Skip to content

Commit a83f0de

Browse files
authored
[ALICE3] Remove HfHelper instances (#18433)
1 parent df37dd2 commit a83f0de

4 files changed

Lines changed: 11 additions & 17 deletions

File tree

‎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
}

0 commit comments

Comments
 (0)