Skip to content

Commit a812ed4

Browse files
[PWGHF,PWGCF] Store charm hadron + track invariant mass in derived tree (#12864)
1 parent acc5a44 commit a812ed4

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

PWGCF/DataModel/FemtoDerived.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ DECLARE_SOA_COLUMN(Kstar, kstar, float); //! Relative
243243
DECLARE_SOA_COLUMN(KT, kT, float); //! kT distribution of particle pairs
244244
DECLARE_SOA_COLUMN(MT, mT, float); //! Transverse mass distribution
245245
DECLARE_SOA_COLUMN(CharmM, charmM, float); //! Charm hadron mass
246+
DECLARE_SOA_COLUMN(CharmTrkM, charmtrkM, float); //! Charm hadron track mass
246247
DECLARE_SOA_COLUMN(CharmPt, charmPt, float); //! Transverse momentum of charm hadron for result task
247248
DECLARE_SOA_COLUMN(CharmEta, charmEta, float); //! Eta of charm hadron for result task
248249
DECLARE_SOA_COLUMN(CharmPhi, charmPhi, float); //! Phi of charm hadron for result task
@@ -327,6 +328,7 @@ DECLARE_SOA_TABLE(FDHfPairs, "AOD", "FDHFPAIRS", //! table to store results for
327328
fdhf::MultPercentile,
328329
fdhf::Charge,
329330
fdhf::PairSign,
331+
fdhf::CharmTrkM,
330332
fdhf::ProcessType,
331333
fdhf::FlagMc,
332334
fdhf::OriginMcRec);

PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h"
2525
#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h"
2626

27+
#include "Common/Core/RecoDecay.h"
28+
2729
#include <CommonConstants/PhysicsConstants.h>
2830
#include <Framework/ASoAHelpers.h>
2931
#include <Framework/AnalysisDataModel.h>
@@ -298,6 +300,49 @@ struct HfTaskCharmHadronsFemtoDream {
298300
return invMass;
299301
}
300302

303+
template <typename Candidate, typename Track>
304+
float getCharmHadronTrackMass(const Candidate& cand,
305+
const Track& trk,
306+
double trackMassHyp = o2::constants::physics::MassProton)
307+
{
308+
309+
auto pVecProng0 = RecoDecayPtEtaPhi::pVector(cand.prong0Pt(), cand.prong0Eta(), cand.prong0Phi());
310+
auto pVecProng1 = RecoDecayPtEtaPhi::pVector(cand.prong1Pt(), cand.prong1Eta(), cand.prong1Phi());
311+
auto pVecProng2 = RecoDecayPtEtaPhi::pVector(cand.prong2Pt(), cand.prong2Eta(), cand.prong2Phi());
312+
auto pVecTrack = RecoDecayPtEtaPhi::pVector(trk.pt(), trk.eta(), trk.phi());
313+
const auto pVecCharmTrk = std::array{pVecProng0, pVecProng1, pVecProng2, pVecTrack};
314+
315+
std::array<double, 4> massCharmTrk{};
316+
317+
if (charmHadPDGCode == o2::constants::physics::Pdg::kLambdaCPlus) {
318+
// Λc⁺ → p K π
319+
if (cand.candidateSelFlag() == 1) {
320+
massCharmTrk = {
321+
o2::constants::physics::MassProton,
322+
o2::constants::physics::MassKPlus,
323+
o2::constants::physics::MassPiPlus,
324+
trackMassHyp};
325+
} else {
326+
// prong0=π, prong1=K, prong2=p
327+
massCharmTrk = {
328+
o2::constants::physics::MassPiPlus,
329+
o2::constants::physics::MassKPlus,
330+
o2::constants::physics::MassProton,
331+
trackMassHyp};
332+
}
333+
} else if (charmHadPDGCode == o2::constants::physics::Pdg::kDPlus) {
334+
// D⁺ → π K π
335+
massCharmTrk = {
336+
o2::constants::physics::MassPiPlus,
337+
o2::constants::physics::MassKPlus,
338+
o2::constants::physics::MassPiPlus,
339+
trackMassHyp};
340+
} else {
341+
return -1.f;
342+
}
343+
return static_cast<float>(RecoDecay::m(pVecCharmTrk, massCharmTrk));
344+
}
345+
301346
/// This function processes the same event and takes care of all the histogramming
302347
template <bool isMc, typename PartitionType, typename CandType, typename TableTracks, typename Collision>
303348
void doSameEvent(PartitionType& sliceTrk1, CandType& sliceCharmHad, TableTracks const& parts, Collision const& col)
@@ -323,7 +368,6 @@ struct HfTaskCharmHadronsFemtoDream {
323368
if (kstar > highkstarCut) {
324369
continue;
325370
}
326-
327371
float invMass = getCharmHadronMass(p2);
328372

329373
if (invMass < charmHadMinInvMass || invMass > charmHadMaxInvMass) {
@@ -334,6 +378,8 @@ struct HfTaskCharmHadronsFemtoDream {
334378
continue;
335379
}
336380

381+
float deltaInvMassPair = getCharmHadronTrackMass(p2, p1, o2::constants::physics::MassProton) - invMass;
382+
337383
// proton track charge
338384
float chargeTrack = 0.;
339385
if ((p1.cut() & CutBitChargePositive) == CutBitChargePositive) {
@@ -372,6 +418,7 @@ struct HfTaskCharmHadronsFemtoDream {
372418
col.multV0M(),
373419
p2.charge(),
374420
pairSign,
421+
deltaInvMassPair,
375422
processType,
376423
charmHadMc,
377424
originType);
@@ -427,6 +474,9 @@ struct HfTaskCharmHadronsFemtoDream {
427474
if (p2.pt() < charmHadMinPt || p2.pt() > charmHadMaxPt) {
428475
continue;
429476
}
477+
478+
float deltaInvMassPair = getCharmHadronTrackMass(p2, p1, o2::constants::physics::MassProton) - invMass;
479+
430480
// proton track charge
431481
float chargeTrack = 0.;
432482
if ((p1.cut() & CutBitChargePositive) == CutBitChargePositive) {
@@ -462,6 +512,7 @@ struct HfTaskCharmHadronsFemtoDream {
462512
collision1.multV0M(),
463513
p2.charge(),
464514
pairSign,
515+
deltaInvMassPair,
465516
processType,
466517
charmHadMc,
467518
originType);

0 commit comments

Comments
 (0)