5#ifndef TRIGCOSTANALYSIS_COSTDATA_H
6#define TRIGCOSTANALYSIS_COSTDATA_H 1
8#include "GaudiKernel/StatusCode.h"
71 const std::map<std::string, std::set<size_t>>&
chainToAlgMap()
const;
76 void setChainToAlgMap(
const std::map<std::string, std::set<size_t>>& algToChains );
91 const std::map<std::string, std::map<int16_t, std::set<size_t>>>&
sequencersMap()
const;
96 void setSequencersMap(
const std::map<std::string, std::map<int16_t, std::set<size_t>>>& seqToAlg );
101 const std::vector<TrigCompositeUtils::AlgToChainTool::ChainInfo>&
seededChains()
const;
172 void setTypeMap(
const std::unordered_map<uint32_t, std::string>& typeMap );
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;
const std::map< std::string, std::set< size_t > > & chainToUniqAlgMap() const
Getter of the chain to its unique alg names map.
const std::map< std::string, std::set< size_t > > * m_chainToUniqAlgIdx
Mapping of chain name to its unique algorithms.
const xAOD::TrigCompositeContainer & costCollection() const
Getter of the cached algorithm cost collection pointer.
bool isMasterSlot() const
const std::vector< TrigCompositeUtils::AlgToChainTool::ChainInfo > * m_seededChains
Set of seeded chains to monitor.
uint32_t m_lb
Current luminosity block number.
bool m_liveTimeIsPerEvent
If the livetime represents a single event or all of the current LB.
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.
void setSequencersMap(const std::map< std::string, std::map< int16_t, std::set< size_t > > > &seqToAlg)
Set the sequence to alg idx map.
const std::map< std::string, std::set< size_t > > & chainToAlgMap() const
Getter of the alg name to chains map.
CostData & operator=(const CostData &)=delete
Forbid assignment.
const std::string & algNameToClassType(size_t algNameHash) const
Get the class typename given an algorithm instance name.
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...
uint32_t lb() const
Current luminosity block number.
const std::map< std::string, std::map< int16_t, std::set< size_t > > > & sequencersMap() const
Getter of the sequence to alg idx map.
uint32_t onlineSlot() const
CostData()
Construct an empty CostData.
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.
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.
uint64_t m_algTotalTime
Integrated CPU time of all algorithms in the event.
const std::unordered_map< uint32_t, std::string > * m_typeMapPtr
Cached non-owning pointer mapping algorithm instance names to types.
bool liveTimeIsPerEvent() const
If a call to liveTime() is providing data on a single event or a whole LB.
uint32_t m_slot
Current online slot number.
const std::map< std::string, std::map< int16_t, std::set< size_t > > > * m_sequencers
Mapping of sequence to algorithms.
void setSeededChains(const std::vector< TrigCompositeUtils::AlgToChainTool::ChainInfo > &seededChains)
Set the seeded chains set.
const xAOD::TrigCompositeContainer * m_costCollection
Cached non-owning pointer to main algorithm cost collection.
float m_liveTime
Effective walltime of either the event or the LB, in seconds (.
StatusCode set(const xAOD::TrigCompositeContainer *costCollection, uint32_t onlineSlot)
Cache the cost and ros collections, after formally requesting it from storegate.
StatusCode cache()
Compute and cache derived quantities, called automatically after set().
const std::vector< TrigCompositeUtils::AlgToChainTool::ChainInfo > & seededChains() const
Getter of the seeded chains set.
std::map< size_t, std::vector< size_t > > m_algToRos
Mapping of indexes from m_costCollection to corresponding ROS requests made by algorithm.
float liveTime() const
Getter of effective P1 walltime represented by either the current event, or the current lumi block.
void setLivetime(float time, bool liveTimeIsPerEvent)
Setter of effective P1 walltime represented by the current event, or the current lumi block.
void setOnlineSlot(uint32_t slot)
Setter of the online Slot number of the current event.
void setChainToUniqAlgMap(const std::map< std::string, std::set< size_t > > &algToChains)
Set the chain to its unique alg names map.
float algTotalTimeMilliSec() const
Getter of the total algorithm CPU time in the event.
const std::map< std::string, std::set< size_t > > * m_chainToAlgIdx
Mapping of chain to algorithms idx.
~CostData()=default
Default destructor.
Caches and propagates event data to be used by monitoring algorithms.
TrigCompositeContainer_v1 TrigCompositeContainer
Declare the latest version of the container.