Skip to content

Commit 1c8d1c4

Browse files
authored
Unify headers with mass constants (#3976)
1 parent 0869b6f commit 1c8d1c4

File tree

107 files changed

+716
-911
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+716
-911
lines changed

EventFiltering/PWGHF/HFFilter.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include <onnxruntime/core/session/experimental_onnxruntime_cxx_api.h> // needed for HFFilterHelpers, to be fixed
2323

24+
#include "CommonConstants/PhysicsConstants.h"
2425
#include "CCDB/BasicCCDBManager.h"
2526
#include "DataFormatsParameters/GRPMagField.h"
2627
#include "DataFormatsParameters/GRPObject.h"
@@ -422,7 +423,7 @@ struct HfFilter { // Main struct for HF triggers
422423
auto pt2Prong = RecoDecay::pt(pVec2Prong);
423424

424425
if (applyOptimisation) {
425-
optimisationTreeCharm(thisCollId, pdg::Code::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2]);
426+
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2]);
426427
}
427428

428429
auto selD0 = helper.isSelectedD0InMassRange(pVecPos, pVecNeg, pt2Prong, preselD0, activateQA, hMassVsPtC[kD0]);
@@ -468,7 +469,7 @@ struct HfFilter { // Main struct for HF triggers
468469
keepEvent[kBeauty3P] = true;
469470
// fill optimisation tree for D0
470471
if (applyOptimisation) {
471-
optimisationTreeBeauty(thisCollId, pdg::Code::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], dcaThird[0]);
472+
optimisationTreeBeauty(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], dcaThird[0]);
472473
}
473474
if (activateQA) {
474475
hMassVsPtB[kBplus]->Fill(ptCand, massCand);
@@ -529,7 +530,7 @@ struct HfFilter { // Main struct for HF triggers
529530
if (isProton) {
530531
float relativeMomentum = helper.computeRelativeMomentum(pVecThird, pVec2Prong, massD0);
531532
if (applyOptimisation) {
532-
optimisationTreeFemto(thisCollId, pdg::Code::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr());
533+
optimisationTreeFemto(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr());
533534
}
534535
if (relativeMomentum < femtoMaxRelativeMomentum) {
535536
keepEvent[kFemto2P] = true;
@@ -757,25 +758,25 @@ struct HfFilter { // Main struct for HF triggers
757758
if (is3Prong[0]) {
758759
is3ProngInMass[0] = helper.isSelectedDplusInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, activateQA, hMassVsPtC[kDplus]);
759760
if (applyOptimisation) {
760-
optimisationTreeCharm(thisCollId, pdg::Code::kDPlus, pt3Prong, scoresToFill[0][0], scoresToFill[0][1], scoresToFill[0][2]);
761+
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kDPlus, pt3Prong, scoresToFill[0][0], scoresToFill[0][1], scoresToFill[0][2]);
761762
}
762763
}
763764
if (is3Prong[1]) {
764765
is3ProngInMass[1] = helper.isSelectedDsInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[1], activateQA, hMassVsPtC[kDs]);
765766
if (applyOptimisation) {
766-
optimisationTreeCharm(thisCollId, pdg::Code::kDS, pt3Prong, scoresToFill[1][0], scoresToFill[1][1], scoresToFill[1][2]);
767+
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kDS, pt3Prong, scoresToFill[1][0], scoresToFill[1][1], scoresToFill[1][2]);
767768
}
768769
}
769770
if (is3Prong[2]) {
770771
is3ProngInMass[2] = helper.isSelectedLcInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[2], activateQA, hMassVsPtC[kLc]);
771772
if (applyOptimisation) {
772-
optimisationTreeCharm(thisCollId, pdg::Code::kLambdaCPlus, pt3Prong, scoresToFill[2][0], scoresToFill[2][1], scoresToFill[2][2]);
773+
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kLambdaCPlus, pt3Prong, scoresToFill[2][0], scoresToFill[2][1], scoresToFill[2][2]);
773774
}
774775
}
775776
if (is3Prong[3]) {
776777
is3ProngInMass[3] = helper.isSelectedXicInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[3], activateQA, hMassVsPtC[kXic]);
777778
if (applyOptimisation) {
778-
optimisationTreeCharm(thisCollId, pdg::Code::kXiCPlus, pt3Prong, scoresToFill[3][0], scoresToFill[3][1], scoresToFill[3][2]);
779+
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kXiCPlus, pt3Prong, scoresToFill[3][0], scoresToFill[3][1], scoresToFill[3][2]);
779780
}
780781
}
781782

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

809-
int charmParticleID[kNBeautyParticles - 2] = {pdg::Code::kDPlus, pdg::Code::kDS, pdg::Code::kLambdaCPlus, pdg::Code::kXiCPlus};
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};
810811

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

EventFiltering/PWGHF/HFFilterHelpers.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -134,25 +134,25 @@ static const std::tuple pdgCharmDaughters{
134134
std::array{2212, -321, 211}, // Lc
135135
std::array{2212, -321, 211}}; // Xic
136136

137-
constexpr float massPi = o2::analysis::pdg::MassPiPlus;
138-
constexpr float massKa = o2::analysis::pdg::MassKPlus;
139-
constexpr float massProton = o2::analysis::pdg::MassProton;
140-
constexpr float massGamma = o2::analysis::pdg::MassGamma;
141-
constexpr float massK0S = o2::analysis::pdg::MassK0Short;
142-
constexpr float massLambda = o2::analysis::pdg::MassLambda0;
143-
constexpr float massXi = o2::analysis::pdg::MassXiMinus;
144-
constexpr float massPhi = o2::analysis::pdg::MassPhi;
145-
constexpr float massD0 = o2::analysis::pdg::MassD0;
146-
constexpr float massDPlus = o2::analysis::pdg::MassDPlus;
147-
constexpr float massDs = o2::analysis::pdg::MassDS;
148-
constexpr float massLc = o2::analysis::pdg::MassLambdaCPlus;
149-
constexpr float massXic = o2::analysis::pdg::MassXiCPlus;
150-
constexpr float massDStar = o2::analysis::pdg::MassDStar;
151-
constexpr float massBPlus = o2::analysis::pdg::MassBPlus;
152-
constexpr float massB0 = o2::analysis::pdg::MassB0;
153-
constexpr float massBs = o2::analysis::pdg::MassBS;
154-
constexpr float massLb = o2::analysis::pdg::MassLambdaB0;
155-
constexpr float massXib = o2::analysis::pdg::MassXiB0;
137+
constexpr float massPi = o2::constants::physics::MassPiPlus;
138+
constexpr float massKa = o2::constants::physics::MassKPlus;
139+
constexpr float massProton = o2::constants::physics::MassProton;
140+
constexpr float massGamma = o2::constants::physics::MassGamma;
141+
constexpr float massK0S = o2::constants::physics::MassK0Short;
142+
constexpr float massLambda = o2::constants::physics::MassLambda0;
143+
constexpr float massXi = o2::constants::physics::MassXiMinus;
144+
constexpr float massPhi = o2::constants::physics::MassPhi;
145+
constexpr float massD0 = o2::constants::physics::MassD0;
146+
constexpr float massDPlus = o2::constants::physics::MassDPlus;
147+
constexpr float massDs = o2::constants::physics::MassDS;
148+
constexpr float massLc = o2::constants::physics::MassLambdaCPlus;
149+
constexpr float massXic = o2::constants::physics::MassXiCPlus;
150+
constexpr float massDStar = o2::constants::physics::MassDStar;
151+
constexpr float massBPlus = o2::constants::physics::MassBPlus;
152+
constexpr float massB0 = o2::constants::physics::MassB0;
153+
constexpr float massBs = o2::constants::physics::MassBS;
154+
constexpr float massLb = o2::constants::physics::MassLambdaB0;
155+
constexpr float massXib = o2::constants::physics::MassXiB0;
156156

157157
static const o2::framework::AxisSpec ptAxis{50, 0.f, 50.f};
158158
static const o2::framework::AxisSpec pAxis{50, 0.f, 10.f};

EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <onnxruntime/core/session/experimental_onnxruntime_cxx_api.h> // needed for HFFilterHelpers, to be fixed
2222

23+
#include "CommonConstants/PhysicsConstants.h"
2324
#include "CCDB/BasicCCDBManager.h"
2425
#include "DataFormatsParameters/GRPMagField.h"
2526
#include "DataFormatsParameters/GRPObject.h"
@@ -121,7 +122,7 @@ struct HfFilterPrepareMlSamples { // Main struct
121122

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

204205
// D± → π± K∓ π±
205-
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
206+
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
206207
if (indexRec >= 0) {
207208
channel = kDplus;
208209
}
209210
if (indexRec < 0) {
210211
// Ds± → K± K∓ π±
211-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
212+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
212213
if (indexRec >= 0) {
213214
channel = kDs;
214215
}
215216
}
216217
if (indexRec < 0) {
217218
// Λc± → p± K∓ π±
218-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
219+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
219220
if (indexRec >= 0) {
220221
channel = kLc;
221222
}
222223
}
223224
if (indexRec < 0) {
224225
// Ξc± → p± K∓ π±
225-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
226+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
226227
if (indexRec >= 0) {
227228
channel = kXic;
228229
}

EventFiltering/PWGLF/filterf1proton.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "Common/DataModel/Multiplicity.h"
3737
#include "Common/DataModel/PIDResponse.h"
3838
#include "PWGLF/DataModel/LFStrangenessTables.h"
39-
#include "PWGHF/Core/PDG.h"
39+
#include "CommonConstants/PhysicsConstants.h"
4040
#include "DataFormatsTPC/BetheBlochAleph.h"
4141
#include "CCDB/BasicCCDBManager.h"
4242
#include "CCDB/CcdbApi.h"
@@ -316,7 +316,7 @@ struct filterf1proton {
316316
const float dcaDaughv0 = candidate.dcaV0daughters();
317317
const float cpav0 = candidate.v0cosPA();
318318

319-
float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short;
319+
float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short;
320320
float lowmasscutks0 = 0.497 - 2.0 * cSigmaMassKs0;
321321
float highmasscutks0 = 0.497 + 2.0 * cSigmaMassKs0;
322322

@@ -390,10 +390,10 @@ struct filterf1proton {
390390

391391
std::vector<double> BBProton, BBAntiproton, BBPion, BBAntipion, BBKaon, BBAntikaon;
392392
ROOT::Math::PtEtaPhiMVector F1Vector, KKs0Vector;
393-
double massPi = o2::analysis::pdg::MassPiPlus;
394-
double massKa = o2::analysis::pdg::MassKPlus;
393+
double massPi = o2::constants::physics::MassPiPlus;
394+
double massKa = o2::constants::physics::MassKPlus;
395395
double massPr = o2::constants::physics::MassProton;
396-
double massK0s = o2::analysis::pdg::MassK0Short;
396+
double massK0s = o2::constants::physics::MassK0Short;
397397
double massF1{0.};
398398
double masskKs0{0.};
399399
double pT{0.};

0 commit comments

Comments
 (0)