ATLAS Offline Software
Loading...
Searching...
No Matches
TrigCostAuditor.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "TrigCostSvc.h"
7
8
10
11TrigCostAuditor::TrigCostAuditor(const std::string& name, ISvcLocator* pSvcLocator) :
12Auditor(name, pSvcLocator),
13AthMessaging(msgSvc(), name)
14{
15 ATH_MSG_DEBUG("TrigCostAuditor constructor");
16}
17
18// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
19
21 ATH_MSG_DEBUG("TrigCostAuditor initialize()");
22 ATH_CHECK( m_trigCostSvcHandle.retrieve() );
23 return StatusCode::SUCCESS;
24}
25
26// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
27
29 ATH_MSG_DEBUG("TrigCostAuditor finalize()");
30 return StatusCode::SUCCESS;
31}
32
33// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
34
35void TrigCostAuditor::before(const std::string& event, const std::string& caller,
36 const EventContext& ctx) {
37 if (event != IAuditor::Execute) return; // I only care for execution time
38 ATH_MSG_DEBUG("Before Execute: " << caller);
40
41}
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
44
45void TrigCostAuditor::after(const std::string& event, const std::string& caller,
46 const EventContext& ctx, const StatusCode& sc) {
47 if (event != IAuditor::Execute) return; // I only care for execution time
48 ATH_MSG_DEBUG("After Execute: " << caller << " " << sc);
50}
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
53
55 const EventContext& ctx) {
56 if (m_trigCostSvcHandle->processAlg(ctx, caller, type).isFailure()) {
57 ATH_MSG_FATAL("Error in TrigCostSvc called by TrigCostAuditor, auditing algorithm: " << caller);
58 throw std::runtime_error("TrigCostAuditor exception");
59 }
60}
61
62
63// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
64
65
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
AuditType
Disambiguation enum for the start or the end of an algorithm's execution.
virtual StatusCode finalize() override
Does nothing.
virtual StatusCode initialize() override
Initialise auditor.
virtual void before(const std::string &event, const std::string &caller, const EventContext &ctx) override
Audit before an algorithm standard event type is called.
virtual void after(const std::string &event, const std::string &caller, const EventContext &ctx, const StatusCode &sc) override
Audit after an algorithm standard event type is called.
void callService(const std::string &caller, ITrigCostSvc::AuditType type, const EventContext &ctx)
Performs internal call to the trigger cost service.
TrigCostAuditor(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi Auditor constructor.
ServiceHandle< ITrigCostSvc > m_trigCostSvcHandle