68 #include "StTriggerData2003.h"
69 #include "StDaqLib/TRG/trgStructures2003.h"
85 int npre = data->EvtDesc.npre;
86 int npost = data->EvtDesc.npost;
94 memcpy(mData,data,size);
98 unsigned int StTriggerData2003::version()
const
100 return mData->EvtDesc.TrgDataFmtVer;
103 StTriggerData2003::~StTriggerData2003()
106 unsigned int StTriggerData2003::token()
const
108 return mData->EvtDesc.TrgToken;
111 unsigned int StTriggerData2003::triggerWord()
const
113 return mData->EvtDesc.TriggerWord;
116 unsigned int StTriggerData2003::actionWord()
const
119 ( (
unsigned short)(mData->EvtDesc.actionWdTrgCommand) * 16 * 16 * 16 ) +
120 ( (
unsigned short)(mData->EvtDesc.actionWdDaqCommand) * 16 * 16 ) +
121 ( mData->EvtDesc.actionWdDetectorBitMask & 0x00ff ) ;
124 unsigned int StTriggerData2003::numberOfPreXing()
const
126 return mData->EvtDesc.npre;
129 unsigned int StTriggerData2003::numberOfPostXing()
const
131 return mData->EvtDesc.npost;
134 unsigned short StTriggerData2003::busyStatus()
const{
135 return mData->EvtDesc.modifiedBusyStatus;
138 unsigned short StTriggerData2003::dsmInput()
const{
139 return mData->EvtDesc.DSMInput;
142 unsigned short StTriggerData2003::trgToken()
const{
143 return mData->EvtDesc.TrgToken;
146 unsigned short StTriggerData2003::dsmAddress()
const{
147 return mData->EvtDesc.DSMAddress;
150 unsigned short StTriggerData2003::mAddBits()
const{
151 return mData->EvtDesc.addBits;
154 unsigned short StTriggerData2003::bcData(
int channel)
const{
155 return mData->TrgSum.DSMdata.BCdata[channel];
158 unsigned short StTriggerData2003::lastDSM(
int channel)
const{
159 return mData->TrgSum.DSMdata.lastDSM[channel];
162 unsigned short StTriggerData2003::tcuBits()
const
164 return mData->EvtDesc.DSMInput;
167 unsigned int StTriggerData2003::bunchCounterHigh()
const
169 return mData->EvtDesc.bunchXing_hi;
172 unsigned int StTriggerData2003::bunchCounterLow()
const
174 return mData->EvtDesc.bunchXing_lo;
177 unsigned int StTriggerData2003::bunchId48Bit()
const
179 unsigned long long bxinghi,bxing1,bxinglo, bx;
180 bxinghi = mData->TrgSum.DSMdata.BCdata[3];
181 bxing1 = mData->TrgSum.DSMdata.BCdata[10];
182 bxinglo = (bxing1 << 16) + mData->TrgSum.DSMdata.BCdata[11];
183 bx = (bxinghi << 32) + bxinglo;
184 return (
int)(bx % 120);
187 unsigned int StTriggerData2003::bunchId7Bit()
const
190 b7dat = mData->TrgSum.DSMdata.BCdata[2];
195 unsigned int StTriggerData2003::spinBit()
const
197 return (mData->TrgSum.DSMdata.lastDSM[7]/16)%256;
200 unsigned int StTriggerData2003::spinBitYellowFilled()
const
202 unsigned int sb = spinBit();
206 unsigned int StTriggerData2003::spinBitYellowUp()
const
208 unsigned int sb = spinBit();
212 unsigned int StTriggerData2003::spinBitYellowDown()
const
214 unsigned int sb = spinBit();
218 unsigned int StTriggerData2003::spinBitYellowUnpol()
const
220 unsigned int sb = spinBit();
224 unsigned int StTriggerData2003::spinBitBlueFilled()
const
226 unsigned int sb = spinBit();
230 unsigned int StTriggerData2003::spinBitBlueUp()
const
232 unsigned int sb = spinBit();
236 unsigned int StTriggerData2003::spinBitBlueDown()
const
238 unsigned int sb = spinBit();
242 unsigned int StTriggerData2003::spinBitBlueUnpol()
const
244 unsigned int sb = spinBit();
248 unsigned short StTriggerData2003::ctbRaw(
int address,
int prepost)
const
250 return mData->rawTriggerDet[prepostAddress(prepost)].CTB[address];
253 unsigned short StTriggerData2003::ctb(
int pmt,
int prepost)
const
255 static const unsigned char ctbMap[240] = {
256 7, 6, 5, 4, 3, 23, 22, 21, 20, 19,
257 2, 1, 0, 15, 14, 18, 17, 16, 31, 30,
258 13, 12, 11, 10, 9, 29, 28, 27, 26, 25,
259 39, 38, 37, 36, 35, 55, 54, 53, 52, 51,
260 34, 33, 32, 47, 46, 50, 49, 48, 63, 62,
261 45, 44, 43, 42, 41, 61, 60, 59, 58, 57,
262 71, 70, 69, 68, 67, 87, 86, 85, 84, 83,
263 66, 65, 64, 79, 78, 82, 81, 80, 95, 94,
264 77, 76, 75, 74, 73, 93, 92, 91, 90, 89,
265 103, 102, 101, 100, 99, 119, 118, 117, 116, 115,
266 98, 97, 96, 111, 110, 114, 113, 112, 127, 126,
267 109, 108, 107, 106, 105, 125, 124, 123, 122, 121,
268 135, 134, 133, 132, 131, 151, 150, 149, 148, 147,
269 130, 129, 128, 143, 142, 146, 145, 144, 159, 158,
270 141, 140, 139, 138, 137, 157, 156, 155, 154, 153,
271 167, 166, 165, 164, 163, 183, 182, 181, 180, 179,
272 162, 161, 160, 175, 174, 178, 177, 176, 191, 190,
273 173, 172, 171, 170, 169, 189, 188, 187, 186, 185,
274 199, 198, 197, 196, 195, 215, 214, 213, 212, 211,
275 194, 193, 192, 207, 206, 210, 209, 208, 223, 222,
276 205, 204, 203, 202, 201, 221, 220, 219, 218, 217,
277 231, 230, 229, 228, 227, 247, 246, 245, 244, 243,
278 226, 225, 224, 239, 238, 242, 241, 240, 255, 254,
279 237, 236, 235, 234, 233, 253, 252, 251, 250, 249,
281 return mData->rawTriggerDet[prepostAddress(prepost)].CTB[ctbMap[pmt]];
284 unsigned short StTriggerData2003::ctbTraySlat(
int tray,
int slat,
int prepost)
const{
285 static const unsigned char ctbMap[2][120] = {
286 { 109, 108, 107, 106, 105, 7, 6, 5, 4, 3,
287 2, 1, 0, 15, 14, 13, 12, 11, 10, 9,
288 39, 38, 37, 36, 35, 34, 33, 32, 47, 46,
289 45, 44, 43, 42, 41, 71, 70, 69, 68, 67,
290 66, 65, 64, 79, 78, 77, 76, 75, 74, 73,
291 103, 102, 101, 100, 99, 98, 97, 96, 111, 110,
292 141, 140, 139, 138, 137, 167, 166, 165, 164, 163,
293 162, 161, 160, 175, 174, 173, 172, 171, 170, 169,
294 199, 198, 197, 196, 195, 194, 193, 192, 207, 206,
295 205, 204, 203, 202, 201, 231, 230, 229, 228, 227,
296 226, 225, 224, 239, 238, 237, 236, 235, 234, 233,
297 135, 134, 133, 132, 131, 130, 129, 128, 143, 142},
298 { 125, 124, 123, 122, 121, 23, 22, 21, 20, 19,
299 18, 17, 16, 31, 30, 29, 28, 27, 26, 25,
300 55, 54, 53, 52, 51, 50, 49, 48, 63, 62,
301 61, 60, 59, 58, 57, 87, 86, 85, 84, 83,
302 82, 81, 80, 95, 94, 93, 92, 91, 90, 89,
303 119, 118, 117, 116, 115, 114, 113, 112, 127, 126,
304 157, 156, 155, 154, 153, 183, 182, 181, 180, 179,
305 178, 177, 176, 191, 190, 189, 188, 187, 186, 185,
306 215, 214, 213, 212, 211, 210, 209, 208, 223, 222,
307 221, 220, 219, 218, 217, 247, 246, 245, 244, 243,
308 242, 241, 240, 255, 254, 253, 252, 251, 250, 249,
309 151, 150, 149, 148, 147, 146, 145, 144, 159, 158}
311 int add=prepostAddress(prepost);
312 if(add>=0)
return mData->rawTriggerDet[prepostAddress(prepost)].CTB[ctbMap[slat][tray]];
316 unsigned short StTriggerData2003::ctbSum(
int prepost)
const{
317 unsigned short sum=0;
318 for(
int i=1; i<240; i++){sum+=ctb(i,prepost);}
322 unsigned short StTriggerData2003::mwc(
int pmt,
int prepost)
const
324 static const unsigned char mwcMap[96] = {
325 71, 70, 69, 68, 67, 66, 65, 64, 79, 78, 77, 76,
326 95, 94, 93, 92, 87, 86, 85, 84, 83, 82, 81, 80,
327 99, 98, 97, 96, 111, 110, 109, 108, 103, 102, 101, 100,
328 119, 118, 117, 116, 115, 114, 113, 112, 127, 126, 125, 124,
329 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12,
330 31, 30, 29, 28, 23, 22, 21, 20, 19, 18, 17, 16,
331 35, 34, 33, 32, 47, 46, 45, 44, 39, 38, 37, 36,
332 55, 54, 53, 52, 51, 50, 49, 48, 63, 62, 61, 60,
334 return mData->rawTriggerDet[prepostAddress(prepost)].MWC[mwcMap[pmt]];
337 unsigned short StTriggerData2003::bbcADC(StBeamDirection eastwest,
int pmt,
int prepost)
const
339 static const int q_map[2][24] = {
340 { 8 , 5 , 4 , 40 , 37 , 36 , 7 , 6 ,
341 3 , 2 , 1 , 39 , 38 , 35 , 34 , 33 ,
342 72 , 71 , 70 , 69 , 68 , 67 , 66 , 65 },
343 { 24 , 21 , 20 , 56 , 53 , 52 , 23 , 22 ,
344 19 , 18 , 17 , 55 , 54 , 51 , 50 , 49 ,
345 80 , 79 , 78 , 77 , 76 , 75 , 74 , 73 }
347 return mData->rawTriggerDet[prepostAddress(prepost)].BBC[q_map[eastwest][pmt-1]-1];
350 unsigned short StTriggerData2003::bbcTDC(StBeamDirection eastwest,
int pmt,
int prepost)
const
352 static const int t_map[2][16] ={
353 { 16 , 13 , 12 , 48 , 45 , 44 , 15 , 14 ,
354 11 , 10 , 9 , 47 , 46 , 43 , 42 , 41 },
355 { 32 , 29 , 28 , 64 , 61 , 60 , 31 , 30 ,
356 27 , 26 , 25 , 63 , 62 , 59 , 58 , 57 }
358 return mData->rawTriggerDet[prepostAddress(prepost)].BBC[t_map[eastwest][pmt-1]-1];
361 unsigned short StTriggerData2003::bbcADCSum(StBeamDirection eastwest,
int prepost)
const
363 int address = prepostAddress(prepost);
366 mData->rawTriggerDet[address].BBClayer1[7]%2048+
367 mData->rawTriggerDet[address].BBClayer1[3]%2048;
371 mData->rawTriggerDet[address].BBClayer1[5]%2048+
372 mData->rawTriggerDet[address].BBClayer1[1]%2048;
376 unsigned short StTriggerData2003::bbcADCSumLargeTile(StBeamDirection eastwest,
int prepost)
const
378 int address = prepostAddress(prepost);
379 if(eastwest==east){
return mData->rawTriggerDet[address].BBClayer1[11]%2048; }
380 else {
return mData->rawTriggerDet[address].BBClayer1[10]%2048; }
383 unsigned short StTriggerData2003::bbcEarliestTDC(StBeamDirection eastwest,
int prepost)
const
385 int address = prepostAddress(prepost), t1, t2;
387 t1 = mData->rawTriggerDet[address].BBClayer1[6]%256;
388 t2 = mData->rawTriggerDet[address].BBClayer1[2]%256;
391 t1 = mData->rawTriggerDet[address].BBClayer1[4]%256;
392 t2 = mData->rawTriggerDet[address].BBClayer1[0]%256;
394 return (t1>t2) ? t1 : t2;
397 unsigned short StTriggerData2003::bbcTimeDifference()
const
399 return mData->TrgSum.DSMdata.VTX[3]%512;
402 unsigned short StTriggerData2003::fpd(StBeamDirection eastwest,
int module,
int pmt,
int prepost)
const
404 static const short fpdmap[2][6][49] = {
408 {39, 38, 37, 36, 35, 34, 33,
409 7, 6, 5, 23, 22, 21, 55,
410 4, 3, 2, 20, 19, 18, 54,
411 1, 0, 15, 17, 16, 31, 53,
412 14, 13, 12, 30, 29, 28, 52,
413 11, 10, 9, 27, 26, 25, 51,
414 32, 47, 46, 45, 44, 43, 42},
416 { 103,101,100, 99, 98, 97, 96,
417 71, 70, 69, 87, 86, 85, 48,
418 68, 67, 66, 84, 83, 82, 63,
419 65, 64, 79, 81, 80, 95, 61,
420 78, 77 ,76, 94, 93, 92, 60,
421 75, 74, 73, 91, 90, 89, 59,
422 111,110,109,108, 107, 106,105},
424 {135, 134, 133, 132, 131, 130, 129, 128, 143, 142,
425 119, 118, 117, 116, 115, 114, 113, 112,
426 127, 126, 125, 124, 123, 122, 121,
428 -1, -1, -1, -1, -1, -1, -1,
429 -1, -1, -1, -1, -1, -1, -1,
430 -1, -1, -1, -1, -1, -1, -1},
432 {151, 150, 149, 148, 147, 146, 145, 144,
433 159, 158, 157, 156, 155, 154, 153,
434 167, 166, 165, 164, 163, 162, 161, 160, 175, 174,
436 -1, -1, -1, -1, -1, -1, -1,
437 -1, -1, -1, -1, -1, -1, -1,
438 -1, -1, -1, -1, -1, -1, -1},
440 { 50, 49, 141, 140, 139, 138, 137,
441 -1, -1, -1, -1, -1, -1, -1,
442 -1, -1, -1, -1, -1, -1, -1,
443 -1, -1, -1, -1, -1, -1, -1,
444 -1, -1, -1, -1, -1, -1, -1,
445 -1, -1, -1, -1, -1, -1, -1,
446 -1, -1, -1, -1, -1, -1, -1},
448 { 58, 57, 173, 172, 171, 170, 169,
449 -1, -1, -1, -1, -1, -1, -1,
450 -1, -1, -1, -1, -1, -1, -1,
451 -1, -1, -1, -1, -1, -1, -1,
452 -1, -1, -1, -1, -1, -1, -1,
453 -1, -1, -1, -1, -1, -1, -1,
454 -1, -1, -1, -1, -1, -1, -1},
459 { -1, -1, -1, -1, -1, -1, -1,
460 -1, -1, -1, -1, -1, -1, -1,
461 -1, -1, -1, -1, -1, -1, -1,
462 -1, -1, -1, -1, -1, -1, -1,
463 -1, -1, -1, -1, -1, -1, -1,
464 -1, -1, -1, -1, -1, -1, -1,
465 -1, -1, -1, -1, -1, -1, -1},
467 { 7, 6, 25, 22, 41, 38, 48,
468 5, 4, 21, 20, 37, 36, 54,
469 3, 2, 19, 18, 35, 34, 53,
470 1, 0, 17, 16, 33, 32, 52,
471 15, 14, 31, 30, 47, 46, 51,
472 13, 12, 29, 28, 45, 44, 50,
473 9, 10, 27, 26, 43, 42, 49},
475 { -1, -1, -1, -1, -1, -1, -1,
476 -1, -1, -1, -1, -1, -1, -1,
477 -1, -1, -1, -1, -1, -1, -1,
478 -1, -1, -1, -1, -1, -1, -1,
479 -1, -1, -1, -1, -1, -1, -1,
480 -1, -1, -1, -1, -1, -1, -1,
481 -1, -1, -1, -1, -1, -1, -1},
489 -1, -1, -1, -1, -1, -1, -1,
490 -1, -1, -1, -1, -1, -1, -1,
491 -1, -1, -1, -1, -1, -1, -1},
493 { -1, -1, -1, -1, -1, -1, -1,
494 -1, -1, -1, -1, -1, -1, -1,
495 -1, -1, -1, -1, -1, -1, -1,
496 -1, -1, -1, -1, -1, -1, -1,
497 -1, -1, -1, -1, -1, -1, -1,
498 -1, -1, -1, -1, -1, -1, -1,
499 -1, -1, -1, -1, -1, -1, -1},
501 { 63, 62, 61, 60, 59, 58, -1,
502 -1, -1, -1, -1, -1, -1, -1,
503 -1, -1, -1, -1, -1, -1, -1,
504 -1, -1, -1, -1, -1, -1, -1,
505 -1, -1, -1, -1, -1, -1, -1,
506 -1, -1, -1, -1, -1, -1, -1,
507 -1, -1, -1, -1, -1, -1, -1},
510 int address = fpdmap[eastwest][module][pmt-1];
513 if(address<112)
return mData->rawTriggerDet[prepostAddress(prepost)].FPDEastNSLayer0[address];
514 else return mData->rawTriggerDet[prepostAddress(prepost)].FPDEastTBLayer0[address-112];
516 if(address<112)
return mData->rawTriggerDet[prepostAddress(prepost)].FPDWestNSLayer0[address];
517 else return mData->rawTriggerDet[prepostAddress(prepost)].FPDWestTBLayer0[address-112];
524 unsigned short StTriggerData2003::fpdSum(StBeamDirection eastwest,
int module)
const
526 static const short map[2][4]={{3,2,1,0},{7,6,5,4}};
527 static const short nbit[2][4]={{16384,16384,8192,8192},{16384,16384,8192,8192}};
528 return mData->TrgSum.DSMdata.FPD[map[eastwest][module]] % nbit[eastwest][module];
531 unsigned short StTriggerData2003::fpdLayer1DSMRaw(StBeamDirection eastwest,
int channel,
int prepost)
const{
533 if(channel<8)
return mData->rawTriggerDet[prepostAddress(prepost)].FPDEastNSLayer1[channel];
534 if(channel<16)
return mData->rawTriggerDet[prepostAddress(prepost)].FPDEastTBLayer1[channel-8];
536 if(channel<8)
return mData->rawTriggerDet[prepostAddress(prepost)].FPDWestNSLayer1[channel];
537 if(channel<16)
return mData->rawTriggerDet[prepostAddress(prepost)].FPDWestTBLayer1[channel-8];
542 unsigned short StTriggerData2003::fpdLayer1DSM(StBeamDirection eastwest,
int module,
int board,
int prepost)
const{
543 static const short map[4][4]={{3,2,1,0},{7,6,5,4},{3,2,6,7},{0,1,4,5}};
546 if(module<2)
return mData->rawTriggerDet[prepostAddress(prepost)].FPDEastNSLayer1[map[module][board]];
547 else return mData->rawTriggerDet[prepostAddress(prepost)].FPDEastTBLayer1[map[module][board]];
549 if(module<2)
return mData->rawTriggerDet[prepostAddress(prepost)].FPDWestNSLayer1[map[module][board]];
550 else return mData->rawTriggerDet[prepostAddress(prepost)].FPDWestTBLayer1[map[module][board]];
556 unsigned short StTriggerData2003::fpdLayer2DSMRaw(
int channel)
const{
557 if(channel<8)
return mData->TrgSum.DSMdata.FPD[channel];
561 unsigned short StTriggerData2003::fpdLayer2DSM(StBeamDirection eastwest,
int module)
const{
562 static const int dsmmap[2][4]={{3,2,1,0},{7,6,5,4}};
563 if(module<4)
return mData->TrgSum.DSMdata.FPD[dsmmap[eastwest][module]];
567 unsigned short StTriggerData2003::zdcAtChannel(
int channel,
int prepost)
const
569 static const int dsmmap[16]={7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8};
570 if(channel>=0 && channel<16){
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[dsmmap[channel]]; }
574 unsigned short StTriggerData2003::zdcAtAddress(
int address,
int prepost)
const
576 if(address>=0 && address<16){
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[address]; }
580 unsigned short StTriggerData2003::zdcUnAttenuated(StBeamDirection eastwest,
int prepost)
const
582 if(eastwest==east) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[4];}
583 if(eastwest==west) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[0];}
587 unsigned short StTriggerData2003::zdcAttenuated(StBeamDirection eastwest,
int prepost)
const
589 if(eastwest==east) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[13];}
590 if(eastwest==west) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[10];}
594 unsigned short StTriggerData2003::zdcADC(StBeamDirection eastwest,
int pmt,
int prepost)
const
596 if(eastwest==east && pmt==1) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[7];}
597 if(eastwest==east && pmt==2) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[6];}
598 if(eastwest==east && pmt==3) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[5];}
599 if(eastwest==west && pmt==1) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[3];}
600 if(eastwest==west && pmt==2) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[2];}
601 if(eastwest==west && pmt==3) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[1];}
605 unsigned short StTriggerData2003::zdcTDC(StBeamDirection eastwest,
int prepost)
const
607 if(eastwest==east) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[8];}
608 if(eastwest==west) {
return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[9];}
612 unsigned short StTriggerData2003::zdcHardwareSum(
int prepost)
const
614 return mData->rawTriggerDet[prepostAddress(prepost)].ZDC[14];
617 unsigned short StTriggerData2003::bemcLayer1DSM(
int channel,
int prepost)
const {
618 const int n_bemc_layer1=48;
619 if (channel<0 || channel >=n_bemc_layer1) {
620 gMessMgr->Warning() <<
"Barrel DSM layer 1 out of range (" << channel <<
")" << endm;
623 return mData->rawTriggerDet[prepostAddress(prepost)].BEMClayer1[channel];
626 unsigned short StTriggerData2003::eemcLayer1DSM(
int channel,
int prepost)
const {
627 const int n_eemc_layer1=48;
628 if (channel<0 || channel >=n_eemc_layer1) {
629 gMessMgr->Warning() <<
"Endap DSM layer 1 out of range (" << channel <<
")" << endm;
632 return mData->rawTriggerDet[prepostAddress(prepost)].EEMClayer1[channel];
635 unsigned short StTriggerData2003::emcLayer2DSM(
int channel)
const {
636 const int n_emc_layer2=8;
637 if (channel<0 || channel >=n_emc_layer2) {
638 gMessMgr->Warning() <<
"EMC DSM layer 2 out of range (" << channel <<
")" << endm;
641 return mData->TrgSum.DSMdata.EMC[channel];
644 unsigned char StTriggerData2003::bemcHighTower(
int patch_id,
int prepost)
const
647 const int m_max_patch=300;
649 if ( patch_id < 0 || patch_id >= m_max_patch) {
650 gMessMgr->Warning() <<
"Invalid Barrel patch id" << endm;
655 int channel=patch_id%10;
656 unsigned short trg_word;
658 trg_word=decodeEmc12bit(dsm-15,channel,mData->rawTriggerDet[prepostAddress(prepost)].BEMCEast);
660 trg_word=decodeEmc12bit(dsm,channel,mData->rawTriggerDet[prepostAddress(prepost)].BEMCWest);
661 return trg_word & 0x3F;
664 unsigned char StTriggerData2003::bemcJetPatch (
int patch_id,
int prepost)
const
667 const int m_max_patch=300;
669 if ( patch_id < 0 || patch_id >= m_max_patch) {
670 gMessMgr->Warning() <<
"Invalid Barrel patch id" << endm;
675 int channel=patch_id%10;
676 unsigned short trg_word;
678 trg_word=decodeEmc12bit(dsm-15,channel,mData->rawTriggerDet[prepostAddress(prepost)].BEMCEast);
680 trg_word=decodeEmc12bit(dsm,channel,mData->rawTriggerDet[prepostAddress(prepost)].BEMCWest);
681 return trg_word >> 6;
684 unsigned char StTriggerData2003::eemcHighTower(
int patch_id,
int prepost)
const
687 const int m_max_patch=90;
689 if ( patch_id < 0 || patch_id >= m_max_patch) {
690 gMessMgr->Warning() <<
"Invalid Endcap patch id" << endm;
695 int channel=patch_id%10;
696 unsigned short trg_word;
697 trg_word=decodeEmc12bit(dsm,channel,mData->rawTriggerDet[prepostAddress(prepost)].EEMC);
698 return trg_word & 0x3F;
702 unsigned char StTriggerData2003::eemcJetPatch (
int patch_id,
int prepost)
const
705 const int m_max_patch=90;
707 if ( patch_id < 0 || patch_id >= m_max_patch) {
708 gMessMgr->Warning() <<
"Invalid Endcap patch id" << endm;
713 int channel=patch_id%10;
714 unsigned short trg_word;
715 trg_word=decodeEmc12bit(dsm,channel,mData->rawTriggerDet[prepostAddress(prepost)].EEMC);
716 return trg_word >> 6;
719 unsigned char StTriggerData2003::bemcHighestTowerADC(
int prepost)
const
722 const int m_max_patch=300;
724 for(
int i=1; i<m_max_patch; i++){
725 unsigned char hh=bemcHighTower(i,prepost);
731 unsigned char StTriggerData2003::eemcHighestTowerADC(
int prepost)
const
734 const int m_max_patch=90;
736 for(
int i=1; i<m_max_patch; i++){
737 unsigned char hh=eemcHighTower(i,prepost);
743 void StTriggerData2003::dump()
const
745 printf(
"***** StTriggerData Dump *****\n");
746 printf(
" Year=%d Version=%x\n",year(),version());
747 printf(
" %d pre and %d post crossing data available\n",numberOfPreXing(),numberOfPostXing());
748 printf(
" Token=%d TriggerWord=%x ActionWord=%x BusyStatus=%x\n",
749 token(), triggerWord(), actionWord(), busyStatus());
750 printf(
" TUC Bits=%d : ",tcuBits());
751 for(
int i=0; i<16; i++) {printf(
" %d",(tcuBits()>>(15-i))%2);}; printf(
"\n");
752 printf(
" BunchId 7bit=%d 48bit=%d\n",bunchId7Bit(), bunchId48Bit());
753 printf(
" Spin Bits=%d : ",spinBit());
754 for(
int i=0; i<8; i++) {printf(
" %d",(spinBit()>>(7-i))%2);}; printf(
"\n");
755 printf(
" CTB ADC : ");
for(
int i=0; i<240;i++){ printf(
"%d ",ctb(i,0)); }; printf(
"\n");
756 printf(
" MWC ADC : ");
for(
int i=0; i<96; i++){ printf(
"%d ",mwc(i,0)); }; printf(
"\n");
757 printf(
" BBC East ADC : ");
for(
int i=1; i<=24;i++){ printf(
"%d ",bbcADC(east,i,0)); }; printf(
"\n");
758 printf(
" BBC West ADC : ");
for(
int i=1; i<=24;i++){ printf(
"%d ",bbcADC(west,i,0)); }; printf(
"\n");
759 printf(
" BBC East TAC : ");
for(
int i=1; i<=16;i++){ printf(
"%d ",bbcTDC(east,i,0)); }; printf(
"\n");
760 printf(
" BBC West TAC : ");
for(
int i=1; i<=16;i++){ printf(
"%d ",bbcTDC(west,i,0)); }; printf(
"\n");
761 for(
int i=-numberOfPreXing(); i<=static_cast<int>(numberOfPostXing()); i++){
762 printf(
" BBC Sums %d xing : ",i);
763 printf(
"East=%d West=%d Large tile East=%d West=%d\n",
764 bbcADCSum(east,i),bbcADCSum(west,i),
765 bbcADCSumLargeTile(east,i),bbcADCSumLargeTile(west,i));
767 printf(
" BBC Earilest : "); printf(
"East=%d West=%d Difference+256=%d\n",
768 bbcEarliestTDC(east,0),bbcEarliestTDC(west,0),bbcTimeDifference());
769 printf(
" FPD East North : ");
for(
int i=1; i<=49;i++){ printf(
"%d ",fpd(east,0,i,0)); }; printf(
"\n");
770 printf(
" FPD East South : ");
for(
int i=1; i<=49;i++){ printf(
"%d ",fpd(east,1,i,0)); }; printf(
"\n");
771 printf(
" FPD East Top : ");
for(
int i=1; i<=25;i++){ printf(
"%d ",fpd(east,2,i,0)); }; printf(
"\n");
772 printf(
" FPD East Bottom : ");
for(
int i=1; i<=25;i++){ printf(
"%d ",fpd(east,3,i,0)); }; printf(
"\n");
773 printf(
" FPD East North PS: ");
for(
int i=1; i<= 7;i++){ printf(
"%d ",fpd(east,4,i,0)); }; printf(
"\n");
774 printf(
" FPD East South PS: ");
for(
int i=1; i<= 7;i++){ printf(
"%d ",fpd(east,5,i,0)); }; printf(
"\n");
775 printf(
" FPD West South : ");
for(
int i=1; i<=49;i++){ printf(
"%d ",fpd(west,1,i,0)); }; printf(
"\n");
776 printf(
" FPD West Bottom : ");
for(
int i=1; i<=25;i++){ printf(
"%d ",fpd(west,3,i,0)); }; printf(
"\n");
777 printf(
" FPD West South PS: ");
for(
int i=1; i<= 7;i++){ printf(
"%d ",fpd(west,5,i,0)); }; printf(
"\n");
778 printf(
" FPD Sums East : ");
for(
int j=0; j<4 ;j++) printf(
"%d ",fpdSum(east,j)); printf(
"\n");
779 printf(
" FPD Sums West : ");
for(
int j=0; j<4 ;j++) printf(
"%d ",fpdSum(west,j)); printf(
"\n");
780 printf(
" ZDC ADC East : ");
for(
int j=1; j<4 ;j++) printf(
"%d ",zdcADC(east,j)); printf(
"\n");
781 printf(
" ZDC ADC West : ");
for(
int j=1; j<4 ;j++) printf(
"%d ",zdcADC(west,j)); printf(
"\n");
782 printf(
" ZDC Sum(A) East : ");printf(
"%d ",zdcAttenuated(east)); printf(
"\n");
783 printf(
" ZDC Sum(A) West : ");printf(
"%d ",zdcAttenuated(west)); printf(
"\n");
784 printf(
" ZDC Sum(UA) East : ");printf(
"%d ",zdcUnAttenuated(east)); printf(
"\n");
785 printf(
" ZDC Sum(UA) West : ");printf(
"%d ",zdcUnAttenuated(west)); printf(
"\n");
787 printf(
"***** StTriggerData Dump *****\n");
790 char* StTriggerData2003::getTriggerStructure()
792 return (
char*) mData;
800 int StTriggerData2003::getRawSize()
const
802 int npre = numberOfPreXing();
803 int npost = numberOfPostXing();
809 unsigned char * StTriggerData2003::getDsm0_EEMC(
int prepost)
const
811 return mData->rawTriggerDet[prepostAddress(prepost)].EEMC;
814 unsigned short int * StTriggerData2003::getDsm1_EEMC(
int prepost)
const
816 return mData->rawTriggerDet[prepostAddress(prepost)].EEMClayer1;
819 unsigned short int * StTriggerData2003::getDsm2_EMC()
const
821 return mData->TrgSum.DSMdata.EMC;
824 unsigned short int * StTriggerData2003::getDsm3()
const
826 return mData->TrgSum.DSMdata.lastDSM;
829 unsigned int StTriggerData2003::l2ResultLength()
const
831 return sizeof(mData->TrgSum.L2Result)/
sizeof(
unsigned int);
834 const unsigned int* StTriggerData2003::l2Result()
const
836 return mData->TrgSum.L2Result;