ATLAS Offline Software
Loading...
Searching...
No Matches
AthAlgorithm.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// AthAlgorithm.h
6// Header file for class AthAlgorithm
7// Author: S.Binet<binet@cern.ch>
9#ifndef ATHENABASECOMPS_ATHALGORITHM_H
10#define ATHENABASECOMPS_ATHALGORITHM_H 1
11
12// STL includes
13#include <string>
14#include <type_traits>
15
16
17// Framework includes
22#include "Gaudi/Algorithm.h"
23
24class EventContext;
25
50
52 : public AthCommonDataStore<AthCommonMsg< Gaudi::Algorithm >>
53{
54 public:
55
57 AthAlgorithm(const std::string& name, ISvcLocator* pSvcLocator);
58
60 virtual ~AthAlgorithm();
61
67 virtual StatusCode sysInitialize() override;
68
69#pragma GCC diagnostic push
70#pragma GCC diagnostic ignored "-Woverloaded-virtual"
71
77 virtual StatusCode execute(const EventContext& ctx) = 0;
78
79 private:
80 // This is the base-class execute method that gets called by the scheduler.
81 virtual StatusCode execute ( const EventContext& ctx ) const override final {
82 // "Thread-safe" because scheduler ensures algorithm never gets called concurrently.
83 auto nc_this ATLAS_THREAD_SAFE = const_cast<AthAlgorithm*>( this );
84 return nc_this->execute( ctx );
85 }
86
87#pragma GCC diagnostic pop
88
89 public:
90
97 virtual const DataObjIDColl& extraOutputDeps() const override;
98
100
101 const EventContext& getContext() const;
102 bool filterPassed() const;
103 void setFilterPassed(bool state) const;
105
106 bool filterPassed(const EventContext& ctx) const;
107 void setFilterPassed( bool state, const EventContext& ctx ) const;
108
109 protected:
111 virtual bool isReEntrant() const override final { return false; }
112
113 private:
115
116};
117
118#endif //> !ATHENABASECOMPS_ATHALGORITHM_H
Templated class that provides access to Athena event stores and ability to set data dependencies via ...
Templated class that provides backwards compatibility for legacy MsgService manipulation methods.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
const EventContext & getContext() const
Deprecated methods (use the ones with EventContext).
virtual StatusCode execute(const EventContext &ctx) const override final
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
DataObjIDColl m_extendedExtraObjects
void setFilterPassed(bool state) const
virtual bool isReEntrant() const override final
Legacy algorithms are not thread-safe.
virtual StatusCode execute(const EventContext &ctx)=0
Execute method.
virtual StatusCode sysInitialize() override
Override sysInitialize.
bool filterPassed() const
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
virtual ~AthAlgorithm()
Destructor:
AthCommonDataStore(const std::string &name, T... args)