24 #ifndef StTriggerData2012_hh
25 #define StTriggerData2012_hh
27 #include "StTriggerData.h"
28 #include "StDaqLib/TRG/trgStructures2012.h"
38 void readData() {readData(0,0);}
43 unsigned int version()
const;
44 unsigned int numberOfPreXing()
const;
45 unsigned int numberOfPostXing()
const;
48 unsigned int eventNumber()
const;
49 unsigned int token()
const;
50 unsigned int triggerWord()
const;
51 unsigned int actionWord()
const;
52 unsigned short busyStatus()
const;
53 unsigned short dsmInput()
const;
54 unsigned short trgToken()
const;
55 unsigned short dsmAddress()
const;
56 unsigned short mAddBits()
const;
57 unsigned short bcData(
int channel)
const;
60 int L2ResultsOffset(StL2AlgorithmId
id)
const;
61 bool isL2Triggered(StL2TriggerResultType
id)
const;
62 unsigned long long l2sum()
const;
65 unsigned int bunchCounterHigh()
const;
66 unsigned int bunchCounterLow()
const;
67 unsigned int bunchId48Bit()
const;
68 unsigned int bunchId7Bit()
const;
69 unsigned int spinBit()
const;
70 unsigned int spinBitYellowFilled()
const;
71 unsigned int spinBitYellowUp()
const;
72 unsigned int spinBitYellowDown()
const;
73 unsigned int spinBitYellowUnpol()
const;
74 unsigned int spinBitBlueFilled()
const;
75 unsigned int spinBitBlueUp()
const;
76 unsigned int spinBitBlueDown()
const;
77 unsigned int spinBitBlueUnpol()
const;
80 unsigned short tcuBits()
const;
81 unsigned short lastDSM(
int address)
const;
82 unsigned short bemcLayer1DSM(
int channel,
int prepost=0)
const;
83 unsigned short eemcLayer1DSM(
int channel,
int prepost=0)
const;
84 unsigned short emcLayer2DSM(
int channel)
const;
85 unsigned short tpcMaskDSM(
int channel)
const;
86 unsigned short fpdLayer1DSMRaw(StBeamDirection eastwest,
int channel,
int prepost=0)
const;
88 unsigned short fpdLayer2DSMRaw(
int channel)
const;
98 unsigned short bbcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
99 unsigned short bbcTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
100 unsigned short bbcADCSum(StBeamDirection eastwest,
int prepost=0)
const;
101 unsigned short bbcADCSumLargeTile(StBeamDirection eastwest,
int prepost=0)
const;
102 unsigned short bbcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
103 unsigned short bbcTimeDifference()
const;
104 unsigned short bbcEarliestTDCLarge(StBeamDirection eastwest,
int prepost=0)
const;
105 unsigned short bbcTimeDifferenceLarge()
const;
108 unsigned short fpd(StBeamDirection eastwest,
int module,
int pmt,
int prepost=0)
const;
109 unsigned short fpdSum(StBeamDirection eastwest,
int module)
const;
112 unsigned short nQTdata(
int prepost=0)
const;
113 unsigned int* QTdata(
int prepost=0)
const;
114 unsigned short fmsADC(
int crt,
int adr,
int ch,
int prepost=0)
const;
115 unsigned short fmsTDC(
int crt,
int adr,
int ch,
int prepost=0)
const;
118 bool zdcPresent(
int prepost=0)
const;
119 unsigned short zdcAtChannel(
int channel,
int prepost=0)
const;
120 unsigned short zdcAtAddress(
int address,
int prepost=0)
const;
121 unsigned short zdcUnAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
122 unsigned short zdcAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
123 unsigned short zdcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
124 unsigned short zdcTDC(StBeamDirection eastwest,
int prepost=0)
const;
125 unsigned short zdcPmtTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
126 unsigned short zdcHardwareSum(
int prepost=0)
const;
128 unsigned short zdcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
129 bool zdcSumADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
130 bool zdcFrontADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
131 bool zdcBackADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
132 unsigned short zdcTruncatedSum(StBeamDirection eastwest,
int prepost=0)
const;
134 bool zdcSumADCaboveThresholdL2(StBeamDirection eastwest)
const;
135 bool zdcFrontADCaboveThresholdL2(StBeamDirection eastwest)
const;
136 bool zdcBackADCaboveThresholdL2(StBeamDirection eastwest)
const;
137 unsigned short zdcTimeDifference()
const;
139 bool zdcSumADCaboveThresholdL3(StBeamDirection eastwest)
const;
140 bool zdcFrontADCaboveThresholdL3(StBeamDirection eastwest)
const;
141 bool zdcBackADCaboveThresholdL3(StBeamDirection eastwest)
const;
142 bool zdcTimeDifferenceInWindow()
const;
145 bool zdcSMDPresent(
int prepost=0)
const;
146 unsigned short zdcSMD(StBeamDirection eastwest,
int verthori,
int strip,
int prepost=0)
const;
147 unsigned short zdcSMDHighestStrip(StBeamDirection eastwest,
int verthori,
int prepost=0)
const;
150 unsigned char bemcHighTower(
int patch_id,
int prepost=0)
const;
151 unsigned char bemcJetPatch (
int patch_id,
int prepost=0)
const;
152 unsigned char eemcHighTower(
int patch_id,
int prepost=0)
const;
153 unsigned char eemcJetPatch (
int patch_id,
int prepost=0)
const;
154 unsigned char bemcHighestTowerADC(
int prepost=0)
const;
155 unsigned char eemcHighestTowerADC(
int prepost=0)
const;
158 unsigned short vpdADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
159 unsigned short vpdTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
160 unsigned short vpdADCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
161 unsigned short vpdTDCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
162 unsigned short vpdEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
163 unsigned short vpdEarliestTDCHighThr(StBeamDirection eastwest,
int prepost=0)
const;
164 unsigned short vpdTimeDifference()
const;
167 unsigned short mtdAtAddress(
int address,
int prepost=0)
const;
168 unsigned short mtdAdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
169 unsigned short mtdTdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
170 unsigned char mtdDsmAtCh(
int ch,
int prepost=0)
const;
171 bool mtdDsmHit(
int pmt,
int prepost=0)
const;
172 unsigned short mtdgemAtAddress(
int address,
int prepost=0)
const;
173 unsigned short mtdVpdTacDiff()
const;
176 unsigned short tofAtAddress(
int address,
int prepost=0)
const;
177 unsigned short tofTrayMultiplicity(
int tray,
int prepost=0)
const;
178 unsigned short tofMultiplicity(
int prepost=0)
const;
181 unsigned short pp2ppADC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
182 unsigned short pp2ppTAC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
183 unsigned long pp2ppDSM(
int prepost=0)
const;
186 char* getTriggerStructure();
188 int getRawSize()
const;
190 unsigned char* getDsm0_BEMCE(
int prepost=0)
const;
191 unsigned char* getDsm0_BEMCW(
int prepost=0)
const;
192 unsigned short* getDsm1_BEMC(
int prepost=0)
const;
193 unsigned char* getDsm0_EEMC(
int prepost=0)
const;
194 unsigned short* getDsm1_EEMC(
int prepost=0)
const;
195 unsigned short* getDsm2_EMC()
const;
197 unsigned short* getDsm3()
const;
198 unsigned char* getDsm_FMS(
int prepost=0)
const;
201 unsigned short* getDsm1_FMS(
int prepost=0)
const;
202 unsigned short* getDsm2_FMS()
const;
203 unsigned int l2ResultLength()
const;
204 const unsigned int* l2Result()
const;
228 unsigned short mxq[11][16][32],feq[11][16][32],bbq[11][16][32],qt1[11][16][32],qt2[11][16][32],qt3[11][16][32],qt4[11][16][32];
229 unsigned char tmxq[11][16][32],tfeq[11][16][32],tbbq[11][16][32],tqt1[11][16][32],tqt2[11][16][32],tqt3[11][16][32],tqt4[11][16][32];
237 void swapRawDet(
DataBlock2012* data,
int name,
int hlength,
int bs);
244 swapI((
unsigned int*)&offlen->offset);
245 swapI((
unsigned int*)&offlen->length);
250 swapI((
unsigned int*)&TrgData->FormatVersion);
251 swapI((
unsigned int*)&TrgData->totalTriggerLength);
252 swapI((
unsigned int*)&TrgData->eventNumber);
253 swapOfflen(&TrgData->EventDesc_ofl);
254 swapOfflen(&TrgData->L1_DSM_ofl);
255 swapOfflen(&TrgData->Summary_ofl);
256 swapIn((
unsigned int*)TrgData->PrePostList,10);
261 swapIn((
unsigned int*)&EvtDesc->length,3);
262 swapSCC((
unsigned int*)&EvtDesc->actionWdDetectorBitMask);
263 swapSSn((
unsigned int*)&EvtDesc->TrgToken,12);
268 swapI((
unsigned int*)&L1_DSM->length);
269 swapSSn((
unsigned int*)L1_DSM->TOF,16+8*7);
274 swapIn((
unsigned int*)&TrgSum->length,1+2+2+32+64+64);
277 inline void StTriggerData2012::swapRawDetOfflen(
TrgOfflen2012* offlen)
280 for (i=0; i<y12MAX_OFFLEN; i++) {
281 swapOfflen(&offlen[i]);
282 if (mDebug>0) printf(
"Offlen id=%2d offset=%d length=%d\n", i, offlen[i].offset, offlen[i].length);