19 #include "GaudiKernel/IAlgManager.h"
20 #include "GaudiKernel/ISvcLocator.h"
28 ISvcLocator* pSvcLocator ):
30 m_clidSvc(
"ClassIDSvc/ClassIDSvc",
name)
45 ATH_MSG_ERROR (
"Unable to configure one or more sequencer members ");
46 return StatusCode::FAILURE;
52 for (Gaudi::Algorithm* theAlgorithm : *subAlgorithms()) {
53 if (!theAlgorithm->sysInitialize( ).isSuccess()) {
55 << theAlgorithm->type() <<
"/" << theAlgorithm->name());
56 sc= StatusCode::FAILURE;
64 ATH_MSG_DEBUG(
"Allow dynamic data consumers to update their data dependencies.");
83 for (Gaudi::Algorithm* theAlgorithm : *subAlgorithms()) {
84 if ( theAlgorithm->isEnabled( ) ) {
85 if (theAlgorithm->sysReinitialize( ).isFailure()) {
87 << theAlgorithm->type () <<
"/"
88 << theAlgorithm->name());
89 sc = StatusCode::FAILURE;
105 auto state = execState( ctx );
108 if ( isEnabled( ) && state.state() != AlgExecState::State::Done ) {
111 state.setState( AlgExecState::State::Executing );
117 const std::vector<Gaudi::Algorithm*>* subAlgms = subAlgorithms( );
118 for (
auto theAlgorithm : *subAlgms) {
119 if ( theAlgorithm->isEnabled( ) ) {
124 if (
sc.isSuccess() ) {
128 const bool passed = theAlgorithm->execState( ctx ).filterPassed();
130 state.setFilterPassed( !
passed );
132 state.setFilterPassed(
passed );
145 ATH_MSG_INFO (
"execute of [" << theAlgorithm->name() <<
"] did NOT succeed");
154 state.setFilterPassed( !seqPass );
156 state.setFilterPassed( seqPass );
160 state.setState( AlgExecState::State::Done );
167 const EventContext& ctx)
const
170 return theAlgorithm->sysExecute( ctx );
178 for (Gaudi::Algorithm* theAlgorithm : *subAlgorithms()) {
179 if (!theAlgorithm->sysStart( ).isSuccess()) {
181 << theAlgorithm->type () <<
"/"
182 << theAlgorithm->name());
183 sc = StatusCode::FAILURE;
194 for (Gaudi::Algorithm* theAlgorithm : *subAlgorithms()) {
195 if (theAlgorithm->sysStop( ).isFailure()) {
197 << theAlgorithm->type () <<
"/"
198 << theAlgorithm->name());
199 sc = StatusCode::FAILURE;
208 execState(ctx).reset();
212 for (Gaudi::Algorithm* theAlgorithm : *subAlgorithms()) {
213 theAlgorithm->execState(ctx).reset();
226 return append( pAlgorithm, subAlgorithms( ) );
231 const std::string&
name,
232 Gaudi::Algorithm*& pAlgorithm )
240 return remove (pAlgorithm->name());
268 std::vector<Gaudi::Algorithm*>* theAlgs )
270 bool all_good =
true;
273 for (Gaudi::Algorithm* theAlgorithm : *theAlgs) {
274 if ( theAlgorithm == pAlgorithm ) {
280 theAlgs->push_back( pAlgorithm );
281 pAlgorithm->addRef();
283 return all_good ? StatusCode::SUCCESS : StatusCode::FAILURE;
289 Gaudi::Algorithm*& pAlgorithm,
290 std::vector<Gaudi::Algorithm*>* theAlgs )
292 SmartIF<IAlgManager> theAlgMgr(Gaudi::svcLocator()->as<IAlgManager>());
293 IAlgorithm*
tmp =
nullptr;
296 pAlgorithm =
dynamic_cast<Gaudi::Algorithm*
>(
tmp);
297 theAlgs->push_back( pAlgorithm );
299 return StatusCode::SUCCESS;
304 std::vector<Gaudi::Algorithm*>* theAlgs )
306 SmartIF<IAlgManager> theAlgMgr(Gaudi::svcLocator()->as<IAlgManager>());
314 for (
const std::string&
name : theNames.value()) {
317 Gaudi::Utils::TypeNameString tn(
name);
321 SmartIF<IAlgorithm>& theIAlg = theAlgMgr->algorithm(tn.name(),
false);
322 Gaudi::Algorithm* theAlgorithm =
nullptr;
324 theAlgorithm =
dynamic_cast<Gaudi::Algorithm*
>(theIAlg.get());
325 if ( theAlgorithm ) {
328 if (
append(theAlgorithm, theAlgs).isSuccess( ) ) {
329 ATH_MSG_DEBUG (tn.name() <<
" already exists - appended to member list");
332 result = StatusCode::FAILURE;
336 ATH_MSG_WARNING (tn.name() <<
" is not an Algorithm - Failed dynamic cast");
337 result = StatusCode::FAILURE;
343 if (
createAndAppend(tn.type(), tn.name(), theAlgorithm, theAlgs).isSuccess( ) ) {
344 ATH_MSG_DEBUG (tn.name() <<
" doesn't exist - created and appended to member list");
347 result = StatusCode::FAILURE;
354 if (
result.isSuccess() && !theAlgs->empty() ) {
358 for (Gaudi::Algorithm*
alg : *theAlgs) {
376 std::vector<Gaudi::Algorithm*>* )
379 return StatusCode::FAILURE;