diff --git a/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/FJvtSelectionTool.h b/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/FJvtSelectionTool.h index d20037e21f1fe40c485a290611cbb0135741709b..fdb680686293938005aa3773a458e9e38f0346e6 100644 --- a/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/FJvtSelectionTool.h +++ b/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/FJvtSelectionTool.h @@ -18,10 +18,6 @@ namespace CP { virtual StatusCode initialize() override; private: - // Used to correctly initialize the ReadDecorHandle - Gaudi::Property<std::string> m_jetContainer{ - this, "JetContainer", "", - "The name of the jet container, used to correctly initialize the read handles"}; Gaudi::Property<std::string> m_wp{ this, "WorkingPoint", "Loose", "The working point to use. Set to 'Custom' to manually set the values"}; diff --git a/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/JvtSelectionTool.h b/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/JvtSelectionTool.h index 05a5a4a3768d96fe8be92eceda4d8c616040fc5a..b518685e712c8877fda63ae32a7556d57607bea5 100644 --- a/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/JvtSelectionTool.h +++ b/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/JvtSelectionTool.h @@ -19,10 +19,6 @@ namespace CP { virtual StatusCode initialize() override; private: - // Used to correctly initialize the ReadDecorHandle - Gaudi::Property<std::string> m_jetContainer{ - this, "JetContainer", "", - "The name of the jet container, used to correctly initialize the read handles"}; Gaudi::Property<bool> m_isPFlow{ this, "IsPFlow", true, "Whether the jet collection is PFlow or not. Used to configure the correct working " diff --git a/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/JvtSelectionToolBase.h b/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/JvtSelectionToolBase.h index d21b89490f5bd4b6e4f810bf7ada95b9e9f5f51e..2e0038d0c7d4c80fabafe2e76fd617071a413dc1 100644 --- a/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/JvtSelectionToolBase.h +++ b/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/JvtSelectionToolBase.h @@ -5,14 +5,15 @@ #ifndef JETJVTEFFICIENCY_JVTSELECTIONTOOLBASE_H #define JETJVTEFFICIENCY_JVTSELECTIONTOOLBASE_H -#include "AsgDataHandles/ReadDecorHandleKey.h" +#include "AsgDataHandles/WriteDecorHandleKey.h" #include "AsgTools/AsgTool.h" #include "AsgTools/PropertyWrapper.h" #include "PATCore/IAsgSelectionTool.h" +#include "JetInterface/IJetDecorator.h" #include "xAODJet/JetContainer.h" namespace CP { - class JvtSelectionToolBase : public asg::AsgTool, virtual public IAsgSelectionTool { + class JvtSelectionToolBase : public asg::AsgTool, virtual public IAsgSelectionTool, virtual public IJetDecorator { public: using asg::AsgTool::AsgTool; virtual ~JvtSelectionToolBase() = default; @@ -24,6 +25,9 @@ namespace CP { virtual asg::AcceptData accept(const xAOD::IParticle *jet) const override; protected: + Gaudi::Property<std::string> m_jetContainer{ + this, "JetContainer", "", + "The name of the jet container, used to correctly initialize the read handles"}; Gaudi::Property<float> m_minPtForJvt{ this, "MinPtForJvt", 20e3, "Accept all jets with pT below this"}; Gaudi::Property<float> m_maxPtForJvt{ @@ -36,6 +40,9 @@ namespace CP { Gaudi::Property<std::string> m_jetEtaName{ this, "JetEtaName", "eta", "The name of the jet eta to use."}; + SG::WriteDecorHandleKey<xAOD::JetContainer> m_passJvtKey{ + this, "PassFlagName", "passJvt", "SG key for output pass-JVT decoration"}; + // The template AcceptInfo object asg::AcceptInfo m_info; // The index to set in the info. I suspect that this is always 0 but better to be safe @@ -46,6 +53,8 @@ namespace CP { virtual bool isInRange(const xAOD::IParticle *jet) const; // Check the score virtual bool select(const xAOD::IParticle *jet) const = 0; + // Decorate jets with decision flags + virtual StatusCode decorate(const xAOD::JetContainer& jets) const override; }; } // namespace CP diff --git a/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/NNJvtSelectionTool.h b/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/NNJvtSelectionTool.h index 91a1dda851eeda33b7f7f14564ed4c109d1a20ff..f7c778af20a95a48e78ea4131687d84cb3dcd976 100644 --- a/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/NNJvtSelectionTool.h +++ b/Reconstruction/Jet/JetJvtEfficiency/JetJvtEfficiency/NNJvtSelectionTool.h @@ -20,10 +20,6 @@ namespace CP { virtual StatusCode initialize() override; private: - // Used to correctly initialize the ReadDecorHandle - Gaudi::Property<std::string> m_jetContainer{ - this, "JetContainer", "", - "The name of the jet container, used to correctly initialize the read handles"}; Gaudi::Property<std::string> m_wp{ this, "WorkingPoint", "FixedEffPt", "The working point to use"}; Gaudi::Property<std::string> m_configDir{ diff --git a/Reconstruction/Jet/JetJvtEfficiency/Root/JvtSelectionToolBase.cxx b/Reconstruction/Jet/JetJvtEfficiency/Root/JvtSelectionToolBase.cxx index 62bdd271bff75da68cfd87fe48e21b0396d8b08e..2f6ee4406392b7a940dcd15ef22ee06a1fbf963c 100644 --- a/Reconstruction/Jet/JetJvtEfficiency/Root/JvtSelectionToolBase.cxx +++ b/Reconstruction/Jet/JetJvtEfficiency/Root/JvtSelectionToolBase.cxx @@ -3,13 +3,16 @@ */ #include "JetJvtEfficiency/JvtSelectionToolBase.h" -#include "AsgDataHandles/ReadDecorHandle.h" +#include "AsgDataHandles/WriteDecorHandle.h" namespace CP { StatusCode JvtSelectionToolBase::initialize() { m_etaAcc = SG::ConstAccessor<float>(m_jetEtaName); m_cutPos = m_info.addCut("Jvt", "Whether the jet passes the Jvt selection"); + if (!m_passJvtKey.empty()) m_passJvtKey = m_jetContainer + "." + m_passJvtKey.key(); + ATH_CHECK(m_passJvtKey.initialize(SG::AllowEmpty)); + return StatusCode::SUCCESS; } @@ -31,4 +34,10 @@ namespace CP { float eta = m_etaAcc(*jet); return std::abs(eta) >= m_minEta && std::abs(eta) <= m_maxEta; } + + StatusCode JvtSelectionToolBase::decorate(const xAOD::JetContainer& jets) const { + SG::WriteDecorHandle<xAOD::JetContainer, char> passJvtHandle(m_passJvtKey); + for(const xAOD::Jet* jet : jets) passJvtHandle(*jet) = select(jet); + return StatusCode::SUCCESS; + } } // namespace CP diff --git a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexNNTagger.h b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexNNTagger.h index 0f226aef41669b2fddb7fc498f2a1b39514efa62..5192a8c741553799e69cecfbd5f05c64add5d543 100644 --- a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexNNTagger.h +++ b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexNNTagger.h @@ -31,7 +31,6 @@ #include "AsgDataHandles/ReadDecorHandleKey.h" #include "AsgDataHandles/WriteDecorHandleKey.h" #include "JetInterface/IJetDecorator.h" -#include "JetMomentTools/NNJvtBinning.h" #include "xAODJet/JetContainer.h" #include "xAODTracking/VertexContainer.h" @@ -40,9 +39,6 @@ namespace JetPileupTag { - // Because there is no SystemOfUnits.h in AnalysisBase - constexpr float GeV=1e3; - class JetVertexNNTagger : public asg::AsgTool, virtual public IJetDecorator @@ -188,8 +184,6 @@ namespace JetPileupTag { /// Internal members for interpreting jet inputs /// and NN configuration std::unique_ptr<lwt::generic::FastGraph<double> > m_lwnn {nullptr}; - // The Jvt bins and cut map - NNJvtCutMap m_cutMap; // Generically needed for moment tools Gaudi::Property<std::string> m_jetContainerName{this,"JetContainer", "", "SG key for the input jet container"}; @@ -202,15 +196,8 @@ namespace JetPileupTag { // NN configuration Gaudi::Property<std::string> m_TrkAugNNConfigDir{this, "TrkAugNNConfigDir", "JetPileupTag/NNJvt/HLT-2025-02-05", "PathResolver-accessible directory holding config files"}; Gaudi::Property<std::string> m_TrkAugNNParamFileName{this, "TrkAugNNParamFile", "TrkAugNNJVT.Network.graph.HLT.json", "Name of json file containing network parameters"}; - Gaudi::Property<std::string> m_TrkAugNNCutFileName{this, "TrkAugNNCutFile", "TrkAugNNJVT.Cuts.HLT.json", "Name of json file containing network parameters"}; Gaudi::Property<std::string> m_NNConfigDir{this,"NNConfigDir", "JetPileupTag/NNJvt/2022-03-22", "PathResolver-accessible directory holding config files"}; Gaudi::Property<std::string> m_NNParamFileName{this,"NNParamFile", "NNJVT.Network.graph.Offline.Nonprompt_All_MaxWeight.json", "Name of json file containing network parameters"}; - Gaudi::Property<std::string> m_NNCutFileName{this,"NNCutFile", "NNJVT.Cuts.FixedEffPt.Offline.Nonprompt_All_MaxW.json", "Name of json file containing network parameters"}; - - - // Additional steering - Gaudi::Property<float> m_maxpt_for_cut{this,"MaxPtForCut", 60*GeV, "Jet pt above which no cut is applied"}; - // Access to inputs from StoreGate SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainer_key{this, "VertexContainer", "PrimaryVertices", "SG key for input vertex container"}; @@ -222,8 +209,6 @@ namespace JetPileupTag { SG::WriteDecorHandleKey<xAOD::JetContainer> m_jvtKey{this, "JVTName", "NNJvt", "SG key for output JVT decoration"}; SG::WriteDecorHandleKey<xAOD::JetContainer> m_rptKey{this, "RpTName", "NNJvtRpt", "SG key for output RpT decoration"}; - SG::WriteDecorHandleKey<xAOD::JetContainer> m_passJvtKey{this, "passJvtName", "NNJvtPass", "SG key for output pass-JVT decoration"}; - //new nnjvt input variables diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetVertexNNTagger.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetVertexNNTagger.cxx index 31fc8be9adbbc0485bb8181e0eea7b79ee74a164..220bb2bd2376f6eb05f0f5ae56e2945849a050df 100644 --- a/Reconstruction/Jet/JetMomentTools/Root/JetVertexNNTagger.cxx +++ b/Reconstruction/Jet/JetMomentTools/Root/JetVertexNNTagger.cxx @@ -46,18 +46,15 @@ namespace JetPileupTag { // Determine which NNJVT configuration to use based on the flag std::string configDir; std::string paramFileName; - std::string cutFileName; if (m_useTrkAugNN) { ATH_MSG_INFO("Using Track-Augmented NN configuration."); configDir = m_TrkAugNNConfigDir; paramFileName = m_TrkAugNNParamFileName; - cutFileName = m_TrkAugNNCutFileName; } else { ATH_MSG_INFO("Using Classic NN configuration."); configDir = m_NNConfigDir; paramFileName = m_NNParamFileName; - cutFileName = m_NNCutFileName; } @@ -95,26 +92,13 @@ namespace JetPileupTag { // Primarily using double to take advantage of build_vector later m_lwnn = std::make_unique<lwt::generic::FastGraph<double> >(cfg,order); - std::string cutsPath = PathResolverFindCalibFile(configDir+"/"+cutFileName); - ATH_MSG_INFO(" Reading JVT NN cut file from:\n " << cutFileName << "\n"); - ATH_MSG_INFO(" resolved in :\n " << cutsPath << "\n\n"); - std::ifstream fcuts( cutsPath.c_str() ); - if ( !fcuts.is_open() ) { - ATH_MSG_ERROR( "Error opening cuts file: " << cutFileName ); - ATH_MSG_ERROR( "Are you sure that the file exists at this path?" ); - return StatusCode::FAILURE; - } - m_cutMap = NNJvtCutMap::fromJSON(fcuts); - m_jvfCorrKey = m_jetContainerName + "." + m_jvfCorrKey.key(); m_sumPtTrkKey = m_jetContainerName + "." + m_sumPtTrkKey.key(); m_trkWidthKey = m_jetContainerName + "." + m_trkWidthKey.key(); m_numTrkKey = m_jetContainerName + "." + m_numTrkKey.key(); m_jvtKey = m_jetContainerName + "." + m_jvtKey.key(); if (!m_rptKey.empty()) - m_rptKey = m_jetContainerName + "." + m_rptKey.key(); - if (!m_passJvtKey.empty()) - m_passJvtKey = m_jetContainerName + "." + m_passJvtKey.key(); + m_rptKey = m_jetContainerName + "." + m_rptKey.key(); m_rptPerVertexKey = m_jetContainerName + "." + m_rptPerVertexKey.key(); m_DtrkWidthKey = m_jetContainerName + "." + m_DtrkWidthKey.key(); m_DnumTrkKey = m_jetContainerName + "." + m_DnumTrkKey.key(); @@ -137,7 +121,6 @@ namespace JetPileupTag { // Suppress output dependencies renounce(m_jvtKey); renounce(m_rptKey); - renounce(m_passJvtKey); if (m_useTrkAugNN) { renounce(m_rptPerVertexKey); renounce(m_DtrkWidthKey); @@ -157,7 +140,6 @@ namespace JetPileupTag { ATH_CHECK(m_numTrkKey.initialize(m_useTrkAugNN)); ATH_CHECK(m_jvtKey.initialize()); ATH_CHECK(m_rptKey.initialize(SG::AllowEmpty)); - ATH_CHECK(m_passJvtKey.initialize(SG::AllowEmpty)); ATH_CHECK(m_rptKey.initialize(SG::AllowEmpty)); ATH_CHECK(m_rptPerVertexKey.initialize(m_useTrkAugNN)); ATH_CHECK(m_DtrkWidthKey.initialize(m_useTrkAugNN)); @@ -367,8 +349,6 @@ namespace JetPileupTag { SG::WriteDecorHandle<xAOD::JetContainer, float> jvtHandle(m_jvtKey); - SG::WriteDecorHandle<xAOD::JetContainer, char> passJvtHandle(m_passJvtKey); - std::unique_ptr<TrkAugHandleHolder> trkAugHandleHolder; std::unique_ptr<ClassicHandleHolder> classicHandleHolder; @@ -389,12 +369,10 @@ namespace JetPileupTag { static constexpr float invalidJvt = -1; static constexpr float invalidRpt = 0; - static constexpr char invalidPassJvt = true; for(const xAOD::Jet* jet : jetCont) { float jvt = invalidJvt; float rpt = invalidRpt; - char passJvt = invalidPassJvt; // consider only leading numVertices for difference calucations. //Vertices ordered acccording to descending SumTrkPt_vxi, for i>0. SumTrkPt_vx0 is for HS vertex. @@ -405,36 +383,23 @@ namespace JetPileupTag { if (HSvertex->vertexType() == xAOD::VxType::PriVtx) { - ATH_MSG_VERBOSE("Processing jet with pt: " << jet->pt() << " and eta: " << jet->eta()); - size_t ptbin, etabin; - - std::vector<float> features; - if (m_useTrkAugNN) { TrackMomentStruct trackMoment = trkAugHandleHolder->getTrackMoments(*jet); - std::vector<float> trkwidth = trkAugHandleHolder->trkWidthHandle(*jet); - std::vector<int> numtrk = trkAugHandleHolder->numTrkHandle(*jet); - std::vector<float> sumpttrk = trkAugHandleHolder->sumPtTrkHandle(*jet); - - - //TrackMomentStruct trackMoment(numtrk, trkwidth, sumpttrk); - ATH_MSG_VERBOSE("Before sorting:"); ATH_MSG_VERBOSE("sumpttrk: " << vectorToString(sumpttrk)); ATH_MSG_VERBOSE("trkwidth: " << vectorToString(trkwidth)); ATH_MSG_VERBOSE("numtrk: " << vectorToString(numtrk)); - // Get resorted vertex indices based on sumpttrk values std::vector<size_t> resorted_vertex_indices = get_resorted_vertex_indices(sumpttrk, HSvertex); @@ -468,40 +433,32 @@ namespace JetPileupTag { dTrkWidthVec.assign(differences.dTrkWidth.begin(), differences.dTrkWidth.end()); dRptVec.assign(differences.dRpt.begin(), differences.dRpt.end()); - if (jet->pt() <= m_maxpt_for_cut && m_cutMap.edges(*jet, ptbin, etabin)) { - - ATH_MSG_VERBOSE("Defining NNJVT features"); - - // Use Track-Augmented NN features - features = { static_cast<float>(jet->pt()), - static_cast<float>(jet->eta()), - static_cast<float>(sortedTrackMoments.numTrk[0]), - sortedTrackMoments.trkWidth[0], - sortedTrackMoments.rpt[0], - static_cast<float>(differences.dNumTrk[0]), - differences.dTrkWidth[0], - differences.dRpt[0] }; - - ATH_MSG_VERBOSE("Using Track-Augmented NN features: " - << "jet_pt = " << jet->pt() - << ", jet_eta = " << jet->eta() - << ", numtrk_sorted[0] = " << sortedTrackMoments.numTrk[0] - << ", trkwidth_sorted[0] = " << sortedTrackMoments.trkWidth[0] - << ", rpt_per_vertex[0] = " << sortedTrackMoments.rpt[0] - << ", dnumtrk[0] = " << differences.dNumTrk[0] - << ", dtrkwidth[0] = " << differences.dTrkWidth[0] - << ", dRpt_per_vertex[0] = " << differences.dRpt[0]); - - - jvt = evaluateJvt(features); - float jvtCut = m_cutMap(ptbin, etabin); - passJvt = jvt > jvtCut; - - ATH_MSG_VERBOSE("Jet with pt " << jet->pt() << ", eta " << jet->eta() ); - ATH_MSG_VERBOSE("JVT cut for ptbin " << ptbin << ", etabin " << etabin << " = " << jvtCut); - ATH_MSG_VERBOSE("Evaluated JVT = " << jvt << ", jet " << (passJvt ? "passes" :"fails") << " working point" ); - } + ATH_MSG_VERBOSE("Defining NNJVT features"); + // Use Track-Augmented NN features + features = { static_cast<float>(jet->pt()), + static_cast<float>(jet->eta()), + static_cast<float>(sortedTrackMoments.numTrk[0]), + sortedTrackMoments.trkWidth[0], + sortedTrackMoments.rpt[0], + static_cast<float>(differences.dNumTrk[0]), + differences.dTrkWidth[0], + differences.dRpt[0] }; + + ATH_MSG_VERBOSE("Using Track-Augmented NN features: " + << "jet_pt = " << jet->pt() + << ", jet_eta = " << jet->eta() + << ", numtrk_sorted[0] = " << sortedTrackMoments.numTrk[0] + << ", trkwidth_sorted[0] = " << sortedTrackMoments.trkWidth[0] + << ", rpt_per_vertex[0] = " << sortedTrackMoments.rpt[0] + << ", dnumtrk[0] = " << differences.dNumTrk[0] + << ", dtrkwidth[0] = " << differences.dTrkWidth[0] + << ", dRpt_per_vertex[0] = " << differences.dRpt[0]); + + jvt = evaluateJvt(features); + + ATH_MSG_VERBOSE("Jet with pt " << jet->pt() << ", eta " << jet->eta() ); + ATH_MSG_VERBOSE("Evaluated JVT = " << jvt ); } else { @@ -512,53 +469,32 @@ namespace JetPileupTag { continue; } - // Calculate RpT and JVFCorr float jvfcorr = classicHandleHolder->jvfCorrHandle(*jet); - rpt = (jet->pt() != 0) ? (sumpttrk[HSvertex->index() - vertices[0]->index()] / jet->pt()) : invalidRpt; - ATH_MSG_VERBOSE("Defining NNJVT features"); - if (jet->pt() <= m_maxpt_for_cut && m_cutMap.edges(*jet, ptbin, etabin)) { + // Use standard NN features + features = {rpt, jvfcorr, static_cast<float>(ptbin), static_cast<float>(etabin)}; + ATH_MSG_VERBOSE("Using standard NN features: " + << "rpt = " << rpt + << ", corrJVF = " << jvfcorr + << ", ptbin = " << ptbin + << ", etabin = " << etabin); - // Use standard NN features - features = {rpt, jvfcorr, static_cast<float>(ptbin), static_cast<float>(etabin)}; - - ATH_MSG_VERBOSE("Using standard NN features: " - << "rpt = " << rpt - << ", corrJVF = " << jvfcorr - << ", ptbin = " << ptbin - << ", etabin = " << etabin); - - jvt = evaluateJvt(features); - - float jvtCut = m_cutMap(ptbin, etabin); - passJvt = jvt > jvtCut; - - ATH_MSG_VERBOSE("Jet with pt " << jet->pt() << ", eta " << jet->eta() ); - ATH_MSG_VERBOSE("JVT cut for ptbin " << ptbin << ", etabin " << etabin << " = " << jvtCut); - ATH_MSG_VERBOSE("Evaluated JVT = " << jvt << ", jet " << (passJvt ? "passes" :"fails") << " working point" ); - } - + jvt = evaluateJvt(features); + ATH_MSG_VERBOSE("Jet with pt " << jet->pt() << ", eta " << jet->eta() ); + ATH_MSG_VERBOSE("Evaluated JVT = " << jvt ); } - - - - } // Decorate jet jvtHandle(*jet) = jvt; - if (!passJvtHandle.key().empty()) - passJvtHandle(*jet) = passJvt; - - if (m_useTrkAugNN) { trkAugHandleHolder->decorate(*jet, rptVec, dNumTrkVec, dTrkWidthVec, dRptVec, sortedTrkWidthVec, sortedNumTrkVec); } else { diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetRecoSequencesConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetRecoSequencesConfig.py index da81bed5088aad9ae5e7f3f792c2e09be04bb8cb..9f7f32f08dae8b1a0f8b4f43192156f2a668ae5c 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetRecoSequencesConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetRecoSequencesConfig.py @@ -121,7 +121,7 @@ def StandardJetBuildDataDeps(flags, **jetRecoDict): if is_pflow: jetDef.modifiers += ["CaloEnergiesClus"] # Needed for FlowElement GSC if use_FS_tracking: - jetDef.modifiers += ["TrackMoments", "JVF", "JVT", "NNJVT_TrkAugV1"] # (NN)JVT not strictly needed for no-calib jets + jetDef.modifiers += ["TrackMoments", "JVF", "JVT", "NNJVT_TrkAugV1", "NNJVT_Sel_TrkAugV1"] # (NN)JVT not strictly needed for no-calib jets pj_name = JetRecConfig.getPJContName(jetDef.inputdef) if use_FS_tracking: @@ -174,7 +174,7 @@ def StandardJetRecoDataDeps(flags, **jetRecoDict): jetDef.modifiers = getCalibMods(flags, jetRecoDict, rhoKey) if use_FS_tracking: - jetDef.modifiers += ["JVT", "NNJVT_TrkAugV1"] + jetDef.modifiers += ["JVT", "NNJVT_TrkAugV1", "NNJVT_Sel_TrkAugV1"] if jetRecoDict["recoAlg"] == "a4": jetDef.modifiers += ["CaloQuality"] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/TriggerJetMods.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/TriggerJetMods.py index e53777402b7981ef7a11040113ce8290a3cfb4c9..4de7fa2d591e93c93f6e88c67d2c163d8aca88ed 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/TriggerJetMods.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/TriggerJetMods.py @@ -16,10 +16,17 @@ def getTrkAugNNJvtTool(jetdef, modspec): UseTrkAugNN = True, NNConfigDir = "JetPileupTag/NNJvt/HLT-2025-02-05", NNParamFile = "TrkAugNNJVT.Network.graph.HLT.json", - NNCutFile = "TrkAugNNJVT.Cuts.HLT.json", ) return nnjvt_trkaug +def getTrkAugNNJvtSelectionTool(jetdef, modspec): + nnjvt_sel = CompFactory.getComp("CP::NNJvtSelectionTool")( + "nnjvt_sel_trkaugv1", + ConfigDir = "JetPileupTag/NNJvt/HLT-2025-02-05", + ConfigFile = "TrkAugNNJVT.Cuts.HLT.json", + ) + return nnjvt_sel + # Many JetMoment tools need to know the name of the container they operate on. # We set the function below as the 'JetContainer' property so the config system # can assign the right name to the c++ tool. @@ -58,6 +65,12 @@ stdJetModifiers.update( prereqs = [ "mod:TrackMoments" ], JetContainer = _jetname, JVTName = 'NNJvtTrkAugV1', - passJvtName = 'NNJvtTrkAugV1Pass', + ) + + NNJVT_Sel_TrkAugV1 = JetModifier("NNJvtSelection", "nnjvt_sel_trkaugv1", + createfn=getTrkAugNNJvtSelectionTool, + prereqs = [ "mod:NNJVT_TrkAugV1" ], + JetContainer = _jetname, + PassFlagName = 'NNJvtTrkAugV1Pass', ) )