1 #include "EMC_Reader.hh"
3 #include "EMC_BarrelReader.hh"
4 #include "EMC_SmdReader.hh"
7 using namespace OLDEVP;
14 int towerresult = barreltowerreader->ProcessBarrelTower(EmcPTR, TrgPTR);
15 mTheTowerAdcR=barreltowerreader->getBTOWERADCR();
18 cout<<
" Barrel TOWER processing is not successful**"<<endl;
26 delete barreltowerreader;
32 int smdresult = barrelsmdreader->ProcessBarrelSmd(EmcPTR);
33 mTheSmdAdcR=barrelsmdreader->getBSMDADCR();
37 cout<<
" Barrel SMD processing is not successful**"<<endl;
44 delete barrelsmdreader;
55 printf(
" SP in EMC_Reader\n");
59 printf(
"This is the EMC_Reader ctor in %s.\n",__FILE__);
62 pBankEMCP->header.BankType[7]=0;
63 cout<<
"header bank type "<<pBankEMCP->header.BankType<<endl;
65 if (!pBankEMCP->test_CRC())
66 printf(
"CRC error in EMCP: %s %d\n",__FILE__,__LINE__) ;
67 if (pBankEMCP->swap() < 0)
68 printf(
"swap error in EMCP: %s %d\n",__FILE__,__LINE__) ;
70 pBankEMCP->header.CRC = 0;
71 int Token = pBankEMCP->header.Token;
74 if(Token !=dp->header.Token)
75 printf(
"Token mismatch between global %d and RICH %d\n",dp->header.Token,Token);
78 ProcessEvent(pBankEMCP, pTRGP);
84 if(strncmp(mTheTowerAdcR.BankType,
"TOWRADCR",8))
86 cout<<
"EMC_Reader::NTowerHits() -> error in header"<<endl;
89 int nhits=mTheTowerAdcR.NTowerHits;
99 if(strncmp(mTheSmdAdcR.BankType,
"BSMDADCR",8))
101 cout<<
" error in header name**"<<endl;
104 int nhits=mTheSmdAdcR.NSmdHits;
119 if(strncmp(mTheTowerAdcR.BankType,
"TOWRADCR",8))
121 cout<<
" error in header name**"<<endl;
126 ADC=mTheTowerAdcR.TowerMatrix[module-1][eta-1][sub-1];
141 if(strncmp(mTheTowerAdcR.BankType,
"TOWRADCR",8))
143 cout<<
" error in header name**" << endl;
146 ADC = mTheTowerAdcR.TowerADCArray[index];
161 if(strncmp(mTheSmdAdcR.BankType,
"BSMDADCR",8))
163 cout<<
" getSMDE_ADC::error in header name**"<<endl;
168 ADC = mTheSmdAdcR.SmdE_ADCMatrix[modInd-1][stripInd-1];
184 if(strncmp(mTheSmdAdcR.BankType,
"BSMDADCR",8))
186 cout<<
" getSMDE_ADC::error in header name**"<<endl;
191 ADC=mTheSmdAdcR.SmdP_ADCMatrix[modInd-1][binInd-1][stripInd-1];
204 if(strncmp(mTheSmdAdcR.BankType,
"BSMDADCR",8))
206 cout<<
" getSMD_ADC::error in header name**"<<endl;
211 ADC=mTheSmdAdcR.SMDADCArray[fiber][index];
223 if(strncmp(mTheSmdAdcR.BankType,
"BSMDADCR",8))
231 TimeBin=mTheSmdAdcR.TimeBin[fiber];
238 bool EMC_Reader::isTowerPresent()
240 return mTowerPresent;
242 bool EMC_Reader::isSmdPresent()
248 return mTheTowerAdcR;
int getSMD_TIMEBIN(int, unsigned int &)
Get SMD time bin (capacitor number) for a given fiber (RDO)
int NTowerHits()
Return number of valid hits on towers.
Bank_BTOWERADCR & getBTOWERADCR()
EMC_Reader destructor.
int NSmdHits()
Return number of valid hits on SMD.
int getSMD_ADC(int, int, unsigned short &)
Get SMD ADC for a given index and fiber (RDO) number.
int getSMDP_ADC(int, int, int, unsigned short &)
Get ADC for SMDP with given module, eta and sub.
int getTowerADC(int, int, int, unsigned short &)
Get ADC value for one tower with given module, eta and sub.
EMC_Reader(EventReader *er, Bank_EMCP *pEMCP, Bank_TRGP *pTRGP)
EMC_Reader constructor.
int getSMDE_ADC(int, int, unsigned short &)
Get ADC for SMDE with given module and stip number.