StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFmsTriggerDetector.h
1 
5 /***************************************************************************
6  *
7  * $Id: StFmsTriggerDetector.h,v 2.6 2010/01/13 17:51:55 ullrich Exp $
8  *
9  * Author: Akio Ogawa, Apr 2007
10  ***************************************************************************
11  *
12  * Description:
13  *
14  ***************************************************************************
15  *
16  * $Log: StFmsTriggerDetector.h,v $
17  * Revision 2.6 2010/01/13 17:51:55 ullrich
18  * New clearFlag() for mudst reading, Data member mNumHeader gets //!
19  *
20  * Revision 2.4 2009/02/23 22:29:57 ullrich
21  * Fixed problem when running over 2009 data (solution by Pibero)
22  *
23  * Revision 2.3 2007/12/11 18:11:13 ullrich
24  * Fix bugs in QT decoding (Akio).
25  *
26  * Revision 2.2 2007/07/11 23:06:45 perev
27  * Cleanup+fix StXXXTriggerDetector
28  *
29  * Revision 2.1 2007/07/02 20:21:55 ullrich
30  * Initial Revision.
31  *
32  *
33  **************************************************************************/
34 #ifndef StFmsTriggerDetector_hh
35 #define StFmsTriggerDetector_hh
36 #include "StObject.h"
37 
38 class StTriggerData;
39 
41 public:
44  virtual ~StFmsTriggerDetector();
45  // StFmsTriggerDetector(const StFmsTriggerDetector&); use default
46  // StFmsTriggerDetector& operator=(const StFmsTriggerDetector&); use default
47 
48  void clearFlag();
49 
50  unsigned int nHit() const;
51  unsigned int hit(int line) const;
52  unsigned short adc(int crate, int addr, int dcard, int dch);
53  unsigned short tdc(int crate, int addr, int dcard, int dch);
54 
55  unsigned char DSM(int ch) const {return mDSM[ch];}
56  unsigned char DSM01(int ch) const {return mDSM01[ch];}
57  unsigned char DSM02(int ch) const {return mDSM02[ch];}
58  unsigned short DSM1(int ch) const {return mDSM1[ch];}
59  unsigned short DSM2(int ch) const {return mDSM2[ch];}
60 
61  void dump();
62 
63 protected:
64  void decode();
65  unsigned short getNHT(int) const;
66  unsigned short getADR(int) const;
67  unsigned short getCRT(int) const;
68  unsigned short getADC(int) const;
69  unsigned short getTDC(int) const;
70  unsigned short getQT8(int) const;
71  unsigned short getCHA(int) const;
72 
73 protected:
74  enum {
75  mMaxLine = 1600,
76  mMaxDSM = 256,
77  mMaxDSM01 = 112,
78  mMaxDSM02 = 16,
79  mMaxDSM1 = 16,
80  mMaxDSM2 = 8,
81  mMaxCrate = 4,
82  mMaxAddr = 16,
83  mMaxDCard = 4,
84  mMaxChan = 8,
85  mOffsetCrate = 11,
86  mOffsetAddr = 16
87  };
88 
89  char mBeg[1];
90  UInt_t mNumQTdata;
91  UInt_t mQTdata[mMaxLine];
92  Char_t mDSM[mMaxDSM];
93  Char_t mDSM01[mMaxDSM01];
94  Char_t mDSM02[mMaxDSM02];
95  UShort_t mDSM1[mMaxDSM1];
96  UShort_t mDSM2[mMaxDSM2];
97 
98  int mNumHeader;
99  unsigned short mADC[mMaxCrate][mMaxAddr][mMaxDCard][mMaxChan];
100  unsigned short mTDC[mMaxCrate][mMaxAddr][mMaxDCard][mMaxChan];
101  char mEnd[1];
102 
103  ClassDef(StFmsTriggerDetector,4)
104 };
105 
106 inline unsigned int StFmsTriggerDetector::nHit() const {return mNumQTdata;}
107 inline unsigned short StFmsTriggerDetector::getNHT(int v) const {return (unsigned short) (v & 0x000000FF); }
108 inline unsigned short StFmsTriggerDetector::getADR(int v) const {return (unsigned short) ((v & 0x001F0000) >> 16);}
109 inline unsigned short StFmsTriggerDetector::getCRT(int v) const {return (unsigned short) ((v & 0xFF000000) >> 24);}
110 inline unsigned short StFmsTriggerDetector::getADC(int v) const {return (unsigned short) (v & 0x00000FFF);}
111 inline unsigned short StFmsTriggerDetector::getTDC(int v) const {return (unsigned short) ((v & 0x001F0000) >> 16);}
112 inline unsigned short StFmsTriggerDetector::getQT8(int v) const {return (unsigned short) ((v & 0x18000000) >> 27);}
113 inline unsigned short StFmsTriggerDetector::getCHA(int v) const {return (unsigned short) ((v & 0xE0000000) >> 29);}
114 
115 #endif
Definition: DSM.hh:16