Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions PWGLF/Tasks/Strangeness/nonPromptCascade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@
if (particle.has_mothers()) {
auto mom = particle.template mothers_as<aod::McParticles>()[0];
int pdgCodeMom = mom.pdgCode();
fromBeauty = std::abs(pdgCodeMom) / 5000 == 1 || std::abs(pdgCodeMom) / 500 == 1 || std::abs(pdgCodeMom) == 5;

Check failure on line 138 in PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 138 in PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
fromCharm = std::abs(pdgCodeMom) / 4000 == 1 || std::abs(pdgCodeMom) / 400 == 1 || std::abs(pdgCodeMom) == 4;

Check failure on line 139 in PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
while (mom.has_mothers()) {
const auto grandma = mom.template mothers_as<aod::McParticles>()[0];
int pdgCodeGrandma = std::abs(grandma.pdgCode());
fromBeauty = fromBeauty || (pdgCodeGrandma / 5000 == 1 || pdgCodeGrandma / 500 == 1 || pdgCodeGrandma == 5);

Check failure on line 143 in PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
fromCharm = fromCharm || (pdgCodeGrandma / 4000 == 1 || pdgCodeGrandma / 400 == 1 || pdgCodeGrandma == 4);

Check failure on line 144 in PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
mom = grandma;
}
}
Expand Down Expand Up @@ -210,6 +210,7 @@
float mBz = 0.f;
o2::vertexing::DCAFitterN<2> mDCAFitter;
std::array<int, 2> mProcessCounter = {0, 0}; // {Tracked, All}
std::map<uint64_t, uint32_t> mToiMap;

void initCCDB(aod::BCsWithTimestamps::iterator const& bc)
{
Expand Down Expand Up @@ -299,9 +300,10 @@
return true;
}

void zorroAccounting(const auto& collisions, auto& toiMap)
void zorroAccounting(const auto& collisions)
{
if (cfgSkimmedProcessing && mProcessCounter[0] != mProcessCounter[1]) {
mToiMap.clear();
int runNumber{-1};
for (const auto& coll : collisions) {
auto bc = coll.template bc_as<aod::BCsWithTimestamps>();
Expand All @@ -320,7 +322,7 @@
for (size_t i{0}; i < toivect.size(); i++) {
toiMask += toivect[i] << i;
}
toiMap[bc.globalBC()] = toiMask;
mToiMap[bc.globalBC()] = toiMask;
}
}
}
Expand All @@ -338,7 +340,7 @@
};

template <typename TrackType, typename CollisionType>
void fillCandidatesVector(CollisionType const&, TrackType const& tracks, auto const& cascades, auto& candidates, std::map<uint64_t, uint32_t> toiMap = {})
void fillCandidatesVector(CollisionType const&, TrackType const& tracks, auto const& cascades, auto& candidates)
{

const auto& getCascade = [](auto const& candidate) {
Expand Down Expand Up @@ -476,13 +478,13 @@
if (protonTrack.mcParticle().has_mothers() && pionTrack.mcParticle().has_mothers() && bachelor.mcParticle().has_mothers()) {
if (protonTrack.mcParticle().mothersIds()[0] == pionTrack.mcParticle().mothersIds()[0]) {
const auto v0part = protonTrack.mcParticle().template mothers_first_as<aod::McParticles>();
if (std::abs(v0part.pdgCode()) == 3122 && v0part.has_mothers()) {

Check failure on line 481 in PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
const auto motherV0 = v0part.template mothers_as<aod::McParticles>()[0];
if (v0part.mothersIds()[0] == bachelor.mcParticle().mothersIds()[0]) {
if (std::abs(motherV0.pdgCode()) == 3312 || std::abs(motherV0.pdgCode()) == 3334) {

Check failure on line 484 in PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
isGoodCascade = true;

isOmega = (std::abs(motherV0.pdgCode()) == 3334);

Check failure on line 487 in PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
fromHF = isFromHF(motherV0);
mcParticleID = v0part.mothersIds()[0];
}
Expand Down Expand Up @@ -543,8 +545,8 @@
o2::base::Propagator::Instance()->propagateToDCA(primaryVertex, ntCascadeTrack, mBz, 2.f, matCorr, &motherDCA);
}
uint32_t toiMask = 0x0;
if (toiMap.count(bc.globalBC())) {
toiMask = toiMap[bc.globalBC()];
if (mToiMap.count(bc.globalBC())) {
toiMask = mToiMap[bc.globalBC()];
}
candidates.emplace_back(NPCascCandidate{mcParticleID, trackedCascGlobalIndex, itsTrackGlobalIndex, candidate.collisionId(), matchingChi2, deltaPtITSCascade, deltaPtCascade, cascITSclsSize, hasReassociatedClusters, hasFakeReassociation, isGoodMatch, isGoodCascade, pdgCodeMom, itsTrackPDG, fromHF[0], fromHF[1],
collision.numContrib(), cascPVContribs, collision.collisionTimeRes(), primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(),
Expand Down Expand Up @@ -595,7 +597,7 @@
auto daughters = mom.template daughters_as<aod::McParticles>();
motherDecayDaughters = daughters.size();
for (const auto& d : daughters) {
if (std::abs(d.pdgCode()) == 11 || std::abs(d.pdgCode()) == 13) {

Check failure on line 600 in PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
motherDecayDaughters *= -1;
break;
}
Expand Down Expand Up @@ -675,7 +677,7 @@
auto daughters = mom.template daughters_as<aod::McParticles>();
motherDecayDaughters = daughters.size();
for (const auto& d : daughters) {
if (std::abs(d.pdgCode()) == 11 || std::abs(d.pdgCode()) == 13) {

Check failure on line 680 in PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
motherDecayDaughters *= -1;
break;
}
Expand All @@ -693,10 +695,8 @@
aod::BCsWithTimestamps const&)
{
mProcessCounter[0]++;
fillMultHistos(collisions);
std::map<uint64_t, uint32_t> toiMap;
zorroAccounting(collisions, toiMap);
fillCandidatesVector<TracksExtData>(collisions, tracks, trackedCascades, gCandidates, toiMap);
zorroAccounting(collisions);
fillCandidatesVector<TracksExtData>(collisions, tracks, trackedCascades, gCandidates);
fillDataTable<aod::AssignedTrackedCascades>(gCandidates);
}
PROCESS_SWITCH(NonPromptCascadeTask, processTrackedCascadesData, "process cascades from strangeness tracking: Data analysis", false);
Expand All @@ -706,9 +706,9 @@
aod::BCsWithTimestamps const&)
{
mProcessCounter[1]++;
std::map<uint64_t, uint32_t> toiMap;
zorroAccounting(collisions, toiMap);
fillCandidatesVector<TracksExtData>(collisions, tracks, cascades, gCandidatesNT, toiMap);
fillMultHistos(collisions);
zorroAccounting(collisions);
fillCandidatesVector<TracksExtData>(collisions, tracks, cascades, gCandidatesNT);
fillDataTable<aod::Cascades>(gCandidatesNT);
}
PROCESS_SWITCH(NonPromptCascadeTask, processCascadesData, "process cascades: Data analysis", false);
Expand Down
Loading