- changes for QA part of standard GG task
authorfbock <Friederike.Bock@cern.ch>
Mon, 17 Feb 2014 14:13:07 +0000 (15:13 +0100)
committerfbock <Friederike.Bock@cern.ch>
Mon, 17 Feb 2014 14:13:07 +0000 (15:13 +0100)
- changes for Dalitz task to make the output smaller (Pedro)
- changes Eta 3 particle decay channel, including Mass cut

13 files changed:
PWGGA/GammaConv/AliAnalysisTaskEtaToPiPlPiMiGamma.cxx
PWGGA/GammaConv/AliAnalysisTaskEtaToPiPlPiMiGamma.h
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.h
PWGGA/GammaConv/AliAnalysisTaskGammaConvV1.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvV1.h
PWGGA/GammaConv/AliConversionMesonCuts.cxx
PWGGA/GammaConv/AliDalitzElectronCuts.cxx
PWGGA/GammaConv/AliPrimaryPionCuts.cxx
PWGGA/GammaConv/AliPrimaryPionCuts.h
PWGGA/GammaConv/macros/AddTask_GammaConvEtaPiPlPiMiGamma_pPb.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_pPb.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_pPb2.C

index 4344e79..255d8b1 100644 (file)
@@ -134,7 +134,8 @@ AliAnalysisTaskEtaToPiPlPiMiGamma::AliAnalysisTaskEtaToPiPlPiMiGamma():
        fDoMesonAnalysis(kTRUE),
        fDoMesonQA(kFALSE),
        fIsFromMBHeader(kTRUE),
-       fIsMC(kFALSE)
+       fIsMC(kFALSE),
+       fIsGammaEtaCand(kFALSE)
 {
 
 }
@@ -217,7 +218,8 @@ AliAnalysisTaskEtaToPiPlPiMiGamma::AliAnalysisTaskEtaToPiPlPiMiGamma( const char
        fDoMesonAnalysis(kTRUE),
        fDoMesonQA(kFALSE),
        fIsFromMBHeader(kTRUE),
-       fIsMC(kFALSE)
+       fIsMC(kFALSE),
+       fIsGammaEtaCand(kFALSE)
 {
    DefineOutput(1, TList::Class());
 }
@@ -423,9 +425,9 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserCreateOutputObjects()
                        fESDList[iCut]->Add(fHistoPionPionInvMassPt[iCut]);
                }
 
-               fHistoMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt","ESD_Mother_InvMass_Pt",900,0.3,1.2,250,0,25);
+               fHistoMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt","ESD_Mother_InvMass_Pt",450,0.3,0.75,250,0,25);
                fESDList[iCut]->Add(fHistoMotherInvMassPt[iCut]);
-               fHistoMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt","ESD_Background_InvMass_Pt",900,0.3,1.2,250,0,25);
+               fHistoMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt","ESD_Background_InvMass_Pt",450,0.3,0.75,250,0,25);
                fESDList[iCut]->Add(fHistoMotherBackInvMassPt[iCut]);
 
                if ( fDoMesonQA ) {
@@ -525,7 +527,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserCreateOutputObjects()
                        fHistoMCEtaGGPt[iCut]->Sumw2();
                        fMCList[iCut]->Add(fHistoMCEtaGGPt[iCut]);
                        
-                       fHistoMCEtaPiPlPiMiGammaInAccPt[iCut] = new TH1F("MC_EtaDalitzInAcc_Pt","MC_EtaDalitzInAcc_Pt",250,0,25);
+                       fHistoMCEtaPiPlPiMiGammaInAccPt[iCut] = new TH1F("MC_EtaInAcc_Pt","MC_EtaInAcc_Pt",250,0,25);
                        fHistoMCEtaPiPlPiMiGammaInAccPt[iCut]->Sumw2();
                        fMCList[iCut]->Add(fHistoMCEtaPiPlPiMiGammaInAccPt[iCut]);
 
@@ -676,6 +678,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::UserExec(Option_t *){
                        ProcessMCParticles();
                }
 
+               fIsGammaEtaCand =kFALSE;
 //             cout << "new event" << endl;
                ProcessPhotonCandidates(); // Process this cuts gammas
                ProcessPionCandidates(); // Process this cuts gammas
@@ -869,6 +872,24 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessTruePhotonCandidates(AliAODConver
                if( labelGamma < MCStack->GetNprimary() ) {
                        if( fIsFromMBHeader ){
                                fHistoTrueConvGammaFromEtaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+                               
+//                             TParticle * gammaMC = (TParticle*)MCStack->Particle(labelGamma);
+//                             Int_t gammaMotherLabel=gammaMC->GetFirstMother();
+//                             for(Int_t index= ((TParticle*)MCStack->Particle(gammaMotherLabel))->GetFirstDaughter();index<= ((TParticle*)MCStack->Particle(gammaMotherLabel))->GetLastDaughter();index++){                           
+//                                     TParticle* temp = (TParticle*)fMCStack->Particle( index );
+//                                     switch( temp->GetPdgCode() ) {
+//                                             case 211:
+//                                                     cout << "pi- " << index << "\t" << temp->Pt() << "\t" << temp->Eta() << endl;
+//                                                     break;
+//                                             case -211:
+//                                                     cout << "pi+ " << index << "\t" << temp->Pt() << "\t" << temp->Eta() << endl;
+//                                                     break;
+//                                             case ::kGamma:
+//                                                     cout << "gamma " << index << "\t" << temp->Pt()<< "\t" << temp->Eta() << endl;
+//                                                     break;
+//                                     }
+//                             }                                               
+                               fIsGammaEtaCand = kTRUE;        
                        }
                }
        } 
@@ -904,6 +925,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessPionCandidates(){
                                        if( IsEtaPiPlPiMiGammaDaughter(labelNegPion) == kTRUE ) {
                                                if( labelNegPion < fMCStack->GetNprimary() ) {
                                                        fHistoTrueNegPionFromEtaPt[fiCut]->Fill(negPionCandidate->Pt());
+//                                                     if (fIsGammaEtaCand) cout << "pi- rec" << labelNegPion << "\t" << negPionCandidate->Pt()<< endl;
                                                } 
                                        }       
                                }
@@ -929,6 +951,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessPionCandidates(){
                                        if( IsEtaPiPlPiMiGammaDaughter(labelPosPion) == kTRUE ) {
                                                if( labelPosPion < fMCStack->GetNprimary() ){
                                                        fHistoTruePosPionFromEtaPt[fiCut]->Fill(posPionCandidate->Pt());
+//                                                     if (fIsGammaEtaCand) cout << "pi+ rec" << labelPosPion << "\t" << posPionCandidate->Pt()<< endl;
                                                } 
                                        }
                                }
@@ -967,8 +990,14 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessPionCandidates(){
                                }
                        }
                        
-                       AliAODConversionPhoton *vphoton = new AliAODConversionPhoton(virtualPhoton); //To Apply PsiPairCut
-                       fGoodVirtualParticles->Add(  vphoton );
+                       AliAODConversionPhoton *vParticle = new AliAODConversionPhoton(virtualPhoton); //To Apply PsiPairCut
+                       if (((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->DoMassCut()){
+                               if (vParticle->GetMass() < ((AliPrimaryPionCuts*)fPionCutArray->At(fiCut))->GetMassCut()){
+                                       fGoodVirtualParticles->Add(  vParticle );
+                               }
+                       } else {
+                               fGoodVirtualParticles->Add(  vParticle );
+                       }       
                        delete virtualPhoton;
                        virtualPhoton=NULL;
                                        
@@ -1105,11 +1134,20 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::CalculateMesonCandidates(){
 
                                AliAODConversionMother *etacand = new AliAODConversionMother(gamma,vParticle);
                                etacand->SetLabels(GammaIndex,virtualParticleIndex);
-                                               
+                               
+//                             if(fMCEvent){
+//                                     AliESDtrack *posPionVParticle = fESDEvent->GetTrack( vParticle->GetTrackLabelNegative() );
+//                                     AliESDtrack *negPionVParticle = fESDEvent->GetTrack( vParticle->GetTrackLabelPositive() );
+// 
+//                                     Int_t labeln=TMath::Abs(negPionVParticle->GetLabel());
+//                                     Int_t labelp=TMath::Abs(posPionVParticle->GetLabel());
+//                                     
+//                                     cout << labeln << "\t" << labelp << endl;
+//                             }       
 
                                if( ( ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(etacand,kTRUE,((AliConversionCuts*)fGammaCutArray->At(fiCut))->GetEtaShift())) ){
                        
-                                       //cout<< "Meson Accepted "<<endl;
+//                                     cout<< "Meson Accepted "<<endl;
                                        
                                        Int_t zbin= fBGHandler[fiCut]->GetZBinIndex(fESDEvent->GetPrimaryVertex()->GetZ());
                                        Int_t mbin = 0;
@@ -1295,6 +1333,7 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessTrueMesonCandidates(AliAODConvers
                Bool_t isTrueEta = kFALSE;
                Int_t gammaMCLabel = TrueGammaCandidate->GetMCParticleLabel(MCStack);
                Int_t gammaMotherLabel = -1;
+               Bool_t gammaEtaCand = kFALSE;
                
                if(gammaMCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother
                        // Daughters Gamma 0
@@ -1306,9 +1345,12 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessTrueMesonCandidates(AliAODConvers
                                if(negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){ // ... From Conversion ...
                                        if(gammaMC->GetPdgCode() == 22){ // ... with Gamma Mother
                                                gammaMotherLabel=gammaMC->GetFirstMother();
+                                               if( ((TParticle*)MCStack->Particle(gammaMotherLabel))->GetNDaughters() == 3 && ((TParticle*)MCStack->Particle(gammaMotherLabel))->GetPdgCode() == 221 ) gammaEtaCand = kTRUE;
                                        }
                                }
                        }
+                       
+                       
                }
 
                Int_t virtualParticleMCLabel = TrueVirtualParticleCandidate->GetMCParticleLabel(MCStack);
@@ -1321,6 +1363,10 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessTrueMesonCandidates(AliAODConvers
                if (fDoMesonQA){
                        TParticle * negativeMC = (TParticle*)TrueVirtualParticleCandidate->GetNegativeMCDaughter(MCStack);
                        TParticle * positiveMC = (TParticle*)TrueVirtualParticleCandidate->GetPositiveMCDaughter(MCStack);
+//                     if (gammaEtaCand){
+//                             cout << "neg Part: label - " <<  TrueVirtualParticleCandidate->GetMCLabelNegative() <<" pdg-code - " << negativeMC->GetPdgCode() << endl;
+//                             cout << "pos Part: label - " <<  TrueVirtualParticleCandidate->GetMCLabelPositive() <<" pdg-code - " << positiveMC->GetPdgCode() << endl;                       
+//                     }
                        if(TMath::Abs(negativeMC->GetPdgCode())==211 && TMath::Abs(positiveMC->GetPdgCode())==211){  // Pions ...
                                fHistoTruePionPionInvMassPt[fiCut]->Fill(TrueVirtualParticleCandidate->GetMass(),TrueVirtualParticleCandidate->Pt());
                        }
@@ -1329,9 +1375,6 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::ProcessTrueMesonCandidates(AliAODConvers
                if(virtualParticleMCLabel != -1){ // if virtualParticleMCLabel==-1 particles don't have same mother 
                        TParticle * negativeMC = (TParticle*)TrueVirtualParticleCandidate->GetNegativeMCDaughter(MCStack);
                        TParticle * positiveMC = (TParticle*)TrueVirtualParticleCandidate->GetPositiveMCDaughter(MCStack);
-//                     cout << "neg Part: label - " <<  TrueVirtualParticleCandidate->GetMCLabelNegative() <<" pdg-code - " << negativeMC->GetPdgCode() << endl;
-//                     cout << "pos Part: label - " <<  TrueVirtualParticleCandidate->GetMCLabelPositive() <<" pdg-code - " << positiveMC->GetPdgCode() << endl;
-                       
                        TParticle * virtualParticleMotherMC = (TParticle*)MCStack->Particle(virtualParticleMCLabel);
 //                     cout << "pdg code same mother - " << virtualParticleMotherMC->GetPdgCode() << endl;
                        
index 01af1d3..97b7c19 100644 (file)
@@ -163,7 +163,7 @@ class AliAnalysisTaskEtaToPiPlPiMiGamma: public AliAnalysisTaskSE
                Bool_t fDoMesonQA;
                Bool_t fIsFromMBHeader;
                Bool_t fIsMC;
-
+               Bool_t fIsGammaEtaCand;
        private:
                AliAnalysisTaskEtaToPiPlPiMiGamma( const AliAnalysisTaskEtaToPiPlPiMiGamma& ); // Not implemented
                AliAnalysisTaskEtaToPiPlPiMiGamma& operator=( const AliAnalysisTaskEtaToPiPlPiMiGamma& ); // Not implemented
index 013aac7..62b6e90 100644 (file)
@@ -71,6 +71,7 @@ fV0Reader(NULL),
    fMotherList(NULL),
    fTrueList(NULL),
    fMCList(NULL),
+   fQAFolder(NULL),
    fOutputContainer(0),
    fReaderGammas(NULL),
    fSelectorElectronIndex(0),
@@ -97,12 +98,22 @@ fV0Reader(NULL),
    hESDDalitzPositronAfterEta(NULL),
    hESDDalitzElectronAfterPhi(NULL),
    hESDDalitzPositronAfterPhi(NULL),
+   hESDDalitzElectronAfterNClsITS(NULL),
+   hESDDalitzPositronAfterNClsITS(NULL),
    hESDDalitzElectronAfterNFindClsTPC(NULL),
    hESDDalitzPositronAfterNFindClsTPC(NULL),
+   hESDDalitzElectronAfterNClsTPC(NULL),
+   hESDDalitzPositronAfterNClsTPC(NULL),
    hESDDalitzPosEleAfterDCAxy(NULL),
    hESDDalitzPosEleAfterDCAz(NULL),
-   hESDDalitzPosEleAfterTPCdEdx(NULL),
-   hESDDalitzPosEleAfterTPCdEdxSignal(NULL),
+   hESDDalitzElectronAfterTPCdEdxVsP(NULL),
+   hESDDalitzPositronAfterTPCdEdxVsP(NULL),
+   hESDDalitzElectronAfterTPCdEdxSignalVsP(NULL),
+   hESDDalitzPositronAfterTPCdEdxSignalVsP(NULL),
+   hESDDalitzElectronAfterTPCdEdxVsEta(NULL),
+   hESDDalitzPositronAfterTPCdEdxVsEta(NULL),
+   hESDDalitzElectronAfterTPCdEdxVsPhi(NULL),
+   hESDDalitzPositronAfterTPCdEdxVsPhi(NULL),
    hESDMotherPhi(NULL),
    hESDEposEnegPsiPairDPhi(NULL),
    hESDEposEnegInvMassPt(NULL),
@@ -202,6 +213,7 @@ AliAnalysisTaskGammaConvDalitzV1::AliAnalysisTaskGammaConvDalitzV1( const char*
    fMotherList(NULL),
    fTrueList(NULL),
    fMCList(NULL),
+   fQAFolder(NULL),
    fOutputContainer(0),
    fReaderGammas(NULL),
    fSelectorElectronIndex(0),
@@ -228,12 +240,22 @@ AliAnalysisTaskGammaConvDalitzV1::AliAnalysisTaskGammaConvDalitzV1( const char*
    hESDDalitzPositronAfterEta(NULL),
    hESDDalitzElectronAfterPhi(NULL),
    hESDDalitzPositronAfterPhi(NULL),
+   hESDDalitzElectronAfterNClsITS(NULL),
+   hESDDalitzPositronAfterNClsITS(NULL),
    hESDDalitzElectronAfterNFindClsTPC(NULL),
    hESDDalitzPositronAfterNFindClsTPC(NULL),
+   hESDDalitzElectronAfterNClsTPC(NULL),
+   hESDDalitzPositronAfterNClsTPC(NULL),
    hESDDalitzPosEleAfterDCAxy(NULL),
    hESDDalitzPosEleAfterDCAz(NULL),
-   hESDDalitzPosEleAfterTPCdEdx(NULL),
-   hESDDalitzPosEleAfterTPCdEdxSignal(NULL),
+   hESDDalitzElectronAfterTPCdEdxVsP(NULL),
+   hESDDalitzPositronAfterTPCdEdxVsP(NULL),
+   hESDDalitzElectronAfterTPCdEdxSignalVsP(NULL),
+   hESDDalitzPositronAfterTPCdEdxSignalVsP(NULL),
+   hESDDalitzElectronAfterTPCdEdxVsEta(NULL),
+   hESDDalitzPositronAfterTPCdEdxVsEta(NULL),
+   hESDDalitzElectronAfterTPCdEdxVsPhi(NULL),
+   hESDDalitzPositronAfterTPCdEdxVsPhi(NULL),
    hESDMotherPhi(NULL),
    hESDEposEnegPsiPairDPhi(NULL),
    hESDEposEnegInvMassPt(NULL),
@@ -455,12 +477,13 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
    fESDList                        = new TList*[fnCuts];
    fBackList                       = new TList*[fnCuts];
    fMotherList                     = new TList*[fnCuts];
+   //fQAFolder                       = new TList*[fnCuts];
    hNEvents                        = new TH1I*[fnCuts];
    hNGoodESDTracks                 = new TH1I*[fnCuts];
    hEtaShift                       = new TProfile*[fnCuts];
    hESDConvGammaPt                 = new TH1F*[fnCuts];
    hESDConvGammaEta               = new TH1F*[fnCuts];
-   hESDConvGammaZR                 = new TH2F*[fnCuts];
+   
    hESDDalitzElectronPt            = new TH1F*[fnCuts];
    hESDDalitzPositronPt            = new TH1F*[fnCuts];
    hESDDalitzElectronPhi          = new TH1F*[fnCuts];
@@ -468,22 +491,35 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
    
    if( fDoMesonQA ) {
      
+   fQAFolder  = new TList*[fnCuts];  
+     
    hESDDalitzElectronAfterPt      = new TH1F*[fnCuts];
    hESDDalitzPositronAfterPt       = new TH1F*[fnCuts];
    hESDDalitzElectronAfterEta      = new TH1F*[fnCuts];
    hESDDalitzPositronAfterEta      = 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];
    hESDDalitzPosEleAfterDCAxy     = new TH2F*[fnCuts];
    hESDDalitzPosEleAfterDCAz       = new TH2F*[fnCuts];
-   hESDDalitzPosEleAfterTPCdEdx    = new TH2F*[fnCuts];
-   hESDDalitzPosEleAfterTPCdEdxSignal = 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];
    hESDEposEnegLikeSignBackInvMassPt = new TH2F*[fnCuts];
+   hESDConvGammaZR                 = new TH2F*[fnCuts];
    
    }
    
@@ -516,9 +552,8 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
       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");
@@ -546,9 +581,6 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
       hESDConvGammaEta[iCut] = new TH1F("ESD_ConvGamma_Eta","ESD_ConvGamma_Eta",600,-1.5,1.5);
       fESDList[iCut]->Add(hESDConvGammaEta[iCut]);
       
-      hESDConvGammaZR[iCut]= new TH2F("ESD_ConvGamma_ConversionPoint_ZR","ESD_ConvGamma_ConversionPoint_ZR",1200,-150,150,480,0,120);
-      fESDList[iCut]->Add(hESDConvGammaZR[iCut]);
-
       hESDDalitzElectronPt[iCut] = new TH1F("ESD_DalitzElectron_Pt","ESD_DalitzElectron_Pt",1000,0,25);
       fESDList[iCut]->Add(hESDDalitzElectronPt[iCut]);
 
@@ -565,65 +597,160 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
      
       
       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);
+        
+             
        
-        
+      const Int_t kDCABins=62;
+      Double_t binsDCADummy[63]={-3.0,-2.7,-2.4,-2.1,-1.8,-1.5,-1.2,-0.9,-0.6,-0.3,-0.25,-0.2,-0.19,-0.18,-0.17,-0.16,-0.15,-0.14,-0.13,-0.12,-0.11,-0.10,-0.09,-0.08,-0.07,-0.06,-0.05,-0.04,-0.03,-0.02,-0.01,0.0,0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.2,0.25,0.3,0.6,0.9,1.2,1.5,1.8,2.1,2.4,2.7,3.0};
+
+      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;
+               
+       }
+        
       
+        
+      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);
-      fESDList[iCut]->Add(hESDDalitzElectronAfterPt[iCut]);
+      fQAFolder[iCut]->Add(hESDDalitzElectronAfterPt[iCut]);
 
       hESDDalitzPositronAfterPt[iCut] = new TH1F("ESD_DalitzPositron_After_Pt","ESD_DalitzPositron_After_Pt",1000,0,25);
-      fESDList[iCut]->Add(hESDDalitzPositronAfterPt[iCut]);
+      fQAFolder[iCut]->Add(hESDDalitzPositronAfterPt[iCut]);
         
       hESDDalitzElectronAfterEta[iCut] = new TH1F("ESD_DalitzElectron_After_Eta","ESD_DalitzElectron_After_Eta",600,-1.5,1.5);
-      fESDList[iCut]->Add(hESDDalitzElectronAfterEta[iCut]);
+      fQAFolder[iCut]->Add(hESDDalitzElectronAfterEta[iCut]);
       
       hESDDalitzPositronAfterEta[iCut] = new TH1F("ESD_DalitzPositron_After_Eta","ESD_DalitzElectron_After_Eta",600,-1.5,1.5);
-      fESDList[iCut]->Add(hESDDalitzPositronAfterEta[iCut]);
+      fQAFolder[iCut]->Add(hESDDalitzPositronAfterEta[iCut]);
       
                   
       hESDDalitzElectronAfterPhi[iCut] = new TH1F("ESD_DalitzElectron_After_Phi","ESD_DalitzElectron_After_Phi",360,0,2*TMath::Pi());
-      fESDList[iCut]->Add(hESDDalitzElectronAfterPhi[iCut]);
+      fQAFolder[iCut]->Add(hESDDalitzElectronAfterPhi[iCut]);
 
       hESDDalitzPositronAfterPhi[iCut] = new TH1F("ESD_DalitzPositron_After_Phi","ESD_DalitzPositron_After_Phi",360,0,2*TMath::Pi());
-      fESDList[iCut]->Add(hESDDalitzPositronAfterPhi[iCut]);
+      fQAFolder[iCut]->Add(hESDDalitzPositronAfterPhi[iCut]);
+      
+      hESDDalitzElectronAfterNClsITS[iCut]  = new TH1F("ESD_DalitzElectron_After_NClsITS","ESD_DalitzElectron_After_NClsITS",6,0.,6.);
+      fQAFolder[iCut]->Add(hESDDalitzElectronAfterNClsITS[iCut]);
+      
+      hESDDalitzPositronAfterNClsITS[iCut]  = new TH1F("ESD_DalitzPositron_After_NClsITS","ESD_DalitzPositron_After_NClsITS",6,0.,6.);
+      fQAFolder[iCut]->Add(hESDDalitzPositronAfterNClsITS[iCut]);
+      
       
-      hESDDalitzElectronAfterNFindClsTPC[iCut]  = new TH2F("ESD_DalitzElectron_After_NFindClsTPC","ESD_DalitzElectron_After_NFindClsTPC",100,0,1,400,0.,10.);
-      fESDList[iCut]->Add(hESDDalitzElectronAfterNFindClsTPC[iCut]);
+      hESDDalitzElectronAfterNFindClsTPC[iCut]  = new TH2F("ESD_DalitzElectron_After_NFindClsTPC","ESD_DalitzElectron_After_NFindClsTPC",50,0,1,kPtBins,binsPtDummy);
+      fQAFolder[iCut]->Add(hESDDalitzElectronAfterNFindClsTPC[iCut]);
       
-      hESDDalitzPositronAfterNFindClsTPC[iCut]  = new TH2F("ESD_DalitzPositron_After_NFindClsTPC","ESD_DalitzPositron_After_NFindClsTPC",100,0,1,400,0.,10.);
-      fESDList[iCut]->Add(hESDDalitzPositronAfterNFindClsTPC[iCut]);
+      hESDDalitzPositronAfterNFindClsTPC[iCut]  = new TH2F("ESD_DalitzPositron_After_NFindClsTPC","ESD_DalitzPositron_After_NFindClsTPC",50,0,1,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]);
+      
+         
       
-      hESDDalitzPosEleAfterDCAxy[iCut] = new TH2F("ESD_DalitzPosEle_After_DCAxy","ESD_DalitzPosEle_After_DCAxy",800,-4.0,4.0,400,0.,10.);
-      fESDList[iCut]->Add(hESDDalitzPosEleAfterDCAxy[iCut]);
+      hESDDalitzPosEleAfterDCAxy[iCut] = new TH2F("ESD_DalitzPosEle_After_DCAxy","ESD_DalitzPosEle_After_DCAxy",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
+      fQAFolder[iCut]->Add(hESDDalitzPosEleAfterDCAxy[iCut]);
       
-      hESDDalitzPosEleAfterDCAz[iCut]  = new TH2F("ESD_DalitzPosEle_After_DCAz","ESD_DalitzPosEle_After_DCAz",800,-4.0,4.0,400,0.,10.);
-      fESDList[iCut]->Add(hESDDalitzPosEleAfterDCAz[iCut]);
+      hESDDalitzPosEleAfterDCAz[iCut]  = new TH2F("ESD_DalitzPosEle_After_DCAz","ESD_DalitzPosEle_After_DCAz",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
+      fQAFolder[iCut]->Add(hESDDalitzPosEleAfterDCAz[iCut]);
       
-      hESDDalitzPosEleAfterTPCdEdx[iCut] = new TH2F("ESD_DalitzPosEle_After_TPCdEdx","ESD_DalitzPosEle_After_TPCdEdx",150,0.05,20,400,-10,10);
-      fESDList[iCut]->Add(hESDDalitzPosEleAfterTPCdEdx[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]);
       
-      hESDDalitzPosEleAfterTPCdEdxSignal[iCut] =new TH2F("ESD_DalitzPosEle_After_TPCdEdxSignal","ESD_DalitzPosEle_After_TPCdEdxSignal" ,150,0.05,20.0,800,0.0,200);
-      fESDList[iCut]->Add(hESDDalitzPosEleAfterTPCdEdxSignal[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());
-      fESDList[iCut]->Add(hESDMotherPhi[iCut]);
+      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 );
-      fESDList[iCut]->Add(hESDEposEnegPsiPairDPhi[iCut]);
+      fQAFolder[iCut]->Add(hESDEposEnegPsiPairDPhi[iCut]);
 
       hESDEposEnegInvMassPt[iCut] = new TH2F("ESD_EposEneg_InvMassPt","ESD_EposEneg_InvMassPt",5000,0.,5.,100,0.,10.);
-      fESDList[iCut]->Add(hESDEposEnegInvMassPt[iCut]);
+      fQAFolder[iCut]->Add(hESDEposEnegInvMassPt[iCut]);
       
       hESDEposEnegLikeSignBackInvMassPt[iCut]  = new TH2F("ESD_EposEneg_LikeSignBack_InvMassPt","ESD_EposEneg_LikeSignBack_InvMassPt",5000,0.,5.,100,0.,10.);
-      fESDList[iCut]->Add(hESDEposEnegLikeSignBackInvMassPt[iCut]);
+      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);
@@ -647,29 +774,11 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
       hESDMotherBackInvMassPt[iCut] = new TH2F("ESD_DalitzBackground_InvMass_Pt","ESD_DalitzBackground_InvMass_Pt",800,0,0.8,250,0,25);
       fESDList[iCut]->Add(hESDMotherBackInvMassPt[iCut]);
 
-
-      if ( fDoMesonQA ) {
-       
-      TAxis *AxisAfter = hESDDalitzPosEleAfterTPCdEdx[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 = hESDDalitzPosEleAfterTPCdEdxSignal[iCut]->GetXaxis(); 
-      AxisAfter->Set(bins, newBins);
-
-      delete [] newBins;
-      
-      }
-
-            
+           
       
       fCutFolder[iCut]->Add(fESDList[iCut]);
+      
+      
 
    }
 
@@ -850,8 +959,6 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
 
 
 
-
-
         }
 
 
@@ -1209,7 +1316,7 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessPhotonCandidates()
         if(fIsFromMBHeader){
              hESDConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt());
              hESDConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta());
-             hESDConvGammaZR[fiCut]->Fill(PhotonCandidate->GetConversionZ(),PhotonCandidate->GetConversionRadius());
+             if( fDoMesonQA ) hESDConvGammaZR[fiCut]->Fill(PhotonCandidate->GetConversionZ(),PhotonCandidate->GetConversionRadius());
         }
         
          if(fMCEvent){
@@ -1251,7 +1358,7 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessPhotonCandidates()
             if(fIsFromMBHeader){
                hESDConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt());
                hESDConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta());
-               hESDConvGammaZR[fiCut]->Fill(PhotonCandidate->GetConversionZ(),PhotonCandidate->GetConversionRadius());
+               if( fDoMesonQA )hESDConvGammaZR[fiCut]->Fill(PhotonCandidate->GetConversionZ(),PhotonCandidate->GetConversionRadius());
             }
             
             if(fMCEvent){
@@ -1280,7 +1387,7 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessPhotonCandidates()
          if(fIsFromMBHeader){
              hESDConvGammaPt[fiCut]->Fill(PhotonCandidate->Pt()); // Differences to old V0Reader in p_t due to conversion KF->TLorentzVector
              hESDConvGammaEta[fiCut]->Fill(PhotonCandidate->Eta());
-             hESDConvGammaZR[fiCut]->Fill(PhotonCandidate->GetConversionZ(),PhotonCandidate->GetConversionRadius());
+             if(fDoMesonQA)hESDConvGammaZR[fiCut]->Fill(PhotonCandidate->GetConversionZ(),PhotonCandidate->GetConversionRadius());
          }
         
          if(fMCEvent){
@@ -1729,47 +1836,6 @@ void AliAnalysisTaskGammaConvDalitzV1::CalculatePi0DalitzCandidates(){
                   mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fGoodGammas->GetEntries());
                }
              
-             AliESDtrack *positronVgamma = 0;
-             AliESDtrack *electronVgamma = 0;
-             
-             Double_t clsToFPos = -1.0;
-             Double_t clsToFNeg = -1.0;
-             
-             Float_t dcaToVertexXYPos = -1.0;
-             Float_t dcaToVertexZPos  = -1.0;
-             Float_t dcaToVertexXYNeg = -1.0;
-             Float_t dcaToVertexZNeg  = -1.0;
-             
-             
-              if ( fDoMesonQA ) {
-             
-               positronVgamma = fESDEvent->GetTrack( Vgamma->GetTrackLabelPositive() );
-               electronVgamma = fESDEvent->GetTrack( Vgamma->GetTrackLabelNegative() );
-               clsToFPos = ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetNFindableClustersTPC(positronVgamma);
-               clsToFNeg = ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetNFindableClustersTPC(electronVgamma);
-             
-               Float_t bPos[2];
-               Float_t bCovPos[3];
-               positronVgamma->GetImpactParameters(bPos,bCovPos);
-               if (bCovPos[0]<=0 || bCovPos[2]<=0) {
-                 AliDebug(1, "Estimated b resolution lower or equal zero!");
-                 bCovPos[0]=0; bCovPos[2]=0;
-               }
-             
-               Float_t bNeg[2];
-               Float_t bCovNeg[3];
-               positronVgamma->GetImpactParameters(bNeg,bCovNeg);
-               if (bCovNeg[0]<=0 || bCovNeg[2]<=0) {
-                 AliDebug(1, "Estimated b resolution lower or equal zero!");
-                 bCovNeg[0]=0; bCovNeg[2]=0;
-               }
-             
-               dcaToVertexXYPos = bPos[0];
-               dcaToVertexZPos  = bPos[1];
-               dcaToVertexXYNeg = bNeg[0];
-               dcaToVertexZNeg  = bNeg[1];
-             
-              }
                      
              
               if(  ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoMassCut() == kTRUE ) {
@@ -1785,34 +1851,12 @@ void AliAnalysisTaskGammaConvDalitzV1::CalculatePi0DalitzCandidates(){
                 
                    if ( fDoMesonQA ) {
                    
-                    hESDMotherPhi[fiCut]->Fill(pi0cand->Phi());
+                      hESDMotherPhi[fiCut]->Fill(pi0cand->Phi());
                 
                        if( lGoodVirtualGamma[virtualGammaIndex] == kFALSE ) {
                 
-                         hESDDalitzElectronAfterPt[fiCut]->Fill(  electronVgamma->Pt()  );
-                         hESDDalitzPositronAfterPt[fiCut]->Fill(  positronVgamma->Pt()  );
+                         FillElectronQAHistos(Vgamma);
                          
-                         hESDDalitzElectronAfterEta[fiCut]->Fill( electronVgamma->Eta() );
-                         hESDDalitzPositronAfterEta[fiCut]->Fill( positronVgamma->Eta() );
-                
-                         hESDDalitzElectronAfterPhi[fiCut]->Fill( electronVgamma->Phi() );
-                         hESDDalitzPositronAfterPhi[fiCut]->Fill( positronVgamma->Phi() );
-                     
-                         hESDDalitzElectronAfterNFindClsTPC[fiCut]->Fill(clsToFNeg,electronVgamma->Pt());
-                         hESDDalitzPositronAfterNFindClsTPC[fiCut]->Fill(clsToFPos,positronVgamma->Pt());
-                     
-                     
-                         hESDDalitzPosEleAfterDCAxy[fiCut]->Fill(  dcaToVertexXYNeg, electronVgamma->Pt() );
-                         hESDDalitzPosEleAfterDCAz[fiCut]->Fill(   dcaToVertexZNeg,  electronVgamma->Pt() );
-                         hESDDalitzPosEleAfterDCAxy[fiCut]->Fill(  dcaToVertexXYPos, positronVgamma->Pt() );
-                         hESDDalitzPosEleAfterDCAz[fiCut]->Fill(   dcaToVertexZPos,  positronVgamma->Pt() );
-                     
-                         hESDDalitzPosEleAfterTPCdEdx[fiCut]->Fill( positronVgamma->P(),((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetPIDResponse()->NumberOfSigmasTPC(positronVgamma, AliPID::kElectron) );
-                         hESDDalitzPosEleAfterTPCdEdx[fiCut]->Fill( electronVgamma->P(),((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetPIDResponse()->NumberOfSigmasTPC(electronVgamma, AliPID::kElectron) );
-                     
-                         hESDDalitzPosEleAfterTPCdEdxSignal[fiCut]->Fill( positronVgamma->P(), TMath::Abs(positronVgamma->GetTPCsignal()));
-                         hESDDalitzPosEleAfterTPCdEdxSignal[fiCut]->Fill( electronVgamma->P(), TMath::Abs(electronVgamma->GetTPCsignal()));
-                     
                          lGoodVirtualGamma[virtualGammaIndex] = kTRUE;
                      }
                   }
@@ -1829,31 +1873,9 @@ void AliAnalysisTaskGammaConvDalitzV1::CalculatePi0DalitzCandidates(){
                    hESDMotherPhi[fiCut]->Fill(pi0cand->Phi());
                 
                    if( lGoodVirtualGamma[virtualGammaIndex] == kFALSE ) {
-                
-                     hESDDalitzElectronAfterPt[fiCut]->Fill(  electronVgamma->Pt()  );
-                     hESDDalitzPositronAfterPt[fiCut]->Fill(  positronVgamma->Pt()  );
                      
-                     hESDDalitzElectronAfterEta[fiCut]->Fill( electronVgamma->Eta() );
-                     hESDDalitzPositronAfterEta[fiCut]->Fill( positronVgamma->Eta() );
+                     FillElectronQAHistos(Vgamma);
                 
-                     hESDDalitzElectronAfterPhi[fiCut]->Fill( electronVgamma->Phi() );
-                     hESDDalitzPositronAfterPhi[fiCut]->Fill( positronVgamma->Phi() );
-                     
-                     hESDDalitzElectronAfterNFindClsTPC[fiCut]->Fill(clsToFNeg,electronVgamma->Pt());
-                     hESDDalitzPositronAfterNFindClsTPC[fiCut]->Fill(clsToFPos,positronVgamma->Pt());
-                     
-                     hESDDalitzPosEleAfterDCAxy[fiCut]->Fill(  dcaToVertexXYNeg, electronVgamma->Pt() );
-                     hESDDalitzPosEleAfterDCAz[fiCut]->Fill(   dcaToVertexZNeg,  electronVgamma->Pt() );
-                     hESDDalitzPosEleAfterDCAxy[fiCut]->Fill(  dcaToVertexXYPos, positronVgamma->Pt() );
-                     hESDDalitzPosEleAfterDCAz[fiCut]->Fill(   dcaToVertexZPos,  positronVgamma->Pt() );
-                     
-                     hESDDalitzPosEleAfterTPCdEdx[fiCut]->Fill( positronVgamma->P(),((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetPIDResponse()->NumberOfSigmasTPC(positronVgamma, AliPID::kElectron) );
-                     hESDDalitzPosEleAfterTPCdEdx[fiCut]->Fill( electronVgamma->P(),((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetPIDResponse()->NumberOfSigmasTPC(electronVgamma, AliPID::kElectron) );
-                     
-                     hESDDalitzPosEleAfterTPCdEdxSignal[fiCut]->Fill( positronVgamma->P(), TMath::Abs(positronVgamma->GetTPCsignal()));
-                     hESDDalitzPosEleAfterTPCdEdxSignal[fiCut]->Fill( electronVgamma->P(), TMath::Abs(electronVgamma->GetTPCsignal()));
-                     
-                     
                      lGoodVirtualGamma[virtualGammaIndex] = kTRUE;
                 
                    }
@@ -2499,6 +2521,108 @@ Bool_t AliAnalysisTaskGammaConvDalitzV1::IsPi0DalitzDaughter( Int_t label ) cons
        
 }
 
+void AliAnalysisTaskGammaConvDalitzV1::FillElectronQAHistos(AliAODConversionPhoton *Vgamma) const
+{
+  
+
+             AliESDtrack *positronVgamma = 0;
+             AliESDtrack *electronVgamma = 0;
+             
+             Double_t clsToFPos = -1.0;
+             Double_t clsToFNeg = -1.0;
+            
+             Double_t NumClsITSPos = -1.0;
+             Double_t NumClsITSNeg = -1.0;
+             Double_t NumClsTPCPos = -1.0;
+             Double_t NumClsTPCNeg = -1.0;
+                     
+             Float_t dcaToVertexXYPos = -1.0;
+             Float_t dcaToVertexZPos  = -1.0;
+             Float_t dcaToVertexXYNeg = -1.0;
+             Float_t dcaToVertexZNeg  = -1.0;
+             
+             Double_t nSigmaPosTPC = -999.;
+             Double_t nSigmaNegTPC = -999.;
+             
+             positronVgamma = fESDEvent->GetTrack( Vgamma->GetTrackLabelPositive() );
+             electronVgamma = fESDEvent->GetTrack( Vgamma->GetTrackLabelNegative() );
+             clsToFPos = ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetNFindableClustersTPC(positronVgamma);
+             clsToFNeg = ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetNFindableClustersTPC(electronVgamma);
+             
+             nSigmaPosTPC = ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetPIDResponse()->NumberOfSigmasTPC(positronVgamma, AliPID::kElectron) ;
+             nSigmaNegTPC = ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetPIDResponse()->NumberOfSigmasTPC(electronVgamma, AliPID::kElectron) ;
+              
+             
+             
+             NumClsITSPos =  positronVgamma->GetNcls(0); //Get number of ITS clusters
+             NumClsITSNeg =  electronVgamma->GetNcls(0);
+             NumClsTPCPos =  positronVgamma->GetNcls(1);  //Get number of TPC clusters
+             NumClsTPCNeg =  electronVgamma->GetNcls(1);
+             
+             
+             Float_t bPos[2];
+             Float_t bCovPos[3];
+             positronVgamma->GetImpactParameters(bPos,bCovPos);
+             
+             if (bCovPos[0]<=0 || bCovPos[2]<=0) {
+                 AliDebug(1, "Estimated b resolution lower or equal zero!");
+                 bCovPos[0]=0; bCovPos[2]=0;
+              }
+             
+              Float_t bNeg[2];
+              Float_t bCovNeg[3];
+              positronVgamma->GetImpactParameters(bNeg,bCovNeg);
+              
+              if (bCovNeg[0]<=0 || bCovNeg[2]<=0) {
+                 AliDebug(1, "Estimated b resolution lower or equal zero!");
+                 bCovNeg[0]=0; bCovNeg[2]=0;
+               }
+             
+              dcaToVertexXYPos = bPos[0];
+              dcaToVertexZPos  = bPos[1];
+              dcaToVertexXYNeg = bNeg[0];
+              dcaToVertexZNeg  = bNeg[1];
+             
+              hESDDalitzElectronAfterPt[fiCut]->Fill(  electronVgamma->Pt()  );
+              hESDDalitzPositronAfterPt[fiCut]->Fill(  positronVgamma->Pt()  );
+                         
+              hESDDalitzElectronAfterEta[fiCut]->Fill( electronVgamma->Eta() );
+              hESDDalitzPositronAfterEta[fiCut]->Fill( positronVgamma->Eta() );
+                
+              hESDDalitzElectronAfterPhi[fiCut]->Fill( electronVgamma->Phi() );
+              hESDDalitzPositronAfterPhi[fiCut]->Fill( positronVgamma->Phi() );
+                     
+              hESDDalitzElectronAfterNFindClsTPC[fiCut]->Fill(clsToFNeg,electronVgamma->Pt());
+              hESDDalitzPositronAfterNFindClsTPC[fiCut]->Fill(clsToFPos,positronVgamma->Pt());
+              
+              hESDDalitzElectronAfterNClsTPC[fiCut]->Fill( NumClsTPCNeg,electronVgamma->Pt());
+              hESDDalitzPositronAfterNClsTPC[fiCut]->Fill( NumClsTPCPos,positronVgamma->Pt());
+              
+              hESDDalitzElectronAfterNClsITS[fiCut]->Fill( NumClsITSNeg);
+              hESDDalitzPositronAfterNClsITS[fiCut]->Fill( NumClsITSPos);
+              
+              hESDDalitzPosEleAfterDCAxy[fiCut]->Fill(  dcaToVertexXYNeg, electronVgamma->Pt() );
+              hESDDalitzPosEleAfterDCAz[fiCut]->Fill(   dcaToVertexZNeg,  electronVgamma->Pt() );
+              hESDDalitzPosEleAfterDCAxy[fiCut]->Fill(  dcaToVertexXYPos, positronVgamma->Pt() );
+              hESDDalitzPosEleAfterDCAz[fiCut]->Fill(   dcaToVertexZPos,  positronVgamma->Pt() );
+                     
+              hESDDalitzElectronAfterTPCdEdxVsP[fiCut]->Fill( electronVgamma->P(),nSigmaNegTPC);
+              hESDDalitzPositronAfterTPCdEdxVsP[fiCut]->Fill( positronVgamma->P(), nSigmaPosTPC);
+              
+              hESDDalitzElectronAfterTPCdEdxVsEta[fiCut]->Fill( electronVgamma->Eta(),nSigmaNegTPC);
+               hESDDalitzPositronAfterTPCdEdxVsEta[fiCut]->Fill( positronVgamma->Eta(),nSigmaPosTPC);
+              
+               hESDDalitzElectronAfterTPCdEdxVsPhi[fiCut]->Fill( electronVgamma->Phi(),nSigmaNegTPC);
+               hESDDalitzPositronAfterTPCdEdxVsPhi[fiCut]->Fill( positronVgamma->Phi(),nSigmaPosTPC);
+              
+                             
+              hESDDalitzElectronAfterTPCdEdxSignalVsP[fiCut]->Fill( electronVgamma->P(), TMath::Abs(electronVgamma->GetTPCsignal()));
+              hESDDalitzPositronAfterTPCdEdxSignalVsP[fiCut]->Fill( positronVgamma->P(), TMath::Abs(positronVgamma->GetTPCsignal()));
+                   
+              
+  
+}
+
 
 //_____________________________________________________________________________
 Double_t AliAnalysisTaskGammaConvDalitzV1::GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg ) const
@@ -2508,7 +2632,7 @@ Double_t AliAnalysisTaskGammaConvDalitzV1::GetPsiPair( const AliESDtrack *trackP
    // direction ?0 to the opening angle ? Pair
    //
    // Ref. Measurement of photons via conversion pairs with the PHENIX experiment at RHIC
-   //      Master Thesis. Thorsten Dahms. 2005
+   //      Mas   ter Thesis. Thorsten Dahms. 2005
    // https://twiki.cern.ch/twiki/pub/ALICE/GammaPhysicsPublications/tdahms_thesis.pdf
    //
    Double_t momPos[3];
index 7e74639..af43957 100644 (file)
@@ -78,6 +78,7 @@ class AliAnalysisTaskGammaConvDalitzV1: public AliAnalysisTaskSE
                 void CalculatePi0DalitzCandidates();
                 void CalculateBackground();
                 void UpdateEventByEventData();
+               void FillElectronQAHistos(AliAODConversionPhoton *Vgamma) const;
                 Double_t GetPsiPair( const AliESDtrack *trackPos, const AliESDtrack *trackNeg ) const;
                Bool_t IsDalitz(TParticle *fMCMother) const;
                 Bool_t IsPi0DalitzDaughter( Int_t label ) const;
@@ -96,6 +97,7 @@ class AliAnalysisTaskGammaConvDalitzV1: public AliAnalysisTaskSE
     TList **fMotherList;
     TList **fTrueList;
     TList **fMCList;
+    TList **fQAFolder;
     TList *fOutputContainer;
     TClonesArray *fReaderGammas;
     vector<Int_t> fSelectorElectronIndex;
@@ -122,12 +124,22 @@ class AliAnalysisTaskGammaConvDalitzV1: public AliAnalysisTaskSE
     TH1F **hESDDalitzPositronAfterEta;
     TH1F **hESDDalitzElectronAfterPhi;
     TH1F **hESDDalitzPositronAfterPhi;
+    TH1F **hESDDalitzElectronAfterNClsITS;
+    TH1F **hESDDalitzPositronAfterNClsITS;
     TH2F **hESDDalitzElectronAfterNFindClsTPC;
     TH2F **hESDDalitzPositronAfterNFindClsTPC;
+    TH2F **hESDDalitzElectronAfterNClsTPC;
+    TH2F **hESDDalitzPositronAfterNClsTPC;
     TH2F **hESDDalitzPosEleAfterDCAxy;
     TH2F **hESDDalitzPosEleAfterDCAz;
-    TH2F **hESDDalitzPosEleAfterTPCdEdx;
-    TH2F **hESDDalitzPosEleAfterTPCdEdxSignal;
+    TH2F **hESDDalitzElectronAfterTPCdEdxVsP;
+    TH2F **hESDDalitzPositronAfterTPCdEdxVsP;
+    TH2F **hESDDalitzElectronAfterTPCdEdxSignalVsP;
+    TH2F **hESDDalitzPositronAfterTPCdEdxSignalVsP;
+    TH2F **hESDDalitzElectronAfterTPCdEdxVsEta;
+    TH2F **hESDDalitzPositronAfterTPCdEdxVsEta;
+    TH2F **hESDDalitzElectronAfterTPCdEdxVsPhi;
+    TH2F **hESDDalitzPositronAfterTPCdEdxVsPhi;
     TH1F **hESDMotherPhi;
     TH2F **hESDEposEnegPsiPairDPhi;
     TH2F **hESDEposEnegInvMassPt;
index 26ff582..6b9bd7e 100644 (file)
@@ -125,6 +125,10 @@ AliAnalysisTaskGammaConvV1::AliAnalysisTaskGammaConvV1(): AliAnalysisTaskSE(),
    hMCK0sPt(NULL),
    hMCK0sWOWeightPt(NULL),
    hMCK0sPtY(NULL),
+   hMCSecPi0PtvsSource(NULL),
+   hMCSecPi0Source(NULL),
+   hMCSecEtaPt(NULL),
+   hMCSecEtaSource(NULL),
    hESDTrueMotherInvMassPt(NULL),
    hESDTruePrimaryMotherInvMassPt(NULL),
    hESDTruePrimaryMotherW0WeightingInvMassPt(NULL),
@@ -136,6 +140,8 @@ AliAnalysisTaskGammaConvV1::AliAnalysisTaskGammaConvV1(): AliAnalysisTaskSE(),
    hESDTrueK0sWithPi0DaughterMCPt(NULL),
    hESDTrueSecondaryMotherFromEtaInvMassPt(NULL),
    hESDTrueEtaWithPi0DaughterMCPt(NULL),
+   hESDTrueSecondaryMotherFromLambdaInvMassPt(NULL),
+   hESDTrueLambdaWithPi0DaughterMCPt(NULL),
    hESDTrueBckGGInvMassPt(NULL),
    hESDTrueBckContInvMassPt(NULL),
    hESDTruePi0PtY(NULL),
@@ -260,6 +266,10 @@ AliAnalysisTaskGammaConvV1::AliAnalysisTaskGammaConvV1(const char *name):
    hMCK0sPt(NULL),
    hMCK0sWOWeightPt(NULL),
    hMCK0sPtY(NULL),
+   hMCSecPi0PtvsSource(NULL),
+   hMCSecPi0Source(NULL),
+   hMCSecEtaPt(NULL),
+   hMCSecEtaSource(NULL),
    hESDTrueMotherInvMassPt(NULL),
    hESDTruePrimaryMotherInvMassPt(NULL),
    hESDTruePrimaryMotherW0WeightingInvMassPt(NULL),
@@ -271,6 +281,8 @@ AliAnalysisTaskGammaConvV1::AliAnalysisTaskGammaConvV1(const char *name):
    hESDTrueK0sWithPi0DaughterMCPt(NULL),
    hESDTrueSecondaryMotherFromEtaInvMassPt(NULL),
    hESDTrueEtaWithPi0DaughterMCPt(NULL),
+   hESDTrueSecondaryMotherFromLambdaInvMassPt(NULL),
+   hESDTrueLambdaWithPi0DaughterMCPt(NULL),
    hESDTrueBckGGInvMassPt(NULL),
    hESDTrueBckContInvMassPt(NULL),
    hESDTruePi0PtY(NULL),
@@ -414,487 +426,507 @@ void AliAnalysisTaskGammaConvV1::InitBack(){
    }
 }
 //________________________________________________________________________
-void AliAnalysisTaskGammaConvV1::UserCreateOutputObjects()
-{
-
-   // Create histograms
-   if(fOutputContainer != NULL){
-      delete fOutputContainer;
-      fOutputContainer = NULL;
-   }
-   if(fOutputContainer == NULL){
-      fOutputContainer = new TList();
-      fOutputContainer->SetOwner(kTRUE);
-   }
-
-   // Array of current cut's gammas
-   fGammaCandidates = new TList();
-
-   fCutFolder = new TList*[fnCuts];
-   fESDList = new TList*[fnCuts];
-   fBackList = new TList*[fnCuts];
-   fMotherList = new TList*[fnCuts];
-   hNEvents = new TH1I*[fnCuts];
-   hNGoodESDTracks = new TH1I*[fnCuts];
-   hNGammaCandidates = new TH1I*[fnCuts];
-   hNV0Tracks = new TH1I*[fnCuts];
-   hEtaShift = new TProfile*[fnCuts];
-   hESDConvGammaPt = new TH1F*[fnCuts];
-
-   if (fDoPhotonQA == 2){
-      fPhotonDCAList = new TList*[fnCuts];
-      tESDConvGammaPtDcazCat = new TTree*[fnCuts];
-   }
-   if (fDoPhotonQA > 0){
-      hESDConvGammaR = new TH1F*[fnCuts];
-      hESDConvGammaEta = new TH1F*[fnCuts];
-   } 
-   
-   if(fDoMesonAnalysis){
-      hESDMotherInvMassPt = new TH2F*[fnCuts];
-      hESDMotherBackInvMassPt = new TH2F*[fnCuts];
-      hESDMotherInvMassEalpha = new TH2F*[fnCuts];
-      if (fDoMesonQA == 2){
-         fMesonDCAList = new TList*[fnCuts];
-         tESDMesonsInvMassPtDcazMinDcazMaxFlag = new TTree*[fnCuts];
-      }
-      if (fDoMesonQA > 0){
-         hESDMotherPi0PtY =  new TH2F*[fnCuts];
-         hESDMotherEtaPtY =  new TH2F*[fnCuts];
-         hESDMotherPi0PtAlpha =  new TH2F*[fnCuts];
-         hESDMotherEtaPtAlpha =  new TH2F*[fnCuts];
-         hESDMotherPi0PtOpenAngle =  new TH2F*[fnCuts];
-         hESDMotherEtaPtOpenAngle =  new TH2F*[fnCuts];
-      }   
-   }
-
-   for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-
-      TString cutstring = ((AliConversionCuts*)fCutArray->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",cutstring.Data(),cutstringMeson.Data()));
-      fCutFolder[iCut]->SetOwner(kTRUE);
-      fOutputContainer->Add(fCutFolder[iCut]);
-      fESDList[iCut] = new TList();
-      fESDList[iCut]->SetName(Form("%s_%s ESD histograms",cutstring.Data(),cutstringMeson.Data()));
-      fESDList[iCut]->SetOwner(kTRUE);
-      fCutFolder[iCut]->Add(fESDList[iCut]);
-
-      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");
-      if (((AliConversionCuts*)fCutArray->At(iCut))->IsSpecialTrigger() == 4 ){
-         TString TriggerNames = "Not Trigger: ";
-         TriggerNames = TriggerNames+ ( (AliConversionCuts*)fCutArray->At(iCut))->GetSpecialTriggerName();
-         hNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
-      } else {
-         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 == 1) hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",4000,0,4000);
-      else if(fIsHeavyIon == 2) hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",400,0,400);
-      else hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200);
-      fESDList[iCut]->Add(hNGoodESDTracks[iCut]);
-      if(fIsHeavyIon == 1) hNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",100,0,100);
-      else if(fIsHeavyIon == 2) hNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",50,0,50);
-      else hNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",50,0,50);
-      fESDList[iCut]->Add(hNGammaCandidates[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]);
-
-      if (fDoPhotonQA == 2){
-         fPhotonDCAList[iCut] = new TList();
-         fPhotonDCAList[iCut]->SetName(Form("%s_%s Photon DCA tree",cutstring.Data(),cutstringMeson.Data()));
-         fPhotonDCAList[iCut]->SetOwner(kTRUE);
-         fCutFolder[iCut]->Add(fPhotonDCAList[iCut]);
-            
-        tESDConvGammaPtDcazCat[iCut] = new TTree("ESD_ConvGamma_Pt_Dcaz_R_Eta","ESD_ConvGamma_Pt_Dcaz_R_Eta_Cat");   
-         tESDConvGammaPtDcazCat[iCut]->Branch("Pt",&fPtGamma,"fPtGamma/F");
-         tESDConvGammaPtDcazCat[iCut]->Branch("DcaZPhoton",&fDCAzPhoton,"fDCAzPhoton/F");
-//          tESDConvGammaPtDcazCat[iCut]->Branch("R",&fRConvPhoton,"fRConvPhoton/F");
-//          tESDConvGammaPtDcazCat[iCut]->Branch("Eta",&fEtaPhoton,"fEtaPhoton/F");
-         
-         tESDConvGammaPtDcazCat[iCut]->Branch("cat",&iCatPhoton,"iCatPhoton/b");
-         if(fIsMC){
-            tESDConvGammaPtDcazCat[iCut]->Branch("photonMCInfo",&iPhotonMCInfo,"iPhotonMCInfo/b");
-         }
-         fPhotonDCAList[iCut]->Add(tESDConvGammaPtDcazCat[iCut]);
-      }
-
-      if (fDoPhotonQA > 0){
-         hESDConvGammaR[iCut] = new TH1F("ESD_ConvGamma_R","ESD_ConvGamma_R",800,0,200);
-         fESDList[iCut]->Add(hESDConvGammaR[iCut]);
-         hESDConvGammaEta[iCut] = new TH1F("ESD_ConvGamma_Eta","ESD_ConvGamma_Eta",2000,-2,2);
-         fESDList[iCut]->Add(hESDConvGammaEta[iCut]);
-      }
-      
-      if(fDoMesonAnalysis){
-         hESDMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt","ESD_Mother_InvMass_Pt",800,0,0.8,250,0,25);
-         fESDList[iCut]->Add(hESDMotherInvMassPt[iCut]);
-         hESDMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt","ESD_Background_InvMass_Pt",800,0,0.8,250,0,25);
-         fESDList[iCut]->Add(hESDMotherBackInvMassPt[iCut]);
-         hESDMotherInvMassEalpha[iCut] = new TH2F("ESD_Mother_InvMass_vs_E_alpha","ESD_Mother_InvMass_vs_E_alpha",800,0,0.8,250,0,25);
-         fESDList[iCut]->Add(hESDMotherInvMassEalpha[iCut]);
-         if (fDoMesonQA == 2){    
-            fMesonDCAList[iCut] = new TList();
-            fMesonDCAList[iCut]->SetName(Form("%s_%s Meson DCA tree",cutstring.Data(),cutstringMeson.Data()));
-            fMesonDCAList[iCut]->SetOwner(kTRUE);
-            fCutFolder[iCut]->Add(fMesonDCAList[iCut]);
-            
-            tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut] = new TTree("ESD_Mesons_InvMass_Pt_DcazMin_DcazMax_Flag","ESD_Mesons_InvMass_Pt_DcazMin_DcazMax_Flag");   
-            tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("InvMass",&fInvMass,"fInvMass/F");
-            tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("Pt",&fPt,"fPt/F");
-            tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("DcaZMin",&fDCAzGammaMin,"fDCAzGammaMin/F");
-            tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("DcaZMax",&fDCAzGammaMax,"fDCAzGammaMax/F");
-            tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("kind",&iFlag,"iFlag/b");
-            if(fIsMC){
-               tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("mesonMCInfo",&iMesonMCInfo,"iMesonMCInfo/b");
-            }
-            fMesonDCAList[iCut]->Add(tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]);
-              
-         }
-         if (fDoMesonQA > 0 ){
-            hESDMotherPi0PtY[iCut] = new TH2F("ESD_MotherPi0_Pt_Y","ESD_MotherPi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);            
-            SetLogBinningXTH2(hESDMotherPi0PtY[iCut]);
-            fESDList[iCut]->Add(hESDMotherPi0PtY[iCut]);
-            hESDMotherEtaPtY[iCut] = new TH2F("ESD_MotherEta_Pt_Y","ESD_MotherEta_Pt_Y",150,0.03,15.,150,-1.5,1.5);
-            SetLogBinningXTH2(hESDMotherEtaPtY[iCut]);
-            fESDList[iCut]->Add(hESDMotherEtaPtY[iCut]);
-            hESDMotherPi0PtAlpha[iCut] = new TH2F("ESD_MotherPi0_Pt_Alpha","ESD_MotherPi0_Pt_Alpha",150,0.03,15.,100,0,1);            
-            SetLogBinningXTH2(hESDMotherPi0PtAlpha[iCut]);
-            fESDList[iCut]->Add(hESDMotherPi0PtAlpha[iCut]);
-            hESDMotherEtaPtAlpha[iCut] = new TH2F("ESD_MotherEta_Pt_Alpha","ESD_MotherEta_Pt_Alpha",150,0.03,15.,100,0,1);
-            SetLogBinningXTH2(hESDMotherEtaPtAlpha[iCut]);
-            fESDList[iCut]->Add(hESDMotherEtaPtAlpha[iCut]);
-            hESDMotherPi0PtOpenAngle[iCut] = new TH2F("ESD_MotherPi0_Pt_OpenAngle","ESD_MotherPi0_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi());            
-            SetLogBinningXTH2(hESDMotherPi0PtOpenAngle[iCut]);
-            fESDList[iCut]->Add(hESDMotherPi0PtOpenAngle[iCut]);
-            hESDMotherEtaPtOpenAngle[iCut] = new TH2F("ESD_MotherEta_Pt_OpenAngle","ESD_MotherEta_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi());            
-            SetLogBinningXTH2(hESDMotherEtaPtOpenAngle[iCut]);
-            fESDList[iCut]->Add(hESDMotherEtaPtOpenAngle[iCut]);
-         }
-         
-            
-      }
-
-
-   }
-   if(fDoMesonAnalysis){
-      InitBack(); // Init Background Handler
-   }
-
-   if(fIsMC){
-      // MC Histogramms
-      fMCList = new TList*[fnCuts];
-      // True Histogramms
-      fTrueList = new TList*[fnCuts];
-      // Selected Header List
-      fHeaderNameList = new TList*[fnCuts];
-      hMCHeaders = new TH1I*[fnCuts];
-      hMCAllGammaPt = new TH1F*[fnCuts];
-      hMCDecayGammaPi0Pt = new TH1F*[fnCuts];
-      hMCDecayGammaRhoPt = new TH1F*[fnCuts];
-      hMCDecayGammaEtaPt = new TH1F*[fnCuts];
-      hMCDecayGammaOmegaPt = new TH1F*[fnCuts];
-      hMCDecayGammaEtapPt = new TH1F*[fnCuts];
-      hMCDecayGammaPhiPt = new TH1F*[fnCuts];
-      hMCDecayGammaSigmaPt = new TH1F*[fnCuts];
-      hMCConvGammaPt = new TH1F*[fnCuts];
-      hESDTrueConvGammaPt = new TH1F*[fnCuts];
-
-      hESDCombinatorialPt = new TH2F*[fnCuts];
-      hESDTruePrimaryConvGammaPt = new TH1F*[fnCuts];
-      hESDTruePrimaryConvGammaESDPtMCPt = new TH2F*[fnCuts];
-      hESDTrueSecondaryConvGammaPt = new TH1F*[fnCuts];
-      hESDTrueSecondaryConvGammaFromXFromK0sPt = new TH1F*[fnCuts];
-      hESDTrueSecondaryConvGammaFromXFromLambdaPt = new TH1F*[fnCuts];
-
-      hESDTrueDalitzPsiPairDeltaPhi= new TH2F*[fnCuts];
-      hESDTrueGammaPsiPairDeltaPhi= new TH2F*[fnCuts];
-
-      if (fDoPhotonQA > 0){
-         hMCConvGammaR = new TH1F*[fnCuts];
-         hMCConvGammaEta = new TH1F*[fnCuts];
-        hESDTrueConvGammaEta = new TH1F*[fnCuts];
-      }
-
-      if(fDoMesonAnalysis){
-         hMCPi0Pt = new TH1F*[fnCuts];
-         hMCPi0WOWeightPt = new TH1F*[fnCuts];
-         hMCEtaPt = new TH1F*[fnCuts];
-         hMCEtaWOWeightPt = new TH1F*[fnCuts];
-         hMCPi0InAccPt = new TH1F*[fnCuts];
-         hMCEtaInAccPt = new TH1F*[fnCuts];
-
-         hESDTrueMotherInvMassPt = new TH2F*[fnCuts];
-         hESDTruePrimaryMotherInvMassPt = new TH2F*[fnCuts];
-         hESDTruePrimaryMotherW0WeightingInvMassPt = new TH2F*[fnCuts];
-         pESDTruePrimaryMotherWeightsInvMassPt = new TProfile2D*[fnCuts];
-         hESDTrueSecondaryMotherInvMassPt = new TH2F*[fnCuts];
-         hESDTrueSecondaryMotherFromK0sInvMassPt = new TH2F*[fnCuts];
-         hESDTrueSecondaryMotherFromEtaInvMassPt = new TH2F*[fnCuts];
-         hESDTrueMotherDalitzInvMassPt = new TH2F*[fnCuts];
-         if (fDoMesonQA > 0){
-            hMCPi0PtY = new TH2F*[fnCuts];
-            hMCEtaPtY = new TH2F*[fnCuts];
-            hMCK0sPt = new TH1F*[fnCuts];
-            hMCK0sWOWeightPt = new TH1F*[fnCuts];
-            hMCK0sPtY = new TH2F*[fnCuts];
-            hESDTruePrimaryPi0MCPtResolPt = new TH2F*[fnCuts];
-            hESDTruePrimaryEtaMCPtResolPt = new TH2F*[fnCuts];
-            hESDTrueK0sWithPi0DaughterMCPt = new TH1F*[fnCuts];
-            hESDTrueEtaWithPi0DaughterMCPt = new TH1F*[fnCuts];
-            hESDTrueBckGGInvMassPt = new TH2F*[fnCuts];
-            hESDTrueBckContInvMassPt = new TH2F*[fnCuts];
-            hESDTruePi0PtY = new TH2F*[fnCuts];
-            hESDTrueEtaPtY = new TH2F*[fnCuts];
-            hESDTruePi0PtAlpha = new TH2F*[fnCuts];
-            hESDTrueEtaPtAlpha = new TH2F*[fnCuts];
-            hESDTruePi0PtOpenAngle = new TH2F*[fnCuts];
-            hESDTrueEtaPtOpenAngle = new TH2F*[fnCuts];
-         }
-      }
-
-      for(Int_t iCut = 0; iCut<fnCuts;iCut++){
-         TString cutstring = ((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber();
-         TString cutstringMeson = "NoMesonCut";
-         if(fDoMesonAnalysis)cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
-
-         fMCList[iCut] = new TList();
-         fMCList[iCut]->SetName(Form("%s_%s MC histograms",cutstring.Data(),cutstringMeson.Data()));
-         fMCList[iCut]->SetOwner(kTRUE);
-         fCutFolder[iCut]->Add(fMCList[iCut]);
-         hMCHeaders[iCut] = new TH1I("MC_Headers","MC_Headers",20,0,20);
-         fMCList[iCut]->Add(hMCHeaders[iCut]);
-         hMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25);
-         fMCList[iCut]->Add(hMCAllGammaPt[iCut]);
-         hMCDecayGammaPi0Pt[iCut] = new TH1F("MC_DecayGammaPi0_Pt","MC_DecayGammaPi0_Pt",250,0,25);
-         fMCList[iCut]->Add(hMCDecayGammaPi0Pt[iCut]);
-         hMCDecayGammaRhoPt[iCut] = new TH1F("MC_DecayGammaRho_Pt","MC_DecayGammaRho_Pt",250,0,25);
-         fMCList[iCut]->Add(hMCDecayGammaRhoPt[iCut]);
-         hMCDecayGammaEtaPt[iCut] = new TH1F("MC_DecayGammaEta_Pt","MC_DecayGammaEta_Pt",250,0,25);
-         fMCList[iCut]->Add(hMCDecayGammaEtaPt[iCut]);
-         hMCDecayGammaOmegaPt[iCut] = new TH1F("MC_DecayGammaOmega_Pt","MC_DecayGammaOmmega_Pt",250,0,25);
-         fMCList[iCut]->Add(hMCDecayGammaOmegaPt[iCut]);
-         hMCDecayGammaEtapPt[iCut] = new TH1F("MC_DecayGammaEtap_Pt","MC_DecayGammaEtap_Pt",250,0,25);
-         fMCList[iCut]->Add(hMCDecayGammaEtapPt[iCut]);
-         hMCDecayGammaPhiPt[iCut] = new TH1F("MC_DecayGammaPhi_Pt","MC_DecayGammaPhi_Pt",250,0,25);
-         fMCList[iCut]->Add(hMCDecayGammaPhiPt[iCut]);
-         hMCDecayGammaSigmaPt[iCut] = new TH1F("MC_DecayGammaSigma_Pt","MC_DecayGammaSigma_Pt",250,0,25);
-         fMCList[iCut]->Add(hMCDecayGammaSigmaPt[iCut]);
-         hMCConvGammaPt[iCut] = new TH1F("MC_ConvGamma_Pt","MC_ConvGamma_Pt",250,0,25);
-         fMCList[iCut]->Add(hMCConvGammaPt[iCut]);
-      
-         if (fDoPhotonQA > 0){
-            hMCConvGammaR[iCut] = new TH1F("MC_ConvGamma_R","MC_ConvGamma_R",800,0,200);
-            fMCList[iCut]->Add(hMCConvGammaR[iCut]);
-            hMCConvGammaEta[iCut] = new TH1F("MC_ConvGamma_Eta","MC_ConvGamma_Eta",2000,-2,2);
-            fMCList[iCut]->Add(hMCConvGammaEta[iCut]);
-         }
-
-         if(fDoMesonAnalysis){
-            hMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt","MC_Pi0_Pt",250,0,25);
-            hMCPi0Pt[iCut]->Sumw2();
-            fMCList[iCut]->Add(hMCPi0Pt[iCut]);
-            hMCPi0WOWeightPt[iCut] = new TH1F("MC_Pi0_WOWeights_Pt","MC_Pi0_WOWeights_Pt",250,0,25);
-            hMCPi0WOWeightPt[iCut]->Sumw2();
-            fMCList[iCut]->Add(hMCPi0WOWeightPt[iCut]);
-            
-            hMCEtaPt[iCut] = new TH1F("MC_Eta_Pt","MC_Eta_Pt",250,0,25);
-            hMCEtaPt[iCut]->Sumw2();
-            fMCList[iCut]->Add(hMCEtaPt[iCut]);
-            hMCEtaWOWeightPt[iCut] = new TH1F("MC_Eta_WOWeights_Pt","MC_Eta_WOWeights_Pt",250,0,25);
-            hMCEtaWOWeightPt[iCut]->Sumw2();
-            fMCList[iCut]->Add(hMCEtaWOWeightPt[iCut]);
-            hMCPi0InAccPt[iCut] = new TH1F("MC_Pi0InAcc_Pt","MC_Pi0InAcc_Pt",250,0,25);
-            hMCPi0InAccPt[iCut]->Sumw2();
-            fMCList[iCut]->Add(hMCPi0InAccPt[iCut]);
-            hMCEtaInAccPt[iCut] = new TH1F("MC_EtaInAcc_Pt","MC_EtaInAcc_Pt",250,0,25);
-            hMCEtaInAccPt[iCut]->Sumw2();
-            fMCList[iCut]->Add(hMCEtaInAccPt[iCut]);
-            if (fDoMesonQA > 0){
-               hMCPi0PtY[iCut] = new TH2F("MC_Pi0_Pt_Y","MC_Pi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);
-               hMCPi0PtY[iCut]->Sumw2();
-               SetLogBinningXTH2(hMCPi0PtY[iCut]);
-               fMCList[iCut]->Add(hMCPi0PtY[iCut]);
-               hMCEtaPtY[iCut] = new TH2F("MC_Eta_Pt_Y","MC_Eta_Pt_Y",150,0.03,15.,150,-1.5,1.5);
-               hMCEtaPtY[iCut]->Sumw2();
-               SetLogBinningXTH2(hMCEtaPtY[iCut]);
-               fMCList[iCut]->Add(hMCEtaPtY[iCut]);
-               hMCK0sPt[iCut] = new TH1F("MC_K0s_Pt","MC_K0s_Pt",150,0,15);
-               hMCK0sPt[iCut]->Sumw2();
-               fMCList[iCut]->Add(hMCK0sPt[iCut]);
-               hMCK0sWOWeightPt[iCut] = new TH1F("MC_K0s_WOWeights_Pt","MC_K0s_WOWeights_Pt",150,0,15);
-               hMCK0sWOWeightPt[iCut]->Sumw2();
-               fMCList[iCut]->Add(hMCK0sWOWeightPt[iCut]);
-               hMCK0sPtY[iCut] = new TH2F("MC_K0s_Pt_Y","MC_K0s_Pt_Y",150,0.03,15.,150,-1.5,1.5);
-               hMCK0sPtY[iCut]->Sumw2();
-               SetLogBinningXTH2(hMCK0sPtY[iCut]);
-               fMCList[iCut]->Add(hMCK0sPtY[iCut]);
-               
-            }
-
-         }
-         fTrueList[iCut] = new TList();
-         fTrueList[iCut]->SetName(Form("%s_%s True histograms",cutstring.Data(),cutstringMeson.Data()));
-         fTrueList[iCut]->SetOwner(kTRUE);
-         fCutFolder[iCut]->Add(fTrueList[iCut]);
-
-         hESDTrueConvGammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25);
-         fTrueList[iCut]->Add(hESDTrueConvGammaPt[iCut]);
-
-         hESDCombinatorialPt[iCut] = new TH2F("ESD_TrueCombinatorial_Pt","ESD_TrueCombinatorial_Pt",250,0,25,16,-0.5,15.5);
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec+Elec");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 2,"Elec+Pion");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 3,"Elec+Kaon");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 4,"Elec+Proton");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 5,"Elec+Muon");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 6,"Pion+Pion");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 7,"Pion+Kaon");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 8,"Pion+Proton");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 9,"Pion+Muon");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(10,"Kaon+Kaon");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(11,"Kaon+Proton");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(12,"Kaon+Muon");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(13,"Proton+Proton");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(14,"Proton+Muon");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(15,"Muon+Muon");
-         hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(16,"Rest");
-         fTrueList[iCut]->Add(hESDCombinatorialPt[iCut]);
-         hESDTruePrimaryConvGammaPt[iCut] = new TH1F("ESD_TruePrimaryConvGamma_Pt","ESD_TruePrimaryConvGamma_Pt",250,0,25);
-         fTrueList[iCut]->Add(hESDTruePrimaryConvGammaPt[iCut]);
-         hESDTrueSecondaryConvGammaPt[iCut] = new TH1F("ESD_TrueSecondaryConvGamma_Pt","ESD_TrueSecondaryConvGamma_Pt",250,0,25);
-         fTrueList[iCut]->Add(hESDTrueSecondaryConvGammaPt[iCut]);
-
-         hESDTrueSecondaryConvGammaFromXFromK0sPt[iCut]
-            = new TH1F("ESD_TrueSecondaryConvGammaFromXFromK0s_Pt", "ESD_TrueSecondaryConvGammaFromXFromK0s_Pt",250,0,25);
-         fTrueList[iCut]->Add(hESDTrueSecondaryConvGammaFromXFromK0sPt[iCut]);
-         hESDTrueSecondaryConvGammaFromXFromLambdaPt[iCut]
-            = new TH1F("ESD_TrueSecondaryConvGammaFromXFromLambda_Pt", "ESD_TrueSecondaryConvGammaFromXFromLambda_Pt",250,0,25);
-         fTrueList[iCut]->Add(hESDTrueSecondaryConvGammaFromXFromLambdaPt[iCut]);
-
-         hESDTrueDalitzPsiPairDeltaPhi[iCut]
-            = new TH2F("ESD_TrueDalitzPsiPairDeltaPhi_Pt", "ESD_TrueDalitzPsiPairDeltaPhi_Pt",100,-0.5,2,100,-0.5,0.5);
-         fTrueList[iCut]->Add(hESDTrueDalitzPsiPairDeltaPhi[iCut]);
-         
-         hESDTrueGammaPsiPairDeltaPhi[iCut]
-            = new TH2F("ESD_TrueGammaPsiPairDeltaPhi_Pt", "ESD_TrueGammaPsiPairDeltaPhi_Pt",100,-0.5,2,100,-0.5,0.5);
-         fTrueList[iCut]->Add(hESDTrueGammaPsiPairDeltaPhi[iCut]);
-
-         
-         hESDTruePrimaryConvGammaESDPtMCPt[iCut] = new TH2F("ESD_TruePrimaryConvGammaESD_PtMCPt", "ESD_TruePrimaryConvGammaESD_PtMCPt",250,0,25,250,0,25);
-         fTrueList[iCut]->Add(hESDTruePrimaryConvGammaESDPtMCPt[iCut]);
-         
-         if(fDoMesonAnalysis){
-            hESDTrueMotherInvMassPt[iCut] = new TH2F("ESD_TrueMother_InvMass_Pt","ESD_TrueMother_InvMass_Pt",800,0,0.8,250,0,25);
-            fTrueList[iCut]->Add(hESDTrueMotherInvMassPt[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_TruePrimaryMotherW0Weights_InvMass_Pt", "ESD_TruePrimaryMotherW0Weights_InvMass_Pt", 800,0,0.8,250,0,25);
-            hESDTruePrimaryMotherW0WeightingInvMassPt[iCut]->Sumw2();
-            fTrueList[iCut]->Add(hESDTruePrimaryMotherW0WeightingInvMassPt[iCut]);
-            pESDTruePrimaryMotherWeightsInvMassPt[iCut]
-               = new TProfile2D("ESD_TruePrimaryMotherWeights_InvMass_Pt", "ESD_TruePrimaryMotherWeights_InvMass_Pt", 800,0,0.8,250,0,25);
-            pESDTruePrimaryMotherWeightsInvMassPt[iCut]->Sumw2();
-            fTrueList[iCut]->Add(pESDTruePrimaryMotherWeightsInvMassPt[iCut]);
-            hESDTrueSecondaryMotherInvMassPt[iCut]
-               = new TH2F("ESD_TrueSecondaryMother_InvMass_Pt", "ESD_TrueSecondaryMother_InvMass_Pt", 800,0,0.8,250,0,25);
-            hESDTrueSecondaryMotherInvMassPt[iCut]->Sumw2();
-            fTrueList[iCut]->Add(hESDTrueSecondaryMotherInvMassPt[iCut]);
-            hESDTrueSecondaryMotherFromK0sInvMassPt[iCut]
-               = new TH2F("ESD_TrueSecondaryMotherFromK0s_InvMass_Pt","ESD_TrueSecondaryMotherFromK0s_InvMass_Pt",800,0,0.8,250,0,25);
-            hESDTrueSecondaryMotherFromK0sInvMassPt[iCut]->Sumw2();
-            fTrueList[iCut]->Add(hESDTrueSecondaryMotherFromK0sInvMassPt[iCut]);
-            hESDTrueSecondaryMotherFromEtaInvMassPt[iCut]
-               = new TH2F("ESD_TrueSecondaryMotherFromEta_InvMass_Pt","ESD_TrueSecondaryMotherFromEta_InvMass_Pt",800,0,0.8,250,0,25);
-            fTrueList[iCut]->Add(hESDTrueSecondaryMotherFromEtaInvMassPt[iCut]);
-            hESDTrueMotherDalitzInvMassPt[iCut] = new TH2F("ESD_TrueDalitz_InvMass_Pt","ESD_TrueDalitz_InvMass_Pt",800,0,0.8,250,0,25);
-            fTrueList[iCut]->Add(hESDTrueMotherDalitzInvMassPt[iCut]);         
-            if (fDoMesonQA > 0){
-               hESDTruePrimaryPi0MCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi0_MCPt_ResolPt","ESD_TruePrimaryPi0_ResolPt_MCPt",500,0.03,25,1000,-1.,1.);
-               hESDTruePrimaryPi0MCPtResolPt[iCut]->Sumw2();
-               SetLogBinningXTH2(hESDTruePrimaryPi0MCPtResolPt[iCut]);
-               fTrueList[iCut]->Add(hESDTruePrimaryPi0MCPtResolPt[iCut]);
-               hESDTruePrimaryEtaMCPtResolPt[iCut]  = new TH2F("ESD_TruePrimaryEta_MCPt_ResolPt","ESD_TruePrimaryEta_ResolPt_MCPt",500,0.03,25,1000,-1.,1.);
-               hESDTruePrimaryEtaMCPtResolPt[iCut]->Sumw2();
-               SetLogBinningXTH2(hESDTruePrimaryEtaMCPtResolPt[iCut]);
-               fTrueList[iCut]->Add(hESDTruePrimaryEtaMCPtResolPt[iCut]);
-               hESDTrueBckGGInvMassPt[iCut] = new TH2F("ESD_TrueBckGG_InvMass_Pt","ESD_TrueBckGG_InvMass_Pt",800,0,0.8,250,0,25);
-               fTrueList[iCut]->Add(hESDTrueBckGGInvMassPt[iCut]);
-               hESDTrueBckContInvMassPt[iCut] = new TH2F("ESD_TrueBckCont_InvMass_Pt","ESD_TrueBckCont_InvMass_Pt",800,0,0.8,250,0,25);
-               fTrueList[iCut]->Add(hESDTrueBckContInvMassPt[iCut]);
-               hESDTrueK0sWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueK0sWithPi0Daughter_MCPt","ESD_TrueK0sWithPi0Daughter_MCPt",250,0,25);
-               fTrueList[iCut]->Add(hESDTrueK0sWithPi0DaughterMCPt[iCut]);
-               hESDTrueEtaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueEtaWithPi0Daughter_MCPt","ESD_TrueEtaWithPi0Daughter_MCPt",250,0,25);
-               fTrueList[iCut]->Add(hESDTrueEtaWithPi0DaughterMCPt[iCut]);
-               hESDTruePi0PtY[iCut] = new TH2F("ESD_TruePi0_Pt_Y","ESD_TruePi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);
-               SetLogBinningXTH2(hESDTruePi0PtY[iCut]);
-               fTrueList[iCut]->Add(hESDTruePi0PtY[iCut]);
-               hESDTrueEtaPtY[iCut] = new TH2F("ESD_TrueEta_Pt_Y","ESD_TrueEta_Pt_Y",150,0.03,15.,150,-1.5,1.5);
-               SetLogBinningXTH2(hESDTrueEtaPtY[iCut]);
-               fTrueList[iCut]->Add(hESDTrueEtaPtY[iCut]);
-               hESDTruePi0PtAlpha[iCut] = new TH2F("ESD_TruePi0_Pt_Alpha","ESD_TruePi0_Pt_Alpha",150,0.03,15.,100,0,1);
-               SetLogBinningXTH2(hESDTruePi0PtAlpha[iCut]);
-               fTrueList[iCut]->Add(hESDTruePi0PtAlpha[iCut]);
-               hESDTrueEtaPtAlpha[iCut] = new TH2F("ESD_TrueEta_Pt_Alpha","ESD_TrueEta_Pt_Alpha",150,0.03,15.,100,0,1);
-               SetLogBinningXTH2(hESDTrueEtaPtAlpha[iCut]);
-               fTrueList[iCut]->Add(hESDTrueEtaPtAlpha[iCut]);
-               
-               hESDTruePi0PtOpenAngle[iCut] = new TH2F("ESD_TruePi0_Pt_OpenAngle","ESD_TruePi0_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi());            
-               SetLogBinningXTH2(hESDTruePi0PtOpenAngle[iCut]);
-               fTrueList[iCut]->Add(hESDTruePi0PtOpenAngle[iCut]);
-               hESDTrueEtaPtOpenAngle[iCut] = new TH2F("ESD_TrueEta_Pt_OpenAngle","ESD_TrueEta_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi());            
-               SetLogBinningXTH2(hESDTrueEtaPtOpenAngle[iCut]);
-               fTrueList[iCut]->Add(hESDTrueEtaPtOpenAngle[iCut]);
-
-               hESDTrueConvGammaEta[iCut] = new TH1F("ESD_TrueConvGamma_Eta","ESD_TrueConvGamma_Eta",2000,-2,2);
-              fTrueList[iCut]->Add(hESDTrueConvGammaEta[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());
-
-   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(fDoMesonAnalysis){
-         if(!((AliConversionMesonCuts*)fMesonCutArray->At(iCut))) continue;
-         if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()){
-            fCutFolder[iCut]->Add(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms());
-         }
-      }
-   }
-   PostData(1, fOutputContainer);
+void AliAnalysisTaskGammaConvV1::UserCreateOutputObjects(){
+
+       // Create histograms
+       if(fOutputContainer != NULL){
+               delete fOutputContainer;
+               fOutputContainer = NULL;
+       }
+       if(fOutputContainer == NULL){
+               fOutputContainer = new TList();
+               fOutputContainer->SetOwner(kTRUE);
+       }
+
+       // Array of current cut's gammas
+       fGammaCandidates = new TList();
+
+       fCutFolder = new TList*[fnCuts];
+       fESDList = new TList*[fnCuts];
+       fBackList = new TList*[fnCuts];
+       fMotherList = new TList*[fnCuts];
+       hNEvents = new TH1I*[fnCuts];
+       hNGoodESDTracks = new TH1I*[fnCuts];
+       hNGammaCandidates = new TH1I*[fnCuts];
+       hNV0Tracks = new TH1I*[fnCuts];
+       hEtaShift = new TProfile*[fnCuts];
+       hESDConvGammaPt = new TH1F*[fnCuts];
+
+       if (fDoPhotonQA == 2){
+               fPhotonDCAList = new TList*[fnCuts];
+               tESDConvGammaPtDcazCat = new TTree*[fnCuts];
+       }
+       if (fDoPhotonQA > 0){
+               hESDConvGammaR = new TH1F*[fnCuts];
+               hESDConvGammaEta = new TH1F*[fnCuts];
+       } 
+       
+       if(fDoMesonAnalysis){
+               hESDMotherInvMassPt = new TH2F*[fnCuts];
+               hESDMotherBackInvMassPt = new TH2F*[fnCuts];
+               hESDMotherInvMassEalpha = new TH2F*[fnCuts];
+               if (fDoMesonQA == 2){
+                       fMesonDCAList = new TList*[fnCuts];
+                       tESDMesonsInvMassPtDcazMinDcazMaxFlag = new TTree*[fnCuts];
+               }
+               if (fDoMesonQA > 0){
+                       hESDMotherPi0PtY =  new TH2F*[fnCuts];
+                       hESDMotherEtaPtY =  new TH2F*[fnCuts];
+                       hESDMotherPi0PtAlpha =  new TH2F*[fnCuts];
+                       hESDMotherEtaPtAlpha =  new TH2F*[fnCuts];
+                       hESDMotherPi0PtOpenAngle =  new TH2F*[fnCuts];
+                       hESDMotherEtaPtOpenAngle =  new TH2F*[fnCuts];
+               }   
+       }
+
+       for(Int_t iCut = 0; iCut<fnCuts;iCut++){
+
+               TString cutstring = ((AliConversionCuts*)fCutArray->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",cutstring.Data(),cutstringMeson.Data()));
+               fCutFolder[iCut]->SetOwner(kTRUE);
+               fOutputContainer->Add(fCutFolder[iCut]);
+               fESDList[iCut] = new TList();
+               fESDList[iCut]->SetName(Form("%s_%s ESD histograms",cutstring.Data(),cutstringMeson.Data()));
+               fESDList[iCut]->SetOwner(kTRUE);
+               fCutFolder[iCut]->Add(fESDList[iCut]);
+
+               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");
+               if (((AliConversionCuts*)fCutArray->At(iCut))->IsSpecialTrigger() == 4 ){
+                       TString TriggerNames = "Not Trigger: ";
+                       TriggerNames = TriggerNames+ ( (AliConversionCuts*)fCutArray->At(iCut))->GetSpecialTriggerName();
+                       hNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
+               } else {
+                       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 == 1) hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",4000,0,4000);
+               else if(fIsHeavyIon == 2) hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",400,0,400);
+               else hNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200);
+               fESDList[iCut]->Add(hNGoodESDTracks[iCut]);
+               if(fIsHeavyIon == 1) hNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",100,0,100);
+               else if(fIsHeavyIon == 2) hNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",50,0,50);
+               else hNGammaCandidates[iCut] = new TH1I("GammaCandidates","GammaCandidates",50,0,50);
+               fESDList[iCut]->Add(hNGammaCandidates[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]);
+
+               if (fDoPhotonQA == 2){
+                       fPhotonDCAList[iCut] = new TList();
+                       fPhotonDCAList[iCut]->SetName(Form("%s_%s Photon DCA tree",cutstring.Data(),cutstringMeson.Data()));
+                       fPhotonDCAList[iCut]->SetOwner(kTRUE);
+                       fCutFolder[iCut]->Add(fPhotonDCAList[iCut]);
+                               
+                       tESDConvGammaPtDcazCat[iCut] = new TTree("ESD_ConvGamma_Pt_Dcaz_R_Eta","ESD_ConvGamma_Pt_Dcaz_R_Eta_Cat");   
+                       tESDConvGammaPtDcazCat[iCut]->Branch("Pt",&fPtGamma,"fPtGamma/F");
+                       tESDConvGammaPtDcazCat[iCut]->Branch("DcaZPhoton",&fDCAzPhoton,"fDCAzPhoton/F");
+       //          tESDConvGammaPtDcazCat[iCut]->Branch("R",&fRConvPhoton,"fRConvPhoton/F");
+       //          tESDConvGammaPtDcazCat[iCut]->Branch("Eta",&fEtaPhoton,"fEtaPhoton/F");
+                       
+                       tESDConvGammaPtDcazCat[iCut]->Branch("cat",&iCatPhoton,"iCatPhoton/b");
+                       if(fIsMC){
+                               tESDConvGammaPtDcazCat[iCut]->Branch("photonMCInfo",&iPhotonMCInfo,"iPhotonMCInfo/b");
+                       }
+                       fPhotonDCAList[iCut]->Add(tESDConvGammaPtDcazCat[iCut]);
+               }
+
+               if (fDoPhotonQA > 0){
+                       hESDConvGammaR[iCut] = new TH1F("ESD_ConvGamma_R","ESD_ConvGamma_R",800,0,200);
+                       fESDList[iCut]->Add(hESDConvGammaR[iCut]);
+                       hESDConvGammaEta[iCut] = new TH1F("ESD_ConvGamma_Eta","ESD_ConvGamma_Eta",2000,-2,2);
+                       fESDList[iCut]->Add(hESDConvGammaEta[iCut]);
+               }
+               
+               if(fDoMesonAnalysis){
+                       hESDMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt","ESD_Mother_InvMass_Pt",800,0,0.8,250,0,25);
+                       fESDList[iCut]->Add(hESDMotherInvMassPt[iCut]);
+                       hESDMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt","ESD_Background_InvMass_Pt",800,0,0.8,250,0,25);
+                       fESDList[iCut]->Add(hESDMotherBackInvMassPt[iCut]);
+                       hESDMotherInvMassEalpha[iCut] = new TH2F("ESD_Mother_InvMass_vs_E_alpha","ESD_Mother_InvMass_vs_E_alpha",800,0,0.8,250,0,25);
+                       fESDList[iCut]->Add(hESDMotherInvMassEalpha[iCut]);
+                       if (fDoMesonQA == 2){    
+                               fMesonDCAList[iCut] = new TList();
+                               fMesonDCAList[iCut]->SetName(Form("%s_%s Meson DCA tree",cutstring.Data(),cutstringMeson.Data()));
+                               fMesonDCAList[iCut]->SetOwner(kTRUE);
+                               fCutFolder[iCut]->Add(fMesonDCAList[iCut]);
+                               
+                               tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut] = new TTree("ESD_Mesons_InvMass_Pt_DcazMin_DcazMax_Flag","ESD_Mesons_InvMass_Pt_DcazMin_DcazMax_Flag");   
+                               tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("InvMass",&fInvMass,"fInvMass/F");
+                               tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("Pt",&fPt,"fPt/F");
+                               tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("DcaZMin",&fDCAzGammaMin,"fDCAzGammaMin/F");
+                               tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("DcaZMax",&fDCAzGammaMax,"fDCAzGammaMax/F");
+                               tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("kind",&iFlag,"iFlag/b");
+                               if(fIsMC){
+                               tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]->Branch("mesonMCInfo",&iMesonMCInfo,"iMesonMCInfo/b");
+                               }
+                               fMesonDCAList[iCut]->Add(tESDMesonsInvMassPtDcazMinDcazMaxFlag[iCut]);
+                               
+                       }
+                       if (fDoMesonQA > 0 ){
+                               hESDMotherPi0PtY[iCut] = new TH2F("ESD_MotherPi0_Pt_Y","ESD_MotherPi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);            
+                               SetLogBinningXTH2(hESDMotherPi0PtY[iCut]);
+                               fESDList[iCut]->Add(hESDMotherPi0PtY[iCut]);
+                               hESDMotherEtaPtY[iCut] = new TH2F("ESD_MotherEta_Pt_Y","ESD_MotherEta_Pt_Y",150,0.03,15.,150,-1.5,1.5);
+                               SetLogBinningXTH2(hESDMotherEtaPtY[iCut]);
+                               fESDList[iCut]->Add(hESDMotherEtaPtY[iCut]);
+                               hESDMotherPi0PtAlpha[iCut] = new TH2F("ESD_MotherPi0_Pt_Alpha","ESD_MotherPi0_Pt_Alpha",150,0.03,15.,100,0,1);            
+                               SetLogBinningXTH2(hESDMotherPi0PtAlpha[iCut]);
+                               fESDList[iCut]->Add(hESDMotherPi0PtAlpha[iCut]);
+                               hESDMotherEtaPtAlpha[iCut] = new TH2F("ESD_MotherEta_Pt_Alpha","ESD_MotherEta_Pt_Alpha",150,0.03,15.,100,0,1);
+                               SetLogBinningXTH2(hESDMotherEtaPtAlpha[iCut]);
+                               fESDList[iCut]->Add(hESDMotherEtaPtAlpha[iCut]);
+                               hESDMotherPi0PtOpenAngle[iCut] = new TH2F("ESD_MotherPi0_Pt_OpenAngle","ESD_MotherPi0_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi());            
+                               SetLogBinningXTH2(hESDMotherPi0PtOpenAngle[iCut]);
+                               fESDList[iCut]->Add(hESDMotherPi0PtOpenAngle[iCut]);
+                               hESDMotherEtaPtOpenAngle[iCut] = new TH2F("ESD_MotherEta_Pt_OpenAngle","ESD_MotherEta_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi());            
+                               SetLogBinningXTH2(hESDMotherEtaPtOpenAngle[iCut]);
+                               fESDList[iCut]->Add(hESDMotherEtaPtOpenAngle[iCut]);
+                       }
+                       
+                               
+               }
+
+
+       }
+       if(fDoMesonAnalysis){
+               InitBack(); // Init Background Handler
+       }
+
+       if(fIsMC){
+               // MC Histogramms
+               fMCList = new TList*[fnCuts];
+               // True Histogramms
+               fTrueList = new TList*[fnCuts];
+               // Selected Header List
+               fHeaderNameList = new TList*[fnCuts];
+               hMCHeaders = new TH1I*[fnCuts];
+               hMCAllGammaPt = new TH1F*[fnCuts];
+               hMCDecayGammaPi0Pt = new TH1F*[fnCuts];
+               hMCDecayGammaRhoPt = new TH1F*[fnCuts];
+               hMCDecayGammaEtaPt = new TH1F*[fnCuts];
+               hMCDecayGammaOmegaPt = new TH1F*[fnCuts];
+               hMCDecayGammaEtapPt = new TH1F*[fnCuts];
+               hMCDecayGammaPhiPt = new TH1F*[fnCuts];
+               hMCDecayGammaSigmaPt = new TH1F*[fnCuts];
+               hMCConvGammaPt = new TH1F*[fnCuts];
+               hESDTrueConvGammaPt = new TH1F*[fnCuts];
+
+               hESDCombinatorialPt = new TH2F*[fnCuts];
+               hESDTruePrimaryConvGammaPt = new TH1F*[fnCuts];
+               hESDTruePrimaryConvGammaESDPtMCPt = new TH2F*[fnCuts];
+               hESDTrueSecondaryConvGammaPt = new TH1F*[fnCuts];
+               hESDTrueSecondaryConvGammaFromXFromK0sPt = new TH1F*[fnCuts];
+               hESDTrueSecondaryConvGammaFromXFromLambdaPt = new TH1F*[fnCuts];
+
+               hESDTrueDalitzPsiPairDeltaPhi= new TH2F*[fnCuts];
+               hESDTrueGammaPsiPairDeltaPhi= new TH2F*[fnCuts];
+
+               if (fDoPhotonQA > 0){
+                       hMCConvGammaR = new TH1F*[fnCuts];
+                       hMCConvGammaEta = new TH1F*[fnCuts];
+               hESDTrueConvGammaEta = new TH1F*[fnCuts];
+               }
+
+               if(fDoMesonAnalysis){
+                       hMCPi0Pt = new TH1F*[fnCuts];
+                       hMCPi0WOWeightPt = new TH1F*[fnCuts];
+                       hMCEtaPt = new TH1F*[fnCuts];
+                       hMCEtaWOWeightPt = new TH1F*[fnCuts];
+                       hMCPi0InAccPt = new TH1F*[fnCuts];
+                       hMCEtaInAccPt = new TH1F*[fnCuts];
+
+                       hESDTrueMotherInvMassPt = new TH2F*[fnCuts];
+                       hESDTruePrimaryMotherInvMassPt = new TH2F*[fnCuts];
+                       hESDTruePrimaryMotherW0WeightingInvMassPt = new TH2F*[fnCuts];
+                       pESDTruePrimaryMotherWeightsInvMassPt = new TProfile2D*[fnCuts];
+                       hESDTrueSecondaryMotherInvMassPt = new TH2F*[fnCuts];
+                       hESDTrueSecondaryMotherFromK0sInvMassPt = new TH2F*[fnCuts];
+                       hESDTrueSecondaryMotherFromEtaInvMassPt = new TH2F*[fnCuts];
+                       hESDTrueSecondaryMotherFromLambdaInvMassPt = new TH2F*[fnCuts];
+                       hESDTrueMotherDalitzInvMassPt = new TH2F*[fnCuts];
+                       if (fDoMesonQA > 0){
+                               hMCPi0PtY = new TH2F*[fnCuts];
+                               hMCEtaPtY = new TH2F*[fnCuts];
+                               hMCK0sPt = new TH1F*[fnCuts];
+                               hMCK0sWOWeightPt = new TH1F*[fnCuts];
+                               hMCK0sPtY = new TH2F*[fnCuts];
+                               hMCSecPi0PtvsSource= new TH2F*[fnCuts];
+                               hMCSecPi0Source = new TH1F*[fnCuts];
+                               hMCSecEtaPt = new TH1F*[fnCuts];
+                               hMCSecEtaSource = new TH1F*[fnCuts];
+                               hESDTruePrimaryPi0MCPtResolPt = new TH2F*[fnCuts];
+                               hESDTruePrimaryEtaMCPtResolPt = new TH2F*[fnCuts];
+                               hESDTrueK0sWithPi0DaughterMCPt = new TH1F*[fnCuts];
+                               hESDTrueEtaWithPi0DaughterMCPt = new TH1F*[fnCuts];
+                               hESDTrueLambdaWithPi0DaughterMCPt = new TH1F*[fnCuts];
+                               hESDTrueBckGGInvMassPt = new TH2F*[fnCuts];
+                               hESDTrueBckContInvMassPt = new TH2F*[fnCuts];
+                               hESDTruePi0PtY = new TH2F*[fnCuts];
+                               hESDTrueEtaPtY = new TH2F*[fnCuts];
+                               hESDTruePi0PtAlpha = new TH2F*[fnCuts];
+                               hESDTrueEtaPtAlpha = new TH2F*[fnCuts];
+                               hESDTruePi0PtOpenAngle = new TH2F*[fnCuts];
+                               hESDTrueEtaPtOpenAngle = new TH2F*[fnCuts];
+                       }
+               }
+
+               for(Int_t iCut = 0; iCut<fnCuts;iCut++){
+                       TString cutstring = ((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber();
+                       TString cutstringMeson = "NoMesonCut";
+                       if(fDoMesonAnalysis)cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
+
+                       fMCList[iCut] = new TList();
+                       fMCList[iCut]->SetName(Form("%s_%s MC histograms",cutstring.Data(),cutstringMeson.Data()));
+                       fMCList[iCut]->SetOwner(kTRUE);
+                       fCutFolder[iCut]->Add(fMCList[iCut]);
+                       hMCHeaders[iCut] = new TH1I("MC_Headers","MC_Headers",20,0,20);
+                       fMCList[iCut]->Add(hMCHeaders[iCut]);
+                       hMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25);
+                       fMCList[iCut]->Add(hMCAllGammaPt[iCut]);
+                       hMCDecayGammaPi0Pt[iCut] = new TH1F("MC_DecayGammaPi0_Pt","MC_DecayGammaPi0_Pt",250,0,25);
+                       fMCList[iCut]->Add(hMCDecayGammaPi0Pt[iCut]);
+                       hMCDecayGammaRhoPt[iCut] = new TH1F("MC_DecayGammaRho_Pt","MC_DecayGammaRho_Pt",250,0,25);
+                       fMCList[iCut]->Add(hMCDecayGammaRhoPt[iCut]);
+                       hMCDecayGammaEtaPt[iCut] = new TH1F("MC_DecayGammaEta_Pt","MC_DecayGammaEta_Pt",250,0,25);
+                       fMCList[iCut]->Add(hMCDecayGammaEtaPt[iCut]);
+                       hMCDecayGammaOmegaPt[iCut] = new TH1F("MC_DecayGammaOmega_Pt","MC_DecayGammaOmmega_Pt",250,0,25);
+                       fMCList[iCut]->Add(hMCDecayGammaOmegaPt[iCut]);
+                       hMCDecayGammaEtapPt[iCut] = new TH1F("MC_DecayGammaEtap_Pt","MC_DecayGammaEtap_Pt",250,0,25);
+                       fMCList[iCut]->Add(hMCDecayGammaEtapPt[iCut]);
+                       hMCDecayGammaPhiPt[iCut] = new TH1F("MC_DecayGammaPhi_Pt","MC_DecayGammaPhi_Pt",250,0,25);
+                       fMCList[iCut]->Add(hMCDecayGammaPhiPt[iCut]);
+                       hMCDecayGammaSigmaPt[iCut] = new TH1F("MC_DecayGammaSigma_Pt","MC_DecayGammaSigma_Pt",250,0,25);
+                       fMCList[iCut]->Add(hMCDecayGammaSigmaPt[iCut]);
+                       hMCConvGammaPt[iCut] = new TH1F("MC_ConvGamma_Pt","MC_ConvGamma_Pt",250,0,25);
+                       fMCList[iCut]->Add(hMCConvGammaPt[iCut]);
+               
+                       if (fDoPhotonQA > 0){
+                               hMCConvGammaR[iCut] = new TH1F("MC_ConvGamma_R","MC_ConvGamma_R",800,0,200);
+                               fMCList[iCut]->Add(hMCConvGammaR[iCut]);
+                               hMCConvGammaEta[iCut] = new TH1F("MC_ConvGamma_Eta","MC_ConvGamma_Eta",2000,-2,2);
+                               fMCList[iCut]->Add(hMCConvGammaEta[iCut]);
+                       }
+
+                       if(fDoMesonAnalysis){
+                               hMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt","MC_Pi0_Pt",250,0,25);
+                               hMCPi0Pt[iCut]->Sumw2();
+                               fMCList[iCut]->Add(hMCPi0Pt[iCut]);
+                               hMCPi0WOWeightPt[iCut] = new TH1F("MC_Pi0_WOWeights_Pt","MC_Pi0_WOWeights_Pt",250,0,25);
+                               hMCPi0WOWeightPt[iCut]->Sumw2();
+                               fMCList[iCut]->Add(hMCPi0WOWeightPt[iCut]);
+                               
+                               hMCEtaPt[iCut] = new TH1F("MC_Eta_Pt","MC_Eta_Pt",250,0,25);
+                               hMCEtaPt[iCut]->Sumw2();
+                               fMCList[iCut]->Add(hMCEtaPt[iCut]);
+                               hMCEtaWOWeightPt[iCut] = new TH1F("MC_Eta_WOWeights_Pt","MC_Eta_WOWeights_Pt",250,0,25);
+                               hMCEtaWOWeightPt[iCut]->Sumw2();
+                               fMCList[iCut]->Add(hMCEtaWOWeightPt[iCut]);
+                               hMCPi0InAccPt[iCut] = new TH1F("MC_Pi0InAcc_Pt","MC_Pi0InAcc_Pt",250,0,25);
+                               hMCPi0InAccPt[iCut]->Sumw2();
+                               fMCList[iCut]->Add(hMCPi0InAccPt[iCut]);
+                               hMCEtaInAccPt[iCut] = new TH1F("MC_EtaInAcc_Pt","MC_EtaInAcc_Pt",250,0,25);
+                               hMCEtaInAccPt[iCut]->Sumw2();
+                               fMCList[iCut]->Add(hMCEtaInAccPt[iCut]);
+                               if (fDoMesonQA > 0){
+                                       hMCPi0PtY[iCut] = new TH2F("MC_Pi0_Pt_Y","MC_Pi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);
+                                       hMCPi0PtY[iCut]->Sumw2();
+                                       SetLogBinningXTH2(hMCPi0PtY[iCut]);
+                                       fMCList[iCut]->Add(hMCPi0PtY[iCut]);
+                                       hMCEtaPtY[iCut] = new TH2F("MC_Eta_Pt_Y","MC_Eta_Pt_Y",150,0.03,15.,150,-1.5,1.5);
+                                       hMCEtaPtY[iCut]->Sumw2();
+                                       SetLogBinningXTH2(hMCEtaPtY[iCut]);
+                                       fMCList[iCut]->Add(hMCEtaPtY[iCut]);
+                                       hMCK0sPt[iCut] = new TH1F("MC_K0s_Pt","MC_K0s_Pt",150,0,15);
+                                       hMCK0sPt[iCut]->Sumw2();
+                                       fMCList[iCut]->Add(hMCK0sPt[iCut]);
+                                       hMCK0sWOWeightPt[iCut] = new TH1F("MC_K0s_WOWeights_Pt","MC_K0s_WOWeights_Pt",150,0,15);
+                                       hMCK0sWOWeightPt[iCut]->Sumw2();
+                                       fMCList[iCut]->Add(hMCK0sWOWeightPt[iCut]);
+                                       hMCK0sPtY[iCut] = new TH2F("MC_K0s_Pt_Y","MC_K0s_Pt_Y",150,0.03,15.,150,-1.5,1.5);
+                                       hMCK0sPtY[iCut]->Sumw2();
+                                       SetLogBinningXTH2(hMCK0sPtY[iCut]);
+                                       fMCList[iCut]->Add(hMCK0sPtY[iCut]);
+                                       
+                                       hMCSecPi0Source[iCut] = new TH1F("MC_SecPi0_Source","MC_SecPi0_Source",5000,0.,5000);
+                                       fMCList[iCut]->Add(hMCSecPi0Source[iCut]);
+                                       hMCSecEtaSource[iCut] = new TH1F("MC_SecEta_Source","MC_SecEta_Source",5000,0,5000);
+                                       fMCList[iCut]->Add(hMCSecEtaSource[iCut]);
+                                       hMCSecPi0PtvsSource[iCut] = new TH2F("MC_SecPi0_Pt_Source","MC_SecPi0_Pt_Source",250,0.0,25.,16,-0.5,15.5);
+                                       hMCSecPi0PtvsSource[iCut]->Sumw2();
+                                       fMCList[iCut]->Add(hMCSecPi0PtvsSource[iCut]);
+                                       hMCSecEtaPt[iCut] = new TH1F("MC_SecEta_Pt","MC_SecEta_Pt",250,0,25);
+                                       hMCSecEtaPt[iCut]->Sumw2();
+                                       fMCList[iCut]->Add(hMCSecEtaPt[iCut]);
+                               }
+
+                       }
+                       fTrueList[iCut] = new TList();
+                       fTrueList[iCut]->SetName(Form("%s_%s True histograms",cutstring.Data(),cutstringMeson.Data()));
+                       fTrueList[iCut]->SetOwner(kTRUE);
+                       fCutFolder[iCut]->Add(fTrueList[iCut]);
+
+                       hESDTrueConvGammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25);
+                       fTrueList[iCut]->Add(hESDTrueConvGammaPt[iCut]);
+
+                       hESDCombinatorialPt[iCut] = new TH2F("ESD_TrueCombinatorial_Pt","ESD_TrueCombinatorial_Pt",250,0,25,16,-0.5,15.5);
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 1,"Elec+Elec");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 2,"Elec+Pion");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 3,"Elec+Kaon");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 4,"Elec+Proton");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 5,"Elec+Muon");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 6,"Pion+Pion");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 7,"Pion+Kaon");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 8,"Pion+Proton");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel( 9,"Pion+Muon");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(10,"Kaon+Kaon");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(11,"Kaon+Proton");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(12,"Kaon+Muon");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(13,"Proton+Proton");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(14,"Proton+Muon");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(15,"Muon+Muon");
+                       hESDCombinatorialPt[iCut]->GetYaxis()->SetBinLabel(16,"Rest");
+                       fTrueList[iCut]->Add(hESDCombinatorialPt[iCut]);
+                       hESDTruePrimaryConvGammaPt[iCut] = new TH1F("ESD_TruePrimaryConvGamma_Pt","ESD_TruePrimaryConvGamma_Pt",250,0,25);
+                       fTrueList[iCut]->Add(hESDTruePrimaryConvGammaPt[iCut]);
+                       hESDTrueSecondaryConvGammaPt[iCut] = new TH1F("ESD_TrueSecondaryConvGamma_Pt","ESD_TrueSecondaryConvGamma_Pt",250,0,25);
+                       fTrueList[iCut]->Add(hESDTrueSecondaryConvGammaPt[iCut]);
+
+                       hESDTrueSecondaryConvGammaFromXFromK0sPt[iCut]
+                               = new TH1F("ESD_TrueSecondaryConvGammaFromXFromK0s_Pt", "ESD_TrueSecondaryConvGammaFromXFromK0s_Pt",250,0,25);
+                       fTrueList[iCut]->Add(hESDTrueSecondaryConvGammaFromXFromK0sPt[iCut]);
+                       hESDTrueSecondaryConvGammaFromXFromLambdaPt[iCut]
+                               = new TH1F("ESD_TrueSecondaryConvGammaFromXFromLambda_Pt", "ESD_TrueSecondaryConvGammaFromXFromLambda_Pt",250,0,25);
+                       fTrueList[iCut]->Add(hESDTrueSecondaryConvGammaFromXFromLambdaPt[iCut]);
+
+                       hESDTrueDalitzPsiPairDeltaPhi[iCut]
+                               = new TH2F("ESD_TrueDalitzPsiPairDeltaPhi_Pt", "ESD_TrueDalitzPsiPairDeltaPhi_Pt",100,-0.5,2,100,-0.5,0.5);
+                       fTrueList[iCut]->Add(hESDTrueDalitzPsiPairDeltaPhi[iCut]);
+                       
+                       hESDTrueGammaPsiPairDeltaPhi[iCut]
+                               = new TH2F("ESD_TrueGammaPsiPairDeltaPhi_Pt", "ESD_TrueGammaPsiPairDeltaPhi_Pt",100,-0.5,2,100,-0.5,0.5);
+                       fTrueList[iCut]->Add(hESDTrueGammaPsiPairDeltaPhi[iCut]);
+
+                       hESDTruePrimaryConvGammaESDPtMCPt[iCut] = new TH2F("ESD_TruePrimaryConvGammaESD_PtMCPt", "ESD_TruePrimaryConvGammaESD_PtMCPt",250,0,25,250,0,25);
+                       fTrueList[iCut]->Add(hESDTruePrimaryConvGammaESDPtMCPt[iCut]);
+                       
+                       if(fDoMesonAnalysis){
+                               hESDTrueMotherInvMassPt[iCut] = new TH2F("ESD_TrueMother_InvMass_Pt","ESD_TrueMother_InvMass_Pt",800,0,0.8,250,0,25);
+                               fTrueList[iCut]->Add(hESDTrueMotherInvMassPt[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_TruePrimaryMotherW0Weights_InvMass_Pt", "ESD_TruePrimaryMotherW0Weights_InvMass_Pt", 800,0,0.8,250,0,25);
+                               hESDTruePrimaryMotherW0WeightingInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(hESDTruePrimaryMotherW0WeightingInvMassPt[iCut]);
+                               pESDTruePrimaryMotherWeightsInvMassPt[iCut]
+                               = new TProfile2D("ESD_TruePrimaryMotherWeights_InvMass_Pt", "ESD_TruePrimaryMotherWeights_InvMass_Pt", 800,0,0.8,250,0,25);
+                               pESDTruePrimaryMotherWeightsInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(pESDTruePrimaryMotherWeightsInvMassPt[iCut]);
+                               hESDTrueSecondaryMotherInvMassPt[iCut]
+                               = new TH2F("ESD_TrueSecondaryMother_InvMass_Pt", "ESD_TrueSecondaryMother_InvMass_Pt", 800,0,0.8,250,0,25);
+                               hESDTrueSecondaryMotherInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(hESDTrueSecondaryMotherInvMassPt[iCut]);
+                               hESDTrueSecondaryMotherFromK0sInvMassPt[iCut]
+                               = new TH2F("ESD_TrueSecondaryMotherFromK0s_InvMass_Pt","ESD_TrueSecondaryMotherFromK0s_InvMass_Pt",800,0,0.8,250,0,25);
+                               hESDTrueSecondaryMotherFromK0sInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(hESDTrueSecondaryMotherFromK0sInvMassPt[iCut]);
+                               hESDTrueSecondaryMotherFromEtaInvMassPt[iCut]
+                               = new TH2F("ESD_TrueSecondaryMotherFromEta_InvMass_Pt","ESD_TrueSecondaryMotherFromEta_InvMass_Pt",800,0,0.8,250,0,25);
+                               fTrueList[iCut]->Add(hESDTrueSecondaryMotherFromEtaInvMassPt[iCut]);
+                               hESDTrueSecondaryMotherFromLambdaInvMassPt[iCut]
+                               = new TH2F("ESD_TrueSecondaryMotherFromLambda_InvMass_Pt","ESD_TrueSecondaryMotherFromLambda_InvMass_Pt",800,0,0.8,250,0,25);
+                               fTrueList[iCut]->Add(hESDTrueSecondaryMotherFromLambdaInvMassPt[iCut]);
+                               hESDTrueMotherDalitzInvMassPt[iCut] = new TH2F("ESD_TrueDalitz_InvMass_Pt","ESD_TrueDalitz_InvMass_Pt",800,0,0.8,250,0,25);
+                               fTrueList[iCut]->Add(hESDTrueMotherDalitzInvMassPt[iCut]);         
+                               if (fDoMesonQA > 0){
+                                       hESDTruePrimaryPi0MCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi0_MCPt_ResolPt","ESD_TruePrimaryPi0_ResolPt_MCPt",500,0.03,25,1000,-1.,1.);
+                                       hESDTruePrimaryPi0MCPtResolPt[iCut]->Sumw2();
+                                       SetLogBinningXTH2(hESDTruePrimaryPi0MCPtResolPt[iCut]);
+                                       fTrueList[iCut]->Add(hESDTruePrimaryPi0MCPtResolPt[iCut]);
+                                       hESDTruePrimaryEtaMCPtResolPt[iCut]  = new TH2F("ESD_TruePrimaryEta_MCPt_ResolPt","ESD_TruePrimaryEta_ResolPt_MCPt",500,0.03,25,1000,-1.,1.);
+                                       hESDTruePrimaryEtaMCPtResolPt[iCut]->Sumw2();
+                                       SetLogBinningXTH2(hESDTruePrimaryEtaMCPtResolPt[iCut]);
+                                       fTrueList[iCut]->Add(hESDTruePrimaryEtaMCPtResolPt[iCut]);
+                                       hESDTrueBckGGInvMassPt[iCut] = new TH2F("ESD_TrueBckGG_InvMass_Pt","ESD_TrueBckGG_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(hESDTrueBckGGInvMassPt[iCut]);
+                                       hESDTrueBckContInvMassPt[iCut] = new TH2F("ESD_TrueBckCont_InvMass_Pt","ESD_TrueBckCont_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(hESDTrueBckContInvMassPt[iCut]);
+                                       hESDTrueK0sWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueK0sWithPi0Daughter_MCPt","ESD_TrueK0sWithPi0Daughter_MCPt",250,0,25);
+                                       fTrueList[iCut]->Add(hESDTrueK0sWithPi0DaughterMCPt[iCut]);
+                                       hESDTrueEtaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueEtaWithPi0Daughter_MCPt","ESD_TrueEtaWithPi0Daughter_MCPt",250,0,25);
+                                       fTrueList[iCut]->Add(hESDTrueEtaWithPi0DaughterMCPt[iCut]);
+                                       hESDTrueLambdaWithPi0DaughterMCPt[iCut] = new TH1F("ESD_TrueLambdaWithPi0Daughter_MCPt","ESD_TrueLambdaWithPi0Daughter_MCPt",250,0,25);
+                                       fTrueList[iCut]->Add(hESDTrueLambdaWithPi0DaughterMCPt[iCut]);
+
+                                       hESDTruePi0PtY[iCut] = new TH2F("ESD_TruePi0_Pt_Y","ESD_TruePi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);
+                                       SetLogBinningXTH2(hESDTruePi0PtY[iCut]);
+                                       fTrueList[iCut]->Add(hESDTruePi0PtY[iCut]);
+                                       hESDTrueEtaPtY[iCut] = new TH2F("ESD_TrueEta_Pt_Y","ESD_TrueEta_Pt_Y",150,0.03,15.,150,-1.5,1.5);
+                                       SetLogBinningXTH2(hESDTrueEtaPtY[iCut]);
+                                       fTrueList[iCut]->Add(hESDTrueEtaPtY[iCut]);
+                                       hESDTruePi0PtAlpha[iCut] = new TH2F("ESD_TruePi0_Pt_Alpha","ESD_TruePi0_Pt_Alpha",150,0.03,15.,100,0,1);
+                                       SetLogBinningXTH2(hESDTruePi0PtAlpha[iCut]);
+                                       fTrueList[iCut]->Add(hESDTruePi0PtAlpha[iCut]);
+                                       hESDTrueEtaPtAlpha[iCut] = new TH2F("ESD_TrueEta_Pt_Alpha","ESD_TrueEta_Pt_Alpha",150,0.03,15.,100,0,1);
+                                       SetLogBinningXTH2(hESDTrueEtaPtAlpha[iCut]);
+                                       fTrueList[iCut]->Add(hESDTrueEtaPtAlpha[iCut]);
+                                       
+                                       hESDTruePi0PtOpenAngle[iCut] = new TH2F("ESD_TruePi0_Pt_OpenAngle","ESD_TruePi0_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi());            
+                                       SetLogBinningXTH2(hESDTruePi0PtOpenAngle[iCut]);
+                                       fTrueList[iCut]->Add(hESDTruePi0PtOpenAngle[iCut]);
+                                       hESDTrueEtaPtOpenAngle[iCut] = new TH2F("ESD_TrueEta_Pt_OpenAngle","ESD_TrueEta_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi());            
+                                       SetLogBinningXTH2(hESDTrueEtaPtOpenAngle[iCut]);
+                                       fTrueList[iCut]->Add(hESDTrueEtaPtOpenAngle[iCut]);
+
+                                       hESDTrueConvGammaEta[iCut] = new TH1F("ESD_TrueConvGamma_Eta","ESD_TrueConvGamma_Eta",2000,-2,2);
+                                       fTrueList[iCut]->Add(hESDTrueConvGammaEta[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());
+
+       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(fDoMesonAnalysis){
+                       if(!((AliConversionMesonCuts*)fMesonCutArray->At(iCut))) continue;
+                       if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms()){
+                               fCutFolder[iCut]->Add(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutHistograms());
+                       }
+               }
+       }
+       PostData(1, fOutputContainer);
 }
 //_____________________________________________________________________________
 Bool_t AliAnalysisTaskGammaConvV1::Notify()
@@ -1545,6 +1577,7 @@ void AliAnalysisTaskGammaConvV1::ProcessAODMCParticles()
          }
       }
    }
+   
 }
 //________________________________________________________________________
 void AliAnalysisTaskGammaConvV1::ProcessMCParticles()
@@ -1613,9 +1646,11 @@ void AliAnalysisTaskGammaConvV1::ProcessMCParticles()
                   //cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
                }
             }
-            hMCK0sPt[fiCut]->Fill(particle->Pt(),weightedK0s);
-            hMCK0sWOWeightPt[fiCut]->Fill(particle->Pt());
-            hMCK0sPtY[fiCut]->Fill(particle->Pt(),mesonY,weightedK0s);
+            if (fMCStack->IsPhysicalPrimary(i)){
+                               hMCK0sPt[fiCut]->Fill(particle->Pt(),weightedK0s);
+                               hMCK0sWOWeightPt[fiCut]->Fill(particle->Pt());
+                               hMCK0sPtY[fiCut]->Fill(particle->Pt(),mesonY,weightedK0s);
+                       }       
          }
          if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))
             ->MesonIsSelectedMC(particle,fMCStack,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift())){
@@ -1664,6 +1699,46 @@ void AliAnalysisTaskGammaConvV1::ProcessMCParticles()
          }
       }
    }
+   
+       if (fDoMesonQA){
+               for(Int_t i = fMCStack->GetNprimary(); i < fMCStack->GetNtrack(); i++) {
+                       TParticle* particle = (TParticle *)fMCStack->Particle(i);                       
+                       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(fDoMesonAnalysis){
+                               if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))
+            ->MesonIsSelectedMC(particle,fMCStack,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift())){
+                                       Float_t weighted= 1;
+                                       if(((AliConversionCuts*)fCutArray->At(fiCut))->IsParticleFromBGEvent(i, fMCStack, fInputEvent)){
+                                               if (particle->Pt()>0.005){
+                                                       weighted= ((AliConversionCuts*)fCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),i, fMCStack, fInputEvent);
+                       //                   if(particle->GetPdgCode() == 221){
+                       //                      cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
+                       //                   }
+                                               }
+                                       }
+                                       
+                                       if(particle->GetPdgCode() == 111){      
+                                               Int_t pdgCode = ((TParticle*)fMCStack->Particle( particle->GetFirstMother() ))->GetPdgCode();
+                                               Int_t source = GetSourceClassification(111,pdgCode);
+                                               hMCSecPi0PtvsSource[fiCut]->Fill(particle->Pt(),source,weighted); // All MC Pi0
+                                               hMCSecPi0Source[fiCut]->Fill(pdgCode);                                          
+                                       } else if(particle->GetPdgCode() == 221){
+                                               Int_t pdgCode = ((TParticle*)fMCStack->Particle( particle->GetFirstMother() ))->GetPdgCode();
+                                               hMCSecEtaPt[fiCut]->Fill(particle->Pt(),weighted); // All MC Pi0
+                                               hMCSecEtaSource[fiCut]->Fill(pdgCode);
+                                       } 
+                               }
+                       }
+               }
+       }
 }
 //________________________________________________________________________
 void AliAnalysisTaskGammaConvV1::CalculatePi0Candidates(){
@@ -1885,6 +1960,12 @@ void AliAnalysisTaskGammaConvV1::ProcessTrueMesonCandidates(AliAODConversionMoth
                      if (fDoMesonQA > 0)hESDTrueEtaWithPi0DaughterMCPt[fiCut]
                                        ->Fill(MCStack->Particle(secMotherLabel)->Pt());
                   }
+                  if(MCStack->Particle(secMotherLabel)->GetPdgCode()==3122){
+                     iMesonMCInfo = 7;
+                     hESDTrueSecondaryMotherFromLambdaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+                     if (fDoMesonQA > 0)hESDTrueLambdaWithPi0DaughterMCPt[fiCut]
+                                       ->Fill(MCStack->Particle(secMotherLabel)->Pt());
+                  }
                }
             }else{ // Only primary pi0 for efficiency calculation
                iMesonMCInfo = 6;
@@ -2064,6 +2145,12 @@ void AliAnalysisTaskGammaConvV1::ProcessTrueMesonCandidatesAOD(AliAODConversionM
                if (fDoMesonQA > 0)hESDTrueEtaWithPi0DaughterMCPt[fiCut]
                                  ->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt());
             }
+            if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==3122){
+               iMesonMCInfo = 7;
+               hESDTrueSecondaryMotherFromLambdaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+               if (fDoMesonQA > 0)hESDTrueLambdaWithPi0DaughterMCPt[fiCut]
+                                 ->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt());
+            }
          }
       }else{ // Only primary pi0 for efficiency calculation
          Float_t weighted= 1;
@@ -2466,3 +2553,24 @@ void AliAnalysisTaskGammaConvV1::Terminate(const Option_t *)
 
    //fOutputContainer->Print(); // Will crash on GRID
 }
+
+//________________________________________________________________________
+Int_t AliAnalysisTaskGammaConvV1::GetSourceClassification(Int_t daughter, Int_t pdgCode){
+
+       if (daughter == 111) {
+               if (abs(pdgCode) == 310) return 1; // k0s
+               else if (abs(pdgCode) == 3122) return 2; // Lambda
+               else if (abs(pdgCode) == 130) return 3; // K0L
+               else if (abs(pdgCode) == 2212) return 4; // proton
+               else if (abs(pdgCode) == 2112) return 5; // neutron
+               else if (abs(pdgCode) == 211) return 6; // pion
+               else if (abs(pdgCode) == 321) return 7; // kaon
+               else if (abs(pdgCode) == 113 || abs(pdgCode) == 213 ) return 8; // rho 0,+,-
+               else if (abs(pdgCode) == 3222 || abs(pdgCode) == 3212 || abs(pdgCode) == 3112  ) return 9; // Sigma
+               else if (abs(pdgCode) == 2224 || abs(pdgCode) == 2214 || abs(pdgCode) == 2114 || abs(pdgCode) == 1114  ) return 10; // Delta
+               else if (abs(pdgCode) == 313 || abs(pdgCode) == 323   ) return 11; // K*
+               else return 15;         
+       } 
+       return 15;
+
+}
\ No newline at end of file
index b158114..9588224 100644 (file)
@@ -63,6 +63,7 @@ class AliAnalysisTaskGammaConvV1 : public AliAnalysisTaskSE {
    void MoveParticleAccordingToVertex(AliAODConversionPhoton* particle,const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex);
    void UpdateEventByEventData();
    void SetLogBinningXTH2(TH2* histoRebin);
+   Int_t GetSourceClassification(Int_t daughter, Int_t pdgCode);
    
  protected:
    AliV0ReaderV1 *fV0Reader;
@@ -137,6 +138,10 @@ class AliAnalysisTaskGammaConvV1 : public AliAnalysisTaskSE {
    TH1F **hMCK0sPt;
    TH1F **hMCK0sWOWeightPt;
    TH2F **hMCK0sPtY;
+   TH2F **hMCSecPi0PtvsSource;
+   TH1F **hMCSecPi0Source;
+   TH1F **hMCSecEtaPt;
+   TH1F **hMCSecEtaSource;
    TH2F **hESDTrueMotherInvMassPt;
    TH2F **hESDTruePrimaryMotherInvMassPt;
    TH2F **hESDTruePrimaryMotherW0WeightingInvMassPt;
@@ -148,6 +153,8 @@ class AliAnalysisTaskGammaConvV1 : public AliAnalysisTaskSE {
    TH1F **hESDTrueK0sWithPi0DaughterMCPt;
    TH2F **hESDTrueSecondaryMotherFromEtaInvMassPt;
    TH1F **hESDTrueEtaWithPi0DaughterMCPt;
+   TH2F **hESDTrueSecondaryMotherFromLambdaInvMassPt;
+   TH1F **hESDTrueLambdaWithPi0DaughterMCPt;
    TH2F **hESDTrueBckGGInvMassPt;
    TH2F **hESDTrueBckContInvMassPt;
    TH2F **hESDTruePi0PtY;
@@ -212,7 +219,7 @@ private:
    AliAnalysisTaskGammaConvV1 &operator=(const AliAnalysisTaskGammaConvV1&); // Prevent assignment
 
 
-   ClassDef(AliAnalysisTaskGammaConvV1, 10);
+   ClassDef(AliAnalysisTaskGammaConvV1, 11);
 };
 
 #endif
index 7ef663b..ab13e87 100644 (file)
@@ -544,6 +544,7 @@ Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_
    if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
       if(hist)hist->Fill(cutIndex);
       cutIndex++;
+//       cout << "undefined rapidity" << endl;
       return kFALSE;
    }
    else{
@@ -551,6 +552,7 @@ Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_
       cutIndex++;
       if(abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
          if(hist)hist->Fill(cutIndex);
+//              cout << abs(pi0->Rapidity()-fRapidityShift) << ">" << fRapidityCutMeson << endl;
          return kFALSE;
       }
    }
@@ -559,6 +561,7 @@ Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_
    // Opening Angle Cut
    //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
    if( pi0->GetOpeningAngle() < fOpeningAngle){
+//       cout << pi0->GetOpeningAngle() << "<" << fOpeningAngle << endl; 
       if(hist)hist->Fill(cutIndex);
       return kFALSE;
    }
@@ -572,6 +575,7 @@ Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_
    
    // Alpha Max Cut
    if(pi0->GetAlpha()>fAlphaCutMeson){
+//        cout << pi0->GetAlpha() << ">" << fAlphaCutMeson << endl; 
       if(hist)hist->Fill(cutIndex);
       return kFALSE;
    }
@@ -579,6 +583,7 @@ Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_
 
    // Alpha Min Cut
    if(pi0->GetAlpha()<fAlphaMinCutMeson){
+//       cout << pi0->GetAlpha() << "<" << fAlphaMinCutMeson << endl; 
       if(hist)hist->Fill(cutIndex);
       return kFALSE;
    }
@@ -588,12 +593,14 @@ Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_
    if (hDCARMesonPrimVtxBefore)hDCARMesonPrimVtxBefore->Fill(pi0->GetDCARMotherPrimVtx());
 
    if (pi0->GetDCABetweenPhotons() > fDCAGammaGammaCut){
+//       cout << pi0->GetDCABetweenPhotons() << ">" << fDCAGammaGammaCut << endl; 
       if(hist)hist->Fill(cutIndex);
       return kFALSE;
    }
    cutIndex++;
 
    if (pi0->GetDCARMotherPrimVtx() > fDCARMesonPrimVtxCut){
+//        cout << pi0->GetDCARMotherPrimVtx() << ">" << fDCARMesonPrimVtxCut << endl; 
       if(hist)hist->Fill(cutIndex);
       return kFALSE;
    }
@@ -603,6 +610,7 @@ Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_
    if (hDCAZMesonPrimVtxBefore)hDCAZMesonPrimVtxBefore->Fill(pi0->GetDCAZMotherPrimVtx());
 
    if (abs(pi0->GetDCAZMotherPrimVtx()) > fDCAZMesonPrimVtxCut){
+//       cout << pi0->GetDCAZMotherPrimVtx() << ">" << fDCAZMesonPrimVtxCut << endl; 
       if(hist)hist->Fill(cutIndex);
       return kFALSE;
    }
index f95843f..19b2a8f 100644 (file)
@@ -186,6 +186,38 @@ void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TStrin
        if(name=="")fHistograms->SetName(Form("ElectronCuts_%s",cutName.Data()));
        else fHistograms->SetName(Form("%s_%s",name.Data(),cutName.Data()));
     }
+    
+    
+    Int_t kDedxSignalbins = 200;
+    
+     const Int_t kDCABins=62;
+    
+     Double_t binsDCADummy[63]={-3.0,-2.7,-2.4,-2.1,-1.8,-1.5,-1.2,-0.9,-0.6,-0.3,-0.25,-0.2,-0.19,-0.18,-0.17,-0.16,-0.15,-0.14,-0.13,-0.12,-0.11,-0.10,-0.09,-0.08,-0.07,-0.06,-0.05,-0.04,-0.03,-0.02,-0.01,0.0,0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.2,0.25,0.3,0.6,0.9,1.2,1.5,1.8,2.1,2.4,2.7,3.0};
+
+     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;
+               
+       }
+       
 
 
     hCutIndex=new TH1F(Form("IsElectronSelected %s",cutName.Data()),"IsElectronSelected",10,-0.5,9.5);
@@ -222,29 +254,29 @@ void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TStrin
     if(preCut){
 
 
-       hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,150,0.05,20,400,-10,10);
+       hITSdEdxbefore=new TH2F(Form("Electron_ITS_before %s",cutName.Data()),"ITS dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
        fHistograms->Add(hITSdEdxbefore);
        AxisBeforeITS = hITSdEdxbefore->GetXaxis();
 
-       hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,150,0.05,20,400,-10,10);
+       hTPCdEdxbefore=new TH2F(Form("Electron_dEdx_before %s",cutName.Data()),"dEdx electron before" ,kPBins,binsPDummy,200,-10,10);
        fHistograms->Add(hTPCdEdxbefore);
        AxisBeforedEdx = hTPCdEdxbefore->GetXaxis();
 
-       hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,150,0.05,20.0,800,0.0,200);
+       hTPCdEdxSignalbefore=new TH2F(Form("Electron_dEdxSignal_before %s",cutName.Data()),"dEdx electron signal before" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
        fHistograms->Add(hTPCdEdxSignalbefore);
        AxisBeforedEdxSignal = hTPCdEdxSignalbefore->GetXaxis();
 
-       hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,150,0.05,20,400,-6,10);
+       hTOFbefore=new TH2F(Form("Electron_TOF_before %s",cutName.Data()),"TOF electron before" ,kPBins,binsPDummy,200,-10,10);
        fHistograms->Add(hTOFbefore);
        AxisBeforeTOF = hTOFbefore->GetXaxis();
        
-       hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",800,-4.0,4.0,400,0.,10.);
+       hTrackDCAxyPtbefore = new TH2F(Form("hTrack_DCAxy_Pt_before %s",cutName.Data()),"DCAxy Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
        fHistograms->Add(hTrackDCAxyPtbefore);  
        
-       hTrackDCAzPtbefore  = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz  Vs Pt of tracks before",800,-4.0,4.0,400,0.,10.);
+       hTrackDCAzPtbefore  = new TH2F(Form("hTrack_DCAz_Pt_before %s",cutName.Data()), "DCAz  Vs Pt of tracks before",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
        fHistograms->Add(hTrackDCAzPtbefore); 
        
-       hTrackNFindClsPtTPCbefore = new TH2F(Form("hTrack_NFindCls_Pt_TPC_before %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt before",100,0,1,400,0.,10.);
+       hTrackNFindClsPtTPCbefore = new TH2F(Form("hTrack_NFindCls_Pt_TPC_before %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt before",50,0,1,kPtBins,binsPtDummy);
        fHistograms->Add(hTrackNFindClsPtTPCbefore); 
        
        
@@ -252,25 +284,25 @@ void AliDalitzElectronCuts::InitCutHistograms(TString name, Bool_t preCut,TStrin
     }
 
 
-    hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,150,0.05,20,400, -10,10);
+    hITSdEdxafter=new TH2F(Form("Electron_ITS_after %s",cutName.Data()),"ITS dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
     fHistograms->Add(hITSdEdxafter);
 
-    hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,150,0.05,20,400, -10,10);
+    hTPCdEdxafter=new TH2F(Form("Electron_dEdx_after %s",cutName.Data()),"dEdx electron after" ,kPBins,binsPDummy,200, -10,10);
     fHistograms->Add(hTPCdEdxafter);
 
-    hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,150,0.05,20.0,800,0.0,200);
+    hTPCdEdxSignalafter=new TH2F(Form("Electron_dEdxSignal_after %s",cutName.Data()),"dEdx electron signal after" ,kPBins,binsPDummy,kDedxSignalbins,0.0,200);
     fHistograms->Add(hTPCdEdxSignalafter);
 
-    hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,150,0.05,20,400,-6,10);
+    hTOFafter=new TH2F(Form("Electron_TOF_after %s",cutName.Data()),"TOF electron after" ,kPBins,binsPDummy,200,-6,10);
     fHistograms->Add(hTOFafter);
       
-    hTrackDCAxyPtafter  = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",800,-4.0,4.0,400,0.,10.);
+    hTrackDCAxyPtafter  = new TH2F(Form("hTrack_DCAxy_Pt_after %s",cutName.Data()),"DCAxy Vs Pt of tracks after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
     fHistograms->Add(hTrackDCAxyPtafter); 
     
-    hTrackDCAzPtafter  = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks  after",800,-4.0,4.0,400,0.,10.);
+    hTrackDCAzPtafter  = new TH2F(Form("hTrack_DCAz_Pt_after %s",cutName.Data()), "DCAz Vs Pt of tracks  after",kDCABins,binsDCADummy,kPtBins,binsPtDummy);
     fHistograms->Add(hTrackDCAzPtafter); 
     
-    hTrackNFindClsPtTPCafter = new TH2F(Form("hTrack_NFindCls_Pt_TPC_after %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt after",100,0,1,400,0.,10.);
+    hTrackNFindClsPtTPCafter = new TH2F(Form("hTrack_NFindCls_Pt_TPC_after %s",cutName.Data()),"Track: N Findable Cls TPC Vs Pt after",50,0,1,kPtBins,binsPtDummy);
     fHistograms->Add(hTrackNFindClsPtTPCafter); 
     
     
index b3f99a1..2a22df9 100644 (file)
@@ -55,6 +55,7 @@ const char* AliPrimaryPionCuts::fgkCutNames[AliPrimaryPionCuts::kNCuts] = {
        "kPiDedxSigmaITSCut",
        "kPiDedxSigmaTPCCut",
        "kPiTOFSigmaCut",
+       "kMassCut"
 };
 
 //________________________________________________________________________
@@ -80,6 +81,8 @@ AliPrimaryPionCuts::AliPrimaryPionCuts(const char *name,const char *title) : Ali
        fUseCorrectedTPCClsInfo(kFALSE),
        fUseTOFpid(kFALSE),
        fRequireTOF(kFALSE),
+       fDoMassCut(kFALSE),
+       fMassCut(10),
        fDoWeights(kFALSE),
        fCutString(NULL),
        fHistCutIndex(NULL),
@@ -564,6 +567,12 @@ Bool_t AliPrimaryPionCuts::SetCut(cutIds cutID, const Int_t value) {
                                UpdateCutString();
                                return kTRUE;
                        } else return kFALSE;
+               case kMassCut:
+                       if( SetMassCut(value)) {
+                               fCuts[kMassCut] = value;
+                               UpdateCutString();
+                               return kTRUE;
+                       } else return kFALSE;
                case kNCuts:
                        cout << "Error:: Cut id out of range"<< endl;
                        return kFALSE;
@@ -947,6 +956,41 @@ Bool_t AliPrimaryPionCuts::SetTOFPionPIDCut(Int_t TOFelectronPID){
     return kTRUE;
 }
 
+///________________________________________________________________________
+Bool_t AliPrimaryPionCuts::SetMassCut(Int_t massCut){
+    // Set Cut
+       switch(massCut){ 
+               case 0: // no cut
+                       fDoMassCut = kFALSE;
+                       fMassCut = 10;
+                       break;
+               case 1: // cut at 1 GeV/c^2
+                       fDoMassCut = kTRUE;
+                       fMassCut = 1;
+                       break;
+               case 2: // cut at 0.7 GeV/c^2
+                       fDoMassCut = kTRUE;
+                       fMassCut = 0.7;
+                       break;
+               case 3: // cut at 0.6 GeV/c^2
+                       fDoMassCut = kTRUE;
+                       fMassCut = 0.6;
+                       break;
+               case 4: // cut at eta mass
+                       fDoMassCut = kTRUE;
+                       fMassCut = 0.547853;
+                       break;
+               case 5: // cut at 0.5 GeV/c^2
+                       fDoMassCut = kTRUE;
+                       fMassCut = 0.5;
+                       break;
+               default:
+                       cout<<"Warning: MassCut not defined "<<massCut<<endl;
+               return kFALSE;
+    } 
+    return kTRUE;
+}
+
 
 ///________________________________________________________________________
 TString AliPrimaryPionCuts::GetCutNumber(){
@@ -963,7 +1007,7 @@ TString AliPrimaryPionCuts::GetCutNumber(){
 AliPrimaryPionCuts* AliPrimaryPionCuts::GetStandardCuts2010PbPb(){
     //Create and return standard 2010 PbPb cuts
     AliPrimaryPionCuts *cuts=new AliPrimaryPionCuts("StandardCuts2010PbPb","StandardCuts2010PbPb");
-    if(!cuts->InitializeCutsFromCutString("9069640364102")){
+    if(!cuts->InitializeCutsFromCutString("000000400")){
                cout<<"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;   
        }
     return cuts;
@@ -974,7 +1018,7 @@ AliPrimaryPionCuts* AliPrimaryPionCuts::GetStandardCuts2010pp(){
     //Create and return standard 2010 PbPb cuts
     AliPrimaryPionCuts *cuts=new AliPrimaryPionCuts("StandardCuts2010pp","StandardCuts2010pp");
                                           
-    if(!cuts->InitializeCutsFromCutString("9069640364102")){
+    if(!cuts->InitializeCutsFromCutString("000000400")){
                cout<<"Warning: Initialization of Standardcuts2010pp failed"<<endl;
        }
     return cuts;
index 205e784..e6aef3a 100644 (file)
@@ -46,6 +46,7 @@ class AliPrimaryPionCuts : public AliAnalysisCuts {
                kPidedxSigmaITSCut,
                kPidedxSigmaTPCCut,
                kPiTOFSigmaPID,
+               kMassCut,
                kNCuts
        };
 
@@ -108,11 +109,14 @@ class AliPrimaryPionCuts : public AliAnalysisCuts {
        Bool_t SetDCACut(Int_t dcaCut);
        void SetEtaShift(Double_t etaShift){fEtaShift = etaShift;}
        Bool_t SetTOFPionPIDCut(Int_t TOFelectronPID);
+       Bool_t SetMassCut(Int_t massCut);
+       Double_t GetMassCut(){return fMassCut;}
        
        // Request Flags
        Double_t GetEtaCut(){ return  fEtaCut;}
        Double_t GetNFindableClustersTPC(AliESDtrack* lTrack);
        Bool_t   DoWeights(){return fDoWeights;}
+       Bool_t   DoMassCut(){return fDoMassCut;}
        
        protected:
 
@@ -138,7 +142,10 @@ class AliPrimaryPionCuts : public AliAnalysisCuts {
        Bool_t   fUseCorrectedTPCClsInfo; // flag to use corrected tpc cl info
        Bool_t   fUseTOFpid; // flag to use tof pid
        Bool_t   fRequireTOF; //flg to analyze only tracks with TOF signal
+       Bool_t   fDoMassCut;
+       Double_t fMassCut;      
        Bool_t   fDoWeights;
+       
 
 
        // Histograms
@@ -166,7 +173,7 @@ class AliPrimaryPionCuts : public AliAnalysisCuts {
        AliPrimaryPionCuts& operator=(const AliPrimaryPionCuts&); // not implemented
 
 
-       ClassDef(AliPrimaryPionCuts,2)
+       ClassDef(AliPrimaryPionCuts,3)
 };
 
 #endif
index bab51b7..e5956ec 100644 (file)
@@ -45,8 +45,8 @@ void AddTask_GammaConvEtaPiPlPiMiGamma_pPb(
        }
        
        //=========  Set Cutnumber for V0Reader ================================
-       TString ConvCutnumber = "8000000060084001001500000000";   //Online  V0 finder
-       TString PionCuts      = "00000221";            //Electron Cuts
+       TString ConvCutnumber = "8000000060081001001500000000";   //Online  V0 finder
+       TString PionCuts      = "000000200";            //Electron Cuts
                
        Bool_t doEtaShift = kFALSE;
 
@@ -128,7 +128,7 @@ void AddTask_GammaConvEtaPiPlPiMiGamma_pPb(
        task->SetIsMC(isMC);
 
        // Cut Numbers to use in Analysis
-       Int_t numberOfCuts = 1;
+       Int_t numberOfCuts = 4;
        TString *ConvCutarray    = new TString[numberOfCuts];
        TString *PionCutarray    = new TString[numberOfCuts];
 
@@ -143,7 +143,10 @@ void AddTask_GammaConvEtaPiPlPiMiGamma_pPb(
        stringShift = "pPb";
 
        if( trainConfig == 1 ) {
-               ConvCutarray[0] = "8000011002092170008260400000"; PionCutarray[0] = "00000362"; MesonCutarray[0] = "01039035009000"; //standard cut Pi0 PbPb 00-100                     
+               ConvCutarray[0] = "8000011002091170008260400000"; PionCutarray[0] = "000000400"; MesonCutarray[0] = "01035035000000"; //standard cut Pi0 PbPb 00-100                    
+               ConvCutarray[1] = "8000011002091170008260400000"; PionCutarray[1] = "000000403"; MesonCutarray[1] = "01035035000000"; //standard cut Pi0 PbPb 00-100                    
+               ConvCutarray[2] = "8000011002091170008260400000"; PionCutarray[2] = "000000404"; MesonCutarray[2] = "01035035000000"; //standard cut Pi0 PbPb 00-100                    
+               ConvCutarray[3] = "8000011002091170008260400000"; PionCutarray[3] = "000000405"; MesonCutarray[3] = "01035035000000"; //standard cut Pi0 PbPb 00-100                    
        } 
        
        TList *ConvCutList  = new TList();
index 7c35581..79a698f 100644 (file)
@@ -1104,7 +1104,7 @@ void AddTask_GammaConvV1_pPb(  Int_t trainConfig = 1,  //change different set of
        task->SetMoveParticleAccordingToVertex(kTRUE);
        task->SetDoMesonAnalysis(kTRUE);
        task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA
-       task->SetDoPhotonQA(enableQAMesonTask);  //Attention new switch small for Photon QA
+       task->SetDoPhotonQA(enableQAPhotonTask);  //Attention new switch small for Photon QA
        
        //connect containers
        AliAnalysisDataContainer *coutput =
index 145a493..b356735 100644 (file)
@@ -160,7 +160,7 @@ void AddTask_GammaConvV1_pPb2(  Int_t trainConfig = 1,  //change different set o
    task->SetMoveParticleAccordingToVertex(kTRUE);
    task->SetDoMesonAnalysis(kTRUE);
    task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA
-   task->SetDoPhotonQA(enableQAMesonTask);  //Attention new switch small for Photon QA
+   task->SetDoPhotonQA(enableQAPhotonTask);  //Attention new switch small for Photon QA
  
    //connect containers
    AliAnalysisDataContainer *coutput =