From e53158928ac09b9f01a7b7692ddf1234134d2b03 Mon Sep 17 00:00:00 2001 From: fbock Date: Wed, 20 Aug 2014 16:56:19 +0200 Subject: [PATCH] - changed order of filling validated histograms --- ...alysisTaskNeutralMesonToPiPlPiMiPiZero.cxx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/PWGGA/GammaConv/AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero.cxx b/PWGGA/GammaConv/AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero.cxx index a4f0166dcca..12ada3c5e13 100644 --- a/PWGGA/GammaConv/AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero.cxx +++ b/PWGGA/GammaConv/AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero.cxx @@ -1201,18 +1201,19 @@ void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessPionCandidates(){ Int_t labelp=0; Int_t motherlabelp = 0; Int_t motherlabeln = 0; + TParticle *fNegativeMCParticle =NULL; + TParticle *fPositiveMCParticle =NULL; if( fMCEvent ) { labeln=TMath::Abs(negPionCandidate->GetLabel()); labelp=TMath::Abs(posPionCandidate->GetLabel()); - TParticle *fNegativeMCParticle = fMCStack->Particle(labeln); - TParticle *fPositiveMCParticle = fMCStack->Particle(labelp); + fNegativeMCParticle = fMCStack->Particle(labeln); + fPositiveMCParticle = fMCStack->Particle(labelp); motherlabeln = fNegativeMCParticle->GetMother(0); motherlabelp = fPositiveMCParticle->GetMother(0); if( fPositiveMCParticle && fNegativeMCParticle) { virtualPhoton->SetMCLabelPositive(labelp); virtualPhoton->SetMCLabelNegative(labeln); - } - + } } AliAODConversionPhoton *vParticle = new AliAODConversionPhoton(virtualPhoton); //To Apply PsiPairCut @@ -1225,10 +1226,15 @@ void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessPionCandidates(){ } if (fMCEvent){ - if (motherlabeln == motherlabelp){ - fHistoTruePionPionFromSameMotherInvMassPt[fiCut]->Fill(vParticle->GetMass(),vParticle->Pt()); - if( IsEtaPiPlPiMiPiZeroDaughter(labeln) || IsOmegaPiPlPiMiPiZeroDaughter(labeln) ) { - fHistoTruePionPionFromNeutralMesonInvMassPt[fiCut]->Fill(vParticle->GetMass(),vParticle->Pt()); + if (fPositiveMCParticle && fNegativeMCParticle ) { + if(TMath::Abs(fNegativeMCParticle->GetPdgCode())==211 && TMath::Abs(fPositiveMCParticle->GetPdgCode())==211){ // Pions ... + fHistoTruePionPionInvMassPt[fiCut]->Fill(vParticle->GetMass(),vParticle->Pt()); + if (motherlabeln == motherlabelp){ + fHistoTruePionPionFromSameMotherInvMassPt[fiCut]->Fill(vParticle->GetMass(),vParticle->Pt()); + if( IsEtaPiPlPiMiPiZeroDaughter(labeln) || IsOmegaPiPlPiMiPiZeroDaughter(labeln) ) { + fHistoTruePionPionFromNeutralMesonInvMassPt[fiCut]->Fill(vParticle->GetMass(),vParticle->Pt()); + } + } } } } @@ -1553,9 +1559,6 @@ void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::ProcessTrueMesonCandidates(Ali // if (fDoMesonQA){ TParticle * negativeMC = (TParticle*)TrueVirtualParticleCandidate->GetNegativeMCDaughter(MCStack); TParticle * positiveMC = (TParticle*)TrueVirtualParticleCandidate->GetPositiveMCDaughter(MCStack); - if(TMath::Abs(negativeMC->GetPdgCode())==211 && TMath::Abs(positiveMC->GetPdgCode())==211){ // Pions ... - fHistoTruePionPionInvMassPt[fiCut]->Fill(TrueVirtualParticleCandidate->GetMass(),TrueVirtualParticleCandidate->Pt()); - } // } if(virtualParticleMCLabel != -1){ // if virtualParticleMCLabel==-1 particles don't have same mother -- 2.39.3