ATLAS Offline Software
AlgorithmIdentifier.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGCOSTMONITOR_TRIGCOSTALGORITHMIDENTIFIER_H
6 #define TRIGCOSTMONITOR_TRIGCOSTALGORITHMIDENTIFIER_H 1
7 
8 #include "GaudiKernel/EventContext.h"
9 
11 
12 #include <functional>
13 #include <string>
14 
23  AlgorithmIdentifier(const size_t realSlot, const size_t saveSlot, const std::string& caller, const std::string& storeName, const int16_t viewID = -1);
24  ~AlgorithmIdentifier() = default;
25 
26  TrigConf::HLTHash callerHash (MsgStream& msg) const;
27  TrigConf::HLTHash storeHash (MsgStream& msg) const;
28  StatusCode isValid() const;
29  void dump (MsgStream& msg);
30 
31  size_t m_realSlot;
33  std::string m_caller;
34  std::string m_store;
36  size_t m_hash;
37 
38  static constexpr int16_t s_noView = -1;
39 };
40 
53  static AlgorithmIdentifier make(const EventContext& context, const std::string& caller, MsgStream& msg, const int16_t slotOverride = -1);
54 };
55 
66  static size_t hash(const AlgorithmIdentifier& ai);
67 
74  static bool equal(const AlgorithmIdentifier& x, const AlgorithmIdentifier& y);
75 };
76 
78  return ai.m_hash;
79 }
80 
82  return (x.m_caller == y.m_caller && x.m_store == y.m_store && x.m_realSlot == y.m_realSlot);
83 }
84 
85 #endif // TRIGCOSTMONITOR_TRIGCOSTALGORITHMIDENTIFIER_H
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::~AlgorithmIdentifier
~AlgorithmIdentifier()=default
AlgorithmIdentifier::storeHash
TrigConf::HLTHash storeHash(MsgStream &msg) const
Definition: AlgorithmIdentifier.cxx:46
AlgorithmIdentifier::AlgorithmIdentifier
AlgorithmIdentifier()
Definition: AlgorithmIdentifier.cxx:13
AlgorithmIdentifier
Small structure to hold an algorithm's name and store, plus some details on its EventView....
Definition: AlgorithmIdentifier.h:21
AlgorithmIdentifier::m_caller
std::string m_caller
Name of the algorithm.
Definition: AlgorithmIdentifier.h:33
AlgorithmIdentifier::s_noView
static constexpr int16_t s_noView
Constant value used to express an Algorithm which is not running in a View.
Definition: AlgorithmIdentifier.h:38
TrigConf::HLTHash
uint32_t HLTHash
Definition: TrigConfHLTUtils/TrigConfHLTUtils/HLTUtils.h:19
AlgorithmIdentifierMaker::make
static AlgorithmIdentifier make(const EventContext &context, const std::string &caller, MsgStream &msg, const int16_t slotOverride=-1)
Construct an AlgorithmIdentifier.
Definition: AlgorithmIdentifier.cxx:84
x
#define x
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
AlgorithmIdentifier::m_store
std::string m_store
Name of the algorithm's store.
Definition: AlgorithmIdentifier.h:34
HLTUtils.h
AlgorithmIdentifier::m_hash
size_t m_hash
Hash of algorithm + store + realSlot.
Definition: AlgorithmIdentifier.h:36
AlgorithmIdentifier::dump
void dump(MsgStream &msg)
Definition: AlgorithmIdentifier.cxx:66
AlgorithmIdentifier::isValid
StatusCode isValid() const
Definition: AlgorithmIdentifier.cxx:57
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AlgorithmIdentifier::callerHash
TrigConf::HLTHash callerHash(MsgStream &msg) const
Definition: AlgorithmIdentifier.cxx:35
AlgorithmIdentifierHashCompare
Static hash and equal members as required by tbb::concurrent_hash_map.
Definition: AlgorithmIdentifier.h:60
AlgorithmIdentifierHashCompare::hash
static size_t hash(const AlgorithmIdentifier &ai)
Hash function for AlgorithmIdentifier to assign bucket in hash map.
Definition: AlgorithmIdentifier.h:77
AlgorithmIdentifier::m_viewID
int16_t m_viewID
If not within an event view, then the m_iewID = s_noView = -1.
Definition: AlgorithmIdentifier.h:35
AlgorithmIdentifier::m_realSlot
size_t m_realSlot
The actual slot of the algorithm.
Definition: AlgorithmIdentifier.h:31
y
#define y
AlgorithmIdentifierHashCompare::equal
static bool equal(const AlgorithmIdentifier &x, const AlgorithmIdentifier &y)
Equality function for AlgorithmIdentifier to check for uniqueness within hash bucket.
Definition: AlgorithmIdentifier.h:81
AlgorithmIdentifierMaker
Simple factory class to construct an AlgorithmIdentifier from an algorithm name and context.
Definition: AlgorithmIdentifier.h:45
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7