ATLAS Offline Software
Loading...
Searching...
No Matches
TrigCostAnalysis Class Reference

Athena algorithm used to process Trigger cost monitoring data in Run 3 and above. More...

#include <TrigCostAnalysis.h>

Inheritance diagram for TrigCostAnalysis:
Collaboration diagram for TrigCostAnalysis:

Public Member Functions

 TrigCostAnalysis (const std::string &name, ISvcLocator *pSvcLocator)
 Construct TrigCostAnalysis.
virtual ~TrigCostAnalysis ()=default
 Default destructor.
virtual StatusCode initialize () final
 Retrieve tools and initialise read handles.
virtual StatusCode start ()
 Retrieve menu handle.
virtual StatusCode execute (const EventContext &ctx) final
 Monitor event, unless max range limit reached and event outside of all ranges.
virtual StatusCode finalize () final
 Currently a noop for this algorithm.
TH1 * bookGetPointer (TH1 *hist, const std::string &tDir="") const
 Public method forwarded to this class' AthHistogramAlgorithm::bookGetPointer base.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Public Attributes

ServiceHandle< ITHistSvc > m_histSvc { this, "THistSvc", "THistSvc/THistSvc", "Histogramming svc" }
Gaudi::Property< bool > m_singleTimeRange
Gaudi::Property< std::string > m_singleTimeRangeName
Gaudi::Property< std::string > m_additionalHashMap
Gaudi::Property< std::vector< std::string > > m_additionalHashList
Gaudi::Property< size_t > m_TimeRangeLengthLB
Gaudi::Property< size_t > m_maxTimeRange
Gaudi::Property< bool > m_doMonitorAlgorithm
Gaudi::Property< bool > m_doMonitorAlgorithmClass
Gaudi::Property< bool > m_doMonitorGlobal
Gaudi::Property< bool > m_doMonitorThreadOccupancy
Gaudi::Property< bool > m_doMonitorChain
Gaudi::Property< bool > m_doMonitorChainAlgorithm
Gaudi::Property< bool > m_doMonitorSequence
Gaudi::Property< bool > m_useEBWeights
Gaudi::Property< size_t > m_maxFullEventDumps
Gaudi::Property< uint64_t > m_fullEventDumpProbability
Gaudi::Property< float > m_baseEventWeight
Gaudi::Property< std::set< std::string > > m_excludeAlgsFromChain
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_costDataKey
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_metadataDataKey
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
ToolHandle< IEnhancedBiasWeighter > m_enhancedBiasTool
ToolHandle< TrigCompositeUtils::AlgToChainTool > m_algToChainTool

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

bool checkDoFullEventDump (const EventContext &context, const CostData &costData)
 Check if event dumping should be performed for the current event.
StatusCode getRange (const EventContext &context, MonitoredRange *&range)
 Return or construct and return a Range for the Context.
StatusCode dumpEvent (const EventContext &context) const
 Dump event algorithm execution data in ASCII format.
StatusCode registerMonitors (MonitoredRange *range)
 Populate a newly minted Range object with all configured Monitors.
float getWeight (const EventContext &context)
 Compute global event weight to correct for online prescales.
uint32_t getOnlineSlot (const xAOD::TrigCompositeContainer *costCollection) const
 Return the slot used to process the event online.
StatusCode checkUpdateMaxView (const size_t max)
 High watermark for pre-cached string hashes for the SLOT category.
void writeMetadata ()
 Write to outpute tree (if any) the metadata needed downstream.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::unordered_map< std::string, std::unique_ptr< MonitoredRange > > m_monitoredRanges
 Owned storage of Ranges.
std::unordered_map< uint32_t, std::string > m_algTypeMap
 Cache of algorithm's type, read from configuration data.
std::set< std::string > m_storeIdentifiers
 Identifiers of object stores, needed to cache STORE string-hash values.
TTree * m_metadataTree
 Used to write out some metadata needed by post-processing (e.g.
std::atomic< size_t > m_fullEventDumps
 Counter to keep track of how many events have been full-dumped.
std::atomic< size_t > m_maxViewsNumber
 What is the maximum number of View instances we've so far cached string hashes to cover?
std::mutex m_addHostnameMutex
 Mutex to update set below.
std::set< std::string > m_hostnames ATLAS_THREAD_SAFE
 Save unique hostnames for the run.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Athena algorithm used to process Trigger cost monitoring data in Run 3 and above.

Outputs histograms.

Algorithm to read relevant trigger cost data from the event store and trigger configuration data from the config service, identify the time Range that the event falls into, and dispatches monitoring to the correct time range. Time ranges, their monitors, and their monitor's counters are all instantiated on-demand.

Definition at line 35 of file TrigCostAnalysis.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrigCostAnalysis()

TrigCostAnalysis::TrigCostAnalysis ( const std::string & name,
ISvcLocator * pSvcLocator )

Construct TrigCostAnalysis.

Parameters
[in]nameAthena algorithm's name.
[in]pSvcLocatorFramework service pointer.

Definition at line 24 of file TrigCostAnalysis.cxx.

24 :
25 AthAlgorithm(name, pSvcLocator),
26 m_metadataTree(nullptr),
29}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
std::atomic< size_t > m_maxViewsNumber
What is the maximum number of View instances we've so far cached string hashes to cover?
TTree * m_metadataTree
Used to write out some metadata needed by post-processing (e.g.
std::atomic< size_t > m_fullEventDumps
Counter to keep track of how many events have been full-dumped.

◆ ~TrigCostAnalysis()

virtual TrigCostAnalysis::~TrigCostAnalysis ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ bookGetPointer()

TH1 * TrigCostAnalysis::bookGetPointer ( TH1 * hist,
const std::string & tDir = "" ) const

Public method forwarded to this class' AthHistogramAlgorithm::bookGetPointer base.

Parameters
[in]histBare pointer to histogram. Ownership transferred to THistSvc.
[in]tDirHistogram name & directory.
Returns
Cached pointer to histogram. Used to fill histogram without having to perform THishSvc lookup.

Definition at line 169 of file TrigCostAnalysis.cxx.

169 {
170 std::string histName(hist->GetName());
171 std::string bookingString = "/COSTSTREAM/" + tDir + "/" + histName;
172
173 if (!((m_histSvc->regHist(bookingString, hist)).isSuccess())) {
174 ATH_MSG_WARNING( "Problem registering histogram with name " << histName);
175 return nullptr;
176 }
177
178 return hist;
179}
#define ATH_MSG_WARNING(x,...)
ServiceHandle< ITHistSvc > m_histSvc

◆ checkDoFullEventDump()

bool TrigCostAnalysis::checkDoFullEventDump ( const EventContext & context,
const CostData & costData )
private

Check if event dumping should be performed for the current event.

Parameters
[in]contextEvent context.
[in]costDataWe only dump the master-slot (slot:0) as these events cary payload data for all slots / all threads.
Returns
True, if the event should be dumped.

Definition at line 301 of file TrigCostAnalysis.cxx.

301 {
302 if (costData.isMasterSlot()
304 and context.eventID().event_number() % m_fullEventDumpProbability == 0)
305 {
307 return true;
308 }
309 return false;
310}
bool isMasterSlot() const
Definition CostData.cxx:79
Gaudi::Property< size_t > m_maxFullEventDumps
Gaudi::Property< uint64_t > m_fullEventDumpProbability

◆ checkUpdateMaxView()

StatusCode TrigCostAnalysis::checkUpdateMaxView ( const size_t max)
private

High watermark for pre-cached string hashes for the SLOT category.

Corresponding to SG and View IProxyDict names.

Parameters
[in]maxPre-compute string hashes for View or Slot multiplicities up to this number.

Definition at line 133 of file TrigCostAnalysis.cxx.

133 {
134 if (max <= m_maxViewsNumber) {
135 return StatusCode::SUCCESS;
136 }
137
138 const size_t current = m_maxViewsNumber;
140
141 ATH_MSG_DEBUG(std::format("Extending maximum View instances from {} to {}", current, max));
142
143 for (size_t viewID = current; viewID <= m_maxViewsNumber; ++viewID) {
144 // Allow for this many individual View instances
145 for (const std::string& store : m_storeIdentifiers) {
147 std::format("{}_view_{}", store, viewID), "STORE");
148 }
149
150 // And this many global Slots. Though, in general, it will be the Views which are driving this.
152 std::format("{}_StoreGateSvc_Impl", viewID), "STORE");
153 }
154
155 return StatusCode::SUCCESS;
156}
#define ATH_MSG_DEBUG(x,...)
#define max(a, b)
Definition cfImp.cxx:41
static HLTHash string2hash(std::string_view, const std::string &category=s_defaultCategory)
hash function translating TE names into identifiers
std::set< std::string > m_storeIdentifiers
Identifiers of object stores, needed to cache STORE string-hash values.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ dumpEvent()

StatusCode TrigCostAnalysis::dumpEvent ( const EventContext & context) const
private

Dump event algorithm execution data in ASCII format.

Parameters
[in]contextEvent context.

Definition at line 420 of file TrigCostAnalysis.cxx.

420 {
422 SG::ReadHandle<xAOD::TrigCompositeContainer> costDataHandle(m_costDataKey, context);
423
424 std::stringstream ss;
425 size_t algID = 0;
426
427 for ( const xAOD::TrigComposite* tc : *costDataHandle ) {
428 const uint64_t start = tc->getDetail<uint64_t>("start"); // in mus
429 const uint64_t stop = tc->getDetail<uint64_t>("stop"); // in mus
430 const uint32_t slot = tc->getDetail<uint32_t>("slot");
431 const uint64_t start_ms_round = std::llround( start * 1e-3 ); // in ms
432 const uint64_t stop_ms_round = std::llround( stop * 1e-3 ); // in ms
433 const uint32_t threadID = tc->getDetail<uint32_t>("thread");
434
435 ss << "{id:" << algID++;
436 ss << ", group:" << threadID;
437 ss << ", className:'slot" << slot << "'";
438 ss << ", content:'" << TrigConf::HLTUtils::hash2string( tc->getDetail<TrigConf::HLTHash>("alg"), "ALG");
439 ss << "<br>" << TrigConf::HLTUtils::hash2string( tc->getDetail<TrigConf::HLTHash>("store"), "STORE") << "'";
440 ss << ", duration:" << (stop - start); // For tooltip display: in mus
441 ss << ", start:" << start_ms_round; // in ms
442 if (stop_ms_round > start_ms_round) {
443 ss << ", end:" << stop_ms_round;
444 } else {
445 ss << ", type:'point'";
446 }
447 ss << "},\n";
448 }
449
450 ATH_MSG_DEBUG("Full Event Summary for event " << context.eventID().event_number());
451 ATH_MSG_DEBUG(ss.str());
452 // TODO Persist this
453
454 return StatusCode::SUCCESS;
455}
static Double_t ss
static Double_t tc
static const std::string hash2string(HLTHash, const std::string &category=s_defaultCategory)
hash function translating identifiers into names (via internal dictionary)
virtual StatusCode start()
Retrieve menu handle.
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_costDataKey
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
setEventNumber uint32_t

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TrigCostAnalysis::execute ( const EventContext & ctx)
finalvirtual

Monitor event, unless max range limit reached and event outside of all ranges.

Implements AthAlgorithm.

Definition at line 182 of file TrigCostAnalysis.cxx.

182 {
183 const EventContext& context = ctx;
184
185 MonitoredRange* range = nullptr;
186 ATH_CHECK(getRange(context, range));
187
188 if (!range) {
189
190 ATH_MSG_DEBUG("Not monitoring event");
191 return StatusCode::SUCCESS;
192
193 }
194
195 ATH_MSG_DEBUG("Monitoring event " << context.eventID().event_number() << " in LB " << context.eventID().lumi_block() << " in range " << range->getName());
196
197 SG::ReadHandle<xAOD::TrigCompositeContainer> costDataHandle(m_costDataKey, context);
198 ATH_CHECK( costDataHandle.isValid() );
199
200 if (!m_metadataDataKey.empty()){
201 SG::ReadHandle<xAOD::TrigCompositeContainer> metadataDataHandle(m_metadataDataKey, context);
202 if (metadataDataHandle.isValid()){
203 for (const xAOD::TrigComposite* tc : *metadataDataHandle) {
204 try {
205 std::lock_guard<std::mutex> lock(m_addHostnameMutex);
206 m_hostnames.insert(tc->getDetail<std::string>("hostname"));
207 } catch ( const std::exception& ) {
208 ATH_MSG_WARNING("Missing HLT_RuntimeMetadata EDM hostname for event " << context.eventID().event_number());
209 }
210
211 }
212 }
213 else {
214 ATH_MSG_DEBUG("Not valid HLT_RuntimeMetadata handle for the event " << context.eventID().event_number());
215 }
216 }
217
218 // Save indexes of algorithm in costDataHandle
219 std::map<std::string, std::set<size_t>> chainToAlgIdx;
220 std::map<std::string, std::set<size_t>> chainToUniqAlgs; // List for unique algorithms for each chain
221 std::map<std::string, std::map<int16_t, std::set<size_t>>> seqToAlgIdx; // Map of algorithms split in views
222 std::map<std::string, std::set<std::string>> algToChain;
223 m_algToChainTool->cacheSGKeys(context);
224 ATH_CHECK( m_algToChainTool->getChainsForAllAlgs(context, algToChain) );
225
226 // Retrieve active sequences and algorithms
227 std::map<std::string, std::string> algToSeq;
228 ATH_CHECK(m_algToChainTool->getAllActiveSequences(context, algToSeq));
229
230 for (const xAOD::TrigComposite* tc : *costDataHandle) {
231 const uint32_t nameHash = tc->getDetail<TrigConf::HLTHash>("alg");
232 const std::string algName = TrigConf::HLTUtils::hash2string(nameHash, "ALG");
233
234 size_t i = 0;
235 if(m_excludeAlgsFromChain.find(algName) != m_excludeAlgsFromChain.end()) continue;
236
237 for (const std::string& chain : algToChain[algName]){
238 chainToAlgIdx[chain].insert(tc->index());
239 ++i;
240 }
241
242 if (i == 1){
243 ATH_MSG_DEBUG("Algorithm " << algName << " executed uniquely for " << *algToChain[algName].begin() << " chain");
244 chainToUniqAlgs[*algToChain[algName].begin()].insert(tc->index());
245 }
246
247 if (algToSeq.count(algName)){
248 const int16_t view = tc->getDetail<int16_t>("view");
249 seqToAlgIdx[algToSeq[algName]][view].insert(tc->index());
250 }
251 }
252
253 const std::set<TrigCompositeUtils::DecisionID> seededChains = m_algToChainTool->retrieveActiveChains(context, "HLTNav_L1");
254 std::vector<TrigCompositeUtils::AlgToChainTool::ChainInfo> seededChainsInfo;
255
256 // Skip empty events, where only cost chain was active
257 bool skipMonitoringThisEvent = false;
258 if (seededChains.size() <= 2) {
259 const bool costChain = seededChains.count(TrigConf::HLTUtils::string2hash("HLT_noalg_CostMonDS_L1All")) || seededChains.count(TrigConf::HLTUtils::string2hash("EF_noalg_CostMonDS_L1All"));
260 const bool l1Streamer = seededChains.count(TrigConf::HLTUtils::string2hash("HLT_noalg_L1All")) || seededChains.count(TrigConf::HLTUtils::string2hash("EF_noalg_L1All"));
261 if ((seededChains.size() == 1 && costChain) || (seededChains.size() == 2 && costChain && l1Streamer) ){
262 skipMonitoringThisEvent = true;
263 }
264 }
265
266 for (auto id : seededChains){
267 TrigCompositeUtils::AlgToChainTool::ChainInfo chainInfo;
268 ATH_CHECK(m_algToChainTool->getChainInfo(context, id, chainInfo));
269 seededChainsInfo.push_back(std::move(chainInfo));
270 }
271
272 const uint32_t onlineSlot = getOnlineSlot( costDataHandle.get() );
273 CostData costData;
274 ATH_CHECK( costData.set(costDataHandle.get(), onlineSlot) );
275 costData.setChainToAlgMap(chainToAlgIdx);
276 costData.setChainToUniqAlgMap(chainToUniqAlgs);
277 costData.setSequencersMap(seqToAlgIdx);
278 costData.setSeededChains(seededChainsInfo);
279 costData.setLb( context.eventID().lumi_block() );
280 costData.setTypeMap( m_algTypeMap );
281 if (!m_enhancedBiasTool.name().empty() && !m_enhancedBiasTool->isMC()) {
282 double liveTime = m_enhancedBiasTool->getEBLiveTime(context);
283 bool liveTimeIsPerEvent = true;
284 if (liveTime == 0.0) { // Note: This comes from a direct "return 0.", hence no delta
285 liveTime = m_enhancedBiasTool->getLBLength(context);
286 liveTimeIsPerEvent = false;
287 }
288 costData.setLivetime( liveTime, liveTimeIsPerEvent );
289 }
290
291 ATH_CHECK( range->newEvent( costData, getWeight(context), skipMonitoringThisEvent ) );
292
293 if (checkDoFullEventDump(context, costData)) {
294 ATH_CHECK( dumpEvent(context) );
295 }
296
297 return StatusCode::SUCCESS;
298}
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
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
void setTypeMap(const std::unordered_map< uint32_t, std::string > &typeMap)
Set internal type map pointer.
Definition CostData.cxx:102
void setChainToAlgMap(const std::map< std::string, std::set< size_t > > &algToChains)
Set the alg name to chains map.
Definition CostData.cxx:106
void setSeededChains(const std::vector< TrigCompositeUtils::AlgToChainTool::ChainInfo > &seededChains)
Set the seeded chains set.
Definition CostData.cxx:135
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
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 setChainToUniqAlgMap(const std::map< std::string, std::set< size_t > > &algToChains)
Set the chain to its unique alg names map.
Definition CostData.cxx:110
uint32_t getOnlineSlot(const xAOD::TrigCompositeContainer *costCollection) const
Return the slot used to process the event online.
Gaudi::Property< std::set< std::string > > m_excludeAlgsFromChain
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_metadataDataKey
ToolHandle< IEnhancedBiasWeighter > m_enhancedBiasTool
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.
ToolHandle< TrigCompositeUtils::AlgToChainTool > m_algToChainTool
StatusCode dumpEvent(const EventContext &context) const
Dump event algorithm execution data in ASCII format.
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.
setScaleOne setStatusOne setSaturated int16_t

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode TrigCostAnalysis::finalize ( )
finalvirtual

Currently a noop for this algorithm.

Definition at line 458 of file TrigCostAnalysis.cxx.

458 {
459 ATH_MSG_VERBOSE("In finalize()");
460
462 return StatusCode::SUCCESS;
463}
#define ATH_MSG_VERBOSE(x,...)
void writeMetadata()
Write to outpute tree (if any) the metadata needed downstream.

◆ getOnlineSlot()

uint32_t TrigCostAnalysis::getOnlineSlot ( const xAOD::TrigCompositeContainer * costCollection) const
private

Return the slot used to process the event online.

Parameters
[in]costCollectionCost data.
Returns
Oneline slot number..

Definition at line 400 of file TrigCostAnalysis.cxx.

400 {
401 // Online, Slot 0 can be configured as the master-slot. In this mode, events in Slot 0
402 // hoover up data about algorithm executions in other slots too.
403 // This all-slots data stored in the master slot is exploited by dumpEvent, and some specialist monitors.
404 // Other monitors will want to avoid it for fear of double-counting
405 if (costCollection->size() == 0) {
406 return 0;
407 }
408 const uint32_t initialSlot = costCollection->at(0)->getDetail<uint32_t>("slot");
409 for ( const xAOD::TrigComposite* tc : *costCollection ) {
410 const uint32_t algSlot = tc->getDetail<uint32_t>("slot");
411 if (algSlot == 0 or algSlot != initialSlot) {
412 return 0; // If we see a zero, or two different slot numbers, then we're in the master slot
413 }
414 }
415 // If we saw exclusivly one non-zero slot, then we're in that slot
416 return initialSlot;
417}
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.

◆ getRange()

StatusCode TrigCostAnalysis::getRange ( const EventContext & context,
MonitoredRange *& range )
private

Return or construct and return a Range for the Context.

Might return nullptr range.

Parameters
[in]contextEvent context.
[out]rangeReference to a mutable range ptr. Will be set to point to the Range. If range does not exist it will be created unless the maximum number of ranges has been reached. If this happens, range will be set to nullptr.

Definition at line 354 of file TrigCostAnalysis.cxx.

355{
356 range = nullptr;
357 constexpr bool includeEndOfLB = false;
358
359 std::string rangeName;
360 if (m_singleTimeRange) {
361 rangeName = m_singleTimeRangeName;
362 } else {
363 const auto lumiBlock = context.eventID().lumi_block();
364 const size_t start = lumiBlock - (lumiBlock % m_TimeRangeLengthLB);
365 const size_t stop = start + m_TimeRangeLengthLB - 1;
366
367 if (includeEndOfLB && stop != start) {
368 rangeName = std::format("LumiBlock_{:05}_{}", start, stop);
369 } else {
370 rangeName = std::format("LumiBlock_{:05}", start);
371 }
372 }
373
374 // Fast path — range already exists
375 if (auto it = m_monitoredRanges.find(rangeName); it != m_monitoredRanges.end()) {
376 range = it->second.get();
377 return StatusCode::SUCCESS;
378 }
379
380 // We don't have this range yet — check if we are allowed to create more
381 if (m_monitoredRanges.size() >= m_maxTimeRange) {
382 return StatusCode::SUCCESS; // range stays nullptr
383 }
384
385 auto [it, inserted] = m_monitoredRanges.try_emplace(
386 rangeName,
387 std::make_unique<MonitoredRange>(rangeName, this)
388 );
389
390 if (!inserted) {
391 range = it->second.get();
392 return StatusCode::SUCCESS;
393 }
394
395 ATH_CHECK(registerMonitors(it->second.get()));
396 range = it->second.get();
397 return StatusCode::SUCCESS;
398}
std::unordered_map< std::string, std::unique_ptr< MonitoredRange > > m_monitoredRanges
Owned storage of Ranges.
Gaudi::Property< bool > m_singleTimeRange
Gaudi::Property< size_t > m_maxTimeRange
StatusCode registerMonitors(MonitoredRange *range)
Populate a newly minted Range object with all configured Monitors.
Gaudi::Property< size_t > m_TimeRangeLengthLB
Gaudi::Property< std::string > m_singleTimeRangeName
setTeId lumiBlock

◆ getWeight()

float TrigCostAnalysis::getWeight ( const EventContext & context)
private

Compute global event weight to correct for online prescales.

Parameters
[in]contextEvent context.
Returns
Global event weight.

Definition at line 158 of file TrigCostAnalysis.cxx.

158 {
159 // TODO Prescale of CostMon chain for P1
160 double ebWeight = 1.0;
161 if (m_useEBWeights) {
162 ebWeight = m_enhancedBiasTool->getEBWeight(context);
163 ATH_MSG_DEBUG("EB Weight is " << ebWeight);
164 }
165 return m_baseEventWeight * ebWeight;
166}
Gaudi::Property< bool > m_useEBWeights
Gaudi::Property< float > m_baseEventWeight

◆ initialize()

StatusCode TrigCostAnalysis::initialize ( )
finalvirtual

Retrieve tools and initialise read handles.

Definition at line 32 of file TrigCostAnalysis.cxx.

32 {
33 ATH_MSG_VERBOSE("In initialize()");
34
35 ATH_MSG_DEBUG("Reading from " << m_costDataKey.key() << ", " << m_HLTMenuKey.key());
36 ATH_CHECK( m_costDataKey.initialize() );
37 ATH_CHECK( m_HLTMenuKey.initialize() );
38
40
41
42 if (!m_enhancedBiasTool.name().empty()) {
43 ATH_CHECK( m_enhancedBiasTool.retrieve() );
44 } else {
45 ATH_MSG_DEBUG("No EnhancedBiasTool. Not doing additional weighting.");
46 if (m_useEBWeights) {
47 ATH_MSG_FATAL("Configured to use Enhanced Bias weights. Must supply weighting tool.");
48 return StatusCode::FAILURE;
49 }
50 }
51
53
54 if (not m_additionalHashMap.empty()) {
55 std::string hashFile = PathResolverFindCalibFile( m_additionalHashMap );
56 if (hashFile.empty()) {
57 ATH_MSG_WARNING("Could not retrieve " << m_additionalHashMap << ", won't load additional hash maps.");
58 } else {
60 }
61 }
62
63 ATH_CHECK( m_histSvc->regTree("/COSTSTREAM/metadata", std::make_unique<TTree>("metadata", "metadata")) );
64 ATH_CHECK( m_histSvc->getTree("/COSTSTREAM/metadata", m_metadataTree) );
65
66 return StatusCode::SUCCESS;
67}
#define ATH_MSG_FATAL(x,...)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
static void file2hashes(const std::string &fileName="hashes2string.txt")
debugging output of internal dictionary
Gaudi::Property< std::string > m_additionalHashMap
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ registerMonitors()

StatusCode TrigCostAnalysis::registerMonitors ( MonitoredRange * range)
private

Populate a newly minted Range object with all configured Monitors.

Parameters
[in]rangeMutable ptr to new Range object which is to be populated.

Definition at line 313 of file TrigCostAnalysis.cxx.

313 {
314 ATH_CHECK(range != nullptr);
316 ATH_CHECK( range->addMonitor(std::make_unique<MonitorAlgorithm>("Algorithm_HLT", range)) );
317 ATH_MSG_DEBUG("Registering Algorithm_HLT Monitor for range " << range->getName() << ". Size:" << range->getMonitors().size());
318 }
320 ATH_CHECK( range->addMonitor(std::make_unique<MonitorAlgorithmClass>("Algorithm_Class_HLT", range)) );
321 ATH_MSG_DEBUG("Registering Algorithm_Class_HLT Monitor for range " << range->getName() << ". Size:" << range->getMonitors().size());
322 }
323 if (m_doMonitorGlobal) {
324 ATH_CHECK( range->addMonitor(std::make_unique<MonitorGlobal>("Global_HLT", range)) );
325 ATH_MSG_DEBUG("Registering Global_HLT Monitor for range " << range->getName() << ". Size:" << range->getMonitors().size());
326 }
328 ATH_CHECK( range->addMonitor(std::make_unique<MonitorThreadOccupancy>("Thread_Occupancy_HLT", range)) );
329 ATH_MSG_DEBUG("Registering Thread_Occupancy_HLT Monitor for range " << range->getName() << ". Size:" << range->getMonitors().size());
330 }
331 if (m_doMonitorChain) {
332 ATH_CHECK( range->addMonitor(std::make_unique<MonitorChain>("Chain_HLT", range)) );
333 ATH_MSG_DEBUG("Registering Chain_HLT Monitor for range " << range->getName() << ". Size:" << range->getMonitors().size());
334 }
336 ATH_CHECK( range->addMonitor(std::make_unique<MonitorChainAlgorithm>("Chain_Algorithm_HLT", range)) );
337 ATH_MSG_DEBUG("Registering Chain_Algorihtm_HLT Monitor for range " << range->getName() << ". Size:" << range->getMonitors().size());
338 }
340 ATH_CHECK( range->addMonitor(std::make_unique<MonitorSequence>("Sequence_HLT", range)) );
341 ATH_MSG_DEBUG("Registering Sequence_HLT Monitor for range " << range->getName() << ". Size:" << range->getMonitors().size());
342 }
343 // if (m_do...) {}
344
345 // Set the verbosity for the monitors
346 for (const std::unique_ptr<MonitorBase>& monitor : range->getMonitors()){
347 monitor->msg().setLevel(msg().level());
348 }
349
350 return StatusCode::SUCCESS;
351}
Gaudi::Property< bool > m_doMonitorAlgorithm
Gaudi::Property< bool > m_doMonitorChainAlgorithm
Gaudi::Property< bool > m_doMonitorSequence
Gaudi::Property< bool > m_doMonitorThreadOccupancy
Gaudi::Property< bool > m_doMonitorGlobal
Gaudi::Property< bool > m_doMonitorChain
Gaudi::Property< bool > m_doMonitorAlgorithmClass

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ start()

StatusCode TrigCostAnalysis::start ( )
virtual

Retrieve menu handle.

Definition at line 69 of file TrigCostAnalysis.cxx.

69 {
70 SG::ReadHandle<TrigConf::HLTMenu> hltMenuHandle = SG::makeHandle( m_HLTMenuKey );
71 ATH_CHECK( hltMenuHandle.isValid() );
72 ATH_MSG_INFO("Configuring from " << m_HLTMenuKey << " with " << hltMenuHandle->size() << " chains");
73 using boost::property_tree::ptree;
74
75 // Populate the reverse-hashing dictionary with all ALG NAMES.
76 // Obtain a mapping from NAME to TYPE from the configuration JSON
77 m_storeIdentifiers.clear();
78 const ptree& menuData = hltMenuHandle->data();
79 for (const auto& sequencer : menuData.get_child("sequencers")) {
80 ATH_MSG_VERBOSE("Found Sequencer:" << sequencer.first);
81 for (const auto& alg : sequencer.second) {
82 // Data stored in Gaudi format of "AlgClassType/AlgInstanceName"
83 size_t breakPoint = alg.second.data().find('/');
84 std::string algType = alg.second.data().substr(0, breakPoint);
85 std::string algName = alg.second.data().substr(breakPoint+1, alg.second.data().size());
86 std::replace(algType.begin(), algType.end(), ':', '_');
87 std::replace(algName.begin(), algName.end(), ':', '_');
89 ATH_MSG_VERBOSE("AlgType:" << algType << ", AlgName:" << algName );
90 if (algType.find("EventViewCreatorAlgorithm") != std::string::npos) {
91 ATH_MSG_VERBOSE(algType << " is identified as a ViewCreator");
92 m_storeIdentifiers.insert(std::move(algName));
93 }
94 }
95 }
96
97 // Call TrigConf::HLTUtils::string2hash(chain.name()) for all the chains to cache the hash to name mapping
98 std::vector<TrigConf::Chain> chains;
99 ATH_CHECK( m_algToChainTool->getAllChains(chains));
100 for (const TrigConf::Chain& chain : chains) {
101 HLT::Identifier(chain.name());
103
104 // Populate legs' names
105 const size_t legsSize {chain.legMultiplicities().size()};
106 for (size_t counter = 0; legsSize > 1 && counter < legsSize; ++counter){
107 HLT::Identifier l = TrigCompositeUtils::createLegName(chain.namehash(), counter);
109 }
110 }
111
112 // Save identifiers and classes for additional HLTJobOptions map
113 if (not m_additionalHashList.empty()){
114 for (const std::string& entry : m_additionalHashList){
115 size_t breakPoint = entry.find('/');
116 if (breakPoint != std::string::npos){
117 std::string algType = entry.substr(0, breakPoint);
118 const std::string algName = entry.substr(breakPoint+1, entry.size());
119 std::replace(algType.begin(), algType.end(), ':', '_');
120 m_algTypeMap[ TrigConf::HLTUtils::string2hash(algName, "ALG") ] = std::move(algType);
121 } else {
123 }
124 }
125 }
126
127 // As an initial guess, 25 should be a good uper maximum for the number of expected View instances.
129 return StatusCode::SUCCESS;
130}
#define ATH_MSG_INFO(x,...)
boost::property_tree::ptree ptree
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Gaudi::Property< std::vector< std::string > > m_additionalHashList
StatusCode checkUpdateMaxView(const size_t max)
High watermark for pre-cached string hashes for the SLOT category.
l
Printing final latex table to .tex output file.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
HLT::Identifier createLegName(const HLT::Identifier &chainIdentifier, size_t counter)
Generate the HLT::Identifier which corresponds to a specific leg of a given chain.

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x,...)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

◆ writeMetadata()

void TrigCostAnalysis::writeMetadata ( )
private

Write to outpute tree (if any) the metadata needed downstream.

Definition at line 466 of file TrigCostAnalysis.cxx.

466 {
467 if (!m_metadataTree) {
468 return;
469 }
470
471 auto runNumber = m_enhancedBiasTool->getRunNumber();
472 m_metadataTree->Branch("runNumber", &runNumber);
473
474 std::string hostnamesList = "";
475 if (m_hostnames.size() > 1){
476 ATH_MSG_DEBUG("Found many hostnames for this run");
477 for (const auto& name : m_hostnames) hostnamesList += name + ",";
478 hostnamesList.pop_back();
479 } else if (m_hostnames.size() == 1) {
480 hostnamesList = *m_hostnames.begin();
481 }
482 m_metadataTree->Branch("hostname", &hostnamesList);
483
484 SG::ReadHandle<TrigConf::HLTMenu> hltMenuHandle = SG::makeHandle( m_HLTMenuKey );
485 std::string menuStr;
486 if ( hltMenuHandle.isValid() ){
487 std::stringstream ss;
488 boost::property_tree::json_parser::write_json(ss, hltMenuHandle->data());
489 menuStr = ss.str();
490 m_metadataTree->Branch("HLTMenu", &menuStr);
491 }
492
493 bool ChainMonitor = m_doMonitorChain;
494 bool ChainAlgorithmMonitor = m_doMonitorChainAlgorithm;
495 bool AlgorithmMonitor = m_doMonitorAlgorithm;
496 bool AlgorithmClassMonitor = m_doMonitorAlgorithmClass;
497 bool GlobalsMonitor = m_doMonitorGlobal;
498 bool ThreadMonitor = m_doMonitorThreadOccupancy;
499
500 m_metadataTree->Branch("ChainMonitor", &ChainMonitor);
501 m_metadataTree->Branch("ChainAlgorithmMonitor", &ChainAlgorithmMonitor);
502 m_metadataTree->Branch("AlgorithmMonitor", &AlgorithmMonitor);
503 m_metadataTree->Branch("AlgorithmClassMonitor", &AlgorithmClassMonitor);
504 m_metadataTree->Branch("GlobalsMonitor", &GlobalsMonitor);
505 m_metadataTree->Branch("ThreadMonitor", &ThreadMonitor);
506
507 float BaseEventWeight = m_baseEventWeight;
508 std::string AdditionalHashMap = m_additionalHashMap;
509 bool DoEBWeighting = m_useEBWeights;
510
511 m_metadataTree->Branch("AdditionalHashMap", &AdditionalHashMap);
512 m_metadataTree->Branch("DoEBWeighting", &DoEBWeighting);
513 m_metadataTree->Branch("BaseEventWeight", &BaseEventWeight);
514
515 std::string atlasProject = std::getenv("AtlasProject");
516 std::string atlasVersion = std::getenv("AtlasVersion");
517 m_metadataTree->Branch("AtlasProject", &atlasProject);
518 m_metadataTree->Branch("AtlasVersion", &atlasVersion);
519
520
521 std::string processedRanges;
523 processedRanges = m_singleTimeRangeName;
524 }
525 else {
526 std::stringstream ss;
527 for(const auto& rangePair : m_monitoredRanges){
528 ss << rangePair.first << ": ";
529 std::string lbrange = rangePair.first.substr(strlen("LumiBlock_"));
530 ss << " Lumiblocks " << std::stoi(lbrange) << " to " << std::stoi(lbrange) + m_TimeRangeLengthLB << ", ";
531 }
532 processedRanges = ss.str();
533 ATH_MSG_INFO("Processed ranges: " << processedRanges);
534 }
535
536 m_metadataTree->Branch("ProcessedRanges", &processedRanges);
537
538 m_metadataTree->Fill();
539}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::set<std::string> m_hostnames TrigCostAnalysis::ATLAS_THREAD_SAFE
mutableprivate

Save unique hostnames for the run.

Definition at line 213 of file TrigCostAnalysis.h.

◆ m_addHostnameMutex

std::mutex TrigCostAnalysis::m_addHostnameMutex
private

Mutex to update set below.

Definition at line 212 of file TrigCostAnalysis.h.

◆ m_additionalHashList

Gaudi::Property<std::vector<std::string> > TrigCostAnalysis::m_additionalHashList
Initial value:
{ this, "AdditionalHashList", {},
"Used to load strings corresponding to algorithms which are not explicitly scheduled by chains." }

Definition at line 89 of file TrigCostAnalysis.h.

89 { this, "AdditionalHashList", {},
90 "Used to load strings corresponding to algorithms which are not explicitly scheduled by chains." };

◆ m_additionalHashMap

Gaudi::Property<std::string> TrigCostAnalysis::m_additionalHashMap
Initial value:
{ this, "AdditionalHashMap", "TrigCostRootAnalysis/hashes2string_29042021.txt",
"Used to load strings corresponding to algorithms which are not explicitly scheduled by chains. To be updated periodically." }

Definition at line 86 of file TrigCostAnalysis.h.

86 { this, "AdditionalHashMap", "TrigCostRootAnalysis/hashes2string_29042021.txt",
87 "Used to load strings corresponding to algorithms which are not explicitly scheduled by chains. To be updated periodically." };

◆ m_algToChainTool

ToolHandle<TrigCompositeUtils::AlgToChainTool> TrigCostAnalysis::m_algToChainTool
Initial value:
{this, "AlgToChainTool", "",
"Tool to retrieve chains for algorithm."}

Definition at line 146 of file TrigCostAnalysis.h.

146 {this, "AlgToChainTool", "",
147 "Tool to retrieve chains for algorithm."};

◆ m_algTypeMap

std::unordered_map<uint32_t, std::string > TrigCostAnalysis::m_algTypeMap
private

Cache of algorithm's type, read from configuration data.

Definition at line 206 of file TrigCostAnalysis.h.

◆ m_baseEventWeight

Gaudi::Property<float> TrigCostAnalysis::m_baseEventWeight
Initial value:
{ this, "BaseEventWeight", true,
"Base events weight, other weights may be multiplied on top of this one." }

Definition at line 128 of file TrigCostAnalysis.h.

128 { this, "BaseEventWeight", true,
129 "Base events weight, other weights may be multiplied on top of this one." };

◆ m_costDataKey

SG::ReadHandleKey<xAOD::TrigCompositeContainer> TrigCostAnalysis::m_costDataKey
Initial value:
{ this, "CostReadHandleKey", "HLT_TrigCostContainer",
"Trigger cost payload container for algorithms" }

Definition at line 134 of file TrigCostAnalysis.h.

134 { this, "CostReadHandleKey", "HLT_TrigCostContainer",
135 "Trigger cost payload container for algorithms" };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_doMonitorAlgorithm

Gaudi::Property<bool> TrigCostAnalysis::m_doMonitorAlgorithm
Initial value:
{ this, "DoMonitorAlgs", true,
"Monitor individual algorithms by instance name" }

Definition at line 98 of file TrigCostAnalysis.h.

98 { this, "DoMonitorAlgs", true,
99 "Monitor individual algorithms by instance name" };

◆ m_doMonitorAlgorithmClass

Gaudi::Property<bool> TrigCostAnalysis::m_doMonitorAlgorithmClass
Initial value:
{ this, "DoMonitorAlgClass", true,
"Monitor individual algorithms by instance class type name" }

Definition at line 101 of file TrigCostAnalysis.h.

101 { this, "DoMonitorAlgClass", true,
102 "Monitor individual algorithms by instance class type name" };

◆ m_doMonitorChain

Gaudi::Property<bool> TrigCostAnalysis::m_doMonitorChain
Initial value:
{ this, "DoMonitorChain", true,
"Monitor individual chains by instance name" }

Definition at line 110 of file TrigCostAnalysis.h.

110 { this, "DoMonitorChain", true,
111 "Monitor individual chains by instance name" };

◆ m_doMonitorChainAlgorithm

Gaudi::Property<bool> TrigCostAnalysis::m_doMonitorChainAlgorithm
Initial value:
{ this, "DoMonitorChainAlgorithm", false,
"Monitor algorithms associated with chains by instance name" }

Definition at line 113 of file TrigCostAnalysis.h.

113 { this, "DoMonitorChainAlgorithm", false,
114 "Monitor algorithms associated with chains by instance name" };

◆ m_doMonitorGlobal

Gaudi::Property<bool> TrigCostAnalysis::m_doMonitorGlobal
Initial value:
{ this, "DoMonitorGlobal", true,
"Monitor global event properties" }

Definition at line 104 of file TrigCostAnalysis.h.

104 { this, "DoMonitorGlobal", true,
105 "Monitor global event properties" };

◆ m_doMonitorSequence

Gaudi::Property<bool> TrigCostAnalysis::m_doMonitorSequence
Initial value:
{ this, "DoMonitorSequence", true,
"Monitor individual sequences by name" }

Definition at line 116 of file TrigCostAnalysis.h.

116 { this, "DoMonitorSequence", true,
117 "Monitor individual sequences by name" };

◆ m_doMonitorThreadOccupancy

Gaudi::Property<bool> TrigCostAnalysis::m_doMonitorThreadOccupancy
Initial value:
{ this, "DoMonitorThreadOccupancy", true,
"Monitor algorithm occupancy load of individual threads in an MT execution environment" }

Definition at line 107 of file TrigCostAnalysis.h.

107 { this, "DoMonitorThreadOccupancy", true,
108 "Monitor algorithm occupancy load of individual threads in an MT execution environment" };

◆ m_enhancedBiasTool

ToolHandle<IEnhancedBiasWeighter> TrigCostAnalysis::m_enhancedBiasTool
Initial value:
{this, "EnhancedBiasTool", "",
"Enhanced bias weighting tool."}

Definition at line 143 of file TrigCostAnalysis.h.

143 {this, "EnhancedBiasTool", "",
144 "Enhanced bias weighting tool."};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_excludeAlgsFromChain

Gaudi::Property<std::set<std::string> > TrigCostAnalysis::m_excludeAlgsFromChain
Initial value:
{
this, "ExcludeAlgsFromChainTime", {}, "Algorithms to exclude from chain time calculation"}

Definition at line 131 of file TrigCostAnalysis.h.

131 {
132 this, "ExcludeAlgsFromChainTime", {}, "Algorithms to exclude from chain time calculation"};

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fullEventDumpProbability

Gaudi::Property<uint64_t> TrigCostAnalysis::m_fullEventDumpProbability
Initial value:
{ this, "FullEventDumpProbability", 10,
"Save a full record of one in every N events, up to MaxFullEventDumps." }

Definition at line 125 of file TrigCostAnalysis.h.

125 { this, "FullEventDumpProbability", 10,
126 "Save a full record of one in every N events, up to MaxFullEventDumps." };

◆ m_fullEventDumps

std::atomic<size_t> TrigCostAnalysis::m_fullEventDumps
mutableprivate

Counter to keep track of how many events have been full-dumped.

Definition at line 210 of file TrigCostAnalysis.h.

◆ m_histSvc

ServiceHandle<ITHistSvc> TrigCostAnalysis::m_histSvc { this, "THistSvc", "THistSvc/THistSvc", "Histogramming svc" }

Definition at line 78 of file TrigCostAnalysis.h.

78{ this, "THistSvc", "THistSvc/THistSvc", "Histogramming svc" };

◆ m_HLTMenuKey

SG::ReadHandleKey<TrigConf::HLTMenu> TrigCostAnalysis::m_HLTMenuKey
Initial value:
{this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu",
"HLT Menu"}

Definition at line 140 of file TrigCostAnalysis.h.

140 {this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu",
141 "HLT Menu"};

◆ m_maxFullEventDumps

Gaudi::Property<size_t> TrigCostAnalysis::m_maxFullEventDumps
Initial value:
{ this, "MaxFullEventDumps", 10,
"Maximum number of full event summaries which will be dumped" }

Definition at line 122 of file TrigCostAnalysis.h.

122 { this, "MaxFullEventDumps", 10,
123 "Maximum number of full event summaries which will be dumped" };

◆ m_maxTimeRange

Gaudi::Property<size_t> TrigCostAnalysis::m_maxTimeRange
Initial value:
{ this, "MaxTimeRanges", 5,
"Maximum number of allowed time ranges" }

Definition at line 95 of file TrigCostAnalysis.h.

95 { this, "MaxTimeRanges", 5,
96 "Maximum number of allowed time ranges" };

◆ m_maxViewsNumber

std::atomic<size_t> TrigCostAnalysis::m_maxViewsNumber
mutableprivate

What is the maximum number of View instances we've so far cached string hashes to cover?

Definition at line 211 of file TrigCostAnalysis.h.

◆ m_metadataDataKey

SG::ReadHandleKey<xAOD::TrigCompositeContainer> TrigCostAnalysis::m_metadataDataKey
Initial value:
{ this, "CostMetadataWriteHandleKey", "HLT_RuntimeMetadata",
"TrigComposite collections with additional cost metadata" }

Definition at line 137 of file TrigCostAnalysis.h.

137 { this, "CostMetadataWriteHandleKey", "HLT_RuntimeMetadata",
138 "TrigComposite collections with additional cost metadata" };

◆ m_metadataTree

TTree* TrigCostAnalysis::m_metadataTree
private

Used to write out some metadata needed by post-processing (e.g.

bunchgroup, lumi)

Definition at line 208 of file TrigCostAnalysis.h.

◆ m_monitoredRanges

std::unordered_map<std::string, std::unique_ptr<MonitoredRange> > TrigCostAnalysis::m_monitoredRanges
private

Owned storage of Ranges.

Keyed on Range name.

Definition at line 205 of file TrigCostAnalysis.h.

◆ m_singleTimeRange

Gaudi::Property<bool> TrigCostAnalysis::m_singleTimeRange
Initial value:
{ this, "UseSingleTimeRange", false,
"Use a single time range rather than splitting by LB" }

Definition at line 80 of file TrigCostAnalysis.h.

80 { this, "UseSingleTimeRange", false,
81 "Use a single time range rather than splitting by LB" };

◆ m_singleTimeRangeName

Gaudi::Property<std::string> TrigCostAnalysis::m_singleTimeRangeName
Initial value:
{ this, "SingleTimeRangeName", "All",
"Name for single time range" }

Definition at line 83 of file TrigCostAnalysis.h.

83 { this, "SingleTimeRangeName", "All",
84 "Name for single time range" };

◆ m_storeIdentifiers

std::set<std::string> TrigCostAnalysis::m_storeIdentifiers
private

Identifiers of object stores, needed to cache STORE string-hash values.

Definition at line 207 of file TrigCostAnalysis.h.

◆ m_TimeRangeLengthLB

Gaudi::Property<size_t> TrigCostAnalysis::m_TimeRangeLengthLB
Initial value:
{ this, "TimeRangeLengthLB", 50,
"Length of each variable length Time Range in LB" }

Definition at line 92 of file TrigCostAnalysis.h.

92 { this, "TimeRangeLengthLB", 50,
93 "Length of each variable length Time Range in LB" };

◆ m_useEBWeights

Gaudi::Property<bool> TrigCostAnalysis::m_useEBWeights
Initial value:
{ this, "UseEBWeights", true,
"Apply Enhanced Bias weights" }

Definition at line 119 of file TrigCostAnalysis.h.

119 { this, "UseEBWeights", true,
120 "Apply Enhanced Bias weights" };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: