coding violations corrected
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 7 Nov 2008 17:29:54 +0000 (17:29 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 7 Nov 2008 17:29:54 +0000 (17:29 +0000)
PWG4/PartCorr/AliAnalysisTaskGammaConversion.cxx
PWG4/PartCorr/AliAnalysisTaskGammaConversion.h
PWG4/PartCorr/AliGammaConversionHistograms.cxx
PWG4/PartCorr/AliGammaConversionHistograms.h
PWG4/PartCorr/AliV0Reader.cxx
PWG4/PartCorr/AliV0Reader.h
PWG4/macros/ConfigGammaConversion.C

index 074cb7ff003268c732377bde788ca8484a4686e3..ff6d6fdec7e0c4cda4d97cbeea2cc334cc28a8d8 100644 (file)
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt                        *
- * Version 1.0                                                            *
- *                                                                        *
- * 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.                  *
- **************************************************************************/
-
-// root
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TInterpreter.h>
-#include <TChain.h>
-#include <TFile.h>
-#include <Riostream.h>
-
-// analysis
-//#include "AliAnalysisTaskSE.h"
-#include "AliAnalysisTaskGammaConversion.h"
-#include "AliAnalysisManager.h"
-#include "AliESDInputHandler.h"
-#include "AliMCEventHandler.h"
-#include "AliMCEvent.h"
-#include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliAODHandler.h"
-#include "AliStack.h"
-#include "AliLog.h"
-//#include "TLorentzVector.h"
-#include "AliKFVertex.h"
-
-ClassImp(AliAnalysisTaskGammaConversion)
-
-
-AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion():
-  AliAnalysisTaskSE(),
-  fV0Reader(NULL),
-  fStack(NULL),
-  fOutputContainer(NULL),
-  fHistograms(NULL),
-  fDoMCTruth(kFALSE),
-  fMCAllGammas(),
-  fMCPi0s(),
-  fMCEtas(),
-  fMCGammaChi_c(),
-  fKFReconstructedGammas(),
-  fElectronMass(-1),
-  fGammaMass(-1),
-  fPi0Mass(-1),
-  fEtaMass(-1),
-  fGammaWidth(-1),
-  fPi0Width(-1),
-  fEtaWidth(-1),
-  fCalculateBackground(kFALSE)
-{
-  // Default constructor
-  // Common I/O in slot 0
-  DefineInput (0, TChain::Class());
-  DefineOutput(0, TTree::Class());
-
-  // Your private output
-  DefineOutput(1, TList::Class());
-}
-
-AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name):
-  AliAnalysisTaskSE(name),
-  fV0Reader(NULL),
-  fStack(NULL),
-  fOutputContainer(0x0),
-  fHistograms(NULL),
-  fDoMCTruth(kFALSE),
-  fMCAllGammas(),
-  fMCPi0s(),
-  fMCEtas(),
-  fMCGammaChi_c(),
-  fKFReconstructedGammas(),
-  fElectronMass(-1),
-  fGammaMass(-1),
-  fPi0Mass(-1),
-  fEtaMass(-1),
-  fGammaWidth(-1),
-  fPi0Width(-1),
-  fEtaWidth(-1),
-  fCalculateBackground(kFALSE)
-{
-  // Common I/O in slot 0
-  DefineInput (0, TChain::Class());
-  DefineOutput(0, TTree::Class());
-  
-  // Your private output
-  DefineOutput(1, TList::Class());
-}
-
-AliAnalysisTaskGammaConversion::~AliAnalysisTaskGammaConversion() 
-{
-  // Remove all pointers
-  if(fOutputContainer){
-    fOutputContainer->Clear() ; 
-    delete fOutputContainer ;
-  }
-  if(fHistograms){
-    delete fHistograms;
-  }
-  if(fV0Reader){
-    delete fV0Reader;
-  }
-}
-
-
-void AliAnalysisTaskGammaConversion::Init()
-{
-  // Initialization
-}
-
-
-void AliAnalysisTaskGammaConversion::Exec(Option_t */*option*/)
-{
-  // Execute analysis for current event
-  //
-  
-  ConnectInputData("");
-  
-  //clear vectors
-  fMCAllGammas.clear();
-  fMCPi0s.clear();
-  fMCEtas.clear();
-  fMCGammaChi_c.clear();
-  /*
-  for(UInt_t ikf=0;ikf<fKFReconstructedGammas.size();ikf++){
-    delete fKFReconstructedGammas[ikf];
-    fKFReconstructedGammas[ikf]=NULL;
-  }
-  */
-  fKFReconstructedGammas.clear();
-
-  //Clear the data in the v0Reader
-  fV0Reader->UpdateEventByEventData();
-  // Process the v0 information
-  if(fDoMCTruth){
-    ProcessMCData();
-  }
-
-  // Process the v0 information
-  ProcessV0s();
-
-  if(fCalculateBackground){//calculate background if flag is set
-    CalculateBackground();
-  }
-
-  // Process reconstructed gammas
-  ProcessGammasForNeutralMesonAnalysis();
-
-  PostData(1, fOutputContainer);
-  
-}
-
-void AliAnalysisTaskGammaConversion::ConnectInputData(Option_t */*option*/){
-
-  if(fV0Reader == NULL){
-    // Write warning here cuts and so on are default if this ever happens
-  }
-  fV0Reader->Initialize();
-}
-
-void AliAnalysisTaskGammaConversion::ProcessMCData(){
-  
-  fStack = fV0Reader->GetMCStack();
-
-  for (Int_t iTracks = 0; iTracks < fStack->GetNtrack(); iTracks++) {
-    TParticle* particle = (TParticle *)fStack->Particle(iTracks);
-
-    if (!particle) {
-      //print warning here
-      continue;
-    }
-    
-    if(particle->Pt()<fV0Reader->GetPtCut()){
-      continue;
-    }
-    
-    if(TMath::Abs(particle->Eta())> fV0Reader->GetEtaCut()){
-      continue;
-    }
-
-    if(particle->R()>fV0Reader->GetMaxRCut()){ // cuts on distance from collision point
-      continue;
-    }
-
-    Double_t tmpPhi=particle->Phi();
-    if(particle->Phi()> TMath::Pi()){
-      tmpPhi = particle->Phi()-(2*TMath::Pi());
-    }
-
-    
-    //process the gammas
-    if (particle->GetPdgCode()== 22){
-      fMCAllGammas.push_back(particle);
-      if(particle->GetMother(0)>-1){ //Means we have a mother
-       if( fStack->Particle(particle->GetMother(0))->GetPdgCode() != 22 ){//Checks for a non gamma mother.
-         if(fHistograms->fMC_Gamma_Energy){fHistograms->fMC_Gamma_Energy->Fill(particle->Energy());}
-         if(fHistograms->fMC_Gamma_Pt){fHistograms->fMC_Gamma_Pt->Fill(particle->Pt());}
-         if(fHistograms->fMC_Gamma_Eta){fHistograms->fMC_Gamma_Eta->Fill(particle->Eta());}
-         
-         /*      Double_t tmpPhi=particle->Phi();
-         if(particle->Phi()> TMath::Pi()){
-           tmpPhi = particle->Phi()-(2*TMath::Pi());
-           }*/
-         if(fHistograms->fMC_Gamma_Phi){fHistograms->fMC_Gamma_Phi->Fill(tmpPhi);}
-
-         //adding the conversion points from all gammas with e+e- daughters
-         if(particle->GetNDaughters() == 2){
-           TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter());
-           TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter());
-           
-           if(daughter0->R()>fV0Reader->GetMaxRCut() || daughter1->R()>fV0Reader->GetMaxRCut()){
-             continue;
-           }
-           
-           if(daughter0->GetPdgCode() == -11 && daughter1->GetPdgCode() == 11 ||
-              daughter0->GetPdgCode() == 11 && daughter1->GetPdgCode() == -11){
-
-             // begin Mapping 
-             Int_t rBin    = fHistograms->GetRBin(daughter0->R());
-             Int_t phiBin  = fHistograms->GetPhiBin(daughter0->Phi());
-             
-             if(fHistograms->fMC_Mapping[phiBin][rBin] != NULL){fHistograms->fMC_Mapping[phiBin][rBin]->Fill(daughter0->Vz(), particle->Eta());}
-             if(fHistograms->fMC_Mapping_Phi[phiBin] != NULL){fHistograms->fMC_Mapping_Phi[phiBin]->Fill(daughter0->Vz(), particle->Eta());}
-             if(fHistograms->fMC_Mapping_R[rBin] != NULL){fHistograms->fMC_Mapping_R[rBin]->Fill(daughter0->Vz(), particle->Eta());}
-             //end mapping
-
-
-             if(fHistograms->fMC_EP_R){fHistograms->fMC_EP_R->Fill(daughter0->R());}
-             if(fHistograms->fMC_EP_Z_R){fHistograms->fMC_EP_Z_R->Fill(daughter0->Vz(),daughter0->R());}
-             if(fHistograms->fMC_EP_X_Y){fHistograms->fMC_EP_X_Y->Fill(daughter0->Vx(),daughter0->Vy());}
-             if(fHistograms->fMC_EP_OpeningAngle){fHistograms->fMC_EP_OpeningAngle->Fill(GetMCOpeningAngle(daughter0, daughter1));}
-
-           }
-         }
-       }
-       if( fStack->Particle(particle->GetMother(0))->GetPdgCode()==10441 ||//chi_c0 
-           fStack->Particle(particle->GetMother(0))->GetPdgCode()==20443 ||//psi_2S
-           fStack->Particle(particle->GetMother(0))->GetPdgCode()==445  //chi_c2
-       ){ 
-         fMCGammaChi_c.push_back(particle);
-         }
-      }
-      else{//means we have a primary particle
-       if(fHistograms->fMC_DirectGamma_Energy){fHistograms->fMC_DirectGamma_Energy->Fill(particle->Energy());}
-       if(fHistograms->fMC_DirectGamma_Pt){fHistograms->fMC_DirectGamma_Pt->Fill(particle->Pt());}
-       if(fHistograms->fMC_DirectGamma_Eta){fHistograms->fMC_DirectGamma_Eta->Fill(particle->Eta());}
-       /*
-       Double_t tmpPhi=particle->Phi();
-       if(particle->Phi()> TMath::Pi()){
-         tmpPhi = particle->Phi()-(2*TMath::Pi());
-       }
-       */
-       if(fHistograms->fMC_DirectGamma_Phi){fHistograms->fMC_DirectGamma_Phi->Fill(tmpPhi);}
-
-       //adding the conversion points from all gammas with e+e- daughters
-       if(particle->GetNDaughters() == 2){
-         TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter());
-         TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter());
-         if(daughter0->GetPdgCode() == -11 && daughter1->GetPdgCode() == 11 ||
-            daughter0->GetPdgCode() == 11 && daughter1->GetPdgCode() == -11){
-           
-           if(fHistograms->fMC_EP_R){fHistograms->fMC_EP_R->Fill(daughter0->R());}
-           if(fHistograms->fMC_EP_Z_R){fHistograms->fMC_EP_Z_R->Fill(daughter0->Vz(),daughter0->R());}
-           if(fHistograms->fMC_EP_X_Y){fHistograms->fMC_EP_X_Y->Fill(daughter0->Vx(),daughter0->Vy());}
-           if(fHistograms->fMC_EP_OpeningAngle){fHistograms->fMC_EP_OpeningAngle->Fill(GetMCOpeningAngle(daughter0,daughter1));}
-
-         }
-       }
-
-      }
-    }
-    else if (TMath::Abs(particle->GetPdgCode())== 11){ // Means we have an electron or a positron
-      if(particle->GetMother(0)>-1){ // means we have a mother
-       if( fStack->Particle(particle->GetMother(0))->GetPdgCode()==22 ){ // Means we have a gamma mother
-         if(particle->GetPdgCode() == 11){//electron 
-           if(fHistograms->fMC_E_Energy){fHistograms->fMC_E_Energy->Fill(particle->Energy());}
-           if(fHistograms->fMC_E_Pt){fHistograms->fMC_E_Pt->Fill(particle->Pt());}
-           if(fHistograms->fMC_E_Eta){fHistograms->fMC_E_Eta->Fill(particle->Eta());}
-           /*      Double_t tmpPhi=particle->Phi();
-           if(particle->Phi()> TMath::Pi()){
-             tmpPhi = particle->Phi()-(2*TMath::Pi());
-             }*/
-           if(fHistograms->fMC_E_Phi){fHistograms->fMC_E_Phi->Fill(tmpPhi);}
-         }
-         if(particle->GetPdgCode() == -11){//positron 
-           if(fHistograms->fMC_P_Energy){fHistograms->fMC_P_Energy->Fill(particle->Energy());}
-           if(fHistograms->fMC_P_Pt){fHistograms->fMC_P_Pt->Fill(particle->Pt());}
-           if(fHistograms->fMC_P_Eta){fHistograms->fMC_P_Eta->Fill(particle->Eta());}
-           /*
-           Double_t tmpPhi=particle->Phi();
-           if(particle->Phi()> TMath::Pi()){
-             tmpPhi = particle->Phi()-(2*TMath::Pi());
-           }
-           */
-           if(fHistograms->fMC_P_Phi){fHistograms->fMC_P_Phi->Fill(tmpPhi);}
-         }
-       }
-      }
-    }
-    else if(particle->GetNDaughters() == 2){
-
-      TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter());
-      TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter());
-      if(daughter0->GetPdgCode() == 22 && daughter1->GetPdgCode() == 22){//check for gamma gamma daughters
-       
-       if(particle->GetPdgCode()==111){//Pi0
-         if( iTracks >= fStack->GetNprimary()){
-           
-           if(fHistograms->fMC_Pi0Secondaries_Eta){fHistograms->fMC_Pi0Secondaries_Eta->Fill(particle->Eta());}
-           /*
-             Double_t tmpPhi=particle->Phi();
-             if(particle->Phi()> TMath::Pi()){
-             tmpPhi = particle->Phi()-(2*TMath::Pi());
-             }
-           */
-           if(fHistograms->fMC_Pi0Secondaries_Phi){fHistograms->fMC_Pi0Secondaries_Phi->Fill(tmpPhi);}
-           if(fHistograms->fMC_Pi0Secondaries_Pt){fHistograms->fMC_Pi0Secondaries_Pt->Fill(particle->Pt());}
-           if(fHistograms->fMC_Pi0Secondaries_Energy){fHistograms->fMC_Pi0Secondaries_Energy->Fill(particle->Energy());}
-           if(fHistograms->fMC_Pi0Secondaries_R){fHistograms->fMC_Pi0Secondaries_R->Fill(particle->R());}
-           if(fHistograms->fMC_Pi0Secondaries_Z_R){fHistograms->fMC_Pi0Secondaries_Z_R->Fill(particle->Vz(),particle->R());}
-           if(fHistograms->fMC_Pi0Secondaries_OpeningAngleGamma){fHistograms->fMC_Pi0Secondaries_OpeningAngleGamma->Fill(GetMCOpeningAngle(daughter0,daughter1));}
-           if(fHistograms->fMC_Pi0Secondaries_X_Y){fHistograms->fMC_Pi0Secondaries_X_Y->Fill(particle->Vx(),particle->Vy());}//only fill from one daughter to avoid multiple filling
-         }
-         else{
-           if(fHistograms->fMC_Pi0_Eta){fHistograms->fMC_Pi0_Eta->Fill(particle->Eta());}
-           /*
-           Double_t tmpPhi=particle->Phi();
-           if(particle->Phi()> TMath::Pi()){
-             tmpPhi = particle->Phi()-(2*TMath::Pi());
-           }
-           */
-           if(fHistograms->fMC_Pi0_Phi){fHistograms->fMC_Pi0_Phi->Fill(tmpPhi);}
-           if(fHistograms->fMC_Pi0_Pt){fHistograms->fMC_Pi0_Pt->Fill(particle->Pt());}
-           if(fHistograms->fMC_Pi0_Energy){fHistograms->fMC_Pi0_Energy->Fill(particle->Energy());}
-           if(fHistograms->fMC_Pi0_R){fHistograms->fMC_Pi0_R->Fill(particle->R());}
-           if(fHistograms->fMC_Pi0_Z_R){fHistograms->fMC_Pi0_Z_R->Fill(particle->Vz(),particle->R());}
-           if(fHistograms->fMC_Pi0_OpeningAngleGamma){fHistograms->fMC_Pi0_OpeningAngleGamma->Fill(GetMCOpeningAngle(daughter0,daughter1));}
-           if(fHistograms->fMC_Pi0_X_Y){fHistograms->fMC_Pi0_X_Y->Fill(particle->Vx(),particle->Vy());}//only fill from one daughter to avoid multiple filling
-         }
-       }
-       else if(particle->GetPdgCode()==221){//Eta
-         if(fHistograms->fMC_Eta_Eta){fHistograms->fMC_Eta_Eta->Fill(particle->Eta());}
-         /*
-           Double_t tmpPhi=particle->Phi();
-         if(particle->Phi()> TMath::Pi()){
-           tmpPhi = particle->Phi()-(2*TMath::Pi());
-         }
-         */
-         if(fHistograms->fMC_Eta_Phi){fHistograms->fMC_Eta_Phi->Fill(tmpPhi);}
-         if(fHistograms->fMC_Eta_Pt){fHistograms->fMC_Eta_Pt->Fill(particle->Pt());}
-         if(fHistograms->fMC_Eta_Energy){fHistograms->fMC_Eta_Energy->Fill(particle->Energy());}
-         if(fHistograms->fMC_Eta_R){fHistograms->fMC_Eta_R->Fill(particle->R());}
-         if(fHistograms->fMC_Eta_Z_R){fHistograms->fMC_Eta_Z_R->Fill(particle->Vz(),particle->R());}
-         if(fHistograms->fMC_Eta_OpeningAngleGamma){fHistograms->fMC_Eta_OpeningAngleGamma->Fill(GetMCOpeningAngle(daughter0,daughter1));}
-         if(fHistograms->fMC_Eta_X_Y){fHistograms->fMC_Eta_X_Y->Fill(particle->Vx(),particle->Vy());}//only fill from one daughter to avoid multiple filling
-       }
-       
-       //the match data should be filled no matter which mother the gamma-gamma comes from
-       if(fHistograms->fMC_Match_Gamma_R){fHistograms->fMC_Match_Gamma_R->Fill(particle->R());}
-       if(fHistograms->fMC_Match_Gamma_Z_R){fHistograms->fMC_Match_Gamma_Z_R->Fill(particle->Vz(),particle->R());}
-       if(fHistograms->fMC_Match_Gamma_X_Y){fHistograms->fMC_Match_Gamma_X_Y->Fill(particle->Vx(),particle->Vy());}
-       if(fHistograms->fMC_Match_Gamma_Mass){fHistograms->fMC_Match_Gamma_Mass->Fill(particle->GetCalcMass());}
-       if(fHistograms->fMC_Match_Gamma_OpeningAngle){fHistograms->fMC_Match_Gamma_OpeningAngle->Fill(GetMCOpeningAngle(daughter0,daughter1));}
-       if(fHistograms->fMC_Match_Gamma_Energy){fHistograms->fMC_Match_Gamma_Energy->Fill(particle->Energy());}
-       if(fHistograms->fMC_Match_Gamma_Pt){fHistograms->fMC_Match_Gamma_Pt->Fill(particle->Pt());}
-       if(fHistograms->fMC_Match_Gamma_Eta){fHistograms->fMC_Match_Gamma_Eta->Fill(particle->Eta());}
-       /*
-       Double_t tmpPhi=particle->Phi();
-       if(particle->Phi()> TMath::Pi()){
-         tmpPhi = particle->Phi()-(2*TMath::Pi());
-       }
-       */
-       if(fHistograms->fMC_Match_Gamma_Phi){fHistograms->fMC_Match_Gamma_Phi->Fill(tmpPhi);}
-      }
-    }
-  }
-}
-
-void AliAnalysisTaskGammaConversion::ProcessV0s(){
-  Int_t nSurvivingV0s=0;
-  while(fV0Reader->NextV0()){
-    nSurvivingV0s++;
-    //-------------------------- filling v0 information -------------------------------------
-    if(fHistograms->fESD_EP_OpeningAngle){fHistograms->fESD_EP_OpeningAngle->Fill(fV0Reader->GetOpeningAngle());}    
-    if(fHistograms->fESD_EP_R){fHistograms->fESD_EP_R->Fill(fV0Reader->GetXYRadius());}
-    if(fHistograms->fESD_EP_Z_R){fHistograms->fESD_EP_Z_R->Fill(fV0Reader->GetZ(),fV0Reader->GetXYRadius());}
-    if(fHistograms->fESD_EP_X_Y){fHistograms->fESD_EP_X_Y->Fill(fV0Reader->GetX(),fV0Reader->GetY());}
-    
-    
-    if(fHistograms->fESD_E_Energy){fHistograms->fESD_E_Energy->Fill(fV0Reader->GetNegativeTrackEnergy());}
-    if(fHistograms->fESD_E_Pt){fHistograms->fESD_E_Pt->Fill(fV0Reader->GetNegativeTrackPt());}
-    if(fHistograms->fESD_E_Eta){fHistograms->fESD_E_Eta->Fill(fV0Reader->GetNegativeTrackEta());}
-    if(fHistograms->fESD_E_Phi){fHistograms->fESD_E_Phi->Fill(fV0Reader->GetNegativeTrackPhi());}
-    
-    if(fHistograms->fESD_P_Energy){fHistograms->fESD_P_Energy->Fill(fV0Reader->GetPositiveTrackEnergy());}
-    if(fHistograms->fESD_P_Pt){fHistograms->fESD_P_Pt->Fill(fV0Reader->GetPositiveTrackPt());}
-    if(fHistograms->fESD_P_Eta){fHistograms->fESD_P_Eta->Fill(fV0Reader->GetPositiveTrackEta());}
-    if(fHistograms->fESD_P_Phi){fHistograms->fESD_P_Phi->Fill(fV0Reader->GetPositiveTrackPhi());}
-    
-    if(fHistograms->fESD_Gamma_Energy){fHistograms->fESD_Gamma_Energy->Fill(fV0Reader->GetMotherCandidateEnergy());}
-    if(fHistograms->fESD_Gamma_Pt){fHistograms->fESD_Gamma_Pt->Fill(fV0Reader->GetMotherCandidatePt());}
-    if(fHistograms->fESD_Gamma_Eta){fHistograms->fESD_Gamma_Eta->Fill(fV0Reader->GetMotherCandidateEta());}
-    if(fHistograms->fESD_Gamma_Phi){fHistograms->fESD_Gamma_Phi->Fill(fV0Reader->GetMotherCandidatePhi());}
-
-
-    // begin mapping
-    Int_t rBin    = fHistograms->GetRBin(fV0Reader->GetXYRadius());
-    Int_t phiBin  = fHistograms->GetPhiBin(fV0Reader->GetNegativeTrackPhi());
-    Double_t motherCandidateEta= fV0Reader->GetMotherCandidateEta();
-    if(fHistograms->fESD_Mapping[phiBin][rBin] != NULL){fHistograms->fESD_Mapping[phiBin][rBin]->Fill(fV0Reader->GetZ(),motherCandidateEta);}
-    if(fHistograms->fESD_Mapping_Phi[phiBin] != NULL){fHistograms->fESD_Mapping_Phi[phiBin]->Fill(fV0Reader->GetZ(),motherCandidateEta);}
-    if(fHistograms->fESD_Mapping_R[rBin] != NULL){fHistograms->fESD_Mapping_R[rBin]->Fill(fV0Reader->GetZ(),motherCandidateEta);}
-    // end mapping
-    
-
-    fKFReconstructedGammas.push_back(*fV0Reader->GetMotherCandidateKFCombination());
-
-    //----------------------------------- checking for "real" conversions (MC match) --------------------------------------
-    if(fDoMCTruth){
-      if(fV0Reader->HasSameMCMother() == kFALSE){
-       continue;
-      }
-
-      TParticle * negativeMC = (TParticle*)fV0Reader->GetNegativeMCParticle();
-      TParticle * positiveMC = (TParticle*)fV0Reader->GetPositiveMCParticle();
-      if(negativeMC->GetPdgCode()!=11 || positiveMC->GetPdgCode()!=-11){
-       continue;
-      }
-
-      if(fV0Reader->GetMotherMCParticle()->GetPdgCode() == 22){
-       if(fHistograms->fESD_Match_Gamma_X_Y){fHistograms->fESD_Match_Gamma_X_Y->Fill(fV0Reader->GetX(),fV0Reader->GetY());}
-       if(fHistograms->fESD_Match_Gamma_OpeningAngle){fHistograms->fESD_Match_Gamma_OpeningAngle->Fill(fV0Reader->GetOpeningAngle());}
-       if(fHistograms->fESD_Match_Gamma_Pt){fHistograms->fESD_Match_Gamma_Pt->Fill(fV0Reader->GetMotherCandidatePt());}
-       if(fHistograms->fESD_Match_Gamma_Energy){fHistograms->fESD_Match_Gamma_Energy->Fill(fV0Reader->GetMotherCandidateEnergy());}
-       if(fHistograms->fESD_Match_Gamma_Eta){fHistograms->fESD_Match_Gamma_Eta->Fill(fV0Reader->GetMotherCandidateEta());}
-
-       if(fHistograms->fESD_Match_Gamma_Phi){fHistograms->fESD_Match_Gamma_Phi->Fill(fV0Reader->GetMotherCandidatePhi());}
-       if(fHistograms->fESD_Match_Gamma_Mass){fHistograms->fESD_Match_Gamma_Mass->Fill(fV0Reader->GetMotherCandidateMass());}
-       if(fHistograms->fESD_Match_Gamma_Width){fHistograms->fESD_Match_Gamma_Width->Fill(fV0Reader->GetMotherCandidateWidth());}
-       if(fHistograms->fESD_Match_Gamma_Chi2){fHistograms->fESD_Match_Gamma_Chi2->Fill(fV0Reader->GetMotherCandidateChi2());}
-       if(fHistograms->fESD_Match_Gamma_NDF){fHistograms->fESD_Match_Gamma_NDF->Fill(fV0Reader->GetMotherCandidateNDF());}
-       if(fHistograms->fESD_Match_Gamma_R){fHistograms->fESD_Match_Gamma_R->Fill(fV0Reader->GetXYRadius());}
-       if(fHistograms->fESD_Match_Gamma_Z_R){fHistograms->fESD_Match_Gamma_Z_R->Fill(fV0Reader->GetZ(),fV0Reader->GetXYRadius());}
-
-       //resolution
-       Double_t mc_pt   = fV0Reader->GetMotherMCParticle()->Pt();
-       Double_t esd_pt  = fV0Reader->GetMotherCandidatePt();
-       Double_t res_dPt = ((esd_pt - mc_pt)/mc_pt)*100;
-       if(fHistograms->fResolution_dPt != NULL){fHistograms->fResolution_dPt->Fill(mc_pt,res_dPt);}
-       if(fHistograms->fResolution_MC_Pt != NULL){fHistograms->fResolution_MC_Pt->Fill(mc_pt);}
-       if(fHistograms->fResolution_ESD_Pt != NULL){fHistograms->fResolution_ESD_Pt->Fill(esd_pt);}
-       
-       Double_t res_dZ = ((fV0Reader->GetZ() -fV0Reader->GetNegativeMCParticle()->Vz())/fV0Reader->GetNegativeMCParticle()->Vz())*100;
-       if(fHistograms->fResolution_dZ != NULL){fHistograms->fResolution_dZ->Fill(fV0Reader->GetNegativeMCParticle()->Vz(),res_dZ);}
-       if(fHistograms->fResolution_MC_Z != NULL){fHistograms->fResolution_MC_Z->Fill(fV0Reader->GetNegativeMCParticle()->Vz());}
-       if(fHistograms->fResolution_ESD_Z != NULL){fHistograms->fResolution_ESD_Z->Fill(fV0Reader->GetZ());}
-       
-       Double_t res_dR = ((fV0Reader->GetXYRadius() - fV0Reader->GetNegativeMCParticle()->R())/fV0Reader->GetNegativeMCParticle()->R())*100;
-       if(fHistograms->fResolution_dR != NULL){fHistograms->fResolution_dR->Fill(fV0Reader->GetNegativeMCParticle()->R(),res_dR);}
-       if(fHistograms->fResolution_MC_R != NULL){fHistograms->fResolution_MC_R->Fill(fV0Reader->GetNegativeMCParticle()->R());}
-       if(fHistograms->fResolution_ESD_R != NULL){fHistograms->fResolution_ESD_R->Fill(fV0Reader->GetXYRadius());}
-       if(fHistograms->fResolution_dR_dPt != NULL){fHistograms->fResolution_dR_dPt->Fill(res_dR,res_dPt);}
-      }
-    }
-  }
-  if(fHistograms->fNumberOfSurvivingV0s != NULL){fHistograms->fNumberOfSurvivingV0s->Fill(nSurvivingV0s);}
-  if(fHistograms->fNumberOfV0s != NULL){fHistograms->fNumberOfV0s->Fill(fV0Reader->GetNumberOfV0s());}
-}
-
-void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){
-
-  for(UInt_t firstGammaIndex=0;firstGammaIndex<fKFReconstructedGammas.size();firstGammaIndex++){
-    for(UInt_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fKFReconstructedGammas.size();secondGammaIndex++){
-      AliKFParticle * twoGammaDecayCandidateDaughter0 = &fKFReconstructedGammas[firstGammaIndex];
-      AliKFParticle * twoGammaDecayCandidateDaughter1 = &fKFReconstructedGammas[secondGammaIndex];
-
-      // Pi0's
-      AliKFParticle *pi0Candidate = new AliKFParticle(*twoGammaDecayCandidateDaughter0,*twoGammaDecayCandidateDaughter1);
-
-      //      pi0Candidate->SetMassConstraint(fPi0Mass,fPi0Width);
-
-      Double_t massPi0 =0.;
-      Double_t widthPi0 = 0.;
-      Double_t chi2Pi0 =10000.;        
-      pi0Candidate->GetMass(massPi0,widthPi0);
-      if(pi0Candidate->GetNDF()>0){
-       chi2Pi0 = pi0Candidate->GetChi2()/pi0Candidate->GetNDF();
-       //      if(chi2Pi0>0 && chi2Pi0<fChi2Cut){//TODO  find this out
-       if(chi2Pi0>0 && chi2Pi0<10000){//TODO  find this out see line above
-
-         /*
-         TVector3 vertexDaughter0(twoGammaDecayCandidateDaughter0->Px(),twoGammaDecayCandidateDaughter0->Py(),twoGammaDecayCandidateDaughter0->Pz());
-         TVector3 vertexDaughter1(twoGammaDecayCandidateDaughter1->Px(),twoGammaDecayCandidateDaughter1->Py(),twoGammaDecayCandidateDaughter1->Pz());
-         TVector3 vertexPi0Candidate(pi0Candidate->Px(),pi0Candidate->Py(),pi0Candidate->Pz());
-         
-         Double_t openingAnglePi0 = vertexDaughter0.Angle(vertexDaughter1);
-         
-         Double_t radiusPi0 = sqrt( vertexPi0Candidate.x()*vertexPi0Candidate.x() + vertexPi0Candidate.y()*vertexPi0Candidate.y() );
-         */
-
-         TVector3 vectorPi0Candidate(pi0Candidate->Px(),pi0Candidate->Py(),pi0Candidate->Pz());
-
-         Double_t openingAnglePi0 = twoGammaDecayCandidateDaughter0->GetAngle(*twoGammaDecayCandidateDaughter1);
-
-         //Double_t vtx000[3] = {0,0,0};
-         //   NOT SURE IF THIS DOES WHAT WE WANT: remember to ask Sergey  Double_t radiusPi0 = pi0Candidate->GetDistanceFromVertex(vtx000);
-         //Calculating by hand the radius
-         Double_t tmpX= pi0Candidate->GetX();
-         Double_t tmpY= pi0Candidate->GetY();
-         
-         Double_t radiusPi0 = TMath::Sqrt(tmpX*tmpX + tmpY*tmpY);
-
-         if(fHistograms->fESD_Pi0_OpeningAngleGamma){fHistograms->fESD_Pi0_OpeningAngleGamma->Fill(openingAnglePi0);}
-         if(fHistograms->fESD_Pi0_Energy){fHistograms->fESD_Pi0_Energy->Fill(pi0Candidate->GetE());}
-         if(fHistograms->fESD_Pi0_Pt){fHistograms->fESD_Pi0_Pt->Fill(sqrt(pi0Candidate->GetPx()*pi0Candidate->GetPx()+pi0Candidate->GetPy()*pi0Candidate->GetPy()));}
-         if(fHistograms->fESD_Pi0_Eta){fHistograms->fESD_Pi0_Eta->Fill(vectorPi0Candidate.Eta());}
-         if(fHistograms->fESD_Pi0_Phi){fHistograms->fESD_Pi0_Phi->Fill(vectorPi0Candidate.Phi());}
-         if(fHistograms->fESD_Pi0_Mass){fHistograms->fESD_Pi0_Mass->Fill(massPi0);}
-         if(fHistograms->fESD_Pi0_R){fHistograms->fESD_Pi0_R->Fill(radiusPi0);}
-         if(fHistograms->fESD_Pi0_Z_R){fHistograms->fESD_Pi0_Z_R->Fill(tmpY,radiusPi0);}
-         if(fHistograms->fESD_Pi0_X_Y){fHistograms->fESD_Pi0_X_Y->Fill(tmpX,tmpY);}      
-       }
-      }
-      delete pi0Candidate;
-
-      //Eta's
-      AliKFParticle *etaCandidate = new AliKFParticle(*twoGammaDecayCandidateDaughter0,*twoGammaDecayCandidateDaughter1);
-
-      //      etaCandidate->SetMassConstraint(fEtaMass,fEtaWidth);
-      Double_t massEta =0.;
-      Double_t widthEta = 0.;
-      Double_t chi2Eta =10000.;        
-      etaCandidate->GetMass(massEta,widthEta);
-      if(etaCandidate->GetNDF()>0){
-       chi2Eta = etaCandidate->GetChi2()/etaCandidate->GetNDF();
-       //      if(chi2Eta>0 && chi2Eta<fChi2Cut){
-       if(chi2Eta>0 && chi2Eta<100000){// TODO find this out se line above
-         /*
-         TVector3 vertexDaughter0(twoGammaDecayCandidateDaughter0->Px(),twoGammaDecayCandidateDaughter0->Py(),twoGammaDecayCandidateDaughter0->Pz());
-         TVector3 vertexDaughter1(twoGammaDecayCandidateDaughter1->Px(),twoGammaDecayCandidateDaughter1->Py(),twoGammaDecayCandidateDaughter1->Pz());
-         TVector3 vertexEtaCandidate(etaCandidate->Px(),etaCandidate->Py(),etaCandidate->Pz());
-         Double_t openingAngleEta = vertexDaughter0.Angle(vertexDaughter1);
-         
-         Double_t radiusEta = sqrt( etaCandidate->GetX()*etaCandidate->GetX() + vertexEtaCandidate.y()*vertexEtaCandidate.y() );
-         */
-
-         //Calculating by hand the radius
-         Double_t tmpX= etaCandidate->GetX();
-         Double_t tmpY= etaCandidate->GetY();
-         
-         Double_t radiusEta = TMath::Sqrt(tmpX*tmpX + tmpY*tmpY);
-         
-         Double_t openingAngleEta = twoGammaDecayCandidateDaughter0->GetAngle(*twoGammaDecayCandidateDaughter1);
-
-         TVector3 vectorEtaCandidate(etaCandidate->Px(),etaCandidate->Py(),etaCandidate->Pz());
-
-         if(fHistograms->fESD_Eta_OpeningAngleGamma){fHistograms->fESD_Eta_OpeningAngleGamma->Fill(openingAngleEta);}
-         if(fHistograms->fESD_Eta_Energy){fHistograms->fESD_Eta_Energy->Fill(etaCandidate->GetE());}
-         if(fHistograms->fESD_Eta_Pt){fHistograms->fESD_Eta_Pt->Fill(sqrt(etaCandidate->GetPx()*etaCandidate->GetPx()+etaCandidate->GetPy()*etaCandidate->GetPy()));}
-         if(fHistograms->fESD_Eta_Eta){fHistograms->fESD_Eta_Eta->Fill(vectorEtaCandidate.Eta());}
-         if(fHistograms->fESD_Eta_Phi){fHistograms->fESD_Eta_Phi->Fill(vectorEtaCandidate.Phi());}
-         if(fHistograms->fESD_Eta_Mass){fHistograms->fESD_Eta_Mass->Fill(massEta);}
-         if(fHistograms->fESD_Eta_R){fHistograms->fESD_Eta_R->Fill(radiusEta);}
-         if(fHistograms->fESD_Eta_Z_R){fHistograms->fESD_Eta_Z_R->Fill(etaCandidate->GetZ(),radiusEta);}
-         if(fHistograms->fESD_Eta_X_Y){fHistograms->fESD_Eta_X_Y->Fill(tmpX,tmpY);}      
-       }
-      }
-      delete etaCandidate;
-    }
-  }
-
-}
-
-void AliAnalysisTaskGammaConversion::CalculateBackground(){
-
-  for(UInt_t iCurrent=0;iCurrent<fV0Reader->fCurrentEventGoodV0s.size();iCurrent++){
-    AliKFParticle * currentEventGoodV0 = &fV0Reader->fCurrentEventGoodV0s.at(iCurrent);
-    for(UInt_t iPrevious=0;iPrevious<fV0Reader->fCurrentEventGoodV0s.size();iPrevious++){
-      AliKFParticle * previousEventGoodV0 = &fV0Reader->fPreviousEventGoodV0s.at(iPrevious);
-
-      AliKFParticle *backgroundCandidate = new AliKFParticle(*currentEventGoodV0,*previousEventGoodV0);
-
-      Double_t massBG =0.;
-      Double_t widthBG = 0.;
-      Double_t chi2BG =10000.; 
-      backgroundCandidate->GetMass(massBG,widthBG);
-      if(backgroundCandidate->GetNDF()>0){
-       chi2BG = backgroundCandidate->GetChi2()/backgroundCandidate->GetNDF();
-       //      if(chi2Pi0>0 && chi2Pi0<fChi2Cut){//TODO  find this out
-       if(chi2BG>0 && chi2BG<fV0Reader->GetChi2Cut()){//TODO  find this out see line above
-
-         TVector3 vectorBGCandidate(backgroundCandidate->Px(),backgroundCandidate->Py(),backgroundCandidate->Pz());
-
-         Double_t openingAngleBG = currentEventGoodV0->GetAngle(*previousEventGoodV0);
-
-         //Calculating by hand the radius (find a better way)
-         Double_t tmpX= backgroundCandidate->GetX();
-         Double_t tmpY= backgroundCandidate->GetY();
-         
-         Double_t radiusBG = TMath::Sqrt(tmpX*tmpX + tmpY*tmpY);
-
-         if(fHistograms->fESD_Background_OpeningAngleGamma){fHistograms->fESD_Background_OpeningAngleGamma->Fill(openingAngleBG);}
-         if(fHistograms->fESD_Background_Energy){fHistograms->fESD_Background_Energy->Fill(backgroundCandidate->GetE());}
-         if(fHistograms->fESD_Background_Pt){fHistograms->fESD_Background_Pt->Fill(sqrt(backgroundCandidate->GetPx()*backgroundCandidate->GetPx()+backgroundCandidate->GetPy()*backgroundCandidate->GetPy()));}
-         if(fHistograms->fESD_Background_Eta){fHistograms->fESD_Background_Eta->Fill(vectorBGCandidate.Eta());}
-         if(fHistograms->fESD_Background_Phi){fHistograms->fESD_Background_Phi->Fill(vectorBGCandidate.Phi());}
-         if(fHistograms->fESD_Background_Mass){fHistograms->fESD_Background_Mass->Fill(massBG);}
-         if(fHistograms->fESD_Background_R){fHistograms->fESD_Background_R->Fill(radiusBG);}
-         if(fHistograms->fESD_Background_Z_R){fHistograms->fESD_Background_Z_R->Fill(tmpY,radiusBG);}
-         if(fHistograms->fESD_Background_X_Y){fHistograms->fESD_Background_X_Y->Fill(tmpX,tmpY);}
-       }
-      }
-      delete backgroundCandidate;   
-    }
-  }
-}
-
-void AliAnalysisTaskGammaConversion::Terminate(Option_t */*option*/)
-{
-  // Terminate analysis
-  //
-  AliDebug(1,"Do nothing in Terminate");
-}
-
-void AliAnalysisTaskGammaConversion::UserCreateOutputObjects()
-{
-  // Create the output container
-
-  fOutputContainer = fHistograms->GetOutputContainer();
-  fOutputContainer->SetName(GetName()) ;  
-}
-
-Double_t AliAnalysisTaskGammaConversion::GetMCOpeningAngle(TParticle* daughter0,TParticle* daughter1){
-  //helper function
-  TVector3 V3D0(daughter0->Px(),daughter0->Py(),daughter0->Pz());
-  TVector3 V3D1(daughter1->Px(),daughter1->Py(),daughter1->Pz());
-  return V3D0.Angle(V3D1);
-}
-
+/**************************************************************************\r
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ *                                                                        *\r
+ * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt                        *\r
+ * Version 1.0                                                            *\r
+ *                                                                        *\r
+ * Permission to use, copy, modify and distribute this software and its   *\r
+ * documentation strictly for non-commercial purposes is hereby granted   *\r
+ * without fee, provided that the above copyright notice appears in all   *\r
+ * copies and that both the copyright notice and this permission notice   *\r
+ * appear in the supporting documentation. The authors make no claims     *\r
+ * about the suitability of this software for any purpose. It is          *\r
+ * provided "as is" without express or implied warranty.                  *\r
+ **************************************************************************/\r
+\r
+////////////////////////////////////////////////\r
+//--------------------------------------------- \r
+// Class used to do analysis on conversion pairs\r
+//---------------------------------------------\r
+////////////////////////////////////////////////\r
+\r
+// root\r
+#include <TChain.h>\r
+\r
+// analysis\r
+#include "AliAnalysisTaskGammaConversion.h"\r
+#include "AliStack.h"\r
+#include "AliLog.h"\r
+#include <vector>\r
+\r
+class AliKFVertex;\r
+class AliAODHandler;\r
+class AliAODEvent;\r
+class ALiESDEvent;\r
+class AliMCEvent;\r
+class AliMCEventHandler;\r
+class AliESDInputHandler;\r
+class AliAnalysisManager;\r
+class Riostream;\r
+class TFile;\r
+class TInterpreter;\r
+class TSystem;\r
+class TROOT;\r
+\r
+ClassImp(AliAnalysisTaskGammaConversion)\r
+\r
+\r
+AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion():\r
+  AliAnalysisTaskSE(),\r
+  fV0Reader(NULL),\r
+  fStack(NULL),\r
+  fOutputContainer(NULL),\r
+  fHistograms(NULL),\r
+  fDoMCTruth(kFALSE),\r
+  fMCAllGammas(),\r
+  fMCPi0s(),\r
+  fMCEtas(),\r
+  fMCGammaChic(),\r
+  fKFReconstructedGammas(),\r
+  fElectronMass(-1),\r
+  fGammaMass(-1),\r
+  fPi0Mass(-1),\r
+  fEtaMass(-1),\r
+  fGammaWidth(-1),\r
+  fPi0Width(-1),\r
+  fEtaWidth(-1),\r
+  fCalculateBackground(kFALSE)\r
+{\r
+  // Default constructor\r
+  // Common I/O in slot 0\r
+  DefineInput (0, TChain::Class());\r
+  DefineOutput(0, TTree::Class());\r
+\r
+  // Your private output\r
+  DefineOutput(1, TList::Class());\r
+}\r
+\r
+AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name):\r
+  AliAnalysisTaskSE(name),\r
+  fV0Reader(NULL),\r
+  fStack(NULL),\r
+  fOutputContainer(0x0),\r
+  fHistograms(NULL),\r
+  fDoMCTruth(kFALSE),\r
+  fMCAllGammas(),\r
+  fMCPi0s(),\r
+  fMCEtas(),\r
+  fMCGammaChic(),\r
+  fKFReconstructedGammas(),\r
+  fElectronMass(-1),\r
+  fGammaMass(-1),\r
+  fPi0Mass(-1),\r
+  fEtaMass(-1),\r
+  fGammaWidth(-1),\r
+  fPi0Width(-1),\r
+  fEtaWidth(-1),\r
+  fCalculateBackground(kFALSE)\r
+{\r
+  // Common I/O in slot 0\r
+  DefineInput (0, TChain::Class());\r
+  DefineOutput(0, TTree::Class());\r
+  \r
+  // Your private output\r
+  DefineOutput(1, TList::Class());\r
+}\r
+\r
+AliAnalysisTaskGammaConversion::~AliAnalysisTaskGammaConversion() \r
+{\r
+  // Remove all pointers\r
\r
+  if(fOutputContainer){\r
+    fOutputContainer->Clear() ; \r
+    delete fOutputContainer ;\r
+  }\r
+  if(fHistograms){\r
+    delete fHistograms;\r
+  }\r
+  if(fV0Reader){\r
+    delete fV0Reader;\r
+  }\r
+}\r
+\r
+\r
+void AliAnalysisTaskGammaConversion::Init()\r
+{\r
+  // Initialization\r
+}\r
+\r
+\r
+void AliAnalysisTaskGammaConversion::Exec(Option_t */*option*/)\r
+{\r
+  // Execute analysis for current event\r
+  \r
+  ConnectInputData("");\r
+  \r
+  //clear vectors\r
+  fMCAllGammas.clear();\r
+  fMCPi0s.clear();\r
+  fMCEtas.clear();\r
+  fMCGammaChic.clear();\r
+\r
+  fKFReconstructedGammas.clear();\r
+\r
+  //Clear the data in the v0Reader\r
+  fV0Reader->UpdateEventByEventData();\r
+\r
+  // Process the MC information\r
+  if(fDoMCTruth){\r
+    ProcessMCData();\r
+  }\r
+\r
+  // Process the v0 information\r
+  ProcessV0s();\r
+\r
+  //calculate background if flag is set\r
+  if(fCalculateBackground){\r
+    CalculateBackground();\r
+  }\r
+\r
+  // Process reconstructed gammas\r
+  ProcessGammasForNeutralMesonAnalysis();\r
+\r
+  PostData(1, fOutputContainer);\r
+  \r
+}\r
+\r
+void AliAnalysisTaskGammaConversion::ConnectInputData(Option_t */*option*/){\r
+  // see header file for documentation\r
+\r
+  if(fV0Reader == NULL){\r
+    // Write warning here cuts and so on are default if this ever happens\r
+  }\r
+  fV0Reader->Initialize();\r
+}\r
+\r
+void AliAnalysisTaskGammaConversion::ProcessMCData(){\r
+  // see header file for documentation\r
+  \r
+  fStack = fV0Reader->GetMCStack();\r
+\r
+  for (Int_t iTracks = 0; iTracks < fStack->GetNtrack(); iTracks++) {\r
+    TParticle* particle = (TParticle *)fStack->Particle(iTracks);\r
+\r
+    if (!particle) {\r
+      //print warning here\r
+      continue;\r
+    }\r
+    \r
+    if(particle->Pt()<fV0Reader->GetPtCut()){\r
+      continue;\r
+    }\r
+    \r
+    if(TMath::Abs(particle->Eta())> fV0Reader->GetEtaCut()){\r
+      continue;\r
+    }\r
+\r
+    if(particle->R()>fV0Reader->GetMaxRCut()){ // cuts on distance from collision point\r
+      continue;\r
+    }\r
+\r
+    Double_t tmpPhi=particle->Phi();\r
+    if(particle->Phi()> TMath::Pi()){\r
+      tmpPhi = particle->Phi()-(2*TMath::Pi());\r
+    }\r
+\r
+    \r
+    //process the gammas\r
+    if (particle->GetPdgCode()== 22){\r
+      fMCAllGammas.push_back(particle);\r
+      if(particle->GetMother(0)>-1){ //Means we have a mother\r
+       if( fStack->Particle(particle->GetMother(0))->GetPdgCode() != 22 ){//Checks for a non gamma mother.\r
+         fHistograms->FillHistogram("MC_Gamma_Energy", particle->Energy());\r
+         fHistograms->FillHistogram("MC_Gamma_Pt", particle->Pt());\r
+         fHistograms->FillHistogram("MC_Gamma_Eta", particle->Eta());\r
+         \r
+         fHistograms->FillHistogram("MC_Gamma_Phi", tmpPhi);\r
+\r
+         //adding the conversion points from all gammas with e+e- daughters\r
+         if(particle->GetNDaughters() == 2){\r
+           TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter());\r
+           TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter());\r
+           \r
+           if(daughter0->R()>fV0Reader->GetMaxRCut() || daughter1->R()>fV0Reader->GetMaxRCut()){\r
+             continue;\r
+           }\r
+           \r
+           if((daughter0->GetPdgCode() == -11 && daughter1->GetPdgCode()) == 11 ||\r
+              (daughter0->GetPdgCode() == 11 && daughter1->GetPdgCode() == -11)){\r
+\r
+             // begin Mapping \r
+             Int_t rBin    = fHistograms->GetRBin(daughter0->R());\r
+             Int_t phiBin  = fHistograms->GetPhiBin(daughter0->Phi());\r
+             \r
+             TString nameMCMappingPhiR="";\r
+             nameMCMappingPhiR.Form("MC_EP_Mapping-Phi%02d-R%02d",phiBin,rBin);\r
+             fHistograms->FillHistogram(nameMCMappingPhiR, daughter0->Vz(), particle->Eta());\r
+             \r
+             TString nameMCMappingPhi="";\r
+             nameMCMappingPhi.Form("MC_EP_Mapping-Phi%02d",phiBin);\r
+             fHistograms->FillHistogram(nameMCMappingPhi, particle->Eta());\r
+             \r
+             TString nameMCMappingR="";\r
+             nameMCMappingR.Form("MC_EP_Mapping-R%02d",rBin);\r
+             fHistograms->FillHistogram(nameMCMappingR, particle->Eta());\r
+             \r
+             TString nameMCMappingPhiInR="";\r
+             nameMCMappingPhiInR.Form("MC_EP_Mapping_Phi_vs_R_R-%02d",rBin);\r
+             fHistograms->FillHistogram(nameMCMappingPhiInR, daughter0->R(), tmpPhi);\r
+             //end mapping\r
+\r
+             fHistograms->FillHistogram("MC_EP_R",daughter0->R());\r
+             fHistograms->FillHistogram("MC_EP_ZR",daughter0->Vz(),daughter0->R());\r
+             fHistograms->FillHistogram("MC_EP_XY",daughter0->Vx(),daughter0->Vy());\r
+             fHistograms->FillHistogram("MC_EP_OpeningAngle",GetMCOpeningAngle(daughter0, daughter1));\r
+           }\r
+         }\r
+       }\r
+       if( fStack->Particle(particle->GetMother(0))->GetPdgCode()==10441 ||//chic0 \r
+           fStack->Particle(particle->GetMother(0))->GetPdgCode()==20443 ||//psi2S\r
+           fStack->Particle(particle->GetMother(0))->GetPdgCode()==445  //chic2\r
+       ){ \r
+         fMCGammaChic.push_back(particle);\r
+         }\r
+      }\r
+      else{//means we have a primary particle\r
+       fHistograms->FillHistogram("MC_DirectGamma_Energy",particle->Energy());\r
+       fHistograms->FillHistogram("MC_DirectGamma_Pt", particle->Pt());\r
+       fHistograms->FillHistogram("MC_DirectGamma_Eta", particle->Eta());\r
+       fHistograms->FillHistogram("MCDirectGammaPhi", tmpPhi);\r
+\r
+       //adding the conversion points from all gammas with e+e- daughters\r
+       if(particle->GetNDaughters() == 2){\r
+         TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter());\r
+         TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter());\r
+         if((daughter0->GetPdgCode() == -11 && daughter1->GetPdgCode() == 11) ||\r
+            (daughter0->GetPdgCode() == 11 && daughter1->GetPdgCode() == -11)){\r
+           \r
+           fHistograms->FillHistogram("MC_EP_R",daughter0->R());\r
+           fHistograms->FillHistogram("MC_EP_ZR",daughter0->Vz(),daughter0->R());\r
+           fHistograms->FillHistogram("MC_EP_XY",daughter0->Vx(),daughter0->Vy());\r
+           fHistograms->FillHistogram("MC_EP_OpeningAngle",GetMCOpeningAngle(daughter0, daughter1));\r
+\r
+         }\r
+       }\r
+\r
+      }\r
+    }\r
+    else if (TMath::Abs(particle->GetPdgCode())== 11){ // Means we have an electron or a positron\r
+      if(particle->GetMother(0)>-1){ // means we have a mother\r
+       if( fStack->Particle(particle->GetMother(0))->GetPdgCode()==22 ){ // Means we have a gamma mother\r
+         if(particle->GetPdgCode() == 11){//electron \r
+           fHistograms->FillHistogram("MC_E_Energy", particle->Energy());\r
+           fHistograms->FillHistogram("MC_E_Pt", particle->Pt());\r
+           fHistograms->FillHistogram("MC_E_Eta", particle->Eta());\r
+           fHistograms->FillHistogram("MC_E_Phi", tmpPhi);\r
+         }\r
+         if(particle->GetPdgCode() == -11){//positron \r
+           fHistograms->FillHistogram("MC_P_Energy", particle->Energy());\r
+           fHistograms->FillHistogram("MC_P_Pt", particle->Pt());\r
+           fHistograms->FillHistogram("MC_P_Eta", particle->Eta());\r
+           fHistograms->FillHistogram("MC_P_Phi", tmpPhi);\r
+         }\r
+       }\r
+      }\r
+    }\r
+    else if(particle->GetNDaughters() == 2){\r
+\r
+      TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter());\r
+      TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter());\r
+      if(daughter0->GetPdgCode() == 22 && daughter1->GetPdgCode() == 22){//check for gamma gamma daughters\r
+       \r
+       if(particle->GetPdgCode()==111){//Pi0\r
+         \r
+         fHistograms->FillHistogram("MC_Pi0_Secondaries_Phi", tmpPhi);\r
+\r
+         if( iTracks >= fStack->GetNprimary()){\r
+           \r
+           fHistograms->FillHistogram("MC_Pi0_Secondaries_Eta", particle->Eta());\r
+\r
+           fHistograms->FillHistogram("MC_Pi0_Secondaries_Phi", tmpPhi);\r
+           fHistograms->FillHistogram("MC_Pi0_Secondaries_Pt", particle->Pt());\r
+           fHistograms->FillHistogram("MC_Pi0_Secondaries_Energy", particle->Energy());\r
+           fHistograms->FillHistogram("MC_Pi0_Secondaries_R", particle->R());\r
+           fHistograms->FillHistogram("MC_Pi0_Secondaries_ZR", particle->Vz(),particle->R());\r
+           fHistograms->FillHistogram("MC_Pi0_Secondaries_OpeningAngle_Gamma", GetMCOpeningAngle(daughter0,daughter1));\r
+           fHistograms->FillHistogram("MC_Pi0_Secondaries_XY", particle->Vx(),particle->Vy());//only fill from one daughter to avoid multiple filling\r
+         }\r
+         else{\r
+           fHistograms->FillHistogram("MC_Pi0_Eta", particle->Eta());\r
+\r
+           fHistograms->FillHistogram("MC_Pi0_Phi", tmpPhi);\r
+           fHistograms->FillHistogram("MC_Pi0_Pt", particle->Pt());\r
+           fHistograms->FillHistogram("MC_Pi0_Energy", particle->Energy());\r
+           fHistograms->FillHistogram("MC_Pi0_R", particle->R());\r
+           fHistograms->FillHistogram("MC_Pi0_ZR", particle->Vz(),particle->R());\r
+           fHistograms->FillHistogram("MC_Pi0_OpeningAngle_Gamma", GetMCOpeningAngle(daughter0,daughter1));\r
+           fHistograms->FillHistogram("MC_Pi0_XY", particle->Vx(), particle->Vy());//only fill from one daughter to avoid multiple filling\r
+         }\r
+       }\r
+       else if(particle->GetPdgCode()==221){//Eta\r
+         fHistograms->FillHistogram("MC_Eta_Eta", particle->Eta());\r
+\r
+         fHistograms->FillHistogram("MC_Eta_Phi",tmpPhi);\r
+         fHistograms->FillHistogram("MC_Eta_Pt", particle->Pt());\r
+         fHistograms->FillHistogram("MC_Eta_Energy", particle->Energy());\r
+         fHistograms->FillHistogram("MC_Eta_R", particle->R());\r
+         fHistograms->FillHistogram("MC_Eta_ZR", particle->Vz(),particle->R());\r
+         fHistograms->FillHistogram("MC_Eta_OpeningAngle_Gamma", GetMCOpeningAngle(daughter0,daughter1));\r
+         fHistograms->FillHistogram("MC_Eta_XY", particle->Vx(), particle->Vy());//only fill from one daughter to avoid multiple filling\r
+       }\r
+       \r
+       //the match data should be filled no matter which mother the gamma-gamma comes from\r
+       fHistograms->FillHistogram("MC_Match_Gamma_R", particle->R());\r
+       fHistograms->FillHistogram("MC_Match_Gamma_ZR", particle->Vz(),particle->R());\r
+       fHistograms->FillHistogram("MC_Match_Gamma_XY", particle->Vx(),particle->Vy());\r
+       fHistograms->FillHistogram("MC_Match_Gamma_Mass", particle->GetCalcMass());\r
+       fHistograms->FillHistogram("MC_Match_Gamma_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1));\r
+       fHistograms->FillHistogram("MC_Match_Gamma_Energy", particle->Energy());\r
+       fHistograms->FillHistogram("MC_Match_Gamma_Pt", particle->Pt());\r
+       fHistograms->FillHistogram("MC_Match_Gamma_Eta", particle->Eta());\r
+       fHistograms->FillHistogram("MC_Match_Gamma_Phi",tmpPhi);\r
+      }\r
+    }\r
+  }\r
+}\r
+\r
+void AliAnalysisTaskGammaConversion::ProcessV0s(){\r
+  // see header file for documentation\r
+\r
+  Int_t nSurvivingV0s=0;\r
+  while(fV0Reader->NextV0()){\r
+    nSurvivingV0s++;\r
+    //-------------------------- filling v0 information -------------------------------------\r
+    fHistograms->FillHistogram("ESD_EP_OpeningAngle", fV0Reader->GetOpeningAngle());    \r
+    fHistograms->FillHistogram("ESD_EP_R", fV0Reader->GetXYRadius());\r
+    fHistograms->FillHistogram("ESD_EP_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius());\r
+    fHistograms->FillHistogram("ESD_EP_XY", fV0Reader->GetX(),fV0Reader->GetY());\r
+    \r
+    \r
+    fHistograms->FillHistogram("ESD_E_Energy", fV0Reader->GetNegativeTrackEnergy());\r
+    fHistograms->FillHistogram("ESD_E_Pt", fV0Reader->GetNegativeTrackPt());\r
+    fHistograms->FillHistogram("ESD_E_Eta", fV0Reader->GetNegativeTrackEta());\r
+    fHistograms->FillHistogram("ESD_E_Phi", fV0Reader->GetNegativeTrackPhi());\r
+    \r
+    fHistograms->FillHistogram("ESD_P_Energy", fV0Reader->GetPositiveTrackEnergy());\r
+    fHistograms->FillHistogram("ESD_P_Pt", fV0Reader->GetPositiveTrackPt());\r
+    fHistograms->FillHistogram("ESD_P_Eta", fV0Reader->GetPositiveTrackEta());\r
+    fHistograms->FillHistogram("ESD_P_Phi", fV0Reader->GetPositiveTrackPhi());\r
+    \r
+    fHistograms->FillHistogram("ESD_Gamma_Energy", fV0Reader->GetMotherCandidateEnergy());\r
+    fHistograms->FillHistogram("ESD_Gamma_Pt", fV0Reader->GetMotherCandidatePt());\r
+    fHistograms->FillHistogram("ESD_Gamma_Eta", fV0Reader->GetMotherCandidateEta());\r
+    fHistograms->FillHistogram("ESD_Gamma_Phi", fV0Reader->GetMotherCandidatePhi());\r
+\r
+\r
+    // begin mapping\r
+    Int_t rBin    = fHistograms->GetRBin(fV0Reader->GetXYRadius());\r
+    Int_t phiBin  = fHistograms->GetPhiBin(fV0Reader->GetNegativeTrackPhi());\r
+    Double_t motherCandidateEta= fV0Reader->GetMotherCandidateEta();\r
+    \r
+    TString nameESDMappingPhiR="";\r
+    nameESDMappingPhiR.Form("ESD_EP_Mapping-Phi%02d-R%02d",phiBin,rBin);\r
+    fHistograms->FillHistogram(nameESDMappingPhiR, fV0Reader->GetZ(), motherCandidateEta);\r
+\r
+    TString nameESDMappingPhi="";\r
+    nameESDMappingPhi.Form("ESD_EP_Mapping-Phi%02d",phiBin);\r
+    fHistograms->FillHistogram(nameESDMappingPhi, fV0Reader->GetZ(), motherCandidateEta);\r
+\r
+    TString nameESDMappingR="";\r
+    nameESDMappingR.Form("ESD_EP_Mapping-R%02d",rBin);\r
+    fHistograms->FillHistogram(nameESDMappingR, fV0Reader->GetZ(), motherCandidateEta);  \r
+\r
+    TString nameESDMappingPhiInR="";\r
+    nameESDMappingPhiInR.Form("ESD_EP_Mapping_Phi_vs_R_R-%02d",rBin);\r
+    fHistograms->FillHistogram(nameESDMappingPhiInR, fV0Reader->GetXYRadius(), fV0Reader->GetMotherCandidatePhi());\r
+    // end mapping\r
+    \r
+    fKFReconstructedGammas.push_back(*fV0Reader->GetMotherCandidateKFCombination());\r
+\r
+    //----------------------------------- checking for "real" conversions (MC match) --------------------------------------\r
+    if(fDoMCTruth){\r
+      if(fV0Reader->HasSameMCMother() == kFALSE){\r
+       continue;\r
+      }\r
+\r
+      TParticle * negativeMC = (TParticle*)fV0Reader->GetNegativeMCParticle();\r
+      TParticle * positiveMC = (TParticle*)fV0Reader->GetPositiveMCParticle();\r
+      if(negativeMC->GetPdgCode()!=11 || positiveMC->GetPdgCode()!=-11){\r
+       continue;\r
+      }\r
+\r
+      if(fV0Reader->GetMotherMCParticle()->GetPdgCode() == 22){\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_XY", fV0Reader->GetX(),fV0Reader->GetY());\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_OpeningAngle", fV0Reader->GetOpeningAngle());\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_Pt", fV0Reader->GetMotherCandidatePt());\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_Energy", fV0Reader->GetMotherCandidateEnergy());\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_Eta", fV0Reader->GetMotherCandidateEta());\r
+\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_Phi", fV0Reader->GetMotherCandidatePhi());\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_Mass", fV0Reader->GetMotherCandidateMass());\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_Width", fV0Reader->GetMotherCandidateWidth());\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_Chi2", fV0Reader->GetMotherCandidateChi2());\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_NDF", fV0Reader->GetMotherCandidateNDF());\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_R", fV0Reader->GetXYRadius());\r
+       fHistograms->FillHistogram("ESD_Match_Gamma_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius());\r
+\r
+       //resolution\r
+       Double_t mcpt   = fV0Reader->GetMotherMCParticle()->Pt();\r
+       Double_t esdpt  = fV0Reader->GetMotherCandidatePt();\r
+       Double_t resdPt = 0;\r
+       if(mcpt != 0){\r
+         resdPt = ((esdpt - mcpt)/mcpt)*100;\r
+       }\r
+\r
+       fHistograms->FillHistogram("Resolution_dPt", mcpt, resdPt);\r
+       fHistograms->FillHistogram("Resolution_MC_Pt", mcpt);\r
+       fHistograms->FillHistogram("Resolution_ESD_Pt", esdpt);\r
+       \r
+       Double_t resdZ = 0;\r
+       if(fV0Reader->GetNegativeMCParticle()->Vz() != 0){\r
+         resdZ = ((fV0Reader->GetZ() -fV0Reader->GetNegativeMCParticle()->Vz())/fV0Reader->GetNegativeMCParticle()->Vz())*100;\r
+       }\r
+       \r
+       fHistograms->FillHistogram("Resolution_dZ", fV0Reader->GetNegativeMCParticle()->Vz(), resdZ);\r
+       fHistograms->FillHistogram("Resolution_MC_Z", fV0Reader->GetNegativeMCParticle()->Vz());\r
+       fHistograms->FillHistogram("Resolution_ESD_Z", fV0Reader->GetZ());\r
+       \r
+       Double_t resdR = 0;\r
+       if(fV0Reader->GetNegativeMCParticle()->R() != 0){\r
+         resdR = ((fV0Reader->GetXYRadius() - fV0Reader->GetNegativeMCParticle()->R())/fV0Reader->GetNegativeMCParticle()->R())*100;\r
+       }\r
+       fHistograms->FillHistogram("Resolutiond_R", fV0Reader->GetNegativeMCParticle()->R(), resdR);\r
+       fHistograms->FillHistogram("Resolution_MC_R", fV0Reader->GetNegativeMCParticle()->R());\r
+       fHistograms->FillHistogram("Resolution_ESD_R", fV0Reader->GetXYRadius());\r
+       fHistograms->FillHistogram("Resolution_dR_dPt", resdR, resdPt);\r
+      }\r
+    }\r
+  }\r
+  fHistograms->FillHistogram("NumberOfSurvivingV0s", nSurvivingV0s);\r
+  fHistograms->FillHistogram("NumberOfV0s", fV0Reader->GetNumberOfV0s());\r
+}\r
+\r
+void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){\r
+  // see header file for documentation\r
+\r
+  for(UInt_t firstGammaIndex=0;firstGammaIndex<fKFReconstructedGammas.size();firstGammaIndex++){\r
+    for(UInt_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fKFReconstructedGammas.size();secondGammaIndex++){\r
+      AliKFParticle * twoGammaDecayCandidateDaughter0 = &fKFReconstructedGammas[firstGammaIndex];\r
+      AliKFParticle * twoGammaDecayCandidateDaughter1 = &fKFReconstructedGammas[secondGammaIndex];\r
+\r
+      \r
+      AliKFParticle *twoGammaCandidate = new AliKFParticle(*twoGammaDecayCandidateDaughter0,*twoGammaDecayCandidateDaughter1);\r
+\r
+      Double_t massTwoGammaCandidate =0.;\r
+      Double_t widthTwoGammaCandidate = 0.;\r
+      Double_t chi2TwoGammaCandidate =10000.;  \r
+      twoGammaCandidate->GetMass(massTwoGammaCandidate,widthTwoGammaCandidate);\r
+      if(twoGammaCandidate->GetNDF()>0){\r
+       chi2TwoGammaCandidate = twoGammaCandidate->GetChi2()/twoGammaCandidate->GetNDF();\r
+       //      if(chi2TwoGammaCandidate>0 && chi2TwoGammaCandidate<fChi2Cut){//TODO  find this out\r
+       if(chi2TwoGammaCandidate>0 && chi2TwoGammaCandidate<10000){//TODO  find this out see line above\r
+\r
+         TVector3 vectorTwoGammaCandidate(twoGammaCandidate->Px(),twoGammaCandidate->Py(),twoGammaCandidate->Pz());\r
+\r
+         Double_t openingAngleTwoGammaCandidate = twoGammaDecayCandidateDaughter0->GetAngle(*twoGammaDecayCandidateDaughter1);\r
+\r
+         //Calculating by hand the radius\r
+         Double_t tmpX= twoGammaCandidate->GetX();\r
+         Double_t tmpY= twoGammaCandidate->GetY();\r
+         \r
+         Double_t radiusTwoGammaCandidate = TMath::Sqrt(tmpX*tmpX + tmpY*tmpY);\r
+\r
+         fHistograms->FillHistogram("ESD_TwoGammaCombination_OpeningAngleGamma", openingAngleTwoGammaCandidate);\r
+         fHistograms->FillHistogram("ESD_TwoGammaCombination_Energy", twoGammaCandidate->GetE());\r
+         fHistograms->FillHistogram("ESD_TwoGammaCombination_Pt", sqrt(twoGammaCandidate->GetPx()*twoGammaCandidate->GetPx()+twoGammaCandidate->GetPy()*twoGammaCandidate->GetPy()));\r
+         fHistograms->FillHistogram("ESD_TwoGammaCombination_Eta", vectorTwoGammaCandidate.Eta());\r
+         fHistograms->FillHistogram("ESD_TwoGammaCombination_Phi", vectorTwoGammaCandidate.Phi());\r
+         fHistograms->FillHistogram("ESD_TwoGammaCombination_Mass", massTwoGammaCandidate);\r
+         fHistograms->FillHistogram("ESD_TwoGammaCombination_R", radiusTwoGammaCandidate);\r
+         fHistograms->FillHistogram("ESD_TwoGammaCombination_ZR", tmpY, radiusTwoGammaCandidate);\r
+         fHistograms->FillHistogram("ESD_TwoGammaCombination_XY", tmpX, tmpY);   \r
+         fHistograms->FillHistogram("InvMass_vs_Pt__Spectra",massTwoGammaCandidate ,sqrt(twoGammaCandidate->GetPx()*twoGammaCandidate->GetPx()+twoGammaCandidate->GetPy()*twoGammaCandidate->GetPy()));\r
+       }\r
+      }\r
+      delete twoGammaCandidate;\r
+    }\r
+  }\r
+\r
+}\r
+\r
+void AliAnalysisTaskGammaConversion::CalculateBackground(){\r
+  // see header file for documentation\r
+\r
+  vector<AliKFParticle> vectorCurrentEventGoodV0s = fV0Reader->GetCurrentEventGoodV0s();\r
+  vector<AliKFParticle> vectorPreviousEventGoodV0s = fV0Reader->GetPreviousEventGoodV0s();\r
+  for(UInt_t iCurrent=0;iCurrent<vectorCurrentEventGoodV0s.size();iCurrent++){\r
+    AliKFParticle * currentEventGoodV0 = &vectorCurrentEventGoodV0s.at(iCurrent);\r
+    for(UInt_t iPrevious=0;iPrevious<vectorPreviousEventGoodV0s.size();iPrevious++){\r
+      AliKFParticle * previousGoodV0 = &vectorPreviousEventGoodV0s.at(iPrevious);\r
+\r
+      AliKFParticle *backgroundCandidate = new AliKFParticle(*currentEventGoodV0,*previousGoodV0);\r
+\r
+      Double_t massBG =0.;\r
+      Double_t widthBG = 0.;\r
+      Double_t chi2BG =10000.; \r
+      backgroundCandidate->GetMass(massBG,widthBG);\r
+      if(backgroundCandidate->GetNDF()>0){\r
+       chi2BG = backgroundCandidate->GetChi2()/backgroundCandidate->GetNDF();\r
+       //      if(chi2Pi0>0 && chi2Pi0<fChi2Cut){//TODO  find this out\r
+       if(chi2BG>0 && chi2BG<fV0Reader->GetChi2Cut()){//TODO  find this out see line above\r
+\r
+         TVector3 vectorBGCandidate(backgroundCandidate->Px(),backgroundCandidate->Py(),backgroundCandidate->Pz());\r
+\r
+         Double_t openingAngleBG = currentEventGoodV0->GetAngle(*previousGoodV0);\r
+\r
+         //Calculating by hand the radius (find a better way)\r
+         Double_t tmpX= backgroundCandidate->GetX();\r
+         Double_t tmpY= backgroundCandidate->GetY();\r
+         \r
+         Double_t radiusBG = TMath::Sqrt(tmpX*tmpX + tmpY*tmpY);\r
+\r
+         fHistograms->FillHistogram("ESD_Background_GammaDaughter_OpeningAngle", openingAngleBG);\r
+         fHistograms->FillHistogram("ESD_Background_Energy", backgroundCandidate->GetE());\r
+         fHistograms->FillHistogram("ESD_Background_Pt", sqrt(backgroundCandidate->GetPx()*backgroundCandidate->GetPx()+backgroundCandidate->GetPy()*backgroundCandidate->GetPy()));\r
+         fHistograms->FillHistogram("ESD_Background_Eta", vectorBGCandidate.Eta());\r
+         fHistograms->FillHistogram("ESD_Background_Phi", vectorBGCandidate.Phi());\r
+         fHistograms->FillHistogram("ESD_Background_Mass", massBG);\r
+         fHistograms->FillHistogram("ESD_Background_R", radiusBG);\r
+         fHistograms->FillHistogram("ESD_Background_ZR", tmpY, radiusBG);\r
+         fHistograms->FillHistogram("ESD_Background_XY", tmpX, tmpY);\r
+       }\r
+      }\r
+      delete backgroundCandidate;   \r
+    }\r
+  }\r
+}\r
+\r
+void AliAnalysisTaskGammaConversion::Terminate(Option_t */*option*/)\r
+{\r
+  // Terminate analysis\r
+  //\r
+  AliDebug(1,"Do nothing in Terminate");\r
+}\r
+\r
+void AliAnalysisTaskGammaConversion::UserCreateOutputObjects()\r
+{\r
+  // Create the output container\r
+  if(fOutputContainer != NULL){\r
+    delete fOutputContainer;\r
+    fOutputContainer = NULL;\r
+  }\r
+  if(fOutputContainer == NULL){\r
+    fOutputContainer = new TList();\r
+  }\r
+  fHistograms->GetOutputContainer(fOutputContainer);\r
+  fOutputContainer->SetName(GetName()) ;  \r
+}\r
+\r
+Double_t AliAnalysisTaskGammaConversion::GetMCOpeningAngle(TParticle* daughter0, TParticle* daughter1) const{\r
+  //helper function\r
+  TVector3 v3D0(daughter0->Px(),daughter0->Py(),daughter0->Pz());\r
+  TVector3 v3D1(daughter1->Px(),daughter1->Py(),daughter1->Pz());\r
+  return v3D0.Angle(v3D1);\r
+}\r
+\r
index 6f1e3aec9853850ca203e03757588f343ced7325..9e48cdf8deb69fc2a7b3f609e8dc63a062dd455c 100644 (file)
@@ -1,93 +1,95 @@
-#ifndef ALIANALYSISTASKGAMMACONVERSION_H
-#define ALIANALYSISTASKGAMMACONVERSION_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-#include "AliAnalysisTaskSE.h"
-#include "AliV0Reader.h"
-//#include "TH2F.h"
-//#include "TH1F.h"
-#include "AliGammaConversionHistograms.h"
-#include "AliESDv0.h"
-#include <vector>
-//#include "TLorentzVector.h"
-#include "AliKFParticle.h"
-
-//class AliAnaGamma;
-class AliESDInputHandler;
-class AliESDEvent;
-class AliAODEvent;
-class TList;
-class AliStack;
-
-class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
-{
- public:
-    AliAnalysisTaskGammaConversion();
-    AliAnalysisTaskGammaConversion(const char* name);
-    virtual ~AliAnalysisTaskGammaConversion() ;// virtual destructor
-    // Implementation of interface methods
-    virtual void UserCreateOutputObjects();
-    virtual void Init();
-    virtual void LocalInit() {Init();}
-    virtual void Exec(Option_t *option);
-    virtual void Terminate(Option_t *option);
-    virtual void ConnectInputData(Option_t *);
-       
-    void ProcessMCData();
-    void ProcessV0s();
-    void ProcessGammasForNeutralMesonAnalysis();
-    void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;}
-    void SetDoMCTruth(Bool_t flag){fDoMCTruth=flag;}
-    void SetElectronMass(Double_t electronMass){fElectronMass = electronMass;}
-    void SetGammaMass(Double_t gammaMass){fGammaMass = gammaMass;}
-    void SetGammaWidth(Double_t gammaWidth){fGammaWidth = gammaWidth;}
-    void SetPi0Mass(Double_t pi0Mass){fPi0Mass = pi0Mass;}
-    void SetPi0Width(Double_t pi0Width){fPi0Width = pi0Width;}
-    void SetEtaMass(Double_t etaMass){fEtaMass = etaMass;}
-    void SetEtaWidth(Double_t etaWidth){fEtaWidth = etaWidth;}
-    void SetV0Reader(AliV0Reader* reader){fV0Reader=reader;}
-    void SetCalculateBackground(Bool_t bg){fCalculateBackground=bg;}
-    void CalculateBackground();
-    Double_t GetMCOpeningAngle(TParticle* daughter0,TParticle* daughter1);
-
- private:
-    AliAnalysisTaskGammaConversion(const AliAnalysisTaskGammaConversion&); // Not implemented
-    AliAnalysisTaskGammaConversion& operator=(const AliAnalysisTaskGammaConversion&); // Not implemented
-
-    AliV0Reader* fV0Reader;
-
-    AliStack * fStack;
-
-    TList * fOutputContainer ; // Histogram container
-
-    AliGammaConversionHistograms *fHistograms;
-
-    Bool_t fDoMCTruth;
-    
-    vector<TParticle*> fMCAllGammas;
-    vector<TParticle*> fMCPi0s;
-    vector<TParticle*> fMCEtas;
-    vector<TParticle*> fMCGammaChi_c;
-
-    vector<AliKFParticle> fKFReconstructedGammas;
-
-    //mass defines
-    Double_t fElectronMass;
-    Double_t fGammaMass;
-    Double_t fPi0Mass;
-    Double_t fEtaMass;
-
-    // width defines
-    Double_t fGammaWidth;
-    Double_t fPi0Width;
-    Double_t fEtaWidth;
-    Bool_t fCalculateBackground;
-
-
-    ClassDef(AliAnalysisTaskGammaConversion, 0); // Analysis task for gamma conversions
-};
-#endif //ALIANALYSISTASKGAMMA_H
+#ifndef ALIANALYSISTASKGAMMACONVERSION_H\r
+#define ALIANALYSISTASKGAMMACONVERSION_H\r
\r
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ * See cxx source for full Copyright notice                               */\r
+\r
+////////////////////////////////////////////////\r
+//--------------------------------------------- \r
+// Class used to do analysis on conversion pairs\r
+//---------------------------------------------\r
+////////////////////////////////////////////////\r
\r
+#include "AliAnalysisTaskSE.h"\r
+#include <vector>\r
+#include "AliV0Reader.h"\r
+\r
+class AliGammaConversionHistograms;\r
+class AliESDv0;\r
+class AliKFParticle;\r
+class AliESDInputHandler;\r
+class AliESDEvent;\r
+class AliAODEvent;\r
+class TList;\r
+class AliStack;\r
+\r
+class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE\r
+{\r
+ public:\r
+    AliAnalysisTaskGammaConversion();\r
+    AliAnalysisTaskGammaConversion(const char* name);\r
+    virtual ~AliAnalysisTaskGammaConversion() ;// virtual destructor\r
\r
+    // Implementation of interface methods\r
+    virtual void UserCreateOutputObjects();\r
+    virtual void Init();\r
+    virtual void LocalInit() {Init();}\r
+    virtual void Exec(Option_t *option);\r
+    virtual void Terminate(Option_t *option);\r
+    virtual void ConnectInputData(Option_t *);\r
+       \r
+    void ProcessMCData();\r
+    void ProcessV0s();\r
+    void ProcessGammasForNeutralMesonAnalysis();\r
+    void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;}\r
+    void SetDoMCTruth(Bool_t flag){fDoMCTruth=flag;}\r
+    void SetElectronMass(Double_t electronMass){fElectronMass = electronMass;}\r
+    void SetGammaMass(Double_t gammaMass){fGammaMass = gammaMass;}\r
+    void SetGammaWidth(Double_t gammaWidth){fGammaWidth = gammaWidth;}\r
+    void SetPi0Mass(Double_t pi0Mass){fPi0Mass = pi0Mass;}\r
+    void SetPi0Width(Double_t pi0Width){fPi0Width = pi0Width;}\r
+    void SetEtaMass(Double_t etaMass){fEtaMass = etaMass;}\r
+    void SetEtaWidth(Double_t etaWidth){fEtaWidth = etaWidth;}\r
+    void SetV0Reader(AliV0Reader* reader){fV0Reader=reader;}\r
+    void SetCalculateBackground(Bool_t bg){fCalculateBackground=bg;}\r
+    void CalculateBackground();\r
+    Double_t GetMCOpeningAngle(TParticle* daughter0, TParticle* daughter1) const;\r
+\r
+ private:\r
+    AliAnalysisTaskGammaConversion(const AliAnalysisTaskGammaConversion&); // Not implemented\r
+    AliAnalysisTaskGammaConversion& operator=(const AliAnalysisTaskGammaConversion&); // Not implemented\r
+\r
+    AliV0Reader* fV0Reader;\r
+\r
+    AliStack * fStack;\r
+\r
+    TList * fOutputContainer ; // Histogram container\r
+\r
+    AliGammaConversionHistograms *fHistograms;\r
+\r
+    Bool_t fDoMCTruth;\r
+    \r
+    vector<TParticle*> fMCAllGammas;\r
+    vector<TParticle*> fMCPi0s;\r
+    vector<TParticle*> fMCEtas;\r
+    vector<TParticle*> fMCGammaChic;\r
+\r
+    vector<AliKFParticle> fKFReconstructedGammas;\r
+\r
+    //mass defines\r
+    Double_t fElectronMass;\r
+    Double_t fGammaMass;\r
+    Double_t fPi0Mass;\r
+    Double_t fEtaMass;\r
+\r
+    // width defines\r
+    Double_t fGammaWidth;\r
+    Double_t fPi0Width;\r
+    Double_t fEtaWidth;\r
+    Bool_t fCalculateBackground;\r
+\r
+\r
+    ClassDef(AliAnalysisTaskGammaConversion, 0); // Analysis task for gamma conversions\r
+};\r
\r
+#endif //ALIANALYSISTASKGAMMA_H\r
index 0359bacf198f004e8829407a00eb4458290023c1..cd9f6ee47ee59ac3e844e4b460de04e064069bc4 100644 (file)
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt                        *
- * Version 1.0                                                            *
- *                                                                        *
- * 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.                  *
- **************************************************************************/
-/**
- * Class containing histograms 
- //Change here
- // here we need a description of the naming scheme of the histograms.
-
-*/
-
-#include "AliGammaConversionHistograms.h"
-#include "TMath.h"
-
-using namespace std;
-
-ClassImp(AliGammaConversionHistograms)
-
-
-AliGammaConversionHistograms::AliGammaConversionHistograms() :
-  fOutputContainer(NULL),
-  fNPhiIndex(0),
-  fNRIndex(0),
-  fMinRadius(0.),
-  fMaxRadius(0.),
-  fDeltaR(0.),
-  fMinPhi(0.),
-  fMaxPhi(0.),
-  fDeltaPhi(0.),
-  fMC_EP_R(NULL),
-  fMC_EP_Z_R(NULL),
-  fMC_EP_X_Y(NULL),
-  fMC_EP_OpeningAngle(NULL),
-  fMC_E_Energy(NULL),
-  fMC_E_Pt(NULL),
-  fMC_E_Eta(NULL),
-  fMC_E_Phi(NULL),
-  fMC_P_Energy(NULL),
-  fMC_P_Pt(NULL),
-  fMC_P_Eta(NULL),
-  fMC_P_Phi(NULL),
-  fMC_Gamma_Energy(NULL),
-  fMC_Gamma_Pt(NULL),
-  fMC_Gamma_Eta(NULL),
-  fMC_Gamma_Phi(NULL),
-  fMC_DirectGamma_Energy(NULL),
-  fMC_DirectGamma_Pt(NULL),
-  fMC_DirectGamma_Eta(NULL),
-  fMC_DirectGamma_Phi(NULL),
-  fMC_Mapping(),
-  fMC_Mapping_Phi(),
-  fMC_Mapping_R(),
-  fMC_Match_Gamma_Eta(NULL),
-  fMC_Match_Gamma_Phi(NULL),
-  fMC_Match_Gamma_Pt(NULL),
-  fMC_Match_Gamma_Energy(NULL),
-  fMC_Match_Gamma_Mass(NULL),
-  fMC_Match_Gamma_OpeningAngle(NULL),
-  fMC_Match_Gamma_R(NULL),
-  fMC_Match_Gamma_Z_R(NULL),
-  fMC_Match_Gamma_X_Y(NULL),
-  fMC_Pi0_Eta(NULL),
-  fMC_Pi0_Phi(NULL),
-  fMC_Pi0_Pt(NULL),
-  fMC_Pi0_Energy(NULL),
-  fMC_Pi0_Mass(NULL),
-  fMC_Pi0_OpeningAngleGamma(NULL),
-  fMC_Pi0_R(NULL),
-  fMC_Pi0_Z_R(NULL),
-  fMC_Pi0_X_Y(NULL),
-  fMC_Pi0Secondaries_Eta(NULL),
-  fMC_Pi0Secondaries_Phi(NULL),
-  fMC_Pi0Secondaries_Pt(NULL),
-  fMC_Pi0Secondaries_Energy(NULL),
-  fMC_Pi0Secondaries_Mass(NULL),
-  fMC_Pi0Secondaries_OpeningAngleGamma(NULL),
-  fMC_Pi0Secondaries_R(NULL),
-  fMC_Pi0Secondaries_Z_R(NULL),
-  fMC_Pi0Secondaries_X_Y(NULL),
-  fMC_Eta_Eta(NULL),
-  fMC_Eta_Phi(NULL),
-  fMC_Eta_Pt(NULL),
-  fMC_Eta_Energy(NULL),
-  fMC_Eta_Mass(NULL),
-  fMC_Eta_OpeningAngleGamma(NULL),
-  fMC_Eta_R(NULL),
-  fMC_Eta_Z_R(NULL),
-  fMC_Eta_X_Y(NULL),
-  fESD_EP_R(NULL),
-  fESD_EP_Z_R(NULL),
-  fESD_EP_X_Y(NULL),
-  fESD_EP_OpeningAngle(NULL),
-  fESD_E_Energy(NULL),
-  fESD_E_Pt(NULL),
-  fESD_E_Eta(NULL),
-  fESD_E_Phi(NULL),
-  fESD_P_Energy(NULL),
-  fESD_P_Pt(NULL),
-  fESD_P_Eta(NULL),
-  fESD_P_Phi(NULL),
-  fESD_Gamma_Energy(NULL),
-  fESD_Gamma_Pt(NULL),
-  fESD_Gamma_Eta(NULL),
-  fESD_Gamma_Phi(NULL),
-  fESD_Mapping(),
-  fESD_Mapping_Phi(),
-  fESD_Mapping_R(),
-  fESD_Match_Gamma_OpeningAngle(NULL),
-  fESD_Match_Gamma_Energy(NULL),
-  fESD_Match_Gamma_Pt(NULL),
-  fESD_Match_Gamma_Eta(NULL),
-  fESD_Match_Gamma_Phi(NULL),
-  fESD_Match_Gamma_Mass(NULL),
-  fESD_Match_Gamma_Width(NULL),
-  fESD_Match_Gamma_Chi2(NULL),
-  fESD_Match_Gamma_NDF(NULL),
-  fESD_Match_Gamma_R(NULL),
-  fESD_Match_Gamma_Z_R(NULL),
-  fESD_Match_Gamma_X_Y(NULL),
-  fESD_Pi0_OpeningAngleGamma(NULL),
-  fESD_Pi0_Energy(NULL),
-  fESD_Pi0_Pt(NULL),
-  fESD_Pi0_Eta(NULL),
-  fESD_Pi0_Phi(NULL),
-  fESD_Pi0_Mass(NULL),
-  fESD_Pi0_R(NULL),
-  fESD_Pi0_Z_R(NULL),
-  fESD_Pi0_X_Y(NULL),
-  fESD_Eta_OpeningAngleGamma(NULL),
-  fESD_Eta_Energy(NULL),
-  fESD_Eta_Pt(NULL),
-  fESD_Eta_Eta(NULL),
-  fESD_Eta_Phi(NULL),
-  fESD_Eta_Mass(NULL),
-  fESD_Eta_R(NULL),
-  fESD_Eta_Z_R(NULL),
-  fESD_Eta_X_Y(NULL),
-  fESD_Background_OpeningAngleGamma(NULL),
-  fESD_Background_Energy(NULL),
-  fESD_Background_Pt(NULL),
-  fESD_Background_Eta(NULL),
-  fESD_Background_Phi(NULL),
-  fESD_Background_Mass(NULL),
-  fESD_Background_R(NULL),
-  fESD_Background_Z_R(NULL),
-  fESD_Background_X_Y(NULL),
-  fResolution_dPt(NULL),
-  fResolution_dR(NULL),
-  fResolution_dZ(NULL),
-  fResolution_dR_dPt(NULL),
-  fResolution_MC_Pt(NULL),
-  fResolution_MC_R(NULL),
-  fResolution_MC_Z(NULL),
-  fResolution_ESD_Pt(NULL),
-  fResolution_ESD_R(NULL),
-  fResolution_ESD_Z(NULL),
-  fNumberOfV0s(NULL),
-  fNumberOfSurvivingV0s(NULL),
-  fV0MassDebugCut1(NULL),
-  fV0MassDebugCut2(NULL),
-  fV0MassDebugCut3(NULL),
-  fV0MassDebugCut4(NULL),
-  fV0MassDebugCut5(NULL),
-  fV0MassDebugCut6(NULL),
-  fV0MassDebugCut7(NULL),
-  fV0MassDebugCut8(NULL)
-{
-
-}
-
-
-AliGammaConversionHistograms::AliGammaConversionHistograms(const AliGammaConversionHistograms & original) :
-  fOutputContainer(original.fOutputContainer),
-  fNPhiIndex(0),
-  fNRIndex(0),
-  fMinRadius(0.),
-  fMaxRadius(0.),
-  fDeltaR(0.),
-  fMinPhi(0.),
-  fMaxPhi(0.),
-  fDeltaPhi(0.),
-  fMC_EP_R(original.fMC_EP_R),
-  fMC_EP_Z_R(original.fMC_EP_Z_R),
-  fMC_EP_X_Y(original.fMC_EP_X_Y),
-  fMC_EP_OpeningAngle(original.fMC_EP_OpeningAngle),
-  fMC_E_Energy(original.fMC_E_Energy),
-  fMC_E_Pt(original.fMC_E_Pt),
-  fMC_E_Eta(original.fMC_E_Eta),
-  fMC_E_Phi(original.fMC_E_Phi),
-  fMC_P_Energy(original.fMC_P_Energy),
-  fMC_P_Pt(original.fMC_P_Pt),
-  fMC_P_Eta(original.fMC_P_Eta),
-  fMC_P_Phi(original.fMC_P_Phi),
-  fMC_Gamma_Energy(original.fMC_Gamma_Energy),
-  fMC_Gamma_Pt(original.fMC_Gamma_Pt),
-  fMC_Gamma_Eta(original.fMC_Gamma_Eta),
-  fMC_Gamma_Phi(original.fMC_Gamma_Phi),
-  fMC_DirectGamma_Energy(original.fMC_Gamma_Energy),
-  fMC_DirectGamma_Pt(original.fMC_Gamma_Pt),
-  fMC_DirectGamma_Eta(original.fMC_Gamma_Eta),
-  fMC_DirectGamma_Phi(original.fMC_Gamma_Phi),
-  fMC_Mapping(),
-  fMC_Mapping_Phi(),
-  fMC_Mapping_R(),
-  fMC_Match_Gamma_Eta(original.fMC_Match_Gamma_Eta),
-  fMC_Match_Gamma_Phi(original.fMC_Match_Gamma_Phi),
-  fMC_Match_Gamma_Pt(original.fMC_Match_Gamma_Pt),
-  fMC_Match_Gamma_Energy(original.fMC_Match_Gamma_Energy),
-  fMC_Match_Gamma_Mass(original.fMC_Match_Gamma_Mass),
-  fMC_Match_Gamma_OpeningAngle(original.fMC_Match_Gamma_OpeningAngle),
-  fMC_Match_Gamma_R(original.fMC_Match_Gamma_R),
-  fMC_Match_Gamma_Z_R(original.fMC_Match_Gamma_Z_R),
-  fMC_Match_Gamma_X_Y(original.fMC_Match_Gamma_X_Y),
-  fMC_Pi0_Eta(original.fMC_Pi0_Eta),
-  fMC_Pi0_Phi(original.fMC_Pi0_Phi),
-  fMC_Pi0_Pt(original.fMC_Pi0_Pt),
-  fMC_Pi0_Energy(original.fMC_Pi0_Energy),
-  fMC_Pi0_Mass(original.fMC_Pi0_Mass),
-  fMC_Pi0_OpeningAngleGamma(original.fMC_Pi0_OpeningAngleGamma),
-  fMC_Pi0_R(original.fMC_Pi0_R),
-  fMC_Pi0_Z_R(original.fMC_Pi0_Z_R),
-  fMC_Pi0_X_Y(original.fMC_Pi0_X_Y),
-  fMC_Pi0Secondaries_Eta(original.fMC_Pi0_Eta),
-  fMC_Pi0Secondaries_Phi(original.fMC_Pi0_Phi),
-  fMC_Pi0Secondaries_Pt(original.fMC_Pi0_Pt),
-  fMC_Pi0Secondaries_Energy(original.fMC_Pi0_Energy),
-  fMC_Pi0Secondaries_Mass(original.fMC_Pi0_Mass),
-  fMC_Pi0Secondaries_OpeningAngleGamma(original.fMC_Pi0_OpeningAngleGamma),
-  fMC_Pi0Secondaries_R(original.fMC_Pi0_R),
-  fMC_Pi0Secondaries_Z_R(original.fMC_Pi0_Z_R),
-  fMC_Pi0Secondaries_X_Y(original.fMC_Pi0Secondaries_X_Y),
-  fMC_Eta_Eta(original.fMC_Eta_Eta),
-  fMC_Eta_Phi(original.fMC_Eta_Phi),
-  fMC_Eta_Pt(original.fMC_Eta_Pt),
-  fMC_Eta_Energy(original.fMC_Eta_Energy),
-  fMC_Eta_Mass(original.fMC_Eta_Mass),
-  fMC_Eta_OpeningAngleGamma(original.fMC_Eta_OpeningAngleGamma),
-  fMC_Eta_R(original.fMC_Eta_R),
-  fMC_Eta_Z_R(original.fMC_Eta_Z_R),
-  fMC_Eta_X_Y(original.fMC_Eta_X_Y),
-  fESD_EP_R(original.fESD_EP_R),
-  fESD_EP_Z_R(original.fESD_EP_Z_R),
-  fESD_EP_X_Y(original.fESD_EP_X_Y),
-  fESD_EP_OpeningAngle(original.fESD_EP_OpeningAngle),
-  fESD_E_Energy(original.fESD_E_Energy),
-  fESD_E_Pt(original.fESD_E_Pt),
-  fESD_E_Eta(original.fESD_E_Eta),
-  fESD_E_Phi(original.fESD_E_Phi),
-  fESD_P_Energy(original.fESD_P_Energy),
-  fESD_P_Pt(original.fESD_P_Pt),
-  fESD_P_Eta(original.fESD_P_Eta),
-  fESD_P_Phi(original.fESD_P_Phi),
-  fESD_Gamma_Energy(original.fESD_Gamma_Energy),
-  fESD_Gamma_Pt(original.fESD_Gamma_Pt),
-  fESD_Gamma_Eta(original.fESD_Gamma_Eta),
-  fESD_Gamma_Phi(original.fESD_Gamma_Phi),
-  fESD_Mapping(original.fESD_Mapping),
-  fESD_Mapping_Phi(original.fESD_Mapping_Phi),
-  fESD_Mapping_R(original.fESD_Mapping_R),
-  fESD_Match_Gamma_OpeningAngle(original.fESD_Match_Gamma_OpeningAngle),
-  fESD_Match_Gamma_Energy(original.fESD_Match_Gamma_Energy),
-  fESD_Match_Gamma_Pt(original.fESD_Match_Gamma_Pt),
-  fESD_Match_Gamma_Eta(original.fESD_Match_Gamma_Eta),
-  fESD_Match_Gamma_Phi(original.fESD_Match_Gamma_Phi),
-  fESD_Match_Gamma_Mass(original.fESD_Match_Gamma_Mass),
-  fESD_Match_Gamma_Width(original.fESD_Match_Gamma_Width),
-  fESD_Match_Gamma_Chi2(original.fESD_Match_Gamma_Chi2),
-  fESD_Match_Gamma_NDF(original.fESD_Match_Gamma_NDF),
-  fESD_Match_Gamma_R(original.fESD_Match_Gamma_R),
-  fESD_Match_Gamma_Z_R(original.fESD_Match_Gamma_Z_R),
-  fESD_Match_Gamma_X_Y(original.fESD_Match_Gamma_X_Y),
-  fESD_Pi0_OpeningAngleGamma(original.fESD_Pi0_OpeningAngleGamma),
-  fESD_Pi0_Energy(original.fESD_Pi0_Energy),
-  fESD_Pi0_Pt(original.fESD_Pi0_Pt),
-  fESD_Pi0_Eta(original.fESD_Pi0_Eta),
-  fESD_Pi0_Phi(original.fESD_Pi0_Phi),
-  fESD_Pi0_Mass(original.fESD_Pi0_Mass),
-  fESD_Pi0_R(original.fESD_Pi0_R),
-  fESD_Pi0_Z_R(original.fESD_Pi0_Z_R),
-  fESD_Pi0_X_Y(original.fESD_Pi0_X_Y),
-  fESD_Eta_OpeningAngleGamma(original.fESD_Eta_OpeningAngleGamma),
-  fESD_Eta_Energy(original.fESD_Eta_Energy),
-  fESD_Eta_Pt(original.fESD_Eta_Pt),
-  fESD_Eta_Eta(original.fESD_Eta_Eta),
-  fESD_Eta_Phi(original.fESD_Eta_Phi),
-  fESD_Eta_Mass(original.fESD_Eta_Mass),
-  fESD_Eta_R(original.fESD_Eta_R),
-  fESD_Eta_Z_R(original.fESD_Eta_Z_R),
-  fESD_Eta_X_Y(original.fESD_Eta_X_Y),
-  fESD_Background_OpeningAngleGamma(original.fESD_Background_OpeningAngleGamma),
-  fESD_Background_Energy(original.fESD_Background_Energy),
-  fESD_Background_Pt(original.fESD_Background_Pt),
-  fESD_Background_Eta(original.fESD_Background_Eta),
-  fESD_Background_Phi(original.fESD_Background_Phi),
-  fESD_Background_Mass(original.fESD_Background_Mass),
-  fESD_Background_R(original.fESD_Background_R),
-  fESD_Background_Z_R(original.fESD_Background_Z_R),
-  fESD_Background_X_Y(original.fESD_Background_X_Y),
-  fResolution_dPt(original.fResolution_dPt),
-  fResolution_dR(original.fResolution_dR),
-  fResolution_dZ(original.fResolution_dZ),
-  fResolution_dR_dPt(original.fResolution_dR_dPt),
-  fResolution_MC_Pt(original.fResolution_MC_Pt),
-  fResolution_MC_R(original.fResolution_MC_R),
-  fResolution_MC_Z(original.fResolution_MC_Z),
-  fResolution_ESD_Pt(original.fResolution_ESD_Pt),
-  fResolution_ESD_R(original.fResolution_ESD_R),
-  fResolution_ESD_Z(original.fResolution_ESD_Z),
-  fNumberOfV0s(original.fNumberOfV0s),
-  fNumberOfSurvivingV0s(original.fNumberOfSurvivingV0s),
-  fV0MassDebugCut1(original.fV0MassDebugCut1),
-  fV0MassDebugCut2(original.fV0MassDebugCut2),
-  fV0MassDebugCut3(original.fV0MassDebugCut3),
-  fV0MassDebugCut4(original.fV0MassDebugCut4),
-  fV0MassDebugCut5(original.fV0MassDebugCut5),
-  fV0MassDebugCut6(original.fV0MassDebugCut6),
-  fV0MassDebugCut7(original.fV0MassDebugCut7),
-  fV0MassDebugCut8(original.fV0MassDebugCut8)
-{    
-
-}
-
-
-AliGammaConversionHistograms & AliGammaConversionHistograms::operator = (const AliGammaConversionHistograms & /*source*/)
-{
-  // assignment operator
-  return *this;
-}
-
-
-AliGammaConversionHistograms::~AliGammaConversionHistograms() {
-  if(fOutputContainer != NULL){ delete fOutputContainer;}
-
-  if(fMC_EP_R != NULL){ delete fMC_EP_R;}
-  if(fMC_EP_Z_R != NULL){ delete fMC_EP_Z_R;}
-  if(fMC_EP_X_Y != NULL){ delete fMC_EP_X_Y;}
-  if(fMC_EP_OpeningAngle != NULL){ delete fMC_EP_OpeningAngle;}
-
-  if(fMC_E_Energy != NULL){ delete fMC_E_Energy;}
-  if(fMC_E_Pt != NULL){ delete fMC_E_Pt;}
-  if(fMC_E_Eta != NULL){ delete fMC_E_Eta;}
-  if(fMC_E_Phi != NULL){ delete fMC_E_Phi;}
-
-  if(fMC_P_Energy != NULL){ delete fMC_P_Energy;}
-  if(fMC_P_Pt != NULL){ delete fMC_P_Pt;}
-  if(fMC_P_Eta != NULL){ delete fMC_P_Eta;}
-  if(fMC_P_Phi != NULL){ delete fMC_P_Phi;}
-
-  if(fMC_Gamma_Energy != NULL){ delete fMC_Gamma_Energy;}
-  if(fMC_Gamma_Pt != NULL){ delete fMC_Gamma_Pt;}
-  if(fMC_Gamma_Eta != NULL){ delete fMC_Gamma_Eta;}
-  if(fMC_Gamma_Phi != NULL){ delete fMC_Gamma_Phi;}
-
-  if(fMC_DirectGamma_Energy != NULL){ delete fMC_DirectGamma_Energy;}
-  if(fMC_DirectGamma_Pt != NULL){ delete fMC_DirectGamma_Pt;}
-  if(fMC_DirectGamma_Eta != NULL){ delete fMC_DirectGamma_Eta;}
-  if(fMC_DirectGamma_Phi != NULL){ delete fMC_DirectGamma_Phi;}
-
-  //mapping
-  for(UInt_t i=0;i<fMC_Mapping.size();i++){
-    for(UInt_t j=0;j<fMC_Mapping[i].size();j++){
-      if(fMC_Mapping[i][j] != NULL){delete fMC_Mapping[i][j];}
-      fMC_Mapping[i][j]=NULL;
-    }
-    fMC_Mapping[i].clear();
-  }
-  fMC_Mapping.clear();
-
-  for(UInt_t i=0;i<fMC_Mapping_Phi.size();i++){
-    if(fMC_Mapping_Phi[i] != NULL){delete fMC_Mapping_Phi[i];}
-    fMC_Mapping_Phi[i]=NULL;
-  }
-  fMC_Mapping_Phi.clear();
-
-  for(UInt_t i=0;i<fMC_Mapping_R.size();i++){
-    if(fMC_Mapping_R[i] != NULL){delete fMC_Mapping_R[i];}
-    fMC_Mapping_R[i]=NULL;
-  }
-  fMC_Mapping_R.clear();
-
-
-  if(fMC_Match_Gamma_Eta != NULL){ delete fMC_Match_Gamma_Eta;}
-  if(fMC_Match_Gamma_Phi != NULL){ delete fMC_Match_Gamma_Phi;}
-  if(fMC_Match_Gamma_Pt != NULL){ delete fMC_Match_Gamma_Pt;}
-  if(fMC_Match_Gamma_Energy != NULL){ delete fMC_Match_Gamma_Energy;}
-  if(fMC_Match_Gamma_Mass != NULL){ delete fMC_Match_Gamma_Mass;}
-  if(fMC_Match_Gamma_OpeningAngle != NULL){ delete fMC_Match_Gamma_OpeningAngle;}
-  if(fMC_Match_Gamma_R != NULL){ delete fMC_Match_Gamma_R;}
-  if(fMC_Match_Gamma_Z_R != NULL){ delete fMC_Match_Gamma_Z_R;}
-  if(fMC_Match_Gamma_X_Y != NULL){ delete fMC_Match_Gamma_X_Y;}
-
-  if(fMC_Pi0_Eta != NULL){ delete fMC_Pi0_Eta;}
-  if(fMC_Pi0_Phi != NULL){ delete fMC_Pi0_Phi;}
-  if(fMC_Pi0_Pt != NULL){ delete fMC_Pi0_Pt;}
-  if(fMC_Pi0_Energy != NULL){ delete fMC_Pi0_Energy;}
-  if(fMC_Pi0_Mass != NULL){ delete fMC_Pi0_Mass;}
-  if(fMC_Pi0_OpeningAngleGamma != NULL){ delete fMC_Pi0_OpeningAngleGamma;}
-  if(fMC_Pi0_R != NULL){ delete fMC_Pi0_R;}
-  if(fMC_Pi0_Z_R != NULL){ delete fMC_Pi0_Z_R;}
-  if(fMC_Pi0_X_Y != NULL){ delete fMC_Pi0_X_Y;}
-  if(fMC_Pi0Secondaries_X_Y != NULL){ delete fMC_Pi0Secondaries_X_Y;}
-
-  if(fMC_Eta_Eta != NULL){ delete fMC_Eta_Eta;}
-  if(fMC_Eta_Phi != NULL){ delete fMC_Eta_Phi;}
-  if(fMC_Eta_Pt != NULL){ delete fMC_Eta_Pt;}
-  if(fMC_Eta_Energy != NULL){ delete fMC_Eta_Energy;}
-  if(fMC_Eta_Mass != NULL){ delete fMC_Eta_Mass;}
-  if(fMC_Eta_OpeningAngleGamma != NULL){ delete fMC_Eta_OpeningAngleGamma;}
-  if(fMC_Eta_R != NULL){ delete fMC_Eta_R;}
-  if(fMC_Eta_Z_R != NULL){ delete fMC_Eta_Z_R;}
-  if(fMC_Eta_X_Y != NULL){ delete fMC_Eta_X_Y;}
-    
-  // Histograms from esd tracks
-  if(fESD_EP_R != NULL){ delete fESD_EP_R;}
-  if(fESD_EP_Z_R != NULL){ delete fESD_EP_Z_R;}
-  if(fESD_EP_X_Y != NULL){ delete fESD_EP_X_Y;}
-  if(fESD_EP_OpeningAngle != NULL){ delete fESD_EP_OpeningAngle;}
-
-  if(fESD_E_Energy != NULL){ delete fESD_E_Energy;}
-  if(fESD_E_Pt != NULL){ delete fESD_E_Pt;}
-  if(fESD_E_Eta != NULL){ delete fESD_E_Eta;}
-  if(fESD_E_Phi != NULL){ delete fESD_E_Phi;}
-
-  if(fESD_P_Energy != NULL){ delete fESD_P_Energy;}
-  if(fESD_P_Pt != NULL){ delete fESD_P_Pt;}
-  if(fESD_P_Eta != NULL){ delete fESD_P_Eta;}
-  if(fESD_P_Phi != NULL){ delete fESD_P_Phi;}
-
-  if(fESD_Gamma_Energy != NULL){ delete fESD_Gamma_Energy;}
-  if(fESD_Gamma_Pt != NULL){ delete fESD_Gamma_Pt;}
-  if(fESD_Gamma_Eta != NULL){ delete fESD_Gamma_Eta;}
-  if(fESD_Gamma_Phi != NULL){ delete fESD_Gamma_Phi;}
-
-  //mapping
-  for(UInt_t i=0;i<fESD_Mapping.size();i++){
-    for(UInt_t j=0;j<fESD_Mapping[i].size();j++){
-      if(fESD_Mapping[i][j] != NULL){delete fESD_Mapping[i][j];}
-      fESD_Mapping[i][j]=NULL;
-    }
-    fESD_Mapping[i].clear();
-  }
-  fESD_Mapping.clear();
-
-  for(UInt_t i=0;i<fESD_Mapping_Phi.size();i++){
-    if(fESD_Mapping_Phi[i] != NULL){delete fESD_Mapping_Phi[i];}
-    fESD_Mapping_Phi[i]=NULL;
-  }
-  fESD_Mapping_Phi.clear();
-
-  for(UInt_t i=0;i<fESD_Mapping_R.size();i++){
-    if(fESD_Mapping_R[i] != NULL){delete fESD_Mapping_R[i];}
-    fESD_Mapping_R[i]=NULL;
-  }
-  fESD_Mapping_R.clear();
-
-  if(fESD_Match_Gamma_OpeningAngle != NULL){ delete fESD_Match_Gamma_OpeningAngle;}
-  if(fESD_Match_Gamma_Energy != NULL){ delete fESD_Match_Gamma_Energy;}
-  if(fESD_Match_Gamma_Pt != NULL){ delete fESD_Match_Gamma_Pt;}
-  if(fESD_Match_Gamma_Eta != NULL){ delete fESD_Match_Gamma_Eta;}
-  if(fESD_Match_Gamma_Phi != NULL){ delete fESD_Match_Gamma_Phi;}
-  if(fESD_Match_Gamma_Mass != NULL){ delete fESD_Match_Gamma_Mass;}
-  if(fESD_Match_Gamma_Width != NULL){ delete fESD_Match_Gamma_Width;}
-  if(fESD_Match_Gamma_Chi2 != NULL){ delete fESD_Match_Gamma_Chi2;}
-  if(fESD_Match_Gamma_NDF != NULL){ delete fESD_Match_Gamma_NDF;}
-  if(fESD_Match_Gamma_R != NULL){ delete fESD_Match_Gamma_R;}
-  if(fESD_Match_Gamma_Z_R != NULL){ delete fESD_Match_Gamma_Z_R;}
-  if(fESD_Match_Gamma_X_Y != NULL){ delete fESD_Match_Gamma_X_Y;}
-
-  if(fESD_Pi0_OpeningAngleGamma != NULL){ delete fESD_Pi0_OpeningAngleGamma;}
-  if(fESD_Pi0_Energy != NULL){ delete fESD_Pi0_Energy;}
-  if(fESD_Pi0_Pt != NULL){ delete fESD_Pi0_Pt;}
-  if(fESD_Pi0_Eta != NULL){ delete fESD_Pi0_Eta;}
-  if(fESD_Pi0_Phi != NULL){ delete fESD_Pi0_Phi;}
-  if(fESD_Pi0_Mass != NULL){ delete fESD_Pi0_Mass;}
-  if(fESD_Pi0_R != NULL){ delete fESD_Pi0_R;}
-  if(fESD_Pi0_Z_R != NULL){ delete fESD_Pi0_Z_R;}
-  if(fESD_Pi0_X_Y != NULL){ delete fESD_Pi0_X_Y;}
-
-  if(fESD_Eta_OpeningAngleGamma != NULL){ delete fESD_Eta_OpeningAngleGamma;}
-  if(fESD_Eta_Energy != NULL){ delete fESD_Eta_Energy;}
-  if(fESD_Eta_Pt != NULL){ delete fESD_Eta_Pt;}
-  if(fESD_Eta_Eta != NULL){ delete fESD_Eta_Eta;}
-  if(fESD_Eta_Phi != NULL){ delete fESD_Eta_Phi;}
-  if(fESD_Eta_Mass != NULL){ delete fESD_Eta_Mass;}
-  if(fESD_Eta_R != NULL){ delete fESD_Eta_R;}
-  if(fESD_Eta_Z_R != NULL){ delete fESD_Eta_Z_R;}
-  if(fESD_Eta_X_Y != NULL){ delete fESD_Eta_X_Y;}
-
-  if(fESD_Background_OpeningAngleGamma != NULL){ delete fESD_Background_OpeningAngleGamma;}
-  if(fESD_Background_Energy != NULL){ delete fESD_Background_Energy;}
-  if(fESD_Background_Pt != NULL){ delete fESD_Background_Pt;}
-  if(fESD_Background_Eta != NULL){ delete fESD_Background_Eta;}
-  if(fESD_Background_Phi != NULL){ delete fESD_Background_Phi;}
-  if(fESD_Background_Mass != NULL){ delete fESD_Background_Mass;}
-  if(fESD_Background_R != NULL){ delete fESD_Background_R;}
-  if(fESD_Background_Z_R != NULL){ delete fESD_Background_Z_R;}
-  if(fESD_Background_X_Y != NULL){ delete fESD_Background_X_Y;}
-
-  if(fResolution_dPt != NULL){ delete fResolution_dPt;}
-  if(fResolution_dR != NULL){ delete fResolution_dR;}
-  if(fResolution_dZ != NULL){ delete fResolution_dZ;}
-  if(fResolution_dR_dPt != NULL){ delete fResolution_dR_dPt;}
-  if(fResolution_MC_Pt != NULL){ delete fResolution_MC_Pt;}
-  if(fResolution_MC_R != NULL){ delete fResolution_MC_R;}
-  if(fResolution_MC_Z != NULL){ delete fResolution_MC_Z;}
-  if(fResolution_ESD_Pt != NULL){ delete fResolution_ESD_Pt;}
-  if(fResolution_ESD_R != NULL){ delete fResolution_ESD_R;}
-  if(fResolution_ESD_Z != NULL){ delete fResolution_ESD_Z;}
-  
-  if(fNumberOfV0s != NULL){delete fNumberOfV0s;}
-  if(fNumberOfSurvivingV0s != NULL){delete fNumberOfSurvivingV0s;}
-  if(fV0MassDebugCut1 != NULL){delete fV0MassDebugCut1;}
-  if(fV0MassDebugCut2 != NULL){delete fV0MassDebugCut2;}
-  if(fV0MassDebugCut3 != NULL){delete fV0MassDebugCut3;}
-  if(fV0MassDebugCut4 != NULL){delete fV0MassDebugCut4;}
-  if(fV0MassDebugCut5 != NULL){delete fV0MassDebugCut5;}
-  if(fV0MassDebugCut6 != NULL){delete fV0MassDebugCut6;}
-  if(fV0MassDebugCut7 != NULL){delete fV0MassDebugCut7;}
-  if(fV0MassDebugCut8 != NULL){delete fV0MassDebugCut8;}
-
-}
-
-
-TList * AliGammaConversionHistograms::GetOutputContainer(){
-  //checking if the container is alrerady created
-  if(fOutputContainer != NULL){
-    delete fOutputContainer;
-    fOutputContainer=NULL;
-  }
-  fOutputContainer = new TList();
-  TList*  fMappingContainer = new TList();
-  fMappingContainer->SetName("Mapping Histograms");
-
-  if(fMC_EP_R != NULL){ fOutputContainer->Add(fMC_EP_R);}
-  if(fMC_EP_Z_R != NULL){ fOutputContainer->Add(fMC_EP_Z_R);}
-  if(fMC_EP_X_Y != NULL){ fOutputContainer->Add(fMC_EP_X_Y);}
-  if(fMC_EP_OpeningAngle != NULL){ fOutputContainer->Add(fMC_EP_OpeningAngle);}
-
-  if(fMC_E_Energy != NULL){ fOutputContainer->Add(fMC_E_Energy);}
-  if(fMC_E_Pt != NULL){ fOutputContainer->Add(fMC_E_Pt);}
-  if(fMC_E_Eta != NULL){ fOutputContainer->Add(fMC_E_Eta);}
-  if(fMC_E_Phi != NULL){ fOutputContainer->Add(fMC_E_Phi);}
-
-  if(fMC_P_Energy != NULL){ fOutputContainer->Add(fMC_P_Energy);}
-  if(fMC_P_Pt != NULL){ fOutputContainer->Add(fMC_P_Pt);}
-  if(fMC_P_Eta != NULL){ fOutputContainer->Add(fMC_P_Eta);}
-  if(fMC_P_Phi != NULL){ fOutputContainer->Add(fMC_P_Phi);}
-
-  if(fMC_Gamma_Energy != NULL){ fOutputContainer->Add(fMC_Gamma_Energy);}
-  if(fMC_Gamma_Pt != NULL){ fOutputContainer->Add(fMC_Gamma_Pt);}
-  if(fMC_Gamma_Eta != NULL){ fOutputContainer->Add(fMC_Gamma_Eta);}
-  if(fMC_Gamma_Phi != NULL){ fOutputContainer->Add(fMC_Gamma_Phi);}
-
-  if(fMC_DirectGamma_Energy != NULL){ fOutputContainer->Add(fMC_DirectGamma_Energy);}
-  if(fMC_DirectGamma_Pt != NULL){ fOutputContainer->Add(fMC_DirectGamma_Pt);}
-  if(fMC_DirectGamma_Eta != NULL){ fOutputContainer->Add(fMC_DirectGamma_Eta);}
-  if(fMC_DirectGamma_Phi != NULL){ fOutputContainer->Add(fMC_DirectGamma_Phi);}
-
-  //mapping
-  for(UInt_t i=0;i<fMC_Mapping.size();i++){
-    for(UInt_t j=0;j<fMC_Mapping[i].size();j++){
-      if(fMC_Mapping[i][j] != NULL){fMappingContainer->Add(fMC_Mapping[i][j]);}
-    }
-  }
-  for(UInt_t i=0;i<fMC_Mapping_Phi.size();i++){
-    if(fMC_Mapping_Phi[i] != NULL){fMappingContainer->Add(fMC_Mapping_Phi[i]);}
-  }
-  for(UInt_t i=0;i<fMC_Mapping_R.size();i++){
-    if(fMC_Mapping_R[i] != NULL){fMappingContainer->Add(fMC_Mapping_R[i]);}
-  }
-  if(fMC_Match_Gamma_Eta != NULL){ fOutputContainer->Add(fMC_Match_Gamma_Eta);}
-  if(fMC_Match_Gamma_Phi != NULL){ fOutputContainer->Add(fMC_Match_Gamma_Phi);}
-  if(fMC_Match_Gamma_Pt != NULL){ fOutputContainer->Add(fMC_Match_Gamma_Pt);}
-  if(fMC_Match_Gamma_Energy != NULL){ fOutputContainer->Add(fMC_Match_Gamma_Energy);}
-  if(fMC_Match_Gamma_Mass != NULL){ fOutputContainer->Add(fMC_Match_Gamma_Mass);}
-  if(fMC_Match_Gamma_OpeningAngle != NULL){ fOutputContainer->Add(fMC_Match_Gamma_OpeningAngle);}
-  if(fMC_Match_Gamma_R != NULL){ fOutputContainer->Add(fMC_Match_Gamma_R);}
-  if(fMC_Match_Gamma_Z_R != NULL){ fOutputContainer->Add(fMC_Match_Gamma_Z_R);}
-  if(fMC_Match_Gamma_X_Y != NULL){ fOutputContainer->Add(fMC_Match_Gamma_X_Y);}
-
-  if(fMC_Pi0_Eta != NULL){ fOutputContainer->Add(fMC_Pi0_Eta);}
-  if(fMC_Pi0_Phi != NULL){ fOutputContainer->Add(fMC_Pi0_Phi);}
-  if(fMC_Pi0_Pt != NULL){ fOutputContainer->Add(fMC_Pi0_Pt);}
-  if(fMC_Pi0_Energy != NULL){ fOutputContainer->Add(fMC_Pi0_Energy);}
-  if(fMC_Pi0_Mass != NULL){ fOutputContainer->Add(fMC_Pi0_Mass);}
-  if(fMC_Pi0_OpeningAngleGamma != NULL){ fOutputContainer->Add(fMC_Pi0_OpeningAngleGamma);}
-  if(fMC_Pi0_R != NULL){ fOutputContainer->Add(fMC_Pi0_R);}
-  if(fMC_Pi0_Z_R != NULL){ fOutputContainer->Add(fMC_Pi0_Z_R);}
-  if(fMC_Pi0_X_Y != NULL){ fOutputContainer->Add(fMC_Pi0_X_Y);}
-  if(fMC_Pi0Secondaries_X_Y != NULL){ fOutputContainer->Add(fMC_Pi0Secondaries_X_Y);}
-
-  if(fMC_Eta_Eta != NULL){ fOutputContainer->Add(fMC_Eta_Eta);}
-  if(fMC_Eta_Phi != NULL){ fOutputContainer->Add(fMC_Eta_Phi);}
-  if(fMC_Eta_Pt != NULL){ fOutputContainer->Add(fMC_Eta_Pt);}
-  if(fMC_Eta_Energy != NULL){ fOutputContainer->Add(fMC_Eta_Energy);}
-  if(fMC_Eta_Mass != NULL){ fOutputContainer->Add(fMC_Eta_Mass);}
-  if(fMC_Eta_OpeningAngleGamma != NULL){ fOutputContainer->Add(fMC_Eta_OpeningAngleGamma);}
-  if(fMC_Eta_R != NULL){ fOutputContainer->Add(fMC_Eta_R);}
-  if(fMC_Eta_Z_R != NULL){ fOutputContainer->Add(fMC_Eta_Z_R);}
-  if(fMC_Eta_X_Y != NULL){ fOutputContainer->Add(fMC_Eta_X_Y);}
-    
-  // Histograms from esd tracks
-  if(fESD_EP_R != NULL){ fOutputContainer->Add(fESD_EP_R);}
-  if(fESD_EP_Z_R != NULL){ fOutputContainer->Add(fESD_EP_Z_R);}
-  if(fESD_EP_X_Y != NULL){ fOutputContainer->Add(fESD_EP_X_Y);}
-  if(fESD_EP_OpeningAngle != NULL){ fOutputContainer->Add(fESD_EP_OpeningAngle);}
-
-  if(fESD_E_Energy != NULL){ fOutputContainer->Add(fESD_E_Energy);}
-  if(fESD_E_Pt != NULL){ fOutputContainer->Add(fESD_E_Pt);}
-  if(fESD_E_Eta != NULL){ fOutputContainer->Add(fESD_E_Eta);}
-  if(fESD_E_Phi != NULL){ fOutputContainer->Add(fESD_E_Phi);}
-
-  if(fESD_P_Energy != NULL){ fOutputContainer->Add(fESD_P_Energy);}
-  if(fESD_P_Pt != NULL){ fOutputContainer->Add(fESD_P_Pt);}
-  if(fESD_P_Eta != NULL){ fOutputContainer->Add(fESD_P_Eta);}
-  if(fESD_P_Phi != NULL){ fOutputContainer->Add(fESD_P_Phi);}
-
-  if(fESD_Gamma_Energy != NULL){ fOutputContainer->Add(fESD_Gamma_Energy);}
-  if(fESD_Gamma_Pt != NULL){ fOutputContainer->Add(fESD_Gamma_Pt);}
-  if(fESD_Gamma_Eta != NULL){ fOutputContainer->Add(fESD_Gamma_Eta);}
-  if(fESD_Gamma_Phi != NULL){ fOutputContainer->Add(fESD_Gamma_Phi);}
-
-  //mapping
-  for(UInt_t i=0;i<fESD_Mapping.size();i++){
-    for(UInt_t j=0;j<fESD_Mapping[i].size();j++){
-      if(fESD_Mapping[i][j] != NULL){fMappingContainer->Add(fESD_Mapping[i][j]);}
-    }
-  }
-  for(UInt_t i=0;i<fESD_Mapping_Phi.size();i++){
-    if(fESD_Mapping_Phi[i] != NULL){fMappingContainer->Add(fESD_Mapping_Phi[i]);}
-  }
-  for(UInt_t i=0;i<fESD_Mapping_R.size();i++){
-    if(fESD_Mapping_R[i] != NULL){fMappingContainer->Add(fESD_Mapping_R[i]);}
-  }
-
-  fOutputContainer->Add(fMappingContainer);
-
-  if(fESD_Match_Gamma_OpeningAngle != NULL){ fOutputContainer->Add(fESD_Match_Gamma_OpeningAngle);}
-  if(fESD_Match_Gamma_Energy != NULL){ fOutputContainer->Add(fESD_Match_Gamma_Energy);}
-  if(fESD_Match_Gamma_Pt != NULL){ fOutputContainer->Add(fESD_Match_Gamma_Pt);}
-  if(fESD_Match_Gamma_Eta != NULL){ fOutputContainer->Add(fESD_Match_Gamma_Eta);}
-  if(fESD_Match_Gamma_Phi != NULL){ fOutputContainer->Add(fESD_Match_Gamma_Phi);}
-  if(fESD_Match_Gamma_Mass != NULL){ fOutputContainer->Add(fESD_Match_Gamma_Mass);}
-  if(fESD_Match_Gamma_Width != NULL){ fOutputContainer->Add(fESD_Match_Gamma_Width);}
-  if(fESD_Match_Gamma_Chi2 != NULL){ fOutputContainer->Add(fESD_Match_Gamma_Chi2);}
-  if(fESD_Match_Gamma_NDF != NULL){ fOutputContainer->Add(fESD_Match_Gamma_NDF);}
-  if(fESD_Match_Gamma_R != NULL){ fOutputContainer->Add(fESD_Match_Gamma_R);}
-  if(fESD_Match_Gamma_Z_R != NULL){ fOutputContainer->Add(fESD_Match_Gamma_Z_R);}
-  if(fESD_Match_Gamma_X_Y != NULL){ fOutputContainer->Add(fESD_Match_Gamma_X_Y);}
-
-  if(fESD_Pi0_OpeningAngleGamma != NULL){ fOutputContainer->Add(fESD_Pi0_OpeningAngleGamma);}
-  if(fESD_Pi0_Energy != NULL){ fOutputContainer->Add(fESD_Pi0_Energy);}
-  if(fESD_Pi0_Pt != NULL){ fOutputContainer->Add(fESD_Pi0_Pt);}
-  if(fESD_Pi0_Eta != NULL){ fOutputContainer->Add(fESD_Pi0_Eta);}
-  if(fESD_Pi0_Phi != NULL){ fOutputContainer->Add(fESD_Pi0_Phi);}
-  if(fESD_Pi0_Mass != NULL){ fOutputContainer->Add(fESD_Pi0_Mass);}
-  if(fESD_Pi0_R != NULL){ fOutputContainer->Add(fESD_Pi0_R);}
-  if(fESD_Pi0_Z_R != NULL){ fOutputContainer->Add(fESD_Pi0_Z_R);}
-  if(fESD_Pi0_X_Y != NULL){ fOutputContainer->Add(fESD_Pi0_X_Y);}
-
-  if(fESD_Eta_OpeningAngleGamma != NULL){ fOutputContainer->Add(fESD_Eta_OpeningAngleGamma);}
-  if(fESD_Eta_Energy != NULL){ fOutputContainer->Add(fESD_Eta_Energy);}
-  if(fESD_Eta_Pt != NULL){ fOutputContainer->Add(fESD_Eta_Pt);}
-  if(fESD_Eta_Eta != NULL){ fOutputContainer->Add(fESD_Eta_Eta);}
-  if(fESD_Eta_Phi != NULL){ fOutputContainer->Add(fESD_Eta_Phi);}
-  if(fESD_Eta_Mass != NULL){ fOutputContainer->Add(fESD_Eta_Mass);}
-  if(fESD_Eta_R != NULL){ fOutputContainer->Add(fESD_Eta_R);}
-  if(fESD_Eta_Z_R != NULL){ fOutputContainer->Add(fESD_Eta_Z_R);}
-  if(fESD_Eta_X_Y != NULL){ fOutputContainer->Add(fESD_Eta_X_Y);}
-
-  if(fESD_Background_OpeningAngleGamma != NULL){ fOutputContainer->Add(fESD_Background_OpeningAngleGamma);}
-  if(fESD_Background_Energy != NULL){ fOutputContainer->Add(fESD_Background_Energy);}
-  if(fESD_Background_Pt != NULL){ fOutputContainer->Add(fESD_Background_Pt);}
-  if(fESD_Background_Eta != NULL){ fOutputContainer->Add(fESD_Background_Eta);}
-  if(fESD_Background_Phi != NULL){ fOutputContainer->Add(fESD_Background_Phi);}
-  if(fESD_Background_Mass != NULL){ fOutputContainer->Add(fESD_Background_Mass);}
-  if(fESD_Background_R != NULL){ fOutputContainer->Add(fESD_Background_R);}
-  if(fESD_Background_Z_R != NULL){ fOutputContainer->Add(fESD_Background_Z_R);}
-  if(fESD_Background_X_Y != NULL){ fOutputContainer->Add(fESD_Background_X_Y);}
-
-  if(fResolution_dPt != NULL){ fOutputContainer->Add(fResolution_dPt);}
-  if(fResolution_dR != NULL){ fOutputContainer->Add(fResolution_dR);}
-  if(fResolution_dZ != NULL){ fOutputContainer->Add(fResolution_dZ);}
-  if(fResolution_dR_dPt != NULL){ fOutputContainer->Add(fResolution_dR_dPt);}
-  if(fResolution_MC_Pt != NULL){ fOutputContainer->Add(fResolution_MC_Pt);}
-  if(fResolution_MC_R != NULL){ fOutputContainer->Add(fResolution_MC_R);}
-  if(fResolution_MC_Z != NULL){ fOutputContainer->Add(fResolution_MC_Z);}
-  if(fResolution_ESD_Pt != NULL){ fOutputContainer->Add(fResolution_ESD_Pt);}
-  if(fResolution_ESD_R != NULL){ fOutputContainer->Add(fResolution_ESD_R);}
-  if(fResolution_ESD_Z != NULL){ fOutputContainer->Add(fResolution_ESD_Z);}
-
-  if(fNumberOfV0s != NULL){fOutputContainer->Add(fNumberOfV0s);}
-  if(fNumberOfSurvivingV0s != NULL){fOutputContainer->Add(fNumberOfSurvivingV0s);}
-  if(fV0MassDebugCut1 != NULL){fOutputContainer->Add(fV0MassDebugCut1);}
-  if(fV0MassDebugCut2 != NULL){fOutputContainer->Add(fV0MassDebugCut2);}
-  if(fV0MassDebugCut3 != NULL){fOutputContainer->Add(fV0MassDebugCut3);}
-  if(fV0MassDebugCut4 != NULL){fOutputContainer->Add(fV0MassDebugCut4);}
-  if(fV0MassDebugCut5 != NULL){fOutputContainer->Add(fV0MassDebugCut5);}
-  if(fV0MassDebugCut6 != NULL){fOutputContainer->Add(fV0MassDebugCut6);}
-  if(fV0MassDebugCut7 != NULL){fOutputContainer->Add(fV0MassDebugCut7);}
-  if(fV0MassDebugCut8 != NULL){fOutputContainer->Add(fV0MassDebugCut8);}
-
-  return fOutputContainer;
-}
-
-Int_t AliGammaConversionHistograms::GetRBin(Double_t radius){
-  Int_t iResult=0;
-  if(fDeltaR>0){
-    iResult = (Int_t)((radius - fMinRadius)/fDeltaR);
-  }
-  return iResult;
-}
-
-Int_t AliGammaConversionHistograms::GetPhiBin(Double_t phi){
-  Int_t iResult=0;
-  if(fDeltaPhi>0){
-    if(phi>TMath::Pi()){
-      phi-=2*TMath::Pi();
-    }
-    iResult = (Int_t)((phi - fMinPhi)/fDeltaPhi);
-  }
-  return iResult;
-}
-
-
-
-// Initializing the valuse for the mapping
-void AliGammaConversionHistograms::Initialize_MappingValues(Int_t nPhiIndex, Int_t nRIndex, Int_t nBinsR, Double_t minRadius, Double_t maxRadius,Int_t nBinsPhi, Double_t minPhi, Double_t maxPhi){
-  fNPhiIndex = nPhiIndex;
-  fNRIndex   = nRIndex;
-  fMinRadius      = minRadius;
-  fMaxRadius      = maxRadius;
-  if(nBinsR>0){
-    fDeltaR       = (fMaxRadius - fMinRadius)/nRIndex;
-  }
-  fMinPhi         = minPhi;
-  fMaxPhi         = maxPhi;
-  if(nBinsPhi>0){
-    fDeltaPhi     = (fMaxPhi-fMinPhi)/nPhiIndex;
-  }
-}
-
-//Initializing functions for the histograms
-void AliGammaConversionHistograms::Initialize_MC_EP_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_EP_R = new TH1F("MC_EP_R", "", nXBins, firstX, lastX);
-  fMC_EP_R->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_EP_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_EP_Z_R(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fMC_EP_Z_R = new TH2F("MC_EP_Z_R", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fMC_EP_Z_R->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_EP_Z_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_EP_X_Y(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fMC_EP_X_Y = new TH2F("MC_EP_X_Y", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fMC_EP_X_Y->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_EP_X_Y->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_EP_OpeningAngle(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_EP_OpeningAngle = new TH1F("MC_EP_OpeningAngle", "", nXBins, firstX, lastX);
-  fMC_EP_OpeningAngle->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_EP_OpeningAngle->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_E_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_E_Energy = new TH1F("MC_E_Energy", "", nXBins, firstX, lastX);
-  fMC_E_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_E_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_E_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_E_Pt = new TH1F("MC_E_Pt", "", nXBins, firstX, lastX);
-  fMC_E_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_E_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_E_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_E_Eta = new TH1F("MC_E_Eta", "", nXBins, firstX, lastX);
-  fMC_E_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_E_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_E_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_E_Phi = new TH1F("MC_E_Phi", "", nXBins, firstX, lastX);
-  fMC_E_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_E_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_P_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_P_Energy = new TH1F("MC_P_Energy", "", nXBins, firstX, lastX);
-  fMC_P_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_P_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_P_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_P_Pt = new TH1F("MC_P_Pt", "", nXBins, firstX, lastX);
-  fMC_P_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_P_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_P_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_P_Eta = new TH1F("MC_P_Eta", "", nXBins, firstX, lastX);
-  fMC_P_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_P_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_P_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_P_Phi = new TH1F("MC_P_Phi", "", nXBins, firstX, lastX);
-  fMC_P_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_P_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Gamma_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Gamma_Energy = new TH1F("MC_Gamma_Energy", "", nXBins, firstX, lastX);
-  fMC_Gamma_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Gamma_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Gamma_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Gamma_Pt = new TH1F("MC_Gamma_Pt", "", nXBins, firstX, lastX);
-  fMC_Gamma_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Gamma_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Gamma_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Gamma_Eta = new TH1F("MC_Gamma_Eta", "", nXBins, firstX, lastX);
-  fMC_Gamma_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Gamma_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Gamma_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Gamma_Phi = new TH1F("MC_Gamma_Phi", "", nXBins, firstX, lastX);
-  fMC_Gamma_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Gamma_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_DirectGamma_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_DirectGamma_Energy = new TH1F("MC_DirectGamma_Energy", "", nXBins, firstX, lastX);
-  fMC_DirectGamma_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_DirectGamma_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_DirectGamma_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_DirectGamma_Pt = new TH1F("MC_DirectGamma_Pt", "", nXBins, firstX, lastX);
-  fMC_DirectGamma_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_DirectGamma_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_DirectGamma_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_DirectGamma_Eta = new TH1F("MC_DirectGamma_Eta", "", nXBins, firstX, lastX);
-  fMC_DirectGamma_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_DirectGamma_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_DirectGamma_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_DirectGamma_Phi = new TH1F("MC_DirectGamma_Phi", "", nXBins, firstX, lastX);
-  fMC_DirectGamma_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_DirectGamma_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-//mapping
-
-
-void AliGammaConversionHistograms::Initialize_MappingHistograms(Int_t nPhiIndex, Int_t nRIndex,Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  
-  for(Int_t phi =0; phi<=fNPhiIndex;phi++){
-    AliConversionMappingVector tmpRowMC;
-    AliConversionMappingVector tmpRowESD;
-    for(Int_t r =0; r<fNRIndex;r++){
-      //MC
-      Char_t nameMC[100];
-      sprintf(nameMC,"MC_EP_Mapping-Phi%02d-R%02d",phi,r);
-      TH2F * tmpMC = new TH2F(nameMC,nameMC,nXBins,firstX,lastX,nYBins,firstY,lastY);
-      tmpMC->SetXTitle(xAxisTitle);
-      tmpMC->SetYTitle(yAxisTitle);
-      tmpRowMC.push_back(tmpMC);
-      //ESD
-      Char_t nameESD[100];
-      sprintf(nameESD,"ESD_EP_Mapping-Phi%02d-R%02d",phi,r);
-      TH2F * tmpESD = new TH2F(nameESD,nameESD,nXBins,firstX,lastX,nYBins,firstY,lastY);
-      tmpESD->SetXTitle(xAxisTitle);
-      tmpESD->SetYTitle(yAxisTitle);
-      tmpRowESD.push_back(tmpESD);
-    }
-    fMC_Mapping.push_back(tmpRowMC);
-    fESD_Mapping.push_back(tmpRowESD);
-  }
-
-  for(Int_t phi =0; phi<=nPhiIndex;phi++){ 
-    //MC
-    Char_t nameMC[100];
-    sprintf(nameMC,"MC_EP_Mapping-Phi%02d",phi);
-    TH2F * tmpMC = new TH2F(nameMC,nameMC,nXBins,firstX,lastX,nYBins,firstY,lastY);
-    tmpMC->SetXTitle(xAxisTitle);
-    tmpMC->SetYTitle(yAxisTitle);
-    fMC_Mapping_Phi.push_back(tmpMC);
-    //ESD
-    Char_t nameESD[100];
-    sprintf(nameESD,"ESD_EP_Mapping-Phi%02d",phi);
-    TH2F * tmpESD = new TH2F(nameESD,nameESD,nXBins,firstX,lastX,nYBins,firstY,lastY);
-    tmpESD->SetXTitle(xAxisTitle);
-    tmpESD->SetYTitle(yAxisTitle);
-    fESD_Mapping_Phi.push_back(tmpESD);   
-  }
-  for(Int_t r =0; r<=nRIndex;r++){
-    //MC
-    Char_t nameMC[100];
-    sprintf(nameMC,"MC_EP_Mapping-R%02d",r);
-    TH2F * tmpMC = new TH2F(nameMC,nameMC,nXBins,firstX,lastX,nYBins,firstY,lastY);
-    tmpMC->SetXTitle(xAxisTitle);
-    tmpMC->SetYTitle(yAxisTitle);
-    fMC_Mapping_R.push_back(tmpMC);
-    //ESD
-    Char_t nameESD[100];
-    sprintf(nameESD,"ESD_EP_Mapping-R%02d",r);
-    TH2F * tmpESD = new TH2F(nameESD,nameESD,nXBins,firstX,lastX,nYBins,firstY,lastY);
-    tmpESD->SetXTitle(xAxisTitle);
-    tmpESD->SetYTitle(yAxisTitle);
-    fESD_Mapping_R.push_back(tmpESD);
-  }
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Match_Gamma_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Match_Gamma_Eta = new TH1F("MC_Match_Gamma_Eta", "", nXBins, firstX, lastX);
-  fMC_Match_Gamma_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Match_Gamma_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Match_Gamma_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Match_Gamma_Phi = new TH1F("MC_Match_Gamma_Phi", "", nXBins, firstX, lastX);
-  fMC_Match_Gamma_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Match_Gamma_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Match_Gamma_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Match_Gamma_Pt = new TH1F("MC_Match_Gamma_Pt", "", nXBins, firstX, lastX);
-  fMC_Match_Gamma_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Match_Gamma_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Match_Gamma_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Match_Gamma_Energy = new TH1F("MC_Match_Gamma_Energy", "", nXBins, firstX, lastX);
-  fMC_Match_Gamma_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Match_Gamma_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Match_Gamma_Mass(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Match_Gamma_Mass = new TH1F("MC_Match_Gamma_Mass", "", nXBins, firstX, lastX);
-  fMC_Match_Gamma_Mass->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Match_Gamma_Mass->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Match_Gamma_OpeningAngle(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Match_Gamma_OpeningAngle = new TH1F("MC_Match_Gamma_OpeningAngle", "", nXBins, firstX, lastX);
-  fMC_Match_Gamma_OpeningAngle->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Match_Gamma_OpeningAngle->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Match_Gamma_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Match_Gamma_R = new TH1F("MC_Match_Gamma_R", "", nXBins, firstX, lastX);
-  fMC_Match_Gamma_R->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Match_Gamma_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Match_Gamma_Z_R(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fMC_Match_Gamma_Z_R = new TH2F("MC_Match_Gamma_Z_R", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fMC_Match_Gamma_Z_R->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Match_Gamma_Z_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Match_Gamma_X_Y(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fMC_Match_Gamma_X_Y = new TH2F("MC_Match_Gamma_X_Y", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fMC_Match_Gamma_X_Y->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Match_Gamma_X_Y->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Pi0_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Pi0_Eta = new TH1F("MC_Pi0_Eta", "", nXBins, firstX, lastX);
-  fMC_Pi0_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Pi0_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Pi0_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Pi0_Phi = new TH1F("MC_Pi0_Phi", "", nXBins, firstX, lastX);
-  fMC_Pi0_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Pi0_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Pi0_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Pi0_Pt = new TH1F("MC_Pi0_Pt", "", nXBins, firstX, lastX);
-  fMC_Pi0_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Pi0_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Pi0_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Pi0_Energy = new TH1F("MC_Pi0_Energy", "", nXBins, firstX, lastX);
-  fMC_Pi0_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Pi0_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Pi0_Mass(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Pi0_Mass = new TH1F("MC_Pi0_Mass", "", nXBins, firstX, lastX);
-  fMC_Pi0_Mass->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Pi0_Mass->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Pi0_OpeningAngleGamma(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Pi0_OpeningAngleGamma = new TH1F("MC_Pi0_OpeningAngleGamma", "", nXBins, firstX, lastX);
-  fMC_Pi0_OpeningAngleGamma->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Pi0_OpeningAngleGamma->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Pi0_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Pi0_R = new TH1F("MC_Pi0_R", "", nXBins, firstX, lastX);
-  fMC_Pi0_R->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Pi0_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Pi0_Z_R(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fMC_Pi0_Z_R = new TH2F("MC_Pi0_Z_R", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fMC_Pi0_Z_R->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Pi0_Z_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Pi0_X_Y(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fMC_Pi0_X_Y = new TH2F("MC_Pi0_X_Y", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fMC_Pi0_X_Y->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Pi0_X_Y->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Pi0Secondaries_X_Y(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fMC_Pi0Secondaries_X_Y = new TH2F("MC_Pi0Secondaries_X_Y", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fMC_Pi0Secondaries_X_Y->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Pi0Secondaries_X_Y->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Eta_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Eta_Eta = new TH1F("MC_Eta_Eta", "", nXBins, firstX, lastX);
-  fMC_Eta_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Eta_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Eta_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Eta_Phi = new TH1F("MC_Eta_Phi", "", nXBins, firstX, lastX);
-  fMC_Eta_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Eta_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Eta_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Eta_Pt = new TH1F("MC_Eta_Pt", "", nXBins, firstX, lastX);
-  fMC_Eta_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Eta_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Eta_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Eta_Energy = new TH1F("MC_Eta_Energy", "", nXBins, firstX, lastX);
-  fMC_Eta_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Eta_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Eta_Mass(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Eta_Mass = new TH1F("MC_Eta_Mass", "", nXBins, firstX, lastX);
-  fMC_Eta_Mass->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Eta_Mass->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Eta_OpeningAngleGamma(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Eta_OpeningAngleGamma = new TH1F("MC_Eta_OpeningAngleGamma", "", nXBins, firstX, lastX);
-  fMC_Eta_OpeningAngleGamma->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Eta_OpeningAngleGamma->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Eta_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fMC_Eta_R = new TH1F("MC_Eta_R", "", nXBins, firstX, lastX);
-  fMC_Eta_R->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Eta_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Eta_Z_R(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fMC_Eta_Z_R = new TH2F("MC_Eta_Z_R", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fMC_Eta_Z_R->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Eta_Z_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_MC_Eta_X_Y(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fMC_Eta_X_Y = new TH2F("MC_Eta_X_Y", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fMC_Eta_X_Y->GetXaxis()->SetTitle(xAxisTitle);
-  fMC_Eta_X_Y->GetYaxis()->SetTitle(yAxisTitle);
-}   
-// esd
-
-void AliGammaConversionHistograms::Initialize_ESD_EP_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_EP_R = new TH1F("ESD_EP_R", "", nXBins, firstX, lastX);
-  fESD_EP_R->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_EP_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_EP_Z_R(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fESD_EP_Z_R = new TH2F("ESD_EP_Z_R", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fESD_EP_Z_R->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_EP_Z_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_EP_X_Y(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fESD_EP_X_Y = new TH2F("ESD_EP_X_Y", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fESD_EP_X_Y->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_EP_X_Y->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_EP_OpeningAngle(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_EP_OpeningAngle = new TH1F("ESD_EP_OpeningAngle", "", nXBins, firstX, lastX);
-  fESD_EP_OpeningAngle->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_EP_OpeningAngle->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_E_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_E_Energy = new TH1F("ESD_E_Energy", "", nXBins, firstX, lastX);
-  fESD_E_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_E_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_E_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_E_Pt = new TH1F("ESD_E_Pt", "", nXBins, firstX, lastX);
-  fESD_E_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_E_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_E_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_E_Eta = new TH1F("ESD_E_Eta", "", nXBins, firstX, lastX);
-  fESD_E_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_E_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_E_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_E_Phi = new TH1F("ESD_E_Phi", "", nXBins, firstX, lastX);
-  fESD_E_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_E_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_P_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_P_Energy = new TH1F("ESD_P_Energy", "", nXBins, firstX, lastX);
-  fESD_P_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_P_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_P_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_P_Pt = new TH1F("ESD_P_Pt", "", nXBins, firstX, lastX);
-  fESD_P_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_P_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_P_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_P_Eta = new TH1F("ESD_P_Eta", "", nXBins, firstX, lastX);
-  fESD_P_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_P_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_P_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_P_Phi = new TH1F("ESD_P_Phi", "", nXBins, firstX, lastX);
-  fESD_P_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_P_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Gamma_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Gamma_Energy = new TH1F("ESD_Gamma_Energy", "", nXBins, firstX, lastX);
-  fESD_Gamma_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Gamma_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Gamma_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Gamma_Pt = new TH1F("ESD_Gamma_Pt", "", nXBins, firstX, lastX);
-  fESD_Gamma_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Gamma_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Gamma_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Gamma_Eta = new TH1F("ESD_Gamma_Eta", "", nXBins, firstX, lastX);
-  fESD_Gamma_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Gamma_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Gamma_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Gamma_Phi = new TH1F("ESD_Gamma_Phi", "", nXBins, firstX, lastX);
-  fESD_Gamma_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Gamma_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_OpeningAngle(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_OpeningAngle = new TH1F("ESD_Match_Gamma_OpeningAngle", "", nXBins, firstX, lastX);
-  fESD_Match_Gamma_OpeningAngle->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_OpeningAngle->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_Energy = new TH1F("ESD_Match_Gamma_Energy", "", nXBins, firstX, lastX);
-  fESD_Match_Gamma_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_Pt = new TH1F("ESD_Match_Gamma_Pt", "", nXBins, firstX, lastX);
-  fESD_Match_Gamma_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_Eta = new TH1F("ESD_Match_Gamma_Eta", "", nXBins, firstX, lastX);
-  fESD_Match_Gamma_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_Phi = new TH1F("ESD_Match_Gamma_Phi", "", nXBins, firstX, lastX);
-  fESD_Match_Gamma_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_Mass(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_Mass = new TH1F("ESD_Match_Gamma_Mass", "", nXBins, firstX, lastX);
-  fESD_Match_Gamma_Mass->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_Mass->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_Width(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_Width = new TH1F("ESD_Match_Gamma_Width", "", nXBins, firstX, lastX);
-  fESD_Match_Gamma_Width->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_Width->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_Chi2(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_Chi2 = new TH1F("ESD_Match_Gamma_Chi2", "", nXBins, firstX, lastX);
-  fESD_Match_Gamma_Chi2->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_Chi2->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_NDF(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_NDF = new TH1F("ESD_Match_Gamma_NDF", "", nXBins, firstX, lastX);
-  fESD_Match_Gamma_NDF->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_NDF->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_R = new TH1F("ESD_Match_Gamma_R", "", nXBins, firstX, lastX);
-  fESD_Match_Gamma_R->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_Z_R(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_Z_R = new TH2F("ESD_Match_Gamma_Z_R", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fESD_Match_Gamma_Z_R->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_Z_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Match_Gamma_X_Y(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fESD_Match_Gamma_X_Y = new TH2F("ESD_Match_Gamma_X_Y", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fESD_Match_Gamma_X_Y->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Match_Gamma_X_Y->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Pi0_OpeningAngleGamma(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Pi0_OpeningAngleGamma = new TH1F("ESD_Pi0_OpeningAngleGamma", "", nXBins, firstX, lastX);
-  fESD_Pi0_OpeningAngleGamma->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Pi0_OpeningAngleGamma->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Pi0_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Pi0_Energy = new TH1F("ESD_Pi0_Energy", "", nXBins, firstX, lastX);
-  fESD_Pi0_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Pi0_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Pi0_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Pi0_Pt = new TH1F("ESD_Pi0_Pt", "", nXBins, firstX, lastX);
-  fESD_Pi0_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Pi0_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Pi0_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Pi0_Eta = new TH1F("ESD_Pi0_Eta", "", nXBins, firstX, lastX);
-  fESD_Pi0_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Pi0_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Pi0_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Pi0_Phi = new TH1F("ESD_Pi0_Phi", "", nXBins, firstX, lastX);
-  fESD_Pi0_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Pi0_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Pi0_Mass(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Pi0_Mass = new TH1F("ESD_Pi0_Mass", "", nXBins, firstX, lastX);
-  fESD_Pi0_Mass->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Pi0_Mass->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Pi0_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Pi0_R = new TH1F("ESD_Pi0_R", "", nXBins, firstX, lastX);
-  fESD_Pi0_R->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Pi0_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Pi0_Z_R(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fESD_Pi0_Z_R = new TH2F("ESD_Pi0_Z_R", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fESD_Pi0_Z_R->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Pi0_Z_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Pi0_X_Y(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fESD_Pi0_X_Y = new TH2F("ESD_Pi0_X_Y", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fESD_Pi0_X_Y->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Pi0_X_Y->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Eta_OpeningAngleGamma(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Eta_OpeningAngleGamma = new TH1F("ESD_Eta_OpeningAngleGamma", "", nXBins, firstX, lastX);
-  fESD_Eta_OpeningAngleGamma->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Eta_OpeningAngleGamma->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Eta_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Eta_Energy = new TH1F("ESD_Eta_Energy", "", nXBins, firstX, lastX);
-  fESD_Eta_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Eta_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Eta_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Eta_Pt = new TH1F("ESD_Eta_Pt", "", nXBins, firstX, lastX);
-  fESD_Eta_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Eta_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Eta_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Eta_Eta = new TH1F("ESD_Eta_Eta", "", nXBins, firstX, lastX);
-  fESD_Eta_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Eta_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Eta_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Eta_Phi = new TH1F("ESD_Eta_Phi", "", nXBins, firstX, lastX);
-  fESD_Eta_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Eta_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Eta_Mass(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Eta_Mass = new TH1F("ESD_Eta_Mass", "", nXBins, firstX, lastX);
-  fESD_Eta_Mass->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Eta_Mass->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Eta_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Eta_R = new TH1F("ESD_Eta_R", "", nXBins, firstX, lastX);
-  fESD_Eta_R->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Eta_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Eta_Z_R(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fESD_Eta_Z_R = new TH2F("ESD_Eta_Z_R", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fESD_Eta_Z_R->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Eta_Z_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Eta_X_Y(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fESD_Eta_X_Y = new TH2F("ESD_Eta_X_Y", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fESD_Eta_X_Y->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Eta_X_Y->GetYaxis()->SetTitle(yAxisTitle);
-}
-void AliGammaConversionHistograms::Initialize_ESD_Background_OpeningAngleGamma(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Background_OpeningAngleGamma = new TH1F("ESD_Background_OpeningAngleGamma", "", nXBins, firstX, lastX);
-  fESD_Background_OpeningAngleGamma->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Background_OpeningAngleGamma->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Background_Energy(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Background_Energy = new TH1F("ESD_Background_Energy", "", nXBins, firstX, lastX);
-  fESD_Background_Energy->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Background_Energy->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Background_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Background_Pt = new TH1F("ESD_Background_Pt", "", nXBins, firstX, lastX);
-  fESD_Background_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Background_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Background_Eta(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Background_Eta = new TH1F("ESD_Background_Eta", "", nXBins, firstX, lastX);
-  fESD_Background_Eta->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Background_Eta->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Background_Phi(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Background_Phi = new TH1F("ESD_Background_Phi", "", nXBins, firstX, lastX);
-  fESD_Background_Phi->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Background_Phi->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Background_Mass(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Background_Mass = new TH1F("ESD_Background_Mass", "", nXBins, firstX, lastX);
-  fESD_Background_Mass->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Background_Mass->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Background_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fESD_Background_R = new TH1F("ESD_Background_R", "", nXBins, firstX, lastX);
-  fESD_Background_R->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Background_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Background_Z_R(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fESD_Background_Z_R = new TH2F("ESD_Background_Z_R", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fESD_Background_Z_R->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Background_Z_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_ESD_Background_X_Y(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fESD_Background_X_Y = new TH2F("ESD_Background_X_Y", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fESD_Background_X_Y->GetXaxis()->SetTitle(xAxisTitle);
-  fESD_Background_X_Y->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_Resolution_dPt(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fResolution_dPt = new TH2F("Resolution_dPt", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fResolution_dPt->GetXaxis()->SetTitle(xAxisTitle);
-  fResolution_dPt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_Resolution_dR(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fResolution_dR = new TH2F("Resolution_dR", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fResolution_dR->GetXaxis()->SetTitle(xAxisTitle);
-  fResolution_dR->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_Resolution_dZ(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fResolution_dZ = new TH2F("Resolution_dZ", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fResolution_dZ->GetXaxis()->SetTitle(xAxisTitle);
-  fResolution_dZ->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_Resolution_dR_dPt(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){
-  fResolution_dR_dPt = new TH2F("Resolution_dR_dPt", "", nXBins, firstX, lastX, nYBins, firstY, lastY);
-  fResolution_dR_dPt->GetXaxis()->SetTitle(xAxisTitle);
-  fResolution_dR_dPt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_Resolution_MC_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fResolution_MC_Pt = new TH1F("Resolution_MC_Pt", "", nXBins, firstX, lastX);
-  fResolution_MC_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fResolution_MC_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_Resolution_MC_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fResolution_MC_R = new TH1F("Resolution_MC_R", "", nXBins, firstX, lastX);
-  fResolution_MC_R->GetXaxis()->SetTitle(xAxisTitle);
-  fResolution_MC_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_Resolution_MC_Z(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fResolution_MC_Z = new TH1F("Resolution_MC_Z", "", nXBins, firstX, lastX);
-  fResolution_MC_Z->GetXaxis()->SetTitle(xAxisTitle);
-  fResolution_MC_Z->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_Resolution_ESD_Pt(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fResolution_ESD_Pt = new TH1F("Resolution_ESD_Pt", "", nXBins, firstX, lastX);
-  fResolution_ESD_Pt->GetXaxis()->SetTitle(xAxisTitle);
-  fResolution_ESD_Pt->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_Resolution_ESD_R(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fResolution_ESD_R = new TH1F("Resolution_ESD_R", "", nXBins, firstX, lastX);
-  fResolution_ESD_R->GetXaxis()->SetTitle(xAxisTitle);
-  fResolution_ESD_R->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_Resolution_ESD_Z(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fResolution_ESD_Z = new TH1F("Resolution_ESD_Z", "", nXBins, firstX, lastX);
-  fResolution_ESD_Z->GetXaxis()->SetTitle(xAxisTitle);
-  fResolution_ESD_Z->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_NumberOfV0s(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fNumberOfV0s = new TH1F("NumberOfV0s", "", nXBins, firstX, lastX);
-  fNumberOfV0s->GetXaxis()->SetTitle(xAxisTitle);
-  fNumberOfV0s->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_NumberOfSurvivingV0s(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fNumberOfSurvivingV0s = new TH1F("NumberOfSurvivingV0s", "", nXBins, firstX, lastX);
-  fNumberOfSurvivingV0s->GetXaxis()->SetTitle(xAxisTitle);
-  fNumberOfSurvivingV0s->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_V0MassDebugCut1(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fV0MassDebugCut1 = new TH1F("V0MassDebugCut1", "", nXBins, firstX, lastX);
-  fV0MassDebugCut1->GetXaxis()->SetTitle(xAxisTitle);
-  fV0MassDebugCut1->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_V0MassDebugCut2(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fV0MassDebugCut2 = new TH1F("V0MassDebugCut2", "", nXBins, firstX, lastX);
-  fV0MassDebugCut2->GetXaxis()->SetTitle(xAxisTitle);
-  fV0MassDebugCut2->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_V0MassDebugCut3(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fV0MassDebugCut3 = new TH1F("V0MassDebugCut3", "", nXBins, firstX, lastX);
-  fV0MassDebugCut3->GetXaxis()->SetTitle(xAxisTitle);
-  fV0MassDebugCut3->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_V0MassDebugCut4(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fV0MassDebugCut4 = new TH1F("V0MassDebugCut4", "", nXBins, firstX, lastX);
-  fV0MassDebugCut4->GetXaxis()->SetTitle(xAxisTitle);
-  fV0MassDebugCut4->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_V0MassDebugCut5(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fV0MassDebugCut5 = new TH1F("V0MassDebugCut5", "", nXBins, firstX, lastX);
-  fV0MassDebugCut5->GetXaxis()->SetTitle(xAxisTitle);
-  fV0MassDebugCut5->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_V0MassDebugCut6(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fV0MassDebugCut6 = new TH1F("V0MassDebugCut6", "", nXBins, firstX, lastX);
-  fV0MassDebugCut6->GetXaxis()->SetTitle(xAxisTitle);
-  fV0MassDebugCut6->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_V0MassDebugCut7(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fV0MassDebugCut7 = new TH1F("V0MassDebugCut7", "", nXBins, firstX, lastX);
-  fV0MassDebugCut7->GetXaxis()->SetTitle(xAxisTitle);
-  fV0MassDebugCut7->GetYaxis()->SetTitle(yAxisTitle);
-}
-
-void AliGammaConversionHistograms::Initialize_V0MassDebugCut8(Int_t nXBins, Double_t firstX, Double_t lastX, TString xAxisTitle, TString yAxisTitle){
-  fV0MassDebugCut8 = new TH1F("V0MassDebugCut8", "", nXBins, firstX, lastX);
-  fV0MassDebugCut8->GetXaxis()->SetTitle(xAxisTitle);
-  fV0MassDebugCut8->GetYaxis()->SetTitle(yAxisTitle);
-}
+/**************************************************************************\r
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ *                                                                        *\r
+ * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt                        *\r
+ * Version 1.0                                                            *\r
+ *                                                                        *\r
+ * Permission to use, copy, modify and distribute this software and its   *\r
+ * documentation strictly for non-commercial purposes is hereby granted   *\r
+ * without fee, provided that the above copyright notice appears in all   *\r
+ * copies and that both the copyright notice and this permission notice   *\r
+ * appear in the supporting documentation. The authors make no claims     *\r
+ * about the suitability of this software for any purpose. It is          *\r
+ * provided "as is" without express or implied warranty.                  *\r
+ **************************************************************************/\r
+\r
+////////////////////////////////////////////////\r
+//--------------------------------------------- \r
+// Class used to do analysis on conversion pairs\r
+//---------------------------------------------\r
+////////////////////////////////////////////////\r
+\r
+#include "AliGammaConversionHistograms.h"\r
+#include "TMath.h"\r
+#include "TObjString.h"\r
+#include "TMap.h"\r
+#include "TList.h"\r
+#include "TH1F.h"\r
+#include "TH2F.h"\r
+\r
+\r
+using namespace std;\r
+\r
+ClassImp(AliGammaConversionHistograms)\r
+\r
+\r
+AliGammaConversionHistograms::AliGammaConversionHistograms() :\r
+  fHistogramMap(new TMap()),\r
+  fNPhiIndex(0),\r
+  fNRIndex(0),\r
+  fMinRadius(0.),\r
+  fMaxRadius(0.),\r
+  fDeltaR(0.),\r
+  fMinPhi(0.),\r
+  fMaxPhi(0.),\r
+  fDeltaPhi(0.)\r
+{\r
+  // see header file for documenation\r
+}\r
+\r
+\r
+AliGammaConversionHistograms::AliGammaConversionHistograms(const AliGammaConversionHistograms & original) :\r
+  fHistogramMap(original.fHistogramMap),\r
+  fNPhiIndex(original.fNPhiIndex),\r
+  fNRIndex(original.fNRIndex),\r
+  fMinRadius(original.fMinRadius),\r
+  fMaxRadius(original.fMaxRadius),\r
+  fDeltaR(original.fDeltaR),\r
+  fMinPhi(original.fMinPhi),\r
+  fMaxPhi(original.fMaxPhi),\r
+  fDeltaPhi(original.fDeltaPhi)\r
+{    \r
+  //see header file for documentation\r
+}\r
+\r
+\r
+AliGammaConversionHistograms & AliGammaConversionHistograms::operator = (const AliGammaConversionHistograms & /*original*/)\r
+{\r
+  // assignment operator\r
+  return *this;\r
+}\r
+\r
+\r
+AliGammaConversionHistograms::~AliGammaConversionHistograms() {\r
+  //destructor\r
+\r
+\r
+}\r
+\r
+void AliGammaConversionHistograms::AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX,Double_t lastX,TString xAxisTitle, TString yAxisTitle){\r
+  // see header file for documentation\r
+  TH1F *tmp = new TH1F(histogramName, histogramTitle,nXBins,firstX,lastX);\r
+  tmp->GetXaxis()->SetTitle(xAxisTitle);\r
+  tmp->GetYaxis()->SetTitle(yAxisTitle);\r
+  TObjString* tobjstring = new TObjString(histogramName.Data());\r
+  fHistogramMap->Add((TObject*)tobjstring,(TObject*)tmp);\r
+}\r
+\r
+void AliGammaConversionHistograms::AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){\r
+  // see header file for documentation\r
+  TH2F *tmp = new TH2F(histogramName, histogramTitle,nXBins,firstX,lastX,nYBins,firstY,lastY);\r
+  tmp->GetXaxis()->SetTitle(xAxisTitle);\r
+  tmp->GetYaxis()->SetTitle(yAxisTitle);\r
+  TObjString *tobjstring = new TObjString(histogramName.Data());\r
+  fHistogramMap->Add((TObject*)tobjstring,(TObject*)tmp);\r
+}\r
+\r
+void AliGammaConversionHistograms::FillHistogram(TString histogramName, Double_t xValue) const{\r
+  //see header file for documentation\r
+  TH1 *tmp = (TH1*)fHistogramMap->GetValue(histogramName.Data());\r
+  if(tmp){\r
+      tmp->Fill(xValue);\r
+  }\r
+  else{\r
+    cout<<"Histogram does not exist"<<histogramName.Data()<<endl;\r
+  }\r
+}\r
+\r
+void AliGammaConversionHistograms::FillHistogram(TString histogramName, Double_t xValue, Double_t yValue) const{\r
+  //see header file for documentation\r
+  TH1 *tmp = (TH1*)fHistogramMap->GetValue(histogramName.Data());\r
+  if(tmp){\r
+    tmp->Fill(xValue, yValue);\r
+  }\r
+  else{\r
+    cout<<"Histogram does not exist"<<histogramName.Data()<<endl;\r
+  }\r
+}\r
+\r
+void AliGammaConversionHistograms::GetOutputContainer(TList *fOutputContainer) const{\r
+  //checking if the container is alrerady created\r
+\r
+  if(fOutputContainer == NULL){\r
+    //print warning\r
+    return;\r
+  }\r
+  cout<<"Creating the histogram output container"<<endl;\r
+\r
+  if(fHistogramMap){\r
+    TIter iter(fHistogramMap);\r
+    TObjString *histogramName;\r
+    while ((histogramName = (TObjString*) iter.Next())) {\r
+      cout<<"Histohram name "<<histogramName->GetString().Data()<<endl;\r
+      TString histogramString = histogramName->GetString();\r
+      fOutputContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data()));\r
+      histogramName = NULL;\r
+    }  \r
+  }\r
+\r
+  //remember mapping stuff!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r
+\r
+\r
+  /*\r
+  TList*  fMappingContainer = new TList();\r
+  fMappingContainer->SetName("Mapping Histograms");\r
+\r
+  if(fMCEPR != NULL){ fOutputContainer->Add(fMCEPR);}\r
+  if(fMCEPZR != NULL){ fOutputContainer->Add(fMCEPZR);}\r
+  if(fMCEPXY != NULL){ fOutputContainer->Add(fMCEPXY);}\r
+  if(fMCEPOpeningAngle != NULL){ fOutputContainer->Add(fMCEPOpeningAngle);}\r
+\r
+  if(fMCEEnergy != NULL){ fOutputContainer->Add(fMCEEnergy);}\r
+  if(fMCEPt != NULL){ fOutputContainer->Add(fMCEPt);}\r
+  if(fMCEEta != NULL){ fOutputContainer->Add(fMCEEta);}\r
+  if(fMCEPhi != NULL){ fOutputContainer->Add(fMCEPhi);}\r
+\r
+  if(fMCPEnergy != NULL){ fOutputContainer->Add(fMCPEnergy);}\r
+  if(fMCPPt != NULL){ fOutputContainer->Add(fMCPPt);}\r
+  if(fMCPEta != NULL){ fOutputContainer->Add(fMCPEta);}\r
+  if(fMCPPhi != NULL){ fOutputContainer->Add(fMCPPhi);}\r
+\r
+  if(fMCGammaEnergy != NULL){ fOutputContainer->Add(fMCGammaEnergy);}\r
+  if(fMCGammaPt != NULL){ fOutputContainer->Add(fMCGammaPt);}\r
+  if(fMCGammaEta != NULL){ fOutputContainer->Add(fMCGammaEta);}\r
+  if(fMCGammaPhi != NULL){ fOutputContainer->Add(fMCGammaPhi);}\r
+\r
+  if(fMCDirectGammaEnergy != NULL){ fOutputContainer->Add(fMCDirectGammaEnergy);}\r
+  if(fMCDirectGammaPt != NULL){ fOutputContainer->Add(fMCDirectGammaPt);}\r
+  if(fMCDirectGammaEta != NULL){ fOutputContainer->Add(fMCDirectGammaEta);}\r
+  if(fMCDirectGammaPhi != NULL){ fOutputContainer->Add(fMCDirectGammaPhi);}\r
+\r
+  //mapping\r
+  for(UInt_t i=0;i<fMCMapping.size();i++){\r
+    for(UInt_t j=0;j<fMCMapping[i].size();j++){\r
+      if(fMCMapping[i][j] != NULL){fMappingContainer->Add(fMCMapping[i][j]);}\r
+    }\r
+  }\r
+  for(UInt_t i=0;i<fMCMappingPhi.size();i++){\r
+    if(fMCMappingPhi[i] != NULL){fMappingContainer->Add(fMCMappingPhi[i]);}\r
+  }\r
+  for(UInt_t i=0;i<fMCMappingR.size();i++){\r
+    if(fMCMappingR[i] != NULL){fMappingContainer->Add(fMCMappingR[i]);}\r
+  }\r
+  if(fMCMatchGammaEta != NULL){ fOutputContainer->Add(fMCMatchGammaEta);}\r
+  if(fMCMatchGammaPhi != NULL){ fOutputContainer->Add(fMCMatchGammaPhi);}\r
+  if(fMCMatchGammaPt != NULL){ fOutputContainer->Add(fMCMatchGammaPt);}\r
+  if(fMCMatchGammaEnergy != NULL){ fOutputContainer->Add(fMCMatchGammaEnergy);}\r
+  if(fMCMatchGammaMass != NULL){ fOutputContainer->Add(fMCMatchGammaMass);}\r
+  if(fMCMatchGammaOpeningAngle != NULL){ fOutputContainer->Add(fMCMatchGammaOpeningAngle);}\r
+  if(fMCMatchGammaR != NULL){ fOutputContainer->Add(fMCMatchGammaR);}\r
+  if(fMCMatchGammaZR != NULL){ fOutputContainer->Add(fMCMatchGammaZR);}\r
+  if(fMCMatchGammaXY != NULL){ fOutputContainer->Add(fMCMatchGammaXY);}\r
+\r
+  if(fMCPi0Eta != NULL){ fOutputContainer->Add(fMCPi0Eta);}\r
+  if(fMCPi0Phi != NULL){ fOutputContainer->Add(fMCPi0Phi);}\r
+  if(fMCPi0Pt != NULL){ fOutputContainer->Add(fMCPi0Pt);}\r
+  if(fMCPi0Energy != NULL){ fOutputContainer->Add(fMCPi0Energy);}\r
+  if(fMCPi0Mass != NULL){ fOutputContainer->Add(fMCPi0Mass);}\r
+  if(fMCPi0OpeningAngleGamma != NULL){ fOutputContainer->Add(fMCPi0OpeningAngleGamma);}\r
+  if(fMCPi0R != NULL){ fOutputContainer->Add(fMCPi0R);}\r
+  if(fMCPi0ZR != NULL){ fOutputContainer->Add(fMCPi0ZR);}\r
+  if(fMCPi0XY != NULL){ fOutputContainer->Add(fMCPi0XY);}\r
+  if(fMCPi0SecondariesXY != NULL){ fOutputContainer->Add(fMCPi0SecondariesXY);}\r
+\r
+  if(fMCEtaEta != NULL){ fOutputContainer->Add(fMCEtaEta);}\r
+  if(fMCEtaPhi != NULL){ fOutputContainer->Add(fMCEtaPhi);}\r
+  if(fMCEtaPt != NULL){ fOutputContainer->Add(fMCEtaPt);}\r
+  if(fMCEtaEnergy != NULL){ fOutputContainer->Add(fMCEtaEnergy);}\r
+  if(fMCEtaMass != NULL){ fOutputContainer->Add(fMCEtaMass);}\r
+  if(fMCEtaOpeningAngleGamma != NULL){ fOutputContainer->Add(fMCEtaOpeningAngleGamma);}\r
+  if(fMCEtaR != NULL){ fOutputContainer->Add(fMCEtaR);}\r
+  if(fMCEtaZR != NULL){ fOutputContainer->Add(fMCEtaZR);}\r
+  if(fMCEtaXY != NULL){ fOutputContainer->Add(fMCEtaXY);}\r
+    \r
+  // Histograms from esd tracks\r
+  if(fESDEPR != NULL){ fOutputContainer->Add(fESDEPR);}\r
+  if(fESDEPZR != NULL){ fOutputContainer->Add(fESDEPZR);}\r
+  if(fESDEPXY != NULL){ fOutputContainer->Add(fESDEPXY);}\r
+  if(fESDEPOpeningAngle != NULL){ fOutputContainer->Add(fESDEPOpeningAngle);}\r
+\r
+  if(fESDEEnergy != NULL){ fOutputContainer->Add(fESDEEnergy);}\r
+  if(fESDEPt != NULL){ fOutputContainer->Add(fESDEPt);}\r
+  if(fESDEEta != NULL){ fOutputContainer->Add(fESDEEta);}\r
+  if(fESDEPhi != NULL){ fOutputContainer->Add(fESDEPhi);}\r
+\r
+  if(fESDPEnergy != NULL){ fOutputContainer->Add(fESDPEnergy);}\r
+  if(fESDPPt != NULL){ fOutputContainer->Add(fESDPPt);}\r
+  if(fESDPEta != NULL){ fOutputContainer->Add(fESDPEta);}\r
+  if(fESDPPhi != NULL){ fOutputContainer->Add(fESDPPhi);}\r
+\r
+  if(fESDGammaEnergy != NULL){ fOutputContainer->Add(fESDGammaEnergy);}\r
+  if(fESDGammaPt != NULL){ fOutputContainer->Add(fESDGammaPt);}\r
+  if(fESDGammaEta != NULL){ fOutputContainer->Add(fESDGammaEta);}\r
+  if(fESDGammaPhi != NULL){ fOutputContainer->Add(fESDGammaPhi);}\r
+\r
+  //mapping\r
+  for(UInt_t i=0;i<fESDMapping.size();i++){\r
+    for(UInt_t j=0;j<fESDMapping[i].size();j++){\r
+      if(fESDMapping[i][j] != NULL){fMappingContainer->Add(fESDMapping[i][j]);}\r
+    }\r
+  }\r
+  for(UInt_t i=0;i<fESDMappingPhi.size();i++){\r
+    if(fESDMappingPhi[i] != NULL){fMappingContainer->Add(fESDMappingPhi[i]);}\r
+  }\r
+  for(UInt_t i=0;i<fESDMappingR.size();i++){\r
+    if(fESDMappingR[i] != NULL){fMappingContainer->Add(fESDMappingR[i]);}\r
+  }\r
+\r
+  fOutputContainer->Add(fMappingContainer);\r
+\r
+  if(fESDMatchGammaOpeningAngle != NULL){ fOutputContainer->Add(fESDMatchGammaOpeningAngle);}\r
+  if(fESDMatchGammaEnergy != NULL){ fOutputContainer->Add(fESDMatchGammaEnergy);}\r
+  if(fESDMatchGammaPt != NULL){ fOutputContainer->Add(fESDMatchGammaPt);}\r
+  if(fESDMatchGammaEta != NULL){ fOutputContainer->Add(fESDMatchGammaEta);}\r
+  if(fESDMatchGammaPhi != NULL){ fOutputContainer->Add(fESDMatchGammaPhi);}\r
+  if(fESDMatchGammaMass != NULL){ fOutputContainer->Add(fESDMatchGammaMass);}\r
+  if(fESDMatchGammaWidth != NULL){ fOutputContainer->Add(fESDMatchGammaWidth);}\r
+  if(fESDMatchGammaChi2 != NULL){ fOutputContainer->Add(fESDMatchGammaChi2);}\r
+  if(fESDMatchGammaNDF != NULL){ fOutputContainer->Add(fESDMatchGammaNDF);}\r
+  if(fESDMatchGammaR != NULL){ fOutputContainer->Add(fESDMatchGammaR);}\r
+  if(fESDMatchGammaZR != NULL){ fOutputContainer->Add(fESDMatchGammaZR);}\r
+  if(fESDMatchGammaXY != NULL){ fOutputContainer->Add(fESDMatchGammaXY);}\r
+\r
+  if(fESDPi0OpeningAngleGamma != NULL){ fOutputContainer->Add(fESDPi0OpeningAngleGamma);}\r
+  if(fESDPi0Energy != NULL){ fOutputContainer->Add(fESDPi0Energy);}\r
+  if(fESDPi0Pt != NULL){ fOutputContainer->Add(fESDPi0Pt);}\r
+  if(fESDPi0Eta != NULL){ fOutputContainer->Add(fESDPi0Eta);}\r
+  if(fESDPi0Phi != NULL){ fOutputContainer->Add(fESDPi0Phi);}\r
+  if(fESDPi0Mass != NULL){ fOutputContainer->Add(fESDPi0Mass);}\r
+  if(fESDPi0R != NULL){ fOutputContainer->Add(fESDPi0R);}\r
+  if(fESDPi0ZR != NULL){ fOutputContainer->Add(fESDPi0ZR);}\r
+  if(fESDPi0XY != NULL){ fOutputContainer->Add(fESDPi0XY);}\r
+\r
+  if(fESDEtaOpeningAngleGamma != NULL){ fOutputContainer->Add(fESDEtaOpeningAngleGamma);}\r
+  if(fESDEtaEnergy != NULL){ fOutputContainer->Add(fESDEtaEnergy);}\r
+  if(fESDEtaPt != NULL){ fOutputContainer->Add(fESDEtaPt);}\r
+  if(fESDEtaEta != NULL){ fOutputContainer->Add(fESDEtaEta);}\r
+  if(fESDEtaPhi != NULL){ fOutputContainer->Add(fESDEtaPhi);}\r
+  if(fESDEtaMass != NULL){ fOutputContainer->Add(fESDEtaMass);}\r
+  if(fESDEtaR != NULL){ fOutputContainer->Add(fESDEtaR);}\r
+  if(fESDEtaZR != NULL){ fOutputContainer->Add(fESDEtaZR);}\r
+  if(fESDEtaXY != NULL){ fOutputContainer->Add(fESDEtaXY);}\r
+\r
+  if(fESDBackgroundOpeningAngleGamma != NULL){ fOutputContainer->Add(fESDBackgroundOpeningAngleGamma);}\r
+  if(fESDBackgroundEnergy != NULL){ fOutputContainer->Add(fESDBackgroundEnergy);}\r
+  if(fESDBackgroundPt != NULL){ fOutputContainer->Add(fESDBackgroundPt);}\r
+  if(fESDBackgroundEta != NULL){ fOutputContainer->Add(fESDBackgroundEta);}\r
+  if(fESDBackgroundPhi != NULL){ fOutputContainer->Add(fESDBackgroundPhi);}\r
+  if(fESDBackgroundMass != NULL){ fOutputContainer->Add(fESDBackgroundMass);}\r
+  if(fESDBackgroundR != NULL){ fOutputContainer->Add(fESDBackgroundR);}\r
+  if(fESDBackgroundZR != NULL){ fOutputContainer->Add(fESDBackgroundZR);}\r
+  if(fESDBackgroundXY != NULL){ fOutputContainer->Add(fESDBackgroundXY);}\r
+\r
+  if(fResolutiondPt != NULL){ fOutputContainer->Add(fResolutiondPt);}\r
+  if(fResolutiondR != NULL){ fOutputContainer->Add(fResolutiondR);}\r
+  if(fResolutiondZ != NULL){ fOutputContainer->Add(fResolutiondZ);}\r
+  if(fResolutiondRdPt != NULL){ fOutputContainer->Add(fResolutiondRdPt);}\r
+  if(fResolutionMCPt != NULL){ fOutputContainer->Add(fResolutionMCPt);}\r
+  if(fResolutionMCR != NULL){ fOutputContainer->Add(fResolutionMCR);}\r
+  if(fResolutionMCZ != NULL){ fOutputContainer->Add(fResolutionMCZ);}\r
+  if(fResolutionESDPt != NULL){ fOutputContainer->Add(fResolutionESDPt);}\r
+  if(fResolutionESDR != NULL){ fOutputContainer->Add(fResolutionESDR);}\r
+  if(fResolutionESDZ != NULL){ fOutputContainer->Add(fResolutionESDZ);}\r
+\r
+  if(fNumberOfV0s != NULL){fOutputContainer->Add(fNumberOfV0s);}\r
+  if(fNumberOfSurvivingV0s != NULL){fOutputContainer->Add(fNumberOfSurvivingV0s);}\r
+  if(fV0MassDebugCut1 != NULL){fOutputContainer->Add(fV0MassDebugCut1);}\r
+  if(fV0MassDebugCut2 != NULL){fOutputContainer->Add(fV0MassDebugCut2);}\r
+  if(fV0MassDebugCut3 != NULL){fOutputContainer->Add(fV0MassDebugCut3);}\r
+  if(fV0MassDebugCut4 != NULL){fOutputContainer->Add(fV0MassDebugCut4);}\r
+  if(fV0MassDebugCut5 != NULL){fOutputContainer->Add(fV0MassDebugCut5);}\r
+  if(fV0MassDebugCut6 != NULL){fOutputContainer->Add(fV0MassDebugCut6);}\r
+  if(fV0MassDebugCut7 != NULL){fOutputContainer->Add(fV0MassDebugCut7);}\r
+  if(fV0MassDebugCut8 != NULL){fOutputContainer->Add(fV0MassDebugCut8);}\r
+  \r
+  return fOutputContainer;\r
+*/\r
+}\r
+\r
+Int_t AliGammaConversionHistograms::GetRBin(Double_t radius) const{\r
+  // see header file for documentation\r
+  Int_t iResult=0;\r
+  if(fDeltaR>0){\r
+    iResult = (Int_t)((radius - fMinRadius)/fDeltaR);\r
+  }\r
+  return iResult;\r
+}\r
+\r
+Int_t AliGammaConversionHistograms::GetPhiBin(Double_t phi) const{\r
+  // see header file for documentation\r
+  Int_t iResult=0;\r
+  if(fDeltaPhi>0){\r
+    if(phi>TMath::Pi()){\r
+      phi-=2*TMath::Pi();\r
+    }\r
+    iResult = (Int_t)((phi - fMinPhi)/fDeltaPhi);\r
+  }\r
+  return iResult;\r
+}\r
+\r
+\r
+\r
+void AliGammaConversionHistograms::InitializeMappingValues(Int_t nPhiIndex, Int_t nRIndex, Int_t nBinsR, Double_t minRadius, Double_t maxRadius,Int_t nBinsPhi, Double_t minPhi, Double_t maxPhi){\r
+  // Initializing the valuse for the mapping\r
+\r
+  fNPhiIndex = nPhiIndex;\r
+  fNRIndex   = nRIndex;\r
+  fMinRadius      = minRadius;\r
+  fMaxRadius      = maxRadius;\r
+  if(nBinsR>0 && nRIndex!=0){\r
+    fDeltaR       = (fMaxRadius - fMinRadius)/nRIndex;\r
+  }\r
+  fMinPhi         = minPhi;\r
+  fMaxPhi         = maxPhi;\r
+  if(nBinsPhi>0 && nPhiIndex!=0){\r
+    fDeltaPhi     = (fMaxPhi-fMinPhi)/nPhiIndex;\r
+  }\r
+}\r
+\r
+\r
+//mapping\r
+void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t nRIndex,Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){\r
+  // see header file for documentation\r
+  \r
+  for(Int_t phi =0; phi<=fNPhiIndex;phi++){\r
+\r
+    for(Int_t r =0; r<fNRIndex;r++){\r
+\r
+      //Creating the axis titles\r
+      if(xAxisTitle.Length() == 0){\r
+       xAxisTitle.Form("Phi %02d",phi);\r
+      }\r
+      \r
+      if(yAxisTitle.Length() == 0){\r
+       yAxisTitle.Form("R %02d",phi);\r
+      }\r
+\r
+      //MC\r
+      TString nameMC="";\r
+      nameMC.Form("MC_EP_Mapping-Phi%02d-R%02d",phi,r);\r
+      TString titleMC="";\r
+      titleMC.Form("Electron-Positron MC Mapping-Phi%02d-R%02d",phi,r);\r
+\r
+      AddHistogram(nameMC, titleMC, nXBins, firstX, lastX, nYBins, firstY, lastY, xAxisTitle, yAxisTitle);\r
+\r
+      //ESD\r
+      TString nameESD="";\r
+      nameESD.Form("ESD_EP_Mapping-Phi%02d-R%02d",phi,r);\r
+      TString titleESD="";\r
+      titleESD.Form("Electron-Positron ESD Mapping-Phi%02d-R%02d",phi,r);\r
+\r
+      AddHistogram(nameESD, titleESD, nXBins, firstX, lastX, nYBins, firstY, lastY, xAxisTitle, yAxisTitle);\r
+    }\r
+  }\r
+\r
+  for(Int_t phi =0; phi<=nPhiIndex;phi++){ \r
+\r
+    //Creating the axis titles\r
+    if(xAxisTitle.Length() == 0){\r
+      xAxisTitle.Form("Phi %02d",phi);\r
+    }\r
+    if(yAxisTitle.Length() == 0){\r
+      yAxisTitle = "Counts";\r
+    }\r
+    \r
+    //MC\r
+    TString nameMC="";\r
+    nameMC.Form("MC_EP_Mapping-Phi%02d",phi);\r
+    TString titleMC="";\r
+    titleMC.Form("Electron-Positron MC Mapping-Phi%02d",phi);\r
+    \r
+    AddHistogram(nameMC, titleMC, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);\r
+\r
+    //MC\r
+    TString nameESD="";\r
+    nameMC.Form("ESD_EP_Mapping-Phi%02d",phi);\r
+    TString titleESD="";\r
+    titleMC.Form("Electron-Positron ESD Mapping-Phi%02d",phi);\r
+    \r
+    AddHistogram(nameESD, titleESD, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);\r
+  }\r
+\r
+\r
+  for(Int_t r =0; r<=nRIndex;r++){\r
+    //Creating the axis titles\r
+    if(xAxisTitle.Length() == 0){\r
+      xAxisTitle.Form("R %02d",r);\r
+    }\r
+    if(yAxisTitle.Length() == 0){\r
+      yAxisTitle = "Counts";\r
+    }\r
+    \r
+    //MC\r
+    TString nameMC="";\r
+    nameMC.Form("MC_EP_Mapping-R%02d",r);\r
+    TString titleMC="";\r
+    titleMC.Form("Electron-Positron MC Mapping-R%02d",r);\r
+    \r
+    AddHistogram(nameMC, titleMC, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);\r
+\r
+    //ESD\r
+    TString nameESD="";\r
+    nameESD.Form("ESD_EP_Mapping-R%02d",r);\r
+    TString titleESD="";\r
+    titleESD.Form("Electron-Positron ESD Mapping-R%02d",r);\r
+    \r
+    AddHistogram(nameESD, titleESD, nXBins, firstX, lastX, xAxisTitle, yAxisTitle);\r
+\r
+    //Mapping Phi in R\r
+    TString nameMCPhiInR="";\r
+    nameMCPhiInR.Form("MC_EP_Mapping_Phi_vs_R_R-%02d",r);\r
+    TString titleMCPhiInR="";\r
+    titleMCPhiInR.Form("Electron-Positron MC Mapping of Phi in R%02d",r);\r
+    AddHistogram(nameMCPhiInR, titleMCPhiInR, nXBins, firstX, lastX, nYBins, firstY, lastY, xAxisTitle, yAxisTitle);\r
+\r
+    TString nameESDPhiInR="";\r
+    nameESDPhiInR.Form("ESD_EP_Mapping_Phi_vs_R_R-%02d",r);\r
+    TString titleESDPhiInR="";\r
+    titleESDPhiInR.Form("Electron-Positron ESD Mapping of Phi in R%02d",r);\r
+    AddHistogram(nameESDPhiInR, titleESDPhiInR, nXBins, firstX, lastX, nYBins, firstY, lastY, xAxisTitle, yAxisTitle);    \r
+  }\r
+}\r
index 8d9f2a1050348b821eb50184b8fac15a910253b7..d3a1709f2d0a65b3dab7a8e96c7ded16a6c62734 100644 (file)
-#ifndef ALIGAMMACONVERSIONHISTOGRAMS_H
-#define ALIGAMMACONVERSIONHISTOGRAMS_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice     */
-
-#include "TH1F.h"
-#include "TH2F.h"
-#include <Riostream.h>
-#include <vector>
-#include "TString.h"
-#include "TList.h"
-
-class AliGammaConversionHistograms{
-
- public: 
-  
-  AliGammaConversionHistograms();                                                         //constructor
-  AliGammaConversionHistograms(const AliGammaConversionHistograms & g);                   //copy constructor
-  AliGammaConversionHistograms & operator = (const AliGammaConversionHistograms & g);     //assignment operator
-  virtual ~AliGammaConversionHistograms();                                                //virtual destructor
-  
-
-  TList * GetOutputContainer();
-  
-  Int_t GetRBin(Double_t radius);
-  Int_t GetPhiBin(Double_t phi);
-
-  //Setters/Initializers
-
-  void Initialize_MappingValues(Int_t nPhiHistograms, Int_t nRHistograms, Int_t nBinsR, Double_t minRadius, Double_t maxRadius,Int_t nBinsPhi, Double_t minPhi, Double_t maxPhi);
-
-  void Initialize_MC_EP_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_EP_Z_R(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_EP_X_Y(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_EP_OpeningAngle(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_MC_E_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_E_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_E_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_E_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_MC_P_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_P_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_P_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_P_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_MC_Gamma_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Gamma_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Gamma_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Gamma_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_MC_DirectGamma_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_DirectGamma_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_DirectGamma_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_DirectGamma_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  //mapping
-  void Initialize_MappingHistograms(Int_t nPhiHistograms, Int_t nRHistograms,Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle);
-
-  void Initialize_MC_Match_Gamma_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Match_Gamma_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Match_Gamma_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Match_Gamma_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Match_Gamma_Mass(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Match_Gamma_OpeningAngle(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Match_Gamma_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Match_Gamma_Z_R(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Match_Gamma_X_Y(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_MC_Pi0_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Pi0_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Pi0_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Pi0_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Pi0_Mass(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Pi0_OpeningAngleGamma(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Pi0_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Pi0_Z_R(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Pi0_X_Y(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Pi0Secondaries_X_Y(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_MC_Eta_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Eta_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Eta_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Eta_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Eta_Mass(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Eta_OpeningAngleGamma(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Eta_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Eta_Z_R(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_MC_Eta_X_Y(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-    
-  // esd
-
-  void Initialize_ESD_EP_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_EP_Z_R(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_EP_X_Y(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_EP_OpeningAngle(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_ESD_E_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_E_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_E_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_E_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_ESD_P_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_P_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_P_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_P_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-
-  void Initialize_ESD_Gamma_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Gamma_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Gamma_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Gamma_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_ESD_Match_Gamma_OpeningAngle(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_Mass(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_Width(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_Chi2(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_NDF(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_Z_R(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Match_Gamma_X_Y(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-
-
-  void Initialize_ESD_Pi0_OpeningAngleGamma(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Pi0_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Pi0_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Pi0_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Pi0_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Pi0_Mass(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Pi0_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Pi0_Z_R(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Pi0_X_Y(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-
-
-  void Initialize_ESD_Eta_OpeningAngleGamma(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Eta_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Eta_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Eta_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Eta_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Eta_Mass(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Eta_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Eta_Z_R(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Eta_X_Y(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_ESD_Background_OpeningAngleGamma(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Background_Energy(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Background_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Background_Eta(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Background_Phi(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Background_Mass(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Background_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Background_Z_R(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_ESD_Background_X_Y(Int_t nXBins,Double_t firstX,Double_t lastX,Int_t nYBins,Double_t firstY,Double_t lastY,TString xAxisTitle="", TString yAxisTitle="");
-
-
-  void Initialize_Resolution_dPt(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle);
-  void Initialize_Resolution_dR(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle);
-  void Initialize_Resolution_dZ(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle);
-  void Initialize_Resolution_dR_dPt(Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle);
-
-  void Initialize_Resolution_MC_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_Resolution_MC_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_Resolution_MC_Z(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_Resolution_ESD_Pt(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_Resolution_ESD_R(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_Resolution_ESD_Z(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_NumberOfV0s(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_NumberOfSurvivingV0s(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
-  void Initialize_V0MassDebugCut1(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_V0MassDebugCut2(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_V0MassDebugCut3(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_V0MassDebugCut4(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_V0MassDebugCut5(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_V0MassDebugCut6(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_V0MassDebugCut7(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-  void Initialize_V0MassDebugCut8(Int_t nXBins,Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
-
- private:
-  TList* fOutputContainer;
-
-  Int_t fNPhiIndex;
-  Int_t fNRIndex;
-  Double_t fMinRadius;
-  Double_t fMaxRadius;
-  Double_t fDeltaR;
-  Double_t fMinPhi;
-  Double_t fMaxPhi;
-  Double_t fDeltaPhi;
-  
-
-  
-  // Pure MonteCarlo histograms
-  TH1F * fMC_EP_R;                    //! transient
-  TH2F * fMC_EP_Z_R;                  //! transient 
-  TH2F * fMC_EP_X_Y;                  //! transient
-  TH1F * fMC_EP_OpeningAngle;         //! transient
-
-  TH1F * fMC_E_Energy;                //! transient
-  TH1F * fMC_E_Pt;                    //! transient
-  TH1F * fMC_E_Eta;                   //! transient
-  TH1F * fMC_E_Phi;                   //! transient
-
-  TH1F * fMC_P_Energy;                //! transient
-  TH1F * fMC_P_Pt;                    //! transient
-  TH1F * fMC_P_Eta;                   //! transient
-  TH1F * fMC_P_Phi;                   //! transient
-
-  TH1F * fMC_Gamma_Energy;            //! transient
-  TH1F * fMC_Gamma_Pt;                //! transient
-  TH1F * fMC_Gamma_Eta;               //! transient
-  TH1F * fMC_Gamma_Phi;               //! transient
-
-  TH1F * fMC_DirectGamma_Energy;      //! transient
-  TH1F * fMC_DirectGamma_Pt;          //! transient
-  TH1F * fMC_DirectGamma_Eta;         //! transient
-  TH1F * fMC_DirectGamma_Phi;         //! transient
-
-  //mapping
-  //begin double vector
-  typedef vector<TH2F *> AliConversionMappingVector; //! transient  
-  vector<AliConversionMappingVector> fMC_Mapping;    //! transient
-  //end double vector
-
-  vector<TH2F *> fMC_Mapping_Phi;     //! transient
-  vector<TH2F *> fMC_Mapping_R;       //! transient
-
-  TH1F * fMC_Match_Gamma_Eta;         //! transient
-  TH1F * fMC_Match_Gamma_Phi;         //! transient
-  TH1F * fMC_Match_Gamma_Pt;          //! transient
-  TH1F * fMC_Match_Gamma_Energy;      //! transient
-  TH1F * fMC_Match_Gamma_Mass;        //! transient
-  TH1F * fMC_Match_Gamma_OpeningAngle;//! transient
-  TH1F * fMC_Match_Gamma_R;           //! transient
-  TH2F * fMC_Match_Gamma_Z_R;         //! transient
-  TH2F * fMC_Match_Gamma_X_Y;         //! transient
-
-
-  TH1F * fMC_Pi0_Eta;                 //! transient
-  TH1F * fMC_Pi0_Phi;                 //! transient
-  TH1F * fMC_Pi0_Pt;                  //! transient
-  TH1F * fMC_Pi0_Energy;              //! transient
-  TH1F * fMC_Pi0_Mass;                //! transient Not filled, no point, we know the montecarlo mass
-  TH1F * fMC_Pi0_OpeningAngleGamma;   //! transient
-  TH1F * fMC_Pi0_R;                   //! transient
-  TH2F * fMC_Pi0_Z_R;                 //! transient
-  TH2F * fMC_Pi0_X_Y;                 //! transient
-
-  TH1F * fMC_Pi0Secondaries_Eta;                 //! transient
-  TH1F * fMC_Pi0Secondaries_Phi;                 //! transient
-  TH1F * fMC_Pi0Secondaries_Pt;                  //! transient
-  TH1F * fMC_Pi0Secondaries_Energy;              //! transient
-  TH1F * fMC_Pi0Secondaries_Mass;                //! transient Not filled, no point, we know the monteacrlo mass
-  TH1F * fMC_Pi0Secondaries_OpeningAngleGamma;   //! transient
-  TH1F * fMC_Pi0Secondaries_R;                   //! transient
-  TH2F * fMC_Pi0Secondaries_Z_R;                 //! transient
-  TH2F * fMC_Pi0Secondaries_X_Y;
-
-  TH1F * fMC_Eta_Eta;                            //! transient
-  TH1F * fMC_Eta_Phi;                            //! transient
-  TH1F * fMC_Eta_Pt;                             //! transient
-  TH1F * fMC_Eta_Energy;                         //! transient
-  TH1F * fMC_Eta_Mass;                           //! transient Not Filled, no point we know the montecarlo mass
-  TH1F * fMC_Eta_OpeningAngleGamma;              //! transient 
-  TH1F * fMC_Eta_R;                              //! transient We have very few eta secondaries, so the question is if we keep this
-  TH2F * fMC_Eta_Z_R;                            //! transient Same here, do we really need it?
-  TH2F * fMC_Eta_X_Y;                            //! transient all the etas has their vertex in a square in the collision point
-    
-  // Histograms from esd tracks
-  TH1F * fESD_EP_R;                              //! transient  
-  TH2F * fESD_EP_Z_R;                            //! transient
-  TH2F * fESD_EP_X_Y;                            //! transient
-  TH1F * fESD_EP_OpeningAngle;                   //! transient
-
-  TH1F * fESD_E_Energy;                          //! transient
-  TH1F * fESD_E_Pt;                              //! transient
-  TH1F * fESD_E_Eta;                             //! transient
-  TH1F * fESD_E_Phi;                             //! transient
-
-  TH1F * fESD_P_Energy;                          //! transient
-  TH1F * fESD_P_Pt;                              //! transient
-  TH1F * fESD_P_Eta;                             //! transient
-  TH1F * fESD_P_Phi;                             //! transient
-
-
-  TH1F * fESD_Gamma_Energy;                      //! transient
-  TH1F * fESD_Gamma_Pt;                          //! transient
-  TH1F * fESD_Gamma_Eta;                         //! transient
-  TH1F * fESD_Gamma_Phi;                         //! transient
-
-
-  //mapping
-  //begin double vector
-  typedef vector<TH2F *> fESDPhiRVector; //! transient  
-  vector<fESDPhiRVector> fESD_Mapping;    //! transient
-  //end double vector
-  vector<TH2F *> fESD_Mapping_Phi;               //! transient
-  vector<TH2F *> fESD_Mapping_R;                 //! transient
-
-  TH1F * fESD_Match_Gamma_OpeningAngle;          //! transient 
-  TH1F * fESD_Match_Gamma_Energy;                //! transient
-  TH1F * fESD_Match_Gamma_Pt;                    //! transient
-  TH1F * fESD_Match_Gamma_Eta;                   //! transient
-  TH1F * fESD_Match_Gamma_Phi;                   //! transient
-  TH1F * fESD_Match_Gamma_Mass;                  //! transient
-  TH1F * fESD_Match_Gamma_Width;                 //! transient
-  TH1F * fESD_Match_Gamma_Chi2;                  //! transient
-  TH1F * fESD_Match_Gamma_NDF;                   //! transient
-  TH1F * fESD_Match_Gamma_R;                     //! transient
-  TH2F * fESD_Match_Gamma_Z_R;                   //! transient
-  TH2F * fESD_Match_Gamma_X_Y;                   //! transient
-
-
-  TH1F * fESD_Pi0_OpeningAngleGamma;             //! transient
-  TH1F * fESD_Pi0_Energy;                        //! transient
-  TH1F * fESD_Pi0_Pt;                            //! transient
-  TH1F * fESD_Pi0_Eta;                           //! transient
-  TH1F * fESD_Pi0_Phi;                           //! transient
-  TH1F * fESD_Pi0_Mass;                          //! transient
-  TH1F * fESD_Pi0_R;                             //! transient
-  TH2F * fESD_Pi0_Z_R;                           //! transient
-  TH2F * fESD_Pi0_X_Y;                           //! transient
-
-  TH1F * fESD_Eta_OpeningAngleGamma;             //! transient
-  TH1F * fESD_Eta_Energy;                        //! transient
-  TH1F * fESD_Eta_Pt;                            //! transient
-  TH1F * fESD_Eta_Eta;                           //! transient
-  TH1F * fESD_Eta_Phi;                           //! transient
-  TH1F * fESD_Eta_Mass;                          //! transient
-  TH1F * fESD_Eta_R;                             //! transient
-  TH2F * fESD_Eta_Z_R;                           //! transient
-  TH2F * fESD_Eta_X_Y;                           //! transient
-
-  TH1F * fESD_Background_OpeningAngleGamma;      //! transient
-  TH1F * fESD_Background_Energy;                 //! transient
-  TH1F * fESD_Background_Pt;                     //! transient
-  TH1F * fESD_Background_Eta;                    //! transient
-  TH1F * fESD_Background_Phi;                    //! transient
-  TH1F * fESD_Background_Mass;                   //! transient
-  TH1F * fESD_Background_R;                      //! transient
-  TH2F * fESD_Background_Z_R;                    //! transient
-  TH2F * fESD_Background_X_Y;                    //! transient
-
-  TH2F * fResolution_dPt;                        //! transient
-  TH2F * fResolution_dR;                         //! transient
-  TH2F * fResolution_dZ;                         //! transient
-  
-  TH2F * fResolution_dR_dPt;                     //! transient
-
-  TH1F * fResolution_MC_Pt;                      //! transient
-  TH1F * fResolution_MC_R;                       //! transient
-  TH1F * fResolution_MC_Z;                       //! transient
-
-  TH1F * fResolution_ESD_Pt;                     //! transient
-  TH1F * fResolution_ESD_R;                      //! transient
-  TH1F * fResolution_ESD_Z;                      //! transient
-
-  TH1F * fNumberOfV0s;                           //! transient
-  TH1F * fNumberOfSurvivingV0s;                  //! transient
-
-  //  debug histograms
-  TH1F * fV0MassDebugCut1;                       //! transient
-  TH1F * fV0MassDebugCut2;                       //! transient
-  TH1F * fV0MassDebugCut3;                       //! transient
-  TH1F * fV0MassDebugCut4;                       //! transient
-  TH1F * fV0MassDebugCut5;                       //! transient
-  TH1F * fV0MassDebugCut6;                       //! transient
-  TH1F * fV0MassDebugCut7;                       //! transient
-  TH1F * fV0MassDebugCut8;                       //! transient
-
-
-  friend class AliAnalysisTaskGammaConversion;
-  friend class AliV0Reader;
-
-  ClassDef(AliGammaConversionHistograms,0)
-} ;
-
-
-#endif
-
-
-
+#ifndef ALIGAMMACONVERSIONHISTOGRAMS_H\r
+#define ALIGAMMACONVERSIONHISTOGRAMS_H\r
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ * See cxx source for full Copyright notice     */\r
+\r
+////////////////////////////////////////////////\r
+//--------------------------------------------- \r
+// Class used to do analysis on conversion pairs\r
+//---------------------------------------------\r
+////////////////////////////////////////////////\r
+\r
+#include "TString.h"\r
+//#include "TH1F.h"\r
+//#include "TH2F.h"\r
+#include "Riostream.h"\r
+#include <vector>\r
+//#include "TList.h"\r
+//#include "TMap.h"\r
+\r
+class TMap;\r
+class TList;\r
+class TH1F;\r
+class TH2F;\r
+\r
+class AliGammaConversionHistograms{\r
+\r
+ public: \r
+  \r
+  AliGammaConversionHistograms();                                                                  //constructor\r
+  AliGammaConversionHistograms(const AliGammaConversionHistograms & original);                     //copy constructor\r
+  AliGammaConversionHistograms & operator = (const AliGammaConversionHistograms & original);       //assignment operator\r
+  virtual ~AliGammaConversionHistograms();                                                         //virtual destructor\r
+  \r
+\r
+  //  TList * GetOutputContainer();\r
+  void GetOutputContainer(TList *fOutputContainer) const;\r
+  \r
+  Int_t GetRBin(Double_t radius) const;\r
+  Int_t GetPhiBin(Double_t phi) const;\r
+\r
+  void InitializeMappingValues(Int_t nPhiHistograms, Int_t nRHistograms, Int_t nBinsR, Double_t minRadius, Double_t maxRadius,Int_t nBinsPhi, Double_t minPhi, Double_t maxPhi);\r
+\r
+  void AddMappingHistograms(Int_t nPhiHistograms, Int_t nRHistograms,Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle="", TString yAxisTitle="");\r
+\r
+  /*\r
+   * Adds a TH1F histogram to the histogram map and create a key for it \r
+   */\r
+  void AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");\r
+\r
+  /*\r
+   * Adds a TH2F histogram to the histogram map and create a key for it \r
+   */\r
+  void AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle="", TString yAxisTitle="");\r
+\r
+  /*\r
+   * Fills a TH1F histogram with the given name with the given value \r
+   */\r
+  void FillHistogram(TString histogramName, Double_t xValue) const;\r
+\r
+  /*\r
+   * Fills a TH2F histogram with the given name with the given value \r
+   */\r
+  void FillHistogram(TString histogramName, Double_t xValue, Double_t yValue) const;\r
+\r
+ private:\r
+  TMap* fHistogramMap;\r
+\r
+  Int_t fNPhiIndex;\r
+  Int_t fNRIndex;\r
+  Double_t fMinRadius;\r
+  Double_t fMaxRadius;\r
+  Double_t fDeltaR;\r
+  Double_t fMinPhi;\r
+  Double_t fMaxPhi;\r
+  Double_t fDeltaPhi;\r
+  \r
+  ClassDef(AliGammaConversionHistograms,1)\r
+} ;\r
+\r
+\r
+#endif\r
+\r
+\r
+\r
index f97f2f781f44b012018e091b933031ca9d9eeafa..6c9291d670b0b1288c000586d1d8f11d8d58dbac 100644 (file)
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt                        *
- * Version 1.0                                                            *
- *                                                                        *
- * 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.                  *
- **************************************************************************/
-/**
- * Class for reading V0's
- */
-
-// --- ROOT system ---
-#include <TFormula.h>
-#include <TMath.h>
-
-//---- ANALYSIS system ----
-#include "AliV0Reader.h"
-#include "AliAnalysisManager.h"
-#include "AliESDInputHandler.h"
-#include "AliESDv0.h"
-#include "AliMCEvent.h"
-#include "AliKFVertex.h"
-#include <iostream>
-
-using namespace std;
-
-ClassImp(AliV0Reader)
-
-
-
-AliV0Reader::AliV0Reader() :
-  TObject(),
-  fCurrentEventGoodV0s(),
-  fPreviousEventGoodV0s(),
-  fMCStack(NULL),
-  fMCTruth(NULL),
-  fChain(NULL),
-  fESDHandler(NULL),
-  fESDEvent(NULL),
-  fHistograms(NULL),
-  fCurrentV0IndexNumber(0),
-  fCurrentV0(NULL),
-  fCurrentNegativeKFParticle(NULL),
-  fCurrentPositiveKFParticle(NULL),
-  fCurrentMotherKFCandidate(NULL),
-  fCurrentNegativeESDTrack(NULL),
-  fCurrentPositiveESDTrack(NULL),
-  fNegativeTrackLorentzVector(NULL),
-  fPositiveTrackLorentzVector(NULL),
-  fMotherCandidateLorentzVector(NULL),
-  fCurrentXValue(0),
-  fCurrentYValue(0),
-  fCurrentZValue(0),
-  fPositiveTrackPID(0),
-  fNegativeTrackPID(0),
-  fNegativeMCParticle(NULL),
-  fPositiveMCParticle(NULL),
-  fMotherMCParticle(NULL),
-  fMotherCandidateKFMass(0),
-  fMotherCandidateKFWidth(0),
-  fUseKFParticle(kTRUE),
-  fUseESDTrack(kFALSE),
-  fDoMC(kFALSE),
-  fMaxR(10000),// 100 meter(outside of ALICE)
-  fEtaCut(0.),
-  fPtCut(0.),
-  fChi2Cut(0.),
-  fPIDProbabilityCutNegativeParticle(0),
-  fPIDProbabilityCutPositiveParticle(0),
-  fXVertexCut(0.),
-  fYVertexCut(0.),
-  fZVertexCut(0.),
-  fNSigmaMass(0.),
-  fUseImprovedVertex(kFALSE)
-{
-
-}
-
-
-AliV0Reader::AliV0Reader(const AliV0Reader & original) :
-  TObject(original),
-  fCurrentEventGoodV0s(original.fCurrentEventGoodV0s),
-  fPreviousEventGoodV0s(original.fPreviousEventGoodV0s),
-  fMCStack(original.fMCStack),
-  fMCTruth(original.fMCTruth),
-  fChain(original.fChain),
-  fESDHandler(original.fESDHandler),
-  fESDEvent(original.fESDEvent),
-  fHistograms(original.fHistograms),
-  fCurrentV0IndexNumber(original.fCurrentV0IndexNumber),
-  fCurrentV0(original.fCurrentV0),
-  fCurrentNegativeKFParticle(original.fCurrentNegativeKFParticle),
-  fCurrentPositiveKFParticle(original.fCurrentPositiveKFParticle),
-  fCurrentMotherKFCandidate(original.fCurrentMotherKFCandidate),
-  fCurrentNegativeESDTrack(original.fCurrentNegativeESDTrack),
-  fCurrentPositiveESDTrack(original.fCurrentPositiveESDTrack),
-  fNegativeTrackLorentzVector(original.fNegativeTrackLorentzVector),
-  fPositiveTrackLorentzVector(original.fPositiveTrackLorentzVector),
-  fMotherCandidateLorentzVector(original.fMotherCandidateLorentzVector),
-  fCurrentXValue(original.fCurrentXValue),
-  fCurrentYValue(original.fCurrentYValue),
-  fCurrentZValue(original.fCurrentZValue),
-  fPositiveTrackPID(original.fPositiveTrackPID),
-  fNegativeTrackPID(original.fNegativeTrackPID),
-  fNegativeMCParticle(original.fNegativeMCParticle),
-  fPositiveMCParticle(original.fPositiveMCParticle),
-  fMotherMCParticle(original.fMotherMCParticle),
-  fMotherCandidateKFMass(original.fMotherCandidateKFMass),
-  fMotherCandidateKFWidth(original.fMotherCandidateKFWidth),
-  fUseKFParticle(kTRUE),
-  fUseESDTrack(kFALSE),
-  fDoMC(kFALSE),
-  fMaxR(original.fMaxR),
-  fEtaCut(original.fEtaCut),
-  fPtCut(original.fPtCut),
-  fChi2Cut(original.fChi2Cut),
-  fPIDProbabilityCutNegativeParticle(original.fPIDProbabilityCutNegativeParticle),
-  fPIDProbabilityCutPositiveParticle(original.fPIDProbabilityCutPositiveParticle),
-  fXVertexCut(original.fXVertexCut),
-  fYVertexCut(original.fYVertexCut),
-  fZVertexCut(original.fZVertexCut),
-  fNSigmaMass(original.fNSigmaMass),
-  fUseImprovedVertex(original.fUseImprovedVertex)
-{
-
-}
-
-
-AliV0Reader & AliV0Reader::operator = (const AliV0Reader & /*source*/)
-{
-  // assignment operator
-  return *this;
-}
-
-void AliV0Reader::Initialize(){
-  // Get the input handler from the manager
-  fESDHandler = (AliESDInputHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
-  if(fESDHandler == NULL){
-    //print warning here
-  }
-  
-  // Get pointer to esd event from input handler
-  fESDEvent = fESDHandler->GetEvent();
-  if(fESDEvent == NULL){
-    //print warning here
-  }
-
-  //Get pointer to MCTruth
-  fMCTruth = (AliMCEventHandler*)((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
-  if(fMCTruth == NULL){
-    //print warning here
-  }
-
-  //Get pointer to the mc stack
-  fMCStack = fMCTruth->MCEvent()->Stack();
-  if(fMCStack == NULL){
-    //print warning here
-  }
-
-  AliKFParticle::SetField(fESDEvent->GetMagneticField());
-
-}
-
-AliESDv0* AliV0Reader::GetV0(Int_t index){
-  fCurrentV0 = fESDEvent->GetV0(index);
-  UpdateV0Information();
-  return fCurrentV0;
-}
-
-
-Bool_t AliV0Reader::NextV0(){
-  Bool_t iResult=kFALSE;
-  while(fCurrentV0IndexNumber<fESDEvent->GetNumberOfV0s()){
-    fCurrentV0 = fESDEvent->GetV0(fCurrentV0IndexNumber);
-    
-   //checks if on the fly mode is set
-    if ( !fCurrentV0->GetOnFlyStatus() ){
-      fCurrentV0IndexNumber++;
-      if(fHistograms->fV0MassDebugCut1){fHistograms->fV0MassDebugCut1->Fill(GetMotherCandidateMass());}
-      continue;
-    }
-
-    if(fESDEvent->GetPrimaryVertex()->GetNContributors()<=0) {//checks if we have a vertex
-      fCurrentV0IndexNumber++;
-      if(fHistograms->fV0MassDebugCut2){fHistograms->fV0MassDebugCut2->Fill(GetMotherCandidateMass());}
-      continue;
-    }
-
-    if(CheckPIDProbability(fPIDProbabilityCutNegativeParticle,fPIDProbabilityCutPositiveParticle)==kFALSE){
-      fCurrentV0IndexNumber++;
-      if(fHistograms->fV0MassDebugCut3){fHistograms->fV0MassDebugCut3->Fill(GetMotherCandidateMass());}
-      continue;
-    }
-
-
-    fCurrentV0->GetXYZ(fCurrentXValue,fCurrentYValue,fCurrentZValue);
-    if(GetXYRadius()>fMaxR){ // cuts on distance from collision point
-      fCurrentV0IndexNumber++;
-      if(fHistograms->fV0MassDebugCut4){fHistograms->fV0MassDebugCut4->Fill(GetMotherCandidateMass());}
-      continue;
-    }
-
-    UpdateV0Information();
-        
-    if(fUseKFParticle){
-      if(fCurrentMotherKFCandidate->GetNDF()<=0){
-       fCurrentV0IndexNumber++;
-      if(fHistograms->fV0MassDebugCut5){fHistograms->fV0MassDebugCut5->Fill(GetMotherCandidateMass());}
-       continue;
-      }
-      Double_t chi2V0 = fCurrentMotherKFCandidate->GetChi2()/fCurrentMotherKFCandidate->GetNDF();
-      if(chi2V0 > fChi2Cut || chi2V0 <=0){
-       fCurrentV0IndexNumber++;
-      if(fHistograms->fV0MassDebugCut6){fHistograms->fV0MassDebugCut6->Fill(GetMotherCandidateMass());}
-       continue;
-      }
-      
-      if(TMath::Abs(fMotherCandidateLorentzVector->Eta())> fEtaCut){
-       fCurrentV0IndexNumber++;
-      if(fHistograms->fV0MassDebugCut7){fHistograms->fV0MassDebugCut7->Fill(GetMotherCandidateMass());}
-       continue;
-      }
-      
-      if(fMotherCandidateLorentzVector->Pt()<fPtCut){
-       fCurrentV0IndexNumber++;
-      if(fHistograms->fV0MassDebugCut8){fHistograms->fV0MassDebugCut8->Fill(GetMotherCandidateMass());}
-       continue;
-      }
-      
-    }
-    else if(fUseESDTrack){
-      //TODO
-    }
-
-    iResult=kTRUE;//means we have a v0 who survived all the cuts applied
-
-    fCurrentV0IndexNumber++;
-    
-    break;
-  }
-  return iResult; 
-}
-
-void AliV0Reader::UpdateV0Information(){
-    if(fCurrentNegativeKFParticle != NULL){
-      delete fCurrentNegativeKFParticle;
-      //      fCurrentNegativeKFParticle = NULL;
-    }
-    fCurrentNegativeKFParticle = new AliKFParticle(*(fCurrentV0->GetParamN()),fNegativeTrackPID);
-    
-    if(fCurrentPositiveKFParticle != NULL){
-      delete fCurrentPositiveKFParticle;
-      //      fCurrentPositiveKFParticle = NULL;
-    }
-    fCurrentPositiveKFParticle = new AliKFParticle(*(fCurrentV0->GetParamP()),fPositiveTrackPID);
-    
-    if(fCurrentMotherKFCandidate != NULL){
-      //      cout<<"fCurrentMotherKFCandidate: "<<fCurrentMotherKFCandidate<<endl;
-      delete fCurrentMotherKFCandidate;
-      //      fCurrentMotherKFCandidate = NULL;
-    }
-    fCurrentMotherKFCandidate = new AliKFParticle(*fCurrentNegativeKFParticle,*fCurrentPositiveKFParticle);
-
-    fCurrentNegativeESDTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex());
-
-    fCurrentPositiveESDTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex());
-
-    if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){
-      fCurrentMotherKFCandidate->SetMassConstraint(0,fNSigmaMass);
-    }
-
-    if(fUseImprovedVertex == kTRUE){
-      AliKFVertex primaryVertexImproved(*GetPrimaryVertex());
-      primaryVertexImproved+=*fCurrentMotherKFCandidate;
-      fCurrentMotherKFCandidate->SetProductionVertex(primaryVertexImproved);
-    }
-
-    fCurrentMotherKFCandidate->GetMass(fMotherCandidateKFMass,fMotherCandidateKFWidth);
-
-
-    if(fNegativeTrackLorentzVector != NULL){
-      delete fNegativeTrackLorentzVector;
-    }
-    if(fUseKFParticle){
-      fNegativeTrackLorentzVector = new TLorentzVector(fCurrentNegativeKFParticle->Px(),fCurrentNegativeKFParticle->Py(),fCurrentNegativeKFParticle->Pz());
-    }
-    else if(fUseESDTrack){
-      fNegativeTrackLorentzVector = new TLorentzVector(fCurrentNegativeESDTrack->Px(),fCurrentNegativeESDTrack->Py(),fCurrentNegativeESDTrack->Pz());
-    }
-
-    if(fPositiveTrackLorentzVector != NULL){
-      delete fPositiveTrackLorentzVector;
-    }
-    if(fUseKFParticle){
-      fPositiveTrackLorentzVector = new TLorentzVector(fCurrentPositiveKFParticle->Px(),fCurrentPositiveKFParticle->Py(),fCurrentPositiveKFParticle->Pz());
-    }
-    else if(fUseESDTrack){
-      fPositiveTrackLorentzVector = new TLorentzVector(fCurrentPositiveESDTrack->Px(),fCurrentPositiveESDTrack->Py(),fCurrentPositiveESDTrack->Pz());
-    }
-
-    if(fMotherCandidateLorentzVector != NULL){
-      delete fMotherCandidateLorentzVector;
-    }
-    if(fUseKFParticle){
-      fMotherCandidateLorentzVector = new TLorentzVector(*fNegativeTrackLorentzVector + *fPositiveTrackLorentzVector);
-       // new TLorentzVector(fCurrentMotherKFCandidate->Px(),fCurrentMotherKFCandidate->Py(),fCurrentMotherKFCandidate->Pz());
-    }
-    else if(fUseESDTrack){
-      fMotherCandidateLorentzVector = new TLorentzVector(*fNegativeTrackLorentzVector + *fPositiveTrackLorentzVector);
-       // new TLorentzVector(fCurrentNegativeESDTrack->Px()+fCurrentPositiveESDTrack->Px(),fCurrentNegativeESDTrack->Py()+fCurrentPositiveESDTrack->Py(),fCurrentNegativeESDTrack->Pz()+fCurrentPositiveESDTrack->Pz());
-    }
-
-    if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){
-      fMotherCandidateLorentzVector->SetXYZM(fMotherCandidateLorentzVector->Px() ,fMotherCandidateLorentzVector->Py(),fMotherCandidateLorentzVector->Pz(),0.); 
-    }
-    
-    if(fDoMC){
-      fNegativeMCParticle = fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetNindex())->GetLabel()));
-      fPositiveMCParticle = fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetPindex())->GetLabel()));
-    }
-}
-
-Bool_t AliV0Reader::HasSameMCMother(){
-  Bool_t iResult = kFALSE;
-  if(fDoMC == kTRUE){
-    if(fNegativeMCParticle != NULL && fPositiveMCParticle != NULL){
-      if(fNegativeMCParticle->GetMother(0) == fPositiveMCParticle->GetMother(0))
-       fMotherMCParticle = fMCStack->Particle(fPositiveMCParticle->GetMother(0));
-       iResult = kTRUE;
-      }
-  }
-  return iResult;
-}
-
-AliKFParticle* AliV0Reader::GetNegativeKFParticle(){
-  return fCurrentNegativeKFParticle;
-}
-
-AliKFParticle* AliV0Reader::GetPositiveKFParticle(){
-  return fCurrentPositiveKFParticle;
-}
-
-AliKFParticle* AliV0Reader::GetMotherCandidateKFCombination(){
-  return fCurrentMotherKFCandidate;
-}
-
-Bool_t AliV0Reader::CheckPIDProbability(Double_t negProbCut, Double_t posProbCut){
-  Bool_t iResult=kFALSE;
-
-  Double_t *posProbArray = new Double_t[10];
-  Double_t *negProbArray = new Double_t[10];
-  AliESDtrack* negTrack  = fESDEvent->GetTrack(fCurrentV0->GetNindex());
-  AliESDtrack* posTrack  = fESDEvent->GetTrack(fCurrentV0->GetPindex());
-  
-  negTrack->GetTPCpid(negProbArray);
-  posTrack->GetTPCpid(posProbArray);
-
-  if(negProbArray!=NULL && posProbArray!=NULL){
-    if(negProbArray[GetSpeciesIndex(-1)]>=negProbCut && posProbArray[GetSpeciesIndex(1)]>=posProbCut){
-      iResult=kTRUE;
-    }
-  }
-  delete [] posProbArray;
-  delete [] negProbArray;
-  return iResult;
-}
-
-void AliV0Reader::UpdateEventByEventData(){
-  fPreviousEventGoodV0s.clear();
-  fPreviousEventGoodV0s = fCurrentEventGoodV0s;
-  fCurrentEventGoodV0s.clear();
-  
-  fCurrentV0IndexNumber=0;
-}
-
-Double_t AliV0Reader::GetNegativeTrackPhi(){
-  Double_t offset=0;
-  if(fNegativeTrackLorentzVector->Phi()> TMath::Pi()){
-    offset = -2*TMath::Pi();
-  }
-  return fNegativeTrackLorentzVector->Phi()+offset;
-}
-
-Double_t AliV0Reader::GetPositiveTrackPhi(){
-  Double_t offset=0;
-  if(fPositiveTrackLorentzVector->Phi()> TMath::Pi()){
-    offset = -2*TMath::Pi();
-  }
-  return fPositiveTrackLorentzVector->Phi()+offset;
-}
-
-Double_t AliV0Reader::GetMotherCandidatePhi(){
-  Double_t offset=0;
-  if(fMotherCandidateLorentzVector->Phi()> TMath::Pi()){
-    offset = -2*TMath::Pi();
-  }
-  return fMotherCandidateLorentzVector->Phi()+offset;
-}
-
-Int_t AliV0Reader::GetSpeciesIndex(Int_t chargeOfTrack){
-
-  Int_t iResult = 10; // Unknown particle
-
-  if(chargeOfTrack==-1){ //negative track
-    switch(abs(fNegativeTrackPID)){
-    case 11:       //electron
-      iResult = 0;
-      break;
-    case 13:       //muon
-      iResult = 1;
-      break;
-    case 211:      //pion
-      iResult = 2;
-      break;
-    case 321:      //kaon
-      iResult = 3;
-      break;
-    case 2212:     //proton
-      iResult = 4;
-      break;
-    case 22:       //photon
-      iResult = 5;
-      break;
-    case 111:      //pi0
-      iResult = 6;
-      break;
-    case 2112:     //neutron
-      iResult = 7;
-      break;
-    case 311:      //K0
-      iResult = 8;
-      break;
-      
-      //Put in here for kSPECIES::kEleCon  ????
-    }
-  }
-  else if(chargeOfTrack==1){ //positive track
-    switch(abs(fPositiveTrackPID)){
-    case 11:       //electron
-      iResult = 0;
-      break;
-    case 13:       //muon
-      iResult = 1;
-      break;
-    case 211:      //pion
-      iResult = 2;
-      break;
-    case 321:      //kaon
-      iResult = 3;
-      break;
-    case 2212:     //proton
-      iResult = 4;
-      break;
-    case 22:       //photon
-      iResult = 5;
-      break;
-    case 111:      //pi0
-      iResult = 6;
-      break;
-    case 2112:     //neutron
-      iResult = 7;
-      break;
-    case 311:      //K0
-      iResult = 8;
-      break;
-
-      //Put in here for kSPECIES::kEleCon  ????
-    }
-  }
-  else{
-    //Wrong parameter.. Print warning
-  }
-  return iResult;
-}
+/**************************************************************************\r
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ *                                                                        *\r
+ * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt                        *\r
+ * Version 1.0                                                            *\r
+ *                                                                        *\r
+ * Permission to use, copy, modify and distribute this software and its   *\r
+ * documentation strictly for non-commercial purposes is hereby granted   *\r
+ * without fee, provided that the above copyright notice appears in all   *\r
+ * copies and that both the copyright notice and this permission notice   *\r
+ * appear in the supporting documentation. The authors make no claims     *\r
+ * about the suitability of this software for any purpose. It is          *\r
+ * provided "as is" without express or implied warranty.                  *\r
+ **************************************************************************/\r
+\r
+////////////////////////////////////////////////\r
+//--------------------------------------------- \r
+// Class used to do analysis on conversion pairs\r
+//---------------------------------------------\r
+////////////////////////////////////////////////\r
+\r
+// --- ROOT system ---\r
+#include <TMath.h>\r
+\r
+//---- ANALYSIS system ----\r
+#include "AliV0Reader.h"\r
+#include "AliAnalysisManager.h"\r
+#include "AliESDInputHandler.h"\r
+#include "AliMCEvent.h"\r
+#include "AliKFVertex.h"\r
+\r
+#include "AliStack.h"\r
+#include "AliMCEventHandler.h"\r
+\r
+\r
+class iostream;\r
+class AliESDv0;\r
+class TFormula;\r
+\r
+using namespace std;\r
+\r
+ClassImp(AliV0Reader)\r
+\r
+\r
+\r
+  AliV0Reader::AliV0Reader() :\r
+    TObject(),\r
+    fMCStack(NULL),\r
+    fMCTruth(NULL),\r
+    fChain(NULL),\r
+    fESDHandler(NULL),\r
+    fESDEvent(NULL),\r
+    fHistograms(NULL),\r
+    fCurrentV0IndexNumber(0),\r
+    fCurrentV0(NULL),\r
+    fCurrentNegativeKFParticle(NULL),\r
+    fCurrentPositiveKFParticle(NULL),\r
+    fCurrentMotherKFCandidate(NULL),\r
+    fCurrentNegativeESDTrack(NULL),\r
+    fCurrentPositiveESDTrack(NULL),\r
+    fNegativeTrackLorentzVector(NULL),\r
+    fPositiveTrackLorentzVector(NULL),\r
+    fMotherCandidateLorentzVector(NULL),\r
+    fCurrentXValue(0),\r
+    fCurrentYValue(0),\r
+    fCurrentZValue(0),\r
+    fPositiveTrackPID(0),\r
+    fNegativeTrackPID(0),\r
+    fNegativeMCParticle(NULL),\r
+    fPositiveMCParticle(NULL),\r
+    fMotherMCParticle(NULL),\r
+    fMotherCandidateKFMass(0),\r
+    fMotherCandidateKFWidth(0),\r
+    fUseKFParticle(kTRUE),\r
+    fUseESDTrack(kFALSE),\r
+    fDoMC(kFALSE),\r
+    fMaxR(10000),// 100 meter(outside of ALICE)\r
+    fEtaCut(0.),\r
+    fPtCut(0.),\r
+    fChi2Cut(0.),\r
+    fPIDProbabilityCutNegativeParticle(0),\r
+    fPIDProbabilityCutPositiveParticle(0),\r
+    fXVertexCut(0.),\r
+    fYVertexCut(0.),\r
+    fZVertexCut(0.),\r
+    fNSigmaMass(0.),\r
+    fUseImprovedVertex(kFALSE),\r
+    fCurrentEventGoodV0s(),\r
+    fPreviousEventGoodV0s()\r
+{\r
+\r
+}\r
+\r
+\r
+AliV0Reader::AliV0Reader(const AliV0Reader & original) :\r
+  TObject(original),\r
+  fMCStack(original.fMCStack),\r
+  fMCTruth(original.fMCTruth),\r
+  fChain(original.fChain),\r
+  fESDHandler(original.fESDHandler),\r
+  fESDEvent(original.fESDEvent),\r
+  fHistograms(original.fHistograms),\r
+  fCurrentV0IndexNumber(original.fCurrentV0IndexNumber),\r
+  fCurrentV0(original.fCurrentV0),\r
+  fCurrentNegativeKFParticle(original.fCurrentNegativeKFParticle),\r
+  fCurrentPositiveKFParticle(original.fCurrentPositiveKFParticle),\r
+  fCurrentMotherKFCandidate(original.fCurrentMotherKFCandidate),\r
+  fCurrentNegativeESDTrack(original.fCurrentNegativeESDTrack),\r
+  fCurrentPositiveESDTrack(original.fCurrentPositiveESDTrack),\r
+  fNegativeTrackLorentzVector(original.fNegativeTrackLorentzVector),\r
+  fPositiveTrackLorentzVector(original.fPositiveTrackLorentzVector),\r
+  fMotherCandidateLorentzVector(original.fMotherCandidateLorentzVector),\r
+  fCurrentXValue(original.fCurrentXValue),\r
+  fCurrentYValue(original.fCurrentYValue),\r
+  fCurrentZValue(original.fCurrentZValue),\r
+  fPositiveTrackPID(original.fPositiveTrackPID),\r
+  fNegativeTrackPID(original.fNegativeTrackPID),\r
+  fNegativeMCParticle(original.fNegativeMCParticle),\r
+  fPositiveMCParticle(original.fPositiveMCParticle),\r
+  fMotherMCParticle(original.fMotherMCParticle),\r
+  fMotherCandidateKFMass(original.fMotherCandidateKFMass),\r
+  fMotherCandidateKFWidth(original.fMotherCandidateKFWidth),\r
+  fUseKFParticle(kTRUE),\r
+  fUseESDTrack(kFALSE),\r
+  fDoMC(kFALSE),\r
+  fMaxR(original.fMaxR),\r
+  fEtaCut(original.fEtaCut),\r
+  fPtCut(original.fPtCut),\r
+  fChi2Cut(original.fChi2Cut),\r
+  fPIDProbabilityCutNegativeParticle(original.fPIDProbabilityCutNegativeParticle),\r
+  fPIDProbabilityCutPositiveParticle(original.fPIDProbabilityCutPositiveParticle),\r
+  fXVertexCut(original.fXVertexCut),\r
+  fYVertexCut(original.fYVertexCut),\r
+  fZVertexCut(original.fZVertexCut),\r
+  fNSigmaMass(original.fNSigmaMass),\r
+  fUseImprovedVertex(original.fUseImprovedVertex),\r
+  fCurrentEventGoodV0s(original.fCurrentEventGoodV0s),\r
+  fPreviousEventGoodV0s(original.fPreviousEventGoodV0s)\r
+{\r
+\r
+}\r
+\r
+\r
+AliV0Reader & AliV0Reader::operator = (const AliV0Reader & /*source*/)\r
+{\r
+  // assignment operator\r
+  return *this;\r
+}\r
+\r
+void AliV0Reader::Initialize(){\r
+  //see header file for documentation\r
+\r
+  // Get the input handler from the manager\r
+  fESDHandler = (AliESDInputHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());\r
+  if(fESDHandler == NULL){\r
+    //print warning here\r
+  }\r
+  \r
+  // Get pointer to esd event from input handler\r
+  fESDEvent = fESDHandler->GetEvent();\r
+  if(fESDEvent == NULL){\r
+    //print warning here\r
+  }\r
+\r
+  //Get pointer to MCTruth\r
+  fMCTruth = (AliMCEventHandler*)((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());\r
+  if(fMCTruth == NULL){\r
+    //print warning here\r
+  }\r
+\r
+  //Get pointer to the mc stack\r
+  fMCStack = fMCTruth->MCEvent()->Stack();\r
+  if(fMCStack == NULL){\r
+    //print warning here\r
+  }\r
+\r
+  AliKFParticle::SetField(fESDEvent->GetMagneticField());\r
+\r
+}\r
+\r
+AliESDv0* AliV0Reader::GetV0(Int_t index){\r
+  //see header file for documentation\r
+\r
+  fCurrentV0 = fESDEvent->GetV0(index);\r
+  UpdateV0Information();\r
+  return fCurrentV0;\r
+}\r
+\r
+\r
+Bool_t AliV0Reader::NextV0(){\r
+  //see header file for documentation\r
+\r
+  Bool_t iResult=kFALSE;\r
+  while(fCurrentV0IndexNumber<fESDEvent->GetNumberOfV0s()){\r
+    fCurrentV0 = fESDEvent->GetV0(fCurrentV0IndexNumber);\r
+    \r
+    //checks if on the fly mode is set\r
+    if ( !fCurrentV0->GetOnFlyStatus() ){\r
+      fCurrentV0IndexNumber++;\r
+      fHistograms->FillHistogram("V0MassDebugCut1",GetMotherCandidateMass());\r
+      continue;\r
+    }\r
+\r
+    if(fESDEvent->GetPrimaryVertex()->GetNContributors()<=0) {//checks if we have a vertex\r
+      fCurrentV0IndexNumber++;\r
+      fHistograms->FillHistogram("V0MassDebugCut2",GetMotherCandidateMass());\r
+      continue;\r
+    }\r
+\r
+    if(CheckPIDProbability(fPIDProbabilityCutNegativeParticle,fPIDProbabilityCutPositiveParticle)==kFALSE){\r
+      fCurrentV0IndexNumber++;\r
+      fHistograms->FillHistogram("V0MassDebugCut3",GetMotherCandidateMass());\r
+      continue;\r
+    }\r
+\r
+\r
+    fCurrentV0->GetXYZ(fCurrentXValue,fCurrentYValue,fCurrentZValue);\r
\r
+    if(GetXYRadius()>fMaxR){ // cuts on distance from collision point\r
+      fCurrentV0IndexNumber++;\r
+      fHistograms->FillHistogram("V0MassDebugCut4",GetMotherCandidateMass());\r
+      continue;\r
+    }\r
+\r
+    UpdateV0Information();\r
+        \r
+    if(fUseKFParticle){\r
+      if(fCurrentMotherKFCandidate->GetNDF()<=0){\r
+       fCurrentV0IndexNumber++;\r
+       fHistograms->FillHistogram("V0MassDebugCut5",GetMotherCandidateMass());\r
+       continue;\r
+      }\r
+      Double_t chi2V0 = fCurrentMotherKFCandidate->GetChi2()/fCurrentMotherKFCandidate->GetNDF();\r
+      if(chi2V0 > fChi2Cut || chi2V0 <=0){\r
+       fCurrentV0IndexNumber++;\r
+       fHistograms->FillHistogram("V0MassDebugCut6",GetMotherCandidateMass());\r
+       continue;\r
+      }\r
+      \r
+      if(TMath::Abs(fMotherCandidateLorentzVector->Eta())> fEtaCut){\r
+       fCurrentV0IndexNumber++;\r
+       fHistograms->FillHistogram("V0MassDebugCut7",GetMotherCandidateMass());\r
+       continue;\r
+      }\r
+      \r
+      if(fMotherCandidateLorentzVector->Pt()<fPtCut){\r
+       fCurrentV0IndexNumber++;\r
+       fHistograms->FillHistogram("V0MassDebugCut8",GetMotherCandidateMass());\r
+       continue;\r
+      }\r
+      \r
+    }\r
+    else if(fUseESDTrack){\r
+      //TODO\r
+    }\r
+\r
+    iResult=kTRUE;//means we have a v0 who survived all the cuts applied\r
+\r
+    fCurrentV0IndexNumber++;\r
+    \r
+    break;\r
+  }\r
+  return iResult; \r
+}\r
+\r
+void AliV0Reader::UpdateV0Information(){\r
+  //see header file for documentation\r
+  \r
+  if(fCurrentNegativeKFParticle != NULL){\r
+    delete fCurrentNegativeKFParticle;\r
+  }\r
+  fCurrentNegativeKFParticle = new AliKFParticle(*(fCurrentV0->GetParamN()),fNegativeTrackPID);\r
+  \r
+  if(fCurrentPositiveKFParticle != NULL){\r
+    delete fCurrentPositiveKFParticle;\r
+  }\r
+  fCurrentPositiveKFParticle = new AliKFParticle(*(fCurrentV0->GetParamP()),fPositiveTrackPID);\r
+    \r
+  if(fCurrentMotherKFCandidate != NULL){\r
+    delete fCurrentMotherKFCandidate;\r
+  }\r
+  fCurrentMotherKFCandidate = new AliKFParticle(*fCurrentNegativeKFParticle,*fCurrentPositiveKFParticle);\r
+\r
+  fCurrentNegativeESDTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex());\r
+\r
+  fCurrentPositiveESDTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex());\r
+\r
+  if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){\r
+    fCurrentMotherKFCandidate->SetMassConstraint(0,fNSigmaMass);\r
+  }\r
+\r
+  if(fUseImprovedVertex == kTRUE){\r
+    AliKFVertex primaryVertexImproved(*GetPrimaryVertex());\r
+    primaryVertexImproved+=*fCurrentMotherKFCandidate;\r
+    fCurrentMotherKFCandidate->SetProductionVertex(primaryVertexImproved);\r
+  }\r
+\r
+  fCurrentMotherKFCandidate->GetMass(fMotherCandidateKFMass,fMotherCandidateKFWidth);\r
+\r
+\r
+  if(fNegativeTrackLorentzVector != NULL){\r
+    delete fNegativeTrackLorentzVector;\r
+  }\r
+  if(fUseKFParticle){\r
+    fNegativeTrackLorentzVector = new TLorentzVector(fCurrentNegativeKFParticle->Px(),fCurrentNegativeKFParticle->Py(),fCurrentNegativeKFParticle->Pz());\r
+  }\r
+  else if(fUseESDTrack){\r
+    fNegativeTrackLorentzVector = new TLorentzVector(fCurrentNegativeESDTrack->Px(),fCurrentNegativeESDTrack->Py(),fCurrentNegativeESDTrack->Pz());\r
+  }\r
+\r
+  if(fPositiveTrackLorentzVector != NULL){\r
+    delete fPositiveTrackLorentzVector;\r
+  }\r
+  if(fUseKFParticle){\r
+    fPositiveTrackLorentzVector = new TLorentzVector(fCurrentPositiveKFParticle->Px(),fCurrentPositiveKFParticle->Py(),fCurrentPositiveKFParticle->Pz());\r
+  }\r
+  else if(fUseESDTrack){\r
+    fPositiveTrackLorentzVector = new TLorentzVector(fCurrentPositiveESDTrack->Px(),fCurrentPositiveESDTrack->Py(),fCurrentPositiveESDTrack->Pz());\r
+  }\r
+\r
+  if(fMotherCandidateLorentzVector != NULL){\r
+    delete fMotherCandidateLorentzVector;\r
+  }\r
+  if(fUseKFParticle){\r
+    fMotherCandidateLorentzVector = new TLorentzVector(*fNegativeTrackLorentzVector + *fPositiveTrackLorentzVector);\r
+  }\r
+  else if(fUseESDTrack){\r
+    fMotherCandidateLorentzVector = new TLorentzVector(*fNegativeTrackLorentzVector + *fPositiveTrackLorentzVector);\r
+  }\r
+\r
+  if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){\r
+    fMotherCandidateLorentzVector->SetXYZM(fMotherCandidateLorentzVector->Px() ,fMotherCandidateLorentzVector->Py(),fMotherCandidateLorentzVector->Pz(),0.); \r
+  }\r
+    \r
+  if(fDoMC){\r
+    fNegativeMCParticle = fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetNindex())->GetLabel()));\r
+    fPositiveMCParticle = fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetPindex())->GetLabel()));\r
+  }\r
+}\r
+\r
+Bool_t AliV0Reader::HasSameMCMother(){\r
+  //see header file for documentation\r
+\r
+  Bool_t iResult = kFALSE;\r
+  if(fDoMC == kTRUE){\r
+    if(fNegativeMCParticle != NULL && fPositiveMCParticle != NULL){\r
+      if(fNegativeMCParticle->GetMother(0) == fPositiveMCParticle->GetMother(0))\r
+       fMotherMCParticle = fMCStack->Particle(fPositiveMCParticle->GetMother(0));\r
+      iResult = kTRUE;\r
+    }\r
+  }\r
+  return iResult;\r
+}\r
+\r
+Bool_t AliV0Reader::CheckPIDProbability(Double_t negProbCut, Double_t posProbCut){\r
+  //see header file for documentation\r
+\r
+  Bool_t iResult=kFALSE;\r
+\r
+  Double_t *posProbArray = new Double_t[10];\r
+  Double_t *negProbArray = new Double_t[10];\r
+  AliESDtrack* negTrack  = fESDEvent->GetTrack(fCurrentV0->GetNindex());\r
+  AliESDtrack* posTrack  = fESDEvent->GetTrack(fCurrentV0->GetPindex());\r
+  \r
+  negTrack->GetTPCpid(negProbArray);\r
+  posTrack->GetTPCpid(posProbArray);\r
+\r
+  if(negProbArray!=NULL && posProbArray!=NULL){\r
+    if(negProbArray[GetSpeciesIndex(-1)]>=negProbCut && posProbArray[GetSpeciesIndex(1)]>=posProbCut){\r
+      iResult=kTRUE;\r
+    }\r
+  }\r
+  delete [] posProbArray;\r
+  delete [] negProbArray;\r
+  return iResult;\r
+}\r
+\r
+void AliV0Reader::UpdateEventByEventData(){\r
+  //see header file for documentation\r
+\r
+  if(fCurrentEventGoodV0s.size() >0 ){\r
+    fPreviousEventGoodV0s.clear();\r
+    fPreviousEventGoodV0s = fCurrentEventGoodV0s;\r
+  }\r
+  fCurrentEventGoodV0s.clear();\r
+  \r
+  fCurrentV0IndexNumber=0;\r
+}\r
+\r
+Double_t AliV0Reader::GetNegativeTrackPhi() const{\r
+  //see header file for documentation\r
+\r
+  Double_t offset=0;\r
+  if(fNegativeTrackLorentzVector->Phi()> TMath::Pi()){\r
+    offset = -2*TMath::Pi();\r
+  }\r
+  return fNegativeTrackLorentzVector->Phi()+offset;\r
+}\r
+\r
+Double_t AliV0Reader::GetPositiveTrackPhi() const{\r
+  //see header file for documentation\r
+\r
+  Double_t offset=0;\r
+  if(fPositiveTrackLorentzVector->Phi()> TMath::Pi()){\r
+    offset = -2*TMath::Pi();\r
+  }\r
+  return fPositiveTrackLorentzVector->Phi()+offset;\r
+}\r
+\r
+Double_t AliV0Reader::GetMotherCandidatePhi() const{\r
+  //see header file for documentation\r
+\r
+  Double_t offset=0;\r
+  if(fMotherCandidateLorentzVector->Phi()> TMath::Pi()){\r
+    offset = -2*TMath::Pi();\r
+  }\r
+  return fMotherCandidateLorentzVector->Phi()+offset;\r
+}\r
+\r
+Int_t AliV0Reader::GetSpeciesIndex(Int_t chargeOfTrack){\r
+  //see header file for documentation\r
+\r
+  Int_t iResult = 10; // Unknown particle\r
+\r
+  if(chargeOfTrack==-1){ //negative track\r
+    switch(abs(fNegativeTrackPID)){\r
+    case 11:       //electron\r
+      iResult = 0;\r
+      break;\r
+    case 13:       //muon\r
+      iResult = 1;\r
+      break;\r
+    case 211:      //pion\r
+      iResult = 2;\r
+      break;\r
+    case 321:      //kaon\r
+      iResult = 3;\r
+      break;\r
+    case 2212:     //proton\r
+      iResult = 4;\r
+      break;\r
+    case 22:       //photon\r
+      iResult = 5;\r
+      break;\r
+    case 111:      //pi0\r
+      iResult = 6;\r
+      break;\r
+    case 2112:     //neutron\r
+      iResult = 7;\r
+      break;\r
+    case 311:      //K0\r
+      iResult = 8;\r
+      break;\r
+      \r
+      //Put in here for kSPECIES::kEleCon  ????\r
+    }\r
+  }\r
+  else if(chargeOfTrack==1){ //positive track\r
+    switch(abs(fPositiveTrackPID)){\r
+    case 11:       //electron\r
+      iResult = 0;\r
+      break;\r
+    case 13:       //muon\r
+      iResult = 1;\r
+      break;\r
+    case 211:      //pion\r
+      iResult = 2;\r
+      break;\r
+    case 321:      //kaon\r
+      iResult = 3;\r
+      break;\r
+    case 2212:     //proton\r
+      iResult = 4;\r
+      break;\r
+    case 22:       //photon\r
+      iResult = 5;\r
+      break;\r
+    case 111:      //pi0\r
+      iResult = 6;\r
+      break;\r
+    case 2112:     //neutron\r
+      iResult = 7;\r
+      break;\r
+    case 311:      //K0\r
+      iResult = 8;\r
+      break;\r
+\r
+      //Put in here for kSPECIES::kEleCon  ????\r
+    }\r
+  }\r
+  else{\r
+    //Wrong parameter.. Print warning\r
+  }\r
+  return iResult;\r
+}\r
index fd2ec0434d20b5257831b7712fb3cfdae27a92ab..94f1d3f691e0c29f89248d2a48da99860ac7a879 100644 (file)
-#ifndef ALIV0READER_H
-#define ALIV0READER_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice     */
-
-
-// --- ROOT system ---
-#include "TObject.h" 
-#include "TChain.h"
-#include "AliESDv0.h"
-#include "AliESDVertex.h"
-#include "AliESDInputHandler.h"
-#include "AliMCEventHandler.h"
-#include "AliESDEvent.h"
-#include "AliESDtrack.h"
-#include "AliKFParticle.h"
-#include "TParticle.h"
-#include "AliStack.h"
-#include "AliGammaConversionHistograms.h"
-#include <vector>
-
-class TClonesArray ; 
-class TFormula ;
-class TParticle ; 
-class Riostream ;
-class TChain;
-//--- AliRoot system ---
-
-class AliStack ;
-class AliESDEvent ; 
-class AliMCEventHandler;
-class AliLog ;
-
-class AliV0Reader : public TObject {
-
- public: 
-
-  AliV0Reader();                                        //constructor
-  AliV0Reader(const AliV0Reader & g);                   //copy constructor
-  AliV0Reader & operator = (const AliV0Reader & g);     //assignment operator
-  virtual ~AliV0Reader() {;}                            //virtual destructor
-  /*
-   *Initialize the reader
-   */
-  void Initialize();
-
-  /*
-   *Returns the number of v0s in the event, no cuts applied.
-   */
-  Int_t GetNumberOfV0s(){return fESDEvent->GetNumberOfV0s();}
-
-  /*
-   * Check if there are any more good v0s left in the v0 stack
-   * if so, fCurrent v0 is set to this v0 and can be retrieved
-   * by GetCurrentV0 function.
-   * returns kFALSE if there is no more good v0s in the v0 stack
-   */
-  Bool_t NextV0();
-  
-  /*
-   * Returns the v0 at the given index, no checks are done on the v0. 
-   */
-  AliESDv0* GetV0(Int_t index);
-
-  /*
-   * Returns the current v0
-   */
-  AliESDv0* GetCurrentV0(){return fCurrentV0;}
-
-  /*
-   * Returns the negative ESD track which belongs to fCurrentV0
-   */
-  AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());}
-
-  /*
-   * Returns the positive ESD track which belongs to fCurrentV0
-   */
-  AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());}
-
-  /*
-   * Returns the negative KF particle which belongs to fCurrentV0
-   */
-  AliKFParticle* GetNegativeKFParticle();
-
-  /*
-   * Returns the positive KF particle which belongs to fCurrentV0
-   */
-  AliKFParticle* GetPositiveKFParticle();
-  /*
-   * Returns the KFParticle object of the 2 tracks.
-   */
-  AliKFParticle* GetMotherCandidateKFCombination();
-  /*
-   * Checks the probablity that the PID of the particle is what we want it to be.
-   */
-  Bool_t CheckPIDProbability(Double_t negProbCut, Double_t posProbCut);
-
-  /*
-   *Get the negative MC TParticle from the stack 
-   */
-  TParticle * GetNegativeMCParticle(){return fNegativeMCParticle;}//fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetNindex())->GetLabel()));}
-
-  /*
-   *Get the positive MC TParticle from the stack 
-   */
-  TParticle * GetPositiveMCParticle(){return fPositiveMCParticle;}//{return fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetPindex())->GetLabel()));}
-
-  /*
-   *Get the mother MC TParticle from the stack 
-   */
-  TParticle * GetMotherMCParticle(){return fMotherMCParticle;}
-
-  Bool_t HasSameMCMother();
-
-  /*
-   *Get the MC stack 
-   */
-  AliStack* GetMCStack(){return fMCStack;}
-
-  /*
-   *Get the magnetic field from the ESD event 
-   */
-  Double_t GetMagneticField(){return fESDEvent->GetMagneticField();}
-
-  /*
-   *Get the primary vertex from the esd event
-   */
-  const AliESDVertex *GetPrimaryVertex() const {return fESDEvent->GetPrimaryVertex();}
-
-  /*
-   * Set the PID of the negative track
-   */
-  void SetNegativeTrackPID(Int_t negTrackPID){fNegativeTrackPID=negTrackPID;}
-
-  /*
-   * Set the PID of the positive track
-   */
-  void SetPositiveTrackPID(Int_t posTrackPID){fPositiveTrackPID=posTrackPID;}
-
-  /*
-   * Set the flag to use the kfparticle class. Will also disable the use of esd tracks
-   */
-  void UseKFParticle(){fUseKFParticle = kTRUE; fUseESDTrack = kFALSE;}
-
-  /*
-   *  Set the flag to use the esd track class. Will also disable the use of kf particles
-   */
-  void UseESDTrack(){fUseESDTrack = kTRUE; fUseKFParticle = kFALSE;}
-
-  /*
-   *  Set the flag to use improved vertex or not
-   */
-  void SetUseImprovedVertex(Bool_t useImprovedVertex){fUseImprovedVertex=useImprovedVertex;}
-
-  /*
-   * Return the number in the species array belonging to the negative or positive track pid.
-   */
-  Int_t GetSpeciesIndex(Int_t chargeOfTrack);
-
-  /*
-   * Return the x coordinate of the v0
-   */
-  Double_t GetX(){return fCurrentXValue;}
-
-  /*
-   * Return the y coordinate of the v0
-   */
-  Double_t GetY(){return fCurrentYValue;}
-
-  /*
-   * Return the Z coordinate of the v0
-   */
-  Double_t GetZ(){return fCurrentZValue;}
-
-  /*
-   * Return the radius of the v0
-   */
-  Double_t GetXYRadius(){return sqrt((Double_t)(fCurrentXValue*fCurrentXValue + fCurrentYValue*fCurrentYValue));}
-
-  /*
-   * Get the opening angle between the two tracks
-   */
-  Double_t GetOpeningAngle(){return fNegativeTrackLorentzVector->Angle(fPositiveTrackLorentzVector->Vect());}
-
-  Double_t GetNegativeTrackEnergy(){return fCurrentNegativeKFParticle->E();}
-  Double_t GetPositiveTrackEnergy(){return fCurrentPositiveKFParticle->E();}
-  Double_t GetMotherCandidateEnergy(){return fCurrentMotherKFCandidate->E();}
-
-  Double_t GetNegativeTrackPt(){return fNegativeTrackLorentzVector->Pt();}
-  Double_t GetPositiveTrackPt(){return fPositiveTrackLorentzVector->Pt();}
-  Double_t GetMotherCandidatePt(){return fMotherCandidateLorentzVector->Pt();}
-
-  Double_t GetNegativeTrackEta(){return fNegativeTrackLorentzVector->Eta();}
-  Double_t GetPositiveTrackEta(){return fPositiveTrackLorentzVector->Eta();}
-  Double_t GetMotherCandidateEta(){return fMotherCandidateLorentzVector->Eta();}
-
-  Double_t GetMotherCandidateNDF(){return fCurrentMotherKFCandidate->GetNDF();}
-  Double_t GetMotherCandidateChi2(){return fCurrentMotherKFCandidate->GetChi2();}
-  Double_t GetMotherCandidateMass(){return fMotherCandidateKFMass;}
-  Double_t GetMotherCandidateWidth(){return fMotherCandidateKFWidth;}
-
-  Double_t GetNegativeTrackPhi();
-  Double_t GetPositiveTrackPhi();
-  Double_t GetMotherCandidatePhi();
-
-  void UpdateEventByEventData();
-  
-  Double_t GetMaxRCut(){return fMaxR;}
-  Double_t GetEtaCut(){return fEtaCut;}
-  Double_t GetPtCut(){return fPtCut;}
-  Double_t GetChi2Cut(){return fChi2Cut;}
-
-  void SetMaxRCut(Double_t maxR){fMaxR=maxR;}
-  void SetEtaCut(Double_t etaCut){fEtaCut=etaCut;}
-  void SetPtCut(Double_t ptCut){fPtCut=ptCut;}
-  void SetChi2Cut(Double_t chi2){fChi2Cut=chi2;}
-  
-  void SetXVertexCut(Double_t xVtx){fCurrentXValue=xVtx;}
-  void SetYVertexCut(Double_t yVtx){fCurrentYValue=yVtx;}
-  void SetZVertexCut(Double_t zVtx){fCurrentZValue=zVtx;}
-  void SetPIDProbability(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb; fPIDProbabilityCutNegativeParticle=pidProb;}
-  void SetPIDProbabilityNegativeParticle(Double_t pidProb){fPIDProbabilityCutNegativeParticle=pidProb;}
-  void SetPIDProbabilityPositiveParticle(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb;}
-  void SetSigmaMass(Double_t sigmaMass){fNSigmaMass=sigmaMass;}
-  void UpdateV0Information();
-
-  void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;}
-
-  std::vector<AliKFParticle> fCurrentEventGoodV0s;
-  std::vector<AliKFParticle> fPreviousEventGoodV0s;
-
- private:
-  AliStack * fMCStack;           // pointer to MonteCarlo particle stack 
-  AliMCEventHandler* fMCTruth;   // pointer to the MC event handler
-  TChain * fChain;               // pointer to the TChain
-  
-  AliESDInputHandler* fESDHandler;      //! pointer to esd object
-  AliESDEvent *fESDEvent;               //! pointer to esd object
-
-  AliGammaConversionHistograms *fHistograms;
-  
-  Int_t fCurrentV0IndexNumber;
-  AliESDv0 * fCurrentV0;                //! pointer to the current v0
-  AliKFParticle * fCurrentNegativeKFParticle;  //! pointer to the negative KF particle
-  AliKFParticle * fCurrentPositiveKFParticle;  //! pointer to the positive KF particle
-  AliKFParticle * fCurrentMotherKFCandidate;   //! pointer to the positive KF particle
-
-  AliESDtrack * fCurrentNegativeESDTrack;      //! pointer to the negative ESD track
-  AliESDtrack * fCurrentPositiveESDTrack;      //! pointer to the positive ESD track
-  TLorentzVector * fNegativeTrackLorentzVector; //! pointer to the negative Track Lorentz Vector
-  TLorentzVector * fPositiveTrackLorentzVector; //! pointer to the positive Track Lorentz Vector
-  TLorentzVector * fMotherCandidateLorentzVector;   //! pointer to the mother candidate Track Lorentz Vector
-
-  Double_t fCurrentXValue;
-  Double_t fCurrentYValue;
-  Double_t fCurrentZValue;
-
-  Int_t fPositiveTrackPID;
-  Int_t fNegativeTrackPID;
-
-  TParticle *fNegativeMCParticle;      //!
-  TParticle *fPositiveMCParticle;      //!
-  TParticle *fMotherMCParticle;        //!
-
-  Double_t fMotherCandidateKFMass;
-  Double_t fMotherCandidateKFWidth;
-
-  Bool_t fUseKFParticle;
-  Bool_t fUseESDTrack;
-  Bool_t fDoMC;
-
-  //cuts
-  Double_t fMaxR;
-  Double_t fEtaCut;
-  Double_t fPtCut;
-  Double_t fChi2Cut;
-  Double_t fPIDProbabilityCutNegativeParticle;
-  Double_t fPIDProbabilityCutPositiveParticle;
-  Double_t fXVertexCut;
-  Double_t fYVertexCut;
-  Double_t fZVertexCut;
-  
-  Double_t fNSigmaMass;
-  
-  Bool_t fUseImprovedVertex;
-  
-  ClassDef(AliV0Reader,0)
-};
-
-
-#endif
-
-
-
+#ifndef ALIV0READER_H\r
+#define ALIV0READER_H\r
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ * See cxx source for full Copyright notice     */\r
+\r
+////////////////////////////////////////////////\r
+//--------------------------------------------- \r
+// Class used to do analysis on conversion pairs\r
+//---------------------------------------------\r
+////////////////////////////////////////////////\r
+\r
+// --- ROOT system ---\r
+#include "TObject.h" \r
+#include "AliESDv0.h"\r
+#include "AliESDEvent.h"\r
+#include "AliKFParticle.h"\r
+#include "TParticle.h"\r
+#include "AliGammaConversionHistograms.h"\r
+#include <vector>\r
+\r
+class TClonesArray; \r
+class TFormula;\r
+class Riostream;\r
+class TChain;\r
+//--- AliRoot system ---\r
+\r
+class AliStack;\r
+class AliESDEvent; \r
+class AliMCEventHandler;\r
+class AliESDInputHandler;\r
+class AliESDVertex;\r
+class AliLog;\r
+class TChain;\r
+class TChain;\r
+\r
+\r
+\r
+class AliV0Reader : public TObject {\r
+\r
+ public: \r
+\r
+  AliV0Reader();                                        //constructor\r
+  AliV0Reader(const AliV0Reader & g);                   //copy constructor\r
+  AliV0Reader & operator = (const AliV0Reader & g);     //assignment operator\r
+  virtual ~AliV0Reader() {;}                            //virtual destructor\r
+  /*\r
+   *Initialize the reader\r
+   */\r
+  void Initialize();\r
+\r
+  /*\r
+   *Returns the number of v0s in the event, no cuts applied.\r
+   */\r
+  Int_t GetNumberOfV0s() const{return fESDEvent->GetNumberOfV0s();}\r
+\r
+  /*\r
+   * Check if there are any more good v0s left in the v0 stack\r
+   * if so, fCurrent v0 is set to this v0 and can be retrieved\r
+   * by GetCurrentV0 function.\r
+   * returns kFALSE if there is no more good v0s in the v0 stack\r
+   */\r
+  Bool_t NextV0();\r
+  \r
+  /*\r
+   * Returns the v0 at the given index, no checks are done on the v0. \r
+   */\r
+  AliESDv0* GetV0(Int_t index);\r
+\r
+  /*\r
+   * Returns the current v0\r
+   */\r
+  AliESDv0* GetCurrentV0() const{return fCurrentV0;}\r
+\r
+  /*\r
+   * Returns the negative ESD track which belongs to fCurrentV0\r
+   */\r
+  AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());}\r
+\r
+  /*\r
+   * Returns the positive ESD track which belongs to fCurrentV0\r
+   */\r
+  AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());}\r
+\r
+  /*\r
+   * Returns the negative KF particle which belongs to fCurrentV0\r
+   */\r
+  AliKFParticle* GetNegativeKFParticle() const{return fCurrentNegativeKFParticle;}\r
+\r
+  /*\r
+   * Returns the positive KF particle which belongs to fCurrentV0\r
+   */\r
+  AliKFParticle* GetPositiveKFParticle() const{return fCurrentPositiveKFParticle;}\r
+  /*\r
+   * Returns the KFParticle object of the 2 tracks.\r
+   */\r
+  AliKFParticle* GetMotherCandidateKFCombination() const{return fCurrentMotherKFCandidate;}\r
+  /*\r
+   * Checks the probablity that the PID of the particle is what we want it to be.\r
+   */\r
+  Bool_t CheckPIDProbability(Double_t negProbCut, Double_t posProbCut);\r
+\r
+  /*\r
+   *Get the negative MC TParticle from the stack \r
+   */\r
+  TParticle * GetNegativeMCParticle() const{return fNegativeMCParticle;}\r
+\r
+  /*\r
+   *Get the positive MC TParticle from the stack \r
+   */\r
+  TParticle * GetPositiveMCParticle() const{return fPositiveMCParticle;}\r
+\r
+  /*\r
+   *Get the mother MC TParticle from the stack \r
+   */\r
+  TParticle * GetMotherMCParticle() const{return fMotherMCParticle;}\r
+\r
+  Bool_t HasSameMCMother();\r
+\r
+  /*\r
+   *Get the MC stack \r
+   */\r
+  AliStack* GetMCStack() const{return fMCStack;}\r
+\r
+  /*\r
+   *Get the magnetic field from the ESD event \r
+   */\r
+  Double_t GetMagneticField() const{return fESDEvent->GetMagneticField();}\r
+\r
+  /*\r
+   *Get the primary vertex from the esd event\r
+   */\r
+  const AliESDVertex *GetPrimaryVertex() const {return fESDEvent->GetPrimaryVertex();}\r
+\r
+  /*\r
+   * Set the PID of the negative track\r
+   */\r
+  void SetNegativeTrackPID(Int_t negTrackPID){fNegativeTrackPID=negTrackPID;}\r
+\r
+  /*\r
+   * Set the PID of the positive track\r
+   */\r
+  void SetPositiveTrackPID(Int_t posTrackPID){fPositiveTrackPID=posTrackPID;}\r
+\r
+  /*\r
+   * Set the flag to use the kfparticle class. Will also disable the use of esd tracks\r
+   */\r
+  void UseKFParticle(){fUseKFParticle = kTRUE; fUseESDTrack = kFALSE;}\r
+\r
+  /*\r
+   *  Set the flag to use the esd track class. Will also disable the use of kf particles\r
+   */\r
+  void UseESDTrack(){fUseESDTrack = kTRUE; fUseKFParticle = kFALSE;}\r
+\r
+  /*\r
+   *  Set the flag to use improved vertex or not\r
+   */\r
+  void SetUseImprovedVertex(Bool_t useImprovedVertex){fUseImprovedVertex=useImprovedVertex;}\r
+\r
+  /*\r
+   * Return the number in the species array belonging to the negative or positive track pid.\r
+   */\r
+  Int_t GetSpeciesIndex(Int_t chargeOfTrack);\r
+\r
+  /*\r
+   * Return the x coordinate of the v0\r
+   */\r
+  Double_t GetX() const{return fCurrentXValue;}\r
+\r
+  /*\r
+   * Return the y coordinate of the v0\r
+   */\r
+  Double_t GetY() const{return fCurrentYValue;}\r
+\r
+  /*\r
+   * Return the Z coordinate of the v0\r
+   */\r
+  Double_t GetZ() const{return fCurrentZValue;}\r
+\r
+  /*\r
+   * Return the radius of the v0\r
+   */\r
+  Double_t GetXYRadius() const{return sqrt((Double_t)(fCurrentXValue*fCurrentXValue + fCurrentYValue*fCurrentYValue));}\r
+\r
+  /*\r
+   * Get the opening angle between the two tracks\r
+   */\r
+  Double_t GetOpeningAngle(){return fNegativeTrackLorentzVector->Angle(fPositiveTrackLorentzVector->Vect());}\r
+\r
+  Double_t GetNegativeTrackEnergy() const{return fCurrentNegativeKFParticle->E();}\r
+  Double_t GetPositiveTrackEnergy() const{return fCurrentPositiveKFParticle->E();}\r
+  Double_t GetMotherCandidateEnergy() const{return fCurrentMotherKFCandidate->E();}\r
+\r
+  Double_t GetNegativeTrackPt() const{return fNegativeTrackLorentzVector->Pt();}\r
+  Double_t GetPositiveTrackPt() const{return fPositiveTrackLorentzVector->Pt();}\r
+  Double_t GetMotherCandidatePt() const{return fMotherCandidateLorentzVector->Pt();}\r
+\r
+  Double_t GetNegativeTrackEta() const{return fNegativeTrackLorentzVector->Eta();}\r
+  Double_t GetPositiveTrackEta() const{return fPositiveTrackLorentzVector->Eta();}\r
+  Double_t GetMotherCandidateEta() const{return fMotherCandidateLorentzVector->Eta();}\r
+\r
+  Double_t GetMotherCandidateNDF() const{return fCurrentMotherKFCandidate->GetNDF();}\r
+  Double_t GetMotherCandidateChi2() const{return fCurrentMotherKFCandidate->GetChi2();}\r
+  Double_t GetMotherCandidateMass() const{return fMotherCandidateKFMass;}\r
+  Double_t GetMotherCandidateWidth() const{return fMotherCandidateKFWidth;}\r
+\r
+  Double_t GetNegativeTrackPhi() const;\r
+  Double_t GetPositiveTrackPhi() const;\r
+  Double_t GetMotherCandidatePhi() const;\r
+\r
+  void UpdateEventByEventData();\r
+  \r
+  Double_t GetMaxRCut() const{return fMaxR;}\r
+  Double_t GetEtaCut() const{return fEtaCut;}\r
+  Double_t GetPtCut() const{return fPtCut;}\r
+  Double_t GetChi2Cut() const{return fChi2Cut;}\r
+\r
+  void SetMaxRCut(Double_t maxR){fMaxR=maxR;}\r
+  void SetEtaCut(Double_t etaCut){fEtaCut=etaCut;}\r
+  void SetPtCut(Double_t ptCut){fPtCut=ptCut;}\r
+  void SetChi2Cut(Double_t chi2){fChi2Cut=chi2;}\r
+  \r
+  void SetXVertexCut(Double_t xVtx){fCurrentXValue=xVtx;}\r
+  void SetYVertexCut(Double_t yVtx){fCurrentYValue=yVtx;}\r
+  void SetZVertexCut(Double_t zVtx){fCurrentZValue=zVtx;}\r
+  void SetPIDProbability(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb; fPIDProbabilityCutNegativeParticle=pidProb;}\r
+  void SetPIDProbabilityNegativeParticle(Double_t pidProb){fPIDProbabilityCutNegativeParticle=pidProb;}\r
+  void SetPIDProbabilityPositiveParticle(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb;}\r
+  void SetSigmaMass(Double_t sigmaMass){fNSigmaMass=sigmaMass;}\r
+  void UpdateV0Information();\r
+\r
+  void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;}\r
+\r
+  vector<AliKFParticle> GetCurrentEventGoodV0s() const{return fCurrentEventGoodV0s;}\r
+  vector<AliKFParticle> GetPreviousEventGoodV0s() const{return fPreviousEventGoodV0s;}\r
+\r
+ private:\r
+  AliStack * fMCStack;           // pointer to MonteCarlo particle stack \r
+  AliMCEventHandler* fMCTruth;   // pointer to the MC event handler\r
+  TChain * fChain;               // pointer to the TChain\r
+  \r
+  AliESDInputHandler* fESDHandler;      //! pointer to esd object\r
+  AliESDEvent *fESDEvent;               //! pointer to esd object\r
+\r
+  AliGammaConversionHistograms *fHistograms;\r
+  \r
+  Int_t fCurrentV0IndexNumber;\r
+  AliESDv0 * fCurrentV0;                //! pointer to the current v0\r
+  AliKFParticle * fCurrentNegativeKFParticle;  //! pointer to the negative KF particle\r
+  AliKFParticle * fCurrentPositiveKFParticle;  //! pointer to the positive KF particle\r
+  AliKFParticle * fCurrentMotherKFCandidate;   //! pointer to the positive KF particle\r
+\r
+  AliESDtrack * fCurrentNegativeESDTrack;      //! pointer to the negative ESD track\r
+  AliESDtrack * fCurrentPositiveESDTrack;      //! pointer to the positive ESD track\r
\r
+  TLorentzVector * fNegativeTrackLorentzVector; //! pointer to the negative Track Lorentz Vector\r
+  TLorentzVector * fPositiveTrackLorentzVector; //! pointer to the positive Track Lorentz Vector\r
+  TLorentzVector * fMotherCandidateLorentzVector;   //! pointer to the mother candidate Track Lorentz Vector\r
+\r
+  Double_t fCurrentXValue;\r
+  Double_t fCurrentYValue;\r
+  Double_t fCurrentZValue;\r
+\r
+  Int_t fPositiveTrackPID;\r
+  Int_t fNegativeTrackPID;\r
+\r
+  TParticle *fNegativeMCParticle;      //!\r
+  TParticle *fPositiveMCParticle;      //!\r
+  TParticle *fMotherMCParticle;        //!\r
+\r
+  Double_t fMotherCandidateKFMass;\r
+  Double_t fMotherCandidateKFWidth;\r
+\r
+  Bool_t fUseKFParticle;\r
+  Bool_t fUseESDTrack;\r
+  Bool_t fDoMC;\r
+\r
+  //cuts\r
+  Double_t fMaxR;\r
+  Double_t fEtaCut;\r
+  Double_t fPtCut;\r
+  Double_t fChi2Cut;\r
+  Double_t fPIDProbabilityCutNegativeParticle;\r
+  Double_t fPIDProbabilityCutPositiveParticle;\r
+  Double_t fXVertexCut;\r
+  Double_t fYVertexCut;\r
+  Double_t fZVertexCut;\r
+  \r
+  Double_t fNSigmaMass;\r
+  \r
+  Bool_t fUseImprovedVertex;\r
+  \r
+  vector<AliKFParticle> fCurrentEventGoodV0s;\r
+  vector<AliKFParticle> fPreviousEventGoodV0s;\r
+\r
+  ClassDef(AliV0Reader,0)\r
+};\r
+\r
+\r
+#endif\r
+\r
+\r
+\r
index dfeef7fabe87747ea1f03ead2ad8457767e74be9..d2fb671f5497a341f486f16d214b1f702dfab0fc 100644 (file)
-
-/** ------------------------------ Monte Carlo flag -----------------------------------------*/
-Bool_t doMCTruth = kTRUE;
-/** ---------------------------- end Monte Carlo flag ---------------------------------------*/
-
-/** ------------------------- Choose KFParticle OR ESDTrack  --------------------------------*/
-Bool_t useKFParticle = kTRUE;
-Bool_t useESDTrack   = kFALSE;
-/** ----------------------- end Choose KFParticle OR ESDTrack  -----------------------------*/
-
-
-Bool_t calculateBackground = kTRUE;
-
-/** ---------------------------------- define cuts here ------------------------------------*/
-
-Int_t pidOfNegativeTrack=11;
-Int_t pidOfPositiveTrack=-11;
-
-Double_t maxRCut   = 200.;
-Double_t etaCut    = 1.2;
-Double_t ptCut     = 0.1;
-Double_t chi2Cut   = 20.;
-
-Double_t xVertexCut = 0.;
-Double_t yVertexCut = 0.;
-Double_t zVertexCut = 0.;
-
-Double_t sigmaCutGammaMass=0.0001;
-
-Bool_t useImprovedVertex = kTRUE;
-
-// define masses of different particles, this will be used by the KF particle
-// together with the width to set mass constraints. Units in GeV.
-Double_t electronMass = 0.00051099892;
-Double_t gammaMass    = 0.;
-Double_t pi0Mass      = 0.1349766;
-Double_t etaMass      = 0.54751;
-
-// define the width constraint used by KF particle.
-Double_t gammaWidth = 0.01;
-Double_t pi0Width   = 0.01;
-Double_t etaWidth   = 0.01;
-
-// define the probability of track being an electron
-Double_t probElectron = 0.5;
-
-/** ----------------------------------end define cuts here----------------------------------*/
-
-/** -------------------------------- Phi/R Mapping ---------------------------------------*/
-Int_t nPhiIndex = 18;
-Int_t nRIndex   = 40;
-
-Double_t minRadius   = 0.;
-Double_t maxRadius   = 200.;
-Double_t minPhi      = -TMath::Pi();
-Double_t maxPhi      = TMath::Pi();
-/** ------------------------------- end Phi/R Mapping ------------------------------------*/
-
-/** ------------------- define which histograms to plot here --------------------------------*/
-/**   NB: to change the bin numbers, see below the histogram flags                           */
-Bool_t plotMC_EP_R                             = kTRUE;
-Bool_t plotMC_EP_Z_R                           = kTRUE;
-Bool_t plotMC_EP_X_Y                           = kTRUE;
-Bool_t plotMC_EP_OpeningAngle                  = kTRUE;
-
-Bool_t plotMC_E_Energy                         = kTRUE;
-Bool_t plotMC_E_Pt                             = kTRUE;
-Bool_t plotMC_E_Eta                            = kTRUE;
-Bool_t plotMC_E_Phi                            = kTRUE;
-
-Bool_t plotMC_P_Energy                         = kTRUE;
-Bool_t plotMC_P_Pt                             = kTRUE;
-Bool_t plotMC_P_Eta                            = kTRUE;
-Bool_t plotMC_P_Phi                            = kTRUE;
-
-Bool_t plotMC_Gamma_Energy                     = kTRUE;
-Bool_t plotMC_Gamma_Pt                         = kTRUE;
-Bool_t plotMC_Gamma_Eta                        = kTRUE;
-Bool_t plotMC_Gamma_Phi                        = kTRUE;
-
-Bool_t plotMC_DirectGamma_Energy               = kTRUE;
-Bool_t plotMC_DirectGamma_Pt                   = kTRUE;
-Bool_t plotMC_DirectGamma_Eta                  = kTRUE;
-Bool_t plotMC_DirectGamma_Phi                  = kTRUE;
-
-Bool_t plotMC_Match_Gamma_Eta                  = kTRUE;
-Bool_t plotMC_Match_Gamma_Phi                  = kTRUE;
-Bool_t plotMC_Match_Gamma_Pt                   = kTRUE;
-Bool_t plotMC_Match_Gamma_Energy               = kTRUE;
-Bool_t plotMC_Match_Gamma_Mass                 = kTRUE;
-Bool_t plotMC_Match_Gamma_OpeningAngle         = kTRUE;
-Bool_t plotMC_Match_Gamma_R                    = kTRUE;
-Bool_t plotMC_Match_Gamma_Z_R                  = kTRUE;
-Bool_t plotMC_Match_Gamma_X_Y                  = kTRUE;
-
-Bool_t plotMC_Pi0_Eta                          = kTRUE;
-Bool_t plotMC_Pi0_Phi                          = kTRUE;
-Bool_t plotMC_Pi0_Pt                           = kTRUE;
-Bool_t plotMC_Pi0_Energy                       = kTRUE;
-Bool_t plotMC_Pi0_Mass                         = kTRUE;
-Bool_t plotMC_Pi0_OpeningAngle                 = kTRUE;
-Bool_t plotMC_Pi0_R                            = kTRUE;
-Bool_t plotMC_Pi0_Z_R                          = kTRUE;
-Bool_t plotMC_Pi0_X_Y                          = kTRUE;
-
-Bool_t plotMC_Eta_Eta                          = kTRUE;
-Bool_t plotMC_Eta_Phi                          = kTRUE;
-Bool_t plotMC_Eta_Pt                           = kTRUE;
-Bool_t plotMC_Eta_Energy                       = kTRUE;
-Bool_t plotMC_Eta_Mass                         = kTRUE;
-Bool_t plotMC_Eta_OpeningAngleGamma            = kTRUE;
-Bool_t plotMC_Eta_R                            = kTRUE;
-Bool_t plotMC_Eta_Z_R                          = kTRUE;
-Bool_t plotMC_Eta_X_Y                          = kTRUE;
-    
-// Histograms from esd tracks
-Bool_t plotESD_EP_R                            = kTRUE;
-Bool_t plotESD_EP_Z_R                          = kTRUE;
-Bool_t plotESD_EP_X_Y                          = kTRUE;
-Bool_t plotESD_EP_OpeningAngle                 = kTRUE;
-
-Bool_t plotESD_E_Energy                        = kTRUE;
-Bool_t plotESD_E_Pt                            = kTRUE;
-Bool_t plotESD_E_Eta                           = kTRUE;
-Bool_t plotESD_E_Phi                           = kTRUE;
-
-Bool_t plotESD_P_Energy                        = kTRUE;
-Bool_t plotESD_P_Pt                            = kTRUE;
-Bool_t plotESD_P_Eta                           = kTRUE;
-Bool_t plotESD_P_Phi                           = kTRUE;
-
-
-Bool_t plotESD_Gamma_Energy                    = kTRUE;
-Bool_t plotESD_Gamma_Pt                        = kTRUE;
-Bool_t plotESD_Gamma_Eta                       = kTRUE;
-Bool_t plotESD_Gamma_Phi                       = kTRUE;
-
-Bool_t plotESD_Match_Gamma_OpeningAngle        = kTRUE;
-Bool_t plotESD_Match_Gamma_Energy              = kTRUE;
-Bool_t plotESD_Match_Gamma_Pt                  = kTRUE;
-Bool_t plotESD_Match_Gamma_Eta                 = kTRUE;
-Bool_t plotESD_Match_Gamma_Phi                 = kTRUE;
-Bool_t plotESD_Match_Gamma_Mass                = kTRUE;
-Bool_t plotESD_Match_Gamma_Width               = kTRUE;
-Bool_t plotESD_Match_Gamma_Chi2                = kTRUE;
-Bool_t plotESD_Match_Gamma_NDF                 = kTRUE;
-Bool_t plotESD_Match_Gamma_R                   = kTRUE;
-Bool_t plotESD_Match_Gamma_Z_R                 = kTRUE;
-Bool_t plotESD_Match_Gamma_X_Y                 = kTRUE;
-
-Bool_t plotESD_Pi0_OpeningAngleGamma           = kTRUE;
-Bool_t plotESD_Pi0_Energy                      = kTRUE;
-Bool_t plotESD_Pi0_Pt                          = kTRUE;
-Bool_t plotESD_Pi0_Eta                         = kTRUE;
-Bool_t plotESD_Pi0_Phi                         = kTRUE;
-Bool_t plotESD_Pi0_Mass                        = kTRUE;
-Bool_t plotESD_Pi0_R                           = kTRUE;
-Bool_t plotESD_Pi0_Z_R                         = kTRUE;
-Bool_t plotESD_Pi0_X_Y                         = kTRUE;
-
-Bool_t plotESD_Eta_OpeningAngleGamma           = kTRUE;
-Bool_t plotESD_Eta_Energy                      = kTRUE;
-Bool_t plotESD_Eta_Pt                          = kTRUE;
-Bool_t plotESD_Eta_Eta                         = kTRUE;
-Bool_t plotESD_Eta_Phi                         = kTRUE;
-Bool_t plotESD_Eta_Mass                        = kTRUE;
-Bool_t plotESD_Eta_R                           = kTRUE;
-Bool_t plotESD_Eta_Z_R                         = kTRUE;
-Bool_t plotESD_Eta_X_Y                         = kTRUE;
-
-Bool_t plotESD_Background_OpeningAngleGamma    = kTRUE;
-Bool_t plotESD_Background_Energy               = kTRUE;
-Bool_t plotESD_Background_Pt                   = kTRUE;
-Bool_t plotESD_Background_Eta                  = kTRUE;
-Bool_t plotESD_Background_Phi                  = kTRUE;
-Bool_t plotESD_Background_Mass                 = kTRUE;
-Bool_t plotESD_Background_R                    = kTRUE;
-Bool_t plotESD_Background_Z_R                  = kTRUE;
-Bool_t plotESD_Background_X_Y                  = kTRUE;
-
-Bool_t plotMapping                             = kTRUE;       
-
-Bool_t plotResolution_dPt                      = kTRUE;
-Bool_t plotResolution_dR                       = kTRUE;
-Bool_t plotResolution_dZ                       = kTRUE;
-  
-Bool_t plotResolution_dR_dPt                   = kTRUE;
-
-Bool_t plotResolution_MC_Pt                    = kTRUE;
-Bool_t plotResolution_MC_R                     = kTRUE;
-Bool_t plotResolution_MC_Z                     = kTRUE;
-
-Bool_t plotResolution_ESD_Pt                   = kTRUE;
-Bool_t plotResolution_ESD_R                    = kTRUE;
-Bool_t plotResolution_ESD_Z                    = kTRUE;
-
-Bool_t plotNumberOfV0s                         = kTRUE;
-Bool_t plotNumberOfSurvivingV0s                = kTRUE;
-
-  //  debug histograms
-Bool_t plotV0MassDebugCut1                     = kTRUE;
-Bool_t plotV0MassDebugCut2                     = kTRUE;
-Bool_t plotV0MassDebugCut3                     = kTRUE;
-Bool_t plotV0MassDebugCut4                     = kTRUE;
-Bool_t plotV0MassDebugCut5                     = kTRUE;
-Bool_t plotV0MassDebugCut6                     = kTRUE;
-Bool_t plotV0MassDebugCut7                     = kTRUE;
-Bool_t plotV0MassDebugCut8                     = kTRUE;
-
-
-/** ----------------- end define which histograms to plot here -------------------------------*/
-
-
-
-/** ----------- Define the binning for the different plot types here -------------------------*/
-//R-plots
-Int_t nXBinsR = 1000;
-Double_t firstXBinR = 0.;
-Double_t lastXBinR = 250.;
-
-//Z_R-plots
-Int_t nXBinsZ_R = 2000;
-Double_t firstXBinZ_R = -10.;
-Double_t lastXBinZ_R = 10.;
-Int_t nYBinsZ_R = 1000;
-Double_t firstYBinZ_R = 0.;
-Double_t lastYBinZ_R = 250.;
-
-//X_Y-plots
-Int_t nXBinsX_Y = 2000;
-Double_t firstXBinX_Y = -250.;
-Double_t lastXBinX_Y = 250.;
-Int_t nYBinsX_Y = 2000;
-Double_t firstYBinX_Y = -250.;
-Double_t lastYBinX_Y = 250.;
-
-//OpenAngle-plots
-Int_t nXBinsOpeningAngle = 200;
-Double_t firstXBinOpeningAngle = 0.;
-Double_t lastXBinOpeningAngle = TMath::Pi()/2;
-
-//Energy-plots
-Int_t nXBinsEnergy = 500;
-Double_t firstXBinEnergy = 0.;
-Double_t lastXBinEnergy = 5.;
-
-//Pt-plots
-Int_t nXBinsPt = 500;
-Double_t firstXBinPt = 0.;
-Double_t lastXBinPt = 5.;
-
-//Eta-plots
-Int_t nXBinsEta = 400;
-Double_t firstXBinEta = -2.;
-Double_t lastXBinEta = 2.;
-
-//Phi-plots
-Int_t nXBinsPhi = 720;
-Double_t firstXBinPhi = -TMath::Pi();
-Double_t lastXBinPhi = TMath::Pi();
-
-//Mapping-plots
-Int_t nXBinsMapping = 40;
-Double_t firstXBinMapping = -20.;
-Double_t lastXBinMapping = 20.;
-Int_t nYBinsMapping = 30;
-Double_t firstYBinMapping = -1.5;
-Double_t lastYBinMapping = 1.5;
-
-//ResolutionPlots
-//RES_dPt
-Int_t nXBinsResdPt=500;
-Int_t firstXBinResdPt= 0;
-Int_t lastXBinResdPt=5;
-Int_t nYBinsResdPt=1000;
-Int_t firstYBinResdPt= -5;
-Int_t lastYBinResdPt=5;
-
-//RES_dR
-Int_t nXBinsResdR=1000;
-Int_t firstXBinResdR= 0;
-Int_t lastXBinResdR=250;
-Int_t nYBinsResdR=1000;
-Int_t firstYBinResdR= -25;
-Int_t lastYBinResdR=25;
-
-//RES_dZ
-Int_t nXBinsResdZ=2000;
-Int_t firstXBinResdZ= -20;
-Int_t lastXBinResdZ=20;
-Int_t nYBinsResdZ=1000;
-Int_t firstYBinResdZ= -20;
-Int_t lastYBinResdZ=20;
-
-//RES_dR_dPt
-Int_t nXBinsResdR_dPt=1000;
-Int_t firstXBinResdR_dPt= -22;
-Int_t lastXBinResdR_dPt=22;
-Int_t nYBinsResdR_dPt=1000;
-Int_t firstYBinResdR_dPt= -5;
-Int_t lastYBinResdR_dPt=5;
-
-
-//RES_MC_Pt
-Int_t nXBinsResPt=500;
-Int_t firstXBinResPt= 0;
-Int_t lastXBinResPt=5;
-
-//RES_MC_R
-Int_t nXBinsResR=1000;
-Int_t firstXBinResR= 0;
-Int_t lastXBinResR=250;
-
-//RES_MC_Z
-Int_t nXBinsResZ=1000;
-Int_t firstXBinResZ= 0;
-Int_t lastXBinResZ=250;
-
-//GammaMass-plots
-Int_t nXBinsGamma_Mass = 100;
-Double_t firstXBinGamma_Mass = 0.;
-Double_t lastXBinGamma_Mass = 1.;
-
-//Pi0Mass-plots
-Int_t nXBinsPi0_Mass = 100;
-Double_t firstXBinPi0_Mass = 0.;
-Double_t lastXBinPi0_Mass = 1.;
-
-//EtaMass-plots
-Int_t nXBinsEta_Mass = 100;
-Double_t firstXBinEta_Mass = 0.;
-Double_t lastXBinEta_Mass = 1.;
-
-//Gamma_Width-plots
-Int_t nXBinsGamma_Width = 100;
-Double_t firstXBinGamma_Width = 0.;
-Double_t lastXBinGamma_Width = 1.;
-
-//Gamma_Chi2-plots
-Int_t nXBinsGamma_Chi2 = 100;
-Double_t firstXBinGamma_Chi2 = 0;
-Double_t lastXBinGamma_Chi2 = 100.;
-
-//Gamma_NDF-plots
-Int_t nXBinsGamma_NDF = 10;
-Double_t firstXBinGamma_NDF = 0.;
-Double_t lastXBinGamma_NDF = 10.;
-/** ---------- end Define the binning for the different plot types here ----------------------*/
-
-
-
-/************************************************************************************************
- *                                                                                              *
- *                                                                                              *
- *                     EVERYTHING BELOW IS FOR DEVELOPERS ONLY                                  *
- *                                                                                              *
- *                                                                                              *
- ************************************************************************************************/
-
-void ConfigGammaConversion(const char *chainName, const char *sample, int limit = 0){
-  
-  build();//build (if necessary) and load the libraries needed
-
-  gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); // load the CreateChain macro
-
-  AliLog::SetGlobalLogLevel(AliLog::kError);
-
-  //-------------------------------- Creating the histograms -------------------------------
-  AliGammaConversionHistograms * histograms = new AliGammaConversionHistograms();
-
-  //Change here
-  // All the plots need to be given good names for the x-axis and y-axis so that people don't have to ask, or get confused.
-  // I put in cm and cm in the first one as an example where to put in the axis titles.
-  
-  if(plotMC_EP_R != NULL){ histograms->Initialize_MC_EP_R(nXBinsR, firstXBinR, lastXBinR,"cm","cm");}
-  if(plotMC_EP_Z_R != NULL){ histograms->Initialize_MC_EP_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
-  if(plotMC_EP_X_Y != NULL){ histograms->Initialize_MC_EP_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
-  if(plotMC_EP_OpeningAngle != NULL){ histograms->Initialize_MC_EP_OpeningAngle(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-
-  if(plotMC_E_Energy != NULL){ histograms->Initialize_MC_E_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMC_E_Pt != NULL){ histograms->Initialize_MC_E_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMC_E_Eta != NULL){ histograms->Initialize_MC_E_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMC_E_Phi != NULL){ histograms->Initialize_MC_E_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotMC_P_Energy != NULL){ histograms->Initialize_MC_P_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMC_P_Pt != NULL){ histograms->Initialize_MC_P_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMC_P_Eta != NULL){ histograms->Initialize_MC_P_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMC_P_Phi != NULL){ histograms->Initialize_MC_P_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotMC_Gamma_Energy != NULL){ histograms->Initialize_MC_Gamma_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMC_Gamma_Pt != NULL){ histograms->Initialize_MC_Gamma_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMC_Gamma_Eta != NULL){ histograms->Initialize_MC_Gamma_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMC_Gamma_Phi != NULL){ histograms->Initialize_MC_Gamma_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotMC_DirectGamma_Energy != NULL){ histograms->Initialize_MC_DirectGamma_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMC_DirectGamma_Pt != NULL){ histograms->Initialize_MC_DirectGamma_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMC_DirectGamma_Eta != NULL){ histograms->Initialize_MC_DirectGamma_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMC_DirectGamma_Phi != NULL){ histograms->Initialize_MC_DirectGamma_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotMC_Match_Gamma_Eta != NULL){ histograms->Initialize_MC_Match_Gamma_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMC_Match_Gamma_Phi != NULL){ histograms->Initialize_MC_Match_Gamma_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotMC_Match_Gamma_Pt != NULL){ histograms->Initialize_MC_Match_Gamma_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMC_Match_Gamma_Energy != NULL){ histograms->Initialize_MC_Match_Gamma_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMC_Match_Gamma_Mass != NULL){ histograms->Initialize_MC_Match_Gamma_Mass(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass, "", "");}
-  if(plotMC_Match_Gamma_OpeningAngle != NULL){ histograms->Initialize_MC_Match_Gamma_OpeningAngle(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotMC_Match_Gamma_R != NULL){ histograms->Initialize_MC_Match_Gamma_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotMC_Match_Gamma_Z_R != NULL){ histograms->Initialize_MC_Match_Gamma_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
-  if(plotMC_Match_Gamma_X_Y != NULL){ histograms->Initialize_MC_Match_Gamma_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
-
-  if(plotMC_Pi0_Eta != NULL){ histograms->Initialize_MC_Pi0_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMC_Pi0_Phi != NULL){ histograms->Initialize_MC_Pi0_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotMC_Pi0_Pt != NULL){ histograms->Initialize_MC_Pi0_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMC_Pi0_Energy != NULL){ histograms->Initialize_MC_Pi0_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMC_Pi0_Mass != NULL){ histograms->Initialize_MC_Pi0_Mass(nXBinsPi0_Mass, firstXBinPi0_Mass, lastXBinPi0_Mass, "", "");}
-  if(plotMC_Pi0_OpeningAngle != NULL){ histograms->Initialize_MC_Pi0_OpeningAngleGamma(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotMC_Pi0_R != NULL){ histograms->Initialize_MC_Pi0_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotMC_Pi0_Z_R != NULL){ histograms->Initialize_MC_Pi0_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
-  if(plotMC_Pi0_X_Y != NULL){ histograms->Initialize_MC_Pi0_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
-
-  if(plotMC_Eta_Eta != NULL){ histograms->Initialize_MC_Eta_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotMC_Eta_Phi != NULL){ histograms->Initialize_MC_Eta_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotMC_Eta_Pt != NULL){ histograms->Initialize_MC_Eta_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotMC_Eta_Energy != NULL){ histograms->Initialize_MC_Eta_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotMC_Eta_Mass != NULL){ histograms->Initialize_MC_Eta_Mass(nXBinsEta_Mass, firstXBinEta_Mass, lastXBinEta_Mass, "", "");}
-  if(plotMC_Eta_OpeningAngleGamma != NULL){ histograms->Initialize_MC_Eta_OpeningAngleGamma(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotMC_Eta_R != NULL){ histograms->Initialize_MC_Eta_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotMC_Eta_Z_R != NULL){ histograms->Initialize_MC_Eta_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
-  if(plotMC_Eta_X_Y != NULL){ histograms->Initialize_MC_Eta_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
-    
-  // Histograms from esd tracks
-  if(plotESD_EP_R != NULL){ histograms->Initialize_ESD_EP_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotESD_EP_Z_R != NULL){ histograms->Initialize_ESD_EP_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
-  if(plotESD_EP_X_Y != NULL){ histograms->Initialize_ESD_EP_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
-  if(plotESD_EP_OpeningAngle != NULL){ histograms->Initialize_ESD_EP_OpeningAngle(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-
-  if(plotESD_E_Energy != NULL){ histograms->Initialize_ESD_E_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotESD_E_Pt != NULL){ histograms->Initialize_ESD_E_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotESD_E_Eta != NULL){ histograms->Initialize_ESD_E_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotESD_E_Phi != NULL){ histograms->Initialize_ESD_E_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotESD_P_Energy != NULL){ histograms->Initialize_ESD_P_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotESD_P_Pt != NULL){ histograms->Initialize_ESD_P_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotESD_P_Eta != NULL){ histograms->Initialize_ESD_P_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotESD_P_Phi != NULL){ histograms->Initialize_ESD_P_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotESD_Gamma_Energy != NULL){ histograms->Initialize_ESD_Gamma_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotESD_Gamma_Pt != NULL){ histograms->Initialize_ESD_Gamma_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotESD_Gamma_Eta != NULL){ histograms->Initialize_ESD_Gamma_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotESD_Gamma_Phi != NULL){ histograms->Initialize_ESD_Gamma_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-
-  if(plotESD_Match_Gamma_OpeningAngle != NULL){ histograms->Initialize_ESD_Match_Gamma_OpeningAngle(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotESD_Match_Gamma_Energy != NULL){ histograms->Initialize_ESD_Match_Gamma_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotESD_Match_Gamma_Pt != NULL){ histograms->Initialize_ESD_Match_Gamma_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotESD_Match_Gamma_Eta != NULL){ histograms->Initialize_ESD_Match_Gamma_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotESD_Match_Gamma_Phi != NULL){ histograms->Initialize_ESD_Match_Gamma_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotESD_Match_Gamma_Mass != NULL){ histograms->Initialize_ESD_Match_Gamma_Mass(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass, "", "");}
-  if(plotESD_Match_Gamma_Width != NULL){ histograms->Initialize_ESD_Match_Gamma_Width(nXBinsGamma_Width, firstXBinGamma_Width, lastXBinGamma_Width, "", "");}
-  if(plotESD_Match_Gamma_Chi2 != NULL){ histograms->Initialize_ESD_Match_Gamma_Chi2(nXBinsGamma_Chi2, firstXBinGamma_Chi2, lastXBinGamma_Chi2, "", "");}
-  if(plotESD_Match_Gamma_NDF != NULL){ histograms->Initialize_ESD_Match_Gamma_NDF(nXBinsGamma_NDF, firstXBinGamma_NDF, lastXBinGamma_NDF, "", "");}
-  if(plotESD_Match_Gamma_R != NULL){ histograms->Initialize_ESD_Match_Gamma_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotESD_Match_Gamma_Z_R != NULL){ histograms->Initialize_ESD_Match_Gamma_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
-  if(plotESD_Match_Gamma_X_Y != NULL){ histograms->Initialize_ESD_Match_Gamma_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
-
-  if(plotESD_Pi0_OpeningAngleGamma != NULL){ histograms->Initialize_ESD_Pi0_OpeningAngleGamma(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotESD_Pi0_Energy != NULL){ histograms->Initialize_ESD_Pi0_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotESD_Pi0_Pt != NULL){ histograms->Initialize_ESD_Pi0_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotESD_Pi0_Eta != NULL){ histograms->Initialize_ESD_Pi0_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotESD_Pi0_Phi != NULL){ histograms->Initialize_ESD_Pi0_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotESD_Pi0_Mass != NULL){ histograms->Initialize_ESD_Pi0_Mass(nXBinsPi0_Mass, firstXBinPi0_Mass, lastXBinPi0_Mass, "", "");}
-  if(plotESD_Pi0_R != NULL){ histograms->Initialize_ESD_Pi0_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotESD_Pi0_Z_R != NULL){ histograms->Initialize_ESD_Pi0_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
-  if(plotESD_Pi0_X_Y != NULL){ histograms->Initialize_ESD_Pi0_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
-
-  if(plotESD_Eta_OpeningAngleGamma != NULL){ histograms->Initialize_ESD_Eta_OpeningAngleGamma(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotESD_Eta_Energy != NULL){ histograms->Initialize_ESD_Eta_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotESD_Eta_Pt != NULL){ histograms->Initialize_ESD_Eta_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotESD_Eta_Eta != NULL){ histograms->Initialize_ESD_Eta_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotESD_Eta_Phi != NULL){ histograms->Initialize_ESD_Eta_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotESD_Eta_Mass != NULL){ histograms->Initialize_ESD_Eta_Mass(nXBinsEta_Mass, firstXBinEta_Mass, lastXBinEta_Mass, "", "");}
-  if(plotESD_Eta_R != NULL){ histograms->Initialize_ESD_Eta_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotESD_Eta_Z_R != NULL){ histograms->Initialize_ESD_Eta_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
-  if(plotESD_Eta_X_Y != NULL){ histograms->Initialize_ESD_Eta_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
-
-  if(plotESD_Background_OpeningAngleGamma != NULL){ histograms->Initialize_ESD_Background_OpeningAngleGamma(nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}
-  if(plotESD_Background_Energy != NULL){ histograms->Initialize_ESD_Background_Energy(nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}
-  if(plotESD_Background_Pt != NULL){ histograms->Initialize_ESD_Background_Pt(nXBinsPt, firstXBinPt, lastXBinPt, "", "");}
-  if(plotESD_Background_Eta != NULL){ histograms->Initialize_ESD_Background_Eta(nXBinsEta, firstXBinEta, lastXBinEta, "", "");}
-  if(plotESD_Background_Phi != NULL){ histograms->Initialize_ESD_Background_Phi(nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}
-  if(plotESD_Background_Mass != NULL){ histograms->Initialize_ESD_Background_Mass(nXBinsEta_Mass, firstXBinEta_Mass, lastXBinEta_Mass, "", "");}
-  if(plotESD_Background_R != NULL){ histograms->Initialize_ESD_Background_R(nXBinsR, firstXBinR, lastXBinR, "", "");}
-  if(plotESD_Background_Z_R != NULL){ histograms->Initialize_ESD_Background_Z_R(nXBinsZ_R, firstXBinZ_R, lastXBinZ_R, nYBinsZ_R, firstYBinZ_R, lastYBinZ_R, "", "");}
-  if(plotESD_Background_X_Y != NULL){ histograms->Initialize_ESD_Background_X_Y(nXBinsX_Y, firstXBinX_Y, lastXBinX_Y, nYBinsX_Y, firstYBinX_Y, lastYBinX_Y, "", "");}
-
-  if(plotMapping != NULL){histograms->Initialize_MappingValues(nPhiIndex,nRIndex,nXBinsMapping,minRadius,maxRadius,nYBinsMapping,minPhi,maxPhi);}
-  //create the mapping histograms
-  if(plotMapping != NULL){histograms->Initialize_MappingHistograms(nPhiIndex,nRIndex,nXBinsMapping,firstXBinMapping,lastXBinMapping,nYBinsMapping,firstYBinMapping,lastYBinMapping,"", "");}
-
-
-
-
-  
-  if(plotResolution_dPt !=NULL){histograms->Initialize_Resolution_dPt(nXBinsResdPt, firstXBinResdPt, lastXBinResdPt, nYBinsResdPt, firstYBinResdPt, lastYBinResdPt, "", "");}
-  if(plotResolution_dR !=NULL){histograms->Initialize_Resolution_dR(nXBinsResdR, firstXBinResdR, lastXBinResdR, nYBinsResdR, firstYBinResdR, lastYBinResdR, "", "");}
-  if(plotResolution_dZ !=NULL){histograms->Initialize_Resolution_dZ(nXBinsResdZ, firstXBinResdZ, lastXBinResdZ, nYBinsResdZ, firstYBinResdZ, lastYBinResdZ, "", "");}
-  
-  if(plotResolution_dR_dPt !=NULL){histograms->Initialize_Resolution_dR_dPt(nXBinsResdR_dPt, firstXBinResdR_dPt, lastXBinResdR_dPt, nYBinsResdR_dPt, firstYBinResdR_dPt, lastYBinResdR_dPt, "", "");}
-  
-  if(plotResolution_MC_Pt !=NULL){histograms->Initialize_Resolution_MC_Pt(nXBinsResPt, firstXBinResPt, lastXBinResPt,"","");}
-  if(plotResolution_MC_R !=NULL){histograms->Initialize_Resolution_MC_R(nXBinsResR, firstXBinResR, lastXBinResR,"","");}
-  if(plotResolution_MC_Z !=NULL){histograms->Initialize_Resolution_MC_Z(nXBinsResZ, firstXBinResZ, lastXBinResZ,"","");}
-  
-  if(plotResolution_ESD_Pt !=NULL){histograms->Initialize_Resolution_ESD_Pt(nXBinsResPt, firstXBinResPt, lastXBinResPt,"","");}
-  if(plotResolution_ESD_R !=NULL){histograms->Initialize_Resolution_ESD_R(nXBinsResR, firstXBinResR, lastXBinResR,"","");}
-  if(plotResolution_ESD_Z !=NULL){histograms->Initialize_Resolution_ESD_Z(nXBinsResZ, firstXBinResZ, lastXBinResZ,"","");}
-  
-  if(plotNumberOfV0s != NULL){histograms->Initialize_NumberOfV0s(100, 0, 100,"","");}
-  if(plotNumberOfSurvivingV0s != NULL){histograms->Initialize_NumberOfSurvivingV0s(100, 0, 100,"","");}
-
-  //  debug histograms
-  if(plotV0MassDebugCut1 != NULL){histograms->Initialize_V0MassDebugCut1(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
-  if(plotV0MassDebugCut2 != NULL){histograms->Initialize_V0MassDebugCut2(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
-  if(plotV0MassDebugCut3 != NULL){histograms->Initialize_V0MassDebugCut3(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
-  if(plotV0MassDebugCut4 != NULL){histograms->Initialize_V0MassDebugCut4(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
-  if(plotV0MassDebugCut5 != NULL){histograms->Initialize_V0MassDebugCut5(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
-  if(plotV0MassDebugCut6 != NULL){histograms->Initialize_V0MassDebugCut6(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
-  if(plotV0MassDebugCut7 != NULL){histograms->Initialize_V0MassDebugCut7(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
-  if(plotV0MassDebugCut8 != NULL){histograms->Initialize_V0MassDebugCut8(nXBinsGamma_Mass, firstXBinGamma_Mass, lastXBinGamma_Mass,"","");}
-
-
-
-  //------------------------------ end Creating the histograms -----------------------------
-
-  // Create the Analysis manager
-  AliAnalysisManager *mgr  = new AliAnalysisManager("My Manager", "My Analysis");
-
-  // Define Input Event Handler 
-  AliESDInputHandler* inpHandler = new AliESDInputHandler();
-
-  // Define Output Event Handler
-  AliAODHandler* aodHandler = new AliAODHandler();
-  aodHandler->SetOutputFileName("aodAliGammaConversion.root");
-  
-  // Define MC Truth Event Handler
-  AliMCEventHandler* mcHandler = new AliMCEventHandler();
-  
-  // Add Handlers to the Task Manager
-  mgr->SetInputEventHandler  (inpHandler);
-  mgr->SetOutputEventHandler (aodHandler);
-  mgr->SetMCtruthEventHandler(mcHandler);
-
-  // Be sure you are told what you are doing
-  mgr->SetDebugLevel(10);
-
-  // Declare Common Input Tchain
-  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("Chain",TChain::Class(),AliAnalysisManager::kInputContainer);
-
-  // Common Output Tree in common ‘default’ output file
-  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tree", TTree::Class(),AliAnalysisManager::kOutputContainer, "default");
-
-  // Private output objects
-  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histogramsAliGammaConversion", TList::Class(),AliAnalysisManager::kOutputContainer, "histogramsAliGammaConversion.root");
-
-
-  //------------------------ END: Define input/output handlers ---------------------------------------------------
-
-
-  //check for errors in the specified data
-  if(useKFParticle == kTRUE && useESDTrack == kTRUE){
-    //Print warning, cannot use both
-  }
-  if(useKFParticle == kFALSE && useESDTrack == kFALSE){
-    //Print warning, one have to be specified
-  }
-
-
-  //Create the V0Reader
-  AliV0Reader * v0Reader = new AliV0Reader();
-  if(useKFParticle){
-    v0Reader->UseKFParticle();
-  }
-  else if(useESDTrack){
-    v0Reader->UseESDTrack();
-  }
-  v0Reader->SetNegativeTrackPID(pidOfNegativeTrack);
-  v0Reader->SetPositiveTrackPID(pidOfPositiveTrack);
-  v0Reader->SetMaxRCut(maxRCut);
-  v0Reader->SetEtaCut(etaCut);
-  v0Reader->SetPtCut(ptCut);
-  v0Reader->SetChi2Cut(chi2Cut);
-  v0Reader->SetPIDProbability(probElectron);
-  v0Reader->SetXVertexCut(xVertexCut);
-  v0Reader->SetYVertexCut(yVertexCut);
-  v0Reader->SetZVertexCut(zVertexCut);
-  v0Reader->SetSigmaMass(sigmaCutGammaMass);
-  v0Reader->SetUseImprovedVertex(useImprovedVertex);
-
-  // Create the GammaConversionTask
-  AliAnalysisTaskGammaConversion *gammaconversion = new AliAnalysisTaskGammaConversion("GammaConversionTask");
-  gammaconversion->SetDebugLevel(10);
-  
-  gammaconversion->SetV0Reader(v0Reader);
-  gammaconversion->SetCalculateBackground(calculateBackground);
-  gammaconversion->Init();
-  
-  gammaconversion->SetElectronMass(electronMass);
-  gammaconversion->SetGammaMass(gammaMass);
-  gammaconversion->SetPi0Mass(pi0Mass);
-  gammaconversion->SetEtaMass(etaMass);
-
-  gammaconversion->SetGammaWidth(gammaWidth);
-  gammaconversion->SetPi0Width(pi0Width);
-  gammaconversion->SetEtaWidth(etaWidth);
-
-  // define the width constraint used by KF particle.
-  Double_t gammaWidth = 0.01;
-  Double_t pi0Width   = 0.01;
-  Double_t etaWidth   = 0.01;
-
-  gammaconversion->SetHistograms(histograms);
-  v0Reader->SetHistograms(histograms);// also give the pointer to the v0reader, for debugging cuts
-  
-  gammaconversion->SetDoMCTruth(doMCTruth);
-
-
-  // Add task to the manager 
-  mgr->AddTask(gammaconversion);
-
-  // Connect I/O to the task
-  mgr->ConnectInput (gammaconversion, 0, cinput1);
-  mgr->ConnectOutput(gammaconversion, 0, coutput1);
-  mgr->ConnectOutput(gammaconversion, 1, coutput2);
-
-  TChain* chain= CreateESDChain(sample);
-  
-  mgr->InitAnalysis();
-  
-  mgr->PrintStatus();
-  
-  mgr->StartAnalysis("local",chain);
-
-}
-
-
-
-
-void build() {
-  TStopwatch timer;
-  timer.Start();
-  gSystem->Load("libTree.so");
-  gSystem->Load("libGeom");
-  //  gSystem->Load("libANALYSISalice");
-
-  //____________________________________________________//
-  //____________________________________________________//
-  //_____________Setting up STEERBase.par_______________//
-  //____________________________________________________//
-  setupPar("STEERBase");
-  gSystem->Load("libSTEERBase.so");
-
-  //____________________________________________________//
-  //_____________Setting up ESD.par_____________________//
-  //____________________________________________________//
-  setupPar("ESD");
-  gSystem->Load("libVMC.so");
-  gSystem->Load("libESD.so");
-
-  //____________________________________________________//
-  //_____________Setting up AOD.par_____________________//
-  //____________________________________________________//
-  setupPar("AOD");
-  gSystem->Load("libAOD.so");
-                                                                
-  //_____________________________________________________________//
-  //_____________Setting up ANALYSIS.par_________________________//
-  //_____________________________________________________________//
-  setupPar("ANALYSIS");
-  gSystem->Load("libANALYSIS.so");
-
-  //_____________________________________________________________//
-  //_____________Setting up ANALYSISalice.par_________________________//
-  //_____________________________________________________________//
-  setupPar("ANALYSISalice");
-  gSystem->Load("libANALYSISalice.so");
-                                                                                                                                  
-  //_____________________________________________________________//
-  //_____________Setting up PWG4Gamma.par_____________________//
-  //_____________________________________________________________//
-  //  setupPar("PWG4Gamma");
-  //  gSystem->Load("libPWG4Gamma.so");
-  setupPar("PWG4PartCorr");
-  gSystem->Load("libPWG4PartCorr.so");
-  //if head:: use PWG4PartCorr
-             
-  //gROOT->LoadMacro("AliAnalysisTaskPi0.cxx+");
-  // gROOT->LoadMacro("AliAnalysisTaskPtMC.cxx+");
-  //  gROOT->LoadMacro("AliAnalysisTaskPi0MC.cxx+");
-  //  gROOT->LoadMacro("AliAnaScale.cxx+");
-
-
-  //gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
-  //TChain* chain = CreateESDChain("files1.txt");
-
-
-
-  //____________________________________________//
-
-
-}
-
-Int_t setupPar(const char* pararchivename) {
-  ///////////////////
-  // Setup PAR File//
-  ///////////////////
-  if (pararchivename) {
-    char processline[1024];
-    sprintf(processline,".! tar xvzf %s.par",pararchivename);
-    gROOT->ProcessLine(processline);
-    const char* ocwd = gSystem->WorkingDirectory();
-    gSystem->ChangeDirectory(pararchivename);
-                                                                                                                                               
-    // check for BUILD.sh and execute
-    if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
-      printf("*******************************\n");
-      printf("*** Building PAR archive    ***\n");
-      printf("*******************************\n");
-                                                                                                                                               
-      if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
-        Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
-        return -1;
-      }
-    }
-    // check for SETUP.C and execute
-    if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
-      printf("*******************************\n");
-      printf("*** Setup PAR archive       ***\n");
-      printf("*******************************\n");
-      gROOT->Macro("PROOF-INF/SETUP.C");
-    }
-                                                                                                                                               
-    gSystem->ChangeDirectory("../");
-  }                                                                                                                                               
-  return 1;
-}
+\r
+/** ------------------------------ Monte Carlo flag -----------------------------------------*/\r
+Bool_t doMCTruth = kTRUE;\r
+/** ---------------------------- end Monte Carlo flag ---------------------------------------*/\r
+\r
+/** ------------------------- Choose KFParticle OR ESDTrack  --------------------------------*/\r
+Bool_t useKFParticle = kTRUE;\r
+Bool_t useESDTrack   = kFALSE;\r
+/** ----------------------- end Choose KFParticle OR ESDTrack  -----------------------------*/\r
+\r
+\r
+Bool_t calculateBackground = kTRUE;\r
+\r
+/** ---------------------------------- define cuts here ------------------------------------*/\r
+\r
+Int_t pidOfNegativeTrack=11;\r
+Int_t pidOfPositiveTrack=-11;\r
+\r
+Double_t maxRCut   = 200.;\r
+Double_t etaCut    = 1.2;\r
+Double_t ptCut     = 0.1;\r
+Double_t chi2Cut   = 20.;\r
+\r
+Double_t xVertexCut = 0.;\r
+Double_t yVertexCut = 0.;\r
+Double_t zVertexCut = 0.;\r
+\r
+Double_t sigmaCutGammaMass=0.0001;\r
+\r
+Bool_t useImprovedVertex = kTRUE;\r
+\r
+// define masses of different particles, this will be used by the KF particle\r
+// together with the width to set mass constraints. Units in GeV.\r
+Double_t electronMass = 0.00051099892;\r
+Double_t gammaMass    = 0.;\r
+Double_t pi0Mass      = 0.1349766;\r
+Double_t etaMass      = 0.54751;\r
+\r
+// define the width constraint used by KF particle.\r
+Double_t gammaWidth = 0.01;\r
+Double_t pi0Width   = 0.01;\r
+Double_t etaWidth   = 0.01;\r
+\r
+// define the probability of track being an electron\r
+Double_t probElectron = 0.5;\r
+\r
+/** ----------------------------------end define cuts here----------------------------------*/\r
+\r
+/** -------------------------------- Phi/R Mapping ---------------------------------------*/\r
+Int_t nPhiIndex = 18;\r
+Int_t nRIndex   = 40;\r
+\r
+Double_t minRadius   = 0.;\r
+Double_t maxRadius   = 200.;\r
+Double_t minPhi      = -TMath::Pi();\r
+Double_t maxPhi      = TMath::Pi();\r
+/** ------------------------------- end Phi/R Mapping ------------------------------------*/\r
+\r
+/** ------------------- define which histograms to plot here --------------------------------*/\r
+/**   NB: to change the bin numbers, see below the histogram flags                           */\r
+Bool_t plotMCEPR                             = kTRUE;\r
+Bool_t plotMCEPZR                           = kTRUE;\r
+Bool_t plotMCEPXY                           = kTRUE;\r
+Bool_t plotMCEPOpeningAngle                  = kTRUE;\r
+\r
+Bool_t plotMCEEnergy                         = kTRUE;\r
+Bool_t plotMCEPt                             = kTRUE;\r
+Bool_t plotMCEEta                            = kTRUE;\r
+Bool_t plotMCEPhi                            = kTRUE;\r
+\r
+Bool_t plotMCPEnergy                         = kTRUE;\r
+Bool_t plotMCPPt                             = kTRUE;\r
+Bool_t plotMCPEta                            = kTRUE;\r
+Bool_t plotMCPPhi                            = kTRUE;\r
+\r
+Bool_t plotMCGammaEnergy                     = kTRUE;\r
+Bool_t plotMCGammaPt                         = kTRUE;\r
+Bool_t plotMCGammaEta                        = kTRUE;\r
+Bool_t plotMCGammaPhi                        = kTRUE;\r
+\r
+Bool_t plotMCDirectGammaEnergy               = kTRUE;\r
+Bool_t plotMCDirectGammaPt                   = kTRUE;\r
+Bool_t plotMCDirectGammaEta                  = kTRUE;\r
+Bool_t plotMCDirectGammaPhi                  = kTRUE;\r
+\r
+Bool_t plotMCMatchGammaEta                  = kTRUE;\r
+Bool_t plotMCMatchGammaPhi                  = kTRUE;\r
+Bool_t plotMCMatchGammaPt                   = kTRUE;\r
+Bool_t plotMCMatchGammaEnergy               = kTRUE;\r
+Bool_t plotMCMatchGammaMass                 = kTRUE;\r
+Bool_t plotMCMatchGammaOpeningAngle         = kTRUE;\r
+Bool_t plotMCMatchGammaR                    = kTRUE;\r
+Bool_t plotMCMatchGammaZR                  = kTRUE;\r
+Bool_t plotMCMatchGammaXY                  = kTRUE;\r
+\r
+Bool_t plotMCPi0Eta                          = kTRUE;\r
+Bool_t plotMCPi0Phi                          = kTRUE;\r
+Bool_t plotMCPi0Pt                           = kTRUE;\r
+Bool_t plotMCPi0Energy                       = kTRUE;\r
+Bool_t plotMCPi0Mass                         = kTRUE;\r
+Bool_t plotMCPi0OpeningAngle                 = kTRUE;\r
+Bool_t plotMCPi0R                            = kTRUE;\r
+Bool_t plotMCPi0ZR                          = kTRUE;\r
+Bool_t plotMCPi0XY                          = kTRUE;\r
+\r
+Bool_t plotMCEtaEta                          = kTRUE;\r
+Bool_t plotMCEtaPhi                          = kTRUE;\r
+Bool_t plotMCEtaPt                           = kTRUE;\r
+Bool_t plotMCEtaEnergy                       = kTRUE;\r
+Bool_t plotMCEtaMass                         = kTRUE;\r
+Bool_t plotMCEtaOpeningAngleGamma            = kTRUE;\r
+Bool_t plotMCEtaR                            = kTRUE;\r
+Bool_t plotMCEtaZR                          = kTRUE;\r
+Bool_t plotMCEtaXY                          = kTRUE;\r
+    \r
+// Histograms from esd tracks\r
+Bool_t plotESDEPR                            = kTRUE;\r
+Bool_t plotESDEPZR                          = kTRUE;\r
+Bool_t plotESDEPXY                          = kTRUE;\r
+Bool_t plotESDEPOpeningAngle                 = kTRUE;\r
+\r
+Bool_t plotESDEEnergy                        = kTRUE;\r
+Bool_t plotESDEPt                            = kTRUE;\r
+Bool_t plotESDEEta                           = kTRUE;\r
+Bool_t plotESDEPhi                           = kTRUE;\r
+\r
+Bool_t plotESDPEnergy                        = kTRUE;\r
+Bool_t plotESDPPt                            = kTRUE;\r
+Bool_t plotESDPEta                           = kTRUE;\r
+Bool_t plotESDPPhi                           = kTRUE;\r
+\r
+\r
+Bool_t plotESDGammaEnergy                    = kTRUE;\r
+Bool_t plotESDGammaPt                        = kTRUE;\r
+Bool_t plotESDGammaEta                       = kTRUE;\r
+Bool_t plotESDGammaPhi                       = kTRUE;\r
+\r
+Bool_t plotESDMatchGammaOpeningAngle        = kTRUE;\r
+Bool_t plotESDMatchGammaEnergy              = kTRUE;\r
+Bool_t plotESDMatchGammaPt                  = kTRUE;\r
+Bool_t plotESDMatchGammaEta                 = kTRUE;\r
+Bool_t plotESDMatchGammaPhi                 = kTRUE;\r
+Bool_t plotESDMatchGammaMass                = kTRUE;\r
+Bool_t plotESDMatchGammaWidth               = kTRUE;\r
+Bool_t plotESDMatchGammaChi2                = kTRUE;\r
+Bool_t plotESDMatchGammaNDF                 = kTRUE;\r
+Bool_t plotESDMatchGammaR                   = kTRUE;\r
+Bool_t plotESDMatchGammaZR                 = kTRUE;\r
+Bool_t plotESDMatchGammaXY                 = kTRUE;\r
+\r
+Bool_t plotESDTwoGammaCombinationOpeningAngleGamma         = kTRUE;\r
+Bool_t plotESDTwoGammaCombinationEnergy    = kTRUE;\r
+Bool_t plotESDTwoGammaCombinationPt        = kTRUE;\r
+Bool_t plotESDTwoGammaCombinationEta       = kTRUE;\r
+Bool_t plotESDTwoGammaCombinationPhi       = kTRUE;\r
+Bool_t plotESDTwoGammaCombinationMass      = kTRUE;\r
+Bool_t plotESDTwoGammaCombinationR         = kTRUE;\r
+Bool_t plotESDTwoGammaCombinationZR        = kTRUE;\r
+Bool_t plotESDTwoGammaCombinationXY        = kTRUE;\r
+\r
+Bool_t plotESDBackgroundOpeningAngleGamma    = kTRUE;\r
+Bool_t plotESDBackgroundEnergy               = kTRUE;\r
+Bool_t plotESDBackgroundPt                   = kTRUE;\r
+Bool_t plotESDBackgroundEta                  = kTRUE;\r
+Bool_t plotESDBackgroundPhi                  = kTRUE;\r
+Bool_t plotESDBackgroundMass                 = kTRUE;\r
+Bool_t plotESDBackgroundR                    = kTRUE;\r
+Bool_t plotESDBackgroundZR                  = kTRUE;\r
+Bool_t plotESDBackgroundXY                  = kTRUE;\r
+\r
+Bool_t plotMapping                             = kTRUE;       \r
+\r
+Bool_t plotResolutiondPt                      = kTRUE;\r
+Bool_t plotResolutiondR                       = kTRUE;\r
+Bool_t plotResolutiondZ                       = kTRUE;\r
+  \r
+Bool_t plotResolutiondRdPt                   = kTRUE;\r
+\r
+Bool_t plotResolutionMCPt                    = kTRUE;\r
+Bool_t plotResolutionMCR                     = kTRUE;\r
+Bool_t plotResolutionMCZ                     = kTRUE;\r
+\r
+Bool_t plotResolutionESDPt                   = kTRUE;\r
+Bool_t plotResolutionESDR                    = kTRUE;\r
+Bool_t plotResolutionESDZ                    = kTRUE;\r
+\r
+Bool_t plotNumberOfV0s                         = kTRUE;\r
+Bool_t plotNumberOfSurvivingV0s                = kTRUE;\r
+\r
+  //  debug histograms\r
+Bool_t plotV0MassDebugCut1                     = kTRUE;\r
+Bool_t plotV0MassDebugCut2                     = kTRUE;\r
+Bool_t plotV0MassDebugCut3                     = kTRUE;\r
+Bool_t plotV0MassDebugCut4                     = kTRUE;\r
+Bool_t plotV0MassDebugCut5                     = kTRUE;\r
+Bool_t plotV0MassDebugCut6                     = kTRUE;\r
+Bool_t plotV0MassDebugCut7                     = kTRUE;\r
+Bool_t plotV0MassDebugCut8                     = kTRUE;\r
+\r
+Bool_t plotPi0Spectra                          = kTRUE;\r
+Bool_t plotEtaSpectra                          = kTRUE;\r
+\r
+\r
+/** ----------------- end define which histograms to plot here -------------------------------*/\r
+\r
+\r
+\r
+/** ----------- Define the binning for the different plot types here -------------------------*/\r
+//R-plots\r
+Int_t nXBinsR = 1000;\r
+Double_t firstXBinR = 0.;\r
+Double_t lastXBinR = 250.;\r
+\r
+//ZR-plots\r
+Int_t nXBinsZR = 2000;\r
+Double_t firstXBinZR = -10.;\r
+Double_t lastXBinZR = 10.;\r
+Int_t nYBinsZR = 1000;\r
+Double_t firstYBinZR = 0.;\r
+Double_t lastYBinZR = 250.;\r
+\r
+//XY-plots\r
+Int_t nXBinsXY = 2000;\r
+Double_t firstXBinXY = -250.;\r
+Double_t lastXBinXY = 250.;\r
+Int_t nYBinsXY = 2000;\r
+Double_t firstYBinXY = -250.;\r
+Double_t lastYBinXY = 250.;\r
+\r
+//OpenAngle-plots\r
+Int_t nXBinsOpeningAngle = 200;\r
+Double_t firstXBinOpeningAngle = 0.;\r
+Double_t lastXBinOpeningAngle = TMath::Pi()/2;\r
+\r
+//Energy-plots\r
+Int_t nXBinsEnergy = 500;\r
+Double_t firstXBinEnergy = 0.;\r
+Double_t lastXBinEnergy = 5.;\r
+\r
+//Pt-plots\r
+Int_t nXBinsPt = 500;\r
+Double_t firstXBinPt = 0.;\r
+Double_t lastXBinPt = 5.;\r
+\r
+//Eta-plots\r
+Int_t nXBinsEta = 400;\r
+Double_t firstXBinEta = -2.;\r
+Double_t lastXBinEta = 2.;\r
+\r
+//Phi-plots\r
+Int_t nXBinsPhi = 720;\r
+Double_t firstXBinPhi = -TMath::Pi();\r
+Double_t lastXBinPhi = TMath::Pi();\r
+\r
+//Mapping-plots\r
+Int_t nXBinsMapping = 40;\r
+Double_t firstXBinMapping = -20.;\r
+Double_t lastXBinMapping = 20.;\r
+Int_t nYBinsMapping = 30;\r
+Double_t firstYBinMapping = -1.5;\r
+Double_t lastYBinMapping = 1.5;\r
+\r
+//ResolutionPlots\r
+//RESdPt\r
+Int_t nXBinsResdPt=500;\r
+Int_t firstXBinResdPt= 0;\r
+Int_t lastXBinResdPt=5;\r
+Int_t nYBinsResdPt=1000;\r
+Int_t firstYBinResdPt= -5;\r
+Int_t lastYBinResdPt=5;\r
+\r
+//RESdR\r
+Int_t nXBinsResdR=1000;\r
+Int_t firstXBinResdR= 0;\r
+Int_t lastXBinResdR=250;\r
+Int_t nYBinsResdR=1000;\r
+Int_t firstYBinResdR= -25;\r
+Int_t lastYBinResdR=25;\r
+\r
+//RESdZ\r
+Int_t nXBinsResdZ=2000;\r
+Int_t firstXBinResdZ= -20;\r
+Int_t lastXBinResdZ=20;\r
+Int_t nYBinsResdZ=1000;\r
+Int_t firstYBinResdZ= -20;\r
+Int_t lastYBinResdZ=20;\r
+\r
+//RESdRdPt\r
+Int_t nXBinsResdRdPt=1000;\r
+Int_t firstXBinResdRdPt= -22;\r
+Int_t lastXBinResdRdPt=22;\r
+Int_t nYBinsResdRdPt=1000;\r
+Int_t firstYBinResdRdPt= -5;\r
+Int_t lastYBinResdRdPt=5;\r
+\r
+\r
+//RESMCPt\r
+Int_t nXBinsResPt=500;\r
+Int_t firstXBinResPt= 0;\r
+Int_t lastXBinResPt=5;\r
+\r
+//RESMCR\r
+Int_t nXBinsResR=1000;\r
+Int_t firstXBinResR= 0;\r
+Int_t lastXBinResR=250;\r
+\r
+//RESMCZ\r
+Int_t nXBinsResZ=1000;\r
+Int_t firstXBinResZ= 0;\r
+Int_t lastXBinResZ=250;\r
+\r
+//GammaMass-plots\r
+Int_t nXBinsGammaMass = 100;\r
+Double_t firstXBinGammaMass = 0.;\r
+Double_t lastXBinGammaMass = 1.;\r
+\r
+//Pi0Mass-plots\r
+Int_t nXBinsPi0Mass = 100;\r
+Double_t firstXBinPi0Mass = 0.;\r
+Double_t lastXBinPi0Mass = 1.;\r
+\r
+//EtaMass-plots\r
+Int_t nXBinsEtaMass = 100;\r
+Double_t firstXBinEtaMass = 0.;\r
+Double_t lastXBinEtaMass = 1.;\r
+\r
+//GammaWidth-plots\r
+Int_t nXBinsGammaWidth = 100;\r
+Double_t firstXBinGammaWidth = 0.;\r
+Double_t lastXBinGammaWidth = 1.;\r
+\r
+//GammaChi2-plots\r
+Int_t nXBinsGammaChi2 = 100;\r
+Double_t firstXBinGammaChi2 = 0;\r
+Double_t lastXBinGammaChi2 = 100.;\r
+\r
+//GammaNDF-plots\r
+Int_t nXBinsGammaNDF = 10;\r
+Double_t firstXBinGammaNDF = 0.;\r
+Double_t lastXBinGammaNDF = 10.;\r
+\r
+//Spectra-plots\r
+Int_t nXBinsSpectra = 100;\r
+Double_t firstXBinSpectra = 0.;\r
+Double_t lastXBinSpectra = 1.;\r
+Int_t nYBinsSpectra = 500;\r
+Double_t firstYBinSpectra = 0.;\r
+Double_t lastYBinSpectra = 100.;\r
+\r
+/** ---------- end Define the binning for the different plot types here ----------------------*/\r
+\r
+\r
+\r
+/************************************************************************************************\r
+ *                                                                                              *\r
+ *                                                                                              *\r
+ *                     EVERYTHING BELOW IS FOR DEVELOPERS ONLY                                  *\r
+ *                                                                                              *\r
+ *                                                                                              *\r
+ ************************************************************************************************/\r
+\r
+void ConfigGammaConversion(const char *chainName, const char *sample, int limit = 0){\r
+  \r
+  build();//build (if necessary) and load the libraries needed\r
+\r
+  gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); // load the CreateChain macro\r
+\r
+  AliLog::SetGlobalLogLevel(AliLog::kError);\r
+\r
+  //-------------------------------- Creating the histograms -------------------------------\r
+  AliGammaConversionHistograms * histograms = new AliGammaConversionHistograms();\r
+\r
+  if(plotMCEPR == kTRUE){ histograms->AddHistogram("MC_EP_R","Radius of gamma conversion points",nXBinsR, firstXBinR, lastXBinR,"counts","cm");}\r
+  if(plotMCEPZR == kTRUE){ histograms->AddHistogram("MC_EP_ZR","Radius of gamma conversion points vs Z",nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "cm", "cm");}\r
+  if(plotMCEPXY == kTRUE){ histograms->AddHistogram("MC_EP_XY","Gamma XY converison point.",nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "cm", "cm");}\r
+  if(plotMCEPOpeningAngle == kTRUE){ histograms->AddHistogram("MC_EP_OpeningAngle","Opening angle of e+e- pairs from gamma conversion",nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "counts", "cm");}\r
+\r
+  if(plotMCEEnergy == kTRUE){ histograms->AddHistogram("MC_E_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotMCEPt == kTRUE){ histograms->AddHistogram("MC_E_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotMCEEta == kTRUE){ histograms->AddHistogram("MC_E_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotMCEPhi == kTRUE){ histograms->AddHistogram("MC_E_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+\r
+  if(plotMCPEnergy == kTRUE){ histograms->AddHistogram("MC_P_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotMCPPt == kTRUE){ histograms->AddHistogram("MC_P_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotMCPEta == kTRUE){ histograms->AddHistogram("MC_P_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotMCPPhi == kTRUE){ histograms->AddHistogram("MC_P_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+\r
+  if(plotMCGammaEnergy == kTRUE){ histograms->AddHistogram("MC_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotMCGammaPt == kTRUE){ histograms->AddHistogram("MC_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotMCGammaEta == kTRUE){ histograms->AddHistogram("MC_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotMCGammaPhi == kTRUE){ histograms->AddHistogram("MC_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+\r
+  if(plotMCDirectGammaEnergy == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotMCDirectGammaPt == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotMCDirectGammaEta == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotMCDirectGammaPhi == kTRUE){ histograms->AddHistogram("MC_DirectGamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+\r
+  if(plotMCMatchGammaEta == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotMCMatchGammaPhi == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+  if(plotMCMatchGammaPt == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotMCMatchGammaEnergy == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotMCMatchGammaMass == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_Mass" ,"" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass, "", "");}\r
+  if(plotMCMatchGammaOpeningAngle == kTRUE){ histograms->AddHistogram("MC_Match_Gamma_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
+  if(plotMCMatchGammaR == kTRUE){ histograms->AddHistogram("MC_Match_GammaR" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
+  if(plotMCMatchGammaZR == kTRUE){ histograms->AddHistogram("MC_Match_GammaZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
+  if(plotMCMatchGammaXY == kTRUE){ histograms->AddHistogram("MC_Match_GammaXY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
+\r
+  if(plotMCPi0Eta == kTRUE){ histograms->AddHistogram("MC_Pi0_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotMCPi0Phi == kTRUE){ histograms->AddHistogram("MC_Pi0_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+  if(plotMCPi0Pt == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotMCPi0Energy == kTRUE){ histograms->AddHistogram("MC_Pi0_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotMCPi0Mass == kTRUE){ histograms->AddHistogram("MC_Pi0_Mass" ,"" , nXBinsPi0Mass, firstXBinPi0Mass, lastXBinPi0Mass, "", "");}\r
+  if(plotMCPi0OpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
+  if(plotMCPi0R == kTRUE){ histograms->AddHistogram("MC_Pi0_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
+  if(plotMCPi0ZR == kTRUE){ histograms->AddHistogram("MC_Pi0_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
+  if(plotMCPi0XY == kTRUE){ histograms->AddHistogram("MC_Pi0_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
+\r
+  if(plotMCEtaEta == kTRUE){ histograms->AddHistogram("MC_Eta_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotMCEtaPhi == kTRUE){ histograms->AddHistogram("MC_Eta_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+  if(plotMCEtaPt == kTRUE){ histograms->AddHistogram("MC_Eta_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotMCEtaEnergy == kTRUE){ histograms->AddHistogram("MC_Eta_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotMCEtaMass == kTRUE){ histograms->AddHistogram("MC_Eta_Mass" ,"" , nXBinsEtaMass, firstXBinEtaMass, lastXBinEtaMass, "", "");}\r
+  if(plotMCEtaOpeningAngleGamma == kTRUE){ histograms->AddHistogram("MC_Eta_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
+  if(plotMCEtaR == kTRUE){ histograms->AddHistogram("MC_Eta_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
+  if(plotMCEtaZR == kTRUE){ histograms->AddHistogram("MC_Eta_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
+  if(plotMCEtaXY == kTRUE){ histograms->AddHistogram("MC_Eta_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
+    \r
+  // Histograms from esd tracks\r
+  if(plotESDEPR == kTRUE){ histograms->AddHistogram("ESD_EP_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
+  if(plotESDEPZR == kTRUE){ histograms->AddHistogram("ESD_EP_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
+  if(plotESDEPXY == kTRUE){ histograms->AddHistogram("ESD_EP_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
+  if(plotESDEPOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_EP_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
+\r
+  if(plotESDEEnergy == kTRUE){ histograms->AddHistogram("ESD_E_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotESDEPt == kTRUE){ histograms->AddHistogram("ESD_E_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotESDEEta == kTRUE){ histograms->AddHistogram("ESD_E_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotESDEPhi == kTRUE){ histograms->AddHistogram("ESD_E_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+\r
+  if(plotESDPEnergy == kTRUE){ histograms->AddHistogram("ESD_P_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotESDPPt == kTRUE){ histograms->AddHistogram("ESD_P_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotESDPEta == kTRUE){ histograms->AddHistogram("ESD_P_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotESDPPhi == kTRUE){ histograms->AddHistogram("ESD_P_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+\r
+  if(plotESDGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotESDGammaPt == kTRUE){ histograms->AddHistogram("ESD_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotESDGammaEta == kTRUE){ histograms->AddHistogram("ESD_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotESDGammaPhi == kTRUE){ histograms->AddHistogram("ESD_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+\r
+  if(plotESDMatchGammaOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
+  if(plotESDMatchGammaEnergy == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotESDMatchGammaPt == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotESDMatchGammaEta == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotESDMatchGammaPhi == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+  if(plotESDMatchGammaMass == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Mass" ,"" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass, "", "");}\r
+  if(plotESDMatchGammaWidth == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Width" ,"" , nXBinsGammaWidth, firstXBinGammaWidth, lastXBinGammaWidth, "", "");}\r
+  if(plotESDMatchGammaChi2 == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_Chi2" ,"" , nXBinsGammaChi2, firstXBinGammaChi2, lastXBinGammaChi2, "", "");}\r
+  if(plotESDMatchGammaNDF == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_NDF" ,"" , nXBinsGammaNDF, firstXBinGammaNDF, lastXBinGammaNDF, "", "");}\r
+  if(plotESDMatchGammaR == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
+  if(plotESDMatchGammaZR == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
+  if(plotESDMatchGammaXY == kTRUE){ histograms->AddHistogram("ESD_Match_Gamma_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
+\r
+  if(plotESDTwoGammaCombinationOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
+  if(plotESDTwoGammaCombinationEnergy == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotESDTwoGammaCombinationPt == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotESDTwoGammaCombinationEta == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotESDTwoGammaCombinationPhi == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+  if(plotESDTwoGammaCombinationMass == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_Mass" ,"" , nXBinsPi0Mass, firstXBinPi0Mass, lastXBinPi0Mass, "", "");}\r
+  if(plotESDTwoGammaCombinationR == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
+  if(plotESDTwoGammaCombinationZR == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
+  if(plotESDTwoGammaCombinationXY == kTRUE){ histograms->AddHistogram("ESD_TwoGammaCombination_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
+\r
+  /*\r
+  if(plotESDEtaOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Eta_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
+  if(plotESDEtaEnergy == kTRUE){ histograms->AddHistogram("ESD_Eta_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotESDEtaPt == kTRUE){ histograms->AddHistogram("ESD_Eta_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotESDEtaEta == kTRUE){ histograms->AddHistogram("ESD_Eta_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotESDEtaPhi == kTRUE){ histograms->AddHistogram("ESD_Eta_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+  if(plotESDEtaMass == kTRUE){ histograms->AddHistogram("ESD_Eta_Mass" ,"" , nXBinsEtaMass, firstXBinEtaMass, lastXBinEtaMass, "", "");}\r
+  if(plotESDEtaR == kTRUE){ histograms->AddHistogram("ESD_Eta_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
+  if(plotESDEtaZR == kTRUE){ histograms->AddHistogram("ESD_Eta_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
+  if(plotESDEtaXY == kTRUE){ histograms->AddHistogram("ESD_Eta_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
+  */\r
+  if(plotESDBackgroundOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Background_GammaDaughter_OpeningAngle" ,"" , nXBinsOpeningAngle, firstXBinOpeningAngle, lastXBinOpeningAngle, "", "");}\r
+  if(plotESDBackgroundEnergy == kTRUE){ histograms->AddHistogram("ESD_Background_Energy" ,"" , nXBinsEnergy, firstXBinEnergy, lastXBinEnergy, "", "");}\r
+  if(plotESDBackgroundPt == kTRUE){ histograms->AddHistogram("ESD_Background_Pt" ,"" , nXBinsPt, firstXBinPt, lastXBinPt, "", "");}\r
+  if(plotESDBackgroundEta == kTRUE){ histograms->AddHistogram("ESD_Background_Eta" ,"" , nXBinsEta, firstXBinEta, lastXBinEta, "", "");}\r
+  if(plotESDBackgroundPhi == kTRUE){ histograms->AddHistogram("ESD_Background_Phi" ,"" , nXBinsPhi, firstXBinPhi, lastXBinPhi, "", "");}\r
+  if(plotESDBackgroundMass == kTRUE){ histograms->AddHistogram("ESD_Background_Mass" ,"" , nXBinsEtaMass, firstXBinEtaMass, lastXBinEtaMass, "", "");}\r
+  if(plotESDBackgroundR == kTRUE){ histograms->AddHistogram("ESD_Background_R" ,"" , nXBinsR, firstXBinR, lastXBinR, "", "");}\r
+  if(plotESDBackgroundZR == kTRUE){ histograms->AddHistogram("ESD_Background_ZR" ,"" , nXBinsZR, firstXBinZR, lastXBinZR, nYBinsZR, firstYBinZR, lastYBinZR, "", "");}\r
+  if(plotESDBackgroundXY == kTRUE){ histograms->AddHistogram("ESD_Background_XY" ,"" , nXBinsXY, firstXBinXY, lastXBinXY, nYBinsXY, firstYBinXY, lastYBinXY, "", "");}\r
+\r
+  if(plotMapping == kTRUE){\r
+    histograms->InitializeMappingValues(nPhiIndex,nRIndex,nXBinsMapping,minRadius,maxRadius,nYBinsMapping,minPhi,maxPhi);\r
+    histograms->AddMappingHistograms(nPhiIndex,nRIndex,nXBinsMapping,minRadius,maxRadius,nYBinsMapping,minPhi,maxPhi);\r
+  }\r
+\r
+  if(plotResolutiondPt == kTRUE){histograms->AddHistogram("Resolution_dPt" ,"" , nXBinsResdPt, firstXBinResdPt, lastXBinResdPt, nYBinsResdPt, firstYBinResdPt, lastYBinResdPt, "", "");}\r
+  if(plotResolutiondR == kTRUE){histograms->AddHistogram("Resolution_dR" ,"" , nXBinsResdR, firstXBinResdR, lastXBinResdR, nYBinsResdR, firstYBinResdR, lastYBinResdR, "", "");}\r
+  if(plotResolutiondZ == kTRUE){histograms->AddHistogram("Resolution_dZ" ,"" , nXBinsResdZ, firstXBinResdZ, lastXBinResdZ, nYBinsResdZ, firstYBinResdZ, lastYBinResdZ, "", "");}\r
+  \r
+  if(plotResolutiondRdPt == kTRUE){histograms->AddHistogram("Resolution_dR_dPt" ,"" , nXBinsResdRdPt, firstXBinResdRdPt, lastXBinResdRdPt, nYBinsResdRdPt, firstYBinResdRdPt, lastYBinResdRdPt, "", "");}\r
+  \r
+  if(plotResolutionMCPt == kTRUE){histograms->AddHistogram("Resolution_MC_Pt" ,"" , nXBinsResPt, firstXBinResPt, lastXBinResPt,"","");}\r
+  if(plotResolutionMCR == kTRUE){histograms->AddHistogram("Resolution_MC_R" ,"" , nXBinsResR, firstXBinResR, lastXBinResR,"","");}\r
+  if(plotResolutionMCZ == kTRUE){histograms->AddHistogram("Resolution_MC_Z" ,"" , nXBinsResZ, firstXBinResZ, lastXBinResZ,"","");}\r
+  \r
+  if(plotResolutionESDPt == kTRUE){histograms->AddHistogram("Resolution_ESD_Pt" ,"" , nXBinsResPt, firstXBinResPt, lastXBinResPt,"","");}\r
+  if(plotResolutionESDR == kTRUE){histograms->AddHistogram("Resolution_ESD_R" ,"" , nXBinsResR, firstXBinResR, lastXBinResR,"","");}\r
+  if(plotResolutionESDZ == kTRUE){histograms->AddHistogram("Resolution_ESD_Z" ,"" , nXBinsResZ, firstXBinResZ, lastXBinResZ,"","");}\r
+  \r
+  if(plotNumberOfV0s == kTRUE){histograms->AddHistogram("NumberOfV0s","Number of v0s",100, 0, 100,"","");}\r
+  if(plotNumberOfSurvivingV0s == kTRUE){histograms->AddHistogram("NumberOfSurvivingV0s","Number of surviving v0s",100, 0, 100,"","");}\r
+\r
+  //  debug histograms\r
+  if(plotV0MassDebugCut1 == kTRUE){histograms->AddHistogram("V0MassDebugCut1" ,"debug1" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
+  if(plotV0MassDebugCut2 == kTRUE){histograms->AddHistogram("V0MassDebugCut2" ,"debug2" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
+  if(plotV0MassDebugCut3 == kTRUE){histograms->AddHistogram("V0MassDebugCut3" ,"debug3" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
+  if(plotV0MassDebugCut4 == kTRUE){histograms->AddHistogram("V0MassDebugCut4" ,"debug4" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
+  if(plotV0MassDebugCut5 == kTRUE){histograms->AddHistogram("V0MassDebugCut5" ,"debug5" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
+  if(plotV0MassDebugCut6 == kTRUE){histograms->AddHistogram("V0MassDebugCut6" ,"debug6" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
+  if(plotV0MassDebugCut7 == kTRUE){histograms->AddHistogram("V0MassDebugCut7" ,"debug7" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
+  if(plotV0MassDebugCut8 == kTRUE){histograms->AddHistogram("V0MassDebugCut8" ,"debug8" , nXBinsGammaMass, firstXBinGammaMass, lastXBinGammaMass,"","");}\r
+\r
+\r
+  if(plotPi0Spectra == kTRUE){histograms->AddHistogram("InvMass_vs_Pt__Spectra" ,"Inv mass vs Pt" , nXBinsSpectra, firstXBinSpectra, lastXBinSpectra,nYBinsSpectra, firstYBinSpectra, lastYBinSpectra,"InvMass [GeV]","Pt [GeV]");}\r
+\r
+  \r
+\r
+  //------------------------------ end Creating the histograms -----------------------------\r
+\r
+  // Create the Analysis manager\r
+  AliAnalysisManager *mgr  = new AliAnalysisManager("My Manager", "My Analysis");\r
+\r
+  // Define Input Event Handler \r
+  AliESDInputHandler* inpHandler = new AliESDInputHandler();\r
+\r
+  // Define Output Event Handler\r
+  AliAODHandler* aodHandler = new AliAODHandler();\r
+  aodHandler->SetOutputFileName("aodAliGammaConversion.root");\r
+  \r
+  // Define MC Truth Event Handler\r
+  AliMCEventHandler* mcHandler = new AliMCEventHandler();\r
+  \r
+  // Add Handlers to the Task Manager\r
+  mgr->SetInputEventHandler  (inpHandler);\r
+  mgr->SetOutputEventHandler (aodHandler);\r
+  mgr->SetMCtruthEventHandler(mcHandler);\r
+\r
+  // Be sure you are told what you are doing\r
+  mgr->SetDebugLevel(10);\r
+\r
+  // Declare Common Input Tchain\r
+  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("Chain",TChain::Class(),AliAnalysisManager::kInputContainer);\r
+\r
+  // Common Output Tree in common ‘default’ output file\r
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tree", TTree::Class(),AliAnalysisManager::kOutputContainer, "default");\r
+\r
+  // Private output objects\r
+  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histogramsAliGammaConversion", TList::Class(),AliAnalysisManager::kOutputContainer, "histogramsAliGammaConversion.root");\r
+\r
+\r
+  //------------------------ END: Define input/output handlers ---------------------------------------------------\r
+\r
+\r
+  //check for errors in the specified data\r
+  if(useKFParticle == kTRUE && useESDTrack == kTRUE){\r
+    //Print warning, cannot use both\r
+  }\r
+  if(useKFParticle == kFALSE && useESDTrack == kFALSE){\r
+    //Print warning, one have to be specified\r
+  }\r
+\r
+\r
+  //Create the V0Reader\r
+  AliV0Reader * v0Reader = new AliV0Reader();\r
+  if(useKFParticle){\r
+    v0Reader->UseKFParticle();\r
+  }\r
+  else if(useESDTrack){\r
+    v0Reader->UseESDTrack();\r
+  }\r
+  v0Reader->SetNegativeTrackPID(pidOfNegativeTrack);\r
+  v0Reader->SetPositiveTrackPID(pidOfPositiveTrack);\r
+  v0Reader->SetMaxRCut(maxRCut);\r
+  v0Reader->SetEtaCut(etaCut);\r
+  v0Reader->SetPtCut(ptCut);\r
+  v0Reader->SetChi2Cut(chi2Cut);\r
+  v0Reader->SetPIDProbability(probElectron);\r
+  v0Reader->SetXVertexCut(xVertexCut);\r
+  v0Reader->SetYVertexCut(yVertexCut);\r
+  v0Reader->SetZVertexCut(zVertexCut);\r
+  v0Reader->SetSigmaMass(sigmaCutGammaMass);\r
+  v0Reader->SetUseImprovedVertex(useImprovedVertex);\r
+\r
+  // Create the GammaConversionTask\r
+  AliAnalysisTaskGammaConversion *gammaconversion = new AliAnalysisTaskGammaConversion("GammaConversionTask");\r
+  gammaconversion->SetDebugLevel(10);\r
+  \r
+  gammaconversion->SetV0Reader(v0Reader);\r
+  gammaconversion->SetCalculateBackground(calculateBackground);\r
+  gammaconversion->Init();\r
+  \r
+  gammaconversion->SetElectronMass(electronMass);\r
+  gammaconversion->SetGammaMass(gammaMass);\r
+  gammaconversion->SetPi0Mass(pi0Mass);\r
+  gammaconversion->SetEtaMass(etaMass);\r
+\r
+  gammaconversion->SetGammaWidth(gammaWidth);\r
+  gammaconversion->SetPi0Width(pi0Width);\r
+  gammaconversion->SetEtaWidth(etaWidth);\r
+\r
+  // define the width constraint used by KF particle.\r
+  Double_t gammaWidth = 0.01;\r
+  Double_t pi0Width   = 0.01;\r
+  Double_t etaWidth   = 0.01;\r
+\r
+  gammaconversion->SetHistograms(histograms);\r
+  v0Reader->SetHistograms(histograms);// also give the pointer to the v0reader, for debugging cuts\r
+  \r
+  gammaconversion->SetDoMCTruth(doMCTruth);\r
+\r
+\r
+  // Add task to the manager \r
+  mgr->AddTask(gammaconversion);\r
+\r
+  // Connect I/O to the task\r
+  mgr->ConnectInput (gammaconversion, 0, cinput1);\r
+  mgr->ConnectOutput(gammaconversion, 0, coutput1);\r
+  mgr->ConnectOutput(gammaconversion, 1, coutput2);\r
+\r
+  TChain* chain= CreateESDChain(sample);\r
+  \r
+  mgr->InitAnalysis();\r
+  \r
+  mgr->PrintStatus();\r
+  \r
+  mgr->StartAnalysis("local",chain);\r
+}\r
+\r
+\r
+\r
+\r
+void build() {\r
+  TStopwatch timer;\r
+  timer.Start();\r
+  gSystem->Load("libTree.so");\r
+  gSystem->Load("libGeom");\r
+  //  gSystem->Load("libANALYSISalice");\r
+\r
+  ////\r
+  ////\r
+  //Setting up STEERBase.par//\r
+  ////\r
+  setupPar("STEERBase");\r
+  gSystem->Load("libSTEERBase.so");\r
+\r
+  ////\r
+  //Setting up ESD.par//\r
+  ////\r
+  setupPar("ESD");\r
+  gSystem->Load("libVMC.so");\r
+  gSystem->Load("libESD.so");\r
+\r
+  ////\r
+  //Setting up AOD.par//\r
+  ////\r
+  setupPar("AOD");\r
+  gSystem->Load("libAOD.so");\r
+                                                                \r
+  ////\r
+  //Setting up ANALYSIS.par//\r
+  ////\r
+  setupPar("ANALYSIS");\r
+  gSystem->Load("libANALYSIS.so");\r
+\r
+  ////\r
+  //Setting up ANALYSISalice.par//\r
+  ////\r
+  setupPar("ANALYSISalice");\r
+  gSystem->Load("libANALYSISalice.so");\r
+                                                                                                                                  \r
+  ////\r
+  //Setting up PWG4Gamma.par//\r
+  ////\r
+  //  setupPar("PWG4Gamma");\r
+  //  gSystem->Load("libPWG4Gamma.so");\r
+  setupPar("PWG4PartCorr");\r
+  gSystem->Load("libPWG4PartCorr.so");\r
+  //if head:: use PWG4PartCorr\r
+             \r
+  //gROOT->LoadMacro("AliAnalysisTaskPi0.cxx+");\r
+  // gROOT->LoadMacro("AliAnalysisTaskPtMC.cxx+");\r
+  //  gROOT->LoadMacro("AliAnalysisTaskPi0MC.cxx+");\r
+  //  gROOT->LoadMacro("AliAnaScale.cxx+");\r
+\r
+\r
+  //gROOT->LoadMacro("$ALICEROOT/PWG0/CreateESDChain.C");\r
+  //TChain* chain = CreateESDChain("files1.txt");\r
+\r
+\r
+\r
+  ////\r
+\r
+\r
+}\r
+\r
+Int_t setupPar(const char* pararchivename) {\r
+  ///////////////////\r
+  // Setup PAR File//\r
+  ///////////////////\r
+  if (pararchivename) {\r
+    char processline[1024];\r
+    sprintf(processline,".! tar xvzf %s.par",pararchivename);\r
+    gROOT->ProcessLine(processline);\r
+    const char* ocwd = gSystem->WorkingDirectory();\r
+    gSystem->ChangeDirectory(pararchivename);\r
+                                                                                                                                               \r
+    // check for BUILD.sh and execute\r
+    if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {\r
+      printf("*******************************\n");\r
+      printf("*** Building PAR archive    ***\n");\r
+      printf("*******************************\n");\r
+                                                                                                                                               \r
+      if (gSystem->Exec("PROOF-INF/BUILD.sh")) {\r
+        Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");\r
+        return -1;\r
+      }\r
+    }\r
+    // check for SETUP.C and execute\r
+    if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {\r
+      printf("*******************************\n");\r
+      printf("*** Setup PAR archive       ***\n");\r
+      printf("*******************************\n");\r
+      gROOT->Macro("PROOF-INF/SETUP.C");\r
+    }\r
+                                                                                                                                               \r
+    gSystem->ChangeDirectory("../");\r
+  }                                                                                                                                               \r
+  return 1;\r
+}\r