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 AthONNXSvc");
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', 'AthONNXSvc', myAlgSequence)");
37  serviceName = "AthONNXSvc";
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( log_e, log(jet.e()*eScale) ) ;
138  DEF_RETRIEVER0( log_m, log(jet.m()*eScale) ) ;
139  DEF_RETRIEVER0( m, jet.m()*eScale ) ;
140 
141  // Ratio variables -- default values consistent with DNN training
142  DEF_RATIO_RETRIEVER( Tau21_wta, m_accTau1(jet) > 1e-8 ? eScale * m_accTau2(jet) / m_accTau1(jet) : -0.1);
143  DEF_RATIO_RETRIEVER( Tau32_wta, m_accTau2(jet) > 1e-8 ? eScale * m_accTau3(jet) / m_accTau2(jet) : -0.1);
144  DEF_RATIO_RETRIEVER( C2, m_accECF2(jet) > 1e-8 ? eScale * m_accECF3(jet) * m_accECF1(jet) / pow(m_accECF2(jet), 2.0) : -999);
145  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) : -999);
146 
147  // Std pile-up info
148  DEF_RETRIEVER1( mu, jetInfo.mu()*eScale );
149  DEF_RETRIEVER1( NPV, jetInfo.NPV()*eScale );
150 
151  #undef DEF_RETRIEVER
152 
154  GlobalLargeRDNNCalibration::VarRetriever* buildVarRetriever(const std::string & name){
155  // create a map of known specialized VarRetriever.
156  // it's just a map "name" <-> function returning a Var_xyz()
157  static const std::map<std::string, std::function<GlobalLargeRDNNCalibration::VarRetriever*()> > knownVar{
158  {"eta", [](){return new Var_eta();} },
159  {"log_e", [](){return new Var_log_e();} },
160  {"log_m", [](){return new Var_log_m();} },
161  {"Tau21_wta", [](){return new Ratio_Tau21_wta();} },
162  {"Tau32_wta", [](){return new Ratio_Tau32_wta();} },
163  {"C2", [](){return new Ratio_C2();} },
164  {"D2", [](){return new Ratio_D2();} },
165  {"mu", [](){return new Var_mu();} },
166  {"NPV", [](){return new Var_NPV();} },
167  };
168 
169  auto it = knownVar.find(name);
170  // if name is not a known variable, assume it's a jet attribute, so return a generic VarAccessorRetriever
171  if( it == knownVar.end() ) return new VarAccessorRetriever(name);
172  // else we just return an instance of a known VarRetriever class
173  // (it->second is the function : we call it to obtain a new pointer)
174  return it->second();
175  }
176 
177 }
178 
181  : JetCalibrationStep::JetCalibrationStep("GlobalLargeRDNNCalibration/GlobalLargeRDNNCalibration"),
182  m_config(nullptr), m_calibArea("")
183 {
184 }
185 
188  m_config(nullptr), m_calibArea("")
189 {
190 }
191 
192 GlobalLargeRDNNCalibration::GlobalLargeRDNNCalibration(const std::string& name, TEnv * config, const TString& calibArea, bool /*dev*/)
194  m_config(config), m_calibArea(calibArea)
195 {
196 }
197 
200  for(VarRetriever* v: m_varretrievers) delete v;
201 }
202 
203 // Initialize
205  ATH_MSG_DEBUG("Initializing tool");
206  if ( !m_config ) { ATH_MSG_FATAL("Config file not specified. Aborting."); return StatusCode::FAILURE; }
207 
208  // Get list of input features
209  m_NNInputs = JetCalibUtils::Vectorize( m_config->GetValue("DNNC.Inputs","") );
210  // Now build a VarRetriever for each of the input features
211  m_varretrievers.resize(m_NNInputs.size());
212  ATH_MSG_DEBUG("DNN inputs");
213  for (long unsigned int i=0;i<m_NNInputs.size();i++) {
214  m_varretrievers[i] = buildVarRetriever( m_NNInputs[i].Data() );
215  ATH_MSG_DEBUG(" " << m_NNInputs[i]);
216  }
217 
218  // Get normalization constants for input features
219  m_eScales = JetCalibUtils::VectorizeD( m_config->GetValue("DNNC.EScales","") );
220  m_NormOffsets = JetCalibUtils::VectorizeD( m_config->GetValue("DNNC.NormOffsets","") );
221  m_NormScales = JetCalibUtils::VectorizeD( m_config->GetValue("DNNC.NormScales","") );
222 
223  if (m_eScales.size()!=m_NNInputs.size() || m_NormOffsets.size()!=m_NNInputs.size() || m_NormScales.size()!=m_NNInputs.size()) {
224  ATH_MSG_FATAL("Misconfiguration of config file : not same number of offset/scale parameters and number of features. Will exit");
225  return StatusCode::FAILURE;
226  }
227 
228  if( msgLvl(MSG::DEBUG) ){
229  ATH_MSG_DEBUG("m_NormOffsets size : " << m_NormOffsets.size());
230  ATH_MSG_DEBUG("m_NormOffsets");
231  for (long unsigned int i=0;i<m_NormOffsets.size();i++) {
232  ATH_MSG_DEBUG(" " << m_NormOffsets[i]);
233  }
234  ATH_MSG_DEBUG("m_NormScales size : " << m_NormScales.size());
235  ATH_MSG_DEBUG("m_NormScales");
236  for (long unsigned int i=0;i<m_NormScales.size();i++) {
237  ATH_MSG_DEBUG(" " << m_NormScales[i]);
238  }
239  }
240 
241  // Get DNN config file
242  m_modelFileName = m_config->GetValue("DNNC.ONNXInput","");
243  std::string modelPath="JetCalibTools/"+m_calibArea+"CalibrationConfigs/"+m_modelFileName;
244  const std::string fullModelPath = PathResolverFindCalibFile( modelPath ); // Full path
245  ATH_MSG_INFO("Using ONNX model : " << m_modelFileName);
246  ATH_MSG_INFO("resolved in: " << fullModelPath);
247 
248  // Set up the ONNX Runtime session.
249  m_session = CreateORTSession(fullModelPath);
250  ATH_MSG_DEBUG( "ONNX Runtime session succesfully created" );
251 
252 
253  /************************** Input Nodes *****************************/
254  /*********************************************************************/
255  std::tuple<std::vector<int64_t>, std::vector<const char*> > inputInfo = GetInputNodeInfo(m_session);
256  m_input_node_dims = std::get<0>(inputInfo);
257  m_input_node_names = std::get<1>(inputInfo);
258 
259  if( msgLvl(MSG::DEBUG) ){
260  for( std::size_t i = 0; i < m_input_node_names.size(); i++ ) {
261  // print input node names
262  ATH_MSG_DEBUG("Input "<<i<<" : "<<" name= "<<m_input_node_names[i]);
263 
264  // print input shapes/dims
265  ATH_MSG_DEBUG("Input "<<i<<" : num_dims= "<<m_input_node_dims.size());
266  for (std::size_t j = 0; j < m_input_node_dims.size(); j++){
267  ATH_MSG_DEBUG("Input "<<i<<" : dim "<<j<<"= "<<m_input_node_dims[j]);
268  }
269  }
270  }
271 
272  /************************** Output Nodes *****************************/
273  /*********************************************************************/
274  std::tuple<std::vector<int64_t>, std::vector<const char*> > outputInfo = GetOutputNodeInfo(m_session);
275  m_output_node_dims = std::get<0>(outputInfo);
276  m_output_node_names = std::get<1>(outputInfo);
277 
278  if( msgLvl(MSG::DEBUG) ){
279  for( std::size_t i = 0; i < m_output_node_names.size(); i++ ) {
280  // print input node names
281  ATH_MSG_DEBUG("Output "<<i<<" : "<<" name= "<<m_output_node_names[i]);
282 
283  // print input shapes/dims
284  ATH_MSG_DEBUG("Output "<<i<<" : num_dims= "<<m_output_node_dims.size());
285  for (std::size_t j = 0; j < m_output_node_dims.size(); j++){
286  ATH_MSG_DEBUG("Output "<<i<<" : dim "<<j<<"= "<<m_output_node_dims[j]);
287  }
288  }
289  }
290 
291  /**************************************************************************************
292  * m_input_node_dims[0] = -1; -1 needs to be replaced by the batch size; for no batch --> 1
293  * m_input_node_dims[1] should be equal to m_NNInputs.size()
294  ****************************************************************************************/
295  m_input_node_dims[0] = 1;
296  m_output_node_dims[0] = 1;
297 
298  if (m_NNInputs.size()!=(long unsigned int)m_input_node_dims[1]) {
299  ATH_MSG_FATAL("DNN input features not the same size as in config, will exit");
300  return StatusCode::FAILURE;
301  }
302 
303  // Set jet starting scale
304  m_jetStartScale = "JetConstitScaleMomentum";
305 
306  return StatusCode::SUCCESS;
307 }
308 
309 
310 
312 
313  // Set jet initial scale
314  xAOD::JetFourMom_t jetStartP4;
316  jetStartP4 = jet.jetP4();
317 
318  // Don't apply calibration for jets with negative or null mass or for one constituent jets
319  if(jet.m()<=0 || jet.numConstituents()==1){
320  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",jetStartP4);
321  return StatusCode::SUCCESS;
322  }
323 
324  // Get input features normalized for jet
325  std::vector<float> input_tensor_values = getJetFeatures(jet, jetEventInfo);
326  if( msgLvl(MSG::DEBUG) ){
327  ATH_MSG_DEBUG("Input tensor values : ");
328  for (long unsigned int i=0;i<input_tensor_values.size();i++) ATH_MSG_DEBUG(" " << input_tensor_values[i]);
329  }
330 
331  // Check for nan or +/- inf values
332  int nNan = std::count_if(input_tensor_values.begin(), input_tensor_values.end(), [](float f){return std::isnan(f) || std::isinf(f);});
333  if (nNan>0) {
334  ATH_MSG_WARNING("Encountered Nan or inf value in input features, will not apply calibration");
335  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",jetStartP4);
336  return StatusCode::SUCCESS;
337  }
338 
339  // Convert input_tensor_values array to onnx-compatible tensor
340  Ort::MemoryInfo memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeCPU);
341  Ort::Value input_tensor = Ort::Value::CreateTensor<float>( memory_info,
342  input_tensor_values.data(),
343  input_tensor_values.size(),
344  m_input_node_dims.data(),
345  m_input_node_dims.size());
346 
347  // Make sure we get the same input values in tensor
348  std::vector<float> vec(input_tensor.GetTensorMutableData<float>(), input_tensor.GetTensorMutableData<float>() + m_input_node_dims[1]);
349  if (vec!=input_tensor_values) {
350  ATH_MSG_WARNING("Input tensor after convertion to Ort tensor is not the same as the input vector, will not apply calibration");
351  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",jetStartP4);
352  return StatusCode::SUCCESS;
353  }
354 
355  // Run inference on input_tensor
357  auto output_tensor = session.Run( Ort::RunOptions{nullptr},
358  m_input_node_names.data(),
359  &input_tensor,
360  m_input_node_names.size(),
361  m_output_node_names.data(),
362  m_output_node_names.size());
363  if (!output_tensor.front().IsTensor() || output_tensor.size() != m_output_node_names.size() || output_tensor.front().GetTensorTypeAndShapeInfo().GetShape() != m_output_node_dims) {
364  ATH_MSG_WARNING("Output tensor does not have the same size as output layer, will not apply calibration");
365  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",jetStartP4);
366  return StatusCode::SUCCESS;
367  }
368 
369  // Get pointer to output tensor float values
370  float* outputE = output_tensor.at(0).GetTensorMutableData<float>();
371  float* outputM = output_tensor.at(1).GetTensorMutableData<float>();
372 
373  // Get predicted calibration factors
374  float predRespE = outputE[0]; // first element is predicted response
375  float predRespM = outputM[0];
376 
377  // Print the output predictions for E/M
378  ATH_MSG_DEBUG("Output E : " << predRespE);
379  ATH_MSG_DEBUG("Output M : " << predRespM);
380 
381  if (predRespE==0 || predRespM==0) {
382  ATH_MSG_WARNING("Predictions give 0 values, will not apply calibration");
383  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",jetStartP4);
384  return StatusCode::SUCCESS;
385  }
386 
387  // Apply calibration to jet p4
388  float calibE = jetStartP4.e() / predRespE;
389 
390  // For mass only apply calibration if m>40 GeV
391  float calibM = jetStartP4.mass();
392  if ( calibM > 40000 ) {
393  calibM /= predRespM;
394  }
395 
396  // Propagate energy and mass calibration to jet pT
397  float calibpT = std::sqrt( calibE*calibE - calibM*calibM )/std::cosh( jetStartP4.eta() );
398 
399  // Build calibrated jet p4
400  TLorentzVector TLVjet;
401  TLVjet.SetPtEtaPhiM( calibpT, jetStartP4.eta(), jetStartP4.phi(), calibM );
402  xAOD::JetFourMom_t calibP4;
403  calibP4.SetPxPyPzE( TLVjet.Px(), TLVjet.Py(), TLVjet.Pz(), TLVjet.E() );
404 
405  // Transfer calibrated jet properties to the Jet object
406  jet.setAttribute<xAOD::JetFourMom_t>("JetDNNCScaleMomentum",calibP4);
407  jet.setJetP4( calibP4 );
408 
409  return StatusCode::SUCCESS;
410 
411 }
412 
413 
414 
415 std::vector<float> GlobalLargeRDNNCalibration::getJetFeatures( xAOD::Jet& jet_reco, JetEventInfo& jetEventInfo) const {
416  // Init input tensor
417  std::vector<float> input_tensor_values(m_NNInputs.size());
418 
419  // Retrieve all input variables from the jet and/or jetEventInfo using our VarRetriever collection:
420  for(size_t i=0;i<input_tensor_values.size();i++){
421  float v = m_varretrievers[i]->value(jet_reco, jetEventInfo, m_eScales[i]);
422  // and perform normalisation :
423  input_tensor_values[i] = v*m_NormScales[i] + m_NormOffsets[i];
424  }
425 
426  return input_tensor_values;
427 }
GlobalLargeRDNNCalibration::m_varretrievers
std::vector< VarRetriever * > m_varretrievers
Definition: GlobalLargeRDNNCalibration.h:96
GlobalLargeRDNNCalibration::m_eScales
std::vector< double > m_eScales
Definition: GlobalLargeRDNNCalibration.h:91
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
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:415
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:79
Data
@ Data
Definition: BaseObject.h:11
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
skel.it
it
Definition: skel.GENtoEVGEN.py:423
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:54
GlobalLargeRDNNCalibration::~GlobalLargeRDNNCalibration
virtual ~GlobalLargeRDNNCalibration()
The destructor.
Definition: GlobalLargeRDNNCalibration.cxx:199
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:92
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
GlobalLargeRDNNCalibration::initialize
virtual StatusCode initialize() override
Returns the charged fraction of a jet.
Definition: GlobalLargeRDNNCalibration.cxx:204
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:180
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:195
GlobalLargeRDNNCalibration::calibrate
virtual StatusCode calibrate(xAOD::Jet &jet, JetEventInfo &) const override
Definition: GlobalLargeRDNNCalibration.cxx:311
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
python.PyAthena.v
v
Definition: PyAthena.py:157
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
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
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 >