ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

#include "Riostream.h"              //needed as include
#include "AliFlowCommonConstants.h" //needed as include
#include "AliFlowCommonHist.h"
#include "AliFlowEventSimple.h"
#include "AliFlowTrackSimple.h"

#include "TString.h" 
#include "TProfile.h"
#include "TMath.h"   //needed as include
#include "TList.h"
#include "TH2F.h"
#include "AliFlowVector.h"
#include "TBrowser.h"

class TH1F;
class TH1D;

// AliFlowCommonHist:
//
// Description: Class to organise common histograms for Flow Analysis
//
// authors: N. van der Kolk (kolk@nikhef.nl), A. Bilandzic (anteb@nikhef.nl), RS


using std::cout;
using std::endl;
ClassImp(AliFlowCommonHist)

//-----------------------------------------------------------------------

AliFlowCommonHist::AliFlowCommonHist():
  TNamed(),
  fBookOnlyBasic(kFALSE),
  fHistMultRP(NULL),
  fHistMultPOI(NULL),
  fHistMultPOIvsRP(NULL),
  fHistPtRP(NULL),
  fHistPtPOI(NULL),
  fHistPtSub0(NULL),
  fHistPtSub1(NULL),
  fHistPhiRP(NULL),
  fHistPhiPOI(NULL),
  fHistPhiSub0(NULL),
  fHistPhiSub1(NULL),
  fHistEtaRP(NULL),
  fHistEtaPOI(NULL),
  fHistEtaSub0(NULL),
  fHistEtaSub1(NULL),
  fHistPhiEtaRP(NULL),
  fHistPhiEtaPOI(NULL),
  fHistProMeanPtperBin(NULL),
  fHistWeightvsPhi(NULL),
  fHistQ(NULL),
  fHistAngleQ(NULL),
  fHistAngleQSub0(NULL),
  fHistAngleQSub1(NULL), 
  fHarmonic(NULL),
  fRefMultVsNoOfRPs(NULL),
  fHistRefMult(NULL),
  fHistMassPOI(NULL),
  fHistList(NULL)
{
  
  //default constructor
  
}

AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
  TNamed(),
  fBookOnlyBasic(a.fBookOnlyBasic),
  fHistMultRP(new TH1F(*a.fHistMultRP)),
  fHistMultPOI(new TH1F(*a.fHistMultPOI)),
  fHistMultPOIvsRP(new TH2F(*a.fHistMultPOIvsRP)),
  fHistPtRP(new TH1F(*a.fHistPtRP)),
  fHistPtPOI(new TH1F(*a.fHistPtPOI)),
  fHistPtSub0(new TH1F(*a.fHistPtSub0)),
  fHistPtSub1(new TH1F(*a.fHistPtSub1)),
  fHistPhiRP(new TH1F(*a.fHistPhiRP)),
  fHistPhiPOI(new TH1F(*a.fHistPhiPOI)),
  fHistPhiSub0(new TH1F(*a.fHistPhiSub0)),
  fHistPhiSub1(new TH1F(*a.fHistPhiSub1)),
  fHistEtaRP(new TH1F(*a.fHistEtaRP)),
  fHistEtaPOI(new TH1F(*a.fHistEtaPOI)),
  fHistEtaSub0(new TH1F(*a.fHistEtaSub0)),
  fHistEtaSub1(new TH1F(*a.fHistEtaSub1)),
  fHistPhiEtaRP(new TH2F(*a.fHistPhiEtaRP)),
  fHistPhiEtaPOI(new TH2F(*a.fHistPhiEtaPOI)),
  fHistProMeanPtperBin(new TProfile(*a.fHistProMeanPtperBin)),
  fHistWeightvsPhi(new TH2F(*a.fHistWeightvsPhi)),
  fHistQ(new TH1F(*a.fHistQ)),
  fHistAngleQ(new TH1F(*a.fHistAngleQ)),
  fHistAngleQSub0(new TH1F(*a.fHistAngleQSub0)),
  fHistAngleQSub1(new TH1F(*a.fHistAngleQSub1)), 
  fHarmonic(new TProfile(*a.fHarmonic)),
  fRefMultVsNoOfRPs(new TProfile(*a.fRefMultVsNoOfRPs)),
  fHistRefMult(new TH1F(*a.fHistRefMult)),  
  fHistMassPOI(new TH2F(*a.fHistMassPOI)),  
  fHistList(NULL)
{
  // copy constructor

  fHistList = new TList();
  fHistList-> Add(fHistMultRP);        
  fHistList-> Add(fHistMultPOI);
  if(!fBookOnlyBasic){fHistList-> Add(fHistMultPOIvsRP);}
  fHistList-> Add(fHistPtRP);          
  fHistList-> Add(fHistPtPOI);
  if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub0);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub1);}
  fHistList-> Add(fHistPhiRP);          
  fHistList-> Add(fHistPhiPOI);
  if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub0);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub1);}    
  fHistList-> Add(fHistEtaRP);          
  fHistList-> Add(fHistEtaPOI); 
  if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub0);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub1);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaRP);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaPOI);}
  fHistList-> Add(fHistProMeanPtperBin);
  if(!fBookOnlyBasic){fHistList-> Add(fHistWeightvsPhi);}
  fHistList-> Add(fHarmonic);  
  fHistList-> Add(fRefMultVsNoOfRPs);
  fHistList-> Add(fHistRefMult); 
  fHistList-> Add(fHistMassPOI);
  if(!fBookOnlyBasic){fHistList-> Add(fHistQ);} 
  if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub0);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub1);}
  //  TListIter next = TListIter(a.fHistList);

}


//-----------------------------------------------------------------------

  AliFlowCommonHist::AliFlowCommonHist(const char *anInput, const char *title, Bool_t bookOnlyBasic):
    TNamed(anInput,title),
    fBookOnlyBasic(bookOnlyBasic),
    fHistMultRP(NULL),
    fHistMultPOI(NULL),
    fHistMultPOIvsRP(NULL),
    fHistPtRP(NULL),
    fHistPtPOI(NULL),
    fHistPtSub0(NULL),
    fHistPtSub1(NULL),
    fHistPhiRP(NULL),
    fHistPhiPOI(NULL),
    fHistPhiSub0(NULL),
    fHistPhiSub1(NULL),
    fHistEtaRP(NULL),
    fHistEtaPOI(NULL),
    fHistEtaSub0(NULL),
    fHistEtaSub1(NULL),
    fHistPhiEtaRP(NULL),
    fHistPhiEtaPOI(NULL),
    fHistProMeanPtperBin(NULL),
    fHistWeightvsPhi(NULL),
    fHistQ(NULL),
    fHistAngleQ(NULL),
    fHistAngleQSub0(NULL),
    fHistAngleQSub1(NULL), 
    fHarmonic(NULL),
    fRefMultVsNoOfRPs(NULL),
    fHistRefMult(NULL),
    fHistMassPOI(NULL),
    fHistList(NULL)
{

  //constructor creating histograms 
  Int_t iNbinsMult = AliFlowCommonConstants::GetMaster()->GetNbinsMult();
  Int_t iNbinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
  Int_t iNbinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
  Int_t iNbinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
  Int_t iNbinsQ = AliFlowCommonConstants::GetMaster()->GetNbinsQ();
  Int_t iNbinsMass = AliFlowCommonConstants::GetMaster()->GetNbinsMass();
  TString sName;

  Double_t  dMultMin = AliFlowCommonConstants::GetMaster()->GetMultMin();            
  Double_t  dMultMax = AliFlowCommonConstants::GetMaster()->GetMultMax();
  Double_t  dPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();	     
  Double_t  dPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
  Double_t  dPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();	     
  Double_t  dPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
  Double_t  dEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();	     
  Double_t  dEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();	     
  Double_t  dQMin = AliFlowCommonConstants::GetMaster()->GetQMin();	     
  Double_t  dQMax = AliFlowCommonConstants::GetMaster()->GetQMax();	
  Double_t  dHistWeightvsPhiMin = AliFlowCommonConstants::GetMaster()->GetHistWeightvsPhiMin();
  Double_t  dHistWeightvsPhiMax = AliFlowCommonConstants::GetMaster()->GetHistWeightvsPhiMax();
  Double_t  dMassMin = AliFlowCommonConstants::GetMaster()->GetMassMin();
  Double_t  dMassMax = AliFlowCommonConstants::GetMaster()->GetMassMax();

  
  //  cout<<"The settings for the common histograms are as follows:"<<endl;
  //  cout<<"Multiplicity: "<<iNbinsMult<<" bins between "<<dMultMin<<" and "<<dMultMax<<endl;
  //  cout<<"Pt: "<<iNbinsPt<<" bins between "<<dPtMin<<" and "<<dPtMax<<endl;
  //  cout<<"Phi: "<<iNbinsPhi<<" bins between "<<dPhiMin<<" and "<<dPhiMax<<endl;
  //  cout<<"Eta: "<<iNbinsEta<<" bins between "<<dEtaMin<<" and "<<dEtaMax<<endl;
  //  cout<<"Q: "<<iNbinsQ<<" bins between "<<dQMin<<" and "<<dQMax<<endl;
  //  cout<<"Mass: "<<iNbinsMass<<" bins between "<<dMassMin<<" and "<<dMassMax<<endl;

  //Multiplicity
  sName = "Control_Flow_MultRP_";
  sName +=anInput;
  fHistMultRP = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
  fHistMultRP ->SetXTitle("Multiplicity for RP selection");
  fHistMultRP ->SetYTitle("Counts");

  sName = "Control_Flow_MultPOI_";
  sName +=anInput;
  fHistMultPOI = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
  fHistMultPOI ->SetXTitle("Multiplicity for POI selection");
  fHistMultPOI ->SetYTitle("Counts");

  if(!fBookOnlyBasic){
  sName = "Control_Flow_MultPOIvsRP_";
  sName +=anInput;
  fHistMultPOIvsRP = new TH2F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax,100, dMultMin, dMultMax);
  fHistMultPOIvsRP->SetXTitle("Multiplicity for RP selection");
  fHistMultPOIvsRP->SetYTitle("Multiplicity for POI selection");
  }
  
  //Pt
  sName = "Control_Flow_PtRP_";
  sName +=anInput;
  fHistPtRP = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax); 
  fHistPtRP ->SetXTitle("P_{t} (GeV/c) for RP selection");
  fHistPtRP ->SetYTitle("Counts");

  sName = "Control_Flow_PtPOI_";
  sName +=anInput;
  fHistPtPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax); 
  //binning has to be the same as for fHistProVPt! use to get Nprime!
  fHistPtPOI ->SetXTitle("P_{t} (GeV/c) for POI selection");
  fHistPtPOI ->SetYTitle("Counts");

  if(!fBookOnlyBasic){
  sName = "Control_Flow_PtSub0_";
  sName +=anInput;
  fHistPtSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax); 
  fHistPtSub0 ->SetXTitle("P_{t} (GeV/c) for Subevent 0 selection");
  fHistPtSub0 ->SetYTitle("Counts");
  }
  
  if(!fBookOnlyBasic){
  sName = "Control_Flow_PtSub1_";
  sName +=anInput;
  fHistPtSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax); 
  fHistPtSub1 ->SetXTitle("P_{t} (GeV/c) for Subevent 1 selection");
  fHistPtSub1 ->SetYTitle("Counts");
  }
  
  //Phi
  sName = "Control_Flow_PhiRP_";
  sName +=anInput;
  fHistPhiRP = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
  fHistPhiRP ->SetXTitle("#phi for RP selection");
  fHistPhiRP ->SetYTitle("Counts");

  sName = "Control_Flow_PhiPOI_";
  sName +=anInput;
  fHistPhiPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
  fHistPhiPOI ->SetXTitle("#phi for POI selection");
  fHistPhiPOI ->SetYTitle("Counts");

  if(!fBookOnlyBasic){
  sName = "Control_Flow_PhiSub0_";
  sName +=anInput;
  fHistPhiSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
  fHistPhiSub0 ->SetXTitle("#phi for Subevent 0 selection");
  fHistPhiSub0 ->SetYTitle("Counts");
  }
   
  if(!fBookOnlyBasic){
  sName = "Control_Flow_PhiSub1_";
  sName +=anInput;
  fHistPhiSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
  fHistPhiSub1 ->SetXTitle("#phi for Subevent 1 selection");
  fHistPhiSub1 ->SetYTitle("Counts");
  }
  
  //Eta
  sName = "Control_Flow_EtaRP_";
  sName +=anInput;
  fHistEtaRP = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
  fHistEtaRP ->SetXTitle("#eta for RP selection");
  fHistEtaRP ->SetYTitle("Counts");

  sName = "Control_Flow_EtaPOI_";
  sName +=anInput;
  fHistEtaPOI = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
  fHistEtaPOI ->SetXTitle("#eta for POI selection");
  fHistEtaPOI ->SetYTitle("Counts");

  if(!fBookOnlyBasic){
  sName = "Control_Flow_EtaSub0_";
  sName +=anInput;
  fHistEtaSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
  fHistEtaSub0 ->SetXTitle("#eta for Subevent 0 selection");
  fHistEtaSub0 ->SetYTitle("Counts");
  }
  
  if(!fBookOnlyBasic){
  sName = "Control_Flow_EtaSub1_";
  sName +=anInput;
  fHistEtaSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
  fHistEtaSub1 ->SetXTitle("#eta for Subevent 1 selection");
  fHistEtaSub1 ->SetYTitle("Counts");
  }

  if(!fBookOnlyBasic){
  //Phi vs Eta
  sName = "Control_Flow_PhiEtaRP_";
  sName +=anInput;
  fHistPhiEtaRP = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
  fHistPhiEtaRP ->SetXTitle("#eta");
  fHistPhiEtaRP ->SetYTitle("#phi");
  }
  
  if(!fBookOnlyBasic){
  sName = "Control_Flow_PhiEtaPOI_";
  sName +=anInput;
  fHistPhiEtaPOI = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
  fHistPhiEtaPOI ->SetXTitle("#eta");
  fHistPhiEtaPOI ->SetYTitle("#phi");
  }
  
  //Mean Pt per pt bin 
  sName = "Control_FlowPro_MeanPtperBin_";
  sName +=anInput;
  fHistProMeanPtperBin = new TProfile(sName.Data(), sName.Data(),iNbinsPt,dPtMin,dPtMax);
  fHistProMeanPtperBin ->SetXTitle("P_{t} (GeV/c) ");
  fHistProMeanPtperBin ->SetYTitle("<P_{t}> (GeV/c) ");

  
  if(!fBookOnlyBasic){
  //Particle weight
  sName = "Control_Flow_WeightvsPhi_";
  sName +=anInput;
  fHistWeightvsPhi = new TH2F(sName.Data(), sName.Data(), iNbinsPhi, dPhiMin, dPhiMax, 300, dHistWeightvsPhiMin, dHistWeightvsPhiMax); 
  fHistWeightvsPhi ->SetXTitle("#phi");
  fHistWeightvsPhi ->SetYTitle("weight");
  }
  
  if(!fBookOnlyBasic){
  //Q vector
  sName = "Control_Flow_Q_";
  sName +=anInput;
  fHistQ = new TH1F(sName.Data(), sName.Data(),iNbinsQ, dQMin, dQMax);
  fHistQ ->SetXTitle("Q_{vector}/Mult");
  fHistQ ->SetYTitle("Counts");  
  }
    
  if(!fBookOnlyBasic){
  //Angle of Q vector
  sName = "Control_Flow_AngleQ_";
  sName +=anInput;
  fHistAngleQ = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
  fHistAngleQ ->SetXTitle("Angle of Q_{vector}");
  fHistAngleQ ->SetYTitle("Counts"); 
  }
   
  if(!fBookOnlyBasic){
  sName = "Control_Flow_AngleQSub0_";
  sName +=anInput;
  fHistAngleQSub0 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
  fHistAngleQSub0 ->SetXTitle("Angle of Q_{vector} for Subevent 0");
  fHistAngleQSub0 ->SetYTitle("Counts"); 
  }
  
  if(!fBookOnlyBasic){
  sName = "Control_Flow_AngleQSub1_";
  sName +=anInput;
  fHistAngleQSub1 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
  fHistAngleQSub1 ->SetXTitle("Angle of Q_{vector} for Subevent 1");
  fHistAngleQSub1 ->SetYTitle("Counts"); 
  }
  
  //harmonic
  sName = "Control_Flow_Harmonic_";
  sName +=anInput;
  fHarmonic = new TProfile(sName.Data(),sName.Data(),1,0,1);
  fHarmonic ->SetYTitle("harmonic");
  
  //<reference multiplicity> versus # of RPs
  sName = "Reference_Multiplicity_Vs_Number_Of_RPs_";
  sName +=anInput;
  fRefMultVsNoOfRPs = new TProfile(sName.Data(),sName.Data(),iNbinsMult, dMultMin, dMultMax);
  fRefMultVsNoOfRPs->SetYTitle("<reference multiplicity>");
  fRefMultVsNoOfRPs->SetXTitle("# of RPs");

  //reference multiplicity
  sName = "Control_Flow_Ref_Mult_";
  sName +=anInput;
  fHistRefMult = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
  fHistRefMult->SetXTitle("Reference multiplicity");
  fHistRefMult->SetYTitle("Counts");

  //mass for POI selection
  sName = "Control_Flow_Mass_POI";
  sName +=anInput;
  fHistMassPOI = new TH2F(sName.Data(), sName.Data(), iNbinsMass, dMassMin, dMassMax,
			  iNbinsPt, dPtMin, dPtMax);
  Double_t mbWidth = 0.;
  if(iNbinsMass != 0) 
  {
   mbWidth = (dMassMax-dMassMin)/iNbinsMass*1000.;
  } 
  fHistMassPOI->SetXTitle("Mass (GeV/c^{2})");
  fHistMassPOI->SetYTitle("P_{t} (GeV/c)");
  fHistMassPOI->SetZTitle( Form("Counts/(%.2f MeV/c^{2})",mbWidth));

  //list of histograms if added here also add in copy constructor
  fHistList = new TList();
  fHistList-> Add(fHistMultRP);        
  fHistList-> Add(fHistMultPOI); 
  if(!fBookOnlyBasic){fHistList-> Add(fHistMultPOIvsRP);}
  fHistList-> Add(fHistPtRP);          
  fHistList-> Add(fHistPtPOI); 
  if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub0);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub1);}
  fHistList-> Add(fHistPhiRP);          
  fHistList-> Add(fHistPhiPOI);
  if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub0);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub1);}
  fHistList-> Add(fHistEtaRP);          
  fHistList-> Add(fHistEtaPOI); 
  if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub0);} 
  if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub1);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaRP);}  
  if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaPOI);}
  fHistList-> Add(fHistProMeanPtperBin);
  if(!fBookOnlyBasic){fHistList-> Add(fHistWeightvsPhi);}
  fHistList-> Add(fHarmonic); 
  fHistList-> Add(fRefMultVsNoOfRPs); 
  fHistList-> Add(fHistRefMult);   
  fHistList-> Add(fHistMassPOI);
  if(!fBookOnlyBasic){fHistList-> Add(fHistQ);}           
  if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub0);}
  if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub1);} 

}


//----------------------------------------------------------------------- 

AliFlowCommonHist::~AliFlowCommonHist()
{
  //deletes histograms
  delete fHistMultRP;       
  delete fHistMultPOI; 
  delete fHistMultPOIvsRP;
  delete fHistPtRP;         
  delete fHistPtPOI;
  delete fHistPtSub0;
  delete fHistPtSub1;
  delete fHistPhiRP;        
  delete fHistPhiPOI;
  delete fHistPhiSub0;
  delete fHistPhiSub1;
  delete fHistEtaRP;        
  delete fHistEtaPOI;
  delete fHistEtaSub0;
  delete fHistEtaSub1;
  delete fHistPhiEtaRP;
  delete fHistPhiEtaPOI;
  delete fHistProMeanPtperBin;
  delete fHistWeightvsPhi;
  delete fHistQ;
  delete fHistAngleQ;
  delete fHistAngleQSub0;
  delete fHistAngleQSub1;
  delete fHarmonic;
  delete fRefMultVsNoOfRPs;
  delete fHistRefMult;  
  delete fHistMassPOI;  
  delete fHistList;
}


//----------------------------------------------------------------------- 

Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* anEvent,TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
{
  //Fills the control histograms
  if (!anEvent){
    cout<<"##### FillControlHistograms: FlowEvent pointer null"<<endl;
    return kFALSE;
  }

  //track datamembers
  Double_t dPt     = 0.;
  Double_t dPhi    = 0.;
  Double_t dEta    = 0.;
  Double_t dWeight = 1.;

  //weights used for corrections
  Double_t dWPhi = 1.;
  Double_t dWPt  = 1.;
  Double_t dWEta = 1.;

  TH1F *phiWeights     = NULL;
  TH1F *phiWeightsSub0 = NULL;
  TH1F *phiWeightsSub1 = NULL;
  TH1D *ptWeights      = NULL;
  TH1D *etaWeights     = NULL;

  Int_t nBinsPhi     = 0;
  Int_t nBinsPhiSub0 = 0;
  Int_t nBinsPhiSub1 = 0;
  Double_t dBinWidthPt  = 0.;
  Double_t dPtMin       = 0.;
  Double_t dBinWidthEta = 0.;
  Double_t dEtaMin      = 0.;

  if(weightsList)
    {
      if(usePhiWeights)
	{
	  phiWeights = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights"));
	  if(phiWeights) nBinsPhi = phiWeights->GetNbinsX();
	  phiWeightsSub0 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub0"));
	  if(phiWeightsSub0) nBinsPhiSub0 = phiWeightsSub0->GetNbinsX();
	  phiWeightsSub1 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub1"));
	  if(phiWeightsSub1) nBinsPhiSub1 = phiWeightsSub1->GetNbinsX();
	}
      if(usePtWeights)
	{
	  ptWeights = dynamic_cast<TH1D *>(weightsList->FindObject("pt_weights"));
	  if(ptWeights)
	    {
	      dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
	      dPtMin = (ptWeights->GetXaxis())->GetXmin();
	    }
	}
      if(useEtaWeights)
	{
	  etaWeights = dynamic_cast<TH1D *>(weightsList->FindObject("eta_weights"));
	  if(etaWeights)
	    {
	      dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
	      dEtaMin = (etaWeights->GetXaxis())->GetXmin();
	    }
	}
    } // end of if(weightsList)


  
  //fill the histograms
  AliFlowVector vQ = anEvent->GetQ(2, weightsList, usePhiWeights, usePtWeights, useEtaWeights); 
  //weight by the Multiplicity
  Double_t dQX = 0.;
  Double_t dQY = 0.;
  if (vQ.GetMult()!=0) {
    dQX = vQ.X()/vQ.GetMult();
    dQY = vQ.Y()/vQ.GetMult();
  }
  vQ.Set(dQX,dQY);
  if(!fBookOnlyBasic){fHistQ->Fill(vQ.Mod());}
  if(!fBookOnlyBasic){fHistAngleQ->Fill(vQ.Phi()/2);}

  AliFlowVector* vQSub = new AliFlowVector[2];
  anEvent->Get2Qsub(vQSub, 2, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
  AliFlowVector vQa = vQSub[0];
  AliFlowVector vQb = vQSub[1];
  if(!fBookOnlyBasic){fHistAngleQSub0->Fill(vQa.Phi()/2);}
  if(!fBookOnlyBasic){fHistAngleQSub1->Fill(vQb.Phi()/2);}

  Double_t dMultRP = 0.;
  Double_t dMultPOI = 0.;
  
  Int_t iNumberOfTracks = anEvent->NumberOfTracks();
  AliFlowTrackSimple* pTrack = NULL;     

  for (Int_t i=0;i<iNumberOfTracks;i++) {
    pTrack = anEvent->GetTrack(i);
    if (pTrack ) {
      dWeight = pTrack->Weight();
      dPt = pTrack->Pt();
      dPhi = pTrack->Phi();
      if (dPhi<0.) dPhi+=2*TMath::Pi();
      dEta = pTrack->Eta();

      //weights are only used for the RP selection
      if (pTrack->InRPSelection()){
	// determine Phi weight:
	if(phiWeights && nBinsPhi) {
	  dWPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
	}
	// determine v'(pt) weight:
	if(ptWeights && dBinWidthPt) {
	  dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
	}
	// determine v'(eta) weight:
	if(etaWeights && dBinWidthEta)  {
	  dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
	}
	
	//the total weight is the product
	Double_t dW = dWeight*dWPhi*dWPt*dWEta; 

	//pt
	fHistPtRP->Fill(dPt,dW);
	//phi
	fHistPhiRP->Fill(dPhi,dW);
	//eta
	fHistEtaRP->Fill(dEta,dW);
	//eta vs phi
	if(!fBookOnlyBasic){fHistPhiEtaRP->Fill(dEta,dPhi,dW);}
	//weight vs phi
	if(!fBookOnlyBasic){fHistWeightvsPhi->Fill(dPhi,dW);}
	//count
	dMultRP += dW;
      }
      if (pTrack->InRPSelection() && pTrack->InSubevent(0)) {
	// determine Phi weight:
	if(phiWeightsSub0 && nBinsPhiSub0){
	  dWPhi = phiWeightsSub0->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhiSub0/TMath::TwoPi())));
	}
	// determine v'(pt) weight:
	if(ptWeights && dBinWidthPt) {
	  dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
	}
	// determine v'(eta) weight:
	if(etaWeights && dBinWidthEta)  {
	  dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
	}
	
	//the total weight is the product
	Double_t dW = dWeight*dWPhi*dWPt*dWEta;  

	//pt
	if(!fBookOnlyBasic){fHistPtSub0 ->Fill(dPt,dW);}
	//phi
	if(!fBookOnlyBasic){fHistPhiSub0 ->Fill(dPhi,dW);}
	//eta
	if(!fBookOnlyBasic){fHistEtaSub0 ->Fill(dEta,dW);}
      }
      if (pTrack->InRPSelection() && pTrack->InSubevent(1)) {
	// determine Phi weight:
	if(phiWeightsSub1 && nBinsPhiSub1){
	  dWPhi = phiWeightsSub1->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhiSub1/TMath::TwoPi())));
	}
	// determine v'(pt) weight:
	if(ptWeights && dBinWidthPt) {
	  dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
	}
	// determine v'(eta) weight:
	if(etaWeights && dBinWidthEta)  {
	  dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
	}
	
	//the total weight is the product
	Double_t dW = dWeight*dWPhi*dWPt*dWEta;  

	//pt
	if(!fBookOnlyBasic){fHistPtSub1 -> Fill(dPt,dW);}
	//phi
	if(!fBookOnlyBasic){fHistPhiSub1 -> Fill(dPhi,dW);}
	//eta
	if(!fBookOnlyBasic){fHistEtaSub1 -> Fill(dEta,dW);}
      }
      if (pTrack->InPOISelection()){

	Double_t dW = dWeight; //no pt, phi or eta weights

	//pt
	fHistPtPOI ->Fill(dPt,dW);
	//phi
	fHistPhiPOI ->Fill(dPhi,dW);
	//eta
	fHistEtaPOI ->Fill(dEta,dW);
	//eta vs phi
	if(!fBookOnlyBasic){fHistPhiEtaPOI->Fill(dEta,dPhi,dW);}
	//mean pt
	fHistProMeanPtperBin ->Fill(dPt,dPt,dW);
	//mass
	fHistMassPOI->Fill(pTrack->Mass(),dPt,dW);
	//count
	dMultPOI += dW;
      }
    } //track
  } //loop over tracks
  
  fHistMultRP->Fill(dMultRP);
  fHistMultPOI->Fill(dMultPOI);
  if(!fBookOnlyBasic){fHistMultPOIvsRP->Fill(dMultRP,dMultPOI);}
  
  //<reference multiplicity> versus # of RPs:
  fRefMultVsNoOfRPs->Fill(dMultRP+0.5,anEvent->GetReferenceMultiplicity(),1.);
  
  //reference multiplicity:
  fHistRefMult->Fill(anEvent->GetReferenceMultiplicity());

  return kTRUE; 
}

//----------------------------------------------------------------------- 

Double_t AliFlowCommonHist::GetEntriesInPtBinRP(Int_t aBin)
{
  //get entries in bin aBin from fHistPtRP
  Double_t dEntries = fHistPtRP->GetBinContent(aBin);

  return dEntries;

}

//----------------------------------------------------------------------- 

Double_t AliFlowCommonHist::GetEntriesInPtBinPOI(Int_t aBin)
{
  //get entries in bin aBin from fHistPtPOI
  Double_t dEntries = fHistPtPOI->GetBinContent(aBin);

  return dEntries;

}

//----------------------------------------------------------------------- 

Double_t AliFlowCommonHist::GetEntriesInEtaBinRP(Int_t aBin)
{
  //get entries in bin aBin from fHistPtRP
  Double_t dEntries = fHistEtaRP->GetBinContent(aBin);

  return dEntries;

}

//----------------------------------------------------------------------- 

Double_t AliFlowCommonHist::GetEntriesInEtaBinPOI(Int_t aBin)
{
  //get entries in bin aBin from fHistPtPOI
  Double_t dEntries = fHistEtaPOI->GetBinContent(aBin);

  return dEntries;

}

//----------------------------------------------------------------------- 

Double_t AliFlowCommonHist::GetMeanPt(Int_t aBin)
{  
  //Get entry from bin aBin from fHistProMeanPtperBin
  Double_t dMeanPt = fHistProMeanPtperBin->GetBinContent(aBin);

  return dMeanPt;
  
}


//----------------------------------------------------------------------- 
 Double_t AliFlowCommonHist::Merge(TCollection *aList)
{
  //merge fuction
  //cout<<"entering merge function"<<endl;
  if (!aList) return 0;
  if (aList->IsEmpty()) return 0; //no merging is needed

  Int_t iCount = 0;
  TIter next(aList); // list is supposed to contain only objects of the same type as this
  AliFlowCommonHist *toMerge=NULL;
  while ((toMerge=(AliFlowCommonHist*)next())) {
    TList tempList;
    tempList.Add(toMerge->GetHistList()); 
    fHistList->Merge(&tempList);
    iCount++;
  }
    
  //cout<<"Merged"<<endl;
  return (double)iCount;
    
}

void AliFlowCommonHist::Print(Option_t *option) const
{
  //   -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
  //             ===============================================
  //   printf( "TH1.Print Name  = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
  printf( "Class.Print Name = %s, Histogram list:\n",GetName());

  if (fHistList) {  
    fHistList->Print(option);
  }
  else
    {
      printf( "Empty histogram list \n");
    }
}

//----------------------------------------------------------------------- 
 void AliFlowCommonHist::Browse(TBrowser *b)
{

  if (!b) return;
  if (fHistList) b->Add(fHistList,"AliFlowCommonHistList");
}




 AliFlowCommonHist.cxx:1
 AliFlowCommonHist.cxx:2
 AliFlowCommonHist.cxx:3
 AliFlowCommonHist.cxx:4
 AliFlowCommonHist.cxx:5
 AliFlowCommonHist.cxx:6
 AliFlowCommonHist.cxx:7
 AliFlowCommonHist.cxx:8
 AliFlowCommonHist.cxx:9
 AliFlowCommonHist.cxx:10
 AliFlowCommonHist.cxx:11
 AliFlowCommonHist.cxx:12
 AliFlowCommonHist.cxx:13
 AliFlowCommonHist.cxx:14
 AliFlowCommonHist.cxx:15
 AliFlowCommonHist.cxx:16
 AliFlowCommonHist.cxx:17
 AliFlowCommonHist.cxx:18
 AliFlowCommonHist.cxx:19
 AliFlowCommonHist.cxx:20
 AliFlowCommonHist.cxx:21
 AliFlowCommonHist.cxx:22
 AliFlowCommonHist.cxx:23
 AliFlowCommonHist.cxx:24
 AliFlowCommonHist.cxx:25
 AliFlowCommonHist.cxx:26
 AliFlowCommonHist.cxx:27
 AliFlowCommonHist.cxx:28
 AliFlowCommonHist.cxx:29
 AliFlowCommonHist.cxx:30
 AliFlowCommonHist.cxx:31
 AliFlowCommonHist.cxx:32
 AliFlowCommonHist.cxx:33
 AliFlowCommonHist.cxx:34
 AliFlowCommonHist.cxx:35
 AliFlowCommonHist.cxx:36
 AliFlowCommonHist.cxx:37
 AliFlowCommonHist.cxx:38
 AliFlowCommonHist.cxx:39
 AliFlowCommonHist.cxx:40
 AliFlowCommonHist.cxx:41
 AliFlowCommonHist.cxx:42
 AliFlowCommonHist.cxx:43
 AliFlowCommonHist.cxx:44
 AliFlowCommonHist.cxx:45
 AliFlowCommonHist.cxx:46
 AliFlowCommonHist.cxx:47
 AliFlowCommonHist.cxx:48
 AliFlowCommonHist.cxx:49
 AliFlowCommonHist.cxx:50
 AliFlowCommonHist.cxx:51
 AliFlowCommonHist.cxx:52
 AliFlowCommonHist.cxx:53
 AliFlowCommonHist.cxx:54
 AliFlowCommonHist.cxx:55
 AliFlowCommonHist.cxx:56
 AliFlowCommonHist.cxx:57
 AliFlowCommonHist.cxx:58
 AliFlowCommonHist.cxx:59
 AliFlowCommonHist.cxx:60
 AliFlowCommonHist.cxx:61
 AliFlowCommonHist.cxx:62
 AliFlowCommonHist.cxx:63
 AliFlowCommonHist.cxx:64
 AliFlowCommonHist.cxx:65
 AliFlowCommonHist.cxx:66
 AliFlowCommonHist.cxx:67
 AliFlowCommonHist.cxx:68
 AliFlowCommonHist.cxx:69
 AliFlowCommonHist.cxx:70
 AliFlowCommonHist.cxx:71
 AliFlowCommonHist.cxx:72
 AliFlowCommonHist.cxx:73
 AliFlowCommonHist.cxx:74
 AliFlowCommonHist.cxx:75
 AliFlowCommonHist.cxx:76
 AliFlowCommonHist.cxx:77
 AliFlowCommonHist.cxx:78
 AliFlowCommonHist.cxx:79
 AliFlowCommonHist.cxx:80
 AliFlowCommonHist.cxx:81
 AliFlowCommonHist.cxx:82
 AliFlowCommonHist.cxx:83
 AliFlowCommonHist.cxx:84
 AliFlowCommonHist.cxx:85
 AliFlowCommonHist.cxx:86
 AliFlowCommonHist.cxx:87
 AliFlowCommonHist.cxx:88
 AliFlowCommonHist.cxx:89
 AliFlowCommonHist.cxx:90
 AliFlowCommonHist.cxx:91
 AliFlowCommonHist.cxx:92
 AliFlowCommonHist.cxx:93
 AliFlowCommonHist.cxx:94
 AliFlowCommonHist.cxx:95
 AliFlowCommonHist.cxx:96
 AliFlowCommonHist.cxx:97
 AliFlowCommonHist.cxx:98
 AliFlowCommonHist.cxx:99
 AliFlowCommonHist.cxx:100
 AliFlowCommonHist.cxx:101
 AliFlowCommonHist.cxx:102
 AliFlowCommonHist.cxx:103
 AliFlowCommonHist.cxx:104
 AliFlowCommonHist.cxx:105
 AliFlowCommonHist.cxx:106
 AliFlowCommonHist.cxx:107
 AliFlowCommonHist.cxx:108
 AliFlowCommonHist.cxx:109
 AliFlowCommonHist.cxx:110
 AliFlowCommonHist.cxx:111
 AliFlowCommonHist.cxx:112
 AliFlowCommonHist.cxx:113
 AliFlowCommonHist.cxx:114
 AliFlowCommonHist.cxx:115
 AliFlowCommonHist.cxx:116
 AliFlowCommonHist.cxx:117
 AliFlowCommonHist.cxx:118
 AliFlowCommonHist.cxx:119
 AliFlowCommonHist.cxx:120
 AliFlowCommonHist.cxx:121
 AliFlowCommonHist.cxx:122
 AliFlowCommonHist.cxx:123
 AliFlowCommonHist.cxx:124
 AliFlowCommonHist.cxx:125
 AliFlowCommonHist.cxx:126
 AliFlowCommonHist.cxx:127
 AliFlowCommonHist.cxx:128
 AliFlowCommonHist.cxx:129
 AliFlowCommonHist.cxx:130
 AliFlowCommonHist.cxx:131
 AliFlowCommonHist.cxx:132
 AliFlowCommonHist.cxx:133
 AliFlowCommonHist.cxx:134
 AliFlowCommonHist.cxx:135
 AliFlowCommonHist.cxx:136
 AliFlowCommonHist.cxx:137
 AliFlowCommonHist.cxx:138
 AliFlowCommonHist.cxx:139
 AliFlowCommonHist.cxx:140
 AliFlowCommonHist.cxx:141
 AliFlowCommonHist.cxx:142
 AliFlowCommonHist.cxx:143
 AliFlowCommonHist.cxx:144
 AliFlowCommonHist.cxx:145
 AliFlowCommonHist.cxx:146
 AliFlowCommonHist.cxx:147
 AliFlowCommonHist.cxx:148
 AliFlowCommonHist.cxx:149
 AliFlowCommonHist.cxx:150
 AliFlowCommonHist.cxx:151
 AliFlowCommonHist.cxx:152
 AliFlowCommonHist.cxx:153
 AliFlowCommonHist.cxx:154
 AliFlowCommonHist.cxx:155
 AliFlowCommonHist.cxx:156
 AliFlowCommonHist.cxx:157
 AliFlowCommonHist.cxx:158
 AliFlowCommonHist.cxx:159
 AliFlowCommonHist.cxx:160
 AliFlowCommonHist.cxx:161
 AliFlowCommonHist.cxx:162
 AliFlowCommonHist.cxx:163
 AliFlowCommonHist.cxx:164
 AliFlowCommonHist.cxx:165
 AliFlowCommonHist.cxx:166
 AliFlowCommonHist.cxx:167
 AliFlowCommonHist.cxx:168
 AliFlowCommonHist.cxx:169
 AliFlowCommonHist.cxx:170
 AliFlowCommonHist.cxx:171
 AliFlowCommonHist.cxx:172
 AliFlowCommonHist.cxx:173
 AliFlowCommonHist.cxx:174
 AliFlowCommonHist.cxx:175
 AliFlowCommonHist.cxx:176
 AliFlowCommonHist.cxx:177
 AliFlowCommonHist.cxx:178
 AliFlowCommonHist.cxx:179
 AliFlowCommonHist.cxx:180
 AliFlowCommonHist.cxx:181
 AliFlowCommonHist.cxx:182
 AliFlowCommonHist.cxx:183
 AliFlowCommonHist.cxx:184
 AliFlowCommonHist.cxx:185
 AliFlowCommonHist.cxx:186
 AliFlowCommonHist.cxx:187
 AliFlowCommonHist.cxx:188
 AliFlowCommonHist.cxx:189
 AliFlowCommonHist.cxx:190
 AliFlowCommonHist.cxx:191
 AliFlowCommonHist.cxx:192
 AliFlowCommonHist.cxx:193
 AliFlowCommonHist.cxx:194
 AliFlowCommonHist.cxx:195
 AliFlowCommonHist.cxx:196
 AliFlowCommonHist.cxx:197
 AliFlowCommonHist.cxx:198
 AliFlowCommonHist.cxx:199
 AliFlowCommonHist.cxx:200
 AliFlowCommonHist.cxx:201
 AliFlowCommonHist.cxx:202
 AliFlowCommonHist.cxx:203
 AliFlowCommonHist.cxx:204
 AliFlowCommonHist.cxx:205
 AliFlowCommonHist.cxx:206
 AliFlowCommonHist.cxx:207
 AliFlowCommonHist.cxx:208
 AliFlowCommonHist.cxx:209
 AliFlowCommonHist.cxx:210
 AliFlowCommonHist.cxx:211
 AliFlowCommonHist.cxx:212
 AliFlowCommonHist.cxx:213
 AliFlowCommonHist.cxx:214
 AliFlowCommonHist.cxx:215
 AliFlowCommonHist.cxx:216
 AliFlowCommonHist.cxx:217
 AliFlowCommonHist.cxx:218
 AliFlowCommonHist.cxx:219
 AliFlowCommonHist.cxx:220
 AliFlowCommonHist.cxx:221
 AliFlowCommonHist.cxx:222
 AliFlowCommonHist.cxx:223
 AliFlowCommonHist.cxx:224
 AliFlowCommonHist.cxx:225
 AliFlowCommonHist.cxx:226
 AliFlowCommonHist.cxx:227
 AliFlowCommonHist.cxx:228
 AliFlowCommonHist.cxx:229
 AliFlowCommonHist.cxx:230
 AliFlowCommonHist.cxx:231
 AliFlowCommonHist.cxx:232
 AliFlowCommonHist.cxx:233
 AliFlowCommonHist.cxx:234
 AliFlowCommonHist.cxx:235
 AliFlowCommonHist.cxx:236
 AliFlowCommonHist.cxx:237
 AliFlowCommonHist.cxx:238
 AliFlowCommonHist.cxx:239
 AliFlowCommonHist.cxx:240
 AliFlowCommonHist.cxx:241
 AliFlowCommonHist.cxx:242
 AliFlowCommonHist.cxx:243
 AliFlowCommonHist.cxx:244
 AliFlowCommonHist.cxx:245
 AliFlowCommonHist.cxx:246
 AliFlowCommonHist.cxx:247
 AliFlowCommonHist.cxx:248
 AliFlowCommonHist.cxx:249
 AliFlowCommonHist.cxx:250
 AliFlowCommonHist.cxx:251
 AliFlowCommonHist.cxx:252
 AliFlowCommonHist.cxx:253
 AliFlowCommonHist.cxx:254
 AliFlowCommonHist.cxx:255
 AliFlowCommonHist.cxx:256
 AliFlowCommonHist.cxx:257
 AliFlowCommonHist.cxx:258
 AliFlowCommonHist.cxx:259
 AliFlowCommonHist.cxx:260
 AliFlowCommonHist.cxx:261
 AliFlowCommonHist.cxx:262
 AliFlowCommonHist.cxx:263
 AliFlowCommonHist.cxx:264
 AliFlowCommonHist.cxx:265
 AliFlowCommonHist.cxx:266
 AliFlowCommonHist.cxx:267
 AliFlowCommonHist.cxx:268
 AliFlowCommonHist.cxx:269
 AliFlowCommonHist.cxx:270
 AliFlowCommonHist.cxx:271
 AliFlowCommonHist.cxx:272
 AliFlowCommonHist.cxx:273
 AliFlowCommonHist.cxx:274
 AliFlowCommonHist.cxx:275
 AliFlowCommonHist.cxx:276
 AliFlowCommonHist.cxx:277
 AliFlowCommonHist.cxx:278
 AliFlowCommonHist.cxx:279
 AliFlowCommonHist.cxx:280
 AliFlowCommonHist.cxx:281
 AliFlowCommonHist.cxx:282
 AliFlowCommonHist.cxx:283
 AliFlowCommonHist.cxx:284
 AliFlowCommonHist.cxx:285
 AliFlowCommonHist.cxx:286
 AliFlowCommonHist.cxx:287
 AliFlowCommonHist.cxx:288
 AliFlowCommonHist.cxx:289
 AliFlowCommonHist.cxx:290
 AliFlowCommonHist.cxx:291
 AliFlowCommonHist.cxx:292
 AliFlowCommonHist.cxx:293
 AliFlowCommonHist.cxx:294
 AliFlowCommonHist.cxx:295
 AliFlowCommonHist.cxx:296
 AliFlowCommonHist.cxx:297
 AliFlowCommonHist.cxx:298
 AliFlowCommonHist.cxx:299
 AliFlowCommonHist.cxx:300
 AliFlowCommonHist.cxx:301
 AliFlowCommonHist.cxx:302
 AliFlowCommonHist.cxx:303
 AliFlowCommonHist.cxx:304
 AliFlowCommonHist.cxx:305
 AliFlowCommonHist.cxx:306
 AliFlowCommonHist.cxx:307
 AliFlowCommonHist.cxx:308
 AliFlowCommonHist.cxx:309
 AliFlowCommonHist.cxx:310
 AliFlowCommonHist.cxx:311
 AliFlowCommonHist.cxx:312
 AliFlowCommonHist.cxx:313
 AliFlowCommonHist.cxx:314
 AliFlowCommonHist.cxx:315
 AliFlowCommonHist.cxx:316
 AliFlowCommonHist.cxx:317
 AliFlowCommonHist.cxx:318
 AliFlowCommonHist.cxx:319
 AliFlowCommonHist.cxx:320
 AliFlowCommonHist.cxx:321
 AliFlowCommonHist.cxx:322
 AliFlowCommonHist.cxx:323
 AliFlowCommonHist.cxx:324
 AliFlowCommonHist.cxx:325
 AliFlowCommonHist.cxx:326
 AliFlowCommonHist.cxx:327
 AliFlowCommonHist.cxx:328
 AliFlowCommonHist.cxx:329
 AliFlowCommonHist.cxx:330
 AliFlowCommonHist.cxx:331
 AliFlowCommonHist.cxx:332
 AliFlowCommonHist.cxx:333
 AliFlowCommonHist.cxx:334
 AliFlowCommonHist.cxx:335
 AliFlowCommonHist.cxx:336
 AliFlowCommonHist.cxx:337
 AliFlowCommonHist.cxx:338
 AliFlowCommonHist.cxx:339
 AliFlowCommonHist.cxx:340
 AliFlowCommonHist.cxx:341
 AliFlowCommonHist.cxx:342
 AliFlowCommonHist.cxx:343
 AliFlowCommonHist.cxx:344
 AliFlowCommonHist.cxx:345
 AliFlowCommonHist.cxx:346
 AliFlowCommonHist.cxx:347
 AliFlowCommonHist.cxx:348
 AliFlowCommonHist.cxx:349
 AliFlowCommonHist.cxx:350
 AliFlowCommonHist.cxx:351
 AliFlowCommonHist.cxx:352
 AliFlowCommonHist.cxx:353
 AliFlowCommonHist.cxx:354
 AliFlowCommonHist.cxx:355
 AliFlowCommonHist.cxx:356
 AliFlowCommonHist.cxx:357
 AliFlowCommonHist.cxx:358
 AliFlowCommonHist.cxx:359
 AliFlowCommonHist.cxx:360
 AliFlowCommonHist.cxx:361
 AliFlowCommonHist.cxx:362
 AliFlowCommonHist.cxx:363
 AliFlowCommonHist.cxx:364
 AliFlowCommonHist.cxx:365
 AliFlowCommonHist.cxx:366
 AliFlowCommonHist.cxx:367
 AliFlowCommonHist.cxx:368
 AliFlowCommonHist.cxx:369
 AliFlowCommonHist.cxx:370
 AliFlowCommonHist.cxx:371
 AliFlowCommonHist.cxx:372
 AliFlowCommonHist.cxx:373
 AliFlowCommonHist.cxx:374
 AliFlowCommonHist.cxx:375
 AliFlowCommonHist.cxx:376
 AliFlowCommonHist.cxx:377
 AliFlowCommonHist.cxx:378
 AliFlowCommonHist.cxx:379
 AliFlowCommonHist.cxx:380
 AliFlowCommonHist.cxx:381
 AliFlowCommonHist.cxx:382
 AliFlowCommonHist.cxx:383
 AliFlowCommonHist.cxx:384
 AliFlowCommonHist.cxx:385
 AliFlowCommonHist.cxx:386
 AliFlowCommonHist.cxx:387
 AliFlowCommonHist.cxx:388
 AliFlowCommonHist.cxx:389
 AliFlowCommonHist.cxx:390
 AliFlowCommonHist.cxx:391
 AliFlowCommonHist.cxx:392
 AliFlowCommonHist.cxx:393
 AliFlowCommonHist.cxx:394
 AliFlowCommonHist.cxx:395
 AliFlowCommonHist.cxx:396
 AliFlowCommonHist.cxx:397
 AliFlowCommonHist.cxx:398
 AliFlowCommonHist.cxx:399
 AliFlowCommonHist.cxx:400
 AliFlowCommonHist.cxx:401
 AliFlowCommonHist.cxx:402
 AliFlowCommonHist.cxx:403
 AliFlowCommonHist.cxx:404
 AliFlowCommonHist.cxx:405
 AliFlowCommonHist.cxx:406
 AliFlowCommonHist.cxx:407
 AliFlowCommonHist.cxx:408
 AliFlowCommonHist.cxx:409
 AliFlowCommonHist.cxx:410
 AliFlowCommonHist.cxx:411
 AliFlowCommonHist.cxx:412
 AliFlowCommonHist.cxx:413
 AliFlowCommonHist.cxx:414
 AliFlowCommonHist.cxx:415
 AliFlowCommonHist.cxx:416
 AliFlowCommonHist.cxx:417
 AliFlowCommonHist.cxx:418
 AliFlowCommonHist.cxx:419
 AliFlowCommonHist.cxx:420
 AliFlowCommonHist.cxx:421
 AliFlowCommonHist.cxx:422
 AliFlowCommonHist.cxx:423
 AliFlowCommonHist.cxx:424
 AliFlowCommonHist.cxx:425
 AliFlowCommonHist.cxx:426
 AliFlowCommonHist.cxx:427
 AliFlowCommonHist.cxx:428
 AliFlowCommonHist.cxx:429
 AliFlowCommonHist.cxx:430
 AliFlowCommonHist.cxx:431
 AliFlowCommonHist.cxx:432
 AliFlowCommonHist.cxx:433
 AliFlowCommonHist.cxx:434
 AliFlowCommonHist.cxx:435
 AliFlowCommonHist.cxx:436
 AliFlowCommonHist.cxx:437
 AliFlowCommonHist.cxx:438
 AliFlowCommonHist.cxx:439
 AliFlowCommonHist.cxx:440
 AliFlowCommonHist.cxx:441
 AliFlowCommonHist.cxx:442
 AliFlowCommonHist.cxx:443
 AliFlowCommonHist.cxx:444
 AliFlowCommonHist.cxx:445
 AliFlowCommonHist.cxx:446
 AliFlowCommonHist.cxx:447
 AliFlowCommonHist.cxx:448
 AliFlowCommonHist.cxx:449
 AliFlowCommonHist.cxx:450
 AliFlowCommonHist.cxx:451
 AliFlowCommonHist.cxx:452
 AliFlowCommonHist.cxx:453
 AliFlowCommonHist.cxx:454
 AliFlowCommonHist.cxx:455
 AliFlowCommonHist.cxx:456
 AliFlowCommonHist.cxx:457
 AliFlowCommonHist.cxx:458
 AliFlowCommonHist.cxx:459
 AliFlowCommonHist.cxx:460
 AliFlowCommonHist.cxx:461
 AliFlowCommonHist.cxx:462
 AliFlowCommonHist.cxx:463
 AliFlowCommonHist.cxx:464
 AliFlowCommonHist.cxx:465
 AliFlowCommonHist.cxx:466
 AliFlowCommonHist.cxx:467
 AliFlowCommonHist.cxx:468
 AliFlowCommonHist.cxx:469
 AliFlowCommonHist.cxx:470
 AliFlowCommonHist.cxx:471
 AliFlowCommonHist.cxx:472
 AliFlowCommonHist.cxx:473
 AliFlowCommonHist.cxx:474
 AliFlowCommonHist.cxx:475
 AliFlowCommonHist.cxx:476
 AliFlowCommonHist.cxx:477
 AliFlowCommonHist.cxx:478
 AliFlowCommonHist.cxx:479
 AliFlowCommonHist.cxx:480
 AliFlowCommonHist.cxx:481
 AliFlowCommonHist.cxx:482
 AliFlowCommonHist.cxx:483
 AliFlowCommonHist.cxx:484
 AliFlowCommonHist.cxx:485
 AliFlowCommonHist.cxx:486
 AliFlowCommonHist.cxx:487
 AliFlowCommonHist.cxx:488
 AliFlowCommonHist.cxx:489
 AliFlowCommonHist.cxx:490
 AliFlowCommonHist.cxx:491
 AliFlowCommonHist.cxx:492
 AliFlowCommonHist.cxx:493
 AliFlowCommonHist.cxx:494
 AliFlowCommonHist.cxx:495
 AliFlowCommonHist.cxx:496
 AliFlowCommonHist.cxx:497
 AliFlowCommonHist.cxx:498
 AliFlowCommonHist.cxx:499
 AliFlowCommonHist.cxx:500
 AliFlowCommonHist.cxx:501
 AliFlowCommonHist.cxx:502
 AliFlowCommonHist.cxx:503
 AliFlowCommonHist.cxx:504
 AliFlowCommonHist.cxx:505
 AliFlowCommonHist.cxx:506
 AliFlowCommonHist.cxx:507
 AliFlowCommonHist.cxx:508
 AliFlowCommonHist.cxx:509
 AliFlowCommonHist.cxx:510
 AliFlowCommonHist.cxx:511
 AliFlowCommonHist.cxx:512
 AliFlowCommonHist.cxx:513
 AliFlowCommonHist.cxx:514
 AliFlowCommonHist.cxx:515
 AliFlowCommonHist.cxx:516
 AliFlowCommonHist.cxx:517
 AliFlowCommonHist.cxx:518
 AliFlowCommonHist.cxx:519
 AliFlowCommonHist.cxx:520
 AliFlowCommonHist.cxx:521
 AliFlowCommonHist.cxx:522
 AliFlowCommonHist.cxx:523
 AliFlowCommonHist.cxx:524
 AliFlowCommonHist.cxx:525
 AliFlowCommonHist.cxx:526
 AliFlowCommonHist.cxx:527
 AliFlowCommonHist.cxx:528
 AliFlowCommonHist.cxx:529
 AliFlowCommonHist.cxx:530
 AliFlowCommonHist.cxx:531
 AliFlowCommonHist.cxx:532
 AliFlowCommonHist.cxx:533
 AliFlowCommonHist.cxx:534
 AliFlowCommonHist.cxx:535
 AliFlowCommonHist.cxx:536
 AliFlowCommonHist.cxx:537
 AliFlowCommonHist.cxx:538
 AliFlowCommonHist.cxx:539
 AliFlowCommonHist.cxx:540
 AliFlowCommonHist.cxx:541
 AliFlowCommonHist.cxx:542
 AliFlowCommonHist.cxx:543
 AliFlowCommonHist.cxx:544
 AliFlowCommonHist.cxx:545
 AliFlowCommonHist.cxx:546
 AliFlowCommonHist.cxx:547
 AliFlowCommonHist.cxx:548
 AliFlowCommonHist.cxx:549
 AliFlowCommonHist.cxx:550
 AliFlowCommonHist.cxx:551
 AliFlowCommonHist.cxx:552
 AliFlowCommonHist.cxx:553
 AliFlowCommonHist.cxx:554
 AliFlowCommonHist.cxx:555
 AliFlowCommonHist.cxx:556
 AliFlowCommonHist.cxx:557
 AliFlowCommonHist.cxx:558
 AliFlowCommonHist.cxx:559
 AliFlowCommonHist.cxx:560
 AliFlowCommonHist.cxx:561
 AliFlowCommonHist.cxx:562
 AliFlowCommonHist.cxx:563
 AliFlowCommonHist.cxx:564
 AliFlowCommonHist.cxx:565
 AliFlowCommonHist.cxx:566
 AliFlowCommonHist.cxx:567
 AliFlowCommonHist.cxx:568
 AliFlowCommonHist.cxx:569
 AliFlowCommonHist.cxx:570
 AliFlowCommonHist.cxx:571
 AliFlowCommonHist.cxx:572
 AliFlowCommonHist.cxx:573
 AliFlowCommonHist.cxx:574
 AliFlowCommonHist.cxx:575
 AliFlowCommonHist.cxx:576
 AliFlowCommonHist.cxx:577
 AliFlowCommonHist.cxx:578
 AliFlowCommonHist.cxx:579
 AliFlowCommonHist.cxx:580
 AliFlowCommonHist.cxx:581
 AliFlowCommonHist.cxx:582
 AliFlowCommonHist.cxx:583
 AliFlowCommonHist.cxx:584
 AliFlowCommonHist.cxx:585
 AliFlowCommonHist.cxx:586
 AliFlowCommonHist.cxx:587
 AliFlowCommonHist.cxx:588
 AliFlowCommonHist.cxx:589
 AliFlowCommonHist.cxx:590
 AliFlowCommonHist.cxx:591
 AliFlowCommonHist.cxx:592
 AliFlowCommonHist.cxx:593
 AliFlowCommonHist.cxx:594
 AliFlowCommonHist.cxx:595
 AliFlowCommonHist.cxx:596
 AliFlowCommonHist.cxx:597
 AliFlowCommonHist.cxx:598
 AliFlowCommonHist.cxx:599
 AliFlowCommonHist.cxx:600
 AliFlowCommonHist.cxx:601
 AliFlowCommonHist.cxx:602
 AliFlowCommonHist.cxx:603
 AliFlowCommonHist.cxx:604
 AliFlowCommonHist.cxx:605
 AliFlowCommonHist.cxx:606
 AliFlowCommonHist.cxx:607
 AliFlowCommonHist.cxx:608
 AliFlowCommonHist.cxx:609
 AliFlowCommonHist.cxx:610
 AliFlowCommonHist.cxx:611
 AliFlowCommonHist.cxx:612
 AliFlowCommonHist.cxx:613
 AliFlowCommonHist.cxx:614
 AliFlowCommonHist.cxx:615
 AliFlowCommonHist.cxx:616
 AliFlowCommonHist.cxx:617
 AliFlowCommonHist.cxx:618
 AliFlowCommonHist.cxx:619
 AliFlowCommonHist.cxx:620
 AliFlowCommonHist.cxx:621
 AliFlowCommonHist.cxx:622
 AliFlowCommonHist.cxx:623
 AliFlowCommonHist.cxx:624
 AliFlowCommonHist.cxx:625
 AliFlowCommonHist.cxx:626
 AliFlowCommonHist.cxx:627
 AliFlowCommonHist.cxx:628
 AliFlowCommonHist.cxx:629
 AliFlowCommonHist.cxx:630
 AliFlowCommonHist.cxx:631
 AliFlowCommonHist.cxx:632
 AliFlowCommonHist.cxx:633
 AliFlowCommonHist.cxx:634
 AliFlowCommonHist.cxx:635
 AliFlowCommonHist.cxx:636
 AliFlowCommonHist.cxx:637
 AliFlowCommonHist.cxx:638
 AliFlowCommonHist.cxx:639
 AliFlowCommonHist.cxx:640
 AliFlowCommonHist.cxx:641
 AliFlowCommonHist.cxx:642
 AliFlowCommonHist.cxx:643
 AliFlowCommonHist.cxx:644
 AliFlowCommonHist.cxx:645
 AliFlowCommonHist.cxx:646
 AliFlowCommonHist.cxx:647
 AliFlowCommonHist.cxx:648
 AliFlowCommonHist.cxx:649
 AliFlowCommonHist.cxx:650
 AliFlowCommonHist.cxx:651
 AliFlowCommonHist.cxx:652
 AliFlowCommonHist.cxx:653
 AliFlowCommonHist.cxx:654
 AliFlowCommonHist.cxx:655
 AliFlowCommonHist.cxx:656
 AliFlowCommonHist.cxx:657
 AliFlowCommonHist.cxx:658
 AliFlowCommonHist.cxx:659
 AliFlowCommonHist.cxx:660
 AliFlowCommonHist.cxx:661
 AliFlowCommonHist.cxx:662
 AliFlowCommonHist.cxx:663
 AliFlowCommonHist.cxx:664
 AliFlowCommonHist.cxx:665
 AliFlowCommonHist.cxx:666
 AliFlowCommonHist.cxx:667
 AliFlowCommonHist.cxx:668
 AliFlowCommonHist.cxx:669
 AliFlowCommonHist.cxx:670
 AliFlowCommonHist.cxx:671
 AliFlowCommonHist.cxx:672
 AliFlowCommonHist.cxx:673
 AliFlowCommonHist.cxx:674
 AliFlowCommonHist.cxx:675
 AliFlowCommonHist.cxx:676
 AliFlowCommonHist.cxx:677
 AliFlowCommonHist.cxx:678
 AliFlowCommonHist.cxx:679
 AliFlowCommonHist.cxx:680
 AliFlowCommonHist.cxx:681
 AliFlowCommonHist.cxx:682
 AliFlowCommonHist.cxx:683
 AliFlowCommonHist.cxx:684
 AliFlowCommonHist.cxx:685
 AliFlowCommonHist.cxx:686
 AliFlowCommonHist.cxx:687
 AliFlowCommonHist.cxx:688
 AliFlowCommonHist.cxx:689
 AliFlowCommonHist.cxx:690
 AliFlowCommonHist.cxx:691
 AliFlowCommonHist.cxx:692
 AliFlowCommonHist.cxx:693
 AliFlowCommonHist.cxx:694
 AliFlowCommonHist.cxx:695
 AliFlowCommonHist.cxx:696
 AliFlowCommonHist.cxx:697
 AliFlowCommonHist.cxx:698
 AliFlowCommonHist.cxx:699
 AliFlowCommonHist.cxx:700
 AliFlowCommonHist.cxx:701
 AliFlowCommonHist.cxx:702
 AliFlowCommonHist.cxx:703
 AliFlowCommonHist.cxx:704
 AliFlowCommonHist.cxx:705
 AliFlowCommonHist.cxx:706
 AliFlowCommonHist.cxx:707
 AliFlowCommonHist.cxx:708
 AliFlowCommonHist.cxx:709
 AliFlowCommonHist.cxx:710
 AliFlowCommonHist.cxx:711
 AliFlowCommonHist.cxx:712
 AliFlowCommonHist.cxx:713
 AliFlowCommonHist.cxx:714
 AliFlowCommonHist.cxx:715
 AliFlowCommonHist.cxx:716
 AliFlowCommonHist.cxx:717
 AliFlowCommonHist.cxx:718
 AliFlowCommonHist.cxx:719
 AliFlowCommonHist.cxx:720
 AliFlowCommonHist.cxx:721
 AliFlowCommonHist.cxx:722
 AliFlowCommonHist.cxx:723
 AliFlowCommonHist.cxx:724
 AliFlowCommonHist.cxx:725
 AliFlowCommonHist.cxx:726
 AliFlowCommonHist.cxx:727
 AliFlowCommonHist.cxx:728
 AliFlowCommonHist.cxx:729
 AliFlowCommonHist.cxx:730
 AliFlowCommonHist.cxx:731
 AliFlowCommonHist.cxx:732
 AliFlowCommonHist.cxx:733
 AliFlowCommonHist.cxx:734
 AliFlowCommonHist.cxx:735
 AliFlowCommonHist.cxx:736
 AliFlowCommonHist.cxx:737
 AliFlowCommonHist.cxx:738
 AliFlowCommonHist.cxx:739
 AliFlowCommonHist.cxx:740
 AliFlowCommonHist.cxx:741
 AliFlowCommonHist.cxx:742
 AliFlowCommonHist.cxx:743
 AliFlowCommonHist.cxx:744
 AliFlowCommonHist.cxx:745
 AliFlowCommonHist.cxx:746
 AliFlowCommonHist.cxx:747
 AliFlowCommonHist.cxx:748
 AliFlowCommonHist.cxx:749
 AliFlowCommonHist.cxx:750
 AliFlowCommonHist.cxx:751
 AliFlowCommonHist.cxx:752
 AliFlowCommonHist.cxx:753
 AliFlowCommonHist.cxx:754
 AliFlowCommonHist.cxx:755
 AliFlowCommonHist.cxx:756
 AliFlowCommonHist.cxx:757
 AliFlowCommonHist.cxx:758
 AliFlowCommonHist.cxx:759
 AliFlowCommonHist.cxx:760
 AliFlowCommonHist.cxx:761
 AliFlowCommonHist.cxx:762
 AliFlowCommonHist.cxx:763
 AliFlowCommonHist.cxx:764
 AliFlowCommonHist.cxx:765
 AliFlowCommonHist.cxx:766
 AliFlowCommonHist.cxx:767
 AliFlowCommonHist.cxx:768
 AliFlowCommonHist.cxx:769
 AliFlowCommonHist.cxx:770
 AliFlowCommonHist.cxx:771
 AliFlowCommonHist.cxx:772
 AliFlowCommonHist.cxx:773
 AliFlowCommonHist.cxx:774
 AliFlowCommonHist.cxx:775
 AliFlowCommonHist.cxx:776
 AliFlowCommonHist.cxx:777
 AliFlowCommonHist.cxx:778
 AliFlowCommonHist.cxx:779
 AliFlowCommonHist.cxx:780
 AliFlowCommonHist.cxx:781
 AliFlowCommonHist.cxx:782
 AliFlowCommonHist.cxx:783
 AliFlowCommonHist.cxx:784
 AliFlowCommonHist.cxx:785
 AliFlowCommonHist.cxx:786
 AliFlowCommonHist.cxx:787
 AliFlowCommonHist.cxx:788
 AliFlowCommonHist.cxx:789
 AliFlowCommonHist.cxx:790
 AliFlowCommonHist.cxx:791
 AliFlowCommonHist.cxx:792
 AliFlowCommonHist.cxx:793
 AliFlowCommonHist.cxx:794
 AliFlowCommonHist.cxx:795
 AliFlowCommonHist.cxx:796
 AliFlowCommonHist.cxx:797
 AliFlowCommonHist.cxx:798
 AliFlowCommonHist.cxx:799
 AliFlowCommonHist.cxx:800
 AliFlowCommonHist.cxx:801
 AliFlowCommonHist.cxx:802
 AliFlowCommonHist.cxx:803
 AliFlowCommonHist.cxx:804
 AliFlowCommonHist.cxx:805
 AliFlowCommonHist.cxx:806
 AliFlowCommonHist.cxx:807
 AliFlowCommonHist.cxx:808
 AliFlowCommonHist.cxx:809
 AliFlowCommonHist.cxx:810
 AliFlowCommonHist.cxx:811
 AliFlowCommonHist.cxx:812
 AliFlowCommonHist.cxx:813
 AliFlowCommonHist.cxx:814
 AliFlowCommonHist.cxx:815
 AliFlowCommonHist.cxx:816
 AliFlowCommonHist.cxx:817
 AliFlowCommonHist.cxx:818
 AliFlowCommonHist.cxx:819
 AliFlowCommonHist.cxx:820