Skip to content

Commit 38f5715

Browse files
committed
Use namespace where useful
1 parent 44d55eb commit 38f5715

26 files changed

+270
-244
lines changed

EventFiltering/PWGHF/HFFilter.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
using namespace o2;
4545
using namespace o2::analysis;
4646
using namespace o2::aod::hffilters;
47+
using namespace o2::constants::physics;
4748
using namespace o2::framework;
4849
using namespace o2::framework::expressions;
4950

@@ -423,7 +424,7 @@ struct HfFilter { // Main struct for HF triggers
423424
auto pt2Prong = RecoDecay::pt(pVec2Prong);
424425

425426
if (applyOptimisation) {
426-
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2]);
427+
optimisationTreeCharm(thisCollId, Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2]);
427428
}
428429

429430
auto selD0 = helper.isSelectedD0InMassRange(pVecPos, pVecNeg, pt2Prong, preselD0, activateQA, hMassVsPtC[kD0]);
@@ -469,7 +470,7 @@ struct HfFilter { // Main struct for HF triggers
469470
keepEvent[kBeauty3P] = true;
470471
// fill optimisation tree for D0
471472
if (applyOptimisation) {
472-
optimisationTreeBeauty(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], dcaThird[0]);
473+
optimisationTreeBeauty(thisCollId, Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], dcaThird[0]);
473474
}
474475
if (activateQA) {
475476
hMassVsPtB[kBplus]->Fill(ptCand, massCand);
@@ -530,7 +531,7 @@ struct HfFilter { // Main struct for HF triggers
530531
if (isProton) {
531532
float relativeMomentum = helper.computeRelativeMomentum(pVecThird, pVec2Prong, massD0);
532533
if (applyOptimisation) {
533-
optimisationTreeFemto(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr());
534+
optimisationTreeFemto(thisCollId, Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr());
534535
}
535536
if (relativeMomentum < femtoMaxRelativeMomentum) {
536537
keepEvent[kFemto2P] = true;
@@ -758,25 +759,25 @@ struct HfFilter { // Main struct for HF triggers
758759
if (is3Prong[0]) {
759760
is3ProngInMass[0] = helper.isSelectedDplusInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, activateQA, hMassVsPtC[kDplus]);
760761
if (applyOptimisation) {
761-
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kDPlus, pt3Prong, scoresToFill[0][0], scoresToFill[0][1], scoresToFill[0][2]);
762+
optimisationTreeCharm(thisCollId, Pdg::kDPlus, pt3Prong, scoresToFill[0][0], scoresToFill[0][1], scoresToFill[0][2]);
762763
}
763764
}
764765
if (is3Prong[1]) {
765766
is3ProngInMass[1] = helper.isSelectedDsInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[1], activateQA, hMassVsPtC[kDs]);
766767
if (applyOptimisation) {
767-
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kDS, pt3Prong, scoresToFill[1][0], scoresToFill[1][1], scoresToFill[1][2]);
768+
optimisationTreeCharm(thisCollId, Pdg::kDS, pt3Prong, scoresToFill[1][0], scoresToFill[1][1], scoresToFill[1][2]);
768769
}
769770
}
770771
if (is3Prong[2]) {
771772
is3ProngInMass[2] = helper.isSelectedLcInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[2], activateQA, hMassVsPtC[kLc]);
772773
if (applyOptimisation) {
773-
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kLambdaCPlus, pt3Prong, scoresToFill[2][0], scoresToFill[2][1], scoresToFill[2][2]);
774+
optimisationTreeCharm(thisCollId, Pdg::kLambdaCPlus, pt3Prong, scoresToFill[2][0], scoresToFill[2][1], scoresToFill[2][2]);
774775
}
775776
}
776777
if (is3Prong[3]) {
777778
is3ProngInMass[3] = helper.isSelectedXicInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[3], activateQA, hMassVsPtC[kXic]);
778779
if (applyOptimisation) {
779-
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kXiCPlus, pt3Prong, scoresToFill[3][0], scoresToFill[3][1], scoresToFill[3][2]);
780+
optimisationTreeCharm(thisCollId, Pdg::kXiCPlus, pt3Prong, scoresToFill[3][0], scoresToFill[3][1], scoresToFill[3][2]);
780781
}
781782
}
782783

@@ -807,7 +808,7 @@ struct HfFilter { // Main struct for HF triggers
807808
getPxPyPz(trackParFourth, pVecFourth);
808809
}
809810

810-
int charmParticleID[kNBeautyParticles - 2] = {o2::constants::physics::Pdg::kDPlus, o2::constants::physics::Pdg::kDS, o2::constants::physics::Pdg::kLambdaCPlus, o2::constants::physics::Pdg::kXiCPlus};
811+
int charmParticleID[kNBeautyParticles - 2] = {Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus, Pdg::kXiCPlus};
811812

812813
float massCharmHypos[kNBeautyParticles - 2] = {massDPlus, massDs, massLc, massXic};
813814
float massBeautyHypos[kNBeautyParticles - 2] = {massB0, massBs, massLb, massXib};

EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
using namespace o2;
4141
using namespace o2::analysis;
4242
using namespace o2::aod::hffilters;
43+
using namespace o2::constants::physics;
4344
using namespace o2::framework;
4445
using namespace o2::framework::expressions;
4546

@@ -122,7 +123,7 @@ struct HfFilterPrepareMlSamples { // Main struct
122123

123124
// D0(bar) → π± K∓
124125
bool isInCorrectColl{false};
125-
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg}, o2::constants::physics::Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign);
126+
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg}, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign);
126127
if (indexRec > -1) {
127128
auto particle = mcParticles.rawIteratorAt(indexRec);
128129
flag = RecoDecay::getCharmHadronOrigin(mcParticles, particle);
@@ -203,27 +204,27 @@ struct HfFilterPrepareMlSamples { // Main struct
203204
int8_t channel = -1;
204205

205206
// D± → π± K∓ π±
206-
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
207+
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
207208
if (indexRec >= 0) {
208209
channel = kDplus;
209210
}
210211
if (indexRec < 0) {
211212
// Ds± → K± K∓ π±
212-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
213+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
213214
if (indexRec >= 0) {
214215
channel = kDs;
215216
}
216217
}
217218
if (indexRec < 0) {
218219
// Λc± → p± K∓ π±
219-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
220+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
220221
if (indexRec >= 0) {
221222
channel = kLc;
222223
}
223224
}
224225
if (indexRec < 0) {
225226
// Ξc± → p± K∓ π±
226-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
227+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
227228
if (indexRec >= 0) {
228229
channel = kXic;
229230
}

PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
using namespace o2;
3232
using namespace o2::analysis;
3333
using namespace o2::aod;
34+
using namespace o2::constants::physics;
3435
using namespace o2::framework;
3536
using namespace o2::framework::expressions;
3637

@@ -80,7 +81,7 @@ struct HfCandidateCreatorChic {
8081

8182
void init(InitContext const&)
8283
{
83-
massJpsi = o2::constants::physics::MassJPsi;
84+
massJpsi = MassJPsi;
8485
}
8586

8687
void process(aod::Collision const& collision,
@@ -244,19 +245,19 @@ struct HfCandidateCreatorChicMc {
244245
auto arrayJpsiDaughters = std::array{daughterPosJpsi, daughterNegJpsi};
245246

246247
// chi_c → J/ψ gamma
247-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, o2::constants::physics::Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true);
248+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true);
248249
if (indexRec > -1) {
249250
hMassJpsiToMuMuMatched->Fill(hfHelper.invMassJpsiToMuMu(candidate.prong0()));
250251

251-
int indexMother = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(indexRec), o2::constants::physics::Pdg::kChiC1);
252-
int indexMotherGamma = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(candidate.prong1().mcparticleId()), o2::constants::physics::Pdg::kChiC1);
252+
int indexMother = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(indexRec), Pdg::kChiC1);
253+
int indexMotherGamma = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(candidate.prong1().mcparticleId()), Pdg::kChiC1);
253254
if (indexMother > -1 && indexMotherGamma == indexMother && candidate.prong1().mcparticle().pdgCode() == kGamma) {
254255
auto particleMother = mcParticles.rawIteratorAt(indexMother);
255256
hEphotonMatched->Fill(candidate.prong1().e());
256257
hMassEMatched->Fill(sqrt(candidate.prong1().px() * candidate.prong1().px() + candidate.prong1().py() * candidate.prong1().py() + candidate.prong1().pz() * candidate.prong1().pz()));
257258
if (particleMother.has_daughters()) {
258259
std::vector<int> arrAllDaughtersIndex;
259-
RecoDecay::getDaughters(particleMother, &arrAllDaughtersIndex, std::array{static_cast<int>(kGamma), static_cast<int>(o2::constants::physics::Pdg::kJPsi)}, 1);
260+
RecoDecay::getDaughters(particleMother, &arrAllDaughtersIndex, std::array{static_cast<int>(kGamma), static_cast<int>(Pdg::kJPsi)}, 1);
260261
if (arrAllDaughtersIndex.size() == 2) {
261262
flag = 1 << hf_cand_chic::DecayType::ChicToJpsiToMuMuGamma;
262263
hMassChicToJpsiToMuMuGammaMatched->Fill(hfHelper.invMassChicToJpsiGamma(candidate));
@@ -278,17 +279,17 @@ struct HfCandidateCreatorChicMc {
278279
channel = 0;
279280

280281
// chi_c → J/ψ gamma
281-
if (RecoDecay::isMatchedMCGen(mcParticles, particle, o2::constants::physics::Pdg::kChiC1, std::array{static_cast<int>(o2::constants::physics::Pdg::kJPsi), static_cast<int>(kGamma)}, true)) {
282+
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kChiC1, std::array{static_cast<int>(Pdg::kJPsi), static_cast<int>(kGamma)}, true)) {
282283
// Match J/psi --> e+e-
283284
std::vector<int> arrDaughter;
284-
RecoDecay::getDaughters(particle, &arrDaughter, std::array{static_cast<int>(o2::constants::physics::Pdg::kJPsi)}, 1);
285+
RecoDecay::getDaughters(particle, &arrDaughter, std::array{static_cast<int>(Pdg::kJPsi)}, 1);
285286
auto jpsiCandMC = mcParticles.rawIteratorAt(arrDaughter[0]);
286-
if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, o2::constants::physics::Pdg::kJPsi, std::array{+kElectron, -kElectron}, true)) {
287+
if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true)) {
287288
flag = 1 << hf_cand_chic::DecayType::ChicToJpsiToEEGamma;
288289
}
289290

290291
if (flag == 0) {
291-
if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, o2::constants::physics::Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) {
292+
if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) {
292293
flag = 1 << hf_cand_chic::DecayType::ChicToJpsiToMuMuGamma;
293294
}
294295
}

PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
using namespace o2;
3232
using namespace o2::analysis;
3333
using namespace o2::aod;
34+
using namespace o2::constants::physics;
3435
using namespace o2::framework;
3536
using namespace o2::framework::expressions;
3637

@@ -80,8 +81,8 @@ struct HfCandidateCreatorX {
8081

8182
void init(InitContext const&)
8283
{
83-
massPi = o2::constants::physics::MassPiPlus;
84-
massJpsi = o2::constants::physics::MassJPsi;
84+
massPi = MassPiPlus;
85+
massJpsi = MassJPsi;
8586
}
8687

8788
void process(aod::Collision const& collision,
@@ -276,8 +277,8 @@ struct HfCandidateCreatorXMc {
276277
aod::McParticles const& mcParticles)
277278
{
278279
int indexRec = -1;
279-
int pdgCodeX = o2::constants::physics::Pdg::kX3872;
280-
int pdgCodeJpsi = o2::constants::physics::Pdg::kJPsi;
280+
int pdgCodeX = Pdg::kX3872;
281+
int pdgCodeJpsi = Pdg::kJPsi;
281282
int8_t sign = 0;
282283
int8_t flag = 0;
283284
int8_t origin = 0;
@@ -300,7 +301,7 @@ struct HfCandidateCreatorXMc {
300301
// X → J/ψ π+ π−
301302

302303
// J/ψ → e+ e−
303-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, o2::constants::physics::Pdg::kJPsi, std::array{+kElectron, -kElectron}, true);
304+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true);
304305
// X → π+ π− e+ e−
305306
if (indexRec > -1) {
306307
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgCodeX, std::array{+kPiPlus, -kPiPlus, +kElectron, -kElectron}, true, &sign, 2);
@@ -311,7 +312,7 @@ struct HfCandidateCreatorXMc {
311312

312313
// J/ψ → μ+ μ−
313314
if (flag == 0) {
314-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, o2::constants::physics::Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true);
315+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true);
315316
// X → π+ π− μ+ μ−
316317
if (indexRec > -1) {
317318
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgCodeX, std::array{+kPiPlus, -kPiPlus, +kMuonPlus, -kMuonPlus}, true, &sign, 2);

PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
using namespace o2;
3838
using namespace o2::analysis;
3939
using namespace o2::aod;
40+
using namespace o2::constants::physics;
4041
using namespace o2::framework;
4142
using namespace o2::framework::expressions;
4243

@@ -162,9 +163,9 @@ struct HfDataCreatorD0PiReduced {
162163
runNumber = 0;
163164

164165
// invariant-mass window cut
165-
massPi = o2::constants::physics::MassPiPlus;
166-
massD0 = o2::constants::physics::MassD0;
167-
massBplus = o2::constants::physics::MassBPlus;
166+
massPi = MassPiPlus;
167+
massD0 = MassD0;
168+
massBplus = MassBPlus;
168169
invMass2D0PiMin = (massBplus - invMassWindowD0Pi) * (massBplus - invMassWindowD0Pi);
169170
invMass2D0PiMax = (massBplus + invMassWindowD0Pi) * (massBplus + invMassWindowD0Pi);
170171
}
@@ -348,18 +349,18 @@ struct HfDataCreatorD0PiReduced {
348349
int8_t flag{0};
349350
// B+ → D0(bar) π+ → (K+ π-) π+
350351
// Printf("Checking B+ → D0bar π+");
351-
auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersBplus, o2::constants::physics::Pdg::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2);
352+
auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersBplus, Pdg::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2);
352353
if (indexRec > -1) {
353354
// D0bar → K+ π-
354355
// Printf("Checking D0bar → K+ π-");
355-
indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersD0, o2::constants::physics::Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1);
356+
indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersD0, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1);
356357
if (indexRec > -1) {
357358
flag = sign * BIT(hf_cand_bplus::DecayType::BplusToD0Pi);
358359
} else {
359360
LOGF(info, "WARNING: B+ decays in the expected final state but the condition on the intermediate state is not fulfilled");
360361
}
361362
}
362-
auto indexMother = RecoDecay::getMother(particlesMc, trackPion.template mcParticle_as<P>(), o2::constants::physics::Pdg::kBPlus, true);
363+
auto indexMother = RecoDecay::getMother(particlesMc, trackPion.template mcParticle_as<P>(), Pdg::kBPlus, true);
363364
auto particleMother = particlesMc.rawIteratorAt(indexMother);
364365

365366
rowHfD0PiMcRecReduced(indexHfCand2Prong, selectedTracksPion[trackPion.globalIndex()], flag, particleMother.pt());
@@ -405,11 +406,11 @@ struct HfDataCreatorD0PiReduced {
405406
int8_t sign{0};
406407
int8_t flag{0};
407408
// B+ → D0bar π+
408-
if (RecoDecay::isMatchedMCGen(particlesMc, particle, o2::constants::physics::Pdg::kBPlus, std::array{static_cast<int>(o2::constants::physics::Pdg::kD0), +kPiPlus}, true)) {
409+
if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kBPlus, std::array{static_cast<int>(Pdg::kD0), +kPiPlus}, true)) {
409410
// Match D0bar -> π- K+
410411
auto candD0MC = particlesMc.rawIteratorAt(particle.daughtersIds().front());
411412
// Printf("Checking D0bar -> π- K+");
412-
if (RecoDecay::isMatchedMCGen(particlesMc, candD0MC, static_cast<int>(o2::constants::physics::Pdg::kD0), std::array{+kPiPlus, -kKPlus}, true, &sign)) {
413+
if (RecoDecay::isMatchedMCGen(particlesMc, candD0MC, static_cast<int>(Pdg::kD0), std::array{+kPiPlus, -kKPlus}, true, &sign)) {
413414
flag = sign * BIT(hf_cand_bplus::DecayType::BplusToD0Pi);
414415
}
415416
}

0 commit comments

Comments
 (0)