Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DiTauRecTools::DiTauOnnxDiscriminantTool Class Referenceabstract

#include <DiTauOnnxDiscriminantTool.h>

Inheritance diagram for DiTauRecTools::DiTauOnnxDiscriminantTool:
Collaboration diagram for DiTauRecTools::DiTauOnnxDiscriminantTool:

Classes

struct  InferenceOutput
 
struct  OnnxInputs
 

Public Member Functions

virtual void print () const =0
 Print the state of the tool. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

virtual StatusCode initialize () override
 Dummy implementation of the initialisation function. More...
 
virtual StatusCode execute (const xAOD::DiTauJet &xDiTau) override
 Declare the interface that the class provides. More...
 
Ort::Value create_tensor (std::vector< float > &data, const std::vector< int64_t > &shape) const
 
InferenceOutput run_inference (OnnxInputs &inputs) const
 
float nan_to_num (float value, float nan_replacement, float posinf_replacement, float neginf_replacement) const
 
std::vector< float > flatten (const std::vector< std::vector< float >> &vec_2d) const
 
std::vector< float > extract_points (const std::vector< std::vector< float >> &track_features) const
 
std::vector< float > create_mask (const std::vector< std::vector< float >> &track_features) const
 
float GetDiTauObjOnnxScore (const xAOD::DiTauJet &ditau) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

Gaudi::Property< std::string > m_onnxModelPath {this, "onnxModelPath", "TrigTauRec/00-11-02/dev/boosted_ditau_omni_model.onnx"}
 
Gaudi::Property< size_t > m_maxTracks {this, "maxTracks", 10}
 
std::unique_ptr< Ort::Env > m_ort_env
 
std::unique_ptr< Ort::Session > m_ort_session
 
const std::vector< std::string > m_input_node_names = {"input_features", "input_points", "input_mask", "input_jet", "input_time"}
 
const std::vector< std::string > m_output_node_names = {"output_1", "output_2"}
 
SG::ReadHandleKey< xAOD::DiTauJetContainerm_ditauContainerKey {this, "DiTauContainerName", "DiTauJets", "DiTau container name"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_ditau_pt_DecorKey {this, "DiTauPtDecorName", "DiTauJets.ditau_pt", "Name of the DiTau Pt decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_f_core_lead_DecorKey {this, "DiTauFCoreLeadName", "DiTauJets.f_core_lead", "Name of the Ditau leading subjet core energy fraction decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_f_core_sublead_DecorKey {this, "DiTauFCoreSubLeadName", "DiTauJets.f_core_subl", "Name of the Ditau subleading subjet core energy fraction decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_f_subjet_subl_DecorKey {this, "DiTauSubjetSublName", "DiTauJets.f_subjet_subl", "Name of the Ditau subleading subjet pt fraction decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_f_subjets_DecorKey {this, "DiTauSubjetsName", "DiTauJets.f_subjets", "Name of the DiTau subjets fraction decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_R_max_lead_DecorKey {this, "DiTauRMaxLeadName", "DiTauJets.R_max_lead", "Name of the Ditau Max dR distance track from leading subjet decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_R_max_sublead_DecorKey {this, "DiTauRMaxSubleadName", "DiTauJets.R_max_subl", "Name of the Ditau Max dR distance track from subleading subjet decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_n_track_DecorKey {this, "DiTauNTrackName", "DiTauJets.n_track", "Name of the Ditau number of tracks decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_R_track_all_DecorKey { this, "DiTauRTrackAllName", "DiTauJets.R_track_all", "Name of the Ditau DeltaR tracks over pt in the large region decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_R_isotrack_DecorKey { this, "DiTauRIsoTrackAllName", "DiTauJets.R_isotrack", "Name of the Ditau DeltaR isolated tracks over pt decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_R_track_sublead_DecorKey { this, "DiTauRTrackSubleadName", "DiTauJets.R_tracks_subl", "Name of the Ditau DeltaR tracks over pt in the large region of the subleading subjet decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_M_core_lead_DecorKey { this, "DiTauMCoreLeadName", "DiTauJets.m_core_lead", "Name of the Ditau mass of tracks in the core region of the leading subjet decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_M_core_sublead_DecorKey { this, "DiTauMCoreSubleadName", "DiTauJets.m_core_subl", "Name of the Ditau mass of tracks in the core region of the leading subjet decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_M_track_lead_DecorKey { this, "DiTauMTrackLeadName", "DiTauJets.m_tracks_lead", "Name of the Ditau mass of tracks in the leading subjet decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_d0_leadtrack_lead_DecorKey { this, "DiTauD0LeadTrackLeadName", "DiTauJets.d0_leadtrack_lead", "Name of the DiTau dR between the leading track within the lead subjet with respect to the lead subjet"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_d0_leadtrack_sublead_DecorKey { this, "DiTauD0SubleadTrackLeadName", "DiTauJets.d0_leadtrack_subl", "Name of the DiTau dR between the leading track within the sublead subjet with respect to the sublead subjet"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_f_isotracks_DecorKey { this, "DiTauFIsotracks", "DiTauJets.f_isotracks", "Name of the DiTau energy fraction carried by isolated tracks"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_numberOfInrmstPxlLyrHits_DecorKey { this, "DiTauNumberOfInrmstPxlLyrHits", "DiTauJets.numberOfInnermostPixelLayerHits", "Name of Number of the Hits in Innermost Layer of Pixel detector decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_numberOfPixelHits_DecorKey { this, "DiTauNumberOfPixelHits", "DiTauJets.numberOfPixelHits", "Name of the number of hits in the Pixel detector decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_numberOfSCTHits_DecorKey { this, "DiTauNumberOfSCTHits", "DiTauJets.numberOfSCTHits", "Name of the nnumber of hits in the SCT detector decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_z0_DecorKey { this, "DiTauZ0", "DiTauJets.z0", "Name of the track z0 decoration"}
 
SG::ReadDecorHandleKey< xAOD::DiTauJetContainerm_d0_DecorKey { this, "DiTauD0", "DiTauJets.d0", "Name of the track d0 decoration"}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 20 of file DiTauOnnxDiscriminantTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ create_mask()

std::vector< float > DiTauOnnxDiscriminantTool::create_mask ( const std::vector< std::vector< float >> &  track_features) const
private

Definition at line 86 of file DiTauOnnxDiscriminantTool.cxx.

86  {
87  std::vector<float> mask;
88  mask.reserve(track_features.size());
89  std::transform(track_features.begin(), track_features.end(), std::back_inserter(mask), [](const auto &track) {
90  return std::abs(track[2]) > 1e-6 ? 1.0f : 0.0f;
91  });
92  return mask;
93 }

◆ create_tensor()

Ort::Value DiTauOnnxDiscriminantTool::create_tensor ( std::vector< float > &  data,
const std::vector< int64_t > &  shape 
) const
private

Definition at line 95 of file DiTauOnnxDiscriminantTool.cxx.

95  {
96  Ort::MemoryInfo memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
97  return Ort::Value::CreateTensor<float>(memory_info, data.data(), data.size(),shape.data(), shape.size());
98 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode DiTauOnnxDiscriminantTool::execute ( const xAOD::DiTauJet xDiTau)
overrideprivatevirtual

Declare the interface that the class provides.

Implements DiTauRecTools::IDiTauToolBase.

Definition at line 47 of file DiTauOnnxDiscriminantTool.cxx.

48 {
49  const static SG::Decorator<float> omni_scoreDec("omni_score");
50  ATH_MSG_DEBUG("Inferencing omni DiTau ID score...");
51  float score = GetDiTauObjOnnxScore(xDiTau);
52  ATH_MSG_DEBUG("DiTau ID score: " << score);
53  omni_scoreDec(xDiTau) = score;
54  return StatusCode::SUCCESS;
55 }

◆ extract_points()

std::vector< float > DiTauOnnxDiscriminantTool::extract_points ( const std::vector< std::vector< float >> &  track_features) const
private

Definition at line 76 of file DiTauOnnxDiscriminantTool.cxx.

76  {
77  std::vector<float> points;
78  points.reserve(track_features.size() * 2);
79  for (const auto &track : track_features) {
80  points.push_back(track[0]); // delta_eta
81  points.push_back(track[1]); // delta_phi
82  }
83  return points;
84 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ flatten()

std::vector< float > DiTauOnnxDiscriminantTool::flatten ( const std::vector< std::vector< float >> &  vec_2d) const
private

Definition at line 67 of file DiTauOnnxDiscriminantTool.cxx.

67  {
68  std::vector<float> flattened;
69  flattened.reserve(vec_2d.size() * (vec_2d.empty() ? 0 : vec_2d[0].size()));
70  for (const auto &inner : vec_2d) {
71  flattened.insert(flattened.end(), inner.begin(), inner.end());
72  }
73  return flattened;
74 }

◆ GetDiTauObjOnnxScore()

float DiTauOnnxDiscriminantTool::GetDiTauObjOnnxScore ( const xAOD::DiTauJet ditau) const
private

Definition at line 129 of file DiTauOnnxDiscriminantTool.cxx.

129  {
130 
152 
153  // Input features for Ditau tagger ONNX model
154  std::vector<float> jet_vars = {
155  R_max_leadDec (ditau),
156  R_max_subleadDec (ditau),
157  R_tracks_sublDec (ditau),
158  R_isotracDec (ditau),
159  d0_leadtrack_leadDec (ditau),
160  d0_leadtrack_sublDec (ditau),
161  f_core_leadDec (ditau),
162  f_core_sublDec (ditau),
163  f_subjet_sublDec (ditau),
164  f_subjetDec (ditau),
165  f_isotracks_Dec (ditau),
166  M_core_leadDec (ditau),
167  M_core_sublDec (ditau),
168  M_tracks_leadDec (ditau),
169  static_cast<float>( n_trackDec (ditau)),
170  };
171  std::vector<int64_t> jet_shape = {1, static_cast<int64_t>(jet_vars.size())};
172 
173  const TrackParticleLinks_t &vTauTracks = ditau.trackLinks();
174  std::vector<std::vector<float>> track_features(m_maxTracks, std::vector<float>(11, 0.0f));
175 
176  float jet_eta = ditau.eta();
177  float jet_phi = ditau.phi();
178  size_t num_tracks = std::min(static_cast<size_t>(m_maxTracks), vTauTracks.size());
179 
180  for (size_t i = 0; i < num_tracks; ++i) {
181  const ElementLink<xAOD::TrackParticleContainer> &trackLink = vTauTracks[i];
182  if (!trackLink.isValid()) continue;
183  const xAOD::TrackParticle *xTrack = *trackLink;
184  float track_eta = xTrack->eta();
185  float track_phi = xTrack->phi();
186  float delta_eta = track_eta - jet_eta;
187  float delta_phi = std::remainder(track_phi - jet_phi, 2 * M_PI);
188  float delta_R = std::hypot(delta_eta, delta_phi);
189  float track_pt = static_cast<float>(xTrack->pt());
190  float pt_log = std::log(track_pt + 1e-8f);
191  float jet_pt = ditau_ptDec(ditau);
192  float pt_ratio = track_pt / jet_pt;
193  float pt_ratio_log = std::log(1.0f - pt_ratio + 1e-8f);
194  float track_charge = xTrack->charge();
195  float pt_ratio_log_nan_less = nan_to_num(pt_ratio_log, 0.0f, 0.0f, 0.0f);
196 
197  track_features[i] = {
198  delta_eta,
199  delta_phi,
200  pt_log,
201  d0Dec(*xTrack),
202  pt_ratio_log_nan_less,
203  z0Dec(*xTrack),
204  delta_R,
205  static_cast<float>(numberOfInrmstPxlLyrHitsDec(*xTrack)),
206  static_cast<float>(numberOfPixelHitsDec(*xTrack)),
207  static_cast<float>(numberOfSCTHitsDec(*xTrack)),
208  track_charge
209  };
210  }
211  std::vector<int64_t> track_shape = {1, static_cast<int64_t>(m_maxTracks), 11};
212 
213  // Actual ONNX inference
214  OnnxInputs inputs{
215  flatten(track_features),
216  track_shape,
217  extract_points(track_features),
218  {1, track_shape[1], 2},
219  create_mask(track_features),
220  {1, track_shape[1]},
221  std::move(jet_vars),
222  std::move(jet_shape),
223  {0.0f},
224  {1, 1}
225  };
226  auto output = run_inference(inputs);
227  return output.output_1[1];
228 }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ getName()

const std::string & asg::AsgTool::getName ( const void *  ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode DiTauOnnxDiscriminantTool::initialize ( )
overrideprivatevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 27 of file DiTauOnnxDiscriminantTool.cxx.

28 {
29  ATH_MSG_INFO( "Initializing DiTauOnnxDiscriminantTool" );
30  ATH_MSG_INFO( "onnxModelPath: " << m_onnxModelPath );
31  std::string model_path = PathResolverFindCalibFile(m_onnxModelPath);
32  if (model_path.empty()) {
33  ATH_MSG_ERROR("Could not find model file: " << m_onnxModelPath);
34  return StatusCode::FAILURE;
35  }
36  m_ort_env = std::make_unique<Ort::Env>(ORT_LOGGING_LEVEL_WARNING, "OnnxUtil");
37  Ort::SessionOptions session_options;
38  session_options.SetIntraOpNumThreads(1);
39  session_options.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED);
40  m_ort_session = std::make_unique<Ort::Session>(*m_ort_env, model_path.c_str(), session_options);
41 
42  ATH_CHECK( m_ditauContainerKey.initialize() );
43 
44  return StatusCode::SUCCESS;
45 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101  {
102 
103  return MSG::name( msg().level() );
104  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ nan_to_num()

float DiTauOnnxDiscriminantTool::nan_to_num ( float  value,
float  nan_replacement = 0.0f,
float  posinf_replacement = 0.0f,
float  neginf_replacement = 0.0f 
) const
private

Definition at line 57 of file DiTauOnnxDiscriminantTool.cxx.

57  {
58  if (std::isnan(value))
59  return nan_replacement;
60  if (value == std::numeric_limits<float>::infinity())
61  return posinf_replacement;
62  if (value == -std::numeric_limits<float>::infinity())
63  return neginf_replacement;
64  return value;
65  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print() [1/2]

void asg::AsgTool::print ( ) const
virtualinherited

◆ print() [2/2]

virtual void asg::IAsgTool::print ( ) const
pure virtualinherited

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ run_inference()

DiTauOnnxDiscriminantTool::InferenceOutput DiTauOnnxDiscriminantTool::run_inference ( OnnxInputs inputs) const
private

Definition at line 100 of file DiTauOnnxDiscriminantTool.cxx.

100  {
101  std::vector<Ort::Value> input_tensors;
102  input_tensors.reserve(m_input_node_names.size());
103  input_tensors.emplace_back(create_tensor(inputs.input_features, inputs.input_features_shape));
104  input_tensors.emplace_back(create_tensor(inputs.input_points, inputs.input_points_shape));
105  input_tensors.emplace_back(create_tensor(inputs.input_mask, inputs.input_mask_shape));
106  input_tensors.emplace_back(create_tensor(inputs.input_jet, inputs.input_jet_shape));
107  input_tensors.emplace_back(create_tensor(inputs.input_time, inputs.input_time_shape));
108 
109  std::vector<const char *> input_node_names;
110  input_node_names.reserve(m_input_node_names.size());
111  std::transform(m_input_node_names.begin(), m_input_node_names.end(), std::back_inserter(input_node_names), [](const std::string &name) { return name.c_str(); });
112 
113  std::vector<const char *> output_node_names;
114  output_node_names.reserve(m_output_node_names.size());
115  std::transform(m_output_node_names.begin(), m_output_node_names.end(), std::back_inserter(output_node_names), [](const std::string &name) { return name.c_str(); });
116 
117  auto output_tensors = m_ort_session->Run(Ort::RunOptions{nullptr}, input_node_names.data(), input_tensors.data(), input_node_names.size(), output_node_names.data(), output_node_names.size());
118 
119  InferenceOutput output;
120  for (size_t i = 0; i < output_tensors.size(); ++i) {
121  const auto &tensor = output_tensors[i];
122  const size_t length = tensor.GetTensorTypeAndShapeInfo().GetElementCount();
123  const float *data = tensor.GetTensorData<float>();
124  (i == 0 ? output.output_1 : output.output_2) = std::vector<float>(data, data + length);
125  }
126  return output;
127 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_d0_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_d0_DecorKey { this, "DiTauD0", "DiTauJets.d0", "Name of the track d0 decoration"}
private

Definition at line 99 of file DiTauOnnxDiscriminantTool.h.

◆ m_d0_leadtrack_lead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_d0_leadtrack_lead_DecorKey { this, "DiTauD0LeadTrackLeadName", "DiTauJets.d0_leadtrack_lead", "Name of the DiTau dR between the leading track within the lead subjet with respect to the lead subjet"}
private

Definition at line 92 of file DiTauOnnxDiscriminantTool.h.

◆ m_d0_leadtrack_sublead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_d0_leadtrack_sublead_DecorKey { this, "DiTauD0SubleadTrackLeadName", "DiTauJets.d0_leadtrack_subl", "Name of the DiTau dR between the leading track within the sublead subjet with respect to the sublead subjet"}
private

Definition at line 93 of file DiTauOnnxDiscriminantTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_ditau_pt_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_ditau_pt_DecorKey {this, "DiTauPtDecorName", "DiTauJets.ditau_pt", "Name of the DiTau Pt decoration"}
private

Definition at line 78 of file DiTauOnnxDiscriminantTool.h.

◆ m_ditauContainerKey

SG::ReadHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_ditauContainerKey {this, "DiTauContainerName", "DiTauJets", "DiTau container name"}
private

Definition at line 77 of file DiTauOnnxDiscriminantTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_f_core_lead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_core_lead_DecorKey {this, "DiTauFCoreLeadName", "DiTauJets.f_core_lead", "Name of the Ditau leading subjet core energy fraction decoration"}
private

Definition at line 79 of file DiTauOnnxDiscriminantTool.h.

◆ m_f_core_sublead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_core_sublead_DecorKey {this, "DiTauFCoreSubLeadName", "DiTauJets.f_core_subl", "Name of the Ditau subleading subjet core energy fraction decoration"}
private

Definition at line 80 of file DiTauOnnxDiscriminantTool.h.

◆ m_f_isotracks_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_isotracks_DecorKey { this, "DiTauFIsotracks", "DiTauJets.f_isotracks", "Name of the DiTau energy fraction carried by isolated tracks"}
private

Definition at line 94 of file DiTauOnnxDiscriminantTool.h.

◆ m_f_subjet_subl_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_subjet_subl_DecorKey {this, "DiTauSubjetSublName", "DiTauJets.f_subjet_subl", "Name of the Ditau subleading subjet pt fraction decoration"}
private

Definition at line 81 of file DiTauOnnxDiscriminantTool.h.

◆ m_f_subjets_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_subjets_DecorKey {this, "DiTauSubjetsName", "DiTauJets.f_subjets", "Name of the DiTau subjets fraction decoration"}
private

Definition at line 82 of file DiTauOnnxDiscriminantTool.h.

◆ m_input_node_names

const std::vector<std::string> DiTauRecTools::DiTauOnnxDiscriminantTool::m_input_node_names = {"input_features", "input_points", "input_mask", "input_jet", "input_time"}
private

Definition at line 48 of file DiTauOnnxDiscriminantTool.h.

◆ m_M_core_lead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_M_core_lead_DecorKey { this, "DiTauMCoreLeadName", "DiTauJets.m_core_lead", "Name of the Ditau mass of tracks in the core region of the leading subjet decoration"}
private

Definition at line 89 of file DiTauOnnxDiscriminantTool.h.

◆ m_M_core_sublead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_M_core_sublead_DecorKey { this, "DiTauMCoreSubleadName", "DiTauJets.m_core_subl", "Name of the Ditau mass of tracks in the core region of the leading subjet decoration"}
private

Definition at line 90 of file DiTauOnnxDiscriminantTool.h.

◆ m_M_track_lead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_M_track_lead_DecorKey { this, "DiTauMTrackLeadName", "DiTauJets.m_tracks_lead", "Name of the Ditau mass of tracks in the leading subjet decoration"}
private

Definition at line 91 of file DiTauOnnxDiscriminantTool.h.

◆ m_maxTracks

Gaudi::Property<size_t> DiTauRecTools::DiTauOnnxDiscriminantTool::m_maxTracks {this, "maxTracks", 10}
private

Definition at line 44 of file DiTauOnnxDiscriminantTool.h.

◆ m_n_track_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_n_track_DecorKey {this, "DiTauNTrackName", "DiTauJets.n_track", "Name of the Ditau number of tracks decoration"}
private

Definition at line 85 of file DiTauOnnxDiscriminantTool.h.

◆ m_numberOfInrmstPxlLyrHits_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_numberOfInrmstPxlLyrHits_DecorKey { this, "DiTauNumberOfInrmstPxlLyrHits", "DiTauJets.numberOfInnermostPixelLayerHits", "Name of Number of the Hits in Innermost Layer of Pixel detector decoration"}
private

Definition at line 95 of file DiTauOnnxDiscriminantTool.h.

◆ m_numberOfPixelHits_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_numberOfPixelHits_DecorKey { this, "DiTauNumberOfPixelHits", "DiTauJets.numberOfPixelHits", "Name of the number of hits in the Pixel detector decoration"}
private

Definition at line 96 of file DiTauOnnxDiscriminantTool.h.

◆ m_numberOfSCTHits_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_numberOfSCTHits_DecorKey { this, "DiTauNumberOfSCTHits", "DiTauJets.numberOfSCTHits", "Name of the nnumber of hits in the SCT detector decoration"}
private

Definition at line 97 of file DiTauOnnxDiscriminantTool.h.

◆ m_onnxModelPath

Gaudi::Property<std::string> DiTauRecTools::DiTauOnnxDiscriminantTool::m_onnxModelPath {this, "onnxModelPath", "TrigTauRec/00-11-02/dev/boosted_ditau_omni_model.onnx"}
private

Definition at line 43 of file DiTauOnnxDiscriminantTool.h.

◆ m_ort_env

std::unique_ptr<Ort::Env> DiTauRecTools::DiTauOnnxDiscriminantTool::m_ort_env
private

Definition at line 46 of file DiTauOnnxDiscriminantTool.h.

◆ m_ort_session

std::unique_ptr<Ort::Session> DiTauRecTools::DiTauOnnxDiscriminantTool::m_ort_session
private

Definition at line 47 of file DiTauOnnxDiscriminantTool.h.

◆ m_output_node_names

const std::vector<std::string> DiTauRecTools::DiTauOnnxDiscriminantTool::m_output_node_names = {"output_1", "output_2"}
private

Definition at line 49 of file DiTauOnnxDiscriminantTool.h.

◆ m_R_isotrack_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_isotrack_DecorKey { this, "DiTauRIsoTrackAllName", "DiTauJets.R_isotrack", "Name of the Ditau DeltaR isolated tracks over pt decoration"}
private

Definition at line 87 of file DiTauOnnxDiscriminantTool.h.

◆ m_R_max_lead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_max_lead_DecorKey {this, "DiTauRMaxLeadName", "DiTauJets.R_max_lead", "Name of the Ditau Max dR distance track from leading subjet decoration"}
private

Definition at line 83 of file DiTauOnnxDiscriminantTool.h.

◆ m_R_max_sublead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_max_sublead_DecorKey {this, "DiTauRMaxSubleadName", "DiTauJets.R_max_subl", "Name of the Ditau Max dR distance track from subleading subjet decoration"}
private

Definition at line 84 of file DiTauOnnxDiscriminantTool.h.

◆ m_R_track_all_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_track_all_DecorKey { this, "DiTauRTrackAllName", "DiTauJets.R_track_all", "Name of the Ditau DeltaR tracks over pt in the large region decoration"}
private

Definition at line 86 of file DiTauOnnxDiscriminantTool.h.

◆ m_R_track_sublead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_track_sublead_DecorKey { this, "DiTauRTrackSubleadName", "DiTauJets.R_tracks_subl", "Name of the Ditau DeltaR tracks over pt in the large region of the subleading subjet decoration"}
private

Definition at line 88 of file DiTauOnnxDiscriminantTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_z0_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> DiTauRecTools::DiTauOnnxDiscriminantTool::m_z0_DecorKey { this, "DiTauZ0", "DiTauJets.z0", "Name of the track z0 decoration"}
private

Definition at line 98 of file DiTauOnnxDiscriminantTool.h.


The documentation for this class was generated from the following files:
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
DiTauRecTools::DiTauOnnxDiscriminantTool::m_z0_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_z0_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:98
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
DiTauRecTools::DiTauOnnxDiscriminantTool::m_ditau_pt_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_ditau_pt_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:78
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
DiTauRecTools::DiTauOnnxDiscriminantTool::m_ort_session
std::unique_ptr< Ort::Session > m_ort_session
Definition: DiTauOnnxDiscriminantTool.h:47
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:395
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_max_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_max_sublead_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:84
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:150
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
eFEXNTuple.delta_R
def delta_R(eta1, phi1, eta2, phi2)
Definition: eFEXNTuple.py:21
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
DiTauRecTools::DiTauOnnxDiscriminantTool::m_ditauContainerKey
SG::ReadHandleKey< xAOD::DiTauJetContainer > m_ditauContainerKey
Definition: DiTauOnnxDiscriminantTool.h:77
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
athena.value
value
Definition: athena.py:124
DiTauRecTools::DiTauOnnxDiscriminantTool::m_M_track_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_M_track_lead_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:91
DiTauRecTools::DiTauOnnxDiscriminantTool::m_output_node_names
const std::vector< std::string > m_output_node_names
Definition: DiTauOnnxDiscriminantTool.h:49
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DiTauRecTools::DiTauOnnxDiscriminantTool::run_inference
InferenceOutput run_inference(OnnxInputs &inputs) const
Definition: DiTauOnnxDiscriminantTool.cxx:100
xAOD::DiTauJet_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
DiTauRecTools::DiTauOnnxDiscriminantTool::create_mask
std::vector< float > create_mask(const std::vector< std::vector< float >> &track_features) const
Definition: DiTauOnnxDiscriminantTool.cxx:86
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
DiTauRecTools::DiTauOnnxDiscriminantTool::m_numberOfInrmstPxlLyrHits_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_numberOfInrmstPxlLyrHits_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:95
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_core_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_core_lead_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:79
DiTauRecTools::DiTauOnnxDiscriminantTool::m_d0_leadtrack_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_d0_leadtrack_lead_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:92
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
xAOD::DiTauJet_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
SG::Decorator< float >
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrackParticleLinks_t
std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
Definition: DiTauIDVarCalculator.cxx:20
DiTauRecTools::DiTauOnnxDiscriminantTool::m_d0_leadtrack_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_d0_leadtrack_sublead_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:93
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_core_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_core_sublead_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:80
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
hist_file_dump.f
f
Definition: hist_file_dump.py:141
DiTauRecTools::DiTauOnnxDiscriminantTool::m_M_core_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_M_core_lead_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:89
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_subjet_subl_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_subjet_subl_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:81
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge.output
output
Definition: merge.py:17
DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_subjets_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_subjets_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:82
DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_track_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_track_sublead_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:88
DiTauRecTools::DiTauOnnxDiscriminantTool::create_tensor
Ort::Value create_tensor(std::vector< float > &data, const std::vector< int64_t > &shape) const
Definition: DiTauOnnxDiscriminantTool.cxx:95
DiTauRecTools::DiTauOnnxDiscriminantTool::m_n_track_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_n_track_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:85
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
remainder
std::vector< std::string > remainder(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
Definition: compareFlatTrees.cxx:44
DiTauRecTools::DiTauOnnxDiscriminantTool::m_onnxModelPath
Gaudi::Property< std::string > m_onnxModelPath
Definition: DiTauOnnxDiscriminantTool.h:43
DiTauRecTools::DiTauOnnxDiscriminantTool::m_numberOfPixelHits_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_numberOfPixelHits_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:96
DiTauRecTools::DiTauOnnxDiscriminantTool::m_ort_env
std::unique_ptr< Ort::Env > m_ort_env
Definition: DiTauOnnxDiscriminantTool.h:46
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DiTauRecTools::DiTauOnnxDiscriminantTool::m_M_core_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_M_core_sublead_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:90
DiTauRecTools::DiTauOnnxDiscriminantTool::m_numberOfSCTHits_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_numberOfSCTHits_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:97
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
xAOD::score
@ score
Definition: TrackingPrimitives.h:514
DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_isotracks_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_isotracks_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:94
DiTauRecTools::DiTauOnnxDiscriminantTool::flatten
std::vector< float > flatten(const std::vector< std::vector< float >> &vec_2d) const
Definition: DiTauOnnxDiscriminantTool.cxx:67
a
TList * a
Definition: liststreamerinfos.cxx:10
DiTauRecTools::DiTauOnnxDiscriminantTool::m_d0_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_d0_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:99
python.general.flattened
def flattened(l)
Definition: general.py:126
TauGNNUtils::Variables::Track::pt_log
bool pt_log(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:477
h
DiTauRecTools::DiTauOnnxDiscriminantTool::m_input_node_names
const std::vector< std::string > m_input_node_names
Definition: DiTauOnnxDiscriminantTool.h:48
eFEXNTuple.delta_phi
def delta_phi(phi1, phi2)
Definition: eFEXNTuple.py:15
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
DiTauRecTools::DiTauOnnxDiscriminantTool::nan_to_num
float nan_to_num(float value, float nan_replacement, float posinf_replacement, float neginf_replacement) const
Definition: DiTauOnnxDiscriminantTool.cxx:57
Trk::jet_phi
@ jet_phi
Definition: JetVtxParamDefs.h:28
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
xAOD::DiTauJet_v1::trackLinks
const TrackParticleLinks_t & trackLinks() const
SG::DataProxy
Definition: DataProxy.h:45
DiTauRecTools::DiTauOnnxDiscriminantTool::GetDiTauObjOnnxScore
float GetDiTauObjOnnxScore(const xAOD::DiTauJet &ditau) const
Definition: DiTauOnnxDiscriminantTool.cxx:129
DiTauRecTools::DiTauOnnxDiscriminantTool::m_maxTracks
Gaudi::Property< size_t > m_maxTracks
Definition: DiTauOnnxDiscriminantTool.h:44
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_isotrack_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_isotrack_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:87
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_max_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_max_lead_DecorKey
Definition: DiTauOnnxDiscriminantTool.h:83
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
fitman.k
k
Definition: fitman.py:528
DiTauRecTools::DiTauOnnxDiscriminantTool::extract_points
std::vector< float > extract_points(const std::vector< std::vector< float >> &track_features) const
Definition: DiTauOnnxDiscriminantTool.cxx:76