Skip to content

Commit 59e38d3

Browse files
committed
[PWGHF] Keep kaon origin classification in charm producer
1 parent 240d1d3 commit 59e38d3

2 files changed

Lines changed: 22 additions & 25 deletions

File tree

‎PWGCF/FemtoDream/Core/femtoDreamUtils.h‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@
1818

1919
#include "PWGCF/DataModel/FemtoDerived.h"
2020

21-
#include "Common/Core/RecoDecay.h"
22-
2321
#include <CommonConstants/PhysicsConstants.h>
2422
#include <Framework/Logger.h>
2523

26-
#include <TMCProcess.h>
2724
#include <TPDGCode.h>
2825

2926
#include <cstdint>
@@ -105,28 +102,6 @@ inline float getMass(int pdgCode)
105102
return mass;
106103
}
107104

108-
/// Classify true kaons from the correct collision for the DCA templates.
109-
template <typename T>
110-
inline int getKaonOrigin(T const& particles, typename T::iterator const& particle)
111-
{
112-
using namespace o2::aod::femtodreamMCparticle;
113-
constexpr int GenFromTransport = -1;
114-
if (particle.getProcess() == TMCProcess::kPHInhelastic && particle.getGenStatusCode() == GenFromTransport) {
115-
return kMaterial;
116-
}
117-
// HF decay products can be physical primaries. Check their ancestry first.
118-
if (RecoDecay::getParticleOrigin(particles, particle) != RecoDecay::OriginType::None) {
119-
return kSecondaryFromHF;
120-
}
121-
if (particle.isPhysicalPrimary()) {
122-
return kPrimary;
123-
}
124-
if (particle.getProcess() == TMCProcess::kPDecay && particle.getGenStatusCode() == GenFromTransport && particle.has_mothers()) {
125-
return kSecondaryFromLF;
126-
}
127-
return kElse;
128-
}
129-
130105
inline int checkDaughterType(o2::aod::femtodreamparticle::ParticleType partType, int motherPDG, int daughterPDG = 0)
131106
{
132107
int partOrigin = 0;

‎PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,28 @@ struct HfProducerCharmHadronsTrackFemtoDream {
465465
-999., -999., -999.);
466466
}
467467

468+
/// Classify true kaons from the correct collision for the DCA templates.
469+
template <typename T>
470+
static int getKaonOrigin(T const& particles, typename T::iterator const& particle)
471+
{
472+
using namespace o2::aod::femtodreamMCparticle;
473+
constexpr int GenFromTransport = -1;
474+
if (particle.getProcess() == TMCProcess::kPHInhelastic && particle.getGenStatusCode() == GenFromTransport) {
475+
return kMaterial;
476+
}
477+
// HF decay products can be physical primaries. Check their ancestry first.
478+
if (RecoDecay::getParticleOrigin(particles, particle) != RecoDecay::OriginType::None) {
479+
return kSecondaryFromHF;
480+
}
481+
if (particle.isPhysicalPrimary()) {
482+
return kPrimary;
483+
}
484+
if (particle.getProcess() == TMCProcess::kPDecay && particle.getGenStatusCode() == GenFromTransport && particle.has_mothers()) {
485+
return kSecondaryFromLF;
486+
}
487+
return kElse;
488+
}
489+
468490
template <typename CollisionType, typename ParticleType>
469491
void fillMcParticle(CollisionType const& col, ParticleType const& particle, o2::aod::femtodreamparticle::ParticleType fdparttype, aod::McParticles const& mcParticles)
470492
{

0 commit comments

Comments
 (0)