119 #include "StTriggerData2009.h"
132 mYear=2009; mRun = run; mDebug = 0;
139 mYear=2009; mRun = run; mDebug = dbg;
140 if(mDebug==1) printf(
"StTriggerData2009 Constructor with trigger data block and byteswap option=%d\n",bs);
147 if (data==0) {copyflag=0;}
148 if(mDebug==1) printf(
"StTriggerData2009::readData copyflag=%d byteswap=%d data=%p mData=%p\n",copyflag,bs,data,mData);
151 unsigned int ver = data->FormatVersion;
154 if (ver == y9FORMAT_VERSION || ver == 0x08121140) {
155 if (mDebug==1) printf(
"StTriggerData2009: version = 0x%x (0x%x or 0x08121140)\n",ver,y9FORMAT_VERSION);
158 mErrorFlag = mErrorFlag | 0x1;
159 printf(
"StTriggerData2009: version = 0x%x != (0x%x or 0x08121140)\n",ver,y9FORMAT_VERSION);
163 unsigned int size = data->totalTriggerLength;
164 if (bs) swapI(&size);
165 if (size > y9MAX_TRG_BLK_SIZE) {
166 gMessMgr->Warning() <<
"StTriggerData2009: Data length = " << size
167 <<
" is bigger than max = " << y9MAX_TRG_BLK_SIZE
171 if (mDebug==1) printf(
"StTriggerData2009: size = %d, maxsize = %d\n",size,y9MAX_TRG_BLK_SIZE);
172 memcpy(mData,data,size);
176 if (bs) swapDataBlk(mData);
178 printf(
"StTriggerData2009: version = 0x%x (0x%x or 0x08121140)\n",mData->FormatVersion,y9FORMAT_VERSION);
179 printf(
"StTriggerData2009: size = %d, maxsize = %d\n",mData->totalTriggerLength,y9MAX_TRG_BLK_SIZE);
180 printf(
"EventDesc length=%10d offset=%10d\n",mData->EventDesc_ofl.length,mData->EventDesc_ofl.offset);
181 printf(
"L1_DSM length=%10d offset=%10d\n",mData->L1_DSM_ofl.length,mData->L1_DSM_ofl.offset);
182 printf(
"Summary length=%10d offset=%10d\n",mData->Summary_ofl.length,mData->Summary_ofl.offset);
185 EvtDesc=0; L1_DSM=0; TrgSum=0;
186 if (mData->EventDesc_ofl.length > 0) EvtDesc = (
EvtDescData2009*)((
char*)mData + mData->EventDesc_ofl.offset);
187 if (mData->L1_DSM_ofl.length > 0) L1_DSM = (
L1_DSM_Data2009*)((
char*)mData + mData->L1_DSM_ofl.offset);
188 if (mData->Summary_ofl.length > 0) TrgSum = (
TrgSumData2009* )((
char*)mData + mData->Summary_ofl.offset);
190 if (EvtDesc) swapEvtDesc(EvtDesc);
191 if (L1_DSM) swapL1_DSM(L1_DSM);
192 if (TrgSum) swapTrgSum(TrgSum);
194 if (EvtDesc==0 || L1_DSM==0 || TrgSum==0){
195 mErrorFlag = mErrorFlag | 0x1;
196 gMessMgr->Warning() <<
"StTriggerData2009: EvtDesc, L1_DSM or TrgSum is missing"
197 <<
" mErrorFlag="<<mErrorFlag<<endm;
200 int npre = numberOfPreXing();
201 int npost = numberOfPostXing();
202 if (npre<0 || npre>10 || npost<0 || npost>10){
203 mErrorFlag = mErrorFlag | 0x2;
204 gMessMgr->Warning() <<
"StTriggerData2009: Invalid npre/post = "<< npre <<
" / " << npost
205 <<
" mErrorFlag="<<mErrorFlag<<endm;
207 if (mDebug==1) printf(
"StTriggerData2009: pre=%d post=%d\n",npre,npost);
209 memset(mBC1,0,
sizeof(mBC1));
210 memset(mMXQ,0,
sizeof(mMXQ));
211 memset(mMIX,0,
sizeof(mMIX));
212 memset(mBCW,0,
sizeof(mBCW));
213 memset(mBCE,0,
sizeof(mBCE));
214 memset(mFEQ,0,
sizeof(mFEQ));
215 memset(mBBC,0,
sizeof(mBBC));
216 memset(mBBQ,0,
sizeof(mBBQ));
217 memset(mFMS,0,
sizeof(mFMS));
218 memset(mQT1,0,
sizeof(mQT1));
219 memset(mQT2,0,
sizeof(mQT2));
220 memset(mQT3,0,
sizeof(mQT3));
221 memset(mQT4,0,
sizeof(mQT4));
222 memset(mxq,0,
sizeof(mxq)); memset(tmxq,0,
sizeof(tmxq));
223 memset(feq,0,
sizeof(feq)); memset(tfeq,0,
sizeof(tfeq));
224 memset(bbq,0,
sizeof(bbq)); memset(tbbq,0,
sizeof(tbbq));
225 memset(qt1,0,
sizeof(qt1)); memset(tqt1,0,
sizeof(tqt1));
226 memset(qt2,0,
sizeof(qt2)); memset(tqt2,0,
sizeof(tqt2));
227 memset(qt3,0,
sizeof(qt3)); memset(tqt3,0,
sizeof(tqt3));
228 memset(qt4,0,
sizeof(qt4)); memset(tqt4,0,
sizeof(tqt4));
231 for (
int i=0; i<1+npre+npost; i++){
234 {offlen = mData->MainX;}
237 if (mData->PrePostList[i-1]==0)
continue;
238 offlen = (
TrgOfflen2009*) ((
char*)mData + mData->PrePostList[i-1]);
240 if (bs) swapRawDetOfflen(offlen);
241 for(
int k=0; k<y9MAX_OFFLEN; k++){
242 if(static_cast<unsigned int>(offlen[k].length + offlen[k].offset) > static_cast<unsigned int>(mData->totalTriggerLength)) {
243 mErrorFlag = mErrorFlag | (1 << k);
244 gMessMgr->Warning() <<
"StTriggerData2009: offset ("<<offlen[k].offset<<
") + length ("<<offlen[k].length
245 <<
") exceeds total size("<<mData->totalTriggerLength<<
") for data block id="<<k
246 <<
" mErrorFlag="<<mErrorFlag<<endm;
250 j=offlen[y9BC1_CONF_NUM].length;
if (j>0){mBC1[i] = (
BELayerBlock2009*)((
char*)mData + offlen[y9BC1_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mBC1[i],y9BC1_CONF_NUM,j,bs);}
251 j=offlen[y9MXQ_CONF_NUM].length;
if (j>0){mMXQ[i] = (
QTBlock2009* )((
char*)mData + offlen[y9MXQ_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mMXQ[i],y9MXQ_CONF_NUM,j,bs);}
252 j=offlen[y9MIX_CONF_NUM].length;
if (j>0){mMIX[i] = (
MIXBlock2009* )((
char*)mData + offlen[y9MIX_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mMIX[i],y9MIX_CONF_NUM,j,bs);}
253 j=offlen[y9BCW_CONF_NUM].length;
if (j>0){mBCW[i] = (
BWestBlock2009* )((
char*)mData + offlen[y9BCW_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mBCW[i],y9BCW_CONF_NUM,j,bs);}
254 j=offlen[y9BCE_CONF_NUM].length;
if (j>0){mBCE[i] = (
BEastBlock2009* )((
char*)mData + offlen[y9BCE_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mBCE[i],y9BCE_CONF_NUM,j,bs);}
255 j=offlen[y9FEQ_CONF_NUM].length;
if (j>0){mFEQ[i] = (
QTBlock2009* )((
char*)mData + offlen[y9FEQ_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mFEQ[i],y9FEQ_CONF_NUM,j,bs);}
256 j=offlen[y9BBC_CONF_NUM].length;
if (j>0){mBBC[i] = (
BBCBlock2009* )((
char*)mData + offlen[y9BBC_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mBBC[i],y9BBC_CONF_NUM,j,bs);}
257 j=offlen[y9BBQ_CONF_NUM].length;
if (j>0){mBBQ[i] = (
QTBlock2009* )((
char*)mData + offlen[y9BBQ_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mBBQ[i],y9BBQ_CONF_NUM,j,bs);}
258 j=offlen[y9FMS_CONF_NUM].length;
if (j>0){mFMS[i] = (
FMSBlock2009* )((
char*)mData + offlen[y9FMS_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mFMS[i],y9FMS_CONF_NUM,j,bs);}
259 j=offlen[y9QT1_CONF_NUM].length;
if (j>0){mQT1[i] = (
QTBlock2009* )((
char*)mData + offlen[y9QT1_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mQT1[i],y9QT1_CONF_NUM,j,bs);}
260 j=offlen[y9QT2_CONF_NUM].length;
if (j>0){mQT2[i] = (
QTBlock2009* )((
char*)mData + offlen[y9QT2_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mQT2[i],y9QT2_CONF_NUM,j,bs);}
261 j=offlen[y9QT3_CONF_NUM].length;
if (j>0){mQT3[i] = (
QTBlock2009* )((
char*)mData + offlen[y9QT3_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mQT3[i],y9QT3_CONF_NUM,j,bs);}
262 j=offlen[y9QT4_CONF_NUM].length;
if (j>0){mQT4[i] = (
QTBlock2009* )((
char*)mData + offlen[y9QT4_CONF_NUM].offset); swapRawDet((
DataBlock2009*)mQT4[i],y9QT4_CONF_NUM,j,bs);}
263 if (mMXQ[i]) decodeQT(mMXQ[i]->length/4, mMXQ[i]->data, mxq[i], tmxq[i]);
264 if (mFEQ[i]) decodeQT(mFEQ[i]->length/4, mFEQ[i]->data, feq[i], tfeq[i]);
265 if (mBBQ[i]) decodeQT(mBBQ[i]->length/4, mBBQ[i]->data, bbq[i], tbbq[i]);
266 if (mQT1[i]) decodeQT(mQT1[i]->length/4, mQT1[i]->data, qt1[i], tqt1[i]);
267 if (mQT2[i]) decodeQT(mQT2[i]->length/4, mQT2[i]->data, qt2[i], tqt2[i]);
268 if (mQT3[i]) decodeQT(mQT3[i]->length/4, mQT3[i]->data, qt3[i], tqt3[i]);
269 if (mQT4[i]) decodeQT(mQT4[i]->length/4, mQT4[i]->data, qt4[i], tqt4[i]);
271 if (mDebug==1) dump();
274 StTriggerData2009::~StTriggerData2009() {
delete mData;}
276 unsigned int StTriggerData2009::version()
const
278 return EvtDesc->TrgDataFmtVer;
281 unsigned int StTriggerData2009::eventNumber()
const
283 return mData->eventNumber;
286 unsigned int StTriggerData2009::token()
const
288 return EvtDesc->TrgToken;
291 unsigned int StTriggerData2009::triggerWord()
const
293 return EvtDesc->TriggerWord;
296 unsigned int StTriggerData2009::actionWord()
const
299 ( (
unsigned short)(EvtDesc->actionWdTrgCommand) * 16 * 16 * 16 ) +
300 ( (
unsigned short)(EvtDesc->actionWdDaqCommand) * 16 * 16 ) +
301 ( EvtDesc->actionWdDetectorBitMask & 0x00ff );
304 unsigned int StTriggerData2009::numberOfPreXing()
const
306 return EvtDesc->npre;
309 unsigned int StTriggerData2009::numberOfPostXing()
const
311 return EvtDesc->npost;
314 unsigned short StTriggerData2009::busyStatus()
const{
315 return EvtDesc->internalBusy;
318 unsigned short StTriggerData2009::dsmInput()
const{
319 return EvtDesc->DSMInput;
322 unsigned short StTriggerData2009::trgToken()
const{
323 return EvtDesc->TrgToken;
326 unsigned short StTriggerData2009::dsmAddress()
const{
327 return EvtDesc->DSMAddress;
330 unsigned short StTriggerData2009::mAddBits()
const{
331 return EvtDesc->addBits;
334 unsigned short StTriggerData2009::bcData(
int channel)
const{
335 return L1_DSM->BCdata[channel];
338 unsigned short StTriggerData2009::lastDSM(
int channel)
const{
339 return L1_DSM->lastDSM[channel];
342 unsigned short StTriggerData2009::tcuBits()
const
344 return EvtDesc->DSMInput;
347 unsigned int StTriggerData2009::bunchCounterHigh()
const
349 return EvtDesc->bunchXing_hi;
352 unsigned int StTriggerData2009::bunchCounterLow()
const
354 return EvtDesc->bunchXing_lo;
357 unsigned int StTriggerData2009::bunchId48Bit()
const
359 unsigned long long bxinghi,bxing1,bxinglo, bx;
360 bxinghi = L1_DSM->BCdata[3];
361 bxing1 = L1_DSM->BCdata[10];
362 bxinglo = (bxing1 << 16) + L1_DSM->BCdata[11];
363 bx = (bxinghi << 32) + bxinglo;
364 return (
int)(bx % 120);
367 unsigned int StTriggerData2009::bunchId7Bit()
const
370 b7dat = L1_DSM->BCdata[2];
375 unsigned int StTriggerData2009::spinBit()
const
378 return (L1_DSM->lastDSM[7]/16)%256;
380 return (L1_DSM->lastDSM[4]/16)%256;
384 unsigned int StTriggerData2009::spinBitYellowFilled()
const
386 unsigned int sb = spinBit();
390 unsigned int StTriggerData2009::spinBitYellowUp()
const
392 unsigned int sb = spinBit();
396 unsigned int StTriggerData2009::spinBitYellowDown()
const
398 unsigned int sb = spinBit();
402 unsigned int StTriggerData2009::spinBitYellowUnpol()
const
404 unsigned int sb = spinBit();
408 unsigned int StTriggerData2009::spinBitBlueFilled()
const
410 unsigned int sb = spinBit();
414 unsigned int StTriggerData2009::spinBitBlueUp()
const
416 unsigned int sb = spinBit();
420 unsigned int StTriggerData2009::spinBitBlueDown()
const
422 unsigned int sb = spinBit();
426 unsigned int StTriggerData2009::spinBitBlueUnpol()
const
428 unsigned int sb = spinBit();
432 unsigned short StTriggerData2009::bbcADC(StBeamDirection eastwest,
int pmt,
int prepost)
const
434 const int addrmap[2][24] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
435 4, 4, 4, 4, 4, 4, 4, 4},
436 { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 4, 4, 4, 4, 4, 4, 4, 4} };
438 const int chmap[2][24] = { { 0, 3, 8,16,19,24, 1, 2, 9,10,11,17,18,25,26,27,
439 0, 1, 2, 3, 8, 9,10,11},
440 { 0, 3, 8,16,19,24, 1, 2, 9,10,11,17,18,25,26,27,
441 16,17,18,19,24,25,26,27} };
442 int buffer = prepostAddress(prepost);
443 if (buffer >= 0 && pmt>=1 && pmt<=24)
return bbq[buffer][addrmap[eastwest][pmt-1]][chmap[eastwest][pmt-1]];
447 unsigned short StTriggerData2009::bbcTDC(StBeamDirection eastwest,
int pmt,
int prepost)
const
449 const int addrmap[2][24] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
450 4, 4, 4, 4, 4, 4, 4, 4},
451 { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 4, 4, 4, 4, 4, 4, 4, 4} };
453 const int chmap[2][24] = { { 0, 3, 8,16,19,24, 1, 2, 9,10,11,17,18,25,26,27,
454 0, 1, 2, 3, 8, 9,10,11},
455 { 0, 3, 8,16,19,24, 1, 2, 9,10,11,17,18,25,26,27,
456 16,17,18,19,24,25,26,27} };
457 int buffer = prepostAddress(prepost);
458 if (buffer >= 0 && pmt>=1 && pmt<=24)
return bbq[buffer][addrmap[eastwest][pmt-1]][chmap[eastwest][pmt-1]+4];
462 unsigned short StTriggerData2009::bbcADCSum(StBeamDirection eastwest,
int prepost)
const
464 unsigned short sum=0;
465 int buffer = prepostAddress(prepost);
466 if (buffer >= 0)
for(
int i=1; i<=16; i++) {sum+=bbcADC(eastwest,i,prepost);}
470 unsigned short StTriggerData2009::bbcADCSumLargeTile(StBeamDirection eastwest,
int prepost)
const
472 unsigned short sum=0;
473 int buffer = prepostAddress(prepost);
474 if (buffer >= 0)
for(
int i=17; i<=24; i++) {sum+=bbcADC(eastwest,i,prepost);}
478 unsigned short StTriggerData2009::bbcEarliestTDC(StBeamDirection eastwest,
int prepost)
const
480 int buffer = prepostAddress(prepost);
483 if (eastwest==east) {
return mBBC[buffer]->BBClayer1[2]%4096;}
484 else {
return mBBC[buffer]->BBClayer1[0]%4096;}
490 unsigned short StTriggerData2009::bbcTimeDifference()
const
492 return L1_DSM->VTX[3]%8192;
495 unsigned short StTriggerData2009::bbcEarliestTDCLarge(StBeamDirection eastwest,
int prepost)
const
497 int buffer = prepostAddress(prepost);
500 if (eastwest==east) {
return mBBC[buffer]->BBClayer1[11] & 0x0fff;}
501 else {
return ((mBBC[buffer]->BBClayer1[11] & 0xf000) >> 12)
502 +((mBBC[buffer]->BBClayer1[10] & 0x00ff) << 4 );}
508 unsigned short StTriggerData2009::bbcTimeDifferenceLarge()
const
510 return L1_DSM->VTX[2]%8192;
514 unsigned short StTriggerData2009::fpd(StBeamDirection eastwest,
int module,
int pmt,
int prepost)
const
519 unsigned short StTriggerData2009::fpdSum(StBeamDirection eastwest,
int module)
const
524 unsigned short StTriggerData2009::fpdLayer1DSMRaw(StBeamDirection eastwest,
int channel,
int prepost)
const{
525 int buffer = prepostAddress(prepost);
527 if (eastwest==east) {
if (mMIX[buffer])
return mMIX[buffer]->FPDEastNSLayer1[channel]; }
528 else {
if (mFMS[buffer])
return mFMS[buffer]->FMS[channel]; }
533 unsigned short StTriggerData2009::fpdLayer2DSMRaw(
int channel)
const{
534 if (channel<8)
return L1_DSM->FPD[channel];
538 bool StTriggerData2009::zdcPresent(
int prepost)
const
540 int buffer = prepostAddress(prepost);
541 if (buffer >= 0)
return mBBQ[buffer];
545 unsigned short StTriggerData2009::zdcAtChannel(
int channel,
int prepost)
const
547 int buffer = prepostAddress(prepost);
548 if (buffer >= 0 && channel>=0 && channel<32)
return bbq[buffer][14][channel];
552 unsigned short StTriggerData2009::zdcAtAddress(
int address,
int prepost)
const
554 return zdcAtChannel(address,prepost);
557 unsigned short StTriggerData2009::zdcUnAttenuated(StBeamDirection eastwest,
int prepost)
const
559 int buffer = prepostAddress(prepost);
561 if (eastwest == east)
return bbq[buffer][14][2];
562 else return bbq[buffer][14][18];
567 unsigned short StTriggerData2009::zdcAttenuated(StBeamDirection eastwest,
int prepost)
const
569 int buffer = prepostAddress(prepost);
571 if (eastwest == east)
return bbq[buffer][14][3];
572 else return bbq[buffer][14][19];
577 unsigned short StTriggerData2009::zdcADC(StBeamDirection eastwest,
int pmt,
int prepost)
const
579 int buffer = prepostAddress(prepost);
580 if (buffer >= 0 && pmt>=1 && pmt<=3) {
581 if (eastwest == east) {
582 if (pmt == 1)
return bbq[buffer][14][0];
583 if (pmt == 2)
return bbq[buffer][14][8];
584 if (pmt == 3)
return bbq[buffer][14][9];
587 if (pmt == 1)
return bbq[buffer][14][16];
588 if (pmt == 2)
return bbq[buffer][14][24];
589 if (pmt == 3)
return bbq[buffer][14][25];
595 unsigned short StTriggerData2009::zdcTDC(StBeamDirection eastwest,
int prepost)
const
597 int buffer = prepostAddress(prepost);
599 if (eastwest == east)
return bbq[buffer][14][6];
600 else return bbq[buffer][14][22];
605 unsigned short StTriggerData2009::zdcPmtTDC(StBeamDirection eastwest,
int pmt,
int prepost)
const
607 int buffer = prepostAddress(prepost);
608 if (buffer >= 0 && pmt>=1 && pmt<=3) {
609 if (eastwest == east) {
610 if (pmt == 1)
return bbq[buffer][14][4];
611 if (pmt == 2)
return bbq[buffer][14][12];
612 if (pmt == 3)
return bbq[buffer][14][13];
615 if (pmt == 1)
return bbq[buffer][14][20];
616 if (pmt == 2)
return bbq[buffer][14][28];
617 if (pmt == 3)
return bbq[buffer][14][29];
623 unsigned short StTriggerData2009::zdcHardwareSum(
int prepost)
const
625 int buffer = prepostAddress(prepost);
626 if (buffer >= 0)
return bbq[buffer][14][11];
630 bool StTriggerData2009::zdcSMDPresent(
int prepost)
const
632 int buffer = prepostAddress(prepost);
633 if (buffer >= 0)
return mMXQ[buffer];
637 unsigned short StTriggerData2009::zdcSMD(StBeamDirection eastwest,
int verthori,
int strip,
int prepost)
const
639 static const int zdcsmd_map[2][2][8] ={
640 { { 31, 30, 29, 28, 27, 26, 25, 19} ,
641 { 24, 23, 22, 21, 20, 16, 18, 17} } ,
642 { { 15, 14, 13, 12, 11, 10, 9, 2} ,
643 { 8, 7, 6, 5, 4, 3, 0, 1} }
645 static const int zdcsmd_map2011[2][2][8] ={
646 { {24, 25, 26, 27, 28, 29, 30, 31} ,
647 {16, 17, 18, 19, 20, 21, 22, 23} } ,
648 { {8, 9, 10, 11, 12, 13, 14, 15} ,
649 {0, 1, 2, 3, 4, 5, 6, 7} }
651 if (verthori<0 || verthori>1)
return 0;
652 if (strip<1 || strip>8)
return 0;
653 int buffer = prepostAddress(prepost);
656 return mxq[buffer][4][zdcsmd_map[eastwest][verthori][strip-1]];
658 return mxq[buffer][4][zdcsmd_map2011[eastwest][verthori][strip-1]];
664 unsigned short StTriggerData2009::zdcEarliestTDC(StBeamDirection eastwest,
int prepost)
const
666 int buffer = prepostAddress(prepost);
670 if (eastwest==east) {
return ((mBBC[buffer]->ZDClayer1[3] >> 12) % 16) | ((mBBC[buffer]->ZDClayer1[2] % 256) << 4);}
671 else {
return (mBBC[buffer]->ZDClayer1[3]) % 4096;}
673 if (eastwest==east) {
return ((mBBC[buffer]->ZDClayer1[3] >> 10) % 64) | ((mBBC[buffer]->ZDClayer1[2] % 16) << 6);}
674 else {
return (mBBC[buffer]->ZDClayer1[3]) % 1024;}
681 bool StTriggerData2009::zdcSumADCaboveThreshold(StBeamDirection eastwest,
int prepost)
const {
682 int buffer = prepostAddress(prepost);
686 if (eastwest==east) {
return mBBC[buffer]->ZDClayer1[2] & (1 << (27-16));}
687 else {
return mBBC[buffer]->ZDClayer1[2] & (1 << (24-16));}
689 if (eastwest==east) {
return mBBC[buffer]->ZDClayer1[2] & (1 << (25-16));}
690 else {
return mBBC[buffer]->ZDClayer1[2] & (1 << (22-16));}
697 bool StTriggerData2009::zdcFrontADCaboveThreshold(StBeamDirection eastwest,
int prepost)
const {
698 int buffer = prepostAddress(prepost);
702 if (eastwest==east) {
return mBBC[buffer]->ZDClayer1[2] & (1 << (29-16));}
703 else {
return mBBC[buffer]->ZDClayer1[2] & (1 << (26-16));}
705 if (eastwest==east) {
return mBBC[buffer]->ZDClayer1[2] & (1 << (23-16));}
706 else {
return mBBC[buffer]->ZDClayer1[2] & (1 << (20-16));}
713 bool StTriggerData2009::zdcBackADCaboveThreshold(StBeamDirection eastwest,
int prepost)
const {
714 int buffer = prepostAddress(prepost);
718 if (eastwest==east) {
return mBBC[buffer]->ZDClayer1[2] & (1 << (28-16));}
719 else {
return mBBC[buffer]->ZDClayer1[2] & (1 << (25-16));}
721 if (eastwest==east) {
return mBBC[buffer]->ZDClayer1[2] & (1 << (24-16));}
722 else {
return mBBC[buffer]->ZDClayer1[2] & (1 << (21-16));}
729 unsigned short StTriggerData2009::zdcTimeDifference()
const
731 return L1_DSM->VTX[1]%1024;
734 bool StTriggerData2009::zdcSumADCaboveThresholdL2(StBeamDirection eastwest)
const {
735 return L1_DSM->VTX[1] & (1 << ((eastwest==east) ? 10 : 11));
738 bool StTriggerData2009::zdcFrontADCaboveThresholdL2(StBeamDirection eastwest)
const {
739 return L1_DSM->VTX[1] & (1 << ((eastwest==east) ? 12 : 14));
742 bool StTriggerData2009::zdcBackADCaboveThresholdL2(StBeamDirection eastwest)
const {
743 return L1_DSM->VTX[1] & (1 << ((eastwest==east) ? 13 : 15));
746 bool StTriggerData2009::zdcSumADCaboveThresholdL3(StBeamDirection eastwest)
const {
747 if(mRun<12000000){
return lastDSM(2) & (1 << ((eastwest==east) ? 7 : 8)); }
748 else {
return lastDSM(1) & (1 << ((eastwest==east) ? 7 : 8)); }
751 bool StTriggerData2009::zdcFrontADCaboveThresholdL3(StBeamDirection eastwest)
const {
752 if(mRun<12000000){
return lastDSM(2) & (1 << ((eastwest==east) ? 9 : 11)); }
753 else {
return lastDSM(1) & (1 << ((eastwest==east) ? 9 : 11)); }
756 bool StTriggerData2009::zdcBackADCaboveThresholdL3(StBeamDirection eastwest)
const {
757 if(mRun<12000000){
return lastDSM(2) & (1 << ((eastwest==east) ? 10 : 12)); }
758 else {
return lastDSM(1) & (1 << ((eastwest==east) ? 10 : 12)); }
761 bool StTriggerData2009::zdcTimeDifferenceInWindow()
const
763 if(mRun<12000000){
return lastDSM(2) & (1 << 6); }
764 else {
return lastDSM(1) & (1 << 6); }
767 unsigned short StTriggerData2009::zdcSMDHighestStrip(StBeamDirection eastwest,
int verthori,
int prepost)
const
769 if(mRun<12000000)
return 0;
771 int buffer = prepostAddress(prepost);
774 if (eastwest==east) {
return (mBBC[buffer]->ZDClayer1[1] >> (verthori ? 6 : 9)) % 8;}
775 else {
return (mBBC[buffer]->ZDClayer1[1] >> (verthori ? 0 : 3)) % 8;}
781 unsigned short StTriggerData2009::zdcTruncatedSum(StBeamDirection eastwest,
int prepost)
const
783 if(mRun<12000000)
return 0;
784 int buffer = prepostAddress(prepost);
787 if (eastwest==east) {
return (mBBC[buffer]->ZDClayer1[2] >> (26-16)) % 8;}
788 else {
return (mBBC[buffer]->ZDClayer1[2] >> (29-16)) % 8;}
794 unsigned short StTriggerData2009::pp2ppADC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost)
const
796 static const int map[2][2][2][2] ={ { { { 0, 1}, { 2, 3} } , { {16,17}, {18,19} } , } ,
797 { { { 8, 9}, {10,11} } , { {24,25}, {26,27} } , } };
798 if (vh<0 || vh>1)
return 0;
799 if (udio<0 || udio>1)
return 0;
800 if (ch<0 || ch>1)
return 0;
801 int buffer = prepostAddress(prepost);
802 if (buffer >= 0)
return mxq[buffer][2][map[eastwest][vh][udio][ch]];
806 unsigned short StTriggerData2009::pp2ppTAC(StBeamDirection eastwest,
int vh,
int udio,
int ch,
int prepost)
const
808 static const int map[2][2][2][2] ={ { { { 0, 1}, { 2, 3} } , { {16,17}, {18,19} } , } ,
809 { { { 8, 9}, {10,11} } , { {24,25}, {26,27} } , } };
810 if (vh<0 || vh>1)
return 0;
811 if (udio<0 || udio>1)
return 0;
812 if (ch<0 || ch>1)
return 0;
813 int buffer = prepostAddress(prepost);
814 if (buffer >= 0)
return mxq[buffer][2][map[eastwest][vh][udio][ch]+4];
818 unsigned long StTriggerData2009::pp2ppDSM(
int prepost)
const {
819 if (prepost!=0)
return 0;
820 return L1_DSM->TOF[7];
823 unsigned short StTriggerData2009::bemcLayer1DSM(
int channel,
int prepost)
const {
824 const int n_bemc_layer1=48;
825 if (channel<0 || channel >=n_bemc_layer1) {
826 gMessMgr->Warning() <<
"Barrel DSM layer 1 out of range (" << channel <<
")" << endm;
829 int buffer = prepostAddress(prepost);
830 if (buffer >= 0)
if (mBC1[buffer])
return mBC1[buffer]->BEMClayer1[channel];
834 unsigned short StTriggerData2009::eemcLayer1DSM(
int channel,
int prepost)
const {
835 const int n_eemc_layer1=16;
836 if (channel<0 || channel >=n_eemc_layer1) {
837 gMessMgr->Warning() <<
"Endap DSM layer 1 out of range (" << channel <<
")" << endm;
840 int buffer = prepostAddress(prepost);
841 if (buffer >= 0)
if (mBC1[buffer])
return mBC1[buffer]->EEMClayer1[channel];
845 unsigned short StTriggerData2009::emcLayer2DSM(
int channel)
const {
846 const int n_emc_layer2=8;
847 if (channel<0 || channel >=n_emc_layer2) {
848 gMessMgr->Warning() <<
"EMC DSM layer 2 out of range (" << channel <<
")" << endm;
851 return L1_DSM->EMC[channel];
854 unsigned char StTriggerData2009::bemcHighTower(
int patch_id,
int prepost)
const {
856 const int m_max_patch=300;
857 if ( patch_id < 0 || patch_id >= m_max_patch) {
858 gMessMgr->Warning() <<
"Invalid Barrel patch id: " << patch_id << endm;
861 int buffer = prepostAddress(prepost);
864 int channel=patch_id%10;
865 unsigned short trg_word;
868 trg_word=decodeEmc12bit(dsm-15,channel,mBCE[buffer]->BEMCEast);
874 trg_word=decodeEmc12bit(dsm,channel,mBCW[buffer]->BEMCWest);
878 return trg_word & 0x3F;
883 unsigned char StTriggerData2009::bemcJetPatch (
int patch_id,
int prepost)
const
886 const int m_max_patch=300;
887 if ( patch_id < 0 || patch_id >= m_max_patch) {
888 gMessMgr->Warning() <<
"Invalid Barrel patch id: " << patch_id << endm;
891 int buffer = prepostAddress(prepost);
894 int channel=patch_id%10;
895 unsigned short trg_word;
898 trg_word=decodeEmc12bit(dsm-15,channel,mBCE[buffer]->BEMCEast);
904 trg_word=decodeEmc12bit(dsm,channel,mBCW[buffer]->BEMCWest);
908 return trg_word >> 6;
914 unsigned char StTriggerData2009::eemcHighTower(
int patch_id,
int prepost)
const
917 const int m_max_patch=90;
918 if ( patch_id < 0 || patch_id >= m_max_patch) {
919 gMessMgr->Warning() <<
"Invalid Endcap patch id" << endm;
922 int buffer = prepostAddress(prepost);
923 if (buffer >= 0 && mBC1[buffer]) {
925 int channel=patch_id%10;
926 unsigned short trg_word = decodeEmc12bit(dsm,channel,mBC1[buffer]->EEMC);
927 return trg_word & 0x3F;
932 unsigned char StTriggerData2009::eemcJetPatch (
int patch_id,
int prepost)
const
935 const int m_max_patch=90;
936 if ( patch_id < 0 || patch_id >= m_max_patch) {
937 gMessMgr->Warning() <<
"Invalid Endcap patch id" << endm;
940 int buffer = prepostAddress(prepost);
941 if (buffer >= 0 && mBC1[buffer]) {
943 int channel=patch_id%10;
944 unsigned short trg_word = decodeEmc12bit(dsm,channel,mBC1[buffer]->EEMC);
945 return trg_word >> 6;
950 unsigned char StTriggerData2009::bemcHighestTowerADC(
int prepost)
const {
952 const int m_max_patch=300;
954 for (
int i=1; i<m_max_patch; i++){
955 unsigned char hh=bemcHighTower(i,prepost);
961 unsigned char StTriggerData2009::eemcHighestTowerADC(
int prepost)
const {
963 const int m_max_patch=90;
965 for (
int i=1; i<m_max_patch; i++){
966 unsigned char hh=eemcHighTower(i,prepost);
972 char* StTriggerData2009::getTriggerStructure()
974 return (
char*) mData;
982 int StTriggerData2009::getRawSize()
const
984 return mData->totalTriggerLength;
987 unsigned char* StTriggerData2009::getDsm0_BEMCE(
int prepost)
const {
988 int buffer = prepostAddress(prepost);
989 if (buffer >= 0)
if (mBCE[buffer])
return mBCE[buffer]->BEMCEast;
993 unsigned char* StTriggerData2009::getDsm0_BEMCW(
int prepost)
const {
994 int buffer = prepostAddress(prepost);
995 if (buffer >= 0)
if (mBCW[buffer])
return mBCW[buffer]->BEMCWest;
999 unsigned short* StTriggerData2009::getDsm1_BEMC(
int prepost)
const {
1000 int buffer = prepostAddress(prepost);
1001 if (buffer >= 0)
if (mBC1[buffer])
return mBC1[buffer]->BEMClayer1;
1005 unsigned char* StTriggerData2009::getDsm0_EEMC(
int prepost)
const {
1006 int buffer = prepostAddress(prepost);
1007 if (buffer >= 0)
if (mBC1[buffer])
return mBC1[buffer]->EEMC;
1011 unsigned short* StTriggerData2009::getDsm1_EEMC(
int prepost)
const{
1012 int buffer = prepostAddress(prepost);
1013 if (buffer >= 0)
if (mBC1[buffer])
return mBC1[buffer]->EEMClayer1;
1017 unsigned short* StTriggerData2009::getDsm2_EMC()
const{
1021 unsigned short* StTriggerData2009::getDsm3()
const{
1022 return L1_DSM->lastDSM;
1025 int StTriggerData2009::L2ResultsOffset(StL2AlgorithmId
id)
const
1028 default:
return -999999999;
1032 bool StTriggerData2009::isL2Triggered(StL2TriggerResultType
id)
const
1037 unsigned int StTriggerData2009::l2ResultLength()
const
1039 return sizeof(TrgSum->L2Result)/
sizeof(
unsigned int);
1042 const unsigned int* StTriggerData2009::l2Result()
const
1044 return TrgSum->L2Result;
1047 unsigned long long StTriggerData2009::l2sum()
const
1051 unsigned long long hi = TrgSum->L2Sum[1];
1052 unsigned long long lo = TrgSum->L2Sum[0];
1053 unsigned long long mask=(hi<<32) | lo;
1057 unsigned short StTriggerData2009::vpdADC(StBeamDirection eastwest,
int pmt,
int prepost)
const
1059 static const int map[16] = {0, 1, 2, 3, 8, 9,10,11,16,17,18,19,24,25,26,27};
1060 if (pmt<1 || pmt>16)
return 0;
1061 int buffer = prepostAddress(prepost);
1063 if (mRun<=12003001) {
return bbq[buffer][10+(int)eastwest*2][map[pmt-1]];}
1064 else {
return bbq[buffer][6+(int)eastwest*2][map[pmt-1]];}
1069 unsigned short StTriggerData2009::vpdTDC(StBeamDirection eastwest,
int pmt,
int prepost)
const
1071 static const int map[16] = {0, 1, 2, 3, 8, 9,10,11,16,17,18,19,24,25,26,27};
1072 if (pmt<1 || pmt>16)
return 0;
1073 int buffer = prepostAddress(prepost);
1075 if (mRun<=12003001) {
return bbq[buffer][10+(int)eastwest*2][map[pmt-1]+4];}
1076 else {
return bbq[buffer][6+(int)eastwest*2][map[pmt-1]+4];}
1081 unsigned short StTriggerData2009::vpdADCHighThr(StBeamDirection eastwest,
int pmt,
int prepost)
const
1083 static const int map[16] = {0, 1, 2, 3, 8, 9,10,11,16,17,18,19,24,25,26,27};
1084 if (pmt<1 || pmt>16)
return 0;
1085 int buffer = prepostAddress(prepost);
1087 if (mRun<=12003001) {
return bbq[buffer][6+(int)eastwest*2][map[pmt-1]];}
1088 else {
return mxq[buffer][6+(int)eastwest*2][map[pmt-1]];}
1093 unsigned short StTriggerData2009::vpdTDCHighThr(StBeamDirection eastwest,
int pmt,
int prepost)
const
1095 static const int map[16] = {0, 1, 2, 3, 8, 9,10,11,16,17,18,19,24,25,26,27};
1096 if (pmt<1 || pmt>16)
return 0;
1097 int buffer = prepostAddress(prepost);
1099 if (mRun<=12003001) {
return bbq[buffer][6+(int)eastwest*2][map[pmt-1]+4];}
1100 else {
return mxq[buffer][6+(int)eastwest*2][map[pmt-1]+4];};
1105 unsigned short StTriggerData2009::vpdEarliestTDC(StBeamDirection eastwest,
int prepost)
const
1107 int buffer = prepostAddress(prepost);
1110 if (mRun<=10096084){
1111 if (eastwest==east) {
return mBBC[buffer]->VPD[6]%4096;}
1112 else {
return mBBC[buffer]->VPD[4]%4096;}
1114 else if(mRun<=12003001) {
1115 if (eastwest==east) {
return mBBC[buffer]->VPD[2]%4096;}
1116 else {
return mBBC[buffer]->VPD[0]%4096;}
1119 if (eastwest==east) {
return mBBC[buffer]->VPD[6]%4096;}
1120 else {
return mBBC[buffer]->VPD[4]%4096;}
1128 unsigned short StTriggerData2009::vpdEarliestTDCHighThr(StBeamDirection eastwest,
int prepost)
const
1130 int buffer = prepostAddress(prepost);
1132 if (mRun<=10365999){
1135 else if(mRun<=12003001) {
1137 if (eastwest==east) {
return mBBC[buffer]->VPD[6]%4096;}
1138 else {
return mBBC[buffer]->VPD[4]%4096;}
1142 if (eastwest==east) {
return mMIX[buffer]->MTD_P2PLayer1[13] + ((mMIX[buffer]->MTD_P2PLayer1[12]&0x0f)<<8);}
1143 else {
return mMIX[buffer]->MTD_P2PLayer1[9] + ((mMIX[buffer]->MTD_P2PLayer1[8]&0x0f)<<8);}
1150 unsigned short StTriggerData2009::vpdTimeDifference()
const
1152 return L1_DSM->VTX[7]%8192;
1155 unsigned short StTriggerData2009::nQTdata(
int prepost)
const
1160 unsigned int* StTriggerData2009::QTdata(
int prepost)
const
1165 unsigned short StTriggerData2009::fmsADC(
int crt,
int adr,
int ch,
int prepost)
const
1167 int buffer = prepostAddress(prepost);
1168 if (buffer >= 0 && crt>=1 && crt<=5 && adr>=0 && adr<16 && ch>=0 && ch<=31){
1170 case 1:
return qt1[buffer][adr][ch];
1171 case 2:
return qt2[buffer][adr][ch];
1172 case 3:
return qt3[buffer][adr][ch];
1173 case 4:
return qt4[buffer][adr][ch];
1174 case 5:
return feq[buffer][adr][ch];
1180 unsigned short StTriggerData2009::fmsTDC(
int crt,
int adr,
int ch,
int prepost)
const
1182 int buffer = prepostAddress(prepost);
1183 if (buffer >= 0 && crt>=1 && crt<=5 && adr>=0 && adr<16 && ch>=0 && ch<=31){
1185 case 1:
return tqt1[buffer][adr][ch];
1186 case 2:
return tqt2[buffer][adr][ch];
1187 case 3:
return tqt3[buffer][adr][ch];
1188 case 4:
return tqt4[buffer][adr][ch];
1189 case 5:
return tfeq[buffer][adr][ch];
1195 unsigned char* StTriggerData2009::getDsm_FMS(
int prepost)
const
1197 int buffer = prepostAddress(prepost);
1198 if (buffer >= 0)
if (mFMS[buffer])
return mFMS[buffer]->FMS;
1202 unsigned short* StTriggerData2009::getDsm1_FMS(
int prepost)
const
1204 int buffer = prepostAddress(prepost);
1205 if (buffer >= 0)
if (mMIX[buffer])
return mMIX[buffer]->FPDEastNSLayer1;
1209 unsigned short* StTriggerData2009::getDsm2_FMS()
const {
return L1_DSM->FPD;}
1211 unsigned short StTriggerData2009::mtdAtAddress(
int address,
int prepost)
const
1213 int buffer = prepostAddress(prepost);
1214 if (buffer >= 0 && address>=0 && address<32)
return mxq[buffer][0][address];
1218 unsigned short StTriggerData2009::mtdgemAtAddress(
int address,
int prepost)
const
1220 if (mRun<=12003001)
return 0;
1221 int buffer = prepostAddress(prepost);
1222 if (buffer >= 0 && address>=0 && address<32)
return mxq[buffer][10][address];
1227 unsigned short StTriggerData2009::mtdAdc(StBeamDirection eastwest,
int pmt,
int prepost)
const
1230 int buffer = prepostAddress(prepost);
1231 if (buffer >= 0 && pmt==0){
1232 if (eastwest==east) {
1233 if (mRun<=10133008)
return mxq[buffer][0][0];
1234 else return mxq[buffer][0][24];
1236 if (eastwest==west)
return mxq[buffer][0][8];
1241 unsigned short StTriggerData2009::mtdTdc(StBeamDirection eastwest,
int pmt,
int prepost)
const
1244 int buffer = prepostAddress(prepost);
1245 if (buffer >= 0 && pmt==0){
1246 if (eastwest==east) {
1247 if (mRun<=10133008)
return mxq[buffer][0][4];
1248 else return mxq[buffer][0][28];
1250 if (eastwest==west)
return mxq[buffer][0][12];
1255 unsigned char StTriggerData2009::mtdDsmAtCh(
int ch,
int prepost)
const
1257 int map[16] = {7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8};
1258 int buffer = prepostAddress(prepost);
1259 if (buffer >= 0 && ch>=0 && ch<16){
1260 if (mMIX[buffer])
return mMIX[buffer]->MTD_P2PLayer1[map[ch]];
1265 bool StTriggerData2009::mtdDsmHit(
int pmt,
int prepost)
const
1268 int buffer = prepostAddress(prepost);
1271 if(mRun<10133008 && mRun<11000000){
1272 if( (mMIX[buffer]->MTD_P2PLayer1[5] & 0x1) && (mMIX[buffer]->MTD_P2PLayer1[5] & 0x10) )
return true;
1274 if(prepost!=0)
return false;
1275 return (L1_DSM->TOF[3] & 0x1);
1282 unsigned short StTriggerData2009::tofAtAddress(
int address,
int prepost)
const
1284 int buffer = prepostAddress(prepost);
1285 if (buffer>=0 && address>=0 && address<48) {
1286 if (mMIX[buffer])
return mMIX[buffer]->TOF[address];
1291 unsigned short StTriggerData2009::tofTrayMultiplicity(
int tray,
int prepost)
const
1293 int dsmmap[8] = {3,2,1,0,7,6,5,4};
1294 int traydsm[120] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5,
1295 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3,
1296 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
1297 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
1298 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
1299 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1};
1300 int traych[120] = { 2, 1, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 7, 6, 5, 4, 3,
1301 2, 1, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 7, 6, 5, 4, 3,
1302 2, 1, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 7, 6, 5, 4, 3,
1303 18,19,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,
1304 18,19,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,
1305 18,19,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17};
1306 int buffer = prepostAddress(prepost);
1307 if (buffer>=0 && tray>=1 && tray<=120) {
1309 int address = traydsm[tray-1]*8 + dsmmap[traych[tray-1]/3];
1310 int ch = traych[tray-1]%3;
1311 return (mMIX[buffer]->TOF[address] >> (5*ch)) & 0x1f;
1317 unsigned short StTriggerData2009::tofMultiplicity(
int prepost)
const
1319 if (prepost==0)
return L1_DSM->TOF[1]%8192;
1323 void StTriggerData2009::dump()
const
1325 printf(
"***** StTriggerData Dump *****\n");
1326 printf(
" mDebug=%d mData=%p\n",mDebug,mData);
1327 printf(
" Year=%d Version=%x\n",year(),version());
1328 printf(
" Run#=%d Event#=%d\n",mRun,eventNumber());
1329 printf(
" %d pre and %d post crossing data available\n",numberOfPreXing(),numberOfPostXing());
1330 printf(
" Token=%d TriggerWord=%x ActionWord=%x BusyStatus=%x\n",
1331 token(), triggerWord(), actionWord(), busyStatus());
1332 printf(
" TUC Bits=%d : ",tcuBits());
1333 for (
int i=0; i<16; i++) {printf(
" %d",(tcuBits()>>(15-i))%2);}; printf(
"\n");
1334 printf(
" BunchId 7bit=%d 48bit=%d\n",bunchId7Bit(), bunchId48Bit());
1335 printf(
" Spin Bits=%d : ",spinBit());
1336 for (
int i=0; i<8; i++) {printf(
" %d",(spinBit()>>(7-i))%2);}; printf(
"\n");
1338 printf(
" BBC East ADC : ");
for (
int i=1; i<=24;i++){ printf(
"%d ",bbcADC(east,i,0)); }; printf(
"\n");
1339 printf(
" BBC West ADC : ");
for (
int i=1; i<=24;i++){ printf(
"%d ",bbcADC(west,i,0)); }; printf(
"\n");
1340 printf(
" BBC East TAC : ");
for (
int i=1; i<=16;i++){ printf(
"%d ",bbcTDC(east,i,0)); }; printf(
"\n");
1341 printf(
" BBC West TAC : ");
for (
int i=1; i<=16;i++){ printf(
"%d ",bbcTDC(west,i,0)); }; printf(
"\n");
1342 for (
int i=-numberOfPreXing(); i<=static_cast<int>(numberOfPostXing()); i++){
1343 printf(
" BBC Sums %d xing : ",i);
1344 printf(
"East=%d West=%d Large tile East=%d West=%d\n",
1345 bbcADCSum(east,i),bbcADCSum(west,i),
1346 bbcADCSumLargeTile(east,i),bbcADCSumLargeTile(west,i));
1348 printf(
" BBC Earilest : "); printf(
"East=%d West=%d Difference+256=%d\n",
1349 bbcEarliestTDC(east,0),bbcEarliestTDC(west,0),bbcTimeDifference());
1350 printf(
" ZDC Earilest : "); printf(
"East=%d West=%d Difference=%d\n",
1351 zdcEarliestTDC(east,0),zdcEarliestTDC(west,0),zdcTimeDifference());
1363 printf(
" ZDC Sum(A) East : ");printf(
"%d ",zdcAttenuated(east)); printf(
"\n");
1364 printf(
" ZDC Sum(A) West : ");printf(
"%d ",zdcAttenuated(west)); printf(
"\n");
1365 printf(
" ZDC Sum(UA) East : ");printf(
"%d ",zdcUnAttenuated(east)); printf(
"\n");
1366 printf(
" ZDC Sum(UA) West : ");printf(
"%d ",zdcUnAttenuated(west)); printf(
"\n");
1367 printf(
" VPD E Earliest TAC : %d\n", vpdEarliestTDC(east));
1368 printf(
" VPD W Earliest TAC : %d\n", vpdEarliestTDC(west));
1369 printf(
" VPD TimeDifference : %d\n", vpdTimeDifference());
1370 printf(
" L2 result : \n");
1371 for (
int j=0; j<4 ;j++) {
for (
int k=0; k<16; k++) {printf(
"%u ",*(l2Result()+j*16+k)); } printf(
"\n");}
1372 printf(
"BBClayer1:");
1373 int buffer = prepostAddress(0);
1376 for (
int i = 0;i < 16;i++) printf(
" %1x %04X", i, mBBC[buffer]->BBClayer1[i]);
1380 printf(
"ZDClayer1:");
1383 for (
int i = 0;i < 8;i++) printf(
" %1x %04X", i, mBBC[buffer]->ZDClayer1[i]);
1387 printf(
"VPDlayer1:");
1390 for (
int i = 0;i < 8;i++) printf(
" %1x %04X", i, mBBC[buffer]->VPD[i]);
1396 for (
int i = 0;i < 8;i++) printf(
" %1x %04X", i, L1_DSM->VTX[i]);
1399 printf(
"Last DSM:");
1401 for (
int i = 0;i < 8;i++) printf(
" %1x %04X", i, L1_DSM->lastDSM[i]);
1404 printf(
"***** End StTriggerData Dump *****\n");
1407 void StTriggerData2009::killFMS(){
1409 int npre = numberOfPreXing();
1410 int npost = numberOfPostXing();
1411 for (
int i=0; i<1+npre+npost; i++){
1413 {offlen = mData->MainX;}
1415 if (mData->PrePostList[i-1]==0)
continue;
1416 offlen = (
TrgOfflen2009*) ((
char*)mData + mData->PrePostList[i-1]);
1419 j=offlen[y9FEQ_CONF_NUM].length;
if (j>0){memset((
char*)mData + offlen[y9FEQ_CONF_NUM].offset, 0, j); offlen[y9FEQ_CONF_NUM].length=0;};
1420 j=offlen[y9QT1_CONF_NUM].length;
if (j>0){memset((
char*)mData + offlen[y9QT1_CONF_NUM].offset, 0, j); offlen[y9QT1_CONF_NUM].length=0;};
1421 j=offlen[y9QT2_CONF_NUM].length;
if (j>0){memset((
char*)mData + offlen[y9QT2_CONF_NUM].offset, 0, j); offlen[y9QT2_CONF_NUM].length=0;};
1422 j=offlen[y9QT3_CONF_NUM].length;
if (j>0){memset((
char*)mData + offlen[y9QT3_CONF_NUM].offset, 0, j); offlen[y9QT3_CONF_NUM].length=0;};
1423 j=offlen[y9QT4_CONF_NUM].length;
if (j>0){memset((
char*)mData + offlen[y9QT4_CONF_NUM].offset, 0, j); offlen[y9QT4_CONF_NUM].length=0;};
1427 void StTriggerData2009::Streamer(TBuffer &R__b)
1431 if (R__b.IsReading()) {
1432 R__b.ReadClassBuffer(StTriggerData2009::Class(),
this);
1434 if(mData) readData();
1437 R__b.WriteClassBuffer(StTriggerData2009::Class(),
this);