]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/GammaConv/AliAnalysisTaskGammaConvCalo.cxx
fix coverity 24652
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliAnalysisTaskGammaConvCalo.cxx
index b4f74f2015523824d73a64da345ebfd5b53d2e47..3662683ffac8cc03e823ba67ed3317a416df93ec 100644 (file)
@@ -102,6 +102,7 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(): AliAnalysisTaskSE(
        fCharCatPhoton(0),
        fCharPhotonMCInfo(0),
        fHistoMotherInvMassPt(NULL),
+       fHistoMotherMatchedInvMassPt(NULL),
        fSparseMotherInvMassPtZM(NULL),
        fHistoMotherBackInvMassPt(NULL),
        fSparseMotherBackInvMassPtZM(NULL),
@@ -112,6 +113,10 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(): AliAnalysisTaskSE(
        fHistoMotherEtaPtAlpha(NULL),
        fHistoMotherPi0PtOpenAngle(NULL),
        fHistoMotherEtaPtOpenAngle(NULL),
+    fHistoMotherPi0ConvPhotonEtaPhi(NULL),
+    fHistoMotherEtaConvPhotonEtaPhi(NULL),
+       fHistoMotherInvMassECalib(NULL),
+       fHistoMotherInvMassECalibalpha(NULL),
        fTreeMesonsInvMassPtDcazMinDcazMaxFlag(NULL),
        fInvMass(0),
        fPt(0),
@@ -128,6 +133,7 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(): AliAnalysisTaskSE(
        fHistoClusGammaPt(NULL),
        fHistoMCHeaders(NULL),
        fHistoMCAllGammaPt(NULL),
+       fHistoMCAllGammaEMCALAccPt(NULL),
        fHistoMCDecayGammaPi0Pt(NULL),
        fHistoMCDecayGammaRhoPt(NULL),
        fHistoMCDecayGammaEtaPt(NULL),
@@ -146,6 +152,8 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(): AliAnalysisTaskSE(
        fHistoMCEtaInAccPt(NULL),
        fHistoMCPi0PtY(NULL),
        fHistoMCEtaPtY(NULL),
+       fHistoMCPi0PtAlpha(NULL),
+       fHistoMCEtaPtAlpha(NULL),
        fHistoMCK0sPt(NULL),
        fHistoMCK0sWOWeightPt(NULL),
        fHistoMCK0sPtY(NULL),
@@ -153,24 +161,36 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(): AliAnalysisTaskSE(
        fHistoMCSecPi0Source(NULL),
        fHistoMCSecEtaPt(NULL),
        fHistoMCSecEtaSource(NULL),
-       fHistoTrueMotherInvMassPt(NULL),
-       fHistoTrueMotherCaloPhotonInvMassPt(NULL),
-       fHistoTrueMotherCaloConvertedPhotonInvMassPt(NULL),
-       fHistoTrueMotherCaloElectronInvMassPt(NULL),
-       fHistoTrueMotherCaloMergedClusterInvMassPt(NULL),
+       fHistoTruePi0InvMassPt(NULL),
+       fHistoTrueEtaInvMassPt(NULL),
+       fHistoTruePi0CaloPhotonInvMassPt(NULL),
+       fHistoTrueEtaCaloPhotonInvMassPt(NULL),
+       fHistoTruePi0CaloConvertedPhotonInvMassPt(NULL),
+       fHistoTruePi0CaloConvertedPhotonMatchedInvMassPt(NULL),
+       fHistoTrueEtaCaloConvertedPhotonInvMassPt(NULL),
+       fHistoTrueEtaCaloConvertedPhotonMatchedInvMassPt(NULL),
+       fHistoTruePi0CaloElectronInvMassPt(NULL),
+       fHistoTrueEtaCaloElectronInvMassPt(NULL),
+       fHistoTruePi0CaloMergedClusterInvMassPt(NULL),
+       fHistoTrueEtaCaloMergedClusterInvMassPt(NULL),
        fHistoTrueMotherCaloEMNonLeadingInvMassPt(NULL),
-       fHistoTrueMotherCaloMergedClusterPartConvInvMassPt(NULL),
-       fHistoTruePrimaryMotherInvMassPt(NULL),
-       fHistoTruePrimaryMotherW0WeightingInvMassPt(NULL),
-       fProfileTruePrimaryMotherWeightsInvMassPt(NULL),
+       fHistoTruePi0CaloMergedClusterPartConvInvMassPt(NULL),
+       fHistoTrueEtaCaloMergedClusterPartConvInvMassPt(NULL),
+       fHistoTruePrimaryPi0InvMassPt(NULL),
+       fHistoTruePrimaryEtaInvMassPt(NULL),
+       fHistoTruePrimaryPi0W0WeightingInvMassPt(NULL),
+       fHistoTruePrimaryEtaW0WeightingInvMassPt(NULL),
+       fProfileTruePrimaryPi0WeightsInvMassPt(NULL),
+       fProfileTruePrimaryEtaWeightsInvMassPt(NULL),
        fHistoTruePrimaryPi0MCPtResolPt(NULL),
        fHistoTruePrimaryEtaMCPtResolPt(NULL),
-       fHistoTrueSecondaryMotherInvMassPt(NULL),
-       fHistoTrueSecondaryMotherFromK0sInvMassPt(NULL),
+       fHistoTrueSecondaryPi0InvMassPt(NULL),
+       fHistoTrueSecondaryEtaInvMassPt(NULL),
+       fHistoTrueSecondaryPi0FromK0sInvMassPt(NULL),
        fHistoTrueK0sWithPi0DaughterMCPt(NULL),
-       fHistoTrueSecondaryMotherFromEtaInvMassPt(NULL),
+       fHistoTrueSecondaryPi0FromEtaInvMassPt(NULL),
        fHistoTrueEtaWithPi0DaughterMCPt(NULL),
-       fHistoTrueSecondaryMotherFromLambdaInvMassPt(NULL),
+       fHistoTrueSecondaryPi0FromLambdaInvMassPt(NULL),
        fHistoTrueLambdaWithPi0DaughterMCPt(NULL),
        fHistoTrueBckGGInvMassPt(NULL),
        fHistoTrueBckContInvMassPt(NULL),
@@ -191,8 +211,10 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(): AliAnalysisTaskSE(
        fHistoTrueSecondaryConvGammaFromXFromLambdaPt(NULL),
        fHistoTrueClusGammaPt(NULL),
        fHistoTrueClusUnConvGammaPt(NULL),
+       fHistoTrueClusUnConvGammaMCPt(NULL),
        fHistoTrueClusElectronPt(NULL),
        fHistoTrueClusConvGammaPt(NULL),
+       fHistoTrueClusConvGammaMCPt(NULL),
        fHistoTrueClusConvGammaFullyPt(NULL),
        fHistoTrueClusMergedGammaPt(NULL),
        fHistoTrueClusMergedPartConvGammaPt(NULL),
@@ -200,6 +222,8 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(): AliAnalysisTaskSE(
        fHistoTrueClusDalitzMergedPt(NULL),
        fHistoTrueClusPhotonFromElecMotherPt(NULL),
        fHistoTrueClusShowerPt(NULL),
+       fHistoTrueClusSubLeadingPt(NULL),
+       fHistoTrueClusNParticles(NULL),
        fHistoTrueClusEMNonLeadingPt(NULL),
        fHistoTrueNLabelsInClus(NULL),
        fHistoTruePrimaryClusGammaPt(NULL),
@@ -230,10 +254,7 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(): AliAnalysisTaskSE(
        fDoPhotonQA(0),
        fDoClusterQA(0),
        fIsFromMBHeader(kTRUE),
-       fIsMC(kFALSE),
-       fMinE(0.1),
-       fNminCells(2),
-       fEMCm02cut(0.5)
+       fIsMC(kFALSE)
 {
   
 }
@@ -282,6 +303,7 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(const char *name):
        fCharCatPhoton(0),
        fCharPhotonMCInfo(0),
        fHistoMotherInvMassPt(NULL),
+       fHistoMotherMatchedInvMassPt(NULL),
        fSparseMotherInvMassPtZM(NULL),
        fHistoMotherBackInvMassPt(NULL),
        fSparseMotherBackInvMassPtZM(NULL),
@@ -292,6 +314,10 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(const char *name):
        fHistoMotherEtaPtAlpha(NULL),
        fHistoMotherPi0PtOpenAngle(NULL),
        fHistoMotherEtaPtOpenAngle(NULL),
+    fHistoMotherPi0ConvPhotonEtaPhi(NULL),
+    fHistoMotherEtaConvPhotonEtaPhi(NULL),
+       fHistoMotherInvMassECalib(NULL),
+       fHistoMotherInvMassECalibalpha(NULL),
        fTreeMesonsInvMassPtDcazMinDcazMaxFlag(NULL),
        fInvMass(0),
        fPt(0),
@@ -308,6 +334,7 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(const char *name):
        fHistoClusGammaPt(NULL),
        fHistoMCHeaders(NULL),
        fHistoMCAllGammaPt(NULL),
+       fHistoMCAllGammaEMCALAccPt(NULL),
        fHistoMCDecayGammaPi0Pt(NULL),
        fHistoMCDecayGammaRhoPt(NULL),
        fHistoMCDecayGammaEtaPt(NULL),
@@ -326,6 +353,8 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(const char *name):
        fHistoMCEtaInAccPt(NULL),
        fHistoMCPi0PtY(NULL),
        fHistoMCEtaPtY(NULL),
+       fHistoMCPi0PtAlpha(NULL),
+       fHistoMCEtaPtAlpha(NULL),
        fHistoMCK0sPt(NULL),
        fHistoMCK0sWOWeightPt(NULL),
        fHistoMCK0sPtY(NULL),
@@ -333,24 +362,36 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(const char *name):
        fHistoMCSecPi0Source(NULL),
        fHistoMCSecEtaPt(NULL),
        fHistoMCSecEtaSource(NULL),
-       fHistoTrueMotherInvMassPt(NULL),
-       fHistoTrueMotherCaloPhotonInvMassPt(NULL),
-       fHistoTrueMotherCaloConvertedPhotonInvMassPt(NULL),
-       fHistoTrueMotherCaloElectronInvMassPt(NULL),
-       fHistoTrueMotherCaloMergedClusterInvMassPt(NULL),
+       fHistoTruePi0InvMassPt(NULL),
+       fHistoTrueEtaInvMassPt(NULL),
+       fHistoTruePi0CaloPhotonInvMassPt(NULL),
+       fHistoTrueEtaCaloPhotonInvMassPt(NULL),
+       fHistoTruePi0CaloConvertedPhotonInvMassPt(NULL),
+       fHistoTruePi0CaloConvertedPhotonMatchedInvMassPt(NULL),
+       fHistoTrueEtaCaloConvertedPhotonInvMassPt(NULL),
+       fHistoTrueEtaCaloConvertedPhotonMatchedInvMassPt(NULL),
+       fHistoTruePi0CaloElectronInvMassPt(NULL),
+       fHistoTrueEtaCaloElectronInvMassPt(NULL),
+       fHistoTruePi0CaloMergedClusterInvMassPt(NULL),
+       fHistoTrueEtaCaloMergedClusterInvMassPt(NULL),
        fHistoTrueMotherCaloEMNonLeadingInvMassPt(NULL),
-       fHistoTrueMotherCaloMergedClusterPartConvInvMassPt(NULL),
-       fHistoTruePrimaryMotherInvMassPt(NULL),
-       fHistoTruePrimaryMotherW0WeightingInvMassPt(NULL),
-       fProfileTruePrimaryMotherWeightsInvMassPt(NULL),
+       fHistoTruePi0CaloMergedClusterPartConvInvMassPt(NULL),
+       fHistoTrueEtaCaloMergedClusterPartConvInvMassPt(NULL),
+       fHistoTruePrimaryPi0InvMassPt(NULL),
+       fHistoTruePrimaryEtaInvMassPt(NULL),
+       fHistoTruePrimaryPi0W0WeightingInvMassPt(NULL),
+       fHistoTruePrimaryEtaW0WeightingInvMassPt(NULL),
+       fProfileTruePrimaryPi0WeightsInvMassPt(NULL),
+       fProfileTruePrimaryEtaWeightsInvMassPt(NULL),
        fHistoTruePrimaryPi0MCPtResolPt(NULL),
        fHistoTruePrimaryEtaMCPtResolPt(NULL),
-       fHistoTrueSecondaryMotherInvMassPt(NULL),
-       fHistoTrueSecondaryMotherFromK0sInvMassPt(NULL),
+       fHistoTrueSecondaryPi0InvMassPt(NULL),
+       fHistoTrueSecondaryEtaInvMassPt(NULL),
+       fHistoTrueSecondaryPi0FromK0sInvMassPt(NULL),
        fHistoTrueK0sWithPi0DaughterMCPt(NULL),
-       fHistoTrueSecondaryMotherFromEtaInvMassPt(NULL),
+       fHistoTrueSecondaryPi0FromEtaInvMassPt(NULL),
        fHistoTrueEtaWithPi0DaughterMCPt(NULL),
-       fHistoTrueSecondaryMotherFromLambdaInvMassPt(NULL),
+       fHistoTrueSecondaryPi0FromLambdaInvMassPt(NULL),
        fHistoTrueLambdaWithPi0DaughterMCPt(NULL),
        fHistoTrueBckGGInvMassPt(NULL),
        fHistoTrueBckContInvMassPt(NULL),
@@ -371,8 +412,10 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(const char *name):
        fHistoTrueSecondaryConvGammaFromXFromLambdaPt(NULL),
        fHistoTrueClusGammaPt(NULL),
        fHistoTrueClusUnConvGammaPt(NULL),
+       fHistoTrueClusUnConvGammaMCPt(NULL),
        fHistoTrueClusElectronPt(NULL),
        fHistoTrueClusConvGammaPt(NULL),
+       fHistoTrueClusConvGammaMCPt(NULL),
        fHistoTrueClusConvGammaFullyPt(NULL),
        fHistoTrueClusMergedGammaPt(NULL),
        fHistoTrueClusMergedPartConvGammaPt(NULL),
@@ -380,6 +423,8 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(const char *name):
        fHistoTrueClusDalitzMergedPt(NULL),
        fHistoTrueClusPhotonFromElecMotherPt(NULL),
        fHistoTrueClusShowerPt(NULL),
+       fHistoTrueClusSubLeadingPt(NULL),
+       fHistoTrueClusNParticles(NULL),
        fHistoTrueClusEMNonLeadingPt(NULL),
        fHistoTrueNLabelsInClus(NULL),
        fHistoTruePrimaryClusGammaPt(NULL),
@@ -410,10 +455,7 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(const char *name):
        fDoPhotonQA(0),
        fDoClusterQA(0),
        fIsFromMBHeader(kTRUE),
-       fIsMC(kFALSE),
-       fMinE(0.1),
-       fNminCells(2),
-       fEMCm02cut(0.5)
+       fIsMC(kFALSE)
 {
   // Define output slots here
   DefineOutput(1, TList::Class());
@@ -508,11 +550,13 @@ void AliAnalysisTaskGammaConvCalo::InitBack(){
                                fBGHandler[iCut] = new AliGammaConversionAODBGHandler(
                                                                                                                                        collisionSystem,centMin,centMax,
                                                                                                                                        ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
-                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity());
+                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity(),
+                                                                                                                                       2,8,7);
                                fBGClusHandler[iCut] = new AliGammaConversionAODBGHandler(
                                                                                                                                        collisionSystem,centMin,centMax,
                                                                                                                                        ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
-                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity());
+                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity(),
+                                                                                                                                       2,8,7);
                                fBGHandlerRP[iCut] = NULL;
                        } else{
                                fBGHandlerRP[iCut] = new AliConversionAODBGHandlerRP(
@@ -568,6 +612,7 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
        
        if(fDoMesonAnalysis){
                fHistoMotherInvMassPt = new TH2F*[fnCuts];
+               fHistoMotherMatchedInvMassPt = new TH2F*[fnCuts];
                fHistoMotherBackInvMassPt = new TH2F*[fnCuts];
                fHistoMotherInvMassEalpha = new TH2F*[fnCuts];
                if (fDoMesonQA == 2){
@@ -581,6 +626,12 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                        fHistoMotherEtaPtAlpha =  new TH2F*[fnCuts];
                        fHistoMotherPi0PtOpenAngle =  new TH2F*[fnCuts];
                        fHistoMotherEtaPtOpenAngle =  new TH2F*[fnCuts];
+            fHistoMotherPi0ConvPhotonEtaPhi = new TH2F*[fnCuts];
+            fHistoMotherEtaConvPhotonEtaPhi = new TH2F*[fnCuts];
+               }
+               if(fDoMesonQA == 1){
+                       fHistoMotherInvMassECalib = new TH2F*[fnCuts];
+                       fHistoMotherInvMassECalibalpha = new TH2F*[fnCuts];
                }
        }
        fTagOutputList = new TList*[fnCuts];
@@ -610,11 +661,11 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                fESDList[iCut]->SetOwner(kTRUE);
                fCutFolder[iCut]->Add(fESDList[iCut]);
     
-               fHistoNEvents[iCut] = new TH1I("NEvents","NEvents",9,-0.5,8.5);
+               fHistoNEvents[iCut] = new TH1I("NEvents","NEvents",10,-0.5,9.5);
                fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(1,"Accepted");
                fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(2,"Centrality");
                fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(3,"Missing MC");
-               if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() == 4 ){
+               if (((AliConvEventCuts*)fEventCutArray->At(iCut))->IsSpecialTrigger() > 1 ){ 
                        TString TriggerNames = "Not Trigger: ";
                        TriggerNames = TriggerNames+ ( (AliConvEventCuts*)fEventCutArray->At(iCut))->GetSpecialTriggerName();
                        fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(4,TriggerNames.Data());
@@ -626,6 +677,7 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(7,"Pile-Up");
                fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(8,"no SDD");
                fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(9,"no V0AND");
+               fHistoNEvents[iCut]->GetXaxis()->SetBinLabel(10,"EMCAL problem");
                fESDList[iCut]->Add(fHistoNEvents[iCut]);
                
                if(fIsHeavyIon == 1) fHistoNGoodESDTracks[iCut] = new TH1I("GoodESDTracks","GoodESDTracks",4000,0,4000);
@@ -727,6 +779,8 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                if(fDoMesonAnalysis){
                        fHistoMotherInvMassPt[iCut] = new TH2F("ESD_Mother_InvMass_Pt","ESD_Mother_InvMass_Pt",800,0,0.8,250,0,25);
                        fESDList[iCut]->Add(fHistoMotherInvMassPt[iCut]);
+                       fHistoMotherMatchedInvMassPt[iCut] = new TH2F("ESD_MotherMatched_InvMass_Pt","ESD_MotherMatched_InvMass_Pt",800,0,0.8,250,0,25);
+                       fESDList[iCut]->Add(fHistoMotherMatchedInvMassPt[iCut]);
                        fHistoMotherBackInvMassPt[iCut] = new TH2F("ESD_Background_InvMass_Pt","ESD_Background_InvMass_Pt",800,0,0.8,250,0,25);
                        fESDList[iCut]->Add(fHistoMotherBackInvMassPt[iCut]);
                        fHistoMotherInvMassEalpha[iCut] = new TH2F("ESD_Mother_InvMass_vs_E_alpha","ESD_Mother_InvMass_vs_E_alpha",800,0,0.8,250,0,25);
@@ -749,6 +803,13 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                                fMesonDCAList[iCut]->Add(fTreeMesonsInvMassPtDcazMinDcazMaxFlag[iCut]);
                                
                        }
+                       if(fDoMesonQA == 1){
+                fHistoMotherInvMassECalib[iCut] = new TH2F("ESD_Mother_InvMass_E_Calib","ESD_Mother_InvMass_E_Calib",800,0,0.8,250,0,25);
+                               fESDList[iCut]->Add(fHistoMotherInvMassECalib[iCut]);
+                               fHistoMotherInvMassECalibalpha[iCut] = new TH2F("ESD_Mother_InvMass_vs_E_Calib_alpha","ESD_Mother_InvMass_vs_E_Calib_alpha",800,0,0.8,250,0,25);
+                               fESDList[iCut]->Add(fHistoMotherInvMassECalibalpha[iCut]);
+                       }
+
                        if (fDoMesonQA > 0 ){
                                fHistoMotherPi0PtY[iCut] = new TH2F("ESD_MotherPi0_Pt_Y","ESD_MotherPi0_Pt_Y",150,0.03,15.,150,-1.5,1.5);
                                SetLogBinningXTH2(fHistoMotherPi0PtY[iCut]);
@@ -762,12 +823,16 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                                fHistoMotherEtaPtAlpha[iCut] = new TH2F("ESD_MotherEta_Pt_Alpha","ESD_MotherEta_Pt_Alpha",150,0.03,15.,100,0,1);
                                SetLogBinningXTH2(fHistoMotherEtaPtAlpha[iCut]);
                                fESDList[iCut]->Add(fHistoMotherEtaPtAlpha[iCut]);
-                               fHistoMotherPi0PtOpenAngle[iCut] = new TH2F("ESD_MotherPi0_Pt_OpenAngle","ESD_MotherPi0_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi());
+                               fHistoMotherPi0PtOpenAngle[iCut] = new TH2F("ESD_MotherPi0_Pt_OpenAngle","ESD_MotherPi0_Pt_OpenAngle",150,0.03,15.,100,0,TMath::Pi());
                                SetLogBinningXTH2(fHistoMotherPi0PtOpenAngle[iCut]);
                                fESDList[iCut]->Add(fHistoMotherPi0PtOpenAngle[iCut]);
-                               fHistoMotherEtaPtOpenAngle[iCut] = new TH2F("ESD_MotherEta_Pt_OpenAngle","ESD_MotherEta_Pt_OpenAngle",150,0.03,15.,200,0,2*TMath::Pi());
+                               fHistoMotherEtaPtOpenAngle[iCut] = new TH2F("ESD_MotherEta_Pt_OpenAngle","ESD_MotherEta_Pt_OpenAngle",150,0.03,15.,100,0,TMath::Pi());
                                SetLogBinningXTH2(fHistoMotherEtaPtOpenAngle[iCut]);
                                fESDList[iCut]->Add(fHistoMotherEtaPtOpenAngle[iCut]);
+                fHistoMotherPi0ConvPhotonEtaPhi[iCut] = new TH2F("ESD_MotherPi0ConvPhoton_Eta_Phi","ESD_MotherPi0ConvPhoton_Eta_Phi",600,0,2*TMath::Pi(),400,-2,2);
+                fESDList[iCut]->Add(fHistoMotherPi0ConvPhotonEtaPhi[iCut]);
+                fHistoMotherEtaConvPhotonEtaPhi[iCut] = new TH2F("ESD_MotherEtaConvPhoton_Eta_Phi","ESD_MotherEtaConvPhoton_Eta_Phi",600,0,2*TMath::Pi(),400,-2,2);
+                fESDList[iCut]->Add(fHistoMotherEtaConvPhotonEtaPhi[iCut]);
                        }
                }    
        }
@@ -784,6 +849,7 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                fHeaderNameList                                         = new TList*[fnCuts];
                fHistoMCHeaders                                         = new TH1I*[fnCuts];
                fHistoMCAllGammaPt                                      = new TH1F*[fnCuts];
+               fHistoMCAllGammaEMCALAccPt                      = new TH1F*[fnCuts];
                fHistoMCDecayGammaPi0Pt                         = new TH1F*[fnCuts];
                fHistoMCDecayGammaRhoPt                         = new TH1F*[fnCuts];
                fHistoMCDecayGammaEtaPt                         = new TH1F*[fnCuts];
@@ -813,8 +879,10 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                }
                if (fDoClusterQA > 0){  
                        fHistoTrueClusUnConvGammaPt             = new TH1F*[fnCuts];
+                       fHistoTrueClusUnConvGammaMCPt           = new TH1F*[fnCuts];
                        fHistoTrueClusElectronPt                        = new TH1F*[fnCuts];
                        fHistoTrueClusConvGammaPt                       = new TH1F*[fnCuts];
+                       fHistoTrueClusConvGammaMCPt                     = new TH1F*[fnCuts];
                        fHistoTrueClusConvGammaFullyPt          = new TH1F*[fnCuts];
                        fHistoTrueClusMergedGammaPt             = new TH1F*[fnCuts];
                        fHistoTrueClusMergedPartConvGammaPt = new TH1F*[fnCuts];
@@ -822,6 +890,8 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                        fHistoTrueClusDalitzMergedPt            = new TH1F*[fnCuts];
                        fHistoTrueClusPhotonFromElecMotherPt= new TH1F*[fnCuts];
                        fHistoTrueClusShowerPt                          = new TH1F*[fnCuts];
+                       fHistoTrueClusSubLeadingPt                      = new TH1F*[fnCuts];
+                       fHistoTrueClusNParticles                        = new TH1I*[fnCuts];
                        fHistoTrueClusEMNonLeadingPt            = new TH1F*[fnCuts];
                        fHistoTrueNLabelsInClus                         = new TH1F*[fnCuts];                    
                }
@@ -834,17 +904,24 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                        fHistoMCPi0InAccPt                              = new TH1F*[fnCuts];
                        fHistoMCEtaInAccPt                              = new TH1F*[fnCuts];
       
-                       fHistoTrueMotherInvMassPt                                       = new TH2F*[fnCuts];
-                       fHistoTruePrimaryMotherInvMassPt                        = new TH2F*[fnCuts];
-                       fHistoTruePrimaryMotherW0WeightingInvMassPt = new TH2F*[fnCuts];
-                       fProfileTruePrimaryMotherWeightsInvMassPt       = new TProfile2D*[fnCuts];
-                       fHistoTrueSecondaryMotherInvMassPt                      = new TH2F*[fnCuts];
-                       fHistoTrueSecondaryMotherFromK0sInvMassPt       = new TH2F*[fnCuts];
-                       fHistoTrueSecondaryMotherFromEtaInvMassPt       = new TH2F*[fnCuts];
-                       fHistoTrueSecondaryMotherFromLambdaInvMassPt = new TH2F*[fnCuts];
+                       fHistoTruePi0InvMassPt                                  = new TH2F*[fnCuts];
+                       fHistoTrueEtaInvMassPt                                  = new TH2F*[fnCuts];
+                       fHistoTruePrimaryPi0InvMassPt                   = new TH2F*[fnCuts];
+                       fHistoTruePrimaryEtaInvMassPt                   = new TH2F*[fnCuts];
+                       fHistoTruePrimaryPi0W0WeightingInvMassPt = new TH2F*[fnCuts];
+                       fHistoTruePrimaryEtaW0WeightingInvMassPt = new TH2F*[fnCuts];
+                       fProfileTruePrimaryPi0WeightsInvMassPt  = new TProfile2D*[fnCuts];
+                       fProfileTruePrimaryEtaWeightsInvMassPt  = new TProfile2D*[fnCuts];
+                       fHistoTrueSecondaryPi0InvMassPt                         = new TH2F*[fnCuts];
+                       fHistoTrueSecondaryEtaInvMassPt                         = new TH2F*[fnCuts];
+                       fHistoTrueSecondaryPi0FromK0sInvMassPt  = new TH2F*[fnCuts];
+                       fHistoTrueSecondaryPi0FromEtaInvMassPt  = new TH2F*[fnCuts];
+                       fHistoTrueSecondaryPi0FromLambdaInvMassPt = new TH2F*[fnCuts];
                        if (fDoMesonQA > 0){
                                fHistoMCPi0PtY                                                          = new TH2F*[fnCuts];
                                fHistoMCEtaPtY                                                          = new TH2F*[fnCuts];
+                               fHistoMCPi0PtAlpha                                                      = new TH2F*[fnCuts];
+                               fHistoMCEtaPtAlpha                                                      = new TH2F*[fnCuts];
                                fHistoMCK0sPt                                                           = new TH1F*[fnCuts];
                                fHistoMCK0sWOWeightPt                                           = new TH1F*[fnCuts];
                                fHistoMCK0sPtY                                                          = new TH2F*[fnCuts];
@@ -852,11 +929,18 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                                fHistoMCSecPi0Source                                            = new TH1F*[fnCuts];
                                fHistoMCSecEtaPt                                                        = new TH1F*[fnCuts];
                                fHistoMCSecEtaSource                                            = new TH1F*[fnCuts];
-                               fHistoTrueMotherCaloPhotonInvMassPt                     = new TH2F*[fnCuts];
-                               fHistoTrueMotherCaloConvertedPhotonInvMassPt= new TH2F*[fnCuts];
-                               fHistoTrueMotherCaloElectronInvMassPt           = new TH2F*[fnCuts];
-                               fHistoTrueMotherCaloMergedClusterInvMassPt      = new TH2F*[fnCuts];
-                               fHistoTrueMotherCaloMergedClusterPartConvInvMassPt      = new TH2F*[fnCuts];
+                               fHistoTruePi0CaloPhotonInvMassPt                        = new TH2F*[fnCuts];
+                               fHistoTrueEtaCaloPhotonInvMassPt                        = new TH2F*[fnCuts];
+                               fHistoTruePi0CaloConvertedPhotonInvMassPt       = new TH2F*[fnCuts];
+                               fHistoTruePi0CaloConvertedPhotonMatchedInvMassPt = new TH2F*[fnCuts];
+                               fHistoTrueEtaCaloConvertedPhotonInvMassPt       = new TH2F*[fnCuts];
+                               fHistoTrueEtaCaloConvertedPhotonMatchedInvMassPt = new TH2F*[fnCuts];
+                               fHistoTruePi0CaloElectronInvMassPt              = new TH2F*[fnCuts];
+                               fHistoTrueEtaCaloElectronInvMassPt              = new TH2F*[fnCuts];
+                               fHistoTruePi0CaloMergedClusterInvMassPt         = new TH2F*[fnCuts];
+                               fHistoTrueEtaCaloMergedClusterInvMassPt         = new TH2F*[fnCuts];
+                               fHistoTruePi0CaloMergedClusterPartConvInvMassPt         = new TH2F*[fnCuts];
+                               fHistoTrueEtaCaloMergedClusterPartConvInvMassPt         = new TH2F*[fnCuts];
                                fHistoTrueMotherCaloEMNonLeadingInvMassPt       = new TH2F*[fnCuts];
                                fHistoTruePrimaryPi0MCPtResolPt                         = new TH2F*[fnCuts];
                                fHistoTruePrimaryEtaMCPtResolPt                         = new TH2F*[fnCuts];
@@ -891,6 +975,8 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                        fMCList[iCut]->Add(fHistoMCHeaders[iCut]);
                        fHistoMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25);
                        fMCList[iCut]->Add(fHistoMCAllGammaPt[iCut]);
+                       fHistoMCAllGammaEMCALAccPt[iCut] = new TH1F("MC_AllGammaEMCALAcc_Pt","MC_AllGammaEMCALAcc_Pt",250,0,25);
+                       fMCList[iCut]->Add(fHistoMCAllGammaEMCALAccPt[iCut]);
                        fHistoMCDecayGammaPi0Pt[iCut] = new TH1F("MC_DecayGammaPi0_Pt","MC_DecayGammaPi0_Pt",250,0,25);
                        fMCList[iCut]->Add(fHistoMCDecayGammaPi0Pt[iCut]);
                        fHistoMCDecayGammaRhoPt[iCut] = new TH1F("MC_DecayGammaRho_Pt","MC_DecayGammaRho_Pt",250,0,25);
@@ -944,6 +1030,13 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                                        fHistoMCEtaPtY[iCut]->Sumw2();
                                        SetLogBinningXTH2(fHistoMCEtaPtY[iCut]);
                                        fMCList[iCut]->Add(fHistoMCEtaPtY[iCut]);
+                                       fHistoMCPi0PtAlpha[iCut] = new TH2F("MC_Pi0_Pt_Alpha","MC_Pi0_Pt_Alpha",150,0.03,15.,100,0,1);
+                                       SetLogBinningXTH2(fHistoMCPi0PtAlpha[iCut]);
+                                       fMCList[iCut]->Add(fHistoMCPi0PtAlpha[iCut]);
+                                       fHistoMCEtaPtAlpha[iCut] = new TH2F("MC_Eta_Pt_Alpha","MC_Eta_Pt_Alpha",150,0.03,15.,100,0,1);
+                                       SetLogBinningXTH2(fHistoMCEtaPtAlpha[iCut]);
+                                       fMCList[iCut]->Add(fHistoMCEtaPtAlpha[iCut]);
+
                                        fHistoMCK0sPt[iCut] = new TH1F("MC_K0s_Pt","MC_K0s_Pt",150,0,15);
                                        fHistoMCK0sPt[iCut]->Sumw2();
                                        fMCList[iCut]->Add(fHistoMCK0sPt[iCut]);
@@ -976,7 +1069,7 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                        fHistoTrueConvGammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25);
                        fTrueList[iCut]->Add(fHistoTrueConvGammaPt[iCut]);
       
-                       fHistoTrueConvPi0GammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25);
+            fHistoTrueConvPi0GammaPt[iCut] = new TH1F("ESD_TrueConvPi0Gamma_Pt","ESD_TrueConvPi0Gamma_Pt",250,0,25);
                        fTrueList[iCut]->Add(fHistoTrueConvPi0GammaPt[iCut]);
       
                        fHistoCombinatorialPt[iCut] = new TH2F("ESD_TrueCombinatorial_Pt","ESD_TrueCombinatorial_Pt",250,0,25,16,-0.5,15.5);
@@ -1024,11 +1117,14 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                        if (fDoClusterQA > 0){  
                                fHistoTrueClusUnConvGammaPt[iCut] = new TH1F("TrueClusUnConvGamma_Pt","TrueClusUnConvGamma_Pt",250,0,25);
                                fTagOutputList[iCut]->Add(fHistoTrueClusUnConvGammaPt[iCut]);
+                               fHistoTrueClusUnConvGammaMCPt[iCut] = new TH1F("TrueClusUnConvGamma_MCPt","TrueClusUnConvGamma_MCPt",250,0,25);
+                               fTagOutputList[iCut]->Add(fHistoTrueClusUnConvGammaMCPt[iCut]);
                                fHistoTrueClusElectronPt[iCut] = new TH1F("TrueClusElectron_Pt","TrueElectronGamma_Pt",250,0,25);
                                fTagOutputList[iCut]->Add(fHistoTrueClusElectronPt[iCut]);
-
                                fHistoTrueClusConvGammaPt[iCut] = new TH1F("TrueClusConvGamma_Pt","TrueClusConvGamma_Pt",250,0,25);
                                fTagOutputList[iCut]->Add(fHistoTrueClusConvGammaPt[iCut]);
+                               fHistoTrueClusConvGammaMCPt[iCut] = new TH1F("TrueClusConvGamma_MCPt","TrueClusConvGamma_MCPt",250,0,25);
+                               fTagOutputList[iCut]->Add(fHistoTrueClusConvGammaMCPt[iCut]);
                                fHistoTrueClusConvGammaFullyPt[iCut] = new TH1F("TrueClusConvGammaFullyContained_Pt","TrueClusConvGammaFullyContained_Pt",250,0,25);
                                fTagOutputList[iCut]->Add(fHistoTrueClusConvGammaFullyPt[iCut]);
                                fHistoTrueClusMergedGammaPt[iCut] = new TH1F("TrueClusMergedGamma_Pt","TrueClusMergedGamma_Pt",250,0,25);
@@ -1043,6 +1139,10 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                                fTagOutputList[iCut]->Add(fHistoTrueClusPhotonFromElecMotherPt[iCut]);
                                fHistoTrueClusShowerPt[iCut] = new TH1F("TrueClusShower_Pt","TrueClusShower_Pt",250,0,25);
                                fTagOutputList[iCut]->Add(fHistoTrueClusShowerPt[iCut]);
+                               fHistoTrueClusSubLeadingPt[iCut] = new TH1F("TrueClusSubleading_Pt","TrueClusSubleading_Pt",250,0,25);
+                               fTagOutputList[iCut]->Add(fHistoTrueClusSubLeadingPt[iCut]);
+                               fHistoTrueClusNParticles[iCut] = new TH1I("TrueClusNParticles","TrueClusNParticles",20,0,20);
+                               fTagOutputList[iCut]->Add(fHistoTrueClusNParticles[iCut]);
                                fHistoTrueClusEMNonLeadingPt[iCut] = new TH1F("TrueClusEMNonLeading_Pt","TrueClusEMNonLeading_Pt",250,0,25);
                                fTagOutputList[iCut]->Add(fHistoTrueClusEMNonLeadingPt[iCut]);
                                fHistoTrueNLabelsInClus[iCut] = new TH1F("TrueNLabelsInClus","TrueNLabelsInClus",100,-0.5,99.5);
@@ -1050,40 +1150,76 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                        }       
 
                        if(fDoMesonAnalysis){
-                               fHistoTrueMotherInvMassPt[iCut] = new TH2F("ESD_TrueMother_InvMass_Pt","ESD_TrueMother_InvMass_Pt",800,0,0.8,250,0,25);
-                               fTrueList[iCut]->Add(fHistoTrueMotherInvMassPt[iCut]);
-                               fHistoTruePrimaryMotherInvMassPt[iCut] = new TH2F("ESD_TruePrimaryMother_InvMass_Pt", "ESD_TruePrimaryMother_InvMass_Pt", 800,0,0.8,250,0,25);
-                               fHistoTruePrimaryMotherInvMassPt[iCut]->Sumw2();
-                               fTrueList[iCut]->Add(fHistoTruePrimaryMotherInvMassPt[iCut]);
-                               fHistoTruePrimaryMotherW0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryMotherW0Weights_InvMass_Pt", "ESD_TruePrimaryMotherW0Weights_InvMass_Pt", 800,0,0.8,250,0,25);
-                               fHistoTruePrimaryMotherW0WeightingInvMassPt[iCut]->Sumw2();
-                               fTrueList[iCut]->Add(fHistoTruePrimaryMotherW0WeightingInvMassPt[iCut]);
-                               fProfileTruePrimaryMotherWeightsInvMassPt[iCut] = new TProfile2D("ESD_TruePrimaryMotherWeights_InvMass_Pt", "ESD_TruePrimaryMotherWeights_InvMass_Pt", 800,0,0.8,250,0,25);
-                               fProfileTruePrimaryMotherWeightsInvMassPt[iCut]->Sumw2();
-                               fTrueList[iCut]->Add(fProfileTruePrimaryMotherWeightsInvMassPt[iCut]);
-                               fHistoTrueSecondaryMotherInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryMother_InvMass_Pt", "ESD_TrueSecondaryMother_InvMass_Pt", 800,0,0.8,250,0,25);
-                               fHistoTrueSecondaryMotherInvMassPt[iCut]->Sumw2();
-                               fTrueList[iCut]->Add(fHistoTrueSecondaryMotherInvMassPt[iCut]);
-                               fHistoTrueSecondaryMotherFromK0sInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryMotherFromK0s_InvMass_Pt","ESD_TrueSecondaryMotherFromK0s_InvMass_Pt",800,0,0.8,250,0,25);
-                               fHistoTrueSecondaryMotherFromK0sInvMassPt[iCut]->Sumw2();
-                               fTrueList[iCut]->Add(fHistoTrueSecondaryMotherFromK0sInvMassPt[iCut]);
-                               fHistoTrueSecondaryMotherFromEtaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryMotherFromEta_InvMass_Pt","ESD_TrueSecondaryMotherFromEta_InvMass_Pt",800,0,0.8,250,0,25);
-                               fTrueList[iCut]->Add(fHistoTrueSecondaryMotherFromEtaInvMassPt[iCut]);
-                               fHistoTrueSecondaryMotherFromLambdaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryMotherFromLambda_InvMass_Pt","ESD_TrueSecondaryMotherFromLambda_InvMass_Pt",800,0,0.8,250,0,25);
-                               fTrueList[iCut]->Add(fHistoTrueSecondaryMotherFromLambdaInvMassPt[iCut]);
+                               fHistoTruePi0InvMassPt[iCut] = new TH2F("ESD_TruePi0_InvMass_Pt","ESD_TruePi0_InvMass_Pt",800,0,0.8,250,0,25);
+                               fTrueList[iCut]->Add(fHistoTruePi0InvMassPt[iCut]);
+                               fHistoTrueEtaInvMassPt[iCut] = new TH2F("ESD_TrueEta_InvMass_Pt","ESD_TrueEta_InvMass_Pt",800,0,0.8,250,0,25);
+                               fTrueList[iCut]->Add(fHistoTrueEtaInvMassPt[iCut]);
+
+                               fHistoTruePrimaryPi0InvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0_InvMass_Pt", "ESD_TruePrimaryPi0_InvMass_Pt", 800,0,0.8,250,0,25);
+                               fHistoTruePrimaryPi0InvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(fHistoTruePrimaryPi0InvMassPt[iCut]);
+                               fHistoTruePrimaryEtaInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEta_InvMass_Pt", "ESD_TruePrimaryEta_InvMass_Pt", 800,0,0.8,250,0,25);
+                               fHistoTruePrimaryEtaInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(fHistoTruePrimaryEtaInvMassPt[iCut]);
+
+                               fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryPi0W0Weights_InvMass_Pt", "ESD_TruePrimaryPi0W0Weights_InvMass_Pt", 800,0,0.8,250,0,25);
+                               fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(fHistoTruePrimaryPi0W0WeightingInvMassPt[iCut]);
+                               fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut] = new TH2F("ESD_TruePrimaryEtaW0Weights_InvMass_Pt", "ESD_TruePrimaryEtaW0Weights_InvMass_Pt", 800,0,0.8,250,0,25);
+                               fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(fHistoTruePrimaryEtaW0WeightingInvMassPt[iCut]);
+
+                               fProfileTruePrimaryPi0WeightsInvMassPt[iCut] = new TProfile2D("ESD_TruePrimaryPi0Weights_InvMass_Pt", "ESD_TruePrimaryPi0Weights_InvMass_Pt", 800,0,0.8,250,0,25);
+                               fProfileTruePrimaryPi0WeightsInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(fProfileTruePrimaryPi0WeightsInvMassPt[iCut]);
+                               fProfileTruePrimaryEtaWeightsInvMassPt[iCut] = new TProfile2D("ESD_TruePrimaryEtaWeights_InvMass_Pt", "ESD_TruePrimaryEtaWeights_InvMass_Pt", 800,0,0.8,250,0,25);
+                               fProfileTruePrimaryEtaWeightsInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(fProfileTruePrimaryEtaWeightsInvMassPt[iCut]);
+
+                               fHistoTrueSecondaryPi0InvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0_InvMass_Pt", "ESD_TrueSecondaryPi0_InvMass_Pt", 800,0,0.8,250,0,25);
+                               fHistoTrueSecondaryPi0InvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(fHistoTrueSecondaryPi0InvMassPt[iCut]);
+                               fHistoTrueSecondaryEtaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryEta_InvMass_Pt", "ESD_TrueSecondaryEta_InvMass_Pt", 800,0,0.8,250,0,25);
+                               fHistoTrueSecondaryEtaInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(fHistoTrueSecondaryEtaInvMassPt[iCut]);
+
+                               fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromK0s_InvMass_Pt","ESD_TrueSecondaryPi0FromK0s_InvMass_Pt",800,0,0.8,250,0,25);
+                               fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut]->Sumw2();
+                               fTrueList[iCut]->Add(fHistoTrueSecondaryPi0FromK0sInvMassPt[iCut]);
+                               fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromEta_InvMass_Pt","ESD_TrueSecondaryPi0FromEta_InvMass_Pt",800,0,0.8,250,0,25);
+                               fTrueList[iCut]->Add(fHistoTrueSecondaryPi0FromEtaInvMassPt[iCut]);
+                               fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut] = new TH2F("ESD_TrueSecondaryPi0FromLambda_InvMass_Pt","ESD_TrueSecondaryPi0FromLambda_InvMass_Pt",800,0,0.8,250,0,25);
+                               fTrueList[iCut]->Add(fHistoTrueSecondaryPi0FromLambdaInvMassPt[iCut]);
                                if (fDoMesonQA > 0){
-                                       fHistoTrueMotherCaloPhotonInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloPhoton_InvMass_Pt","ESD_TrueMotherCaloPhoton_InvMass_Pt",800,0,0.8,250,0,25);
-                                       fTrueList[iCut]->Add(fHistoTrueMotherCaloPhotonInvMassPt[iCut]);
-                                       fHistoTrueMotherCaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloConvertedPhoton_InvMass_Pt","ESD_TrueMotherCaloConvertedPhoton_InvMass_Pt",800,0,0.8,250,0,25);
-                                       fTrueList[iCut]->Add(fHistoTrueMotherCaloConvertedPhotonInvMassPt[iCut]);
-                                       fHistoTrueMotherCaloElectronInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloElectron_InvMass_Pt","ESD_TrueMotherCaloElectron_InvMass_Pt",800,0,0.8,250,0,25);
-                                       fTrueList[iCut]->Add(fHistoTrueMotherCaloElectronInvMassPt[iCut]);
-                                       fHistoTrueMotherCaloMergedClusterInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloMergedCluster_InvMass_Pt","ESD_TrueMotherCaloMergedCluster_InvMass_Pt",800,0,0.8,250,0,25);
-                                       fTrueList[iCut]->Add(fHistoTrueMotherCaloMergedClusterInvMassPt[iCut]);
+                                       fHistoTruePi0CaloPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloPhoton_InvMass_Pt","ESD_TruePi0CaloPhoton_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTruePi0CaloPhotonInvMassPt[iCut]);
+                                       fHistoTrueEtaCaloPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloPhoton_InvMass_Pt","ESD_TrueEtaCaloPhoton_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTrueEtaCaloPhotonInvMassPt[iCut]);
+                                       fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloConvertedPhoton_InvMass_Pt","ESD_TruePi0CaloConvertedPhoton_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTruePi0CaloConvertedPhotonInvMassPt[iCut]);
+                                       fHistoTruePi0CaloConvertedPhotonMatchedInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloConvertedPhotonMatched_InvMass_Pt","ESD_TruePi0CaloConvertedPhotonMatched_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTruePi0CaloConvertedPhotonMatchedInvMassPt[iCut]);
+                                       fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloConvertedPhoton_InvMass_Pt","ESD_TrueEtaCaloConvertedPhoton_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTrueEtaCaloConvertedPhotonInvMassPt[iCut]);
+                                       fHistoTrueEtaCaloConvertedPhotonMatchedInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloConvertedPhotonMatched_InvMass_Pt","ESD_TrueEtaCaloConvertedPhotonMatched_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTrueEtaCaloConvertedPhotonMatchedInvMassPt[iCut]);
+
+                                       fHistoTruePi0CaloElectronInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloElectron_InvMass_Pt","ESD_TruePi0CaloElectron_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTruePi0CaloElectronInvMassPt[iCut]);
+                                       fHistoTrueEtaCaloElectronInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloElectron_InvMass_Pt","ESD_TrueEtaCaloElectron_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTrueEtaCaloElectronInvMassPt[iCut]);
+
+                                       fHistoTruePi0CaloMergedClusterInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMergedCluster_InvMass_Pt","ESD_TruePi0CaloMergedCluster_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTruePi0CaloMergedClusterInvMassPt[iCut]);
+                                       fHistoTrueEtaCaloMergedClusterInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMergedCluster_InvMass_Pt","ESD_TrueEtaCaloMergedCluster_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTrueEtaCaloMergedClusterInvMassPt[iCut]);
+
                                        fHistoTrueMotherCaloEMNonLeadingInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloEMNonLeading_InvMass_Pt","ESD_TrueMotherCaloEMNonLeading_InvMass_Pt",800,0,0.8,250,0,25);
                                        fTrueList[iCut]->Add(fHistoTrueMotherCaloEMNonLeadingInvMassPt[iCut]);
-                                       fHistoTrueMotherCaloMergedClusterPartConvInvMassPt[iCut] = new TH2F("ESD_TrueMotherCaloMergedClusterPartConv_InvMass_Pt","ESD_TrueMotherCaloMergedClusterPartConv_InvMass_Pt",800,0,0.8,250,0,25);
-                                       fTrueList[iCut]->Add(fHistoTrueMotherCaloMergedClusterPartConvInvMassPt[iCut]);
+                                       fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut] = new TH2F("ESD_TruePi0CaloMergedClusterPartConv_InvMass_Pt","ESD_TruePi0CaloMergedClusterPartConv_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTruePi0CaloMergedClusterPartConvInvMassPt[iCut]);
+                                       fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut] = new TH2F("ESD_TrueEtaCaloMergedClusterPartConv_InvMass_Pt","ESD_TrueEtaCaloMergedClusterPartConv_InvMass_Pt",800,0,0.8,250,0,25);
+                                       fTrueList[iCut]->Add(fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[iCut]);
                                        
                                        fHistoTruePrimaryPi0MCPtResolPt[iCut] = new TH2F("ESD_TruePrimaryPi0_MCPt_ResolPt","ESD_TruePrimaryPi0_ResolPt_MCPt",500,0.03,25,1000,-1.,1.);
                                        fHistoTruePrimaryPi0MCPtResolPt[iCut]->Sumw2();
@@ -1211,6 +1347,10 @@ void AliAnalysisTaskGammaConvCalo::UserExec(Option_t *)
                if(fMCStack == NULL) fIsMC = kFALSE;
        }
        
+       if(fInputEvent->IsA()==AliAODEvent::Class()){
+               fInputEvent->InitMagneticField();
+       }
+       
        fReaderGammas = fV0Reader->GetReconstructedGammas(); // Gammas from default Cut
 
        // ------------------- BeginEvent ----------------------------
@@ -1228,7 +1368,11 @@ void AliAnalysisTaskGammaConvCalo::UserExec(Option_t *)
        for(Int_t iCut = 0; iCut<fnCuts; iCut++){
                
                fiCut = iCut;
-               Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon);
+               
+               Bool_t isRunningEMCALrelAna = kFALSE;
+               if (((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->GetClusterType() == 1) isRunningEMCALrelAna = kTRUE;
+
+               Int_t eventNotAccepted = ((AliConvEventCuts*)fEventCutArray->At(iCut))->IsEventAcceptedByCut(fV0Reader->GetEventCuts(),fInputEvent,fMCEvent,fIsHeavyIon,isRunningEMCALrelAna);
                
                if(eventNotAccepted){
                // cout << "event rejected due to wrong trigger: " <<eventNotAccepted << endl;
@@ -1359,9 +1503,10 @@ void AliAnalysisTaskGammaConvCalo::ProcessClusters()
        InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
        
        // Loop over EMCal clusters
-       for(Int_t i = 0; i < nclus; i++){
+       for(Long_t i = 0; i < nclus; i++){
                
-               AliVCluster* clus = fInputEvent->GetCaloCluster(i);             
+               AliVCluster* clus = NULL;
+               clus = fInputEvent->GetCaloCluster(i);          
                if (!clus) continue;
                if(!((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->ClusterIsSelected(clus,fInputEvent,fIsMC)) continue;
                // TLorentzvector with cluster
@@ -1377,6 +1522,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessClusters()
                
                // Flag Photon as CaloPhoton
                PhotonCandidate->SetIsCaloPhoton();
+               PhotonCandidate->SetCaloClusterRef(i);
                // get MC label
                if(fIsMC){
                        Int_t* mclabelsCluster = clus->GetLabels();
@@ -1384,7 +1530,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessClusters()
 //                     cout << clus->GetNLabels() << endl;
                        if (clus->GetNLabels()>0){
                                for (Int_t k =0; k< (Int_t)clus->GetNLabels(); k++){
-                                       if (k< 50)PhotonCandidate->SetCaloPhotonMCLabel(k,mclabelsCluster[k]);
+                                       if (k< 20)PhotonCandidate->SetCaloPhotonMCLabel(k,mclabelsCluster[k]);
 //                                     Int_t pdgCode = fMCStack->Particle(mclabelsCluster[k])->GetPdgCode();
 //                                     cout << "label " << k << "\t" << mclabelsCluster[k] << " pdg code: " << pdgCode << endl;
                                }       
@@ -1434,12 +1580,16 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueClusterCandidates(AliAODConversion
                if (TruePhotonCandidate->IsLargestComponentPhoton() || TruePhotonCandidate->IsLargestComponentElectron() )fHistoTrueClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
                        else fHistoTrueClusEMNonLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt());
                if (fDoClusterQA > 0){
-                       if (TruePhotonCandidate->IsLargestComponentPhoton()) 
+                       if (TruePhotonCandidate->IsLargestComponentPhoton()){ 
                                fHistoTrueClusUnConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+                               fHistoTrueClusUnConvGammaMCPt[fiCut]->Fill(Photon->Pt());
+                       }       
                        if (TruePhotonCandidate->IsLargestComponentElectron()) 
                                fHistoTrueClusElectronPt[fiCut]->Fill(TruePhotonCandidate->Pt());
-                       if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) 
+                       if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()){
                                fHistoTrueClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+                               fHistoTrueClusConvGammaMCPt[fiCut]->Fill(((TParticle*)fMCStack->Particle(Photon->GetMother(0)))->Pt());
+                       }       
                        if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion() && TruePhotonCandidate->IsConversionFullyContained()) 
                                fHistoTrueClusConvGammaFullyPt[fiCut]->Fill(TruePhotonCandidate->Pt());
                        if (TruePhotonCandidate->IsMerged() || TruePhotonCandidate->IsMergedPartConv() || TruePhotonCandidate->IsDalitzMerged())
@@ -1454,6 +1604,9 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueClusterCandidates(AliAODConversion
                                fHistoTrueClusPhotonFromElecMotherPt[fiCut]->Fill(TruePhotonCandidate->Pt());
                        if (TruePhotonCandidate->IsShower()) 
                                fHistoTrueClusShowerPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+                       if (TruePhotonCandidate->IsSubLeadingEM())
+                               fHistoTrueClusSubLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+                       fHistoTrueClusNParticles[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMotherMCLabels());
                }
        }
 
@@ -1483,22 +1636,27 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueClusterCandidatesAOD(AliAODConvers
        }
 
        if(Photon == NULL){
-       //    cout << "no photon" << endl;
+       //      cout << "no photon" << endl;
                return;
        }
        TruePhotonCandidate->SetCaloPhotonMCFlagsAOD(fInputEvent);
-       
+       fHistoTrueNLabelsInClus[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMCLabels());    
        // True Photon
        if(fIsFromMBHeader){
                if (TruePhotonCandidate->IsLargestComponentPhoton() || TruePhotonCandidate->IsLargestComponentElectron() )fHistoTrueClusGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
                        else fHistoTrueClusEMNonLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt());
                if (fDoClusterQA > 0){
-                       if (TruePhotonCandidate->IsLargestComponentPhoton()) 
+                       if (TruePhotonCandidate->IsLargestComponentPhoton()) {
                                fHistoTrueClusUnConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+                               fHistoTrueClusUnConvGammaMCPt[fiCut]->Fill(Photon->Pt());
+                       }       
                        if (TruePhotonCandidate->IsLargestComponentElectron()) 
                                fHistoTrueClusElectronPt[fiCut]->Fill(TruePhotonCandidate->Pt());
-                       if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) 
+                       if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion()) {
                                fHistoTrueClusConvGammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+                               AliAODMCParticle *Mother = (AliAODMCParticle*) AODMCTrackArray->At(Photon->GetMother());
+                               fHistoTrueClusConvGammaMCPt[fiCut]->Fill(Mother->Pt());
+                       }       
                        if (TruePhotonCandidate->IsLargestComponentElectron() && TruePhotonCandidate->IsConversion() && TruePhotonCandidate->IsConversionFullyContained()) 
                                fHistoTrueClusConvGammaFullyPt[fiCut]->Fill(TruePhotonCandidate->Pt());
                        if (TruePhotonCandidate->IsMerged() || TruePhotonCandidate->IsMergedPartConv() || TruePhotonCandidate->IsDalitzMerged())
@@ -1513,6 +1671,9 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueClusterCandidatesAOD(AliAODConvers
                                fHistoTrueClusPhotonFromElecMotherPt[fiCut]->Fill(TruePhotonCandidate->Pt());
                        if (TruePhotonCandidate->IsShower()) 
                                fHistoTrueClusShowerPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+                       if (TruePhotonCandidate->IsSubLeadingEM())
+                               fHistoTrueClusSubLeadingPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+                       fHistoTrueClusNParticles[fiCut]->Fill(TruePhotonCandidate->GetNCaloPhotonMotherMCLabels());
                }
        }
 
@@ -1780,13 +1941,15 @@ void AliAnalysisTaskGammaConvCalo::ProcessTruePhotonCandidatesAOD(AliAODConversi
                                fCharPhotonMCInfo = 3;
                        }
                }
-       }
-  
+       }  
+    if( ((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetPdgCode() == 111 ){
+              fHistoTrueConvPi0GammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
+    }
 }
 //________________________________________________________________________
 void AliAnalysisTaskGammaConvCalo::ProcessTruePhotonCandidates(AliAODConversionPhoton *TruePhotonCandidate)
 {
-       
+
        Double_t magField = fInputEvent->GetMagneticField();
        if( magField  < 0.0 ){
                magField =  1.0;
@@ -1794,7 +1957,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessTruePhotonCandidates(AliAODConversionP
        else {
                magField =  -1.0;
        }
-       
+
        // Process True Photons
        TParticle *posDaughter = TruePhotonCandidate->GetPositiveMCDaughter(fMCStack);
        TParticle *negDaughter = TruePhotonCandidate->GetNegativeMCDaughter(fMCStack);  
@@ -1815,7 +1978,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessTruePhotonCandidates(AliAODConversionP
        if(pdgCode[0]!=11 || pdgCode[1]!=11) return; //One Particle is not a electron
        
        if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode()) return; // Same Charge
-       
+
        TParticle *Photon = TruePhotonCandidate->GetMCParticle(fMCStack);
        
        if(Photon->GetPdgCode() != 22){
@@ -1859,18 +2022,17 @@ void AliAnalysisTaskGammaConvCalo::ProcessTruePhotonCandidates(AliAODConversionP
                        }
                }
        }
-       
+
        // pi0 photon
        //Bool_t bpi0 = 0;
        Int_t imother = Photon->GetMother(0);
-       if (imother > -1){
-               AliMCParticle *McMother = static_cast<AliMCParticle*>(fMCEvent->GetTrack(imother));
-               if(McMother->PdgCode() == 111){
-                       fHistoTrueConvPi0GammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
-               }
+       if(imother > -1){
+               AliMCParticle* McMother = static_cast<AliMCParticle*>(fMCEvent->GetTrack(imother));
+               //cout << fMCEvent->GetRunNumber() << " " << imother << " " << fMCEvent->GetNumberOfTracks() << endl;
+               if(McMother->PdgCode() == 111) fHistoTrueConvPi0GammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
        }
+       return;
 }
-
 //________________________________________________________________________
 void AliAnalysisTaskGammaConvCalo::ProcessAODMCParticles()
 {
@@ -1893,49 +2055,52 @@ void AliAnalysisTaskGammaConvCalo::ProcessAODMCParticles()
                if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(particle->Phi(),fEventPlaneAngle,kFALSE)) continue;
                if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(particle,AODMCTrackArray,kFALSE)){
                        fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma
-                               if(particle->GetMother() >-1){ // Meson Decay Gamma
-                                       switch((static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother())))->GetPdgCode()){
-                                       case 111: // Pi0
-                                               fHistoMCDecayGammaPi0Pt[fiCut]->Fill(particle->Pt());
-                                               break;
-                                       case 113: // Rho0
-                                               fHistoMCDecayGammaRhoPt[fiCut]->Fill(particle->Pt());
-                                               break;
-                                       case 221: // Eta
-                                               fHistoMCDecayGammaEtaPt[fiCut]->Fill(particle->Pt());
-                                               break;
-                                       case 223: // Omega
-                                               fHistoMCDecayGammaOmegaPt[fiCut]->Fill(particle->Pt());
-                                               break;
-                                       case 331: // Eta'
-                                               fHistoMCDecayGammaEtapPt[fiCut]->Fill(particle->Pt());
-                                               break;
-                                       case 333: // Phi
-                                               fHistoMCDecayGammaPhiPt[fiCut]->Fill(particle->Pt());
-                                               break;
-                                       case 3212: // Sigma
-                                               fHistoMCDecayGammaSigmaPt[fiCut]->Fill(particle->Pt());
-                                               break;
-                                       }
-                               }
+                       if (abs(particle->Eta()) < 0.66 ){
+                               if (particle->Phi() > 1.39626 && particle->Phi() < 3.125) fHistoMCAllGammaEMCALAccPt[fiCut]->Fill(particle->Pt());
                        }
-                       if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(particle,AODMCTrackArray,kTRUE)){
-                               Double_t rConv = 0;
-                               for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
-                                       AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(daughterIndex));
-                                       if(!tmpDaughter) continue;
-                                       if(abs(tmpDaughter->GetPdgCode()) == 11){
-                                               rConv = sqrt( (tmpDaughter->Xv()*tmpDaughter->Xv()) + (tmpDaughter->Yv()*tmpDaughter->Yv()) );
-                                       }
+                       if(particle->GetMother() >-1){ // Meson Decay Gamma
+                               switch((static_cast<AliAODMCParticle*>(AODMCTrackArray->At(particle->GetMother())))->GetPdgCode()){
+                               case 111: // Pi0
+                                       fHistoMCDecayGammaPi0Pt[fiCut]->Fill(particle->Pt());
+                                       break;
+                               case 113: // Rho0
+                                       fHistoMCDecayGammaRhoPt[fiCut]->Fill(particle->Pt());
+                                       break;
+                               case 221: // Eta
+                                       fHistoMCDecayGammaEtaPt[fiCut]->Fill(particle->Pt());
+                                       break;
+                               case 223: // Omega
+                                       fHistoMCDecayGammaOmegaPt[fiCut]->Fill(particle->Pt());
+                                       break;
+                               case 331: // Eta'
+                                       fHistoMCDecayGammaEtapPt[fiCut]->Fill(particle->Pt());
+                                       break;
+                               case 333: // Phi
+                                       fHistoMCDecayGammaPhiPt[fiCut]->Fill(particle->Pt());
+                                       break;
+                               case 3212: // Sigma
+                                       fHistoMCDecayGammaSigmaPt[fiCut]->Fill(particle->Pt());
+                                       break;
                                }
-                               fHistoMCConvGammaPt[fiCut]->Fill(particle->Pt());
-                               if (fDoPhotonQA > 0){
-                                       fHistoMCConvGammaR[fiCut]->Fill(rConv);
-                                       fHistoMCConvGammaEta[fiCut]->Fill(particle->Eta());
+                       }
+               }
+               if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedAODMC(particle,AODMCTrackArray,kTRUE)){
+                       Double_t rConv = 0;
+                       for(Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
+                               AliAODMCParticle *tmpDaughter = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(daughterIndex));
+                               if(!tmpDaughter) continue;
+                               if(abs(tmpDaughter->GetPdgCode()) == 11){
+                                       rConv = sqrt( (tmpDaughter->Xv()*tmpDaughter->Xv()) + (tmpDaughter->Yv()*tmpDaughter->Yv()) );
                                }
                        }
-                       // Converted MC Gamma
-                       if(fDoMesonAnalysis){
+                       fHistoMCConvGammaPt[fiCut]->Fill(particle->Pt());
+                       if (fDoPhotonQA > 0){
+                               fHistoMCConvGammaR[fiCut]->Fill(rConv);
+                               fHistoMCConvGammaEta[fiCut]->Fill(particle->Eta());
+                       }
+               }
+               // Converted MC Gamma
+               if(fDoMesonAnalysis){
                        if(particle->GetPdgCode() == 310 && fDoMesonQA > 0){
                                Double_t mesonY = 10.;
                                if(particle->E() - particle->Pz() == 0 || particle->E() + particle->Pz() == 0){
@@ -1974,14 +2139,26 @@ void AliAnalysisTaskGammaConvCalo::ProcessAODMCParticles()
                                        mesonY = 0.5*(TMath::Log((particle->E()+particle->Pz()) / (particle->E()-particle->Pz())))-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
                                }
                                
+                               Double_t alpha = -1;
+                               if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){
+                                       alpha = TMath::Abs((daughter0->E() - daughter1->E()))/(daughter0->E() + daughter1->E());
+                               }
+
+                               
                                if(particle->GetPdgCode() == 111){
                                        fHistoMCPi0Pt[fiCut]->Fill(particle->Pt(),weighted); // All MC Pi0
                                        fHistoMCPi0WOWeightPt[fiCut]->Fill(particle->Pt());
-                                       if (fDoMesonQA > 0) fHistoMCPi0PtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0
+                                       if (fDoMesonQA > 0){
+                                               fHistoMCPi0PtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0
+                                               fHistoMCPi0PtAlpha[fiCut]->Fill(particle->Pt(),alpha); // All MC Pi0
+                                       }       
                                } else if(particle->GetPdgCode() == 221){
                                        fHistoMCEtaPt[fiCut]->Fill(particle->Pt(),weighted); // All MC Eta
                                        fHistoMCEtaWOWeightPt[fiCut]->Fill(particle->Pt());
-                                       if (fDoMesonQA > 0) fHistoMCEtaPtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0
+                                       if (fDoMesonQA > 0){
+                                               fHistoMCEtaPtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0
+                                               fHistoMCEtaPtAlpha[fiCut]->Fill(particle->Pt(),alpha); // All MC Pi0
+                                       }       
                                }
                                
                                // Check the acceptance for both gammas
@@ -2018,6 +2195,10 @@ void AliAnalysisTaskGammaConvCalo::ProcessMCParticles()
                if(!((AliConversionPhotonCuts*)fCutArray->At(fiCut))->InPlaneOutOfPlaneCut(particle->Phi(),fEventPlaneAngle,kFALSE)) continue;
                if(((AliConversionPhotonCuts*)fCutArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kFALSE)){
                        fHistoMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma
+                       if (abs(particle->Eta()) < 0.66 ){
+                               if (particle->Phi() > 1.39626 && particle->Phi() < 3.125) fHistoMCAllGammaEMCALAccPt[fiCut]->Fill(particle->Pt());
+                       }       
+                       
                        if(particle->GetMother(0) >-1){ // Meson Decay Gamma
                                switch(fMCStack->Particle(particle->GetMother(0))->GetPdgCode()){
                                case 111: // Pi0
@@ -2092,15 +2273,26 @@ void AliAnalysisTaskGammaConvCalo::ProcessMCParticles()
                                } else{
                                        mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz())))-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift();
                                }
-                               
+
+                               Double_t alpha = -1;
+                               if (particle->GetPdgCode() == 111 || particle->GetPdgCode() == 221){
+                                       alpha = TMath::Abs((daughter0->Energy() - daughter1->Energy()))/(daughter0->Energy() + daughter1->Energy());
+                               }
+
                                if(particle->GetPdgCode() == 111){
                                        fHistoMCPi0Pt[fiCut]->Fill(particle->Pt(),weighted); // All MC Pi0
                                        fHistoMCPi0WOWeightPt[fiCut]->Fill(particle->Pt());
-                                       if (fDoMesonQA > 0) fHistoMCPi0PtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0
+                                       if (fDoMesonQA > 0){
+                                               fHistoMCPi0PtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0
+                                               fHistoMCPi0PtAlpha[fiCut]->Fill(particle->Pt(),alpha); // All MC Pi0
+                                       }       
                                } else if(particle->GetPdgCode() == 221){
                                        fHistoMCEtaPt[fiCut]->Fill(particle->Pt(),weighted); // All MC Eta
                                        fHistoMCEtaWOWeightPt[fiCut]->Fill(particle->Pt());
-                                       if (fDoMesonQA > 0) fHistoMCEtaPtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0
+                                       if (fDoMesonQA > 0){
+                                               fHistoMCEtaPtY[fiCut]->Fill(particle->Pt(),mesonY,weighted); // All MC Pi0
+                                               fHistoMCEtaPtAlpha[fiCut]->Fill(particle->Pt(),alpha); // All MC Pi0
+                                       }       
                                }
                                
                                // Check the acceptance for both gammas
@@ -2227,84 +2419,104 @@ void AliAnalysisTaskGammaConvCalo::CalculatePi0Candidates(){
                        if (gamma0==NULL) continue;
                        
                        for(Int_t secondGammaIndex=0;secondGammaIndex<fClusterCandidates->GetEntries();secondGammaIndex++){
-
+                               Bool_t matched = kFALSE;
                                AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fClusterCandidates->At(secondGammaIndex));
                                if (gamma1==NULL) continue;
                                
+                               if (gamma1->GetIsCaloPhoton()){
+                                       AliVCluster* cluster = fInputEvent->GetCaloCluster(gamma1->GetCaloClusterRef());
+                                       matched = ((AliCaloPhotonCuts*)fClusterCutArray->At(fiCut))->MatchConvPhotonToCluster(gamma0,cluster, fInputEvent );
+                               }       
+                               
                                AliAODConversionMother *pi0cand = new AliAODConversionMother(gamma0,gamma1);
                                pi0cand->SetLabels(firstGammaIndex,secondGammaIndex);
                                
+                               
+                               
                                if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
-                                       fHistoMotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt());
-                                       
+                                       if (matched){
+                                               fHistoMotherMatchedInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt());
+                                       } else {
+                                               fHistoMotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt());
+                                       }       
                                        // fill new histograms
-                                       fHistoPhotonPairAll[fiCut]->Fill(pi0cand->M(),pi0cand->Pt());
-                                       fHistoPhotonPairAllGam[fiCut]->Fill(pi0cand->M(),gamma0->Pt());
-                                       
-                                       if(pi0cand->GetAlpha()<0.1)
-                                               fHistoMotherInvMassEalpha[fiCut]->Fill(pi0cand->M(),pi0cand->E());
-                                       
-                                       if (fDoMesonQA > 0){
-                                               if ( pi0cand->M() > 0.05 && pi0cand->M() < 0.17){
-                                                       fHistoMotherPi0PtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
-                                                       fHistoMotherPi0PtAlpha[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetAlpha());
-                                                       fHistoMotherPi0PtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle());      
-                                               }
-                                               if ( pi0cand->M() > 0.45 && pi0cand->M() < 0.65){
-                                                       fHistoMotherEtaPtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
-                                                       fHistoMotherEtaPtAlpha[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetAlpha());
-                                                       fHistoMotherEtaPtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle());
-                                               }
-                                       }
-                                       if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){
-                                               Int_t zbin = 0;
-                                               Int_t mbin = 0;
+                                       if (!matched){
+                                               fHistoPhotonPairAll[fiCut]->Fill(pi0cand->M(),pi0cand->Pt());
+                                               fHistoPhotonPairAllGam[fiCut]->Fill(pi0cand->M(),gamma0->Pt());
                                                
-                                               if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->BackgroundHandlerType() == 0){
-                                                       zbin = fBGHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
-                                                       if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
-                                                               mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks());
-                                                       } else {
-                                                               mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries());
+                                               if(pi0cand->GetAlpha()<0.1)
+                                                       fHistoMotherInvMassEalpha[fiCut]->Fill(pi0cand->M(),pi0cand->E());
+                                               
+                                               if (fDoMesonQA > 0){
+                                                       if ( pi0cand->M() > 0.05 && pi0cand->M() < 0.17){
+                                                               fHistoMotherPi0PtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
+                                                               fHistoMotherPi0PtAlpha[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetAlpha());
+                                fHistoMotherPi0PtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle());
+                                fHistoMotherPi0ConvPhotonEtaPhi[fiCut]->Fill(gamma0->GetPhotonPhi(), gamma0->GetPhotonEta());
                                                        }
-                                               } else{
-                                                       zbin = fBGHandlerRP[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
-                                                       if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
-                                                               mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks());
-                                                       } else {
-                                                               mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries());
+                                                       if ( pi0cand->M() > 0.45 && pi0cand->M() < 0.65){
+                                                               fHistoMotherEtaPtY[fiCut]->Fill(pi0cand->Pt(),pi0cand->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
+                                                               fHistoMotherEtaPtAlpha[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetAlpha());
+                                                               fHistoMotherEtaPtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle());
+                                fHistoMotherEtaConvPhotonEtaPhi[fiCut]->Fill(gamma0->GetPhotonPhi(), gamma0->GetPhotonEta());
+                                                       }
+                                               }
+                                               if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){
+                                                       Int_t zbin = 0;
+                                                       Int_t mbin = 0;
+                                                       
+                                                       if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->BackgroundHandlerType() == 0){
+                                                               zbin = fBGHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
+                                                               if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
+                                                                       mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks());
+                                                               } else {
+                                                                       mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries());
+                                                               }
+                                                       } else{
+                                                               zbin = fBGHandlerRP[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
+                                                               if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
+                                                                       mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks());
+                                                               } else {
+                                                                       mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries());
+                                                               }
                                                        }
+                                                       Double_t sparesFill[4] = {pi0cand->M(),pi0cand->Pt(),(Double_t)zbin,(Double_t)mbin};
+                                                       fSparseMotherInvMassPtZM[fiCut]->Fill(sparesFill,1);
                                                }
-                                               Double_t sparesFill[4] = {pi0cand->M(),pi0cand->Pt(),(Double_t)zbin,(Double_t)mbin};
-                                               fSparseMotherInvMassPtZM[fiCut]->Fill(sparesFill,1);
                                        }
                                        
-                                       
                                        if(fIsMC){
                                                if(fInputEvent->IsA()==AliESDEvent::Class())
-                                                       ProcessTrueMesonCandidates(pi0cand,gamma0,gamma1);
+                                                       ProcessTrueMesonCandidates(pi0cand,gamma0,gamma1, matched);
                                                if(fInputEvent->IsA()==AliAODEvent::Class())
-                                                       ProcessTrueMesonCandidatesAOD(pi0cand,gamma0,gamma1);
+                                                       ProcessTrueMesonCandidatesAOD(pi0cand,gamma0,gamma1, matched);
                                        }
-                                       if (fDoMesonQA == 2){
-                                               fInvMass = pi0cand->M();
-                                               fPt  = pi0cand->Pt();
-                                               if (abs(gamma0->GetDCAzToPrimVtx()) < abs(gamma1->GetDCAzToPrimVtx())){
-                                                       fDCAzGammaMin = gamma0->GetDCAzToPrimVtx();
-                                                       fDCAzGammaMax = gamma1->GetDCAzToPrimVtx();
-                                               } else {
-                                                       fDCAzGammaMin = gamma1->GetDCAzToPrimVtx();
-                                                       fDCAzGammaMax = gamma0->GetDCAzToPrimVtx();
+                                       if (!matched){
+                                               if (fDoMesonQA == 2){
+                                                       fInvMass = pi0cand->M();
+                                                       fPt  = pi0cand->Pt();
+                                                       if (abs(gamma0->GetDCAzToPrimVtx()) < abs(gamma1->GetDCAzToPrimVtx())){
+                                                               fDCAzGammaMin = gamma0->GetDCAzToPrimVtx();
+                                                               fDCAzGammaMax = gamma1->GetDCAzToPrimVtx();
+                                                       } else {
+                                                               fDCAzGammaMin = gamma1->GetDCAzToPrimVtx();
+                                                               fDCAzGammaMax = gamma0->GetDCAzToPrimVtx();
+                                                       }
+                                                       fCharFlag = pi0cand->GetMesonQuality();
+                                                       //                   cout << "gamma 0: " << gamma0->GetV0Index()<< "\t" << gamma0->GetPx() << "\t" << gamma0->GetPy() << "\t" <<  gamma0->GetPz() << "\t" << endl;
+                                                       //                   cout << "gamma 1: " << gamma1->GetV0Index()<< "\t"<< gamma1->GetPx() << "\t" << gamma1->GetPy() << "\t" <<  gamma1->GetPz() << "\t" << endl;
+                                                       //                    cout << "pi0: "<<fInvMass << "\t" << fPt <<"\t" << fDCAzGammaMin << "\t" << fDCAzGammaMax << "\t" << (Int_t)fCharFlag << "\t" << (Int_t)fCharMesonMCInfo <<endl;
+                                                       if (fIsHeavyIon == 1 && fPt > 0.399 && fPt < 20. ) {
+                                                               if (fInvMass > 0.08 && fInvMass < 0.2) fTreeMesonsInvMassPtDcazMinDcazMaxFlag[fiCut]->Fill();
+                                                               if ((fInvMass > 0.45 && fInvMass < 0.6) &&  (fPt > 0.999 && fPt < 20.) )fTreeMesonsInvMassPtDcazMinDcazMaxFlag[fiCut]->Fill();
+                                                       } else if (fPt > 0.299 && fPt < 20. )  {
+                                                               if ( (fInvMass > 0.08 && fInvMass < 0.2) || (fInvMass > 0.45 && fInvMass < 0.6)) fTreeMesonsInvMassPtDcazMinDcazMaxFlag[fiCut]->Fill();
+                                                       }
                                                }
-                                               fCharFlag = pi0cand->GetMesonQuality();
-                                               //                   cout << "gamma 0: " << gamma0->GetV0Index()<< "\t" << gamma0->GetPx() << "\t" << gamma0->GetPy() << "\t" <<  gamma0->GetPz() << "\t" << endl;
-                                               //                   cout << "gamma 1: " << gamma1->GetV0Index()<< "\t"<< gamma1->GetPx() << "\t" << gamma1->GetPy() << "\t" <<  gamma1->GetPz() << "\t" << endl;
-                                               //                    cout << "pi0: "<<fInvMass << "\t" << fPt <<"\t" << fDCAzGammaMin << "\t" << fDCAzGammaMax << "\t" << (Int_t)fCharFlag << "\t" << (Int_t)fCharMesonMCInfo <<endl;
-                                               if (fIsHeavyIon == 1 && fPt > 0.399 && fPt < 20. ) {
-                                                       if (fInvMass > 0.08 && fInvMass < 0.2) fTreeMesonsInvMassPtDcazMinDcazMaxFlag[fiCut]->Fill();
-                                                       if ((fInvMass > 0.45 && fInvMass < 0.6) &&  (fPt > 0.999 && fPt < 20.) )fTreeMesonsInvMassPtDcazMinDcazMaxFlag[fiCut]->Fill();
-                                               } else if (fPt > 0.299 && fPt < 20. )  {
-                                                       if ( (fInvMass > 0.08 && fInvMass < 0.2) || (fInvMass > 0.45 && fInvMass < 0.6)) fTreeMesonsInvMassPtDcazMinDcazMaxFlag[fiCut]->Fill();
+                                               if (fDoMesonQA == 1){
+                                                       fHistoMotherInvMassECalib[fiCut]->Fill(pi0cand->M(),gamma1->E());
+                                                       if(pi0cand->GetAlpha()<0.1)
+                                                       fHistoMotherInvMassECalibalpha[fiCut]->Fill(pi0cand->M(),gamma1->E());            
                                                }
                                        }
                                }
@@ -2315,7 +2527,7 @@ void AliAnalysisTaskGammaConvCalo::CalculatePi0Candidates(){
        }
 }
 //______________________________________________________________________
-void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidates(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
+void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidates(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1, Bool_t matched)
 {
        // Process True Mesons
        AliStack *MCStack = fMCEvent->Stack();
@@ -2370,82 +2582,111 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidates(AliAODConversionMo
                }
                
                if(isTruePi0 || isTrueEta){// True Pion or Eta
-                       fHistoTrueMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                       if (!matched){
+                               if (isTruePi0)fHistoTruePi0InvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               if (isTrueEta)fHistoTrueEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                       }       
                        if (fDoMesonQA > 0){
-                               if (TrueGammaCandidate1->IsLargestComponentPhoton()) 
-                                       fHistoTrueMotherCaloPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                               if (TrueGammaCandidate1->IsLargestComponentElectron()) 
-                                       fHistoTrueMotherCaloElectronInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                               if (TrueGammaCandidate1->IsLargestComponentElectron() && TrueGammaCandidate1->IsConversion())
-                                       fHistoTrueMotherCaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                               if (TrueGammaCandidate1->IsMerged() || TrueGammaCandidate1->IsMergedPartConv() || TrueGammaCandidate1->IsDalitzMerged() )
-                                       fHistoTrueMotherCaloMergedClusterInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                               if (TrueGammaCandidate1->IsMergedPartConv()) 
-                                       fHistoTrueMotherCaloMergedClusterPartConvInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               if (TrueGammaCandidate1->IsLargestComponentPhoton() && !matched){
+                                       if(isTruePi0) fHistoTruePi0CaloPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       if(isTrueEta) fHistoTrueEtaCaloPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               }       
+                               if (TrueGammaCandidate1->IsLargestComponentElectron() && !matched){
+                                       if(isTruePi0) fHistoTruePi0CaloElectronInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       if(isTrueEta) fHistoTrueEtaCaloElectronInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               }       
+                               if (TrueGammaCandidate1->IsLargestComponentElectron() && TrueGammaCandidate1->IsConversion() ){
+                                       if (isTruePi0 && !matched)fHistoTruePi0CaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       if (isTrueEta && !matched)fHistoTrueEtaCaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       if ((TrueGammaCandidate0->GetMCLabelPositive() == gamma1MCLabel || TrueGammaCandidate0->GetMCLabelNegative() == gamma1MCLabel) && isTruePi0){
+                                               fHistoTruePi0CaloConvertedPhotonMatchedInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       }       
+                                       if ((TrueGammaCandidate0->GetMCLabelPositive() == gamma1MCLabel || TrueGammaCandidate0->GetMCLabelNegative() == gamma1MCLabel) && isTrueEta){
+                                               fHistoTrueEtaCaloConvertedPhotonMatchedInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       }       
+                               }       
+                               if ((TrueGammaCandidate1->IsMerged() || TrueGammaCandidate1->IsMergedPartConv() || TrueGammaCandidate1->IsDalitzMerged()) && !matched ){
+                                       if (isTruePi0 )fHistoTruePi0CaloMergedClusterInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       if (isTrueEta )fHistoTrueEtaCaloMergedClusterInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               }       
+                               if (TrueGammaCandidate1->IsMergedPartConv() && !matched){
+                                       if (isTruePi0) fHistoTruePi0CaloMergedClusterPartConvInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       if (isTrueEta) fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               }       
                        }
-                       if (fDoMesonQA > 0){
-                               if (isTruePi0){
-                                       if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){
-                                               fHistoTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
-                                               fHistoTruePi0PtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
-                                               fHistoTruePi0PtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
-                                       }
-                               } else if (isTrueEta){
-                                       if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){
-                                               fHistoTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
-                                               fHistoTrueEtaPtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
-                                               fHistoTrueEtaPtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
+                       if (!matched){
+                               if (fDoMesonQA > 0){
+                                       if (isTruePi0){
+                                               if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){
+                                                       fHistoTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
+                                                       fHistoTruePi0PtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
+                                                       fHistoTruePi0PtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
+                                               }
+                                       } else if (isTrueEta){
+                                               if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){
+                                                       fHistoTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
+                                                       fHistoTrueEtaPtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
+                                                       fHistoTrueEtaPtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
+                                               }
                                        }
                                }
-                       }
-                       if(gamma0MotherLabel >= MCStack->GetNprimary()){ // Secondary Meson
-                               Int_t secMotherLabel = ((TParticle*)MCStack->Particle(gamma0MotherLabel))->GetMother(0);
-                               Float_t weightedSec= 1;
-                               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, fMCStack, fInputEvent) && MCStack->Particle(secMotherLabel)->GetPdgCode()==310){
-                                       weightedSec= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, fMCStack, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt
-                                       //cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
-                               }
-                               fHistoTrueSecondaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
-                               fCharMesonMCInfo = 2;
-                               if (secMotherLabel >-1){
-                                       if(MCStack->Particle(secMotherLabel)->GetPdgCode()==310){
-                                               fCharMesonMCInfo = 4;
-                                               fHistoTrueSecondaryMotherFromK0sInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
-                                               if (fDoMesonQA > 0)fHistoTrueK0sWithPi0DaughterMCPt[fiCut]->Fill(MCStack->Particle(secMotherLabel)->Pt());
-                                       }
-                                       if(MCStack->Particle(secMotherLabel)->GetPdgCode()==221){
-                                               fCharMesonMCInfo = 3;
-                                               fHistoTrueSecondaryMotherFromEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
-                                               if (fDoMesonQA > 0)fHistoTrueEtaWithPi0DaughterMCPt[fiCut]->Fill(MCStack->Particle(secMotherLabel)->Pt());
-                                       }
-                                       if(MCStack->Particle(secMotherLabel)->GetPdgCode()==3122){
-                                               fCharMesonMCInfo = 7;
-                                               fHistoTrueSecondaryMotherFromLambdaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
-                                               if (fDoMesonQA > 0)fHistoTrueLambdaWithPi0DaughterMCPt[fiCut]->Fill(MCStack->Particle(secMotherLabel)->Pt());
+                               
+                               if(gamma0MotherLabel >= MCStack->GetNprimary()){ // Secondary Meson
+                                       Int_t secMotherLabel = ((TParticle*)MCStack->Particle(gamma0MotherLabel))->GetMother(0);
+                                       Float_t weightedSec= 1;
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, fMCStack, fInputEvent) && MCStack->Particle(secMotherLabel)->GetPdgCode()==310){
+                                               weightedSec= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, fMCStack, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt
+                                               //cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
                                        }
-                               }
-                       } else { // Only primary pi0 for efficiency calculation
-                               fCharMesonMCInfo = 6;
-                               Float_t weighted= 1;
-                               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, fMCStack, fInputEvent)){
-                                       if (((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt()>0.005){
-                                               weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, fMCStack, fInputEvent);
-                                               //                      cout << "rec \t " <<gamma1MotherLabel << "\t" <<  weighted << endl;
+                                       if (isTruePi0)  fHistoTrueSecondaryPi0InvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+                                       if (isTrueEta)  fHistoTrueSecondaryEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+                                       fCharMesonMCInfo = 2;
+                                       if (secMotherLabel >-1){
+                                               if(MCStack->Particle(secMotherLabel)->GetPdgCode()==310 && isTruePi0 ){
+                                                       fCharMesonMCInfo = 4;
+                                                       fHistoTrueSecondaryPi0FromK0sInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+                                                       if (fDoMesonQA > 0)fHistoTrueK0sWithPi0DaughterMCPt[fiCut]->Fill(MCStack->Particle(secMotherLabel)->Pt());
+                                               }
+                                               if(MCStack->Particle(secMotherLabel)->GetPdgCode()==221 && isTruePi0){
+                                                       fCharMesonMCInfo = 3;
+                                                       fHistoTrueSecondaryPi0FromEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+                                                       if (fDoMesonQA > 0)fHistoTrueEtaWithPi0DaughterMCPt[fiCut]->Fill(MCStack->Particle(secMotherLabel)->Pt());
+                                               }
+                                               if(MCStack->Particle(secMotherLabel)->GetPdgCode()==3122 && isTruePi0){
+                                                       fCharMesonMCInfo = 7;
+                                                       fHistoTrueSecondaryPi0FromLambdaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+                                                       if (fDoMesonQA > 0)fHistoTrueLambdaWithPi0DaughterMCPt[fiCut]->Fill(MCStack->Particle(secMotherLabel)->Pt());
+                                               }
                                        }
-                               }
-                               fHistoTruePrimaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
-                               fHistoTruePrimaryMotherW0WeightingInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                               fProfileTruePrimaryMotherWeightsInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
-                                       
-                               if (fDoMesonQA > 0){
-                                       if(isTruePi0){ // Only primary pi0 for resolution
-                                               fHistoTruePrimaryPi0MCPtResolPt[fiCut]->Fill(((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),(Pi0Candidate->Pt()-((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt())/((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),weighted);
+                               } else { // Only primary pi0 for efficiency calculation
+                                       fCharMesonMCInfo = 6;
+                                       Float_t weighted= 1;
+                                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, fMCStack, fInputEvent)){
+                                               if (((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt()>0.005){
+                                                       weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, fMCStack, fInputEvent);
+                                                       //                      cout << "rec \t " <<gamma1MotherLabel << "\t" <<  weighted << endl;
+                                               }
                                        }
-                                       if (isTrueEta){ // Only primary eta for resolution
-                                               fHistoTruePrimaryEtaMCPtResolPt[fiCut]->Fill(((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),(Pi0Candidate->Pt()-((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt())/((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),weighted);
+                                       if (isTruePi0){
+                                               fHistoTruePrimaryPi0InvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
+                                               fHistoTruePrimaryPi0W0WeightingInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                               fProfileTruePrimaryPi0WeightsInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
+                                       } else if (isTrueEta) {
+                                               fHistoTruePrimaryEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
+                                               fHistoTruePrimaryEtaW0WeightingInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                               fProfileTruePrimaryEtaWeightsInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
+                                       }       
+                                               
+                                       if (fDoMesonQA > 0){
+                                               if(isTruePi0){ // Only primary pi0 for resolution
+                                                       fHistoTruePrimaryPi0MCPtResolPt[fiCut]->Fill(((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),(Pi0Candidate->Pt()-((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt())/((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),weighted);
+                                               }
+                                               if (isTrueEta){ // Only primary eta for resolution
+                                                       fHistoTruePrimaryEtaMCPtResolPt[fiCut]->Fill(((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),(Pi0Candidate->Pt()-((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt())/((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),weighted);
+                                               }
                                        }
                                }
-                       }
+                       }       
                } else if(!isTruePi0 && !isTrueEta){ // Background
                        if (fDoMesonQA > 0){
                                if(gamma0MotherLabel>-1 && gamma1MotherLabel>-1){ // Both Tracks are Photons and have a mother but not Pi0 or Eta
@@ -2459,7 +2700,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidates(AliAODConversionMo
        }
 }
 //______________________________________________________________________
-void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidatesAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
+void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidatesAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1, Bool_t matched)
 {
        
        // Process True Mesons
@@ -2524,86 +2765,112 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidatesAOD(AliAODConversio
        }
        
        if(isTruePi0 || isTrueEta){// True Pion or Eta
-               fHistoTrueMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+               if (!matched){
+                       if (isTruePi0)fHistoTruePi0InvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                       if (isTrueEta)fHistoTrueEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+               }       
                if (fDoMesonQA > 0){
-                       if (TrueGammaCandidate1->IsLargestComponentPhoton()) 
-                               fHistoTrueMotherCaloPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                       if (TrueGammaCandidate1->IsLargestComponentElectron()) 
-                               fHistoTrueMotherCaloElectronInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                       if (TrueGammaCandidate1->IsLargestComponentElectron() && TrueGammaCandidate1->IsConversion())
-                               fHistoTrueMotherCaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                       if (TrueGammaCandidate1->IsMerged() || TrueGammaCandidate1->IsMergedPartConv() || TrueGammaCandidate1->IsDalitzMerged() )
-                               fHistoTrueMotherCaloMergedClusterInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                       if (TrueGammaCandidate1->IsMergedPartConv()) 
-                               fHistoTrueMotherCaloMergedClusterPartConvInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                       if (TrueGammaCandidate1->IsLargestComponentPhoton() && !matched){
+                               if (isTruePi0) fHistoTruePi0CaloPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               if (isTrueEta) fHistoTrueEtaCaloPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                       }       
+                       if (TrueGammaCandidate1->IsLargestComponentElectron() && !matched) {
+                               if (isTruePi0) fHistoTruePi0CaloElectronInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               if (isTrueEta) fHistoTrueEtaCaloElectronInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                       }       
+                       if (TrueGammaCandidate1->IsLargestComponentElectron() && TrueGammaCandidate1->IsConversion()){
+                               if (isTruePi0 && !matched)fHistoTruePi0CaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               if (isTrueEta && !matched)fHistoTrueEtaCaloConvertedPhotonInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               if ((TrueGammaCandidate0->GetMCLabelPositive() == gamma1MCLabel || TrueGammaCandidate0->GetMCLabelNegative() == gamma1MCLabel) && isTruePi0)
+                                       fHistoTruePi0CaloConvertedPhotonMatchedInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               if ((TrueGammaCandidate0->GetMCLabelPositive() == gamma1MCLabel || TrueGammaCandidate0->GetMCLabelNegative() == gamma1MCLabel) && isTrueEta)
+                                       fHistoTrueEtaCaloConvertedPhotonMatchedInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                       }       
+                       if ((TrueGammaCandidate1->IsMerged() || TrueGammaCandidate1->IsMergedPartConv() || TrueGammaCandidate1->IsDalitzMerged()) && !matched ){
+                               if (isTruePi0) fHistoTruePi0CaloMergedClusterInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               if (isTrueEta) fHistoTrueEtaCaloMergedClusterInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                       }       
+                       if (TrueGammaCandidate1->IsMergedPartConv() && !matched) {
+                               if (isTruePi0) fHistoTruePi0CaloMergedClusterPartConvInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                               if (isTrueEta) fHistoTrueEtaCaloMergedClusterPartConvInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                       }       
                }
 
-               if (fDoMesonQA > 0){
-                       if (isTruePi0){
-                               if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){
-                               fHistoTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
-                               fHistoTruePi0PtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
-                               fHistoTruePi0PtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
-                               }
-                       } else if (isTrueEta){
-                               if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){
-                               fHistoTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
-                               fHistoTrueEtaPtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
-                               fHistoTrueEtaPtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
-                               }
-                       }
-               }
-               if(!(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->IsPrimary())){ // Secondary Meson
-                       Int_t secMotherLabel = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->GetMother();
-                       Float_t weightedSec= 1;
-                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, 0x0, fInputEvent) && static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310){
-                               weightedSec= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, 0x0, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt
-                               //cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
-                       }
-                       fHistoTrueSecondaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
-                       fCharMesonMCInfo = 2;
-                       if (secMotherLabel >-1){
-                               if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310){
-                                       fCharMesonMCInfo = 4;
-                                       fHistoTrueSecondaryMotherFromK0sInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
-                                       if (fDoMesonQA > 0)fHistoTrueK0sWithPi0DaughterMCPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt());
-                               }
-                               if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==221){
-                                       fCharMesonMCInfo = 3;
-                                       fHistoTrueSecondaryMotherFromEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
-                                       if (fDoMesonQA > 0)fHistoTrueEtaWithPi0DaughterMCPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt());
-                               }
-                               if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==3122){
-                                       fCharMesonMCInfo = 7;
-                                       fHistoTrueSecondaryMotherFromLambdaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
-                                       if (fDoMesonQA > 0)fHistoTrueLambdaWithPi0DaughterMCPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt());
+               if ( !matched){
+                       if (fDoMesonQA > 0){
+                               if (isTruePi0){
+                                       if ( Pi0Candidate->M() > 0.05 && Pi0Candidate->M() < 0.17){
+                                       fHistoTruePi0PtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
+                                       fHistoTruePi0PtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
+                                       fHistoTruePi0PtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
+                                       }
+                               } else if (isTrueEta){
+                                       if ( Pi0Candidate->M() > 0.45 && Pi0Candidate->M() < 0.65){
+                                       fHistoTrueEtaPtY[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift());
+                                       fHistoTrueEtaPtAlpha[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetAlpha());
+                                       fHistoTrueEtaPtOpenAngle[fiCut]->Fill(Pi0Candidate->Pt(),Pi0Candidate->GetOpeningAngle());
+                                       }
                                }
                        }
-               }else{ // Only primary pi0 for efficiency calculation
-                       Float_t weighted= 1;
-                       fCharMesonMCInfo = 6;
-                       if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, 0x0, fInputEvent)){
-                               if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt()>0.005){
-                               weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, 0x0, fInputEvent);
-                               //                      cout << "rec \t " <<gamma1MotherLabel << "\t" <<  weighted << endl;
+                       if(!(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma0MotherLabel))->IsPrimary())){ // Secondary Meson
+                               Int_t secMotherLabel = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->GetMother();
+                               Float_t weightedSec= 1;
+                               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(secMotherLabel, 0x0, fInputEvent) && static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310){
+                                       weightedSec= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),secMotherLabel, 0x0, fInputEvent)/2.; //invariant mass is additive thus the weight for the daughters has to be devide by two for the K0s at a certain pt
+                                       //cout << "MC input \t"<<i << "\t" <<  particle->Pt()<<"\t"<<weighted << endl;
                                }
-                       }
-                       fHistoTruePrimaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
-                       fHistoTruePrimaryMotherW0WeightingInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                       fProfileTruePrimaryMotherWeightsInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
-                       
-                       if (fDoMesonQA > 0){
-                               if(isTruePi0){ // Only primary pi0 for resolution
-                                       fHistoTruePrimaryPi0MCPtResolPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),
-                                                                                                                       (Pi0Candidate->Pt()-static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted);
+                               if (isTruePi0) fHistoTrueSecondaryPi0InvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+                               if (isTrueEta) fHistoTrueSecondaryEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
                                
+                               fCharMesonMCInfo = 2;
+                               if (secMotherLabel >-1){
+                                       if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==310 && isTruePi0){
+                                               fCharMesonMCInfo = 4;
+                                               fHistoTrueSecondaryPi0FromK0sInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+                                               if (fDoMesonQA > 0)fHistoTrueK0sWithPi0DaughterMCPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt());
+                                       }
+                                       if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==221 && isTruePi0){
+                                               fCharMesonMCInfo = 3;
+                                               fHistoTrueSecondaryPi0FromEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+                                               if (fDoMesonQA > 0)fHistoTrueEtaWithPi0DaughterMCPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt());
+                                       }
+                                       if(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->GetPdgCode()==3122 && isTruePi0){
+                                               fCharMesonMCInfo = 7;
+                                               fHistoTrueSecondaryPi0FromLambdaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weightedSec);
+                                               if (fDoMesonQA > 0)fHistoTrueLambdaWithPi0DaughterMCPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(secMotherLabel))->Pt());
+                                       }
                                }
-                               if (isTrueEta){ // Only primary eta for resolution
-                                       fHistoTruePrimaryEtaMCPtResolPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),
-                                                                                                                       (Pi0Candidate->Pt()-static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted);
+                       } else{ // Only primary pi0 for efficiency calculation
+                               Float_t weighted= 1;
+                               fCharMesonMCInfo = 6;
+                               if(((AliConvEventCuts*)fEventCutArray->At(fiCut))->IsParticleFromBGEvent(gamma1MotherLabel, 0x0, fInputEvent)){
+                                       if (static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt()>0.005){
+                                       weighted= ((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetWeightForMeson(fV0Reader->GetPeriodName(),gamma1MotherLabel, 0x0, fInputEvent);
+                                       //                      cout << "rec \t " <<gamma1MotherLabel << "\t" <<  weighted << endl;
+                                       }
+                               }
+                               if (isTruePi0){
+                                       fHistoTruePrimaryPi0InvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
+                                       fHistoTruePrimaryPi0W0WeightingInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       fProfileTruePrimaryPi0WeightsInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
+                               } else if (isTrueEta){
+                                       fHistoTruePrimaryEtaInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
+                                       fHistoTruePrimaryEtaW0WeightingInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       fProfileTruePrimaryEtaWeightsInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);                                     
+                               }       
+                               if (fDoMesonQA > 0){
+                                       if(isTruePi0){ // Only primary pi0 for resolution
+                                               fHistoTruePrimaryPi0MCPtResolPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),
+                                                                                                                               (Pi0Candidate->Pt()-static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted);
+                                       
+                                       }
+                                       if (isTrueEta){ // Only primary eta for resolution
+                                               fHistoTruePrimaryEtaMCPtResolPt[fiCut]->Fill(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),
+                                                                                                                               (Pi0Candidate->Pt()-static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt())/static_cast<AliAODMCParticle*>(AODMCTrackArray->At(gamma1MotherLabel))->Pt(),weighted);
+                                       }
                                }
                        }
-               }
+               }       
        } else if(!isTruePi0 && !isTrueEta) { // Background
                if (fDoMesonQA > 0){
                        if(gamma0MotherLabel>-1 && gamma1MotherLabel>-1){ // Both Tracks are Photons and have a mother but not Pi0 or Eta
@@ -2951,30 +3218,3 @@ Int_t AliAnalysisTaskGammaConvCalo::GetSourceClassification(Int_t daughter, Int_
        return 15;
   
 }
-
-// //________________________________________________________________________
-// Double_t AliAnalysisTaskGammaConvCalo::GetMaxCellEnergy(const AliVCluster *cluster, Short_t &id) const
-// {
-//   // Get maximum energy of attached cell.
-//   
-//   id = -1;
-//   Double_t maxe = 0;
-//   Int_t ncells = cluster->GetNCells();
-//   if (fEsdCells) {
-//     for (Int_t i=0; i<ncells; i++) {
-//       Double_t e = fEsdCells->GetCellAmplitude(TMath::Abs(cluster->GetCellAbsId(i)));
-//       if (e>maxe) {
-//         maxe = e;
-//         id   = cluster->GetCellAbsId(i);
-//       }
-//     }
-//   } else {
-//     for (Int_t i=0; i<ncells; i++) {
-//       Double_t e = fAodCells->GetCellAmplitude(TMath::Abs(cluster->GetCellAbsId(i)));
-//       if (e>maxe)
-//         maxe = e;
-//       id   = cluster->GetCellAbsId(i);
-//     }
-//   }
-//   return maxe;
-// }