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
40 ClassImp(AliFlowCommonHist)
42 //-----------------------------------------------------------------------
44 AliFlowCommonHist::AliFlowCommonHist():
46 fBookOnlyBasic(kFALSE),
49 fHistMultPOIvsRP(NULL),
64 fHistProMeanPtperBin(NULL),
65 fHistWeightvsPhi(NULL),
68 fHistAngleQSub0(NULL),
69 fHistAngleQSub1(NULL),
71 fRefMultVsNoOfRPs(NULL),
81 AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
83 fBookOnlyBasic(a.fBookOnlyBasic),
84 fHistMultRP(new TH1F(*a.fHistMultRP)),
85 fHistMultPOI(new TH1F(*a.fHistMultPOI)),
86 fHistMultPOIvsRP(new TH2F(*a.fHistMultPOIvsRP)),
87 fHistPtRP(new TH1F(*a.fHistPtRP)),
88 fHistPtPOI(new TH1F(*a.fHistPtPOI)),
89 fHistPtSub0(new TH1F(*a.fHistPtSub0)),
90 fHistPtSub1(new TH1F(*a.fHistPtSub1)),
91 fHistPhiRP(new TH1F(*a.fHistPhiRP)),
92 fHistPhiPOI(new TH1F(*a.fHistPhiPOI)),
93 fHistPhiSub0(new TH1F(*a.fHistPhiSub0)),
94 fHistPhiSub1(new TH1F(*a.fHistPhiSub1)),
95 fHistEtaRP(new TH1F(*a.fHistEtaRP)),
96 fHistEtaPOI(new TH1F(*a.fHistEtaPOI)),
97 fHistEtaSub0(new TH1F(*a.fHistEtaSub0)),
98 fHistEtaSub1(new TH1F(*a.fHistEtaSub1)),
99 fHistPhiEtaRP(new TH2F(*a.fHistPhiEtaRP)),
100 fHistPhiEtaPOI(new TH2F(*a.fHistPhiEtaPOI)),
101 fHistProMeanPtperBin(new TProfile(*a.fHistProMeanPtperBin)),
102 fHistWeightvsPhi(new TH2F(*a.fHistWeightvsPhi)),
103 fHistQ(new TH1F(*a.fHistQ)),
104 fHistAngleQ(new TH1F(*a.fHistAngleQ)),
105 fHistAngleQSub0(new TH1F(*a.fHistAngleQSub0)),
106 fHistAngleQSub1(new TH1F(*a.fHistAngleQSub1)),
107 fHarmonic(new TProfile(*a.fHarmonic)),
108 fRefMultVsNoOfRPs(new TProfile(*a.fRefMultVsNoOfRPs)),
109 fHistRefMult(new TH1F(*a.fHistRefMult)),
110 fHistMassPOI(new TH2F(*a.fHistMassPOI)),
115 fHistList = new TList();
116 fHistList-> Add(fHistMultRP);
117 fHistList-> Add(fHistMultPOI);
118 if(!fBookOnlyBasic){fHistList-> Add(fHistMultPOIvsRP);}
119 fHistList-> Add(fHistPtRP);
120 fHistList-> Add(fHistPtPOI);
121 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub0);}
122 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub1);}
123 fHistList-> Add(fHistPhiRP);
124 fHistList-> Add(fHistPhiPOI);
125 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub0);}
126 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub1);}
127 fHistList-> Add(fHistEtaRP);
128 fHistList-> Add(fHistEtaPOI);
129 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub0);}
130 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub1);}
131 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaRP);}
132 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaPOI);}
133 fHistList-> Add(fHistProMeanPtperBin);
134 if(!fBookOnlyBasic){fHistList-> Add(fHistWeightvsPhi);}
135 fHistList-> Add(fHarmonic);
136 fHistList-> Add(fRefMultVsNoOfRPs);
137 fHistList-> Add(fHistRefMult);
138 fHistList-> Add(fHistMassPOI);
139 if(!fBookOnlyBasic){fHistList-> Add(fHistQ);}
140 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
141 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub0);}
142 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub1);}
143 // TListIter next = TListIter(a.fHistList);
148 //-----------------------------------------------------------------------
150 AliFlowCommonHist::AliFlowCommonHist(const char *anInput, const char *title, Bool_t bookOnlyBasic):
151 TNamed(anInput,title),
152 fBookOnlyBasic(bookOnlyBasic),
155 fHistMultPOIvsRP(NULL),
169 fHistPhiEtaPOI(NULL),
170 fHistProMeanPtperBin(NULL),
171 fHistWeightvsPhi(NULL),
174 fHistAngleQSub0(NULL),
175 fHistAngleQSub1(NULL),
177 fRefMultVsNoOfRPs(NULL),
183 //constructor creating histograms
184 Int_t iNbinsMult = AliFlowCommonConstants::GetMaster()->GetNbinsMult();
185 Int_t iNbinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
186 Int_t iNbinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
187 Int_t iNbinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
188 Int_t iNbinsQ = AliFlowCommonConstants::GetMaster()->GetNbinsQ();
189 Int_t iNbinsMass = AliFlowCommonConstants::GetMaster()->GetNbinsMass();
192 Double_t dMultMin = AliFlowCommonConstants::GetMaster()->GetMultMin();
193 Double_t dMultMax = AliFlowCommonConstants::GetMaster()->GetMultMax();
194 Double_t dPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
195 Double_t dPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
196 Double_t dPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
197 Double_t dPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
198 Double_t dEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
199 Double_t dEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
200 Double_t dQMin = AliFlowCommonConstants::GetMaster()->GetQMin();
201 Double_t dQMax = AliFlowCommonConstants::GetMaster()->GetQMax();
202 Double_t dHistWeightvsPhiMin = AliFlowCommonConstants::GetMaster()->GetHistWeightvsPhiMin();
203 Double_t dHistWeightvsPhiMax = AliFlowCommonConstants::GetMaster()->GetHistWeightvsPhiMax();
204 Double_t dMassMin = AliFlowCommonConstants::GetMaster()->GetMassMin();
205 Double_t dMassMax = AliFlowCommonConstants::GetMaster()->GetMassMax();
208 // cout<<"The settings for the common histograms are as follows:"<<endl;
209 // cout<<"Multiplicity: "<<iNbinsMult<<" bins between "<<dMultMin<<" and "<<dMultMax<<endl;
210 // cout<<"Pt: "<<iNbinsPt<<" bins between "<<dPtMin<<" and "<<dPtMax<<endl;
211 // cout<<"Phi: "<<iNbinsPhi<<" bins between "<<dPhiMin<<" and "<<dPhiMax<<endl;
212 // cout<<"Eta: "<<iNbinsEta<<" bins between "<<dEtaMin<<" and "<<dEtaMax<<endl;
213 // cout<<"Q: "<<iNbinsQ<<" bins between "<<dQMin<<" and "<<dQMax<<endl;
214 // cout<<"Mass: "<<iNbinsMass<<" bins between "<<dMassMin<<" and "<<dMassMax<<endl;
217 sName = "Control_Flow_MultRP_";
219 fHistMultRP = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
220 fHistMultRP ->SetXTitle("Multiplicity for RP selection");
221 fHistMultRP ->SetYTitle("Counts");
223 sName = "Control_Flow_MultPOI_";
225 fHistMultPOI = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
226 fHistMultPOI ->SetXTitle("Multiplicity for POI selection");
227 fHistMultPOI ->SetYTitle("Counts");
230 sName = "Control_Flow_MultPOIvsRP_";
232 fHistMultPOIvsRP = new TH2F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax,100, dMultMin, dMultMax);
233 fHistMultPOIvsRP->SetXTitle("Multiplicity for RP selection");
234 fHistMultPOIvsRP->SetYTitle("Multiplicity for POI selection");
238 sName = "Control_Flow_PtRP_";
240 fHistPtRP = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
241 fHistPtRP ->SetXTitle("P_{t} (GeV/c) for RP selection");
242 fHistPtRP ->SetYTitle("Counts");
244 sName = "Control_Flow_PtPOI_";
246 fHistPtPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
247 //binning has to be the same as for fHistProVPt! use to get Nprime!
248 fHistPtPOI ->SetXTitle("P_{t} (GeV/c) for POI selection");
249 fHistPtPOI ->SetYTitle("Counts");
252 sName = "Control_Flow_PtSub0_";
254 fHistPtSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
255 fHistPtSub0 ->SetXTitle("P_{t} (GeV/c) for Subevent 0 selection");
256 fHistPtSub0 ->SetYTitle("Counts");
260 sName = "Control_Flow_PtSub1_";
262 fHistPtSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
263 fHistPtSub1 ->SetXTitle("P_{t} (GeV/c) for Subevent 1 selection");
264 fHistPtSub1 ->SetYTitle("Counts");
268 sName = "Control_Flow_PhiRP_";
270 fHistPhiRP = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
271 fHistPhiRP ->SetXTitle("#phi for RP selection");
272 fHistPhiRP ->SetYTitle("Counts");
274 sName = "Control_Flow_PhiPOI_";
276 fHistPhiPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
277 fHistPhiPOI ->SetXTitle("#phi for POI selection");
278 fHistPhiPOI ->SetYTitle("Counts");
281 sName = "Control_Flow_PhiSub0_";
283 fHistPhiSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
284 fHistPhiSub0 ->SetXTitle("#phi for Subevent 0 selection");
285 fHistPhiSub0 ->SetYTitle("Counts");
289 sName = "Control_Flow_PhiSub1_";
291 fHistPhiSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
292 fHistPhiSub1 ->SetXTitle("#phi for Subevent 1 selection");
293 fHistPhiSub1 ->SetYTitle("Counts");
297 sName = "Control_Flow_EtaRP_";
299 fHistEtaRP = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
300 fHistEtaRP ->SetXTitle("#eta for RP selection");
301 fHistEtaRP ->SetYTitle("Counts");
303 sName = "Control_Flow_EtaPOI_";
305 fHistEtaPOI = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
306 fHistEtaPOI ->SetXTitle("#eta for POI selection");
307 fHistEtaPOI ->SetYTitle("Counts");
310 sName = "Control_Flow_EtaSub0_";
312 fHistEtaSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
313 fHistEtaSub0 ->SetXTitle("#eta for Subevent 0 selection");
314 fHistEtaSub0 ->SetYTitle("Counts");
318 sName = "Control_Flow_EtaSub1_";
320 fHistEtaSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
321 fHistEtaSub1 ->SetXTitle("#eta for Subevent 1 selection");
322 fHistEtaSub1 ->SetYTitle("Counts");
327 sName = "Control_Flow_PhiEtaRP_";
329 fHistPhiEtaRP = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
330 fHistPhiEtaRP ->SetXTitle("#eta");
331 fHistPhiEtaRP ->SetYTitle("#phi");
335 sName = "Control_Flow_PhiEtaPOI_";
337 fHistPhiEtaPOI = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
338 fHistPhiEtaPOI ->SetXTitle("#eta");
339 fHistPhiEtaPOI ->SetYTitle("#phi");
343 sName = "Control_FlowPro_MeanPtperBin_";
345 fHistProMeanPtperBin = new TProfile(sName.Data(), sName.Data(),iNbinsPt,dPtMin,dPtMax);
346 fHistProMeanPtperBin ->SetXTitle("P_{t} (GeV/c) ");
347 fHistProMeanPtperBin ->SetYTitle("<P_{t}> (GeV/c) ");
352 sName = "Control_Flow_WeightvsPhi_";
354 fHistWeightvsPhi = new TH2F(sName.Data(), sName.Data(), iNbinsPhi, dPhiMin, dPhiMax, 300, dHistWeightvsPhiMin, dHistWeightvsPhiMax);
355 fHistWeightvsPhi ->SetXTitle("#phi");
356 fHistWeightvsPhi ->SetYTitle("weight");
361 sName = "Control_Flow_Q_";
363 fHistQ = new TH1F(sName.Data(), sName.Data(),iNbinsQ, dQMin, dQMax);
364 fHistQ ->SetXTitle("Q_{vector}/Mult");
365 fHistQ ->SetYTitle("Counts");
370 sName = "Control_Flow_AngleQ_";
372 fHistAngleQ = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
373 fHistAngleQ ->SetXTitle("Angle of Q_{vector}");
374 fHistAngleQ ->SetYTitle("Counts");
378 sName = "Control_Flow_AngleQSub0_";
380 fHistAngleQSub0 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
381 fHistAngleQSub0 ->SetXTitle("Angle of Q_{vector} for Subevent 0");
382 fHistAngleQSub0 ->SetYTitle("Counts");
386 sName = "Control_Flow_AngleQSub1_";
388 fHistAngleQSub1 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
389 fHistAngleQSub1 ->SetXTitle("Angle of Q_{vector} for Subevent 1");
390 fHistAngleQSub1 ->SetYTitle("Counts");
394 sName = "Control_Flow_Harmonic_";
396 fHarmonic = new TProfile(sName.Data(),sName.Data(),1,0,1);
397 fHarmonic ->SetYTitle("harmonic");
399 //<reference multiplicity> versus # of RPs
400 sName = "Reference_Multiplicity_Vs_Number_Of_RPs_";
402 fRefMultVsNoOfRPs = new TProfile(sName.Data(),sName.Data(),iNbinsMult, dMultMin, dMultMax);
403 fRefMultVsNoOfRPs->SetYTitle("<reference multiplicity>");
404 fRefMultVsNoOfRPs->SetXTitle("# of RPs");
406 //reference multiplicity
407 sName = "Control_Flow_Ref_Mult_";
409 fHistRefMult = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
410 fHistRefMult->SetXTitle("Reference multiplicity");
411 fHistRefMult->SetYTitle("Counts");
413 //mass for POI selection
414 sName = "Control_Flow_Mass_POI";
416 fHistMassPOI = new TH2F(sName.Data(), sName.Data(), iNbinsMass, dMassMin, dMassMax,
417 iNbinsPt, dPtMin, dPtMax);
418 double mbWidth = (dMassMax-dMassMin)/iNbinsMass*1000.;
419 fHistMassPOI->SetXTitle("Mass (GeV/c^{2})");
420 fHistMassPOI->SetYTitle("P_{t} (GeV/c)");
421 fHistMassPOI->SetZTitle( Form("Counts/(%.2f MeV/c^{2})",mbWidth) );
423 //list of histograms if added here also add in copy constructor
424 fHistList = new TList();
425 fHistList-> Add(fHistMultRP);
426 fHistList-> Add(fHistMultPOI);
427 if(!fBookOnlyBasic){fHistList-> Add(fHistMultPOIvsRP);}
428 fHistList-> Add(fHistPtRP);
429 fHistList-> Add(fHistPtPOI);
430 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub0);}
431 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub1);}
432 fHistList-> Add(fHistPhiRP);
433 fHistList-> Add(fHistPhiPOI);
434 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub0);}
435 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub1);}
436 fHistList-> Add(fHistEtaRP);
437 fHistList-> Add(fHistEtaPOI);
438 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub0);}
439 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub1);}
440 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaRP);}
441 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaPOI);}
442 fHistList-> Add(fHistProMeanPtperBin);
443 if(!fBookOnlyBasic){fHistList-> Add(fHistWeightvsPhi);}
444 fHistList-> Add(fHarmonic);
445 fHistList-> Add(fRefMultVsNoOfRPs);
446 fHistList-> Add(fHistRefMult);
447 fHistList-> Add(fHistMassPOI);
448 if(!fBookOnlyBasic){fHistList-> Add(fHistQ);}
449 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
450 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub0);}
451 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub1);}
456 //-----------------------------------------------------------------------
458 AliFlowCommonHist::~AliFlowCommonHist()
463 if(!fBookOnlyBasic){delete fHistMultPOIvsRP;}
466 if(!fBookOnlyBasic){delete fHistPtSub0;}
467 if(!fBookOnlyBasic){delete fHistPtSub1;}
470 if(!fBookOnlyBasic){delete fHistPhiSub0;}
471 if(!fBookOnlyBasic){delete fHistPhiSub1;}
474 if(!fBookOnlyBasic){delete fHistEtaSub0;}
475 if(!fBookOnlyBasic){delete fHistEtaSub1;}
476 delete fHistPhiEtaRP;
477 delete fHistPhiEtaPOI;
478 delete fHistProMeanPtperBin;
479 if(!fBookOnlyBasic){delete fHistWeightvsPhi;}
480 if(!fBookOnlyBasic){delete fHistQ;}
481 if(!fBookOnlyBasic){delete fHistAngleQ;}
482 if(!fBookOnlyBasic){delete fHistAngleQSub0;}
483 if(!fBookOnlyBasic){delete fHistAngleQSub1;}
485 delete fRefMultVsNoOfRPs;
492 //-----------------------------------------------------------------------
494 Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* anEvent,TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
496 //Fills the control histograms
498 cout<<"##### FillControlHistograms: FlowEvent pointer null"<<endl;
506 Double_t dWeight = 1.;
508 //weights used for corrections
513 TH1F *phiWeights = NULL;
514 TH1F *phiWeightsSub0 = NULL;
515 TH1F *phiWeightsSub1 = NULL;
516 TH1D *ptWeights = NULL;
517 TH1D *etaWeights = NULL;
520 Int_t nBinsPhiSub0 = 0;
521 Int_t nBinsPhiSub1 = 0;
522 Double_t dBinWidthPt = 0.;
523 Double_t dPtMin = 0.;
524 Double_t dBinWidthEta = 0.;
525 Double_t dEtaMin = 0.;
531 phiWeights = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights"));
532 if(phiWeights) nBinsPhi = phiWeights->GetNbinsX();
533 phiWeightsSub0 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub0"));
534 if(phiWeightsSub0) nBinsPhiSub0 = phiWeightsSub0->GetNbinsX();
535 phiWeightsSub1 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub1"));
536 if(phiWeightsSub1) nBinsPhiSub1 = phiWeightsSub1->GetNbinsX();
540 ptWeights = dynamic_cast<TH1D *>(weightsList->FindObject("pt_weights"));
543 dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
544 dPtMin = (ptWeights->GetXaxis())->GetXmin();
549 etaWeights = dynamic_cast<TH1D *>(weightsList->FindObject("eta_weights"));
552 dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
553 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
556 } // end of if(weightsList)
560 //fill the histograms
561 AliFlowVector vQ = anEvent->GetQ(2, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
562 //weight by the Multiplicity
565 if (vQ.GetMult()!=0) {
566 dQX = vQ.X()/vQ.GetMult();
567 dQY = vQ.Y()/vQ.GetMult();
570 if(!fBookOnlyBasic){fHistQ->Fill(vQ.Mod());}
571 if(!fBookOnlyBasic){fHistAngleQ->Fill(vQ.Phi()/2);}
573 AliFlowVector* vQSub = new AliFlowVector[2];
574 anEvent->Get2Qsub(vQSub, 2, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
575 AliFlowVector vQa = vQSub[0];
576 AliFlowVector vQb = vQSub[1];
577 if(!fBookOnlyBasic){fHistAngleQSub0->Fill(vQa.Phi()/2);}
578 if(!fBookOnlyBasic){fHistAngleQSub1->Fill(vQb.Phi()/2);}
580 Double_t dMultRP = 0.;
581 Double_t dMultPOI = 0.;
583 Int_t iNumberOfTracks = anEvent->NumberOfTracks();
584 AliFlowTrackSimple* pTrack = NULL;
586 for (Int_t i=0;i<iNumberOfTracks;i++) {
587 pTrack = anEvent->GetTrack(i);
589 dWeight = pTrack->Weight();
591 dPhi = pTrack->Phi();
592 if (dPhi<0.) dPhi+=2*TMath::Pi();
593 dEta = pTrack->Eta();
595 //weights are only used for the RP selection
596 if (pTrack->InRPSelection()){
597 // determine Phi weight:
598 if(phiWeights && nBinsPhi) {
599 dWPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
601 // determine v'(pt) weight:
602 if(ptWeights && dBinWidthPt) {
603 dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
605 // determine v'(eta) weight:
606 if(etaWeights && dBinWidthEta) {
607 dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
610 //the total weight is the product
611 Double_t dW = dWeight*dWPhi*dWPt*dWEta;
614 fHistPtRP->Fill(dPt,dW);
616 fHistPhiRP->Fill(dPhi,dW);
618 fHistEtaRP->Fill(dEta,dW);
620 if(!fBookOnlyBasic){fHistPhiEtaRP->Fill(dEta,dPhi,dW);}
622 if(!fBookOnlyBasic){fHistWeightvsPhi->Fill(dPhi,dW);}
626 if (pTrack->InRPSelection() && pTrack->InSubevent(0)) {
627 // determine Phi weight:
628 if(phiWeightsSub0 && nBinsPhiSub0){
629 dWPhi = phiWeightsSub0->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhiSub0/TMath::TwoPi())));
631 // determine v'(pt) weight:
632 if(ptWeights && dBinWidthPt) {
633 dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
635 // determine v'(eta) weight:
636 if(etaWeights && dBinWidthEta) {
637 dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
640 //the total weight is the product
641 Double_t dW = dWeight*dWPhi*dWPt*dWEta;
644 if(!fBookOnlyBasic){fHistPtSub0 ->Fill(dPt,dW);}
646 if(!fBookOnlyBasic){fHistPhiSub0 ->Fill(dPhi,dW);}
648 if(!fBookOnlyBasic){fHistEtaSub0 ->Fill(dEta,dW);}
650 if (pTrack->InRPSelection() && pTrack->InSubevent(1)) {
651 // determine Phi weight:
652 if(phiWeightsSub1 && nBinsPhiSub1){
653 dWPhi = phiWeightsSub1->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhiSub1/TMath::TwoPi())));
655 // determine v'(pt) weight:
656 if(ptWeights && dBinWidthPt) {
657 dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
659 // determine v'(eta) weight:
660 if(etaWeights && dBinWidthEta) {
661 dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
664 //the total weight is the product
665 Double_t dW = dWeight*dWPhi*dWPt*dWEta;
668 if(!fBookOnlyBasic){fHistPtSub1 -> Fill(dPt,dW);}
670 if(!fBookOnlyBasic){fHistPhiSub1 -> Fill(dPhi,dW);}
672 if(!fBookOnlyBasic){fHistEtaSub1 -> Fill(dEta,dW);}
674 if (pTrack->InPOISelection()){
676 Double_t dW = dWeight; //no pt, phi or eta weights
679 fHistPtPOI ->Fill(dPt,dW);
681 fHistPhiPOI ->Fill(dPhi,dW);
683 fHistEtaPOI ->Fill(dEta,dW);
685 if(!fBookOnlyBasic){fHistPhiEtaPOI ->Fill(dEta,dPhi,dW);}
687 fHistProMeanPtperBin ->Fill(dPt,dPt,dW);
689 fHistMassPOI->Fill(pTrack->Mass(),dPt,dW);
696 fHistMultRP->Fill(dMultRP);
697 fHistMultPOI->Fill(dMultPOI);
698 if(!fBookOnlyBasic){fHistMultPOIvsRP->Fill(dMultRP,dMultPOI);}
700 //<reference multiplicity> versus # of RPs:
701 fRefMultVsNoOfRPs->Fill(dMultRP+0.5,anEvent->GetReferenceMultiplicity(),1.);
703 //reference multiplicity:
704 fHistRefMult->Fill(anEvent->GetReferenceMultiplicity());
709 //-----------------------------------------------------------------------
711 Double_t AliFlowCommonHist::GetEntriesInPtBinRP(Int_t aBin)
713 //get entries in bin aBin from fHistPtRP
714 Double_t dEntries = fHistPtRP->GetBinContent(aBin);
720 //-----------------------------------------------------------------------
722 Double_t AliFlowCommonHist::GetEntriesInPtBinPOI(Int_t aBin)
724 //get entries in bin aBin from fHistPtPOI
725 Double_t dEntries = fHistPtPOI->GetBinContent(aBin);
731 //-----------------------------------------------------------------------
733 Double_t AliFlowCommonHist::GetEntriesInEtaBinRP(Int_t aBin)
735 //get entries in bin aBin from fHistPtRP
736 Double_t dEntries = fHistEtaRP->GetBinContent(aBin);
742 //-----------------------------------------------------------------------
744 Double_t AliFlowCommonHist::GetEntriesInEtaBinPOI(Int_t aBin)
746 //get entries in bin aBin from fHistPtPOI
747 Double_t dEntries = fHistEtaPOI->GetBinContent(aBin);
753 //-----------------------------------------------------------------------
755 Double_t AliFlowCommonHist::GetMeanPt(Int_t aBin)
757 //Get entry from bin aBin from fHistProMeanPtperBin
758 Double_t dMeanPt = fHistProMeanPtperBin->GetBinContent(aBin);
765 //-----------------------------------------------------------------------
766 Double_t AliFlowCommonHist::Merge(TCollection *aList)
769 //cout<<"entering merge function"<<endl;
770 if (!aList) return 0;
771 if (aList->IsEmpty()) return 0; //no merging is needed
774 TIter next(aList); // list is supposed to contain only objects of the same type as this
775 AliFlowCommonHist *toMerge;
776 // make a temporary list
777 TList *pTemp = new TList();
778 while ((toMerge=(AliFlowCommonHist*)next())) {
779 pTemp->Add(toMerge->GetHistList());
782 // Now call merge for fHistList providing temp list
783 fHistList->Merge(pTemp);
787 //cout<<"Merged"<<endl;
788 return (double)iCount;
792 void AliFlowCommonHist::Print(Option_t *option) const
794 // -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
795 // ===============================================
796 // printf( "TH1.Print Name = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
797 printf( "Class.Print Name = %s, Histogram list:\n",GetName());
800 fHistList->Print(option);
804 printf( "Empty histogram list \n");
808 //-----------------------------------------------------------------------
809 void AliFlowCommonHist::Browse(TBrowser *b)
813 if (fHistList) b->Add(fHistList,"AliFlowCommonHistList");