7 #include "BemcHitList.h"
10 #include "StEmcRawMaker/StBemcTables.h"
11 #include "StEmcRawMaker/defines.h"
12 #include "StEmcUtil/geometry/StEmcGeom.h"
13 #include "StEmcDetector.h"
14 #include "StEmcModule.h"
15 #include "StEmcRawHit.h"
22 BemcHitList::BemcHitList() :
23 ScintHitList(0.,M_PI/60,120, -1.,0.05,40,(char *)
"Bemc",4,0.75) {
25 geomB = StEmcGeom::instance(
"bemc");
28 gMessMgr->Message(
"",
"I")
29 <<
" BemcHitList::use kSigPed="<<kSigPed
37 BemcHitList::initRun() {
38 LOG_DEBUG <<Form(
"BemcHitList::initRun() start")<<endm;
39 ScintHitList::initRun();
48 StMaker*mk=(
StMaker*)StMaker::GetChain()->GetMaker(
"GenericVertex");
54 for(
id=1;
id<=BTOWSIZE;
id++) {
62 geomB->getEta(m,e,eta);
63 geomB->getPhi(m,s,phi);
64 if( phi<0) phi+=2*M_PI;
71 int iBin=iPhiEta2bin(iPhi,iEta);
76 assert(mes2bin[m-1][e-1][s-1]==-1);
77 mes2bin[m-1][e-1][s-1]=iBin;
80 if( status!= 1)
continue;
86 LOG_INFO <<
" BemcHitList::initRun() done, active="<<nA<<
" of "<<nB<<
" BTOW towers" <<endm;
94 ScintHitList::clear();
101 BemcHitList::etaBin(
float eta){
102 if(fabs(eta)>0.99)
return -1;
103 int iEta=(int)((eta-eta0)/dEta);
104 if(iEta<0 || iEta>=nEta)
return -1;
111 BemcHitList::bin2EtaLeft(
int iEta){
114 float etaF= eta0+iEta*dEta ;
115 if(etaF<-0.99) etaF=0.99;
122 BemcHitList::~BemcHitList(){
130 for(
int m = 1; m<=BEMCMODULES;m++) {
133 StSPtrVecEmcRawHit& rawHit=module->hits();
134 for(UInt_t k=0;k<rawHit.size();k++) {
136 int m=rawHit[k]->module();
137 int e=rawHit[k]->eta();
138 int s=abs(rawHit[k]->sub());
139 int iBin=mes2bin[m-1][e-1][s-1];
141 if ( getActive(iBin)<0)
continue;
144 geomB->getId(m,e,s,
id);
147 float rawAdc = rawHit[k]->adc();
148 if( rawAdc<ped+ kSigPed*sig )
continue;
149 float adc= rawAdc -ped;
150 if(adc< adcMin)
continue;
void getPedestal(Int_t det, Int_t softId, Int_t cap, Float_t &ped, Float_t &rms) const
Return pedestal mean and rms.
void loadTables(StMaker *anyMaker)
load tables.
Int_t getBin(const Float_t phi, const Float_t eta, Int_t &m, Int_t &e, Int_t &s) const
void getStatus(Int_t det, Int_t softId, Int_t &status, const char *option="") const
Return status.