Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

NtpSRStrip.h

Go to the documentation of this file.
00001 
00002 //
00003 // NtpSRStrip
00004 //
00005 // NtpSRStrip is an ntuple class to hold strip data
00006 //
00007 // Based on Roy Lee's CandEventSR/StripSRTTree class
00009 
00010 #ifndef NTPSRSTRIP_H
00011 #define NTPSRSTRIP_H
00012 
00013 #include <iosfwd> // ostream fwd decl'
00014 #include "Plex/PlexStripEndId.h"
00015 #include "CandNtupleSR/NtpSRPulseHeight.h"
00016 
00017 class NtpSRStrip;
00018 std::ostream& operator << (std::ostream& os, const NtpSRStrip& stp);
00019 
00020 class NtpSRStrip : public TObject {
00021 
00022  public:
00023   NtpSRStrip() : index(0), planeview(0), ndigit(0), demuxveto(0), strip(0), 
00024     plane(0), tpos(0), z(0), pmtindex0(-1), pmtindex1(-1), time0(-999999),
00025     time1(-999999) {}
00026   virtual ~NtpSRStrip() {}
00027 
00028   // State testing methods
00029   virtual std::ostream& Print(std::ostream& os) const;
00030   virtual void Print(Option_t* option = "") const; 
00031   PlexStripEndId GetStripEndId(Detector::Detector_t detector) const;
00032   
00033   // State changing methods
00034   void SetPmtIndex(Int_t pmtindex, UShort_t iend);
00035   void SetTime(Double_t time, UShort_t iend);
00036   void SetPh(const NtpSRPulseHeight& ph, UShort_t iend);
00037 
00038  private:
00039   void UnpackVAChannelId(Int_t pmtindex, Int_t& crate, Int_t& varcId,
00040                          Int_t& vmm, Int_t& vaADCSel, Int_t& vaChip) const;
00041   
00042  public:
00043   // Ntuple is treated like a C-struct with public data members and
00044   // rule-breaking field data members not prefaced by "f" and all
00045   // lowercase, by popular demand.
00046 
00047   Int_t index;            // index of this strip in strip array 
00048   Char_t planeview;       // planeview (ala PlaneView::EPlaneView)
00049   UShort_t ndigit;        // number of digits on strip
00050   UShort_t demuxveto;     // demux veto flag
00051   UShort_t strip;         // strip number
00052   UShort_t plane;         // plane number
00053   Float_t tpos;           // transverse position (m)
00054   Float_t z;              // z position (m)
00055   Int_t pmtindex0;        // crate*108+varcId*36+vmm*6+vaAdcSel*3+vaChip (east)
00056   Int_t pmtindex1;        // crate*108+varcId*36+vmm*6+vaAdcSel*3+vaChip (west)
00057   Double_t time0;         // charge weighted mean (sec) (east)
00058   Double_t time1;         // charge weighted mean (sec) (west)
00059   NtpSRPulseHeight ph0;   // digit pulse height (east)
00060   NtpSRPulseHeight ph1;   // digit pulse height (west)
00061 
00062   ClassDef(NtpSRStrip,2)
00063 };
00064 
00065 inline void NtpSRStrip::SetPmtIndex(Int_t pmtindex, UShort_t iend) {
00066     if      (iend == 0) pmtindex0 = pmtindex; 
00067     else if (iend == 1) pmtindex1 = pmtindex; 
00068     return; 
00069 }  
00070 inline void NtpSRStrip::SetTime(Double_t time, UShort_t iend) {
00071     if      (iend == 0) time0 = time; 
00072     else if (iend == 1) time1 = time; 
00073     return; 
00074 }  
00075 inline void NtpSRStrip::SetPh(const NtpSRPulseHeight& ph, UShort_t iend) {
00076     if      (iend == 0) ph0 = ph; 
00077     else if (iend == 1) ph1 = ph; 
00078     return; 
00079 }  
00080 
00081 #endif // NTPSRSTRIP_H

Generated on Mon Feb 15 11:07:07 2010 for loon by  doxygen 1.3.9.1