Skip to content

Commit a942f8c

Browse files
author
Mattia Faggin
committed
Address comments from Vit.
1 parent 0cd576f commit a942f8c

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

PWGHF/D2H/Tasks/taskSigmac.cxx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct HfTaskSigmac {
4545

4646
HfHelper hfHelper;
4747
bool isMc;
48+
static constexpr std::size_t NDaughters{2u};
4849

4950
using RecoLc = soa::Join<aod::HfCand3Prong, aod::HfSelLc>;
5051

@@ -357,7 +358,7 @@ struct HfTaskSigmac {
357358
massLc = hfHelper.invMassLcToPKPi(candidateLc);
358359
deltaMass = massSc - massLc;
359360
/// fill the histograms
360-
if (chargeSc == o2::aod::hf_cand_sigmac::chargeNull) {
361+
if (chargeSc == o2::aod::hf_cand_sigmac::ChargeNull) {
361362
registry.fill(HIST("Data/hPtSc0"), ptSc);
362363
registry.fill(HIST("Data/hEtaSc0"), etaSc);
363364
registry.fill(HIST("Data/hPhiSc0"), phiSc);
@@ -430,7 +431,7 @@ struct HfTaskSigmac {
430431
massLc = hfHelper.invMassLcToPiKP(candidateLc);
431432
deltaMass = massSc - massLc;
432433
/// fill the histograms
433-
if (chargeSc == o2::aod::hf_cand_sigmac::chargeNull) {
434+
if (chargeSc == o2::aod::hf_cand_sigmac::ChargeNull) {
434435
registry.fill(HIST("Data/hPtSc0"), ptSc);
435436
registry.fill(HIST("Data/hEtaSc0"), etaSc);
436437
registry.fill(HIST("Data/hPhiSc0"), phiSc);
@@ -563,10 +564,10 @@ struct HfTaskSigmac {
563564
for (const auto& particle : mcParticlesSc) {
564565

565566
/// reject immediately particles different from Σc0,++
566-
bool isSc0Gen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi));
567-
bool isScStar0Gen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi));
568-
bool isScPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi));
569-
bool isScStarPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi));
567+
bool isSc0Gen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi));
568+
bool isScStar0Gen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi));
569+
bool isScPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi));
570+
bool isScStarPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi));
570571
if (!isSc0Gen && !isScPlusPlusGen && !isScStar0Gen && !isScStarPlusPlusGen)
571572
continue;
572573

@@ -603,8 +604,7 @@ struct HfTaskSigmac {
603604
double ptGenSc(particle.pt()), etaGenSc(particle.eta()), phiGenSc(particle.phi());
604605
double ptGenScBMother(-1.);
605606
auto arrayDaughtersIds = particle.daughtersIds();
606-
const int dauSize = 2;
607-
if (arrayDaughtersIds.size() != dauSize) {
607+
if (arrayDaughtersIds.size() != NDaughters) {
608608
/// This should never happen
609609
LOG(fatal) << "generated Σc0,++ has a number of daughter particles different than 2";
610610
continue;
@@ -721,7 +721,7 @@ struct HfTaskSigmac {
721721

722722
/// loop over Lc generated particles
723723
for (const auto& particle : mcParticlesLc) {
724-
if (std::abs(particle.flagMcMatchGen()) != 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) {
724+
if (std::abs(particle.flagMcMatchGen()) != BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)) {
725725
continue;
726726
}
727727
if (yCandGenMax >= 0. && std::abs(RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus)) > yCandGenMax) {
@@ -742,8 +742,8 @@ struct HfTaskSigmac {
742742
for (const auto& candSc : candidatesSc) {
743743

744744
/// Candidate selected as Σc0 and/or Σc++
745-
if (!(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && // Σc0,++(2455)
746-
!(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)) { // Σc0,++(2520)
745+
if (!(candSc.hfflag() & BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)) && !(candSc.hfflag() & BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)) && // Σc0,++(2455)
746+
!(candSc.hfflag() & BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi)) && !(candSc.hfflag() & BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi))) { // Σc0,++(2520)
747747
continue;
748748
}
749749
/// rapidity selection on Σc0,++
@@ -762,12 +762,12 @@ struct HfTaskSigmac {
762762

763763
// candidateLc.flagMcDecayChanRec();
764764

765-
bool isTrueSc0Reco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi;
766-
bool isTrueScStar0Reco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi;
767-
bool isTrueScPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi;
768-
bool isTrueScStarPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi;
765+
bool isTrueSc0Reco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi);
766+
bool isTrueScStar0Reco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi);
767+
bool isTrueScPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi);
768+
bool isTrueScStarPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi);
769769
int sigmacSpecies = -1;
770-
if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == o2::aod::hf_cand_sigmac::chargeNull)) {
770+
if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == o2::aod::hf_cand_sigmac::ChargeNull)) {
771771
/// Reconstructed Σc0 signal
772772
// Get the corresponding MC particle for Sc, found as the mother of the soft pion
773773
int indexMcScRec = -1;
@@ -951,7 +951,7 @@ struct HfTaskSigmac {
951951

952952
} /// end candidate Λc+ → π+K-p (and charge conjugate)
953953
/// end reconstructed Σc0 signal
954-
} else if ((isTrueScPlusPlusReco || isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == o2::aod::hf_cand_sigmac::chargePlusPlus)) {
954+
} else if ((isTrueScPlusPlusReco || isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == o2::aod::hf_cand_sigmac::ChargePlusPlus)) {
955955
/// Reconstructed Σc++ signal
956956
// Get the corresponding MC particle for Sc, found as the mother of the soft pion
957957
int indexMcScRec = -1;

PWGHF/DataModel/CandidateReconstructionTables.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,8 +2073,8 @@ enum Species : int { Sc2455 = 0,
20732073
enum Decays : int { PKPi = 0,
20742074
PiKP,
20752075
NDecays };
2076-
const int chargeNull = 0;
2077-
const int chargePlusPlus = 2;
2076+
constexpr int ChargeNull = 0;
2077+
constexpr int ChargePlusPlus = 2;
20782078
} // namespace hf_cand_sigmac
20792079

20802080
// declare dedicated Σc0,++ decay candidate table

PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ struct HfCandidateCreatorSigmac0plusplus {
143143
softPiCuts.SetMaxChi2PerClusterITS(softPiChi2Max);
144144
// ITS hitmap
145145
std::set<uint8_t> setSoftPiItsHitMap; // = {};
146-
const int itsLayers = 7;
147-
for (int idItsLayer = 0; idItsLayer < itsLayers; idItsLayer++) {
146+
constexpr std::size_t itsLayers = 7;
147+
for (std::size_t idItsLayer = 0u; idItsLayer < itsLayers; idItsLayer++) {
148148
if (TESTBIT(softPiItsHitMap, idItsLayer)) {
149149
setSoftPiItsHitMap.insert(static_cast<uint8_t>(idItsLayer));
150150
}
@@ -180,7 +180,7 @@ struct HfCandidateCreatorSigmac0plusplus {
180180

181181
/// keep only the candidates flagged as possible Λc+ (and charge conj.) decaying into a charged pion, kaon and proton
182182
/// if not selected, skip it and go to the next one
183-
if (!(candLc.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) {
183+
if (!(candLc.hfflag() & BIT(aod::hf_cand_3prong::DecayType::LcToPKPi))) {
184184
continue;
185185
}
186186
/// keep only the candidates Λc+ (and charge conj.) within the desired rapidity
@@ -236,7 +236,7 @@ struct HfCandidateCreatorSigmac0plusplus {
236236
int chargeLc = candLc.template prong0_as<aod::TracksWDcaExtra>().sign() + candLc.template prong1_as<aod::TracksWDcaExtra>().sign() + candLc.template prong2_as<aod::TracksWDcaExtra>().sign();
237237
int chargeSoftPi = trackSoftPi.sign();
238238
int8_t chargeSigmac = chargeLc + chargeSoftPi;
239-
if (std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::chargeNull && std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::chargePlusPlus) {
239+
if (std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::ChargeNull && std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::ChargePlusPlus) {
240240
/// this shall never happen
241241
LOG(fatal) << ">>> Sc candidate with charge +1 built, not possible! Charge Lc: " << chargeLc << ", charge soft pion: " << chargeSoftPi;
242242
}
@@ -451,7 +451,7 @@ struct HfCandidateSigmac0plusplusMc {
451451

452452
/// skip immediately the candidate Σc0,++ w/o a Λc+ matched to MC
453453
auto candLc = candSigmac.prongLc_as<LambdacMc>();
454-
if (!(std::abs(candLc.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { /// (*)
454+
if (!(std::abs(candLc.flagMcMatchRec()) == BIT(aod::hf_cand_3prong::DecayType::LcToPKPi))) { /// (*)
455455
rowMCMatchScRec(flag, origin, -1.f, 0);
456456
continue;
457457
}
@@ -462,7 +462,7 @@ struct HfCandidateSigmac0plusplusMc {
462462
candLc.prong2_as<aod::TracksWMc>(),
463463
candSigmac.prong1_as<aod::TracksWMc>()};
464464
chargeSigmac = candSigmac.charge();
465-
if (chargeSigmac == o2::aod::hf_cand_sigmac::chargeNull) {
465+
if (chargeSigmac == o2::aod::hf_cand_sigmac::ChargeNull) {
466466
/// candidate Σc0
467467
/// 3 levels:
468468
/// 1. Σc0 → Λc+ π-,+
@@ -472,18 +472,18 @@ struct HfCandidateSigmac0plusplusMc {
472472
/// look for Σc0(2455)
473473
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaC0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3);
474474
if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC
475-
flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi);
475+
flag = sign * BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi);
476476
}
477477

478478
/// look for Σc0(2520)
479479
if (flag == 0) {
480480
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCStar0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3);
481481
if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC
482-
flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi);
482+
flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi);
483483
}
484484
}
485485

486-
} else if (std::abs(chargeSigmac) == o2::aod::hf_cand_sigmac::chargePlusPlus) {
486+
} else if (std::abs(chargeSigmac) == o2::aod::hf_cand_sigmac::ChargePlusPlus) {
487487
/// candidate Σc++
488488
/// 3 levels:
489489
/// 1. Σc0 → Λc+ π-,+
@@ -493,14 +493,14 @@ struct HfCandidateSigmac0plusplusMc {
493493
/// look for Σc++(2455)
494494
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3);
495495
if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC
496-
flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi);
496+
flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi);
497497
}
498498

499499
/// look for Σc++(2520)
500500
if (flag == 0) {
501501
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCStarPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3);
502502
if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC
503-
flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi);
503+
flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi);
504504
}
505505
}
506506
}
@@ -554,7 +554,7 @@ struct HfCandidateSigmac0plusplusMc {
554554
continue;
555555
if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) {
556556
/// Λc+ daughter decaying in pK-π+ found!
557-
flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi);
557+
flag = sign * BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi);
558558
break;
559559
}
560560
}
@@ -566,7 +566,7 @@ struct HfCandidateSigmac0plusplusMc {
566566
continue;
567567
if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) {
568568
/// Λc+ daughter decaying in pK-π+ found!
569-
flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi);
569+
flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi);
570570
break;
571571
}
572572
}
@@ -582,7 +582,7 @@ struct HfCandidateSigmac0plusplusMc {
582582
continue;
583583
if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) {
584584
/// Λc+ daughter decaying in pK-π+ found!
585-
flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi);
585+
flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi);
586586
break;
587587
}
588588
}
@@ -594,7 +594,7 @@ struct HfCandidateSigmac0plusplusMc {
594594
continue;
595595
if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) {
596596
/// Λc+ daughter decaying in pK-π+ found!
597-
flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi);
597+
flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi);
598598
break;
599599
}
600600
}

0 commit comments

Comments
 (0)