Skip to content

Commit

Permalink
Tag omegas from charm and beauty (AliceO2Group#7741)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpuccio authored Sep 19, 2024
1 parent 37b273d commit 35f48df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
6 changes: 4 additions & 2 deletions PWGLF/DataModel/LFNonPromptCascadeTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ DECLARE_SOA_COLUMN(ITSClusSize, itsClusSize, float);
DECLARE_SOA_COLUMN(IsGoodMatch, isGoodMatch, bool);
DECLARE_SOA_COLUMN(IsGoodCascade, isGoodCascade, bool);
DECLARE_SOA_COLUMN(PdgCodeMom, pdgCodeMom, int);
DECLARE_SOA_COLUMN(PdgCodeGrandma, pdgCodeGrandma, int);
DECLARE_SOA_COLUMN(IsFromBeauty, isFromBeauty, bool);
DECLARE_SOA_COLUMN(IsFromCharm, isFromCharm, bool);

DECLARE_SOA_COLUMN(PvX, pvX, float);
DECLARE_SOA_COLUMN(PvY, pvY, float);
Expand Down Expand Up @@ -164,7 +165,8 @@ DECLARE_SOA_TABLE(NPCascTableMC, "AOD", "NPCASCTABLEMC",
NPCascadeTable::IsGoodMatch,
NPCascadeTable::IsGoodCascade,
NPCascadeTable::PdgCodeMom,
NPCascadeTable::PdgCodeGrandma,
NPCascadeTable::IsFromBeauty,
NPCascadeTable::IsFromCharm,
NPCascadeTable::PvX,
NPCascadeTable::PvY,
NPCascadeTable::PvZ,
Expand Down
23 changes: 15 additions & 8 deletions PWGLF/Tasks/Strangeness/nonPromptCascade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ struct NPCascCandidate {
bool isGoodMatch;
bool isGoodCascade;
int pdgCodeMom;
int pdgCodeGrandma;
bool isFromBeauty;
bool isFromCharm;
float pvX;
float pvY;
float pvZ;
Expand Down Expand Up @@ -564,19 +565,25 @@ struct NonPromptCascadeTask {

bool isGoodMatch = ((motherParticleID == ITStrack.mcParticleId())) ? true : false;

int pdgCodeMom = 0, pdgCodeGrandma = 0;
int pdgCodeMom = 0;
bool fromBeauty = false, fromCharm = false;
if (isGoodCascade && isGoodMatch) {
if (track.mcParticle().has_mothers()) {
const auto mom = track.mcParticle().mothers_as<aod::McParticles>()[0];
auto mom = track.mcParticle().mothers_as<aod::McParticles>()[0];
pdgCodeMom = mom.pdgCode();
if (mom.has_mothers()) {
fromBeauty = std::abs(pdgCodeMom) / 5000 == 1 || std::abs(pdgCodeMom) / 500 == 1 || std::abs(pdgCodeMom) == 5;
fromCharm = std::abs(pdgCodeMom) / 4000 == 1 || std::abs(pdgCodeMom) / 400 == 1 || std::abs(pdgCodeMom) == 4;
while (mom.has_mothers()) {
const auto grandma = mom.mothers_as<aod::McParticles>()[0];
pdgCodeGrandma = grandma.pdgCode();
int pdgCodeGrandma = std::abs(grandma.pdgCode());
fromBeauty = fromBeauty || (pdgCodeGrandma / 5000 == 1 || pdgCodeGrandma / 500 == 1 || pdgCodeGrandma == 5);
fromCharm = fromCharm || (pdgCodeGrandma / 4000 == 1 || pdgCodeGrandma / 400 == 1 || pdgCodeGrandma == 4);
mom = grandma;
}
}
}

candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), trackedCascade.itsClsSize(), isGoodMatch, isGoodCascade, pdgCodeMom, pdgCodeGrandma,
candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), trackedCascade.itsClsSize(), isGoodMatch, isGoodCascade, pdgCodeMom, fromBeauty, fromCharm,
primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(),
track.pt(), track.eta(), track.phi(),
protonTrack.pt(), protonTrack.eta(), pionTrack.pt(), pionTrack.eta(), bachelor.pt(), bachelor.eta(),
Expand Down Expand Up @@ -605,7 +612,7 @@ struct NonPromptCascadeTask {
auto mcCollision = particle.mcCollision_as<aod::McCollisions>();
auto label = collisions.iteratorAt(c.collisionID);

NPCTableMC(c.matchingChi2, c.itsClusSize, c.isGoodMatch, c.isGoodCascade, c.pdgCodeMom, c.pdgCodeGrandma,
NPCTableMC(c.matchingChi2, c.itsClusSize, c.isGoodMatch, c.isGoodCascade, c.pdgCodeMom, c.isFromBeauty, c.isFromCharm,
c.pvX, c.pvY, c.pvZ,
c.cascPt, c.cascEta, c.cascPhi,
c.protonPt, c.protonEta, c.pionPt, c.pionEta, c.bachPt, c.bachEta,
Expand Down Expand Up @@ -813,7 +820,7 @@ struct NonPromptCascadeTask {
daughtersDCA dDCA;
fillDauDCA(trackedCascade, bachelor, protonTrack, pionTrack, primaryVertex, isOmega, dDCA);

candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), trackedCascade.itsClsSize(), 0, 0, 0, 0,
candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), trackedCascade.itsClsSize(), 0, 0, 0, 0, 0,
primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(),
track.pt(), track.eta(), track.phi(),
protonTrack.pt(), protonTrack.eta(), pionTrack.pt(), pionTrack.eta(), bachelor.pt(), bachelor.eta(),
Expand Down

0 comments on commit 35f48df

Please sign in to comment.