]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FLOW/AliFlowCommon/AliFlowCommonHist.cxx
another codechecker warning fixed
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowCommonHist.cxx
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 ClassImp(AliFlowCommonHist)
41
42 //-----------------------------------------------------------------------
43
44 AliFlowCommonHist::AliFlowCommonHist():
45   TNamed(),
46   fHistMultRP(NULL),
47   fHistMultPOI(NULL),
48   fHistMultPOIvsRP(NULL),
49   fHistPtRP(NULL),
50   fHistPtPOI(NULL),
51   fHistPtSub0(NULL),
52   fHistPtSub1(NULL),
53   fHistPhiRP(NULL),
54   fHistPhiPOI(NULL),
55   fHistPhiSub0(NULL),
56   fHistPhiSub1(NULL),
57   fHistEtaRP(NULL),
58   fHistEtaPOI(NULL),
59   fHistEtaSub0(NULL),
60   fHistEtaSub1(NULL),
61   fHistPhiEtaRP(NULL),
62   fHistPhiEtaPOI(NULL),
63   fHistProMeanPtperBin(NULL),
64   fHistQ(NULL),
65   fHistAngleQ(NULL),
66   fHistAngleQSub0(NULL),
67   fHistAngleQSub1(NULL), 
68   fHarmonic(NULL),
69   fRefMultVsNoOfRPs(NULL),
70   fHistList(NULL)
71 {
72   
73   //default constructor
74   
75 }
76
77 AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
78   TNamed(),
79   fHistMultRP(new TH1F(*a.fHistMultRP)),
80   fHistMultPOI(new TH1F(*a.fHistMultPOI)),
81   fHistMultPOIvsRP(new TH2F(*a.fHistMultPOIvsRP)),
82   fHistPtRP(new TH1F(*a.fHistPtRP)),
83   fHistPtPOI(new TH1F(*a.fHistPtPOI)),
84   fHistPtSub0(new TH1F(*a.fHistPtSub0)),
85   fHistPtSub1(new TH1F(*a.fHistPtSub1)),
86   fHistPhiRP(new TH1F(*a.fHistPhiRP)),
87   fHistPhiPOI(new TH1F(*a.fHistPhiPOI)),
88   fHistPhiSub0(new TH1F(*a.fHistPhiSub0)),
89   fHistPhiSub1(new TH1F(*a.fHistPhiSub1)),
90   fHistEtaRP(new TH1F(*a.fHistEtaRP)),
91   fHistEtaPOI(new TH1F(*a.fHistEtaPOI)),
92   fHistEtaSub0(new TH1F(*a.fHistEtaSub0)),
93   fHistEtaSub1(new TH1F(*a.fHistEtaSub1)),
94   fHistPhiEtaRP(new TH2F(*a.fHistPhiEtaRP)),
95   fHistPhiEtaPOI(new TH2F(*a.fHistPhiEtaPOI)),
96   fHistProMeanPtperBin(new TProfile(*a.fHistProMeanPtperBin)),
97   fHistQ(new TH1F(*a.fHistQ)),
98   fHistAngleQ(new TH1F(*a.fHistAngleQ)),
99   fHistAngleQSub0(new TH1F(*a.fHistAngleQSub0)),
100   fHistAngleQSub1(new TH1F(*a.fHistAngleQSub1)), 
101   fHarmonic(new TProfile(*a.fHarmonic)),
102   fRefMultVsNoOfRPs(new TProfile(*a.fRefMultVsNoOfRPs)),
103   fHistList(NULL)
104 {
105   // copy constructor
106
107   fHistList = new TList();
108   fHistList-> Add(fHistMultRP);        
109   fHistList-> Add(fHistMultPOI);
110   fHistList-> Add(fHistMultPOIvsRP);
111   fHistList-> Add(fHistPtRP);          
112   fHistList-> Add(fHistPtPOI);
113   fHistList-> Add(fHistPtSub0);
114   fHistList-> Add(fHistPtSub1);
115   fHistList-> Add(fHistPhiRP);          
116   fHistList-> Add(fHistPhiPOI);
117   fHistList-> Add(fHistPhiSub0);
118   fHistList-> Add(fHistPhiSub1);    
119   fHistList-> Add(fHistEtaRP);          
120   fHistList-> Add(fHistEtaPOI); 
121   fHistList-> Add(fHistEtaSub0);
122   fHistList-> Add(fHistEtaSub1);
123   fHistList-> Add(fHistPhiEtaRP);
124   fHistList-> Add(fHistPhiEtaPOI);
125   fHistList-> Add(fHistProMeanPtperBin); 
126   fHistList-> Add(fHarmonic);  
127   fHistList-> Add(fRefMultVsNoOfRPs);
128   fHistList-> Add(fHistQ); 
129   fHistList-> Add(fHistAngleQ);
130   fHistList-> Add(fHistAngleQSub0);
131   fHistList-> Add(fHistAngleQSub1);
132   //  TListIter next = TListIter(a.fHistList);
133
134 }
135
136
137 //-----------------------------------------------------------------------
138
139   AliFlowCommonHist::AliFlowCommonHist(const char *anInput,const char *title):
140     TNamed(anInput,title),
141     fHistMultRP(NULL),
142     fHistMultPOI(NULL),
143     fHistMultPOIvsRP(NULL),
144     fHistPtRP(NULL),
145     fHistPtPOI(NULL),
146     fHistPtSub0(NULL),
147     fHistPtSub1(NULL),
148     fHistPhiRP(NULL),
149     fHistPhiPOI(NULL),
150     fHistPhiSub0(NULL),
151     fHistPhiSub1(NULL),
152     fHistEtaRP(NULL),
153     fHistEtaPOI(NULL),
154     fHistEtaSub0(NULL),
155     fHistEtaSub1(NULL),
156     fHistPhiEtaRP(NULL),
157     fHistPhiEtaPOI(NULL),
158     fHistProMeanPtperBin(NULL),
159     fHistQ(NULL),
160     fHistAngleQ(NULL),
161     fHistAngleQSub0(NULL),
162     fHistAngleQSub1(NULL), 
163     fHarmonic(NULL),
164     fRefMultVsNoOfRPs(NULL),
165     fHistList(NULL)
166 {
167
168   //constructor creating histograms 
169   Int_t iNbinsMult = AliFlowCommonConstants::GetMaster()->GetNbinsMult();
170   Int_t iNbinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
171   Int_t iNbinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
172   Int_t iNbinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
173   Int_t iNbinsQ = AliFlowCommonConstants::GetMaster()->GetNbinsQ();
174   TString sName;
175
176   Double_t  dMultMin = AliFlowCommonConstants::GetMaster()->GetMultMin();            
177   Double_t  dMultMax = AliFlowCommonConstants::GetMaster()->GetMultMax();
178   Double_t  dPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();        
179   Double_t  dPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
180   Double_t  dPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();      
181   Double_t  dPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
182   Double_t  dEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();      
183   Double_t  dEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();      
184   Double_t  dQMin = AliFlowCommonConstants::GetMaster()->GetQMin();          
185   Double_t  dQMax = AliFlowCommonConstants::GetMaster()->GetQMax();     
186   
187   cout<<"The settings for the common histograms are as follows:"<<endl;
188   cout<<"Multiplicity: "<<iNbinsMult<<" bins between "<<dMultMin<<" and "<<dMultMax<<endl;
189   cout<<"Pt: "<<iNbinsPt<<" bins between "<<dPtMin<<" and "<<dPtMax<<endl;
190   cout<<"Phi: "<<iNbinsPhi<<" bins between "<<dPhiMin<<" and "<<dPhiMax<<endl;
191   cout<<"Eta: "<<iNbinsEta<<" bins between "<<dEtaMin<<" and "<<dEtaMax<<endl;
192   cout<<"Q: "<<iNbinsQ<<" bins between "<<dQMin<<" and "<<dQMax<<endl;
193
194   //Multiplicity
195   sName = "Control_Flow_MultRP_";
196   sName +=anInput;
197   fHistMultRP = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
198   fHistMultRP ->SetXTitle("Multiplicity for RP selection");
199   fHistMultRP ->SetYTitle("Counts");
200
201   sName = "Control_Flow_MultPOI_";
202   sName +=anInput;
203   fHistMultPOI = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
204   fHistMultPOI ->SetXTitle("Multiplicity for POI selection");
205   fHistMultPOI ->SetYTitle("Counts");
206
207   sName = "Control_Flow_MultPOIvsRP_";
208   sName +=anInput;
209   fHistMultPOIvsRP = new TH2F(sName.Data(), sName.Data(),100, dMultMin, dMultMax,100, dMultMin, dMultMax);
210   fHistMultPOIvsRP->SetXTitle("Multiplicity for RP selection");
211   fHistMultPOIvsRP->SetYTitle("Multiplicity for POI selection");
212
213   //Pt
214   sName = "Control_Flow_PtRP_";
215   sName +=anInput;
216   fHistPtRP = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax); 
217   fHistPtRP ->SetXTitle("P_{t} (GeV/c) for RP selection");
218   fHistPtRP ->SetYTitle("Counts");
219
220   sName = "Control_Flow_PtPOI_";
221   sName +=anInput;
222   fHistPtPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax); 
223   //binning has to be the same as for fHistProVPt! use to get Nprime!
224   fHistPtPOI ->SetXTitle("P_{t} (GeV/c) for POI selection");
225   fHistPtPOI ->SetYTitle("Counts");
226
227   sName = "Control_Flow_PtSub0_";
228   sName +=anInput;
229   fHistPtSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax); 
230   fHistPtSub0 ->SetXTitle("P_{t} (GeV/c) for Subevent 0 selection");
231   fHistPtSub0 ->SetYTitle("Counts");
232
233   sName = "Control_Flow_PtSub1_";
234   sName +=anInput;
235   fHistPtSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax); 
236   fHistPtSub1 ->SetXTitle("P_{t} (GeV/c) for Subevent 1 selection");
237   fHistPtSub1 ->SetYTitle("Counts");
238
239   //Phi
240   sName = "Control_Flow_PhiRP_";
241   sName +=anInput;
242   fHistPhiRP = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
243   fHistPhiRP ->SetXTitle("#phi for RP selection");
244   fHistPhiRP ->SetYTitle("Counts");
245
246   sName = "Control_Flow_PhiPOI_";
247   sName +=anInput;
248   fHistPhiPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
249   fHistPhiPOI ->SetXTitle("#phi for POI selection");
250   fHistPhiPOI ->SetYTitle("Counts");
251
252   sName = "Control_Flow_PhiSub0_";
253   sName +=anInput;
254   fHistPhiSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
255   fHistPhiSub0 ->SetXTitle("#phi for Subevent 0 selection");
256   fHistPhiSub0 ->SetYTitle("Counts");
257
258   sName = "Control_Flow_PhiSub1_";
259   sName +=anInput;
260   fHistPhiSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
261   fHistPhiSub1 ->SetXTitle("#phi for Subevent 1 selection");
262   fHistPhiSub1 ->SetYTitle("Counts");
263
264   //Eta
265   sName = "Control_Flow_EtaRP_";
266   sName +=anInput;
267   fHistEtaRP = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
268   fHistEtaRP ->SetXTitle("#eta for RP selection");
269   fHistEtaRP ->SetYTitle("Counts");
270
271   sName = "Control_Flow_EtaPOI_";
272   sName +=anInput;
273   fHistEtaPOI = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
274   fHistEtaPOI ->SetXTitle("#eta for POI selection");
275   fHistEtaPOI ->SetYTitle("Counts");
276
277   sName = "Control_Flow_EtaSub0_";
278   sName +=anInput;
279   fHistEtaSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
280   fHistEtaSub0 ->SetXTitle("#eta for Subevent 0 selection");
281   fHistEtaSub0 ->SetYTitle("Counts");
282
283   sName = "Control_Flow_EtaSub1_";
284   sName +=anInput;
285   fHistEtaSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
286   fHistEtaSub1 ->SetXTitle("#eta for Subevent 1 selection");
287   fHistEtaSub1 ->SetYTitle("Counts");
288
289   //Phi vs Eta
290   sName = "Control_Flow_PhiEtaRP_";
291   sName +=anInput;
292   fHistPhiEtaRP = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
293   fHistPhiEtaRP ->SetXTitle("#eta");
294   fHistPhiEtaRP ->SetYTitle("#phi");
295
296   sName = "Control_Flow_PhiEtaPOI_";
297   sName +=anInput;
298   fHistPhiEtaPOI = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
299   fHistPhiEtaPOI ->SetXTitle("#eta");
300   fHistPhiEtaPOI ->SetYTitle("#phi");
301
302   //Mean Pt per pt bin 
303   sName = "Control_FlowPro_MeanPtperBin_";
304   sName +=anInput;
305   fHistProMeanPtperBin = new TProfile(sName.Data(), sName.Data(),iNbinsPt,dPtMin,dPtMax);
306   fHistProMeanPtperBin ->SetXTitle("P_{t} (GeV/c) ");
307   fHistProMeanPtperBin ->SetYTitle("<P_{t}> (GeV/c) ");
308
309   //Q vector
310   sName = "Control_Flow_Q_";
311   sName +=anInput;
312   fHistQ = new TH1F(sName.Data(), sName.Data(),iNbinsQ, dQMin, dQMax);
313   fHistQ ->SetXTitle("Q_{vector}/Mult");
314   fHistQ ->SetYTitle("Counts");  
315   
316   //Angle of Q vector
317   sName = "Control_Flow_AngleQ_";
318   sName +=anInput;
319   fHistAngleQ = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
320   fHistAngleQ ->SetXTitle("Angle of Q_{vector}");
321   fHistAngleQ ->SetYTitle("Counts"); 
322  
323   sName = "Control_Flow_AngleQSub0_";
324   sName +=anInput;
325   fHistAngleQSub0 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
326   fHistAngleQSub0 ->SetXTitle("Angle of Q_{vector} for Subevent 0");
327   fHistAngleQSub0 ->SetYTitle("Counts"); 
328
329   sName = "Control_Flow_AngleQSub1_";
330   sName +=anInput;
331   fHistAngleQSub1 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
332   fHistAngleQSub1 ->SetXTitle("Angle of Q_{vector} for Subevent 1");
333   fHistAngleQSub1 ->SetYTitle("Counts"); 
334
335   //harmonic
336   sName = "Control_Flow_Harmonic_";
337   sName +=anInput;
338   fHarmonic = new TProfile(sName.Data(),sName.Data(),1,0,1);
339   fHarmonic ->SetYTitle("harmonic");
340   
341   //<reference multiplicity> versus # of RPs
342   sName = "Reference_Multiplicity_Vs_Number_Of_RPs_";
343   sName +=anInput;
344   fRefMultVsNoOfRPs = new TProfile(sName.Data(),sName.Data(),iNbinsMult, dMultMin, dMultMax);
345   fRefMultVsNoOfRPs->SetYTitle("<reference multiplicity>");
346   fRefMultVsNoOfRPs->SetXTitle("# of RPs");
347
348   //list of histograms if added here also add in copy constructor
349   fHistList = new TList();
350   fHistList-> Add(fHistMultRP);        
351   fHistList-> Add(fHistMultPOI); 
352   fHistList-> Add(fHistMultPOIvsRP);
353   fHistList-> Add(fHistPtRP);          
354   fHistList-> Add(fHistPtPOI); 
355   fHistList-> Add(fHistPtSub0);
356   fHistList-> Add(fHistPtSub1);
357   fHistList-> Add(fHistPhiRP);          
358   fHistList-> Add(fHistPhiPOI);
359   fHistList-> Add(fHistPhiSub0);
360   fHistList-> Add(fHistPhiSub1);
361   fHistList-> Add(fHistEtaRP);          
362   fHistList-> Add(fHistEtaPOI); 
363   fHistList-> Add(fHistEtaSub0); 
364   fHistList-> Add(fHistEtaSub1);
365   fHistList-> Add(fHistPhiEtaRP);  
366   fHistList-> Add(fHistPhiEtaPOI);
367   fHistList-> Add(fHistProMeanPtperBin);
368   fHistList-> Add(fHarmonic); 
369   fHistList-> Add(fRefMultVsNoOfRPs); 
370   fHistList-> Add(fHistQ);           
371   fHistList-> Add(fHistAngleQ);
372   fHistList-> Add(fHistAngleQSub0);
373   fHistList-> Add(fHistAngleQSub1); 
374
375 }
376
377
378 //----------------------------------------------------------------------- 
379
380 AliFlowCommonHist::~AliFlowCommonHist()
381 {
382   //deletes histograms
383   delete fHistMultRP;       
384   delete fHistMultPOI; 
385   delete fHistMultPOIvsRP;
386   delete fHistPtRP;         
387   delete fHistPtPOI;
388   delete fHistPtSub0;
389   delete fHistPtSub1;
390   delete fHistPhiRP;        
391   delete fHistPhiPOI;
392   delete fHistPhiSub0;
393   delete fHistPhiSub1;
394   delete fHistEtaRP;        
395   delete fHistEtaPOI;
396   delete fHistEtaSub0;
397   delete fHistEtaSub1;
398   delete fHistPhiEtaRP;
399   delete fHistPhiEtaPOI;
400   delete fHistProMeanPtperBin;
401   delete fHistQ;
402   delete fHistAngleQ;
403   delete fHistAngleQSub0;
404   delete fHistAngleQSub1;
405   delete fHarmonic;
406   delete fRefMultVsNoOfRPs;
407   delete fHistList;
408 }
409
410
411 //----------------------------------------------------------------------- 
412
413 Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* anEvent)
414 {
415   //Fills the control histograms
416   if (!anEvent){
417     cout<<"##### FillControlHistograms: FlowEvent pointer null"<<endl;
418     return kFALSE;
419   }
420
421   Double_t dPt, dPhi, dEta, dWeight;
422
423   //fill the histograms
424   AliFlowVector vQ = anEvent->GetQ(); 
425   //weight by the Multiplicity
426   Double_t dQX = 0.;
427   Double_t dQY = 0.;
428   if (vQ.GetMult()!=0) {
429     dQX = vQ.X()/vQ.GetMult();
430     dQY = vQ.Y()/vQ.GetMult();
431   }
432   vQ.Set(dQX,dQY);
433   fHistQ->Fill(vQ.Mod());
434   fHistAngleQ->Fill(vQ.Phi()/2);
435
436   AliFlowVector* vQSub = new AliFlowVector[2];
437   anEvent->Get2Qsub(vQSub);
438   AliFlowVector vQa = vQSub[0];
439   AliFlowVector vQb = vQSub[1];
440   fHistAngleQSub0->Fill(vQa.Phi()/2);
441   fHistAngleQSub1->Fill(vQb.Phi()/2);
442
443   Double_t dMultRP = 0.;
444   Double_t dMultPOI = 0.;
445   
446   Int_t iNumberOfTracks = anEvent->NumberOfTracks();
447   AliFlowTrackSimple* pTrack = NULL;     
448
449   for (Int_t i=0;i<iNumberOfTracks;i++) {
450     pTrack = anEvent->GetTrack(i);
451     if (pTrack ) {
452       dWeight = pTrack->Weight();
453       if (pTrack->InRPSelection()){
454         //pt
455         dPt = pTrack->Pt();
456         fHistPtRP->Fill(dPt,dWeight);
457         //phi
458         dPhi = pTrack->Phi();
459         if (dPhi<0.) dPhi+=2*TMath::Pi();
460         fHistPhiRP->Fill(dPhi,dWeight);
461         //eta
462         dEta = pTrack->Eta();
463         fHistEtaRP->Fill(dEta,dWeight);
464         //eta vs phi
465         fHistPhiEtaRP->Fill(dEta,dPhi,dWeight);
466         //count
467         dMultRP += dWeight;
468         if (pTrack->InSubevent(0)){
469           //Fill distributions for the subevent
470           fHistPtSub0 -> Fill(dPt,dWeight);
471           fHistPhiSub0 -> Fill(dPhi,dWeight);
472           fHistEtaSub0 -> Fill(dEta,dWeight);
473         } 
474         else if (pTrack->InSubevent(1)){
475           //Fill distributions for the subevent
476           fHistPtSub1 -> Fill(dPt,dWeight);
477           fHistPhiSub1 -> Fill(dPhi,dWeight);
478           fHistEtaSub1 -> Fill(dEta,dWeight);
479         } 
480       }
481       if (pTrack->InPOISelection()){
482         //pt
483         dPt = pTrack->Pt();
484         fHistPtPOI->Fill(dPt,dWeight);
485         //phi
486         dPhi = pTrack->Phi();
487         if (dPhi<0.) dPhi+=2*TMath::Pi();
488         fHistPhiPOI->Fill(dPhi,dWeight);
489         //eta
490         dEta = pTrack->Eta();
491         fHistEtaPOI->Fill(dEta,dWeight);
492         //eta vs phi
493         fHistPhiEtaPOI->Fill(dEta,dPhi,dWeight);
494         //mean pt
495         fHistProMeanPtperBin->Fill(dPt,dPt,dWeight);
496         //count
497         dMultPOI += dWeight;
498       }
499     } //track
500   } //loop over tracks
501   
502   fHistMultRP->Fill(dMultRP);
503   fHistMultPOI->Fill(dMultPOI);
504   fHistMultPOIvsRP->Fill(dMultRP,dMultPOI);
505   
506   //<reference multiplicity> versus # of RPs:
507   fRefMultVsNoOfRPs->Fill(dMultRP+0.5,anEvent->GetReferenceMultiplicity(),1.);
508
509   return kTRUE; 
510 }
511
512 //----------------------------------------------------------------------- 
513
514 Double_t AliFlowCommonHist::GetEntriesInPtBinRP(Int_t aBin)
515 {
516   //get entries in bin aBin from fHistPtRP
517   Double_t dEntries = fHistPtRP->GetBinContent(aBin);
518
519   return dEntries;
520
521 }
522
523 //----------------------------------------------------------------------- 
524
525 Double_t AliFlowCommonHist::GetEntriesInPtBinPOI(Int_t aBin)
526 {
527   //get entries in bin aBin from fHistPtPOI
528   Double_t dEntries = fHistPtPOI->GetBinContent(aBin);
529
530   return dEntries;
531
532 }
533
534 //----------------------------------------------------------------------- 
535
536 Double_t AliFlowCommonHist::GetEntriesInEtaBinRP(Int_t aBin)
537 {
538   //get entries in bin aBin from fHistPtRP
539   Double_t dEntries = fHistEtaRP->GetBinContent(aBin);
540
541   return dEntries;
542
543 }
544
545 //----------------------------------------------------------------------- 
546
547 Double_t AliFlowCommonHist::GetEntriesInEtaBinPOI(Int_t aBin)
548 {
549   //get entries in bin aBin from fHistPtPOI
550   Double_t dEntries = fHistEtaPOI->GetBinContent(aBin);
551
552   return dEntries;
553
554 }
555
556 //----------------------------------------------------------------------- 
557
558 Double_t AliFlowCommonHist::GetMeanPt(Int_t aBin)
559 {  
560   //Get entry from bin aBin from fHistProMeanPtperBin
561   Double_t dMeanPt = fHistProMeanPtperBin->GetBinContent(aBin);
562
563   return dMeanPt;
564   
565 }
566
567
568 //----------------------------------------------------------------------- 
569  Double_t AliFlowCommonHist::Merge(TCollection *aList)
570 {
571   //merge fuction
572   //cout<<"entering merge function"<<endl;
573   if (!aList) return 0;
574   if (aList->IsEmpty()) return 0; //no merging is needed
575
576   Int_t iCount = 0;
577   TIter next(aList); // list is supposed to contain only objects of the same type as this
578   AliFlowCommonHist *toMerge;
579   // make a temporary list
580   TList *pTemp = new TList();
581   while ((toMerge=(AliFlowCommonHist*)next())) {
582     pTemp->Add(toMerge->GetHistList()); 
583     iCount++;
584   }
585   // Now call merge for fHistList providing temp list
586   fHistList->Merge(pTemp);
587   // Cleanup
588   delete pTemp;
589     
590   //cout<<"Merged"<<endl;
591   return (double)iCount;
592     
593 }
594
595 void AliFlowCommonHist::Print(Option_t *option) const
596 {
597   //   -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
598   //             ===============================================
599   //   printf( "TH1.Print Name  = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
600   printf( "Class.Print Name = %s, Histogram list:\n",GetName());
601
602   if (fHistList) {  
603     fHistList->Print(option);
604   }
605   else
606     {
607       printf( "Empty histogram list \n");
608     }
609 }
610
611 //----------------------------------------------------------------------- 
612  void AliFlowCommonHist::Browse(TBrowser *b)
613 {
614
615   if (!b) return;
616   if (fHistList) b->Add(fHistList,"AliFlowCommonHistList");
617 }
618
619
620
621