ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigCost
TrigCostAnalysis
src
monitors
MonitorROS.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 "
MonitorROS.h
"
6
#include "
../counters/CounterROS.h
"
7
8
#include <algorithm>
9
#include <set>
10
#include <utility>
11
12
13
MonitorROS::MonitorROS
(
const
std::string& name,
const
MonitoredRange
* parent)
14
:
MonitorBase
(name, parent) {
15
}
16
17
18
StatusCode
MonitorROS::newEvent
(
const
CostData
& data,
const
float
weight) {
19
20
if
(data.rosCollection().empty()){
21
ATH_MSG_DEBUG
(
"The ROS collection is empty!"
);
22
}
23
const
std::string robsIdStr{
"robs_id"
};
24
for
(
const
xAOD::TrigComposite
*
tc
: data.rosCollection()) {
25
auto
robIds =
tc
->getDetail<std::vector<uint32_t>>(robsIdStr);
26
// Create set of unique ROS for this request
27
std::set<std::string> rosPerRequest;
28
for
(uint32_t robId : robIds) {
29
if
(data.costROSData().getROSForROB(robId).empty()){
30
ATH_MSG_WARNING
(
"ROS for ROB 0x"
<< std::hex << robId <<
" is missing"
);
31
continue
;
32
}
33
std::string rosForROB = data.costROSData().getROSForROB(robId);
34
if
(!rosForROB.empty()){
35
rosPerRequest.insert(std::move(rosForROB));
36
}
37
}
38
39
for
(
const
std::string& rosName : rosPerRequest) {
40
if
(!
counterExists
(rosName)){
41
// Create a new counter using specialized constructor in order to pass number of bins for some of the histograms
42
unsigned
nRobs = data.costROSData().getROBForROS(rosName).size();
// Number of all possible ROBs for this ROS
43
m_counters
.insert( std::make_pair(rosName,
newCounter
(rosName, nRobs)) );
44
}
45
46
ATH_CHECK
(
getCounter
(rosName)->
newEvent
(data,
tc
->index(), weight) );
47
}
48
}
49
50
return
StatusCode::SUCCESS;
51
}
52
53
54
std::unique_ptr<CounterBase>
MonitorROS::newCounter
(
const
std::string& name) {
55
return
std::make_unique<CounterROS>(name,
this
);
56
}
57
58
std::unique_ptr<CounterBase>
MonitorROS::newCounter
(
const
std::string& name,
unsigned
nRobs) {
59
return
std::make_unique<CounterROS>(name, nRobs,
this
);
60
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CounterROS.h
tc
static Double_t tc
Definition
LArPhysWaveHECTool.cxx:38
MonitorROS.h
CostData
Caches and propagates event data to be used by monitoring algorithms.
Definition
CostData.h:26
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.
MonitorBase::counterExists
bool counterExists(const std::string &name) const
Check if a counter of a given name exists.
Definition
Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx:47
MonitorBase::m_counters
std::unordered_map< std::string, std::unique_ptr< CounterBase > > m_counters
Storage of Monitor's collection of Counters.
Definition
Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h:138
MonitorROS::newCounter
virtual std::unique_ptr< CounterBase > newCounter(const std::string &name) override
Concrete counter instantiation.
Definition
MonitorROS.cxx:54
MonitorROS::newEvent
virtual StatusCode newEvent(const CostData &data, const float weight=1.) override
Concrete dispatch method.
Definition
MonitorROS.cxx:18
MonitorROS::MonitorROS
MonitorROS()=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
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