1 #include "StEEmcQAMaker.h"
8 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
9 #include "StMuDSTMaker/COMMON/StMuDst.h"
10 #include "StMuDSTMaker/COMMON/StMuEvent.h"
11 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
12 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
14 #include "StEEmcPool/StMaxStripPi0/StEEmcA2EMaker.h"
17 StEEmcQAMaker::StEEmcQAMaker(
const Char_t *name ) :
StMaker(name)
24 mSamplingFractionP=0.007;
25 mSamplingFractionQ=0.007;
26 mSamplingFractionR=0.007;
36 hEventCounter =
new TH1F(
"hEventCounter",
"Event counts",10,0.,10.);
41 hEventCounter -> GetXaxis() -> SetBinLabel(5,
"eemc response");
44 hFrequencyT=
new TH2F(
"hFrequencyT",
"Tower frequency",60,0.,60.,12,0.,12.);
45 hFrequencyP=
new TH2F(
"hFrequencyP",
"Pre1 frequency",60,0.,60.,12,0.,12.);
46 hFrequencyQ=
new TH2F(
"hFrequencyQ",
"Pre2 frequency",60,0.,60.,12,0.,12.);
47 hFrequencyR=
new TH2F(
"hFrequencyR",
"Post frequency",60,0.,60.,12,0.,12.);
52 TString htitle=
"Triggers analysed per sector [0,12)";
53 hTriggers.push_back(
new TH1F(hname,htitle,12,0.,12.));
56 hTriggers.push_back(
new TH1F(
"hTrigOr",
"Any trigger in trigger list [0,12)",12,0.,12.));
60 const Char_t *secname[]={
61 "[0]",
"[1]",
"[2]",
"[3]",
"[4]",
"[5]",
"[6]",
"[7]",
"[8]",
"[9]",
62 "[10]",
"[11]",
"Full",
"Cut"};
66 for ( Int_t sec=0;sec<14;sec++ )
69 TString hname=
"hEnergyDeposit";
70 TString htitle=
"EM Energy [GeV] summed over towers in sector ";
73 hEnergyDepositT.push_back(
new TH1F(hname+
"T"+secname[sec],htitle,60,0.,60.));
74 htitle=
"Energy deposit [MeV] summed over towers in sector ";
75 hEnergyDepositP.push_back(
new TH1F(hname+
"P"+secname[sec],htitle,50,0.,200.));
76 hEnergyDepositQ.push_back(
new TH1F(hname+
"Q"+secname[sec],htitle,50,0.,200.));
77 hEnergyDepositR.push_back(
new TH1F(hname+
"R"+secname[sec],htitle,50,0.,200.));
78 htitle.ReplaceAll(
"towers",
"smd strips");
79 hEnergyDepositU.push_back(
new TH1F(hname+
"U"+secname[sec],htitle,50,0.,400.));
80 hEnergyDepositV.push_back(
new TH1F(hname+
"V"+secname[sec],htitle,50,0.,400.));
83 hname.ReplaceAll(
"EnergyDeposit",
"Multiplicity");
84 htitle=
"Sector multiplicity ";htitle+=secname[sec];
86 hMultiplicityT.push_back(
new TH1F(hname+
"T"+secname[sec],htitle,60,0.,60.));
87 hMultiplicityP.push_back(
new TH1F(hname+
"P"+secname[sec],htitle,60,0.,60.));
88 hMultiplicityQ.push_back(
new TH1F(hname+
"Q"+secname[sec],htitle,60,0.,60.));
89 hMultiplicityR.push_back(
new TH1F(hname+
"R"+secname[sec],htitle,60,0.,60.));
90 hMultiplicityU.push_back(
new TH1F(hname+
"U"+secname[sec],htitle,60,0.,60.));
91 hMultiplicityV.push_back(
new TH1F(hname+
"V"+secname[sec],htitle,60,0.,60.));
95 htitle=
"ADC-ped in ";htitle+=secname[sec];
97 hAdcT.push_back(
new TH1F(hname+
"T"+secname[sec],htitle,512,0.,512.));
98 hAdcP.push_back(
new TH1F(hname+
"P"+secname[sec],htitle,512,0.,512.));
99 hAdcQ.push_back(
new TH1F(hname+
"Q"+secname[sec],htitle,512,0.,512.));
100 hAdcR.push_back(
new TH1F(hname+
"R"+secname[sec],htitle,512,0.,512.));
101 hAdcU.push_back(
new TH1F(hname+
"U"+secname[sec],htitle,512,0.,512.));
102 hAdcV.push_back(
new TH1F(hname+
"V"+secname[sec],htitle,512,0.,512.));
105 hname=
"hNglobal";hname+=secname[sec];
106 hNglobal.push_back(
new TH1F(hname,
"Number of global tracks",50,0.,50.));
107 hname=
"hNprimary";hname+=secname[sec];
108 hNprimary.push_back(
new TH1F(hname,
"Number of primary tracks",50,0.,50.));
109 hname=
"hNvertex";hname+=secname[sec];
110 hNvertex.push_back(
new TH1F(hname,
"Number of primary vertices",10,0.,10.));
111 hname=
"hZvertex";hname+=secname[sec];
112 hZvertex.push_back(
new TH1F(hname,
"Z of 1st primary vertex",200,-200.,200.));
113 hname=
"hZvertexErr";hname+=secname[sec];
114 hZvertexErr.push_back(
new TH1F(hname,
"Z err of 1st primary vertex",200,-200.,200.));
115 hname=
"hRankVertex";hname+=secname[sec];
116 hRankVertex.push_back(
new TH1F(hname,
"Ranking of 1st primary vertex",100,0.,100.));
117 hname=
"hNtrackVertex";hname+=secname[sec];
118 hNtrackVertex.push_back(
new TH1F(hname,
"Number of tracks used 1st prim vert",25,0.,25.));
119 hname=
"hNtrackVertexEE";hname+=secname[sec];
120 hNtrackVertexEE.push_back(
new TH1F(hname,
"Number of tracks used 1st prim vert macthed to eemc",25,0.,25.));
121 hname=
"hPTsumVertex";hname+=secname[sec];
122 hPTsumVertex.push_back(
new TH1F(hname,
"Scalar pT sum of tracks used 1st prim vertex [GeV]",100,0.,100.));
127 return StMaker::Init();
197 if ( ht.
fail() )
return false;
205 if ( l1trig.isTrigger( myId ) ) {
235 if ( ht.
fail() )
return false;
238 Int_t numberOfVertices=
mMuDst -> muDst() -> numberOfPrimaryVertices();
240 hNvertex[ 12 ] -> Fill( numberOfVertices );
243 hNvertex[ 13 ] -> Fill( numberOfVertices );
247 if ( !numberOfVertices )
return true;
251 Float_t zvertex=vertex->position().z();
254 if ( zvertex < zVertexMin || zvertex >
zVertexMax )
return false;
258 Float_t ezvertex = vertex->posError().z();
264 Float_t rank = vertex -> ranking();
270 Int_t ntrack = vertex -> nTracksUsed();
275 ntrack = vertex -> nEEMCMatch();
281 Float_t ptsum = vertex -> sumTrackPt();
295 if ( ht.
fail() )
return false;
300 Int_t nGlobal=
mMuDst->
muDst()->numberOfGlobalTracks();
305 Int_t nPrimary=
mMuDst->
muDst()->numberOfPrimaryTracks();
325 if ( ht.
fail() )
return false;
327 if ( mysector < 0 )
return false;
330 Int_t ht_phi = ht.
phibin();
331 Int_t ht_eta = ht.
etabin();
344 Float_t energy_deposit[6];
345 for ( Int_t i=0;i<6;i++ )
351 for ( Int_t i=1;i<6;i++ )
352 energy_deposit[i] *= 1000.0;
368 for ( Int_t sub=0;sub<5; sub++ )
369 for ( Int_t eta=0;eta<12;eta++ )
383 if ( strip.
fail() || strip.
energy()<=0. )
continue;
384 hAdcU[mysector]->Fill( strip.
adc() );
390 if ( strip.
fail() || strip.
energy()<=0. )
continue;
391 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
std::vector< TH1F * > hAdcR
ADC.
std::vector< TH1F * > hAdcV
ADC.
std::vector< TH1F * > hEnergyDepositU
Energy deposited in layer.
Float_t mSamplingFractionU
SMD sampling fraction.
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 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.
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.
void Clear(Option_t *opts="")
User defined functions.
Float_t mSamplingFractionT
Tower sampling fraction.
Int_t nVertexMax
Cuts on primary vertex (see constructor for defaults)
Float_t mSamplingFractionV
SMD sampling fraction.
Int_t numberOfHits(Int_t sector, Int_t layer) const