Skip to content

Commit f948dfa

Browse files
committed
Merge branch 'master' of github.com:m-rasa/O2Physics
2 parents f57a814 + e4c37c3 commit f948dfa

222 files changed

Lines changed: 13175 additions & 5749 deletions

File tree

Some content is hidden

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

‎ALICE3/TableProducer/alice3-correlatorDDbar.cxx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ struct alice3correlatorddbar {
8989
Configurable<std::vector<double>> binsPt{"binsPt", std::vector<double>{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"};
9090
Configurable<std::vector<double>> efficiencyD{"efficiencyD", std::vector<double>{efficiencyDmeson_v}, "Efficiency values for D0 meson"};
9191

92-
// HfHelper hfHelper; //not needed for now
93-
9492
Partition<soa::Join<aod::Alice3D0Meson, aod::Alice3D0Sel>> selectedCandidates = aod::a3D0meson::y > -yCandMax&& aod::a3D0meson::y<yCandMax && aod::a3D0meson::pt> ptCandMin && (aod::a3D0Selection::isSelD0 >= selectionFlagD0 || aod::a3D0Selection::isSelD0bar >= selectionFlagD0bar);
9593
Partition<soa::Join<aod::Alice3D0Meson, aod::Alice3D0Sel, aod::Alice3D0MCTruth>> selectedCandidatesMC = aod::a3D0meson::y > -yCandMax&& aod::a3D0meson::y<yCandMax && aod::a3D0meson::pt> ptCandMin && (aod::a3D0Selection::isSelD0 >= selectionFlagD0 || aod::a3D0Selection::isSelD0bar >= selectionFlagD0bar);
9694

‎ALICE3/TableProducer/alice3HfSelector3Prong.cxx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ struct Alice3HfSelector3Prong {
9393
Configurable<int64_t> timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"};
9494
Configurable<bool> loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"};
9595

96-
HfHelperAlice3 hfHelper;
9796
o2::analysis::HfMlResponse3Prong<float> mlResponse;
9897
o2::ccdb::CcdbApi ccdbApi;
9998

@@ -236,7 +235,7 @@ struct Alice3HfSelector3Prong {
236235
template <CharmHadAlice3 CharmHad, bool SwapHypo, typename TCandidate>
237236
bool selectionCandidateMass(int const ptBin, const TCandidate& cand)
238237
{
239-
const float massCand = hfHelper.getCandMass<CharmHad, SwapHypo>(cand);
238+
const float massCand = HfHelperAlice3::getCandMass<CharmHad, SwapHypo>(cand);
240239
// cut on mass window
241240
if (std::abs(massCand - MassReference) > cuts->get(ptBin, "m")) {
242241
return false;

‎ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,6 @@ struct Alice3HfTreeCreator3Prong {
272272
Configurable<float> downSampleFactor{"downSampleFactor", 1., "Fraction of cands to keep"};
273273
Configurable<float> ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"};
274274

275-
HfHelperAlice3 hfHelper;
276-
277275
using CandsLcRec = soa::Filtered<soa::Join<aod::Alice3Cand3Ps, aod::Alice3Sel3Ps, aod::Alice3PidLcs, aod::Alice3McRecFlags>>;
278276
using CandsLcRecWMl = soa::Filtered<soa::Join<aod::Alice3Cand3Ps, aod::Alice3Sel3Ps, aod::Alice3PidLcs, aod::Alice3Ml3Ps, aod::Alice3McRecFlags>>;
279277
using CandsMcGen = soa::Join<aod::McParticles, aod::Alice3McGenFlags>;
@@ -399,7 +397,7 @@ struct Alice3HfTreeCreator3Prong {
399397
rowCandKine3Ps(
400398
cand.ptProng0(), cand.ptProng1(), cand.ptProng2(),
401399
cand.pt(), RecoDecay::p(cand.px(), cand.py(), cand.pz()), cand.eta(), cand.phi(),
402-
hfHelper.getCandMass<CharmHad, IsSwapMassHypo>(cand), hfHelper.getCandY<CharmHad>(cand), hfHelper.getCandEnergy<CharmHad>(cand));
400+
HfHelperAlice3::getCandMass<CharmHad, IsSwapMassHypo>(cand), HfHelperAlice3::getCandY<CharmHad>(cand), HfHelperAlice3::getCandEnergy<CharmHad>(cand));
403401
}
404402
if (fillTables.fillDaugKineInfo) {
405403
rowDaugMoms(
@@ -442,7 +440,7 @@ struct Alice3HfTreeCreator3Prong {
442440
{
443441
for (const auto& part : parts) {
444442
if (fillTables.fillCandGenKineInfo) {
445-
rowCand3PGen(part.pt(), part.eta(), part.phi(), hfHelper.getCandY<CharmHad>(part));
443+
rowCand3PGen(part.pt(), part.eta(), part.phi(), HfHelperAlice3::getCandY<CharmHad>(part));
446444
}
447445
if (fillTables.fillMcMatchGenInfo) {
448446
rowCand3PMcMatchGen(part.flagMcGen(), part.originMcGen());

‎ALICE3/Tasks/alice3HfTask3Prong.cxx‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ struct Alice3HfTask3Prong {
5858
Configurable<std::string> ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"};
5959
Configurable<std::string> ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"};
6060

61-
HfHelperAlice3 hfHelper;
6261
SliceCache cache;
6362
Service<o2::ccdb::BasicCCDBManager> ccdb;
6463

@@ -271,7 +270,7 @@ struct Alice3HfTask3Prong {
271270
for (const auto& candidate : candidates) {
272271
registry.fill(HIST("MC/rec/hCandidateCounter"), 1.);
273272
/// rapidity selection
274-
if (yCandRecoMax >= 0. && std::abs(hfHelper.getCandY<CharmHad>(candidate)) > yCandRecoMax) {
273+
if (yCandRecoMax >= 0. && std::abs(HfHelperAlice3::getCandY<CharmHad>(candidate)) > yCandRecoMax) {
275274
continue;
276275
}
277276
registry.fill(HIST("MC/rec/hCandidateCounter"), 2.);
@@ -311,7 +310,7 @@ struct Alice3HfTask3Prong {
311310

312311
if (candidate.isSelMassHypo0()) {
313312
registry.fill(HIST("hSelectionStatus"), 0., pt);
314-
double mass = hfHelper.getCandMass<CharmHad, false>(candidate);
313+
double mass = HfHelperAlice3::getCandMass<CharmHad, false>(candidate);
315314
/// Fill histograms
316315
fillHistogramsRecSig<CharmHad, SignalClasses::Signal>(candidate, mass, false);
317316
if (originType == RecoDecay::OriginType::Prompt) {
@@ -334,7 +333,7 @@ struct Alice3HfTask3Prong {
334333
if (fillSwapMassHypo) {
335334
if (candidate.isSelMassHypo1()) {
336335
registry.fill(HIST("hSelectionStatus"), 1., pt);
337-
double mass = hfHelper.getCandMass<CharmHad, true>(candidate);
336+
double mass = HfHelperAlice3::getCandMass<CharmHad, true>(candidate);
338337
/// Fill histograms
339338
fillHistogramsRecSig<CharmHad, SignalClasses::Signal>(candidate, mass, true);
340339
if (originType == RecoDecay::OriginType::Prompt) {
@@ -357,12 +356,12 @@ struct Alice3HfTask3Prong {
357356
}
358357
} else { // Background
359358
if (candidate.isSelMassHypo0()) {
360-
double mass = hfHelper.getCandMass<CharmHad, false>(candidate);
359+
double mass = HfHelperAlice3::getCandMass<CharmHad, false>(candidate);
361360
fillHistogramsRecSig<CharmHad, SignalClasses::Bkg>(candidate, mass, false);
362361
}
363362
if (fillSwapMassHypo) {
364363
if (candidate.isSelMassHypo1()) {
365-
double mass = hfHelper.getCandMass<CharmHad, true>(candidate);
364+
double mass = HfHelperAlice3::getCandMass<CharmHad, true>(candidate);
366365
fillHistogramsRecSig<CharmHad, SignalClasses::Bkg>(candidate, mass, true);
367366
}
368367
}
@@ -385,10 +384,10 @@ struct Alice3HfTask3Prong {
385384
static constexpr auto histoSuffix = HIST("Gen") + HIST(SignalSuffixes[SignalType]);
386385
registry.fill(histoPrefix + HIST("hPt") + histoSuffix, particle.pt());
387386
registry.fill(histoPrefix + HIST("hEta") + histoSuffix, particle.eta());
388-
registry.fill(histoPrefix + HIST("hY") + histoSuffix, hfHelper.getCandY<CharmHad>(particle));
387+
registry.fill(histoPrefix + HIST("hY") + histoSuffix, HfHelperAlice3::getCandY<CharmHad>(particle));
389388
registry.fill(histoPrefix + HIST("hPhi") + histoSuffix, particle.phi());
390389
registry.fill(histoPrefix + HIST("hEtaVsPt") + histoSuffix, particle.eta(), particle.pt());
391-
registry.fill(histoPrefix + HIST("hYVsPt") + histoSuffix, hfHelper.getCandY<CharmHad>(particle), particle.pt());
390+
registry.fill(histoPrefix + HIST("hYVsPt") + histoSuffix, HfHelperAlice3::getCandY<CharmHad>(particle), particle.pt());
392391
registry.fill(histoPrefix + HIST("hPhiVsPt") + histoSuffix, particle.phi(), particle.pt());
393392
if (particle.has_daughters()) {
394393
const auto firstDauIdx = particle.daughtersIds().front();
@@ -424,7 +423,7 @@ struct Alice3HfTask3Prong {
424423
// MC gen.
425424
for (const auto& particle : mcParticles) {
426425
if (std::abs(particle.flagMcGen()) == selectedPdg) {
427-
double yGen = hfHelper.getCandY<CharmHad>(particle);
426+
double yGen = HfHelperAlice3::getCandY<CharmHad>(particle);
428427
if (yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) {
429428
continue;
430429
}

‎ALICE3/Tasks/alice3TrackingPerformance.cxx‎

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <TString.h>
3636

3737
#include <algorithm>
38+
#include <cstdlib>
3839
#include <map>
3940
#include <memory>
4041
#include <string>
@@ -46,9 +47,20 @@ using namespace o2::framework;
4647
struct Alice3TrackingPerformance {
4748
Configurable<std::vector<int>> pdgCodes{"pdgCodes", {211}, "List of signed PDG codes to consider for performance evaluation"};
4849
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
49-
ConfigurableAxis ptAxis{"ptAxis", {500, 0, 100}, "#it{p}_{T} (GeV/#it{c})"};
50-
ConfigurableAxis etaAxis{"etaAxis", {100, -5.f, 5.f}, "#eta"};
51-
ConfigurableAxis invPtDeltaAxis{"invPtDeltaAxis", {1000, -0.1f, 0.1f}, "1./#it{p}_{T}^{gen} - 1./#it{p}_{T}^{reco} (GeV/#it{c})^{-1}"};
50+
struct : ConfigurableGroup {
51+
std::string prefix = "Axes"; // JSON group name
52+
ConfigurableAxis ptAxis{"ptAxis", {500, 0, 100}, "#it{p}_{T} (GeV/#it{c})"};
53+
ConfigurableAxis etaAxis{"etaAxis", {100, -5.f, 5.f}, "#eta"};
54+
ConfigurableAxis invPtDeltaAxis{"invPtDeltaAxis", {1000, -0.1f, 0.1f}, "1./#it{p}_{T}^{gen} - 1./#it{p}_{T}^{reco} (GeV/#it{c})^{-1}"};
55+
ConfigurableAxis dcaAxis{"dcaAxis", {1000, -0.1f, 0.1f}, "DCA (cm)"};
56+
} settingsAxes;
57+
58+
struct : ConfigurableGroup {
59+
std::string prefix = "Selections"; // JSON group name
60+
Configurable<float> vtxSelX{"vtxSelX", -1.f, "Vertex selection in X (cm), if negative no selection is applied"};
61+
Configurable<float> vtxSelY{"vtxSelY", -1.f, "Vertex selection in Y (cm), if negative no selection is applied"};
62+
Configurable<float> vtxSelZ{"vtxSelZ", -1.f, "Vertex selection in Z (cm), if negative no selection is applied"};
63+
} settingsSelections;
5264

5365
// Histograms
5466
std::shared_ptr<TH1> particlePdgCodes;
@@ -75,8 +87,11 @@ struct Alice3TrackingPerformance {
7587
pdgCodes.value.push_back(0);
7688
}
7789
const AxisSpec axisPtDelta{100, -1, 1, "(#it{p}_{T}^{reco} - #it{p}_{T}^{gen}) / #it{p}_{T}^{gen}"};
78-
const AxisSpec axisDcaXy{100, -1, 1, "DCA_{xy} (cm)"};
79-
const AxisSpec axisDcaZ{100, -1, 1, "DCA_{z} (cm)"};
90+
const AxisSpec axisPt{settingsAxes.ptAxis, "#it{p}_{T} (GeV/#it{c})"};
91+
const AxisSpec axisInvPt{settingsAxes.invPtDeltaAxis, "1/#it{p}_{T} (GeV/#it{c})^{-1}"};
92+
const AxisSpec axisEta{settingsAxes.etaAxis, "#eta"};
93+
const AxisSpec axisDcaXy{settingsAxes.dcaAxis, "DCA_{xy} (cm)"};
94+
const AxisSpec axisDcaZ{settingsAxes.dcaAxis, "DCA_{z} (cm)"};
8095
const AxisSpec axisCovariancePtPt{100, 0, 10, "cov(#it{p}_{T}, #it{p}_{T}) ((GeV/#it{c})^{2})"};
8196
const AxisSpec axisCovarianceDcaXyDcaXy{100, 0, 1, "cov(DCA_{xy}, DCA_{xy}) (cm^{2})"};
8297
const AxisSpec axisCovarianceDcaZDcaZ{100, 0, 1, "cov(DCA_{z}, DCA_{z}) (cm^{2})"};
@@ -90,25 +105,26 @@ struct Alice3TrackingPerformance {
90105
const std::string tag = "_" + prefix;
91106
prefix += "/";
92107
auto histoName = [&](const std::string& name) { return Form("%s%s%s", prefix.c_str(), name.c_str(), tag.c_str()); };
93-
particlePtDistribution[pdg] = histos.add<TH1>(histoName("particlePtDistribution"), "", kTH1D, {ptAxis});
108+
particlePtDistribution[pdg] = histos.add<TH1>(histoName("particlePtDistribution"), "", kTH1D, {axisPt});
94109
LOG(info) << "Added histogram: " << histoName("particlePtDistribution");
95-
particleEtaDistribution[pdg] = histos.add<TH1>(histoName("particleEtaDistribution"), "", kTH1D, {etaAxis});
96-
97-
ptDistribution[pdg] = histos.add<TH1>(histoName("ptDistribution"), "", kTH1D, {ptAxis});
98-
ptResolutionVsPt[pdg] = histos.add<TH2>(histoName("ptResolutionVsPt"), "", kTH2D, {ptAxis, axisPtDelta});
99-
ptResolutionVsEta[pdg] = histos.add<TProfile2D>(histoName("ptResolutionVsEta"), "", kTProfile2D, {ptAxis, etaAxis});
100-
invPtResolutionVsPt[pdg] = histos.add<TH2>(histoName("invPtResolutionVsPt"), "", kTH2D, {ptAxis, invPtDeltaAxis});
101-
invPtResolutionVsEta[pdg] = histos.add<TProfile2D>(histoName("invPtResolutionVsEta"), "", kTProfile2D, {ptAxis, etaAxis});
102-
dcaXyResolutionVsPt[pdg] = histos.add<TH2>(histoName("dcaXyResolutionVsPt"), "", kTH2D, {ptAxis, axisDcaXy});
103-
dcaZResolutionVsPt[pdg] = histos.add<TH2>(histoName("dcaZResolutionVsPt"), "", kTH2D, {ptAxis, axisDcaZ});
104-
covariancePtPtVsPt[pdg] = histos.add<TH2>(histoName("covariancePtPtVsPt"), "", kTH2D, {ptAxis, axisCovariancePtPt});
105-
covarianceDcaXyDcaXyVsPt[pdg] = histos.add<TH2>(histoName("covarianceDcaXyDcaXyVsPt"), "", kTH2D, {ptAxis, axisCovarianceDcaXyDcaXy});
106-
covarianceDcaZDcaZVsPt[pdg] = histos.add<TH2>(histoName("covarianceDcaZDcaZVsPt"), "", kTH2D, {ptAxis, axisCovarianceDcaZDcaZ});
110+
particleEtaDistribution[pdg] = histos.add<TH1>(histoName("particleEtaDistribution"), "", kTH1D, {axisEta});
111+
112+
ptDistribution[pdg] = histos.add<TH1>(histoName("ptDistribution"), "", kTH1D, {axisPt});
113+
ptResolutionVsPt[pdg] = histos.add<TH2>(histoName("ptResolutionVsPt"), "", kTH2D, {axisPt, axisPtDelta});
114+
ptResolutionVsEta[pdg] = histos.add<TProfile2D>(histoName("ptResolutionVsEta"), "", kTProfile2D, {axisPt, axisEta});
115+
invPtResolutionVsPt[pdg] = histos.add<TH2>(histoName("invPtResolutionVsPt"), "", kTH2D, {axisPt, axisInvPt});
116+
invPtResolutionVsEta[pdg] = histos.add<TProfile2D>(histoName("invPtResolutionVsEta"), "", kTProfile2D, {axisPt, axisEta});
117+
dcaXyResolutionVsPt[pdg] = histos.add<TH2>(histoName("dcaXyResolutionVsPt"), "", kTH2D, {axisPt, axisDcaXy});
118+
dcaZResolutionVsPt[pdg] = histos.add<TH2>(histoName("dcaZResolutionVsPt"), "", kTH2D, {axisPt, axisDcaZ});
119+
covariancePtPtVsPt[pdg] = histos.add<TH2>(histoName("covariancePtPtVsPt"), "", kTH2D, {axisPt, axisCovariancePtPt});
120+
covarianceDcaXyDcaXyVsPt[pdg] = histos.add<TH2>(histoName("covarianceDcaXyDcaXyVsPt"), "", kTH2D, {axisPt, axisCovarianceDcaXyDcaXy});
121+
covarianceDcaZDcaZVsPt[pdg] = histos.add<TH2>(histoName("covarianceDcaZDcaZVsPt"), "", kTH2D, {axisPt, axisCovarianceDcaZDcaZ});
107122
}
108123
}
109124

110125
void process(soa::Join<aod::Tracks, o2::aod::TracksCov, o2::aod::McTrackLabels, o2::aod::TracksDCA, o2::aod::TracksDCACov> const& tracks,
111-
aod::McParticles const& mcParticles)
126+
aod::McParticles const& mcParticles,
127+
aod::McCollisions const&)
112128
{
113129
auto isParticleSelected = [&](const o2::aod::McParticle& p) {
114130
if (!p.isPhysicalPrimary()) {
@@ -119,6 +135,18 @@ struct Alice3TrackingPerformance {
119135
};
120136

121137
for (const auto& mcParticle : mcParticles) {
138+
// Selecting collisions
139+
const auto& collision = mcParticle.mcCollision();
140+
if (settingsSelections.vtxSelX >= 0.f && std::abs(collision.posX()) > settingsSelections.vtxSelX) {
141+
continue;
142+
}
143+
if (settingsSelections.vtxSelY >= 0.f && std::abs(collision.posY()) > settingsSelections.vtxSelY) {
144+
continue;
145+
}
146+
if (settingsSelections.vtxSelZ >= 0.f && std::abs(collision.posZ()) > settingsSelections.vtxSelZ) {
147+
continue;
148+
}
149+
122150
particlePdgCodes->Fill(Form("%d", mcParticle.pdgCode()), 1);
123151
if (!isParticleSelected(mcParticle)) {
124152
continue;

‎Common/Core/FFitWeights.cxx‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ void FFitWeights::init()
8686
fW_data->Add(new TProfile("pMeanPt", "", centBin, 0, centBin));
8787
fW_data->Add(new TH2D("hPtWeight", "", centBin, 0, centBin, ptBin, ptAxis->GetXmin(), ptAxis->GetXmax()));
8888

89-
ptProfCent = reinterpret_cast<TProfile*>(fW_data->FindObject("pMeanPt"));
90-
h2ptCent = reinterpret_cast<TH2D*>(fW_data->FindObject("hPtWeight"));
89+
ptProfCent = dynamic_cast<TProfile*>(fW_data->FindObject("pMeanPt"));
90+
h2ptCent = dynamic_cast<TH2D*>(fW_data->FindObject("hPtWeight"));
9191
};
9292

9393
void FFitWeights::fillWeights(float centrality, float qn, int nh, const char* pf)
@@ -98,10 +98,10 @@ void FFitWeights::fillWeights(float centrality, float qn, int nh, const char* pf
9898
if (!tar)
9999
return;
100100

101-
TH2D* th2 = reinterpret_cast<TH2D*>(tar->FindObject(this->getQName(nh, pf)));
101+
TH2D* th2 = dynamic_cast<TH2D*>(tar->FindObject(this->getQName(nh, pf)));
102102
if (!th2) {
103103
tar->Add(new TH2D(this->getQName(nh, pf), this->getAxisName(nh, pf), centBin, 0, centBin, qAxis->GetNbins(), qAxis->GetXmin(), qAxis->GetXmax()));
104-
th2 = reinterpret_cast<TH2D*>(tar->At(tar->GetEntries() - 1));
104+
th2 = dynamic_cast<TH2D*>(tar->At(tar->GetEntries() - 1));
105105
}
106106
th2->Fill(centrality, qn);
107107
};
@@ -117,7 +117,7 @@ void FFitWeights::fillPt(float centrality, float pt, float weight, bool first)
117117
float FFitWeights::getPtMult(float centrality)
118118
{
119119
if (!ptProfCent) {
120-
ptProfCent = reinterpret_cast<TProfile*>(fW_data->FindObject("pMeanPt"));
120+
ptProfCent = dynamic_cast<TProfile*>(fW_data->FindObject("pMeanPt"));
121121
}
122122
return ptProfCent->GetBinContent(ptProfCent->FindBin(centrality));
123123
};
@@ -132,7 +132,7 @@ Long64_t FFitWeights::Merge(TCollection* collist)
132132
}
133133
FFitWeights* lW = 0;
134134
TIter allW(collist);
135-
while ((lW = (reinterpret_cast<FFitWeights*>(allW())))) {
135+
while ((lW = (dynamic_cast<FFitWeights*>(allW())))) {
136136
addArray(fW_data, lW->getDataArray());
137137
nmerged++;
138138
}
@@ -150,7 +150,7 @@ void FFitWeights::addArray(TObjArray* targ, TObjArray* sour)
150150

151151
auto* tObj = targ->FindObject(obj->GetName());
152152
if (!tObj) {
153-
auto* clone = static_cast<TObject*>(obj->Clone(obj->GetName()));
153+
auto* clone = obj->Clone(obj->GetName());
154154
if (auto* h = dynamic_cast<TH1*>(clone))
155155
h->SetDirectory(0);
156156
targ->Add(clone);
@@ -168,7 +168,7 @@ void FFitWeights::mptSel()
168168
if (!tar)
169169
return;
170170

171-
TH2D* th2 = reinterpret_cast<TH2D*>(tar->FindObject("hPtWeight"));
171+
TH2D* th2 = dynamic_cast<TH2D*>(tar->FindObject("hPtWeight"));
172172
if (!th2) {
173173
return;
174174
}
@@ -198,7 +198,7 @@ void FFitWeights::qSelection(const std::vector<int>& nhv, const std::vector<std:
198198

199199
for (const auto& pf : stv) {
200200
for (const auto& nh : nhv) {
201-
TH2D* th2{reinterpret_cast<TH2D*>(tar->FindObject(this->getQName(nh, pf.c_str())))};
201+
TH2D* th2{dynamic_cast<TH2D*>(tar->FindObject(this->getQName(nh, pf.c_str())))};
202202
if (!th2) {
203203
LOGF(info, "FFitWeights qh not found!");
204204
return;

‎Common/Core/PID/PIDTOFParamService.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ struct TOFSupport : o2::framework::ServicePlugin {
298298
},
299299
.configure = CommonServices::noConfiguration(),
300300
.exit = [](ServiceRegistryRef, void* service) {
301-
auto* resp = reinterpret_cast<o2::pid::tof::TOFResponse*>(service);
301+
auto* resp = static_cast<o2::pid::tof::TOFResponse*>(service);
302302
delete resp; },
303303
.kind = ServiceKind::Serial};
304304
}

0 commit comments

Comments
 (0)