ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigCost
TrigCostAnalysis
src
monitors
MonitorAlgorithm.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MonitorAlgorithm.h
"
6
#include "
../counters/CounterAlgorithm.h
"
7
#include <cstdint>
8
#include <algorithm>
9
10
MonitorAlgorithm::MonitorAlgorithm
(
const
std::string& name,
const
MonitoredRange
* parent)
11
:
MonitorBase
(name, parent) {
12
}
13
14
StatusCode
MonitorAlgorithm::newEvent
(
const
CostData
& data,
const
float
weight) {
15
const
std::string slotStr{
"slot"
};
16
const
std::string algStr{
"alg"
};
17
const
std::string ALGStr{
"ALG"
};
18
for
(
const
xAOD::TrigComposite
*
tc
: data.costCollection()) {
19
const
uint32_t slot =
tc
->getDetail<uint32_t>(slotStr);
20
if
(slot != data.onlineSlot()) {
21
continue
;
// When monitoring the master slot, this Monitor ignores algs running in different slots
22
}
23
const
uint32_t nameHash =
tc
->getDetail<
TrigConf::HLTHash
>(algStr);
24
std::string name =
TrigConf::HLTUtils::hash2string
(nameHash, ALGStr);
25
std::replace(name.begin(), name.end(),
':'
,
'_'
);
26
ATH_CHECK
(
getCounter
(name)->
newEvent
(data,
tc
->index(), weight) );
27
}
28
29
return
StatusCode::SUCCESS;
30
}
31
32
33
std::unique_ptr<CounterBase>
MonitorAlgorithm::newCounter
(
const
std::string& name) {
34
return
std::make_unique<CounterAlgorithm>(name,
this
);
35
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
CounterAlgorithm.h
tc
static Double_t tc
Definition
LArPhysWaveHECTool.cxx:38
MonitorAlgorithm.h
CostData
Caches and propagates event data to be used by monitoring algorithms.
Definition
CostData.h:26
MonitorAlgorithm::newCounter
virtual std::unique_ptr< CounterBase > newCounter(const std::string &name) override
Concrete counter instantiation.
Definition
MonitorAlgorithm.cxx:33
MonitorAlgorithm::newEvent
virtual StatusCode newEvent(const CostData &data, const float weight=1.) override
Concrete dispatch method.
Definition
MonitorAlgorithm.cxx:14
MonitorAlgorithm::MonitorAlgorithm
MonitorAlgorithm()=delete
Forbid default constructor.
MonitorBase::getCounter
CounterBase * getCounter(const std::string &name)
Retrieve counter by name.
Definition
Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx:52
MonitorBase::MonitorBase
MonitorBase()=delete
Forbid default constructor.
MonitoredRange
Container which represents a time range and holds a collection of Monitors which monitor this range.
Definition
MonitoredRange.h:29
TrigConf::HLTUtils::hash2string
static const std::string hash2string(HLTHash, const std::string &category="TE")
hash function translating identifiers into names (via internal dictionary)
TrigConf::HLTHash
uint32_t HLTHash
Definition
TrigConfHLTUtils/TrigConfHLTUtils/HLTUtils.h:19
xAOD::TrigComposite
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
Definition
TrigComposite.h:16
Generated on
for ATLAS Offline Software by
1.17.0