16 #include "StDetectorDbMaker/StDetectorDbTriggerID.h"
21 #include "StEventTypes.h"
24 #include "StPhysicalHelixD.hh"
27 #include "tables/St_vertexSeed_Table.h"
32 #include "SystemOfUnits.h"
35 #include "StMuDSTMaker/COMMON/StMuDst.h"
36 #include "StMuDSTMaker/COMMON/StMuTrack.h"
37 #include "StMuDSTMaker/COMMON/StMuEvent.h"
38 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
39 #include "StMuDSTMaker/COMMON/StMuEmcCollection.h"
40 #include "StMuDSTMaker/COMMON/StMuDst.h"
41 #include "StMuDSTMaker/COMMON/StMuEmcUtil.h"
44 #include "StEventTypes.h"
47 #include "StEmcClusterCollection.h"
48 #include "StEmcPoint.h"
49 #include "StEmcUtil/geometry/StEmcGeom.h"
50 #include "StEmcUtil/others/emcDetectorName.h"
51 #include "StEmcADCtoEMaker/StBemcData.h"
52 #include "StEmcADCtoEMaker/StEmcADCtoEMaker.h"
53 #include "StEmcRawMaker/defines.h"
54 #include "StEmcRawMaker/StBemcRaw.h"
55 #include "StEmcRawMaker/StBemcTables.h"
56 #include "StEmcRawMaker/StEmcRawMaker.h"
57 #include "StEmcRawMaker/defines.h"
60 #include "StEEmcUtil/database/StEEmcDb.h"
61 #include "StEEmcUtil/database/EEmcDbItem.h"
62 #include "StEEmcUtil/database/cstructs/eemcConstDB.hh"
63 #include "StEEmcUtil/EEfeeRaw/EEname2Index.h"
64 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
68 #include "StJetHistMaker.h"
80 Int_t StJetHistMaker::InitRun(Int_t runId)
82 cout <<
"Welcome to StJetHistMaker::InitRun()"<<endl;
83 mTables->loadTables((
StMaker*)
this);
113 Int_t StJetHistMaker::Init()
115 cout <<
"StJetHistMaker: output file: " << mOutName << endl;
118 mOutfile =
new TFile(mOutName,
"RECREATE");
121 mbVertexZvsNp =
new TH2F(
"mbVertexZvsNp",
"Z_{vertex} vs N_{good-primary} (mb)", 101, -0.5, 100.5, 400, -200., 200.);
122 mbTrackKin =
new TH3F(
"mbTrackKin",
"Eta vs Phi vs Pt (mb)", 200, 0., 10., 100, -3.14159, 3.14159, 100, -1.5, 1.5);
123 mbNfitVsEta =
new TH2F(
"mbNfitVsEta",
"Eta vs N_{fit} (mb)", 56, -0.5, 55.5, 100, -1.5, 1.5);
126 ht1VertexZvsNp =
new TH2F(
"ht1VertexZvsNp",
"Z_{vertex} vs N_{good-primary} (ht1)", 101, -0.5, 100.5, 400, -200., 200.);
127 ht1TrackKin =
new TH3F(
"ht1TrackKin",
"Eta vs Phi vs Pt (ht1)", 200, 0., 10., 100, -3.14159, 3.14159, 100, -1.5, 1.5);
128 ht1NfitVsEta =
new TH2F(
"ht1NfitVsEta",
"Eta vs N_{fit} (ht1)", 56, -0.5, 55.5, 100, -1.5, 1.5);
131 otherVertexZvsNp =
new TH2F(
"otherVertexZvsNp",
"Z_{vertex} vs N_{good-primary} (other)", 101, -0.5, 100.5, 400, -200., 200.);
132 otherTrackKin =
new TH3F(
"otherTrackKin",
"Eta vs Phi vs Pt (other)", 200, 0., 10., 100, -3.14159, 3.14159, 100, -1.5, 1.5);
133 otherNfitVsEta =
new TH2F(
"otherNfitVsEta",
"Eta vs N_{fit} (other)", 56, -0.5, 55.5, 100, -1.5, 1.5);
136 mipHistVsEta =
new TH2F(
"mipHistVsEta",
"ADC_{MIP} distribution vs Tower Eta",20, 0., 1., 200, 0, 200);
137 mipEvsEta =
new TH2F(
"mipEvsEta",
"E_{MIP} distribution vs Tower Eta",20, 0., 1., 200, 0, 2);
138 towerEvsId =
new TH2F(
"towerEvsId",
"E_{Tower} vs ID",2401, -0.5, 2400.5, 100, 0., 10.);
139 towerAdcvsId =
new TH2F(
"towerAdcvsId",
"ADC_{Tower} vs ID", 2401, -0.5, 2400.5, 100, 0., 500.);
142 return StMaker::Init();
145 void StJetHistMaker::fillBarrelHits()
147 cout <<
"void StJetHistMaker::fillBarrelHits()"<<endl;
151 StEmcGeom* geom = StEmcGeom::instance(
"bemc");
171 for(
int m = 1; m<=120;m++) {
175 StSPtrVecEmcRawHit& rawHits = module->hits();
177 for(UInt_t k=0;k<rawHits.size();k++) {
181 int m = tempRawHit->module();
182 int e = tempRawHit->eta();
183 int s = abs(tempRawHit->sub());
186 geom->getId(m,e,s,
id);
189 mTables->getStatus(BTOW,
id, status);
194 mTables->getPedestal(BTOW,
id, CAP, pedestal, rms);
198 geom->getEtaPhi(
id,eta,phi);
202 mTables->getCalib(BTOW,
id,1,gain);
204 if (gain!=0. && status==1);
215 cout <<
" Start StJetHistMaker :: "<< GetName() <<endl;
216 gMessMgr->SwitchOff(
"I");
217 gMessMgr->SwitchOff(
"E");
218 gMessMgr->SwitchOff(
"W");
219 gMessMgr->SwitchOff(
"Q");
223 mudst = muDstMaker->
muDst();
242 int startriggers[3] = {45010, 45201, 45202};
243 int trigs[3] = {0,0,0};
244 int prescales[3] = {0,0,0};
247 for (
int i=0; i<3; ++i) {
248 if (l1trig.isTrigger(startriggers[i])) {
257 for (
int j=0; j<3; ++j) {
259 if (v.getL0OfflineTrgId(i) == startriggers[j]) {
260 prescales[j] = v.getPsL0(i);
265 if (vertex.z()!=0. && fabs(vertex.z())<50 ) {
268 int nTracks = mudst->primaryTracks()->GetLast()+1;
270 for(
int i = 0; i < nTracks; i++) {
279 && fabs(track->
eta())<0.5
289 mbTrackKin->Fill( mom.perp(), mom.phi(), mom.pseudoRapidity() );
290 mbNfitVsEta->Fill(track->
nHitsFit(), mom.pseudoRapidity());
293 ht1TrackKin->Fill( mom.perp(), mom.phi(), mom.pseudoRapidity() );
294 ht1NfitVsEta->Fill(track->
nHitsFit(), mom.pseudoRapidity());
296 if (trigs[0]==0 && trigs[1]==0 && trigs[2]==0) {
297 otherTrackKin->Fill( mom.perp(), mom.phi(), mom.pseudoRapidity() );
298 otherNfitVsEta->Fill(track->
nHitsFit(), mom.pseudoRapidity());
305 mbVertexZvsNp->Fill(nprim, vertex.z());
308 ht1VertexZvsNp->Fill(nprim, vertex.z());
310 if (trigs[0]==0 && trigs[1]==0 && trigs[2]==0) {
311 otherVertexZvsNp->Fill(nprim, vertex.z());
318 void StJetHistMaker::FinishFile(
void)
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in 'physical events'. Therefore there is only 1 primary vert...
Double_t pt() const
Returns pT at point of dca to primary vertex.
UShort_t nHitsFit() const
Return total number of hits used in fit.
Accessor to the database for trigger id information.
short flag() const
Returns flag, (see StEvent manual for type information)
Double_t eta() const
Returns pseudo rapidity at point of dca to primary vertex.
const StThreeVectorF & momentum() const
Returns 3-momentum at dca to primary vertex.
Collection of trigger ids as stored in MuDst.
StTrackTopologyMap topologyMap() const
Returns topology map.