00001
00002
00003
00004
00005
00006
00007
00009
00010 #ifndef NTPSRSTRIP_H
00011 #define NTPSRSTRIP_H
00012
00013 #include <iosfwd>
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
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
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
00044
00045
00046
00047 Int_t index;
00048 Char_t planeview;
00049 UShort_t ndigit;
00050 UShort_t demuxveto;
00051 UShort_t strip;
00052 UShort_t plane;
00053 Float_t tpos;
00054 Float_t z;
00055 Int_t pmtindex0;
00056 Int_t pmtindex1;
00057 Double_t time0;
00058 Double_t time1;
00059 NtpSRPulseHeight ph0;
00060 NtpSRPulseHeight ph1;
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