30 #ifndef StTriggerData2017_hh
31 #define StTriggerData2017_hh
33 #include "StTriggerData.h"
34 #include "StDaqLib/TRG/trgStructures2017.h"
44 void readData() {readData(0,0);}
49 unsigned int version()
const;
50 unsigned int numberOfPreXing()
const;
51 unsigned int numberOfPostXing()
const;
54 unsigned int eventNumber()
const;
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;
65 unsigned short getTrgDetMask()
const;
66 unsigned int getTrgCrateMask()
const;
69 int L2ResultsOffset(StL2AlgorithmId
id)
const;
70 bool isL2Triggered(StL2TriggerResultType
id)
const;
71 unsigned long long l2sum()
const;
74 unsigned int tcuCounter()
const;
75 unsigned int rccCounter(
int crate)
const;
76 unsigned long long bunchCounter()
const;
77 unsigned int bunchCounterHigh()
const;
78 unsigned int bunchCounterLow()
const;
79 unsigned int bunchId48Bit()
const;
80 unsigned int bunchId7Bit()
const;
81 unsigned int spinBit()
const;
82 unsigned int spinBitYellowFilled()
const;
83 unsigned int spinBitYellowUp()
const;
84 unsigned int spinBitYellowDown()
const;
85 unsigned int spinBitYellowUnpol()
const;
86 unsigned int spinBitBlueFilled()
const;
87 unsigned int spinBitBlueUp()
const;
88 unsigned int spinBitBlueDown()
const;
89 unsigned int spinBitBlueUnpol()
const;
92 unsigned short tcuBits()
const;
93 unsigned short lastDSM(
int address)
const;
94 unsigned short bemcLayer1DSM(
int channel,
int prepost=0)
const;
95 unsigned short eemcLayer1DSM(
int channel,
int prepost=0)
const;
96 unsigned short emcLayer2DSM(
int channel)
const;
97 unsigned short tpcMaskDSM(
int channel)
const;
98 unsigned short fpdLayer1DSMRaw(StBeamDirection eastwest,
int channel,
int prepost=0)
const;
100 unsigned short fpdLayer2DSMRaw(
int channel)
const;
110 unsigned short bbcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
111 unsigned short bbcTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
112 unsigned short bbcTDC5bit(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
113 unsigned short bbcADCSum(StBeamDirection eastwest,
int prepost=0)
const;
114 unsigned short bbcADCSumLargeTile(StBeamDirection eastwest,
int prepost=0)
const;
115 unsigned short bbcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
116 unsigned short bbcTimeDifference()
const;
117 unsigned short bbcTacSum()
const;
118 unsigned short bbcEarliestTDCLarge(StBeamDirection eastwest,
int prepost=0)
const;
119 unsigned short bbcTimeDifferenceLarge()
const;
120 unsigned short bbcBB101(
int ch,
int prepost=0)
const;
121 unsigned short bbcBB102(
int ch,
int prepost=0)
const;
124 unsigned short fpd(StBeamDirection eastwest,
int module,
int pmt,
int prepost=0)
const;
125 unsigned short fpdSum(StBeamDirection eastwest,
int module)
const;
128 unsigned short nQTdata(
int prepost=0)
const;
129 unsigned int* QTdata(
int prepost=0)
const;
130 unsigned short fmsADC(
int crt,
int adr,
int ch,
int prepost=0)
const;
131 unsigned short fmsTDC(
int crt,
int adr,
int ch,
int prepost=0)
const;
134 unsigned short epdADC(
int crt,
int adr,
int ch,
int prepost=0)
const;
135 unsigned short epdTDC(
int crt,
int adr,
int ch,
int prepost=0)
const;
138 bool zdcPresent(
int prepost=0)
const;
139 unsigned short zdcAtChannel(
int channel,
int prepost=0)
const;
140 unsigned short zdcAtAddress(
int address,
int prepost=0)
const;
141 unsigned short zdcUnAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
142 unsigned short zdcAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
143 unsigned short zdcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
144 unsigned short zdcTDC(StBeamDirection eastwest,
int prepost=0)
const;
145 unsigned short zdcPmtTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
146 unsigned short zdcHardwareSum(
int prepost=0)
const;
148 unsigned short zdcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
149 bool zdcSumADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
150 bool zdcFrontADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
151 bool zdcBackADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
152 unsigned short zdcTruncatedSum(StBeamDirection eastwest,
int prepost=0)
const;
154 bool zdcSumADCaboveThresholdL2(StBeamDirection eastwest)
const;
155 bool zdcFrontADCaboveThresholdL2(StBeamDirection eastwest)
const;
156 bool zdcBackADCaboveThresholdL2(StBeamDirection eastwest)
const;
157 unsigned short zdcTimeDifference()
const;
159 bool zdcSumADCaboveThresholdL3(StBeamDirection eastwest)
const;
160 bool zdcFrontADCaboveThresholdL3(StBeamDirection eastwest)
const;
161 bool zdcBackADCaboveThresholdL3(StBeamDirection eastwest)
const;
162 bool zdcTimeDifferenceInWindow()
const;
165 bool zdcSMDPresent(
int prepost=0)
const;
166 unsigned short zdcSMD(StBeamDirection eastwest,
int verthori,
int strip,
int prepost=0)
const;
167 unsigned short zdcSMDHighestStrip(StBeamDirection eastwest,
int verthori,
int prepost=0)
const;
170 unsigned char bemcHighTower(
int patch_id,
int prepost=0)
const;
171 unsigned char bemcJetPatch (
int patch_id,
int prepost=0)
const;
172 unsigned char eemcHighTower(
int patch_id,
int prepost=0)
const;
173 unsigned char eemcJetPatch (
int patch_id,
int prepost=0)
const;
174 unsigned char bemcHighestTowerADC(
int prepost=0)
const;
175 unsigned char eemcHighestTowerADC(
int prepost=0)
const;
178 unsigned short vpdADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
179 unsigned short vpdTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
180 unsigned short vpdADCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
181 unsigned short vpdTDCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
182 unsigned short vpdEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
183 unsigned short vpdEarliestTDCHighThr(StBeamDirection eastwest,
int prepost=0)
const;
184 unsigned short vpdTimeDifference()
const;
186 unsigned short bbcVP101(
int ch,
int prepost = 0)
const;
189 unsigned short mxqAtSlotAddress(
int address,
int prepost=0,
int slot=0)
const;
192 unsigned short mtdQtAtCh(
int qtid,
int address,
int prepost)
const;
193 unsigned short mtdAtAddress(
int address,
int prepost=0)
const;
194 unsigned short mtdgemAtAddress(
int address,
int prepost=0)
const;
195 unsigned short mtd3AtAddress(
int address,
int prepost=0)
const;
196 unsigned short mtdAdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
197 unsigned short mtdTdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
198 unsigned char mtdDsmAtCh(
int ch,
int prepost=0)
const;
199 bool mtdDsmHit(
int pmt,
int prepost=0)
const;
200 unsigned short mtdVpdTacDiff()
const;
201 unsigned short mtd4AtAddress(
int address,
int prepost=0)
const;
204 unsigned short tofAtAddress(
int address,
int prepost=0)
const;
205 unsigned short tofTrayMultiplicity(
int tray,
int prepost=0)
const;
206 unsigned short tofMultiplicity(
int prepost=0)
const;
207 unsigned short dsmTF201Ch(
int ch)
const;
210 unsigned short pp2ppADC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
211 unsigned short pp2ppTAC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
212 unsigned long pp2ppDSM(
int prepost=0)
const;
215 char* getTriggerStructure();
217 int getRawSize()
const;
219 unsigned char* getDsm0_BEMCE(
int prepost=0)
const;
220 unsigned char* getDsm0_BEMCW(
int prepost=0)
const;
221 unsigned short* getDsm1_BEMC(
int prepost=0)
const;
222 unsigned char* getDsm0_EEMC(
int prepost=0)
const;
223 unsigned short* getDsm1_EEMC(
int prepost=0)
const;
224 unsigned short* getDsm2_EMC()
const;
226 unsigned short* getDsm3()
const;
227 unsigned char* getDsm_FMS(
int prepost=0)
const;
230 unsigned short* getDsm1_FMS(
int prepost=0)
const;
231 unsigned short* getDsm2_FMS()
const;
232 unsigned int l2ResultLength()
const;
233 const unsigned int* l2Result()
const;
259 unsigned short mxq[11][16][32],epq[11][16][32],bbq[11][16][32],qt1[11][16][32],qt2[11][16][32],qt3[11][16][32],qt4[11][16][32],
260 fq1[11][16][32],fq2[11][16][32];
261 unsigned char tmxq[11][16][32],tepq[11][16][32],tbbq[11][16][32],tqt1[11][16][32],tqt2[11][16][32],tqt3[11][16][32],tqt4[11][16][32],
262 tfq1[11][16][32],tfq2[11][16][32];
271 void swapRawDet(
DataBlock2017* data,
int name,
int hlength,
int bs);
278 swapI((
unsigned int*)&offlen->offset);
279 swapI((
unsigned int*)&offlen->length);
284 swapI((
unsigned int*)&TrgData->FormatVersion);
285 swapI((
unsigned int*)&TrgData->totalTriggerLength);
286 swapI((
unsigned int*)&TrgData->eventNumber);
287 swapOfflen(&TrgData->EventDesc_ofl);
288 swapOfflen(&TrgData->L1_DSM_ofl);
289 swapOfflen(&TrgData->Summary_ofl);
290 swapIn((
unsigned int*)TrgData->PrePostList,10);
295 swapIn((
unsigned int*)&EvtDesc->length,3);
296 swapSCC((
unsigned int*)&EvtDesc->actionWdDetectorBitMask);
297 swapSSn((
unsigned int*)&EvtDesc->TrgToken,12);
302 swapI((
unsigned int*)&L1_DSM->length);
303 swapSSn((
unsigned int*)L1_DSM->TOF,16+8*7);
308 swapIn((
unsigned int*)&TrgSum->length,1+2+2+32+64+64);
311 inline void StTriggerData2017::swapRawDetOfflen(
TrgOfflen2017* offlen)
314 for (i=0; i<y17MAX_OFFLEN; i++) {
315 swapOfflen(&offlen[i]);
316 if (mDebug>0) printf(
"Offlen id=%2d offset=%d length=%d\n", i, offlen[i].offset, offlen[i].length);