23 #ifndef StTriggerData2013_hh
24 #define StTriggerData2013_hh
26 #include "StTriggerData.h"
27 #include "StDaqLib/TRG/trgStructures2013.h"
37 void readData() {readData(0,0);}
42 unsigned int version()
const;
43 unsigned int numberOfPreXing()
const;
44 unsigned int numberOfPostXing()
const;
47 unsigned int eventNumber()
const;
48 unsigned int token()
const;
49 unsigned int triggerWord()
const;
50 unsigned int actionWord()
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;
59 int L2ResultsOffset(StL2AlgorithmId
id)
const;
60 bool isL2Triggered(StL2TriggerResultType
id)
const;
61 unsigned long long l2sum()
const;
64 unsigned int bunchCounterHigh()
const;
65 unsigned int bunchCounterLow()
const;
66 unsigned int bunchId48Bit()
const;
67 unsigned int bunchId7Bit()
const;
68 unsigned int spinBit()
const;
69 unsigned int spinBitYellowFilled()
const;
70 unsigned int spinBitYellowUp()
const;
71 unsigned int spinBitYellowDown()
const;
72 unsigned int spinBitYellowUnpol()
const;
73 unsigned int spinBitBlueFilled()
const;
74 unsigned int spinBitBlueUp()
const;
75 unsigned int spinBitBlueDown()
const;
76 unsigned int spinBitBlueUnpol()
const;
79 unsigned short tcuBits()
const;
80 unsigned short lastDSM(
int address)
const;
81 unsigned short bemcLayer1DSM(
int channel,
int prepost=0)
const;
82 unsigned short eemcLayer1DSM(
int channel,
int prepost=0)
const;
83 unsigned short emcLayer2DSM(
int channel)
const;
84 unsigned short tpcMaskDSM(
int channel)
const;
85 unsigned short fpdLayer1DSMRaw(StBeamDirection eastwest,
int channel,
int prepost=0)
const;
87 unsigned short fpdLayer2DSMRaw(
int channel)
const;
97 unsigned short bbcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
98 unsigned short bbcTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
99 unsigned short bbcADCSum(StBeamDirection eastwest,
int prepost=0)
const;
100 unsigned short bbcADCSumLargeTile(StBeamDirection eastwest,
int prepost=0)
const;
101 unsigned short bbcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
102 unsigned short bbcTimeDifference()
const;
103 unsigned short bbcEarliestTDCLarge(StBeamDirection eastwest,
int prepost=0)
const;
104 unsigned short bbcTimeDifferenceLarge()
const;
107 unsigned short fpd(StBeamDirection eastwest,
int module,
int pmt,
int prepost=0)
const;
108 unsigned short fpdSum(StBeamDirection eastwest,
int module)
const;
111 unsigned short nQTdata(
int prepost=0)
const;
112 unsigned int* QTdata(
int prepost=0)
const;
113 unsigned short fmsADC(
int crt,
int adr,
int ch,
int prepost=0)
const;
114 unsigned short fmsTDC(
int crt,
int adr,
int ch,
int prepost=0)
const;
117 bool zdcPresent(
int prepost=0)
const;
118 unsigned short zdcAtChannel(
int channel,
int prepost=0)
const;
119 unsigned short zdcAtAddress(
int address,
int prepost=0)
const;
120 unsigned short zdcUnAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
121 unsigned short zdcAttenuated(StBeamDirection eastwest,
int prepost=0)
const;
122 unsigned short zdcADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
123 unsigned short zdcTDC(StBeamDirection eastwest,
int prepost=0)
const;
124 unsigned short zdcPmtTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
125 unsigned short zdcHardwareSum(
int prepost=0)
const;
127 unsigned short zdcEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
128 bool zdcSumADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
129 bool zdcFrontADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
130 bool zdcBackADCaboveThreshold(StBeamDirection eastwest,
int prepost=0)
const;
131 unsigned short zdcTruncatedSum(StBeamDirection eastwest,
int prepost=0)
const;
133 bool zdcSumADCaboveThresholdL2(StBeamDirection eastwest)
const;
134 bool zdcFrontADCaboveThresholdL2(StBeamDirection eastwest)
const;
135 bool zdcBackADCaboveThresholdL2(StBeamDirection eastwest)
const;
136 unsigned short zdcTimeDifference()
const;
138 bool zdcSumADCaboveThresholdL3(StBeamDirection eastwest)
const;
139 bool zdcFrontADCaboveThresholdL3(StBeamDirection eastwest)
const;
140 bool zdcBackADCaboveThresholdL3(StBeamDirection eastwest)
const;
141 bool zdcTimeDifferenceInWindow()
const;
144 bool zdcSMDPresent(
int prepost=0)
const;
145 unsigned short zdcSMD(StBeamDirection eastwest,
int verthori,
int strip,
int prepost=0)
const;
146 unsigned short zdcSMDHighestStrip(StBeamDirection eastwest,
int verthori,
int prepost=0)
const;
149 unsigned char bemcHighTower(
int patch_id,
int prepost=0)
const;
150 unsigned char bemcJetPatch (
int patch_id,
int prepost=0)
const;
151 unsigned char eemcHighTower(
int patch_id,
int prepost=0)
const;
152 unsigned char eemcJetPatch (
int patch_id,
int prepost=0)
const;
153 unsigned char bemcHighestTowerADC(
int prepost=0)
const;
154 unsigned char eemcHighestTowerADC(
int prepost=0)
const;
157 unsigned short vpdADC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
158 unsigned short vpdTDC(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
159 unsigned short vpdADCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
160 unsigned short vpdTDCHighThr(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
161 unsigned short vpdEarliestTDC(StBeamDirection eastwest,
int prepost=0)
const;
162 unsigned short vpdEarliestTDCHighThr(StBeamDirection eastwest,
int prepost=0)
const;
163 unsigned short vpdTimeDifference()
const;
166 unsigned short mxqAtSlotAddress(
int address,
int prepost=0,
int slot=0)
const;
169 unsigned short mtdAtAddress(
int address,
int prepost=0)
const;
170 unsigned short mtdgemAtAddress(
int address,
int prepost=0)
const;
171 unsigned short mtd3AtAddress(
int address,
int prepost=0)
const;
172 unsigned short mtdAdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
173 unsigned short mtdTdc(StBeamDirection eastwest,
int pmt,
int prepost=0)
const;
174 unsigned char mtdDsmAtCh(
int ch,
int prepost=0)
const;
175 bool mtdDsmHit(
int pmt,
int prepost=0)
const;
176 unsigned short mtdVpdTacDiff()
const;
177 unsigned short mtd4AtAddress(
int address,
int prepost=0)
const;
180 unsigned short tofAtAddress(
int address,
int prepost=0)
const;
181 unsigned short tofTrayMultiplicity(
int tray,
int prepost=0)
const;
182 unsigned short tofMultiplicity(
int prepost=0)
const;
183 unsigned short dsmTF201Ch(
int ch)
const;
186 unsigned short pp2ppADC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
187 unsigned short pp2ppTAC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost=0)
const;
188 unsigned long pp2ppDSM(
int prepost=0)
const;
191 char* getTriggerStructure();
193 int getRawSize()
const;
195 unsigned char* getDsm0_BEMCE(
int prepost=0)
const;
196 unsigned char* getDsm0_BEMCW(
int prepost=0)
const;
197 unsigned short* getDsm1_BEMC(
int prepost=0)
const;
198 unsigned char* getDsm0_EEMC(
int prepost=0)
const;
199 unsigned short* getDsm1_EEMC(
int prepost=0)
const;
200 unsigned short* getDsm2_EMC()
const;
202 unsigned short* getDsm3()
const;
203 unsigned char* getDsm_FMS(
int prepost=0)
const;
206 unsigned short* getDsm1_FMS(
int prepost=0)
const;
207 unsigned short* getDsm2_FMS()
const;
208 unsigned int l2ResultLength()
const;
209 const unsigned int* l2Result()
const;
233 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];
234 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];
242 void swapRawDet(
DataBlock2013* data,
int name,
int hlength,
int bs);
249 swapI((
unsigned int*)&offlen->offset);
250 swapI((
unsigned int*)&offlen->length);
255 swapI((
unsigned int*)&TrgData->FormatVersion);
256 swapI((
unsigned int*)&TrgData->totalTriggerLength);
257 swapI((
unsigned int*)&TrgData->eventNumber);
258 swapOfflen(&TrgData->EventDesc_ofl);
259 swapOfflen(&TrgData->L1_DSM_ofl);
260 swapOfflen(&TrgData->Summary_ofl);
261 swapIn((
unsigned int*)TrgData->PrePostList,10);
266 swapIn((
unsigned int*)&EvtDesc->length,3);
267 swapSCC((
unsigned int*)&EvtDesc->actionWdDetectorBitMask);
268 swapSSn((
unsigned int*)&EvtDesc->TrgToken,12);
273 swapI((
unsigned int*)&L1_DSM->length);
274 swapSSn((
unsigned int*)L1_DSM->TOF,16+8*7);
279 swapIn((
unsigned int*)&TrgSum->length,1+2+2+32+64+64);
282 inline void StTriggerData2013::swapRawDetOfflen(
TrgOfflen2013* offlen)
285 for (i=0; i<y13MAX_OFFLEN; i++) {
286 swapOfflen(&offlen[i]);
287 if (mDebug>0) printf(
"Offlen id=%2d offset=%d length=%d\n", i, offlen[i].offset, offlen[i].length);