diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 5bce11ac26f..e5aa7fbfe02 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -94,6 +94,11 @@ using MyElectron = MyElectrons::iterator; using FilteredMyElectrons = o2::soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; +using MyElectronsSCT = o2::soa::Join; +using MyElectronSCT = MyElectronsSCT::iterator; +using FilteredMyElectronsSCT = o2::soa::Filtered; +using FilteredMyElectronSCT = FilteredMyElectronsSCT::iterator; + using MyMuons = o2::soa::Join; using MyMuon = MyMuons::iterator; using FilteredMyMuons = o2::soa::Filtered; @@ -102,7 +107,7 @@ using FilteredMyMuon = FilteredMyMuons::iterator; using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMFwdTrack>; -template +template struct Dilepton { // Configurables @@ -257,15 +262,20 @@ struct Dilepton { o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; // configuration for PID ML - o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + // o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + // o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMLPID{"binsMLPID", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMLPID{"cutsMLPID", std::vector{0.97, 0.97, 0.97, 0.8, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + // o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + // o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + // o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + // o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + // o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + + o2::framework::Configurable> binsMLSCT{"binsMLSCT", std::vector{0.1, 0.4, 0.6, 0.8, 1, 2, 4, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMLSCTeT_prompt_hc{"cutsMLSCTeT_prompt_hc", std::vector{0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8}, "ML cuts per bin for prompt hc"}; + o2::framework::Configurable> cutsMLSCTeT_nonprompt_hc{"cutsMLSCTeT_nonprompt_hc", std::vector{0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8}, "ML cuts per bin for nonprompt hc"}; + o2::framework::Configurable> cutsMLSCTeT_hb{"cutsMLSCTeT_hb", std::vector{0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8}, "ML cuts per bin for hb"}; } dielectroncuts; DimuonCut fDimuonCut; @@ -328,8 +338,8 @@ struct Dilepton { o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; o2::framework::Service ccdb; - int mRunNumber; - float d_bz; + int mRunNumber{0}; + float d_bz{0}; o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; // static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; @@ -793,14 +803,14 @@ struct Dilepton { if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { // please call this at the end of DefineDileptonCut std::vector binsML{}; - binsML.reserve(dielectroncuts.binsMl.value.size()); - for (size_t i = 0; i < dielectroncuts.binsMl.value.size(); i++) { - binsML.emplace_back(dielectroncuts.binsMl.value[i]); + binsML.reserve(dielectroncuts.binsMLPID.value.size()); + for (size_t i = 0; i < dielectroncuts.binsMLPID.value.size(); i++) { + binsML.emplace_back(dielectroncuts.binsMLPID.value[i]); } std::vector thresholdsML{}; - thresholdsML.reserve(dielectroncuts.cutsMl.value.size()); - for (size_t i = 0; i < dielectroncuts.cutsMl.value.size(); i++) { - thresholdsML.emplace_back(dielectroncuts.cutsMl.value[i]); + thresholdsML.reserve(dielectroncuts.cutsMLPID.value.size()); + for (size_t i = 0; i < dielectroncuts.cutsMLPID.value.size(); i++) { + thresholdsML.emplace_back(dielectroncuts.cutsMLPID.value[i]); } fDielectronCut.SetMLThresholds(binsML, thresholdsML); } // end of PID ML @@ -837,6 +847,26 @@ struct Dilepton { fDimuonCut.EnableTTCA(dimuoncuts.enableTTCA); } + template + bool foundHFSV(TTrack const& track) + { + int ptbin = lower_bound(dielectroncuts.binsMLSCT.value.begin(), dielectroncuts.binsMLSCT.value.end(), track.pt()) - dielectroncuts.binsMLSCT.value.begin() - 1; + if (ptbin < 0) { + ptbin = 0; + } else if (static_cast(dielectroncuts.binsMLSCT.value.size()) - 2 < ptbin) { + ptbin = static_cast(dielectroncuts.binsMLSCT.value.size()) - 2; + } + + for (int i = 0; i < static_cast(track.nSV()); i++) { + auto probaSCT = track.probaSCT(i); + // LOGF(info, "track.globalIndex() = %d, pt = %f, i = %d, probaSCT[0] = %f, probaSCT[1] = %f, probaSCT[2] = %f, probaSCT[3] = %f", track.globalIndex(), track.pt(), i, probaSCT[0], probaSCT[1], probaSCT[2], probaSCT[3]); + if (probaSCT[1] > dielectroncuts.cutsMLSCTeT_prompt_hc.value[ptbin] || probaSCT[2] > dielectroncuts.cutsMLSCTeT_nonprompt_hc.value[ptbin] || probaSCT[3] > dielectroncuts.cutsMLSCTeT_hb.value[ptbin]) { + return true; + } + } + return false; + } + template bool isGoodQvector(TQvectors const& qvectors) { @@ -889,6 +919,11 @@ struct Dilepton { return false; } } + if constexpr (withSCT) { + if (foundHFSV(t1) || foundHFSV(t2)) { + return false; + } + } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { if (!cut.template IsSelectedTrack(t1) || !cut.template IsSelectedTrack(t2)) { return false; @@ -1244,7 +1279,8 @@ struct Dilepton { using FilteredMyCollisions = o2::soa::Filtered; o2::framework::SliceCache cache; - o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + // o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; o2::framework::expressions::Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc; o2::framework::expressions::Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); @@ -1266,10 +1302,14 @@ struct Dilepton { ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfb >= static_cast(0)); - o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); - o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); + // o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); + // o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); + using TElectronType = std::tuple_element_t<0, std::tuple>; + o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); + o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); - o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + // o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track; o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); o2::framework::expressions::Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), @@ -1545,6 +1585,13 @@ struct Dilepton { return false; } } + + if constexpr (withSCT) { + if (foundHFSV(t1) || foundHFSV(t2)) { + return false; + } + } + } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { if (!cut.IsSelectedTrack(t1) || !cut.IsSelectedTrack(t2)) { return false; diff --git a/PWGEM/Dilepton/DataModel/dileptonTables.h b/PWGEM/Dilepton/DataModel/dileptonTables.h index a3a7d52b4e2..27d06147986 100644 --- a/PWGEM/Dilepton/DataModel/dileptonTables.h +++ b/PWGEM/Dilepton/DataModel/dileptonTables.h @@ -697,7 +697,7 @@ DECLARE_SOA_COLUMN(BDTScoreNonpromptHcUINT8, bdtScoreNonpromptHcUINT8, std::vect DECLARE_SOA_COLUMN(BDTScoreHbUINT8, bdtScoreHbUINT8, std::vector); //! scaling factor is 255. DECLARE_SOA_COLUMN(HadronType, hadronType, std::vector); //! 0:track, 1:K0S, 2:Lambda, 3:AntiLambda, 4:XiMinus, 5:XiPlus, 6:OmegaMinus, 7:OmegaPlus -DECLARE_SOA_DYNAMIC_COLUMN(ProbaSCT, probaSCT, [](std::vector p0, std::vector p1, std::vector p2, std::vector p3, std::vector type, int index) -> std::array { +DECLARE_SOA_DYNAMIC_COLUMN(ProbaSCT, probaSCT, [](gsl::span p0, gsl::span p1, gsl::span p2, gsl::span p3, gsl::span type, const int index) -> std::array { return std::array{ std::nextafter(p0[index] / 255.f, std::numeric_limits::infinity()), std::nextafter(p1[index] / 255.f, std::numeric_limits::infinity()), @@ -705,7 +705,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(ProbaSCT, probaSCT, [](std::vector p0, std:: std::nextafter(p3[index] / 255.f, std::numeric_limits::infinity()), static_cast(type[index])}; }); -DECLARE_SOA_DYNAMIC_COLUMN(NSV, nSV, [](std::vector type) -> size_t { return type.size(); }); +DECLARE_SOA_DYNAMIC_COLUMN(NSV, nSV, [](gsl::span type) -> size_t { return type.size(); }); DECLARE_SOA_COLUMN(ITSNSigmaEl, itsNSigmaEl, float); //! DECLARE_SOA_COLUMN(ITSNSigmaMu, itsNSigmaMu, float); //! diff --git a/PWGEM/Dilepton/Tasks/CMakeLists.txt b/PWGEM/Dilepton/Tasks/CMakeLists.txt index 473e24c969d..c872babef87 100644 --- a/PWGEM/Dilepton/Tasks/CMakeLists.txt +++ b/PWGEM/Dilepton/Tasks/CMakeLists.txt @@ -90,6 +90,11 @@ o2physics_add_dpl_workflow(dielectron-mc PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMDileptonCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(dielectron-sct + SOURCES dielectronSCT.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMDileptonCore O2Physics::EventFilteringUtils + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(dimuon SOURCES dimuon.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMDileptonCore O2Physics::EventFilteringUtils diff --git a/PWGEM/Dilepton/Tasks/dielectron.cxx b/PWGEM/Dilepton/Tasks/dielectron.cxx index 042831bff30..27f5d13802e 100644 --- a/PWGEM/Dilepton/Tasks/dielectron.cxx +++ b/PWGEM/Dilepton/Tasks/dielectron.cxx @@ -25,5 +25,5 @@ using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask>(cfgc, TaskName{"dielectron"})}; + adaptAnalysisTask>(cfgc, TaskName{"dielectron"})}; } diff --git a/PWGEM/Dilepton/Tasks/dielectronSCT.cxx b/PWGEM/Dilepton/Tasks/dielectronSCT.cxx new file mode 100644 index 00000000000..646069802b5 --- /dev/null +++ b/PWGEM/Dilepton/Tasks/dielectronSCT.cxx @@ -0,0 +1,29 @@ +// 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. +// +// ======================== +// +// This code is for dielectron analyses. +// Please write to: daiki.sekihata@cern.ch + +#include "PWGEM/Dilepton/Core/Dilepton.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask>(cfgc, TaskName{"dielectron-sct"})}; +} diff --git a/PWGEM/Dilepton/Tasks/dimuon.cxx b/PWGEM/Dilepton/Tasks/dimuon.cxx index be0a7d8386b..a964f00a1c8 100644 --- a/PWGEM/Dilepton/Tasks/dimuon.cxx +++ b/PWGEM/Dilepton/Tasks/dimuon.cxx @@ -25,5 +25,5 @@ using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask>(cfgc, TaskName{"dimuon"})}; + adaptAnalysisTask>(cfgc, TaskName{"dimuon"})}; } diff --git a/PWGEM/Dilepton/Utils/ElectronModule.h b/PWGEM/Dilepton/Utils/ElectronModule.h index c2d7d343c75..99a40c8d28b 100644 --- a/PWGEM/Dilepton/Utils/ElectronModule.h +++ b/PWGEM/Dilepton/Utils/ElectronModule.h @@ -278,7 +278,7 @@ struct cfgDFeT : o2::framework::ConfigurableGroup { o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.4, 0.8, 1.0, 2.0, 4, 20}, "Bin limits for ML application"}; // o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9}, "ML cuts per bin"}; - o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"ptH", "impPar3DHinSigma", "tpcNSigmaKa", "signedMassLH", "dcaLH", "cpa", "cpaXY", "impPar3DinSigma", "decayLength3DinSigma", "decayLengthXYinSigma"}, "Names of ML model input features"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"ptH", "impPar3DHinSigma", "tpcNSigmaKa", "signedMassLH", "dcaLH", "cpa", "cpaXY", "decayLength3DinSigma", "decayLengthXYinSigma"}, "Names of ML model input features"}; o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "ptL", "Names of ML model binning feature"}; o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; @@ -295,7 +295,7 @@ struct cfgDFeV0 : o2::framework::ConfigurableGroup { o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.4, 0.8, 1.0, 2.0, 4, 20}, "Bin limits for ML application"}; // o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9}, "ML cuts per bin"}; - o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"ptH", "impPar3DHinSigma", "massLH", "dcaLH", "cpa", "cpaXY", "impPar3DinSigma", "decayLength3DinSigma", "decayLengthXYinSigma"}, "Names of ML model input features"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"ptH", "impPar3DHinSigma", "massLH", "dcaLH", "cpa", "cpaXY", "decayLength3DinSigma", "decayLengthXYinSigma"}, "Names of ML model input features"}; o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "ptL", "Names of ML model binning feature"}; o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; @@ -312,7 +312,7 @@ struct cfgDFeC : o2::framework::ConfigurableGroup { o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.4, 0.8, 1.0, 2.0, 4, 20}, "Bin limits for ML application"}; // o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9}, "ML cuts per bin"}; - o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"ptH", "impPar3DHinSigma", "massLH", "dcaLH", "cpa", "cpaXY", "impPar3DinSigma", "decayLength3DinSigma", "decayLengthXYinSigma"}, "Names of ML model input features"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"ptH", "impPar3DHinSigma", "massLH", "dcaLH", "cpa", "cpaXY", "decayLength3DinSigma", "decayLengthXYinSigma"}, "Names of ML model input features"}; o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "ptL", "Names of ML model binning feature"}; o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; @@ -1665,7 +1665,7 @@ class ElectronModule registry.fill(HIST("SCT/eT/hMass"), eTpair.mass); if (eTpair.isOK && fConfigDFeT.useML) { o2::analysis::pwgem::dilepton::sct::candidate candidate; - fillCandidate(candidate, eTpair, trackParCov, mDcaInfoCov); + fillCandidate(candidate, eTpair, hadronParCov, mDcaInfoCov); candidate.ptL = trackParCov.getPt(); candidate.signLH = electron.sign() * hadron.sign(); candidate.signedMassLH = electron.sign() * hadron.sign() * eTpair.mass; @@ -2167,6 +2167,7 @@ class ElectronModule candidate.impPar3DHinSigma = dca3DinSigmaOTF(candidate.impParXYH, candidate.impParZH, trackParCov.getSigmaY2(), trackParCov.getSigmaZ2(), trackParCov.getSigmaZY()); candidate.signLH = 0; candidate.dcaLH = pair.dca2legs; + candidate.logChi2PCA = std::log10(std::pow(pair.dca2legs, 2)); candidate.massLH = pair.mass; candidate.signedMassLH = pair.mass; candidate.cpa = pair.cospa; diff --git a/PWGEM/Dilepton/Utils/MlResponseSCT.h b/PWGEM/Dilepton/Utils/MlResponseSCT.h index 8a00659ecc0..c55e10da8c4 100644 --- a/PWGEM/Dilepton/Utils/MlResponseSCT.h +++ b/PWGEM/Dilepton/Utils/MlResponseSCT.h @@ -63,6 +63,7 @@ enum class InputFeaturesSCT : uint8_t { impPar3DHinSigma, signLH, dcaLH, + logChi2PCA, massLH, signedMassLH, missingPtNuPerpToFD, @@ -109,6 +110,7 @@ struct candidate { // LH pair information int signLH{0}; float dcaLH{0}; + float logChi2PCA{0}; float massLH{0}; float signedMassLH{0}; float missingPtNuPerpToFD{0}; @@ -162,6 +164,7 @@ class MlResponseSCT : public MlResponse CHECK_AND_FILL_TRACK(impPar3DHinSigma); CHECK_AND_FILL_TRACK(signLH); CHECK_AND_FILL_TRACK(dcaLH); + CHECK_AND_FILL_TRACK(logChi2PCA); CHECK_AND_FILL_TRACK(massLH); CHECK_AND_FILL_TRACK(signedMassLH); CHECK_AND_FILL_TRACK(missingPtNuPerpToFD); @@ -240,6 +243,7 @@ class MlResponseSCT : public MlResponse FILL_MAP_TRACK(impPar3DHinSigma), FILL_MAP_TRACK(signLH), FILL_MAP_TRACK(dcaLH), + FILL_MAP_TRACK(logChi2PCA), FILL_MAP_TRACK(massLH), FILL_MAP_TRACK(signedMassLH), FILL_MAP_TRACK(missingPtNuPerpToFD),