5#ifndef TRIGCOSTANALYSIS_TRIGCOSTALYSIS_H
6#define TRIGCOSTANALYSIS_TRIGCOSTALYSIS_H 1
16#include "Gaudi/Parsers/Factory.h"
17#include "GaudiKernel/ITHistSvc.h"
22#include <unordered_map>
59 virtual StatusCode
start();
64 virtual StatusCode
execute() final;
82 "Use a single time range rather than splitting by LB" };
85 "Name for single time range" };
87 Gaudi::Property<std::string>
m_additionalHashMap {
this,
"AdditionalHashMap",
"TrigCostRootAnalysis/hashes2string_29042021.txt",
88 "Used to load strings corresponding to algorithms which are not explicitly scheduled by chains. To be updated periodically." };
91 "Used to load strings corresponding to algorithms which are not explicitly scheduled by chains." };
94 "Length of each variable length Time Range in LB" };
97 "Maximum number of allowed time ranges" };
100 "Monitor individual algorithms by instance name" };
103 "Monitor individual algorithms by instance class type name" };
106 "Monitor global event properties" };
109 "Monitor algorithm occupancy load of individual threads in an MT execution environment" };
112 "Monitor Read-Out System" };
115 "Monitor individual chains by instance name" };
118 "Monitor algorithms associated with chains by instance name" };
121 "Monitor individual sequences by name" };
124 "Apply Enhanced Bias weights" };
127 "Maximum number of full event summaries which will be dumped" };
130 "Save a full record of one in every N events, up to MaxFullEventDumps." };
133 "Base events weight, other weights may be multiplied on top of this one." };
135 Gaudi::Property<std::map<std::string, std::vector<uint32_t>>>
m_rosToRob {
136 this,
"ROSToROBMap", {},
"ROS to ROB mapping" };
139 this,
"ExcludeAlgsFromChainTime", {},
"Algorithms to exclude from chain time calculation"};
142 "Trigger cost payload container for algorithms" };
145 "Trigger ROS cost payload container for algorithms" };
148 "TrigComposite collections with additional cost metadata" };
154 "Enhanced bias weighting tool."};
156 ToolHandle<TrigCompositeUtils::AlgToChainTool>
m_algToChainTool{
this,
"AlgToChainTool",
"",
157 "Tool to retrieve chains for algorithm."};
182 StatusCode
dumpEvent(
const EventContext& context)
const;
195 float getWeight(
const EventContext& context);
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Caches and propagates event data to be used by monitoring algorithms.
Caches and propagates event data to be used by monitoring algorithms.
Container which represents a time range and holds a collection of Monitors which monitor this range.
Property holding a SG store/key/clid from which a ReadHandle is made.
Gaudi::Property< bool > m_useEBWeights
uint32_t getOnlineSlot(const xAOD::TrigCompositeContainer *costCollection) const
Return the slot used to process the event online.
std::unordered_map< std::string, std::unique_ptr< MonitoredRange > > m_monitoredRanges
Owned storage of Ranges.
Gaudi::Property< bool > m_singleTimeRange
Gaudi::Property< std::set< std::string > > m_excludeAlgsFromChain
Gaudi::Property< std::vector< std::string > > m_additionalHashList
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_metadataDataKey
Gaudi::Property< bool > m_doMonitorAlgorithm
Gaudi::Property< bool > m_doMonitorChainAlgorithm
Gaudi::Property< bool > m_doMonitorROS
virtual StatusCode finalize() final
Currently a noop for this algorithm.
Gaudi::Property< float > m_baseEventWeight
TH1 * bookGetPointer(TH1 *hist, const std::string &tDir="") const
Public method forwarded to this class' AthHistogramAlgorithm::bookGetPointer base.
ServiceHandle< ITHistSvc > m_histSvc
Gaudi::Property< bool > m_doMonitorSequence
std::atomic< size_t > m_maxViewsNumber
What is the maximum number of View instances we've so far cached string hashes to cover?
virtual StatusCode start()
Retrieve menu handle.
virtual ~TrigCostAnalysis()=default
Default destructor.
void writeMetadata()
Write to outpute tree (if any) the metadata needed downstream.
std::set< std::string > m_hostnames ATLAS_THREAD_SAFE
Save unique hostnames for the run.
ToolHandle< IEnhancedBiasWeighter > m_enhancedBiasTool
Gaudi::Property< size_t > m_maxFullEventDumps
Gaudi::Property< std::string > m_additionalHashMap
Gaudi::Property< std::map< std::string, std::vector< uint32_t > > > m_rosToRob
std::mutex m_addHostnameMutex
Mutex to update set below.
StatusCode getRange(const EventContext &context, MonitoredRange *&range)
Return or construct and return a Range for the Context.
std::unordered_map< uint32_t, std::string > m_algTypeMap
Cache of algorithm's type, read from configuration data.
Gaudi::Property< size_t > m_maxTimeRange
Gaudi::Property< bool > m_doMonitorThreadOccupancy
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_rosDataKey
virtual StatusCode execute() final
Monitor event, unless max range limit reached and event outside of all ranges.
StatusCode registerMonitors(MonitoredRange *range)
Populate a newly minted Range object with all configured Monitors.
Gaudi::Property< bool > m_doMonitorGlobal
Gaudi::Property< size_t > m_TimeRangeLengthLB
StatusCode checkUpdateMaxView(const size_t max)
High watermark for pre-cached string hashes for the SLOT category.
virtual StatusCode initialize() final
Retrieve tools and initialise read handles.
CostROSData m_costROSData
Cached CostROSData class with details needed for ROS monitoring.
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_costDataKey
TTree * m_metadataTree
Used to write out some metadata needed by post-processing (e.g.
TrigCostAnalysis(const std::string &name, ISvcLocator *pSvcLocator)
Construct TrigCostAnalysis.
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
ToolHandle< TrigCompositeUtils::AlgToChainTool > m_algToChainTool
std::set< std::string > m_storeIdentifiers
Identifiers of object stores, needed to cache STORE string-hash values.
Gaudi::Property< bool > m_doMonitorChain
StatusCode dumpEvent(const EventContext &context) const
Dump event algorithm execution data in ASCII format.
Gaudi::Property< bool > m_doMonitorAlgorithmClass
Gaudi::Property< uint64_t > m_fullEventDumpProbability
std::atomic< size_t > m_fullEventDumps
Counter to keep track of how many events have been full-dumped.
Gaudi::Property< std::string > m_singleTimeRangeName
float getWeight(const EventContext &context)
Compute global event weight to correct for online prescales.
bool checkDoFullEventDump(const EventContext &context, const CostData &costData)
Check if event dumping should be performed for the current event.
TrigCompositeContainer_v1 TrigCompositeContainer
Declare the latest version of the container.