ATLAS Offline Software
AnaReentrantAlgorithm.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 #ifndef ANA_ALGORITHM__ANA_REENTRANT_ALGORITHM_H
9 #define ANA_ALGORITHM__ANA_REENTRANT_ALGORITHM_H
10 
11 #include <AnaAlgorithm/Global.h>
12 
13 #ifdef XAOD_STANDALONE
14 #include <AsgTools/AsgComponent.h>
15 #include <AsgTools/SgTEvent.h>
16 #include <memory>
17 #include <vector>
18 #else
21 #endif
22 
23 class EventContext;
24 class ISvcLocator;
25 
26 namespace EL
27 {
28 #ifdef XAOD_STANDALONE
29  class IWorker;
30 #endif
31 
44 
46 #ifdef XAOD_STANDALONE
47  : public asg::AsgComponent
48 #else
49  : public AthReentrantAlgorithm
50 #endif
51  {
52  //
53  // public interface
54  //
55 
66  public:
67  AnaReentrantAlgorithm (const std::string& name,
68  ISvcLocator* pSvcLocator);
69 
73  public:
74  virtual ~AnaReentrantAlgorithm() noexcept;
75 
76 
77 
78  //
79  // services interface
80  //
81 
82 #ifdef XAOD_STANDALONE
83  public:
90  IFilterWorker *filterWorker () const;
91 
92 
97  public:
98  bool filterPassed() const;
99 
103  public:
104  void setFilterPassed (bool val_filterPassed);
105 
106 
114  public:
115  IWorker *wk () const;
116 #endif
117 
118 
119 
120  //
121  // virtual interface
122  //
123 
130  protected:
132 
137  protected:
138  virtual ::StatusCode execute (const EventContext& ctx) const;
139 
145  protected:
147 
148 
149 
150  //
151  // framework interface
152  //
153 
154 #ifdef XAOD_STANDALONE
155  public:
158 
160  public:
161  ::StatusCode sysExecute (const EventContext& ctx);
162 
164  public:
165  ::StatusCode sysFinalize ();
166 
167 
189  public:
190  asg::SgTEvent *evtStore() const;
191 
197  public:
198  void setEvtStore (asg::SgTEvent *val_evtStore);
199 
205  public:
206  void setFilterWorker (IFilterWorker *val_filterWorker);
207 
213  public:
214  void setWk (IWorker *val_wk);
215 #endif
216 
217 
218 
219  //
220  // private interface
221  //
222 
223 #ifdef XAOD_STANDALONE
224  private:
226  asg::SgTEvent *m_evtStore = nullptr;
227 #endif
228 
229 #ifdef XAOD_STANDALONE
230  private:
232  IFilterWorker *m_filterWorker = nullptr;
233 #endif
234 
235 #ifdef XAOD_STANDALONE
236  private:
238  IWorker *m_wk = nullptr;
239 #endif
240  };
241 }
242 
243 #endif
EL::IFilterWorker
the interface to the filter functions in the algorithm sequence
Definition: IFilterWorker.h:27
EL::AnaReentrantAlgorithm::finalize
virtual ::StatusCode finalize()
finalize this algorithm
Definition: AnaReentrantAlgorithm.cxx:103
EL::AnaReentrantAlgorithm::execute
virtual ::StatusCode execute(const EventContext &ctx) const
execute this algorithm
Definition: AnaReentrantAlgorithm.cxx:95
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthReentrantAlgorithm::filterPassed
virtual bool filterPassed(const EventContext &ctx) const
Definition: AthReentrantAlgorithm.h:135
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
EL::AnaReentrantAlgorithm::~AnaReentrantAlgorithm
virtual ~AnaReentrantAlgorithm() noexcept
standard (virtual) destructor
Definition: AnaReentrantAlgorithm.cxx:43
EL::AnaReentrantAlgorithm::initialize
virtual ::StatusCode initialize()
initialize this algorithm
Definition: AnaReentrantAlgorithm.cxx:87
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL::IWorker
the interface for algorithms to access IWorker
Definition: IWorker.h:40
MessageCheck.h
macros for messaging and checking status codes
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
AthReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthReentrantAlgorithm.cxx:67
Global.h
AthReentrantAlgorithm.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
EL::AnaReentrantAlgorithm::AnaReentrantAlgorithm
AnaReentrantAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition: AnaReentrantAlgorithm.cxx:29
AsgComponent.h
EL::AnaReentrantAlgorithm
the base class for EventLoop reentrant algorithms
Definition: AnaReentrantAlgorithm.h:51
asg::SgTEvent
Wrapper for TEvent to make it look like StoreGate.
Definition: SgTEvent.h:44
AthReentrantAlgorithm::setFilterPassed
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Definition: AthReentrantAlgorithm.h:139
SgTEvent.h