1616#include " Framework/ASoA.h"
1717#include " Framework/AnalysisDataModel.h"
1818#include " Framework/AnalysisTask.h"
19- #include " Framework/O2DatabasePDGPlugin.h"
2019#include " Framework/HistogramRegistry.h"
21- #include " TDatabasePDG .h"
20+ #include " Framework/runDataProcessing .h"
2221
2322#include " Common/Core/TrackSelection.h"
2423#include " Common/Core/TrackSelectionDefaults.h"
2524#include " Common/DataModel/EventSelection.h"
2625#include " Common/DataModel/TrackSelectionTables.h"
2726
28- #include " PWGHF/Core/PDG.h"
29-
3027#include " PWGHF/Core/HfHelper.h"
3128#include " PWGHF/DataModel/CandidateReconstructionTables.h"
3229#include " PWGHF/DataModel/CandidateSelectionTables.h"
30+ #include " PWGHF/Core/PDG.h"
3331
3432#include " PWGJE/DataModel/Jet.h"
3533
3634#include " EventFiltering/filterTables.h"
3735
3836using namespace o2 ;
37+ using namespace o2 ::analysis;
3938using namespace o2 ::framework;
4039using namespace o2 ::framework::expressions;
4140
42- #include " Framework/runDataProcessing.h"
43-
4441template <typename JetTableData, typename JetConstituentTableData, typename CandidateTableData, typename JetTableMCD, typename JetConstituentTableMCD, typename JetMatchingTableMCDMCP, typename JetTableMCDWeighted, typename CandidateTableMCD, typename JetTableMCP, typename JetConstituentTableMCP, typename JetMatchingTableMCPMCD, typename JetTableMCPWeighted, typename ParticleTableMCP>
4542struct JetFinderHFQATask {
4643 HistogramRegistry registry;
@@ -64,8 +61,21 @@ struct JetFinderHFQATask {
6461 std::vector<bool > filledJetR;
6562 std::vector<double > jetRadiiValues;
6663
64+ double candMass;
65+
6766 void init (o2::framework::InitContext&)
6867 {
68+
69+ if constexpr (std::is_same_v<std::decay_t <CandidateTableData>, soa::Join<aod::HfCand2Prong, aod::HfSelD0>>) { // Note : need to be careful if configurable workflow options are added later
70+ candMass = pdg::MassD0;
71+ }
72+ if constexpr (std::is_same_v<std::decay_t <CandidateTableData>, soa::Join<aod::HfCand3Prong, aod::HfSelLc>>) {
73+ candMass = pdg::MassLambdaCPlus;
74+ }
75+ if constexpr (std::is_same_v<std::decay_t <CandidateTableData>, soa::Join<aod::HfCandBplus, aod::HfSelBplusToD0Pi>>) {
76+ candMass = pdg::MassBPlus;
77+ }
78+
6979 trackSelection = static_cast <std::string>(trackSelections);
7080 jetRadiiValues = (std::vector<double >)jetRadii;
7181
@@ -237,7 +247,7 @@ struct JetFinderHFQATask {
237247 registry.fill (HIST (" h3_jet_r_jet_pt_candidate_pt" ), jet.r () / 100.0 , jet.pt (), hfcandidate.pt (), weight);
238248 registry.fill (HIST (" h3_jet_r_jet_pt_candidate_eta" ), jet.r () / 100.0 , jet.pt (), hfcandidate.eta (), weight);
239249 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 (o2::analysis::pdg::MassD0 ), weight);
250+ registry.fill (HIST (" h3_jet_r_jet_pt_candidate_y" ), jet.r () / 100.0 , jet.pt (), hfcandidate.y (candMass ), weight);
241251
242252 if (jet.r () == round (selectedJetsRadius * 100 .0f )) {
243253 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 +332,7 @@ struct JetFinderHFQATask {
322332 mcdCandPt = hfcandidate_mcd.pt ();
323333 mcdCandPhi = hfcandidate_mcd.phi ();
324334 mcdCandEta = hfcandidate_mcd.eta ();
325- mcdCandY = hfcandidate_mcd.y (o2::analysis::pdg::MassD0 );
335+ mcdCandY = hfcandidate_mcd.y (candMass );
326336 }
327337
328338 for (auto & hfcandidate_mcp : mcpjet.template hfcandidates_as <std::decay_t <O>>()) {
@@ -474,12 +484,12 @@ struct JetFinderHFQATask {
474484 registry.fill (HIST (" h3_jet_r_jet_pt_candidate_pt_MB" ), jet.r () / 100.0 , jet.pt (), hfcandidate.pt ());
475485 registry.fill (HIST (" h3_jet_r_jet_pt_candidate_eta_MB" ), jet.r () / 100.0 , jet.pt (), hfcandidate.eta ());
476486 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 (o2::analysis::pdg::MassD0 ));
487+ registry.fill (HIST (" h3_jet_r_jet_pt_candidate_y_MB" ), jet.r () / 100.0 , jet.pt (), hfcandidate.y (candMass ));
478488 if (collision.hasJetChHighPt () >= 1 ) {
479489 registry.fill (HIST (" h3_jet_r_jet_pt_candidate_pt_Triggered" ), jet.r () / 100.0 , jet.pt (), hfcandidate.pt ());
480490 registry.fill (HIST (" h3_jet_r_jet_pt_candidate_eta_Triggered" ), jet.r () / 100.0 , jet.pt (), hfcandidate.eta ());
481491 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 (o2::analysis::pdg::MassD0 ));
492+ registry.fill (HIST (" h3_jet_r_jet_pt_candidate_y_Triggered" ), jet.r () / 100.0 , jet.pt (), hfcandidate.y (candMass ));
483493 }
484494 }
485495 }
0 commit comments