2 #include "StjBEMCMuDst.h"
4 #include <StMuDSTMaker/COMMON/StMuDst.h>
5 #include <StMuDSTMaker/COMMON/StMuEvent.h>
7 #include <StEvent/StEmcRawHit.h>
8 #include <StEvent/StEmcCollection.h>
9 #include <StEvent/StEmcModule.h>
10 #include <StEvent/StEmcDetector.h>
11 #include <StEvent/StEvent.h>
13 #include <StEmcUtil/geometry/StEmcGeom.h>
16 #include <StEmcRawMaker/defines.h>
17 #include <StEmcRawMaker/StBemcTables.h>
19 #include "StEmcADCtoEMaker/StEmcADCtoEMaker.h"
20 #include "StEmcSimulatorMaker/StEmcSimulatorMaker.h"
28 int StjBEMCMuDst::_runNumber = -1;
29 int StjBEMCMuDst::_eventId = -1;
30 StjTowerEnergyList StjBEMCMuDst::_list;
32 StjBEMCMuDst::StjBEMCMuDst(
bool doTowerSwapFix) : _bemcTables(0)
36 _bemcTables = adc2e->getBemcData()->getTables();
41 _bemcTables = emcSim->getTables();
49 StjTowerEnergyList StjBEMCMuDst::getEnergyList()
51 if(isNewEvent()) _list = getlist();
55 void StjBEMCMuDst::setVertex(
float vx,
float vy,
float vz)
64 bool StjBEMCMuDst::isNewEvent()
71 StjTowerEnergyList StjBEMCMuDst::getlist()
76 StjTowerEnergyList ret;
80 StEmcDetector* detector = emcCollection->detector(kBarrelEmcTowerId);
82 for(
unsigned int m = 1; m <= detector->numberOfModules(); ++m) {
83 StSPtrVecEmcRawHit& rawHits = detector->module(m)->hits();
84 for(
size_t k = 0; k < rawHits.size(); ++k) {
85 ret.push_back(readTowerHit(*rawHits[k]));
96 StEvent*
event =
dynamic_cast<StEvent*
>(StMaker::GetChain()->GetInputDS(
"StEvent") );
107 ret.detectorId = kBarrelEmcTowerId;
110 StEmcGeom::instance(
"bemc")->getId(hit.module(), hit.eta(), abs(hit.sub()), towerId);
112 ret.towerId = towerId;
114 float towerX, towerY, towerZ;
115 StEmcGeom::instance(
"bemc")->getXYZ(towerId, towerX, towerY, towerZ);
116 TVector3 tower(towerX, towerY, towerZ);
118 ret.towerR = tower.Perp();
119 ret.towerEta = tower.Eta();
120 ret.towerPhi = tower.Phi();
130 ret.vertexX = vertex.x();
131 ret.vertexY = vertex.y();
132 ret.vertexZ = vertex.z();
135 ret.energy = hit.energy();
140 _bemcTables->
getPedestal(BTOW, towerId, CAP, pedestal, rms);
141 ret.pedestal = pedestal;
145 _bemcTables->
getStatus(BTOW, towerId, status);
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in 'physical events'. Therefore there is only 1 primary vert...
void getPedestal(Int_t det, Int_t softId, Int_t cap, Float_t &ped, Float_t &rms) const
Return pedestal mean and rms.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
static StEmcCollection * emcCollection()
returns pointer to current StEmcCollection
void getStatus(Int_t det, Int_t softId, Int_t &status, const char *option="") const
Return status.