ATLAS Offline Software
MonitorChainAlgorithm.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "../counters/CounterAlgorithm.h"
7 
10 }
11 
13  const std::vector<TrigCompositeUtils::AlgToChainTool::ChainInfo>& seededChains = data.seededChains();
14  for (size_t i = 0; i < seededChains.size(); ++i){
15  // Find algorithms associated with chain name
16  if (!data.chainToAlgMap().count(seededChains[i].name)) continue;
17 
18  for (const size_t algIndex : data.chainToAlgMap().at(seededChains[i].name)){
19  const xAOD::TrigComposite* alg = data.costCollection().at(algIndex);
20 
21  const uint32_t slot = alg->getDetail<uint32_t>("slot");
22  if (slot != data.onlineSlot()) {
23  continue; // When monitoring the master slot, this Monitor ignores algs running in different slots
24  }
25 
26  const uint32_t nameHash = alg->getDetail<TrigConf::HLTHash>("alg");
27  const std::string algName = TrigConf::HLTUtils::hash2string(nameHash, "ALG");
28 
29  std::stringstream counterName;
30  counterName << seededChains[i].name << "__" << algName;
31  ATH_CHECK( getCounter(counterName.str())->newEvent(data, algIndex, weight) );
32  }
33  }
34 
35  return StatusCode::SUCCESS;
36 }
37 
38 
39 std::unique_ptr<CounterBase> MonitorChainAlgorithm::newCounter(const std::string& name) {
40  return std::make_unique<CounterAlgorithm>(name, this);
41 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
CounterBase::newEvent
virtual StatusCode newEvent(const CostData &data, size_t index, float weight=1.0)=0
Pure virtual interface called by Monitor to instruct this Counter to perform its analysis.
SGout2dot.alg
alg
Definition: SGout2dot.py:243
MonitorChainAlgorithm::MonitorChainAlgorithm
MonitorChainAlgorithm()=delete
Forbid default constructor.
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigConf::HLTHash
uint32_t HLTHash
Definition: TrigConfHLTUtils/TrigConfHLTUtils/HLTUtils.h:19
xAOD::JetAlgorithmType::algName
const std::string & algName(ID id)
Converts a JetAlgorithmType::ID into a string.
Definition: JetContainerInfo.cxx:67
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
MonitorChainAlgorithm.h
MonitorBase::getCounter
CounterBase * getCounter(const std::string &name)
Retrieve counter by name.
Definition: Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx:52
lumiFormat.i
int i
Definition: lumiFormat.py:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigConf::HLTUtils::hash2string
static const std::string hash2string(HLTHash, const std::string &category="TE")
hash function translating identifiers into names (via internal dictionary)
MonitorBase
Forward declare.
Definition: Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h:33
MonitoredRange
Container which represents a time range and holds a collection of Monitors which monitor this range.
Definition: MonitoredRange.h:29
MonitorChainAlgorithm::newEvent
virtual StatusCode newEvent(const CostData &data, const float weight=1.) override
Concrete dispatch method.
Definition: MonitorChainAlgorithm.cxx:12
MonitorChainAlgorithm::newCounter
virtual std::unique_ptr< CounterBase > newCounter(const std::string &name) override
Concrete counter instantiation.
Definition: MonitorChainAlgorithm.cxx:39
CostData
Caches and propagates event data to be used by monitoring algorithms.
Definition: CostData.h:26