5 #include <St_base/StMessMgr.h>
6 #include "St_db_Maker/St_db_Maker.h"
8 #include "StGenericVertexMaker/StiPPVertex/BemcHitList.h"
10 #include "StChain/StMaker.h"
11 #include "StEmcRawMaker/StBemcTables.h"
12 #include "StEmcRawMaker/defines.h"
13 #include "StEmcUtil/geometry/StEmcGeom.h"
14 #include "StEvent/StEmcDetector.h"
15 #include "StEvent/StEmcModule.h"
16 #include "StEvent/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
38 LOG_DEBUG <<Form(
"BemcHitList::initRun() start")<<endm;
39 ScintHitList::initRun();
52 for(
id=1;
id<=BTOWSIZE;
id++) {
60 geomB->getEta(m,e,eta);
61 geomB->getPhi(m,s,phi);
62 if( phi<0) phi+=2*M_PI;
69 int iBin=iPhiEta2bin(iPhi,iEta);
74 assert(mes2bin[m-1][e-1][s-1]==-1);
75 mes2bin[m-1][e-1][s-1]=iBin;
78 if( status!= 1)
continue;
84 LOG_INFO <<
" BemcHitList::initRun() done, active="<<nA<<
" of "<<nB<<
" BTOW towers" <<endm;
92 ScintHitList::clear();
99 BemcHitList::etaBin(
float eta){
100 if(fabs(eta)>0.99)
return -1;
101 int iEta=(int)((eta-eta0)/dEta);
102 if(iEta<0 || iEta>=nEta)
return -1;
109 BemcHitList::bin2EtaLeft(
int iEta){
112 float etaF= eta0+iEta*dEta ;
113 if(etaF<-0.99) etaF=0.99;
120 BemcHitList::~BemcHitList(){
128 for(
int m = 1; m<=BEMCMODULES;m++) {
131 StSPtrVecEmcRawHit& rawHit=module->hits();
132 for(UInt_t k=0;k<rawHit.size();k++) {
134 int m=rawHit[k]->module();
135 int e=rawHit[k]->eta();
136 int s=abs(rawHit[k]->sub());
137 int iBin=mes2bin[m-1][e-1][s-1];
139 if ( getActive(iBin)<0)
continue;
142 geomB->getId(m,e,s,
id);
145 float rawAdc = rawHit[k]->adc();
146 if( rawAdc<ped+ kSigPed*sig )
continue;
147 float adc= rawAdc -ped;
148 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.