13 #include "StEEmcQAMaker.h"
20 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
21 #include "StMuDSTMaker/COMMON/StMuDst.h"
22 #include "StMuDSTMaker/COMMON/StMuEvent.h"
23 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
24 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
26 #include "StEEmcA2EMaker.h"
29 StEEmcQAMaker::StEEmcQAMaker(
const Char_t *name ) :
StMaker(name)
35 mSamplingFractionT=0.04;
36 mSamplingFractionU=0.007;
37 mSamplingFractionV=0.007;
44 hEventCounter =
new TH1F(
"hEventCounter",
"Event counts",10,0.,10.);
49 hEventCounter -> GetXaxis() -> SetBinLabel(5,
"eemc response");
52 hFrequencyT=
new TH2F(
"hFrequencyT",
"Tower frequency",60,0.,60.,12,0.,12.);
53 hFrequencyP=
new TH2F(
"hFrequencyP",
"Pre1 frequency",60,0.,60.,12,0.,12.);
54 hFrequencyQ=
new TH2F(
"hFrequencyQ",
"Pre2 frequency",60,0.,60.,12,0.,12.);
55 hFrequencyR=
new TH2F(
"hFrequencyR",
"Post frequency",60,0.,60.,12,0.,12.);
60 TString htitle=
"Triggers analysed per sector [0,12)";
61 hTriggers.push_back(
new TH1F(hname,htitle,12,0.,12.));
63 hTriggersHard.push_back(
new TH1F(hname+
"hard",htitle,12,0.,12.));
66 hTriggers.push_back(
new TH1F(
"hTrigOr",
"Any trigger in trigger list [0,12)",12,0.,12.));
70 const Char_t *secname[]={
71 "[0]",
"[1]",
"[2]",
"[3]",
"[4]",
"[5]",
"[6]",
"[7]",
"[8]",
"[9]",
72 "[10]",
"[11]",
"Full",
"Cut"};
76 for ( Int_t sec=0;sec<14;sec++ )
79 TString hname=
"hEnergyDeposit";
80 TString htitle=
"EM Energy [GeV] summed over towers in sector ";
83 hEnergyDepositT.push_back(
new TH1F(hname+
"T"+secname[sec],htitle,60,0.,60.));
84 htitle=
"Energy deposit [MeV] summed over towers in sector ";
85 hEnergyDepositP.push_back(
new TH1F(hname+
"P"+secname[sec],htitle,50,0.,200.));
86 hEnergyDepositQ.push_back(
new TH1F(hname+
"Q"+secname[sec],htitle,50,0.,200.));
87 hEnergyDepositR.push_back(
new TH1F(hname+
"R"+secname[sec],htitle,50,0.,200.));
88 htitle.ReplaceAll(
"towers",
"smd strips");
89 hEnergyDepositU.push_back(
new TH1F(hname+
"U"+secname[sec],htitle,50,0.,400.));
90 hEnergyDepositV.push_back(
new TH1F(hname+
"V"+secname[sec],htitle,50,0.,400.));
93 hname.ReplaceAll(
"EnergyDeposit",
"Multiplicity");
94 htitle=
"Sector multiplicity ";htitle+=secname[sec];
96 hMultiplicityT.push_back(
new TH1F(hname+
"T"+secname[sec],htitle,60,0.,60.));
97 hMultiplicityP.push_back(
new TH1F(hname+
"P"+secname[sec],htitle,60,0.,60.));
98 hMultiplicityQ.push_back(
new TH1F(hname+
"Q"+secname[sec],htitle,60,0.,60.));
99 hMultiplicityR.push_back(
new TH1F(hname+
"R"+secname[sec],htitle,60,0.,60.));
100 hMultiplicityU.push_back(
new TH1F(hname+
"U"+secname[sec],htitle,60,0.,60.));
101 hMultiplicityV.push_back(
new TH1F(hname+
"V"+secname[sec],htitle,60,0.,60.));
105 htitle=
"ADC-ped in ";htitle+=secname[sec];
107 hAdcT.push_back(
new TH1F(hname+
"T"+secname[sec],htitle,512,0.,512.));
108 hAdcP.push_back(
new TH1F(hname+
"P"+secname[sec],htitle,512,0.,512.));
109 hAdcQ.push_back(
new TH1F(hname+
"Q"+secname[sec],htitle,512,0.,512.));
110 hAdcR.push_back(
new TH1F(hname+
"R"+secname[sec],htitle,512,0.,512.));
111 hAdcU.push_back(
new TH1F(hname+
"U"+secname[sec],htitle,512,0.,512.));
112 hAdcV.push_back(
new TH1F(hname+
"V"+secname[sec],htitle,512,0.,512.));
115 hname=
"hNglobal";hname+=secname[sec];
116 hNglobal.push_back(
new TH1F(hname,
"Number of global tracks",50,0.,50.));
117 hname=
"hNprimary";hname+=secname[sec];
118 hNprimary.push_back(
new TH1F(hname,
"Number of primary tracks",50,0.,50.));
119 hname=
"hNvertex";hname+=secname[sec];
120 hNvertex.push_back(
new TH1F(hname,
"Number of primary vertices",10,0.,10.));
121 hname=
"hZvertex";hname+=secname[sec];
122 hZvertex.push_back(
new TH1F(hname,
"Z of 1st primary vertex",200,-200.,200.));
123 hname=
"hZvertexErr";hname+=secname[sec];
124 hZvertexErr.push_back(
new TH1F(hname,
"Z err of 1st primary vertex",200,-200.,200.));
125 hname=
"hRankVertex";hname+=secname[sec];
126 hRankVertex.push_back(
new TH1F(hname,
"Ranking of 1st primary vertex",100,0.,100.));
127 hname=
"hNtrackVertex";hname+=secname[sec];
128 hNtrackVertex.push_back(
new TH1F(hname,
"Number of tracks used 1st prim vert",25,0.,25.));
129 hname=
"hNtrackVertexEE";hname+=secname[sec];
130 hNtrackVertexEE.push_back(
new TH1F(hname,
"Number of tracks used 1st prim vert macthed to eemc",25,0.,25.));
131 hname=
"hPTsumVertex";hname+=secname[sec];
132 hPTsumVertex.push_back(
new TH1F(hname,
"Scalar pT sum of tracks used 1st prim vertex [GeV]",100,0.,100.));
137 return StMaker::Init();
201 Bool_t got_ht =
false;
205 if ( tow.
et() > ht.
et() && !(tow.
fail()) )
211 if ( !got_ht )
return false;
220 if ( l1trig.isTrigger( myId ) && ht.
et() >
mSoftTrig ) {
225 if ( l1trig.isTrigger( myId ) ) {
226 hTriggersHard[i]->Fill( ht.
sector() );
253 if ( ht.
fail() )
return false;
256 Int_t numberOfVertices=
mMuDst -> muDst() -> numberOfPrimaryVertices();
258 hNvertex[ 12 ] -> Fill( numberOfVertices );
261 hNvertex[ 13 ] -> Fill( numberOfVertices );
265 if ( !numberOfVertices )
return true;
269 Float_t zvertex=vertex->position().z();
272 if ( zvertex < zVertexMin || zvertex >
zVertexMax )
return false;
276 Float_t ezvertex = vertex->posError().z();
282 Float_t rank = vertex -> ranking();
288 Int_t ntrack = vertex -> nTracksUsed();
293 ntrack = vertex -> nEEMCMatch();
299 Float_t ptsum = vertex -> sumTrackPt();
313 if ( ht.
fail() )
return false;
318 Int_t nGlobal=
mMuDst->
muDst()->numberOfGlobalTracks();
323 Int_t nPrimary=
mMuDst->
muDst()->numberOfPrimaryTracks();
343 if ( ht.
fail() )
return false;
345 if ( mysector < 0 )
return false;
348 Int_t ht_phi = ht.
phibin();
349 Int_t ht_eta = ht.
etabin();
362 Float_t energy_deposit[6];
363 for ( Int_t i=0;i<6;i++ )
369 for ( Int_t i=1;i<6;i++ )
370 energy_deposit[i] *= 1000.0;
386 for ( Int_t sub=0;sub<5; sub++ )
387 for ( Int_t eta=0;eta<12;eta++ )
401 if ( strip.
fail() || strip.
energy()<=0. )
continue;
402 hAdcU[mysector]->Fill( strip.
adc() );
408 if ( strip.
fail() || strip.
energy()<=0. )
continue;
409 hAdcV[mysector]->Fill( strip.
adc() );
std::vector< TH1F * > hZvertexErr
Error on z vertex.
std::vector< Int_t > mTriggerList
List of triggers to process.
std::vector< TH1F * > hAdcT
ADC.
EEmc ADC –> energy maker.
TH1F * hEventCounter
Histogram for counting events.
std::vector< TH1F * > hZvertex
Z vertex.
std::vector< TH1F * > hMultiplicityT
[MeV]
std::vector< TH1F * > hMultiplicityU
Multiplicity in layer.
void mudst(const Char_t *name)
sets pointer to the muDst maker
StEEmcTower & hittower(Int_t hit, Int_t layer)
std::vector< TH1F * > hAdcR
ADC.
std::vector< TH1F * > hAdcV
ADC.
std::vector< TH1F * > hEnergyDepositU
Energy deposited in layer.
std::vector< TH1F * > hEnergyDepositP
Energy deposited in layer.
std::vector< TH1F * > hAdcP
ADC.
std::vector< TH1F * > hAdcQ
ADC.
std::vector< TH1F * > hEnergyDepositR
Energy deposited in layer.
void analysis(const Char_t *name)
sets pointer to adc–>energy maker
StEEmcStrip & hitstrip(Int_t sec, Int_t pl, Int_t hit)
Int_t numberOfHitStrips(Int_t sector, Int_t plane) const
std::vector< TH1F * > hNtrackVertexEE
Number of tracks matched to eemc and vertex.
std::vector< TH1F * > hMultiplicityV
Multiplicity in layer.
TH2F * hFrequencyQ
Frequency pre2 is highest on EEMC.
Int_t numberOfHitTowers(Int_t layer) const
Int_t etabin() const
Returns the etabin of this tower, pre- or postshower element.
TH2F * hFrequencyR
Frequency post is highest on EEMC.
void fail(unsigned f)
Set a fail bit for this element.
Float_t mSoftTrig
Software trigger threshold.
StMuDstMaker * mMuDst
MuDst.
std::vector< TH1F * > hNtrackVertex
Number of tracks matched to vertex.
StEEmcA2EMaker * mEEanalysis
ADC –> Energy.
std::vector< TH1F * > hPTsumVertex
Scalar sum of PT of tracks associated with vertex.
std::vector< TH1F * > hEnergyDepositT
Energy deposited in layer.
Float_t energy(Int_t sector, Int_t layer) const
std::vector< TH1F * > hMultiplicityP
Multiplicity in layer.
std::vector< TH1F * > hTriggers
Histograms for counting triggers (one per trigger ID)
TH2F * hFrequencyT
Frequency tower is highest on EEMC.
Base class for representing tower, preshower and postshower elements.
StEEmcTower & hightower(Int_t layer=0)
std::vector< TH1F * > hAdcU
ADC.
TH2F * hFrequencyP
Frequency pre1 is highest on EEMC.
Int_t sector() const
Returns sector of this tower, pre- or postshower element.
std::vector< TH1F * > hEnergyDepositQ
Energy deposited in layer.
std::vector< TH1F * > hNglobal
Number of global tracks.
Example of QA histograming using the StEEmcA2EMaker.
Int_t phibin() const
Returns the phibin of this tower.
void adc(Float_t a)
Set the pedestal-subtracted ADC for this element.
std::vector< TH1F * > hMultiplicityR
Multiplicity in layer.
std::vector< TH1F * > hMultiplicityQ
Multiplicity in layer.
std::vector< TH1F * > hEnergyDepositV
Energy deposited in layer.
virtual Int_t Make()
Process one event.
StEEmcTower & tower(Int_t index, Int_t layer=0)
std::vector< TH1F * > hNprimary
Number of primary tracks.
virtual Int_t Init()
Initialize the maker.
void energy(Float_t e)
Set the energy (adc-ped+0.5)/gain for this element.
std::vector< TH1F * > hNvertex
Number of vertices.
std::vector< TH1F * > hRankVertex
Rank of vertex.
Base class for describing an endcap SMD strip.
Collection of trigger ids as stored in MuDst.
Int_t nVertexMax
Cuts on primary vertex (see constructor for defaults)
Int_t numberOfHits(Int_t sector, Int_t layer) const