Skip to content

Commit

Permalink
Add phi variable to tree
Browse files Browse the repository at this point in the history
  • Loading branch information
atavirag committed Jan 23, 2025
1 parent f86c517 commit 7e7492c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 4 additions & 0 deletions PWGHF/HFC/DataModel/DMesonPairsTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ DECLARE_SOA_COLUMN(PtCand1, ptCand1, float); //! Transverse momentum of first ca
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); //! Rapidity of first candidate
DECLARE_SOA_COLUMN(PhiCand2, phiCand2, float); //! Rapidity 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
19 changes: 10 additions & 9 deletions PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -418,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 @@ -473,11 +473,10 @@ 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)
{
void fillMcHistos(int8_t matchedRec1, int8_t matchedRec2, int8_t isTrueDCand1, int8_t isTrueDbarCand1, int8_t isTrueDCand2, int8_t isTrueDbarCand2) {
// Fill hMatchingMcRec - Cand 1
registry.fill(HIST("hMatchingMcRec"), 1);
if (matchedRec1 == 1) {
Expand Down Expand Up @@ -634,13 +633,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 @@ -668,6 +667,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 @@ -767,6 +767,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 @@ -818,15 +819,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 @@ -1011,7 +1012,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 7e7492c

Please sign in to comment.