24 #ifndef StTriggerData2018_hh
25 #define StTriggerData2018_hh
27 #include "StTriggerData.h"
28 #include "StDaqLib/TRG/trgStructures2018.h"
38 void readData() {readData(0,0);}
44 unsigned int version()
const;
45 unsigned int numberOfPreXing()
const;
46 unsigned int numberOfPostXing()
const;
49 unsigned int eventNumber()
const;
50 unsigned int token()
const;
51 unsigned int triggerWord()
const;
52 unsigned int actionWord()
const;
53 unsigned short busyStatus()
const;
54 unsigned short dsmInput()
const;
55 unsigned short trgToken()
const;
56 unsigned short dsmAddress()
const;
57 unsigned short mAddBits()
const;
58 unsigned short bcData(
int channel)
const;
60 unsigned short getTrgDetMask()
const;
61 unsigned int getTrgCrateMask()
const;
64 int L2ResultsOffset(StL2AlgorithmId
id)
const;
65 bool isL2Triggered(StL2TriggerResultType
id)
const;
66 unsigned long long l2sum()
const;
69 unsigned int tcuCounter()
const;
70 unsigned int rccCounter(
int crate)
const;
71 unsigned long long bunchCounter()
const;
72 unsigned int bunchCounterHigh()
const;
73 unsigned int bunchCounterLow()
const;
74 unsigned int bunchId48Bit()
const;
75 unsigned int bunchId7Bit()
const;
76 unsigned int spinBit()
const;
77 unsigned int spinBitYellowFilled()
const;
78 unsigned int spinBitYellowUp()
const;
79 unsigned int spinBitYellowDown()
const;
80 unsigned int spinBitYellowUnpol()
const;
81 unsigned int spinBitBlueFilled()
const;
82 unsigned int spinBitBlueUp()
const;
83 unsigned int spinBitBlueDown()
const;
84 unsigned int spinBitBlueUnpol()
const;
87 unsigned short tcuBits()
const;
88 unsigned short lastDSM(
int address)
const;
89 unsigned short vertexDSM(
int channel)
const;
90 unsigned short bemcLayer1DSM(
int channel,
int prepost=0)
const;
91 unsigned short eemcLayer1DSM(
int channel,
int prepost=0)
const;
92 unsigned short emcLayer2DSM(
int channel)
const;
93 unsigned short tpcMaskDSM(
int channel)
const;
94 unsigned short fpdLayer1DSMRaw(StBeamDirection eastwest,
int channel,
int prepost=0)
const;
96 unsigned short fpdLayer2DSMRaw(
int channel)
const;
106 unsigned short bbcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
107 unsigned short bbcTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
108 unsigned short bbcTDC5bit(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
109 unsigned short bbcADCSum(StBeamDirection eastwest,
int prepost=0)
const;
110 unsigned short bbcADCSumLargeTile(StBeamDirection eastwest,
int prepost=0)
const;
111 unsigned short bbcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
112 unsigned short bbcTimeDifference()
const;
113 unsigned short bbcTacSum()
const;
114 unsigned short bbcEarliestTDCLarge(StBeamDirection eastwest,
int prepost=0)
const;
115 unsigned short bbcTimeDifferenceLarge()
const;
116 unsigned short bbcBB101(
int ch,
int prepost=0)
const;
117 unsigned short bbcBB102(
int ch,
int prepost=0)
const;
120 unsigned short fpd(StBeamDirection eastwest,
int module,
int pmt,
int prepost=0)
const;
121 unsigned short fpdSum(StBeamDirection eastwest,
int module)
const;
124 unsigned short nQTdata(
int prepost=0)
const;
125 unsigned int* QTdata(
int prepost=0)
const;
126 unsigned short fmsADC(
int crt,
int adr,
int ch,
int prepost=0)
const;
127 unsigned short fmsTDC(
int crt,
int adr,
int ch,
int prepost=0)
const;
130 unsigned short epdTimeDifference()
const;
131 bool epdHitLayer2(StBeamDirection eastwest)
const;
132 unsigned short epdLayer0t(
int ch,
int prepost=0)
const;
133 unsigned short epdLayer1(
int ch,
int prepost=0)
const;
134 unsigned short epdLayer0a(
int ch,
int prepost=0)
const;
135 unsigned short epdADC(
int crt,
int adr,
int ch,
int prepost=0)
const;
136 unsigned short epdTDC(
int crt,
int adr,
int ch,
int prepost=0)
const;
137 unsigned short epdNHits(StBeamDirection eastwest,
int prepost=0)
const;
140 bool zdcPresent(
int prepost=0)
const;
141 unsigned short zdcAtChannel(
int channel,
int prepost=0)
const;
142 unsigned short zdcAtAddress(
int address,
int prepost=0)
const;
143 unsigned short zdcUnAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
144 unsigned short zdcAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
145 unsigned short zdcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
146 unsigned short zdcTDC(StBeamDirection eastwest,
int prepost=0)
const;
147 unsigned short zdcPmtTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
148 unsigned short zdcHardwareSum(
int prepost=0)
const;
150 unsigned short zdcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
151 bool zdcSumADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
152 bool zdcFrontADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
153 bool zdcBackADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
154 unsigned short zdcTruncatedSum(StBeamDirection eastwest,
int prepost=0)
const;
156 bool zdcSumADCaboveThresholdL2(StBeamDirection eastwest)
const;
157 bool zdcFrontADCaboveThresholdL2(StBeamDirection eastwest)
const;
158 bool zdcBackADCaboveThresholdL2(StBeamDirection eastwest)
const;
159 unsigned short zdcTimeDifference()
const;
161 bool zdcSumADCaboveThresholdL3(StBeamDirection eastwest)
const;
162 bool zdcFrontADCaboveThresholdL3(StBeamDirection eastwest)
const;
163 bool zdcBackADCaboveThresholdL3(StBeamDirection eastwest)
const;
164 bool zdcTimeDifferenceInWindow()
const;
167 bool zdcSMDPresent(
int prepost=0)
const;
168 unsigned short zdcSMD(StBeamDirection eastwest,
int verthori,
int strip,
int prepost=0)
const;
169 unsigned short zdcSMDHighestStrip(StBeamDirection eastwest,
int verthori,
int prepost=0)
const;
172 unsigned char bemcHighTower(
int patch_id,
int prepost=0)
const;
173 unsigned char bemcJetPatch (
int patch_id,
int prepost=0)
const;
174 unsigned char eemcHighTower(
int patch_id,
int prepost=0)
const;
175 unsigned char eemcJetPatch (
int patch_id,
int prepost=0)
const;
176 unsigned char bemcHighestTowerADC(
int prepost=0)
const;
177 unsigned char eemcHighestTowerADC(
int prepost=0)
const;
180 unsigned short vpdADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
181 unsigned short vpdTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
182 unsigned short vpdADCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
183 unsigned short vpdTDCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
184 unsigned short vpdEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
185 unsigned short vpdEarliestTDCHighThr(StBeamDirection eastwest,
int prepost=0)
const;
186 float vpdMeanTimeDifference(
int prepost=0)
const;
187 unsigned short vpdADCSum(StBeamDirection eastwest,
int prepost=0)
const;
188 unsigned short bbcVP101(
int ch,
int prepost = 0)
const;
191 unsigned short mxqAtSlotAddress(
int address,
int prepost=0,
int slot=0)
const;
194 unsigned short mtdQtAtCh(
int qtid,
int address,
int prepost)
const;
195 unsigned short mtdAtAddress(
int address,
int prepost=0)
const;
196 unsigned short mtdgemAtAddress(
int address,
int prepost=0)
const;
197 unsigned short mtd3AtAddress(
int address,
int prepost=0)
const;
198 unsigned short mtdAdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
199 unsigned short mtdTdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
200 unsigned char mtdDsmAtCh(
int ch,
int prepost=0)
const;
201 bool mtdDsmHit(
int pmt,
int prepost=0)
const;
202 unsigned short mtdVpdTacDiff()
const;
203 unsigned short mtd4AtAddress(
int address,
int prepost=0)
const;
206 unsigned short tofAtAddress(
int address,
int prepost=0)
const;
207 unsigned short tofTrayMultiplicity(
int tray,
int prepost=0)
const;
208 unsigned short tofMultiplicity(
int prepost=0)
const;
209 unsigned short dsmTF201Ch(
int ch)
const;
212 unsigned short pp2ppADC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
213 unsigned short pp2ppTAC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
214 unsigned long pp2ppDSM(
int prepost=0)
const;
217 char* getTriggerStructure();
219 int getRawSize()
const;
221 unsigned char* getDsm0_BEMCE(
int prepost=0)
const;
222 unsigned char* getDsm0_BEMCW(
int prepost=0)
const;
223 unsigned short* getDsm1_BEMC(
int prepost=0)
const;
224 unsigned char* getDsm0_EEMC(
int prepost=0)
const;
225 unsigned short* getDsm1_EEMC(
int prepost=0)
const;
226 unsigned short* getDsm2_EMC()
const;
228 unsigned short* getDsm3()
const;
229 unsigned char* getDsm_FMS(
int prepost=0)
const;
232 unsigned short* getDsm1_FMS(
int prepost=0)
const;
233 unsigned short* getDsm2_FMS()
const;
234 unsigned int l2ResultLength()
const;
235 const unsigned int* l2Result()
const;
261 unsigned short mxq[11][16][32],eq3[11][16][32],bbq[11][16][32],qt1[11][16][32],qt2[11][16][32],qt3[11][16][32],qt4[11][16][32],
262 eq1[11][16][32],eq2[11][16][32];
263 unsigned char tmxq[11][16][32],teq3[11][16][32],tbbq[11][16][32],tqt1[11][16][32],tqt2[11][16][32],tqt3[11][16][32],tqt4[11][16][32],
264 teq1[11][16][32],teq2[11][16][32];
273 void swapRawDet(
DataBlock2018* data,
int name,
int hlength,
int bs);
280 swapI((
unsigned int*)&offlen->offset);
281 swapI((
unsigned int*)&offlen->length);
286 swapI((
unsigned int*)&TrgData->FormatVersion);
287 swapI((
unsigned int*)&TrgData->totalTriggerLength);
288 swapI((
unsigned int*)&TrgData->eventNumber);
289 swapOfflen(&TrgData->EventDesc_ofl);
290 swapOfflen(&TrgData->L1_DSM_ofl);
291 swapOfflen(&TrgData->Summary_ofl);
292 swapIn((
unsigned int*)TrgData->PrePostList,10);
297 swapIn((
unsigned int*)&EvtDesc->length,3);
298 swapSCC((
unsigned int*)&EvtDesc->actionWdDetectorBitMask);
299 swapSSn((
unsigned int*)&EvtDesc->TrgToken,12);
304 swapI((
unsigned int*)&L1_DSM->length);
305 swapSSn((
unsigned int*)L1_DSM->TOF,16+8*7);
310 swapIn((
unsigned int*)&TrgSum->length,1+2+2+32+64+64);
313 inline void StTriggerData2018::swapRawDetOfflen(
TrgOfflen2018* offlen)
316 for (i=0; i<y18MAX_OFFLEN; i++) {
317 swapOfflen(&offlen[i]);
318 if (mDebug>0) printf(
"Offlen id=%2d offset=%d length=%d\n", i, offlen[i].offset, offlen[i].length);