1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 #include "Riostream.h" //needed as include
17 #include "AliFlowCommonConstants.h" //needed as include
18 #include "AliFlowCommonHist.h"
19 #include "AliFlowEventSimple.h"
20 #include "AliFlowTrackSimple.h"
24 #include "TMath.h" //needed as include
27 #include "AliFlowVector.h"
35 // Description: Class to organise common histograms for Flow Analysis
37 // authors: N. van der Kolk (kolk@nikhef.nl), A. Bilandzic (anteb@nikhef.nl), RS
42 ClassImp(AliFlowCommonHist)
44 //-----------------------------------------------------------------------
46 AliFlowCommonHist::AliFlowCommonHist():
48 fBookOnlyBasic(kFALSE),
51 fHistMultPOIvsRP(NULL),
66 fHistProMeanPtperBin(NULL),
67 fHistWeightvsPhi(NULL),
70 fHistAngleQSub0(NULL),
71 fHistAngleQSub1(NULL),
73 fRefMultVsNoOfRPs(NULL),
83 AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
85 fBookOnlyBasic(a.fBookOnlyBasic),
86 fHistMultRP(new TH1F(*a.fHistMultRP)),
87 fHistMultPOI(new TH1F(*a.fHistMultPOI)),
88 fHistMultPOIvsRP(new TH2F(*a.fHistMultPOIvsRP)),
89 fHistPtRP(new TH1F(*a.fHistPtRP)),
90 fHistPtPOI(new TH1F(*a.fHistPtPOI)),
91 fHistPtSub0(new TH1F(*a.fHistPtSub0)),
92 fHistPtSub1(new TH1F(*a.fHistPtSub1)),
93 fHistPhiRP(new TH1F(*a.fHistPhiRP)),
94 fHistPhiPOI(new TH1F(*a.fHistPhiPOI)),
95 fHistPhiSub0(new TH1F(*a.fHistPhiSub0)),
96 fHistPhiSub1(new TH1F(*a.fHistPhiSub1)),
97 fHistEtaRP(new TH1F(*a.fHistEtaRP)),
98 fHistEtaPOI(new TH1F(*a.fHistEtaPOI)),
99 fHistEtaSub0(new TH1F(*a.fHistEtaSub0)),
100 fHistEtaSub1(new TH1F(*a.fHistEtaSub1)),
101 fHistPhiEtaRP(new TH2F(*a.fHistPhiEtaRP)),
102 fHistPhiEtaPOI(new TH2F(*a.fHistPhiEtaPOI)),
103 fHistProMeanPtperBin(new TProfile(*a.fHistProMeanPtperBin)),
104 fHistWeightvsPhi(new TH2F(*a.fHistWeightvsPhi)),
105 fHistQ(new TH1F(*a.fHistQ)),
106 fHistAngleQ(new TH1F(*a.fHistAngleQ)),
107 fHistAngleQSub0(new TH1F(*a.fHistAngleQSub0)),
108 fHistAngleQSub1(new TH1F(*a.fHistAngleQSub1)),
109 fHarmonic(new TProfile(*a.fHarmonic)),
110 fRefMultVsNoOfRPs(new TProfile(*a.fRefMultVsNoOfRPs)),
111 fHistRefMult(new TH1F(*a.fHistRefMult)),
112 fHistMassPOI(new TH2F(*a.fHistMassPOI)),
117 fHistList = new TList();
118 fHistList-> Add(fHistMultRP);
119 fHistList-> Add(fHistMultPOI);
120 if(!fBookOnlyBasic){fHistList-> Add(fHistMultPOIvsRP);}
121 fHistList-> Add(fHistPtRP);
122 fHistList-> Add(fHistPtPOI);
123 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub0);}
124 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub1);}
125 fHistList-> Add(fHistPhiRP);
126 fHistList-> Add(fHistPhiPOI);
127 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub0);}
128 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub1);}
129 fHistList-> Add(fHistEtaRP);
130 fHistList-> Add(fHistEtaPOI);
131 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub0);}
132 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub1);}
133 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaRP);}
134 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaPOI);}
135 fHistList-> Add(fHistProMeanPtperBin);
136 if(!fBookOnlyBasic){fHistList-> Add(fHistWeightvsPhi);}
137 fHistList-> Add(fHarmonic);
138 fHistList-> Add(fRefMultVsNoOfRPs);
139 fHistList-> Add(fHistRefMult);
140 fHistList-> Add(fHistMassPOI);
141 if(!fBookOnlyBasic){fHistList-> Add(fHistQ);}
142 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
143 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub0);}
144 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub1);}
145 // TListIter next = TListIter(a.fHistList);
150 //-----------------------------------------------------------------------
152 AliFlowCommonHist::AliFlowCommonHist(const char *anInput, const char *title, Bool_t bookOnlyBasic):
153 TNamed(anInput,title),
154 fBookOnlyBasic(bookOnlyBasic),
157 fHistMultPOIvsRP(NULL),
171 fHistPhiEtaPOI(NULL),
172 fHistProMeanPtperBin(NULL),
173 fHistWeightvsPhi(NULL),
176 fHistAngleQSub0(NULL),
177 fHistAngleQSub1(NULL),
179 fRefMultVsNoOfRPs(NULL),
185 //constructor creating histograms
186 Int_t iNbinsMult = AliFlowCommonConstants::GetMaster()->GetNbinsMult();
187 Int_t iNbinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
188 Int_t iNbinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
189 Int_t iNbinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
190 Int_t iNbinsQ = AliFlowCommonConstants::GetMaster()->GetNbinsQ();
191 Int_t iNbinsMass = AliFlowCommonConstants::GetMaster()->GetNbinsMass();
194 Double_t dMultMin = AliFlowCommonConstants::GetMaster()->GetMultMin();
195 Double_t dMultMax = AliFlowCommonConstants::GetMaster()->GetMultMax();
196 Double_t dPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
197 Double_t dPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
198 Double_t dPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
199 Double_t dPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
200 Double_t dEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
201 Double_t dEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
202 Double_t dQMin = AliFlowCommonConstants::GetMaster()->GetQMin();
203 Double_t dQMax = AliFlowCommonConstants::GetMaster()->GetQMax();
204 Double_t dHistWeightvsPhiMin = AliFlowCommonConstants::GetMaster()->GetHistWeightvsPhiMin();
205 Double_t dHistWeightvsPhiMax = AliFlowCommonConstants::GetMaster()->GetHistWeightvsPhiMax();
206 Double_t dMassMin = AliFlowCommonConstants::GetMaster()->GetMassMin();
207 Double_t dMassMax = AliFlowCommonConstants::GetMaster()->GetMassMax();
210 // cout<<"The settings for the common histograms are as follows:"<<endl;
211 // cout<<"Multiplicity: "<<iNbinsMult<<" bins between "<<dMultMin<<" and "<<dMultMax<<endl;
212 // cout<<"Pt: "<<iNbinsPt<<" bins between "<<dPtMin<<" and "<<dPtMax<<endl;
213 // cout<<"Phi: "<<iNbinsPhi<<" bins between "<<dPhiMin<<" and "<<dPhiMax<<endl;
214 // cout<<"Eta: "<<iNbinsEta<<" bins between "<<dEtaMin<<" and "<<dEtaMax<<endl;
215 // cout<<"Q: "<<iNbinsQ<<" bins between "<<dQMin<<" and "<<dQMax<<endl;
216 // cout<<"Mass: "<<iNbinsMass<<" bins between "<<dMassMin<<" and "<<dMassMax<<endl;
219 sName = "Control_Flow_MultRP_";
221 fHistMultRP = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
222 fHistMultRP ->SetXTitle("Multiplicity for RP selection");
223 fHistMultRP ->SetYTitle("Counts");
225 sName = "Control_Flow_MultPOI_";
227 fHistMultPOI = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
228 fHistMultPOI ->SetXTitle("Multiplicity for POI selection");
229 fHistMultPOI ->SetYTitle("Counts");
232 sName = "Control_Flow_MultPOIvsRP_";
234 fHistMultPOIvsRP = new TH2F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax,100, dMultMin, dMultMax);
235 fHistMultPOIvsRP->SetXTitle("Multiplicity for RP selection");
236 fHistMultPOIvsRP->SetYTitle("Multiplicity for POI selection");
240 sName = "Control_Flow_PtRP_";
242 fHistPtRP = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
243 fHistPtRP ->SetXTitle("P_{t} (GeV/c) for RP selection");
244 fHistPtRP ->SetYTitle("Counts");
246 sName = "Control_Flow_PtPOI_";
248 fHistPtPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
249 //binning has to be the same as for fHistProVPt! use to get Nprime!
250 fHistPtPOI ->SetXTitle("P_{t} (GeV/c) for POI selection");
251 fHistPtPOI ->SetYTitle("Counts");
254 sName = "Control_Flow_PtSub0_";
256 fHistPtSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
257 fHistPtSub0 ->SetXTitle("P_{t} (GeV/c) for Subevent 0 selection");
258 fHistPtSub0 ->SetYTitle("Counts");
262 sName = "Control_Flow_PtSub1_";
264 fHistPtSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
265 fHistPtSub1 ->SetXTitle("P_{t} (GeV/c) for Subevent 1 selection");
266 fHistPtSub1 ->SetYTitle("Counts");
270 sName = "Control_Flow_PhiRP_";
272 fHistPhiRP = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
273 fHistPhiRP ->SetXTitle("#phi for RP selection");
274 fHistPhiRP ->SetYTitle("Counts");
276 sName = "Control_Flow_PhiPOI_";
278 fHistPhiPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
279 fHistPhiPOI ->SetXTitle("#phi for POI selection");
280 fHistPhiPOI ->SetYTitle("Counts");
283 sName = "Control_Flow_PhiSub0_";
285 fHistPhiSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
286 fHistPhiSub0 ->SetXTitle("#phi for Subevent 0 selection");
287 fHistPhiSub0 ->SetYTitle("Counts");
291 sName = "Control_Flow_PhiSub1_";
293 fHistPhiSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
294 fHistPhiSub1 ->SetXTitle("#phi for Subevent 1 selection");
295 fHistPhiSub1 ->SetYTitle("Counts");
299 sName = "Control_Flow_EtaRP_";
301 fHistEtaRP = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
302 fHistEtaRP ->SetXTitle("#eta for RP selection");
303 fHistEtaRP ->SetYTitle("Counts");
305 sName = "Control_Flow_EtaPOI_";
307 fHistEtaPOI = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
308 fHistEtaPOI ->SetXTitle("#eta for POI selection");
309 fHistEtaPOI ->SetYTitle("Counts");
312 sName = "Control_Flow_EtaSub0_";
314 fHistEtaSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
315 fHistEtaSub0 ->SetXTitle("#eta for Subevent 0 selection");
316 fHistEtaSub0 ->SetYTitle("Counts");
320 sName = "Control_Flow_EtaSub1_";
322 fHistEtaSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
323 fHistEtaSub1 ->SetXTitle("#eta for Subevent 1 selection");
324 fHistEtaSub1 ->SetYTitle("Counts");
329 sName = "Control_Flow_PhiEtaRP_";
331 fHistPhiEtaRP = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
332 fHistPhiEtaRP ->SetXTitle("#eta");
333 fHistPhiEtaRP ->SetYTitle("#phi");
337 sName = "Control_Flow_PhiEtaPOI_";
339 fHistPhiEtaPOI = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
340 fHistPhiEtaPOI ->SetXTitle("#eta");
341 fHistPhiEtaPOI ->SetYTitle("#phi");
345 sName = "Control_FlowPro_MeanPtperBin_";
347 fHistProMeanPtperBin = new TProfile(sName.Data(), sName.Data(),iNbinsPt,dPtMin,dPtMax);
348 fHistProMeanPtperBin ->SetXTitle("P_{t} (GeV/c) ");
349 fHistProMeanPtperBin ->SetYTitle("<P_{t}> (GeV/c) ");
354 sName = "Control_Flow_WeightvsPhi_";
356 fHistWeightvsPhi = new TH2F(sName.Data(), sName.Data(), iNbinsPhi, dPhiMin, dPhiMax, 300, dHistWeightvsPhiMin, dHistWeightvsPhiMax);
357 fHistWeightvsPhi ->SetXTitle("#phi");
358 fHistWeightvsPhi ->SetYTitle("weight");
363 sName = "Control_Flow_Q_";
365 fHistQ = new TH1F(sName.Data(), sName.Data(),iNbinsQ, dQMin, dQMax);
366 fHistQ ->SetXTitle("Q_{vector}/Mult");
367 fHistQ ->SetYTitle("Counts");
372 sName = "Control_Flow_AngleQ_";
374 fHistAngleQ = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
375 fHistAngleQ ->SetXTitle("Angle of Q_{vector}");
376 fHistAngleQ ->SetYTitle("Counts");
380 sName = "Control_Flow_AngleQSub0_";
382 fHistAngleQSub0 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
383 fHistAngleQSub0 ->SetXTitle("Angle of Q_{vector} for Subevent 0");
384 fHistAngleQSub0 ->SetYTitle("Counts");
388 sName = "Control_Flow_AngleQSub1_";
390 fHistAngleQSub1 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
391 fHistAngleQSub1 ->SetXTitle("Angle of Q_{vector} for Subevent 1");
392 fHistAngleQSub1 ->SetYTitle("Counts");
396 sName = "Control_Flow_Harmonic_";
398 fHarmonic = new TProfile(sName.Data(),sName.Data(),1,0,1);
399 fHarmonic ->SetYTitle("harmonic");
401 //<reference multiplicity> versus # of RPs
402 sName = "Reference_Multiplicity_Vs_Number_Of_RPs_";
404 fRefMultVsNoOfRPs = new TProfile(sName.Data(),sName.Data(),iNbinsMult, dMultMin, dMultMax);
405 fRefMultVsNoOfRPs->SetYTitle("<reference multiplicity>");
406 fRefMultVsNoOfRPs->SetXTitle("# of RPs");
408 //reference multiplicity
409 sName = "Control_Flow_Ref_Mult_";
411 fHistRefMult = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
412 fHistRefMult->SetXTitle("Reference multiplicity");
413 fHistRefMult->SetYTitle("Counts");
415 //mass for POI selection
416 sName = "Control_Flow_Mass_POI";
418 fHistMassPOI = new TH2F(sName.Data(), sName.Data(), iNbinsMass, dMassMin, dMassMax,
419 iNbinsPt, dPtMin, dPtMax);
420 Double_t mbWidth = 0.;
423 mbWidth = (dMassMax-dMassMin)/iNbinsMass*1000.;
425 fHistMassPOI->SetXTitle("Mass (GeV/c^{2})");
426 fHistMassPOI->SetYTitle("P_{t} (GeV/c)");
427 fHistMassPOI->SetZTitle( Form("Counts/(%.2f MeV/c^{2})",mbWidth));
429 //list of histograms if added here also add in copy constructor
430 fHistList = new TList();
431 fHistList-> Add(fHistMultRP);
432 fHistList-> Add(fHistMultPOI);
433 if(!fBookOnlyBasic){fHistList-> Add(fHistMultPOIvsRP);}
434 fHistList-> Add(fHistPtRP);
435 fHistList-> Add(fHistPtPOI);
436 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub0);}
437 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub1);}
438 fHistList-> Add(fHistPhiRP);
439 fHistList-> Add(fHistPhiPOI);
440 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub0);}
441 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub1);}
442 fHistList-> Add(fHistEtaRP);
443 fHistList-> Add(fHistEtaPOI);
444 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub0);}
445 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub1);}
446 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaRP);}
447 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaPOI);}
448 fHistList-> Add(fHistProMeanPtperBin);
449 if(!fBookOnlyBasic){fHistList-> Add(fHistWeightvsPhi);}
450 fHistList-> Add(fHarmonic);
451 fHistList-> Add(fRefMultVsNoOfRPs);
452 fHistList-> Add(fHistRefMult);
453 fHistList-> Add(fHistMassPOI);
454 if(!fBookOnlyBasic){fHistList-> Add(fHistQ);}
455 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
456 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub0);}
457 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub1);}
462 //-----------------------------------------------------------------------
464 AliFlowCommonHist::~AliFlowCommonHist()
469 delete fHistMultPOIvsRP;
482 delete fHistPhiEtaRP;
483 delete fHistPhiEtaPOI;
484 delete fHistProMeanPtperBin;
485 delete fHistWeightvsPhi;
488 delete fHistAngleQSub0;
489 delete fHistAngleQSub1;
491 delete fRefMultVsNoOfRPs;
498 //-----------------------------------------------------------------------
500 Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* anEvent,TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
502 //Fills the control histograms
504 cout<<"##### FillControlHistograms: FlowEvent pointer null"<<endl;
512 Double_t dWeight = 1.;
514 //weights used for corrections
519 TH1F *phiWeights = NULL;
520 TH1F *phiWeightsSub0 = NULL;
521 TH1F *phiWeightsSub1 = NULL;
522 TH1D *ptWeights = NULL;
523 TH1D *etaWeights = NULL;
526 Int_t nBinsPhiSub0 = 0;
527 Int_t nBinsPhiSub1 = 0;
528 Double_t dBinWidthPt = 0.;
529 Double_t dPtMin = 0.;
530 Double_t dBinWidthEta = 0.;
531 Double_t dEtaMin = 0.;
537 phiWeights = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights"));
538 if(phiWeights) nBinsPhi = phiWeights->GetNbinsX();
539 phiWeightsSub0 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub0"));
540 if(phiWeightsSub0) nBinsPhiSub0 = phiWeightsSub0->GetNbinsX();
541 phiWeightsSub1 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub1"));
542 if(phiWeightsSub1) nBinsPhiSub1 = phiWeightsSub1->GetNbinsX();
546 ptWeights = dynamic_cast<TH1D *>(weightsList->FindObject("pt_weights"));
549 dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
550 dPtMin = (ptWeights->GetXaxis())->GetXmin();
555 etaWeights = dynamic_cast<TH1D *>(weightsList->FindObject("eta_weights"));
558 dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
559 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
562 } // end of if(weightsList)
566 //fill the histograms
567 AliFlowVector vQ = anEvent->GetQ(2, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
568 //weight by the Multiplicity
571 if (vQ.GetMult()!=0) {
572 dQX = vQ.X()/vQ.GetMult();
573 dQY = vQ.Y()/vQ.GetMult();
576 if(!fBookOnlyBasic){fHistQ->Fill(vQ.Mod());}
577 if(!fBookOnlyBasic){fHistAngleQ->Fill(vQ.Phi()/2);}
579 AliFlowVector* vQSub = new AliFlowVector[2];
580 anEvent->Get2Qsub(vQSub, 2, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
581 AliFlowVector vQa = vQSub[0];
582 AliFlowVector vQb = vQSub[1];
583 if(!fBookOnlyBasic){fHistAngleQSub0->Fill(vQa.Phi()/2);}
584 if(!fBookOnlyBasic){fHistAngleQSub1->Fill(vQb.Phi()/2);}
586 Double_t dMultRP = 0.;
587 Double_t dMultPOI = 0.;
589 Int_t iNumberOfTracks = anEvent->NumberOfTracks();
590 AliFlowTrackSimple* pTrack = NULL;
592 for (Int_t i=0;i<iNumberOfTracks;i++) {
593 pTrack = anEvent->GetTrack(i);
595 dWeight = pTrack->Weight();
597 dPhi = pTrack->Phi();
598 if (dPhi<0.) dPhi+=2*TMath::Pi();
599 dEta = pTrack->Eta();
601 //weights are only used for the RP selection
602 if (pTrack->InRPSelection()){
603 // determine Phi weight:
604 if(phiWeights && nBinsPhi) {
605 dWPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
607 // determine v'(pt) weight:
608 if(ptWeights && dBinWidthPt) {
609 dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
611 // determine v'(eta) weight:
612 if(etaWeights && dBinWidthEta) {
613 dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
616 //the total weight is the product
617 Double_t dW = dWeight*dWPhi*dWPt*dWEta;
620 fHistPtRP->Fill(dPt,dW);
622 fHistPhiRP->Fill(dPhi,dW);
624 fHistEtaRP->Fill(dEta,dW);
626 if(!fBookOnlyBasic){fHistPhiEtaRP->Fill(dEta,dPhi,dW);}
628 if(!fBookOnlyBasic){fHistWeightvsPhi->Fill(dPhi,dW);}
632 if (pTrack->InRPSelection() && pTrack->InSubevent(0)) {
633 // determine Phi weight:
634 if(phiWeightsSub0 && nBinsPhiSub0){
635 dWPhi = phiWeightsSub0->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhiSub0/TMath::TwoPi())));
637 // determine v'(pt) weight:
638 if(ptWeights && dBinWidthPt) {
639 dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
641 // determine v'(eta) weight:
642 if(etaWeights && dBinWidthEta) {
643 dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
646 //the total weight is the product
647 Double_t dW = dWeight*dWPhi*dWPt*dWEta;
650 if(!fBookOnlyBasic){fHistPtSub0 ->Fill(dPt,dW);}
652 if(!fBookOnlyBasic){fHistPhiSub0 ->Fill(dPhi,dW);}
654 if(!fBookOnlyBasic){fHistEtaSub0 ->Fill(dEta,dW);}
656 if (pTrack->InRPSelection() && pTrack->InSubevent(1)) {
657 // determine Phi weight:
658 if(phiWeightsSub1 && nBinsPhiSub1){
659 dWPhi = phiWeightsSub1->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhiSub1/TMath::TwoPi())));
661 // determine v'(pt) weight:
662 if(ptWeights && dBinWidthPt) {
663 dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
665 // determine v'(eta) weight:
666 if(etaWeights && dBinWidthEta) {
667 dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
670 //the total weight is the product
671 Double_t dW = dWeight*dWPhi*dWPt*dWEta;
674 if(!fBookOnlyBasic){fHistPtSub1 -> Fill(dPt,dW);}
676 if(!fBookOnlyBasic){fHistPhiSub1 -> Fill(dPhi,dW);}
678 if(!fBookOnlyBasic){fHistEtaSub1 -> Fill(dEta,dW);}
680 if (pTrack->InPOISelection()){
682 Double_t dW = dWeight; //no pt, phi or eta weights
685 fHistPtPOI ->Fill(dPt,dW);
687 fHistPhiPOI ->Fill(dPhi,dW);
689 fHistEtaPOI ->Fill(dEta,dW);
691 if(!fBookOnlyBasic){fHistPhiEtaPOI->Fill(dEta,dPhi,dW);}
693 fHistProMeanPtperBin ->Fill(dPt,dPt,dW);
695 fHistMassPOI->Fill(pTrack->Mass(),dPt,dW);
702 fHistMultRP->Fill(dMultRP);
703 fHistMultPOI->Fill(dMultPOI);
704 if(!fBookOnlyBasic){fHistMultPOIvsRP->Fill(dMultRP,dMultPOI);}
706 //<reference multiplicity> versus # of RPs:
707 fRefMultVsNoOfRPs->Fill(dMultRP+0.5,anEvent->GetReferenceMultiplicity(),1.);
709 //reference multiplicity:
710 fHistRefMult->Fill(anEvent->GetReferenceMultiplicity());
715 //-----------------------------------------------------------------------
717 Double_t AliFlowCommonHist::GetEntriesInPtBinRP(Int_t aBin)
719 //get entries in bin aBin from fHistPtRP
720 Double_t dEntries = fHistPtRP->GetBinContent(aBin);
726 //-----------------------------------------------------------------------
728 Double_t AliFlowCommonHist::GetEntriesInPtBinPOI(Int_t aBin)
730 //get entries in bin aBin from fHistPtPOI
731 Double_t dEntries = fHistPtPOI->GetBinContent(aBin);
737 //-----------------------------------------------------------------------
739 Double_t AliFlowCommonHist::GetEntriesInEtaBinRP(Int_t aBin)
741 //get entries in bin aBin from fHistPtRP
742 Double_t dEntries = fHistEtaRP->GetBinContent(aBin);
748 //-----------------------------------------------------------------------
750 Double_t AliFlowCommonHist::GetEntriesInEtaBinPOI(Int_t aBin)
752 //get entries in bin aBin from fHistPtPOI
753 Double_t dEntries = fHistEtaPOI->GetBinContent(aBin);
759 //-----------------------------------------------------------------------
761 Double_t AliFlowCommonHist::GetMeanPt(Int_t aBin)
763 //Get entry from bin aBin from fHistProMeanPtperBin
764 Double_t dMeanPt = fHistProMeanPtperBin->GetBinContent(aBin);
771 //-----------------------------------------------------------------------
772 Double_t AliFlowCommonHist::Merge(TCollection *aList)
775 //cout<<"entering merge function"<<endl;
776 if (!aList) return 0;
777 if (aList->IsEmpty()) return 0; //no merging is needed
780 TIter next(aList); // list is supposed to contain only objects of the same type as this
781 AliFlowCommonHist *toMerge=NULL;
782 while ((toMerge=(AliFlowCommonHist*)next())) {
784 tempList.Add(toMerge->GetHistList());
785 fHistList->Merge(&tempList);
789 //cout<<"Merged"<<endl;
790 return (double)iCount;
794 void AliFlowCommonHist::Print(Option_t *option) const
796 // -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
797 // ===============================================
798 // printf( "TH1.Print Name = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
799 printf( "Class.Print Name = %s, Histogram list:\n",GetName());
802 fHistList->Print(option);
806 printf( "Empty histogram list \n");
810 //-----------------------------------------------------------------------
811 void AliFlowCommonHist::Browse(TBrowser *b)
815 if (fHistList) b->Add(fHistList,"AliFlowCommonHistList");