ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigMonitoring
TrigCostMonitor
TrigCostMonitor
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
10
#include "
TrigConfHLTUtils/HLTUtils.h
"
11
12
#include <functional>
13
#include <string>
14
21
struct
AlgorithmIdentifier
{
22
AlgorithmIdentifier
();
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
;
32
size_t
m_slotToSaveInto
;
33
std::string
m_caller
;
34
std::string
m_store
;
35
int16_t
m_viewID
;
36
size_t
m_hash
;
37
38
static
constexpr
int16_t
s_noView
= -1;
39
};
40
45
struct
AlgorithmIdentifierMaker
{
53
static
AlgorithmIdentifier
make
(
const
EventContext& context,
const
std::string& caller, MsgStream&
msg
,
const
int16_t slotOverride = -1);
54
};
55
60
struct
AlgorithmIdentifierHashCompare
{
66
static
size_t
hash
(
const
AlgorithmIdentifier
& ai);
67
74
static
bool
equal
(
const
AlgorithmIdentifier
&
x
,
const
AlgorithmIdentifier
&
y
);
75
};
76
77
inline
size_t
AlgorithmIdentifierHashCompare::hash
(
const
AlgorithmIdentifier
& ai) {
78
return
ai.
m_hash
;
79
}
80
81
inline
bool
AlgorithmIdentifierHashCompare::equal
(
const
AlgorithmIdentifier
&
x
,
const
AlgorithmIdentifier
&
y
) {
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
HLTUtils.h
y
#define y
x
#define x
TrigConf::HLTHash
uint32_t HLTHash
Definition
TrigConfHLTUtils/TrigConfHLTUtils/HLTUtils.h:19
dump
-event-from-file
AlgorithmIdentifierHashCompare
Static hash and equal members as required by tbb::concurrent_hash_map.
Definition
AlgorithmIdentifier.h:60
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
AlgorithmIdentifierHashCompare::hash
static size_t hash(const AlgorithmIdentifier &ai)
Hash function for AlgorithmIdentifier to assign bucket in hash map.
Definition
AlgorithmIdentifier.h:77
AlgorithmIdentifierMaker
Simple factory class to construct an AlgorithmIdentifier from an algorithm name and context.
Definition
AlgorithmIdentifier.h:45
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
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::m_store
std::string m_store
Name of the algorithm's store.
Definition
AlgorithmIdentifier.h:34
AlgorithmIdentifier::callerHash
TrigConf::HLTHash callerHash(MsgStream &msg) const
Definition
AlgorithmIdentifier.cxx:35
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()
Definition
AlgorithmIdentifier.cxx:13
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
AlgorithmIdentifier::storeHash
TrigConf::HLTHash storeHash(MsgStream &msg) const
Definition
AlgorithmIdentifier.cxx:46
AlgorithmIdentifier::m_realSlot
size_t m_realSlot
The actual slot of the algorithm.
Definition
AlgorithmIdentifier.h:31
AlgorithmIdentifier::~AlgorithmIdentifier
~AlgorithmIdentifier()=default
AlgorithmIdentifier::m_hash
size_t m_hash
Hash of algorithm + store + realSlot.
Definition
AlgorithmIdentifier.h:36
AlgorithmIdentifier::isValid
StatusCode isValid() const
Definition
AlgorithmIdentifier.cxx:57
AlgorithmIdentifier::m_viewID
int16_t m_viewID
If not within an event view, then the m_iewID = s_noView = -1.
Definition
AlgorithmIdentifier.h:35
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0