diff --git a/PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskLambdaPion.cxx b/PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskLambdaPion.cxx index 3b7a2b480e7..124572dce0b 100644 --- a/PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskLambdaPion.cxx +++ b/PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskLambdaPion.cxx @@ -18,6 +18,7 @@ ClassImp(AliAnalysisTaskLambdaPion) fUseOMixing(false), fPCSettings(NewPC), fUseEvtNoLambda(false), + fExcludedMothers({}), fTrigger(AliVEvent::kINT7), fQA(nullptr), fEvtList(nullptr), @@ -56,6 +57,7 @@ AliAnalysisTaskLambdaPion::AliAnalysisTaskLambdaPion( fUseOMixing(false), fPCSettings(pcsettings), fUseEvtNoLambda(usenolambdaevt), + fExcludedMothers({}), fTrigger(AliVEvent::kINT7), fQA(nullptr), fEvtList(nullptr), @@ -308,6 +310,12 @@ void AliAnalysisTaskLambdaPion::UserExec(Option_t *) StoreGlobalTrackReference(track); } + // Load MC information + AliMCEvent *fMC = nullptr; + if (fIsMC) { + fMC = dynamic_cast(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler())->MCEvent(); + } + std::vector PionPlus; std::vector PionMinus; std::vector Lambdas; @@ -322,10 +330,30 @@ void AliAnalysisTaskLambdaPion::UserExec(Option_t *) fLambda->Setv0(fInputEvent, casc); if (fLambdaCuts->isSelected(fLambda)) { + if (fIsMC && fExcludedMothers.size() > 0) { + // Reject the decay products of some specific particles + AliAODMCParticle *mcPart = (AliAODMCParticle *)fMC->GetTrack(fLambda->GetID()); + AliAODMCParticle *mom = (AliAODMCParticle *)fMC->GetTrack(mcPart->GetMother()); + int momAbsPdg = std::abs(mom->GetPdgCode()); + if (std::find(fExcludedMothers.begin(), fExcludedMothers.end(), momAbsPdg) != fExcludedMothers.end()) { + continue; + } + } + Lambdas.push_back(*fLambda); } if (fAntiLambdaCuts->isSelected(fLambda)) { + if (fIsMC && fExcludedMothers.size() > 0) { + // Reject the decay products of some specific particles + AliAODMCParticle *mcPart = (AliAODMCParticle *)fMC->GetTrack(fLambda->GetID()); + AliAODMCParticle *mom = (AliAODMCParticle *)fMC->GetTrack(mcPart->GetMother()); + int momAbsPdg = std::abs(mom->GetPdgCode()); + if (std::find(fExcludedMothers.begin(), fExcludedMothers.end(), momAbsPdg) != fExcludedMothers.end()) { + continue; + } + } + AntiLambdas.push_back(*fLambda); } } @@ -344,21 +372,36 @@ void AliAnalysisTaskLambdaPion::UserExec(Option_t *) fTrack->SetTrack(track); if (fPosPionCuts->isSelected(fTrack)) { + if (fIsMC && fExcludedMothers.size() > 0) { + // Reject the decay products of some specific particles + AliAODMCParticle *mcPart = (AliAODMCParticle *)fMC->GetTrack(fTrack->GetID()); + AliAODMCParticle *mom = (AliAODMCParticle *)fMC->GetTrack(mcPart->GetMother()); + int momAbsPdg = std::abs(mom->GetPdgCode()); + if (std::find(fExcludedMothers.begin(), fExcludedMothers.end(), momAbsPdg) != fExcludedMothers.end()) { + continue; + } + } + PionPlus.push_back(*fTrack); } if (fNegPionCuts->isSelected(fTrack)) { + if (fIsMC && fExcludedMothers.size() > 0) { + // Reject the decay products of some specific particles + AliAODMCParticle *mcPart = (AliAODMCParticle *)fMC->GetTrack(fTrack->GetID()); + AliAODMCParticle *mom = (AliAODMCParticle *)fMC->GetTrack(mcPart->GetMother()); + int momAbsPdg = std::abs(mom->GetPdgCode()); + if (std::find(fExcludedMothers.begin(), fExcludedMothers.end(), momAbsPdg) != fExcludedMothers.end()) { + continue; + } + } + PionMinus.push_back(*fTrack); } } if (fIsMC) { - AliAODInputHandler *eventHandler = - dynamic_cast(AliAnalysisManager::GetAnalysisManager() - ->GetInputEventHandler()); - AliMCEvent *fMC = eventHandler->MCEvent(); - for (int iPart = 0; iPart < (fMC->GetNumberOfTracks()); iPart++) { AliAODMCParticle *mcPart = (AliAODMCParticle *)fMC->GetTrack(iPart); diff --git a/PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskLambdaPion.h b/PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskLambdaPion.h index c3c0a51323a..713cf459cbb 100644 --- a/PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskLambdaPion.h +++ b/PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskLambdaPion.h @@ -58,6 +58,9 @@ class AliAnalysisTaskLambdaPion : public AliAnalysisTaskSE { fUseEvtNoLambda = usenolambdaevt; } + void SetExcludeDausOf(std::vector motherList) { + fExcludedMothers = motherList; + } void SetCollectionConfig(AliFemtoDreamCollConfig *config) { fConfig = config; @@ -72,6 +75,7 @@ class AliAnalysisTaskLambdaPion : public AliAnalysisTaskSE bool fIsMC; // bool fUseOMixing; // bool fUseEvtNoLambda; // + std::vector fExcludedMothers; // Only valid if run on MC PCSettings fPCSettings; // UInt_t fTrigger; // TList *fResults; //! @@ -101,7 +105,7 @@ class AliAnalysisTaskLambdaPion : public AliAnalysisTaskSE AliFemtoDreamControlSample *fSample; //! AliAODTrack **fGTI; //! int fTrackBufferSize; // - ClassDef(AliAnalysisTaskLambdaPion, 1) + ClassDef(AliAnalysisTaskLambdaPion, 2) }; #endif /* PWGCF_FEMTOSCOPY_FEMTODREAM_ALIANALYSISTASKLAMBDAPION_H_ */