21 #ifndef StTriggerData2019_hh
22 #define StTriggerData2019_hh
24 #include "StTriggerData.h"
25 #include "StDaqLib/TRG/trgStructures2019.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 short busyStatus()
const;
51 unsigned short dsmInput()
const;
52 unsigned short trgToken()
const;
53 unsigned short dsmAddress()
const;
54 unsigned short mAddBits()
const;
55 unsigned short bcData(
int channel)
const;
57 unsigned short getTrgDetMask()
const;
58 unsigned int getTrgCrateMask()
const;
61 int L2ResultsOffset(StL2AlgorithmId
id)
const;
62 bool isL2Triggered(StL2TriggerResultType
id)
const;
63 unsigned long long l2sum()
const;
66 unsigned int tcuCounter()
const;
67 unsigned int rccCounter(
int crate)
const;
68 unsigned long long bunchCounter()
const;
69 unsigned int bunchCounterHigh()
const;
70 unsigned int bunchCounterLow()
const;
71 unsigned int bunchId48Bit()
const;
72 unsigned int bunchId7Bit()
const;
73 unsigned int revTick1()
const;
74 unsigned int revTick2()
const;
75 unsigned int revTick3()
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 epdEarliestTDC(StBeamDirection eastwest,
int prepost)
const;
131 unsigned short epdTimeDifference()
const;
132 bool epdHitLayer2(StBeamDirection eastwest)
const;
133 unsigned short epdLayer1(
int ch,
int prepost=0)
const;
134 unsigned short epdLayer1a(
int ch,
int prepost=0)
const;
135 unsigned short epdLayer1b(
int ch,
int prepost=0)
const;
136 unsigned short epdLayer0t(
int ch,
int prepost=0)
const;
137 unsigned short epdLayer0a(
int ch,
int prepost=0)
const;
138 unsigned char epdLayer0h(
int ch,
int prepost=0)
const;
139 unsigned short epdADC(
int crt,
int adr,
int ch,
int prepost=0)
const;
140 unsigned short epdTDC(
int crt,
int adr,
int ch,
int prepost=0)
const;
141 unsigned short epdNHits(StBeamDirection eastwest,
int prepost=0)
const;
142 unsigned short epdNHitsQT(
int crate,
int qt,
int mult12,
int prepost=0)
const;
143 unsigned short epdLayer0aMult(
int ch,
int prepost=0)
const;
144 unsigned short epdLayer0hMult(
int ch,
int mult12,
int prepost=0)
const;
145 unsigned short epdLayer1bMult(StBeamDirection eastwest,
int ring,
int prepost=0)
const;
146 unsigned short epdMultTotal(
int prepost=0)
const;
147 unsigned short epdMultDiff(
int prepost=0)
const;
150 bool zdcPresent(
int prepost=0)
const;
151 unsigned short zdcAtChannel(
int channel,
int prepost=0)
const;
152 unsigned short zdcAtAddress(
int address,
int prepost=0)
const;
153 unsigned short zdcUnAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
154 unsigned short zdcAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
155 unsigned short zdcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
156 unsigned short zdcTDC(StBeamDirection eastwest,
int prepost=0)
const;
157 unsigned short zdcPmtTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
158 unsigned short zdcHardwareSum(
int prepost=0)
const;
160 unsigned short zdcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
161 bool zdcSumADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
162 bool zdcFrontADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
163 bool zdcBackADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
164 unsigned short zdcTruncatedSum(StBeamDirection eastwest,
int prepost=0)
const;
166 bool zdcSumADCaboveThresholdL2(StBeamDirection eastwest)
const;
167 bool zdcFrontADCaboveThresholdL2(StBeamDirection eastwest)
const;
168 bool zdcBackADCaboveThresholdL2(StBeamDirection eastwest)
const;
169 unsigned short zdcTimeDifference()
const;
171 bool zdcSumADCaboveThresholdL3(StBeamDirection eastwest)
const;
172 bool zdcFrontADCaboveThresholdL3(StBeamDirection eastwest)
const;
173 bool zdcBackADCaboveThresholdL3(StBeamDirection eastwest)
const;
174 bool zdcTimeDifferenceInWindow()
const;
177 bool zdcSMDPresent(
int prepost=0)
const;
178 unsigned short zdcSMD(StBeamDirection eastwest,
int verthori,
int strip,
int prepost=0)
const;
179 unsigned short zdcSMDHighestStrip(StBeamDirection eastwest,
int verthori,
int prepost=0)
const;
182 unsigned char bemcHighTower(
int patch_id,
int prepost=0)
const;
183 unsigned char bemcJetPatch (
int patch_id,
int prepost=0)
const;
184 unsigned char eemcHighTower(
int patch_id,
int prepost=0)
const;
185 unsigned char eemcJetPatch (
int patch_id,
int prepost=0)
const;
186 unsigned char bemcHighestTowerADC(
int prepost=0)
const;
187 unsigned char eemcHighestTowerADC(
int prepost=0)
const;
190 unsigned short vpdADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
191 unsigned short vpdTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
192 unsigned short vpdADCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
193 unsigned short vpdTDCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
194 unsigned short vpdEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
195 unsigned short vpdEarliestTDCHighThr(StBeamDirection eastwest,
int prepost=0)
const;
196 float vpdMeanTimeDifference(
int prepost=0)
const;
197 unsigned short vpdADCSum(StBeamDirection eastwest,
int prepost=0)
const;
198 unsigned short bbcVP101(
int ch,
int prepost = 0)
const;
201 unsigned short mxqAtSlotAddress(
int address,
int prepost=0,
int slot=0)
const;
204 unsigned short mtdQtAtCh(
int qtid,
int address,
int prepost)
const;
205 unsigned short mtdAtAddress(
int address,
int prepost=0)
const;
206 unsigned short mtdgemAtAddress(
int address,
int prepost=0)
const;
207 unsigned short mtd3AtAddress(
int address,
int prepost=0)
const;
208 unsigned short mtdAdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
209 unsigned short mtdTdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
210 unsigned char mtdDsmAtCh(
int ch,
int prepost=0)
const;
211 bool mtdDsmHit(
int pmt,
int prepost=0)
const;
212 unsigned short mtdVpdTacDiff()
const;
213 unsigned short mtd4AtAddress(
int address,
int prepost=0)
const;
216 unsigned short tofAtAddress(
int address,
int prepost=0)
const;
217 unsigned short tofTrayMultiplicity(
int tray,
int prepost=0)
const;
218 unsigned short tofMultiplicity(
int prepost=0)
const;
219 unsigned short dsmTF201Ch(
int ch)
const;
222 unsigned short pp2ppADC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
223 unsigned short pp2ppTAC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
224 unsigned long pp2ppDSM(
int prepost=0)
const;
227 char* getTriggerStructure();
229 int getRawSize()
const;
231 unsigned char* getDsm0_BEMCE(
int prepost=0)
const;
232 unsigned char* getDsm0_BEMCW(
int prepost=0)
const;
233 unsigned short* getDsm1_BEMC(
int prepost=0)
const;
234 unsigned char* getDsm0_EEMC(
int prepost=0)
const;
235 unsigned short* getDsm1_EEMC(
int prepost=0)
const;
236 unsigned short* getDsm2_EMC()
const;
238 unsigned short* getDsm3()
const;
239 unsigned char* getDsm_FMS(
int prepost=0)
const;
242 unsigned short* getDsm1_FMS(
int prepost=0)
const;
243 unsigned short* getDsm2_FMS()
const;
244 unsigned int l2ResultLength()
const;
245 const unsigned int* l2Result()
const;
271 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],
272 eq1[11][16][32],eq2[11][16][32];
273 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],
274 teq1[11][16][32],teq2[11][16][32];
283 void swapRawDet(
DataBlock2019* data,
int name,
int hlength,
int bs);
290 swapI((
unsigned int*)&offlen->offset);
291 swapI((
unsigned int*)&offlen->length);
296 swapI((
unsigned int*)&TrgData->FormatVersion);
297 swapI((
unsigned int*)&TrgData->totalTriggerLength);
298 swapI((
unsigned int*)&TrgData->eventNumber);
299 swapOfflen(&TrgData->EventDesc_ofl);
300 swapOfflen(&TrgData->L1_DSM_ofl);
301 swapOfflen(&TrgData->Summary_ofl);
302 swapIn((
unsigned int*)TrgData->PrePostList,10);
307 swapIn((
unsigned int*)&EvtDesc->length,3);
308 swapSCC((
unsigned int*)&EvtDesc->actionWdDetectorBitMask);
309 swapSSn((
unsigned int*)&EvtDesc->TrgToken,12);
314 swapI((
unsigned int*)&L1_DSM->length);
315 swapSSn((
unsigned int*)L1_DSM->TOF,16+8*7);
320 swapIn((
unsigned int*)&TrgSum->length,1+2+2+32+64+64);
323 inline void StTriggerData2019::swapRawDetOfflen(
TrgOfflen2019* offlen)
326 for (i=0; i<y19MAX_OFFLEN; i++) {
327 swapOfflen(&offlen[i]);
328 if (mDebug>0) printf(
"Offlen id=%2d offset=%d length=%d\n", i, offlen[i].offset, offlen[i].length);