4 #include "StECalEnergyIter.h"
5 #include "StMuDSTMaker/COMMON/StMuEmcCollection.h"
6 #include "StMuDSTMaker/COMMON/StMuEmcHit.h"
7 #include "StEEmcUtil/database/StEEmcDb.h"
8 #include "StEEmcUtil/database/EEmcDbItem.h"
11 bool StECalEnergyIter::mIsSimu =
false;
14 : mEmCol(emCol), mEEdb(db), mdetector(det), mIhits(0), mSuppBad(flag) {
20 mNhits = mEmCol->getNEndcapTowerADC();
23 mNhits = mEmCol->getNEndcapPrsHits();
28 mNhits = mEmCol->getNEndcapSmdHits(cuv);
36 bool StECalEnergyIter::next(
float &e,
int &adc,
int &adclessped,
37 int &sec,
int &eta,
int &phi,
char &cdet)
44 if ( mNhits <= mIhits )
return false;
48 mEmCol->getEndcapTowerADC(mIhits++, adc, sec, phi, eta);
50 dbitem = mEEdb->getTile(sec, phi-1+
'A', eta, cdet);
54 adc = mEmCol->getEndcapPrsHit(mIhits++, sec, phi, eta,
57 dbitem = mEEdb->getTile(sec, phi-1+
'A', eta, cdet);
62 adc = mEmCol->getEndcapSmdHit(cdet, mIhits++, sec, eta)->
getAdc();
63 dbitem = mEEdb->getByStrip(sec, cdet, eta);
68 dbfail = ( !dbitem || dbitem->fail || dbitem->gain < 0.5 );
69 }
while ( mSuppBad && dbfail );
78 float acorr = adc - dbitem->ped;
79 e = acorr/dbitem->gain;
80 if ( mIsSimu && mdetector == eemc ) e *= 1.25;
81 adclessped = (int) TMath::Floor(acorr + 0.5);
int getAdc() const
Return ADC value.