ATLAS Offline Software
Loading...
Searching...
No Matches
AthSequencer.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7// AthSequencer.h
8// Header file for class AthSequencer
9// Author: S.Binet<binet@cern.ch>
10// Stolen from Gaudi repository
12#ifndef GAUDISEQUENCER_ATHSEQUENCER_H
13#define GAUDISEQUENCER_ATHSEQUENCER_H
14
15// Include files
18
19#include "Gaudi/Property.h"
20#include "Gaudi/Sequence.h"
21#include "GaudiKernel/ServiceHandle.h"
22#include "GaudiKernel/IClassIDSvc.h"
23
24
39 : public AthCommonDataStore<AthCommonMsg<Gaudi::Sequence>>
40{
41public:
42
46 AthSequencer( const std::string& name, // The path object's name
47 ISvcLocator* svcloc // A pointer to a service location service
48 );
49
53 virtual ~AthSequencer( );
54
55 /*****************************
56 ** Public Function Members **
57 *****************************/
58
59
66 virtual StatusCode initialize( ) override;
67
71 virtual StatusCode reinitialize( ) override;
72
77 virtual StatusCode execute( const EventContext& ctx ) const override;
78
81 virtual StatusCode start () override;
82
85 virtual StatusCode stop () override;
86
90 virtual void resetExecuted( const EventContext& ctx ) const;
91
95 virtual bool isStopOverride( ) const;
96
100 StatusCode append( Gaudi::Algorithm* pAlgorithm );
101
111 StatusCode createAndAppend(
112 const std::string& type, // The concrete algorithm class of the algorithm
113 const std::string& name, // The name to be given to the algorithm
114 Gaudi::Algorithm*& pAlgorithm // Set to point to the newly created algorithm object
115 );
116
120 StatusCode remove( Gaudi::Algorithm* pAlgorithm );
121 StatusCode remove( const std::string& name );
122
124 StatusCode decodeMemberNames( );
125
127 void membershipHandler( Gaudi::Details::PropertyBase& theProp );
128
131
133 void branchMembershipHandler( Gaudi::Details::PropertyBase& theProp );
134
135protected:
136
140 StatusCode append( Gaudi::Algorithm* pAlgorithm,
141 std::vector<Gaudi::Algorithm*>* theAlgs );
142
152 StatusCode createAndAppend(
153 const std::string& type, // The concrete algorithm class of the algorithm
154 const std::string& name, // The name to be given to the algorithm
155 Gaudi::Algorithm*& pAlgorithm, // Set to point to the newly created algorithm object
156 std::vector<Gaudi::Algorithm*>* theAlgs
157 );
158
162 StatusCode decodeNames( Gaudi::Property<std::vector<std::string>>& theNames,
163 std::vector<Gaudi::Algorithm*>* theAlgs );
164
168 StatusCode remove( const std::string& algname, std::vector<Gaudi::Algorithm*>* theAlgs );
169
170private:
172 StatusCode executeAlgorithm (Gaudi::Algorithm* theAlgorithm, const EventContext& ctx) const;
173
174 /**************************
175 ** Private Data Members **
176 **************************/
177
178 Gaudi::Property<std::vector<std::string>> m_names{this, "Members",{},
179 "Algorithm names (of the form '<cppType>/<instanceName>')","std::vector<Algorithm>"};
180
181 Gaudi::Property<bool> m_modeOR{this, "ModeOR", false,
182 "Use OR logic instead of AND"};
183
184 Gaudi::Property<bool> m_ignoreFilter{this, "IgnoreFilterPassed", false,
185 "Always continue sequence ignoring filterPassed of member algorithms"};
186
187 Gaudi::Property<bool> m_invert{ this, "Invert", false,
188 "Invert the logic result of the sequencer"};
189
190 Gaudi::Property<bool> m_stopOverride{this, "StopOverride", false,
191 "Continue even if algorithm filter fails"};
192
193 Gaudi::Property<bool> m_sequential{this, "Sequential", false,
194 "Concurrent or (strict) Sequential ordering of algorithms"};
195
196 Gaudi::Property<std::vector<std::string>> m_undeclaredOutputData{this, "ExtraDataForDynamicConsumers", {},
197 "Pass these extra output data IDs, which are not declared by any of the algorithms or tools, to dynamic data consumers."};
198
199 Gaudi::Property<bool> m_runPostInitialize{this, "ProcessDynamicDataDependencies", false,
200 "Run the post initialization step, to dynamically create and gather extra data dependencies. "
201 "Should be enabled for the top most sequence."};
202
204
205 const unsigned int m_maxPass{100}; //<! maximum number of iterations to process dynamic data dependencies
206};
207
208#endif //GAUDISEQUENCER_ATHSEQUENCER_H
209
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.
AthCommonDataStore(const std::string &name, T... args)
virtual StatusCode initialize() override
Initialization of a sequencer.
StatusCode decodeBranchMemberNames()
Decode branch member naem list.
virtual StatusCode reinitialize() override
AthSequencer Reinitialization.
virtual void resetExecuted(const EventContext &ctx) const
Reset the AthSequencer executed state for the current event.
virtual bool isStopOverride() const
Has the StopOverride mode been set?
ServiceHandle< IClassIDSvc > m_clidSvc
virtual StatusCode start() override
Start (from INITIALIZED to RUNNING).
Gaudi::Property< bool > m_invert
StatusCode decodeNames(Gaudi::Property< std::vector< std::string > > &theNames, std::vector< Gaudi::Algorithm * > *theAlgs)
Decode algorithm names, creating or appending algorithms as appropriate.
Gaudi::Property< bool > m_modeOR
StatusCode executeAlgorithm(Gaudi::Algorithm *theAlgorithm, const EventContext &ctx) const
Run one algorithm.
StatusCode remove(Gaudi::Algorithm *pAlgorithm)
Remove the specified algorithm from the sequencer.
virtual StatusCode execute(const EventContext &ctx) const override
The actions to be performed by the sequencer on an event.
void membershipHandler(Gaudi::Details::PropertyBase &theProp)
"Members" property handler
Gaudi::Property< std::vector< std::string > > m_names
virtual ~AthSequencer()
Destructor.
Gaudi::Property< bool > m_ignoreFilter
StatusCode append(Gaudi::Algorithm *pAlgorithm)
Append an algorithm to the sequencer.
void branchMembershipHandler(Gaudi::Details::PropertyBase &theProp)
"BranchMembers" propertry handler
Gaudi::Property< bool > m_stopOverride
AthSequencer(const std::string &name, ISvcLocator *svcloc)
Constructor(s)
const unsigned int m_maxPass
virtual StatusCode stop() override
Stop (from RUNNING to INITIALIZED).
StatusCode createAndAppend(const std::string &type, const std::string &name, Gaudi::Algorithm *&pAlgorithm)
Create a algorithm and append it to the sequencer.
StatusCode decodeMemberNames()
Decode Member Name list.
Gaudi::Property< bool > m_sequential
Gaudi::Property< bool > m_runPostInitialize
Gaudi::Property< std::vector< std::string > > m_undeclaredOutputData