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