MAYOR commit to separate Event and Conversion Cuts, all tasks working except dPhi...
authorfbock <friederike.bock@cern.ch>
Mon, 7 Jul 2014 16:47:13 +0000 (18:47 +0200)
committerfbock <friederike.bock@cern.ch>
Mon, 7 Jul 2014 16:47:13 +0000 (18:47 +0200)
46 files changed:
PWGGA/CMakelibPWGGAGammaConv.pkg
PWGGA/GammaConv/AliAnalysisTaskConversionQA.cxx
PWGGA/GammaConv/AliAnalysisTaskConversionQA.h
PWGGA/GammaConv/AliAnalysisTaskEtaToPiPlPiMiGamma.cxx
PWGGA/GammaConv/AliAnalysisTaskEtaToPiPlPiMiGamma.h
PWGGA/GammaConv/AliAnalysisTaskGammaConvCalo.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvCalo.h
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.h
PWGGA/GammaConv/AliAnalysisTaskGammaConvV1.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvV1.h
PWGGA/GammaConv/AliAnalysisTaskMaterial.cxx
PWGGA/GammaConv/AliAnalysisTaskMaterial.h
PWGGA/GammaConv/AliAnalysisTaskPi0v2.cxx
PWGGA/GammaConv/AliAnalysisTaskPi0v2.h
PWGGA/GammaConv/AliAnalysisTaskResolution.cxx
PWGGA/GammaConv/AliAnalysisTaskResolution.h
PWGGA/GammaConv/AliAnalysisTaskdPhi.cxx
PWGGA/GammaConv/AliAnalysisTaskdPhi.h
PWGGA/GammaConv/AliCaloPhotonCuts.cxx
PWGGA/GammaConv/AliConvEventCuts.cxx [new file with mode: 0644]
PWGGA/GammaConv/AliConvEventCuts.h [new file with mode: 0644]
PWGGA/GammaConv/AliConversionPhotonCuts.cxx [new file with mode: 0644]
PWGGA/GammaConv/AliConversionPhotonCuts.h [new file with mode: 0644]
PWGGA/GammaConv/AliConversionSelection.cxx
PWGGA/GammaConv/AliConversionSelection.h
PWGGA/GammaConv/AliV0ReaderV1.cxx
PWGGA/GammaConv/AliV0ReaderV1.h
PWGGA/GammaConv/macros/AddTask_GammaConvCalo_PbPb.C
PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pPb.C
PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pp.C
PWGGA/GammaConv/macros/AddTask_GammaConvEtaPiPlPiMiGamma_pPb.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_PbPb.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_PbPb2.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_pPb.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_pPb2.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_pPb3.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_pp.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_pp2.C
PWGGA/GammaConv/macros/AddTask_GammaConvdPhi_PbPb.C
PWGGA/GammaConv/macros/AddTask_GammaConvdPhi_pp.C
PWGGA/GammaConv/macros/AddTask_Material.C
PWGGA/GammaConv/macros/AddTask_PhotonQA.C
PWGGA/GammaConv/macros/AddTask_Pi0v2.C
PWGGA/GammaConv/macros/AddTask_Resolution.C
PWGGA/PWGGAGammaConvLinkDef.h

index 8ab2d12..050b76f 100644 (file)
@@ -34,6 +34,8 @@ set ( SRCS
        GammaConv/AliKFConversionPhoton.cxx
        GammaConv/AliKFConversionMother.cxx
         GammaConv/AliCaloPhotonCuts.cxx
+        GammaConv/AliConvEventCuts.cxx
+        GammaConv/AliConversionPhotonCuts.cxx
        GammaConv/AliConversionCuts.cxx
        GammaConv/AliConversionSelection.cxx
        GammaConv/AliConversionMesonCuts.cxx
index 1699ccd..8328230 100644 (file)
@@ -39,732 +39,721 @@ ClassImp(AliAnalysisTaskConversionQA)
 
 //________________________________________________________________________
 AliAnalysisTaskConversionQA::AliAnalysisTaskConversionQA() : AliAnalysisTaskSE(),
-   fV0Reader(NULL),
-   fConversionGammas(NULL),
-   fConversionCuts(NULL),
-   fInputEvent(NULL),
-   fNumberOfESDTracks(0),
-   fMCEvent(NULL),
-   fMCStack(NULL),
-   fTreeQA(NULL),
-   fIsHeavyIon(kFALSE),
-   ffillTree(kFALSE),
-   ffillHistograms(kFALSE),
-   fOutputList(NULL),
-   fTreeList(NULL),
-   fESDList(NULL),
-   hVertexZ(NULL),
-   hNGoodESDTracks(NULL),
-   hNV0Tracks(NULL),
-   hNContributorsVertex(NULL),
-   hITSClusterPhi(NULL),
-   hGammaPt(NULL),
-   hGammaPhi(NULL),
-   hGammaEta(NULL),
-   hGammaChi2perNDF(NULL),
-   hGammaPsiPair(NULL),
-   hGammaArmenteros(NULL),
-   hGammaCosinePointingAngle(NULL),
-   hGammaInvMass(NULL),
-   hElecPt(NULL),
-   hElecEta(NULL),
-   hElecPhi(NULL),
-   hElecNfindableClsTPC(NULL),
-   hPosiNfindableClsTPC(NULL),
-   hElecClsTPC(NULL),
-   hPosiClsTPC(NULL),
-   hElectrondEdxP(NULL),
-   hElectronITSdEdxP(NULL),
-   hElectronTOFP(NULL),
-   hElectronNSigmadEdxP(NULL),
-   hElectronNSigmadEdxEta(NULL),
-   hElectronNSigmaPiondEdxP(NULL),
-   hElectronNSigmaITSP(NULL),
-   hElectronNSigmaTOFP(NULL),
-   hPositrondEdxP(NULL),
-   hPositronITSdEdxP(NULL),
-   hPositronTOFP(NULL),
-   hPositronNSigmadEdxP(NULL),
-   hPositronNSigmadEdxEta(NULL),
-   hPositronNSigmaPiondEdxP(NULL),
-   hPositronNSigmaITSP(NULL),
-   hPositronNSigmaTOFP(NULL),
-//    hElecAsymP(NULL),
-//    fTrueList(NULL),
-//    hTrueResolutionR(NULL),
-//    hTrueResolutionZ(NULL),
-//    hTrueResolutionPhi(NULL),
-//    hTrueGammaPt(NULL),
-//    hTrueGammaPhi(NULL),
-//    hTrueGammaEta(NULL),
-//    hTrueGammaMass(NULL),
-//    hTrueGammaChi2perNDF(NULL),
-//    hTrueGammaPsiPair(NULL),
-//    hTrueGammaQt(NULL),
-//    hTrueGammaCosinePointingAngle(NULL),
-//    hTrueGammaXY(NULL),
-//    hTrueGammaZR(NULL),
-//    hTrueElecPt(NULL),
-//    hTrueElecEta(NULL),
-//    hTrueElecPhi(NULL),
-//    hTrueElecNfindableClsTPC(NULL),
-//    hTruePosiNfindableClsTPC(NULL),
-//    hTrueElecAsymP(NULL),
-   fGammaPt(0),
-   fGammaTheta(0),
-   fGammaChi2NDF(0),
-   fGammaPhotonProp(5),
-   fGammaConvCoord(5),
-   fDaughterProp(24),
-   fKind(0),
-   fIsMC(kFALSE),
-   fnGammaCandidates(1),
-   fMCStackPos(NULL),
-   fMCStackNeg(NULL)
+       fV0Reader(NULL),
+       fConversionGammas(NULL),
+       fConversionCuts(NULL),
+       fEventCuts(NULL),
+       fInputEvent(NULL),
+       fNumberOfESDTracks(0),
+       fMCEvent(NULL),
+       fMCStack(NULL),
+       fTreeQA(NULL),
+       fIsHeavyIon(kFALSE),
+       ffillTree(kFALSE),
+       ffillHistograms(kFALSE),
+       fOutputList(NULL),
+       fTreeList(NULL),
+       fESDList(NULL),
+       hVertexZ(NULL),
+       hNGoodESDTracks(NULL),
+       hNV0Tracks(NULL),
+       hNContributorsVertex(NULL),
+       hITSClusterPhi(NULL),
+       hGammaPt(NULL),
+       hGammaPhi(NULL),
+       hGammaEta(NULL),
+       hGammaChi2perNDF(NULL),
+       hGammaPsiPair(NULL),
+       hGammaArmenteros(NULL),
+       hGammaCosinePointingAngle(NULL),
+       hGammaInvMass(NULL),
+       hElecPt(NULL),
+       hElecEta(NULL),
+       hElecPhi(NULL),
+       hElecNfindableClsTPC(NULL),
+       hPosiNfindableClsTPC(NULL),
+       hElecClsTPC(NULL),
+       hPosiClsTPC(NULL),
+       hElectrondEdxP(NULL),
+       hElectronITSdEdxP(NULL),
+       hElectronTOFP(NULL),
+       hElectronNSigmadEdxP(NULL),
+       hElectronNSigmadEdxEta(NULL),
+       hElectronNSigmaPiondEdxP(NULL),
+       hElectronNSigmaITSP(NULL),
+       hElectronNSigmaTOFP(NULL),
+       hPositrondEdxP(NULL),
+       hPositronITSdEdxP(NULL),
+       hPositronTOFP(NULL),
+       hPositronNSigmadEdxP(NULL),
+       hPositronNSigmadEdxEta(NULL),
+       hPositronNSigmaPiondEdxP(NULL),
+       hPositronNSigmaITSP(NULL),
+       hPositronNSigmaTOFP(NULL),
+       //    hElecAsymP(NULL),
+       //    fTrueList(NULL),
+       //    hTrueResolutionR(NULL),
+       //    hTrueResolutionZ(NULL),
+       //    hTrueResolutionPhi(NULL),
+       //    hTrueGammaPt(NULL),
+       //    hTrueGammaPhi(NULL),
+       //    hTrueGammaEta(NULL),
+       //    hTrueGammaMass(NULL),
+       //    hTrueGammaChi2perNDF(NULL),
+       //    hTrueGammaPsiPair(NULL),
+       //    hTrueGammaQt(NULL),
+       //    hTrueGammaCosinePointingAngle(NULL),
+       //    hTrueGammaXY(NULL),
+       //    hTrueGammaZR(NULL),
+       //    hTrueElecPt(NULL),
+       //    hTrueElecEta(NULL),
+       //    hTrueElecPhi(NULL),
+       //    hTrueElecNfindableClsTPC(NULL),
+       //    hTruePosiNfindableClsTPC(NULL),
+       //    hTrueElecAsymP(NULL),
+       fGammaPt(0),
+       fGammaTheta(0),
+       fGammaChi2NDF(0),
+       fGammaPhotonProp(5),
+       fGammaConvCoord(5),
+       fDaughterProp(24),
+       fKind(0),
+       fIsMC(kFALSE),
+       fnGammaCandidates(1),
+       fMCStackPos(NULL),
+       fMCStackNeg(NULL)
 {
 
 }
 
 AliAnalysisTaskConversionQA::AliAnalysisTaskConversionQA(const char *name) : AliAnalysisTaskSE(name),
-   fV0Reader(NULL),
-   fConversionGammas(NULL),
-   fConversionCuts(NULL),
-   fInputEvent(NULL),
-   fNumberOfESDTracks(0),
-   fMCEvent(NULL),
-   fMCStack(NULL),
-   fTreeQA(NULL),
-   fIsHeavyIon(kFALSE),
-   ffillTree(kFALSE),
-   ffillHistograms(kFALSE),
-   fOutputList(NULL),
-   fTreeList(NULL),
-   fESDList(NULL),
-   hVertexZ(NULL),
-   hNGoodESDTracks(NULL),
-   hNV0Tracks(NULL),
-   hNContributorsVertex(NULL),
-   hITSClusterPhi(NULL),
-   hGammaPt(NULL),
-   hGammaPhi(NULL),
-   hGammaEta(NULL),
-   hGammaChi2perNDF(NULL),
-   hGammaPsiPair(NULL),
-   hGammaArmenteros(NULL),
-   hGammaCosinePointingAngle(NULL),
-   hGammaInvMass(NULL),
-   hElecPt(NULL),
-   hElecEta(NULL),
-   hElecPhi(NULL),
-   hElecNfindableClsTPC(NULL),
-   hPosiNfindableClsTPC(NULL),
-   hElecClsTPC(NULL),
-   hPosiClsTPC(NULL),
-   hElectrondEdxP(NULL),
-   hElectronITSdEdxP(NULL),
-   hElectronTOFP(NULL),
-   hElectronNSigmadEdxP(NULL),
-   hElectronNSigmadEdxEta(NULL),
-   hElectronNSigmaPiondEdxP(NULL),
-   hElectronNSigmaITSP(NULL),
-   hElectronNSigmaTOFP(NULL),
-   hPositrondEdxP(NULL),
-   hPositronITSdEdxP(NULL),
-   hPositronTOFP(NULL),
-   hPositronNSigmadEdxP(NULL),
-   hPositronNSigmadEdxEta(NULL),
-   hPositronNSigmaPiondEdxP(NULL),
-   hPositronNSigmaITSP(NULL),
-   hPositronNSigmaTOFP(NULL),
-//    hGammaXY(NULL),
-//    hGammaZR(NULL),
-//    hElecAsymP(NULL),
-//    fTrueList(NULL),
-//    hTrueResolutionR(NULL),
-//    hTrueResolutionZ(NULL),
-//    hTrueResolutionPhi(NULL),
-//    hTrueGammaPt(NULL),
-//    hTrueGammaPhi(NULL),
-//    hTrueGammaEta(NULL),
-//    hTrueGammaMass(NULL),
-//    hTrueGammaChi2perNDF(NULL),
-//    hTrueGammaPsiPair(NULL),
-//    hTrueGammaQt(NULL),
-//    hTrueGammaCosinePointingAngle(NULL),
-//    hTrueGammaXY(NULL),
-//    hTrueGammaZR(NULL),
-//    hTrueElecPt(NULL),
-//    hTrueElecEta(NULL),
-//    hTrueElecPhi(NULL),
-//    hTrueElecNfindableClsTPC(NULL),
-//    hTruePosiNfindableClsTPC(NULL),
-//    hTrueElecAsymP(NULL),
-   fGammaPt(0),
-   fGammaTheta(0),
-   fGammaChi2NDF(0),
-   fGammaPhotonProp(5),
-   fGammaConvCoord(5),
-   fDaughterProp(24),
-   fKind(0),
-   fIsMC(kFALSE),
-   fnGammaCandidates(1),
-   fMCStackPos(NULL),
-   fMCStackNeg(NULL)
+       fV0Reader(NULL),
+       fConversionGammas(NULL),
+       fConversionCuts(NULL),
+       fEventCuts(NULL),
+       fInputEvent(NULL),
+       fNumberOfESDTracks(0),
+       fMCEvent(NULL),
+       fMCStack(NULL),
+       fTreeQA(NULL),
+       fIsHeavyIon(kFALSE),
+       ffillTree(kFALSE),
+       ffillHistograms(kFALSE),
+       fOutputList(NULL),
+       fTreeList(NULL),
+       fESDList(NULL),
+       hVertexZ(NULL),
+       hNGoodESDTracks(NULL),
+       hNV0Tracks(NULL),
+       hNContributorsVertex(NULL),
+       hITSClusterPhi(NULL),
+       hGammaPt(NULL),
+       hGammaPhi(NULL),
+       hGammaEta(NULL),
+       hGammaChi2perNDF(NULL),
+       hGammaPsiPair(NULL),
+       hGammaArmenteros(NULL),
+       hGammaCosinePointingAngle(NULL),
+       hGammaInvMass(NULL),
+       hElecPt(NULL),
+       hElecEta(NULL),
+       hElecPhi(NULL),
+       hElecNfindableClsTPC(NULL),
+       hPosiNfindableClsTPC(NULL),
+       hElecClsTPC(NULL),
+       hPosiClsTPC(NULL),
+       hElectrondEdxP(NULL),
+       hElectronITSdEdxP(NULL),
+       hElectronTOFP(NULL),
+       hElectronNSigmadEdxP(NULL),
+       hElectronNSigmadEdxEta(NULL),
+       hElectronNSigmaPiondEdxP(NULL),
+       hElectronNSigmaITSP(NULL),
+       hElectronNSigmaTOFP(NULL),
+       hPositrondEdxP(NULL),
+       hPositronITSdEdxP(NULL),
+       hPositronTOFP(NULL),
+       hPositronNSigmadEdxP(NULL),
+       hPositronNSigmadEdxEta(NULL),
+       hPositronNSigmaPiondEdxP(NULL),
+       hPositronNSigmaITSP(NULL),
+       hPositronNSigmaTOFP(NULL),
+       //    hGammaXY(NULL),
+       //    hGammaZR(NULL),
+       //    hElecAsymP(NULL),
+       //    fTrueList(NULL),
+       //    hTrueResolutionR(NULL),
+       //    hTrueResolutionZ(NULL),
+       //    hTrueResolutionPhi(NULL),
+       //    hTrueGammaPt(NULL),
+       //    hTrueGammaPhi(NULL),
+       //    hTrueGammaEta(NULL),
+       //    hTrueGammaMass(NULL),
+       //    hTrueGammaChi2perNDF(NULL),
+       //    hTrueGammaPsiPair(NULL),
+       //    hTrueGammaQt(NULL),
+       //    hTrueGammaCosinePointingAngle(NULL),
+       //    hTrueGammaXY(NULL),
+       //    hTrueGammaZR(NULL),
+       //    hTrueElecPt(NULL),
+       //    hTrueElecEta(NULL),
+       //    hTrueElecPhi(NULL),
+       //    hTrueElecNfindableClsTPC(NULL),
+       //    hTruePosiNfindableClsTPC(NULL),
+       //    hTrueElecAsymP(NULL),
+       fGammaPt(0),
+       fGammaTheta(0),
+       fGammaChi2NDF(0),
+       fGammaPhotonProp(5),
+       fGammaConvCoord(5),
+       fDaughterProp(24),
+       fKind(0),
+       fIsMC(kFALSE),
+       fnGammaCandidates(1),
+       fMCStackPos(NULL),
+       fMCStackNeg(NULL)
 {
-   // Default constructor
+       // Default constructor
 
-   DefineInput(0, TChain::Class());
-   DefineOutput(1, TList::Class());
+       DefineInput(0, TChain::Class());
+       DefineOutput(1, TList::Class());
 }
 
 //________________________________________________________________________
 AliAnalysisTaskConversionQA::~AliAnalysisTaskConversionQA()
 {
-   // default deconstructor
-  
+       // default deconstructor
+       
 }
 //________________________________________________________________________
 void AliAnalysisTaskConversionQA::UserCreateOutputObjects()
 {
-   // Create User Output Objects
-
-   if(fOutputList != NULL){
-      delete fOutputList;
-      fOutputList = NULL;
-   }
-   if(fOutputList == NULL){
-      fOutputList = new TList();
-      fOutputList->SetOwner(kTRUE);
-   }
-   
-   if(ffillHistograms){
-         
-      fESDList = new TList();
-      fESDList->SetOwner(kTRUE);
-      fESDList->SetName("ESD QA");
-      fOutputList->Add(fESDList);
-
-      hVertexZ = new TH1F("Vertex_Z","Vertex_Z",300,-15,15);
-      fESDList->Add(hVertexZ);
-      hNContributorsVertex = new TH1I("ContrVertex_Z","ContrVertex_Z",3000,0,3000);
-      fESDList->Add(hNContributorsVertex);
-      if(fIsHeavyIon) hNGoodESDTracks = new TH1I("GoodESDTracks","GoodESDTracks",4000,0,4000);
-      else hNGoodESDTracks = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200);
-      fESDList->Add(hNGoodESDTracks);
-      if(fIsHeavyIon) hNV0Tracks = new TH1I("V0 Multiplicity","V0 Multiplicity",30000,0,30000);
-      else hNV0Tracks = new TH1I("V0 Multiplicity","V0 Multiplicity",2000,0,2000);
-      fESDList->Add(hNV0Tracks);
-
-      hITSClusterPhi = new TH2F("ITSClusterPhi","hITSClusterPhi",72,0,2*TMath::Pi(),7,0,7);
-      fESDList->Add(hITSClusterPhi);
-      hGammaPt = new TH1F("Gamma_Pt","Gamma_Pt",250,0,25);
-      fESDList->Add(hGammaPt);
-      hGammaPhi = new TH1F("Gamma_Phi","Gamma_Phi",360,0,2*TMath::Pi());
-      fESDList->Add(hGammaPhi);
-      hGammaEta = new TH1F("Gamma_Eta","Gamma_Eta",600,-1.5,1.5);
-      fESDList->Add(hGammaEta);
-      hGammaChi2perNDF = new TH1F("Gamma_Chi2perNDF","Gamma_Chi2perNDF",500,0,100);
-      fESDList->Add(hGammaChi2perNDF);
-      hGammaPsiPair = new TH1F("Gamma_PsiPair","Gamma_PsiPair",500,0,2);
-      fESDList->Add(hGammaPsiPair);
-      hGammaArmenteros = new TH2F("Gamma_Armenteros","Gamma_Armenteros",200,-1,1,400,0,0.1);
-      fESDList->Add(hGammaArmenteros);
-      hGammaCosinePointingAngle = new TH1F("Gamma_CosinePointingAngle","Gamma_CosinePointingAngle",1000,-1.,1.);
-      fESDList->Add(hGammaCosinePointingAngle);
-      hGammaInvMass = new TH1F( "Gamma_InvMass","",200, 0, 0.2);
-      fESDList->Add(hGammaInvMass);
-      hElecPt = new TH2F("Electron_Positron_Pt","Electron_Positron_Pt",250,0,25,250,0,25);
-      fESDList->Add(hElecPt);
-      hElecEta = new TH2F("Electron_Positron_Eta","Electron_Positron_Eta",600,-1.5,1.5,600,-1.5,1.5);
-      fESDList->Add(hElecEta);
-      hElecPhi = new TH2F("Electron_Positron_Phi","Electron_Positron_Phi",360,0,2*TMath::Pi(),360,0,2*TMath::Pi());
-      fESDList->Add(hElecPhi);
-      hElecClsTPC = new TH1F("Electron_ClusterTPC","Electron_ClusterTPC",200,0,200);
-      fESDList->Add(hElecClsTPC);
-      hPosiClsTPC = new TH1F("Positron_ClusterTPC","Positron_ClusterTPC",200,0,200);
-      fESDList->Add(hPosiClsTPC);
-      
-      hElecNfindableClsTPC = new TH1F("Electron_findableClusterTPC","Electron_findableClusterTPC",100,0,1);
-      fESDList->Add(hElecNfindableClsTPC);
-      hPosiNfindableClsTPC = new TH1F("Positron_findableClusterTPC","Positron_findableClusterTPC",100,0,1);
-      fESDList->Add(hPosiNfindableClsTPC);
-      
-      hElectrondEdxP =  new TH2F("Electron_dEdx_P","Electron_dEdx_P",100, 0.05, 20, 200, 0, 200);
-      SetLogBinningXTH2(hElectrondEdxP);
-      fESDList->Add(hElectrondEdxP);
-      hPositrondEdxP =  new TH2F("Positron_dEdx_P","Positron_dEdx_P",100, 0.05, 20, 200, 0, 200);
-      SetLogBinningXTH2(hPositrondEdxP);
-      fESDList->Add(hPositrondEdxP);
-      hElectronNSigmadEdxP =  new TH2F("Electron_NSigmadEdx_P","Electron_NSigmadEdx_P",100, 0.05, 20, 200, -10, 10);  
-      SetLogBinningXTH2(hElectronNSigmadEdxP);
-      fESDList->Add(hElectronNSigmadEdxP);
-         hElectronNSigmadEdxEta =  new TH2F("Electron_NSigmadEdx_Eta","Electron_NSigmadEdx_Eta",140, -1.4, 1.4, 200, -10, 10);  
-         fESDList->Add(hElectronNSigmadEdxEta);
-      hPositronNSigmadEdxP =  new TH2F("Positron_NSigmadEdx_P","Positron_NSigmadEdx_P",100, 0.05, 20, 200, -10, 10);
-      SetLogBinningXTH2(hPositronNSigmadEdxP);
-      fESDList->Add(hPositronNSigmadEdxP);
-         hPositronNSigmadEdxEta =  new TH2F("Positron_NSigmadEdx_Eta","Positron_NSigmadEdx_Eta",140, -1.4, 1.4, 200, -10, 10);  
-         fESDList->Add(hPositronNSigmadEdxEta);
-      hElectronNSigmaPiondEdxP =  new TH2F("Electron_NSigmaPiondEdx_P","Electron_NSigmaPiondEdx_P",100, 0.05, 20, 200, -10, 10);  
-      SetLogBinningXTH2(hElectronNSigmaPiondEdxP);
-      fESDList->Add(hElectronNSigmaPiondEdxP);
-      hPositronNSigmaPiondEdxP =  new TH2F("Positron_NSigmaPiondEdx_P","Positron_NSigmaPiondEdx_P",100, 0.05, 20, 200, -10, 10);
-      SetLogBinningXTH2(hPositronNSigmaPiondEdxP);
-      fESDList->Add(hPositronNSigmaPiondEdxP);
-      
-      hElectronTOFP =  new TH2F("Electron_TOF_P","Electron_TOF_P",100, 0.05, 20, 600, -1000, 29000);
-      SetLogBinningXTH2(hElectronTOFP);
-      fESDList->Add(hElectronTOFP);
-      hPositronTOFP =  new TH2F("Positron_TOF_P","Positron_TOF_P",100, 0.05, 20, 600, -1000, 29000);
-      SetLogBinningXTH2(hPositronTOFP);
-      fESDList->Add(hPositronTOFP);
-      hElectronNSigmaTOFP =  new TH2F("Electron_NSigmaTOF_P","Electron_NSigmaTOF_P",100, 0.05, 20, 200, -10, 10);
-      SetLogBinningXTH2(hElectronNSigmaTOFP);
-      fESDList->Add(hElectronNSigmaTOFP);
-      hPositronNSigmaTOFP =  new TH2F("Positron_NSigmaTOF_P","Positron_NSigmaTOF_P",100, 0.05, 20, 200, -10, 10);
-      SetLogBinningXTH2(hPositronNSigmaTOFP);
-      fESDList->Add(hPositronNSigmaTOFP);
-      
-      hElectronITSdEdxP  =  new TH2F("Electron_ITSdEdx_P","Electron_ITSdEdx_P",100, 0.05, 20, 200, 0, 200);
-      SetLogBinningXTH2(hElectronITSdEdxP);
-      fESDList->Add(hElectronITSdEdxP);
-      hPositronITSdEdxP =  new TH2F("Positron_ITSdEdx_P","Positron_ITSdEdx_P",100, 0.05, 20, 200, 0, 200);
-      SetLogBinningXTH2(hPositronITSdEdxP);
-      fESDList->Add(hPositronITSdEdxP);
-      hElectronNSigmaITSP =  new TH2F("Electron_NSigmaITS_P","Electron_NSigmaITS_P",100, 0.05, 20, 200, -10, 10);
-      SetLogBinningXTH2(hElectronNSigmaITSP);
-      fESDList->Add(hElectronNSigmaITSP);
-      hPositronNSigmaITSP =  new TH2F("Positron_NSigmaITS_P","Positron_NSigmaITS_P",100, 0.05, 20, 200, -10, 10);
-      SetLogBinningXTH2(hPositronNSigmaITSP);
-      fESDList->Add(hPositronNSigmaITSP);
-      
-      
-      
-//       hGammaXY = new TH2F("Gamma_ConversionPoint_XY","Gamma_ConversionPoint_XY",960,-120,120,960,-120,120);
-//       fESDList->Add(hGammaXY);
-//       hGammaZR= new TH2F("Gamma_ConversionPoint_ZR","Gamma_ConversionPoint_ZR",1200,-150,150,480,0,120);
-//       fESDList->Add(hGammaZR);
-
-
-//       hElecAsymP = new TH2F("Electron_Asym_vs_P", "Electron_Asym_vs_P",200,0.,20.,200,0.,1.); 
-//       fESDList->Add(hElecAsymP);
-
-//       if(fIsMC){
-//          fTrueList = new TList();
-//          fTrueList->SetOwner(kTRUE);
-//          fTrueList->SetName("True QA");
-//          fOutputList->Add(fTrueList);
-// 
-//          hTrueResolutionR = new TH2F("True_ConversionPointResolution_R","True_ConversionPointResolution_R",240,0,120,200,-20,20);
-//          fTrueList->Add(hTrueResolutionR);
-//          hTrueResolutionZ = new TH2F("True_ConversionPointResolution_Z","True_ConversionPointResolution_Z",480,-120,120,200,-20,20);
-//          fTrueList->Add(hTrueResolutionZ);
-//          hTrueResolutionPhi = new TH2F("True_ConversionPointResolution_Phi","True_ConversionPointResolution_Phi",360,0,2*TMath::Pi(),200,-TMath::Pi()/30., TMath::Pi()/30.);
-//          fTrueList->Add(hTrueResolutionPhi);
-// 
-//          hTrueGammaPt = new TH1F("True_Gamma_Pt","True_Gamma_Pt",250,0,25);
-//          fTrueList->Add(hTrueGammaPt);
-//          hTrueGammaPhi = new TH1F("True_Gamma_Phi","True_Gamma_Phi",360,0,2*TMath::Pi());
-//          fTrueList->Add(hTrueGammaPhi);
-//          hTrueGammaEta = new TH1F("True_Gamma_Eta","True_Gamma_Eta",600,-1.5,1.5);
-//          fTrueList->Add(hTrueGammaEta);
-//          hTrueGammaMass = new TH1F("True_Gamma_Mass","True_Gamma_Mass",1000,0,0.3);
-//          fTrueList->Add(hTrueGammaMass);
-//          hTrueGammaChi2perNDF = new TH1F("True_Gamma_Chi2perNDF","True_Gamma_Chi2perNDF",500,0,100);
-//          fTrueList->Add(hTrueGammaChi2perNDF);
-//          hTrueGammaPsiPair = new TH1F("True_Gamma_PsiPair","True_Gamma_PsiPair",500,0,2);
-//          fTrueList->Add(hTrueGammaPsiPair);
-//          hTrueGammaQt = new TH1F("True_Gamma_Qt","True_Gamma_Qt",400,0,0.1);
-//          fTrueList->Add(hTrueGammaQt);
-//          hTrueGammaCosinePointingAngle = new TH1F("True_Gamma_CosinePointingAngle","True_Gamma_CosinePointingAngle",900,0.7,1.);
-//          fTrueList->Add(hTrueGammaCosinePointingAngle);
-//          hTrueGammaXY = new TH2F("True_Gamma_ConversionPoint_XY","True_Gamma_ConversionPoint_XY",960,-120,120,960,-120,120);
-//          fTrueList->Add(hTrueGammaXY);
-//          hTrueGammaZR= new TH2F("TrueGamma_ConversionPoint_ZR","TrueGamma_ConversionPoint_ZR",1200,-150,150,480,0,120);
-//          fTrueList->Add(hTrueGammaZR);
-// 
-//          hTrueElecPt = new TH2F("True_Electron_Positron_Pt","True_Electron_Positron_Pt",250,0,25,250,0,25);
-//          fTrueList->Add(hTrueElecPt);
-//          hTrueElecEta = new TH2F("True_Electron_Positron_Eta","True_Electron_Positron_Eta",600,-1.5,1.5,600,-1.5,1.5);
-//          fTrueList->Add(hTrueElecEta);
-//          hTrueElecPhi = new TH2F("True_Electron_Positron_Phi","True_Electron_Positron_Phi",360,0,2*TMath::Pi(),360,0,2*TMath::Pi());
-//          fTrueList->Add(hTrueElecPhi);
-//          hTrueElecNfindableClsTPC = new TH1F("True_Electron_findableClusterTPC","True_Electron_findableClusterTPC",100,0,1);
-//          fTrueList->Add(hTrueElecNfindableClsTPC);
-//          hTruePosiNfindableClsTPC = new TH1F("True_Positron_findableClusterTPC","True_Positron_findableClusterTPC",100,0,1);
-//          fTrueList->Add(hTruePosiNfindableClsTPC);
-//                              hTrueElecAsymP = new TH2F("True_Electron_Asym_vs_P", "True_Electron_Asym_vs_P",200,0.,20.,200,0.,1.); 
-//                              fTrueList->Add(hTrueElecAsymP);
-//       }
-      if(fConversionCuts->GetCutHistograms()){
-         fOutputList->Add(fConversionCuts->GetCutHistograms());
-      }
-   }
-   
-   if(ffillTree){
-      fTreeList = new TList();
-      fTreeList->SetOwner(kTRUE);
-      fTreeList->SetName("TreeList");
-      fOutputList->Add(fTreeList);
-
-      fTreeQA = new TTree("PhotonQA","PhotonQA");   
-     
-      fTreeQA->Branch("daughterProp",&fDaughterProp);
-      fTreeQA->Branch("recCords",&fGammaConvCoord);
-      fTreeQA->Branch("photonProp",&fGammaPhotonProp);
-      fTreeQA->Branch("pt",&fGammaPt,"fGammaPt/F");
-      fTreeQA->Branch("theta",&fGammaTheta,"fGammaTheta/F");
-      fTreeQA->Branch("chi2ndf",&fGammaChi2NDF,"fGammaChi2NDF/F");
-      if (fIsMC) {
-         fTreeQA->Branch("kind",&fKind,"fKind/b");
-      }   
-      fTreeList->Add(fTreeQA);
-
-   }
-
-   fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1");
-   
-   PostData(1, fOutputList);
+       // Create User Output Objects
+
+       if(fOutputList != NULL){
+               delete fOutputList;
+               fOutputList = NULL;
+       }
+       if(fOutputList == NULL){
+               fOutputList = new TList();
+               fOutputList->SetOwner(kTRUE);
+       }
+       
+       if(ffillHistograms){
+               fESDList = new TList();
+               fESDList->SetOwner(kTRUE);
+               fESDList->SetName("ESD QA");
+               fOutputList->Add(fESDList);
+
+               hVertexZ = new TH1F("Vertex_Z","Vertex_Z",300,-15,15);
+               fESDList->Add(hVertexZ);
+               hNContributorsVertex = new TH1I("ContrVertex_Z","ContrVertex_Z",3000,0,3000);
+               fESDList->Add(hNContributorsVertex);
+               if(fIsHeavyIon) hNGoodESDTracks = new TH1I("GoodESDTracks","GoodESDTracks",4000,0,4000);
+               else hNGoodESDTracks = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200);
+               fESDList->Add(hNGoodESDTracks);
+               if(fIsHeavyIon) hNV0Tracks = new TH1I("V0 Multiplicity","V0 Multiplicity",30000,0,30000);
+               else hNV0Tracks = new TH1I("V0 Multiplicity","V0 Multiplicity",2000,0,2000);
+               fESDList->Add(hNV0Tracks);
+
+               hITSClusterPhi = new TH2F("ITSClusterPhi","hITSClusterPhi",72,0,2*TMath::Pi(),7,0,7);
+               fESDList->Add(hITSClusterPhi);
+               hGammaPt = new TH1F("Gamma_Pt","Gamma_Pt",250,0,25);
+               fESDList->Add(hGammaPt);
+               hGammaPhi = new TH1F("Gamma_Phi","Gamma_Phi",360,0,2*TMath::Pi());
+               fESDList->Add(hGammaPhi);
+               hGammaEta = new TH1F("Gamma_Eta","Gamma_Eta",600,-1.5,1.5);
+               fESDList->Add(hGammaEta);
+               hGammaChi2perNDF = new TH1F("Gamma_Chi2perNDF","Gamma_Chi2perNDF",500,0,100);
+               fESDList->Add(hGammaChi2perNDF);
+               hGammaPsiPair = new TH1F("Gamma_PsiPair","Gamma_PsiPair",500,0,2);
+               fESDList->Add(hGammaPsiPair);
+               hGammaArmenteros = new TH2F("Gamma_Armenteros","Gamma_Armenteros",200,-1,1,400,0,0.1);
+               fESDList->Add(hGammaArmenteros);
+               hGammaCosinePointingAngle = new TH1F("Gamma_CosinePointingAngle","Gamma_CosinePointingAngle",1000,-1.,1.);
+               fESDList->Add(hGammaCosinePointingAngle);
+               hGammaInvMass = new TH1F( "Gamma_InvMass","",200, 0, 0.2);
+               fESDList->Add(hGammaInvMass);
+               hElecPt = new TH2F("Electron_Positron_Pt","Electron_Positron_Pt",250,0,25,250,0,25);
+               fESDList->Add(hElecPt);
+               hElecEta = new TH2F("Electron_Positron_Eta","Electron_Positron_Eta",600,-1.5,1.5,600,-1.5,1.5);
+               fESDList->Add(hElecEta);
+               hElecPhi = new TH2F("Electron_Positron_Phi","Electron_Positron_Phi",360,0,2*TMath::Pi(),360,0,2*TMath::Pi());
+               fESDList->Add(hElecPhi);
+               hElecClsTPC = new TH1F("Electron_ClusterTPC","Electron_ClusterTPC",200,0,200);
+               fESDList->Add(hElecClsTPC);
+               hPosiClsTPC = new TH1F("Positron_ClusterTPC","Positron_ClusterTPC",200,0,200);
+               fESDList->Add(hPosiClsTPC);
+               
+               hElecNfindableClsTPC = new TH1F("Electron_findableClusterTPC","Electron_findableClusterTPC",100,0,1);
+               fESDList->Add(hElecNfindableClsTPC);
+               hPosiNfindableClsTPC = new TH1F("Positron_findableClusterTPC","Positron_findableClusterTPC",100,0,1);
+               fESDList->Add(hPosiNfindableClsTPC);
+               
+               hElectrondEdxP =  new TH2F("Electron_dEdx_P","Electron_dEdx_P",100, 0.05, 20, 200, 0, 200);
+               SetLogBinningXTH2(hElectrondEdxP);
+               fESDList->Add(hElectrondEdxP);
+               hPositrondEdxP =  new TH2F("Positron_dEdx_P","Positron_dEdx_P",100, 0.05, 20, 200, 0, 200);
+               SetLogBinningXTH2(hPositrondEdxP);
+               fESDList->Add(hPositrondEdxP);
+               hElectronNSigmadEdxP =  new TH2F("Electron_NSigmadEdx_P","Electron_NSigmadEdx_P",100, 0.05, 20, 200, -10, 10);  
+               SetLogBinningXTH2(hElectronNSigmadEdxP);
+               fESDList->Add(hElectronNSigmadEdxP);
+               hElectronNSigmadEdxEta =  new TH2F("Electron_NSigmadEdx_Eta","Electron_NSigmadEdx_Eta",140, -1.4, 1.4, 200, -10, 10);  
+               fESDList->Add(hElectronNSigmadEdxEta);
+               hPositronNSigmadEdxP =  new TH2F("Positron_NSigmadEdx_P","Positron_NSigmadEdx_P",100, 0.05, 20, 200, -10, 10);
+               SetLogBinningXTH2(hPositronNSigmadEdxP);
+               fESDList->Add(hPositronNSigmadEdxP);
+               hPositronNSigmadEdxEta =  new TH2F("Positron_NSigmadEdx_Eta","Positron_NSigmadEdx_Eta",140, -1.4, 1.4, 200, -10, 10);  
+               fESDList->Add(hPositronNSigmadEdxEta);
+               hElectronNSigmaPiondEdxP =  new TH2F("Electron_NSigmaPiondEdx_P","Electron_NSigmaPiondEdx_P",100, 0.05, 20, 200, -10, 10);  
+               SetLogBinningXTH2(hElectronNSigmaPiondEdxP);
+               fESDList->Add(hElectronNSigmaPiondEdxP);
+               hPositronNSigmaPiondEdxP =  new TH2F("Positron_NSigmaPiondEdx_P","Positron_NSigmaPiondEdx_P",100, 0.05, 20, 200, -10, 10);
+               SetLogBinningXTH2(hPositronNSigmaPiondEdxP);
+               fESDList->Add(hPositronNSigmaPiondEdxP);
+               
+               hElectronTOFP =  new TH2F("Electron_TOF_P","Electron_TOF_P",100, 0.05, 20, 600, -1000, 29000);
+               SetLogBinningXTH2(hElectronTOFP);
+               fESDList->Add(hElectronTOFP);
+               hPositronTOFP =  new TH2F("Positron_TOF_P","Positron_TOF_P",100, 0.05, 20, 600, -1000, 29000);
+               SetLogBinningXTH2(hPositronTOFP);
+               fESDList->Add(hPositronTOFP);
+               hElectronNSigmaTOFP =  new TH2F("Electron_NSigmaTOF_P","Electron_NSigmaTOF_P",100, 0.05, 20, 200, -10, 10);
+               SetLogBinningXTH2(hElectronNSigmaTOFP);
+               fESDList->Add(hElectronNSigmaTOFP);
+               hPositronNSigmaTOFP =  new TH2F("Positron_NSigmaTOF_P","Positron_NSigmaTOF_P",100, 0.05, 20, 200, -10, 10);
+               SetLogBinningXTH2(hPositronNSigmaTOFP);
+               fESDList->Add(hPositronNSigmaTOFP);
+               
+               hElectronITSdEdxP  =  new TH2F("Electron_ITSdEdx_P","Electron_ITSdEdx_P",100, 0.05, 20, 200, 0, 200);
+               SetLogBinningXTH2(hElectronITSdEdxP);
+               fESDList->Add(hElectronITSdEdxP);
+               hPositronITSdEdxP =  new TH2F("Positron_ITSdEdx_P","Positron_ITSdEdx_P",100, 0.05, 20, 200, 0, 200);
+               SetLogBinningXTH2(hPositronITSdEdxP);
+               fESDList->Add(hPositronITSdEdxP);
+               hElectronNSigmaITSP =  new TH2F("Electron_NSigmaITS_P","Electron_NSigmaITS_P",100, 0.05, 20, 200, -10, 10);
+               SetLogBinningXTH2(hElectronNSigmaITSP);
+               fESDList->Add(hElectronNSigmaITSP);
+               hPositronNSigmaITSP =  new TH2F("Positron_NSigmaITS_P","Positron_NSigmaITS_P",100, 0.05, 20, 200, -10, 10);
+               SetLogBinningXTH2(hPositronNSigmaITSP);
+               fESDList->Add(hPositronNSigmaITSP);
+               
+       //       hGammaXY = new TH2F("Gamma_ConversionPoint_XY","Gamma_ConversionPoint_XY",960,-120,120,960,-120,120);
+       //       fESDList->Add(hGammaXY);
+       //       hGammaZR= new TH2F("Gamma_ConversionPoint_ZR","Gamma_ConversionPoint_ZR",1200,-150,150,480,0,120);
+       //       fESDList->Add(hGammaZR);
+
+
+       //       hElecAsymP = new TH2F("Electron_Asym_vs_P", "Electron_Asym_vs_P",200,0.,20.,200,0.,1.); 
+       //       fESDList->Add(hElecAsymP);
+
+       //       if(fIsMC){
+       //          fTrueList = new TList();
+       //          fTrueList->SetOwner(kTRUE);
+       //          fTrueList->SetName("True QA");
+       //          fOutputList->Add(fTrueList);
+       // 
+       //          hTrueResolutionR = new TH2F("True_ConversionPointResolution_R","True_ConversionPointResolution_R",240,0,120,200,-20,20);
+       //          fTrueList->Add(hTrueResolutionR);
+       //          hTrueResolutionZ = new TH2F("True_ConversionPointResolution_Z","True_ConversionPointResolution_Z",480,-120,120,200,-20,20);
+       //          fTrueList->Add(hTrueResolutionZ);
+       //          hTrueResolutionPhi = new TH2F("True_ConversionPointResolution_Phi","True_ConversionPointResolution_Phi",360,0,2*TMath::Pi(),200,-TMath::Pi()/30., TMath::Pi()/30.);
+       //          fTrueList->Add(hTrueResolutionPhi);
+       // 
+       //          hTrueGammaPt = new TH1F("True_Gamma_Pt","True_Gamma_Pt",250,0,25);
+       //          fTrueList->Add(hTrueGammaPt);
+       //          hTrueGammaPhi = new TH1F("True_Gamma_Phi","True_Gamma_Phi",360,0,2*TMath::Pi());
+       //          fTrueList->Add(hTrueGammaPhi);
+       //          hTrueGammaEta = new TH1F("True_Gamma_Eta","True_Gamma_Eta",600,-1.5,1.5);
+       //          fTrueList->Add(hTrueGammaEta);
+       //          hTrueGammaMass = new TH1F("True_Gamma_Mass","True_Gamma_Mass",1000,0,0.3);
+       //          fTrueList->Add(hTrueGammaMass);
+       //          hTrueGammaChi2perNDF = new TH1F("True_Gamma_Chi2perNDF","True_Gamma_Chi2perNDF",500,0,100);
+       //          fTrueList->Add(hTrueGammaChi2perNDF);
+       //          hTrueGammaPsiPair = new TH1F("True_Gamma_PsiPair","True_Gamma_PsiPair",500,0,2);
+       //          fTrueList->Add(hTrueGammaPsiPair);
+       //          hTrueGammaQt = new TH1F("True_Gamma_Qt","True_Gamma_Qt",400,0,0.1);
+       //          fTrueList->Add(hTrueGammaQt);
+       //          hTrueGammaCosinePointingAngle = new TH1F("True_Gamma_CosinePointingAngle","True_Gamma_CosinePointingAngle",900,0.7,1.);
+       //          fTrueList->Add(hTrueGammaCosinePointingAngle);
+       //          hTrueGammaXY = new TH2F("True_Gamma_ConversionPoint_XY","True_Gamma_ConversionPoint_XY",960,-120,120,960,-120,120);
+       //          fTrueList->Add(hTrueGammaXY);
+       //          hTrueGammaZR= new TH2F("TrueGamma_ConversionPoint_ZR","TrueGamma_ConversionPoint_ZR",1200,-150,150,480,0,120);
+       //          fTrueList->Add(hTrueGammaZR);
+       // 
+       //          hTrueElecPt = new TH2F("True_Electron_Positron_Pt","True_Electron_Positron_Pt",250,0,25,250,0,25);
+       //          fTrueList->Add(hTrueElecPt);
+       //          hTrueElecEta = new TH2F("True_Electron_Positron_Eta","True_Electron_Positron_Eta",600,-1.5,1.5,600,-1.5,1.5);
+       //          fTrueList->Add(hTrueElecEta);
+       //          hTrueElecPhi = new TH2F("True_Electron_Positron_Phi","True_Electron_Positron_Phi",360,0,2*TMath::Pi(),360,0,2*TMath::Pi());
+       //          fTrueList->Add(hTrueElecPhi);
+       //          hTrueElecNfindableClsTPC = new TH1F("True_Electron_findableClusterTPC","True_Electron_findableClusterTPC",100,0,1);
+       //          fTrueList->Add(hTrueElecNfindableClsTPC);
+       //          hTruePosiNfindableClsTPC = new TH1F("True_Positron_findableClusterTPC","True_Positron_findableClusterTPC",100,0,1);
+       //          fTrueList->Add(hTruePosiNfindableClsTPC);
+       //                               hTrueElecAsymP = new TH2F("True_Electron_Asym_vs_P", "True_Electron_Asym_vs_P",200,0.,20.,200,0.,1.); 
+       //                               fTrueList->Add(hTrueElecAsymP);
+       //       }
+               if(fConversionCuts->GetCutHistograms()){
+                       fOutputList->Add(fConversionCuts->GetCutHistograms());
+               }
+       }
+       
+       if(ffillTree){
+               fTreeList = new TList();
+               fTreeList->SetOwner(kTRUE);
+               fTreeList->SetName("TreeList");
+               fOutputList->Add(fTreeList);
+
+               fTreeQA = new TTree("PhotonQA","PhotonQA");   
+               
+               fTreeQA->Branch("daughterProp",&fDaughterProp);
+               fTreeQA->Branch("recCords",&fGammaConvCoord);
+               fTreeQA->Branch("photonProp",&fGammaPhotonProp);
+               fTreeQA->Branch("pt",&fGammaPt,"fGammaPt/F");
+               fTreeQA->Branch("theta",&fGammaTheta,"fGammaTheta/F");
+               fTreeQA->Branch("chi2ndf",&fGammaChi2NDF,"fGammaChi2NDF/F");
+               if (fIsMC) {
+                       fTreeQA->Branch("kind",&fKind,"fKind/b");
+               }   
+               fTreeList->Add(fTreeQA);
+       }
+
+       fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1");
+       
+       PostData(1, fOutputList);
 }
 //_____________________________________________________________________________
 Bool_t AliAnalysisTaskConversionQA::Notify()
 {
-   if(!fConversionCuts->GetDoEtaShift()) return kTRUE;; // No Eta Shift requested, continue
-      
-   if(fConversionCuts->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
-      fConversionCuts->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName());
-      fConversionCuts->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
-      return kTRUE;
-   }
-   else{
-      printf(" Gamma Conversion QA Task %s :: Eta Shift Manually Set to %f \n\n",
-             (fConversionCuts->GetCutNumber()).Data(),fConversionCuts->GetEtaShift());
-      fConversionCuts->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
-   }
-   
-   return kTRUE;
+       if(!fEventCuts->GetDoEtaShift()) return kTRUE;; // No Eta Shift requested, continue
+               
+       if(fEventCuts->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
+               fEventCuts->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName());
+               fEventCuts->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
+               return kTRUE;
+       }
+       else{
+               printf(" Gamma Conversion QA Task %s :: Eta Shift Manually Set to %f \n\n",
+                               (fEventCuts->GetCutNumber()).Data(),fEventCuts->GetEtaShift());
+               fEventCuts->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
+       }
+       
+       return kTRUE;
 }
 //________________________________________________________________________
 void AliAnalysisTaskConversionQA::UserExec(Option_t *){
 
+       Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality();
+       if(eventQuality != 0){// Event Not Accepted
+               return;
+       }
+       fInputEvent = InputEvent();
+       if(fIsMC) fMCEvent = MCEvent();
+       if(fMCEvent && fInputEvent->IsA()==AliESDEvent::Class()){ fMCStack = fMCEvent->Stack(); }
+
+       Int_t eventNotAccepted =
+               fEventCuts->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon);
+       if(eventNotAccepted) return; // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
+
+       fConversionGammas=fV0Reader->GetReconstructedGammas();
+
+       if(fMCEvent){
+               if(fEventCuts->GetSignalRejection() != 0){
+                       if(fInputEvent->IsA()==AliESDEvent::Class()){
+                               fEventCuts->GetNotRejectedParticles(fEventCuts->GetSignalRejection(),
+                                                                                                       fEventCuts->GetAcceptedHeader(),
+                                                                                                       fMCEvent);
+                       }
+                       else if(fInputEvent->IsA()==AliAODEvent::Class()){
+                               fEventCuts->GetNotRejectedParticles(fEventCuts->GetSignalRejection(),
+                                                                                                       fEventCuts->GetAcceptedHeader(),
+                                                                                                       fInputEvent);
+                       }
+               }
+       }
 
+       if(ffillHistograms){
+               CountTracks();
+               hVertexZ->Fill(fInputEvent->GetPrimaryVertex()->GetZ());
+               hNContributorsVertex->Fill(fEventCuts->GetNumberOfContributorsVtx(fInputEvent));
+               hNGoodESDTracks->Fill(fNumberOfESDTracks);
+               hNV0Tracks->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C());
+       }
 
-   Int_t eventQuality = ((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEventQuality();
-   if(eventQuality != 0){// Event Not Accepted
-      return;
-   }
-   fInputEvent = InputEvent();
-   if(fIsMC) fMCEvent = MCEvent();
-   if(fMCEvent && fInputEvent->IsA()==AliESDEvent::Class()){ fMCStack = fMCEvent->Stack(); }
-
-   Int_t eventNotAccepted =
-      fConversionCuts->IsEventAcceptedByConversionCut(fV0Reader->GetConversionCuts(),fInputEvent,fMCEvent,fIsHeavyIon);
-   if(eventNotAccepted) return; // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
-
-   fConversionGammas=fV0Reader->GetReconstructedGammas();
-
-   if(fMCEvent){
-      if(fConversionCuts->GetSignalRejection() != 0){
-         if(fInputEvent->IsA()==AliESDEvent::Class()){
-               fConversionCuts->GetNotRejectedParticles(fConversionCuts->GetSignalRejection(),
-                                                        fConversionCuts->GetAcceptedHeader(),
-                                                        fMCEvent);
-         }
-         else if(fInputEvent->IsA()==AliAODEvent::Class()){
-            fConversionCuts->GetNotRejectedParticles(fConversionCuts->GetSignalRejection(),
-                                                      fConversionCuts->GetAcceptedHeader(),
-                                                      fInputEvent);
-         }
-      }
-   }
-
-   if(ffillHistograms){
-      CountTracks();
-      hVertexZ->Fill(fInputEvent->GetPrimaryVertex()->GetZ());
-      hNContributorsVertex->Fill(fConversionCuts->GetNumberOfContributorsVtx(fInputEvent));
-      hNGoodESDTracks->Fill(fNumberOfESDTracks);
-      hNV0Tracks->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C());
-   }
-
-   if(fMCEvent && fInputEvent->IsA()==AliAODEvent::Class() && !(fV0Reader->AreAODsRelabeled())){
-      RelabelAODPhotonCandidates(kTRUE);    // In case of AODMC relabeling MC
-      fV0Reader->RelabelAODs(kTRUE);
-   }
-         
-         
-   for(Int_t firstGammaIndex=0;firstGammaIndex<fConversionGammas->GetEntriesFast();firstGammaIndex++){
-      AliAODConversionPhoton *gamma=dynamic_cast<AliAODConversionPhoton*>(fConversionGammas->At(firstGammaIndex));
-      if (gamma==NULL) continue;
-      if(fMCEvent && fConversionCuts->GetSignalRejection() != 0){
-         if(!fConversionCuts->IsParticleFromBGEvent(gamma->GetMCLabelPositive(), fMCStack, fInputEvent))
-            continue;
-         if(!fConversionCuts->IsParticleFromBGEvent(gamma->GetMCLabelNegative(), fMCStack, fInputEvent))
-            continue;
-      }
-      if(!fConversionCuts->PhotonIsSelected(gamma,fInputEvent)){
-         continue;
-      }
-
-      if(ffillTree) ProcessQATree(gamma);
-      if(ffillHistograms) ProcessQA(gamma);
-   }
-   
-   if(fMCEvent && fInputEvent->IsA()==AliAODEvent::Class() && !(fV0Reader->AreAODsRelabeled())){
-      RelabelAODPhotonCandidates(kFALSE); // Back to ESDMC Label
-      fV0Reader->RelabelAODs(kFALSE);
-   }
-      
-   PostData(1, fOutputList);
+       if(fMCEvent && fInputEvent->IsA()==AliAODEvent::Class() && !(fV0Reader->AreAODsRelabeled())){
+               RelabelAODPhotonCandidates(kTRUE);    // In case of AODMC relabeling MC
+               fV0Reader->RelabelAODs(kTRUE);
+       }
+               
+               
+       for(Int_t firstGammaIndex=0;firstGammaIndex<fConversionGammas->GetEntriesFast();firstGammaIndex++){
+               AliAODConversionPhoton *gamma=dynamic_cast<AliAODConversionPhoton*>(fConversionGammas->At(firstGammaIndex));
+               if (gamma==NULL) continue;
+               if(fMCEvent && fEventCuts->GetSignalRejection() != 0){
+                       if(!fEventCuts->IsParticleFromBGEvent(gamma->GetMCLabelPositive(), fMCStack, fInputEvent))
+                               continue;
+                       if(!fEventCuts->IsParticleFromBGEvent(gamma->GetMCLabelNegative(), fMCStack, fInputEvent))
+                               continue;
+               }
+               if(!fConversionCuts->PhotonIsSelected(gamma,fInputEvent)){
+                       continue;
+               }
+
+               if(ffillTree) ProcessQATree(gamma);
+               if(ffillHistograms) ProcessQA(gamma);
+       }
+       
+       if(fMCEvent && fInputEvent->IsA()==AliAODEvent::Class() && !(fV0Reader->AreAODsRelabeled())){
+               RelabelAODPhotonCandidates(kFALSE); // Back to ESDMC Label
+               fV0Reader->RelabelAODs(kFALSE);
+       }
+               
+       PostData(1, fOutputList);
 }
 
 
 ///________________________________________________________________________
 void AliAnalysisTaskConversionQA::ProcessQATree(AliAODConversionPhoton *gamma){
 
-   // Fill Histograms for QA and MC
-   AliVEvent* event = (AliVEvent*) InputEvent();
-   
-   
-   
-   AliPIDResponse* pidResonse = ((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetPIDResponse();
+       // Fill Histograms for QA and MC
+       AliVEvent* event = (AliVEvent*) InputEvent();
+               
+       AliPIDResponse* pidResonse = ((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetPIDResponse();
+
+       fGammaPt = gamma->GetPhotonPt();
+       
+       fGammaTheta = gamma->Theta();
+       fGammaChi2NDF = gamma->GetChi2perNDF();
+       
+       fGammaPhotonProp(0)  = gamma->GetArmenterosQt();
+       fGammaPhotonProp(1)  = gamma->GetArmenterosAlpha();
+       fGammaPhotonProp(2)  = gamma->GetPsiPair();
+       fGammaPhotonProp(3) = fConversionCuts->GetCosineOfPointingAngle(gamma,event);
+               fGammaPhotonProp(4) = gamma->GetMass();
+       
+       fGammaConvCoord(0) = gamma->GetConversionX();
+       fGammaConvCoord(1) = gamma->GetConversionY();
+       fGammaConvCoord(2) = gamma->GetConversionZ();
+       fGammaConvCoord(3) = gamma->GetConversionRadius();
+       fGammaConvCoord(4) = gamma->GetPhotonPhi();
+       
+       AliVTrack * negTrack = fConversionCuts->GetTrack(event, gamma->GetTrackLabelNegative());
+       AliVTrack * posTrack = fConversionCuts->GetTrack(event, gamma->GetTrackLabelPositive());
+
+       
+       if(!negTrack||!posTrack)return;
+
+       fKind = 9;
+       if(fMCEvent && fInputEvent->IsA()==AliESDEvent::Class()){
+               fKind = IsTruePhotonESD(gamma);
+       } else if (fMCEvent && fInputEvent->IsA()==AliAODEvent::Class()){
+       //        cout << "entering IsTruePhotonAOD" << endl;
+               fKind = IsTruePhotonAOD(gamma);   
+       }
 
-   fGammaPt = gamma->GetPhotonPt();
-   
-   fGammaTheta = gamma->Theta();
-   fGammaChi2NDF = gamma->GetChi2perNDF();
-   
-   fGammaPhotonProp(0)  = gamma->GetArmenterosQt();
-   fGammaPhotonProp(1)  = gamma->GetArmenterosAlpha();
-   fGammaPhotonProp(2)  = gamma->GetPsiPair();
-   fGammaPhotonProp(3) = fConversionCuts->GetCosineOfPointingAngle(gamma,event);
-       fGammaPhotonProp(4) = gamma->GetMass();
-   
-   fGammaConvCoord(0) = gamma->GetConversionX();
-   fGammaConvCoord(1) = gamma->GetConversionY();
-   fGammaConvCoord(2) = gamma->GetConversionZ();
-   fGammaConvCoord(3) = gamma->GetConversionRadius();
-   fGammaConvCoord(4) = gamma->GetPhotonPhi();
-   
-   AliVTrack * negTrack = fConversionCuts->GetTrack(event, gamma->GetTrackLabelNegative());
-   AliVTrack * posTrack = fConversionCuts->GetTrack(event, gamma->GetTrackLabelPositive());
+       fDaughterProp(0) =  posTrack->Pt();
+       fDaughterProp(7) =  negTrack->Pt();
+       fDaughterProp(1) =  posTrack->Theta();
+       fDaughterProp(8) =  negTrack->Theta();
+       // dEdx TPC
+       fDaughterProp(2) =  posTrack->GetTPCsignal();
+       fDaughterProp(3) =  pidResonse->NumberOfSigmasTPC(posTrack,AliPID::kElectron);
+       fDaughterProp(22) =  pidResonse->NumberOfSigmasTPC(posTrack,AliPID::kPion);
+       fDaughterProp(9) =  negTrack->GetTPCsignal();
+       fDaughterProp(10) =  pidResonse->NumberOfSigmasTPC(negTrack,AliPID::kElectron);
+       fDaughterProp(23) =  pidResonse->NumberOfSigmasTPC(negTrack,AliPID::kPion);
+       Int_t nPosClusterITS = 0;
+       Int_t nNegClusterITS = 0;
+       for(Int_t itsLayer = 0; itsLayer<6;itsLayer++){
+               if(TESTBIT(negTrack->GetITSClusterMap(),itsLayer)){
+                       nNegClusterITS++;
+               }
+               if(TESTBIT(posTrack->GetITSClusterMap(),itsLayer)){
+                       nPosClusterITS++;
+               }
+       }
+       
+       // ITS signal
+       fDaughterProp(14) =  (Float_t)nPosClusterITS;
+       fDaughterProp(15) =  (Float_t)nNegClusterITS;
+       if (nPosClusterITS > 0 ){
+               fDaughterProp(16) =  posTrack->GetITSsignal();
+               fDaughterProp(20) =  pidResonse->NumberOfSigmasITS(posTrack,AliPID::kElectron);
+       } else {
+               fDaughterProp(16) =  1000;
+               fDaughterProp(20) =  20;
+       }
+       if (nNegClusterITS > 0 ){
+               fDaughterProp(17) =  negTrack->GetITSsignal();
+               fDaughterProp(21) =  pidResonse->NumberOfSigmasITS(negTrack,AliPID::kElectron);
+       } else {
+               fDaughterProp(17) =  1000;
+               fDaughterProp(21) =  20;
+       }
 
-   
-   if(!negTrack||!posTrack)return;
-
-   fKind = 9;
-   if(fMCEvent && fInputEvent->IsA()==AliESDEvent::Class()){
-      fKind = IsTruePhotonESD(gamma);
-   } else if (fMCEvent && fInputEvent->IsA()==AliAODEvent::Class()){
-//       cout << "entering IsTruePhotonAOD" << endl;
-      fKind = IsTruePhotonAOD(gamma);   
-   }
-
-   fDaughterProp(0) =  posTrack->Pt();
-   fDaughterProp(7) =  negTrack->Pt();
-   fDaughterProp(1) =  posTrack->Theta();
-   fDaughterProp(8) =  negTrack->Theta();
-   // dEdx TPC
-   fDaughterProp(2) =  posTrack->GetTPCsignal();
-   fDaughterProp(3) =  pidResonse->NumberOfSigmasTPC(posTrack,AliPID::kElectron);
-   fDaughterProp(22) =  pidResonse->NumberOfSigmasTPC(posTrack,AliPID::kPion);
-   fDaughterProp(9) =  negTrack->GetTPCsignal();
-   fDaughterProp(10) =  pidResonse->NumberOfSigmasTPC(negTrack,AliPID::kElectron);
-   fDaughterProp(23) =  pidResonse->NumberOfSigmasTPC(negTrack,AliPID::kPion);
-   Int_t nPosClusterITS = 0;
-   Int_t nNegClusterITS = 0;
-   for(Int_t itsLayer = 0; itsLayer<6;itsLayer++){
-      if(TESTBIT(negTrack->GetITSClusterMap(),itsLayer)){
-         nNegClusterITS++;
-      }
-      if(TESTBIT(posTrack->GetITSClusterMap(),itsLayer)){
-         nPosClusterITS++;
-      }
-   }
-   
-   // ITS signal
-   fDaughterProp(14) =  (Float_t)nPosClusterITS;
-   fDaughterProp(15) =  (Float_t)nNegClusterITS;
-   if (nPosClusterITS > 0 ){
-      fDaughterProp(16) =  posTrack->GetITSsignal();
-      fDaughterProp(20) =  pidResonse->NumberOfSigmasITS(posTrack,AliPID::kElectron);
-   } else {
-      fDaughterProp(16) =  1000;
-      fDaughterProp(20) =  20;
-   }
-   if (nNegClusterITS > 0 ){
-      fDaughterProp(17) =  negTrack->GetITSsignal();
-      fDaughterProp(21) =  pidResonse->NumberOfSigmasITS(negTrack,AliPID::kElectron);
-   } else {
-      fDaughterProp(17) =  1000;
-      fDaughterProp(21) =  20;
-   }
-
-   // TOF 
-   if((posTrack->GetStatus() & AliESDtrack::kTOFpid) && !(posTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
-      Double_t t0pos = pidResonse->GetTOFResponse().GetStartTime(posTrack->P());
-      Double_t timesPos[9];
-      posTrack->GetIntegratedTimes(timesPos);
-      Double_t TOFsignalPos =  posTrack->GetTOFsignal();
-      Double_t dTpos = TOFsignalPos - t0pos - timesPos[0];
-      fDaughterProp(4) =  dTpos;
-      fDaughterProp(5) =  pidResonse->NumberOfSigmasTOF(posTrack, AliPID::kElectron);
-   } else {
-      fDaughterProp(4) =  20000;
-      fDaughterProp(5) =  -20;
-   }
-   if((negTrack->GetStatus() & AliESDtrack::kTOFpid) && !(negTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
-      Double_t t0neg = pidResonse->GetTOFResponse().GetStartTime(negTrack->P());
-      Double_t timesNeg[9];
-      negTrack->GetIntegratedTimes(timesNeg);
-      Double_t TOFsignalNeg =  negTrack->GetTOFsignal();
-      Double_t dTneg = TOFsignalNeg - t0neg - timesNeg[0];
-      fDaughterProp(11) =  dTneg;
-      fDaughterProp(12) =  pidResonse->NumberOfSigmasTOF(negTrack, AliPID::kElectron);
-   } else {
-      fDaughterProp(11) =  20000;
-      fDaughterProp(12) =  -20;
-   }
-
-   fDaughterProp(6) =  (Float_t)posTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius()));
-   fDaughterProp(18) =  posTrack->GetNcls(1);
-   fDaughterProp(13) =  (Float_t)negTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius()));
-   fDaughterProp(19) =  negTrack->GetNcls(1);
-   
-   if (fTreeQA){
-      fTreeQA->Fill();
-   }
+       // TOF 
+       if((posTrack->GetStatus() & AliESDtrack::kTOFpid) && !(posTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
+               Double_t t0pos = pidResonse->GetTOFResponse().GetStartTime(posTrack->P());
+               Double_t timesPos[9];
+               posTrack->GetIntegratedTimes(timesPos);
+               Double_t TOFsignalPos = posTrack->GetTOFsignal();
+               Double_t dTpos = TOFsignalPos - t0pos - timesPos[0];
+               fDaughterProp(4) =  dTpos;
+               fDaughterProp(5) =  pidResonse->NumberOfSigmasTOF(posTrack, AliPID::kElectron);
+       } else {
+               fDaughterProp(4) =  20000;
+               fDaughterProp(5) =  -20;
+       }
+       if((negTrack->GetStatus() & AliESDtrack::kTOFpid) && !(negTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
+               Double_t t0neg = pidResonse->GetTOFResponse().GetStartTime(negTrack->P());
+               Double_t timesNeg[9];
+               negTrack->GetIntegratedTimes(timesNeg);
+               Double_t TOFsignalNeg = negTrack->GetTOFsignal();
+               Double_t dTneg = TOFsignalNeg - t0neg - timesNeg[0];
+               fDaughterProp(11) =  dTneg;
+               fDaughterProp(12) =  pidResonse->NumberOfSigmasTOF(negTrack, AliPID::kElectron);
+       } else {
+               fDaughterProp(11) =  20000;
+               fDaughterProp(12) =  -20;
+       }
+
+       fDaughterProp(6) =  (Float_t)posTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius()));
+       fDaughterProp(18) =  posTrack->GetNcls(1);
+       fDaughterProp(13) =  (Float_t)negTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius()));
+       fDaughterProp(19) =  negTrack->GetNcls(1);
+       
+       if (fTreeQA){
+               fTreeQA->Fill();
+       }
 }
 
 //_____________________________________________________________________________________________________
 void AliAnalysisTaskConversionQA::ProcessQA(AliAODConversionPhoton *gamma){
 
-   AliPIDResponse* pidResonse = ((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetPIDResponse();
-   
-   // Fill Histograms for QA and MC
-
-   hGammaPt->Fill(gamma->GetPhotonPt());
-   hGammaPhi->Fill(gamma->GetPhotonPhi());
-   hGammaEta->Fill(gamma->Eta());
-   hGammaChi2perNDF->Fill(gamma->GetChi2perNDF());
-   hGammaPsiPair->Fill(gamma->GetPsiPair());
-   hGammaArmenteros->Fill(gamma->GetArmenterosAlpha(),gamma->GetArmenterosQt());
-   hGammaCosinePointingAngle->Fill(fConversionCuts->GetCosineOfPointingAngle(gamma,fInputEvent));
-   hGammaInvMass->Fill(gamma->GetMass());
-//    hGammaXY->Fill(gamma->GetConversionX(),gamma->GetConversionY());
-//    hGammaZR->Fill(gamma->GetConversionZ(),gamma->GetConversionRadius());
-
-   AliVTrack * negTrack = fConversionCuts->GetTrack(fInputEvent, gamma->GetTrackLabelNegative());
-   AliVTrack * posTrack = fConversionCuts->GetTrack(fInputEvent, gamma->GetTrackLabelPositive());
-   if(!negTrack||!posTrack)return;
-
-
-   hElecPt->Fill(negTrack->Pt(),posTrack->Pt());
-   hElecEta->Fill(negTrack->Eta(),posTrack->Eta());
-   hElecPhi->Fill(negTrack->Phi(),posTrack->Phi());
-
-   hElecNfindableClsTPC->Fill((Float_t)posTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius())));
-   hPosiNfindableClsTPC->Fill((Float_t)negTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius())));
-   hElecClsTPC->Fill(negTrack->GetNcls(1));
-   hPosiClsTPC->Fill(posTrack->GetNcls(1));
-   //TPC dEdx
-   hElectrondEdxP->Fill(negTrack->P() ,negTrack->GetTPCsignal());
-   hElectronNSigmadEdxP->Fill(negTrack->P() ,pidResonse->NumberOfSigmasTPC(negTrack, AliPID::kElectron));
-   hElectronNSigmadEdxEta->Fill(negTrack->Eta() ,pidResonse->NumberOfSigmasTPC(negTrack, AliPID::kElectron));
-   hElectronNSigmaPiondEdxP->Fill(negTrack->P() ,pidResonse->NumberOfSigmasTPC(negTrack, AliPID::kPion));
-   hPositrondEdxP->Fill(posTrack->P() ,posTrack->GetTPCsignal());
-   hPositronNSigmadEdxP->Fill(posTrack->P() ,pidResonse->NumberOfSigmasTPC(posTrack, AliPID::kElectron));
-   hPositronNSigmadEdxEta->Fill(posTrack->Eta() ,pidResonse->NumberOfSigmasTPC(posTrack, AliPID::kElectron));
-   hPositronNSigmaPiondEdxP->Fill(posTrack->P() ,pidResonse->NumberOfSigmasTPC(posTrack, AliPID::kPion));
-   
-   //TOF signal
-   if((negTrack->GetStatus() & AliESDtrack::kTOFpid) && !(negTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
-      Double_t t0neg = pidResonse->GetTOFResponse().GetStartTime(negTrack->P());
-      Double_t timesNeg[9];
-      negTrack->GetIntegratedTimes(timesNeg);
-      Double_t TOFsignalNeg = negTrack->GetTOFsignal();
-      Double_t dTneg = TOFsignalNeg - t0neg - timesNeg[0];
-      hElectronTOFP->Fill(negTrack->P() ,dTneg);
-      hElectronNSigmaTOFP->Fill(negTrack->P() ,pidResonse->NumberOfSigmasTOF(negTrack, AliPID::kElectron));
-   }
-   if((posTrack->GetStatus() & AliESDtrack::kTOFpid) && !(posTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
-      Double_t t0pos = pidResonse->GetTOFResponse().GetStartTime(posTrack->P());
-      Double_t timesPos[9];
-      posTrack->GetIntegratedTimes(timesPos);
-      Double_t TOFsignalPos = posTrack->GetTOFsignal();
-      Double_t dTpos = TOFsignalPos - t0pos - timesPos[0];
-      hPositronTOFP->Fill(posTrack->P() ,dTpos);
-      hPositronNSigmaTOFP->Fill(posTrack->P() ,pidResonse->NumberOfSigmasTOF(posTrack, AliPID::kElectron));
-   }
-   
-   Int_t nPosClusterITS = 0;
-   Int_t nNegClusterITS = 0;
-   for(Int_t itsLayer = 0; itsLayer<6;itsLayer++){
-      if(TESTBIT(negTrack->GetITSClusterMap(),itsLayer)){
-         nNegClusterITS++;
-      }
-      if(TESTBIT(posTrack->GetITSClusterMap(),itsLayer)){
-         nPosClusterITS++;
-      }
-   }
-   Double_t negtrackPhi = negTrack->Phi();
-   Double_t postrackPhi = posTrack->Phi();
-   hITSClusterPhi->Fill(negtrackPhi,nNegClusterITS);
-   hITSClusterPhi->Fill(postrackPhi,nPosClusterITS);
-   
-   // ITS signal
-   if (nPosClusterITS > 0 ){
-      hPositronITSdEdxP->Fill(posTrack->P() ,posTrack->GetITSsignal());
-      hPositronNSigmaITSP->Fill(posTrack->P() ,pidResonse->NumberOfSigmasITS(posTrack,AliPID::kElectron));
-   } 
-   if (nNegClusterITS > 0 ){
-      hElectronITSdEdxP->Fill(negTrack->P() ,negTrack->GetITSsignal());
-      hElectronNSigmaITSP->Fill(negTrack->P() ,pidResonse->NumberOfSigmasITS(negTrack,AliPID::kElectron));
-   }
+       AliPIDResponse* pidResonse = ((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetPIDResponse();
+       
+       // Fill Histograms for QA and MC
+
+       hGammaPt->Fill(gamma->GetPhotonPt());
+       hGammaPhi->Fill(gamma->GetPhotonPhi());
+       hGammaEta->Fill(gamma->Eta());
+       hGammaChi2perNDF->Fill(gamma->GetChi2perNDF());
+       hGammaPsiPair->Fill(gamma->GetPsiPair());
+       hGammaArmenteros->Fill(gamma->GetArmenterosAlpha(),gamma->GetArmenterosQt());
+       hGammaCosinePointingAngle->Fill(fConversionCuts->GetCosineOfPointingAngle(gamma,fInputEvent));
+       hGammaInvMass->Fill(gamma->GetMass());
+       //    hGammaXY->Fill(gamma->GetConversionX(),gamma->GetConversionY());
+       //    hGammaZR->Fill(gamma->GetConversionZ(),gamma->GetConversionRadius());
+
+       AliVTrack * negTrack = fConversionCuts->GetTrack(fInputEvent, gamma->GetTrackLabelNegative());
+       AliVTrack * posTrack = fConversionCuts->GetTrack(fInputEvent, gamma->GetTrackLabelPositive());
+       if(!negTrack||!posTrack)return;
+
+
+       hElecPt->Fill(negTrack->Pt(),posTrack->Pt());
+       hElecEta->Fill(negTrack->Eta(),posTrack->Eta());
+       hElecPhi->Fill(negTrack->Phi(),posTrack->Phi());
+
+       hElecNfindableClsTPC->Fill((Float_t)posTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius())));
+       hPosiNfindableClsTPC->Fill((Float_t)negTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius())));
+       hElecClsTPC->Fill(negTrack->GetNcls(1));
+       hPosiClsTPC->Fill(posTrack->GetNcls(1));
+       //TPC dEdx
+       hElectrondEdxP->Fill(negTrack->P() ,negTrack->GetTPCsignal());
+       hElectronNSigmadEdxP->Fill(negTrack->P() ,pidResonse->NumberOfSigmasTPC(negTrack, AliPID::kElectron));
+       hElectronNSigmadEdxEta->Fill(negTrack->Eta() ,pidResonse->NumberOfSigmasTPC(negTrack, AliPID::kElectron));
+       hElectronNSigmaPiondEdxP->Fill(negTrack->P() ,pidResonse->NumberOfSigmasTPC(negTrack, AliPID::kPion));
+       hPositrondEdxP->Fill(posTrack->P() ,posTrack->GetTPCsignal());
+       hPositronNSigmadEdxP->Fill(posTrack->P() ,pidResonse->NumberOfSigmasTPC(posTrack, AliPID::kElectron));
+       hPositronNSigmadEdxEta->Fill(posTrack->Eta() ,pidResonse->NumberOfSigmasTPC(posTrack, AliPID::kElectron));
+       hPositronNSigmaPiondEdxP->Fill(posTrack->P() ,pidResonse->NumberOfSigmasTPC(posTrack, AliPID::kPion));
+       
+       //TOF signal
+       if((negTrack->GetStatus() & AliESDtrack::kTOFpid) && !(negTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
+               Double_t t0neg = pidResonse->GetTOFResponse().GetStartTime(negTrack->P());
+               Double_t timesNeg[9];
+               negTrack->GetIntegratedTimes(timesNeg);
+               Double_t TOFsignalNeg = negTrack->GetTOFsignal();
+               Double_t dTneg = TOFsignalNeg - t0neg - timesNeg[0];
+               hElectronTOFP->Fill(negTrack->P() ,dTneg);
+               hElectronNSigmaTOFP->Fill(negTrack->P() ,pidResonse->NumberOfSigmasTOF(negTrack, AliPID::kElectron));
+       }
+       if((posTrack->GetStatus() & AliESDtrack::kTOFpid) && !(posTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
+               Double_t t0pos = pidResonse->GetTOFResponse().GetStartTime(posTrack->P());
+               Double_t timesPos[9];
+               posTrack->GetIntegratedTimes(timesPos);
+               Double_t TOFsignalPos = posTrack->GetTOFsignal();
+               Double_t dTpos = TOFsignalPos - t0pos - timesPos[0];
+               hPositronTOFP->Fill(posTrack->P() ,dTpos);
+               hPositronNSigmaTOFP->Fill(posTrack->P() ,pidResonse->NumberOfSigmasTOF(posTrack, AliPID::kElectron));
+       }
+       
+       Int_t nPosClusterITS = 0;
+       Int_t nNegClusterITS = 0;
+       for(Int_t itsLayer = 0; itsLayer<6;itsLayer++){
+               if(TESTBIT(negTrack->GetITSClusterMap(),itsLayer)){
+                       nNegClusterITS++;
+               }
+               if(TESTBIT(posTrack->GetITSClusterMap(),itsLayer)){
+                       nPosClusterITS++;
+               }
+       }
+       Double_t negtrackPhi = negTrack->Phi();
+       Double_t postrackPhi = posTrack->Phi();
+       hITSClusterPhi->Fill(negtrackPhi,nNegClusterITS);
+       hITSClusterPhi->Fill(postrackPhi,nPosClusterITS);
+       
+       // ITS signal
+       if (nPosClusterITS > 0 ){
+               hPositronITSdEdxP->Fill(posTrack->P() ,posTrack->GetITSsignal());
+               hPositronNSigmaITSP->Fill(posTrack->P() ,pidResonse->NumberOfSigmasITS(posTrack,AliPID::kElectron));
+       } 
+       if (nNegClusterITS > 0 ){
+               hElectronITSdEdxP->Fill(negTrack->P() ,negTrack->GetITSsignal());
+               hElectronNSigmaITSP->Fill(negTrack->P() ,pidResonse->NumberOfSigmasITS(negTrack,AliPID::kElectron));
+       }
 
-   
+       
 }
 
 
 //________________________________________________________________________
 void AliAnalysisTaskConversionQA::CountTracks(){
 
-   if(fInputEvent->IsA()==AliESDEvent::Class()){
-   // Using standard function for setting Cuts
-   Bool_t selectPrimaries=kTRUE;
-   AliESDtrackCuts *EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
-   EsdTrackCuts->SetMaxDCAToVertexZ(2);
-   EsdTrackCuts->SetEtaRange(-0.8, 0.8);
-   EsdTrackCuts->SetPtRange(0.15);
-      fNumberOfESDTracks = 0;
-      for(Int_t iTracks = 0; iTracks < fInputEvent->GetNumberOfTracks(); iTracks++){
-         AliESDtrack* curTrack = (AliESDtrack*) fInputEvent->GetTrack(iTracks);
-         if(!curTrack) continue;
-         // if(fMCEvent && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 0){
-         //    if(!((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(abs(curTrack->GetLabel()), fMCStack)) continue;
-         // }
-         if(EsdTrackCuts->AcceptTrack(curTrack) ) fNumberOfESDTracks++;
-      }
-      delete EsdTrackCuts;
-      EsdTrackCuts=0x0;
-   }
-   else if(fInputEvent->IsA()==AliAODEvent::Class()){      
-      fNumberOfESDTracks = 0;
-      for(Int_t iTracks = 0; iTracks<fInputEvent->GetNumberOfTracks(); iTracks++){
-         AliAODTrack* curTrack = (AliAODTrack*) fInputEvent->GetTrack(iTracks);
-         if(curTrack->GetID()<0) continue; // Avoid double counting of tracks
-         if(!curTrack->IsHybridGlobalConstrainedGlobal()) continue;
-         if(abs(curTrack->Eta())>0.8) continue;
-         if(curTrack->Pt()<0.15) continue;
-         fNumberOfESDTracks++;
-      }
-   }
-   return;
+       if(fInputEvent->IsA()==AliESDEvent::Class()){
+               // Using standard function for setting Cuts
+               Bool_t selectPrimaries=kTRUE;
+               AliESDtrackCuts *EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
+               EsdTrackCuts->SetMaxDCAToVertexZ(2);
+               EsdTrackCuts->SetEtaRange(-0.8, 0.8);
+               EsdTrackCuts->SetPtRange(0.15);
+               fNumberOfESDTracks = 0;
+               for(Int_t iTracks = 0; iTracks < fInputEvent->GetNumberOfTracks(); iTracks++){
+                       AliESDtrack* curTrack = (AliESDtrack*) fInputEvent->GetTrack(iTracks);
+                       if(!curTrack) continue;
+                       if(EsdTrackCuts->AcceptTrack(curTrack) ) fNumberOfESDTracks++;
+               }
+               delete EsdTrackCuts;
+               EsdTrackCuts=0x0;
+       }
+       else if(fInputEvent->IsA()==AliAODEvent::Class()){      
+               fNumberOfESDTracks = 0;
+               for(Int_t iTracks = 0; iTracks<fInputEvent->GetNumberOfTracks(); iTracks++){
+                       AliAODTrack* curTrack = (AliAODTrack*) fInputEvent->GetTrack(iTracks);
+                       if(curTrack->GetID()<0) continue; // Avoid double counting of tracks
+                       if(!curTrack->IsHybridGlobalConstrainedGlobal()) continue;
+                       if(abs(curTrack->Eta())>0.8) continue;
+                       if(curTrack->Pt()<0.15) continue;
+                       fNumberOfESDTracks++;
+               }
+       }
+       return;
 }
 
 UInt_t AliAnalysisTaskConversionQA::IsTruePhotonESD(AliAODConversionPhoton *TruePhotonCandidate)
 {
-
-
        UInt_t kind = 9;
        TParticle *posDaughter = TruePhotonCandidate->GetPositiveMCDaughter(fMCStack);
        TParticle *negDaughter = TruePhotonCandidate->GetNegativeMCDaughter(fMCStack);
@@ -773,7 +762,6 @@ UInt_t AliAnalysisTaskConversionQA::IsTruePhotonESD(AliAODConversionPhoton *True
        Int_t pdgCodeNeg = 0; 
        Int_t pdgCode = 0; 
 
-
        if(posDaughter == NULL || negDaughter == NULL) {
                kind = 9;
                //              return kFALSE; // One particle does not exist
@@ -870,92 +858,92 @@ UInt_t AliAnalysisTaskConversionQA::IsTruePhotonAOD(AliAODConversionPhoton *True
 //________________________________________________________________________
 void AliAnalysisTaskConversionQA::RelabelAODPhotonCandidates(Bool_t mode){
 
-   // Relabeling For AOD Event
-   // ESDiD -> AODiD
-   // MCLabel -> AODMCLabel
-   
-   if(mode){
-      fMCStackPos = new Int_t[fConversionGammas->GetEntries()];
-      fMCStackNeg = new Int_t[fConversionGammas->GetEntries()];
-   }
-   
-   for(Int_t iGamma = 0;iGamma<fConversionGammas->GetEntries();iGamma++){
-      AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) fConversionGammas->At(iGamma);
-      if(!PhotonCandidate) continue;
-      if(!mode){// Back to ESD Labels
-         PhotonCandidate->SetMCLabelPositive(fMCStackPos[iGamma]);
-         PhotonCandidate->SetMCLabelNegative(fMCStackNeg[iGamma]);
-         //PhotonCandidate->IsAODMCLabel(kFALSE);
-         continue;
-      }
-      fMCStackPos[iGamma] =  PhotonCandidate->GetMCLabelPositive();
-      fMCStackNeg[iGamma] =  PhotonCandidate->GetMCLabelNegative();
-
-      Bool_t AODLabelPos = kFALSE;
-      Bool_t AODLabelNeg = kFALSE;
-
-      for(Int_t i = 0; i<fInputEvent->GetNumberOfTracks();i++){
-         AliAODTrack *tempDaughter = static_cast<AliAODTrack*>(fInputEvent->GetTrack(i));
-         if(!AODLabelPos){
-            if( tempDaughter->GetID() == PhotonCandidate->GetTrackLabelPositive() ){
-               PhotonCandidate->SetMCLabelPositive(abs(tempDaughter->GetLabel()));
-               AODLabelPos = kTRUE;
-            }
-         }
-         if(!AODLabelNeg){
-            if( tempDaughter->GetID() == PhotonCandidate->GetTrackLabelNegative()){
-               PhotonCandidate->SetMCLabelNegative(abs(tempDaughter->GetLabel()));
-               AODLabelNeg = kTRUE;
-            }
-         }
-         if(AODLabelNeg && AODLabelPos){
-            break;
-         }
-      } // Both ESD Tracks have AOD Tracks with Positive IDs
-      if(!AODLabelPos || !AODLabelNeg){
-         for(Int_t i = 0; i<fInputEvent->GetNumberOfTracks();i++){
-            AliAODTrack *tempDaughter = static_cast<AliAODTrack*>(fInputEvent->GetTrack(i));
-            if(tempDaughter->GetID()<0){
-               if(!AODLabelPos){
-                  if( (abs(tempDaughter->GetID())-1) == PhotonCandidate->GetTrackLabelPositive()){
-                     PhotonCandidate->SetMCLabelPositive(abs(tempDaughter->GetLabel()));
-                     AODLabelPos = kTRUE;
-                  }
-               }
-               if(!AODLabelNeg){
-                  if( (abs(tempDaughter->GetID())-1) == PhotonCandidate->GetTrackLabelNegative()){
-                     PhotonCandidate->SetMCLabelNegative(abs(tempDaughter->GetLabel()));
-                     AODLabelNeg = kTRUE;
-                  }
-               }
-            }
-            if(AODLabelNeg && AODLabelPos){
-               break;
-            }
-         }
-         if(!AODLabelPos || !AODLabelNeg){
-            cout<<"WARNING!!! AOD TRACKS NOT FOUND FOR"<<endl;
-         }
-      }
-   }
-   
-   if(!mode){
-      delete[] fMCStackPos;
-      delete[] fMCStackNeg;
-   }
+       // Relabeling For AOD Event
+       // ESDiD -> AODiD
+       // MCLabel -> AODMCLabel
+       
+       if(mode){
+               fMCStackPos = new Int_t[fConversionGammas->GetEntries()];
+               fMCStackNeg = new Int_t[fConversionGammas->GetEntries()];
+       }
+       
+       for(Int_t iGamma = 0;iGamma<fConversionGammas->GetEntries();iGamma++){
+               AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) fConversionGammas->At(iGamma);
+               if(!PhotonCandidate) continue;
+               if(!mode){// Back to ESD Labels
+                       PhotonCandidate->SetMCLabelPositive(fMCStackPos[iGamma]);
+                       PhotonCandidate->SetMCLabelNegative(fMCStackNeg[iGamma]);
+                       //PhotonCandidate->IsAODMCLabel(kFALSE);
+                       continue;
+               }
+               fMCStackPos[iGamma] =  PhotonCandidate->GetMCLabelPositive();
+               fMCStackNeg[iGamma] =  PhotonCandidate->GetMCLabelNegative();
+
+               Bool_t AODLabelPos = kFALSE;
+               Bool_t AODLabelNeg = kFALSE;
+
+               for(Int_t i = 0; i<fInputEvent->GetNumberOfTracks();i++){
+                       AliAODTrack *tempDaughter = static_cast<AliAODTrack*>(fInputEvent->GetTrack(i));
+                       if(!AODLabelPos){
+                               if( tempDaughter->GetID() == PhotonCandidate->GetTrackLabelPositive() ){
+                               PhotonCandidate->SetMCLabelPositive(abs(tempDaughter->GetLabel()));
+                               AODLabelPos = kTRUE;
+                               }
+                       }
+                       if(!AODLabelNeg){
+                               if( tempDaughter->GetID() == PhotonCandidate->GetTrackLabelNegative()){
+                               PhotonCandidate->SetMCLabelNegative(abs(tempDaughter->GetLabel()));
+                               AODLabelNeg = kTRUE;
+                               }
+                       }
+                       if(AODLabelNeg && AODLabelPos){
+                               break;
+                       }
+               } // Both ESD Tracks have AOD Tracks with Positive IDs
+               if(!AODLabelPos || !AODLabelNeg){
+                       for(Int_t i = 0; i<fInputEvent->GetNumberOfTracks();i++){
+                               AliAODTrack *tempDaughter = static_cast<AliAODTrack*>(fInputEvent->GetTrack(i));
+                               if(tempDaughter->GetID()<0){
+                               if(!AODLabelPos){
+                                       if( (abs(tempDaughter->GetID())-1) == PhotonCandidate->GetTrackLabelPositive()){
+                                               PhotonCandidate->SetMCLabelPositive(abs(tempDaughter->GetLabel()));
+                                               AODLabelPos = kTRUE;
+                                       }
+                               }
+                               if(!AODLabelNeg){
+                                       if( (abs(tempDaughter->GetID())-1) == PhotonCandidate->GetTrackLabelNegative()){
+                                               PhotonCandidate->SetMCLabelNegative(abs(tempDaughter->GetLabel()));
+                                               AODLabelNeg = kTRUE;
+                                       }
+                               }
+                               }
+                               if(AODLabelNeg && AODLabelPos){
+                               break;
+                               }
+                       }
+                       if(!AODLabelPos || !AODLabelNeg){
+                               cout<<"WARNING!!! AOD TRACKS NOT FOUND FOR"<<endl;
+                       }
+               }
+       }
+       
+       if(!mode){
+               delete[] fMCStackPos;
+               delete[] fMCStackNeg;
+       }
 }
 
 void AliAnalysisTaskConversionQA::SetLogBinningXTH2(TH2* histoRebin){
-   TAxis *axisafter = histoRebin->GetXaxis(); 
-   Int_t bins = axisafter->GetNbins();
-   Double_t from = axisafter->GetXmin();
-   Double_t to = axisafter->GetXmax();
-   Double_t *newbins = new Double_t[bins+1];
-   newbins[0] = from;
-   Double_t factor = TMath::Power(to/from, 1./bins);
-   for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
-   axisafter->Set(bins, newbins);
-   delete [] newbins;
+       TAxis *axisafter = histoRebin->GetXaxis(); 
+       Int_t bins = axisafter->GetNbins();
+       Double_t from = axisafter->GetXmin();
+       Double_t to = axisafter->GetXmax();
+       Double_t *newbins = new Double_t[bins+1];
+       newbins[0] = from;
+       Double_t factor = TMath::Power(to/from, 1./bins);
+       for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
+       axisafter->Set(bins, newbins);
+       delete [] newbins;
 
 }
 
index 59c3c07..b4b2236 100644 (file)
@@ -9,7 +9,7 @@
 #include "AliLog.h"
 #include <vector>
 #include "AliV0ReaderV1.h"
-#include "AliConversionCuts.h"
+#include "AliConversionPhotonCuts.h"
 #include "TList.h"
 #include "AliStack.h"
 #include "TClonesArray.h"
@@ -20,128 +20,135 @@ using namespace std;
 
 class AliAnalysisTaskConversionQA : public AliAnalysisTaskSE{
 
- public:
-   
-   AliAnalysisTaskConversionQA();
-   AliAnalysisTaskConversionQA(const char *name);
-   virtual ~AliAnalysisTaskConversionQA();
+       public:
+       
+               AliAnalysisTaskConversionQA();
+               AliAnalysisTaskConversionQA(const char *name);
+               virtual ~AliAnalysisTaskConversionQA();
 
-   virtual void   UserCreateOutputObjects();
-   virtual Bool_t Notify();
-   virtual void   UserExec(Option_t *option);
-   virtual void   Terminate(Option_t *);
+               virtual void   UserCreateOutputObjects();
+               virtual Bool_t Notify();
+               virtual void   UserExec(Option_t *option);
+               virtual void   Terminate(Option_t *);
 
-   void SetV0Reader(AliV0ReaderV1 *v0Reader){fV0Reader=v0Reader;}
-   void SetConversionCuts(AliConversionCuts* conversionCuts,Bool_t IsHeavyIon ){
-      fConversionCuts=conversionCuts;
-      fIsHeavyIon = IsHeavyIon;
-   }
-   void FillType(Bool_t fillTree, Bool_t fillHistorams){
-      ffillTree = fillTree;
-      ffillHistograms = fillHistorams;
-   }
-   void SetIsMC(Bool_t isMC){fIsMC = isMC;}
-   
- private:
-    
-   AliAnalysisTaskConversionQA(const AliAnalysisTaskConversionQA&); // Prevent copy-construction
-   AliAnalysisTaskConversionQA &operator=(const AliAnalysisTaskConversionQA&); // Prevent assignment
+               void SetV0Reader(AliV0ReaderV1 *v0Reader){fV0Reader=v0Reader;}
+               void SetConversionCuts(AliConversionPhotonCuts* conversionCuts,Bool_t IsHeavyIon ){
+                       fConversionCuts=conversionCuts;
+                       fIsHeavyIon = IsHeavyIon;
+               }
+               void SetEventCuts(AliConvEventCuts* conversionCuts,Bool_t IsHeavyIon ){
+                       fEventCuts=conversionCuts;
+                       fIsHeavyIon = IsHeavyIon;
+               }
 
-   void ProcessQATree(AliAODConversionPhoton *gamma);
-   void ProcessQA(AliAODConversionPhoton *gamma);
-   void RelabelAODPhotonCandidates(Bool_t mode);
-   void ProcessTrueQAESD(AliAODConversionPhoton *TruePhotonCandidate, AliESDtrack *elec, AliESDtrack *posi);
-   void ProcessTrueQAAOD(AliAODConversionPhoton *TruePhotonCandidate, AliAODTrack *elec, AliAODTrack *posi);
-   UInt_t IsTruePhotonESD(AliAODConversionPhoton *TruePhotonCandidate);
-   UInt_t IsTruePhotonAOD(AliAODConversionPhoton *TruePhotonCandidate);
-   void CountTracks();
-   void SetLogBinningXTH2(TH2* histoRebin);
+               void FillType(Bool_t fillTree, Bool_t fillHistorams){
+                       ffillTree = fillTree;
+                       ffillHistograms = fillHistorams;
+               }
+               void SetIsMC(Bool_t isMC){fIsMC = isMC;}
        
-   AliV0ReaderV1 *fV0Reader;    
-   TClonesArray *fConversionGammas;
-   AliConversionCuts *fConversionCuts; // Cuts used by the V0Reader
-   AliVEvent *fInputEvent;
-   Int_t fNumberOfESDTracks;
-   AliMCEvent *fMCEvent;
-   AliStack *fMCStack;
-   TTree *fTreeQA;
-   Bool_t fIsHeavyIon;
-   Bool_t ffillTree;
-   Bool_t ffillHistograms;
-   TList *fOutputList;
-   TList *fTreeList;
-   TList *fESDList;
-   TH1F *hVertexZ;
-   TH1I *hNGoodESDTracks;
-   TH1I *hNV0Tracks;
-   TH1I *hNContributorsVertex;
-   TH2F *hITSClusterPhi;
-   TH1F *hGammaPt;
-   TH1F *hGammaPhi;
-   TH1F *hGammaEta;
-   TH1F *hGammaChi2perNDF;
-   TH1F *hGammaPsiPair;
-   TH2F *hGammaArmenteros;
-   TH1F *hGammaCosinePointingAngle;
-   TH1F *hGammaInvMass;
-   TH2F *hElecPt;
-   TH2F *hElecEta;
-   TH2F *hElecPhi;
-   TH1F *hElecNfindableClsTPC;
-   TH1F *hPosiNfindableClsTPC;
-   TH1F *hElecClsTPC;
-   TH1F *hPosiClsTPC;
-   TH2F* hElectrondEdxP;
-   TH2F* hElectronITSdEdxP;
-   TH2F* hElectronTOFP;
-   TH2F* hElectronNSigmadEdxP;
-   TH2F* hElectronNSigmadEdxEta;
-   TH2F* hElectronNSigmaPiondEdxP;
-   TH2F* hElectronNSigmaITSP;
-   TH2F* hElectronNSigmaTOFP;
-   TH2F* hPositrondEdxP;
-   TH2F* hPositronITSdEdxP;
-   TH2F* hPositronTOFP;
-   TH2F* hPositronNSigmadEdxP;
-   TH2F* hPositronNSigmadEdxEta;
-   TH2F* hPositronNSigmaPiondEdxP;
-   TH2F* hPositronNSigmaITSP;
-   TH2F* hPositronNSigmaTOFP;
-//    TH2F *hElecAsymP;
-//    TH2F *hGammaXY;
-//    TH2F *hGammaZR;   
-//    TList *fTrueList;
-//    TH2F *hTrueResolutionR;
-//    TH2F *hTrueResolutionZ;
-//    TH2F *hTrueResolutionPhi;
-//    TH1F *hTrueGammaPt;
-//    TH1F *hTrueGammaPhi;
-//    TH1F *hTrueGammaEta;
-//    TH1F *hTrueGammaMass;
-//    TH1F *hTrueGammaChi2perNDF;
-//    TH1F *hTrueGammaPsiPair;
-//    TH1F *hTrueGammaQt;
-//    TH1F *hTrueGammaCosinePointingAngle;
-//    TH2F *hTrueGammaXY;
-//    TH2F *hTrueGammaZR;
-//    TH2F *hTrueElecPt;
-//    TH2F *hTrueElecEta;
-//    TH2F *hTrueElecPhi;
-//    TH1F *hTrueElecNfindableClsTPC;
-//    TH1F *hTruePosiNfindableClsTPC;
-//    TH2F *hTrueElecAsymP;
-   Float_t fGammaPt;
-   Float_t fGammaTheta;
-   Float_t fGammaChi2NDF;
-   TVectorF fGammaPhotonProp;
-   TVectorF fGammaConvCoord;
-   TVectorF fDaughterProp;
-   UInt_t fKind;
-   Bool_t fIsMC;
-   Int_t fnGammaCandidates;
-   Int_t *fMCStackPos;     //[fnGammaCandidates]
-   Int_t *fMCStackNeg;     //[fnGammaCandidates]
-   ClassDef(AliAnalysisTaskConversionQA, 4);
+       private:
+                       
+               AliAnalysisTaskConversionQA(const AliAnalysisTaskConversionQA&); // Prevent copy-construction
+               AliAnalysisTaskConversionQA &operator=(const AliAnalysisTaskConversionQA&); // Prevent assignment
+
+               void ProcessQATree(AliAODConversionPhoton *gamma);
+               void ProcessQA(AliAODConversionPhoton *gamma);
+               void RelabelAODPhotonCandidates(Bool_t mode);
+               void ProcessTrueQAESD(AliAODConversionPhoton *TruePhotonCandidate, AliESDtrack *elec, AliESDtrack *posi);
+               void ProcessTrueQAAOD(AliAODConversionPhoton *TruePhotonCandidate, AliAODTrack *elec, AliAODTrack *posi);
+               UInt_t IsTruePhotonESD(AliAODConversionPhoton *TruePhotonCandidate);
+               UInt_t IsTruePhotonAOD(AliAODConversionPhoton *TruePhotonCandidate);
+               void CountTracks();
+               void SetLogBinningXTH2(TH2* histoRebin);
+                       
+               AliV0ReaderV1                   *fV0Reader;                                     //
+               TClonesArray                    *fConversionGammas;                             //
+               AliConversionPhotonCuts         *fConversionCuts;                               // Cuts used by the V0Reader
+               AliConvEventCuts                *fEventCuts;                                    // Cuts used by the V0Reader
+               AliVEvent                               *fInputEvent;                                   //
+               Int_t                                   fNumberOfESDTracks;                             //
+               AliMCEvent                              *fMCEvent;                                              //
+               AliStack                                *fMCStack;                                              //
+               TTree                                   *fTreeQA;                                               //
+               Bool_t                                  fIsHeavyIon;                                    //
+               Bool_t                                  ffillTree;                                              //
+               Bool_t                                  ffillHistograms;                                //
+               TList                                   *fOutputList;                                   //
+               TList                                   *fTreeList;                                             //
+               TList                                   *fESDList;                                              //
+               TH1F                                    *hVertexZ;                                              //
+               TH1I                                    *hNGoodESDTracks;                               //
+               TH1I                                    *hNV0Tracks;                                    //
+               TH1I                                    *hNContributorsVertex;                  //
+               TH2F                                    *hITSClusterPhi;                                //
+               TH1F                                    *hGammaPt;                                              //
+               TH1F                                    *hGammaPhi;                                             //
+               TH1F                                    *hGammaEta;                                             //
+               TH1F                                    *hGammaChi2perNDF;                              //
+               TH1F                                    *hGammaPsiPair;                                 //
+               TH2F                                    *hGammaArmenteros;                              //
+               TH1F                                    *hGammaCosinePointingAngle;             //
+               TH1F                                    *hGammaInvMass;                                 //
+               TH2F                                    *hElecPt;                                               //
+               TH2F                                    *hElecEta;                                              //
+               TH2F                                    *hElecPhi;                                              //
+               TH1F                                    *hElecNfindableClsTPC;                  //
+               TH1F                                    *hPosiNfindableClsTPC;                  //
+               TH1F                                    *hElecClsTPC;                                   //
+               TH1F                                    *hPosiClsTPC;                                   //
+               TH2F                                    *hElectrondEdxP;                                //
+               TH2F                                            *hElectronITSdEdxP;                             //
+               TH2F                                            *hElectronTOFP;                                 //
+               TH2F                                    *hElectronNSigmadEdxP;                  //
+               TH2F                                    *hElectronNSigmadEdxEta;                //
+               TH2F                                    *hElectronNSigmaPiondEdxP;              //
+               TH2F                                    *hElectronNSigmaITSP;                   //
+               TH2F                                    *hElectronNSigmaTOFP;                   //
+               TH2F                                    *hPositrondEdxP;                                //
+               TH2F                                    *hPositronITSdEdxP;                             //
+               TH2F                                    *hPositronTOFP;                                 //
+               TH2F                                    *hPositronNSigmadEdxP;                  //
+               TH2F                                    *hPositronNSigmadEdxEta;                //
+               TH2F                                    *hPositronNSigmaPiondEdxP;              //
+               TH2F                                    *hPositronNSigmaITSP;                   //
+               TH2F                                    *hPositronNSigmaTOFP;                   //
+               //    TH2F                                              *hElecAsymP;                                    //
+               //    TH2F                                              *hGammaXY;                                              //
+               //    TH2F                                              *hGammaZR;                                      //
+               //    TList                                     *fTrueList;                                             //
+               //    TH2F                                              *hTrueResolutionR;                              //
+               //    TH2F                                              *hTrueResolutionZ;                              //
+               //    TH2F                                              *hTrueResolutionPhi;                    //
+               //    TH1F                                              *hTrueGammaPt;                                  //
+               //    TH1F                                              *hTrueGammaPhi;                                 //
+               //    TH1F                                              *hTrueGammaEta;                                 //
+               //    TH1F                                              *hTrueGammaMass;                                //
+               //    TH1F                                              *hTrueGammaChi2perNDF;                  //
+               //    TH1F                                              *hTrueGammaPsiPair;                             //
+               //    TH1F                                              *hTrueGammaQt;                                  //
+               //    TH1F                                              *hTrueGammaCosinePointingAngle; //
+               //    TH2F                                              *hTrueGammaXY;                                  //
+               //    TH2F                                              *hTrueGammaZR;                                  //
+               //    TH2F                                              *hTrueElecPt;                                   //
+               //    TH2F                                              *hTrueElecEta;                                  //
+               //    TH2F                                              *hTrueElecPhi;                                  //
+               //    TH1F                                              *hTrueElecNfindableClsTPC;              //
+               //    TH1F                                              *hTruePosiNfindableClsTPC;              //
+               //    TH2F                                              *hTrueElecAsymP;                                //
+               Float_t                                         fGammaPt;                                               //
+               Float_t                                         fGammaTheta;                                    //
+               Float_t                                         fGammaChi2NDF;                                  //
+               TVectorF                                fGammaPhotonProp;                               //
+               TVectorF                                fGammaConvCoord;                                //
+               TVectorF                                fDaughterProp;                                  //
+               UInt_t                                  fKind;                                                  //
+               Bool_t                                  fIsMC;                                                  //
+               Int_t                                   fnGammaCandidates;                              //
+               Int_t                                   *fMCStackPos;                                   //[fnGammaCandidates]
+               Int_t                                   *fMCStackNeg;                                   //[fnGammaCandidates]
+               
+               ClassDef(AliAnalysisTaskConversionQA, 5);
 };
 
 #endif
index 255d8b1..3927964 100644 (file)
@@ -77,9 +77,11 @@ AliAnalysisTaskEtaToPiPlPiMiGamma::AliAnalysisTaskEtaToPiPlPiMiGamma():
        fSelectorPosPionIndex(0),
        fGoodGammas(NULL),
        fGoodVirtualParticles(NULL),
+       fEventCutArray(NULL),
        fGammaCutArray(NULL),
        fPionCutArray(NULL),
        fMesonCutArray(NULL),
+       fEventCuts(NULL),
        fConversionCuts(NULL),
        fHistoConvGammaPt(NULL),
        fHistoConvGammaEta(NULL),
@@ -161,9 +163,11 @@ AliAnalysisTaskEtaToPiPlPiMiGamma::AliAnalysisTaskEtaToPiPlPiMiGamma( const char
        fSelectorPosPionIndex(0),
        fGoodGammas(NULL),
        fGoodVirtualParticles(NULL),
+       fEventCutArray(NULL),
        fGammaCutArray(NULL),
        fPionCutArray(NULL),
        fMesonCutArray(NULL),
+       fEventCuts(NULL),
        fConversionCuts(NULL),
        fHistoConvGammaPt(NULL),
        fHistoConvGammaEta(NULL),
@@ -258,13 +262,14 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::InitBack(){
        fBGHandler = new AliGammaConversionAODBGHandler*[fnCuts];
        for(Int_t iCut = 0; iCut<fnCuts;iCut++){
                
-               TString cutstringPion     =   ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutNumber();
-               TString cutstringMeson        =   ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
-               TString cutstringGamma        =   ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetCutNumber();
+               TString cutstringEvent          = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
+               TString cutstringPion           = ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutNumber();
+               TString cutstringMeson          = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
+               TString cutstringGamma          = ((AliConversionPhotonCuts*)fGammaCutArray->At(iCut))->GetCutNumber();
                
-               Int_t collisionSystem = atoi((TString)(((AliConversionCuts*)fGammaCutArray->At(iCut))->GetCutNumber())(0,1));
-               Int_t centMin = atoi((TString)(((AliConversionCuts*)fGammaCutArray->At(iCut))->GetCutNumber())(1,1));
-               Int_t centMax = atoi((TString)(((AliConversionCuts*)fGammaCutArray->At(iCut))->GetCutNumber())(2,1));
+               Int_t collisionSystem = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(0,1));
+               Int_t centMin = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(1,1));
+               Int_t centMax = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(2,1));
                
                if(collisionSystem == 1 || collisionSystem == 2 ||
                        collisionSystem == 5 || collisionSystem == 8 ||
@@ -283,7 +288,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::InitBack(){
 
 
                fBackList[iCut] = new TList();
-               fBackList[iCut]->SetName(Form("%s_%s_%s Back histograms",cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
+               fBackList[iCut]->SetName(Form("%s_%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
                fBackList[iCut]->SetOwner(kTRUE);
                fCutFolder[iCut]->Add(fBackList[iCut]);
 
@@ -291,7 +296,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::InitBack(){
                fBackList[iCut]->Add(fTHnSparseMotherBackInvMassPtZM[iCut]);
 
                fMotherList[iCut] = new TList();
-               fMotherList[iCut]->SetName(Form("%s_%s_%s Mother histograms",cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
+               fMotherList[iCut]->SetName(Form("%s_%s_%s_%s Mother histograms",cutstringEvent.Data(),cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
                fMotherList[iCut]->SetOwner(kTRUE);
                fCutFolder[iCut]->Add(fMotherList[iCut]);
 
@@ -360,17 +365,18 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserCreateOutputObjects()
        fHistoMotherBackInvMassPt       = new TH2F*[fnCuts];
 
        for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-               TString cutstringPion =((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutNumber();
-               TString cutstringMeson= ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
-               TString cutstringGamma = ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetCutNumber();
+               TString cutstringEvent  = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
+               TString cutstringPion   = ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutNumber();
+               TString cutstringMeson  = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
+               TString cutstringGamma  = ((AliConversionPhotonCuts*)fGammaCutArray->At(iCut))->GetCutNumber();
 
                fCutFolder[iCut] = new TList();
-               fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s",cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
+               fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s_%s",cutstringEvent.Data(),cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
                fCutFolder[iCut]->SetOwner(kTRUE);
                fOutputContainer->Add(fCutFolder[iCut]);
 
                fESDList[iCut] = new TList();
-               fESDList[iCut]->SetName(Form("%s_%s_%s ESD histograms",cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
+               fESDList[iCut]->SetName(Form("%s_%s_%s_%s ESD histograms",cutstringEvent.Data(),cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
                fESDList[iCut]->SetOwner(kTRUE);
 
                fHistoNEvents[iCut] = new TH1I("NEvents","NEvents",9,-0.5,8.5);
@@ -491,12 +497,13 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserCreateOutputObjects()
                }
                
                for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-                       TString cutstringPion =((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutNumber();
-                       TString cutstringMeson= ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
-                       TString cutstringGamma = ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringEvent  = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringPion   = ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringMeson  = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringGamma  = ((AliConversionPhotonCuts*)fGammaCutArray->At(iCut))->GetCutNumber();
 
                        fMCList[iCut] = new TList();
-                       fMCList[iCut]->SetName(Form("%s_%s_%s MC histograms",cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
+                       fMCList[iCut]->SetName(Form("%s_%s_%s_%s MC histograms",cutstringEvent.Data(),cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
                        fMCList[iCut]->SetOwner(kTRUE);
                        fCutFolder[iCut]->Add(fMCList[iCut]);
 
@@ -532,7 +539,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserCreateOutputObjects()
                        fMCList[iCut]->Add(fHistoMCEtaPiPlPiMiGammaInAccPt[iCut]);
 
                        fTrueList[iCut] = new TList();
-                       fTrueList[iCut]->SetName(Form("%s_%s_%s True histograms",cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
+                       fTrueList[iCut]->SetName(Form("%s_%s_%s_%s True histograms",cutstringEvent.Data(),cutstringGamma.Data(),cutstringPion.Data(),cutstringMeson.Data()));
                        fTrueList[iCut]->SetOwner(kTRUE);
                        fCutFolder[iCut]->Add(fTrueList[iCut]);
 
@@ -580,9 +587,9 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserCreateOutputObjects()
        if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader
                
        if(fV0Reader)
-               if((AliConversionCuts*)fV0Reader->GetConversionCuts())
-                       if(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms())
-                               fOutputContainer->Add(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms());
+               if((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())
+                       if(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms())
+                               fOutputContainer->Add(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms());
                
                
                
@@ -607,8 +614,8 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserCreateOutputObjects()
                        }
                }
                if( fGammaCutArray ) {
-                       if( ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetCutHistograms() ) {
-                               fCutFolder[iCut]->Add( ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetCutHistograms()  );
+                       if( ((AliConversionPhotonCuts*)fGammaCutArray->At(iCut))->GetCutHistograms() ) {
+                               fCutFolder[iCut]->Add( ((AliConversionPhotonCuts*)fGammaCutArray->At(iCut))->GetCutHistograms()  );
                        }
                }
        }
@@ -627,7 +634,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserExec(Option_t *){
        fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1");
        if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader
 
-       Int_t eventQuality = ((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEventQuality();
+       Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality();
 
        if(eventQuality == 2 || eventQuality == 3){// Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1
                for(Int_t iCut = 0; iCut<fnCuts; iCut++){
@@ -651,8 +658,8 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserExec(Option_t *){
        for(Int_t iCut = 0; iCut<fnCuts; iCut++){
                fiCut = iCut;
                Int_t eventNotAccepted =
-                       ((AliConversionCuts*)fGammaCutArray->At(iCut))
-                       ->IsEventAcceptedByConversionCut(fV0Reader->GetConversionCuts(),fInputEvent,fMCEvent,fIsHeavyIon);
+                       ((AliConvEventCuts*)fGammaCutArray->At(iCut))
+                       ->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon);
                
                if(eventNotAccepted){
                        //                      cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
@@ -671,9 +678,10 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserExec(Option_t *){
 
                if(fMCEvent){ // Process MC Particle
                        fMCStack = fMCEvent->Stack();                   
-                       if(((AliConversionCuts*)fGammaCutArray->At(iCut))->GetSignalRejection() != 0){
-                               ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetNotRejectedParticles(((AliConversionCuts*)fGammaCutArray->At(iCut))->GetSignalRejection(), ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetAcceptedHeader(),
-                                                                                                       fMCEvent);
+                       if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection() != 0){
+                               ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(), 
+                                                                                                                                                                               ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
+                                                                                                                                                                               fMCEvent);
                        } 
                        ProcessMCParticles();
                }
@@ -700,22 +708,22 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserExec(Option_t *){
 
 Bool_t AliAnalysisTaskEtaToPiPlPiMiGamma::Notify(){
        for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-               if( !((AliConversionCuts*)fGammaCutArray->At(iCut))->GetDoEtaShift() ){
+               if( !((AliConvEventCuts*)fEventCutArray->At(iCut))->GetDoEtaShift() ){
                        fProfileEtaShift[iCut]->Fill(0.,0.);
                        continue; // No Eta Shift requested, continue
                }
-               if( ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
-                       ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName());
-                       ((AliConversionCuts*)fGammaCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once   
-                       ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->SetEtaShift( ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetEtaShift() );
-                       fProfileEtaShift[iCut]->Fill(0.,(((AliConversionCuts*)fGammaCutArray->At(iCut))->GetEtaShift()));
+               if( ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
+                       ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName());
+                       ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once   
+                       ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->SetEtaShift( ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() );
+                       fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
                        continue;
                } else {
                        printf(" Eta t PiPlusPiMinus Gamma Task %s :: Eta Shift Manually Set to %f \n\n",
-                       (((AliConversionCuts*)fGammaCutArray->At(iCut))->GetCutNumber()).Data(),((AliConversionCuts*)fGammaCutArray->At(iCut))->GetEtaShift());
-                       ((AliConversionCuts*)fGammaCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once   
-                       ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->SetEtaShift( ((AliConversionCuts*)fGammaCutArray->At(iCut))->GetEtaShift() );
-                       fProfileEtaShift[iCut]->Fill(0.,(((AliConversionCuts*)fGammaCutArray->At(iCut))->GetEtaShift()));
+                       (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber()).Data(),((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift());
+                       ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once   
+                       ((AliPrimaryPionCuts*)fPionCutArray->At(iCut))->SetEtaShift( ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() );
+                       fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
                }
        }
        return kTRUE;
@@ -739,20 +747,20 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessPhotonCandidates(){
                
                fIsFromMBHeader = kTRUE;
                
-               if( fMCEvent && ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetSignalRejection() != 0 ){           
+               if( fMCEvent && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0 ){            
                        Int_t isPosFromMBHeader
-                               = ((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent);
-                       if(isPosFromMBHeader == 0 && ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
+                               = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent);
+                       if(isPosFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
                        Int_t isNegFromMBHeader
-                               = ((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent);
-                       if(isNegFromMBHeader == 0 && ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
+                               = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent);
+                       if(isNegFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
                        if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE;
                }
                
-               if(!((AliConversionCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelected(PhotonCandidate,fESDEvent)) continue;
+               if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelected(PhotonCandidate,fESDEvent)) continue;
 
-               if(!((AliConversionCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut() &&
-                       !((AliConversionCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){ // if no post reader loop is required add to events good gammas
+               if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut() &&
+                       !((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){ // if no post reader loop is required add to events good gammas
                        
                        fGoodGammas->Add(PhotonCandidate);
                
@@ -764,31 +772,31 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessPhotonCandidates(){
                        if(fMCEvent){
                                ProcessTruePhotonCandidates(PhotonCandidate);
                        }
-               } else if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut()){ // if Shared Electron cut is enabled, Fill array, add to step one
-                       ((AliConversionCuts*)fGammaCutArray->At(fiCut))->FillElectonLabelArray(PhotonCandidate,nV0);
+               } else if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut()){ // if Shared Electron cut is enabled, Fill array, add to step one
+                       ((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->FillElectonLabelArray(PhotonCandidate,nV0);
                        nV0++;
                        GoodGammasStepOne->Add(PhotonCandidate);
-               } else if(!((AliConversionCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut() &&
-                               ((AliConversionCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){ // shared electron is disabled, step one not needed -> step two
+               } else if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut() &&
+                               ((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){ // shared electron is disabled, step one not needed -> step two
                        GoodGammasStepTwo->Add(PhotonCandidate);
                }
        }
        
        
-       if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut()){
+       if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseElecSharingCut()){
                for(Int_t i = 0;i<GoodGammasStepOne->GetEntries();i++){
                        AliAODConversionPhoton *PhotonCandidate= (AliAODConversionPhoton*) GoodGammasStepOne->At(i);
                        if(!PhotonCandidate) continue;
                        fIsFromMBHeader = kTRUE;
-                       if(fMCEvent && ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetSignalRejection() != 0){
+                       if(fMCEvent && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
                                Int_t isPosFromMBHeader
-                               = ((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack,fInputEvent);
+                               = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack,fInputEvent);
                                Int_t isNegFromMBHeader
-                               = ((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent);
+                               = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent);
                                if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE;
                        }
-                       if(!((AliConversionCuts*)fGammaCutArray->At(fiCut))->RejectSharedElectronV0s(PhotonCandidate,i,GoodGammasStepOne->GetEntries())) continue;
-                       if(!((AliConversionCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){ // To Colse v0s cut diabled, step two not needed
+                       if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->RejectSharedElectronV0s(PhotonCandidate,i,GoodGammasStepOne->GetEntries())) continue;
+                       if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){ // To Colse v0s cut diabled, step two not needed
                                fGoodGammas->Add(PhotonCandidate);
                                if(fIsFromMBHeader){
                                        fHistoConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt());
@@ -801,20 +809,20 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessPhotonCandidates(){
                        else GoodGammasStepTwo->Add(PhotonCandidate); // Close v0s cut enabled -> add to list two
                }
        }
-       if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){
+       if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->UseToCloseV0sCut()){
                for(Int_t i = 0;i<GoodGammasStepTwo->GetEntries();i++){
                        AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) GoodGammasStepTwo->At(i);
                        if(!PhotonCandidate) continue;
                        
-                       if(fMCEvent && ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetSignalRejection() != 0){
+                       if(fMCEvent && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
                                Int_t isPosFromMBHeader
-                               = ((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack,fInputEvent);
+                               = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack,fInputEvent);
                                Int_t isNegFromMBHeader
-                               = ((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent);
+                               = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack,fInputEvent);
                                if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE;
                        }
                        
-                       if(!((AliConversionCuts*)fGammaCutArray->At(fiCut))->RejectToCloseV0s(PhotonCandidate,GoodGammasStepTwo,i)) continue;
+                       if(!((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->RejectToCloseV0s(PhotonCandidate,GoodGammasStepTwo,i)) continue;
                        fGoodGammas->Add(PhotonCandidate); // Add gamma to current cut TList
                
                        if(fIsFromMBHeader){
@@ -1016,22 +1024,22 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessMCParticles(){
                if (!particle) continue;
 
                Int_t isMCFromMBHeader = -1;
-               if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetSignalRejection() != 0){
+               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
                        isMCFromMBHeader
-                               = ((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent);
-                       if(isMCFromMBHeader == 0 && ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
+                               = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent);
+                       if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
                }
 
-               if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack,fInputEvent)){
+               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack,fInputEvent)){
                        
-                       if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kFALSE)){
+                       if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kFALSE)){
                                fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma
                                if(particle->GetMother(0) >-1){
                                        if (fMCStack->Particle(particle->GetMother(0))->GetPdgCode() ==221 && fMCStack->Particle(particle->GetMother(0))->GetNDaughters()==3 ) fHistoMCGammaFromEtaPt[fiCut]->Fill(particle->Pt()); // All pos from eta
                                }       
                        }
                        
-                       if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kTRUE)){
+                       if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kTRUE)){
                                fHistoMCConvGammaPt[fiCut]->Fill(particle->Pt());
                        } // Converted MC Gamma
                        
@@ -1052,12 +1060,12 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessMCParticles(){
                        
                        // \eta -> \gamma \gamma 
                        
-                       if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMC( particle,fMCStack,((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetEtaShift() ) ){
+                       if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMC( particle,fMCStack,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift() ) ){
                                Float_t weighted= 1;
                                if( ((AliPrimaryPionCuts*) fPionCutArray->At(fiCut))->DoWeights() ) { 
-                                       if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
                                                if (particle->Pt()>0.005){
-                                                       weighted= ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack,fInputEvent);
+                                                       weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack,fInputEvent);
                                                }
                                        }
                                }
@@ -1069,12 +1077,12 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessMCParticles(){
                        Int_t labelelectron = -1;
                        Int_t labelpositron = -1;
 
-                       if( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMCDalitz(particle,fMCStack,labelelectron,labelpositron,labelgamma,((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetEtaShift())){
+                       if( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMCDalitz(particle,fMCStack,labelelectron,labelpositron,labelgamma,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
                                Float_t weighted= 1;
                                if( ((AliPrimaryPionCuts*) fPionCutArray->At(fiCut))->DoWeights() ) { 
-                                       if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack,fInputEvent)){
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack,fInputEvent)){
                                                if (particle->Pt()>0.005){
-                                                       weighted= ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack,fInputEvent);
+                                                       weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack,fInputEvent);
                                                }
                                        }
                                }
@@ -1087,19 +1095,19 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessMCParticles(){
                        Int_t labelNegPion = -1;
                        Int_t labelPosPion = -1;
 
-                       if( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMCEtaPiPlPiMiGamma(particle,fMCStack,labelNegPion,labelPosPion,labelGamma3Body,((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetEtaShift())){       
+                       if( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMCEtaPiPlPiMiGamma(particle,fMCStack,labelNegPion,labelPosPion,labelGamma3Body,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){        
                                Float_t weighted= 1;
                                if( ((AliPrimaryPionCuts*) fPionCutArray->At(fiCut))->DoWeights() ) { 
-                                       if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack,fInputEvent)){
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack,fInputEvent)){
                                                if (particle->Pt()>0.005){
-                                                       weighted= ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack,fInputEvent);
+                                                       weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack,fInputEvent);
                                                }
                                        }
                                }
                                if(particle->GetPdgCode() == 221)fHistoMCEtaPiPlPiMiGammaPt[fiCut]->Fill(particle->Pt(), weighted); // All MC Eta
                
                                TParticle *gamma    = fMCStack->Particle(labelGamma3Body);
-                               if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelectedMC(gamma,fMCStack,kFALSE) &&
+                               if(((AliConversionPhotonCuts*)fGammaCutArray->At(fiCut))->PhotonIsSelectedMC(gamma,fMCStack,kFALSE) &&
                                ((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->PionIsSelectedMC(labelNegPion,fMCStack) &&
                                ((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->PionIsSelectedMC(labelPosPion,fMCStack) ) {
                                        if(particle->GetPdgCode() == 221)fHistoMCEtaPiPlPiMiGammaInAccPt[fiCut]->Fill(particle->Pt(), weighted ); // MC EtaDalitz with gamma and e+e- in acc
@@ -1145,7 +1153,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::CalculateMesonCandidates(){
 //                                     cout << labeln << "\t" << labelp << endl;
 //                             }       
 
-                               if( ( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(etacand,kTRUE,((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetEtaShift())) ){
+                               if( ( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(etacand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())) ){
                        
 //                                     cout<< "Meson Accepted "<<endl;
                                        
@@ -1276,7 +1284,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::CalculateBackground(){
                                        AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&previousGoodV0);
                                                                
 
-                                       if( ( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE, ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetEtaShift()))){
+                                       if( ( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE, ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                                fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
                                                Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
                                                fTHnSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
@@ -1307,7 +1315,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::CalculateBackground(){
 
                                                AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&previousGoodV0);
                                                                
-                                               if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetEtaShift()))){
+                                               if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                                        fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
                                                        Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
                                                        fTHnSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
@@ -1402,9 +1410,9 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessTrueMesonCandidates(AliAODConvers
                        if ( isPiPiDecay) { //real eta -> Pi+ Pi- Gamma
                                Float_t weighted= 1;
                                if( ((AliPrimaryPionCuts*) fPionCutArray->At(fiCut))->DoWeights() ) { 
-                                       if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack,fInputEvent)){
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack,fInputEvent)){
                                                if (((TParticle*)MCStack->Particle(gammaMotherLabel))->Pt()>0.005){
-                                                       weighted= ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gammaMotherLabel,fMCStack,fInputEvent);
+                                                       weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gammaMotherLabel,fMCStack,fInputEvent);
                                                }
                                        }
                                }
@@ -1413,9 +1421,9 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessTrueMesonCandidates(AliAODConvers
                        } else if ( isRealGamma ){
                                Float_t weighted= 1;
                                if( ((AliPrimaryPionCuts*) fPionCutArray->At(fiCut))->DoWeights() ) {
-                                       if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack,fInputEvent)){
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack,fInputEvent)){
                                                if (((TParticle*)MCStack->Particle(gammaMotherLabel))->Pt()>0.005){
-                                                       weighted= ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gammaMotherLabel,fMCStack,fInputEvent);
+                                                       weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gammaMotherLabel,fMCStack,fInputEvent);
                                                }
                                        }
                                }
@@ -1424,9 +1432,9 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessTrueMesonCandidates(AliAODConvers
                        } else if (isDalitz) {
                                Float_t weighted= 1;
                                if( ((AliPrimaryPionCuts*) fPionCutArray->At(fiCut))->DoWeights() ) {
-                                       if(((AliConversionCuts*)fGammaCutArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack,fInputEvent)){
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gammaMotherLabel, fMCStack,fInputEvent)){
                                                if (((TParticle*)MCStack->Particle(gammaMotherLabel))->Pt()>0.005){
-                                                       weighted= ((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gammaMotherLabel,fMCStack,fInputEvent);
+                                                       weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gammaMotherLabel,fMCStack,fInputEvent);
                                                }
                                        }
                                }
index 97b7c19..5c83911 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef ALIANALYSISTASKHEAVYMESONTHREEBODY_H
-#define ALIANALYSISTASKHEAVYMESONTHREEBODY_H
+#ifndef ALIANALYSISTASKETATOPIPLPIMIGAMMA_H
+#define ALIANALYSISTASKETATOPIPLPIMIGAMMA_H
 
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
@@ -11,6 +11,7 @@
 #include "AliKFConversionPhoton.h"
 #include "AliPrimaryPionSelector.h"
 #include "AliConversionMesonCuts.h"
+#include "AliConvEventCuts.h"
 #include "AliGammaConversionAODBGHandler.h"
 #include "TProfile2D.h"
 
@@ -52,6 +53,11 @@ class AliAnalysisTaskEtaToPiPlPiMiGamma: public AliAnalysisTaskSE
                        fnCuts= nCuts;
                        fGammaCutArray = CutArray;
                }
+               void SetEventCutList(Int_t nCuts, TList *CutArray){
+                       fnCuts= nCuts;
+                       fEventCutArray = CutArray;
+               }
+
                void SetPionCutList(TList *CutArray){
                        fPionCutArray = CutArray;
                }
@@ -79,97 +85,99 @@ class AliAnalysisTaskEtaToPiPlPiMiGamma: public AliAnalysisTaskSE
                
                
 
-               AliV0ReaderV1 *fV0Reader;
-               AliPrimaryPionSelector* fPionSelector;
-               AliGammaConversionAODBGHandler **fBGHandler;
-               AliESDEvent *fESDEvent;
-               AliMCEvent *fMCEvent;
-               AliStack *fMCStack;
-               TList **fCutFolder;
-               TList **fESDList;
-               TList **fBackList;
-               TList **fMotherList;
-               TList **fTrueList;
-               TList **fMCList;
-               TList *fOutputContainer;
-               TClonesArray *fReaderGammas;
-               vector<Int_t> fSelectorNegPionIndex;
-               vector<Int_t> fSelectorPosPionIndex;
-               TList *fGoodGammas;
-               TList *fGoodVirtualParticles;
-               TList *fGammaCutArray;
-               TList *fPionCutArray;
-               TList *fMesonCutArray;
-               AliConversionCuts *fConversionCuts;
+               AliV0ReaderV1                                   *fV0Reader;                                                                     //
+               AliPrimaryPionSelector                  *fPionSelector;                                                         //
+               AliGammaConversionAODBGHandler  **fBGHandler;                                                           //
+               AliESDEvent                                     *fESDEvent;                                                                     //
+               AliMCEvent                                              *fMCEvent;                                                                      //
+               AliStack                                                *fMCStack;                                                                      //
+               TList                                                   **fCutFolder;                                                           //
+               TList                                                   **fESDList;                                                                     //
+               TList                                                   **fBackList;                                                            //
+               TList                                                   **fMotherList;                                                          //
+               TList                                                   **fTrueList;                                                            //
+               TList                                                   **fMCList;                                                                      //
+               TList                                                   *fOutputContainer;                                                      //
+               TClonesArray                                    *fReaderGammas;                                                         //
+               vector<Int_t>                                   fSelectorNegPionIndex;                                          //
+               vector<Int_t>                                   fSelectorPosPionIndex;                                          //
+               TList                                                   *fGoodGammas;                                                           //
+               TList                                                   *fGoodVirtualParticles;                                         //
+               TList                                                   *fEventCutArray;                                                        //
+               TList                                                   *fGammaCutArray;                                                        //
+               TList                                                   *fPionCutArray;                                                         //
+               TList                                                   *fMesonCutArray;                                                        //
+               AliConvEventCuts                                *fEventCuts;                                                            //
+               AliConversionPhotonCuts                 *fConversionCuts;                                                       //
                
                // reconstructed particles
-               TH1F **fHistoConvGammaPt;
-               TH1F **fHistoConvGammaEta;
-               TH1F **fHistoNegPionPt;
-               TH1F **fHistoPosPionPt;
-               TH1F **fHistoNegPionPhi;
-               TH1F **fHistoPosPionPhi;
-               TH1F **fHistoNegPionEta;
-               TH1F **fHistoPosPionEta;
-               TH2F **fHistoNegPionClsTPC;
-               TH2F **fHistoPosPionClsTPC;
-               TH2F **fHistoPionDCAxy;
-               TH2F **fHistoPionDCAz;
-               TH2F **fHistoPionTPCdEdxNSigma;
-               TH2F **fHistoPionTPCdEdx;
-               TH2F **fHistoPionPionInvMassPt;
-               TH2F **fHistoMotherInvMassPt;
-               THnSparseF **fTHnSparseMotherInvMassPtZM;
-               TH2F **fHistoMotherBackInvMassPt;
-               THnSparseF **fTHnSparseMotherBackInvMassPtZM;
+               TH1F                                                    **fHistoConvGammaPt;                                            //
+               TH1F                                                    **fHistoConvGammaEta;                                           //
+               TH1F                                                    **fHistoNegPionPt;                                                      //
+               TH1F                                                    **fHistoPosPionPt;                                                      //
+               TH1F                                                    **fHistoNegPionPhi;                                                     //
+               TH1F                                                    **fHistoPosPionPhi;                                                     //
+               TH1F                                                    **fHistoNegPionEta;                                                     //
+               TH1F                                                    **fHistoPosPionEta;                                                     //
+               TH2F                                                    **fHistoNegPionClsTPC;                                          //
+               TH2F                                                    **fHistoPosPionClsTPC;                                          //
+               TH2F                                                    **fHistoPionDCAxy;                                                      //
+               TH2F                                                    **fHistoPionDCAz;                                                       //
+               TH2F                                                    **fHistoPionTPCdEdxNSigma;                                      //
+               TH2F                                                    **fHistoPionTPCdEdx;                                            //
+               TH2F                                                    **fHistoPionPionInvMassPt;                                      //
+               TH2F                                                    **fHistoMotherInvMassPt;                                        //
+               THnSparseF                                              **fTHnSparseMotherInvMassPtZM;                          //
+               TH2F                                                    **fHistoMotherBackInvMassPt;                            //
+               THnSparseF                                              **fTHnSparseMotherBackInvMassPtZM;                      //
                
                // pure MC properties
-               TH1F **fHistoMCAllGammaPt;
-               TH1F **fHistoMCConvGammaPt;
-               TH1F **fHistoMCAllPosPionsPt;
-               TH1F **fHistoMCAllNegPionsPt;
-               TH1F **fHistoMCGammaFromEtaPt;
-               TH1F **fHistoMCPosPionsFromEtaPt;
-               TH1F **fHistoMCNegPionsFromEtaPt;
-               TH1F **fHistoMCEtaPiPlPiMiGammaPt;
-               TH1F **fHistoMCEtaGGPt;
-               TH1F **fHistoMCEtaDalitzPt;
-               TH1F **fHistoMCEtaPiPlPiMiGammaInAccPt;
-               
+               TH1F                                                    **fHistoMCAllGammaPt;                                           //
+               TH1F                                                    **fHistoMCConvGammaPt;                                          //
+               TH1F                                                    **fHistoMCAllPosPionsPt;                                        //
+               TH1F                                                    **fHistoMCAllNegPionsPt;                                        //
+               TH1F                                                    **fHistoMCGammaFromEtaPt;                                       //
+               TH1F                                                    **fHistoMCPosPionsFromEtaPt;                            //
+               TH1F                                                    **fHistoMCNegPionsFromEtaPt;                            //
+               TH1F                                                    **fHistoMCEtaPiPlPiMiGammaPt;                           //
+               TH1F                                                    **fHistoMCEtaGGPt;                                                      //
+               TH1F                                                    **fHistoMCEtaDalitzPt;                                          //
+               TH1F                                                    **fHistoMCEtaPiPlPiMiGammaInAccPt;                      //
+
                // reconstructed particles MC validated
-               TH2F **fHistoTrueMotherPiPlPiMiGammaInvMassPt;
-               TH2F **fHistoTrueMotherGammaGammaInvMassPt;
-               TH2F **fHistoTrueMotherDalitzInvMassPt;
-               TH1F **fHistoTrueConvGammaPt;
-               TH1F **fHistoTrueConvGammaFromEtaPt;
-               TH1F **fHistoTruePosPionPt;
-               TH1F **fHistoTruePosPionFromEtaPt;
-               TH1F **fHistoTrueNegPionPt;
-               TH1F **fHistoTrueNegPionFromEtaPt;
-               TH2F **fHistoTruePionPionInvMassPt;
-               TH2F **fHistoTruePionPionFromEtaInvMassPt;
+               TH2F                                                    **fHistoTrueMotherPiPlPiMiGammaInvMassPt;       //
+               TH2F                                                    **fHistoTrueMotherGammaGammaInvMassPt;          //
+               TH2F                                                    **fHistoTrueMotherDalitzInvMassPt;                      //
+               TH1F                                                    **fHistoTrueConvGammaPt;                                        //
+               TH1F                                                    **fHistoTrueConvGammaFromEtaPt;                         //
+               TH1F                                                    **fHistoTruePosPionPt;                                          //
+               TH1F                                                    **fHistoTruePosPionFromEtaPt;                           //
+               TH1F                                                    **fHistoTrueNegPionPt;                                          //
+               TH1F                                                    **fHistoTrueNegPionFromEtaPt;                           //
+               TH2F                                                    **fHistoTruePionPionInvMassPt;                          //
+               TH2F                                                    **fHistoTruePionPionFromEtaInvMassPt;           //
                // Event properties
-               TH1I **fHistoNEvents;
-               TH1I **fHistoNGoodESDTracks;
-               TProfile **fProfileEtaShift;
+               TH1I                                                    **fHistoNEvents;                                                        //
+               TH1I                                                    **fHistoNGoodESDTracks;                                         //
+               TProfile                                                **fProfileEtaShift;                                                     //
                        
-               TRandom3 fRandom;
-               Int_t fnCuts;
-               Int_t fiCut;
-               Int_t fNumberOfESDTracks;
-               Bool_t fMoveParticleAccordingToVertex;
-               Bool_t fIsHeavyIon;
-               Bool_t fDoMesonAnalysis;
-               Bool_t fDoMesonQA;
-               Bool_t fIsFromMBHeader;
-               Bool_t fIsMC;
-               Bool_t fIsGammaEtaCand;
+               TRandom3                                                fRandom;
+               Int_t                                                   fnCuts;
+               Int_t                                                   fiCut;
+               Int_t                                                   fNumberOfESDTracks;
+               Bool_t                                                  fMoveParticleAccordingToVertex;
+               Bool_t                                                  fIsHeavyIon;
+               Bool_t                                                  fDoMesonAnalysis;
+               Bool_t                                                  fDoMesonQA;
+               Bool_t                                                  fIsFromMBHeader;
+               Bool_t                                                  fIsMC;
+               Bool_t                                                  fIsGammaEtaCand;
        private:
                AliAnalysisTaskEtaToPiPlPiMiGamma( const AliAnalysisTaskEtaToPiPlPiMiGamma& ); // Not implemented
                AliAnalysisTaskEtaToPiPlPiMiGamma& operator=( const AliAnalysisTaskEtaToPiPlPiMiGamma& ); // Not implemented
 
-               ClassDef( AliAnalysisTaskEtaToPiPlPiMiGamma, 1 );
+               ClassDef( AliAnalysisTaskEtaToPiPlPiMiGamma, 2 );
 };
 
-#endif // ALIANALYSISTASKHEAVYMESONTHREEBODY_H
+#endif // ALIANALYSISTASKETATOPIPLPIMIGAMMA_H
 
index b47a9a8..c74127b 100644 (file)
@@ -83,6 +83,8 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(): AliAnalysisTaskSE(
        fReaderGammas(NULL),
        fGammaCandidates(NULL),
        fClusterCandidates(NULL),
+       fEventCutArray(NULL),
+       fEventCuts(NULL),
        fCutArray(NULL),
        fConversionCuts(NULL),
        fClusterCutArray(NULL),
@@ -245,6 +247,8 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(const char *name):
        fReaderGammas(NULL),
        fGammaCandidates(NULL),
        fClusterCandidates(NULL),
+       fEventCutArray(NULL),
+       fEventCuts(NULL),
        fCutArray(NULL),
        fConversionCuts(NULL),
        fClusterCutArray(NULL),
@@ -429,13 +433,14 @@ void AliAnalysisTaskGammaConvCalo::InitBack(){
        
        for(Int_t iCut = 0; iCut<fnCuts;iCut++){
                if (((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){
-                       TString cutstring = ((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber();
-                       TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
-                       TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringEvent  = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringPhoton = ((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringCalo   = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringMeson  = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
                        
-                       Int_t collisionSystem = atoi((TString)(((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber())(0,1));
-                       Int_t centMin = atoi((TString)(((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber())(1,1));
-                       Int_t centMax = atoi((TString)(((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber())(2,1));
+                       Int_t collisionSystem = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(0,1));
+                       Int_t centMin = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(1,1));
+                       Int_t centMax = atoi((TString)(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber())(2,1));
                        
                        if(collisionSystem == 1 || collisionSystem == 2 ||
                                collisionSystem == 5 || collisionSystem == 8 ||
@@ -452,7 +457,7 @@ void AliAnalysisTaskGammaConvCalo::InitBack(){
                        }
                        
                        fBackList[iCut] = new TList();
-                       fBackList[iCut]->SetName(Form("%s_%s_%s Back histograms",cutstring.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
+                       fBackList[iCut]->SetName(Form("%s_%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
                        fBackList[iCut]->SetOwner(kTRUE);
                        fCutFolder[iCut]->Add(fBackList[iCut]);
                        
@@ -460,7 +465,7 @@ void AliAnalysisTaskGammaConvCalo::InitBack(){
                        fBackList[iCut]->Add(fSparseMotherBackInvMassPtZM[iCut]);
                        
                        fMotherList[iCut] = new TList();
-                       fMotherList[iCut]->SetName(Form("%s_%s_%s Mother histograms",cutstring.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
+                       fMotherList[iCut]->SetName(Form("%s_%s_%s_%s Mother histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
                        fMotherList[iCut]->SetOwner(kTRUE);
                        fCutFolder[iCut]->Add(fMotherList[iCut]);
                        
@@ -479,11 +484,11 @@ void AliAnalysisTaskGammaConvCalo::InitBack(){
                                fBGHandlerRP[iCut] = NULL;
                        } else{
                                fBGHandlerRP[iCut] = new AliConversionAODBGHandlerRP(
-                                                                                                                                       ((AliConversionCuts*)fCutArray->At(fiCut))->IsHeavyIon(),
+                                                                                                                                       ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsHeavyIon(),
                                                                                                                                        ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity(),
                                                                                                                                        ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents());
                                fBGClusHandlerRP[iCut] = new AliConversionAODBGHandlerRP(
-                                                                                                                                       ((AliConversionCuts*)fCutArray->At(fiCut))->IsHeavyIon(),
+                                                                                                                                       ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsHeavyIon(),
                                                                                                                                        ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity(),
                                                                                                                                        ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents());
                                fBGHandler[iCut] = NULL;
@@ -558,18 +563,18 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
        fHistoClusGammaPt = new TH1F*[fnCuts];
        
        for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-
-               TString cutstring = ((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber();
-               TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
-               TString cutstringMeson = "NoMesonCut";
+               TString cutstringEvent  = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
+               TString cutstringPhoton = ((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutNumber();
+               TString cutstringCalo   = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
+               TString cutstringMeson  = "NoMesonCut";
                if(fDoMesonAnalysis)cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
     
                fCutFolder[iCut] = new TList();
-               fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s",cutstring.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
+               fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s_%s",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
                fCutFolder[iCut]->SetOwner(kTRUE);
                fOutputContainer->Add(fCutFolder[iCut]);
                fESDList[iCut] = new TList();
-               fESDList[iCut]->SetName(Form("%s_%s_%s ESD histograms",cutstring.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
+               fESDList[iCut]->SetName(Form("%s_%s_%s_%s ESD histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
                fESDList[iCut]->SetOwner(kTRUE);
                fCutFolder[iCut]->Add(fESDList[iCut]);
     
@@ -577,9 +582,9 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
                fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
                fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Missing MC");
-               if (((AliConversionCuts*)fCutArray->At(iCut))->IsSpecialTrigger() == 4 ){
+               if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() == 4 ){
                        TString TriggerNames = "Not Trigger: ";
-                       TriggerNames = TriggerNames+ ( (AliConversionCuts*)fCutArray->At(iCut))->GetSpecialTriggerName();
+                       TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
                        fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
                } else {
                        fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
@@ -616,7 +621,7 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
     
                if (fDoPhotonQA == 2){
                        fPhotonDCAList[iCut] = new TList();
-                       fPhotonDCAList[iCut]->SetName(Form("%s_%s_%s Photon DCA tree",cutstring.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
+                       fPhotonDCAList[iCut]->SetName(Form("%s_%s_%s_%s Photon DCA tree",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
                        fPhotonDCAList[iCut]->SetOwner(kTRUE);
                        fCutFolder[iCut]->Add(fPhotonDCAList[iCut]);
       
@@ -641,7 +646,7 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                }
 
                fTagOutputList[iCut] = new TList();
-               fTagOutputList[iCut]->SetName(Form("%s_%s_%s Tagging Output",cutstring.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
+               fTagOutputList[iCut]->SetName(Form("%s_%s_%s_%s Tagging Output",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
                fTagOutputList[iCut]->SetOwner(1);
                fCutFolder[iCut]->Add(fTagOutputList[iCut]);
                
@@ -696,7 +701,7 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                        fESDList[iCut]->Add(fHistoMotherInvMassEalpha[iCut]);
                        if (fDoMesonQA == 2){
                                fMesonDCAList[iCut] = new TList();
-                               fMesonDCAList[iCut]->SetName(Form("%s_%s_%s Meson DCA tree",cutstring.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
+                               fMesonDCAList[iCut]->SetName(Form("%s_%s_%s_%s Meson DCA tree",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
                                fMesonDCAList[iCut]->SetOwner(kTRUE);
                                fCutFolder[iCut]->Add(fMesonDCAList[iCut]);
                                
@@ -824,13 +829,14 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
     
     
                for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-                       TString cutstring = ((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber();
-                       TString cutstringCalo = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
-                       TString cutstringMeson = "NoMesonCut";
+                       TString cutstringEvent  = ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringPhoton = ((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringCalo   = ((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringMeson  = "NoMesonCut";
                        if(fDoMesonAnalysis)cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
       
                        fMCList[iCut] = new TList();
-                       fMCList[iCut]->SetName(Form("%s_%s_%s MC histograms",cutstring.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
+                       fMCList[iCut]->SetName(Form("%s_%s_%s_%s MC histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
                        fMCList[iCut]->SetOwner(kTRUE);
                        fCutFolder[iCut]->Add(fMCList[iCut]);
                        fHistoMCHeaders[iCut] = new TH1I("MC_Headers","MC_Headers",20,0,20);
@@ -915,7 +921,7 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
         
                        }
                        fTrueList[iCut] = new TList();
-                       fTrueList[iCut]->SetName(Form("%s_%s_%s True histograms",cutstring.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
+                       fTrueList[iCut]->SetName(Form("%s_%s_%s_%s True histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
                        fTrueList[iCut]->SetOwner(kTRUE);
                        fCutFolder[iCut]->Add(fTrueList[iCut]);
       
@@ -1045,14 +1051,23 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
        if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader
   
        if(fV0Reader)
-               if((AliConversionCuts*)fV0Reader->GetConversionCuts())
-                       if(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms())
-                               fOutputContainer->Add(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms());
-  
+               if((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())
+                       if(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms())
+                               fOutputContainer->Add(((AliConversionPhotonCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms());
+       if(fV0Reader)
+               if((AliConvEventCuts*)fV0Reader->GetEventCuts())
+                       if(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms())
+                               fOutputContainer->Add(((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetCutHistograms());
+
+                       
        for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-               if(!((AliConversionCuts*)fCutArray->At(iCut))) continue;
-               if(((AliConversionCuts*)fCutArray->At(iCut))->GetCutHistograms()){
-                       fCutFolder[iCut]->Add(((AliConversionCuts*)fCutArray->At(iCut))->GetCutHistograms());
+               if(!((AliConvEventCuts*)fEventCutArray->At(iCut))) continue;
+               if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms()){
+                       fCutFolder[iCut]->Add(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutHistograms());
+               }
+               if(!((AliConversionPhotonCuts*)fCutArray->At(iCut))) continue;
+               if(((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutHistograms()){
+                       fCutFolder[iCut]->Add(((AliConversionPhotonCuts*)fCutArray->At(iCut))->GetCutHistograms());
                }
                if(!((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))) continue;
                if(((AliCaloPhotonCuts*)fClusterCutArray->At(iCut))->GetCutHistograms()){
@@ -1071,21 +1086,21 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
 Bool_t AliAnalysisTaskGammaConvCalo::Notify()
 {
        for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-               if(!((AliConversionCuts*)fCutArray->At(iCut))->GetDoEtaShift()){
-                       fProfileEtaShift[iCut]->Fill(0.,(((AliConversionCuts*)fCutArray->At(iCut))->GetEtaShift()));
+               if(!((AliConvEventCuts*)fEventCutArray->At(iCut))->GetDoEtaShift()){
+                       fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
                        continue; // No Eta Shift requested, continue
                }
-               if(((AliConversionCuts*)fCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
-                       ((AliConversionCuts*)fCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName());
-                       fProfileEtaShift[iCut]->Fill(0.,(((AliConversionCuts*)fCutArray->At(iCut))->GetEtaShift()));
-                       ((AliConversionCuts*)fCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
+               if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
+                       ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName());
+                       fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
+                       ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
                        continue;
                }
                else{
                        printf(" Gamma Conversion Task %s :: Eta Shift Manually Set to %f \n\n",
-                                       (((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber()).Data(),((AliConversionCuts*)fCutArray->At(iCut))->GetEtaShift());
-                       fProfileEtaShift[iCut]->Fill(0.,(((AliConversionCuts*)fCutArray->At(iCut))->GetEtaShift()));
-                       ((AliConversionCuts*)fCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
+                                       (((AliConvEventCuts*)fEventCutArray->At(iCut))->GetCutNumber()).Data(),((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift());
+                       fProfileEtaShift[iCut]->Fill(0.,(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetEtaShift()));
+                       ((AliConvEventCuts*)fEventCutArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once
                }
        }
        
@@ -1097,7 +1112,7 @@ void AliAnalysisTaskGammaConvCalo::UserExec(Option_t *)
        //
        // Called for each event
        //
-       Int_t eventQuality = ((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEventQuality();
+       Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality();
        if(eventQuality == 2 || eventQuality == 3){// Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1
                for(Int_t iCut = 0; iCut<fnCuts; iCut++){
                fHistoNEvents[iCut]->Fill(eventQuality);
@@ -1132,7 +1147,7 @@ void AliAnalysisTaskGammaConvCalo::UserExec(Option_t *)
        for(Int_t iCut = 0; iCut<fnCuts; iCut++){
                
                fiCut = iCut;
-               Int_t eventNotAccepted = ((AliConversionCuts*)fCutArray->At(iCut))->IsEventAcceptedByConversionCut(fV0Reader->GetConversionCuts(),fInputEvent,fMCEvent,fIsHeavyIon);
+               Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon);
                
                if(eventNotAccepted){
                // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
@@ -1148,30 +1163,30 @@ void AliAnalysisTaskGammaConvCalo::UserExec(Option_t *)
 
                fHistoNEvents[iCut]->Fill(eventQuality); // Should be 0 here
                fHistoNGoodESDTracks[iCut]->Fill(fV0Reader->GetNumberOfPrimaryTracks());
-               if(((AliConversionCuts*)fCutArray->At(iCut))->IsHeavyIon() == 2)        fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A());
+               if(((AliConvEventCuts*)fEventCutArray->At(iCut))->IsHeavyIon() == 2)    fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A());
                        else fHistoNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C());
 
                if(fIsMC){
                        // Process MC Particle
-                       if(((AliConversionCuts*)fCutArray->At(iCut))->GetSignalRejection() != 0){
+                       if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection() != 0){
                                if(fInputEvent->IsA()==AliESDEvent::Class()){
-                               ((AliConversionCuts*)fCutArray->At(iCut))->GetNotRejectedParticles(((AliConversionCuts*)fCutArray->At(iCut))->GetSignalRejection(),
-                                                                                                                                                                       ((AliConversionCuts*)fCutArray->At(iCut))->GetAcceptedHeader(),
+                               ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
+                                                                                                                                                                       ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
                                                                                                                                                                        fMCEvent);
                                }
                                else if(fInputEvent->IsA()==AliAODEvent::Class()){
-                               ((AliConversionCuts*)fCutArray->At(iCut))->GetNotRejectedParticles(((AliConversionCuts*)fCutArray->At(iCut))->GetSignalRejection(),
-                                                                                                                                                                       ((AliConversionCuts*)fCutArray->At(iCut))->GetAcceptedHeader(),
+                               ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetNotRejectedParticles(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetSignalRejection(),
+                                                                                                                                                                       ((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader(),
                                                                                                                                                                        fInputEvent);
                                }
 
-                               if(((AliConversionCuts*)fCutArray->At(iCut))->GetAcceptedHeader()){
-                                       for(Int_t i = 0;i<(((AliConversionCuts*)fCutArray->At(iCut))->GetAcceptedHeader())->GetEntries();i++){
+                               if(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader()){
+                                       for(Int_t i = 0;i<(((AliConvEventCuts*)fEventCutArray->At(iCut))->GetAcceptedHeader())->GetEntries();i++){
                                                TString nameBin= fHistoMCHeaders[iCut]->GetXaxis()->GetBinLabel(i+1);
                                                if (nameBin.CompareTo("")== 0){
-                                               TString nameHeader = ((TObjString*)((TList*)((AliConversionCuts*)fCutArray->At(iCut))
-                                                                                                                       ->GetAcceptedHeader())->At(i))->GetString();
-                                               fHistoMCHeaders[iCut]->GetXaxis()->SetBinLabel(i+1,nameHeader.Data());
+                                                       TString nameHeader = ((TObjString*)((TList*)((AliConvEventCuts*)fEventCutArray->At(iCut))
+                                                                                                                               ->GetAcceptedHeader())->At(i))->GetString();
+                                                       fHistoMCHeaders[iCut]->GetXaxis()->SetBinLabel(i+1,nameHeader.Data());
                                                }
                                        }
                                }
@@ -1292,12 +1307,12 @@ void AliAnalysisTaskGammaConvCalo::ProcessClusters()
        //    fIsFromMBHeader = kTRUE;
        //    if(fIsMC){
        //      Int_t isPosFromMBHeader
-       //      = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(mclab, fMCStack, fInputEvent);
-       //      if(isPosFromMBHeader == 0 && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
+       //      = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(mclab, fMCStack, fInputEvent);
+       //      if(isPosFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
        // 
        //      Int_t isNegFromMBHeader
-       //      = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(mclab, fMCStack, fInputEvent);
-       //      if(isNegFromMBHeader == 0 && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
+       //      = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(mclab, fMCStack, fInputEvent);
+       //      if(isNegFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
        //      
        //      if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE;
        //    }
@@ -1334,7 +1349,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessClusters()
        //        fTreeConvGammaPtDcazCat[fiCut]->Fill();
        //      }
        //    }
-               
+               delete tmpvec;
        }
        
 }
@@ -1364,8 +1379,8 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueClusterCandidates(AliAODConversion
        if(Photon->GetMother(0) <= fMCStack->GetNprimary()){
                // Count just primary MC Gammas as true --> For Ratio esdtruegamma / mcconvgamma
                if(fIsFromMBHeader){
-               fHistoTruePrimaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
-               fHistoTruePrimaryClusGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt()); // Allways Filled
+                       fHistoTruePrimaryClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+                       fHistoTruePrimaryClusGammaESDPtMCPt[fiCut]->Fill(TruePhotonCandidate->Pt(),Photon->Pt()); // Allways Filled
                }
        }
 
@@ -1390,6 +1405,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueClusterCandidates(AliAODConversion
        //      }
        //    }
        //  }
+       
 }
 
 
@@ -1404,21 +1420,18 @@ void AliAnalysisTaskGammaConvCalo::ProcessPhotonCandidates()
                AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) fReaderGammas->At(i);
                if(!PhotonCandidate) continue;
                fIsFromMBHeader = kTRUE;
-               if(fIsMC && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 0){
-                       Int_t isPosFromMBHeader
-                       = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent);
-                       if(isPosFromMBHeader == 0 && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
-                       Int_t isNegFromMBHeader
-                       = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack, fInputEvent);
-                       if(isNegFromMBHeader == 0 && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
-                       
+               if(fIsMC && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
+                       Int_t isPosFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent);
+                       if(isPosFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
+                       Int_t isNegFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack, fInputEvent);
+                       if(isNegFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
                        if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE;
                }
                
-               if(!((AliConversionCuts*)fCutArray->At(fiCut))->PhotonIsSelected(PhotonCandidate,fInputEvent)) continue;
-               if(!((AliConversionCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(PhotonCandidate->GetPhotonPhi(),fEventPlaneAngle)) continue;
-               if(!((AliConversionCuts*)fCutArray->At(fiCut))->UseElecSharingCut() &&
-               !((AliConversionCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){
+               if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelected(PhotonCandidate,fInputEvent)) continue;
+               if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(PhotonCandidate->GetPhotonPhi(),fEventPlaneAngle)) continue;
+               if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut() &&
+               !((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){
                        fGammaCandidates->Add(PhotonCandidate); // if no second loop is required add to events good gammas
                        
                        if(fIsFromMBHeader){
@@ -1436,44 +1449,42 @@ void AliAnalysisTaskGammaConvCalo::ProcessPhotonCandidates()
                        }
                        if (fIsFromMBHeader && fDoPhotonQA == 2){
                                if (fIsHeavyIon == 1 && PhotonCandidate->Pt() > 0.399 && PhotonCandidate->Pt() < 12.){
-                               fPtGamma = PhotonCandidate->Pt();
-                               fDCAzPhoton = PhotonCandidate->GetDCAzToPrimVtx();
-                               fRConvPhoton = PhotonCandidate->GetConversionRadius();
-                               fEtaPhoton = PhotonCandidate->GetPhotonEta();
-                               fCharCatPhoton = PhotonCandidate->GetPhotonQuality();
-                               fTreeConvGammaPtDcazCat[fiCut]->Fill();
+                                       fPtGamma = PhotonCandidate->Pt();
+                                       fDCAzPhoton = PhotonCandidate->GetDCAzToPrimVtx();
+                                       fRConvPhoton = PhotonCandidate->GetConversionRadius();
+                                       fEtaPhoton = PhotonCandidate->GetPhotonEta();
+                                       fCharCatPhoton = PhotonCandidate->GetPhotonQuality();
+                                       fTreeConvGammaPtDcazCat[fiCut]->Fill();
                                } else if ( PhotonCandidate->Pt() > 0.299 && PhotonCandidate->Pt() < 16.){
-                               fPtGamma = PhotonCandidate->Pt();
-                               fDCAzPhoton = PhotonCandidate->GetDCAzToPrimVtx();
-                               fRConvPhoton = PhotonCandidate->GetConversionRadius();
-                               fEtaPhoton = PhotonCandidate->GetPhotonEta();
-                               fCharCatPhoton = PhotonCandidate->GetPhotonQuality();
-                               fTreeConvGammaPtDcazCat[fiCut]->Fill();
+                                       fPtGamma = PhotonCandidate->Pt();
+                                       fDCAzPhoton = PhotonCandidate->GetDCAzToPrimVtx();
+                                       fRConvPhoton = PhotonCandidate->GetConversionRadius();
+                                       fEtaPhoton = PhotonCandidate->GetPhotonEta();
+                                       fCharCatPhoton = PhotonCandidate->GetPhotonQuality();
+                                       fTreeConvGammaPtDcazCat[fiCut]->Fill();
                                }
                        }
-               } else if(((AliConversionCuts*)fCutArray->At(fiCut))->UseElecSharingCut()){ // if Shared Electron cut is enabled, Fill array, add to step one
-                       ((AliConversionCuts*)fCutArray->At(fiCut))->FillElectonLabelArray(PhotonCandidate,nV0);
+               } else if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut()){ // if Shared Electron cut is enabled, Fill array, add to step one
+                       ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->FillElectonLabelArray(PhotonCandidate,nV0);
                        nV0++;
                        GammaCandidatesStepOne->Add(PhotonCandidate);
-               } else if(!((AliConversionCuts*)fCutArray->At(fiCut))->UseElecSharingCut() &&
-                               ((AliConversionCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){ // shared electron is disabled, step one not needed -> step two
+               } else if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut() &&
+                               ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){ // shared electron is disabled, step one not needed -> step two
                        GammaCandidatesStepTwo->Add(PhotonCandidate);
                }
        }
-       if(((AliConversionCuts*)fCutArray->At(fiCut))->UseElecSharingCut()){
+       if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseElecSharingCut()){
                for(Int_t i = 0;i<GammaCandidatesStepOne->GetEntries();i++){
                        AliAODConversionPhoton *PhotonCandidate= (AliAODConversionPhoton*) GammaCandidatesStepOne->At(i);
                        if(!PhotonCandidate) continue;
                        fIsFromMBHeader = kTRUE;
-                       if(fMCStack && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 0){
-                               Int_t isPosFromMBHeader
-                               = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent);
-                               Int_t isNegFromMBHeader
-                               = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack, fInputEvent);
+                       if(fMCStack && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
+                               Int_t isPosFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent);
+                               Int_t isNegFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack, fInputEvent);
                                if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE;
                        }
-                       if(!((AliConversionCuts*)fCutArray->At(fiCut))->RejectSharedElectronV0s(PhotonCandidate,i,GammaCandidatesStepOne->GetEntries())) continue;
-                       if(!((AliConversionCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){ // To Colse v0s cut diabled, step two not needed
+                       if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->RejectSharedElectronV0s(PhotonCandidate,i,GammaCandidatesStepOne->GetEntries())) continue;
+                       if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){ // To Colse v0s cut diabled, step two not needed
                                fGammaCandidates->Add(PhotonCandidate);
                                if(fIsFromMBHeader){
                                        fHistoConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt());
@@ -1509,19 +1520,17 @@ void AliAnalysisTaskGammaConvCalo::ProcessPhotonCandidates()
                        }
                }
        }
-       if(((AliConversionCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){
+       if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->UseToCloseV0sCut()){
                for(Int_t i = 0;i<GammaCandidatesStepTwo->GetEntries();i++){
                        AliAODConversionPhoton* PhotonCandidate = (AliAODConversionPhoton*) GammaCandidatesStepTwo->At(i);
                        if(!PhotonCandidate) continue;
                        fIsFromMBHeader = kTRUE;
-                       if(fMCStack && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 0){
-                               Int_t isPosFromMBHeader
-                               = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent);
-                               Int_t isNegFromMBHeader
-                               = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack, fInputEvent);
+                       if(fMCStack && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
+                               Int_t isPosFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelPositive(), fMCStack, fInputEvent);
+                               Int_t isNegFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(PhotonCandidate->GetMCLabelNegative(), fMCStack, fInputEvent);
                                if( (isNegFromMBHeader+isPosFromMBHeader) != 4) fIsFromMBHeader = kFALSE;
                        }
-                       if(!((AliConversionCuts*)fCutArray->At(fiCut))->RejectToCloseV0s(PhotonCandidate,GammaCandidatesStepTwo,i)) continue;
+                       if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->RejectToCloseV0s(PhotonCandidate,GammaCandidatesStepTwo,i)) continue;
                        fGammaCandidates->Add(PhotonCandidate); // Add gamma to current cut TList
                        if(fIsFromMBHeader){
                                fHistoConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt());
@@ -1603,8 +1612,8 @@ void AliAnalysisTaskGammaConvCalo::ProcessTruePhotonCandidatesAOD(AliAODConversi
        }
        
        AliAODMCParticle *Photon = (AliAODMCParticle*) AODMCTrackArray->At(posDaughter->GetMother());
-       AliVTrack * electronCandidate = ((AliConversionCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelNegative() );
-       AliVTrack * positronCandidate = ((AliConversionCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelPositive() );
+       AliVTrack * electronCandidate = ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelNegative() );
+       AliVTrack * positronCandidate = ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelPositive() );
        Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
        
        if(Photon->GetPdgCode() != 22){
@@ -1691,8 +1700,8 @@ void AliAnalysisTaskGammaConvCalo::ProcessTruePhotonCandidates(AliAODConversionP
        if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode()) return; // Same Charge
        
        TParticle *Photon = TruePhotonCandidate->GetMCParticle(fMCStack);
-       AliVTrack * electronCandidate = ((AliConversionCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelNegative() );
-       AliVTrack * positronCandidate = ((AliConversionCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelPositive() );
+       AliVTrack * electronCandidate = ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelNegative() );
+       AliVTrack * positronCandidate = ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetTrack(fInputEvent,TruePhotonCandidate->GetTrackLabelPositive() );
        Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
        
        if(Photon->GetPdgCode() != 22){
@@ -1702,8 +1711,6 @@ void AliAnalysisTaskGammaConvCalo::ProcessTruePhotonCandidates(AliAODConversionP
        
        if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5) return;// check if the daughters come from a conversion
        
-       
-       
        // True Photon
        if(fIsFromMBHeader){
                fHistoTrueConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
@@ -1764,14 +1771,13 @@ void AliAnalysisTaskGammaConvCalo::ProcessAODMCParticles()
                if (!particle->IsPrimary()) continue;
                
                Int_t isMCFromMBHeader = -1;
-               if(((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 0){
-                       isMCFromMBHeader
-                       = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent);
-                       if(isMCFromMBHeader == 0 && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
+               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
+                       isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent);
+                       if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
                }
                
-               if(!((AliConversionCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(particle->Phi(),fEventPlaneAngle,kFALSE)) continue;
-               if(((AliConversionCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(particle,AODMCTrackArray,kFALSE)){
+               if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(particle->Phi(),fEventPlaneAngle,kFALSE)) continue;
+               if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(particle,AODMCTrackArray,kFALSE)){
                        fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma
                                if(particle->GetMother() >-1){ // Meson Decay Gamma
                                        switch((static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother())))->GetPdgCode()){
@@ -1799,7 +1805,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessAODMCParticles()
                                        }
                                }
                        }
-                       if(((AliConversionCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(particle,AODMCTrackArray,kTRUE)){
+                       if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(particle,AODMCTrackArray,kTRUE)){
                                Double_t rConv = 0;
                                for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
                                        AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(daughterIndex));
@@ -1819,14 +1825,14 @@ void AliAnalysisTaskGammaConvCalo::ProcessAODMCParticles()
                        if(particle->GetPdgCode() == 310 && fDoMesonQA > 0){
                                Double_t mesonY = 10.;
                                if(particle->E() - particle->Pz() == 0 || particle->E() + particle->Pz() == 0){
-                                       mesonY=10.-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift();
+                                       mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
                                } else {
-                                       mesonY = 0.5*(TMath::Log((particle->E()+particle->Pz()) / (particle->E()-particle->Pz())))-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift();
+                                       mesonY = 0.5*(TMath::Log((particle->E()+particle->Pz()) / (particle->E()-particle->Pz())))-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
                                }
                                Float_t weightedK0s= 1;
-                               if(((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
+                               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
                                        if (particle->Pt()>0.005){
-                                               weightedK0s= ((AliConversionCuts*)fCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, 0x0, fInputEvent);
+                                               weightedK0s= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, 0x0, fInputEvent);
                                                //cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
                                        }
                                }
@@ -1835,13 +1841,13 @@ void AliAnalysisTaskGammaConvCalo::ProcessAODMCParticles()
                                fHistoMCK0sPtY[fiCut]->Fill(particle->Pt(),mesonY,weightedK0s);
                        }
                        if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))
-                               ->MesonIsSelectedAODMC(particle,AODMCTrackArray,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift())){
+                               ->MesonIsSelectedAODMC(particle,AODMCTrackArray,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
                                AliAODMCParticle* daughter0 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetDaughter(0)));
                                AliAODMCParticle* daughter1 = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetDaughter(1)));
                                Float_t weighted= 1;
-                               if(((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
+                               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
                                        if (particle->Pt()>0.005){
-                                               weighted= ((AliConversionCuts*)fCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, 0x0, fInputEvent);
+                                               weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, 0x0, fInputEvent);
                                                //                   if(particle->GetPdgCode() == 221){
                                                //                      cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
                                                //                   }
@@ -1849,9 +1855,9 @@ void AliAnalysisTaskGammaConvCalo::ProcessAODMCParticles()
                                }
                                Double_t mesonY = 10.;
                                if(particle->E() - particle->Pz() == 0 || particle->E() + particle->Pz() == 0){
-                                       mesonY=10.-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift();
+                                       mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
                                } else{
-                                       mesonY = 0.5*(TMath::Log((particle->E()+particle->Pz()) / (particle->E()-particle->Pz())))-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift();
+                                       mesonY = 0.5*(TMath::Log((particle->E()+particle->Pz()) / (particle->E()-particle->Pz())))-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
                                }
                                
                                if(particle->GetPdgCode() == 111){
@@ -1865,10 +1871,10 @@ void AliAnalysisTaskGammaConvCalo::ProcessAODMCParticles()
                                }
                                
                                // Check the acceptance for both gammas
-                               if(((AliConversionCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(daughter0,AODMCTrackArray,kFALSE) &&
-                               ((AliConversionCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(daughter1,AODMCTrackArray,kFALSE)  &&
-                               ((AliConversionCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter0->Phi(),fEventPlaneAngle,kFALSE) &&
-                               ((AliConversionCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter1->Phi(),fEventPlaneAngle,kFALSE)){
+                               if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(daughter0,AODMCTrackArray,kFALSE) &&
+                               ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(daughter1,AODMCTrackArray,kFALSE)  &&
+                               ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter0->Phi(),fEventPlaneAngle,kFALSE) &&
+                               ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter1->Phi(),fEventPlaneAngle,kFALSE)){
                                        
                                        if(particle->GetPdgCode() == 111){
                                                fHistoMCPi0InAccPt[fiCut]->Fill(particle->Pt(),weighted); // MC Pi0 with gamma in acc
@@ -1890,14 +1896,13 @@ void AliAnalysisTaskGammaConvCalo::ProcessMCParticles()
                if (!particle) continue;
                
                Int_t isMCFromMBHeader = -1;
-               if(((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 0){
-                       isMCFromMBHeader
-                       = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent);
-                       if(isMCFromMBHeader == 0 && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
+               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
+                       isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent);
+                       if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
                }
                
-               if(!((AliConversionCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(particle->Phi(),fEventPlaneAngle,kFALSE)) continue;
-               if(((AliConversionCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kFALSE)){
+               if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(particle->Phi(),fEventPlaneAngle,kFALSE)) continue;
+               if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kFALSE)){
                        fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma
                        if(particle->GetMother(0) >-1){ // Meson Decay Gamma
                                switch(fMCStack->Particle(particle->GetMother(0))->GetPdgCode()){
@@ -1925,7 +1930,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessMCParticles()
                                }
                        }
                }
-               if(((AliConversionCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kTRUE)){
+               if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kTRUE)){
                        fHistoMCConvGammaPt[fiCut]->Fill(particle->Pt());
                        if (fDoPhotonQA > 0){
                                fHistoMCConvGammaR[fiCut]->Fill(((TParticle*)fMCStack->Particle(particle->GetFirstDaughter()))->R());
@@ -1936,14 +1941,14 @@ void AliAnalysisTaskGammaConvCalo::ProcessMCParticles()
                        if(particle->GetPdgCode() == 310 && fDoMesonQA > 0){
                                Double_t mesonY = 10.;
                                if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){
-                                       mesonY=10.-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift();
+                                       mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
                                } else{
-                                       mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz())))-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift();
+                                       mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz())))-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
                                }
                                Float_t weightedK0s= 1;
-                               if(((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
+                               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
                                        if (particle->Pt()>0.005){
-                                               weightedK0s= ((AliConversionCuts*)fCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent);
+                                               weightedK0s= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent);
                                                //cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
                                        }
                                }
@@ -1954,14 +1959,14 @@ void AliAnalysisTaskGammaConvCalo::ProcessMCParticles()
                                }
                        }
                        if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))
-                               ->MesonIsSelectedMC(particle,fMCStack,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift())){
+                               ->MesonIsSelectedMC(particle,fMCStack,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
                                TParticle* daughter0 = (TParticle*)fMCStack->Particle(particle->GetFirstDaughter());
                                TParticle* daughter1 = (TParticle*)fMCStack->Particle(particle->GetLastDaughter());
                                
                                Float_t weighted= 1;
-                               if(((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
+                               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
                                        if (particle->Pt()>0.005){
-                                               weighted= ((AliConversionCuts*)fCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent);
+                                               weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent);
                                                //                   if(particle->GetPdgCode() == 221){
                                                //                      cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
                                                //                   }
@@ -1969,9 +1974,9 @@ void AliAnalysisTaskGammaConvCalo::ProcessMCParticles()
                                }
                                Double_t mesonY = 10.;
                                if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){
-                                       mesonY=10.-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift();
+                                       mesonY=10.-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
                                } else{
-                                       mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz())))-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift();
+                                       mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz())))-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
                                }
                                
                                if(particle->GetPdgCode() == 111){
@@ -1985,10 +1990,10 @@ void AliAnalysisTaskGammaConvCalo::ProcessMCParticles()
                                }
                                
                                // Check the acceptance for both gammas
-                               if(((AliConversionCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(daughter0,fMCStack,kFALSE) &&
-                               ((AliConversionCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(daughter1,fMCStack,kFALSE)  &&
-                               ((AliConversionCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter0->Phi(),fEventPlaneAngle,kFALSE) &&
-                               ((AliConversionCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter1->Phi(),fEventPlaneAngle,kFALSE)){
+                               if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(daughter0,fMCStack,kFALSE) &&
+                               ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(daughter1,fMCStack,kFALSE)  &&
+                               ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter0->Phi(),fEventPlaneAngle,kFALSE) &&
+                               ((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(daughter1->Phi(),fEventPlaneAngle,kFALSE)){
                                        
                                        if(particle->GetPdgCode() == 111){
                                                fHistoMCPi0InAccPt[fiCut]->Fill(particle->Pt(),weighted); // MC Pi0 with gamma in acc
@@ -2006,19 +2011,17 @@ void AliAnalysisTaskGammaConvCalo::ProcessMCParticles()
                        if (!particle) continue;
       
                        Int_t isMCFromMBHeader = -1;
-                       if(((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 0){
-                               isMCFromMBHeader
-        = ((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent);
-                               if(isMCFromMBHeader == 0 && ((AliConversionCuts*)fCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
+                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 0){
+                               isMCFromMBHeader = ((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent);
+                               if(isMCFromMBHeader == 0 && ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetSignalRejection() != 3) continue;
                        }
       
                        if(fDoMesonAnalysis){
-                               if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))
-           ->MesonIsSelectedMC(particle,fMCStack,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift())){
+                               if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMC(particle,fMCStack,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
                                        Float_t weighted= 1;
-                                       if(((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
                                                if (particle->Pt()>0.005){
-                                                       weighted= ((AliConversionCuts*)fCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent);
+                                                       weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent);
               //                   if(particle->GetPdgCode() == 221){
               //                      cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
               //                   }
@@ -2073,11 +2076,11 @@ void AliAnalysisTaskGammaConvCalo::PhotonTagging(){
                                
                                // see if pi0?
                                if((pairVector.M() > 0.11 && pairVector.M() < 0.15)){
-                               btagpi0 = 1;
+                                       btagpi0 = 1;    
                                }
                                // or eta
                                if((pairVector.M() > 0.50 && pairVector.M() < 0.6)){
-                               btageta = 1;
+                                       btageta = 1;
                                }
                        }// end loop over clusters
                        
@@ -2117,7 +2120,7 @@ void AliAnalysisTaskGammaConvCalo::CalculatePi0Candidates(){
                                AliAODConversionMother *pi0cand = new AliAODConversionMother(gamma0,gamma1);
                                pi0cand->SetLabels(firstGammaIndex,secondGammaIndex);
                                
-                               if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift()))){
+                               if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                        fHistoMotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt());
                                        
                                        // fill new histograms
@@ -2129,12 +2132,12 @@ void AliAnalysisTaskGammaConvCalo::CalculatePi0Candidates(){
                                        
                                        if (fDoMesonQA > 0){
                                                if ( pi0cand->M() > 0.05 && pi0cand->M() < 0.17){
-                                                       fHistoMotherPi0PtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift());
+                                                       fHistoMotherPi0PtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
                                                        fHistoMotherPi0PtAlpha[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetAlpha());
                                                        fHistoMotherPi0PtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle());      
                                                }
                                                if ( pi0cand->M() > 0.45 && pi0cand->M() < 0.65){
-                                                       fHistoMotherEtaPtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift());
+                                                       fHistoMotherEtaPtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
                                                        fHistoMotherEtaPtAlpha[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetAlpha());
                                                        fHistoMotherEtaPtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle());
                                                }
@@ -2284,13 +2287,13 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidates(AliAODConversionMo
                                if (fDoMesonQA > 0){
                                        if (isTruePi0){
                                                if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){
-                                                       fHistoTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift());
+                                                       fHistoTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
                                                        fHistoTruePi0PtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
                                                        fHistoTruePi0PtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
                                                }
                                        } else if (isTrueEta){
                                                if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){
-                                                       fHistoTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift());
+                                                       fHistoTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
                                                        fHistoTrueEtaPtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
                                                        fHistoTrueEtaPtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
                                                }
@@ -2299,8 +2302,8 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidates(AliAODConversionMo
                                if(gamma0MotherLabel >= MCStack->GetNprimary()){ // Secondary Meson
                                        Int_t secMotherLabel = ((TParticle*)MCStack->Particle(gamma1MotherLabel))->GetMother(0);
                                        Float_t weightedSec= 1;
-                                       if(((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, fMCStack, fInputEvent) && MCStack->Particle(secMotherLabel)->GetPdgCode()==310){
-                                               weightedSec= ((AliConversionCuts*)fCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, fMCStack, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, fMCStack, fInputEvent) && MCStack->Particle(secMotherLabel)->GetPdgCode()==310){
+                                               weightedSec= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, fMCStack, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt
                                                //cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
                                        }
                                        fHistoTrueSecondaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
@@ -2325,9 +2328,9 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidates(AliAODConversionMo
                                } else { // Only primary pi0 for efficiency calculation
                                        fCharMesonMCInfo = 6;
                                        Float_t weighted= 1;
-                                       if(((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, fMCStack, fInputEvent)){
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, fMCStack, fInputEvent)){
                                                if (((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt()>0.005){
-                                                       weighted= ((AliConversionCuts*)fCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, fMCStack, fInputEvent);
+                                                       weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, fMCStack, fInputEvent);
                                                        //                      cout << "rec \t " <<gamma1MotherLabel << "\t" <<  weighted << endl;
                                                }
                                        }
@@ -2466,13 +2469,13 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidatesAOD(AliAODConversio
                if (fDoMesonQA > 0){
                        if (isTruePi0){
                                if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){
-                               fHistoTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift());
+                               fHistoTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
                                fHistoTruePi0PtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
                                fHistoTruePi0PtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
                                }
                        } else if (isTrueEta){
                                if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){
-                               fHistoTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift());
+                               fHistoTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
                                fHistoTrueEtaPtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
                                fHistoTrueEtaPtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
                                }
@@ -2481,8 +2484,8 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidatesAOD(AliAODConversio
                if(!(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->IsPrimary())){ // Secondary Meson
                        Int_t secMotherLabel = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->GetMother();
                        Float_t weightedSec= 1;
-                       if(((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, 0x0, fInputEvent) && static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310){
-                               weightedSec= ((AliConversionCuts*)fCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, 0x0, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt
+                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, 0x0, fInputEvent) && static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310){
+                               weightedSec= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, 0x0, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt
                                //cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
                        }
                        fHistoTrueSecondaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
@@ -2507,9 +2510,9 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidatesAOD(AliAODConversio
                }else{ // Only primary pi0 for efficiency calculation
                        Float_t weighted= 1;
                        fCharMesonMCInfo = 6;
-                       if(((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, 0x0, fInputEvent)){
+                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, 0x0, fInputEvent)){
                                if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt()>0.005){
-                               weighted= ((AliConversionCuts*)fCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, 0x0, fInputEvent);
+                               weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, 0x0, fInputEvent);
                                //                      cout << "rec \t " <<gamma1MotherLabel << "\t" <<  weighted << endl;
                                }
                        }
@@ -2547,6 +2550,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidatesAOD(AliAODConversio
                }
        }
 }
+
 //________________________________________________________________________
 void AliAnalysisTaskGammaConvCalo::CalculateBackground(){
        
@@ -2574,14 +2578,14 @@ void AliAnalysisTaskGammaConvCalo::CalculateBackground(){
                                        if(fMoveParticleAccordingToVertex == kTRUE){
                                                MoveParticleAccordingToVertex(&previousGoodV0,bgEventVertex);
                                        }
-                                       if(((AliConversionCuts*)fCutArray->At(fiCut))->GetInPlaneOutOfPlaneCut() != 0){
+                                       if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetInPlaneOutOfPlaneCut() != 0){
                                                RotateParticleAccordingToEP(&previousGoodV0,bgEventVertex->fEP,fEventPlaneAngle);
                                        }
                                        
                                        AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&previousGoodV0);
                                        backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
                                        if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))
-                                               ->MesonIsSelected(backgroundCandidate,kFALSE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift()))){
+                                               ->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                                fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
                                                Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
                                                fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
@@ -2607,14 +2611,14 @@ void AliAnalysisTaskGammaConvCalo::CalculateBackground(){
                                                if(fMoveParticleAccordingToVertex == kTRUE){
                                                        MoveParticleAccordingToVertex(&previousGoodV0,bgEventVertex);
                                                }
-                                               if(((AliConversionCuts*)fCutArray->At(fiCut))->GetInPlaneOutOfPlaneCut() != 0){
+                                               if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->GetInPlaneOutOfPlaneCut() != 0){
                                                        RotateParticleAccordingToEP(&previousGoodV0,bgEventVertex->fEP,fEventPlaneAngle);
                                                }
                                        
                                        
                                                AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&previousGoodV0);
                                                backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
-                                               if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift()))){
+                                               if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                                        fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
                                                        Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
                                                        fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
@@ -2653,14 +2657,14 @@ void AliAnalysisTaskGammaConvCalo::CalculateBackgroundRP(){
                        for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fGammaCandidates->GetEntries();secondGammaIndex++){
                                AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fGammaCandidates->At(secondGammaIndex));
                                if (gamma1 == NULL) continue;
-                               if(!((AliConversionCuts*)fCutArray->At(fiCut))->PhotonIsSelected(gamma1,fInputEvent))continue;
+                               if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelected(gamma1,fInputEvent))continue;
                                for(Int_t nRandom=0;nRandom<((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetNumberOfBGEvents();nRandom++){
                                
                                        RotateParticle(gamma1);                                 
                                        AliAODConversionMother backgroundCandidate(gamma0,gamma1);
                                        backgroundCandidate.CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
                                        if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))
-                                               ->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift())){
+                                               ->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
                                                fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate.M(),backgroundCandidate.Pt());
                                                Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin};
                                                fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight);
@@ -2668,8 +2672,7 @@ void AliAnalysisTaskGammaConvCalo::CalculateBackgroundRP(){
                                }
                        }
                }
-       }
-       else{
+       } else {
                // Do Event Mixing
                for(Int_t nEventsInBG=0;nEventsInBG <fBGHandlerRP[fiCut]->GetNBGEvents(fGammaCandidates,fInputEvent);nEventsInBG++){
                
@@ -2693,7 +2696,7 @@ void AliAnalysisTaskGammaConvCalo::CalculateBackgroundRP(){
                                                AliAODConversionMother backgroundCandidate(gamma0,gamma1);
                                                backgroundCandidate.CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
                                                if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))
-                                               ->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift())){
+                                               ->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
                                                fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate.M(),backgroundCandidate.Pt());
                                                Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin};
                                                fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight);
index 5e4e017..e471463 100644 (file)
@@ -8,6 +8,8 @@
 #include "AliGammaConversionAODBGHandler.h"
 #include "AliConversionAODBGHandlerRP.h"
 #include "AliCaloPhotonCuts.h"
+#include "AliConvEventCuts.h"
+#include "AliConversionPhotonCuts.h"
 #include "AliConversionMesonCuts.h"
 #include "AliAnalysisManager.h"
 #include "TProfile2D.h"
@@ -54,6 +56,12 @@ class AliAnalysisTaskGammaConvCalo : public AliAnalysisTaskSE {
                void SetDoPhotonQA(Int_t flag){fDoPhotonQA = flag;}
                
            // Setting the cut lists for the conversion photons
+               void SetEventCutList(Int_t nCuts, TList *CutArray){
+                       fnCuts = nCuts;
+                       fEventCutArray = CutArray;
+               }
+
+               // Setting the cut lists for the conversion photons
                void SetConversionCutList(Int_t nCuts, TList *CutArray){
                        fnCuts = nCuts;
                        fCutArray = CutArray;
@@ -118,8 +126,10 @@ class AliAnalysisTaskGammaConvCalo : public AliAnalysisTaskSE {
                TClonesArray                                            *fReaderGammas;                                         // Array with conversion photons selected by V0Reader Cut
                TList                                                           *fGammaCandidates;                                      // current list of photon candidates
                TList                                                           *fClusterCandidates;                            //! current list of cluster candidates
+               TList                                                           *fEventCutArray;                                        // List with Event Cuts
+               AliConvEventCuts                                        *fEventCuts;                                            // EventCutObject
                TList                                                           *fCutArray;                                                     // List with Conversion Cuts
-               AliConversionCuts                                       *fConversionCuts;                                       // ConversionCutObject
+               AliConversionPhotonCuts                         *fConversionCuts;                                       // ConversionCutObject
                TList                                                           *fClusterCutArray;                                      // List with Cluster Cuts
                AliCaloPhotonCuts                                       *fCaloPhotonCuts;                                       // CaloPhotonCutObject
                TList                                                           *fMesonCutArray;                                        // List with Meson Cuts
@@ -294,7 +304,7 @@ class AliAnalysisTaskGammaConvCalo : public AliAnalysisTaskSE {
                AliAnalysisTaskGammaConvCalo(const AliAnalysisTaskGammaConvCalo&); // Prevent copy-construction
                AliAnalysisTaskGammaConvCalo &operator=(const AliAnalysisTaskGammaConvCalo&); // Prevent assignment
 
-               ClassDef(AliAnalysisTaskGammaConvCalo, 1);
+               ClassDef(AliAnalysisTaskGammaConvCalo, 2);
 };
 
 #endif
index fedf02d..cccebb5 100644 (file)
@@ -59,2611 +59,2232 @@ ClassImp( AliAnalysisTaskGammaConvDalitzV1 )
 
 //-----------------------------------------------------------------------------------------------
 AliAnalysisTaskGammaConvDalitzV1::AliAnalysisTaskGammaConvDalitzV1():
-fV0Reader(NULL),
-   fElecSelector(NULL),
-   fBGHandler(NULL),
-   fESDEvent(NULL),
-   fMCEvent(NULL),
-   fMCStack(NULL),
-   fCutFolder(NULL),
-   fESDList(NULL),
-   fBackList(NULL),
-   fMotherList(NULL),
-   fTrueList(NULL),
-   fMCList(NULL),
-   fQAFolder(NULL),
-   fOutputContainer(0),
-   fReaderGammas(NULL),
-   fSelectorElectronIndex(0),
-   fSelectorPositronIndex(0),
-   fGoodGammas(NULL),
-   fGoodVirtualGammas(NULL),
-   fGoodElectrons(NULL),
-   fGoodPositrons(NULL),
-   fCutGammaArray(NULL),
-   fCutElectronArray(NULL),
-   fCutMesonArray(NULL),
-   fGammasPool(NULL),
-   fConversionCuts(NULL),
-   hESDConvGammaPt(NULL),
-   hESDConvGammaEta(NULL),
-   hESDConvGammaZR(NULL),
-   hESDDalitzElectronPt(NULL),
-   hESDDalitzPositronPt(NULL),
-   hESDDalitzElectronPhi(NULL),
-   hESDDalitzPositronPhi(NULL),
-   hESDDalitzElectronAfterPt(NULL),
-   hESDDalitzPositronAfterPt(NULL),
-   hESDDalitzElectronAfterEta(NULL),
-   hESDDalitzElectronAfterEtaPCut(NULL),
-   hESDDalitzPositronAfterEta(NULL),
-   hESDDalitzPositronAfterEtaPCut(NULL),
-   hESDDalitzElectronAfterPhi(NULL),
-   hESDDalitzPositronAfterPhi(NULL),
-   hESDDalitzElectronAfterNClsITS(NULL),
-   hESDDalitzPositronAfterNClsITS(NULL),
-   hESDDalitzElectronAfterNFindClsTPC(NULL),
-   hESDDalitzPositronAfterNFindClsTPC(NULL),
-   hESDDalitzElectronAfterNClsTPC(NULL),
-   hESDDalitzPositronAfterNClsTPC(NULL),
-   hESDDalitzElectronAfterNCrossedRowsTPC(NULL),
-   hESDDalitzPositronAfterNCrossedRowsTPC(NULL),
-   hESDDalitzPosEleAfterDCAxy(NULL),
-   hESDDalitzPosEleAfterDCAz(NULL),
-   hESDDalitzElectronAfterTPCdEdxVsP(NULL),
-   hESDDalitzPositronAfterTPCdEdxVsP(NULL),
-   hESDDalitzElectronAfterTPCdEdxSignalVsP(NULL),
-   hESDDalitzPositronAfterTPCdEdxSignalVsP(NULL),
-   hESDDalitzElectronAfterTPCdEdxVsEta(NULL),
-   hESDDalitzPositronAfterTPCdEdxVsEta(NULL),
-   hESDDalitzElectronAfterTPCdEdxVsPhi(NULL),
-   hESDDalitzPositronAfterTPCdEdxVsPhi(NULL),
-   hESDMotherPhi(NULL),
-   hESDEposEnegPsiPairDPhi(NULL),
-   hESDEposEnegInvMassPt(NULL),
-   hESDEposEnegAfterMassCutInvMassPi0Pt(NULL),
-   hESDEposEnegInvMassPi0Pt(NULL),
-   hESDEposEnegLikeSignBackInvMassPt(NULL),
-   hESDMotherInvMassPt(NULL),
-   hESDPi0MotherInvMassPt(NULL),
-   hESDPi0MotherDiffInvMassPt(NULL),
-   hESDPi0MotherDiffLimInvMassPt(NULL),
-   sESDMotherInvMassPtZM(NULL),
-   hESDMotherBackInvMassPt(NULL),
-   sESDMotherBackInvMassPtZM(NULL),
-   hMCAllGammaPt(NULL),
-   hMCConvGammaPt(NULL),
-   hMCConvGammaRSPt(NULL),
-   hMCAllPositronsPt(NULL),
-   hMCAllElectronsPt(NULL),
-   hMCConvGammaEta(NULL),
-   hMCAllPositronsEta(NULL),
-   hMCAllElectronsEta(NULL),
-   hMCPi0DalitzGammaPt(NULL),
-   hMCPi0DalitzElectronPt(NULL),
-   hMCPi0DalitzPositronPt(NULL),
-   hMCPi0Pt(NULL),
-   hMCPi0GGPt(NULL),
-   hMCEtaPt(NULL),
-   hMCEtaGGPt(NULL), 
-   hMCPi0InAccPt(NULL),
-   hMCEtaInAccPt(NULL),
-   hMCChiCPt(NULL),
-   hMCChiCInAccPt(NULL),
-   hMCPi0EposEnegInvMassPt(NULL),
-   hMCEtaEposEnegInvMassPt(NULL),
-   hESDEposEnegTruePi0DalitzInvMassPt(NULL),
-   hESDEposEnegTruePrimPi0DalitzInvMass(NULL),
-   hESDEposEnegTruePi0DalitzPsiPairDPhi(NULL),
-   hESDEposEnegTrueEtaDalitzInvMassPt(NULL),
-   hESDEposEnegTruePrimEtaDalitzInvMass(NULL),
-   hESDEposEnegTrueEtaDalitzPsiPairDPhi(NULL),
-   hESDEposEnegTruePhotonInvMassPt(NULL),
-   hESDEposEnegTrueInvMassPt(NULL),
-   hESDEposEnegTruePhotonPsiPairDPhi(NULL),
-   hESDEposEnegTruePhotonPsiPairDPhiPtCut(NULL),
-   hESDEposEnegTrueJPsiInvMassPt(NULL),
-   hESDTrueMotherChiCInvMassPt(NULL),
-   hESDTrueMotherChiCDiffInvMassPt(NULL),
-   hESDTrueMotherInvMassPt(NULL),
-   hESDTrueMotherDalitzInvMassPt(NULL),
-   hESDTrueMotherPi0GGInvMassPt(NULL),
-   hESDTruePrimaryMotherPi0GGInvMassPt(NULL),
-   hESDTrueSecondaryMotherPi0GGInvMassPt(NULL),
-   hESDTruePrimaryMotherInvMassMCPt(NULL),
-   hESDTruePrimaryMotherInvMassPt(NULL),
-   hESDTruePrimaryMotherW0WeightingInvMassPt(NULL),
-   hESDTruePrimaryPi0DalitzESDPtMCPt(NULL),
-   hESDTrueSecondaryMotherInvMassPt(NULL),
-   hESDTrueSecondaryMotherFromK0sInvMassPt(NULL),
-   hESDTrueBckGGInvMassPt(NULL),
-   hESDTrueBckContInvMassPt(NULL),
-   hESDTrueMotherGGInvMassPt(NULL),
-   hESDTrueConvGammaPt(NULL),
-   hESDTruePositronPt(NULL),
-   hESDTrueElectronPt(NULL),
-   hESDTrueSecConvGammaPt(NULL),
-   hESDTrueSecPositronPt(NULL),
-   hESDTrueSecElectronPt(NULL),
-   hESDTruePi0DalitzConvGammaPt(NULL),
-   hESDTruePi0DalitzPositronPt(NULL),
-   hESDTruePi0DalitzElectronPt(NULL),
-   hESDTruePi0DalitzSecConvGammaPt(NULL),
-   hESDTruePi0DalitzSecPositronPt(NULL),
-   hESDTruePi0DalitzSecElectronPt(NULL),
-   hNEvents(NULL),
-   hNGoodESDTracks(NULL),
-   hNGoodESDTracksVsNGoodGammas(NULL),
-   hNGoodESDTracksVsNGoodVGammas(NULL),
-   hNV0Tracks(NULL),
-   hEtaShift(NULL),
-   fRandom(0),
-   fUnsmearedPx(NULL),
-   fUnsmearedPy(NULL),
-   fUnsmearedPz(NULL),
-   fUnsmearedE(NULL),
-   fUnsmearedVPx(NULL),
-   fUnsmearedVPy(NULL),
-   fUnsmearedVPz(NULL),
-   fUnsmearedVE(NULL),
-   fnCuts(0),
-   fiCut(0),
-   fNumberOfESDTracks(0),
-   fNumberOfESDTrackskBoth(0),
-   fNVirtualGammas(0),
-   fMoveParticleAccordingToVertex(kFALSE),
-   fIsHeavyIon(kFALSE),
-   fDoMesonAnalysis(kTRUE),
-   fDoChicAnalysis(kFALSE),
-   fDoMesonQA(kFALSE),
-   fSetProductionVertextoVGamma(kTRUE),
-   fIsFromMBHeader(kTRUE),
-   fIsMC(kFALSE)
+       fV0Reader(NULL),
+       fElecSelector(NULL),
+       fBGHandler(NULL),
+       fESDEvent(NULL),
+       fMCEvent(NULL),
+       fMCStack(NULL),
+       fCutFolder(NULL),
+       fESDList(NULL),
+       fBackList(NULL),
+       fMotherList(NULL),
+       fTrueList(NULL),
+       fMCList(NULL),
+       fQAFolder(NULL),
+       fOutputContainer(0),
+       fReaderGammas(NULL),
+       fSelectorElectronIndex(0),
+       fSelectorPositronIndex(0),
+       fGoodGammas(NULL),
+       fGoodVirtualGammas(NULL),
+       fGoodElectrons(NULL),
+       fGoodPositrons(NULL),
+       fCutEventArray(NULL),
+       fCutGammaArray(NULL),
+       fCutElectronArray(NULL),
+       fCutMesonArray(NULL),
+       fGammasPool(NULL),
+       fEventCuts(NULL),
+       fConversionCuts(NULL),
+       hESDConvGammaPt(NULL),
+       hESDConvGammaEta(NULL),
+       hESDConvGammaZR(NULL),
+       hESDDalitzElectronPt(NULL),
+       hESDDalitzPositronPt(NULL),
+       hESDDalitzElectronPhi(NULL),
+       hESDDalitzPositronPhi(NULL),
+       hESDDalitzElectronAfterPt(NULL),
+       hESDDalitzPositronAfterPt(NULL),
+       hESDDalitzElectronAfterEta(NULL),
+       hESDDalitzElectronAfterEtaPCut(NULL),
+       hESDDalitzPositronAfterEta(NULL),
+       hESDDalitzPositronAfterEtaPCut(NULL),
+       hESDDalitzElectronAfterPhi(NULL),
+       hESDDalitzPositronAfterPhi(NULL),
+       hESDDalitzElectronAfterNClsITS(NULL),
+       hESDDalitzPositronAfterNClsITS(NULL),
+       hESDDalitzElectronAfterNFindClsTPC(NULL),
+       hESDDalitzPositronAfterNFindClsTPC(NULL),
+       hESDDalitzElectronAfterNClsTPC(NULL),
+       hESDDalitzPositronAfterNClsTPC(NULL),
+       hESDDalitzElectronAfterNCrossedRowsTPC(NULL),
+       hESDDalitzPositronAfterNCrossedRowsTPC(NULL),
+       hESDDalitzPosEleAfterDCAxy(NULL),
+       hESDDalitzPosEleAfterDCAz(NULL),
+       hESDDalitzElectronAfterTPCdEdxVsP(NULL),
+       hESDDalitzPositronAfterTPCdEdxVsP(NULL),
+       hESDDalitzElectronAfterTPCdEdxSignalVsP(NULL),
+       hESDDalitzPositronAfterTPCdEdxSignalVsP(NULL),
+       hESDDalitzElectronAfterTPCdEdxVsEta(NULL),
+       hESDDalitzPositronAfterTPCdEdxVsEta(NULL),
+       hESDDalitzElectronAfterTPCdEdxVsPhi(NULL),
+       hESDDalitzPositronAfterTPCdEdxVsPhi(NULL),
+       hESDMotherPhi(NULL),
+       hESDEposEnegPsiPairDPhi(NULL),
+       hESDEposEnegInvMassPt(NULL),
+       hESDEposEnegAfterMassCutInvMassPi0Pt(NULL),
+       hESDEposEnegInvMassPi0Pt(NULL),
+       hESDEposEnegLikeSignBackInvMassPt(NULL),
+       hESDMotherInvMassPt(NULL),
+       hESDPi0MotherInvMassPt(NULL),
+       hESDPi0MotherDiffInvMassPt(NULL),
+       hESDPi0MotherDiffLimInvMassPt(NULL),
+       sESDMotherInvMassPtZM(NULL),
+       hESDMotherBackInvMassPt(NULL),
+       sESDMotherBackInvMassPtZM(NULL),
+       hMCAllGammaPt(NULL),
+       hMCConvGammaPt(NULL),
+       hMCConvGammaRSPt(NULL),
+       hMCAllPositronsPt(NULL),
+       hMCAllElectronsPt(NULL),
+       hMCConvGammaEta(NULL),
+       hMCAllPositronsEta(NULL),
+       hMCAllElectronsEta(NULL),
+       hMCPi0DalitzGammaPt(NULL),
+       hMCPi0DalitzElectronPt(NULL),
+       hMCPi0DalitzPositronPt(NULL),
+       hMCPi0Pt(NULL),
+       hMCPi0GGPt(NULL),
+       hMCEtaPt(NULL),
+       hMCEtaGGPt(NULL), 
+       hMCPi0InAccPt(NULL),
+       hMCEtaInAccPt(NULL),
+       hMCChiCPt(NULL),
+       hMCChiCInAccPt(NULL),
+       hMCPi0EposEnegInvMassPt(NULL),
+       hMCEtaEposEnegInvMassPt(NULL),
+       hESDEposEnegTruePi0DalitzInvMassPt(NULL),
+       hESDEposEnegTruePrimPi0DalitzInvMass(NULL),
+       hESDEposEnegTruePi0DalitzPsiPairDPhi(NULL),
+       hESDEposEnegTrueEtaDalitzInvMassPt(NULL),
+       hESDEposEnegTruePrimEtaDalitzInvMass(NULL),
+       hESDEposEnegTrueEtaDalitzPsiPairDPhi(NULL),
+       hESDEposEnegTruePhotonInvMassPt(NULL),
+       hESDEposEnegTrueInvMassPt(NULL),
+       hESDEposEnegTruePhotonPsiPairDPhi(NULL),
+       hESDEposEnegTruePhotonPsiPairDPhiPtCut(NULL),
+       hESDEposEnegTrueJPsiInvMassPt(NULL),
+       hESDTrueMotherChiCInvMassPt(NULL),
+       hESDTrueMotherChiCDiffInvMassPt(NULL),
+       hESDTrueMotherInvMassPt(NULL),
+       hESDTrueMotherDalitzInvMassPt(NULL),
+       hESDTrueMotherPi0GGInvMassPt(NULL),
+       hESDTruePrimaryMotherPi0GGInvMassPt(NULL),
+       hESDTrueSecondaryMotherPi0GGInvMassPt(NULL),
+       hESDTruePrimaryMotherInvMassMCPt(NULL),
+       hESDTruePrimaryMotherInvMassPt(NULL),
+       hESDTruePrimaryMotherW0WeightingInvMassPt(NULL),
+       hESDTruePrimaryPi0DalitzESDPtMCPt(NULL),
+       hESDTrueSecondaryMotherInvMassPt(NULL),
+       hESDTrueSecondaryMotherFromK0sInvMassPt(NULL),
+       hESDTrueBckGGInvMassPt(NULL),
+       hESDTrueBckContInvMassPt(NULL),
+       hESDTrueMotherGGInvMassPt(NULL),
+       hESDTrueConvGammaPt(NULL),
+       hESDTruePositronPt(NULL),
+       hESDTrueElectronPt(NULL),
+       hESDTrueSecConvGammaPt(NULL),
+       hESDTrueSecPositronPt(NULL),
+       hESDTrueSecElectronPt(NULL),
+       hESDTruePi0DalitzConvGammaPt(NULL),
+       hESDTruePi0DalitzPositronPt(NULL),
+       hESDTruePi0DalitzElectronPt(NULL),
+       hESDTruePi0DalitzSecConvGammaPt(NULL),
+       hESDTruePi0DalitzSecPositronPt(NULL),
+       hESDTruePi0DalitzSecElectronPt(NULL),
+       hNEvents(NULL),
+       hNGoodESDTracks(NULL),
+       hNGoodESDTracksVsNGoodGammas(NULL),
+       hNGoodESDTracksVsNGoodVGammas(NULL),
+       hNV0Tracks(NULL),
+       hEtaShift(NULL),
+       fRandom(0),
+       fUnsmearedPx(NULL),
+       fUnsmearedPy(NULL),
+       fUnsmearedPz(NULL),
+       fUnsmearedE(NULL),
+       fUnsmearedVPx(NULL),
+       fUnsmearedVPy(NULL),
+       fUnsmearedVPz(NULL),
+       fUnsmearedVE(NULL),
+       fnCuts(0),
+       fiCut(0),
+       fNumberOfESDTracks(0),
+       fNumberOfESDTrackskBoth(0),
+       fNVirtualGammas(0),
+       fMoveParticleAccordingToVertex(kFALSE),
+       fIsHeavyIon(kFALSE),
+       fDoMesonAnalysis(kTRUE),
+       fDoChicAnalysis(kFALSE),
+       fDoMesonQA(kFALSE),
+       fSetProductionVertextoVGamma(kTRUE),
+       fIsFromMBHeader(kTRUE),
+       fIsMC(kFALSE)
 {
 
 }
 
 //-----------------------------------------------------------------------------------------------
 AliAnalysisTaskGammaConvDalitzV1::AliAnalysisTaskGammaConvDalitzV1( const char* name ):
-   AliAnalysisTaskSE(name),
-   fV0Reader(NULL),
-   fElecSelector(NULL),
-   fBGHandler(NULL),
-   fESDEvent(NULL),
-   fMCEvent(NULL),
-   fMCStack(NULL),
-   fCutFolder(NULL),
-   fESDList(NULL),
-   fBackList(NULL),
-   fMotherList(NULL),
-   fTrueList(NULL),
-   fMCList(NULL),
-   fQAFolder(NULL),
-   fOutputContainer(0),
-   fReaderGammas(NULL),
-   fSelectorElectronIndex(0),
-   fSelectorPositronIndex(0),
-   fGoodGammas(NULL),
-   fGoodVirtualGammas(NULL),
-   fGoodElectrons(NULL),
-   fGoodPositrons(NULL),
-   fCutGammaArray(NULL),
-   fCutElectronArray(NULL),
-   fCutMesonArray(NULL),
-   fGammasPool(NULL),
-   fConversionCuts(NULL),
-   hESDConvGammaPt(NULL),
-   hESDConvGammaEta(NULL),
-   hESDConvGammaZR(NULL),
-   hESDDalitzElectronPt(NULL),
-   hESDDalitzPositronPt(NULL),
-   hESDDalitzElectronPhi(NULL),
-   hESDDalitzPositronPhi(NULL),
-   hESDDalitzElectronAfterPt(NULL),
-   hESDDalitzPositronAfterPt(NULL),
-   hESDDalitzElectronAfterEta(NULL),
-   hESDDalitzElectronAfterEtaPCut(NULL),
-   hESDDalitzPositronAfterEta(NULL),
-   hESDDalitzPositronAfterEtaPCut(NULL),
-   hESDDalitzElectronAfterPhi(NULL),
-   hESDDalitzPositronAfterPhi(NULL),
-   hESDDalitzElectronAfterNClsITS(NULL),
-   hESDDalitzPositronAfterNClsITS(NULL),
-   hESDDalitzElectronAfterNFindClsTPC(NULL),
-   hESDDalitzPositronAfterNFindClsTPC(NULL),
-   hESDDalitzElectronAfterNClsTPC(NULL),
-   hESDDalitzPositronAfterNClsTPC(NULL),
-   hESDDalitzElectronAfterNCrossedRowsTPC(NULL),
-   hESDDalitzPositronAfterNCrossedRowsTPC(NULL),
-   hESDDalitzPosEleAfterDCAxy(NULL),
-   hESDDalitzPosEleAfterDCAz(NULL),
-   hESDDalitzElectronAfterTPCdEdxVsP(NULL),
-   hESDDalitzPositronAfterTPCdEdxVsP(NULL),
-   hESDDalitzElectronAfterTPCdEdxSignalVsP(NULL),
-   hESDDalitzPositronAfterTPCdEdxSignalVsP(NULL),
-   hESDDalitzElectronAfterTPCdEdxVsEta(NULL),
-   hESDDalitzPositronAfterTPCdEdxVsEta(NULL),
-   hESDDalitzElectronAfterTPCdEdxVsPhi(NULL),
-   hESDDalitzPositronAfterTPCdEdxVsPhi(NULL),
-   hESDMotherPhi(NULL),
-   hESDEposEnegPsiPairDPhi(NULL),
-   hESDEposEnegInvMassPt(NULL),
-   hESDEposEnegAfterMassCutInvMassPi0Pt(NULL),
-   hESDEposEnegInvMassPi0Pt(NULL),
-   hESDEposEnegLikeSignBackInvMassPt(NULL),
-   hESDMotherInvMassPt(NULL),
-   hESDPi0MotherInvMassPt(NULL),
-   hESDPi0MotherDiffInvMassPt(NULL),
-   hESDPi0MotherDiffLimInvMassPt(NULL),
-   sESDMotherInvMassPtZM(NULL),
-   hESDMotherBackInvMassPt(NULL),
-   sESDMotherBackInvMassPtZM(NULL),
-   hMCAllGammaPt(NULL),
-   hMCConvGammaPt(NULL),
-   hMCConvGammaRSPt(NULL),
-   hMCAllPositronsPt(NULL),
-   hMCAllElectronsPt(NULL),
-   hMCConvGammaEta(NULL),
-   hMCAllPositronsEta(NULL),
-   hMCAllElectronsEta(NULL),
-   hMCPi0DalitzGammaPt(NULL),
-   hMCPi0DalitzElectronPt(NULL),
-   hMCPi0DalitzPositronPt(NULL),
-   hMCPi0Pt(NULL),
-   hMCPi0GGPt(NULL),
-   hMCEtaPt(NULL),
-   hMCEtaGGPt(NULL),
-   hMCPi0InAccPt(NULL),
-   hMCEtaInAccPt(NULL),
-   hMCChiCPt(NULL),
-   hMCChiCInAccPt(NULL),
-   hMCPi0EposEnegInvMassPt(NULL),
-   hMCEtaEposEnegInvMassPt(NULL),
-   hESDEposEnegTruePi0DalitzInvMassPt(NULL),
-   hESDEposEnegTruePrimPi0DalitzInvMass(NULL),
-   hESDEposEnegTruePi0DalitzPsiPairDPhi(NULL),
-   hESDEposEnegTrueEtaDalitzInvMassPt(NULL),
-   hESDEposEnegTruePrimEtaDalitzInvMass(NULL),
-   hESDEposEnegTrueEtaDalitzPsiPairDPhi(NULL),
-   hESDEposEnegTruePhotonInvMassPt(NULL),
-   hESDEposEnegTrueInvMassPt(NULL),
-   hESDEposEnegTruePhotonPsiPairDPhi(NULL),
-   hESDEposEnegTruePhotonPsiPairDPhiPtCut(NULL),
-   hESDEposEnegTrueJPsiInvMassPt(NULL),
-   hESDTrueMotherChiCInvMassPt(NULL),
-   hESDTrueMotherChiCDiffInvMassPt(NULL),
-   hESDTrueMotherInvMassPt(NULL),
-   hESDTrueMotherDalitzInvMassPt(NULL),
-   hESDTrueMotherPi0GGInvMassPt(NULL),
-   hESDTruePrimaryMotherPi0GGInvMassPt(NULL),
-   hESDTrueSecondaryMotherPi0GGInvMassPt(NULL),
-   hESDTruePrimaryMotherInvMassMCPt(NULL),
-   hESDTruePrimaryMotherInvMassPt(NULL),
-   hESDTruePrimaryMotherW0WeightingInvMassPt(NULL),
-   hESDTruePrimaryPi0DalitzESDPtMCPt(NULL),
-   hESDTrueSecondaryMotherInvMassPt(NULL),
-   hESDTrueSecondaryMotherFromK0sInvMassPt(NULL),
-   hESDTrueBckGGInvMassPt(NULL),
-   hESDTrueBckContInvMassPt(NULL),
-   hESDTrueMotherGGInvMassPt(NULL),
-   hESDTrueConvGammaPt(NULL),
-   hESDTruePositronPt(NULL),
-   hESDTrueElectronPt(NULL),
-   hESDTrueSecConvGammaPt(NULL),
-   hESDTrueSecPositronPt(NULL),
-   hESDTrueSecElectronPt(NULL),
-   hESDTruePi0DalitzConvGammaPt(NULL),
-   hESDTruePi0DalitzPositronPt(NULL),
-   hESDTruePi0DalitzElectronPt(NULL),
-   hESDTruePi0DalitzSecConvGammaPt(NULL),
-   hESDTruePi0DalitzSecPositronPt(NULL),
-   hESDTruePi0DalitzSecElectronPt(NULL),
-   hNEvents(NULL),
-   hNGoodESDTracks(NULL),
-   hNGoodESDTracksVsNGoodGammas(NULL),
-   hNGoodESDTracksVsNGoodVGammas(NULL),
-   hNV0Tracks(NULL),
-   hEtaShift(NULL),
-   fRandom(0),
-   fUnsmearedPx(NULL),
-   fUnsmearedPy(NULL),
-   fUnsmearedPz(NULL),
-   fUnsmearedE(NULL),
-   fUnsmearedVPx(NULL),
-   fUnsmearedVPy(NULL),
-   fUnsmearedVPz(NULL),
-   fUnsmearedVE(NULL),
-   fnCuts(0),
-   fiCut(0),
-   fNumberOfESDTracks(0),
-   fNumberOfESDTrackskBoth(0),
-   fNVirtualGammas(0),
-   fMoveParticleAccordingToVertex(kFALSE),
-   fIsHeavyIon(kFALSE),
-   fDoMesonAnalysis(kTRUE),
-   fDoChicAnalysis(kFALSE),
-   fDoMesonQA(kFALSE),
-   fSetProductionVertextoVGamma(kTRUE),
-   fIsFromMBHeader(kTRUE),
-   fIsMC(kFALSE)
+       AliAnalysisTaskSE(name),
+       fV0Reader(NULL),
+       fElecSelector(NULL),
+       fBGHandler(NULL),
+       fESDEvent(NULL),
+       fMCEvent(NULL),
+       fMCStack(NULL),
+       fCutFolder(NULL),
+       fESDList(NULL),
+       fBackList(NULL),
+       fMotherList(NULL),
+       fTrueList(NULL),
+       fMCList(NULL),
+       fQAFolder(NULL),
+       fOutputContainer(0),
+       fReaderGammas(NULL),
+       fSelectorElectronIndex(0),
+       fSelectorPositronIndex(0),
+       fGoodGammas(NULL),
+       fGoodVirtualGammas(NULL),
+       fGoodElectrons(NULL),
+       fGoodPositrons(NULL),
+       fCutEventArray(NULL),
+       fCutGammaArray(NULL),
+       fCutElectronArray(NULL),
+       fCutMesonArray(NULL),
+       fGammasPool(NULL),
+       fEventCuts(NULL),
+       fConversionCuts(NULL),
+       hESDConvGammaPt(NULL),
+       hESDConvGammaEta(NULL),
+       hESDConvGammaZR(NULL),
+       hESDDalitzElectronPt(NULL),
+       hESDDalitzPositronPt(NULL),
+       hESDDalitzElectronPhi(NULL),
+       hESDDalitzPositronPhi(NULL),
+       hESDDalitzElectronAfterPt(NULL),
+       hESDDalitzPositronAfterPt(NULL),
+       hESDDalitzElectronAfterEta(NULL),
+       hESDDalitzElectronAfterEtaPCut(NULL),
+       hESDDalitzPositronAfterEta(NULL),
+       hESDDalitzPositronAfterEtaPCut(NULL),
+       hESDDalitzElectronAfterPhi(NULL),
+       hESDDalitzPositronAfterPhi(NULL),
+       hESDDalitzElectronAfterNClsITS(NULL),
+       hESDDalitzPositronAfterNClsITS(NULL),
+       hESDDalitzElectronAfterNFindClsTPC(NULL),
+       hESDDalitzPositronAfterNFindClsTPC(NULL),
+       hESDDalitzElectronAfterNClsTPC(NULL),
+       hESDDalitzPositronAfterNClsTPC(NULL),
+       hESDDalitzElectronAfterNCrossedRowsTPC(NULL),
+       hESDDalitzPositronAfterNCrossedRowsTPC(NULL),
+       hESDDalitzPosEleAfterDCAxy(NULL),
+       hESDDalitzPosEleAfterDCAz(NULL),
+       hESDDalitzElectronAfterTPCdEdxVsP(NULL),
+       hESDDalitzPositronAfterTPCdEdxVsP(NULL),
+       hESDDalitzElectronAfterTPCdEdxSignalVsP(NULL),
+       hESDDalitzPositronAfterTPCdEdxSignalVsP(NULL),
+       hESDDalitzElectronAfterTPCdEdxVsEta(NULL),
+       hESDDalitzPositronAfterTPCdEdxVsEta(NULL),
+       hESDDalitzElectronAfterTPCdEdxVsPhi(NULL),
+       hESDDalitzPositronAfterTPCdEdxVsPhi(NULL),
+       hESDMotherPhi(NULL),
+       hESDEposEnegPsiPairDPhi(NULL),
+       hESDEposEnegInvMassPt(NULL),
+       hESDEposEnegAfterMassCutInvMassPi0Pt(NULL),
+       hESDEposEnegInvMassPi0Pt(NULL),
+       hESDEposEnegLikeSignBackInvMassPt(NULL),
+       hESDMotherInvMassPt(NULL),
+       hESDPi0MotherInvMassPt(NULL),
+       hESDPi0MotherDiffInvMassPt(NULL),
+       hESDPi0MotherDiffLimInvMassPt(NULL),
+       sESDMotherInvMassPtZM(NULL),
+       hESDMotherBackInvMassPt(NULL),
+       sESDMotherBackInvMassPtZM(NULL),
+       hMCAllGammaPt(NULL),
+       hMCConvGammaPt(NULL),
+       hMCConvGammaRSPt(NULL),
+       hMCAllPositronsPt(NULL),
+       hMCAllElectronsPt(NULL),
+       hMCConvGammaEta(NULL),
+       hMCAllPositronsEta(NULL),
+       hMCAllElectronsEta(NULL),
+       hMCPi0DalitzGammaPt(NULL),
+       hMCPi0DalitzElectronPt(NULL),
+       hMCPi0DalitzPositronPt(NULL),
+       hMCPi0Pt(NULL),
+       hMCPi0GGPt(NULL),
+       hMCEtaPt(NULL),
+       hMCEtaGGPt(NULL),
+       hMCPi0InAccPt(NULL),
+       hMCEtaInAccPt(NULL),
+       hMCChiCPt(NULL),
+       hMCChiCInAccPt(NULL),
+       hMCPi0EposEnegInvMassPt(NULL),
+       hMCEtaEposEnegInvMassPt(NULL),
+       hESDEposEnegTruePi0DalitzInvMassPt(NULL),
+       hESDEposEnegTruePrimPi0DalitzInvMass(NULL),
+       hESDEposEnegTruePi0DalitzPsiPairDPhi(NULL),
+       hESDEposEnegTrueEtaDalitzInvMassPt(NULL),
+       hESDEposEnegTruePrimEtaDalitzInvMass(NULL),
+       hESDEposEnegTrueEtaDalitzPsiPairDPhi(NULL),
+       hESDEposEnegTruePhotonInvMassPt(NULL),
+       hESDEposEnegTrueInvMassPt(NULL),
+       hESDEposEnegTruePhotonPsiPairDPhi(NULL),
+       hESDEposEnegTruePhotonPsiPairDPhiPtCut(NULL),
+       hESDEposEnegTrueJPsiInvMassPt(NULL),
+       hESDTrueMotherChiCInvMassPt(NULL),
+       hESDTrueMotherChiCDiffInvMassPt(NULL),
+       hESDTrueMotherInvMassPt(NULL),
+       hESDTrueMotherDalitzInvMassPt(NULL),
+       hESDTrueMotherPi0GGInvMassPt(NULL),
+       hESDTruePrimaryMotherPi0GGInvMassPt(NULL),
+       hESDTrueSecondaryMotherPi0GGInvMassPt(NULL),
+       hESDTruePrimaryMotherInvMassMCPt(NULL),
+       hESDTruePrimaryMotherInvMassPt(NULL),
+       hESDTruePrimaryMotherW0WeightingInvMassPt(NULL),
+       hESDTruePrimaryPi0DalitzESDPtMCPt(NULL),
+       hESDTrueSecondaryMotherInvMassPt(NULL),
+       hESDTrueSecondaryMotherFromK0sInvMassPt(NULL),
+       hESDTrueBckGGInvMassPt(NULL),
+       hESDTrueBckContInvMassPt(NULL),
+       hESDTrueMotherGGInvMassPt(NULL),
+       hESDTrueConvGammaPt(NULL),
+       hESDTruePositronPt(NULL),
+       hESDTrueElectronPt(NULL),
+       hESDTrueSecConvGammaPt(NULL),
+       hESDTrueSecPositronPt(NULL),
+       hESDTrueSecElectronPt(NULL),
+       hESDTruePi0DalitzConvGammaPt(NULL),
+       hESDTruePi0DalitzPositronPt(NULL),
+       hESDTruePi0DalitzElectronPt(NULL),
+       hESDTruePi0DalitzSecConvGammaPt(NULL),
+       hESDTruePi0DalitzSecPositronPt(NULL),
+       hESDTruePi0DalitzSecElectronPt(NULL),
+       hNEvents(NULL),
+       hNGoodESDTracks(NULL),
+       hNGoodESDTracksVsNGoodGammas(NULL),
+       hNGoodESDTracksVsNGoodVGammas(NULL),
+       hNV0Tracks(NULL),
+       hEtaShift(NULL),
+       fRandom(0),
+       fUnsmearedPx(NULL),
+       fUnsmearedPy(NULL),
+       fUnsmearedPz(NULL),
+       fUnsmearedE(NULL),
+       fUnsmearedVPx(NULL),
+       fUnsmearedVPy(NULL),
+       fUnsmearedVPz(NULL),
+       fUnsmearedVE(NULL),
+       fnCuts(0),
+       fiCut(0),
+       fNumberOfESDTracks(0),
+       fNumberOfESDTrackskBoth(0),
+       fNVirtualGammas(0),
+       fMoveParticleAccordingToVertex(kFALSE),
+       fIsHeavyIon(kFALSE),
+       fDoMesonAnalysis(kTRUE),
+       fDoChicAnalysis(kFALSE),
+       fDoMesonQA(kFALSE),
+       fSetProductionVertextoVGamma(kTRUE),
+       fIsFromMBHeader(kTRUE),
+       fIsMC(kFALSE)
 {
-   DefineOutput(1, TList::Class());
+       DefineOutput(1, TList::Class());
 }
 
 //-----------------------------------------------------------------------------------------------
 AliAnalysisTaskGammaConvDalitzV1::~AliAnalysisTaskGammaConvDalitzV1()
 {
-   //
-   // virtual destructor
-   //
-
-   cout<<"Destructor"<<endl;
-
-   if(fGoodGammas){
-      delete fGoodGammas;
-      fGoodGammas = 0x0;
-   }
-   if(fGoodVirtualGammas){
-      delete fGoodVirtualGammas;
-      fGoodVirtualGammas = 0x0;
-   }
-   if(fGoodElectrons){
-      delete fGoodElectrons;
-      fGoodElectrons = 0x0;
-   }
-   if(fGoodPositrons){
-      delete fGoodPositrons;
-      fGoodPositrons = 0x0;
-   }
-   if(fBGHandler){
-      delete[] fBGHandler;
-      fBGHandler = 0x0;
-   }
-   if( fGammasPool ){
-      delete[] fGammasPool;
-      fGammasPool = 0x0;
-   }
+       //
+       // virtual destructor
+       //
+
+       cout<<"Destructor"<<endl;
+
+       if(fGoodGammas){
+               delete fGoodGammas;
+               fGoodGammas = 0x0;
+       }
+       if(fGoodVirtualGammas){
+               delete fGoodVirtualGammas;
+               fGoodVirtualGammas = 0x0;
+       }
+       if(fGoodElectrons){
+               delete fGoodElectrons;
+               fGoodElectrons = 0x0;
+       }
+       if(fGoodPositrons){
+               delete fGoodPositrons;
+               fGoodPositrons = 0x0;
+       }
+       if(fBGHandler){
+               delete[] fBGHandler;
+               fBGHandler = 0x0;
+       }
+       if( fGammasPool ){
+               delete[] fGammasPool;
+               fGammasPool = 0x0;
+       }
 }
+
 //___________________________________________________________
 void AliAnalysisTaskGammaConvDalitzV1::InitBack(){
 
-   const Int_t nDim = 4;
-   Int_t nBins[nDim] = {800,250,7,4};
-   Double_t xMin[nDim] = {0,0, 0,0};
-   Double_t xMax[nDim] = {0.8,25,7,4};
-   
-   sESDMotherInvMassPtZM = new THnSparseF*[fnCuts];
-   sESDMotherBackInvMassPtZM = new THnSparseF*[fnCuts];
+       const Int_t nDim = 4;
+       Int_t nBins[nDim] = {800,250,7,4};
+       Double_t xMin[nDim] = {0,0, 0,0};
+       Double_t xMax[nDim] = {0.8,25,7,4};
+       
+       sESDMotherInvMassPtZM = new THnSparseF*[fnCuts];
+       sESDMotherBackInvMassPtZM = new THnSparseF*[fnCuts];
 
-   fBGHandler = new AliGammaConversionAODBGHandler*[fnCuts];
-   
-   for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-   
-         
-         TString cutstringElectron     =   ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutNumber();
-         TString cutstringMeson        =   ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutNumber();
-         TString cutstringGamma        =   ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber();
-
-
-         
-         Int_t collisionSystem = atoi((TString)(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber())(0,1));
-         Int_t centMin = atoi((TString)(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber())(1,1));
-         Int_t centMax = atoi((TString)(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber())(2,1));
-         
-         if(collisionSystem == 1 || collisionSystem == 2 ||
-            collisionSystem == 5 || collisionSystem == 8 ||
-            collisionSystem == 9){
-            centMin = centMin*10;
-            centMax = centMax*10; 
-         }
-         else if(collisionSystem == 3 || collisionSystem == 6){
-            centMin = centMin*5;
-            centMax = centMax*5;
-         }
-         else if(collisionSystem == 4 || collisionSystem == 7){
-            centMin = ((centMin*5)+45);
-            centMax = ((centMax*5)+45);
-         }
-
-
-         fBackList[iCut] = new TList();
-         fBackList[iCut]->SetName(Form("%s_%s_%s Back histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
-         fBackList[iCut]->SetOwner(kTRUE);
-         fCutFolder[iCut]->Add(fBackList[iCut]);
-
-         sESDMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m","Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
-         fBackList[iCut]->Add(sESDMotherBackInvMassPtZM[iCut]);
-
-         fMotherList[iCut] = new TList();
-         fMotherList[iCut]->SetName(Form("%s_%s_%s Mother histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
-         fMotherList[iCut]->SetOwner(kTRUE);
-         fCutFolder[iCut]->Add(fMotherList[iCut]);
-
-         sESDMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m","Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
-         fMotherList[iCut]->Add(sESDMotherInvMassPtZM[iCut]);
-
-         
-         fBGHandler[iCut] = new AliGammaConversionAODBGHandler(
-                                                                  collisionSystem,centMin,centMax,
-                                                                  ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->NumberOfRotationEvents(),
-                                                                  ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->UseTrackMultiplicity());
-        
-        if( ( (AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetBKGMethod() == 3 ){
-         fGammasPool[iCut] = new TList();
-        }
-    
-   }
+       fBGHandler = new AliGammaConversionAODBGHandler*[fnCuts];
+       
+       for(Int_t iCut = 0; iCut<fnCuts;iCut++){
+       
+               TString cutstringEvent          = ((AliConvEventCuts*)fCutEventArray->At(iCut))->GetCutNumber();
+               TString cutstringElectron       = ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutNumber();
+               TString cutstringMeson          = ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutNumber();
+               TString cutstringGamma          = ((AliConversionPhotonCuts*)fCutGammaArray->At(iCut))->GetCutNumber();
+               
+               Int_t collisionSystem = atoi((TString)(((AliConvEventCuts*)fCutEventArray->At(iCut))->GetCutNumber())(0,1));
+               Int_t centMin = atoi((TString)(((AliConvEventCuts*)fCutEventArray->At(iCut))->GetCutNumber())(1,1));
+               Int_t centMax = atoi((TString)(((AliConvEventCuts*)fCutEventArray->At(iCut))->GetCutNumber())(2,1));
+               
+               if(collisionSystem == 1 || collisionSystem == 2 ||
+                       collisionSystem == 5 || collisionSystem == 8 ||
+                       collisionSystem == 9){
+                       centMin = centMin*10;
+                       centMax = centMax*10; 
+               }
+               else if(collisionSystem == 3 || collisionSystem == 6){
+                       centMin = centMin*5;
+                       centMax = centMax*5;
+               }
+               else if(collisionSystem == 4 || collisionSystem == 7){
+                       centMin = ((centMin*5)+45);
+                       centMax = ((centMax*5)+45);
+               }
+
+
+               fBackList[iCut] = new TList();
+               fBackList[iCut]->SetName(Form("%s_%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
+               fBackList[iCut]->SetOwner(kTRUE);
+               fCutFolder[iCut]->Add(fBackList[iCut]);
+
+               sESDMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m","Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
+               fBackList[iCut]->Add(sESDMotherBackInvMassPtZM[iCut]);
+
+               fMotherList[iCut] = new TList();
+               fMotherList[iCut]->SetName(Form("%s_%s_%s_%s Mother histograms",cutstringEvent.Data(),cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
+               fMotherList[iCut]->SetOwner(kTRUE);
+               fCutFolder[iCut]->Add(fMotherList[iCut]);
+
+               sESDMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m","Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
+               fMotherList[iCut]->Add(sESDMotherInvMassPtZM[iCut]);
+
+               
+               fBGHandler[iCut] = new AliGammaConversionAODBGHandler(
+                                                                                                                               collisionSystem,centMin,centMax,
+                                                                                                                               ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->NumberOfRotationEvents(),
+                                                                                                                               ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->UseTrackMultiplicity());
+               
+               if( ( (AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetBKGMethod() == 3 ){
+                       fGammasPool[iCut] = new TList();
+               }
+                       
+       }
 }
 
 //______________________________________________________________________
 void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
 {
-   //
-   // Create ouput objects
-   //
-
-   // Create the output container
-   if(fOutputContainer != NULL){
-      delete fOutputContainer;
-      fOutputContainer = NULL;
-   }
-   if(fOutputContainer == NULL){
-      fOutputContainer = new TList();
-      fOutputContainer->SetOwner(kTRUE);
-   }
-
-   fGoodGammas = new TList();
-   //fGoodGammas->SetOwner(kTRUE);
-
-
-   fGoodVirtualGammas = new TList();
-   fGoodVirtualGammas->SetOwner(kTRUE);
-
-
-
-   fGammasPool                     = new TList*[fnCuts];
-   fCutFolder                      = new TList*[fnCuts];
-   fESDList                        = new TList*[fnCuts];
-   fBackList                       = new TList*[fnCuts];
-   fMotherList                     = new TList*[fnCuts];
-   //fQAFolder                       = new TList*[fnCuts];
-   hNEvents                        = new TH1I*[fnCuts];
-   hNGoodESDTracks                 = new TH1I*[fnCuts];
-   hNV0Tracks                     = new TH1I*[fnCuts];
-   hEtaShift                       = new TProfile*[fnCuts];
-   hESDConvGammaPt                 = new TH1F*[fnCuts];
-   hESDConvGammaEta               = new TH1F*[fnCuts];
-   
-   hESDDalitzElectronPt            = new TH1F*[fnCuts];
-   hESDDalitzPositronPt            = new TH1F*[fnCuts];
-   hESDDalitzElectronPhi          = new TH1F*[fnCuts];
-   hESDDalitzPositronPhi          = new TH1F*[fnCuts];
-   
-   if( fDoMesonQA ) {
-     
-   fQAFolder  = new TList*[fnCuts];  
-   
-   hNGoodESDTracksVsNGoodGammas    = new TH2F*[fnCuts];
-   hNGoodESDTracksVsNGoodVGammas   = new TH2F*[fnCuts]; 
-   hESDDalitzElectronAfterPt      = new TH1F*[fnCuts];
-   hESDDalitzPositronAfterPt       = new TH1F*[fnCuts];
-   hESDDalitzElectronAfterEta      = new TH1F*[fnCuts];
-   hESDDalitzElectronAfterEtaPCut  = new TH1F*[fnCuts];
-   hESDDalitzPositronAfterEta      = new TH1F*[fnCuts];
-   hESDDalitzPositronAfterEtaPCut  = new TH1F*[fnCuts];
-   hESDDalitzElectronAfterPhi      = new TH1F*[fnCuts];
-   hESDDalitzPositronAfterPhi      = new TH1F*[fnCuts];
-   hESDDalitzElectronAfterNClsITS  = new TH1F*[fnCuts];
-   hESDDalitzPositronAfterNClsITS  = new TH1F*[fnCuts];
-   hESDDalitzElectronAfterNFindClsTPC = new TH2F*[fnCuts];
-   hESDDalitzPositronAfterNFindClsTPC = new TH2F*[fnCuts];
-   hESDDalitzElectronAfterNClsTPC     = new TH2F*[fnCuts];
-   hESDDalitzPositronAfterNClsTPC     = new TH2F*[fnCuts];
-   hESDDalitzElectronAfterNCrossedRowsTPC = new TH2F*[fnCuts];
-   hESDDalitzPositronAfterNCrossedRowsTPC = new TH2F*[fnCuts];
-   hESDDalitzPosEleAfterDCAxy     = new TH2F*[fnCuts];
-   hESDDalitzPosEleAfterDCAz       = new TH2F*[fnCuts];
-   hESDDalitzElectronAfterTPCdEdxVsP    = new TH2F*[fnCuts];
-   hESDDalitzPositronAfterTPCdEdxVsP = new TH2F*[fnCuts];
-   hESDDalitzElectronAfterTPCdEdxSignalVsP = new TH2F*[fnCuts];
-   hESDDalitzPositronAfterTPCdEdxSignalVsP = new TH2F*[fnCuts];
-   hESDDalitzElectronAfterTPCdEdxVsEta = new TH2F*[fnCuts];
-   hESDDalitzPositronAfterTPCdEdxVsEta = new TH2F*[fnCuts];
-   hESDDalitzElectronAfterTPCdEdxVsPhi = new TH2F*[fnCuts];
-   hESDDalitzPositronAfterTPCdEdxVsPhi = new TH2F*[fnCuts];
-   hESDMotherPhi                   = new TH1F*[fnCuts];
-   hESDEposEnegPsiPairDPhi         = new TH2F*[fnCuts];
-   hESDEposEnegInvMassPt           = new TH2F*[fnCuts];
-   hESDEposEnegAfterMassCutInvMassPi0Pt = new TH2F*[fnCuts];
-   hESDEposEnegInvMassPi0Pt             = new TH2F*[fnCuts];
-   hESDEposEnegLikeSignBackInvMassPt = new TH2F*[fnCuts];
-   hESDConvGammaZR                 = new TH2F*[fnCuts];
-   
-   }
-   
-   
-   
-   hESDMotherInvMassPt             = new TH2F*[fnCuts];
-   
-   if(fDoChicAnalysis) {
-   hESDPi0MotherInvMassPt          = new TH2F*[fnCuts];
-   hESDPi0MotherDiffInvMassPt      = new TH2F*[fnCuts];
-   hESDPi0MotherDiffLimInvMassPt   = new TH2F*[fnCuts];
-   }
-   
-   
-   hESDMotherBackInvMassPt         = new TH2F*[fnCuts];
-
-
-   for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-
-
-      TString cutstringElectron =((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutNumber();
-      TString cutstringMeson= ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutNumber();
-      TString cutstringGamma = ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber();
-
-      fCutFolder[iCut] = new TList();
-      fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
-      fCutFolder[iCut]->SetOwner(kTRUE);
-      fOutputContainer->Add(fCutFolder[iCut]);
-
-      fESDList[iCut] = new TList();
-      fESDList[iCut]->SetName(Form("%s_%s_%s ESD histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
-      fESDList[iCut]->SetOwner(kTRUE);
-      
-     
-      hNEvents[iCut] = new TH1I("NEvents","NEvents",9,-0.5,8.5);
-      hNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
-      hNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
-      hNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Missing MC");
-      hNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
-      hNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
-      hNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
-      hNEvents[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up");
-      hNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
-      hNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
-      fESDList[iCut]->Add(hNEvents[iCut]);
-
-
-
-      if(fIsHeavyIon) hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",3000,0,3000);
-      else hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200);
-      fESDList[iCut]->Add(hNGoodESDTracks[iCut]);
-      
-      
-      if(fIsHeavyIon == 1) hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",30000,0,30000);
-      else if(fIsHeavyIon == 2) hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",2500,0,2500);
-      else hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",1500,0,1500);
-      fESDList[iCut]->Add(hNV0Tracks[iCut]);
-      
-
-      hEtaShift[iCut] = new TProfile("Eta Shift","Eta Shift",1, -0.5,0.5);
-      fESDList[iCut]->Add(hEtaShift[iCut]);
-
-      hESDConvGammaPt[iCut] = new TH1F("ESD_ConvGamma_Pt","ESD_ConvGamma_Pt",250,0,25);
-      fESDList[iCut]->Add(hESDConvGammaPt[iCut]);
-      
-      hESDConvGammaEta[iCut] = new TH1F("ESD_ConvGamma_Eta","ESD_ConvGamma_Eta",600,-1.5,1.5);
-      fESDList[iCut]->Add(hESDConvGammaEta[iCut]);
-      
-      hESDDalitzElectronPt[iCut] = new TH1F("ESD_DalitzElectron_Pt","ESD_DalitzElectron_Pt",1000,0,25);
-      fESDList[iCut]->Add(hESDDalitzElectronPt[iCut]);
-
-      hESDDalitzPositronPt[iCut] = new TH1F("ESD_DalitzPositron_Pt","ESD_DalitzPositron_Pt",1000,0,25);
-      fESDList[iCut]->Add(hESDDalitzPositronPt[iCut]);
-      
-      
-      hESDDalitzElectronPhi[iCut] = new TH1F("ESD_DalitzElectron_Phi","ESD_DalitzElectron_Phi",360,0,2*TMath::Pi());
-      fESDList[iCut]->Add(hESDDalitzElectronPhi[iCut]);
-
-      hESDDalitzPositronPhi[iCut] = new TH1F("ESD_DalitzPositron_Phi","ESD_DalitzPositron_Phi",360,0,2*TMath::Pi());
-      fESDList[iCut]->Add(hESDDalitzPositronPhi[iCut]);
-      
-     
-      
-      if ( fDoMesonQA ) {
-
-      fQAFolder[iCut] = new TList();
-      fQAFolder[iCut]->SetName(Form("%s_%s_%s QA histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
-      fQAFolder[iCut]->SetOwner(kTRUE);
-        
-             
+       //
+       // Create ouput objects
+       //
+
+       // Create the output container
+       if(fOutputContainer != NULL){
+               delete fOutputContainer;
+               fOutputContainer = NULL;
+       }
+       if(fOutputContainer == NULL){
+               fOutputContainer = new TList();
+               fOutputContainer->SetOwner(kTRUE);
+       }
+
+       fGoodGammas = new TList();
+       //fGoodGammas->SetOwner(kTRUE);
+
+       fGoodVirtualGammas = new TList();
+       fGoodVirtualGammas->SetOwner(kTRUE);
+
+       fGammasPool                             = new TList*[fnCuts];
+       fCutFolder                              = new TList*[fnCuts];
+       fESDList                                = new TList*[fnCuts];
+       fBackList                               = new TList*[fnCuts];
+       fMotherList                             = new TList*[fnCuts];
+       hNEvents                                = new TH1I*[fnCuts];
+       hNGoodESDTracks                 = new TH1I*[fnCuts];
+       hNV0Tracks                              = new TH1I*[fnCuts];
+       hEtaShift                               = new TProfile*[fnCuts];
+       hESDConvGammaPt                 = new TH1F*[fnCuts];
+       hESDConvGammaEta                = new TH1F*[fnCuts];
        
-   
-      const Int_t kPtBins=110;
-      Double_t binsPtDummy[kPtBins+1];
-      const Int_t kPBins = 109;
-      Double_t binsPDummy[kPBins+1];
-      binsPtDummy[0]=0.0;
-      binsPDummy[0]=0.05;
-     
-        for(Int_t i=1;i<kPtBins+1;i++)
-        {
-                if(binsPtDummy[i-1]+0.05<1.01)
-                        binsPtDummy[i]=binsPtDummy[i-1]+0.05;
-                else
-                        binsPtDummy[i]=binsPtDummy[i-1]+0.1;
-               
-        }
-        for(Int_t i=1; i<kPBins+1;i++){
-                 
-                 if( binsPDummy[i-1]+0.05<1.01)
-                       binsPDummy[i] = binsPDummy[i-1]+0.05;
-                 else
-                       binsPDummy[i] = binsPDummy[i-1]+0.1;
-               
+       hESDDalitzElectronPt    = new TH1F*[fnCuts];
+       hESDDalitzPositronPt    = new TH1F*[fnCuts];
+       hESDDalitzElectronPhi   = new TH1F*[fnCuts];
+       hESDDalitzPositronPhi   = new TH1F*[fnCuts];
+       
+       if( fDoMesonQA ) {
+               fQAFolder                                                               = new TList*[fnCuts];  
+               hNGoodESDTracksVsNGoodGammas                    = new TH2F*[fnCuts];
+               hNGoodESDTracksVsNGoodVGammas                   = new TH2F*[fnCuts]; 
+               hESDDalitzElectronAfterPt                               = new TH1F*[fnCuts];
+               hESDDalitzPositronAfterPt                               = new TH1F*[fnCuts];
+               hESDDalitzElectronAfterEta                              = new TH1F*[fnCuts];
+               hESDDalitzElectronAfterEtaPCut                  = new TH1F*[fnCuts];
+               hESDDalitzPositronAfterEta                              = new TH1F*[fnCuts];
+               hESDDalitzPositronAfterEtaPCut                  = new TH1F*[fnCuts];
+               hESDDalitzElectronAfterPhi                              = new TH1F*[fnCuts];
+               hESDDalitzPositronAfterPhi                              = new TH1F*[fnCuts];
+               hESDDalitzElectronAfterNClsITS                  = new TH1F*[fnCuts];
+               hESDDalitzPositronAfterNClsITS                  = new TH1F*[fnCuts];
+               hESDDalitzElectronAfterNFindClsTPC              = new TH2F*[fnCuts];
+               hESDDalitzPositronAfterNFindClsTPC              = new TH2F*[fnCuts];
+               hESDDalitzElectronAfterNClsTPC                  = new TH2F*[fnCuts];
+               hESDDalitzPositronAfterNClsTPC                  = new TH2F*[fnCuts];
+               hESDDalitzElectronAfterNCrossedRowsTPC  = new TH2F*[fnCuts];
+               hESDDalitzPositronAfterNCrossedRowsTPC  = new TH2F*[fnCuts];
+               hESDDalitzPosEleAfterDCAxy                              = new TH2F*[fnCuts];
+               hESDDalitzPosEleAfterDCAz                               = new TH2F*[fnCuts];
+               hESDDalitzElectronAfterTPCdEdxVsP               = new TH2F*[fnCuts];
+               hESDDalitzPositronAfterTPCdEdxVsP               = new TH2F*[fnCuts];
+               hESDDalitzElectronAfterTPCdEdxSignalVsP = new TH2F*[fnCuts];
+               hESDDalitzPositronAfterTPCdEdxSignalVsP = new TH2F*[fnCuts];
+               hESDDalitzElectronAfterTPCdEdxVsEta     = new TH2F*[fnCuts];
+               hESDDalitzPositronAfterTPCdEdxVsEta     = new TH2F*[fnCuts];
+               hESDDalitzElectronAfterTPCdEdxVsPhi     = new TH2F*[fnCuts];
+               hESDDalitzPositronAfterTPCdEdxVsPhi     = new TH2F*[fnCuts];
+               hESDMotherPhi                                                   = new TH1F*[fnCuts];
+               hESDEposEnegPsiPairDPhi                                 = new TH2F*[fnCuts];
+               hESDEposEnegInvMassPt                                   = new TH2F*[fnCuts];
+               hESDEposEnegAfterMassCutInvMassPi0Pt    = new TH2F*[fnCuts];
+               hESDEposEnegInvMassPi0Pt                                = new TH2F*[fnCuts];
+               hESDEposEnegLikeSignBackInvMassPt               = new TH2F*[fnCuts];
+               hESDConvGammaZR                                                 = new TH2F*[fnCuts];
        }
-        
-      hNGoodESDTracksVsNGoodGammas[iCut] = new TH2F("hNGoodESDTracksVsNGoodGammas","hNGoodESDTracksVsNGoodGammas",200,-0.5,199.5,100,-0.5,99.5);
-      fQAFolder[iCut]->Add(hNGoodESDTracksVsNGoodGammas[iCut]);
-     
-      hNGoodESDTracksVsNGoodVGammas[iCut] = new TH2F("hNGoodESDTracksVsNVGoodVGammas","hNGoodESDTracksVsNGoodVGammas",200,-0.5,199.5,100,-0.5,99.5);
-      fQAFolder[iCut]->Add(hNGoodESDTracksVsNGoodVGammas[iCut]);
-             
-      hESDConvGammaZR[iCut]= new TH2F("ESD_ConvGamma_ConversionPoint_ZR","ESD_ConvGamma_ConversionPoint_ZR",1200,-150,150,480,0,120);
-      fQAFolder[iCut]->Add(hESDConvGammaZR[iCut]);
-     
-      hESDDalitzElectronAfterPt[iCut] = new TH1F("ESD_DalitzElectron_After_Pt","ESD_DalitzElectron_After_Pt",1000,0,25);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterPt[iCut]);
-
-      hESDDalitzPositronAfterPt[iCut] = new TH1F("ESD_DalitzPositron_After_Pt","ESD_DalitzPositron_After_Pt",1000,0,25);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterPt[iCut]);
-        
-      hESDDalitzElectronAfterEta[iCut] = new TH1F("ESD_DalitzElectron_After_Eta","ESD_DalitzElectron_After_Eta",600,-1.5,1.5);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterEta[iCut]);
-      
-      hESDDalitzElectronAfterEtaPCut[iCut] = new TH1F("ESD_DalitzElectron_After_Eta_PCut","ESD_DalitzElectron_After_Eta_PCut",600,-1.5,1.5);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterEtaPCut[iCut]);
-      
-      
-      hESDDalitzPositronAfterEta[iCut] = new TH1F("ESD_DalitzPositron_After_Eta","ESD_DalitzElectron_After_Eta",600,-1.5,1.5);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterEta[iCut]);
-      
-      hESDDalitzPositronAfterEtaPCut[iCut] = new TH1F("ESD_DalitzPositron_After_Eta_PCut","ESD_DalitzElectron_After_Eta_PCut",600,-1.5,1.5);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterEtaPCut[iCut]);
-      
-                  
-      hESDDalitzElectronAfterPhi[iCut] = new TH1F("ESD_DalitzElectron_After_Phi","ESD_DalitzElectron_After_Phi",360,0,2*TMath::Pi());
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterPhi[iCut]);
-
-      hESDDalitzPositronAfterPhi[iCut] = new TH1F("ESD_DalitzPositron_After_Phi","ESD_DalitzPositron_After_Phi",360,0,2*TMath::Pi());
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterPhi[iCut]);
-      
-      hESDDalitzElectronAfterNClsITS[iCut]  = new TH1F("ESD_DalitzElectron_After_NClsITS","ESD_DalitzElectron_After_NClsITS",7,0.,7.);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterNClsITS[iCut]);
-      
-      hESDDalitzPositronAfterNClsITS[iCut]  = new TH1F("ESD_DalitzPositron_After_NClsITS","ESD_DalitzPositron_After_NClsITS",7,0.,7.);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterNClsITS[iCut]);
-      
-      
-      hESDDalitzElectronAfterNFindClsTPC[iCut]  = new TH2F("ESD_DalitzElectron_After_NFindClsTPC","ESD_DalitzElectron_After_NFindClsTPC",60,0,1.5,kPtBins,binsPtDummy);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterNFindClsTPC[iCut]);
-      
-      hESDDalitzPositronAfterNFindClsTPC[iCut]  = new TH2F("ESD_DalitzPositron_After_NFindClsTPC","ESD_DalitzPositron_After_NFindClsTPC",60,0,1.5,kPtBins,binsPtDummy);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterNFindClsTPC[iCut]);
-      
-      
-      hESDDalitzElectronAfterNClsTPC[iCut]  = new TH2F("ESD_DalitzElectron_After_NClsTPC","ESD_DalitzElectron_After_NClsTPC",200,0,200,kPtBins,binsPtDummy);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterNClsTPC[iCut]);
-      
-      hESDDalitzPositronAfterNClsTPC[iCut]  = new TH2F("ESD_DalitzPositron_After_NClsTPC","ESD_DalitzPositron_After_NClsTPC",200,0,200,kPtBins,binsPtDummy);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterNClsTPC[iCut]);
-               
-      hESDDalitzPositronAfterNCrossedRowsTPC[iCut] =  new TH2F("ESD_DalitzPositron_After_NCrossedRowsTPC","ESD_DalitzPositron_After_NCrossedRowsTPC",165,-0.5,164.5,kPtBins,binsPtDummy);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterNCrossedRowsTPC[iCut]);
-      
-      hESDDalitzElectronAfterNCrossedRowsTPC[iCut] =  new TH2F("ESD_DalitzElectron_After_NCrossedRowsTPC","ESD_DalitzElectron_After_NCrossedRowsTPC",165,-0.5,164.5,kPtBins,binsPtDummy);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterNCrossedRowsTPC[iCut]);
-            
-      hESDDalitzPosEleAfterDCAxy[iCut] = new TH2F("ESD_DalitzPosEle_After_DCAxy","ESD_DalitzPosEle_After_DCAxy",124,-0.62,0.62,kPtBins,binsPtDummy);
-      fQAFolder[iCut]->Add(hESDDalitzPosEleAfterDCAxy[iCut]);
-      
-      hESDDalitzPosEleAfterDCAz[iCut]  = new TH2F("ESD_DalitzPosEle_After_DCAz","ESD_DalitzPosEle_After_DCAz",200,-1.0,1.0,kPtBins,binsPtDummy);
-      fQAFolder[iCut]->Add(hESDDalitzPosEleAfterDCAz[iCut]);
-      
-      hESDDalitzElectronAfterTPCdEdxVsP[iCut] = new TH2F("ESD_DalitzElectron_After_TPCdEdxVsP","ESD_DalitzElectron_After_TPCdEdxVsP_After_TPCdEdx",kPBins,binsPDummy,200,-10,10);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterTPCdEdxVsP[iCut]);
-      
-      hESDDalitzPositronAfterTPCdEdxVsP[iCut] = new TH2F("ESD_DalitzPositron_After_TPCdEdxVsP","ESD_DalitzPositron_After_TPCdEdxVsP",kPBins,binsPDummy,200,-10,10);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterTPCdEdxVsP[iCut]);
-      
-      hESDDalitzElectronAfterTPCdEdxSignalVsP[iCut] =new TH2F("ESD_DalitzElectron_After_TPCdEdxSignalVsP","ESD_DalitzElectron_After_TPCdEdxSignalVsP" ,kPBins,binsPDummy,200,0.0,200);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterTPCdEdxSignalVsP[iCut]);  
-      
-      hESDDalitzPositronAfterTPCdEdxSignalVsP[iCut] =new TH2F("ESD_DalitzPositron_After_TPCdEdxSignalVsP","ESD_DalitzPositron_After_TPCdEdxSignalVsP" ,kPBins,binsPDummy,200,0.0,200);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterTPCdEdxSignalVsP[iCut]); 
-      
-      hESDDalitzElectronAfterTPCdEdxVsEta[iCut] = new TH2F("ESD_DalitzElectron_After_TPCdEdxVsEta","ESD_DalitzElectron_After_TPCdEdxVsEta",140,-1.4,1.4,200,-10,10);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterTPCdEdxVsEta[iCut]);
-      
-      hESDDalitzPositronAfterTPCdEdxVsEta[iCut] = new  TH2F("ESD_DalitzPositron_After_TPCdEdxVsEta","ESD_DalitzPositron_After_TPCdEdxVsEta",140,-1.4,1.4,200,-10,10);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterTPCdEdxVsEta[iCut]);
-      
-      hESDDalitzElectronAfterTPCdEdxVsPhi[iCut] = new TH2F("ESD_DalitzElectron_After_TPCdEdxVsPhi","ESD_DalitzElectron_After_TPCdEdxVsPhi",180,0,2*TMath::Pi(),200,-10,10);
-      fQAFolder[iCut]->Add(hESDDalitzElectronAfterTPCdEdxVsPhi[iCut]);
-      
-      hESDDalitzPositronAfterTPCdEdxVsPhi[iCut] = new TH2F("ESD_DalitzPositron_After_TPCdEdxVsPhi","ESD_DalitzPositron_After_TPCdEdxVsPhi",180,0,2*TMath::Pi(),200,-10,10);
-      fQAFolder[iCut]->Add(hESDDalitzPositronAfterTPCdEdxVsPhi[iCut]);
-            
-      hESDMotherPhi[iCut] = new TH1F("ESD_DalitzMother_Phi","ESD_DalitzMother_Phi",360,0,2*TMath::Pi());
-      fQAFolder[iCut]->Add(hESDMotherPhi[iCut]);
-      
-      hESDEposEnegPsiPairDPhi[iCut] = new TH2F("ESD_EposEneg_PsiPair_DPhi","ESD_EposEneg_PsiPair_DPhi", 100, -1.0,1.0,100,-1.0,1.0 );
-      fQAFolder[iCut]->Add(hESDEposEnegPsiPairDPhi[iCut]);
-
-      hESDEposEnegInvMassPt[iCut] = new TH2F("ESD_EposEneg_InvMassPt","ESD_EposEneg_InvMassPt",4000,0.0,2.0,100,0.,10.);
-      fQAFolder[iCut]->Add(hESDEposEnegInvMassPt[iCut]);
-      
-      hESDEposEnegAfterMassCutInvMassPi0Pt[iCut] = new TH2F("ESD_EposEneg_AfterMassCut_InvMassPi0Pt","ESD_EposEneg_AfterMassCut_InvMassPi0Pt",4000,0.0,2.0,100,0.,10.);
-      fQAFolder[iCut]->Add(hESDEposEnegAfterMassCutInvMassPi0Pt[iCut]);
-      
-      
-      hESDEposEnegInvMassPi0Pt[iCut] = new TH2F("ESD_EposEneg_InvMassPi0Pt","ESD_EposEneg_InvMassPi0Pt",1000,0.0,0.5,100,0.,10.);
-      fQAFolder[iCut]->Add(hESDEposEnegInvMassPi0Pt[iCut]);
-      
-      
-      
-      hESDEposEnegLikeSignBackInvMassPt[iCut]  = new TH2F("ESD_EposEneg_LikeSignBack_InvMassPt","ESD_EposEneg_LikeSignBack_InvMassPt",4000,0.0,2.,100,0.,10.);
-      fQAFolder[iCut]->Add(hESDEposEnegLikeSignBackInvMassPt[iCut]);
-      
-      
-      TAxis *AxisAfter = hESDDalitzElectronAfterTPCdEdxVsP[iCut]->GetXaxis(); 
-      Int_t bins = AxisAfter->GetNbins();
-      Double_t from = AxisAfter->GetXmin();
-      Double_t to = AxisAfter->GetXmax();
-      Double_t *newBins = new Double_t[bins+1];
-      newBins[0] = from;
-      Double_t factor = TMath::Power(to/from, 1./bins);
-      for(Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
-
-      AxisAfter->Set(bins, newBins);
-      AxisAfter = hESDDalitzElectronAfterTPCdEdxSignalVsP[iCut]->GetXaxis(); 
-      AxisAfter->Set(bins, newBins);
-      
-      AxisAfter = hESDDalitzPositronAfterTPCdEdxVsP[iCut]->GetXaxis();
-      AxisAfter->Set(bins, newBins);
-      
-      AxisAfter = hESDDalitzPositronAfterTPCdEdxSignalVsP[iCut]->GetXaxis();
-      AxisAfter->Set(bins,newBins);
-                    
-      
-
-      delete [] newBins;
-      
-      
-      
-      
-      fCutFolder[iCut]->Add(fQAFolder[iCut]);
-      
-           
-      
-      }
-      
-      
-             
-     
-
-      hESDMotherInvMassPt[iCut] = new TH2F("ESD_DalitzMother_InvMass_Pt","ESD_DalitzMother_InvMass_Pt",800,0,0.8,250,0,25);
-      fESDList[iCut]->Add(hESDMotherInvMassPt[iCut]);
-                                                                                 
-       
-      if( fDoChicAnalysis) {
-                  
-      hESDPi0MotherInvMassPt[iCut] = new TH2F("ESD_Pi0Mother_InvMass_Pt","ESD_Pi0Mother_InvMass_Pt",4000,0,4,250,0,25);
-      fESDList[iCut]->Add(hESDPi0MotherInvMassPt[iCut]);
-  
-      hESDPi0MotherDiffInvMassPt[iCut] = new TH2F("ESD_Pi0Mother_DiffInvMass_Pt","ESD_Pi0Mother_DiffInvMass_Pt",2000,0,2,250,0,25);
-      fESDList[iCut]->Add(hESDPi0MotherDiffInvMassPt[iCut]);
-
-      hESDPi0MotherDiffLimInvMassPt[iCut] = new TH2F("ESD_Pi0Mother_DiffLimInvMass_Pt","ESD_Pi0Mother_DiffLimInvMass_Pt",2000,0,2,250,0,25);
-      fESDList[iCut]->Add(hESDPi0MotherDiffLimInvMassPt[iCut]);
-      
-      }
-
-
-      hESDMotherBackInvMassPt[iCut] = new TH2F("ESD_DalitzBackground_InvMass_Pt","ESD_DalitzBackground_InvMass_Pt",800,0,0.8,250,0,25);
-      fESDList[iCut]->Add(hESDMotherBackInvMassPt[iCut]);
-
-           
-      
-      fCutFolder[iCut]->Add(fESDList[iCut]);
-      
-      
-
-   }
-
-
-   InitBack(); // Init Background Handler
-
-
-    if( fIsMC ){
-      // MC Histogramms
-      fMCList = new TList*[fnCuts];
-      // True Histogramms
-      fTrueList = new TList*[fnCuts];
-      hESDTrueConvGammaPt = new TH1F*[fnCuts];
-      hESDTruePositronPt  = new TH1F*[fnCuts];
-      hESDTrueElectronPt  = new TH1F*[fnCuts];
-      hESDTrueSecConvGammaPt = new TH1F*[fnCuts];
-      hESDTrueSecPositronPt  = new TH1F*[fnCuts];
-      hESDTrueSecElectronPt  = new TH1F*[fnCuts];
-      hESDTruePi0DalitzConvGammaPt = new TH1F*[fnCuts];
-      hESDTruePi0DalitzPositronPt  = new TH1F*[fnCuts];
-      hESDTruePi0DalitzElectronPt  = new TH1F*[fnCuts];
-      hESDTruePi0DalitzSecConvGammaPt = new TH1F*[fnCuts];
-      hESDTruePi0DalitzSecPositronPt  = new TH1F*[fnCuts];
-      hESDTruePi0DalitzSecElectronPt  = new TH1F*[fnCuts];
-      //if(fDoMesonAnalysis){
-      hMCAllGammaPt  = new TH1F*[fnCuts];
-      hMCConvGammaPt = new TH1F*[fnCuts];
-      hMCConvGammaRSPt = new TH1F*[fnCuts];
-      hMCAllPositronsPt = new TH1F*[fnCuts];
-      hMCAllElectronsPt = new TH1F*[fnCuts];
-      
-      if( fDoMesonQA ) {
-
-       hMCConvGammaEta    = new TH1F*[fnCuts];
-       hMCAllPositronsEta = new TH1F*[fnCuts];
-       hMCAllElectronsEta = new TH1F*[fnCuts];
-       
-      }
-      hMCPi0DalitzGammaPt    = new TH1F*[fnCuts];
-      hMCPi0DalitzElectronPt = new TH1F*[fnCuts];
-      hMCPi0DalitzPositronPt = new TH1F*[fnCuts];
-      hMCPi0Pt = new TH1F*[fnCuts];
-      hMCPi0GGPt =  new TH1F*[fnCuts];
-      hMCEtaPt = new TH1F*[fnCuts];
-      hMCEtaGGPt = new TH1F*[fnCuts];
-      hMCPi0InAccPt = new TH1F*[fnCuts];
-      hMCEtaInAccPt = new TH1F*[fnCuts];
-                       hMCChiCPt = new TH1F*[fnCuts];
-                       hMCChiCInAccPt = new TH1F*[fnCuts];
-                       
-                       
-      if ( fDoMesonQA ) {
-       
-       hMCPi0EposEnegInvMassPt                      = new TH2F*[fnCuts];       
-        hMCEtaEposEnegInvMassPt                             = new TH2F*[fnCuts];
-       
-       hESDEposEnegTruePi0DalitzInvMassPt           = new TH2F*[fnCuts];
-       hESDEposEnegTruePrimPi0DalitzInvMass         = new TH1F*[fnCuts];
-        hESDEposEnegTruePi0DalitzPsiPairDPhi         = new TH2F*[fnCuts];
-       hESDEposEnegTrueEtaDalitzInvMassPt           = new TH2F*[fnCuts];
-       hESDEposEnegTruePrimEtaDalitzInvMass         = new TH1F*[fnCuts];
-        hESDEposEnegTrueEtaDalitzPsiPairDPhi         = new TH2F*[fnCuts];
-       hESDEposEnegTruePhotonInvMassPt              = new TH2F*[fnCuts];
-       hESDEposEnegTrueInvMassPt                    = new TH2F*[fnCuts];
-        hESDEposEnegTruePhotonPsiPairDPhi            = new TH2F*[fnCuts];
-       hESDEposEnegTruePhotonPsiPairDPhiPtCut       = new TH2F*[fnCuts];
-       hESDEposEnegTrueJPsiInvMassPt                = new TH2F*[fnCuts];
-      }
-      
-      
-      if( fDoChicAnalysis ){
-      hESDTrueMotherChiCInvMassPt = new TH2F*[fnCuts];
-      hESDTrueMotherChiCDiffInvMassPt = new TH2F*[fnCuts];
-      }
-      
-      
-      hESDTrueMotherInvMassPt = new TH2F*[fnCuts];
-      hESDTrueMotherDalitzInvMassPt = new TH2F*[fnCuts];
-      hESDTrueMotherPi0GGInvMassPt = new TH2F*[fnCuts];
-      hESDTruePrimaryMotherPi0GGInvMassPt = new TH2F*[fnCuts];
-      hESDTrueSecondaryMotherPi0GGInvMassPt = new TH2F*[fnCuts];
-      hESDTruePrimaryPi0DalitzESDPtMCPt = new TH2F*[fnCuts];
-      hESDTruePrimaryMotherInvMassMCPt = new TH2F*[fnCuts];
-      hESDTruePrimaryMotherInvMassPt   = new TH2F*[fnCuts];
-      hESDTruePrimaryMotherW0WeightingInvMassPt = new TH2F*[fnCuts];
-      hESDTrueSecondaryMotherInvMassPt = new TH2F*[fnCuts];
-      hESDTrueSecondaryMotherFromK0sInvMassPt = new TH2F*[fnCuts];
-      hESDTrueBckGGInvMassPt = new TH2F*[fnCuts];
-      hESDTrueBckContInvMassPt = new TH2F*[fnCuts];
-      hESDTrueMotherGGInvMassPt = new TH2F*[fnCuts];
-      //}
-
-      for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-         TString cutstringElectron =((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutNumber();
-         TString cutstringMeson= ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutNumber();
-         TString cutstringGamma = ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber();
-
-         fMCList[iCut] = new TList();
-         fMCList[iCut]->SetName(Form("%s_%s_%s MC histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
-         fMCList[iCut]->SetOwner(kTRUE);
-         fCutFolder[iCut]->Add(fMCList[iCut]);
-
-
-       hMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25);
-       fMCList[iCut]->Add(hMCAllGammaPt[iCut]);
-       
-       hMCConvGammaPt[iCut] = new TH1F("MC_ConvGamma_Pt","MC_ConvGamma_Pt",250,0,25);
-       fMCList[iCut]->Add(hMCConvGammaPt[iCut]);
-       
-       
-       hMCConvGammaRSPt[iCut] = new TH1F("MC_ConvGamma_RS_Pt","MC_ConvGamma_RS_Pt",250,0,25);
-        fMCList[iCut]->Add(hMCConvGammaRSPt[iCut]);
-       
-                                
-       hMCAllPositronsPt[iCut] = new TH1F("MC_AllPositrons_Pt","MC_AllPositrons_Pt",1000,0,25);
-       fMCList[iCut]->Add(hMCAllPositronsPt[iCut]);
-                                
-                                hMCAllElectronsPt[iCut] = new TH1F("MC_AllElectrons_Pt","MC_AllElectrons_Pt",1000,0,25);
-                                fMCList[iCut]->Add(hMCAllElectronsPt[iCut]);
-                                
-                                hMCPi0DalitzGammaPt[iCut] = new TH1F("MC_Pi0DalitzGamma_Pt","MC_Pi0DalitzGamma_Pt",250,0,25);
-                                 hMCPi0DalitzGammaPt[iCut]->Sumw2();
-                                fMCList[iCut]->Add(hMCPi0DalitzGammaPt[iCut]);
-                                
-                                if ( fDoMesonQA ){
-                                 
-                                 hMCConvGammaEta[iCut] = new TH1F("MC_ConvGamma_Eta","MC_ConvGamma_Eta",600,-1.5,1.5);
-                                 fMCList[iCut]->Add(hMCConvGammaEta[iCut]);
-        
-                                 hMCAllPositronsEta[iCut] = new TH1F("MC_AllPositrons_Eta","MC_AllPositrons_Eta",600,-1.5,1.5);
-                                 fMCList[iCut]->Add(hMCAllPositronsEta[iCut]);
-                                
-                                 hMCAllElectronsEta[iCut] = new TH1F("MC_AllElectrons_Eta","MC_AllElectrons_Eta",600,-1.5,1.5);
-                                 fMCList[iCut]->Add(hMCAllElectronsEta[iCut]);
-                                
-                                
-                                }
-                                
-                                
-                                hMCPi0DalitzPositronPt[iCut] = new TH1F("MC_Pi0DalitzPositron_Pt","MC_Pi0DalitzPositron_Pt",1000,0,25);
-                                 hMCPi0DalitzPositronPt[iCut]->Sumw2();
-                                fMCList[iCut]->Add(hMCPi0DalitzPositronPt[iCut]);
-                                
-                                hMCPi0DalitzElectronPt[iCut] = new TH1F("MC_Pi0DalitzElectron_Pt","MC_Pi0DalitzElectron_Pt",1000,0,25);
-                                 hMCPi0DalitzElectronPt[iCut]->Sumw2();
-                                fMCList[iCut]->Add(hMCPi0DalitzElectronPt[iCut]);
-                                
-                                
-                                hMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt","MC_Pi0_Pt",250,0,25);
-                                 hMCPi0Pt[iCut]->Sumw2();
-                                fMCList[iCut]->Add(hMCPi0Pt[iCut]);
-                                
-                                hMCPi0GGPt[iCut] = new TH1F("MC_Pi0_GG_Pt","MC_Pi0_GG_Pt",250,0,25);
-                                 hMCPi0GGPt[iCut]->Sumw2();
-                                fMCList[iCut]->Add(hMCPi0GGPt[iCut]);
-                                
-                                hMCEtaPt[iCut] = new TH1F("MC_Eta_Pt","MC_Eta_Pt",250,0,25);
-                                 hMCEtaPt[iCut]->Sumw2();
-                                fMCList[iCut]->Add(hMCEtaPt[iCut]);
-
-                                hMCEtaGGPt[iCut] = new TH1F("MC_Eta_GG_Pt","MC_Eta_GG_Pt",250,0,25);
-                                 hMCEtaGGPt[iCut]->Sumw2();
-                                fMCList[iCut]->Add(hMCEtaGGPt[iCut]);
-                                
-                                hMCPi0InAccPt[iCut] = new TH1F("MC_Pi0DalitzInAcc_Pt","MC_Pi0DalitzInAcc_Pt",250,0,25);
-                                 hMCPi0InAccPt[iCut]->Sumw2();
-                                fMCList[iCut]->Add(hMCPi0InAccPt[iCut]);
-
-                                hMCEtaInAccPt[iCut] = new TH1F("MC_EtaDalitzInAcc_Pt","MC_EtaDalitzInAcc_Pt",250,0,25);
-                                 hMCEtaInAccPt[iCut]->Sumw2();
-                                fMCList[iCut]->Add(hMCEtaInAccPt[iCut]);
-                                
-                               
+       
+       
+       
+       hESDMotherInvMassPt             = new TH2F*[fnCuts];
+       if(fDoChicAnalysis) {
+               hESDPi0MotherInvMassPt                                  = new TH2F*[fnCuts];
+               hESDPi0MotherDiffInvMassPt                              = new TH2F*[fnCuts];
+               hESDPi0MotherDiffLimInvMassPt                   = new TH2F*[fnCuts];
+       }
+       hESDMotherBackInvMassPt = new TH2F*[fnCuts];
 
-                                hMCChiCPt[iCut] = new TH1F("MC_ChiC_Pt","MC_ChiC_Pt",250,0,25);
-                                fMCList[iCut]->Add(hMCChiCPt[iCut]);
-
-                                hMCChiCInAccPt[iCut] = new TH1F("MC_ChiCInAcc_Pt","MC_ChiCInAcc_Pt",250,0,25);
-                                fMCList[iCut]->Add(hMCChiCInAccPt[iCut]);
-                                
-                                 if ( fDoMesonQA ) {
-
-                                 hMCPi0EposEnegInvMassPt[iCut] = new TH2F("MC_Pi0EposEneg_InvMassPt","MC_Pi0EposEneg_InvMassPt",1000,0.0,0.5,100,0.,10.);
-                                 fMCList[iCut]->Add(hMCPi0EposEnegInvMassPt[iCut]);
-
-                                 hMCEtaEposEnegInvMassPt[iCut] = new TH2F("MC_EtaEposEneg_InvMassPt","MC_EtaEposEneg_InvMassPt",1400,0.,0.7,100,0.,10.);
-                                 fMCList[iCut]->Add(hMCEtaEposEnegInvMassPt[iCut]);
-                                 
-                                                                 
-                                 
-                                 }
-                                
-                                
-
-         fTrueList[iCut] = new TList();
-         fTrueList[iCut]->SetName(Form("%s_%s_%s True histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
-         fTrueList[iCut]->SetOwner(kTRUE);
-         fCutFolder[iCut]->Add(fTrueList[iCut]);
-
-        if ( fDoMesonQA ) {
-
-
-        hESDEposEnegTruePi0DalitzInvMassPt[iCut] = new TH2F("ESD_EposEneg_TruePi0Dalitz_InvMassPt","ESD_EposEneg_TruePi0Dalitz_InvMassPt",1000,0.0,0.5,100,0.,10.);
-        fTrueList[iCut]->Add(hESDEposEnegTruePi0DalitzInvMassPt[iCut]);
-        
-        hESDEposEnegTruePrimPi0DalitzInvMass[iCut] = new TH1F("ESD_EposEneg_TruePrimPi0Dalitz_InvMass","ESD_EposEneg_TruePrimPi0Dalitz_InvMass",500,0.,0.5);
-        fTrueList[iCut]->Add(hESDEposEnegTruePrimPi0DalitzInvMass[iCut]);
-
-         hESDEposEnegTruePi0DalitzPsiPairDPhi[iCut] = new TH2F("ESD_EposEneg_TruePi0Dalitz_PsiPair_DPhi","ESD_EposEneg_TruePi0Dalitz_PsiPair_DPhi", 100, -1.0,1.0,100,-1.0,1.0 );
-         fTrueList[iCut]->Add(hESDEposEnegTruePi0DalitzPsiPairDPhi[iCut]);
-
-        
-        hESDEposEnegTrueEtaDalitzInvMassPt[iCut] = new TH2F("ESD_EposEneg_TrueEtaDalitz_InvMassPt","ESD_EposEneg_TrueEtaDalitz_InvMassPt",700,0.,0.7,100,0.,10.);
-        fTrueList[iCut]->Add(hESDEposEnegTrueEtaDalitzInvMassPt[iCut]);
-        
-        hESDEposEnegTruePrimEtaDalitzInvMass[iCut] = new TH1F("ESD_EposEneg_TruePrimEtaDalitz_InvMass","ESD_EposEneg_TruePrimEtaDalitz_InvMass",700,0.,0.7);
-        fTrueList[iCut]->Add(hESDEposEnegTruePrimEtaDalitzInvMass[iCut]);
-
-         hESDEposEnegTrueEtaDalitzPsiPairDPhi[iCut] = new TH2F("ESD_EposEneg_TrueEtaDalitz_PsiPair_DPhi","ESD_EposEneg_TrueEtaDalitz_PsiPair_DPhi", 100, -1.0,1.0,100,-1.0,1.0 );
-         fTrueList[iCut]->Add(hESDEposEnegTrueEtaDalitzPsiPairDPhi[iCut]);
-        
-        hESDEposEnegTruePhotonInvMassPt[iCut] = new TH2F("ESD_EposEneg_TruePhoton_InvMassPt","ESD_EposEneg_TruePhoton_InvMassPt",500,0.,0.5,100,0.,10.);
-        fTrueList[iCut]->Add(hESDEposEnegTruePhotonInvMassPt[iCut]);
-        
-        hESDEposEnegTrueInvMassPt[iCut] = new TH2F("ESD_EposEneg_True_InvMassPt","ESD_EposEneg_True_InvMassPt",5000,0.,5.,100,0.,10.);
-        fTrueList[iCut]->Add(hESDEposEnegTrueInvMassPt[iCut]);
-        
-         hESDEposEnegTruePhotonPsiPairDPhi[iCut] = new TH2F("ESD_EposEneg_TruePhoton_PsiPair_DPhi","ESD_EposEneg_TruePhoton_PsiPair_DPhi", 100, -1.0,1.0,100,-1.0,1.0 );
-         fTrueList[iCut]->Add(hESDEposEnegTruePhotonPsiPairDPhi[iCut]);
-        
-        hESDEposEnegTruePhotonPsiPairDPhiPtCut[iCut] = new TH2F("ESD_EposEneg_TruePhoton_PsiPair_DPhi_PtCut","ESD_EposEneg_TruePhoton_PsiPair_DPhi_PtCut", 100, -1.0,1.0,100,-1.0,1.0 );
-         fTrueList[iCut]->Add(hESDEposEnegTruePhotonPsiPairDPhiPtCut[iCut]);
-        
-        
-        hESDEposEnegTrueJPsiInvMassPt[iCut] = new TH2F("ESD_EposEneg_TrueJPsi_InvMassPt","ESD_EposEneg_TrueJPsi_InvMassPt",5000,0.,5.,100,0.,10.);
-        fTrueList[iCut]->Add(hESDEposEnegTrueJPsiInvMassPt[iCut]);
-        
-
-
-        }
-
-
-         hESDTruePositronPt[iCut] = new TH1F("ESD_TruePositron_Pt","ESD_TruePositron_Pt",1000,0,25);
-         fTrueList[iCut]->Add(hESDTruePositronPt[iCut]);
-
-         hESDTrueElectronPt[iCut] = new TH1F("ESD_TrueElectron_Pt","ESD_TrueElectron_Pt",1000,0,25);
-         fTrueList[iCut]->Add(hESDTrueElectronPt[iCut]);
-        
-        hESDTrueSecPositronPt[iCut] = new TH1F("ESD_TrueSecPositron_Pt","ESD_TrueSecPositron_Pt",1000,0,25);
-         fTrueList[iCut]->Add(hESDTrueSecPositronPt[iCut]);
-
-         hESDTrueSecElectronPt[iCut] = new TH1F("ESD_TrueSecElectron_Pt","ESD_TrueSecElectron_Pt",1000,0,25);
-         fTrueList[iCut]->Add(hESDTrueSecElectronPt[iCut]); 
-
-         hESDTrueConvGammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25);
-         fTrueList[iCut]->Add(hESDTrueConvGammaPt[iCut]);
-        
-        hESDTrueSecConvGammaPt[iCut] = new TH1F("ESD_TrueSecConvGamma_Pt","ESD_TrueSecConvGamma_Pt",250,0,25);
-         fTrueList[iCut]->Add(hESDTrueSecConvGammaPt[iCut]);
-
-         hESDTruePi0DalitzConvGammaPt[iCut] = new TH1F("ESD_TruePi0DalitzConvGamma_Pt","ESD_TruePi0DalitzConvGamma_Pt",250,0,25);
-         fTrueList[iCut]->Add(hESDTruePi0DalitzConvGammaPt[iCut]);
-
-         hESDTruePi0DalitzElectronPt[iCut] = new TH1F("ESD_TruePi0DalitzElectron_Pt","ESD_TruePi0DalitzElectron_Pt",1000,0,25);
-         fTrueList[iCut]->Add(hESDTruePi0DalitzElectronPt[iCut]);
-
-         hESDTruePi0DalitzPositronPt[iCut] = new TH1F("ESD_TruePi0DalitzPositron_Pt","ESD_TruePi0DalitzPositron_Pt",1000,0,25);
-         fTrueList[iCut]->Add(hESDTruePi0DalitzPositronPt[iCut]);
-        
-        hESDTruePi0DalitzSecConvGammaPt[iCut] = new TH1F("ESD_TruePi0DalitzSecConvGamma_Pt","ESD_TruePi0DalitzSecConvGamma_Pt",250,0,25);
-         fTrueList[iCut]->Add(hESDTruePi0DalitzSecConvGammaPt[iCut]);
-        
-        hESDTruePi0DalitzSecElectronPt[iCut] = new TH1F("ESD_TruePi0DalitzSecElectron_Pt","ESD_TruePi0DalitzSecElectron_Pt",1000,0,25);
-         fTrueList[iCut]->Add(hESDTruePi0DalitzSecElectronPt[iCut]);
-
-         hESDTruePi0DalitzSecPositronPt[iCut] = new TH1F("ESD_TruePi0DalitzSecPositron_Pt","ESD_TruePi0DalitzSecPositron_Pt",1000,0,25);
-         fTrueList[iCut]->Add(hESDTruePi0DalitzSecPositronPt[iCut]);
-
-        if( fDoChicAnalysis) { 
-          
-        hESDTrueMotherChiCInvMassPt[iCut] = new TH2F("ESD_TrueMotherChiC_InvMass_Pt","ESD_TrueMotherChiC_InvMass_Pt",4000,0,4,250,0,25);
-         fTrueList[iCut]->Add(hESDTrueMotherChiCInvMassPt[iCut]);
-
-        hESDTrueMotherChiCDiffInvMassPt[iCut] = new TH2F("ESD_TrueMotherChiCDiff_InvMass_Pt","ESD_TrueMotherChiCDiff_InvMass_Pt",2000,0,2,250,0,25);
-         fTrueList[iCut]->Add(hESDTrueMotherChiCDiffInvMassPt[iCut]);
-        
-        }
-
-        hESDTrueMotherInvMassPt[iCut] = new TH2F("ESD_TrueMother_InvMass_Pt","ESD_TrueMother_InvMass_Pt",800,0,0.8,250,0,25);
-         hESDTrueMotherInvMassPt[iCut]->Sumw2();
-         fTrueList[iCut]->Add(hESDTrueMotherInvMassPt[iCut]);
-        
-        hESDTrueMotherDalitzInvMassPt[iCut] = new TH2F("ESD_TrueMother_Dalitz_InvMass_Pt","ESD_TrueMother_Dalitz_InvMass_Pt",800,0,0.8,250,0,25);
-         hESDTrueMotherDalitzInvMassPt[iCut]->Sumw2();
-         fTrueList[iCut]->Add(hESDTrueMotherDalitzInvMassPt[iCut]);
-        
-        
-        
-        
-
-         hESDTrueMotherPi0GGInvMassPt[iCut] = new TH2F("ESD_TrueMotherPi0GG_InvMass_Pt","ESD_TrueMotherPi0GG_InvMass_Pt",800,0,0.8,250,0,25);
-         hESDTrueMotherPi0GGInvMassPt[iCut]->Sumw2();
-         fTrueList[iCut]->Add(hESDTrueMotherPi0GGInvMassPt[iCut]);
-
-         hESDTruePrimaryMotherPi0GGInvMassPt[iCut] = new TH2F("ESD_TruePrimaryMotherPi0GG_InvMass_Pt","ESD_TruePrimaryMotherPi0GG_InvMass_Pt",800,0,0.8,250,0,25);
-         hESDTruePrimaryMotherPi0GGInvMassPt[iCut]->Sumw2();
-         fTrueList[iCut]->Add(hESDTruePrimaryMotherPi0GGInvMassPt[iCut]);
-
-         hESDTrueSecondaryMotherPi0GGInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryMotherPi0GG_InvMass_Pt","ESD_TrueSecondaryMotherPi0GG_InvMass_Pt",800,0,0.8,250,0,25);
-         hESDTrueSecondaryMotherPi0GGInvMassPt[iCut]->Sumw2();
-         fTrueList[iCut]->Add(hESDTrueSecondaryMotherPi0GGInvMassPt[iCut]);
-
-         hESDTruePrimaryPi0DalitzESDPtMCPt[iCut] = new TH2F("ESD_TruePrimaryPi0Dalitz_ESDPt_MCPt","ESD_TruePrimaryPi0Dalitz_ESDPt_MCPt",250,0,25,250,0,25);
-         hESDTruePrimaryPi0DalitzESDPtMCPt[iCut]->Sumw2();
-         fTrueList[iCut]->Add(hESDTruePrimaryPi0DalitzESDPtMCPt[iCut]);
-         hESDTruePrimaryMotherInvMassMCPt[iCut] = new TH2F("ESD_TruePrimaryMother_InvMass_MCPt","ESD_TrueDalitzPrimaryMother_InvMass_MCPt",800,0,0.8,250,0,25);
-         hESDTruePrimaryMotherInvMassMCPt[iCut]->Sumw2();
-         fTrueList[iCut]->Add(hESDTruePrimaryMotherInvMassMCPt[iCut]);
-         hESDTruePrimaryMotherInvMassPt[iCut] = new TH2F("ESD_TruePrimaryMother_InvMass_Pt","ESD_TruePrimaryMother_InvMass_Pt",800,0,0.8,250,0,25);
-         hESDTruePrimaryMotherInvMassPt[iCut]->Sumw2();
-         fTrueList[iCut]->Add(hESDTruePrimaryMotherInvMassPt[iCut]);
-        hESDTruePrimaryMotherW0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryMotherW0Weighting_InvMass_Pt","ESD_TruePrimaryMotherW0Weighting_InvMass_Pt",800,0,0.8,250,0,25);
-         hESDTruePrimaryMotherW0WeightingInvMassPt[iCut]->Sumw2();
-         fTrueList[iCut]->Add(hESDTruePrimaryMotherW0WeightingInvMassPt[iCut]); 
-
-         hESDTrueSecondaryMotherInvMassPt[iCut] = new TH2F("ESD_TrueDalitzSecondaryMother_InvMass_Pt","ESD_TrueDalitzSecondaryMother_InvMass_Pt",800,0,0.8,250,0,25);
-         hESDTrueSecondaryMotherInvMassPt[iCut]->Sumw2();
-         fTrueList[iCut]->Add(hESDTrueSecondaryMotherInvMassPt[iCut]);
-         //                            hESDTrueSecondaryMotherFromK0sInvMassPt[iCut] = new TH2F("ESD_TrueDalitzSecondaryMotherFromK0s_InvMass_Pt","ESD_TrueDalitzSecondaryMotherFromK0s_InvMass_Pt",1000,0,1,250,0,25);
-         //                            fTrueList[iCut]->Add(hESDTrueSecondaryMotherFromK0sInvMassPt[iCut]);
-         hESDTrueBckGGInvMassPt[iCut] = new TH2F("ESD_TrueDalitzBckGG_InvMass_Pt","ESD_TrueDalitzBckGG_InvMass_Pt",800,0,0.8,250,0,25);
-         fTrueList[iCut]->Add(hESDTrueBckGGInvMassPt[iCut]);
-         hESDTrueBckContInvMassPt[iCut] = new TH2F("ESD_TrueDalitzBckCont_InvMass_Pt","ESD_TrueDalitzBckCont_InvMass_Pt",800,0,0.8,250,0,25);
-         fTrueList[iCut]->Add(hESDTrueBckContInvMassPt[iCut]);
-         //                            hESDTrueMotherGGInvMassPt[iCut] = new TH2F("ESD_TrueGammaGamma_InvMass_Pt","ESD_TrueGammaGamma_InvMass_Pt",1000,0,1,250,0,25);
-         //                            fTrueList[iCut]->Add(hESDTrueMotherGGInvMassPt[iCut]);
-
-      }
-   }
-   
-   fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1");
-   if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader
-     
-   if(fV0Reader)
-      if((AliConversionCuts*)fV0Reader->GetConversionCuts())
-         if(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms())
-            fOutputContainer->Add(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetCutHistograms());
-        
-        
-        
-   fElecSelector=(AliDalitzElectronSelector*)AliAnalysisManager::GetAnalysisManager()->GetTask("ElectronSelector");
-   if(!fElecSelector){printf("Error: No ElectronSelector");return;} // GetV0Reader
-     
-    if( fElecSelector ){
-
-      if ( ((AliDalitzElectronCuts*)fElecSelector->GetDalitzElectronCuts())->GetCutHistograms() ){
-         fOutputContainer->Add( ((AliDalitzElectronCuts*)fElecSelector->GetDalitzElectronCuts())->GetCutHistograms() );
-      }
-   }  
-
-   for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-
-      if( fCutElectronArray ){
-         if( ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutHistograms() ) {
-            fCutFolder[iCut]->Add( ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutHistograms() );
-         }
-      }
-
-      if( fCutMesonArray  ) {
-         if( ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutHistograms() ) {
-            fCutFolder[iCut]->Add( ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutHistograms());
-         }
-      }
-
-      if( fCutGammaArray ) {
-         if( ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutHistograms() ) {
-            fCutFolder[iCut]->Add( ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutHistograms()  );
-         }
-      }
-   }
-
-   PostData(1, fOutputContainer);
 
-}
+       for(Int_t iCut = 0; iCut<fnCuts;iCut++){
 
-//______________________________________________________________________
-void AliAnalysisTaskGammaConvDalitzV1::UserExec(Option_t *)
-{
+               TString cutstringEvent          = ((AliConvEventCuts*)fCutEventArray->At(iCut))->GetCutNumber();
+               TString cutstringElectron       = ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetCutNumber();
+               TString cutstringMeson          = ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->GetCutNumber();
+               TString cutstringGamma          = ((AliConversionPhotonCuts*)fCutGammaArray->At(iCut))->GetCutNumber();
 
-   //
-   // Execute analysis for current event
-   //
-
-   fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1");
-   if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader
-
-
-   Int_t eventQuality = ((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEventQuality();
-
-   if(eventQuality == 2 || eventQuality == 3){// Event Not Accepted due to MC event missing or wrong trigger for V0ReaderV1
-        for(Int_t iCut = 0; iCut<fnCuts; iCut++){
-          hNEvents[iCut]->Fill(eventQuality);
-        }
-      return;
-   }
-
-
-   fElecSelector=(AliDalitzElectronSelector*)AliAnalysisManager::GetAnalysisManager()->GetTask("ElectronSelector");
-   if(!fElecSelector){printf("Error: No ElectronSelector");return;} // GetV0Reader
-
-
-   if(fIsMC)         fMCEvent        =  MCEvent();
-   fESDEvent        = (AliESDEvent*)InputEvent();
-   fReaderGammas    = fV0Reader->GetReconstructedGammas(); // Gammas from default Cut
-   fSelectorElectronIndex = fElecSelector->GetReconstructedElectronsIndex(); // Electrons from default Cut
-   fSelectorPositronIndex = fElecSelector->GetReconstructedPositronsIndex(); // Positrons from default Cut
-
-   CountESDTracks(); // Estimate Event Multiplicity
-   fNumberOfESDTracks = fV0Reader->GetNumberOfPrimaryTracks();
-   //AddTaskContainers(); //Add conatiner
-
-   for(Int_t iCut = 0; iCut<fnCuts; iCut++){
-     
-     
-     fiCut = iCut;
-      
-      fNVirtualGammas = 0;
-
-      Int_t eventNotAccepted =
-         ((AliConversionCuts*)fCutGammaArray->At(iCut))
-         ->IsEventAcceptedByConversionCut(fV0Reader->GetConversionCuts(),fInputEvent,fMCEvent,fIsHeavyIon);
-        
-      if(eventNotAccepted){
-         //                    cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
-         hNEvents[iCut]->Fill(eventNotAccepted); // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
-         continue;
-      }
-
-      if(eventQuality != 0){// Event Not Accepted
-         //                    cout << "event rejected due to: " <<eventQuality << endl;
-         hNEvents[iCut]->Fill(eventQuality);
-         continue;
-      }
-
-      hNEvents[iCut]->Fill(eventQuality);
-
-      hNGoodESDTracks[iCut]->Fill(fNumberOfESDTracks);
-      
-      if(((AliConversionCuts*)fCutGammaArray->At(iCut))->IsHeavyIon() == 2) hNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A());
-      else hNV0Tracks[iCut]->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C());
-
-
-      if(fMCEvent){ // Process MC Particle
-         
-       
-       
-       fMCStack = fMCEvent->Stack();
-        
-         if(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetSignalRejection() != 0){
-             ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetNotRejectedParticles(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetSignalRejection(),
-                                                                                    ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetAcceptedHeader(),
-                                                                                      fMCEvent);
-         } 
-        
-         ProcessMCParticles();
-      }
-
-      ProcessPhotonCandidates(); // Process this cuts gammas
-      ProcessElectronCandidates(); // Process this cuts gammas
-      
-      if(((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->UseMCPSmearing() && fMCEvent){
-       
-            fUnsmearedPx = new Double_t[fGoodGammas->GetEntries()]; // Store unsmeared Momenta
-            fUnsmearedPy = new Double_t[fGoodGammas->GetEntries()];
-            fUnsmearedPz = new Double_t[fGoodGammas->GetEntries()];
-            fUnsmearedE =  new Double_t[fGoodGammas->GetEntries()];
-
-            for(Int_t gamma=0;gamma<fGoodGammas->GetEntries();gamma++){ // Smear the AODPhotons in MC
-             
-               fUnsmearedPx[gamma] = ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->Px();
-               fUnsmearedPy[gamma] = ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->Py();
-               fUnsmearedPz[gamma] = ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->Pz();
-               fUnsmearedE[gamma] =  ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->E();
-               ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->SmearParticle(dynamic_cast<AliAODConversionPhoton*>(fGoodGammas->At(gamma)));
-              
-            }           
-       }
-       
-       if( ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetUseVPhotonMCPmearing() && ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->UseMCPSmearing() && fMCEvent){
-        
-          // cout<<"Entro virtual photon smearing"<<endl;
-       
-            fUnsmearedVPx = new Double_t[fGoodVirtualGammas->GetEntries()]; // Store unsmeared Momenta
-            fUnsmearedVPy = new Double_t[fGoodVirtualGammas->GetEntries()];
-            fUnsmearedVPz = new Double_t[fGoodVirtualGammas->GetEntries()];
-            fUnsmearedVE =  new Double_t[fGoodVirtualGammas->GetEntries()];
-
-            for(Int_t Vgamma=0;Vgamma<fGoodVirtualGammas->GetEntries();Vgamma++){ // Smear the AODPhotons in MC
-             
-               fUnsmearedVPx[Vgamma] = ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->Px();
-               fUnsmearedVPy[Vgamma] = ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->Py();
-               fUnsmearedVPz[Vgamma] = ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->Pz();
-               fUnsmearedVE[Vgamma] =  ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->E();
-               ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->SmearVirtualPhoton(dynamic_cast<AliAODConversionPhoton*>(fGoodVirtualGammas->At(Vgamma)));
-              
-            }           
-       }
-       
-      ProcessVirtualGammasCandidates();
-      CalculatePi0DalitzCandidates();
-      CalculateBackground();
-      UpdateEventByEventData();
-      
-      if ( fDoMesonQA ) {
-       
-      hNGoodESDTracksVsNGoodGammas[iCut]->Fill(fNumberOfESDTrackskBoth,fGoodGammas->GetEntries());
-      hNGoodESDTracksVsNGoodVGammas[iCut]->Fill(fNumberOfESDTrackskBoth,fNVirtualGammas);
-      
-      
-      }
-      
-      
-      if(((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->UseMCPSmearing() && fMCEvent){
-       
-          for(Int_t gamma=0;gamma<fGoodGammas->GetEntries();gamma++){ // Smear the AODPhotons in MC
-               ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->SetPx(fUnsmearedPx[gamma]); // Reset Unsmeared Momenta
-               ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->SetPy(fUnsmearedPy[gamma]);
-               ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->SetPz(fUnsmearedPz[gamma]);
-               ((AliAODConversionPhoton*)fGoodGammas->At(gamma))->SetE(fUnsmearedE[gamma]);
-            }
-            delete[] fUnsmearedPx; fUnsmearedPx = 0x0;
-            delete[] fUnsmearedPy; fUnsmearedPy = 0x0;
-            delete[] fUnsmearedPz; fUnsmearedPz = 0x0;
-            delete[] fUnsmearedE;  fUnsmearedE  = 0x0;
-           
-      }
-       
-       if( ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetUseVPhotonMCPmearing() && ((AliConversionMesonCuts*)fCutMesonArray->At(iCut))->UseMCPSmearing() && fMCEvent){
-       
-          for(Int_t Vgamma=0;Vgamma<fGoodVirtualGammas->GetEntries();Vgamma++){ // Smear the AODPhotons in MC
-               ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->SetPx(fUnsmearedVPx[Vgamma]); // Reset Unsmeared Momenta
-               ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->SetPy(fUnsmearedVPy[Vgamma]);
-               ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->SetPz(fUnsmearedVPz[Vgamma]);
-               ((AliAODConversionPhoton*)fGoodVirtualGammas->At(Vgamma))->SetE(fUnsmearedVE[Vgamma]);
-            } 
-            delete[] fUnsmearedVPx; fUnsmearedVPx = 0x0;
-            delete[] fUnsmearedVPy; fUnsmearedVPy = 0x0;
-            delete[] fUnsmearedVPz; fUnsmearedVPz = 0x0;
-            delete[] fUnsmearedVE;  fUnsmearedVE  = 0x0;
-           
-       }
-
-     
-
-      fGoodGammas->Clear(); // delete this cuts good gammas
-      fGoodVirtualGammas->Clear(); // delete this cuts good gammas
-   }
-
-   fSelectorElectronIndex.clear();
-   fSelectorPositronIndex.clear();
-
-   PostData( 1, fOutputContainer );
-}
+               fCutFolder[iCut] = new TList();
+               fCutFolder[iCut]->SetName(Form("Cut Number %s_%s_%s_%s",cutstringEvent.Data(),cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
+               fCutFolder[iCut]->SetOwner(kTRUE);
+               fOutputContainer->Add(fCutFolder[iCut]);
 
-Bool_t AliAnalysisTaskGammaConvDalitzV1::Notify()
-{
-   for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-      
-
-      if( !((AliConversionCuts*)fCutGammaArray->At(iCut))->GetDoEtaShift() ){
-
-         /*if (((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift() != 0.){
-            printf("Error: Gamma Conversion Dalitz Task %s :: Eta Shift not requested but set to %f, reset to 00. \n\n",
-                   (((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber()).Data(),((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift());
-            ((AliConversionCuts*)fCutGammaArray->At(iCut))->SetEtaShift(0.);
-            ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->SetEtaShift(0.);
-      
-            
-         }*/
-         hEtaShift[iCut]->Fill(0.,0.);
-         continue; // No Eta Shift requested, continue
-      }
-    
-      
-      if( ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift() == 0.0){ // Eta Shift requested but not set, get shift automatically
-         ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCorrectEtaShiftFromPeriod(fV0Reader->GetPeriodName());
-         ((AliConversionCuts*)fCutGammaArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once   
-        ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->SetEtaShift( ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift() );
-         hEtaShift[iCut]->Fill(0.,(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift()));
-         continue;
-      }
-      else{
-         printf(" Gamma Conversion Dalitz Task %s :: Eta Shift Manually Set to %f \n\n",
-         (((AliConversionCuts*)fCutGammaArray->At(iCut))->GetCutNumber()).Data(),((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift());
-         ((AliConversionCuts*)fCutGammaArray->At(iCut))->DoEtaShift(kFALSE); // Eta Shift Set, make sure that it is called only once   
-        ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->SetEtaShift( ((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift() );
-          hEtaShift[iCut]->Fill(0.,(((AliConversionCuts*)fCutGammaArray->At(iCut))->GetEtaShift()));
-      }
-   }
-   
-   return kTRUE;
-}
+               fESDList[iCut] = new TList();
+               fESDList[iCut]->SetName(Form("%s_%s_%s_%s ESD histograms",cutstringEvent.Data(),cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
+               fESDList[iCut]->SetOwner(kTRUE);
+               
+               hNEvents[iCut] = new TH1I("NEvents","NEvents",9,-0.5,8.5);
+               hNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
+               hNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
+               hNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Missing MC");
+               hNEvents[iCut]->GetXaxis()->SetBinLabel(4,"Trigger");
+               hNEvents[iCut]->GetXaxis()->SetBinLabel(5,"Vertex Z");
+               hNEvents[iCut]->GetXaxis()->SetBinLabel(6,"Cont. Vertex");
+               hNEvents[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up");
+               hNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
+               hNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
+               fESDList[iCut]->Add(hNEvents[iCut]);
+
+               if(fIsHeavyIon) hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",3000,0,3000);
+               else hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200);
+               fESDList[iCut]->Add(hNGoodESDTracks[iCut]);
+               
+               
+               if(fIsHeavyIon == 1) hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",30000,0,30000);
+               else if(fIsHeavyIon == 2) hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",2500,0,2500);
+               else hNV0Tracks[iCut] = new TH1I("V0 Multiplicity","V0 Multiplicity",1500,0,1500);
+               fESDList[iCut]->Add(hNV0Tracks[iCut]);
+               
+               hEtaShift[iCut] = new TProfile("Eta Shift","Eta Shift",1, -0.5,0.5);
+               fESDList[iCut]->Add(hEtaShift[iCut]);
 
+               hESDConvGammaPt[iCut] = new TH1F("ESD_ConvGamma_Pt","ESD_ConvGamma_Pt",250,0,25);
+               fESDList[iCut]->Add(hESDConvGammaPt[iCut]);
+               
+               hESDConvGammaEta[iCut] = new TH1F("ESD_ConvGamma_Eta","ESD_ConvGamma_Eta",600,-1.5,1.5);
+               fESDList[iCut]->Add(hESDConvGammaEta[iCut]);
+               
+               hESDDalitzElectronPt[iCut] = new TH1F("ESD_DalitzElectron_Pt","ESD_DalitzElectron_Pt",1000,0,25);
+               fESDList[iCut]->Add(hESDDalitzElectronPt[iCut]);
 
-void AliAnalysisTaskGammaConvDalitzV1::Terminate(const Option_t *)
-{
+               hESDDalitzPositronPt[iCut] = new TH1F("ESD_DalitzPositron_Pt","ESD_DalitzPositron_Pt",1000,0,25);
+               fESDList[iCut]->Add(hESDDalitzPositronPt[iCut]);
+               
+               
+               hESDDalitzElectronPhi[iCut] = new TH1F("ESD_DalitzElectro