2 #include "StjEEMCMuDst.h"
5 #include "StMuDSTMaker/COMMON/StMuDst.h"
6 #include "StMuDSTMaker/COMMON/StMuEvent.h"
7 #include "StMuDSTMaker/COMMON/StMuEmcCollection.h"
9 #include "StEEmcUtil/database/StEEmcDb.h"
10 #include "StEEmcUtil/database/EEmcDbItem.h"
11 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
14 StjEEMCMuDst::StjEEMCMuDst() : mEeDb((
StEEmcDb*)
StMaker::GetChain()->GetDataSet(
"StEEmcDb"))
19 void StjEEMCMuDst::Init()
21 if (mEeDb) mEeDb->setThreshold(3);
24 StjTowerEnergyList StjEEMCMuDst::getEnergyList()
28 StjTowerEnergyList ret;
30 for (
int id = 0;
id < muEmc->getNEndcapTowerADC(); ++id) {
32 int rawadc, sec, sub, etabin;
33 muEmc->getEndcapTowerADC(
id, rawadc, sec, sub, etabin);
36 if (rawadc < 0 || rawadc >= 4095)
continue;
38 assert(1 <= sec && sec <= 12);
39 assert(1 <= sub && sub <= 5);
40 assert(1 <= etabin && etabin <= 12);
70 const EEmcDbItem *dbItem = mEeDb->getT(sec,sub-1+
'A',etabin);
72 if(dbItem->fail)
continue;
73 if(dbItem->stat)
continue;
74 if(dbItem->gain<=0.)
continue;
75 if(rawadc<dbItem->thr)
continue;
77 double adc = rawadc - (dbItem->ped);
78 double energy = adc/(dbItem->gain);
83 energyDeposit.detectorId = kEndcapEmcTowerId;
84 energyDeposit.towerId = (sec-1)*60+(sub-1)*12+(etabin-1);
87 TVector3 towerLocation = geom.
getTowerCenter(sec-1,sub-1,etabin-1);
89 energyDeposit.towerR = towerLocation.Perp();
90 energyDeposit.towerEta = towerLocation.Eta();
91 energyDeposit.towerPhi = towerLocation.Phi();
94 energyDeposit.vertexX = _vx;
95 energyDeposit.vertexY = _vy;
96 energyDeposit.vertexZ = _vz;
101 energyDeposit.vertexX = vertex.x();
102 energyDeposit.vertexY = vertex.y();
103 energyDeposit.vertexZ = vertex.z();
106 energyDeposit.energy = energy;
107 energyDeposit.adc = rawadc;
108 energyDeposit.pedestal = dbItem->ped;
109 energyDeposit.rms = dbItem->sigPed;
110 energyDeposit.status = dbItem->stat == 0;
112 if(energyDeposit.energy < 0.01)
continue;
114 ret.push_back(energyDeposit);
TVector3 getTowerCenter(const UInt_t sec, const UInt_t sub, const UInt_t etabin) const
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in 'physical events'. Therefore there is only 1 primary vert...
static EEmcGeomSimple & Instance()
returns a reference to a static instance of EEmcGeomSimple
static StMuEmcCollection * muEmcCollection()
returns pointer to current StMuEmcCollection
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)