From e54cf0d1a1bf09c5ee7d17a28c8df35a2e745858 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 19 Sep 2025 15:59:18 +0200 Subject: [PATCH 1/5] Usage of ML models for MFT-Muon matching --- PWGDQ/Core/MuonMatchingMlResponse.h | 378 ++++++++++++++++++ .../TableProducer/tableMakerMC_withAssoc.cxx | 31 ++ 2 files changed, 409 insertions(+) create mode 100644 PWGDQ/Core/MuonMatchingMlResponse.h diff --git a/PWGDQ/Core/MuonMatchingMlResponse.h b/PWGDQ/Core/MuonMatchingMlResponse.h new file mode 100644 index 00000000000..e9e3983aa08 --- /dev/null +++ b/PWGDQ/Core/MuonMatchingMlResponse.h @@ -0,0 +1,378 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file MuonMatchingMlResponse.h +/// \brief Class to compute the ML response for MFT-Muon matching + +#ifndef PWGDQ_DILEPTON_UTILS_MLRESPONSEMFTMUONMATCHING_H_ +#define PWGDQ_DILEPTON_UTILS_MLRESPONSEMFTMUONMATCHING_H_ + +#include "Tools/ML/MlResponse.h" + +#include +#include +#include + +// Fill the map of available input features +// the key is the feature's name (std::string) +// the value is the corresponding value in EnumInputFeatures +#define FILL_MAP_MFTMUON_MATCH(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesMFTMuonMatch::FEATURE) \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER=FEATURE from track +#define CHECK_AND_FILL_MUON_TRACK(FEATURE, GETTER) \ + case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ + inputFeature = muon.GETTER(); \ + break; \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER=FEATURE from track +#define CHECK_AND_FILL_MFT_TRACK(FEATURE, GETTER) \ + case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ + inputFeature = mft.GETTER(); \ + break; \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER=FEATURE from track +#define CHECK_AND_FILL_MUON_COV(FEATURE, GETTER) \ + case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ + inputFeature = muoncov.GETTER(); \ + break; \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER=FEATURE from track +#define CHECK_AND_FILL_MFT_COV(FEATURE, GETTER) \ + case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ + inputFeature = mftcov.GETTER(); \ + break; \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER1 and GETTER2 from track. +#define CHECK_AND_FILL_MFTMUON_DIFF(FEATURE, GETTER1, GETTER2) \ + case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ + inputFeature = (mft.GETTER2() - muon.GETTER1()); \ + break; \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER=FEATURE from collision +#define CHECK_AND_FILL_MFTMUON_COLLISION(GETTER) \ + case static_cast(InputFeaturesMFTMuonMatch::GETTER): { \ + inputFeature = collision.GETTER(); \ + break; \ + } + +namespace o2::analysis +{ +// possible input features for ML +enum class InputFeaturesMFTMuonMatch : uint8_t { + zMatching, + xMFT, + yMFT, + qOverptMFT, + tglMFT, + phiMFT, + dcaXY, + dcaZ, + chi2MFT, + nClustersMFT, + xMCH, + yMCH, + qOverptMCH, + tglMCH, + phiMCH, + nClustersMCH, + chi2MCH, + pdca, + cXXMFT, + cXYMFT, + cYYMFT, + cPhiYMFT, + cPhiXMFT, + cPhiPhiMFT, + cTglYMFT, + cTglXMFT, + cTglPhiMFT, + cTglTglMFT, + c1PtYMFT, + c1PtXMFT, + c1PtPhiMFT, + c1PtTglMFT, + c1Pt21Pt2MFT, + cXXMCH, + cXYMCH, + cYYMCH, + cPhiYMCH, + cPhiXMCH, + cPhiPhiMCH, + cTglYMCH, + cTglXMCH, + cTglPhiMCH, + cTglTglMCH, + c1PtYMCH, + c1PtXMCH, + c1PtPhiMCH, + c1PtTglMCH, + c1Pt21Pt2MCH, + deltaX, + deltaY, + deltaPhi, + deltaEta, + deltaPt, + posX, + posY, + posZ, + numContrib, + trackOccupancyInTimeRange, + ft0cOccupancyInTimeRange, + multFT0A, + multFT0C, + multNTracksPV, + multNTracksPVeta1, + multNTracksPVetaHalf, + isInelGt0, + isInelGt1, + multFT0M, + centFT0M, + centFT0A, + centFT0C, + chi2MCHMFT +}; + +template +class MlResponseMFTMuonMatch : public MlResponse +{ + public: + /// Default constructor + MlResponseMFTMuonMatch() = default; + /// Default destructor + virtual ~MlResponseMFTMuonMatch() = default; + + template + float return_feature(uint8_t idx, T1 const& muon, T2 const& mft, C1 const& muoncov, C2 const& mftcov, U const& collision) + { + float inputFeature = 0.; + switch (idx) { + CHECK_AND_FILL_MFT_TRACK(zMatching,z); + CHECK_AND_FILL_MFT_TRACK(xMFT,x); + CHECK_AND_FILL_MFT_TRACK(yMFT,y); + CHECK_AND_FILL_MFT_TRACK(qOverptMFT,signed1Pt); + CHECK_AND_FILL_MFT_TRACK(tglMFT,tgl); + CHECK_AND_FILL_MFT_TRACK(phiMFT,phi); + CHECK_AND_FILL_MFT_TRACK(chi2MFT,chi2); + CHECK_AND_FILL_MFT_TRACK(nClustersMFT,nClusters); + CHECK_AND_FILL_MUON_TRACK(dcaXY, fwddcaXY); + CHECK_AND_FILL_MUON_TRACK(dcaZ, fwddcaz); + CHECK_AND_FILL_MUON_TRACK(xMCH,x); + CHECK_AND_FILL_MUON_TRACK(yMCH,y); + CHECK_AND_FILL_MUON_TRACK(qOverptMCH,signed1Pt); + CHECK_AND_FILL_MUON_TRACK(tglMCH,tgl); + CHECK_AND_FILL_MUON_TRACK(phiMCH,phi); + CHECK_AND_FILL_MUON_TRACK(nClustersMCH,nClusters); + CHECK_AND_FILL_MUON_TRACK(chi2MCH,chi2); + CHECK_AND_FILL_MUON_TRACK(pdca,pDca); + CHECK_AND_FILL_MFT_COV(cXXMFT,cXX); + CHECK_AND_FILL_MFT_COV(cXYMFT,cXY); + CHECK_AND_FILL_MFT_COV(cYYMFT,cYY); + CHECK_AND_FILL_MFT_COV(cPhiYMFT,cPhiY); + CHECK_AND_FILL_MFT_COV(cPhiXMFT,cPhiX); + CHECK_AND_FILL_MFT_COV(cPhiPhiMFT,cPhiPhi); + CHECK_AND_FILL_MFT_COV(cTglYMFT,cTglY); + CHECK_AND_FILL_MFT_COV(cTglXMFT,cTglX); + CHECK_AND_FILL_MFT_COV(cTglPhiMFT,cTglPhi); + CHECK_AND_FILL_MFT_COV(cTglTglMFT,cTglTgl); + CHECK_AND_FILL_MFT_COV(c1PtYMFT,c1PtY); + CHECK_AND_FILL_MFT_COV(c1PtXMFT,c1PtX); + CHECK_AND_FILL_MFT_COV(c1PtPhiMFT,c1PtPhi); + CHECK_AND_FILL_MFT_COV(c1PtTglMFT,c1PtTgl); + CHECK_AND_FILL_MFT_COV(c1Pt21Pt2MFT,c1Pt21Pt2); + CHECK_AND_FILL_MUON_COV(cXXMCH,cXX); + CHECK_AND_FILL_MUON_COV(cXYMCH,cXY); + CHECK_AND_FILL_MUON_COV(cYYMCH,cYY); + CHECK_AND_FILL_MUON_COV(cPhiYMCH,cPhiY); + CHECK_AND_FILL_MUON_COV(cPhiXMCH,cPhiX); + CHECK_AND_FILL_MUON_COV(cPhiPhiMCH,cPhiPhi); + CHECK_AND_FILL_MUON_COV(cTglYMCH,cTglY); + CHECK_AND_FILL_MUON_COV(cTglXMCH,cTglX); + CHECK_AND_FILL_MUON_COV(cTglPhiMCH,cTglPhi); + CHECK_AND_FILL_MUON_COV(cTglTglMCH,cTglTgl); + CHECK_AND_FILL_MUON_COV(c1PtYMCH,c1PtY); + CHECK_AND_FILL_MUON_COV(c1PtXMCH,c1PtX); + CHECK_AND_FILL_MUON_COV(c1PtPhiMCH,c1PtPhi); + CHECK_AND_FILL_MUON_COV(c1PtTglMCH,c1PtTgl); + CHECK_AND_FILL_MUON_COV(c1Pt21Pt2MCH,c1Pt21Pt2); + CHECK_AND_FILL_MFTMUON_COLLISION(posX); + CHECK_AND_FILL_MFTMUON_COLLISION(posY); + CHECK_AND_FILL_MFTMUON_COLLISION(posZ); + CHECK_AND_FILL_MFTMUON_COLLISION(numContrib); + CHECK_AND_FILL_MFTMUON_COLLISION(trackOccupancyInTimeRange); + CHECK_AND_FILL_MFTMUON_COLLISION(ft0cOccupancyInTimeRange); + CHECK_AND_FILL_MFTMUON_COLLISION(multFT0A); + CHECK_AND_FILL_MFTMUON_COLLISION(multFT0C); + CHECK_AND_FILL_MFTMUON_COLLISION(multNTracksPV); + CHECK_AND_FILL_MFTMUON_COLLISION(multNTracksPVeta1); + CHECK_AND_FILL_MFTMUON_COLLISION(multNTracksPVetaHalf); + CHECK_AND_FILL_MFTMUON_COLLISION(isInelGt0); + CHECK_AND_FILL_MFTMUON_COLLISION(isInelGt1); + CHECK_AND_FILL_MFTMUON_COLLISION(multFT0M); + CHECK_AND_FILL_MFTMUON_COLLISION(centFT0M); + CHECK_AND_FILL_MFTMUON_COLLISION(centFT0A); + CHECK_AND_FILL_MFTMUON_COLLISION(centFT0C); + CHECK_AND_FILL_MUON_TRACK(chi2MCHMFT,chi2MatchMCHMFT); + } + return inputFeature; + } + + template + float return_featureTest(uint8_t idx, T1 const& muon) + { + float inputFeature = 0.; + switch (idx) { + CHECK_AND_FILL_MUON_TRACK(chi2MCHMFT,chi2MatchMCHMFT); + } + return inputFeature; + } + + + /// Method to get the input features vector needed for ML inference + /// \param track is the single track, \param collision is the collision + /// \return inputFeatures vector + template + std::vector getInputFeatures(T1 const& muon, T2 const& mft, C1 const& muoncov, C2 const& mftcov, U const& collision) + { + std::vector inputFeatures; + for (const auto& idx : MlResponse::mCachedIndices) { + float inputFeature = return_feature(idx, muon, mft, muoncov, mftcov, collision); + inputFeatures.emplace_back(inputFeature); + } + return inputFeatures; + } + + template + std::vector getInputFeaturesTest(T1 const& muon) + { + std::vector inputFeatures; + for (const auto& idx : MlResponse::mCachedIndices) { + float inputFeature = return_featureTest(idx, muon); + inputFeatures.emplace_back(inputFeature); + } + return inputFeatures; + } + + /// Method to get the value of variable chosen for binning + /// \param track is the single track, \param collision is the collision + /// \return binning variable + template + float getBinningFeature(T1 const& muon, T2 const& mft, C1 const& muoncov, C2 const& mftcov, U const& collision) + { + return return_feature(mCachedIndexBinning, muon, mft, muoncov, mftcov, collision); + } + + void cacheBinningIndex(std::string const& cfgBinningFeature) + { + setAvailableInputFeatures(); + if (MlResponse::mAvailableInputFeatures.count(cfgBinningFeature)) { + mCachedIndexBinning = MlResponse::mAvailableInputFeatures[cfgBinningFeature]; + } else { + LOG(fatal) << "Binning feature " << cfgBinningFeature << " not available! Please check your configurables."; + } + } + + protected: + /// Method to fill the map of available input features + void setAvailableInputFeatures() + { + MlResponse::mAvailableInputFeatures = { + FILL_MAP_MFTMUON_MATCH(zMatching), + FILL_MAP_MFTMUON_MATCH(xMFT), + FILL_MAP_MFTMUON_MATCH(yMFT), + FILL_MAP_MFTMUON_MATCH(qOverptMFT), + FILL_MAP_MFTMUON_MATCH(tglMFT), + FILL_MAP_MFTMUON_MATCH(phiMFT), + FILL_MAP_MFTMUON_MATCH(dcaXY), + FILL_MAP_MFTMUON_MATCH(dcaZ), + FILL_MAP_MFTMUON_MATCH(chi2MFT), + FILL_MAP_MFTMUON_MATCH(nClustersMFT), + FILL_MAP_MFTMUON_MATCH(xMCH), + FILL_MAP_MFTMUON_MATCH(yMCH), + FILL_MAP_MFTMUON_MATCH(qOverptMCH), + FILL_MAP_MFTMUON_MATCH(tglMCH), + FILL_MAP_MFTMUON_MATCH(phiMCH), + FILL_MAP_MFTMUON_MATCH(nClustersMCH), + FILL_MAP_MFTMUON_MATCH(chi2MCH), + FILL_MAP_MFTMUON_MATCH(pdca), + FILL_MAP_MFTMUON_MATCH(cXXMFT), + FILL_MAP_MFTMUON_MATCH(cXYMFT), + FILL_MAP_MFTMUON_MATCH(cYYMFT), + FILL_MAP_MFTMUON_MATCH(cPhiYMFT), + FILL_MAP_MFTMUON_MATCH(cPhiXMFT), + FILL_MAP_MFTMUON_MATCH(cPhiPhiMFT), + FILL_MAP_MFTMUON_MATCH(cTglYMFT), + FILL_MAP_MFTMUON_MATCH(cTglXMFT), + FILL_MAP_MFTMUON_MATCH(cTglPhiMFT), + FILL_MAP_MFTMUON_MATCH(cTglTglMFT), + FILL_MAP_MFTMUON_MATCH(c1PtYMFT), + FILL_MAP_MFTMUON_MATCH(c1PtXMFT), + FILL_MAP_MFTMUON_MATCH(c1PtPhiMFT), + FILL_MAP_MFTMUON_MATCH(c1PtTglMFT), + FILL_MAP_MFTMUON_MATCH(c1Pt21Pt2MFT), + FILL_MAP_MFTMUON_MATCH(cXXMCH), + FILL_MAP_MFTMUON_MATCH(cXYMCH), + FILL_MAP_MFTMUON_MATCH(cYYMCH), + FILL_MAP_MFTMUON_MATCH(cPhiYMCH), + FILL_MAP_MFTMUON_MATCH(cPhiXMCH), + FILL_MAP_MFTMUON_MATCH(cPhiPhiMCH), + FILL_MAP_MFTMUON_MATCH(cTglYMCH), + FILL_MAP_MFTMUON_MATCH(cTglXMCH), + FILL_MAP_MFTMUON_MATCH(cTglPhiMCH), + FILL_MAP_MFTMUON_MATCH(cTglTglMCH), + FILL_MAP_MFTMUON_MATCH(c1PtYMCH), + FILL_MAP_MFTMUON_MATCH(c1PtXMCH), + FILL_MAP_MFTMUON_MATCH(c1PtPhiMCH), + FILL_MAP_MFTMUON_MATCH(c1PtTglMCH), + FILL_MAP_MFTMUON_MATCH(c1Pt21Pt2MCH), + FILL_MAP_MFTMUON_MATCH(chi2MCHMFT) + }; + } + + uint8_t mCachedIndexBinning; // index correspondance between configurable and available input features +}; + +} // namespace o2::analysis + +#undef FILL_MAP_MFTMUON_MAP +#undef CHECK_AND_FILL_MUON_TRACK +#undef CHECK_AND_FILL_MFT_TRACK +#undef CHECK_AND_FILL_MUON_COV +#undef CHECK_AND_FILL_MFT_COV +#undef CHECK_AND_FILL_MFTMUON_DIFF +#undef CHECK_AND_FILL_MFTMUON_COLLISION + +#endif // PWGDQ_DILEPTON_UTILS_MLRESPONSEMFTMUONMATCHING_H_ diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index a3c257652fd..607091207ec 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -44,6 +44,7 @@ #include "PWGDQ/Core/CutsLibrary.h" #include "PWGDQ/Core/MCSignal.h" #include "PWGDQ/Core/MCSignalLibrary.h" +#include "PWGDQ/Core/MuonMatchingMlResponse.h" #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/FwdTrackReAlignTables.h" @@ -199,6 +200,7 @@ struct TableMakerMC { Configurable fGeoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; Configurable fGrpMagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable fGrpMagPathRun2{"grpmagPathRun2", "GLO/GRP/GRP", "CCDB path of the GRPObject (Usage for Run 2)"}; + Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; } fConfigCCDB; struct : ConfigurableGroup { @@ -208,8 +210,12 @@ struct TableMakerMC { Configurable fPropMuon{"cfgPropMuon", true, "Propagate muon tracks through absorber (do not use if applying pairing)"}; Configurable fRefitGlobalMuon{"cfgRefitGlobalMuon", true, "Correct global muon parameters"}; Configurable fKeepBestMatch{"cfgKeepBestMatch", false, "Keep only the best match global muons in the skimming"}; + Configurable fUseML{"cfgUseML", false, "Import ONNX model from ccdb to decide which matching candidates to keep"}; Configurable fMuonMatchEtaMin{"cfgMuonMatchEtaMin", -4.0f, "Definition of the acceptance of muon tracks to be matched with MFT"}; Configurable fMuonMatchEtaMax{"cfgMuonMatchEtaMax", -2.5f, "Definition of the acceptance of muon tracks to be matched with MFT"}; + Configurable> fModelPathsCCDB{"fModelPathsCCDB", std::vector{"Users/m/mcoquet/MLTest"}, "Paths of models on CCDB"}; + Configurable> fInputFeatures{"cfgInputFeatures", std::vector{"chi2MCHMFT"}, "Names of ML model input features"}; + Configurable> fModelNames{"cfgModelNames", std::vector{"model.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; } fConfigVariousOptions; Service fCCDB; @@ -240,6 +246,12 @@ struct TableMakerMC { std::map fBestMatch; std::unordered_map map_mfttrackcovs; + o2::analysis::MlResponseMFTMuonMatch matchingMlResponse; + std::vector binsPtMl; + std::array cutValues; + std::vector cutDirMl; + + void init(o2::framework::InitContext& context) { // Check whether barrel or muon are enabled @@ -364,6 +376,19 @@ struct TableMakerMC { fCCDB->get(fConfigCCDB.fGeoPath); } fCCDBApi.init(fConfigCCDB.fConfigCcdbUrl.value); + + if (fConfigVariousOptions.fUseML.value){ + //TODO : for now we use hard coded values since the current models use 1 pT bin + binsPtMl = {-1e-6,1000.0}; + cutValues = {0.0}; + cutDirMl = {cuts_ml::CutNot}; + o2::framework::LabeledArray mycutsMl(cutValues.data(),1,1,std::vector{"pT bin 0"},std::vector{"score"}); + matchingMlResponse.configure(binsPtMl, mycutsMl, cutDirMl, 1); + matchingMlResponse.setModelPathsCCDB(fConfigVariousOptions.fModelNames.value, fCCDBApi, fConfigVariousOptions.fModelPathsCCDB.value, fConfigCCDB.timestamp.value); + matchingMlResponse.cacheInputFeaturesIndices(fConfigVariousOptions.fInputFeatures.value); + matchingMlResponse.init(); + } + } void DefineCuts() @@ -882,6 +907,12 @@ struct TableMakerMC { if (static_cast(muon.trackType()) < 2) { auto muonID = muon.matchMCHTrackId(); auto chi2 = muon.chi2MatchMCHMFT(); + if (fConfigVariousOptions.fUseML.value){ + std::vector output; + std::vector inputML = matchingMlResponse.getInputFeaturesTest(muon); + matchingMlResponse.isSelectedMl(inputML, 0, output); + chi2 = output[0]; + } if (mCandidates.find(muonID) == mCandidates.end()) { mCandidates[muonID] = {chi2, muon.globalIndex()}; } else { From 245ad8dec052a3efac419ec229880fed754019b6 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 19 Sep 2025 16:03:54 +0200 Subject: [PATCH 2/5] clang format --- PWGDQ/Core/MuonMatchingMlResponse.h | 145 +++++++++--------- .../TableProducer/tableMakerMC_withAssoc.cxx | 86 ++++++----- 2 files changed, 115 insertions(+), 116 deletions(-) diff --git a/PWGDQ/Core/MuonMatchingMlResponse.h b/PWGDQ/Core/MuonMatchingMlResponse.h index e9e3983aa08..30d7eac0ad2 100644 --- a/PWGDQ/Core/MuonMatchingMlResponse.h +++ b/PWGDQ/Core/MuonMatchingMlResponse.h @@ -24,69 +24,68 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_MFTMUON_MATCH(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesMFTMuonMatch::FEATURE) \ - } +#define FILL_MAP_MFTMUON_MATCH(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesMFTMuonMatch::FEATURE)} // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE // if so, the inputFeatures vector is filled with the FEATURE's value // by calling the corresponding GETTER=FEATURE from track -#define CHECK_AND_FILL_MUON_TRACK(FEATURE, GETTER) \ +#define CHECK_AND_FILL_MUON_TRACK(FEATURE, GETTER) \ case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ - inputFeature = muon.GETTER(); \ - break; \ + inputFeature = muon.GETTER(); \ + break; \ } // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE // if so, the inputFeatures vector is filled with the FEATURE's value // by calling the corresponding GETTER=FEATURE from track -#define CHECK_AND_FILL_MFT_TRACK(FEATURE, GETTER) \ +#define CHECK_AND_FILL_MFT_TRACK(FEATURE, GETTER) \ case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ - inputFeature = mft.GETTER(); \ - break; \ + inputFeature = mft.GETTER(); \ + break; \ } // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE // if so, the inputFeatures vector is filled with the FEATURE's value // by calling the corresponding GETTER=FEATURE from track -#define CHECK_AND_FILL_MUON_COV(FEATURE, GETTER) \ +#define CHECK_AND_FILL_MUON_COV(FEATURE, GETTER) \ case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ - inputFeature = muoncov.GETTER(); \ - break; \ + inputFeature = muoncov.GETTER(); \ + break; \ } // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE // if so, the inputFeatures vector is filled with the FEATURE's value // by calling the corresponding GETTER=FEATURE from track -#define CHECK_AND_FILL_MFT_COV(FEATURE, GETTER) \ +#define CHECK_AND_FILL_MFT_COV(FEATURE, GETTER) \ case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ - inputFeature = mftcov.GETTER(); \ - break; \ + inputFeature = mftcov.GETTER(); \ + break; \ } // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE // if so, the inputFeatures vector is filled with the FEATURE's value // by calling the corresponding GETTER1 and GETTER2 from track. -#define CHECK_AND_FILL_MFTMUON_DIFF(FEATURE, GETTER1, GETTER2) \ - case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ - inputFeature = (mft.GETTER2() - muon.GETTER1()); \ - break; \ +#define CHECK_AND_FILL_MFTMUON_DIFF(FEATURE, GETTER1, GETTER2) \ + case static_cast(InputFeaturesMFTMuonMatch::FEATURE): { \ + inputFeature = (mft.GETTER2() - muon.GETTER1()); \ + break; \ } // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE // if so, the inputFeatures vector is filled with the FEATURE's value // by calling the corresponding GETTER=FEATURE from collision -#define CHECK_AND_FILL_MFTMUON_COLLISION(GETTER) \ +#define CHECK_AND_FILL_MFTMUON_COLLISION(GETTER) \ case static_cast(InputFeaturesMFTMuonMatch::GETTER): { \ - inputFeature = collision.GETTER(); \ - break; \ + inputFeature = collision.GETTER(); \ + break; \ } namespace o2::analysis @@ -180,54 +179,54 @@ class MlResponseMFTMuonMatch : public MlResponse { float inputFeature = 0.; switch (idx) { - CHECK_AND_FILL_MFT_TRACK(zMatching,z); - CHECK_AND_FILL_MFT_TRACK(xMFT,x); - CHECK_AND_FILL_MFT_TRACK(yMFT,y); - CHECK_AND_FILL_MFT_TRACK(qOverptMFT,signed1Pt); - CHECK_AND_FILL_MFT_TRACK(tglMFT,tgl); - CHECK_AND_FILL_MFT_TRACK(phiMFT,phi); - CHECK_AND_FILL_MFT_TRACK(chi2MFT,chi2); - CHECK_AND_FILL_MFT_TRACK(nClustersMFT,nClusters); + CHECK_AND_FILL_MFT_TRACK(zMatching, z); + CHECK_AND_FILL_MFT_TRACK(xMFT, x); + CHECK_AND_FILL_MFT_TRACK(yMFT, y); + CHECK_AND_FILL_MFT_TRACK(qOverptMFT, signed1Pt); + CHECK_AND_FILL_MFT_TRACK(tglMFT, tgl); + CHECK_AND_FILL_MFT_TRACK(phiMFT, phi); + CHECK_AND_FILL_MFT_TRACK(chi2MFT, chi2); + CHECK_AND_FILL_MFT_TRACK(nClustersMFT, nClusters); CHECK_AND_FILL_MUON_TRACK(dcaXY, fwddcaXY); CHECK_AND_FILL_MUON_TRACK(dcaZ, fwddcaz); - CHECK_AND_FILL_MUON_TRACK(xMCH,x); - CHECK_AND_FILL_MUON_TRACK(yMCH,y); - CHECK_AND_FILL_MUON_TRACK(qOverptMCH,signed1Pt); - CHECK_AND_FILL_MUON_TRACK(tglMCH,tgl); - CHECK_AND_FILL_MUON_TRACK(phiMCH,phi); - CHECK_AND_FILL_MUON_TRACK(nClustersMCH,nClusters); - CHECK_AND_FILL_MUON_TRACK(chi2MCH,chi2); - CHECK_AND_FILL_MUON_TRACK(pdca,pDca); - CHECK_AND_FILL_MFT_COV(cXXMFT,cXX); - CHECK_AND_FILL_MFT_COV(cXYMFT,cXY); - CHECK_AND_FILL_MFT_COV(cYYMFT,cYY); - CHECK_AND_FILL_MFT_COV(cPhiYMFT,cPhiY); - CHECK_AND_FILL_MFT_COV(cPhiXMFT,cPhiX); - CHECK_AND_FILL_MFT_COV(cPhiPhiMFT,cPhiPhi); - CHECK_AND_FILL_MFT_COV(cTglYMFT,cTglY); - CHECK_AND_FILL_MFT_COV(cTglXMFT,cTglX); - CHECK_AND_FILL_MFT_COV(cTglPhiMFT,cTglPhi); - CHECK_AND_FILL_MFT_COV(cTglTglMFT,cTglTgl); - CHECK_AND_FILL_MFT_COV(c1PtYMFT,c1PtY); - CHECK_AND_FILL_MFT_COV(c1PtXMFT,c1PtX); - CHECK_AND_FILL_MFT_COV(c1PtPhiMFT,c1PtPhi); - CHECK_AND_FILL_MFT_COV(c1PtTglMFT,c1PtTgl); - CHECK_AND_FILL_MFT_COV(c1Pt21Pt2MFT,c1Pt21Pt2); - CHECK_AND_FILL_MUON_COV(cXXMCH,cXX); - CHECK_AND_FILL_MUON_COV(cXYMCH,cXY); - CHECK_AND_FILL_MUON_COV(cYYMCH,cYY); - CHECK_AND_FILL_MUON_COV(cPhiYMCH,cPhiY); - CHECK_AND_FILL_MUON_COV(cPhiXMCH,cPhiX); - CHECK_AND_FILL_MUON_COV(cPhiPhiMCH,cPhiPhi); - CHECK_AND_FILL_MUON_COV(cTglYMCH,cTglY); - CHECK_AND_FILL_MUON_COV(cTglXMCH,cTglX); - CHECK_AND_FILL_MUON_COV(cTglPhiMCH,cTglPhi); - CHECK_AND_FILL_MUON_COV(cTglTglMCH,cTglTgl); - CHECK_AND_FILL_MUON_COV(c1PtYMCH,c1PtY); - CHECK_AND_FILL_MUON_COV(c1PtXMCH,c1PtX); - CHECK_AND_FILL_MUON_COV(c1PtPhiMCH,c1PtPhi); - CHECK_AND_FILL_MUON_COV(c1PtTglMCH,c1PtTgl); - CHECK_AND_FILL_MUON_COV(c1Pt21Pt2MCH,c1Pt21Pt2); + CHECK_AND_FILL_MUON_TRACK(xMCH, x); + CHECK_AND_FILL_MUON_TRACK(yMCH, y); + CHECK_AND_FILL_MUON_TRACK(qOverptMCH, signed1Pt); + CHECK_AND_FILL_MUON_TRACK(tglMCH, tgl); + CHECK_AND_FILL_MUON_TRACK(phiMCH, phi); + CHECK_AND_FILL_MUON_TRACK(nClustersMCH, nClusters); + CHECK_AND_FILL_MUON_TRACK(chi2MCH, chi2); + CHECK_AND_FILL_MUON_TRACK(pdca, pDca); + CHECK_AND_FILL_MFT_COV(cXXMFT, cXX); + CHECK_AND_FILL_MFT_COV(cXYMFT, cXY); + CHECK_AND_FILL_MFT_COV(cYYMFT, cYY); + CHECK_AND_FILL_MFT_COV(cPhiYMFT, cPhiY); + CHECK_AND_FILL_MFT_COV(cPhiXMFT, cPhiX); + CHECK_AND_FILL_MFT_COV(cPhiPhiMFT, cPhiPhi); + CHECK_AND_FILL_MFT_COV(cTglYMFT, cTglY); + CHECK_AND_FILL_MFT_COV(cTglXMFT, cTglX); + CHECK_AND_FILL_MFT_COV(cTglPhiMFT, cTglPhi); + CHECK_AND_FILL_MFT_COV(cTglTglMFT, cTglTgl); + CHECK_AND_FILL_MFT_COV(c1PtYMFT, c1PtY); + CHECK_AND_FILL_MFT_COV(c1PtXMFT, c1PtX); + CHECK_AND_FILL_MFT_COV(c1PtPhiMFT, c1PtPhi); + CHECK_AND_FILL_MFT_COV(c1PtTglMFT, c1PtTgl); + CHECK_AND_FILL_MFT_COV(c1Pt21Pt2MFT, c1Pt21Pt2); + CHECK_AND_FILL_MUON_COV(cXXMCH, cXX); + CHECK_AND_FILL_MUON_COV(cXYMCH, cXY); + CHECK_AND_FILL_MUON_COV(cYYMCH, cYY); + CHECK_AND_FILL_MUON_COV(cPhiYMCH, cPhiY); + CHECK_AND_FILL_MUON_COV(cPhiXMCH, cPhiX); + CHECK_AND_FILL_MUON_COV(cPhiPhiMCH, cPhiPhi); + CHECK_AND_FILL_MUON_COV(cTglYMCH, cTglY); + CHECK_AND_FILL_MUON_COV(cTglXMCH, cTglX); + CHECK_AND_FILL_MUON_COV(cTglPhiMCH, cTglPhi); + CHECK_AND_FILL_MUON_COV(cTglTglMCH, cTglTgl); + CHECK_AND_FILL_MUON_COV(c1PtYMCH, c1PtY); + CHECK_AND_FILL_MUON_COV(c1PtXMCH, c1PtX); + CHECK_AND_FILL_MUON_COV(c1PtPhiMCH, c1PtPhi); + CHECK_AND_FILL_MUON_COV(c1PtTglMCH, c1PtTgl); + CHECK_AND_FILL_MUON_COV(c1Pt21Pt2MCH, c1Pt21Pt2); CHECK_AND_FILL_MFTMUON_COLLISION(posX); CHECK_AND_FILL_MFTMUON_COLLISION(posY); CHECK_AND_FILL_MFTMUON_COLLISION(posZ); @@ -245,7 +244,7 @@ class MlResponseMFTMuonMatch : public MlResponse CHECK_AND_FILL_MFTMUON_COLLISION(centFT0M); CHECK_AND_FILL_MFTMUON_COLLISION(centFT0A); CHECK_AND_FILL_MFTMUON_COLLISION(centFT0C); - CHECK_AND_FILL_MUON_TRACK(chi2MCHMFT,chi2MatchMCHMFT); + CHECK_AND_FILL_MUON_TRACK(chi2MCHMFT, chi2MatchMCHMFT); } return inputFeature; } @@ -255,12 +254,11 @@ class MlResponseMFTMuonMatch : public MlResponse { float inputFeature = 0.; switch (idx) { - CHECK_AND_FILL_MUON_TRACK(chi2MCHMFT,chi2MatchMCHMFT); + CHECK_AND_FILL_MUON_TRACK(chi2MCHMFT, chi2MatchMCHMFT); } return inputFeature; } - /// Method to get the input features vector needed for ML inference /// \param track is the single track, \param collision is the collision /// \return inputFeatures vector @@ -358,8 +356,7 @@ class MlResponseMFTMuonMatch : public MlResponse FILL_MAP_MFTMUON_MATCH(c1PtPhiMCH), FILL_MAP_MFTMUON_MATCH(c1PtTglMCH), FILL_MAP_MFTMUON_MATCH(c1Pt21Pt2MCH), - FILL_MAP_MFTMUON_MATCH(chi2MCHMFT) - }; + FILL_MAP_MFTMUON_MATCH(chi2MCHMFT)}; } uint8_t mCachedIndexBinning; // index correspondance between configurable and available input features diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 607091207ec..e1ab36ba6bb 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -16,46 +16,50 @@ // The skimmed MC stack includes the MC truth particles corresponding to the list of user specified MC signals (see MCsignal.h) // and the MC truth particles corresponding to the reconstructed tracks selected by the specified track cuts on reconstructed data. -#include -#include -#include -#include -#include -#include -#include -#include -#include "TList.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/ASoA.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Centrality.h" -#include "Common/CCDB/TriggerAliases.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/Core/HistogramManager.h" -#include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/HistogramsLibrary.h" +#include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/CutsLibrary.h" +#include "PWGDQ/Core/HistogramManager.h" +#include "PWGDQ/Core/HistogramsLibrary.h" #include "PWGDQ/Core/MCSignal.h" #include "PWGDQ/Core/MCSignalLibrary.h" #include "PWGDQ/Core/MuonMatchingMlResponse.h" +#include "PWGDQ/Core/VarManager.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" + +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FwdTrackReAlignTables.h" +#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/FwdTrackReAlignTables.h" -#include "Common/DataModel/CollisionAssociationTables.h" + +#include "CCDB/BasicCCDBManager.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" +#include "DetectorsBase/GeometryManager.h" +#include "DetectorsBase/Propagator.h" #include "Field/MagneticField.h" +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/DataTypes.h" +#include "Framework/runDataProcessing.h" + #include "TGeoGlobalMagField.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsBase/GeometryManager.h" -#include "CCDB/BasicCCDBManager.h" +#include "TList.h" + +#include +#include +#include +#include +#include +#include +#include +#include using std::cout; using std::endl; @@ -248,10 +252,9 @@ struct TableMakerMC { o2::analysis::MlResponseMFTMuonMatch matchingMlResponse; std::vector binsPtMl; - std::array cutValues; + std::array cutValues; std::vector cutDirMl; - void init(o2::framework::InitContext& context) { // Check whether barrel or muon are enabled @@ -377,18 +380,17 @@ struct TableMakerMC { } fCCDBApi.init(fConfigCCDB.fConfigCcdbUrl.value); - if (fConfigVariousOptions.fUseML.value){ - //TODO : for now we use hard coded values since the current models use 1 pT bin - binsPtMl = {-1e-6,1000.0}; + if (fConfigVariousOptions.fUseML.value) { + // TODO : for now we use hard coded values since the current models use 1 pT bin + binsPtMl = {-1e-6, 1000.0}; cutValues = {0.0}; cutDirMl = {cuts_ml::CutNot}; - o2::framework::LabeledArray mycutsMl(cutValues.data(),1,1,std::vector{"pT bin 0"},std::vector{"score"}); + o2::framework::LabeledArray mycutsMl(cutValues.data(), 1, 1, std::vector{"pT bin 0"}, std::vector{"score"}); matchingMlResponse.configure(binsPtMl, mycutsMl, cutDirMl, 1); matchingMlResponse.setModelPathsCCDB(fConfigVariousOptions.fModelNames.value, fCCDBApi, fConfigVariousOptions.fModelPathsCCDB.value, fConfigCCDB.timestamp.value); matchingMlResponse.cacheInputFeaturesIndices(fConfigVariousOptions.fInputFeatures.value); matchingMlResponse.init(); } - } void DefineCuts() @@ -907,12 +909,12 @@ struct TableMakerMC { if (static_cast(muon.trackType()) < 2) { auto muonID = muon.matchMCHTrackId(); auto chi2 = muon.chi2MatchMCHMFT(); - if (fConfigVariousOptions.fUseML.value){ - std::vector output; - std::vector inputML = matchingMlResponse.getInputFeaturesTest(muon); - matchingMlResponse.isSelectedMl(inputML, 0, output); - chi2 = output[0]; - } + if (fConfigVariousOptions.fUseML.value) { + std::vector output; + std::vector inputML = matchingMlResponse.getInputFeaturesTest(muon); + matchingMlResponse.isSelectedMl(inputML, 0, output); + chi2 = output[0]; + } if (mCandidates.find(muonID) == mCandidates.end()) { mCandidates[muonID] = {chi2, muon.globalIndex()}; } else { From ee488dc7fe6e395f238ec4bcce4dcda797651002 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 19 Sep 2025 16:22:11 +0200 Subject: [PATCH 3/5] Fixes for linter --- PWGDQ/Core/MuonMatchingMlResponse.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/PWGDQ/Core/MuonMatchingMlResponse.h b/PWGDQ/Core/MuonMatchingMlResponse.h index 30d7eac0ad2..57e4aa07943 100644 --- a/PWGDQ/Core/MuonMatchingMlResponse.h +++ b/PWGDQ/Core/MuonMatchingMlResponse.h @@ -11,9 +11,10 @@ /// \file MuonMatchingMlResponse.h /// \brief Class to compute the ML response for MFT-Muon matching +/// \author Maurice Coquet -#ifndef PWGDQ_DILEPTON_UTILS_MLRESPONSEMFTMUONMATCHING_H_ -#define PWGDQ_DILEPTON_UTILS_MLRESPONSEMFTMUONMATCHING_H_ +#ifndef PWGDQ_CORE_MLRESPONSEMFTMUONMATCHING_H_ +#define PWGDQ_CORE_MLRESPONSEMFTMUONMATCHING_H_ #include "Tools/ML/MlResponse.h" @@ -175,7 +176,7 @@ class MlResponseMFTMuonMatch : public MlResponse virtual ~MlResponseMFTMuonMatch() = default; template - float return_feature(uint8_t idx, T1 const& muon, T2 const& mft, C1 const& muoncov, C2 const& mftcov, U const& collision) + float returnFeature(uint8_t idx, T1 const& muon, T2 const& mft, C1 const& muoncov, C2 const& mftcov, U const& collision) { float inputFeature = 0.; switch (idx) { @@ -250,7 +251,7 @@ class MlResponseMFTMuonMatch : public MlResponse } template - float return_featureTest(uint8_t idx, T1 const& muon) + float returnFeatureTest(uint8_t idx, T1 const& muon) { float inputFeature = 0.; switch (idx) { @@ -267,7 +268,7 @@ class MlResponseMFTMuonMatch : public MlResponse { std::vector inputFeatures; for (const auto& idx : MlResponse::mCachedIndices) { - float inputFeature = return_feature(idx, muon, mft, muoncov, mftcov, collision); + float inputFeature = returnFeature(idx, muon, mft, muoncov, mftcov, collision); inputFeatures.emplace_back(inputFeature); } return inputFeatures; @@ -278,7 +279,7 @@ class MlResponseMFTMuonMatch : public MlResponse { std::vector inputFeatures; for (const auto& idx : MlResponse::mCachedIndices) { - float inputFeature = return_featureTest(idx, muon); + float inputFeature = returnFeatureTest(idx, muon); inputFeatures.emplace_back(inputFeature); } return inputFeatures; @@ -290,7 +291,7 @@ class MlResponseMFTMuonMatch : public MlResponse template float getBinningFeature(T1 const& muon, T2 const& mft, C1 const& muoncov, C2 const& mftcov, U const& collision) { - return return_feature(mCachedIndexBinning, muon, mft, muoncov, mftcov, collision); + return returnFeature(mCachedIndexBinning, muon, mft, muoncov, mftcov, collision); } void cacheBinningIndex(std::string const& cfgBinningFeature) @@ -372,4 +373,4 @@ class MlResponseMFTMuonMatch : public MlResponse #undef CHECK_AND_FILL_MFTMUON_DIFF #undef CHECK_AND_FILL_MFTMUON_COLLISION -#endif // PWGDQ_DILEPTON_UTILS_MLRESPONSEMFTMUONMATCHING_H_ +#endif // PWGDQ_CORE_MLRESPONSEMFTMUONMATCHING_H_ From 06c38f9124ef4ef4ee65a8f7dd11ae8941729d7f Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 19 Sep 2025 14:23:41 +0000 Subject: [PATCH 4/5] Please consider the following formatting changes --- PWGDQ/Core/MuonMatchingMlResponse.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGDQ/Core/MuonMatchingMlResponse.h b/PWGDQ/Core/MuonMatchingMlResponse.h index 57e4aa07943..1e55d65cff2 100644 --- a/PWGDQ/Core/MuonMatchingMlResponse.h +++ b/PWGDQ/Core/MuonMatchingMlResponse.h @@ -25,9 +25,10 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_MFTMUON_MATCH(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesMFTMuonMatch::FEATURE)} +#define FILL_MAP_MFTMUON_MATCH(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesMFTMuonMatch::FEATURE) \ + } // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE From 7bef04a85ad2dd892ec993ecdd15a1a8fe62513d Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 19 Sep 2025 16:41:25 +0200 Subject: [PATCH 5/5] Further fixes --- PWGDQ/Core/MuonMatchingMlResponse.h | 6 +++--- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGDQ/Core/MuonMatchingMlResponse.h b/PWGDQ/Core/MuonMatchingMlResponse.h index 1e55d65cff2..1c36f26ab5d 100644 --- a/PWGDQ/Core/MuonMatchingMlResponse.h +++ b/PWGDQ/Core/MuonMatchingMlResponse.h @@ -13,8 +13,8 @@ /// \brief Class to compute the ML response for MFT-Muon matching /// \author Maurice Coquet -#ifndef PWGDQ_CORE_MLRESPONSEMFTMUONMATCHING_H_ -#define PWGDQ_CORE_MLRESPONSEMFTMUONMATCHING_H_ +#ifndef PWGDQ_CORE_MUONMATCHINGMLRESPONSE_H_ +#define PWGDQ_CORE_MUONMATCHINGMLRESPONSE_H_ #include "Tools/ML/MlResponse.h" @@ -374,4 +374,4 @@ class MlResponseMFTMuonMatch : public MlResponse #undef CHECK_AND_FILL_MFTMUON_DIFF #undef CHECK_AND_FILL_MFTMUON_COLLISION -#endif // PWGDQ_CORE_MLRESPONSEMFTMUONMATCHING_H_ +#endif // PWGDQ_CORE_MUONMATCHINGMLRESPONSE_H_ diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index e1ab36ba6bb..cd38a312311 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -387,7 +387,7 @@ struct TableMakerMC { cutDirMl = {cuts_ml::CutNot}; o2::framework::LabeledArray mycutsMl(cutValues.data(), 1, 1, std::vector{"pT bin 0"}, std::vector{"score"}); matchingMlResponse.configure(binsPtMl, mycutsMl, cutDirMl, 1); - matchingMlResponse.setModelPathsCCDB(fConfigVariousOptions.fModelNames.value, fCCDBApi, fConfigVariousOptions.fModelPathsCCDB.value, fConfigCCDB.timestamp.value); + matchingMlResponse.setModelPathsCCDB(fConfigVariousOptions.fModelNames.value, fCCDBApi, fConfigVariousOptions.fModelPathsCCDB.value, fConfigCCDB.timestampCCDB.value); matchingMlResponse.cacheInputFeaturesIndices(fConfigVariousOptions.fInputFeatures.value); matchingMlResponse.init(); }