ATLAS Offline Software
GlobalLargeRDNNCalibration.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // System includes
6 #include <TEnv.h>
7 #include <tuple>
8 #include <cmath>
9 #include <map>
10 
11 #ifdef XAOD_STANDALONE
13 #endif
14 
18 
19 
20 namespace{
21  // Redefine some functions from the package OnnxRuntimeUtils which is not (yet) available in AnalysisBase
22  // Set up the ONNX Runtime session
23  std::unique_ptr< Ort::Session > CreateORTSession(const std::string& modelFile){
24  Ort::SessionOptions sessionOptions;
25  sessionOptions.SetIntraOpNumThreads( 1 );
26  sessionOptions.SetGraphOptimizationLevel( ORT_ENABLE_BASIC );
27 
28  // Set the ONNX service name depending on the actual analysis release
29  std::string serviceName;
30  #ifdef XAOD_STANDALONE
31  using namespace asg::msgUserCode;
32  ANA_MSG_WARNING("If running DNN calibration in AnalysisBase: necessary to instantiate the ONNX service AthOnnx::OnnxRuntimeSvc with name OnnxRuntimeSvc");
33  ATH_MSG_WARNING("Either in C++ config (see exemple in JetCalibTools_Example.cxx)");
34  ATH_MSG_WARNING("Or in python config with");
35  ATH_MSG_WARNING(" from AnaAlgorithm.DualUseConfig import createService");
36  ATH_MSG_WARNING(" onnxSvc = createService('AthOnnx::OnnxRuntimeSvc', 'OnnxRuntimeSvc', myAlgSequence)");
37  serviceName = "OnnxRuntimeSvc";
38  #else
39  serviceName = "AthOnnx::OnnxRuntimeSvc";
40  #endif
41 
42  ServiceHandle< AthOnnx::IOnnxRuntimeSvc > svc(serviceName, "AthOnnx::OnnxRuntimeSvc");
43 
44  return std::make_unique<Ort::Session>( svc->env(),
45  modelFile.c_str(),
46  sessionOptions );
47  }
48 
49  // Get dimensions and names of the input nodes
50  std::tuple<std::vector<int64_t>, std::vector<const char*> > GetInputNodeInfo(const std::unique_ptr< Ort::Session >& session){
51  std::vector<int64_t> input_node_dims;
52  size_t num_input_nodes = session->GetInputCount();
53  std::vector<const char*> input_node_names(num_input_nodes);
54  Ort::AllocatorWithDefaultOptions allocator;
55  for( std::size_t i = 0; i < num_input_nodes; i++ ) {
56 
57  char* input_name = session->GetInputNameAllocated(i, allocator).release();
58  input_node_names[i] = input_name;
59  Ort::TypeInfo type_info = session->GetInputTypeInfo(i);
60  auto tensor_info = type_info.GetTensorTypeAndShapeInfo();
61 
62  input_node_dims = tensor_info.GetShape();
63  }
64  return std::make_tuple(input_node_dims, input_node_names);
65  }
66 
67  // Get dimensions and names of the output nodes
68  std::tuple<std::vector<int64_t>, std::vector<const char*> > GetOutputNodeInfo(const std::unique_ptr< Ort::Session >& session){
69  std::vector<int64_t> output_node_dims;
70  size_t num_output_nodes = session->GetOutputCount();
71  std::vector<const char*> output_node_names(num_output_nodes);
72  Ort::AllocatorWithDefaultOptions allocator;
73 
74  for( std::size_t i = 0; i < num_output_nodes; i++ ) {
75  char* output_name = session->GetOutputNameAllocated(i, allocator).release();
76  output_node_names[i] = output_name;
77 
78  Ort::TypeInfo type_info = session->GetOutputTypeInfo(i);
79  auto tensor_info = type_info.GetTensorTypeAndShapeInfo();
80 
81  output_node_dims = tensor_info.GetShape();
82  }
83  return std::make_tuple(output_node_dims, output_node_names);
84  }
85 }
86 
87 
91 
93  virtual float value(const xAOD::Jet& jet, JetEventInfo& jetInfo, double eScale) = 0;
94  virtual ~VarRetriever()= default;
95 };
96 
97 namespace {
98 
100  struct VarAccessorRetriever : public GlobalLargeRDNNCalibration::VarRetriever {
101  VarAccessorRetriever(const std::string &n): m_acc(n) {}
102 
103  virtual float value(const xAOD::Jet& jet, JetEventInfo&, double eScale) {
104  return m_acc(jet) * eScale;
105  }
106 
108  };
109 
112  struct RatioAccessorRetriever : public GlobalLargeRDNNCalibration::VarRetriever {
113  RatioAccessorRetriever(): m_accTau1("Tau1_wta"),
114  m_accTau2("Tau2_wta"),
115  m_accTau3("Tau3_wta"),
116  m_accECF1("ECF1"),
117  m_accECF2("ECF2"),
118  m_accECF3("ECF3") {}
119 
120  virtual float value(const xAOD::Jet& jet, JetEventInfo&, double eScale) = 0;
121 
128  };
129 
131  #define DEF_RETRIEVER0(cname, expr ) struct Var_##cname : public GlobalLargeRDNNCalibration::VarRetriever { float value(const xAOD::Jet& jet, JetEventInfo& , double eScale ) { return expr ; } }
132  #define DEF_RETRIEVER1(cname, expr ) struct Var_##cname : public GlobalLargeRDNNCalibration::VarRetriever { float value(const xAOD::Jet& , JetEventInfo& jetInfo, double eScale ) { return expr ; } }
133  #define DEF_RATIO_RETRIEVER(cname, expr ) struct Ratio_##cname : public RatioAccessorRetriever { float value(const xAOD::Jet& jet, JetEventInfo& , double eScale ) { return expr ; } }
134 
135  // Std jet variables
136  DEF_RETRIEVER0( eta, jet.eta()*eScale ) ;
137  DEF_RETRIEVER0( rapidity, jet.rapidity()*eScale ) ;
138  DEF_RETRIEVER0( log_e, log(jet.e()*eScale) ) ;
139  DEF_RETRIEVER0( log_m, log(jet.m()*eScale) ) ;
140  DEF_RETRIEVER0( m, jet.m()*eScale ) ;
141 
142  // Ratio variables -- default values consistent with DNN training
143  DEF_RATIO_RETRIEVER( Tau21_wta, m_accTau1(jet) > 1e-8 ? eScale * m_accTau2(jet) / m_accTau1(jet) : -0.1);
144  DEF_RATIO_RETRIEVER( Tau32_wta, m_accTau2(jet) > 1e-8 ? eScale * m_accTau3(jet) / m_accTau2(jet) : -0.1);
145  DEF_RATIO_RETRIEVER( C2, m_accECF2(jet) > 1e-8 ? eScale * m_accECF3(jet) * m_accECF1(jet) / pow(m_accECF2(jet), 2.0) : -0.1);
146  DEF_RATIO_RETRIEVER( D2, m_accECF2(jet) > 1e-8 ? eScale * m_accECF3(jet) * pow(m_accECF1(jet), 3.0) / pow(m_accECF2(jet), 3.0) : -0.1);
147 
148  // Std pile-up info
149  DEF_RETRIEVER1( mu, jetInfo.mu()*eScale );
150  DEF_RETRIEVER1( NPV, jetInfo.NPV()*eScale );
151 
152  #undef DEF_RETRIEVER
153 
155  GlobalLargeRDNNCalibration::VarRetriever* buildVarRetriever(const std::string & name){
156  // create a map of known specialized VarRetriever.
157  // it's just a map "name" <-> function returning a Var_xyz()
158  static const std::map<std::string, std::function<GlobalLargeRDNNCalibration::VarRetriever*()> > knownVar{
159  {"eta", [](){return new Var_eta();} },
160  {"rapidity", [](){return new Var_rapidity();} },
161  {"log_e", [](){return new Var_log_e();} },
162  {"log_m", [](){return new Var_log_m();} },
163  {"Tau21_wta", [](){return new Ratio_Tau21_wta();} },
164  {"Tau32_wta", [](){return new Ratio_Tau32_wta();} },
165  {"C2", [](){return new Ratio_C2();} },
166  {"D2", [](){return new Ratio_D2();} },
167  {"mu", [](){return new Var_mu();} },
168  {"NPV", [](){return new Var_NPV();} },
169  };
170 
171  auto it = knownVar.find(name);
172  // if name is not a known variable, assume it's a jet attribute, so return a generic VarAccessorRetriever
173  if( it == knownVar.end() ) return new VarAccessorRetriever(name);
174  // else we just return an instance of a known VarRetriever class
175  // (it->second is the function : we call it to obtain a new pointer)
176  return it->second();
177  }
178 
179 }
180 
183  : JetCalibrationStep::JetCalibrationStep("GlobalLargeRDNNCalibration/GlobalLargeRDNNCalibration"),
184  m_config(nullptr), m_calibArea("")
185 {
186 }
187 
190  m_config(nullptr), m_calibArea("")
191 {
192 }
193 
194 GlobalLargeRDNNCalibration::GlobalLargeRDNNCalibration(const std::string& name, TEnv * config, const TString& calibArea, bool dev)
196  m_config(config), m_calibArea(calibArea), m_devMode(dev)
197 {
198 }
199 
202  for(VarRetriever* v: m_varretrievers) delete v;
203 }
204 
205 // Initialize
207  ATH_MSG_DEBUG("Initializing tool");
208  if ( !m_config ) { ATH_MSG_FATAL("Config file not specified. Aborting."); return StatusCode::FAILURE; }
209 
210  // Get list of input features
211  m_NNInputs = JetCalibUtils::Vectorize( m_config->GetValue("DNNC.Inputs","") );
212  // Now build a VarRetriever for each of the input features
213  m_varretrievers.resize(m_NNInputs.size());
214  ATH_MSG_DEBUG("DNN inputs");
215  for (long unsigned int i=0;i<m_NNInputs.size();i++) {
216  m_varretrievers[i] = buildVarRetriever( m_NNInputs[i].Data() );
217  ATH_MSG_DEBUG(" " << m_NNInputs[i]);
218  }
219 
220  // Get normalization constants for input features
221  m_eScales = JetCalibUtils::VectorizeD( m_config->GetValue("DNNC.EScales","") );
222  m_NormOffsets = JetCalibUtils::VectorizeD( m_config->GetValue("DNNC.NormOffsets","") );
223  m_NormScales = JetCalibUtils::VectorizeD( m_config->GetValue("DNNC.NormScales","") );
224 
225  if (m_eScales.size()!=m_NNInputs.size() || m_NormOffsets.size()!=m_NNInputs.size() || m_NormScales.size()!=m_NNInputs.size()) {
226  ATH_MSG_FATAL("Misconfiguration of config file : not same number of offset/scale parameters and number of features. Will exit");
227  return StatusCode::FAILURE;
228  }
229 
230  if( msgLvl(MSG::DEBUG) ){
231  ATH_MSG_DEBUG("m_NormOffsets size : " << m_NormOffsets.size());
232  ATH_MSG_DEBUG("m_NormOffsets");
233  for (long unsigned int i=0;i<m_NormOffsets.size();i++) {
234  ATH_MSG_DEBUG(" " << m_NormOffsets[i]);
235  }
236  ATH_MSG_DEBUG("m_NormScales size : " << m_NormScales.size());
237  ATH_MSG_DEBUG("m_NormScales");
238  for (long unsigned int i=0;i<m_NormScales.size();i++) {
239  ATH_MSG_DEBUG(" " << m_NormScales[i]);
240  }
241  }
242 
243  // Get DNN config file
244  m_modelFileName = m_config->GetValue("DNNC.ONNXInput","");
245  std::string modelPath = "";
246  if (m_devMode) {
247  modelPath="JetCalibTools/"+m_modelFileName;
248  } else {
249  modelPath="JetCalibTools/"+m_calibArea+"CalibrationConfigs/"+m_modelFileName;
250  }
251  const std::string fullModelPath = PathResolverFindCalibFile( modelPath ); // Full path
252  ATH_MSG_INFO("Using ONNX model : " << m_modelFileName);
253  ATH_MSG_INFO("resolved in: " << fullModelPath);
254 
255  // Set up the ONNX Runtime session.
256  m_session = CreateORTSession(fullModelPath);
257  ATH_MSG_DEBUG( "ONNX Runtime session succesfully created" );
258 
259 
260  /************************** Input Nodes *****************************/
261  /*********************************************************************/
262  std::tuple<std::vector<int64_t>, std::vector<const char*> > inputInfo = GetInputNodeInfo(m_session);
263  m_input_node_dims = std::get<0>(inputInfo);
264  m_input_node_names = std::get<1>(inputInfo);
265 
266  if( msgLvl(MSG::DEBUG) ){
267  for( std::size_t i = 0; i < m_input_node_names.size(); i++ ) {
268  // print input node names
269  ATH_MSG_DEBUG("Input "<<i<<" : "<<" name= "<<m_input_node_names[i]);
270 
271  // print input shapes/dims
272  ATH_MSG_DEBUG("Input "<<i<<" : num_dims= "<<m_input_node_dims.size());
273  for (std::size_t j = 0; j < m_input_node_dims.size(); j++){
274  ATH_MSG_DEBUG("Input "<<i<<" : dim "<<j<<"= "<<m_input_node_dims[j]);
275  }
276  }
277  }
278 
279  /************************** Output Nodes *****************************/
280  /*********************************************************************/
281  std::tuple<std::vector<int64_t>, std::vector<const char*> > outputInfo = GetOutputNodeInfo(m_session);
282  m_output_node_dims = std::get<0>(outputInfo);
283  m_output_node_names = std::get<1>(outputInfo);
284 
285  if( msgLvl(MSG::DEBUG) ){
286  for( std::size_t i = 0; i < m_output_node_names.size(); i++ ) {
287  // print input node names
288  ATH_MSG_DEBUG("Output "<<i<<" : "<<" name= "<<m_output_node_names[i]);
289 
290  // print input shapes/dims
291  ATH_MSG_DEBUG("Output "<<i<<" : num_dims= "<<m_output_node_dims.size());
292  for (std::size_t j = 0; j < m_output_node_dims.size(); j++){
293  ATH_MSG_DEBUG("Output "<<i<<" : dim "<<j<<"= "<<m_output_node_dims[j]);
294  }
295  }
296  }
297 
298  /**************************************************************************************
299  * m_input_node_dims[0] = -1; -1 needs to be replaced by the batch size; for no batch --> 1
300  * m_input_node_dims[1] should be equal to m_NNInputs.size()
301  ****************************************************************************************/
302  m_input_node_dims[0] = 1;
303  m_output_node_dims[0] = 1;
304 
305  if (m_NNInputs.size()!=(long unsigned int)m_input_node_dims[1]) {
306  ATH_MSG_FATAL("DNN input features not the same size as in config, will exit");
307  return StatusCode::FAILURE;
308  }
309 
310  // Set jet starting scale
311  m_jetStartScale = "JetConstitScaleMomentum";
312 
313  return StatusCode::SUCCESS;
314 }
315 
316 
317 
319 
320  // Set jet initial scale
321  xAOD::JetFourMom_t jetStartP4;
323  jetStartP4 = jet.jetP4();
324 
325  // Don't apply calibration for jets with negative or null mass or for one constituent jets
326  if(jet.m()<=0 || jet.numConstituents()==1){
327  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",jetStartP4);
328  return StatusCode::SUCCESS;
329  }
330 
331  // Get input features normalized for jet
332  std::vector<float> input_tensor_values = getJetFeatures(jet, jetEventInfo);
333  if( msgLvl(MSG::DEBUG) ){
334  ATH_MSG_DEBUG("Input tensor values : ");
335  for (long unsigned int i=0;i<input_tensor_values.size();i++) ATH_MSG_DEBUG(" " << input_tensor_values[i]);
336  }
337 
338  // Check for nan or +/- inf values
339  int nNan = std::count_if(input_tensor_values.begin(), input_tensor_values.end(), [](float f){return std::isnan(f) || std::isinf(f);});
340  if (nNan>0) {
341  ATH_MSG_WARNING("Encountered Nan or inf value in input features, will not apply calibration");
342  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",jetStartP4);
343  return StatusCode::SUCCESS;
344  }
345 
346  // Convert input_tensor_values array to onnx-compatible tensor
347  Ort::MemoryInfo memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeCPU);
348  Ort::Value input_tensor = Ort::Value::CreateTensor<float>( memory_info,
349  input_tensor_values.data(),
350  input_tensor_values.size(),
351  m_input_node_dims.data(),
352  m_input_node_dims.size());
353 
354  // Make sure we get the same input values in tensor
355  std::vector<float> vec(input_tensor.GetTensorMutableData<float>(), input_tensor.GetTensorMutableData<float>() + m_input_node_dims[1]);
356  if (vec!=input_tensor_values) {
357  ATH_MSG_WARNING("Input tensor after convertion to Ort tensor is not the same as the input vector, will not apply calibration");
358  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",jetStartP4);
359  return StatusCode::SUCCESS;
360  }
361 
362  // Run inference on input_tensor
364  auto output_tensor = session.Run( Ort::RunOptions{nullptr},
365  m_input_node_names.data(),
366  &input_tensor,
367  m_input_node_names.size(),
368  m_output_node_names.data(),
369  m_output_node_names.size());
370  if (!output_tensor.front().IsTensor() || output_tensor.size() != m_output_node_names.size() || output_tensor.front().GetTensorTypeAndShapeInfo().GetShape() != m_output_node_dims) {
371  ATH_MSG_WARNING("Output tensor does not have the same size as output layer, will not apply calibration");
372  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",jetStartP4);
373  return StatusCode::SUCCESS;
374  }
375 
376  // Get pointer to output tensor float values
377  float* outputE = output_tensor.at(0).GetTensorMutableData<float>();
378  float* outputM = output_tensor.at(1).GetTensorMutableData<float>();
379 
380  // Get predicted calibration factors
381  float predRespE = outputE[0]; // first element is predicted response
382  float predRespM = outputM[0];
383 
384  // Print the output predictions for E/M
385  ATH_MSG_DEBUG("Output E : " << predRespE);
386  ATH_MSG_DEBUG("Output M : " << predRespM);
387 
388  if (predRespE==0 || predRespM==0) {
389  ATH_MSG_WARNING("Predictions give 0 values, will not apply calibration");
390  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",jetStartP4);
391  return StatusCode::SUCCESS;
392  }
393 
394  // Apply calibration to jet p4
395  float calibE = jetStartP4.e() / predRespE;
396 
397  // For mass only apply calibration if m>40 GeV
398  float calibM = jetStartP4.mass();
399  if ( calibM > 40000 ) {
400  calibM /= predRespM;
401  }
402 
403  // Propagate energy and mass calibration to jet pT
404  float calibpT = std::sqrt( calibE*calibE - calibM*calibM )/std::cosh( jetStartP4.eta() );
405 
406  // Build calibrated jet p4
407  TLorentzVector TLVjet;
408  TLVjet.SetPtEtaPhiM( calibpT, jetStartP4.eta(), jetStartP4.phi(), calibM );
409  xAOD::JetFourMom_t calibP4;
410  calibP4.SetPxPyPzE( TLVjet.Px(), TLVjet.Py(), TLVjet.Pz(), TLVjet.E() );
411 
412  // Transfer calibrated jet properties to the Jet object
413  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",calibP4);
414  jet.setJetP4( calibP4 );
415 
416  return StatusCode::SUCCESS;
417 
418 }
419 
420 
421 
422 std::vector<float> GlobalLargeRDNNCalibration::getJetFeatures( xAOD::Jet& jet_reco, JetEventInfo& jetEventInfo) const {
423  // Init input tensor
424  std::vector<float> input_tensor_values(m_NNInputs.size());
425 
426  // Retrieve all input variables from the jet and/or jetEventInfo using our VarRetriever collection:
427  for(size_t i=0;i<input_tensor_values.size();i++){
428  float v = m_varretrievers[i]->value(jet_reco, jetEventInfo, m_eScales[i]);
429  // and perform normalisation :
430  input_tensor_values[i] = v*m_NormScales[i] + m_NormOffsets[i];
431  }
432 
433  return input_tensor_values;
434 }
GlobalLargeRDNNCalibration::m_varretrievers
std::vector< VarRetriever * > m_varretrievers
Definition: GlobalLargeRDNNCalibration.h:96
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
GlobalLargeRDNNCalibration::m_eScales
std::vector< double > m_eScales
Definition: GlobalLargeRDNNCalibration.h:91
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DEF_RETRIEVER0
#define DEF_RETRIEVER0(cname, expr)
Define shortcuts macro to declare specialized VarRetriever class in one line.
Definition: GlobalLargeRDNNCalibration.cxx:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
asg::AsgMessaging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Test the output level of the object.
Definition: AsgMessaging.cxx:41
DEF_RATIO_RETRIEVER
#define DEF_RATIO_RETRIEVER(cname, expr)
Definition: GlobalLargeRDNNCalibration.cxx:133
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
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
JetCalibrationStep::setStartP4
virtual StatusCode setStartP4(xAOD::Jet &jet) const
Definition: JetCalibrationStep.cxx:21
GlobalLargeRDNNCalibration::m_output_node_dims
std::vector< int64_t > m_output_node_dims
Definition: GlobalLargeRDNNCalibration.h:101
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
Data
@ Data
Definition: BaseObject.h:11
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
skel.it
it
Definition: skel.GENtoEVGEN.py:396
GlobalLargeRDNNCalibration::VarRetriever::value
virtual float value(const xAOD::Jet &jet, JetEventInfo &jetInfo, double eScale)=0
the value of the variable to be retrieved from the jet and/or JetEventInfo
GlobalLargeRDNNCalibration::m_NormScales
std::vector< double > m_NormScales
Definition: GlobalLargeRDNNCalibration.h:93
GlobalLargeRDNNCalibration::VarRetriever::~VarRetriever
virtual ~VarRetriever()=default
GlobalLargeRDNNCalibration.h
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
GlobalLargeRDNNCalibration::~GlobalLargeRDNNCalibration
virtual ~GlobalLargeRDNNCalibration()
The destructor.
Definition: GlobalLargeRDNNCalibration.cxx:201
python.oracle.Session
Session
Definition: oracle.py:78
GlobalLargeRDNNCalibration::m_output_node_names
std::vector< const char * > m_output_node_names
Definition: GlobalLargeRDNNCalibration.h:102
JetCalibUtils::Vectorize
StrV Vectorize(const TString &str, const TString &sep=" ")
Definition: JetCalibUtils.cxx:14
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
AthMessaging::ATLAS_THREAD_SAFE
std::atomic_flag m_initialized ATLAS_THREAD_SAFE
Messaging initialized (initMessaging)
Definition: AthMessaging.h:141
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
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
GlobalLargeRDNNCalibration::m_config
TEnv * m_config
Definition: GlobalLargeRDNNCalibration.h:104
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
lumiFormat.i
int i
Definition: lumiFormat.py:85
JetStandardHistoSpecs.knownVar
knownVar
Definition: JetStandardHistoSpecs.py:15
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MessageCheck.h
macros for messaging and checking status codes
ANA_MSG_WARNING
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:292
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
hist_file_dump.f
f
Definition: hist_file_dump.py:135
GlobalLargeRDNNCalibration::initialize
virtual StatusCode initialize() override
Returns the charged fraction of a jet.
Definition: GlobalLargeRDNNCalibration.cxx:206
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
GlobalLargeRDNNCalibration::m_NNInputs
std::vector< TString > m_NNInputs
Definition: GlobalLargeRDNNCalibration.h:90
GlobalLargeRDNNCalibration::GlobalLargeRDNNCalibration
GlobalLargeRDNNCalibration()
The constructor.
Definition: GlobalLargeRDNNCalibration.cxx:182
xAOD::JetFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition: JetTypes.h:17
PathResolver.h
JetCalibUtils.h
DEF_RETRIEVER1
#define DEF_RETRIEVER1(cname, expr)
Definition: GlobalLargeRDNNCalibration.cxx:132
JetCalibrationStep::m_jetStartScale
std::string m_jetStartScale
Definition: JetCalibrationStep.h:41
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
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
python.PyAthena.v
v
Definition: PyAthena.py:154
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
GlobalLargeRDNNCalibration::m_calibArea
std::string m_calibArea
Definition: GlobalLargeRDNNCalibration.h:105
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
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
JetCalibUtils::VectorizeD
VecD VectorizeD(const TString &str, const TString &sep=" ")
Definition: JetCalibUtils.cxx:25
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
GlobalLargeRDNNCalibration::m_input_node_names
std::vector< const char * > m_input_node_names
Definition: GlobalLargeRDNNCalibration.h:100
JetCalibrationStep
Definition: JetCalibrationStep.h:20
ServiceHandle< AthOnnx::IOnnxRuntimeSvc >