ATLAS Offline Software
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
AlgorithmIdentifier Class Reference

Small structure to hold an algorithm's name and store, plus some details on its EventView. The AI also keeps a pointer to the EventContext and MsgService, this is for convenience such that methods which use the AI don't need to be additionally passed these. More...

#include <AlgorithmIdentifier.h>

Collaboration diagram for AlgorithmIdentifier:

Public Member Functions

 AlgorithmIdentifier ()
 
 AlgorithmIdentifier (const size_t realSlot, const size_t saveSlot, const std::string &caller, const std::string &storeName, const int16_t viewID=-1)
 
 ~AlgorithmIdentifier ()=default
 
TrigConf::HLTHash callerHash (MsgStream &msg) const
 
TrigConf::HLTHash storeHash (MsgStream &msg) const
 
StatusCode isValid () const
 
void dump (MsgStream &msg)
 

Public Attributes

size_t m_realSlot
 The actual slot of the algorithm. More...
 
size_t m_slotToSaveInto
 The slot which is used for the purposes of recording data on this algorithm's execution. More...
 
std::string m_caller
 Name of the algorithm. More...
 
std::string m_store
 Name of the algorithm's store. More...
 
int16_t m_viewID
 If not within an event view, then the m_iewID = s_noView = -1. More...
 
size_t m_hash
 Hash of algorithm + store + realSlot. More...
 

Static Public Attributes

static constexpr int16_t s_noView = -1
 Constant value used to express an Algorithm which is not running in a View. More...
 

Detailed Description

Small structure to hold an algorithm's name and store, plus some details on its EventView. The AI also keeps a pointer to the EventContext and MsgService, this is for convenience such that methods which use the AI don't need to be additionally passed these.

Definition at line 21 of file AlgorithmIdentifier.h.

Constructor & Destructor Documentation

◆ AlgorithmIdentifier() [1/2]

AlgorithmIdentifier::AlgorithmIdentifier ( )

Definition at line 13 of file AlgorithmIdentifier.cxx.

13  :
14  m_realSlot(),
16  m_caller(""),
17  m_store(""),
18  m_viewID(0),
19  m_hash(0)
20  {}

◆ AlgorithmIdentifier() [2/2]

AlgorithmIdentifier::AlgorithmIdentifier ( const size_t  realSlot,
const size_t  saveSlot,
const std::string &  caller,
const std::string &  storeName,
const int16_t  viewID = -1 
)

Definition at line 24 of file AlgorithmIdentifier.cxx.

24  :
25  m_realSlot(realSlot),
26  m_slotToSaveInto(saveSlot),
27  m_caller(caller),
28  m_store(storeName),
29  m_viewID(viewID),
30  m_hash(std::hash<std::string>{}(m_caller + m_store + std::to_string(realSlot)))
31  {}

◆ ~AlgorithmIdentifier()

AlgorithmIdentifier::~AlgorithmIdentifier ( )
default

Member Function Documentation

◆ callerHash()

TrigConf::HLTHash AlgorithmIdentifier::callerHash ( MsgStream &  msg) const

Definition at line 35 of file AlgorithmIdentifier.cxx.

35  {
36  try {
38  } catch (const std::exception& ex) {
39  msg << MSG::DEBUG << "Caught " << typeid(ex).name() << ": " << ex.what() << endmsg;
40  }
41  return 0;
42 }

◆ dump()

void AlgorithmIdentifier::dump ( MsgStream &  msg)

Definition at line 66 of file AlgorithmIdentifier.cxx.

66  {
67  TrigConf::HLTHash theCallerHash = callerHash(msg);
68  TrigConf::HLTHash theStoreHash = storeHash(msg);
69 
70  msg << MSG::INFO << "----------" << endmsg;
71  msg << "Valid? " << (isValid() ? "YES" : "NO") << endmsg;
72  msg << "Real Slot:" << m_realSlot << endmsg;
73  msg << "Slot Save Overrride:" << m_slotToSaveInto << endmsg;
74  msg << "Caller:'" << m_caller << "'" << endmsg;
75  msg << "Caller Hash:" << theCallerHash << endmsg;
76  msg << "Store:'" << m_store << "'" << endmsg;
77  msg << "Store Hash:" << theStoreHash << endmsg;
78  msg << "View ID:" << m_viewID << endmsg;
79  msg << "AI Hash:" << m_hash << endmsg;
80 }

◆ isValid()

StatusCode AlgorithmIdentifier::isValid ( ) const

Definition at line 57 of file AlgorithmIdentifier.cxx.

57  {
58  if (m_caller == "" || m_store == "" || !m_hash) {
59  return StatusCode::FAILURE;
60  }
61  return StatusCode::SUCCESS;
62 }

◆ storeHash()

TrigConf::HLTHash AlgorithmIdentifier::storeHash ( MsgStream &  msg) const

Definition at line 46 of file AlgorithmIdentifier.cxx.

46  {
47  try {
49  } catch (const std::exception& ex) {
50  msg << MSG::DEBUG << "Caught " << typeid(ex).name() << ": " << ex.what() << endmsg;
51  }
52  return 0;
53 }

Member Data Documentation

◆ m_caller

std::string AlgorithmIdentifier::m_caller

Name of the algorithm.

Definition at line 33 of file AlgorithmIdentifier.h.

◆ m_hash

size_t AlgorithmIdentifier::m_hash

Hash of algorithm + store + realSlot.

Multi-event-unique quantity (I.e. unique even with –concurrent-events > 1). Cached for speed.

Definition at line 36 of file AlgorithmIdentifier.h.

◆ m_realSlot

size_t AlgorithmIdentifier::m_realSlot

The actual slot of the algorithm.

Definition at line 31 of file AlgorithmIdentifier.h.

◆ m_slotToSaveInto

size_t AlgorithmIdentifier::m_slotToSaveInto

The slot which is used for the purposes of recording data on this algorithm's execution.

Note: might not be the actual slot of the alg

Definition at line 32 of file AlgorithmIdentifier.h.

◆ m_store

std::string AlgorithmIdentifier::m_store

Name of the algorithm's store.

e.g. '0_StoreGateSvc_Impl' for the main store.

Definition at line 34 of file AlgorithmIdentifier.h.

◆ m_viewID

int16_t AlgorithmIdentifier::m_viewID

If not within an event view, then the m_iewID = s_noView = -1.

Definition at line 35 of file AlgorithmIdentifier.h.

◆ s_noView

constexpr int16_t AlgorithmIdentifier::s_noView = -1
staticconstexpr

Constant value used to express an Algorithm which is not running in a View.

Definition at line 38 of file AlgorithmIdentifier.h.


The documentation for this class was generated from the following files:
AlgorithmIdentifier::m_slotToSaveInto
size_t m_slotToSaveInto
The slot which is used for the purposes of recording data on this algorithm's execution.
Definition: AlgorithmIdentifier.h:32
AlgorithmIdentifier::storeHash
TrigConf::HLTHash storeHash(MsgStream &msg) const
Definition: AlgorithmIdentifier.cxx:46
AlgorithmIdentifier::m_caller
std::string m_caller
Name of the algorithm.
Definition: AlgorithmIdentifier.h:33
TrigConf::HLTHash
uint32_t HLTHash
Definition: TrigConfHLTUtils/TrigConfHLTUtils/HLTUtils.h:19
AlgorithmIdentifier::m_store
std::string m_store
Name of the algorithm's store.
Definition: AlgorithmIdentifier.h:34
AlgorithmIdentifier::m_hash
size_t m_hash
Hash of algorithm + store + realSlot.
Definition: AlgorithmIdentifier.h:36
TrigConf::HLTUtils::string2hash
static HLTHash string2hash(const std::string &, const std::string &category="TE")
hash function translating TE names into identifiers
AlgorithmIdentifier::isValid
StatusCode isValid() const
Definition: AlgorithmIdentifier.cxx:57
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
AlgorithmIdentifier::callerHash
TrigConf::HLTHash callerHash(MsgStream &msg) const
Definition: AlgorithmIdentifier.cxx:35
calibdata.exception
exception
Definition: calibdata.py:496
AlgorithmIdentifier::m_viewID
int16_t m_viewID
If not within an event view, then the m_iewID = s_noView = -1.
Definition: AlgorithmIdentifier.h:35
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
AlgorithmIdentifier::m_realSlot
size_t m_realSlot
The actual slot of the algorithm.
Definition: AlgorithmIdentifier.h:31
DEBUG
#define DEBUG
Definition: page_access.h:11
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7