00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef StFmsTriggerDetector_hh
00035 #define StFmsTriggerDetector_hh
00036 #include "StObject.h"
00037
00038 class StTriggerData;
00039
00040 class StFmsTriggerDetector : public StObject {
00041 public:
00042 StFmsTriggerDetector();
00043 StFmsTriggerDetector(const StTriggerData&);
00044 virtual ~StFmsTriggerDetector();
00045
00046
00047
00048 void clearFlag();
00049
00050 unsigned int nHit() const;
00051 unsigned int hit(int line) const;
00052 unsigned short adc(int crate, int addr, int dcard, int dch);
00053 unsigned short tdc(int crate, int addr, int dcard, int dch);
00054
00055 unsigned char DSM(int ch) const {return mDSM[ch];}
00056 unsigned char DSM01(int ch) const {return mDSM01[ch];}
00057 unsigned char DSM02(int ch) const {return mDSM02[ch];}
00058 unsigned short DSM1(int ch) const {return mDSM1[ch];}
00059 unsigned short DSM2(int ch) const {return mDSM2[ch];}
00060
00061 void dump();
00062
00063 protected:
00064 void decode();
00065 unsigned short getNHT(int) const;
00066 unsigned short getADR(int) const;
00067 unsigned short getCRT(int) const;
00068 unsigned short getADC(int) const;
00069 unsigned short getTDC(int) const;
00070 unsigned short getQT8(int) const;
00071 unsigned short getCHA(int) const;
00072
00073 protected:
00074 enum {
00075 mMaxLine = 1600,
00076 mMaxDSM = 256,
00077 mMaxDSM01 = 112,
00078 mMaxDSM02 = 16,
00079 mMaxDSM1 = 16,
00080 mMaxDSM2 = 8,
00081 mMaxCrate = 4,
00082 mMaxAddr = 16,
00083 mMaxDCard = 4,
00084 mMaxChan = 8,
00085 mOffsetCrate = 11,
00086 mOffsetAddr = 16
00087 };
00088
00089 char mBeg[1];
00090 UInt_t mNumQTdata;
00091 UInt_t mQTdata[mMaxLine];
00092 Char_t mDSM[mMaxDSM];
00093 Char_t mDSM01[mMaxDSM01];
00094 Char_t mDSM02[mMaxDSM02];
00095 UShort_t mDSM1[mMaxDSM1];
00096 UShort_t mDSM2[mMaxDSM2];
00097
00098 int mNumHeader;
00099 unsigned short mADC[mMaxCrate][mMaxAddr][mMaxDCard][mMaxChan];
00100 unsigned short mTDC[mMaxCrate][mMaxAddr][mMaxDCard][mMaxChan];
00101 char mEnd[1];
00102
00103 ClassDef(StFmsTriggerDetector,4)
00104 };
00105
00106 inline unsigned int StFmsTriggerDetector::nHit() const {return mNumQTdata;}
00107 inline unsigned short StFmsTriggerDetector::getNHT(int v) const {return (unsigned short) (v & 0x000000FF); }
00108 inline unsigned short StFmsTriggerDetector::getADR(int v) const {return (unsigned short) ((v & 0x001F0000) >> 16);}
00109 inline unsigned short StFmsTriggerDetector::getCRT(int v) const {return (unsigned short) ((v & 0xFF000000) >> 24);}
00110 inline unsigned short StFmsTriggerDetector::getADC(int v) const {return (unsigned short) (v & 0x00000FFF);}
00111 inline unsigned short StFmsTriggerDetector::getTDC(int v) const {return (unsigned short) ((v & 0x001F0000) >> 16);}
00112 inline unsigned short StFmsTriggerDetector::getQT8(int v) const {return (unsigned short) ((v & 0x18000000) >> 27);}
00113 inline unsigned short StFmsTriggerDetector::getCHA(int v) const {return (unsigned short) ((v & 0xE0000000) >> 29);}
00114
00115 #endif