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