StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTriggerData2007.h
1  /***************************************************************************
2  *
3  * $Id: StTriggerData2007.h,v 2.6 2009/03/19 02:46:01 ullrich Exp $
4  *
5  * Author: Akio Ogawa, Feb 2007
6  ***************************************************************************
7  *
8  * Description: Concrete implementation of StTriggerData for 2007.
9  *
10  ***************************************************************************
11  *
12  * $Log: StTriggerData2007.h,v $
13  * Revision 2.6 2009/03/19 02:46:01 ullrich
14  * Add 2nd argument (pre/post) to vpdEarliestTDC().
15  *
16  * Revision 2.5 2009/02/11 23:33:55 jeromel
17  * Modifications by Akio to support getDsm0_BEMCE and getDsm0_BEMCW as well as
18  * getDsm1_BEMC. However, use of const=0 impose implementation (was not done
19  * in years < 2009). Added methods with return 0.
20  *
21  * Revision 2.4 2007/07/02 17:04:32 ullrich
22  * Add two new members mtdAdc() and mtdTdc() (Akio).
23  *
24  * Revision 2.3 2007/04/24 14:51:59 ullrich
25  * Fixed bug in VPD unpacking (Akio).
26  *
27  * Revision 2.2 2007/04/03 20:10:50 ullrich
28  * Added access function for VPD data.
29  *
30  * Revision 2.1 2007/02/22 20:31:24 ullrich
31  * Initial Revision.
32  *
33  **************************************************************************/
34 #ifndef StTriggerData2007_hh
35 #define StTriggerData2007_hh
36 
37 #include "StTriggerData.h"
38 
39 struct TrgDataType2007;
40 
42 public:
44  StTriggerData2007(const TrgDataType2007*, int run);
46 
47  void dump() const; //dump data into text
48 
49  // versison and data type information
50  unsigned int version() const;
51  unsigned int numberOfPreXing() const;
52  unsigned int numberOfPostXing() const;
53 
54  // generic Trigger infomations
55  unsigned int token() const;
56  unsigned int triggerWord() const;
57  unsigned int actionWord() const;
58  unsigned short busyStatus() const;
59  unsigned short dsmInput() const;
60  unsigned short trgToken() const;
61  unsigned short dsmAddress() const;
62  unsigned short mAddBits() const;
63  unsigned short bcData(int channel) const;
64 
65  //L2 offsets
66  int L2ResultsOffset(StL2AlgorithmId id) const;
67  bool isL2Triggered(StL2TriggerResultType id) const;
68 
69  // bunch and spin bits
70  unsigned int bunchCounterHigh() const;
71  unsigned int bunchCounterLow() const;
72  unsigned int bunchId48Bit() const;
73  unsigned int bunchId7Bit() const;
74  unsigned int spinBit() const;
75  unsigned int spinBitYellowFilled() const;
76  unsigned int spinBitYellowUp() const;
77  unsigned int spinBitYellowDown() const;
78  unsigned int spinBitYellowUnpol() const;
79  unsigned int spinBitBlueFilled() const;
80  unsigned int spinBitBlueUp() const;
81  unsigned int spinBitBlueDown() const;
82  unsigned int spinBitBlueUnpol() const;
83 
84  // High Level Trigger info
85  unsigned short tcuBits() const;
86  unsigned short lastDSM(int address) const;
87  unsigned short bemcLayer1DSM(int channel, int prepost=0) const;
88  unsigned short eemcLayer1DSM(int channel, int prepost=0) const;
89  unsigned short emcLayer2DSM(int channel) const;
90  unsigned short fpdLayer1DSMRaw(StBeamDirection eastwest, int channel, int prepost=0) const;
91  unsigned short fpdLayer1DSM(StBeamDirection eastwest, int module, int board, int prepost=0) const;
92  unsigned short fpdLayer2DSMRaw(int channel) const;
93  unsigned short fpdLayer2DSM(StBeamDirection eastwest, int module) const;
94 
95  // CTB
96  unsigned short ctbRaw(int address, int prepost=0) const;
97  unsigned short ctb(int pmt, int prepost=0) const;
98  unsigned short ctbTraySlat(int tray, int slat, int prepost=0) const;
99  unsigned short ctbSum(int prepost=0) const;
100 
101  // BBC
102  unsigned short bbcADC(StBeamDirection eastwest, int pmt, int prepost=0) const;
103  unsigned short bbcTDC(StBeamDirection eastwest, int pmt, int prepost=0) const;
104  unsigned short bbcADCSum(StBeamDirection eastwest, int prepost=0) const;
105  unsigned short bbcADCSumLargeTile(StBeamDirection eastwest, int prepost=0) const;
106  unsigned short bbcEarliestTDC(StBeamDirection eastwest, int prepost=0) const;
107  unsigned short bbcTimeDifference() const;
108 
109  // FPD
110  unsigned short fpd(StBeamDirection eastwest, int module, int pmt, int prepost=0) const;
111  unsigned short fpdSum(StBeamDirection eastwest, int module) const;
112 
113  // FMS
114  unsigned short nQTdata(int prepost=0) const;
115  unsigned int* QTdata(int prepost=0) const;
116 
117  //ZDC
118  unsigned short zdcAtChannel(int channel, int prepost=0) const;
119  unsigned short zdcAtAddress(int address, int prepost=0) const;
120  unsigned short zdcUnAttenuated(StBeamDirection eastwest, int prepost=0) const;
121  unsigned short zdcAttenuated(StBeamDirection eastwest, int prepost=0) const;
122  unsigned short zdcADC(StBeamDirection eastwest, int pmt, int prepost=0) const;
123  unsigned short zdcTDC(StBeamDirection eastwest, int prepost=0) const;
124  unsigned short zdcHardwareSum(int prepost=0) const;
125 
126  //ZDCSMD
127  unsigned short zdcSMD(StBeamDirection eastwest, int verthori, int strip, int prepost=0) const;
128 
129  // EMC
130  unsigned char bemcHighTower(int patch_id, int prepost=0) const;
131  unsigned char bemcJetPatch (int patch_id, int prepost=0) const;
132  unsigned char eemcHighTower(int patch_id, int prepost=0) const;
133  unsigned char eemcJetPatch (int patch_id, int prepost=0) const;
134  unsigned char bemcHighestTowerADC(int prepost=0) const;
135  unsigned char eemcHighestTowerADC(int prepost=0) const;
136 
137  // VPD
138  unsigned short vpdADC(StBeamDirection eastwest, int pmt, int prepost=0) const;
139  unsigned short vpdTDC(StBeamDirection eastwest, int pmt, int prepost=0) const;
140  unsigned short vpdEarliestTDC(StBeamDirection eastwest, int prepost=0) const;
141  unsigned short vpdTimeDifference() const;
142 
143  //MTD
144  unsigned short mtdAtAddress(int address, int prepost=0) const;
145  unsigned short mtdAdc(StBeamDirection eastwest, int pmt, int prepost=0) const;
146  unsigned short mtdTdc(StBeamDirection eastwest, int pmt, int prepost=0) const;
147 
148  // experts only
149  char* getTriggerStructure();
150  TrgDataType2007* getTriggerStructure2007();
151  int getRawSize() const;
152 
153  unsigned char* getDsm0_BEMCE(int prepost=0) const { return 0;}
154  unsigned char* getDsm0_BEMCW(int prepost=0) const { return 0;}
155  unsigned char* getDsm0_EEMC(int prepost=0) const;
156  unsigned short* getDsm1_BEMC(int prepost=0) const { return 0;}
157 
158  unsigned short* getDsm1_EEMC(int prepost=0) const;
159  unsigned short* getDsm2_EMC() const;
160  unsigned short* getDsm3() const;
161  unsigned char* getDsm_FMS(int prepost=0) const;
162  unsigned char* getDsm01_FMS(int prepost=0) const;
163  unsigned char* getDsm02_FMS(int prepost=0) const;
164  unsigned short* getDsm1_FMS(int prepost=0) const;
165  unsigned short* getDsm2_FMS() const;
166  unsigned int l2ResultLength() const;
167  const unsigned int* l2Result() const;
168 
169 protected:
170  TrgDataType2007 *mData;
171 
172  ClassDef(StTriggerData2007,1)
173 };
174 
175 #endif