ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigMonitoring
TrigCostMonitor
src
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
5
#include "
TrigCostMonitor/TrigCostAuditor.h
"
6
#include "
TrigCostSvc.h
"
7
8
10
11
TrigCostAuditor::TrigCostAuditor
(
const
std::string& name, ISvcLocator* pSvcLocator) :
12
Auditor(name, pSvcLocator),
13
AthMessaging
(msgSvc(), name)
14
{
15
ATH_MSG_DEBUG
(
"TrigCostAuditor constructor"
);
16
}
17
18
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
19
20
StatusCode
TrigCostAuditor::initialize
(){
21
ATH_MSG_DEBUG
(
"TrigCostAuditor initialize()"
);
22
ATH_CHECK
(
m_trigCostSvcHandle
.retrieve() );
23
return
StatusCode::SUCCESS;
24
}
25
26
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
27
28
StatusCode
TrigCostAuditor::finalize
() {
29
ATH_MSG_DEBUG
(
"TrigCostAuditor finalize()"
);
30
return
StatusCode::SUCCESS;
31
}
32
33
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
34
35
void
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);
39
callService
(caller,
ITrigCostSvc::AuditType::Before
, ctx);
40
41
}
42
43
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
44
45
void
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
);
49
callService
(caller,
ITrigCostSvc::AuditType::After
, ctx);
50
}
51
52
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
53
54
void
TrigCostAuditor::callService
(
const
std::string& caller,
ITrigCostSvc::AuditType
type
,
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
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
TrigCostAuditor.h
TrigCostSvc.h
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
ITrigCostSvc::AuditType
AuditType
Disambiguation enum for the start or the end of an algorithm's execution.
Definition
ITrigCostSvc.h:36
ITrigCostSvc::Before
@ Before
Definition
ITrigCostSvc.h:36
ITrigCostSvc::After
@ After
Definition
ITrigCostSvc.h:36
TrigCostAuditor::finalize
virtual StatusCode finalize() override
Does nothing.
Definition
TrigCostAuditor.cxx:28
TrigCostAuditor::initialize
virtual StatusCode initialize() override
Initialise auditor.
Definition
TrigCostAuditor.cxx:20
TrigCostAuditor::before
virtual void before(const std::string &event, const std::string &caller, const EventContext &ctx) override
Audit before an algorithm standard event type is called.
Definition
TrigCostAuditor.cxx:35
TrigCostAuditor::after
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.
Definition
TrigCostAuditor.cxx:45
TrigCostAuditor::callService
void callService(const std::string &caller, ITrigCostSvc::AuditType type, const EventContext &ctx)
Performs internal call to the trigger cost service.
Definition
TrigCostAuditor.cxx:54
TrigCostAuditor::TrigCostAuditor
TrigCostAuditor(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi Auditor constructor.
Definition
TrigCostAuditor.cxx:11
TrigCostAuditor::m_trigCostSvcHandle
ServiceHandle< ITrigCostSvc > m_trigCostSvcHandle
Definition
TrigCostAuditor.h:76
type
Generated on
for ATLAS Offline Software by
1.17.0