43 #include "TOF_Reader.hh"
44 #include "StMessMgr.h"
47 using namespace OLDEVP;
49 bool TOF_Reader::year2Data(){
return (mTofRawDataVersion==1);}
50 bool TOF_Reader::year3Data(){
return (mTofRawDataVersion==2);}
51 bool TOF_Reader::year4Data(){
return (mTofRawDataVersion==3);}
53 bool TOF_Reader::year5Data(){
return (mTofRawDataVersion==0);}
55 void TOF_Reader::ProcessEvent(
const Bank_TOFP * TofPTR) {
58 if(year2Data()||year3Data()||year4Data()) {
59 unpackerr=UnpackYear2to4Data(TofPTR);
60 if(unpackerr>0) LOG_INFO<<
"TOF_READER::UnPack Year2-4 data ERROR!"<<endm;
64 unpackerr=UnpackYear5Data(TofPTR);
65 if(unpackerr>0) LOG_INFO<<
"TOF_READER::UnPack Year5 Data ERROR!"<<endm;
75 if (!pBankTOFP->test_CRC()) {
76 LOG_DEBUG << Form(
"CRC error in TOFP: %s %d",__FILE__,__LINE__) << endm;
78 if (pBankTOFP->swap() < 0) {
79 LOG_DEBUG << Form(
"swap error in TOFP: %s %d",__FILE__,__LINE__) << endm;
82 pBankTOFP->header.CRC = 0;
83 int Token = pBankTOFP->header.Token;
85 if(Token !=dp->header.Token){
86 LOG_DEBUG << Form(
"Token mismatch between global %d and TOF %d",dp->header.Token,Token) << endm;
89 mTofRawDataVersion = pBankTOFP->header.FormatNumber;
96 else if (year3Data()) {
97 mMaxAdcChannels=48+12+72;
98 mMaxTdcChannels=48+72;
101 mMaxAdcChannels=TOF_MAX_ADC_CHANNELS;
102 mMaxTdcChannels=TOF_MAX_TDC_CHANNELS;
104 mMaxScaChannels = TOF_MAX_SCA_CHANNELS;
105 mMaxA2dChannels = TOF_MAX_A2D_CHANNELS;
107 ProcessEvent(pBankTOFP);
111 unsigned short TOF_Reader::GetAdc(
int daqId){
112 if ((daqId<0) || (daqId>mMaxAdcChannels-1)){
113 LOG_INFO <<
"TOF_Reader::GetAdc slatId out of range " << daqId << endm;
116 return mTheTofArray.AdcData[daqId];
118 unsigned short TOF_Reader::GetAdcFromSlat(
int slatId){
return GetAdc(slatId);}
121 unsigned short TOF_Reader::GetTdc(
int daqId){
122 if ((daqId<0) || (daqId>mMaxTdcChannels-1)){
123 LOG_INFO <<
"TOF_Reader::GetTdc daqId out of range " << daqId << endm;
126 return mTheTofArray.TdcData[daqId];
129 unsigned short TOF_Reader::GetTdcFromSlat(
int slatId){
return GetTdc(slatId);}
132 unsigned short TOF_Reader::GetTofpAdc(
int slatId){
133 if ((slatId<0) || (slatId>41)){
134 LOG_INFO <<
"TOF_Reader::GetTofpAdc slatId out of range " << slatId << endm;
137 return mTheTofArray.AdcData[slatId];
141 unsigned short TOF_Reader::GetTofpTdc(
int slatId){
142 if ((slatId<0) || (slatId>41)){
143 LOG_INFO <<
"TOF_Reader::GetTofpTdc slatId out of range " << slatId << endm;
146 return mTheTofArray.TdcData[slatId];
150 unsigned short TOF_Reader::GetTofrAdc(
int padId){
152 LOG_INFO <<
"TOF_Reader: TOFr ADC data not available for year2 data" << endm;
156 if((padId<0) || (padId>71)) {
157 LOG_INFO <<
"TOF_Reader::GetTofrAdc padId out of range " << padId << endm;
162 if ((padId<0) || (padId>119)){
163 LOG_INFO <<
"TOF_Reader::GetTofrAdc padId out of range " << padId << endm;
167 return mTheTofArray.AdcData[60+padId];
171 unsigned short TOF_Reader::GetTofrTdc(
int padId){
173 LOG_INFO <<
"TOF_Reader: TOFr TDC data not available for year2 data" << endm;
177 if((padId<0) || (padId>71)) {
178 LOG_INFO <<
"TOF_Reader::GetTofrTdc padId out of range " << padId << endm;
181 return mTheTofArray.TdcData[48+padId];
184 if ((padId<0) || (padId>119)){
185 LOG_INFO <<
"TOF_Reader::GetTofrTdc padId out of range " << padId << endm;
191 }
else if(padId<48) {
193 }
else if(padId<72) {
198 return mTheTofArray.TdcData[48+offset+padId];
203 unsigned short TOF_Reader::GetTofrTOT(
int totId){
204 if(year2Data()||year3Data()) {
205 LOG_INFO <<
"TOF_Reader:: TOFr TOT data not available for year3 and year3 data" << endm;
208 if((totId<0) || (totId>9)) {
209 LOG_INFO <<
"TOF_Reader::GetTofrTOT totId out of range " << totId << endm;
211 unsigned short tdcId[10] = {72, 73, 98, 99, 124, 125, 176, 177, 178, 179};
213 return mTheTofArray.TdcData[tdcId[totId]];
216 unsigned short TOF_Reader::GetPvpdAdc(
int pvpdId){
217 if ((pvpdId<0) || (pvpdId>5)){
218 LOG_INFO <<
"TOF_Reader::GetPvpdAdc pvpdId out of range " << pvpdId << endm;
221 return mTheTofArray.AdcData[43+pvpdId];
225 unsigned short TOF_Reader::GetPvpdAdcHigh(
int pvpdId){
227 LOG_INFO <<
"TOF_Reader: pVPD high gain data not available for year2 data" << endm;
230 if ((pvpdId<0) || (pvpdId>5)){
231 LOG_INFO <<
"TOF_Reader::GetPvpdAdcHigh pvpdId out of range " << pvpdId << endm;
234 return mTheTofArray.TdcData[54+pvpdId];
237 unsigned short TOF_Reader::GetPvpdTdc(
int pvpdId){
238 if ((pvpdId<0) || (pvpdId>5)){
239 LOG_INFO <<
"TOF_Reader::GetPvpdTdc pvpdId out of range " << pvpdId << endm;
242 return mTheTofArray.TdcData[43+pvpdId];
245 unsigned short TOF_Reader::GetClockAdc(){
return mTheTofArray.AdcData[42];}
248 short TOF_Reader::GetTc(
int chanId){
249 if ((chanId<0) || (chanId>mMaxA2dChannels-1)){
250 LOG_INFO <<
"TOF_Reader::GetTc chanId out of range " << chanId << endm;
253 return mTheTofArray.A2dData[chanId];
257 unsigned short TOF_Reader::GetSc(
int chanId){
258 if ((chanId<0) || (chanId>mMaxScaChannels-1)){
259 LOG_INFO <<
"TOF_Reader::GetSc chanId out of range " << chanId << endm;
262 return mTheTofArray.ScaData[chanId];
266 unsigned int TOF_Reader::GetEventNumber(){
267 return mTheTofArray.EventNumber;
270 void TOF_Reader::printRawData(){
271 LOG_INFO <<
"StDaqLib/TOF/TOF_Reader Printing Raw Data...";
272 LOG_INFO <<
"\n --- ADCD: ";
273 for (
int i=0;i<mMaxAdcChannels;i++) LOG_INFO <<
" " << mTheTofArray.AdcData[i];
274 LOG_INFO <<
"\n --- TDCD: ";
275 for (
int i=0;i<mMaxTdcChannels;i++) LOG_INFO <<
" " << mTheTofArray.TdcData[i];
276 LOG_INFO <<
"\n --- A2DD: ";
277 for (
int i=0;i<mMaxA2dChannels;i++) LOG_INFO <<
" " << mTheTofArray.A2dData[i];
278 LOG_INFO <<
"\n --- SCAD: ";
279 for (
int i=0;i<mMaxScaChannels;i++) LOG_INFO <<
" " << mTheTofArray.ScaData[i];
280 LOG_INFO <<
"\nStDaqLib/TOF/TOF_Reader Done Printing Raw Data..." << endm;
285 unsigned int TOF_Reader::GetLdTdc(
int daqId){
286 if ((daqId<0) || (daqId>mMaxTdcChannels-1)){
287 LOG_INFO <<
"TOF_Reader::GetTdc daqId out of range " << daqId << endm;
290 return mTheTofArray.LdTdcData[daqId];
293 unsigned int TOF_Reader::GetTrTdc(
int daqId){
294 if ((daqId<0) || (daqId>mMaxTdcChannels-1)){
295 LOG_INFO <<
"TOF_Reader::GetTdc daqId out of range " << daqId << endm;
298 return mTheTofArray.TrTdcData[daqId];
301 unsigned int TOF_Reader::GetLdmTdc(
int daqId,
int n){
302 if ((daqId<0) || (daqId>mMaxTdcChannels-1)){
303 LOG_INFO <<
"TOF_Reader::GetTdc daqId out of range " << daqId << endm;
307 for(
unsigned int i=0;i<mTheTofArray.TofLeadingHits.size();i++){
308 chan = mTheTofArray.TofLeadingHits[i].globaltdcchan;
309 if(chan == daqId)
break;
311 return mTheTofArray.TofLeadingHits[chan+n].tdc;
314 unsigned int TOF_Reader::GetTrmTdc(
int daqId,
int n){
315 if ((daqId<0) || (daqId>mMaxTdcChannels-1)){
316 LOG_INFO <<
"TOF_Reader::GetTdc daqId out of range " << daqId << endm;
320 for(
unsigned int i=0;i<mTheTofArray.TofTrailingHits.size();i++){
321 chan = mTheTofArray.TofTrailingHits[i].globaltdcchan;
322 if(chan == daqId)
break;
324 return mTheTofArray.TofTrailingHits[chan+n].tdc;
327 unsigned short TOF_Reader::GetNLdHits(
int daqId){
328 if ((daqId<0) || (daqId>mMaxTdcChannels-1)){
329 LOG_INFO <<
"TOF_Reader::GetTdc daqId out of range " << daqId << endm;
332 return mTheTofArray.LdNHit[daqId];
335 unsigned short TOF_Reader::GetNTrHits(
int daqId){
336 if ((daqId<0) || (daqId>mMaxTdcChannels-1)){
337 LOG_INFO <<
"TOF_Reader::GetTdc daqId out of range " << daqId << endm;
340 return mTheTofArray.TrNHit[daqId];
343 unsigned int TOF_Reader::GetPvpdLdTdc(
int pvpdId){
344 if ((pvpdId<0) || (pvpdId>5)){
345 LOG_INFO <<
"TOF_Reader::GetPvpdTdc pvpdId out of range " << pvpdId << endm;
348 return mTheTofArray.LdTdcData[192+pvpdId];
351 unsigned int TOF_Reader::GetPvpdTrTdc(
int pvpdId){
352 if ((pvpdId<0) || (pvpdId>5)){
353 LOG_INFO <<
"TOF_Reader::GetPvpdTdc pvpdId out of range " << pvpdId << endm;
356 return mTheTofArray.TrTdcData[192+pvpdId];
359 unsigned int TOF_Reader::GetPvpdLdmTdc(
int daqId,
int n){
360 if ((daqId<0) || (daqId>5)){
361 LOG_INFO <<
"TOF_Reader::GetPvpdTdc daqId out of range " << daqId << endm;
365 for(
unsigned int i=0;i<mTheTofArray.TofLeadingHits.size();i++){
366 chan = mTheTofArray.TofLeadingHits[i].globaltdcchan;
367 if(chan-192 == daqId)
break;
369 return mTheTofArray.TofLeadingHits[chan+n].tdc;
372 unsigned int TOF_Reader::GetPvpdTrmTdc(
int daqId,
int n){
373 if ((daqId<0) || (daqId>5)){
374 LOG_INFO <<
"TOF_Reader::GetPvpdTdc daqId out of range " << daqId << endm;
378 for(
unsigned int i=0;i<mTheTofArray.TofTrailingHits.size();i++){
379 chan = mTheTofArray.TofTrailingHits[i].globaltdcchan;
380 if(chan-192 == daqId)
break;
382 return mTheTofArray.TofTrailingHits[chan+n].tdc;
385 unsigned int TOF_Reader::GetNLeadingHits() {
386 return (
unsigned int)(mTheTofArray.TofLeadingHits.size());
389 unsigned int TOF_Reader::GetLeadingEventNumber(
int ihit) {
390 if(ihit<0 || ihit >= (
int) mTheTofArray.TofLeadingHits.size())
return 0;
392 return mTheTofArray.TofLeadingHits[ihit].EventNumber;
395 unsigned short TOF_Reader::GetLeadingFiberId(
int ihit) {
396 if(ihit<0 || ihit >= (
int )mTheTofArray.TofLeadingHits.size())
return 9999;
398 return mTheTofArray.TofLeadingHits[ihit].fiberid;
401 unsigned short TOF_Reader::GetLeadingGlobalTdcChan(
int ihit) {
402 if(ihit<0 || ihit >= (
int) mTheTofArray.TofLeadingHits.size())
return 9999;
404 return mTheTofArray.TofLeadingHits[ihit].globaltdcchan;
407 unsigned int TOF_Reader::GetLeadingTdc(
int ihit) {
408 if(ihit<0 || ihit >= (
int) mTheTofArray.TofLeadingHits.size())
return 0;
410 return mTheTofArray.TofLeadingHits[ihit].tdc;
413 unsigned int TOF_Reader::GetNTrailingHits() {
414 return (
unsigned int)(mTheTofArray.TofTrailingHits.size());
417 unsigned int TOF_Reader::GetTrailingEventNumber(
int ihit) {
418 if(ihit<0 || ihit >= (
int) mTheTofArray.TofTrailingHits.size())
return 0;
420 return mTheTofArray.TofTrailingHits[ihit].EventNumber;
423 unsigned short TOF_Reader::GetTrailingFiberId(
int ihit) {
424 if(ihit<0 || ihit >= (
int) mTheTofArray.TofTrailingHits.size())
return 9999;
426 return mTheTofArray.TofTrailingHits[ihit].fiberid;
429 unsigned short TOF_Reader::GetTrailingGlobalTdcChan(
int ihit) {
430 if(ihit<0 || ihit >= (
int) mTheTofArray.TofTrailingHits.size())
return 9999;
432 return mTheTofArray.TofTrailingHits[ihit].globaltdcchan;
435 unsigned int TOF_Reader::GetTrailingTdc(
int ihit) {
436 if(ihit<0 || ihit >= (
int) mTheTofArray.TofTrailingHits.size())
return 0;
438 return mTheTofArray.TofTrailingHits[ihit].tdc;
441 int TOF_Reader::UnpackYear2to4Data(
const Bank_TOFP * TofPTR) {
443 unsigned short numberOfDataWords, slot, channel;
444 int dataDWord, value;
446 unsigned short Token = TofPTR->header.Token;
448 LOG_INFO <<
"TOF_Reader: do not know how to handle token==0"<<endm;
451 mTheTofArray.EventNumber = Token;
453 mTheTofArray.ByteSwapped = 0x04030201;
455 int tofRawDataVersion = TofPTR->header.FormatNumber;
458 if ((tofRawDataVersion <1) || (tofRawDataVersion >3)){
459 LOG_INFO <<
"TOF_Reader: ERROR unknown raw data version " << tofRawDataVersion << endm;
468 if (TofPTR->AdcPTR.length>0) {
469 TofAdcD = (
TOFADCD *) ((
unsigned long *)TofPTR + TofPTR->AdcPTR.offset);
472 if (TofAdcD->header.Token!=Token){
473 LOG_INFO <<
"TOF_Reader: Token mismatch TOFP "<< Token
474 <<
" ADCD " << TofAdcD->header.Token << endm;
475 mTheTofArray.EventNumber=0;
477 numberOfDataWords=TofAdcD->header.BankLength - (INT32)
sizeof(TofAdcD->header)/4;
478 if (numberOfDataWords!=mMaxAdcChannels){
479 LOG_INFO <<
"TOF_Reader: ADCD #channels mismatch " << numberOfDataWords << endm;
480 if (numberOfDataWords>mMaxAdcChannels) numberOfDataWords=mMaxAdcChannels;
483 for (dataDWord=0; dataDWord < numberOfDataWords; dataDWord++) {
487 slot = int( TofAdcD->data[dataDWord].data & 0x000000FF);
488 channel = int((TofAdcD->data[dataDWord].data & 0x0000FF00) >> 8);
489 value = int((TofAdcD->data[dataDWord].data & 0xFFFF0000) >> 16);
490 mTheTofArray.AdcData[dataDWord]=value;
496 if (TofPTR->TdcPTR.length>0) {
497 TofTdcD = (
TOFTDCD *) ((
unsigned long *)TofPTR + TofPTR->TdcPTR.offset);
500 if (TofTdcD->header.Token!=Token){
501 LOG_INFO <<
"TOF_Reader: Token mismatch TOFP "<< Token
502 <<
" TDCD " << TofTdcD->header.Token << endm;
503 mTheTofArray.EventNumber=0;
505 numberOfDataWords=TofTdcD->header.BankLength - (INT32)
sizeof(TofTdcD->header)/4;
506 if (numberOfDataWords!=mMaxTdcChannels){
507 LOG_INFO <<
"TOF_Reader: TDCD #channels mismatch " << numberOfDataWords << endm;
508 if (numberOfDataWords>mMaxTdcChannels) numberOfDataWords=mMaxTdcChannels;
511 for (dataDWord=0; dataDWord < numberOfDataWords; dataDWord++) {
515 slot = int( TofTdcD->data[dataDWord].data & 0x000000FF);
516 channel = int((TofTdcD->data[dataDWord].data & 0x0000FF00) >> 8);
517 value = int((TofTdcD->data[dataDWord].data & 0xFFFF0000) >> 16);
518 mTheTofArray.TdcData[dataDWord]=value;
524 if (TofPTR->A2dPTR.length>0) {
525 TofA2dD = (
TOFA2DD *) ((
unsigned long *)TofPTR + TofPTR->A2dPTR.offset);
528 if (TofA2dD->header.Token!=Token){
529 LOG_INFO <<
"TOF_Reader: Token mismatch TOFP "<< Token
530 <<
" A2DD " << TofA2dD->header.Token << endm;
531 mTheTofArray.EventNumber=0;
533 numberOfDataWords=TofA2dD->header.BankLength - (INT32)
sizeof(TofA2dD->header)/4;
534 if (numberOfDataWords!=mMaxA2dChannels){
535 LOG_INFO <<
"TOF_Reader: A2DD #channels mismatch " << numberOfDataWords << endm;
536 if (numberOfDataWords>mMaxA2dChannels) numberOfDataWords=mMaxA2dChannels;
539 for (dataDWord=0; dataDWord < numberOfDataWords; dataDWord++) {
543 slot = int( TofA2dD->data[dataDWord].data & 0x000000FF);
544 channel = int((TofA2dD->data[dataDWord].data & 0x0000FF00) >> 8);
545 value = int(
int(TofA2dD->data[dataDWord].data) >> 16);
546 mTheTofArray.A2dData[dataDWord]=value;
552 if (TofPTR->ScaPTR.length>0) {
553 TofScaD = (
TOFSCAD *) ((
unsigned long *)TofPTR + TofPTR->ScaPTR.offset);
556 if (TofScaD->header.Token!=Token){
557 LOG_INFO <<
"TOF_Reader: Token mismatch TOFP "<< Token
558 <<
" SCAD " << TofScaD->header.Token << endm;
559 mTheTofArray.EventNumber=0;
561 numberOfDataWords=TofScaD->header.BankLength - (INT32)
sizeof(TofScaD->header)/4;
562 if (numberOfDataWords!=mMaxScaChannels){
563 LOG_INFO <<
"TOF_Reader: SCAD #channels mismatch " << numberOfDataWords << endm;
564 if (numberOfDataWords>mMaxScaChannels) numberOfDataWords=mMaxScaChannels;
567 for (dataDWord=0; dataDWord < numberOfDataWords; dataDWord++) {
570 channel = int( TofScaD->data[dataDWord].data & 0x000000FF);
571 value = int((TofScaD->data[dataDWord].data & 0xFFFFFF00) >> 8);
572 mTheTofArray.ScaData[dataDWord]=value;
578 int TOF_Reader::UnpackYear5Data(
const Bank_TOFP * TofPTR) {
584 unsigned short Token = TofPTR->header.Token;
586 LOG_INFO <<
"TOF_Reader: do not know how to handle token==0"<<endm;
589 mTheTofArray.EventNumber = Token;
591 mTheTofArray.ByteSwapped = 0x04030201;
593 int tofRawDataVersion = TofPTR->header.FormatNumber;
597 if ((tofRawDataVersion <0) || (tofRawDataVersion >3)){
598 LOG_INFO <<
"TOF_Reader: ERROR unknown raw data version " << tofRawDataVersion << endm;
606 mTheTofArray.TofLeadingHits.clear();
607 mTheTofArray.TofTrailingHits.clear();
609 for(
int ifib=0;ifib<4;ifib++) {
613 if (TofPTR->DDLRPTR[ifib].length<=0) {
614 LOG_INFO<<
"No data words in this fiber! "<<endm;
617 TOFDDLR *TofDdlr = (
TOFDDLR *)((
unsigned long *)TofPTR + TofPTR->DDLRPTR[ifib].offset);
618 int nword = TofPTR->DDLRPTR[ifib].length-10;
622 int runnumber = ercpy->runno();
623 int fiboffset1[6]={1,2,3,4,5,6};
624 int fiboffset2[6]={4,5,6,1,2,3};
626 if(runnumber<6055081)
for(
int i=0;i<6;i++){fiboffset[i]=fiboffset1[i];}
627 if(runnumber>=6055081)
for(
int i=0;i<6;i++){fiboffset[i]=fiboffset2[i];}
629 for (
int iword=0;iword<nword;iword++) {
631 int dataword=TofDdlr->data[iword];
633 if( (dataword&0xF0000000)>>28 == 0xe)
continue;
634 if( (dataword&0xF0000000)>>28 == 0xc) halftrayid = dataword&0x01;
637 int edgeid =int( (dataword & 0xf0000000)>>28 );
638 if((edgeid !=LEADING) && (edgeid!=TRAILING))
continue;
639 int tdcid = (dataword & 0x0f000000)>>24;
642 if(edgeid == LEADING) {
645 tdcchan=(dataword&0x00E00000)>>21;
646 timeinbin=((dataword&0x7ffff)<<2)+((dataword>>19)&0x03);
647 templdhit.tdc=timeinbin;
649 if(ifib==0)templdhit.
globaltdcchan=tdcchan + (tdcid&0x03)*8+(tdcid>>2)*24+halftrayid*96;
651 if(tdcid==0&&tdcchan==0)templdhit.
globaltdcchan=191 + fiboffset[0+3*(ifib-1)];
652 if(tdcid==1&&tdcchan==0)templdhit.
globaltdcchan=191 + fiboffset[1+3*(ifib-1)];
653 if(tdcid==1&&tdcchan==2)templdhit.
globaltdcchan=191 + fiboffset[2+3*(ifib-1)];
655 mTheTofArray.TofLeadingHits.push_back(templdhit);
656 }
else if (edgeid==TRAILING){
659 tdcchan=(dataword&0x0F80000)>>19;
660 timeinbin = dataword & 0x7ffff;
661 temptrhit.tdc=timeinbin;
662 if(ifib==0)temptrhit.
globaltdcchan=tdcchan +(tdcid>>2)*24+halftrayid*96;
664 if(tdcid==3&&tdcchan==0)temptrhit.
globaltdcchan=191 + fiboffset[0+3*(ifib-1)];
665 if(tdcid==3&&tdcchan==8)temptrhit.
globaltdcchan=191 + fiboffset[1+3*(ifib-1)];
666 if(tdcid==3&&tdcchan==10)temptrhit.
globaltdcchan=191+ fiboffset[2+3*(ifib-1)];
668 mTheTofArray.TofTrailingHits.push_back(temptrhit);
670 LOG_INFO<<
" UNKNOWN TDC data ! "<<endm;
686 for(
unsigned int i=0;i<TOF_MAX_TDC_CHANNELS;i++){mTheTofArray.LdNHit[i]=0;mTheTofArray.LdTdcData[i]=0;}
687 for(
unsigned int i=0;i<TOF_MAX_TDC_CHANNELS;i++){mTheTofArray.TrNHit[i]=0;mTheTofArray.TrTdcData[i]=0;}
689 for(
unsigned int i=0;i<mTheTofArray.TofLeadingHits.size();i++){
690 int chan = mTheTofArray.TofLeadingHits[i].globaltdcchan;
691 if(chan <=0)
continue;
692 mTheTofArray.LdNHit[chan]++;
694 for(
unsigned int i=0;i<mTheTofArray.TofTrailingHits.size();i++){
695 int chan = mTheTofArray.TofTrailingHits[i].globaltdcchan;
696 if(chan <=0)
continue;
697 mTheTofArray.TrNHit[chan]++;
701 for(
unsigned int i=0;i<mTheTofArray.TofLeadingHits.size();i++){
702 int chan = mTheTofArray.TofLeadingHits[i].globaltdcchan;
703 if(chan == oldchan)
continue;
704 mTheTofArray.LdTdcData[chan]=mTheTofArray.TofLeadingHits[i].tdc;
708 for(
unsigned int i=0;i<mTheTofArray.TofTrailingHits.size();i++){
709 int chan = mTheTofArray.TofTrailingHits[i].globaltdcchan;
710 if(chan == oldchan)
continue;
711 mTheTofArray.TrTdcData[chan]=mTheTofArray.TofTrailingHits[i].tdc;
unsigned char globaltdcchan
1,2,......,120,for tray, 121, 122 for upvpd
unsigned char fiberid
data word before unpack