ATLAS Offline Software
Loading...
Searching...
No Matches
MonitorAlgorithmClass.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8MonitorAlgorithmClass::MonitorAlgorithmClass(const std::string& name, const MonitoredRange* parent)
9 : MonitorBase(name, parent) {
10}
11
12StatusCode MonitorAlgorithmClass::newEvent(const CostData& data, const float weight) {
13
14 for (const xAOD::TrigComposite* tc : data.costCollection()) {
15 const uint32_t slot = tc->getDetail<uint32_t>("slot");
16 if (slot != data.onlineSlot()) {
17 continue; // When monitoring the master slot, this Monitor ignores algs running in different slots
18 }
19 const uint32_t nameHash = tc->getDetail<TrigConf::HLTHash>("alg");
20 const std::string& name = data.algNameToClassType(nameHash);
21 ATH_CHECK( getCounter(name)->newEvent(data, tc->index(), weight) );
22 }
23
24 return StatusCode::SUCCESS;
25}
26
27
28std::unique_ptr<CounterBase> MonitorAlgorithmClass::newCounter(const std::string& name) {
29 return std::make_unique<CounterAlgorithmClass>(name, this);
30}
#define ATH_CHECK
Evaluate an expression and check for errors.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t tc
Caches and propagates event data to be used by monitoring algorithms.
Definition CostData.h:26
virtual std::unique_ptr< CounterBase > newCounter(const std::string &name) override
Concrete counter instantiation.
virtual StatusCode newEvent(const CostData &data, const float weight=1.) override
Concrete dispatch method.
MonitorAlgorithmClass()=delete
Forbid default constructor.
CounterBase * getCounter(const std::string &name)
Retrieve counter by name.
MonitorBase()=delete
Forbid default constructor.
Container which represents a time range and holds a collection of Monitors which monitor this range.
TrigComposite_v1 TrigComposite
Declare the latest version of the class.