Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TrigADComboHypoTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGADCOMBOHYPO_TRIGADCOMBOHYPOTOOL_H
6 #define TRIGADCOMBOHYPO_TRIGADCOMBOHYPOTOOL_H
7 
10 
11 #include "xAODJet/Jet.h"
12 #include "xAODMuon/Muon.h"
13 #include "xAODEgamma/Electron.h"
14 #include "xAODEgamma/Photon.h"
15 #include "xAODTau/TauJet.h"
17 
19 
20 #include <iostream>
21 #include <cmath>
22 #include <numbers>
23 
25 
26 public:
27  TrigADComboHypoTool(const std::string& type, const std::string& name, const IInterface* parent);
28  virtual StatusCode initialize() override;
29  //need to see all jets at once not a series of combinations
30  virtual StatusCode decide(Combo::LegDecisionsMap& passingLegs, const EventContext& ctx) const override;
31 
32 private:
33  Gaudi::Property<unsigned int> m_maxjs{this, "max_jets",{6}, "Maximum number of jets allowed in the event"};
34  Gaudi::Property<unsigned int> m_maxes{this, "max_electrons",{3}, "Maximum number of electrons allowed in the event"};
35  Gaudi::Property<unsigned int> m_maxms{this, "max_muons",{3}, "Maximum number of muons allowed in the event"};
36  Gaudi::Property<unsigned int> m_maxgs{this, "max_photons",{3}, "Maximum number of photons allowed in the event"};
37 
38  Gaudi::Property<double> m_adScoreThres{this, "adScoreThres", {0.}, "HLT AD score threshold"};
39 
40  bool getAdDecision(
41  const std::vector<const xAOD::Jet*> &input_jets,
42  const std::vector<const xAOD::Muon*> &input_muons,
43  const std::vector<const xAOD::Electron*> &input_electrons,
44  const std::vector<const xAOD::Photon*> &input_photons,
45  const std::vector<const xAOD::TauJet*> &input_taus,
46  const std::vector<const xAOD::TrigMissingET*> &input_mets) const;
47 
48  float runInference(std::vector<float> &tensor) const;
49 
50  ServiceHandle<AthOnnx::IOnnxRuntimeSvc> m_svc{this, "ONNXRuntimeSvc", "AthOnnx::OnnxRuntimeSvc", "TrigADComboHypoTool ONNXRuntimeSvc"};
51 
52  std::unique_ptr<Ort::Session> m_session;
53 
54  std::vector<const char *> m_input_node_names;
55 
56  std::vector<const char *> m_output_node_names;
57 
58  std::vector<int64_t> m_input_node_dims;
59 
60  // This path needs to point to the ATLAS calibration area (https://atlas-groupdata.web.cern.ch/atlas-groupdata/, /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/)
61  Gaudi::Property<std::string> m_modelFileName{this, "ModelFileName", "TrigAnomalyDetectionHypo/2025-03-10/HLT_AD_v1.onnx"}; // main area v1 (2025.03.10)
62 
63 };
64 
65 #endif
TrigADComboHypoTool::m_maxes
Gaudi::Property< unsigned int > m_maxes
Definition: TrigADComboHypoTool.h:34
TrigADComboHypoTool::m_maxjs
Gaudi::Property< unsigned int > m_maxjs
Definition: TrigADComboHypoTool.h:33
TrigMissingET.h
Jet.h
Muon.h
TrigADComboHypoTool
Definition: TrigADComboHypoTool.h:24
TrigADComboHypoTool::m_input_node_names
std::vector< const char * > m_input_node_names
Definition: TrigADComboHypoTool.h:54
TrigADComboHypoTool::m_session
std::unique_ptr< Ort::Session > m_session
Definition: TrigADComboHypoTool.h:52
TrigADComboHypoTool::decide
virtual StatusCode decide(Combo::LegDecisionsMap &passingLegs, const EventContext &ctx) const override
retrieves the decisions associated to this decId, make their combinations and apply the algorithm
Definition: TrigADComboHypoTool.cxx:96
ComboHypoToolBase
Base class for tools which cut on properties of multi-object or multi-leg chains. User should derive ...
Definition: ComboHypoToolBase.h:26
Combo::LegDecisionsMap
std::map< TrigCompositeUtils::DecisionID, std::vector< ElementLink< TrigCompositeUtils::DecisionContainer > > > LegDecisionsMap
LegDecisionsMap For a given chain leg key, this map holds all Decision Objects which are active on th...
Definition: IComboHypoTool.h:28
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
TrigADComboHypoTool::m_maxgs
Gaudi::Property< unsigned int > m_maxgs
Definition: TrigADComboHypoTool.h:36
TrigCompositeUtils.h
TrigADComboHypoTool::TrigADComboHypoTool
TrigADComboHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigADComboHypoTool.cxx:24
Photon.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigADComboHypoTool::m_svc
ServiceHandle< AthOnnx::IOnnxRuntimeSvc > m_svc
Definition: TrigADComboHypoTool.h:50
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ComboHypoToolBase.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TrigADComboHypoTool::m_maxms
Gaudi::Property< unsigned int > m_maxms
Definition: TrigADComboHypoTool.h:35
TrigADComboHypoTool::initialize
virtual StatusCode initialize() override
Definition: TrigADComboHypoTool.cxx:26
IOnnxRuntimeSvc.h
TrigADComboHypoTool::runInference
float runInference(std::vector< float > &tensor) const
Definition: TrigADComboHypoTool.cxx:343
TrigADComboHypoTool::m_input_node_dims
std::vector< int64_t > m_input_node_dims
Definition: TrigADComboHypoTool.h:58
TauJet.h
TrigADComboHypoTool::m_output_node_names
std::vector< const char * > m_output_node_names
Definition: TrigADComboHypoTool.h:56
Electron.h
TrigADComboHypoTool::m_adScoreThres
Gaudi::Property< double > m_adScoreThres
Definition: TrigADComboHypoTool.h:38
TrigADComboHypoTool::m_modelFileName
Gaudi::Property< std::string > m_modelFileName
Definition: TrigADComboHypoTool.h:61
TrigADComboHypoTool::getAdDecision
bool getAdDecision(const std::vector< const xAOD::Jet * > &input_jets, const std::vector< const xAOD::Muon * > &input_muons, const std::vector< const xAOD::Electron * > &input_electrons, const std::vector< const xAOD::Photon * > &input_photons, const std::vector< const xAOD::TauJet * > &input_taus, const std::vector< const xAOD::TrigMissingET * > &input_mets) const
Definition: TrigADComboHypoTool.cxx:234
ServiceHandle< AthOnnx::IOnnxRuntimeSvc >