11 #include "StarClassLibrary/StPhysicalHelixD.hh"
12 #include "StarClassLibrary/StThreeVectorD.hh"
13 #include "StarClassLibrary/StThreeVectorF.hh"
17 #include "StEvent/StEmcDetector.h"
18 #include "StEvent/StEmcCollection.h"
19 #include "StEvent/StEmcRawHit.h"
20 #include "StEvent/StEmcModule.h"
23 #include "StEmcClusterCollection.h"
24 #include "StEmcPoint.h"
25 #include "StEmcUtil/geometry/StEmcGeom.h"
26 #include "StEmcUtil/others/emcDetectorName.h"
27 #include "StEmcADCtoEMaker/StBemcData.h"
28 #include "StEmcADCtoEMaker/StEmcADCtoEMaker.h"
29 #include "StEmcRawMaker/defines.h"
30 #include "StEmcRawMaker/StBemcRaw.h"
34 #include "TFriendElement.h"
40 #include "StMuDSTMaker/COMMON/StMuTrack.h"
46 #include "StEEmcUtil/database/cstructs/eemcConstDB.hh"
47 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
51 #include "StAdcPedHistoMaker.h"
52 #include "StEEmcUtil/database/StEEmcDb.h"
53 #include "StEEmcUtil/database/EEmcDbItem.h"
55 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
56 #include "StMuDSTMaker/COMMON/StMuDst.h"
57 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
58 #include "StMuDSTMaker/COMMON/StMuEvent.h"
66 :
StMaker(name), mDstMaker(uDstMaker) {
71 cout <<
"StAdcPedHistoMaker::StAdcPedHistoMaker()"<<endl;
79 StAdcPedHistoMaker::~StAdcPedHistoMaker()
81 cout <<
"StAdcPedHistoMaker::~StAdcPedHistoMaker()"<<endl;
90 StAdcPedHistoMaker::Init() {
91 mEeDb = (
StEEmcDb*)this->GetDataSet(
"StEEmcDb");
99 Int_t StAdcPedHistoMaker::InitRun(
int runNo){
104 for(i=0;i<EEindexMax;i++) {
109 char tt1[100],tt2[200];
110 sprintf(tt1,
"a%s",x->
name);
111 sprintf(tt2,
"ADC for %s, cr/chan=%3.3d/%3.3d, tube=%s; ADC",x->
name,
113 TH1F* h=
new TH1F(tt1,tt2,500,-20.5,479.5);
118 printf(
"StAdcPedHistoMaker::InitRun() setup: pedSub=%d killMask=0x%0x trigId=%d\n", pedSub, killMask, trigID);
135 StMuEvent *
event = mDstMaker -> muDst() -> event();
139 if( trigID && !l1trig.isTrigger(trigID))
return kStOk;
148 const int nEndcapTowers=720;
149 for(
int i=0;i<nEndcapTowers;i++){
151 emc->getEndcapTowerADC(i,val,sec,sub,eta);
152 const EEmcDbItem *x=mEeDb -> getTile(sec,
'A'+sub-1,eta,
'T');
155 if(pedSub) adc-=x->ped;
157 if(x->fail )
continue;
158 if(x->stat & killMask)
continue;
160 hPix[x->key]->Fill(adc);
164 int pNh= emc->getNEndcapPrsHits();
165 for (
int i=0; i < pNh; i++) {
166 int pre, sec, eta, sub;
171 const EEmcDbItem *x=mEeDb -> getTile(sec,sub-1+
'A', eta, pre-1+
'P');
173 if(pedSub) adc-=x->ped;
175 if(x->fail )
continue;
176 if(x->stat & killMask)
continue;
178 hPix[x->key]->Fill(adc);
183 for(uv=
'U'; uv <=
'V'; uv++) {
185 int nh= emc->getNEndcapSmdHits(uv);
186 for (
int i=0; i < nh; i++) {
189 const EEmcDbItem *x=mEeDb -> getByStrip(sec,uv,strip);
191 if(pedSub) adc-=x->ped;
193 if(x->fail )
continue;
194 if(x->stat & killMask)
continue;
196 hPix[x->key]->Fill(adc);
const EEmcDbItem * getByIndex(int ikey) const
returns full DB info for one pixel
char name[StEEmcNameLen]
ASCII name of the channel, see Readme.
int getAdc() const
Return ADC value.
char tube[StEEmcNameLen]
name of PMT or MAPMT pixel
static StMuEmcCollection * muEmcCollection()
returns pointer to current StMuEmcCollection
Collection of trigger ids as stored in MuDst.