ATLAS Offline Software
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, V, H > &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) const 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, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &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"}
 
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 ools/DiTauRecTools/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 103 of file ools/Root/DiTauOnnxDiscriminantTool.cxx.

103  {
104  std::vector<float> mask;
105  mask.reserve(track_features.size());
106  std::transform(track_features.begin(), track_features.end(), std::back_inserter(mask), [](const auto &track) {
107  return std::abs(track[2]) > 1e-6 ? 1.0f : 0.0f;
108  });
109  return mask;
110 }

◆ create_tensor()

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

Definition at line 112 of file ools/Root/DiTauOnnxDiscriminantTool.cxx.

112  {
113  Ort::MemoryInfo memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
114  return Ort::Value::CreateTensor<float>(memory_info, data.data(), data.size(),shape.data(), shape.size());
115 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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) const
overrideprivatevirtual

Declare the interface that the class provides.

Implements DiTauRecTools::IDiTauToolBase.

Definition at line 64 of file ools/Root/DiTauOnnxDiscriminantTool.cxx.

65 {
66  const static SG::Decorator<float> omni_scoreDec("omni_score");
67  ATH_MSG_DEBUG("Inferencing omni DiTau ID score...");
68  float score = GetDiTauObjOnnxScore(xDiTau);
69  ATH_MSG_DEBUG("DiTau ID score: " << score);
70  omni_scoreDec(xDiTau) = score;
71  return StatusCode::SUCCESS;
72 }

◆ extract_points()

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

Definition at line 93 of file ools/Root/DiTauOnnxDiscriminantTool.cxx.

93  {
94  std::vector<float> points;
95  points.reserve(track_features.size() * 2);
96  for (const auto &track : track_features) {
97  points.push_back(track[0]); // delta_eta
98  points.push_back(track[1]); // delta_phi
99  }
100  return points;
101 }

◆ 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 84 of file ools/Root/DiTauOnnxDiscriminantTool.cxx.

84  {
85  std::vector<float> flattened;
86  flattened.reserve(vec_2d.size() * (vec_2d.empty() ? 0 : vec_2d[0].size()));
87  for (const auto &inner : vec_2d) {
88  flattened.insert(flattened.end(), inner.begin(), inner.end());
89  }
90  return flattened;
91 }

◆ GetDiTauObjOnnxScore()

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

Definition at line 146 of file ools/Root/DiTauOnnxDiscriminantTool.cxx.

146  {
147 
164  // Accessors for reading the necessary features from the xAOD::TrackParticle object
165  static const SG::ConstAccessor< uint8_t > numberOfInrmstPxlLyrHitsAcc ("numberOfInnermostPixelLayerHits");
166  static const SG::ConstAccessor< uint8_t > numberOfPixelHitsAcc ("numberOfPixelHits");
167  static const SG::ConstAccessor< uint8_t > numberOfSCTHitsAcc ("numberOfSCTHits");
168  static const SG::ConstAccessor< float > z0Acc ("z0");
169  static const SG::ConstAccessor< float > d0Acc ("d0");
170 
171 
172  // Input features for Ditau tagger ONNX model
173  std::vector<float> jet_vars = {
174  R_max_leadDec (ditau),
175  R_max_subleadDec (ditau),
176  R_tracks_sublDec (ditau),
177  R_isotracDec (ditau),
178  d0_leadtrack_leadDec (ditau),
179  d0_leadtrack_sublDec (ditau),
180  f_core_leadDec (ditau),
181  f_core_sublDec (ditau),
182  f_subjet_sublDec (ditau),
183  f_subjetDec (ditau),
184  f_isotracks_Dec (ditau),
185  M_core_leadDec (ditau),
186  M_core_sublDec (ditau),
187  M_tracks_leadDec (ditau),
188  static_cast<float>( n_trackDec (ditau)),
189  };
190  std::vector<int64_t> jet_shape = {1, static_cast<int64_t>(jet_vars.size())};
191 
192  const TrackParticleLinks_t &vTauTracks = ditau.trackLinks();
193  std::vector<std::vector<float>> track_features(m_maxTracks, std::vector<float>(11, 0.0f));
194 
195  float jet_eta = ditau.eta();
196  float jet_phi = ditau.phi();
197  size_t num_tracks = std::min(static_cast<size_t>(m_maxTracks), vTauTracks.size());
198 
199  for (size_t i = 0; i < num_tracks; ++i) {
200  const ElementLink<xAOD::TrackParticleContainer> &trackLink = vTauTracks[i];
201  if (!trackLink.isValid()) continue;
202  const xAOD::TrackParticle *xTrack = *trackLink;
203  float track_eta = xTrack->eta();
204  float track_phi = xTrack->phi();
205  float delta_eta = track_eta - jet_eta;
206  float delta_phi = std::remainder(track_phi - jet_phi, 2 * M_PI);
207  float delta_R = std::hypot(delta_eta, delta_phi);
208  float track_pt = static_cast<float>(xTrack->pt());
209  float pt_log = std::log(track_pt + 1e-8f);
210  float jet_pt = ditau_ptDec(ditau);
211  float pt_ratio = track_pt / jet_pt;
212  float pt_ratio_log = std::log(1.0f - pt_ratio + 1e-8f);
213  float track_charge = xTrack->charge();
214  float pt_ratio_log_nan_less = nan_to_num(pt_ratio_log, 0.0f, 0.0f, 0.0f);
215 
216  track_features[i] = {
217  delta_eta,
218  delta_phi,
219  pt_log,
220  d0Acc(*xTrack),
221  pt_ratio_log_nan_less,
222  z0Acc(*xTrack),
223  delta_R,
224  static_cast<float>(numberOfInrmstPxlLyrHitsAcc(*xTrack)),
225  static_cast<float>(numberOfPixelHitsAcc(*xTrack)),
226  static_cast<float>(numberOfSCTHitsAcc(*xTrack)),
227  track_charge
228  };
229  }
230  std::vector<int64_t> track_shape = {1, static_cast<int64_t>(m_maxTracks), 11};
231 
232  // Actual ONNX inference
233  OnnxInputs inputs{
234  flatten(track_features),
235  track_shape,
236  extract_points(track_features),
237  {1, track_shape[1], 2},
238  create_mask(track_features),
239  {1, track_shape[1]},
240  std::move(jet_vars),
241  std::move(jet_shape),
242  {0.0f},
243  {1, 1}
244  };
245  auto output = run_inference(inputs);
246  return output.output_1[1];
247 }

◆ 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 ools/Root/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  ATH_CHECK( m_ditau_pt_DecorKey.initialize() );
44  ATH_CHECK( m_f_core_lead_DecorKey.initialize() );
45  ATH_CHECK( m_f_core_sublead_DecorKey.initialize() );
46  ATH_CHECK( m_f_subjet_subl_DecorKey.initialize() );
47  ATH_CHECK( m_f_subjets_DecorKey.initialize() );
48  ATH_CHECK( m_R_max_lead_DecorKey.initialize() );
49  ATH_CHECK( m_R_max_sublead_DecorKey.initialize() );
50  ATH_CHECK( m_n_track_DecorKey.initialize() );
51  ATH_CHECK( m_R_track_all_DecorKey.initialize() );
52  ATH_CHECK( m_R_isotrack_DecorKey.initialize() );
53  ATH_CHECK( m_R_track_sublead_DecorKey.initialize() );
54  ATH_CHECK( m_M_core_lead_DecorKey.initialize() );
55  ATH_CHECK( m_M_core_sublead_DecorKey.initialize() );
56  ATH_CHECK( m_M_track_lead_DecorKey.initialize() );
59  ATH_CHECK( m_f_isotracks_DecorKey.initialize() );
60 
61  return StatusCode::SUCCESS;
62 }

◆ 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 74 of file ools/Root/DiTauOnnxDiscriminantTool.cxx.

74  {
75  if (std::isnan(value))
76  return nan_replacement;
77  if (value == std::numeric_limits<float>::infinity())
78  return posinf_replacement;
79  if (value == -std::numeric_limits<float>::infinity())
80  return neginf_replacement;
81  return value;
82  }

◆ 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 117 of file ools/Root/DiTauOnnxDiscriminantTool.cxx.

117  {
118  std::vector<Ort::Value> input_tensors;
119  input_tensors.reserve(m_input_node_names.size());
120  input_tensors.emplace_back(create_tensor(inputs.input_features, inputs.input_features_shape));
121  input_tensors.emplace_back(create_tensor(inputs.input_points, inputs.input_points_shape));
122  input_tensors.emplace_back(create_tensor(inputs.input_mask, inputs.input_mask_shape));
123  input_tensors.emplace_back(create_tensor(inputs.input_jet, inputs.input_jet_shape));
124  input_tensors.emplace_back(create_tensor(inputs.input_time, inputs.input_time_shape));
125 
126  std::vector<const char *> input_node_names;
127  input_node_names.reserve(m_input_node_names.size());
128  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(); });
129 
130  std::vector<const char *> output_node_names;
131  output_node_names.reserve(m_output_node_names.size());
132  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(); });
133 
134  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());
135 
136  InferenceOutput output;
137  for (size_t i = 0; i < output_tensors.size(); ++i) {
138  const auto &tensor = output_tensors[i];
139  const size_t length = tensor.GetTensorTypeAndShapeInfo().GetElementCount();
140  const float *data = tensor.GetTensorData<float>();
141  (i == 0 ? output.output_1 : output.output_2) = std::vector<float>(data, data + length);
142  }
143  return output;
144 }

◆ 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_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

◆ 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

◆ 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

◆ m_ditauContainerKey

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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ m_maxTracks

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

◆ 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

◆ m_onnxModelPath

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

◆ m_ort_env

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

◆ m_ort_session

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

◆ m_output_node_names

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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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.


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:74
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
DiTauRecTools::DiTauOnnxDiscriminantTool::m_ditau_pt_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_ditau_pt_DecorKey
Definition: ools/DiTauRecTools/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: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:47
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
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: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:84
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:151
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:78
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: ools/DiTauRecTools/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: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:91
TrackParticleLinks_t
std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
Definition: src/DiTauOnnxDiscriminantTool.cxx:16
DiTauRecTools::DiTauOnnxDiscriminantTool::m_output_node_names
const std::vector< std::string > m_output_node_names
Definition: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:49
SG::ConstAccessor< uint8_t >
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DiTauRecTools::DiTauOnnxDiscriminantTool::run_inference
InferenceOutput run_inference(OnnxInputs &inputs) const
Definition: ools/Root/DiTauOnnxDiscriminantTool.cxx:117
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: ools/Root/DiTauOnnxDiscriminantTool.cxx:103
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:459
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
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
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: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:79
DiTauRecTools::DiTauOnnxDiscriminantTool::m_d0_leadtrack_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_d0_leadtrack_lead_DecorKey
Definition: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:92
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
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
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
DiTauRecTools::DiTauOnnxDiscriminantTool::m_d0_leadtrack_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_d0_leadtrack_sublead_DecorKey
Definition: ools/DiTauRecTools/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: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:80
CalibDbCompareRT.dummy
dummy
Definition: CalibDbCompareRT.py:59
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:140
DiTauRecTools::DiTauOnnxDiscriminantTool::m_M_core_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_M_core_lead_DecorKey
Definition: ools/DiTauRecTools/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: ools/DiTauRecTools/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:16
DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_subjets_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_subjets_DecorKey
Definition: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:82
DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_track_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_track_sublead_DecorKey
Definition: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:88
DiTauRecTools::DiTauOnnxDiscriminantTool::create_tensor
Ort::Value create_tensor(std::vector< float > &data, const std::vector< int64_t > &shape) const
Definition: ools/Root/DiTauOnnxDiscriminantTool.cxx:112
DiTauRecTools::DiTauOnnxDiscriminantTool::m_n_track_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_n_track_DecorKey
Definition: ools/DiTauRecTools/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: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:43
DiTauRecTools::DiTauOnnxDiscriminantTool::m_ort_env
std::unique_ptr< Ort::Env > m_ort_env
Definition: ools/DiTauRecTools/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: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:90
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:283
xAOD::score
@ score
Definition: TrackingPrimitives.h:514
DiTauRecTools::DiTauOnnxDiscriminantTool::m_f_isotracks_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_isotracks_DecorKey
Definition: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:94
DiTauRecTools::DiTauOnnxDiscriminantTool::flatten
std::vector< float > flatten(const std::vector< std::vector< float >> &vec_2d) const
Definition: ools/Root/DiTauOnnxDiscriminantTool.cxx:84
a
TList * a
Definition: liststreamerinfos.cxx:10
python.general.flattened
def flattened(l)
Definition: general.py:125
TauGNNUtils::Variables::Track::pt_log
bool pt_log(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:478
h
DiTauRecTools::DiTauOnnxDiscriminantTool::m_input_node_names
const std::vector< std::string > m_input_node_names
Definition: ools/DiTauRecTools/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: ools/Root/DiTauOnnxDiscriminantTool.cxx:74
Trk::jet_phi
@ jet_phi
Definition: JetVtxParamDefs.h:28
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
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: ools/Root/DiTauOnnxDiscriminantTool.cxx:146
DiTauRecTools::DiTauOnnxDiscriminantTool::m_maxTracks
Gaudi::Property< size_t > m_maxTracks
Definition: ools/DiTauRecTools/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: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:87
DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_max_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_max_lead_DecorKey
Definition: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:83
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97
DiTauRecTools::DiTauOnnxDiscriminantTool::m_R_track_all_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_track_all_DecorKey
Definition: ools/DiTauRecTools/DiTauOnnxDiscriminantTool.h:86
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: ools/Root/DiTauOnnxDiscriminantTool.cxx:93