26 #ifndef StTriggerData2016_hh
27 #define StTriggerData2016_hh
29 #include "StTriggerData.h"
30 #include "StDaqLib/TRG/trgStructures2016.h"
40 void readData() {readData(0,0);}
45 unsigned int version()
const;
46 unsigned int numberOfPreXing()
const;
47 unsigned int numberOfPostXing()
const;
50 unsigned int eventNumber()
const;
51 unsigned int token()
const;
52 unsigned int triggerWord()
const;
53 unsigned int actionWord()
const;
54 unsigned short busyStatus()
const;
55 unsigned short dsmInput()
const;
56 unsigned short trgToken()
const;
57 unsigned short dsmAddress()
const;
58 unsigned short mAddBits()
const;
59 unsigned short bcData(
int channel)
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 spinBit()
const;
75 unsigned int spinBitYellowFilled()
const;
76 unsigned int spinBitYellowUp()
const;
77 unsigned int spinBitYellowDown()
const;
78 unsigned int spinBitYellowUnpol()
const;
79 unsigned int spinBitBlueFilled()
const;
80 unsigned int spinBitBlueUp()
const;
81 unsigned int spinBitBlueDown()
const;
82 unsigned int spinBitBlueUnpol()
const;
85 unsigned short tcuBits()
const;
86 unsigned short lastDSM(
int address)
const;
87 unsigned short bemcLayer1DSM(
int channel,
int prepost=0)
const;
88 unsigned short eemcLayer1DSM(
int channel,
int prepost=0)
const;
89 unsigned short emcLayer2DSM(
int channel)
const;
90 unsigned short tpcMaskDSM(
int channel)
const;
91 unsigned short fpdLayer1DSMRaw(StBeamDirection eastwest,
int channel,
int prepost=0)
const;
93 unsigned short fpdLayer2DSMRaw(
int channel)
const;
103 unsigned short bbcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
104 unsigned short bbcTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
105 unsigned short bbcADCSum(StBeamDirection eastwest,
int prepost=0)
const;
106 unsigned short bbcADCSumLargeTile(StBeamDirection eastwest,
int prepost=0)
const;
107 unsigned short bbcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
108 unsigned short bbcTimeDifference()
const;
109 unsigned short bbcTacSum()
const;
110 unsigned short bbcEarliestTDCLarge(StBeamDirection eastwest,
int prepost=0)
const;
111 unsigned short bbcTimeDifferenceLarge()
const;
114 unsigned short fpd(StBeamDirection eastwest,
int module,
int pmt,
int prepost=0)
const;
115 unsigned short fpdSum(StBeamDirection eastwest,
int module)
const;
118 unsigned short nQTdata(
int prepost=0)
const;
119 unsigned int* QTdata(
int prepost=0)
const;
120 unsigned short fmsADC(
int crt,
int adr,
int ch,
int prepost=0)
const;
121 unsigned short fmsTDC(
int crt,
int adr,
int ch,
int prepost=0)
const;
124 bool zdcPresent(
int prepost=0)
const;
125 unsigned short zdcAtChannel(
int channel,
int prepost=0)
const;
126 unsigned short zdcAtAddress(
int address,
int prepost=0)
const;
127 unsigned short zdcUnAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
128 unsigned short zdcAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
129 unsigned short zdcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
130 unsigned short zdcTDC(StBeamDirection eastwest,
int prepost=0)
const;
131 unsigned short zdcPmtTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
132 unsigned short zdcHardwareSum(
int prepost=0)
const;
134 unsigned short zdcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
135 bool zdcSumADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
136 bool zdcFrontADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
137 bool zdcBackADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
138 unsigned short zdcTruncatedSum(StBeamDirection eastwest,
int prepost=0)
const;
140 bool zdcSumADCaboveThresholdL2(StBeamDirection eastwest)
const;
141 bool zdcFrontADCaboveThresholdL2(StBeamDirection eastwest)
const;
142 bool zdcBackADCaboveThresholdL2(StBeamDirection eastwest)
const;
143 unsigned short zdcTimeDifference()
const;
145 bool zdcSumADCaboveThresholdL3(StBeamDirection eastwest)
const;
146 bool zdcFrontADCaboveThresholdL3(StBeamDirection eastwest)
const;
147 bool zdcBackADCaboveThresholdL3(StBeamDirection eastwest)
const;
148 bool zdcTimeDifferenceInWindow()
const;
151 bool zdcSMDPresent(
int prepost=0)
const;
152 unsigned short zdcSMD(StBeamDirection eastwest,
int verthori,
int strip,
int prepost=0)
const;
153 unsigned short zdcSMDHighestStrip(StBeamDirection eastwest,
int verthori,
int prepost=0)
const;
156 unsigned char bemcHighTower(
int patch_id,
int prepost=0)
const;
157 unsigned char bemcJetPatch (
int patch_id,
int prepost=0)
const;
158 unsigned char eemcHighTower(
int patch_id,
int prepost=0)
const;
159 unsigned char eemcJetPatch (
int patch_id,
int prepost=0)
const;
160 unsigned char bemcHighestTowerADC(
int prepost=0)
const;
161 unsigned char eemcHighestTowerADC(
int prepost=0)
const;
164 unsigned short vpdADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
165 unsigned short vpdTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
166 unsigned short vpdADCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
167 unsigned short vpdTDCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
168 unsigned short vpdEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
169 unsigned short vpdEarliestTDCHighThr(StBeamDirection eastwest,
int prepost=0)
const;
170 unsigned short vpdTimeDifference()
const;
172 unsigned short bbcVP101(
int ch,
int prepost = 0)
const;
175 unsigned short mxqAtSlotAddress(
int address,
int prepost=0,
int slot=0)
const;
178 unsigned short mtdQtAtCh(
int qtid,
int address,
int prepost)
const;
179 unsigned short mtdAtAddress(
int address,
int prepost=0)
const;
180 unsigned short mtdgemAtAddress(
int address,
int prepost=0)
const;
181 unsigned short mtd3AtAddress(
int address,
int prepost=0)
const;
182 unsigned short mtdAdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
183 unsigned short mtdTdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
184 unsigned char mtdDsmAtCh(
int ch,
int prepost=0)
const;
185 bool mtdDsmHit(
int pmt,
int prepost=0)
const;
186 unsigned short mtdVpdTacDiff()
const;
187 unsigned short mtd4AtAddress(
int address,
int prepost=0)
const;
190 unsigned short tofAtAddress(
int address,
int prepost=0)
const;
191 unsigned short tofTrayMultiplicity(
int tray,
int prepost=0)
const;
192 unsigned short tofMultiplicity(
int prepost=0)
const;
193 unsigned short dsmTF201Ch(
int ch)
const;
196 unsigned short pp2ppADC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
197 unsigned short pp2ppTAC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
198 unsigned long pp2ppDSM(
int prepost=0)
const;
201 char* getTriggerStructure();
203 int getRawSize()
const;
205 unsigned char* getDsm0_BEMCE(
int prepost=0)
const;
206 unsigned char* getDsm0_BEMCW(
int prepost=0)
const;
207 unsigned short* getDsm1_BEMC(
int prepost=0)
const;
208 unsigned char* getDsm0_EEMC(
int prepost=0)
const;
209 unsigned short* getDsm1_EEMC(
int prepost=0)
const;
210 unsigned short* getDsm2_EMC()
const;
212 unsigned short* getDsm3()
const;
213 unsigned char* getDsm_FMS(
int prepost=0)
const;
216 unsigned short* getDsm1_FMS(
int prepost=0)
const;
217 unsigned short* getDsm2_FMS()
const;
218 unsigned int l2ResultLength()
const;
219 const unsigned int* l2Result()
const;
243 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];
244 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];
252 void swapRawDet(
DataBlock2016* data,
int name,
int hlength,
int bs);
259 swapI((
unsigned int*)&offlen->offset);
260 swapI((
unsigned int*)&offlen->length);
265 swapI((
unsigned int*)&TrgData->FormatVersion);
266 swapI((
unsigned int*)&TrgData->totalTriggerLength);
267 swapI((
unsigned int*)&TrgData->eventNumber);
268 swapOfflen(&TrgData->EventDesc_ofl);
269 swapOfflen(&TrgData->L1_DSM_ofl);
270 swapOfflen(&TrgData->Summary_ofl);
271 swapIn((
unsigned int*)TrgData->PrePostList,10);
276 swapIn((
unsigned int*)&EvtDesc->length,3);
277 swapSCC((
unsigned int*)&EvtDesc->actionWdDetectorBitMask);
278 swapSSn((
unsigned int*)&EvtDesc->TrgToken,12);
283 swapI((
unsigned int*)&L1_DSM->length);
284 swapSSn((
unsigned int*)L1_DSM->TOF,16+8*7);
289 swapIn((
unsigned int*)&TrgSum->length,1+2+2+32+64+64);
292 inline void StTriggerData2016::swapRawDetOfflen(
TrgOfflen2016* offlen)
295 for (i=0; i<y16MAX_OFFLEN; i++) {
296 swapOfflen(&offlen[i]);
297 if (mDebug>0) printf(
"Offlen id=%2d offset=%d length=%d\n", i, offlen[i].offset, offlen[i].length);