Skip to content

Commit

Permalink
[PWGHF] Add prompt and non-prompt plots for efficiencies (#9478)
Browse files Browse the repository at this point in the history
  • Loading branch information
atavirag authored Jan 24, 2025
1 parent ababb9c commit 9498b2d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
12 changes: 8 additions & 4 deletions PWGHF/HFC/DataModel/DMesonPairsTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ namespace o2::aod
namespace hf_correlation_d_meson_pair
{
// Kinematic info
DECLARE_SOA_COLUMN(PtCand1, ptCand1, float); //! Transverse momentum of first candidate
DECLARE_SOA_COLUMN(PtCand2, ptCand2, float); //! Transverse momentum of second candidate
DECLARE_SOA_COLUMN(YCand1, yCand1, float); //! Rapidity of first candidate
DECLARE_SOA_COLUMN(YCand2, yCand2, float); //! Rapidity of second candidate
DECLARE_SOA_COLUMN(PtCand1, ptCand1, float); //! Transverse momentum of first candidate
DECLARE_SOA_COLUMN(PtCand2, ptCand2, float); //! Transverse momentum of second candidate
DECLARE_SOA_COLUMN(YCand1, yCand1, float); //! Rapidity of first candidate
DECLARE_SOA_COLUMN(YCand2, yCand2, float); //! Rapidity of second candidate
DECLARE_SOA_COLUMN(PhiCand1, phiCand1, float); //! Azimuthal angle of first candidate
DECLARE_SOA_COLUMN(PhiCand2, phiCand2, float); //! Azimuthal angle of second candidate
// Invariant mass
DECLARE_SOA_COLUMN(MDCand1, mDCand1, float); //! Invariant mass of first candidate as D
DECLARE_SOA_COLUMN(MDbarCand1, mDbarCand1, float); //! Invariant mass of first candidate as Dbar
Expand Down Expand Up @@ -58,6 +60,8 @@ DECLARE_SOA_COLUMN(MlProbD0barCand2, mlProbD0barCand2, std::vector<float>); //!
hf_correlation_d_meson_pair::PtCand2, \
hf_correlation_d_meson_pair::YCand1, \
hf_correlation_d_meson_pair::YCand2, \
hf_correlation_d_meson_pair::PhiCand1, \
hf_correlation_d_meson_pair::PhiCand2, \
hf_correlation_d_meson_pair::MDCand1, \
hf_correlation_d_meson_pair::MDbarCand1, \
hf_correlation_d_meson_pair::MDCand2, \
Expand Down
20 changes: 13 additions & 7 deletions PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ struct HfCorrelatorDMesonPairs {
{"hNContribMcGen", "D meson candidates MC Gen;Number of contributors", hTH1NContrib},
// MC Rec plots
{"hPtVsYVsNContribMcRec", "D meson candidates MC Rec;candidate #it{p}_{T} (GeV/#it{c});#it{y};Number of contributors", hTH3PtVsYVsNContrib},
{"hPtVsYVsNContribMcRecPrompt", "D meson candidates MC Rec Prompt;candidate #it{p}_{T} (GeV/#it{c});#it{y};Number of contributors", hTH3PtVsYVsNContrib},
{"hPtVsYVsNContribMcRecNonPrompt", "D meson candidates MC Rec Non-prompt;candidate #it{p}_{T} (GeV/#it{c});#it{y};Number of contributors", hTH3PtVsYVsNContrib},
{"hNContribMcRec", "D meson candidates MC Rec;Number of contributors", hTH1NContrib},
// PID plots ----- Not definitively here
{"PID/hTofNSigmaPi", "(TOFsignal-time#pi)/tofSigPid;p[GeV/c];(TOFsignal-time#pi)/tofSigPid", hTH2Pid},
Expand Down Expand Up @@ -416,7 +418,7 @@ struct HfCorrelatorDMesonPairs {

/// Fill selection status histogram
void fillEntry(const bool& isDCand1, const bool& isDbarCand1, const bool& isDCand2, const bool& isDbarCand2,
const uint8_t& candidateType1, const uint8_t& candidateType2, float yCand1, float yCand2,
const uint8_t& candidateType1, const uint8_t& candidateType2, float yCand1, float yCand2, float phiCand1, float phiCand2,
double ptCand1, double ptCand2, float massDCand1, float massDbarCand1, float massDCand2, float massDbarCand2)
{

Expand Down Expand Up @@ -471,7 +473,7 @@ struct HfCorrelatorDMesonPairs {
}
}

entryD0Pair(ptCand1, ptCand2, yCand1, yCand2, massDCand1, massDbarCand1, massDCand2, massDbarCand2, pairType, candidateType1, candidateType2);
entryD0Pair(ptCand1, ptCand2, yCand1, yCand2, phiCand1, phiCand2, massDCand1, massDbarCand1, massDCand2, massDbarCand2, pairType, candidateType1, candidateType2);
}

void fillMcHistos(int8_t matchedRec1, int8_t matchedRec2, int8_t isTrueDCand1, int8_t isTrueDbarCand1, int8_t isTrueDCand2, int8_t isTrueDbarCand2)
Expand Down Expand Up @@ -632,13 +634,13 @@ struct HfCorrelatorDMesonPairs {
}

fillEntry(isDCand1, isDbarCand1, isDCand2, isDbarCand2, candidateType1, candidateType2, hfHelper.yD0(candidate1), hfHelper.yD0(candidate2),
candidate1.pt(), candidate2.pt(), hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1),
candidate1.pt(), candidate2.pt(), candidate1.phi(), candidate2.phi(), hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1),
hfHelper.invMassD0ToPiK(candidate2), hfHelper.invMassD0barToKPi(candidate2));

entryD0PairMl(outputMlD0Cand1, outputMlD0barCand1, outputMlD0Cand2, outputMlD0barCand2);
} else {
// Fill entries
fillEntry(isDCand1, isDbarCand1, isDCand2, isDbarCand2, candidateType1, candidateType2, hfHelper.yD0(candidate1), hfHelper.yD0(candidate2),
fillEntry(isDCand1, isDbarCand1, isDCand2, isDbarCand2, candidateType1, candidateType2, hfHelper.yD0(candidate1), hfHelper.yD0(candidate2), candidate1.phi(), candidate2.phi(),
candidate1.pt(), candidate2.pt(), hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1),
hfHelper.invMassD0ToPiK(candidate2), hfHelper.invMassD0barToKPi(candidate2));
}
Expand Down Expand Up @@ -666,6 +668,7 @@ struct HfCorrelatorDMesonPairs {

auto ptCandidate1 = candidate1.pt();
auto yCandidate1 = hfHelper.yD0(candidate1);
auto phiCandidate1 = candidate1.phi();
float massD0Cand1 = hfHelper.invMassD0ToPiK(candidate1);
float massD0barCand1 = hfHelper.invMassD0barToKPi(candidate1);
auto prong0Cand1 = candidate1.template prong0_as<aod::Tracks>();
Expand Down Expand Up @@ -734,8 +737,10 @@ struct HfCorrelatorDMesonPairs {
registry.fill(HIST("hNContribMcRec"), collision.numContrib());
if (originRec1 == 1) {
registry.fill(HIST("hMassMcRecPrompt"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt());
registry.fill(HIST("hPtVsYVsNContribMcRecPrompt"), candidate1.pt(), hfHelper.yD0(candidate1), collision.numContrib());
} else if (originRec1 == 2) {
registry.fill(HIST("hMassMcRecNonPrompt"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt());
registry.fill(HIST("hPtVsYVsNContribMcRecNonPrompt"), candidate1.pt(), hfHelper.yD0(candidate1), collision.numContrib());
}
} else if (isTrueDbarCand1) {
registry.fill(HIST("hMassMcRecReflections"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt());
Expand Down Expand Up @@ -763,6 +768,7 @@ struct HfCorrelatorDMesonPairs {

auto ptCandidate2 = candidate2.pt();
auto yCandidate2 = hfHelper.yD0(candidate2);
auto phiCandidate2 = candidate2.phi();
float massD0Cand2 = hfHelper.invMassD0ToPiK(candidate2);
float massD0barCand2 = hfHelper.invMassD0barToKPi(candidate2);
auto prong0Cand2 = candidate2.template prong0_as<aod::Tracks>();
Expand Down Expand Up @@ -814,15 +820,15 @@ struct HfCorrelatorDMesonPairs {
}

// Fill tables
fillEntry(isDCand1, isDbarCand1, isDCand2, isDbarCand2, candidateType1, candidateType2, yCandidate1, yCandidate2,
fillEntry(isDCand1, isDbarCand1, isDCand2, isDbarCand2, candidateType1, candidateType2, yCandidate1, yCandidate2, phiCandidate1, phiCandidate2,
ptCandidate1, ptCandidate2, massD0Cand1, massD0barCand1, massD0Cand2, massD0barCand2);
fillMcHistos(matchedRec1, matchedRec2, isTrueDCand1, isTrueDbarCand1, isTrueDCand2, isTrueDbarCand2);
entryD0PairMcInfo(originRec1, originRec2, matchedRec1, matchedRec2);
entryD0PairMl(outputMlD0Cand1, outputMlD0barCand1, outputMlD0Cand2, outputMlD0barCand2);

} else {
// Fill tables
fillEntry(isDCand1, isDbarCand1, isDCand2, isDbarCand2, candidateType1, candidateType2, yCandidate1, yCandidate2,
fillEntry(isDCand1, isDbarCand1, isDCand2, isDbarCand2, candidateType1, candidateType2, yCandidate1, yCandidate2, phiCandidate1, phiCandidate2,
ptCandidate1, ptCandidate2, massD0Cand1, massD0barCand1, massD0Cand2, massD0barCand2);
fillMcHistos(matchedRec1, matchedRec2, isTrueDCand1, isTrueDbarCand1, isTrueDCand2, isTrueDbarCand2);
entryD0PairMcInfo(originRec1, originRec2, matchedRec1, matchedRec2);
Expand Down Expand Up @@ -1007,7 +1013,7 @@ struct HfCorrelatorDMesonPairs {
}

// Fill pair Selection Status
entryD0PairMcGen(particle1.pt(), particle2.pt(), particle1.y(), particle2.y(), massD, massDbar, massD, massDbar, pairType, particleType1, particleType2);
entryD0PairMcGen(particle1.pt(), particle2.pt(), particle1.y(), particle2.y(), particle1.phi(), particle2.phi(), massD, massDbar, massD, massDbar, pairType, particleType1, particleType2);
entryD0PairMcGenInfo(originGen1, originGen2, matchedGen1, matchedGen2);

} // end inner loop
Expand Down

0 comments on commit 9498b2d

Please sign in to comment.