ATLAS Offline Software
GlobalLargeRDNNCalibration.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /* ***********************************************************************************\
6  * *
7  * Name: GlobalLargeRDNNCalibration *
8  * Purpose: Perform the DNN JES and JMS step of the large-R jets' calibration *
9  * *
10  * # Date Comments By *
11  * -- -------- -------------------------- ------------------------------------------ *
12  * 1 31/01/23 First Version G. Albouy, P.-A. Delsart *
13 \*************************************************************************************/
14 
15 
16 #ifndef JetCalibTools_GlobalLargeRDNNCalibration_H
17 #define JetCalibTools_GlobalLargeRDNNCalibration_H
18 
19 #include <string>
20 #include <vector>
21 
22 //xAOD EDM classes
24 #include "xAODJet/JetContainer.h"
25 
26 // Other packages includes
29 
30 // Local includes
33 
35 
36 public:
37  // Constructor/destructor/init
42 
47  GlobalLargeRDNNCalibration(const std::string& name);
48 
57  GlobalLargeRDNNCalibration(const std::string& name, TEnv * config, const TString& calibArea, bool dev);
58 
62  virtual ~GlobalLargeRDNNCalibration() ;
63 
68  virtual StatusCode initialize() override;
69 
70 
73  struct VarRetriever;
74 
75  protected:
76  // @brief Calibrates the jet, and decorates it with the calibration using the name "JetGNNCScaleMomentum"
77  // @param jet_reco The jet
78  // @param jetEventInfo A set of information about the event and jet
79  virtual StatusCode calibrate(xAOD::Jet& jet, JetEventInfo&) const override;
80 
81  private:
82 
88  std::vector<float> getJetFeatures( xAOD::Jet& jet_reco, JetEventInfo& jetEventInfo) const;
89 
90  std::vector<TString> m_NNInputs;
91  std::vector<double> m_eScales;
92  std::vector<double> m_NormOffsets;
93  std::vector<double> m_NormScales;
94  std::string m_modelFileName;
95 
96  std::vector<VarRetriever*> m_varretrievers;
97 
98  std::unique_ptr< Ort::Session > m_session;
99  std::vector<int64_t> m_input_node_dims;
100  std::vector<const char*> m_input_node_names;
101  std::vector<int64_t> m_output_node_dims;
102  std::vector<const char*> m_output_node_names;
103 
104  TEnv * m_config;
105  std::string m_calibArea;
106  bool m_devMode;
107 
108 
109 }; // Class GlobalLargeRDNNCalibration
110 
111 
112 #endif
GlobalLargeRDNNCalibration::m_varretrievers
std::vector< VarRetriever * > m_varretrievers
Definition: GlobalLargeRDNNCalibration.h:96
GlobalLargeRDNNCalibration::m_eScales
std::vector< double > m_eScales
Definition: GlobalLargeRDNNCalibration.h:91
GlobalLargeRDNNCalibration
Definition: GlobalLargeRDNNCalibration.h:34
GlobalLargeRDNNCalibration::getJetFeatures
std::vector< float > getJetFeatures(xAOD::Jet &jet_reco, JetEventInfo &jetEventInfo) const
Returns a vector of input features for the NN.
Definition: GlobalLargeRDNNCalibration.cxx:422
GlobalLargeRDNNCalibration::VarRetriever
VarRetriever is a generic class to access Jet and/or JetEventInfo variables.
Definition: GlobalLargeRDNNCalibration.cxx:90
GlobalLargeRDNNCalibration::m_output_node_dims
std::vector< int64_t > m_output_node_dims
Definition: GlobalLargeRDNNCalibration.h:101
GlobalLargeRDNNCalibration::m_NormScales
std::vector< double > m_NormScales
Definition: GlobalLargeRDNNCalibration.h:93
GlobalLargeRDNNCalibration::~GlobalLargeRDNNCalibration
virtual ~GlobalLargeRDNNCalibration()
The destructor.
Definition: GlobalLargeRDNNCalibration.cxx:201
GlobalLargeRDNNCalibration::m_output_node_names
std::vector< const char * > m_output_node_names
Definition: GlobalLargeRDNNCalibration.h:102
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
IJetCalibrationTool.h
GlobalLargeRDNNCalibration::m_input_node_dims
std::vector< int64_t > m_input_node_dims
Definition: GlobalLargeRDNNCalibration.h:99
GlobalLargeRDNNCalibration::m_NormOffsets
std::vector< double > m_NormOffsets
Definition: GlobalLargeRDNNCalibration.h:92
JetEventInfo
Definition: JetEventInfo.h:8
GlobalLargeRDNNCalibration::m_config
TEnv * m_config
Definition: GlobalLargeRDNNCalibration.h:104
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
GlobalLargeRDNNCalibration::initialize
virtual StatusCode initialize() override
Returns the charged fraction of a jet.
Definition: GlobalLargeRDNNCalibration.cxx:206
GlobalLargeRDNNCalibration::m_NNInputs
std::vector< TString > m_NNInputs
Definition: GlobalLargeRDNNCalibration.h:90
GlobalLargeRDNNCalibration::GlobalLargeRDNNCalibration
GlobalLargeRDNNCalibration()
The constructor.
Definition: GlobalLargeRDNNCalibration.cxx:182
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
GlobalLargeRDNNCalibration::calibrate
virtual StatusCode calibrate(xAOD::Jet &jet, JetEventInfo &) const override
Definition: GlobalLargeRDNNCalibration.cxx:318
ServiceHandle.h
EventInfo.h
IOnnxRuntimeSvc.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
GlobalLargeRDNNCalibration::m_calibArea
std::string m_calibArea
Definition: GlobalLargeRDNNCalibration.h:105
JetContainer.h
GlobalLargeRDNNCalibration::m_session
std::unique_ptr< Ort::Session > m_session
Definition: GlobalLargeRDNNCalibration.h:98
GlobalLargeRDNNCalibration::m_modelFileName
std::string m_modelFileName
Definition: GlobalLargeRDNNCalibration.h:94
GlobalLargeRDNNCalibration::m_devMode
bool m_devMode
Definition: GlobalLargeRDNNCalibration.h:106
JetCalibrationStep.h
GlobalLargeRDNNCalibration::m_input_node_names
std::vector< const char * > m_input_node_names
Definition: GlobalLargeRDNNCalibration.h:100
JetCalibrationStep
Definition: JetCalibrationStep.h:20