ATLAS Offline Software
TrigCostAuditor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGCOSTMONITOR_TRIGCOSTAUDITOR_H
6 #define TRIGCOSTMONITOR_TRIGCOSTAUDITOR_H 1
7 
8 #include "GaudiKernel/Auditor.h"
9 #include "GaudiKernel/ServiceHandle.h"
10 
12 
13 #include "ITrigCostSvc.h"
14 
22 class TrigCostAuditor : virtual public Auditor, public AthMessaging {
23 
24  using AthMessaging::msg;
25  using Auditor::after;
26  using Auditor::before;
27 
28  public:
29 
35  TrigCostAuditor( const std::string& name, ISvcLocator* svcloc );
36 
41  virtual StatusCode initialize() override;
42 
47  virtual StatusCode finalize() override;
48 
49 
55  virtual void before(StandardEventType evt, const std::string& caller) override;
56 
62  virtual void after(StandardEventType evt, const std::string&, const StatusCode& sc) override;
63 
67  virtual void before(StandardEventType evt, INamedInterface* caller) override;
68 
72  virtual void after(StandardEventType evt, INamedInterface* caller, const StatusCode& sc) override;
73 
74 private:
75 
81  void callService(const std::string& caller, ITrigCostSvc::AuditType type);
82 
83  ServiceHandle<ITrigCostSvc> m_trigCostSvcHandle { this, "TrigCostSvc", "TrigCostSvc",
84  "The trigger cost service to pass audit information to" };
85 
86 };
87 
88 inline void TrigCostAuditor::before(StandardEventType evt, INamedInterface* caller) {
89  return this->before(evt, caller->name());
90 }
91 
92 inline void TrigCostAuditor::after(StandardEventType evt, INamedInterface* caller, const StatusCode& sc) {
93  return this->after(evt, caller->name(), sc);
94 }
95 
96 #endif // TRIGCOSTMONITOR_TRIGCOSTAUDITOR_H
TrigCostAuditor::callService
void callService(const std::string &caller, ITrigCostSvc::AuditType type)
Performs internal call to the trigger cost service.
Definition: TrigCostAuditor.cxx:54
TrigCostAuditor
Gaudi Auditor implementation to hook algorithm executions and notify the Trigger Cost Service.
Definition: TrigCostAuditor.h:22
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TrigCostAuditor::before
virtual void before(StandardEventType evt, const std::string &caller) override
Audit before an algorithm standard event type is called.
Definition: TrigCostAuditor.cxx:37
TrigCostAuditor::initialize
virtual StatusCode initialize() override
Initialise auditor.
Definition: TrigCostAuditor.cxx:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ITrigCostSvc.h
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
TrigCostAuditor::m_trigCostSvcHandle
ServiceHandle< ITrigCostSvc > m_trigCostSvcHandle
Definition: TrigCostAuditor.h:83
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigCostAuditor::TrigCostAuditor
TrigCostAuditor(const std::string &name, ISvcLocator *svcloc)
< Inherit CustomEventType as a noop
Definition: TrigCostAuditor.cxx:13
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthMessaging.h
ITrigCostSvc::AuditType
AuditType
Disambiguation enum for the start or the end of an algorithm's execution.
Definition: ITrigCostSvc.h:36
TrigCostAuditor::after
virtual void after(StandardEventType evt, const std::string &, const StatusCode &sc) override
Audit after an algorithm standard event type is called.
Definition: TrigCostAuditor.cxx:46
TrigCostAuditor::finalize
virtual StatusCode finalize() override
Does nothing.
Definition: TrigCostAuditor.cxx:30
ServiceHandle< ITrigCostSvc >