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