Skip to content

Commit 019dc62

Browse files
authored
PWGJE: Remove RecoDecay::getMassPDG (#3695)
* PWGJE: Remove RecoDecay::getMassPDG * Fix loops * Remove unnecessary includes of RecoDecay
1 parent a0a7bbb commit 019dc62

9 files changed

Lines changed: 18 additions & 27 deletions

PWGJE/TableProducer/jetfinder.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "Common/Core/TrackSelectionDefaults.h"
3131
#include "Common/DataModel/EventSelection.h"
3232
#include "Common/DataModel/TrackSelectionTables.h"
33-
#include "Common/Core/RecoDecay.h"
33+
#include "Common/Core/RecoDecay.h" // FIXME: Remove RecoDecay::getMassPDG
3434
#include "PWGJE/DataModel/EMCALClusters.h"
3535

3636
#include "PWGHF/Core/SelectorCuts.h"
@@ -120,13 +120,13 @@ void analyseClusters(std::vector<fastjet::PseudoJet>& inputParticles, T const& c
120120
template <typename T>
121121
bool analyseCandidate(std::vector<fastjet::PseudoJet>& inputParticles, int candPDG, float candPtMin, float candPtMax, float candYMin, float candYMax, T const& candidate)
122122
{
123-
if (candidate.y(RecoDecay::getMassPDG(candPDG)) < candYMin || candidate.y(RecoDecay::getMassPDG(candPDG)) > candYMax) {
123+
if (candidate.y(RecoDecay::getMassPDG(candPDG)) < candYMin || candidate.y(RecoDecay::getMassPDG(candPDG)) > candYMax) { // FIXME: Remove RecoDecay::getMassPDG
124124
return false;
125125
}
126126
if (candidate.pt() < candPtMin || candidate.pt() >= candPtMax) {
127127
return false;
128128
}
129-
FastJetUtilities::fillTracks(candidate, inputParticles, candidate.globalIndex(), static_cast<int>(JetConstituentStatus::candidateHF), RecoDecay::getMassPDG(candPDG));
129+
FastJetUtilities::fillTracks(candidate, inputParticles, candidate.globalIndex(), static_cast<int>(JetConstituentStatus::candidateHF), RecoDecay::getMassPDG(candPDG)); // FIXME: Remove RecoDecay::getMassPDG
130130
return true;
131131
}
132132

@@ -234,7 +234,7 @@ void analyseParticles(std::vector<fastjet::PseudoJet>& inputParticles, std::stri
234234
continue;
235235
}
236236
}
237-
FastJetUtilities::fillTracks(particle, inputParticles, particle.globalIndex(), static_cast<int>(JetConstituentStatus::track), RecoDecay::getMassPDG(particle.pdgCode()));
237+
FastJetUtilities::fillTracks(particle, inputParticles, particle.globalIndex(), static_cast<int>(JetConstituentStatus::track), pdgParticle->Mass());
238238
}
239239
}
240240

PWGJE/TableProducer/jetfinderhf.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// Authors: Nima Zardoshti, Jochen Klein
1515

1616
#include "PWGJE/TableProducer/jetfinder.h"
17+
#include "Common/Core/RecoDecay.h"
1718

1819
using namespace o2;
1920
using namespace o2::analysis;
@@ -201,7 +202,7 @@ struct JetFinderHFTask {
201202

202203
for (auto const& particle : particles) {
203204
if (std::abs(particle.flagMcMatchGen()) & (1 << candDecay)) {
204-
auto particleY = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()));
205+
auto particleY = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, pdg->Mass(particle.pdgCode()));
205206
if (particleY < candYMin || particleY > candYMax) {
206207
continue;
207208
}
@@ -213,7 +214,7 @@ struct JetFinderHFTask {
213214
}
214215
for (auto& candidate : candidates) {
215216
analyseParticles(inputParticles, particleSelection, jetTypeParticleLevel, particles, pdg->Instance(), std::optional{candidate});
216-
FastJetUtilities::fillTracks(candidate, inputParticles, candidate.globalIndex(), static_cast<int>(JetConstituentStatus::candidateHF), RecoDecay::getMassPDG(candidate.pdgCode()));
217+
FastJetUtilities::fillTracks(candidate, inputParticles, candidate.globalIndex(), static_cast<int>(JetConstituentStatus::candidateHF), pdg->Mass(candidate.pdgCode()));
217218
findJets(jetFinder, inputParticles, jetRadius, collision, jetsTable, constituentsTable, constituentsSubTable, DoConstSub, true);
218219
}
219220
}

PWGJE/Tasks/jetTutorial.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#include "Common/DataModel/EventSelection.h"
2525
#include "Common/DataModel/TrackSelectionTables.h"
2626

27-
#include "Common/Core/RecoDecay.h"
28-
2927
#include "PWGJE/Core/FastJetUtilities.h"
3028
#include "PWGJE/DataModel/Jet.h"
3129

PWGJE/Tasks/jetTutorialSkeleton.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#include "Common/DataModel/EventSelection.h"
2525
#include "Common/DataModel/TrackSelectionTables.h"
2626

27-
#include "Common/Core/RecoDecay.h"
28-
2927
#include "PWGJE/Core/FastJetUtilities.h"
3028
#include "PWGJE/DataModel/Jet.h"
3129

PWGJE/Tasks/jetfinderQA.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#include "Common/DataModel/EventSelection.h"
2525
#include "Common/DataModel/TrackSelectionTables.h"
2626

27-
#include "Common/Core/RecoDecay.h"
28-
2927
#include "PWGJE/Core/FastJetUtilities.h"
3028
#include "PWGJE/Core/JetFinder.h"
3129
#include "PWGJE/DataModel/Jet.h"

PWGJE/Tasks/jetfinderhfQA.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "Common/DataModel/EventSelection.h"
2626
#include "Common/DataModel/TrackSelectionTables.h"
2727

28-
#include "Common/Core/RecoDecay.h"
28+
#include "PWGHF/Core/PDG.h"
2929

3030
#include "PWGHF/Core/HfHelper.h"
3131
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
@@ -237,7 +237,7 @@ struct JetFinderHFQATask {
237237
registry.fill(HIST("h3_jet_r_jet_pt_candidate_pt"), jet.r() / 100.0, jet.pt(), hfcandidate.pt(), weight);
238238
registry.fill(HIST("h3_jet_r_jet_pt_candidate_eta"), jet.r() / 100.0, jet.pt(), hfcandidate.eta(), weight);
239239
registry.fill(HIST("h3_jet_r_jet_pt_candidate_phi"), jet.r() / 100.0, jet.pt(), hfcandidate.phi(), weight);
240-
registry.fill(HIST("h3_jet_r_jet_pt_candidate_y"), jet.r() / 100.0, jet.pt(), hfcandidate.y(RecoDecay::getMassPDG(421)), weight);
240+
registry.fill(HIST("h3_jet_r_jet_pt_candidate_y"), jet.r() / 100.0, jet.pt(), hfcandidate.y(o2::analysis::pdg::MassD0), weight);
241241

242242
if (jet.r() == round(selectedJetsRadius * 100.0f)) {
243243
if constexpr (std::is_same_v<std::decay_t<U>, soa::Join<aod::HfCand2Prong, aod::HfSelD0>> || std::is_same_v<std::decay_t<U>, soa::Join<aod::HfCand2Prong, aod::HfSelD0, aod::HfCand2ProngMcRec>>) {
@@ -322,7 +322,7 @@ struct JetFinderHFQATask {
322322
mcdCandPt = hfcandidate_mcd.pt();
323323
mcdCandPhi = hfcandidate_mcd.phi();
324324
mcdCandEta = hfcandidate_mcd.eta();
325-
mcdCandY = hfcandidate_mcd.y(RecoDecay::getMassPDG(421));
325+
mcdCandY = hfcandidate_mcd.y(o2::analysis::pdg::MassD0);
326326
}
327327

328328
for (auto& hfcandidate_mcp : mcpjet.template hfcandidates_as<std::decay_t<O>>()) {
@@ -474,12 +474,12 @@ struct JetFinderHFQATask {
474474
registry.fill(HIST("h3_jet_r_jet_pt_candidate_pt_MB"), jet.r() / 100.0, jet.pt(), hfcandidate.pt());
475475
registry.fill(HIST("h3_jet_r_jet_pt_candidate_eta_MB"), jet.r() / 100.0, jet.pt(), hfcandidate.eta());
476476
registry.fill(HIST("h3_jet_r_jet_pt_candidate_phi_MB"), jet.r() / 100.0, jet.pt(), hfcandidate.phi());
477-
registry.fill(HIST("h3_jet_r_jet_pt_candidate_y_MB"), jet.r() / 100.0, jet.pt(), hfcandidate.y(RecoDecay::getMassPDG(421)));
477+
registry.fill(HIST("h3_jet_r_jet_pt_candidate_y_MB"), jet.r() / 100.0, jet.pt(), hfcandidate.y(o2::analysis::pdg::MassD0));
478478
if (collision.hasJetChHighPt() >= 1) {
479479
registry.fill(HIST("h3_jet_r_jet_pt_candidate_pt_Triggered"), jet.r() / 100.0, jet.pt(), hfcandidate.pt());
480480
registry.fill(HIST("h3_jet_r_jet_pt_candidate_eta_Triggered"), jet.r() / 100.0, jet.pt(), hfcandidate.eta());
481481
registry.fill(HIST("h3_jet_r_jet_pt_candidate_phi_Triggered"), jet.r() / 100.0, jet.pt(), hfcandidate.phi());
482-
registry.fill(HIST("h3_jet_r_jet_pt_candidate_y_Triggered"), jet.r() / 100.0, jet.pt(), hfcandidate.y(RecoDecay::getMassPDG(421)));
482+
registry.fill(HIST("h3_jet_r_jet_pt_candidate_y_Triggered"), jet.r() / 100.0, jet.pt(), hfcandidate.y(o2::analysis::pdg::MassD0));
483483
}
484484
}
485485
}

PWGJE/Tasks/jetsubstructure.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@
2020
#include "Framework/AnalysisTask.h"
2121
#include "Framework/AnalysisDataModel.h"
2222
#include "Framework/ASoA.h"
23-
#include "TDatabasePDG.h"
23+
#include "Framework/O2DatabasePDGPlugin.h"
2424

2525
#include "Common/Core/TrackSelection.h"
2626
#include "Common/Core/TrackSelectionDefaults.h"
2727
#include "Common/DataModel/EventSelection.h"
2828
#include "Common/DataModel/TrackSelectionTables.h"
2929

30-
#include "Common/Core/RecoDecay.h"
31-
3230
#include "PWGJE/DataModel/Jet.h"
3331
#include "PWGJE/DataModel/JetSubstructure.h"
3432
#include "PWGJE/Core/JetFinder.h"
@@ -50,6 +48,7 @@ struct JetSubstructureTask {
5048
Configurable<float> zCut{"zCut", 0.1, "soft drop z cut"};
5149
Configurable<float> beta{"beta", 0.0, "soft drop beta"};
5250

51+
Service<o2::framework::O2DatabasePDG> pdg;
5352
std::vector<fastjet::PseudoJet> jetConstituents;
5453
std::vector<fastjet::PseudoJet> jetReclustered;
5554
JetFinder jetReclusterer;
@@ -123,7 +122,7 @@ struct JetSubstructureTask {
123122
{
124123
jetConstituents.clear();
125124
for (auto& jetConstituent : jet.template tracks_as<aod::McParticles>()) {
126-
FastJetUtilities::fillTracks(jetConstituent, jetConstituents, jetConstituent.globalIndex(), static_cast<int>(JetConstituentStatus::track), RecoDecay::getMassPDG(jetConstituent.pdgCode()));
125+
FastJetUtilities::fillTracks(jetConstituent, jetConstituents, jetConstituent.globalIndex(), static_cast<int>(JetConstituentStatus::track), pdg->Mass(jetConstituent.pdgCode()));
127126
}
128127
jetReclustering(jet);
129128
}

PWGJE/Tasks/jetsubstructurehf.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "Framework/AnalysisDataModel.h"
2222
#include "Framework/ASoA.h"
2323
#include "Framework/O2DatabasePDGPlugin.h"
24-
#include "TDatabasePDG.h"
2524

2625
#include "Common/Core/TrackSelection.h"
2726
#include "Common/Core/TrackSelectionDefaults.h"
@@ -144,7 +143,7 @@ struct JetSubstructureHFTask {
144143
FastJetUtilities::fillTracks(jetConstituent, jetConstituents, jetConstituent.globalIndex());
145144
}
146145
for (auto& jetHFCandidate : jet.template hfcandidates_as<CandidateTable>()) { // should only be one at the moment
147-
FastJetUtilities::fillTracks(jetHFCandidate, jetConstituents, jetHFCandidate.globalIndex(), static_cast<int>(JetConstituentStatus::candidateHF), RecoDecay::getMassPDG(candPDG));
146+
FastJetUtilities::fillTracks(jetHFCandidate, jetConstituents, jetHFCandidate.globalIndex(), static_cast<int>(JetConstituentStatus::candidateHF), pdg->Mass(candPDG));
148147
}
149148
jetReclustering(jet);
150149
}
@@ -155,10 +154,10 @@ struct JetSubstructureHFTask {
155154
{
156155
jetConstituents.clear();
157156
for (auto& jetConstituent : jet.template tracks_as<aod::McParticles>()) {
158-
FastJetUtilities::fillTracks(jetConstituent, jetConstituents, jetConstituent.globalIndex(), static_cast<int>(JetConstituentStatus::track), RecoDecay::getMassPDG(jetConstituent.pdgCode()));
157+
FastJetUtilities::fillTracks(jetConstituent, jetConstituents, jetConstituent.globalIndex(), static_cast<int>(JetConstituentStatus::track), pdg->Mass(jetConstituent.pdgCode()));
159158
}
160159
for (auto& jetHFCandidate : jet.template hfcandidates_as<aod::McParticles>()) { // should only be one at the moment
161-
FastJetUtilities::fillTracks(jetHFCandidate, jetConstituents, jetHFCandidate.globalIndex(), static_cast<int>(JetConstituentStatus::candidateHF), RecoDecay::getMassPDG(jetHFCandidate.pdgCode()));
160+
FastJetUtilities::fillTracks(jetHFCandidate, jetConstituents, jetHFCandidate.globalIndex(), static_cast<int>(JetConstituentStatus::candidateHF), pdg->Mass(jetHFCandidate.pdgCode()));
162161
}
163162
jetReclustering(jet);
164163
}

PWGJE/Tasks/triggerCorrelations.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include "Common/DataModel/TrackSelectionTables.h"
2929
#include "Common/CCDB/TriggerAliases.h"
3030

31-
#include "Common/Core/RecoDecay.h"
32-
3331
#include "PWGJE/Core/FastJetUtilities.h"
3432
#include "PWGJE/DataModel/EMCALClusters.h"
3533
#include "PWGJE/Core/JetFinder.h"

0 commit comments

Comments
 (0)