ATLAS Offline Software
Loading...
Searching...
No Matches
AlgorithmIdentifier Class Reference

Small structure to hold an algorithm's name and store, plus some details on its EventView. 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.
size_t m_slotToSaveInto
 The slot which is used for the purposes of recording data on this algorithm's execution.
std::string m_caller
 Name of the algorithm.
std::string m_store
 Name of the algorithm's store.
int16_t m_viewID
 If not within an event view, then the m_iewID = s_noView = -1.
size_t m_hash
 Hash of algorithm + store + realSlot.

Static Public Attributes

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

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

◆ 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}
#define endmsg
static HLTHash string2hash(const std::string &, const std::string &category="TE")
hash function translating TE names into identifiers
MsgStream & msg
Definition testRead.cxx:32

◆ 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}
TrigConf::HLTHash callerHash(MsgStream &msg) const
TrigConf::HLTHash storeHash(MsgStream &msg) const
StatusCode isValid() const

◆ 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

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: