AliPhysics  8d00e07 (8d00e07)
AliFlowCommonHist.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
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  **************************************************************************/
15 
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"
21 
22 #include "TString.h"
23 #include "TProfile.h"
24 #include "TMath.h" //needed as include
25 #include "TList.h"
26 #include "TH2F.h"
27 #include "AliFlowVector.h"
28 #include "TBrowser.h"
29 
30 class TH1F;
31 class TH1D;
32 
33 // AliFlowCommonHist:
34 //
35 // Description: Class to organise common histograms for Flow Analysis
36 //
37 // authors: N. van der Kolk (kolk@nikhef.nl), A. Bilandzic (anteb@nikhef.nl), RS
38 
39 
40 using std::cout;
41 using std::endl;
42 ClassImp(AliFlowCommonHist)
43 
44 //-----------------------------------------------------------------------
45 
47  TNamed(),
48  fBookOnlyBasic(kFALSE),
49  fHistMultRP(NULL),
50  fHistMultPOI(NULL),
51  fHistMultPOIvsRP(NULL),
52  fHistPtRP(NULL),
53  fHistPtPOI(NULL),
54  fHistPtSub0(NULL),
55  fHistPtSub1(NULL),
56  fHistPhiRP(NULL),
57  fHistPhiPOI(NULL),
58  fHistPhiSub0(NULL),
59  fHistPhiSub1(NULL),
60  fHistEtaRP(NULL),
61  fHistEtaPOI(NULL),
62  fHistEtaSub0(NULL),
63  fHistEtaSub1(NULL),
64  fHistPhiEtaRP(NULL),
65  fHistPhiEtaPOI(NULL),
66  fHistProMeanPtperBin(NULL),
67  fHistWeightvsPhi(NULL),
68  fHistQ(NULL),
69  fHistAngleQ(NULL),
70  fHistAngleQSub0(NULL),
71  fHistAngleQSub1(NULL),
72  fHarmonic(NULL),
73  fRefMultVsNoOfRPs(NULL),
74  fHistRefMult(NULL),
75  fHistMassPOI(NULL),
76  fHistList(NULL),
77  fHarmonicInt(2)
78 {
79 
80  //default constructor
81 
82 }
83 
85  TNamed(),
86  fBookOnlyBasic(a.fBookOnlyBasic),
87  fHistMultRP(new TH1F(*a.fHistMultRP)),
88  fHistMultPOI(new TH1F(*a.fHistMultPOI)),
89  fHistMultPOIvsRP(new TH2F(*a.fHistMultPOIvsRP)),
90  fHistPtRP(new TH1F(*a.fHistPtRP)),
91  fHistPtPOI(new TH1F(*a.fHistPtPOI)),
92  fHistPtSub0(new TH1F(*a.fHistPtSub0)),
93  fHistPtSub1(new TH1F(*a.fHistPtSub1)),
94  fHistPhiRP(new TH1F(*a.fHistPhiRP)),
95  fHistPhiPOI(new TH1F(*a.fHistPhiPOI)),
96  fHistPhiSub0(new TH1F(*a.fHistPhiSub0)),
97  fHistPhiSub1(new TH1F(*a.fHistPhiSub1)),
98  fHistEtaRP(new TH1F(*a.fHistEtaRP)),
99  fHistEtaPOI(new TH1F(*a.fHistEtaPOI)),
100  fHistEtaSub0(new TH1F(*a.fHistEtaSub0)),
101  fHistEtaSub1(new TH1F(*a.fHistEtaSub1)),
102  fHistPhiEtaRP(new TH2F(*a.fHistPhiEtaRP)),
103  fHistPhiEtaPOI(new TH2F(*a.fHistPhiEtaPOI)),
104  fHistProMeanPtperBin(new TProfile(*a.fHistProMeanPtperBin)),
105  fHistWeightvsPhi(new TH2F(*a.fHistWeightvsPhi)),
106  fHistQ(new TH1F(*a.fHistQ)),
107  fHistAngleQ(new TH1F(*a.fHistAngleQ)),
108  fHistAngleQSub0(new TH1F(*a.fHistAngleQSub0)),
109  fHistAngleQSub1(new TH1F(*a.fHistAngleQSub1)),
110  fHarmonic(new TProfile(*a.fHarmonic)),
111  fRefMultVsNoOfRPs(new TProfile(*a.fRefMultVsNoOfRPs)),
112  fHistRefMult(new TH1F(*a.fHistRefMult)),
113  fHistMassPOI(new TH2F(*a.fHistMassPOI)),
114  fHistList(NULL),
115  fHarmonicInt(a.fHarmonicInt)
116 {
117  // copy constructor
118 
119  fHistList = new TList();
120  fHistList-> Add(fHistMultRP);
121  fHistList-> Add(fHistMultPOI);
123  fHistList-> Add(fHistPtRP);
124  fHistList-> Add(fHistPtPOI);
125  if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub0);}
126  if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub1);}
127  fHistList-> Add(fHistPhiRP);
128  fHistList-> Add(fHistPhiPOI);
130  if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub1);}
131  fHistList-> Add(fHistEtaRP);
132  fHistList-> Add(fHistEtaPOI);
139  fHistList-> Add(fHarmonic);
141  fHistList-> Add(fHistRefMult);
142  fHistList-> Add(fHistMassPOI);
143  if(!fBookOnlyBasic){fHistList-> Add(fHistQ);}
144  if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
147  // TListIter next = TListIter(a.fHistList);
148 
149 }
150 
151 
152 //-----------------------------------------------------------------------
153 
154  AliFlowCommonHist::AliFlowCommonHist(const char *anInput, const char *title, Bool_t bookOnlyBasic, Int_t harmonic):
155  TNamed(anInput,title),
156  fBookOnlyBasic(bookOnlyBasic),
157  fHistMultRP(NULL),
158  fHistMultPOI(NULL),
159  fHistMultPOIvsRP(NULL),
160  fHistPtRP(NULL),
161  fHistPtPOI(NULL),
162  fHistPtSub0(NULL),
163  fHistPtSub1(NULL),
164  fHistPhiRP(NULL),
165  fHistPhiPOI(NULL),
166  fHistPhiSub0(NULL),
167  fHistPhiSub1(NULL),
168  fHistEtaRP(NULL),
169  fHistEtaPOI(NULL),
170  fHistEtaSub0(NULL),
171  fHistEtaSub1(NULL),
172  fHistPhiEtaRP(NULL),
173  fHistPhiEtaPOI(NULL),
174  fHistProMeanPtperBin(NULL),
175  fHistWeightvsPhi(NULL),
176  fHistQ(NULL),
177  fHistAngleQ(NULL),
178  fHistAngleQSub0(NULL),
179  fHistAngleQSub1(NULL),
180  fHarmonic(NULL),
181  fRefMultVsNoOfRPs(NULL),
182  fHistRefMult(NULL),
183  fHistMassPOI(NULL),
184  fHistList(NULL),
185  fHarmonicInt(harmonic)
186 {
187 
188  //constructor creating histograms
195  TString sName;
196 
211 
212 
213  // cout<<"The settings for the common histograms are as follows:"<<endl;
214  // cout<<"Multiplicity: "<<iNbinsMult<<" bins between "<<dMultMin<<" and "<<dMultMax<<endl;
215  // cout<<"Pt: "<<iNbinsPt<<" bins between "<<dPtMin<<" and "<<dPtMax<<endl;
216  // cout<<"Phi: "<<iNbinsPhi<<" bins between "<<dPhiMin<<" and "<<dPhiMax<<endl;
217  // cout<<"Eta: "<<iNbinsEta<<" bins between "<<dEtaMin<<" and "<<dEtaMax<<endl;
218  // cout<<"Q: "<<iNbinsQ<<" bins between "<<dQMin<<" and "<<dQMax<<endl;
219  // cout<<"Mass: "<<iNbinsMass<<" bins between "<<dMassMin<<" and "<<dMassMax<<endl;
220 
221  //Multiplicity
222  sName = "Control_Flow_MultRP_";
223  sName +=anInput;
224  fHistMultRP = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
225  fHistMultRP ->SetXTitle("Multiplicity for RP selection");
226  fHistMultRP ->SetYTitle("Counts");
227 
228  sName = "Control_Flow_MultPOI_";
229  sName +=anInput;
230  fHistMultPOI = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
231  fHistMultPOI ->SetXTitle("Multiplicity for POI selection");
232  fHistMultPOI ->SetYTitle("Counts");
233 
234  if(!fBookOnlyBasic){
235  sName = "Control_Flow_MultPOIvsRP_";
236  sName +=anInput;
237  fHistMultPOIvsRP = new TH2F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax,100, dMultMin, dMultMax);
238  fHistMultPOIvsRP->SetXTitle("Multiplicity for RP selection");
239  fHistMultPOIvsRP->SetYTitle("Multiplicity for POI selection");
240  }
241 
242  //Pt
243  sName = "Control_Flow_PtRP_";
244  sName +=anInput;
245  fHistPtRP = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
246  fHistPtRP ->SetXTitle("P_{t} (GeV/c) for RP selection");
247  fHistPtRP ->SetYTitle("Counts");
248 
249  sName = "Control_Flow_PtPOI_";
250  sName +=anInput;
251  fHistPtPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
252  //binning has to be the same as for fHistProVPt! use to get Nprime!
253  fHistPtPOI ->SetXTitle("P_{t} (GeV/c) for POI selection");
254  fHistPtPOI ->SetYTitle("Counts");
255 
256  if(!fBookOnlyBasic){
257  sName = "Control_Flow_PtSub0_";
258  sName +=anInput;
259  fHistPtSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
260  fHistPtSub0 ->SetXTitle("P_{t} (GeV/c) for Subevent 0 selection");
261  fHistPtSub0 ->SetYTitle("Counts");
262  }
263 
264  if(!fBookOnlyBasic){
265  sName = "Control_Flow_PtSub1_";
266  sName +=anInput;
267  fHistPtSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
268  fHistPtSub1 ->SetXTitle("P_{t} (GeV/c) for Subevent 1 selection");
269  fHistPtSub1 ->SetYTitle("Counts");
270  }
271 
272  //Phi
273  sName = "Control_Flow_PhiRP_";
274  sName +=anInput;
275  fHistPhiRP = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
276  fHistPhiRP ->SetXTitle("#phi for RP selection");
277  fHistPhiRP ->SetYTitle("Counts");
278 
279  sName = "Control_Flow_PhiPOI_";
280  sName +=anInput;
281  fHistPhiPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
282  fHistPhiPOI ->SetXTitle("#phi for POI selection");
283  fHistPhiPOI ->SetYTitle("Counts");
284 
285  if(!fBookOnlyBasic){
286  sName = "Control_Flow_PhiSub0_";
287  sName +=anInput;
288  fHistPhiSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
289  fHistPhiSub0 ->SetXTitle("#phi for Subevent 0 selection");
290  fHistPhiSub0 ->SetYTitle("Counts");
291  }
292 
293  if(!fBookOnlyBasic){
294  sName = "Control_Flow_PhiSub1_";
295  sName +=anInput;
296  fHistPhiSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
297  fHistPhiSub1 ->SetXTitle("#phi for Subevent 1 selection");
298  fHistPhiSub1 ->SetYTitle("Counts");
299  }
300 
301  //Eta
302  sName = "Control_Flow_EtaRP_";
303  sName +=anInput;
304  fHistEtaRP = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
305  fHistEtaRP ->SetXTitle("#eta for RP selection");
306  fHistEtaRP ->SetYTitle("Counts");
307 
308  sName = "Control_Flow_EtaPOI_";
309  sName +=anInput;
310  fHistEtaPOI = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
311  fHistEtaPOI ->SetXTitle("#eta for POI selection");
312  fHistEtaPOI ->SetYTitle("Counts");
313 
314  if(!fBookOnlyBasic){
315  sName = "Control_Flow_EtaSub0_";
316  sName +=anInput;
317  fHistEtaSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
318  fHistEtaSub0 ->SetXTitle("#eta for Subevent 0 selection");
319  fHistEtaSub0 ->SetYTitle("Counts");
320  }
321 
322  if(!fBookOnlyBasic){
323  sName = "Control_Flow_EtaSub1_";
324  sName +=anInput;
325  fHistEtaSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
326  fHistEtaSub1 ->SetXTitle("#eta for Subevent 1 selection");
327  fHistEtaSub1 ->SetYTitle("Counts");
328  }
329 
330  if(!fBookOnlyBasic){
331  //Phi vs Eta
332  sName = "Control_Flow_PhiEtaRP_";
333  sName +=anInput;
334  fHistPhiEtaRP = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
335  fHistPhiEtaRP ->SetXTitle("#eta");
336  fHistPhiEtaRP ->SetYTitle("#phi");
337  }
338 
339  if(!fBookOnlyBasic){
340  sName = "Control_Flow_PhiEtaPOI_";
341  sName +=anInput;
342  fHistPhiEtaPOI = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
343  fHistPhiEtaPOI ->SetXTitle("#eta");
344  fHistPhiEtaPOI ->SetYTitle("#phi");
345  }
346 
347  //Mean Pt per pt bin
348  sName = "Control_FlowPro_MeanPtperBin_";
349  sName +=anInput;
350  fHistProMeanPtperBin = new TProfile(sName.Data(), sName.Data(),iNbinsPt,dPtMin,dPtMax);
351  fHistProMeanPtperBin ->SetXTitle("P_{t} (GeV/c) ");
352  fHistProMeanPtperBin ->SetYTitle("<P_{t}> (GeV/c) ");
353 
354 
355  if(!fBookOnlyBasic){
356  //Particle weight
357  sName = "Control_Flow_WeightvsPhi_";
358  sName +=anInput;
359  fHistWeightvsPhi = new TH2F(sName.Data(), sName.Data(), iNbinsPhi, dPhiMin, dPhiMax, 300, dHistWeightvsPhiMin, dHistWeightvsPhiMax);
360  fHistWeightvsPhi ->SetXTitle("#phi");
361  fHistWeightvsPhi ->SetYTitle("weight");
362  }
363 
364  if(!fBookOnlyBasic){
365  //Q vector
366  sName = "Control_Flow_Q_";
367  sName +=anInput;
368  fHistQ = new TH1F(sName.Data(), sName.Data(),iNbinsQ, dQMin, dQMax);
369  fHistQ ->SetXTitle("Q_{vector}/Mult");
370  fHistQ ->SetYTitle("Counts");
371  }
372 
373  if(!fBookOnlyBasic){
374  //Angle of Q vector
375  sName = "Control_Flow_AngleQ_";
376  sName +=anInput;
377  fHistAngleQ = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
378  fHistAngleQ ->SetXTitle("Angle of Q_{vector}");
379  fHistAngleQ ->SetYTitle("Counts");
380  }
381 
382  if(!fBookOnlyBasic){
383  sName = "Control_Flow_AngleQSub0_";
384  sName +=anInput;
385  fHistAngleQSub0 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
386  fHistAngleQSub0 ->SetXTitle("Angle of Q_{vector} for Subevent 0");
387  fHistAngleQSub0 ->SetYTitle("Counts");
388  }
389 
390  if(!fBookOnlyBasic){
391  sName = "Control_Flow_AngleQSub1_";
392  sName +=anInput;
393  fHistAngleQSub1 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
394  fHistAngleQSub1 ->SetXTitle("Angle of Q_{vector} for Subevent 1");
395  fHistAngleQSub1 ->SetYTitle("Counts");
396  }
397 
398  //harmonic
399  sName = "Control_Flow_Harmonic_";
400  sName +=anInput;
401  fHarmonic = new TProfile(sName.Data(),sName.Data(),1,0,1);
402  fHarmonic ->SetYTitle("harmonic");
403 
404  //<reference multiplicity> versus # of RPs
405  sName = "Reference_Multiplicity_Vs_Number_Of_RPs_";
406  sName +=anInput;
407  fRefMultVsNoOfRPs = new TProfile(sName.Data(),sName.Data(),iNbinsMult, dMultMin, dMultMax);
408  fRefMultVsNoOfRPs->SetYTitle("<reference multiplicity>");
409  fRefMultVsNoOfRPs->SetXTitle("# of RPs");
410 
411  //reference multiplicity
412  sName = "Control_Flow_Ref_Mult_";
413  sName +=anInput;
414  fHistRefMult = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
415  fHistRefMult->SetXTitle("Reference multiplicity");
416  fHistRefMult->SetYTitle("Counts");
417 
418  //mass for POI selection
419  sName = "Control_Flow_Mass_POI";
420  sName +=anInput;
421  fHistMassPOI = new TH2F(sName.Data(), sName.Data(), iNbinsMass, dMassMin, dMassMax,
422  iNbinsPt, dPtMin, dPtMax);
423  Double_t mbWidth = 0.;
424  if(iNbinsMass != 0)
425  {
426  mbWidth = (dMassMax-dMassMin)/iNbinsMass*1000.;
427  }
428  fHistMassPOI->SetXTitle("Mass (GeV/c^{2})");
429  fHistMassPOI->SetYTitle("P_{t} (GeV/c)");
430  fHistMassPOI->SetZTitle( Form("Counts/(%.2f MeV/c^{2})",mbWidth));
431 
432  //list of histograms if added here also add in copy constructor
433  fHistList = new TList();
434  fHistList-> Add(fHistMultRP);
435  fHistList-> Add(fHistMultPOI);
437  fHistList-> Add(fHistPtRP);
438  fHistList-> Add(fHistPtPOI);
439  if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub0);}
440  if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub1);}
441  fHistList-> Add(fHistPhiRP);
442  fHistList-> Add(fHistPhiPOI);
445  fHistList-> Add(fHistEtaRP);
446  fHistList-> Add(fHistEtaPOI);
447  if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub0);}
449  if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaRP);}
453  fHistList-> Add(fHarmonic);
455  fHistList-> Add(fHistRefMult);
456  fHistList-> Add(fHistMassPOI);
457  if(!fBookOnlyBasic){fHistList-> Add(fHistQ);}
458  if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
461 
462 }
463 
464 
465 //-----------------------------------------------------------------------
466 
468 {
469  //deletes histograms
470  delete fHistMultRP;
471  delete fHistMultPOI;
472  delete fHistMultPOIvsRP;
473  delete fHistPtRP;
474  delete fHistPtPOI;
475  delete fHistPtSub0;
476  delete fHistPtSub1;
477  delete fHistPhiRP;
478  delete fHistPhiPOI;
479  delete fHistPhiSub0;
480  delete fHistPhiSub1;
481  delete fHistEtaRP;
482  delete fHistEtaPOI;
483  delete fHistEtaSub0;
484  delete fHistEtaSub1;
485  delete fHistPhiEtaRP;
486  delete fHistPhiEtaPOI;
487  delete fHistProMeanPtperBin;
488  delete fHistWeightvsPhi;
489  delete fHistQ;
490  delete fHistAngleQ;
491  delete fHistAngleQSub0;
492  delete fHistAngleQSub1;
493  delete fHarmonic;
494  delete fRefMultVsNoOfRPs;
495  delete fHistRefMult;
496  delete fHistMassPOI;
497  delete fHistList;
498 }
499 
500 
501 //-----------------------------------------------------------------------
502 
503 Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* anEvent,TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
504 {
505  //Fills the control histograms
506  if (!anEvent){
507  cout<<"##### FillControlHistograms: FlowEvent pointer null"<<endl;
508  return kFALSE;
509  }
510 
511  //track datamembers
512  Double_t dPt = 0.;
513  Double_t dPhi = 0.;
514  Double_t dEta = 0.;
515  Double_t dWeight = 1.;
516 
517  //weights used for corrections
518  Double_t dWPhi = 1.;
519  Double_t dWPt = 1.;
520  Double_t dWEta = 1.;
521 
522  TH1F *phiWeights = NULL;
523  TH1F *phiWeightsSub0 = NULL;
524  TH1F *phiWeightsSub1 = NULL;
525  TH1D *ptWeights = NULL;
526  TH1D *etaWeights = NULL;
527 
528  Int_t nBinsPhi = 0;
529  Int_t nBinsPhiSub0 = 0;
530  Int_t nBinsPhiSub1 = 0;
531  Double_t dBinWidthPt = 0.;
532  Double_t dPtMin = 0.;
533  Double_t dBinWidthEta = 0.;
534  Double_t dEtaMin = 0.;
535 
536  if(weightsList)
537  {
538  if(usePhiWeights)
539  {
540  phiWeights = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights"));
541  if(phiWeights) nBinsPhi = phiWeights->GetNbinsX();
542  phiWeightsSub0 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub0"));
543  if(phiWeightsSub0) nBinsPhiSub0 = phiWeightsSub0->GetNbinsX();
544  phiWeightsSub1 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub1"));
545  if(phiWeightsSub1) nBinsPhiSub1 = phiWeightsSub1->GetNbinsX();
546  }
547  if(usePtWeights)
548  {
549  ptWeights = dynamic_cast<TH1D *>(weightsList->FindObject("pt_weights"));
550  if(ptWeights)
551  {
552  dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
553  dPtMin = (ptWeights->GetXaxis())->GetXmin();
554  }
555  }
556  if(useEtaWeights)
557  {
558  etaWeights = dynamic_cast<TH1D *>(weightsList->FindObject("eta_weights"));
559  if(etaWeights)
560  {
561  dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
562  dEtaMin = (etaWeights->GetXaxis())->GetXmin();
563  }
564  }
565  } // end of if(weightsList)
566 
567 
568 
569  //fill the histograms
570  AliFlowVector vQ = anEvent->GetQ(fHarmonicInt, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
571  //weight by the Multiplicity
572  Double_t dQX = 0.;
573  Double_t dQY = 0.;
574  if (vQ.GetMult()!=0) {
575  dQX = vQ.X()/vQ.GetMult();
576  dQY = vQ.Y()/vQ.GetMult();
577  }
578  vQ.Set(dQX,dQY);
579  if(!fBookOnlyBasic){fHistQ->Fill(vQ.Mod());}
580  if(!fBookOnlyBasic){fHistAngleQ->Fill(vQ.Phi()/float(fHarmonicInt));}
581 
582  AliFlowVector* vQSub = new AliFlowVector[2];
583  anEvent->Get2Qsub(vQSub, fHarmonicInt, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
584  AliFlowVector vQa = vQSub[0];
585  AliFlowVector vQb = vQSub[1];
586  if(!fBookOnlyBasic){fHistAngleQSub0->Fill(vQa.Phi()/float(fHarmonicInt));}
587  if(!fBookOnlyBasic){fHistAngleQSub1->Fill(vQb.Phi()/float(fHarmonicInt));}
588 
589  Double_t dMultRP = 0.;
590  Double_t dMultPOI = 0.;
591 
592  Int_t iNumberOfTracks = anEvent->NumberOfTracks();
593  AliFlowTrackSimple* pTrack = NULL;
594 
595  for (Int_t i=0;i<iNumberOfTracks;i++) {
596  pTrack = anEvent->GetTrack(i);
597  if (pTrack ) {
598  dWeight = pTrack->Weight();
599  dPt = pTrack->Pt();
600  dPhi = pTrack->Phi();
601  if (dPhi<0.) dPhi+=2*TMath::Pi();
602  dEta = pTrack->Eta();
603 
604  //weights are only used for the RP selection
605  if (pTrack->InRPSelection()){
606  // determine Phi weight:
607  if(phiWeights && nBinsPhi) {
608  dWPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
609  }
610  // determine v'(pt) weight:
611  if(ptWeights && dBinWidthPt) {
612  dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
613  }
614  // determine v'(eta) weight:
615  if(etaWeights && dBinWidthEta) {
616  dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
617  }
618 
619  //the total weight is the product
620  Double_t dW = dWeight*dWPhi*dWPt*dWEta;
621 
622  //pt
623  fHistPtRP->Fill(dPt,dW);
624  //phi
625  fHistPhiRP->Fill(dPhi,dW);
626  //eta
627  fHistEtaRP->Fill(dEta,dW);
628  //eta vs phi
629  if(!fBookOnlyBasic){fHistPhiEtaRP->Fill(dEta,dPhi,dW);}
630  //weight vs phi
631  if(!fBookOnlyBasic){fHistWeightvsPhi->Fill(dPhi,dW);}
632  //count
633  dMultRP += dW;
634  }
635  if (pTrack->InRPSelection() && pTrack->InSubevent(0)) {
636  // determine Phi weight:
637  if(phiWeightsSub0 && nBinsPhiSub0){
638  dWPhi = phiWeightsSub0->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhiSub0/TMath::TwoPi())));
639  }
640  // determine v'(pt) weight:
641  if(ptWeights && dBinWidthPt) {
642  dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
643  }
644  // determine v'(eta) weight:
645  if(etaWeights && dBinWidthEta) {
646  dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
647  }
648 
649  //the total weight is the product
650  Double_t dW = dWeight*dWPhi*dWPt*dWEta;
651 
652  //pt
653  if(!fBookOnlyBasic){fHistPtSub0 ->Fill(dPt,dW);}
654  //phi
655  if(!fBookOnlyBasic){fHistPhiSub0 ->Fill(dPhi,dW);}
656  //eta
657  if(!fBookOnlyBasic){fHistEtaSub0 ->Fill(dEta,dW);}
658  }
659  if (pTrack->InRPSelection() && pTrack->InSubevent(1)) {
660  // determine Phi weight:
661  if(phiWeightsSub1 && nBinsPhiSub1){
662  dWPhi = phiWeightsSub1->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhiSub1/TMath::TwoPi())));
663  }
664  // determine v'(pt) weight:
665  if(ptWeights && dBinWidthPt) {
666  dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
667  }
668  // determine v'(eta) weight:
669  if(etaWeights && dBinWidthEta) {
670  dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
671  }
672 
673  //the total weight is the product
674  Double_t dW = dWeight*dWPhi*dWPt*dWEta;
675 
676  //pt
677  if(!fBookOnlyBasic){fHistPtSub1 -> Fill(dPt,dW);}
678  //phi
679  if(!fBookOnlyBasic){fHistPhiSub1 -> Fill(dPhi,dW);}
680  //eta
681  if(!fBookOnlyBasic){fHistEtaSub1 -> Fill(dEta,dW);}
682  }
683  if (pTrack->InPOISelection()){
684 
685  Double_t dW = dWeight; //no pt, phi or eta weights
686 
687  //pt
688  fHistPtPOI ->Fill(dPt,dW);
689  //phi
690  fHistPhiPOI ->Fill(dPhi,dW);
691  //eta
692  fHistEtaPOI ->Fill(dEta,dW);
693  //eta vs phi
694  if(!fBookOnlyBasic){fHistPhiEtaPOI->Fill(dEta,dPhi,dW);}
695  //mean pt
696  fHistProMeanPtperBin ->Fill(dPt,dPt,dW);
697  //mass
698  fHistMassPOI->Fill(pTrack->Mass(),dPt,dW);
699  //count
700  dMultPOI += dW;
701  }
702  } //track
703  } //loop over tracks
704 
705  fHistMultRP->Fill(dMultRP);
706  fHistMultPOI->Fill(dMultPOI);
707  if(!fBookOnlyBasic){fHistMultPOIvsRP->Fill(dMultRP,dMultPOI);}
708 
709  //<reference multiplicity> versus # of RPs:
710  fRefMultVsNoOfRPs->Fill(dMultRP+0.5,anEvent->GetReferenceMultiplicity(),1.);
711 
712  //reference multiplicity:
713  fHistRefMult->Fill(anEvent->GetReferenceMultiplicity());
714 
715  return kTRUE;
716 }
717 
718 //-----------------------------------------------------------------------
719 
721 {
722  //get entries in bin aBin from fHistPtRP
723  Double_t dEntries = fHistPtRP->GetBinContent(aBin);
724 
725  return dEntries;
726 
727 }
728 
729 //-----------------------------------------------------------------------
730 
732 {
733  //get entries in bin aBin from fHistPtPOI
734  Double_t dEntries = fHistPtPOI->GetBinContent(aBin);
735 
736  return dEntries;
737 
738 }
739 
740 //-----------------------------------------------------------------------
741 
743 {
744  //get entries in bin aBin from fHistPtRP
745  Double_t dEntries = fHistEtaRP->GetBinContent(aBin);
746 
747  return dEntries;
748 
749 }
750 
751 //-----------------------------------------------------------------------
752 
754 {
755  //get entries in bin aBin from fHistPtPOI
756  Double_t dEntries = fHistEtaPOI->GetBinContent(aBin);
757 
758  return dEntries;
759 
760 }
761 
762 //-----------------------------------------------------------------------
763 
765 {
766  //Get entry from bin aBin from fHistProMeanPtperBin
767  Double_t dMeanPt = fHistProMeanPtperBin->GetBinContent(aBin);
768 
769  return dMeanPt;
770 
771 }
772 
773 
774 //-----------------------------------------------------------------------
776 {
777  //merge fuction
778  //cout<<"entering merge function"<<endl;
779  if (!aList) return 0;
780  if (aList->IsEmpty()) return 0; //no merging is needed
781 
782  Int_t iCount = 0;
783  TIter next(aList); // list is supposed to contain only objects of the same type as this
784  AliFlowCommonHist *toMerge=NULL;
785  while ((toMerge=(AliFlowCommonHist*)next())) {
786  TList tempList;
787  tempList.Add(toMerge->GetHistList());
788  fHistList->Merge(&tempList);
789  iCount++;
790  }
791 
792  //cout<<"Merged"<<endl;
793  return (double)iCount;
794 
795 }
796 
798 {
799  // -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
800  // ===============================================
801  // printf( "TH1.Print Name = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
802  printf( "Class.Print Name = %s, Histogram list:\n",GetName());
803 
804  if (fHistList) {
805  fHistList->Print(option);
806  }
807  else
808  {
809  printf( "Empty histogram list \n");
810  }
811 }
812 
813 //-----------------------------------------------------------------------
814  void AliFlowCommonHist::Browse(TBrowser *b)
815 {
816 
817  if (!b) return;
818  if (fHistList) b->Add(fHistList,"AliFlowCommonHistList");
819 }
820 
821 
822 
823 
Double_t GetHistWeightvsPhiMin() const
double Double_t
Definition: External.C:58
virtual AliFlowVector GetQ(Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE)
Double_t GetEntriesInEtaBinPOI(Int_t iBin)
Definition: External.C:236
const char * title
Definition: MakeQAPdf.C:27
Double_t GetMeanPt(Int_t iBin)
AliFlowTrackSimple * GetTrack(Int_t i)
Bool_t InSubevent(Int_t i) const
Double_t GetEntriesInPtBinPOI(Int_t iBin)
Double_t GetMult() const
Definition: AliFlowVector.h:46
virtual Double_t Merge(TCollection *aList)
Double_t Mass() const
void Browse(TBrowser *b)
Double_t GetHistWeightvsPhiMax() const
Bool_t InRPSelection() const
Bool_t FillControlHistograms(AliFlowEventSimple *anEvent, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE)
Double_t Phi() const
int Int_t
Definition: External.C:63
Definition: External.C:212
void Print(Option_t *option="") const
Double_t GetEntriesInPtBinRP(Int_t iBin)
static AliFlowCommonConstants * GetMaster()
Double_t GetEntriesInEtaBinRP(Int_t iBin)
virtual void Get2Qsub(AliFlowVector *Qarray, Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE)
Int_t GetReferenceMultiplicity() const
Double_t Pt() const
TProfile * fRefMultVsNoOfRPs
Double_t Weight() const
TProfile * fHistProMeanPtperBin
const char Option_t
Definition: External.C:48
Bool_t InPOISelection(Int_t poiType=1) const
Double_t Eta() const
bool Bool_t
Definition: External.C:53
Int_t NumberOfTracks() const