ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
CP::PhotonVertexSelectionTool Class Referenceabstract

Implementation for the photon vertex selection tool. More...

#include <PhotonVertexSelectionTool.h>

Inheritance diagram for CP::PhotonVertexSelectionTool:
Collaboration diagram for CP::PhotonVertexSelectionTool:

Public Types

enum  FailType {
  Unkown = -99, NoFail = 0, NoVxCont = 1, NoEventInfo = 2,
  FailPointing = 3, FailEgamVect = 4, NoGdCandidate = 5, MatchedTrack = 6
}
 Declare the interface that the class provides. More...
 
enum  yyVtxType { Unknown = -1, ConvTrack = 0, SiConvTrack = 1, NoSiTracks = 2 }
 

Public Member Functions

 PhotonVertexSelectionTool (const std::string &name)
 
virtual ~PhotonVertexSelectionTool ()
 
virtual void print () const =0
 Print the state of the tool. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
Function(s) implementing the asg::IAsgTool interface
virtual StatusCode initialize ()
 Function initialising the tool. More...
 
Function(s) implementing the IPhotonVertexSelectionTool interface
StatusCode decorateInputs (const xAOD::EgammaContainer &egammas, FailType *failType=nullptr) const
 Given a list of photons, decorate vertex container with MVA variables. More...
 
StatusCode getVertex (const xAOD::EgammaContainer &egammas, const xAOD::Vertex *&vertex, bool ignoreConv=false) const
 Given a list of photons, return the most likely vertex based on MVA likelihood. More...
 
std::vector< std::pair< const xAOD::Vertex *, float > > getVertex (const xAOD::EgammaContainer &egammas, bool ignoreConv=false, bool noDecorate=false, yyVtxType *vtxCase=nullptr, FailType *failType=nullptr) const
 Given a list of photons, return the MLPs of all vertices in the event. More...
 
int getCase () const
 Return the last case treated: More...
 
const xAOD::VertexgetPrimaryVertexFromConv (const xAOD::PhotonContainer *photons) const
 Get possible vertex directly associated with photon conversions. 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

std::tuple< std::shared_ptr< Ort::Session >, Ort::AllocatorWithDefaultOptions > setONNXSession (Ort::Env &env, const std::string &modelFilePath)
 
std::tuple< std::vector< int64_t >, std::vector< const char * > > getInputNodes (const std::shared_ptr< Ort::Session > sessionHandle, Ort::AllocatorWithDefaultOptions &allocator)
 
std::tuple< std::vector< int64_t >, std::vector< const char * > > getOutputNodes (const std::shared_ptr< Ort::Session > sessionHandle, Ort::AllocatorWithDefaultOptions &allocator)
 
float getScore (int nVars, const std::vector< std::vector< float >> &input_data, const std::shared_ptr< Ort::Session > sessionHandle, std::vector< int64_t > input_node_dims, std::vector< const char * > input_node_names, std::vector< const char * > output_node_names) const
 
TLorentzVector getEgammaVector (const xAOD::EgammaContainer *egammas, FailType &failType) const
 Get combined 4-vector of photon container. More...
 
StatusCode getVertexImp (const xAOD::EgammaContainer &egammas, const xAOD::Vertex *&vertex, bool ignoreConv, bool noDecorate, std::vector< std::pair< const xAOD::Vertex *, float > > &, yyVtxType &, FailType &) const
 Given a list of photons, return the MLPs of all vertices in the event. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Static Private Member Functions

static bool sortMLP (const std::pair< const xAOD::Vertex *, float > &a, const std::pair< const xAOD::Vertex *, float > &b)
 Sort MLP results. More...
 

Private Attributes

int m_nVars
 Create a proper constructor for Athena. More...
 
float m_convPtCut
 
bool m_doSkipByZSigma
 
std::string m_vertexContainerName
 
std::string m_derivationPrefix
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfo {this, "EventInfoContName", "EventInfo", "event info key"}
 Container declarations. More...
 
SG::ReadHandleKey< xAOD::VertexContainerm_vertexContainer {this, "VertexContainer", "PrimaryVertices", "Vertex container name"}
 
bool m_isTMVA
 
std::string m_TMVAModelFilePath1
 
std::string m_TMVAModelFilePath2
 
std::unique_ptr< TMVA::Reader > m_mva1
 
std::unique_ptr< TMVA::Reader > m_mva2
 
std::string m_ONNXModelFilePath1
 
std::string m_ONNXModelFilePath2
 
std::vector< int64_t > m_input_node_dims1
 
std::vector< int64_t > m_output_node_dims1
 
std::vector< const char * > m_input_node_names1
 
std::vector< const char * > m_output_node_names1
 
std::vector< int64_t > m_input_node_dims2
 
std::vector< int64_t > m_output_node_dims2
 
std::vector< const char * > m_input_node_names2
 
std::vector< const char * > m_output_node_names2
 
std::shared_ptr< Ort::Session > m_sessionHandle1
 
std::shared_ptr< Ort::Session > m_sessionHandle2
 
Ort::AllocatorWithDefaultOptions m_allocator1
 
Ort::AllocatorWithDefaultOptions m_allocator2
 
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

Implementation for the photon vertex selection tool.

Takes a list of photons (for example, to two leading photons) and the most likely primary vertex, based on an MVA.

Author
Christopher Meyer chris.nosp@m..mey.nosp@m.er@ce.nosp@m.rn.c.nosp@m.h
Bruno Lenzi bruno.nosp@m..len.nosp@m.zi@ce.nosp@m.rn.c.nosp@m.h

Definition at line 37 of file PhotonVertexSelectionTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ FailType

Declare the interface that the class provides.

enum indicating where the tool has failed

Enumerator
Unkown 
NoFail 
NoVxCont 
NoEventInfo 
FailPointing 
FailEgamVect 
NoGdCandidate 
MatchedTrack 

Definition at line 33 of file IPhotonVertexSelectionTool.h.

33  {
34  Unkown = -99, // Init value
35  NoFail = 0, // Ok to run the MVA algorithm
36  NoVxCont = 1, // No vertex container
37  NoEventInfo = 2, // No EventInfo
38  FailPointing = 3, // Calo pointing failed
39  FailEgamVect = 4, // No diphoton event
40  NoGdCandidate = 5, // Pointing succeded but too distant from any other vertex
41  MatchedTrack = 6, // Conversion photon has a track attached to a primary/pileup vertex
42  };

◆ yyVtxType

Enumerator
Unknown 
ConvTrack 
SiConvTrack 
NoSiTracks 

Definition at line 44 of file IPhotonVertexSelectionTool.h.

44  {
45  Unknown = -1, // Init value
46  ConvTrack = 0, // conv track associated to vertex,
47  SiConvTrack = 1, // at least one conv track with Si hits,
48  NoSiTracks = 2, // no tracks with Si hits or conversions ignored
49  };

Constructor & Destructor Documentation

◆ PhotonVertexSelectionTool()

CP::PhotonVertexSelectionTool::PhotonVertexSelectionTool ( const std::string &  name)

Definition at line 54 of file PhotonVertexSelectionTool.cxx.

56  {
57  // run 2 NN model:
58  // m_doSkipByZSigma = true, m_isTMVA = true
59  // run 3 NN model:
60  // m_doSkipByZSigma = false, m_isTMVA = false
61 
62  // default variables
63  declareProperty("nVars", m_nVars = 4);
64  declareProperty("conversionPtCut", m_convPtCut = 2e3);
65  declareProperty("DoSkipByZSigma", m_doSkipByZSigma = false);
66 
67  declareProperty("derivationPrefix", m_derivationPrefix = "");
68 
69  // boolean for TMVA, default true
70  declareProperty("isTMVA", m_isTMVA = false);
71 
72  // config files (TMVA), default paths if not set
73  declareProperty("ConfigFileCase1",
74  m_TMVAModelFilePath1 = "PhotonVertexSelection/v1/DiphotonVertex_case1.weights.xml");
75  declareProperty("ConfigFileCase2",
76  m_TMVAModelFilePath2 = "PhotonVertexSelection/v1/DiphotonVertex_case2.weights.xml");
77 
78  // config files (ONNX), default paths if not set
79  declareProperty("ONNXModelFileCase1", m_ONNXModelFilePath1 = "PhotonVertexSelection/run3nn/model1.onnx");
80  declareProperty("ONNXModelFileCase2", m_ONNXModelFilePath2 = "PhotonVertexSelection/run3nn/model2.onnx");
81  }

◆ ~PhotonVertexSelectionTool()

CP::PhotonVertexSelectionTool::~PhotonVertexSelectionTool ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ decorateInputs()

StatusCode CP::PhotonVertexSelectionTool::decorateInputs ( const xAOD::EgammaContainer egammas,
FailType failType = nullptr 
) const
virtual

Given a list of photons, decorate vertex container with MVA variables.

Implements CP::IPhotonVertexSelectionTool.

Definition at line 250 of file PhotonVertexSelectionTool.cxx.

250  {
251  auto fail = FailType::NoFail;
252 
253  static const SG::AuxElement::Decorator<float> sumPt2(m_derivationPrefix + "sumPt2");
254  static const SG::AuxElement::Decorator<float> sumPt(m_derivationPrefix + "sumPt");
257 
258  // Get the EventInfo
260 
261  // Find the common z-position from beam / photon pointing information
262  std::pair<float, float> zCommon = xAOD::PVHelpers::getZCommonAndError(&*eventInfo, &egammas, m_convPtCut);
263  // Vector sum of photons
264  TLorentzVector vegamma = getEgammaVector(&egammas, fail);
265 
266  // Retrieve PV collection from TEvent
268 
269  for (const xAOD::Vertex* vertex: *vertices) {
270 
271  // Skip dummy vertices
272  if (!(vertex->vertexType() == xAOD::VxType::VertexType::PriVtx ||
273  vertex->vertexType() == xAOD::VxType::VertexType::PileUp)) continue;
274 
275  // Set input variables
276  if (not sumPt.isAvailable(*vertex)) {
277  sumPt(*vertex) = xAOD::PVHelpers::getVertexSumPt(vertex, 1, false);
278  }
279 
280  if (not sumPt2.isAvailable(*vertex)) {
282  }
283 
284  // Get momentum vector of vertex
285  TLorentzVector vmom = xAOD::PVHelpers::getVertexMomentum(vertex, true, m_derivationPrefix);
286 
287  deltaPhi(*vertex) = (fail != FailType::FailEgamVect) ? std::abs(vmom.DeltaPhi(vegamma)) : -999.;
288  deltaZ(*vertex) = std::abs((zCommon.first - vertex->z())/zCommon.second);
289 
290  } // loop over vertices
291 
292  ATH_MSG_DEBUG("DecorateInputs exit code "<< fail);
293  if(failType!=nullptr)
294  *failType = fail;
295  return StatusCode::SUCCESS;
296  }

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

◆ 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

◆ getCase()

int CP::PhotonVertexSelectionTool::getCase ( ) const
inlinevirtual

Return the last case treated:

Implements CP::IPhotonVertexSelectionTool.

Definition at line 136 of file PhotonVertexSelectionTool.h.

136 { return -1; }

◆ getEgammaVector()

TLorentzVector CP::PhotonVertexSelectionTool::getEgammaVector ( const xAOD::EgammaContainer egammas,
FailType failType 
) const
private

Get combined 4-vector of photon container.

Definition at line 587 of file PhotonVertexSelectionTool.cxx.

588  {
589  TLorentzVector v, v1;
590  const xAOD::CaloCluster *cluster = nullptr;
591  for (const xAOD::Egamma* egamma: *egammas) {
592  if (egamma == nullptr) {
593  ATH_MSG_DEBUG("No egamma object to get four vector");
594  failType = FailType::FailEgamVect;
595  continue;
596  }
597  cluster = egamma->caloCluster();
598  if (cluster == nullptr) {
599  ATH_MSG_WARNING("No cluster associated to egamma, not adding to 4-vector.");
600  continue;
601  }
602 
603  v1.SetPtEtaPhiM(egamma->e()/cosh(cluster->etaBE(2)),
604  cluster->etaBE(2),
605  cluster->phiBE(2),
606  0.0);
607  v += v1;
608  }
609  return v;
610  }

◆ getInputNodes()

std::tuple< std::vector< int64_t >, std::vector< const char * > > CP::PhotonVertexSelectionTool::getInputNodes ( const std::shared_ptr< Ort::Session >  sessionHandle,
Ort::AllocatorWithDefaultOptions &  allocator 
)
private

Definition at line 125 of file PhotonVertexSelectionTool.cxx.

125  {
126  // input nodes
127  std::vector<int64_t> input_node_dims;
128  size_t num_input_nodes = sessionHandle->GetInputCount();
129  std::vector<const char*> input_node_names(num_input_nodes);
130 
131  // Loop the input nodes
132  for( std::size_t i = 0; i < num_input_nodes; i++ ) {
133  // Print input node names
134  char* input_name = sessionHandle->GetInputNameAllocated(i, allocator).release();
135  ATH_MSG_DEBUG("Input "<<i<<" : "<<" name= "<<input_name);
136  input_node_names[i] = input_name;
137 
138  // Print input node types
139  Ort::TypeInfo type_info = sessionHandle->GetInputTypeInfo(i);
140  auto tensor_info = type_info.GetTensorTypeAndShapeInfo();
141  ONNXTensorElementDataType type = tensor_info.GetElementType();
142  ATH_MSG_DEBUG("Input "<<i<<" : "<<" type= "<<type);
143 
144  // Print input shapes/dims
145  input_node_dims = tensor_info.GetShape();
146  ATH_MSG_DEBUG("Input "<<i<<" : num_dims= "<<input_node_dims.size());
147  for (std::size_t j = 0; j < input_node_dims.size(); j++){
148  if(input_node_dims[j]<0){input_node_dims[j] =1;}
149  ATH_MSG_DEBUG("Input"<<i<<" : dim "<<j<<"= "<<input_node_dims[j]);
150  }
151  }
152  return std::make_tuple(input_node_dims, input_node_names);
153  }

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

◆ getOutputNodes()

std::tuple< std::vector< int64_t >, std::vector< const char * > > CP::PhotonVertexSelectionTool::getOutputNodes ( const std::shared_ptr< Ort::Session >  sessionHandle,
Ort::AllocatorWithDefaultOptions &  allocator 
)
private

Definition at line 156 of file PhotonVertexSelectionTool.cxx.

156  {
157  // output nodes
158  std::vector<int64_t> output_node_dims;
159  size_t num_output_nodes = sessionHandle->GetOutputCount();
160  std::vector<const char*> output_node_names(num_output_nodes);
161 
162  // Loop the output nodes
163  for( std::size_t i = 0; i < num_output_nodes; i++ ) {
164  // Print output node names
165  char* output_name = sessionHandle->GetOutputNameAllocated(i, allocator).release();
166  ATH_MSG_DEBUG("Output "<<i<<" : "<<" name= "<<output_name);
167  output_node_names[i] = output_name;
168 
169  Ort::TypeInfo type_info = sessionHandle->GetOutputTypeInfo(i);
170  auto tensor_info = type_info.GetTensorTypeAndShapeInfo();
171  ONNXTensorElementDataType type = tensor_info.GetElementType();
172  ATH_MSG_DEBUG("Output "<<i<<" : "<<" type= "<<type);
173 
174  // Print output shapes/dims
175  output_node_dims = tensor_info.GetShape();
176  ATH_MSG_DEBUG("Output "<<i<<" : num_dims= "<<output_node_dims.size());
177  for (std::size_t j = 0; j < output_node_dims.size(); j++){
178  if(output_node_dims[j]<0){output_node_dims[j] =1;}
179  ATH_MSG_DEBUG("Output"<<i<<" : dim "<<j<<"= "<<output_node_dims[j]);
180  }
181  }
182  return std::make_tuple(output_node_dims, output_node_names);
183  }

◆ getPrimaryVertexFromConv()

const xAOD::Vertex * CP::PhotonVertexSelectionTool::getPrimaryVertexFromConv ( const xAOD::PhotonContainer photons) const
virtual

Get possible vertex directly associated with photon conversions.

Implements CP::IPhotonVertexSelectionTool.

Definition at line 533 of file PhotonVertexSelectionTool.cxx.

534  {
535  if (photons == nullptr) {
536  ATH_MSG_WARNING("Passed nullptr photon container, returning nullptr vertex from getPrimaryVertexFromConv");
537  return nullptr;
538  }
539 
540  std::vector<const xAOD::Vertex*> vertices;
541  const xAOD::Vertex *conversionVertex = nullptr, *primary = nullptr;
542  const xAOD::TrackParticle *tp = nullptr;
543  size_t NumberOfTracks = 0;
544 
545  // Retrieve PV collection from TEvent
547 
548 
549  for (const auto *photon: *photons) {
550  conversionVertex = photon->vertex();
551  if (conversionVertex == nullptr) continue;
552 
553  NumberOfTracks = conversionVertex->nTrackParticles();
554  for (size_t i = 0; i < NumberOfTracks; ++i) {
555  // Get trackParticle in GSF collection
556  const auto *gsfTp = conversionVertex->trackParticle(i);
557  if (gsfTp == nullptr) continue;
558  if (!xAOD::PVHelpers::passConvSelection(*conversionVertex, i, m_convPtCut)) continue;
559 
560  // Get trackParticle in InDet collection
562  if (tp == nullptr) continue;
563 
564  primary = getVertexFromTrack(tp, &*all_vertices);
565  if (primary == nullptr) continue;
566 
567  if (primary->vertexType() == xAOD::VxType::VertexType::PriVtx ||
568  primary->vertexType() == xAOD::VxType::VertexType::PileUp) {
569  if (std::find(vertices.begin(), vertices.end(), primary) == vertices.end()) {
570  vertices.push_back(primary);
571  continue;
572  }
573  }
574  }
575  }
576 
577  if (!vertices.empty()) {
578  if (vertices.size() > 1)
579  ATH_MSG_WARNING("Photons associated to different vertices! Returning lead photon association.");
580  return vertices[0];
581  }
582 
583  return nullptr;
584  }

◆ getProperty()

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

Get one of the tool's properties.

◆ getScore()

float CP::PhotonVertexSelectionTool::getScore ( int  nVars,
const std::vector< std::vector< float >> &  input_data,
const std::shared_ptr< Ort::Session >  sessionHandle,
std::vector< int64_t >  input_node_dims,
std::vector< const char * >  input_node_names,
std::vector< const char * >  output_node_names 
) const
private

Definition at line 89 of file PhotonVertexSelectionTool.cxx.

89  {
90  //*************************************************************************
91  // score the model using sample data, and inspect values
92  // loading input data
93  std::vector<std::vector<float>> input_tensor_values_ = input_data;
94 
95  //preparing container to hold input data
96  size_t input_tensor_size = nVars;
97  std::vector<float> input_tensor_values(nVars);
98  input_tensor_values = input_tensor_values_[0]; //0th element since only batch_size of 1, otherwise loop
99 
100  // create input tensor object from data values
101  auto memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
102  // create tensor using info from inputs
103  Ort::Value input_tensor = Ort::Value::CreateTensor<float>(memory_info, input_tensor_values.data(), input_tensor_size, input_node_dims.data(), input_node_dims.size());
104 
105  // check if input is of type tensor
106  assert(input_tensor.IsTensor());
107 
108  // run the inference
109  auto output_tensors = sessionHandle->Run(Ort::RunOptions{nullptr}, input_node_names.data(), &input_tensor, input_node_names.size(), output_node_names.data(), output_node_names.size());
110 
111  // check size of output tensor
112  assert(output_tensors.size() == 1 && output_tensors.front().IsTensor());
113 
114  // get pointer to output tensor float values
115  //float* floatarr = output_tensors.front().GetTensorMutableData<float>();
116  float* floatarr = output_tensors[0].GetTensorMutableData<float>();
117 
118  int arrSize = sizeof(*floatarr)/sizeof(floatarr[0]);
119  ATH_MSG_DEBUG("The size of the array is: " << arrSize);
120  ATH_MSG_DEBUG("floatarr[0] = " << floatarr[0]);
121  return floatarr[0];
122  }

◆ getVertex() [1/2]

std::vector< std::pair< const xAOD::Vertex *, float > > CP::PhotonVertexSelectionTool::getVertex ( const xAOD::EgammaContainer egammas,
bool  ignoreConv = false,
bool  noDecorate = false,
yyVtxType vtxCase = nullptr,
FailType failType = nullptr 
) const
virtual

Given a list of photons, return the MLPs of all vertices in the event.

Implements CP::IPhotonVertexSelectionTool.

Definition at line 300 of file PhotonVertexSelectionTool.cxx.

301  {
302  const xAOD::Vertex *vertex = nullptr;
303  std::vector<std::pair<const xAOD::Vertex*, float> > vertexMLP;
304  yyVtxType vtxCase = yyVtxType::Unknown;
305  FailType failType = FailType::NoFail;
306  if (getVertexImp( egammas, vertex, ignoreConv, noDecorate, vertexMLP, vtxCase, failType ).isSuccess()) {
307  std::sort(vertexMLP.begin(), vertexMLP.end(), sortMLP);
308  }
309  if(vtxCasePtr!=nullptr)
310  *vtxCasePtr = vtxCase;
311  if(failTypePtr!=nullptr)
312  *failTypePtr = failType;
313 
314  return vertexMLP;
315  }

◆ getVertex() [2/2]

StatusCode CP::PhotonVertexSelectionTool::getVertex ( const xAOD::EgammaContainer egammas,
const xAOD::Vertex *&  vertex,
bool  ignoreConv = false 
) const
virtual

Given a list of photons, return the most likely vertex based on MVA likelihood.

Implements CP::IPhotonVertexSelectionTool.

Definition at line 318 of file PhotonVertexSelectionTool.cxx.

321  {
322  std::vector<std::pair<const xAOD::Vertex*, float> > vertexMLP;
323  yyVtxType vtxcase = yyVtxType::Unknown;
324  FailType failType = FailType::NoFail;
325  return getVertexImp( egammas, prime_vertex, ignoreConv, false, vertexMLP, vtxcase, failType );
326  }

◆ getVertexImp()

StatusCode CP::PhotonVertexSelectionTool::getVertexImp ( const xAOD::EgammaContainer egammas,
const xAOD::Vertex *&  vertex,
bool  ignoreConv,
bool  noDecorate,
std::vector< std::pair< const xAOD::Vertex *, float > > &  vertexMLP,
yyVtxType vtxCase,
FailType fail 
) const
private

Given a list of photons, return the MLPs of all vertices in the event.

Definition at line 328 of file PhotonVertexSelectionTool.cxx.

333  {
334  // Set default vertex case and declare photon container
335  vtxCase = yyVtxType::Unknown;
336  const xAOD::PhotonContainer *photons = dynamic_cast<const xAOD::PhotonContainer*>(&egammas);
337 
338  // Retrieve PV collection from TEvent
340 
341  if (!noDecorate && !decorateInputs(egammas).isSuccess()){
342  return StatusCode::FAILURE;
343  }
344 
345  // Check if a conversion photon has a track attached to a primary/pileup vertex
346  if (!ignoreConv && photons) {
347  prime_vertex = getPrimaryVertexFromConv(photons);
348  if (prime_vertex != nullptr) {
349  vtxCase = yyVtxType::ConvTrack;
350  fail = FailType::MatchedTrack;
351  vertexMLP.emplace_back(prime_vertex, 0.);
352  return StatusCode::SUCCESS;
353  }
354  }
355 
356  if (fail != FailType::NoFail){
357  ATH_MSG_VERBOSE("Returning hardest vertex. Fail detected (type="<< fail <<")");
358  vertexMLP.clear();
359  prime_vertex = xAOD::PVHelpers::getHardestVertex(&*vertices);
360  vertexMLP.emplace_back(prime_vertex, 10.);
361  return StatusCode::SUCCESS;
362  }
363 
364  // Get the EventInfo
366 
367  // If there are any silicon conversions passing selection
368  // ==> use Model 1 (Conv) otherwise Model 2 (Unconv)
369  // Set default for conversion bool as false unless otherwise
370  bool isConverted = false;
371 
372  // assume default NoSiTrack (unconverted) unless otherwise
373  vtxCase = yyVtxType::NoSiTracks;
374  if (!ignoreConv && photons) {
375  for (const auto *photon: *photons) {
376  if (!photon)
377  {
378  ATH_MSG_WARNING("Null pointer to photon");
379  return StatusCode::FAILURE;
380  }
381  // find out if pass conversion selection criteria and tag as SiConvTrack case
383  {
384  isConverted = true;
385  vtxCase = yyVtxType::SiConvTrack;
386  }
387  }
388  }
389 
390  // if TMVA chosen, declare tmva_reader only once (before for looping vertex)
391  TMVA::Reader *tmva_reader = new TMVA::Reader();
392  if(m_isTMVA){
393  if(isConverted){
394  // If there are any silicon conversions passing selection, use MVA1 (converted case)
395  tmva_reader = m_mva1.get();
396  }
397  // Otherwise, use MVA2 (unconverted case)
398  if(!isConverted){
399  tmva_reader = m_mva2.get();
400  }
401  }
402  ATH_MSG_DEBUG("Vtx Case: " << vtxCase);
403 
404  // Vector sum of photons
405  TLorentzVector vegamma = getEgammaVector(&egammas, fail);
406 
411 
412  // Loop over vertices and find best candidate
413  std::vector<float> ONNXInputVector;
414  std::vector<std::vector<float>> onnx_input_tensor_values;
415  std::vector<float> TMVAInputVector;
416  TString TMVAMethod;
417  float mlp = 0.0, mlp_max = -99999.0;
418  float doSkipByZSigmaScore = -9999.0;
419  // assign threshold score value to compare later for good vtx
420  float thresGoodVtxScore;
421  if(m_doSkipByZSigma){thresGoodVtxScore = doSkipByZSigmaScore;}
422  else{thresGoodVtxScore = mlp_max;}
423  for (const xAOD::Vertex* vertex: *vertices) {
424  // Skip dummy vertices
425  if (!(vertex->vertexType() == xAOD::VxType::VertexType::PriVtx ||
426  vertex->vertexType() == xAOD::VxType::VertexType::PileUp)) continue;
427 
428  onnx_input_tensor_values.clear();
429 
430  // Variables used as input features in classifier
431  float sumPt, sumPt2, deltaPhi, deltaZ;
432  float log10_sumPt, log10_sumPt2;
433 
434  sumPt = (sumPtA)(*vertex);
435  sumPt2 = (sumPt2A)(*vertex);
436  deltaPhi = (deltaPhiA)(*vertex);
437  deltaZ = (deltaZA)(*vertex);
438  ATH_MSG_VERBOSE("sumPt: " << sumPt <<
439  " sumPt2: " << sumPt2 <<
440  " deltaPhi: " << deltaPhi <<
441  " deltaZ: " << deltaZ);
442 
443  // setup the vector of input features based on selected inference framework
444  if(m_isTMVA){
445  // Get likelihood probability from TMVA model
446  TMVAMethod = "MLP method";
447  log10_sumPt = static_cast<float>(log10(sumPt));
448  log10_sumPt2 = static_cast<float>(log10(sumPt2));
449  TMVAInputVector = {deltaZ,deltaPhi,log10_sumPt,log10_sumPt2};
450  }
451  else{ //assume ony ONNX for now
452  // Get likelihood probability from onnx model
453  // check if value is 0, assign small number like 1e-8 as dummy, as we will take log later (log(0) is nan)
454  // note that the ordering here is a bit different, following the order used when training
455  ONNXInputVector = {sumPt2, sumPt, deltaPhi, deltaZ};
456  for (long unsigned int i = 0; i < ONNXInputVector.size(); i++) {
457  // skip log for deltaPhi and take log for the rest
458  if (i == 2) {
459  continue;
460  }
461  if (ONNXInputVector[i] != 0 && std::isinf(ONNXInputVector[i]) != true && std::isnan(ONNXInputVector[i]) != true){
462  ONNXInputVector[i] = log(std::abs(ONNXInputVector[i]));
463  }
464  else{
465  ONNXInputVector[i] = log(std::abs(0.00000001)); //log(abs(1e-8))
466  }
467  } //end ONNXInputVector for loop
468  onnx_input_tensor_values.push_back(ONNXInputVector);
469  }
470 
471  // Do the actual calculation of classifier score part
472  if(m_isTMVA){
473  mlp = tmva_reader->EvaluateMVA(TMVAInputVector, TMVAMethod);
474  ATH_MSG_VERBOSE("TMVA output: " << (tmva_reader == m_mva1.get() ? "MVA1 ": "MVA2 ")<< mlp);
475  }
476  else{ //assume ony ONNX for now
477  if(isConverted){
478  mlp = getScore(m_nVars, onnx_input_tensor_values,
481  }
482  if(!isConverted){
483  mlp = getScore(m_nVars, onnx_input_tensor_values,
486  }
487  ATH_MSG_VERBOSE("log(abs(sumPt)): " << sumPt <<
488  " log(abs(sumPt2)): " << sumPt2 <<
489  " deltaPhi: " << deltaPhi <<
490  " log(abs(deltaZ)): " << deltaZ);
491  ATH_MSG_VERBOSE("ONNX output, isConverted = " << isConverted << ", mlp=" << mlp);
492  }
493 
494  // Skip vertices above 10 sigma from pointing or 15 sigma from conversion (HPV)
495  // Simply displace the mlp variable we calculate before by a predefined value
496  if(m_doSkipByZSigma){
497  if ((isConverted && deltaZ > 15) || (!isConverted && deltaZ > 10)) {
498  mlp = doSkipByZSigmaScore;
499  }
500  }
501 
502  // add the new vertex and its score to vertexMLP container
503  vertexMLP.emplace_back(vertex, mlp);
504 
505  // Keep track of maximal likelihood vertex
506  if (mlp > mlp_max) {
507  mlp_max = mlp;
508  prime_vertex = vertex;
509  }
510  } // end loop over vertices
511 
512  // from all the looped vertices, decide the max score which should be more than the minimum we set
513  // (which should be more than the initial mlp_max value above or more than the skip vertex by z-sigma score)
514  // if this does not pass, return hardest primary vertex
515  if (mlp_max <= thresGoodVtxScore) {
516  ATH_MSG_DEBUG("No good vertex candidates from pointing, returning hardest vertex.");
517  prime_vertex = xAOD::PVHelpers::getHardestVertex(&*vertices);
518  fail = FailType::NoGdCandidate;
519  vertexMLP.clear();
520  vertexMLP.emplace_back(xAOD::PVHelpers::getHardestVertex(&*vertices), 20.);
521  }
522 
523  ATH_MSG_VERBOSE("getVertex case "<< (int)vtxCase << " exit code "<< (int)fail);
524  return StatusCode::SUCCESS;
525  }

◆ initialize()

StatusCode CP::PhotonVertexSelectionTool::initialize ( )
virtual

Function initialising the tool.

Reimplemented from asg::AsgTool.

Definition at line 205 of file PhotonVertexSelectionTool.cxx.

206  {
207  ATH_MSG_INFO("Initializing PhotonVertexSelectionTool...");
208  // initialize the readers or sessions
209  if(m_isTMVA){
210  // Get full path of configuration files for MVA
213  // Setup MVAs
214  std::vector<std::string> var_names = {
215  "deltaZ := TMath::Min(abs(PrimaryVerticesAuxDyn.z-zCommon)/zCommonError,20)",
216  "deltaPhi := abs(deltaPhi(PrimaryVerticesAuxDyn.phi,egamma_phi))" ,
217  "logSumpt := log10(PrimaryVerticesAuxDyn.sumPt)" ,
218  "logSumpt2 := log10(PrimaryVerticesAuxDyn.sumPt2)"
219  };
220  auto mva1 = new TMVA::Reader(var_names, "!Silent:Color");
221  mva1->BookMVA ("MLP method", m_TMVAModelFilePath1 );
222  m_mva1 = std::unique_ptr<TMVA::Reader>( std::move(mva1) );
223 
224  auto mva2 = std::make_unique<TMVA::Reader>(var_names, "!Silent:Color");
225  mva2->BookMVA ("MLP method", m_TMVAModelFilePath2 );
226  m_mva2 = std::unique_ptr<TMVA::Reader>( std::move(mva2) );
227  }
228  else{ // assume only ONNX for now
229  // create onnx environment
230  Ort::Env env;
231  // converted
235 
236  // unconverted
240  }
241 
242  // initialize the containers
244  ATH_CHECK( m_vertexContainer.initialize() );
245 
246  return StatusCode::SUCCESS;
247  }

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

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

◆ setONNXSession()

std::tuple< std::shared_ptr< Ort::Session >, Ort::AllocatorWithDefaultOptions > CP::PhotonVertexSelectionTool::setONNXSession ( Ort::Env &  env,
const std::string &  modelFilePath 
)
private

Definition at line 186 of file PhotonVertexSelectionTool.cxx.

186  {
187  // Find the model file.
188  const std::string modelFileName = PathResolverFindCalibFile( modelFilePath );
189  ATH_MSG_INFO( "Using model file: " << modelFileName );
190 
191  // set onnx session options
192  Ort::SessionOptions sessionOptions;
193  sessionOptions.SetIntraOpNumThreads( 1 );
194  sessionOptions.SetGraphOptimizationLevel( ORT_ENABLE_BASIC );
195  // set allocator
196  Ort::AllocatorWithDefaultOptions allocator;
197  // set the onnx runtime session
198  std::shared_ptr<Ort::Session> sessionHandle = std::make_shared<Ort::Session>( env, modelFileName.c_str(), sessionOptions );
199 
200  ATH_MSG_INFO( "Created the ONNX Runtime session for model file = " << modelFileName);
201  return std::make_tuple(sessionHandle, allocator);
202  }

◆ sortMLP()

bool CP::PhotonVertexSelectionTool::sortMLP ( const std::pair< const xAOD::Vertex *, float > &  a,
const std::pair< const xAOD::Vertex *, float > &  b 
)
staticprivate

Sort MLP results.

Definition at line 528 of file PhotonVertexSelectionTool.cxx.

530  { return a.second > b.second; }

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

Ort::AllocatorWithDefaultOptions CP::PhotonVertexSelectionTool::m_allocator1
private

Definition at line 84 of file PhotonVertexSelectionTool.h.

◆ m_allocator2

Ort::AllocatorWithDefaultOptions CP::PhotonVertexSelectionTool::m_allocator2
private

Definition at line 85 of file PhotonVertexSelectionTool.h.

◆ m_convPtCut

float CP::PhotonVertexSelectionTool::m_convPtCut
private

Definition at line 46 of file PhotonVertexSelectionTool.h.

◆ m_derivationPrefix

std::string CP::PhotonVertexSelectionTool::m_derivationPrefix
private

Definition at line 49 of file PhotonVertexSelectionTool.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_doSkipByZSigma

bool CP::PhotonVertexSelectionTool::m_doSkipByZSigma
private

Definition at line 47 of file PhotonVertexSelectionTool.h.

◆ m_eventInfo

SG::ReadHandleKey<xAOD::EventInfo> CP::PhotonVertexSelectionTool::m_eventInfo {this, "EventInfoContName", "EventInfo", "event info key"}
private

Container declarations.

Definition at line 52 of file PhotonVertexSelectionTool.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_input_node_dims1

std::vector<int64_t> CP::PhotonVertexSelectionTool::m_input_node_dims1
private

Definition at line 74 of file PhotonVertexSelectionTool.h.

◆ m_input_node_dims2

std::vector<int64_t> CP::PhotonVertexSelectionTool::m_input_node_dims2
private

Definition at line 77 of file PhotonVertexSelectionTool.h.

◆ m_input_node_names1

std::vector<const char*> CP::PhotonVertexSelectionTool::m_input_node_names1
private

Definition at line 75 of file PhotonVertexSelectionTool.h.

◆ m_input_node_names2

std::vector<const char*> CP::PhotonVertexSelectionTool::m_input_node_names2
private

Definition at line 78 of file PhotonVertexSelectionTool.h.

◆ m_isTMVA

bool CP::PhotonVertexSelectionTool::m_isTMVA
private

TMVA

Definition at line 57 of file PhotonVertexSelectionTool.h.

◆ m_mva1

std::unique_ptr<TMVA::Reader> CP::PhotonVertexSelectionTool::m_mva1
private

Definition at line 63 of file PhotonVertexSelectionTool.h.

◆ m_mva2

std::unique_ptr<TMVA::Reader> CP::PhotonVertexSelectionTool::m_mva2
private

Definition at line 64 of file PhotonVertexSelectionTool.h.

◆ m_nVars

int CP::PhotonVertexSelectionTool::m_nVars
private

Create a proper constructor for Athena.

Configuration variables

Definition at line 45 of file PhotonVertexSelectionTool.h.

◆ m_ONNXModelFilePath1

std::string CP::PhotonVertexSelectionTool::m_ONNXModelFilePath1
private

Definition at line 69 of file PhotonVertexSelectionTool.h.

◆ m_ONNXModelFilePath2

std::string CP::PhotonVertexSelectionTool::m_ONNXModelFilePath2
private

Definition at line 70 of file PhotonVertexSelectionTool.h.

◆ m_output_node_dims1

std::vector<int64_t> CP::PhotonVertexSelectionTool::m_output_node_dims1
private

Definition at line 74 of file PhotonVertexSelectionTool.h.

◆ m_output_node_dims2

std::vector<int64_t> CP::PhotonVertexSelectionTool::m_output_node_dims2
private

Definition at line 77 of file PhotonVertexSelectionTool.h.

◆ m_output_node_names1

std::vector<const char*> CP::PhotonVertexSelectionTool::m_output_node_names1
private

Definition at line 75 of file PhotonVertexSelectionTool.h.

◆ m_output_node_names2

std::vector<const char*> CP::PhotonVertexSelectionTool::m_output_node_names2
private

Definition at line 78 of file PhotonVertexSelectionTool.h.

◆ m_sessionHandle1

std::shared_ptr<Ort::Session> CP::PhotonVertexSelectionTool::m_sessionHandle1
private

Definition at line 81 of file PhotonVertexSelectionTool.h.

◆ m_sessionHandle2

std::shared_ptr<Ort::Session> CP::PhotonVertexSelectionTool::m_sessionHandle2
private

Definition at line 82 of file PhotonVertexSelectionTool.h.

◆ m_TMVAModelFilePath1

std::string CP::PhotonVertexSelectionTool::m_TMVAModelFilePath1
private

Definition at line 58 of file PhotonVertexSelectionTool.h.

◆ m_TMVAModelFilePath2

std::string CP::PhotonVertexSelectionTool::m_TMVAModelFilePath2
private

Definition at line 59 of file PhotonVertexSelectionTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexContainer

SG::ReadHandleKey<xAOD::VertexContainer> CP::PhotonVertexSelectionTool::m_vertexContainer {this, "VertexContainer", "PrimaryVertices", "Vertex container name"}
private

Definition at line 53 of file PhotonVertexSelectionTool.h.

◆ m_vertexContainerName

std::string CP::PhotonVertexSelectionTool::m_vertexContainerName
private

Definition at line 48 of file PhotonVertexSelectionTool.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:
CP::PhotonVertexSelectionTool::setONNXSession
std::tuple< std::shared_ptr< Ort::Session >, Ort::AllocatorWithDefaultOptions > setONNXSession(Ort::Env &env, const std::string &modelFilePath)
Definition: PhotonVertexSelectionTool.cxx:186
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
xAOD::PVHelpers::getVertexSumPt
float getVertexSumPt(const xAOD::Vertex *vertex, int power=1, bool useAux=true)
Loop over track particles associated with vertex and return scalar sum of pT^power in GeV (from auxda...
Definition: PhotonVertexHelpers.cxx:215
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
CP::PhotonVertexSelectionTool::m_TMVAModelFilePath2
std::string m_TMVAModelFilePath2
Definition: PhotonVertexSelectionTool.h:59
CP::PhotonVertexSelectionTool::m_derivationPrefix
std::string m_derivationPrefix
Definition: PhotonVertexSelectionTool.h:49
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
CP::PhotonVertexSelectionTool::getPrimaryVertexFromConv
const xAOD::Vertex * getPrimaryVertexFromConv(const xAOD::PhotonContainer *photons) const
Get possible vertex directly associated with photon conversions.
Definition: PhotonVertexSelectionTool.cxx:533
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
CP::IPhotonVertexSelectionTool::Unkown
@ Unkown
Definition: IPhotonVertexSelectionTool.h:34
CP::IPhotonVertexSelectionTool::FailPointing
@ FailPointing
Definition: IPhotonVertexSelectionTool.h:38
CP::PhotonVertexSelectionTool::getScore
float getScore(int nVars, const std::vector< std::vector< float >> &input_data, const std::shared_ptr< Ort::Session > sessionHandle, std::vector< int64_t > input_node_dims, std::vector< const char * > input_node_names, std::vector< const char * > output_node_names) const
Definition: PhotonVertexSelectionTool.cxx:89
CP::PhotonVertexSelectionTool::m_TMVAModelFilePath1
std::string m_TMVAModelFilePath1
Definition: PhotonVertexSelectionTool.h:58
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CP::PhotonVertexSelectionTool::getEgammaVector
TLorentzVector getEgammaVector(const xAOD::EgammaContainer *egammas, FailType &failType) const
Get combined 4-vector of photon container.
Definition: PhotonVertexSelectionTool.cxx:587
CP::IPhotonVertexSelectionTool::NoSiTracks
@ NoSiTracks
Definition: IPhotonVertexSelectionTool.h:48
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
CP::IPhotonVertexSelectionTool::Unknown
@ Unknown
Definition: IPhotonVertexSelectionTool.h:45
CP::PhotonVertexSelectionTool::m_vertexContainer
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer
Definition: PhotonVertexSelectionTool.h:53
CP::PhotonVertexSelectionTool::m_input_node_dims1
std::vector< int64_t > m_input_node_dims1
Definition: PhotonVertexSelectionTool.h:74
xAOD::PVHelpers::getZCommonAndError
std::pair< float, float > getZCommonAndError(const xAOD::EventInfo *eventInfo, const xAOD::EgammaContainer *egammas, float convPtCut=2e3)
Return zCommon and zCommonError.
Definition: PhotonVertexHelpers.cxx:44
CP::PhotonVertexSelectionTool::m_sessionHandle2
std::shared_ptr< Ort::Session > m_sessionHandle2
Definition: PhotonVertexSelectionTool.h:82
CP::IPhotonVertexSelectionTool::NoEventInfo
@ NoEventInfo
Definition: IPhotonVertexSelectionTool.h:37
CP::IPhotonVertexSelectionTool::SiConvTrack
@ SiConvTrack
Definition: IPhotonVertexSelectionTool.h:47
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
ParticleTest.tp
tp
Definition: ParticleTest.py:25
CP::PhotonVertexSelectionTool::m_mva1
std::unique_ptr< TMVA::Reader > m_mva1
Definition: PhotonVertexSelectionTool.h:63
CP::IPhotonVertexSelectionTool::NoGdCandidate
@ NoGdCandidate
Definition: IPhotonVertexSelectionTool.h:40
xAOD::CaloCluster_v1::phiBE
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:680
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
CP::PhotonVertexSelectionTool::sortMLP
static bool sortMLP(const std::pair< const xAOD::Vertex *, float > &a, const std::pair< const xAOD::Vertex *, float > &b)
Sort MLP results.
Definition: PhotonVertexSelectionTool.cxx:528
CP::PhotonVertexSelectionTool::m_ONNXModelFilePath1
std::string m_ONNXModelFilePath1
Definition: PhotonVertexSelectionTool.h:69
CP::PhotonVertexSelectionTool::m_sessionHandle1
std::shared_ptr< Ort::Session > m_sessionHandle1
Definition: PhotonVertexSelectionTool.h:81
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
egamma
Definition: egamma.h:58
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
ParticleImpl::e
virtual double e() const
energy
Definition: ParticleImpl.h:534
CP::PhotonVertexSelectionTool::m_output_node_dims2
std::vector< int64_t > m_output_node_dims2
Definition: PhotonVertexSelectionTool.h:77
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:644
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
CP::PhotonVertexSelectionTool::m_eventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Container declarations.
Definition: PhotonVertexSelectionTool.h:52
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
xAOD::PVHelpers::getHardestVertex
const xAOD::Vertex * getHardestVertex(const xAOD::VertexContainer *vertices)
Return vertex with highest sum pT^2.
Definition: PhotonVertexHelpers.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
CP::IPhotonVertexSelectionTool::NoVxCont
@ NoVxCont
Definition: IPhotonVertexSelectionTool.h:36
AthCommonDataStore
Definition: AthCommonDataStore.h:52
StateLessPT_NewConfig.primary
primary
Definition: StateLessPT_NewConfig.py:228
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
CP::PhotonVertexSelectionTool::m_allocator1
Ort::AllocatorWithDefaultOptions m_allocator1
Definition: PhotonVertexSelectionTool.h:84
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
CP::IPhotonVertexSelectionTool::yyVtxType
yyVtxType
Definition: IPhotonVertexSelectionTool.h:44
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CP::PhotonVertexSelectionTool::m_convPtCut
float m_convPtCut
Definition: PhotonVertexSelectionTool.h:46
CP::IPhotonVertexSelectionTool::FailType
FailType
Declare the interface that the class provides.
Definition: IPhotonVertexSelectionTool.h:33
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
LHEF::Reader
Pythia8::Reader Reader
Definition: Prophecy4fMerger.cxx:11
CP::PhotonVertexSelectionTool::m_nVars
int m_nVars
Create a proper constructor for Athena.
Definition: PhotonVertexSelectionTool.h:45
CP::PhotonVertexSelectionTool::getOutputNodes
std::tuple< std::vector< int64_t >, std::vector< const char * > > getOutputNodes(const std::shared_ptr< Ort::Session > sessionHandle, Ort::AllocatorWithDefaultOptions &allocator)
Definition: PhotonVertexSelectionTool.cxx:156
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
CP::IPhotonVertexSelectionTool::MatchedTrack
@ MatchedTrack
Definition: IPhotonVertexSelectionTool.h:41
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
CP::PhotonVertexSelectionTool::getVertexImp
StatusCode getVertexImp(const xAOD::EgammaContainer &egammas, const xAOD::Vertex *&vertex, bool ignoreConv, bool noDecorate, std::vector< std::pair< const xAOD::Vertex *, float > > &, yyVtxType &, FailType &) const
Given a list of photons, return the MLPs of all vertices in the event.
Definition: PhotonVertexSelectionTool.cxx:328
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::PVHelpers::getVertexMomentum
TLorentzVector getVertexMomentum(const xAOD::Vertex *vertex, bool useAux=true, const std::string &derivationPrefix="")
Return vector sum of tracks associated with vertex (from auxdata if available and useAux = true)
Definition: PhotonVertexHelpers.cxx:175
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
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
CP::PhotonVertexSelectionTool::m_input_node_dims2
std::vector< int64_t > m_input_node_dims2
Definition: PhotonVertexSelectionTool.h:77
CP::PhotonVertexSelectionTool::m_ONNXModelFilePath2
std::string m_ONNXModelFilePath2
Definition: PhotonVertexSelectionTool.h:70
xAOD::VxType::PileUp
@ PileUp
Pile-up vertex.
Definition: TrackingPrimitives.h:573
CP::PhotonVertexSelectionTool::m_output_node_names1
std::vector< const char * > m_output_node_names1
Definition: PhotonVertexSelectionTool.h:75
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
CP::PhotonVertexSelectionTool::m_mva2
std::unique_ptr< TMVA::Reader > m_mva2
Definition: PhotonVertexSelectionTool.h:64
xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF
const xAOD::TrackParticle * getOriginalTrackParticleFromGSF(const xAOD::TrackParticle *trkPar)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the GSF Track Particle...
Definition: ElectronxAODHelpers.cxx:22
CP::PhotonVertexSelectionTool::m_output_node_names2
std::vector< const char * > m_output_node_names2
Definition: PhotonVertexSelectionTool.h:78
CP::PhotonVertexSelectionTool::m_isTMVA
bool m_isTMVA
Definition: PhotonVertexSelectionTool.h:57
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
CP::PhotonVertexSelectionTool::m_doSkipByZSigma
bool m_doSkipByZSigma
Definition: PhotonVertexSelectionTool.h:47
python.PyAthena.v
v
Definition: PyAthena.py:154
CP::PhotonVertexSelectionTool::m_allocator2
Ort::AllocatorWithDefaultOptions m_allocator2
Definition: PhotonVertexSelectionTool.h:85
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::PhotonVertexSelectionTool::decorateInputs
StatusCode decorateInputs(const xAOD::EgammaContainer &egammas, FailType *failType=nullptr) const
Given a list of photons, decorate vertex container with MVA variables.
Definition: PhotonVertexSelectionTool.cxx:250
CP::IPhotonVertexSelectionTool::ConvTrack
@ ConvTrack
Definition: IPhotonVertexSelectionTool.h:46
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CP::IPhotonVertexSelectionTool::NoFail
@ NoFail
Definition: IPhotonVertexSelectionTool.h:35
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:623
xAOD::PVHelpers::passConvSelection
bool passConvSelection(const xAOD::Photon *photon, float convPtCut=2e3)
Check if photon is converted, and tracks have Si hits and pass selection.
Definition: PhotonVertexHelpers.cxx:133
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
CP::PhotonVertexSelectionTool::m_input_node_names1
std::vector< const char * > m_input_node_names1
Definition: PhotonVertexSelectionTool.h:75
CP::PhotonVertexSelectionTool::m_output_node_dims1
std::vector< int64_t > m_output_node_dims1
Definition: PhotonVertexSelectionTool.h:74
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
CP::PhotonVertexSelectionTool::getInputNodes
std::tuple< std::vector< int64_t >, std::vector< const char * > > getInputNodes(const std::shared_ptr< Ort::Session > sessionHandle, Ort::AllocatorWithDefaultOptions &allocator)
Definition: PhotonVertexSelectionTool.cxx:125
makeComparison.deltaZ
int deltaZ
Definition: makeComparison.py:46
python.DataFormatRates.env
env
Definition: DataFormatRates.py:32
SG::DataProxy
Definition: DataProxy.h:45
CP::PhotonVertexSelectionTool::m_input_node_names2
std::vector< const char * > m_input_node_names2
Definition: PhotonVertexSelectionTool.h:78
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
CP::getVertexFromTrack
const xAOD::Vertex * getVertexFromTrack(const xAOD::TrackParticle *track, const xAOD::VertexContainer *vertices)
Definition: PhotonVertexSelectionTool.cxx:30
CP::IPhotonVertexSelectionTool::FailEgamVect
@ FailEgamVect
Definition: IPhotonVertexSelectionTool.h:39
fitman.k
k
Definition: fitman.py:528
beamspotman.fail
def fail(message)
Definition: beamspotman.py:201