Skip to content

Commit e69e7cc

Browse files
Refactor signal folder and suffix definitions
1 parent bfef27f commit e69e7cc

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

PWGHF/D2H/Tasks/taskCd.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ struct HfTaskCd {
271271
ConfigurableAxis thnConfigAxisNumPvContr{"thnConfigAxisNumPvContr", {200, -0.5, 199.5}, "Number of PV contributors"};
272272
ConfigurableAxis thnConfigAxisCt{"thnConfigAxisCt", {500, 0., 5000.}, ""};
273273

274-
constexpr static std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"};
275-
constexpr static std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"};
276-
const float cmToMum = 1.e4;
274+
static constexpr std::array<std::string_view, 3> SignalFolders = {"signal", "prompt", "nonprompt"};
275+
static constexpr std::array<std::string_view, 3> SignalSuffixes = {"", "Prompt", "NonPrompt"};
276+
static constexpr float CmToMum = 1.e4f;
277277

278278
enum SignalClasses : int {
279279
Signal = 0,
@@ -539,7 +539,7 @@ struct HfTaskCd {
539539
pdgCodeProng0 = std::abs(mcParticleProng0.pdgCode());
540540
const auto indexMother = RecoDecay::getMother(mcParticles, mcParticleProng0, o2::constants::physics::Pdg::kCDeuteron, true);
541541
const auto particleMother = mcParticles.rawIteratorAt(indexMother);
542-
ctGen = RecoDecay::ct(std::array{particleMother.px(), particleMother.py(), particleMother.pz()}, RecoDecay::distance(std::array{particleMother.vx(), particleMother.vy(), particleMother.vz()}, std::array{mcParticleProng0.vx(), mcParticleProng0.vy(), mcParticleProng0.vz()}), o2::constants::physics::MassCDeuteron) * cmToMum;
542+
ctGen = RecoDecay::ct(std::array{particleMother.px(), particleMother.py(), particleMother.pz()}, RecoDecay::distance(std::array{particleMother.vx(), particleMother.vy(), particleMother.vz()}, std::array{mcParticleProng0.vx(), mcParticleProng0.vy(), mcParticleProng0.vz()}), o2::constants::physics::MassCDeuteron) * CmToMum;
543543
ptGen = particleMother.pt();
544544
}
545545

@@ -591,7 +591,7 @@ struct HfTaskCd {
591591
candidate.decayLength(), candidate.cpa(), candidate.chi2PCA(),
592592
nSigmaTpcDe, nSigmaTpcPr, nSigmaItsDe, nSigmaTofDe,
593593
tofBetaDe, tpcInnerParamDe, tofExpMomDe,
594-
candidate.ct(o2::constants::physics::MassCDeuteron) * cmToMum,
594+
candidate.ct(o2::constants::physics::MassCDeuteron) * CmToMum,
595595
candFlag, candSign, candidate.flagMcMatchRec(), candidate.originMcRec(),
596596
candidate.flagMcDecayChanRec(), ctGen, o2::hf_centrality::getCentralityColl(collision));
597597
}
@@ -606,7 +606,7 @@ struct HfTaskCd {
606606
nSigmaTpcDe, nSigmaTpcPr, nSigmaItsDe, nSigmaTofDe,
607607
tofBetaDe, tpcInnerParamDe, tofExpMomDe,
608608
nSigmaTpcPi, nSigmaTofPi, nSigmaTpcKa, nSigmaTofKa,
609-
candidate.ct(o2::constants::physics::MassCDeuteron) * cmToMum,
609+
candidate.ct(o2::constants::physics::MassCDeuteron) * CmToMum,
610610
candFlag, candSign, candidate.flagMcMatchRec(), candidate.isCandidateSwapped(), candidate.originMcRec(),
611611
candidate.flagMcDecayChanRec(), ctGen, collision.numContrib(), o2::hf_centrality::getCentralityColl(collision),
612612
collision.posZ(), collision.globalIndex(), timeStamp);
@@ -697,7 +697,7 @@ struct HfTaskCd {
697697
const bool isPrompt = particle.originMcGen() == 0;
698698
const float ptGenB = isPrompt ? -1.f : mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt();
699699
const auto firstDau = particle.template daughters_as<CandCdMcGen>().begin();
700-
const float ctGen = RecoDecay::ct(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::distance(std::array{particle.vx(), particle.vy(), particle.vz()}, std::array{firstDau.vx(), firstDau.vy(), firstDau.vz()}), o2::constants::physics::MassCDeuteron) * cmToMum;
700+
const float ctGen = RecoDecay::ct(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::distance(std::array{particle.vx(), particle.vy(), particle.vz()}, std::array{firstDau.vx(), firstDau.vy(), firstDau.vz()}), o2::constants::physics::MassCDeuteron) * CmToMum;
701701

702702
fillHistogramsGen<Signal>(particle, yGen);
703703
if (isPrompt) {

0 commit comments

Comments
 (0)