Skip to content

Commit

Permalink
Merge pull request #23334 from danielbattistini/master
Browse files Browse the repository at this point in the history
Add option to reject daughters of specific resonances/decays
  • Loading branch information
alibuild authored Mar 28, 2024
2 parents 37571dd + 907d5c9 commit a75966d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 6 deletions.
53 changes: 48 additions & 5 deletions PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskLambdaPion.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ClassImp(AliAnalysisTaskLambdaPion)
fUseOMixing(false),
fPCSettings(NewPC),
fUseEvtNoLambda(false),
fExcludedMothers({}),
fTrigger(AliVEvent::kINT7),
fQA(nullptr),
fEvtList(nullptr),
Expand Down Expand Up @@ -56,6 +57,7 @@ AliAnalysisTaskLambdaPion::AliAnalysisTaskLambdaPion(
fUseOMixing(false),
fPCSettings(pcsettings),
fUseEvtNoLambda(usenolambdaevt),
fExcludedMothers({}),
fTrigger(AliVEvent::kINT7),
fQA(nullptr),
fEvtList(nullptr),
Expand Down Expand Up @@ -308,6 +310,12 @@ void AliAnalysisTaskLambdaPion::UserExec(Option_t *)
StoreGlobalTrackReference(track);
}

// Load MC information
AliMCEvent *fMC = nullptr;
if (fIsMC) {
fMC = dynamic_cast<AliAODInputHandler *>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler())->MCEvent();
}

std::vector<AliFemtoDreamBasePart> PionPlus;
std::vector<AliFemtoDreamBasePart> PionMinus;
std::vector<AliFemtoDreamBasePart> Lambdas;
Expand All @@ -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);
}
}
Expand All @@ -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<AliAODInputHandler *>(AliAnalysisManager::GetAnalysisManager()
->GetInputEventHandler());
AliMCEvent *fMC = eventHandler->MCEvent();

for (int iPart = 0; iPart < (fMC->GetNumberOfTracks()); iPart++)
{
AliAODMCParticle *mcPart = (AliAODMCParticle *)fMC->GetTrack(iPart);
Expand Down
6 changes: 5 additions & 1 deletion PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskLambdaPion.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class AliAnalysisTaskLambdaPion : public AliAnalysisTaskSE
{
fUseEvtNoLambda = usenolambdaevt;
}
void SetExcludeDausOf(std::vector<UInt_t> motherList) {
fExcludedMothers = motherList;
}
void SetCollectionConfig(AliFemtoDreamCollConfig *config)
{
fConfig = config;
Expand All @@ -72,6 +75,7 @@ class AliAnalysisTaskLambdaPion : public AliAnalysisTaskSE
bool fIsMC; //
bool fUseOMixing; //
bool fUseEvtNoLambda; //
std::vector<UInt_t> fExcludedMothers; // Only valid if run on MC
PCSettings fPCSettings; //
UInt_t fTrigger; //
TList *fResults; //!
Expand Down Expand Up @@ -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_ */

0 comments on commit a75966d

Please sign in to comment.