ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DiTauOnnxDiscriminantTool Class Reference

#include <DiTauOnnxDiscriminantTool.h>

Inheritance diagram for DiTauOnnxDiscriminantTool:
Collaboration diagram for DiTauOnnxDiscriminantTool:

Classes

struct  InferenceOutput
 
struct  OnnxInputs
 

Public Member Functions

 DiTauOnnxDiscriminantTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~DiTauOnnxDiscriminantTool ()
 
virtual StatusCode initialize () override
 Tool initializer. More...
 
virtual StatusCode finalize () override
 Finalizer. More...
 
virtual StatusCode execute (DiTauCandidateData *data, const EventContext &ctx) const override
 Execute - called for each Ditau candidate. More...
 
virtual StatusCode eventInitialize (DiTauCandidateData *data)
 Event initializer - called at the beginning of each event. More...
 
template<class T >
bool retrieveTool (T &tool)
 Convenience functions to handle storegate objects. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 InterfaceID implementation needed for ToolHandle. More...
 

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

Ort::Value create_tensor (std::vector< float > &data, const std::vector< int64_t > &shape) const
 
InferenceOutput run_inference (OnnxInputs &inputs) 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::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 28 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ DiTauOnnxDiscriminantTool()

DiTauOnnxDiscriminantTool::DiTauOnnxDiscriminantTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 20 of file src/DiTauOnnxDiscriminantTool.cxx.

20  :
22 {
23  declareInterface<DiTauToolBase > (this);
24 }

◆ ~DiTauOnnxDiscriminantTool()

DiTauOnnxDiscriminantTool::~DiTauOnnxDiscriminantTool ( )
virtualdefault

Member Function Documentation

◆ create_mask()

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

Definition at line 102 of file src/DiTauOnnxDiscriminantTool.cxx.

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

◆ create_tensor()

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

Definition at line 111 of file src/DiTauOnnxDiscriminantTool.cxx.

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

◆ 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; }

◆ eventInitialize()

StatusCode DiTauToolBase::eventInitialize ( DiTauCandidateData data)
virtualinherited

Event initializer - called at the beginning of each event.

Definition at line 32 of file DiTauToolBase.cxx.

33 {
34  return StatusCode::SUCCESS;
35 }

◆ 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 ( DiTauCandidateData data,
const EventContext &  ctx 
) const
overridevirtual

Execute - called for each Ditau candidate.

Reimplemented from DiTauToolBase.

Definition at line 72 of file src/DiTauOnnxDiscriminantTool.cxx.

73 {
74  static const SG::Accessor<float> omni_scoreDec("omni_score");
75  xAOD::DiTauJet* xDitau = data->xAODDiTau;
76  ATH_MSG_DEBUG("Inferencing omni DiTau ID score...");
77  float score = GetDiTauObjOnnxScore(*xDitau);
78  ATH_MSG_DEBUG("DiTau ID score: " << score);
79  omni_scoreDec(*xDitau) = score;
80  return StatusCode::SUCCESS;
81 }

◆ extract_points()

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

Definition at line 92 of file src/DiTauOnnxDiscriminantTool.cxx.

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

◆ 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

◆ finalize()

StatusCode DiTauOnnxDiscriminantTool::finalize ( )
overridevirtual

Finalizer.

Reimplemented from DiTauToolBase.

Definition at line 64 of file src/DiTauOnnxDiscriminantTool.cxx.

65 {
66  ATH_MSG_INFO( "Finalizing DiTauOnnxDiscriminantTool" );
67  m_ort_session.reset();
68  m_ort_env.reset();
69  return StatusCode::SUCCESS;
70 }

◆ flatten()

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

Definition at line 83 of file src/DiTauOnnxDiscriminantTool.cxx.

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

◆ GetDiTauObjOnnxScore()

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

Definition at line 145 of file src/DiTauOnnxDiscriminantTool.cxx.

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

◆ initialize()

StatusCode DiTauOnnxDiscriminantTool::initialize ( )
overridevirtual

Tool initializer.

Reimplemented from DiTauToolBase.

Definition at line 30 of file src/DiTauOnnxDiscriminantTool.cxx.

31 {
32  ATH_MSG_INFO( "Initializing DiTauOnnxDiscriminantTool" );
33  ATH_MSG_INFO( "onnxModelPath: " << m_onnxModelPath );
34  ATH_CHECK( m_ditau_pt_DecorKey.initialize() );
35  ATH_CHECK( m_f_core_lead_DecorKey.initialize() );
36  ATH_CHECK( m_f_core_sublead_DecorKey.initialize() );
37  ATH_CHECK( m_f_subjet_subl_DecorKey.initialize() );
38  ATH_CHECK( m_f_subjets_DecorKey.initialize() );
39  ATH_CHECK( m_R_max_lead_DecorKey.initialize() );
40  ATH_CHECK( m_R_max_sublead_DecorKey.initialize() );
41  ATH_CHECK( m_n_track_DecorKey.initialize() );
42  ATH_CHECK( m_R_track_all_DecorKey.initialize() );
43  ATH_CHECK( m_R_isotrack_DecorKey.initialize() );
44  ATH_CHECK( m_R_track_sublead_DecorKey.initialize() );
45  ATH_CHECK( m_M_core_lead_DecorKey.initialize() );
46  ATH_CHECK( m_M_core_sublead_DecorKey.initialize() );
47  ATH_CHECK( m_M_track_lead_DecorKey.initialize() );
50  ATH_CHECK( m_f_isotracks_DecorKey.initialize() );
51  auto model_path = PathResolverFindCalibFile (m_onnxModelPath);
52  if (model_path.empty()) {
53  ATH_MSG_ERROR("Could not find model file: " << m_onnxModelPath);
54  return StatusCode::FAILURE;
55  }
56  m_ort_env = std::make_unique<Ort::Env>(ORT_LOGGING_LEVEL_WARNING, "OnnxUtil");
57  Ort::SessionOptions session_options;
58  session_options.SetIntraOpNumThreads(1);
59  session_options.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED);
60  m_ort_session = std::make_unique<Ort::Session>(*m_ort_env, model_path.c_str(), session_options);
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.

◆ interfaceID()

const InterfaceID & DiTauToolBase::interfaceID ( )
staticinherited

InterfaceID implementation needed for ToolHandle.

Definition at line 9 of file DiTauToolBase.cxx.

9  {
10  return DiTauToolBaseID;
11 }

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

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

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

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

◆ retrieveTool()

template<class T >
bool DiTauToolBase::retrieveTool ( T &  tool)
inherited

Convenience functions to handle storegate objects.

Definition at line 54 of file DiTauToolBase.cxx.

54  {
55  if (tool.retrieve().isFailure()) {
56  ATH_MSG_FATAL("Failed to retrieve tool " << tool);
57  return false;
58  } else {
59  ATH_MSG_VERBOSE("Retrieved tool " << tool);
60  }
61  return true;
62 }

◆ run_inference()

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

Definition at line 116 of file src/DiTauOnnxDiscriminantTool.cxx.

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

◆ 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> 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 96 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_d0_leadtrack_sublead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> 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 97 of file DiTauRec/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> DiTauOnnxDiscriminantTool::m_ditau_pt_DecorKey { this, "DiTauPtDecorName", "DiTauJets.ditau_pt", "Name of the DiTau Pt decoration"}
private

Definition at line 82 of file DiTauRec/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> 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 83 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_f_core_sublead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> 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 84 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_f_isotracks_DecorKey

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

Definition at line 98 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_f_subjet_subl_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> 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 85 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_f_subjets_DecorKey

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

Definition at line 86 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_input_node_names

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

Definition at line 53 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_M_core_lead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> 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 93 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_M_core_sublead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> 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 94 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_M_track_lead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> 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 95 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_maxTracks

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

Definition at line 49 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_n_track_DecorKey

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

Definition at line 89 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_onnxModelPath

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

Definition at line 48 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_ort_env

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

Definition at line 51 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_ort_session

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

Definition at line 52 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_output_node_names

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

Definition at line 54 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_R_isotrack_DecorKey

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

Definition at line 91 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_R_max_lead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> 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 87 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_R_max_sublead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> 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 88 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_R_track_all_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> 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 90 of file DiTauRec/DiTauOnnxDiscriminantTool.h.

◆ m_R_track_sublead_DecorKey

SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> 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 92 of file DiTauRec/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.


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
DiTauToolBase::DiTauToolBase
DiTauToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: DiTauToolBase.cxx:14
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DiTauOnnxDiscriminantTool::m_onnxModelPath
Gaudi::Property< std::string > m_onnxModelPath
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:48
DiTauOnnxDiscriminantTool::extract_points
std::vector< float > extract_points(const std::vector< std::vector< float >> &track_features) const
Definition: src/DiTauOnnxDiscriminantTool.cxx:92
DiTauOnnxDiscriminantTool::m_M_core_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_M_core_sublead_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:94
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::Accessor< float >
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:151
DiTauOnnxDiscriminantTool::m_R_max_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_max_lead_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:87
DiTauOnnxDiscriminantTool::run_inference
InferenceOutput run_inference(OnnxInputs &inputs) const
Definition: src/DiTauOnnxDiscriminantTool.cxx:116
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
DiTauOnnxDiscriminantTool::m_d0_leadtrack_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_d0_leadtrack_sublead_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:97
DiTauOnnxDiscriminantTool::m_input_node_names
const std::vector< std::string > m_input_node_names
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:53
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
DiTauOnnxDiscriminantTool::m_R_isotrack_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_isotrack_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:91
DiTauOnnxDiscriminantTool::m_R_track_all_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_track_all_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:90
TrackParticleLinks_t
std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
Definition: src/DiTauOnnxDiscriminantTool.cxx:16
DiTauOnnxDiscriminantTool::m_M_core_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_M_core_lead_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:93
SG::ConstAccessor< uint8_t >
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::DiTauJet_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
DiTauOnnxDiscriminantTool::m_d0_leadtrack_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_d0_leadtrack_lead_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:96
DiTauOnnxDiscriminantTool::create_tensor
Ort::Value create_tensor(std::vector< float > &data, const std::vector< int64_t > &shape) const
Definition: src/DiTauOnnxDiscriminantTool.cxx:111
DiTauOnnxDiscriminantTool::flatten
std::vector< float > flatten(const std::vector< std::vector< float >> &vec_2d) const
Definition: src/DiTauOnnxDiscriminantTool.cxx:83
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
DiTauOnnxDiscriminantTool::m_ditau_pt_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_ditau_pt_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:82
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:459
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
DiTauOnnxDiscriminantTool::m_f_subjet_subl_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_subjet_subl_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:85
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
DiTauOnnxDiscriminantTool::GetDiTauObjOnnxScore
float GetDiTauObjOnnxScore(const xAOD::DiTauJet &ditau) const
Definition: src/DiTauOnnxDiscriminantTool.cxx:145
lumiFormat.i
int i
Definition: lumiFormat.py:85
DiTauOnnxDiscriminantTool::m_f_core_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_core_sublead_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:84
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
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
hist_file_dump.f
f
Definition: hist_file_dump.py:140
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
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
DiTauOnnxDiscriminantTool::m_M_track_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_M_track_lead_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:95
merge.output
output
Definition: merge.py:16
DiTauOnnxDiscriminantTool::m_ort_session
std::unique_ptr< Ort::Session > m_ort_session
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:52
DiTauOnnxDiscriminantTool::m_n_track_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_n_track_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:89
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
DiTauOnnxDiscriminantTool::m_f_core_lead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_core_lead_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:83
remainder
std::vector< std::string > remainder(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
Definition: compareFlatTrees.cxx:44
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DiTauOnnxDiscriminantTool::create_mask
std::vector< float > create_mask(const std::vector< std::vector< float >> &track_features) const
Definition: src/DiTauOnnxDiscriminantTool.cxx:102
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:452
DiTauOnnxDiscriminantTool::m_output_node_names
const std::vector< std::string > m_output_node_names
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:54
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:283
xAOD::score
@ score
Definition: TrackingPrimitives.h:514
DiTauOnnxDiscriminantTool::m_ort_env
std::unique_ptr< Ort::Env > m_ort_env
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:51
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
eFEXNTuple.delta_phi
def delta_phi(phi1, phi2)
Definition: eFEXNTuple.py:15
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
xAOD::DiTauJet_v1
Definition: DiTauJet_v1.h:31
DiTauOnnxDiscriminantTool::m_f_subjets_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_subjets_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:86
Trk::jet_phi
@ jet_phi
Definition: JetVtxParamDefs.h:28
DiTauOnnxDiscriminantTool::m_R_track_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_track_sublead_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:92
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
DiTauOnnxDiscriminantTool::m_f_isotracks_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_f_isotracks_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:98
xAOD::DiTauJet_v1::trackLinks
const TrackParticleLinks_t & trackLinks() const
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97
DiTauOnnxDiscriminantTool::m_maxTracks
Gaudi::Property< size_t > m_maxTracks
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:49
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
DiTauOnnxDiscriminantTool::m_R_max_sublead_DecorKey
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_R_max_sublead_DecorKey
Definition: DiTauRec/DiTauOnnxDiscriminantTool.h:88