ATLAS Offline Software
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 
11 TrigCostAuditor::TrigCostAuditor(const std::string& name, ISvcLocator* pSvcLocator) :
12 Auditor(name, pSvcLocator),
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 
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 
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_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
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
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArPulseShapeRunConfig.Execute
Execute
Definition: LArPulseShapeRunConfig.py:62
TrigCostAuditor::initialize
virtual StatusCode initialize() override
Initialise auditor.
Definition: TrigCostAuditor.cxx:20
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigCostAuditor::m_trigCostSvcHandle
ServiceHandle< ITrigCostSvc > m_trigCostSvcHandle
Definition: TrigCostAuditor.h:76
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TrigCostSvc.h
TrigCostAuditor.h
TrigCostAuditor::TrigCostAuditor
TrigCostAuditor(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi Auditor constructor.
Definition: TrigCostAuditor.cxx:11
ITrigCostSvc::AuditType
AuditType
Disambiguation enum for the start or the end of an algorithm's execution.
Definition: ITrigCostSvc.h:36
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::finalize
virtual StatusCode finalize() override
Does nothing.
Definition: TrigCostAuditor.cxx:28