21 #ifndef StTriggerData2022_hh
22 #define StTriggerData2022_hh
24 #include "StTriggerData.h"
25 #include "StDaqLib/TRG/trgStructures2022.h"
35 void readData() {readData(0,0);}
41 unsigned int version()
const;
42 unsigned int numberOfPreXing()
const;
43 unsigned int numberOfPostXing()
const;
46 unsigned int eventNumber()
const;
47 unsigned int token()
const;
48 unsigned int triggerWord()
const;
49 unsigned int actionWord()
const;
50 unsigned int zdcKillerBit()
const;
51 unsigned short busyStatus()
const;
52 unsigned short dsmInput()
const;
53 unsigned short trgToken()
const;
54 unsigned short dsmAddress()
const;
55 unsigned short mAddBits()
const;
56 unsigned short bcData(
int channel)
const;
58 unsigned short getTrgDetMask()
const;
59 unsigned int getTrgCrateMask()
const;
62 int L2ResultsOffset(StL2AlgorithmId
id)
const;
63 bool isL2Triggered(StL2TriggerResultType
id)
const;
64 unsigned long long l2sum()
const;
67 unsigned int tcuCounter()
const;
68 unsigned int rccCounter(
int crate)
const;
69 unsigned long long bunchCounter()
const;
70 unsigned int bunchCounterHigh()
const;
71 unsigned int bunchCounterLow()
const;
72 unsigned int bunchId48Bit()
const;
73 unsigned int bunchId7Bit()
const;
74 unsigned int revTick1()
const;
75 unsigned int revTick2()
const;
76 unsigned int revTick3()
const;
77 unsigned int spinBit()
const;
78 unsigned int spinBitYellowFilled()
const;
79 unsigned int spinBitYellowUp()
const;
80 unsigned int spinBitYellowDown()
const;
81 unsigned int spinBitYellowUnpol()
const;
82 unsigned int spinBitBlueFilled()
const;
83 unsigned int spinBitBlueUp()
const;
84 unsigned int spinBitBlueDown()
const;
85 unsigned int spinBitBlueUnpol()
const;
88 unsigned short tcuBits()
const;
89 unsigned short lastDSM(
int address)
const;
90 unsigned short vertexDSM(
int channel)
const;
91 unsigned short bemcLayer1DSM(
int channel,
int prepost=0)
const;
92 unsigned short eemcLayer1DSM(
int channel,
int prepost=0)
const;
93 unsigned short emcLayer2DSM(
int channel)
const;
94 unsigned short tpcMaskDSM(
int channel)
const;
107 unsigned short bbcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
108 unsigned short bbcTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
109 unsigned short bbcTDC5bit(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
110 unsigned short bbcADCSum(StBeamDirection eastwest,
int prepost=0)
const;
111 unsigned short bbcADCSumLargeTile(StBeamDirection eastwest,
int prepost=0)
const;
112 unsigned short bbcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
113 unsigned short bbcTimeDifference()
const;
114 unsigned short bbcTacSum()
const;
115 unsigned short bbcEarliestTDCLarge(StBeamDirection eastwest,
int prepost=0)
const;
116 unsigned short bbcTimeDifferenceLarge()
const;
117 unsigned short bbcBB101(
int ch,
int prepost=0)
const;
118 unsigned short bbcBB102(
int ch,
int prepost=0)
const;
121 unsigned short fpd(StBeamDirection eastwest,
int module,
int pmt,
int prepost=0)
const;
122 unsigned short fpdSum(StBeamDirection eastwest,
int module)
const;
127 unsigned short fmsADC(
int crt,
int adr,
int ch,
int prepost=0)
const;
128 unsigned short fmsTDC(
int crt,
int adr,
int ch,
int prepost=0)
const;
131 unsigned short epdEarliestTDC(StBeamDirection eastwest,
int prepost)
const;
132 unsigned short epdTimeDifference()
const;
133 bool epdHitLayer2(StBeamDirection eastwest)
const;
134 unsigned short epdLayer1(
int ch,
int prepost=0)
const;
135 unsigned short epdLayer1a(
int ch,
int prepost=0)
const;
137 unsigned short epdLayer0t(
int ch,
int prepost=0)
const;
140 unsigned short epdADC(
int crt,
int adr,
int ch,
int prepost=0)
const;
141 unsigned short epdTDC(
int crt,
int adr,
int ch,
int prepost=0)
const;
142 unsigned short epdNHits(StBeamDirection eastwest,
int prepost=0)
const;
143 unsigned short epdNHitsQT(
int crate,
int qt,
int mult12,
int prepost=0)
const;
144 unsigned short epdLayer0aMult(
int ch,
int prepost=0)
const;
145 unsigned short epdLayer0hMult(
int ch,
int mult12,
int prepost=0)
const;
146 unsigned short epdLayer1bMult(StBeamDirection eastwest,
int ring,
int prepost=0)
const;
147 unsigned short epdMultTotal(
int prepost=0)
const;
148 unsigned short epdMultDiff(
int prepost=0)
const;
151 bool zdcPresent(
int prepost=0)
const;
152 unsigned short zdcAtChannel(
int channel,
int prepost=0)
const;
153 unsigned short zdcAtAddress(
int address,
int prepost=0)
const;
154 unsigned short zdcUnAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
155 unsigned short zdcAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
156 unsigned short zdcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
157 unsigned short zdcTDC(StBeamDirection eastwest,
int prepost=0)
const;
158 unsigned short zdcPmtTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
159 unsigned short zdcHardwareSum(
int prepost=0)
const;
161 unsigned short zdcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
162 bool zdcSumADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
163 bool zdcFrontADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
164 bool zdcBackADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
165 unsigned short zdcTruncatedSum(StBeamDirection eastwest,
int prepost=0)
const;
167 bool zdcSumADCaboveThresholdL2(StBeamDirection eastwest)
const;
168 bool zdcFrontADCaboveThresholdL2(StBeamDirection eastwest)
const;
169 bool zdcBackADCaboveThresholdL2(StBeamDirection eastwest)
const;
170 unsigned short zdcTimeDifference()
const;
172 bool zdcSumADCaboveThresholdL3(StBeamDirection eastwest)
const;
173 bool zdcFrontADCaboveThresholdL3(StBeamDirection eastwest)
const;
174 bool zdcBackADCaboveThresholdL3(StBeamDirection eastwest)
const;
175 bool zdcTimeDifferenceInWindow()
const;
178 bool zdcSMDPresent(
int prepost=0)
const;
179 unsigned short zdcSMD(StBeamDirection eastwest,
int verthori,
int strip,
int prepost=0)
const;
180 unsigned short zdcSMDHighestStrip(StBeamDirection eastwest,
int verthori,
int prepost=0)
const;
183 unsigned char bemcHighTower(
int patch_id,
int prepost=0)
const;
184 unsigned char bemcJetPatch (
int patch_id,
int prepost=0)
const;
185 unsigned char eemcHighTower(
int patch_id,
int prepost=0)
const;
186 unsigned char eemcJetPatch (
int patch_id,
int prepost=0)
const;
187 unsigned char bemcHighestTowerADC(
int prepost=0)
const;
188 unsigned char eemcHighestTowerADC(
int prepost=0)
const;
191 unsigned short vpdADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
192 unsigned short vpdTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
193 unsigned short vpdADCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
194 unsigned short vpdTDCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
195 unsigned short vpdEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
196 unsigned short vpdEarliestTDCHighThr(StBeamDirection eastwest,
int prepost=0)
const;
197 float vpdMeanTimeDifference(
int prepost=0)
const;
198 unsigned short vpdADCSum(StBeamDirection eastwest,
int prepost=0)
const;
199 unsigned short bbcVP101(
int ch,
int prepost = 0)
const;
202 unsigned short mxqAtSlotAddress(
int address,
int prepost=0,
int slot=0)
const;
205 unsigned short mtdQtAtCh(
int qtid,
int address,
int prepost)
const;
206 unsigned short mtdAtAddress(
int address,
int prepost=0)
const;
207 unsigned short mtdgemAtAddress(
int address,
int prepost=0)
const;
208 unsigned short mtd3AtAddress(
int address,
int prepost=0)
const;
209 unsigned short mtdAdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
210 unsigned short mtdTdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
211 unsigned char mtdDsmAtCh(
int ch,
int prepost=0)
const;
212 bool mtdDsmHit(
int pmt,
int prepost=0)
const;
213 unsigned short mtdVpdTacDiff()
const;
214 unsigned short mtd4AtAddress(
int address,
int prepost=0)
const;
217 unsigned short tofAtAddress(
int address,
int prepost=0)
const;
218 unsigned short tofTrayMultiplicity(
int tray,
int prepost=0)
const;
219 unsigned short tofMultiplicity(
int prepost=0)
const;
220 unsigned short dsmTF201Ch(
int ch)
const;
223 unsigned short pp2ppADC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
224 unsigned short pp2ppTAC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
225 unsigned long pp2ppDSM(
int prepost=0)
const;
228 char* getTriggerStructure();
230 int getRawSize()
const;
232 unsigned char* getDsm0_BEMCE(
int prepost=0)
const;
233 unsigned char* getDsm0_BEMCW(
int prepost=0)
const;
234 unsigned short* getDsm1_BEMC(
int prepost=0)
const;
235 unsigned char* getDsm0_EEMC(
int prepost=0)
const;
236 unsigned short* getDsm1_EEMC(
int prepost=0)
const;
237 unsigned short* getDsm2_EMC()
const;
239 unsigned short* getDsm3()
const;
246 unsigned int l2ResultLength()
const;
247 const unsigned int* l2Result()
const;
274 unsigned short mxq[11][16][32],eq3[11][16][32],bbq[11][16][32],
275 eq1[11][16][32],eq2[11][16][32],eq4[11][16][32];
276 unsigned char tmxq[11][16][32],teq3[11][16][32],tbbq[11][16][32],
277 teq1[11][16][32],teq2[11][16][32],teq4[11][16][32];
285 void swapRawDet(
DataBlock2022* data,
int name,
int hlength,
int bs);
292 swapI((
unsigned int*)&offlen->offset);
293 swapI((
unsigned int*)&offlen->length);
298 swapI((
unsigned int*)&TrgData->FormatVersion);
299 swapI((
unsigned int*)&TrgData->totalTriggerLength);
300 swapI((
unsigned int*)&TrgData->eventNumber);
301 swapOfflen(&TrgData->EventDesc_ofl);
302 swapOfflen(&TrgData->L1_DSM_ofl);
303 swapOfflen(&TrgData->Summary_ofl);
304 swapIn((
unsigned int*)TrgData->PrePostList,10);
309 swapIn((
unsigned int*)&EvtDesc->length,3);
310 swapSCC((
unsigned int*)&EvtDesc->actionWdDetectorBitMask);
311 swapSSn((
unsigned int*)&EvtDesc->TrgToken,12);
316 swapI((
unsigned int*)&L1_DSM->length);
317 swapSSn((
unsigned int*)L1_DSM->TOF,16+8*6);
322 swapIn((
unsigned int*)&TrgSum->length,1+2+2+32+64+64);
325 inline void StTriggerData2022::swapRawDetOfflen(
TrgOfflen2022* offlen)
328 for (i=0; i<y22MAX_OFFLEN; i++) {
329 swapOfflen(&offlen[i]);
330 if (mDebug>0) printf(
"Offlen id=%2d offset=%d length=%d\n", i, offlen[i].offset, offlen[i].length);