From 6d5aba860ace41f6c08a878aabc70742f4c63e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:39:22 +0200 Subject: [PATCH] Remove HfHelper instances --- PWGDQ/Core/VarManager.h | 66 ++++++++++++------------ PWGDQ/TableProducer/tableMakerJpsiHf.cxx | 30 +++++------ 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index c83f57daa7c..87464d09990 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -23,6 +23,8 @@ #include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UPCHelpers.h" +// +#include "PWGHF/Core/HfHelper.h" #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" @@ -1562,10 +1564,10 @@ class VarManager : public TObject static void FillDileptonPhoton(T1 const& dilepton, T2 const& photon, float* values = nullptr); template static void FillHadron(T const& hadron, float* values = nullptr, float hadronMass = 0.0f); - template - static void FillSingleDileptonCharmHadron(Cand const& candidate, H hfHelper, T& bdtScoreCharmHad, float* values = nullptr); - template - static void FillDileptonCharmHadron(DQ const& dilepton, HF const& charmHadron, H hfHelper, T& bdtScoreCharmHad, float* values = nullptr); + template + static void FillSingleDileptonCharmHadron(Cand const& candidate, T& bdtScoreCharmHad, float* values = nullptr); + template + static void FillDileptonCharmHadron(DQ const& dilepton, HF const& charmHadron, T& bdtScoreCharmHad, float* values = nullptr); template static void FillQVectorFromGFW(C const& collision, A const& compA11, A const& compB11, A const& compC11, A const& compA21, A const& compB21, A const& compC21, A const& compA31, A const& compB31, A const& compC31, A const& compA41, A const& compB41, A const& compC41, A const& compA23, A const& compA42, float S10A = 1.0, float S10B = 1.0, float S10C = 1.0, float S11A = 1.0, float S11B = 1.0, float S11C = 1.0, float S12A = 1.0, float S13A = 1.0, float S14A = 1.0, float S21A = 1.0, float S22A = 1.0, float S31A = 1.0, float S41A = 1.0, float* values = nullptr); template @@ -3899,12 +3901,12 @@ void VarManager::FillPair(T1 const& t1, T2 const& t2, float* values) } // polarization parameters - bool useHE = fgUsedVars[kCosThetaHE] || fgUsedVars[kPhiHE]; // helicity frame - bool useCS = fgUsedVars[kCosThetaCS] || fgUsedVars[kPhiCS]; // Collins-Soper frame + bool useHE = fgUsedVars[kCosThetaHE] || fgUsedVars[kPhiHE]; // helicity frame + bool useCS = fgUsedVars[kCosThetaCS] || fgUsedVars[kPhiCS]; // Collins-Soper frame bool useGJB1 = fgUsedVars[kCosThetaGJB1] || fgUsedVars[kPhiGJB1]; // Gottfried-Jackson frame, beam 1 (+z) bool useGJB2 = fgUsedVars[kCosThetaGJB2] || fgUsedVars[kPhiGJB2]; // Gottfried-Jackson frame, beam 2 (-z) - bool usePP = fgUsedVars[kCosThetaPP]; // production plane frame - bool useRM = fgUsedVars[kCosThetaRM]; // Random frame + bool usePP = fgUsedVars[kCosThetaPP]; // production plane frame + bool useRM = fgUsedVars[kCosThetaRM]; // Random frame if (useHE || useCS || useGJB1 || useGJB2 || usePP || useRM) { ROOT::Math::Boost boostv12{v12.BoostToCM()}; @@ -4460,12 +4462,12 @@ void VarManager::FillPairME(T1 const& t1, T2 const& t2, float* values) } // polarization parameters - bool useHE = fgUsedVars[kCosThetaHE] || fgUsedVars[kPhiHE]; // helicity frame - bool useCS = fgUsedVars[kCosThetaCS] || fgUsedVars[kPhiCS]; // Collins-Soper frame + bool useHE = fgUsedVars[kCosThetaHE] || fgUsedVars[kPhiHE]; // helicity frame + bool useCS = fgUsedVars[kCosThetaCS] || fgUsedVars[kPhiCS]; // Collins-Soper frame bool useGJB1 = fgUsedVars[kCosThetaGJB1] || fgUsedVars[kPhiGJB1]; // Gottfried-Jackson frame, beam 1 (+z) bool useGJB2 = fgUsedVars[kCosThetaGJB2] || fgUsedVars[kPhiGJB2]; // Gottfried-Jackson frame, beam 2 (-z) - bool usePP = fgUsedVars[kCosThetaPP]; // production plane frame - bool useRM = fgUsedVars[kCosThetaRM]; // Random frame + bool usePP = fgUsedVars[kCosThetaPP]; // production plane frame + bool useRM = fgUsedVars[kCosThetaRM]; // Random frame if (useHE || useCS || useGJB1 || useGJB2 || usePP || useRM) { ROOT::Math::Boost boostv12{v12.BoostToCM()}; @@ -4888,12 +4890,12 @@ void VarManager::FillPairMC(T1 const& t1, T2 const& t2, float* values) values[kMCP2] = t2.p(); // polarization parameters - bool useHE = fgUsedVars[kMCCosThetaHE] || fgUsedVars[kMCPhiHE]; // helicity frame - bool useCS = fgUsedVars[kMCCosThetaCS] || fgUsedVars[kMCPhiCS]; // Collins-Soper frame + bool useHE = fgUsedVars[kMCCosThetaHE] || fgUsedVars[kMCPhiHE]; // helicity frame + bool useCS = fgUsedVars[kMCCosThetaCS] || fgUsedVars[kMCPhiCS]; // Collins-Soper frame bool useGJB1 = fgUsedVars[kMCCosThetaGJB1] || fgUsedVars[kMCPhiGJB1]; // Gottfried-Jackson frame, beam 1 (+z) bool useGJB2 = fgUsedVars[kMCCosThetaGJB2] || fgUsedVars[kMCPhiGJB2]; // Gottfried-Jackson frame, beam 2 (-z) - bool usePP = fgUsedVars[kMCCosThetaPP]; // production plane frame - bool useRM = fgUsedVars[kMCCosThetaRM]; // Random frame + bool usePP = fgUsedVars[kMCCosThetaPP]; // production plane frame + bool useRM = fgUsedVars[kMCCosThetaRM]; // Random frame if (useHE || useCS || useGJB1 || useGJB2 || usePP || useRM) { ROOT::Math::Boost boostv12{v12.BoostToCM()}; @@ -6829,8 +6831,8 @@ void VarManager::FillHadron(T const& hadron, float* values, float hadronMass) values[kRap] = vhadron.Rapidity(); } -template -void VarManager::FillSingleDileptonCharmHadron(Cand const& candidate, H hfHelper, T& bdtScoreCharmHad, float* values) +template +void VarManager::FillSingleDileptonCharmHadron(Cand const& candidate, T& bdtScoreCharmHad, float* values) { if (!values) { values = static_cast(fgValues); @@ -6843,33 +6845,33 @@ void VarManager::FillSingleDileptonCharmHadron(Cand const& candidate, H hfHelper values[kRap] = candidate.rap(); } if constexpr (partType == kD0ToPiK) { - values[kMassCharmHadron] = hfHelper.invMassD0ToPiK(candidate); + values[kMassCharmHadron] = HfHelper::invMassD0ToPiK(candidate); values[kPtCharmHadron] = candidate.pt(); values[kPhiCharmHadron] = candidate.phi(); - values[kRapCharmHadron] = hfHelper.yD0(candidate); + values[kRapCharmHadron] = HfHelper::yD0(candidate); values[kBdtCharmHadron] = static_cast(bdtScoreCharmHad); } if constexpr (partType == kD0barToKPi) { - values[kMassCharmHadron] = hfHelper.invMassD0barToKPi(candidate); + values[kMassCharmHadron] = HfHelper::invMassD0barToKPi(candidate); values[kPtCharmHadron] = candidate.pt(); values[kPhiCharmHadron] = candidate.phi(); - values[kRapCharmHadron] = hfHelper.yD0(candidate); + values[kRapCharmHadron] = HfHelper::yD0(candidate); values[kBdtCharmHadron] = static_cast(bdtScoreCharmHad); } if constexpr (partType == kDplusToPiKPi) { - values[kMassCharmHadron] = hfHelper.invMassDplusToPiKPi(candidate); + values[kMassCharmHadron] = HfHelper::invMassDplusToPiKPi(candidate); values[kPtCharmHadron] = candidate.pt(); values[kPhiCharmHadron] = candidate.phi(); - values[kRapCharmHadron] = hfHelper.yDplus(candidate); + values[kRapCharmHadron] = HfHelper::yDplus(candidate); values[kBdtCharmHadron] = static_cast(bdtScoreCharmHad); } } -template -void VarManager::FillDileptonCharmHadron(DQ const& dilepton, HF const& charmHadron, H hfHelper, T& bdtScoreCharmHad, float* values) +template +void VarManager::FillDileptonCharmHadron(DQ const& dilepton, HF const& charmHadron, T& bdtScoreCharmHad, float* values) { - FillSingleDileptonCharmHadron(dilepton, hfHelper, bdtScoreCharmHad, values); - FillSingleDileptonCharmHadron(charmHadron, hfHelper, bdtScoreCharmHad, values); + FillSingleDileptonCharmHadron(dilepton, bdtScoreCharmHad, values); + FillSingleDileptonCharmHadron(charmHadron, bdtScoreCharmHad, values); } template @@ -7767,12 +7769,12 @@ void VarManager::FillPairAlice3(T1 const& t1, T2 const& t2, float* values) } // polarization parameters - bool useHE = fgUsedVars[kCosThetaHE] || fgUsedVars[kPhiHE]; // helicity frame - bool useCS = fgUsedVars[kCosThetaCS] || fgUsedVars[kPhiCS]; // Collins-Soper frame + bool useHE = fgUsedVars[kCosThetaHE] || fgUsedVars[kPhiHE]; // helicity frame + bool useCS = fgUsedVars[kCosThetaCS] || fgUsedVars[kPhiCS]; // Collins-Soper frame bool useGJB1 = fgUsedVars[kCosThetaGJB1] || fgUsedVars[kPhiGJB1]; // Gottfried-Jackson frame, beam 1 (+z) bool useGJB2 = fgUsedVars[kCosThetaGJB2] || fgUsedVars[kPhiGJB2]; // Gottfried-Jackson frame, beam 2 (-z) - bool usePP = fgUsedVars[kCosThetaPP]; // production plane frame - bool useRM = fgUsedVars[kCosThetaRM]; // Random frame + bool usePP = fgUsedVars[kCosThetaPP]; // production plane frame + bool useRM = fgUsedVars[kCosThetaRM]; // Random frame if (useHE || useCS || useGJB1 || useGJB2 || usePP || useRM) { ROOT::Math::Boost boostv12{v12.BoostToCM()}; diff --git a/PWGDQ/TableProducer/tableMakerJpsiHf.cxx b/PWGDQ/TableProducer/tableMakerJpsiHf.cxx index 59b06e3ef64..65f69e394d9 100644 --- a/PWGDQ/TableProducer/tableMakerJpsiHf.cxx +++ b/PWGDQ/TableProducer/tableMakerJpsiHf.cxx @@ -102,8 +102,6 @@ using TracksWithExtra = soa::Join; using MyBarrelTracksSelectedWithColl = soa::Join; using MyMuonTracksSelectedWithColl = soa::Join; -HfHelper hfHelper; - struct tableMakerJpsiHf { // // This task combines dilepton candidates with a open charm hadron @@ -321,9 +319,9 @@ struct tableMakerJpsiHf { double rapDmeson = -999.; if constexpr (TDmeson == DmesonType::D0) { - rapDmeson = hfHelper.yD0(dmeson); + rapDmeson = HfHelper::yD0(dmeson); } else if constexpr (TDmeson == DmesonType::Dplus) { - rapDmeson = hfHelper.yDplus(dmeson); + rapDmeson = HfHelper::yDplus(dmeson); } if (yCandDmesonMax >= 0. && std::abs(rapDmeson) > yCandDmesonMax) { @@ -332,18 +330,18 @@ struct tableMakerJpsiHf { if constexpr (TDmeson == DmesonType::D0) { if (dmeson.isSelD0() >= 1) { - VarManager::FillSingleDileptonCharmHadron(dmeson, hfHelper, scores[0], fValuesDileptonCharmHadron); + VarManager::FillSingleDileptonCharmHadron(dmeson, scores[0], fValuesDileptonCharmHadron); fHistMan->FillHistClass("Dmeson", fValuesDileptonCharmHadron); VarManager::ResetValues(0, VarManager::kNVars, fValuesDileptonCharmHadron); } if (dmeson.isSelD0bar() >= 1) { - VarManager::FillSingleDileptonCharmHadron(dmeson, hfHelper, scores[3], fValuesDileptonCharmHadron); + VarManager::FillSingleDileptonCharmHadron(dmeson, scores[3], fValuesDileptonCharmHadron); fHistMan->FillHistClass("Dmeson", fValuesDileptonCharmHadron); VarManager::ResetValues(0, VarManager::kNVars, fValuesDileptonCharmHadron); } } else if constexpr (TDmeson == DmesonType::Dplus) { if (dmeson.isSelDplusToPiKPi() >= 1) { - VarManager::FillSingleDileptonCharmHadron(dmeson, hfHelper, scores_dplus[0], fValuesDileptonCharmHadron); + VarManager::FillSingleDileptonCharmHadron(dmeson, scores_dplus[0], fValuesDileptonCharmHadron); fHistMan->FillHistClass("Dmeson", fValuesDileptonCharmHadron); VarManager::ResetValues(0, VarManager::kNVars, fValuesDileptonCharmHadron); } @@ -366,7 +364,7 @@ struct tableMakerJpsiHf { if (configDebug) { float dummyScore{-999.f}; - VarManager::FillSingleDileptonCharmHadron(dilepton, hfHelper, dummyScore, fValuesDileptonCharmHadron); + VarManager::FillSingleDileptonCharmHadron(dilepton, dummyScore, fValuesDileptonCharmHadron); fHistMan->FillHistClass("JPsi", fValuesDileptonCharmHadron); VarManager::ResetValues(0, VarManager::kNVars, fValuesDileptonCharmHadron); } @@ -391,9 +389,9 @@ struct tableMakerJpsiHf { double rapDmeson = -999.; if constexpr (TDmeson == DmesonType::D0) { - rapDmeson = hfHelper.yD0(dmeson); + rapDmeson = HfHelper::yD0(dmeson); } else if constexpr (TDmeson == DmesonType::Dplus) { - rapDmeson = hfHelper.yDplus(dmeson); + rapDmeson = HfHelper::yDplus(dmeson); } if (yCandDmesonMax >= 0. && std::abs(rapDmeson) > yCandDmesonMax) { @@ -471,14 +469,14 @@ struct tableMakerJpsiHf { if constexpr (TDmeson == DmesonType::D0) { if (dmeson.isSelD0() >= 1) { - massD0 = hfHelper.invMassD0ToPiK(dmeson); - VarManager::FillDileptonCharmHadron(dilepton, dmeson, hfHelper, scores[0], fValuesDileptonCharmHadron); + massD0 = HfHelper::invMassD0ToPiK(dmeson); + VarManager::FillDileptonCharmHadron(dilepton, dmeson, scores[0], fValuesDileptonCharmHadron); fHistMan->FillHistClass("JPsiDmeson", fValuesDileptonCharmHadron); VarManager::ResetValues(0, VarManager::kNVars, fValuesDileptonCharmHadron); } if (dmeson.isSelD0bar() >= 1) { - massD0bar = hfHelper.invMassD0barToKPi(dmeson); - VarManager::FillDileptonCharmHadron(dilepton, dmeson, hfHelper, scores[3], fValuesDileptonCharmHadron); + massD0bar = HfHelper::invMassD0barToKPi(dmeson); + VarManager::FillDileptonCharmHadron(dilepton, dmeson, scores[3], fValuesDileptonCharmHadron); fHistMan->FillHistClass("JPsiDmeson", fValuesDileptonCharmHadron); VarManager::ResetValues(0, VarManager::kNVars, fValuesDileptonCharmHadron); } @@ -487,8 +485,8 @@ struct tableMakerJpsiHf { } } else if constexpr (TDmeson == DmesonType::Dplus) { if (dmeson.isSelDplusToPiKPi() >= 1) { - massDplus = hfHelper.invMassDplusToPiKPi(dmeson); - VarManager::FillDileptonCharmHadron(dilepton, dmeson, hfHelper, scores_dplus[0], fValuesDileptonCharmHadron); + massDplus = HfHelper::invMassDplusToPiKPi(dmeson); + VarManager::FillDileptonCharmHadron(dilepton, dmeson, scores_dplus[0], fValuesDileptonCharmHadron); fHistMan->FillHistClass("JPsiDmeson", fValuesDileptonCharmHadron); VarManager::ResetValues(0, VarManager::kNVars, fValuesDileptonCharmHadron); }