ATLAS Offline Software
Loading...
Searching...
No Matches
CostData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGCOSTANALYSIS_COSTDATA_H
6#define TRIGCOSTANALYSIS_COSTDATA_H 1
7
8#include "GaudiKernel/StatusCode.h"
12
13#include "CostROSData.h"
14
15#include <map>
16#include <vector>
17
26class CostData {
27 public:
31 CostData();
32
36 ~CostData() = default;
37
41 CostData& operator=(const CostData&) = delete;
42
46 CostData(const CostData&) = delete;
47
51 StatusCode set(const xAOD::TrigCompositeContainer* costCollection, uint32_t onlineSlot);
52
57
61 const CostROSData& costROSData() const;
62
67
71 const std::map<std::string, std::set<size_t>>& chainToAlgMap() const;
72
76 void setChainToAlgMap( const std::map<std::string, std::set<size_t>>& algToChains );
77
81 const std::map<std::string, std::set<size_t>>& chainToUniqAlgMap() const;
82
86 void setChainToUniqAlgMap( const std::map<std::string, std::set<size_t>>& algToChains );
87
91 const std::map<std::string, std::map<int16_t, std::set<size_t>>>& sequencersMap() const;
92
96 void setSequencersMap( const std::map<std::string, std::map<int16_t, std::set<size_t>>>& seqToAlg );
97
101 const std::vector<TrigCompositeUtils::AlgToChainTool::ChainInfo>& seededChains() const;
102
106 void setSeededChains(const std::vector<TrigCompositeUtils::AlgToChainTool::ChainInfo>& seededChains);
107
111 const std::map<size_t, std::vector<size_t>>& algToRequestMap() const;
112
116 void setLb(uint32_t lb);
117
121 void setOnlineSlot(uint32_t slot);
122
126 void setLivetime(float time, bool liveTimeIsPerEvent);
127
132 float liveTime() const;
133
138 bool liveTimeIsPerEvent() const;
139
144 uint32_t lb() const;
145
149 uint32_t onlineSlot() const;
150
154 bool isMasterSlot() const;
155
160 float algTotalTimeMilliSec() const;
161
162
166 const std::string& algNameToClassType(size_t algNameHash) const;
167
172 void setTypeMap( const std::unordered_map<uint32_t, std::string>& typeMap );
173
174 private:
175
180 StatusCode cache();
181
183 uint64_t m_algTotalTime;
185 uint32_t m_lb;
186 uint32_t m_slot;
188 const std::unordered_map<uint32_t, std::string>* m_typeMapPtr;
189 std::map<size_t, std::vector<size_t>> m_algToRos;
190 const std::map<std::string, std::set<size_t>>* m_chainToAlgIdx = nullptr;
191 const std::map<std::string, std::set<size_t>>* m_chainToUniqAlgIdx = nullptr;
192 const std::map<std::string, std::map<int16_t, std::set<size_t>>>* m_sequencers = nullptr;
193 const std::vector<TrigCompositeUtils::AlgToChainTool::ChainInfo>* m_seededChains = nullptr;
194
195};
196
197#endif // TRIGCOSTANALYSIS_COSTDATA_H
const std::map< std::string, std::set< size_t > > & chainToUniqAlgMap() const
Getter of the chain to its unique alg names map.
Definition CostData.cxx:123
const std::map< std::string, std::set< size_t > > * m_chainToUniqAlgIdx
Mapping of chain name to its unique algorithms.
Definition CostData.h:191
const xAOD::TrigCompositeContainer & costCollection() const
Getter of the cached algorithm cost collection pointer.
Definition CostData.cxx:56
bool isMasterSlot() const
Definition CostData.cxx:79
const std::vector< TrigCompositeUtils::AlgToChainTool::ChainInfo > * m_seededChains
Set of seeded chains to monitor.
Definition CostData.h:193
uint32_t m_lb
Current luminosity block number.
Definition CostData.h:185
bool m_liveTimeIsPerEvent
If the livetime represents a single event or all of the current LB.
Definition CostData.h:187
const CostROSData & costROSData() const
Getter of the ROS to ROB map.
void setLb(uint32_t lb)
Setter of effective P1 walltime represented by the current event.
Definition CostData.cxx:37
void setSequencersMap(const std::map< std::string, std::map< int16_t, std::set< size_t > > > &seqToAlg)
Set the sequence to alg idx map.
Definition CostData.cxx:114
const std::map< std::string, std::set< size_t > > & chainToAlgMap() const
Getter of the alg name to chains map.
Definition CostData.cxx:119
CostData & operator=(const CostData &)=delete
Forbid assignment.
const std::string & algNameToClassType(size_t algNameHash) const
Get the class typename given an algorithm instance name.
Definition CostData.cxx:89
const std::map< size_t, std::vector< size_t > > & algToRequestMap() const
Getter of map between algorithm (index in costCollection) and ROS requests (indicies in rosCollection...
Definition CostData.cxx:63
uint32_t lb() const
Current luminosity block number.
Definition CostData.cxx:71
const std::map< std::string, std::map< int16_t, std::set< size_t > > > & sequencersMap() const
Getter of the sequence to alg idx map.
Definition CostData.cxx:127
uint32_t onlineSlot() const
Definition CostData.cxx:75
CostData()
Construct an empty CostData.
Definition CostData.cxx:9
void setCostROSData(const CostROSData &costROSData)
Set ROS to ROB map.
void setTypeMap(const std::unordered_map< uint32_t, std::string > &typeMap)
Set internal type map pointer.
Definition CostData.cxx:102
CostData(const CostData &)=delete
Forbid copy.
void setChainToAlgMap(const std::map< std::string, std::set< size_t > > &algToChains)
Set the alg name to chains map.
Definition CostData.cxx:106
uint64_t m_algTotalTime
Integrated CPU time of all algorithms in the event.
Definition CostData.h:183
const std::unordered_map< uint32_t, std::string > * m_typeMapPtr
Cached non-owning pointer mapping algorithm instance names to types.
Definition CostData.h:188
bool liveTimeIsPerEvent() const
If a call to liveTime() is providing data on a single event or a whole LB.
Definition CostData.cxx:51
uint32_t m_slot
Current online slot number.
Definition CostData.h:186
const std::map< std::string, std::map< int16_t, std::set< size_t > > > * m_sequencers
Mapping of sequence to algorithms.
Definition CostData.h:192
void setSeededChains(const std::vector< TrigCompositeUtils::AlgToChainTool::ChainInfo > &seededChains)
Set the seeded chains set.
Definition CostData.cxx:135
const xAOD::TrigCompositeContainer * m_costCollection
Cached non-owning pointer to main algorithm cost collection.
Definition CostData.h:182
float m_liveTime
Effective walltime of either the event or the LB, in seconds (.
Definition CostData.h:184
StatusCode set(const xAOD::TrigCompositeContainer *costCollection, uint32_t onlineSlot)
Cache the cost and ros collections, after formally requesting it from storegate.
Definition CostData.cxx:19
StatusCode cache()
Compute and cache derived quantities, called automatically after set().
Definition CostData.cxx:27
const std::vector< TrigCompositeUtils::AlgToChainTool::ChainInfo > & seededChains() const
Getter of the seeded chains set.
Definition CostData.cxx:131
std::map< size_t, std::vector< size_t > > m_algToRos
Mapping of indexes from m_costCollection to corresponding ROS requests made by algorithm.
Definition CostData.h:189
float liveTime() const
Getter of effective P1 walltime represented by either the current event, or the current lumi block.
Definition CostData.cxx:84
void setLivetime(float time, bool liveTimeIsPerEvent)
Setter of effective P1 walltime represented by the current event, or the current lumi block.
Definition CostData.cxx:45
void setOnlineSlot(uint32_t slot)
Setter of the online Slot number of the current event.
Definition CostData.cxx:41
void setChainToUniqAlgMap(const std::map< std::string, std::set< size_t > > &algToChains)
Set the chain to its unique alg names map.
Definition CostData.cxx:110
float algTotalTimeMilliSec() const
Getter of the total algorithm CPU time in the event.
Definition CostData.cxx:67
const std::map< std::string, std::set< size_t > > * m_chainToAlgIdx
Mapping of chain to algorithms idx.
Definition CostData.h:190
~CostData()=default
Default destructor.
Caches and propagates event data to be used by monitoring algorithms.
Definition CostROSData.h:24
TrigCompositeContainer_v1 TrigCompositeContainer
Declare the latest version of the container.