12 #include "StEStructQAHists.h"
14 #include "StEStructPool/EventMaker/StEStructEvent.h"
15 #include "StEStructPool/EventMaker/StEStructTrack.h"
16 #include "StEStructPool/EventMaker/StEStructCentrality.h"
26 mCents[0]=mCents[1]=NULL;
27 mptCents[0]=mptCents[1]=mptCents[2]=NULL;
29 mTotMult=mPosMult=mNegMult=0;
30 mTotMult4=mPosMult4=mNegMult4=0;
37 StEStructQAHists::~StEStructQAHists(){ };
44 void StEStructQAHists::initHistograms(){
52 fillBaseHistograms(event,reader);
55 void StEStructQAHists::writeHistograms(TFile * tf){
57 writeBaseHistograms(tf);
58 if(!mhasAIndex) writeTrackHistograms(tf);
71 void StEStructQAHists::initBaseHistograms(){
75 int mbNBins = cent->numCentralities();
77 mCents[0] =
new TH1D(
"cenClass",
"cenClass",mbNBins,-0.5,mbNBins-0.5);
78 mCents[1] =
new TH1D(
"centralityDefs",
"centralityDefs",mbNBins,0.5,mbNBins+0.5);
82 for (
int i=0;i<mbNBins;i++) mCents[1]->Fill(i,cent->centralityLimit(i));
84 int mbNPtBins = cent->numPtCentralities();
86 mptCents[0]=
new TH1D(
"ptCenClass",
"ptCenClass",mbNPtBins,-0.5,mbNPtBins-0.5);
87 mptCents[1]=
new TH1D(
"centralityPtDefs",
"centralityPtDefs",mbNPtBins,0.5,mbNPtBins+0.5);
89 for (
int i=0;i<mbNPtBins;i++) mptCents[1]->Fill(i,cent->ptCentralityLimit(i));
92 int mbNPts = cent->numPts();
94 mptCents[2] =
new TH1D(
"ptRanges",
"ptRanges",mbNPts,-0.5,mbNPts+0.5);
96 for (
int i=0;i<mbNPts;i++) mptCents[i]->Fill(i,cent->ptLimit(i));
98 mRefMult =
new TH1D(
"refMult",
"refMult for comparison",2500,-0.5,2500-0.5);
99 mTotMult =
new TH1D(
"totalMultiplicity",
"totalMultiplicity",2500,-0.5,2500-0.5);
100 mPosMult =
new TH1D(
"positiveMultiplicity",
"positiveMultiplicity",1500,-0.5,1500-0.5);
101 mNegMult =
new TH1D(
"negativeMultiplicity",
"negativeMultiplicity",1500,-0.5,1500-0.5);
102 mTotMult4 =
new TH1D(
"nTotOneQuarter",
"nTotOneQuarter",100,0.0,7.0);
103 mPosMult4 =
new TH1D(
"nPosOneQuarter",
"nPosOneQuarter",100,0.0,7.0);
104 mNegMult4 =
new TH1D(
"nNegOneQuarter",
"nNegOneQuarter",100,0.0,7.0);
108 aaGenImpact =
new TH1D(
"impact",
"impact",100,0.0,20.0);
109 aaGen[0] =
new TH2F(
"binary",
"binary",500,0.5,2000.5,50,0.0,20.0);
110 aaGen[1] =
new TH2F(
"participant",
"participant",500,0.5,500.5,50,0.0,20.0);
112 aaGenBin =
new TH1D*[mbNBins-1];
113 aaGenPart =
new TH1D*[mbNBins-1];
114 for(
int i=0;i<mbNBins-1;i++){
116 TString bName(
"binary_"); bName += i;
117 TString pName(
"participant_"); pName += i;
118 aaGenBin[i] =
new TH1D(bName.Data(),bName.Data(),2000,0.5,2000.5);
119 aaGenPart[i] =
new TH1D(pName.Data(),pName.Data(),2000,0.5,2000.5);
126 ppELines =
new TH1F*[mbNBins-1];
127 ppALines =
new TH1F*[mbNBins-1];
129 for(
int i=0;i<mbNBins-1;i++){
131 TString pName(
"partonLines_"); pName+=i;
132 ppELines[i] =
new TH1F(pName.Data(),pName.Data(),1000,0.5,1000.5);
133 TString aName(
"allPartonLines_"); aName+=i;
134 ppALines[i] =
new TH1F(aName.Data(),aName.Data(),200,0.,4000.);
147 int ic = cent->centrality(event->Centrality());
149 if(mptCents[0])mptCents[0]->Fill(ic);
150 mRefMult->Fill(event->RefMult());
151 mTotMult->Fill(event->Ntrack());
152 mPosMult->Fill(event->Npos());
153 mNegMult->Fill(event->Nneg());
154 mTotMult4->Fill(pow(event->Ntrack(),0.25));
155 mPosMult4->Fill(pow(event->Npos(),0.25));
156 mNegMult4->Fill(pow(event->Nneg(),0.25));
159 if(aaGenImpact)aaGenImpact->Fill(reader->getImpact());
160 if(aaGen[0])aaGen[0]->Fill(reader->getBinary(),reader->getImpact());
161 if(aaGen[1])aaGen[1]->Fill(reader->getParticipants(),reader->getImpact());
163 if(aaGenBin[ic]) aaGenBin[ic]->Fill(reader->getBinary());
164 if(aaGenPart[ic])aaGenPart[ic]->Fill(reader->getParticipants());
166 }
else if(mEType==2){
168 ppELines[ic]->Fill(reader->getNPartonic());
169 ppALines[ic]->Fill(reader->getNPartonic());
176 void StEStructQAHists::writeBaseHistograms(TFile* tf){
179 for(
int i=0;i<2;i++)
if(mCents[i])mCents[i]->Write();
180 for(
int i=0;i<3;i++)
if(mptCents[i])mptCents[i]->Write();
189 if(aaGenImpact)aaGenImpact->Write();
190 for(
int i=0;i<2;i++)
if(aaGen[i])aaGen[i]->Write();
191 for(
int i=0;i<StEStructCentrality::Instance()->numCentralities()-1;i++){
192 if(aaGenBin[i])aaGenBin[i]->Write();
193 if(aaGenPart[i])aaGenPart[i]->Write();
195 }
else if(mEType==2){
196 for(
int i=0;i<StEStructCentrality::Instance()->numCentralities()-1;i++){
197 if(ppELines[i])ppELines[i]->Write();
198 if(ppALines[i])ppALines[i]->Write();
204 void StEStructQAHists::initTrackHistograms(
int numBins,
int aIndex){
209 int qbins = 2*numBins;
211 mHEta =
new TH1F*[qbins];
212 mHPhi =
new TH1F*[qbins];
213 mHPt =
new TH1F*[qbins];
214 mHYt =
new TH1F*[qbins];
215 mHMass =
new TH1F*[qbins];
216 mHdEdxPtot =
new TH2F*[numBins];
217 mHToFPtot =
new TH2F*[numBins];
218 mHEtaPt =
new TH2F*[qbins];
222 float xetamin = -2.0;
224 float xphimin = -M_PI;
225 float xphimax = M_PI;
230 float xmassmin = 0.0;
231 float xmassmax = 4.0;
238 float ydmax = 15.0e-06;
250 for(
int i=0; i<numBins;i++){
253 if(mhasAIndex)heta+=haIndex.Data();
254 if(numBins>1)heta+=i;
255 TString hpeta(
"Qp"); hpeta+=heta.Data();
256 mHEta[i]=
new TH1F(hpeta.Data(),hpeta.Data(),nall,xetamin,xetamax);
257 TString hmeta(
"Qm"); hmeta+=heta.Data();
258 mHEta[i+numBins]=
new TH1F(hmeta.Data(),hmeta.Data(),nall,xetamin,xetamax);
261 if(mhasAIndex)hphi+=haIndex.Data();
262 if(numBins>1)hphi+=i;
263 TString hpphi(
"Qp"); hpphi+=hphi.Data();
264 mHPhi[i]=
new TH1F(hpphi.Data(),hpphi.Data(),nall,xphimin,xphimax);
265 TString hmphi(
"Qm"); hmphi+=hphi.Data();
266 mHPhi[i+numBins]=
new TH1F(hmphi.Data(),hmphi.Data(),nall,xphimin,xphimax);
269 if(mhasAIndex)hpt+=haIndex.Data();
271 TString hppt(
"Qp"); hppt+=hpt.Data();
272 mHPt[i]=
new TH1F(hppt.Data(),hppt.Data(),nall,xptmin,xptmax);
273 TString hmpt(
"Qm"); hmpt+=hpt.Data();
274 mHPt[i+numBins]=
new TH1F(hmpt.Data(),hmpt.Data(),nall,xptmin,xptmax);
277 if(mhasAIndex)hyt+=haIndex.Data();
279 TString hpyt(
"Qp"); hpyt+=hyt.Data();
280 mHYt[i]=
new TH1F(hpyt.Data(),hpyt.Data(),nall,xytmin,xytmax);
281 TString hmyt(
"Qm"); hmyt+=hyt.Data();
282 mHYt[i+numBins]=
new TH1F(hmyt.Data(),hmyt.Data(),nall,xytmin,xytmax);
284 TString hdedxP(
"dEdx_P");
285 if(mhasAIndex)hdedxP+=haIndex.Data();
286 if(numBins>1)hdedxP+=i;
287 mHdEdxPtot[i] =
new TH2F(hdedxP.Data(),hdedxP.Data(),nx,xpmin,xpmax,ny,ydmin,ydmax);
289 TString hmass(
"Mass");
290 if(mhasAIndex)hmass+=haIndex.Data();
291 if(numBins>1)hmass+=i;
292 TString hpmass(
"Qp"); hpmass+=hmass.Data();
293 mHMass[i]=
new TH1F(hpmass.Data(),hpmass.Data(),nMass,xmassmin,xmassmax);
294 TString hmmass(
"Qm"); hmmass+=hmass.Data();
295 mHMass[i+numBins]=
new TH1F(hmmass.Data(),hmmass.Data(),nMass,xmassmin,xmassmax);
297 TString htofP(
"mass_P");
298 if(mhasAIndex)htofP+=haIndex.Data();
299 if(numBins>1)htofP+=i;
300 mHToFPtot[i] =
new TH2F(htofP.Data(),htofP.Data(),nx,xpmin,xpmax,ny,ytofmin,ytofmax);
302 TString hetapt(
"EtaPt");
303 if(mhasAIndex)hetapt+=haIndex.Data();
304 if(numBins>1)hetapt+=i;
305 TString hpetapt(
"Qp"); hpetapt+=hetapt.Data();
306 mHEtaPt[i]=
new TH2F(hpetapt.Data(),hpetapt.Data(),20,-1.0,1.0,30,0.1,3.1);
307 TString hmetapt(
"Qm"); hmetapt+=hetapt.Data();
308 mHEtaPt[i+numBins]=
new TH2F(hmetapt.Data(),hmetapt.Data(),20,-1.0,1.0,30,0.1,3.1);
314 void StEStructQAHists::fillTrackHistograms(
StEStructTrack* t,
int ib) {
316 if (mntBins==0 || ib>mntBins) {
321 mHdEdxPtot[i]->Fill(-t->Ptot(),t->Dedx());
322 mHToFPtot[i]->Fill(-t->Ptot(),t->Mass());
325 mHdEdxPtot[i]->Fill(t->Ptot(),t->Dedx());
326 mHToFPtot[i]->Fill(t->Ptot(),t->Mass());
329 mHEta[i]->Fill(t->Eta());
330 mHPhi[i]->Fill(t->Phi());
331 mHPt[i]->Fill(t->Pt());
332 mHYt[i]->Fill(t->Yt());
333 mHEtaPt[i]->Fill(t->Eta(),t->Pt());
334 mHMass[i]->Fill(t->Mass());
339 void StEStructQAHists::writeTrackHistograms(TFile* tf){
341 if(!tf || mntBins==0)
return;
344 for(
int i=0;i<2*mntBins;i++){
352 for(
int i=0;i<mntBins;i++){
353 mHdEdxPtot[i]->Write();
354 mHToFPtot[i]->Write();