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
36 changes: 34 additions & 2 deletions ALICE3/TableProducer/alice3-decayfinder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@

HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};

Partition<aod::McParticles> trueD = aod::mcparticle::pdgCode == 421;

Check failure on line 132 in ALICE3/TableProducer/alice3-decayfinder.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.
Partition<aod::McParticles> trueDbar = aod::mcparticle::pdgCode == -421;

Check failure on line 133 in ALICE3/TableProducer/alice3-decayfinder.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.
Partition<aod::McParticles> trueLc = aod::mcparticle::pdgCode == 4122;
Partition<aod::McParticles> trueLcbar = aod::mcparticle::pdgCode == -4122;

Expand Down Expand Up @@ -229,7 +229,7 @@
std::array<float, 3> negP;
posTrack.getPxPyPzGlo(posP);
negTrack.getPxPyPzGlo(negP);
dmeson.dcaDau = TMath::Sqrt(fitter.getChi2AtPCACandidate());

Check failure on line 232 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
dmeson.Pdaug[0] = posP[0];
dmeson.Pdaug[1] = posP[1];
dmeson.Pdaug[2] = posP[2];
Expand All @@ -238,12 +238,12 @@
dmeson.Ndaug[2] = negP[2];

// return mass and kinematic variables
dmeson.mass = RecoDecay::m(array{array{posP[0], posP[1], posP[2]}, array{negP[0], negP[1], negP[2]}}, array{posMass, negMass});

Check failure on line 241 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
dmeson.pt = std::hypot(posP[0] + negP[0], posP[1] + negP[1]);
dmeson.ptdaugPos = std::hypot(posP[0], posP[1]);
dmeson.ptdaugNeg = std::hypot(negP[0], negP[1]);
dmeson.phi = RecoDecay::phi(array{posP[0] + negP[0], posP[1] + negP[1]});

Check failure on line 245 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
dmeson.eta = RecoDecay::eta(array{posP[0] + negP[0], posP[1] + negP[1], posP[2] + negP[2]});

Check failure on line 246 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
dmeson.y = RecoDecay::y(std::array{posP[0] + negP[0], posP[1] + negP[1], posP[2] + negP[2]}, dmeson.mass);
const auto posSV = fitter.getPCACandidate();
dmeson.posSV[0] = posSV[0];
Expand All @@ -267,6 +267,7 @@
dmeson.mcTruth = 2; // D0bar
}
}

return true;
}

Expand Down Expand Up @@ -300,15 +301,15 @@
t1.getPxPyPzGlo(P1);
t2.getPxPyPzGlo(P2);

lcbaryon.dcaDau = TMath::Sqrt(fitter3.getChi2AtPCACandidate());

Check failure on line 304 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (lcbaryon.dcaDau > dcaDaughtersSelection)
return false;

// return mass
lcbaryon.mass = RecoDecay::m(array{array{P0[0], P0[1], P0[2]}, array{P1[0], P1[1], P1[2]}, array{P2[0], P2[1], P2[2]}}, array{p0mass, p1mass, p2mass});

Check failure on line 309 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
lcbaryon.pt = std::hypot(P0[0] + P1[0] + P2[0], P0[1] + P1[1] + P2[1]);
lcbaryon.phi = RecoDecay::phi(array{P0[0] + P1[0] + P2[0], P0[1] + P1[1] + P2[1]});

Check failure on line 311 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
lcbaryon.eta = RecoDecay::eta(array{P0[0] + P1[0] + P2[0], P0[1] + P1[1] + P2[1], P0[2] + P1[2] + P2[2]});

Check failure on line 312 in ALICE3/TableProducer/alice3-decayfinder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return true;
}

Expand Down Expand Up @@ -362,7 +363,9 @@

if (doprocessFindDmesons) {
histos.add("h2dGenD", "h2dGenD", kTH2F, {axisPt, axisEta});
histos.add("h2dGenD_KpiOnly", "h2dGenD_KpiOnly", kTH2F, {axisPt, axisEta});
histos.add("h2dGenDbar", "h2dGenDbar", kTH2F, {axisPt, axisEta});
histos.add("h2dGenDbar_KpiOnly", "h2dGenDbar_KpiOnly", kTH2F, {axisPt, axisEta});
histos.add("h3dRecD", "h3dRecD", kTH3F, {axisPt, axisEta, axisDMass});
histos.add("h3dRecDSig", "h3dRecDSig", kTH3F, {axisPt, axisEta, axisDMass});
histos.add("h3dRecDRefl", "h3dRecDRefl", kTH3F, {axisPt, axisEta, axisDMass});
Expand Down Expand Up @@ -471,11 +474,37 @@
if (doprocessFindDmesons) {
for (auto const& mcParticle : trueD) {
histos.fill(HIST("h2dGenD"), mcParticle.pt(), mcParticle.eta());
histos.fill(HIST("hDGenForEfficiency"), mcParticle.pt(), mcParticle.y()); // in common for D and Dbar
auto daughters = mcParticle.template daughters_as<aod::McParticles>();
if (daughters.size() != 2)
continue;
// int daugID[2];
int daugPDG[2], i = 0;
for (const auto& dau : daughters) {
// daugID[i] = dau.globalIndex();
daugPDG[i] = dau.pdgCode();
i++;
}
if ((std::fabs(daugPDG[0]) == 321 && std::fabs(daugPDG[1]) == 211) || (std::fabs(daugPDG[0]) == 211 && std::fabs(daugPDG[1]) == 321)) {
histos.fill(HIST("h2dGenD_KpiOnly"), mcParticle.pt(), mcParticle.eta());
histos.fill(HIST("hDGenForEfficiency"), mcParticle.pt(), mcParticle.y()); // in common for D and Dbar
}
}
for (auto const& mcParticle : trueDbar) {
histos.fill(HIST("h2dGenDbar"), mcParticle.pt(), mcParticle.eta());
histos.fill(HIST("hDGenForEfficiency"), mcParticle.pt(), mcParticle.y()); // in common for D and Dbar
auto daughters = mcParticle.template daughters_as<aod::McParticles>();
if (daughters.size() != 2)
continue;
// int daugID[2];
int daugPDG[2], i = 0;
for (const auto& dau : daughters) {
// daugID[i] = dau.globalIndex();
daugPDG[i] = dau.pdgCode();
i++;
}
if ((std::fabs(daugPDG[0]) == 321 && std::fabs(daugPDG[1]) == 211) || (std::fabs(daugPDG[0]) == 211 && std::fabs(daugPDG[1]) == 321)) {
histos.fill(HIST("h2dGenDbar_KpiOnly"), mcParticle.pt(), mcParticle.eta());
histos.fill(HIST("hDGenForEfficiency"), mcParticle.pt(), mcParticle.y()); // in common for D and Dbar
}
}
}
if (doprocessFindLcBaryons) {
Expand Down Expand Up @@ -509,6 +538,7 @@
// D0 mesons
for (auto const& posTrackRow : tracksPiPlusFromDgrouped) {
for (auto const& negTrackRow : tracksKaMinusFromDgrouped) {

if (mcSameMotherCheck && !checkSameMother(posTrackRow, negTrackRow))
continue;
if (!buildDecayCandidateTwoBody(posTrackRow, negTrackRow, o2::constants::physics::MassPionCharged, o2::constants::physics::MassKaonCharged, mcParticles))
Expand Down Expand Up @@ -651,9 +681,11 @@
mcTruthOutcome(dmeson.mcTruth);
}
}

// D0bar mesons
for (auto const& posTrackRow : tracksKaPlusFromDgrouped) {
for (auto const& negTrackRow : tracksPiMinusFromDgrouped) {

if (mcSameMotherCheck && !checkSameMother(posTrackRow, negTrackRow))
continue;
if (!buildDecayCandidateTwoBody(posTrackRow, negTrackRow, o2::constants::physics::MassKaonCharged, o2::constants::physics::MassPionCharged, mcParticles))
Expand Down
Loading