29 const std::string& version)
32 m_registerContext ( false ) ,
33 m_pSvcLocator(pSvcLocator),
56 const Property& prop = appMgr->getProperty(
"AuditAlgorithms");
58 if (
m_name !=
"IncidentSvc") {
77 (
"RegisterForContextService" ,
79 "The flag to enforce the registration for Algorithm Context Service") ;
119 Gaudi::Utils::AlgContext cnt
126 Gaudi::Guards::AuditorGuard guard
137 std::vector<Algorithm *>::iterator it;
140 if ((*it)->sysInitialize().isFailure()) fail =
true;
145 log <<
MSG::ERROR <<
" Error initializing one or several sub-algorithms"
156 log <<
MSG::FATAL <<
" Exception with tag=" << Exception.
tag()
157 <<
" is caught " <<
endmsg;
162 catch(
const std::exception& Exception )
195 Gaudi::Utils::AlgContext cnt
203 Gaudi::Guards::AuditorGuard guard
214 std::vector<Algorithm *>::iterator it;
217 if ((*it)->sysStart().isFailure()) fail =
true;
222 log <<
MSG::ERROR <<
" Error starting one or several sub-algorithms"
233 log <<
MSG::FATAL <<
"in sysStart(): exception with tag=" << Exception.
tag()
234 <<
" is caught" <<
endmsg;
239 catch(
const std::exception& Exception )
242 log <<
MSG::FATAL <<
"in sysStart(): standard std::exception is caught" <<
endmsg;
250 log <<
MSG::FATAL <<
"in sysStart(): UNKNOWN Exception is caught" <<
endmsg;
268 <<
"sysReinitialize(): cannot reinitialize algorithm not initialized"
282 Gaudi::Utils::AlgContext cnt
289 Gaudi::Guards::AuditorGuard guard(
this,
299 std::vector<Algorithm *>::iterator it;
302 if((*it)->sysReinitialize().isFailure()) fail =
true;
309 <<
"sysReinitialize(): Error reinitializing one or several "
310 <<
"sub-algorithms" <<
endmsg;
317 log <<
MSG::FATAL <<
"sysReinitialize(): Exception with tag=" << Exception.
tag()
318 <<
" is caught" <<
endmsg;
323 catch(
const std::exception& Exception )
326 log <<
MSG::FATAL <<
"sysReinitialize(): Standard std::exception is caught" <<
endmsg;
334 log <<
MSG::FATAL <<
"sysReinitialize(): UNKNOWN Exception is caught" <<
endmsg;
352 <<
"sysRestart(): cannot restart algorithm not started"
366 Gaudi::Utils::AlgContext cnt
373 Gaudi::Guards::AuditorGuard guard(
this,
383 std::vector<Algorithm *>::iterator it;
386 if ((*it)->sysRestart().isFailure()) fail =
true;
392 <<
"sysRestart(): Error restarting one or several sub-algorithms"
400 log <<
MSG::FATAL <<
"sysRestart(): Exception with tag=" << Exception.
tag()
401 <<
" is caught" <<
endmsg;
406 catch(
const std::exception& Exception )
409 log <<
MSG::FATAL <<
"sysRestart(): Standard std::exception is caught" <<
endmsg;
440 Gaudi::Utils::AlgContext cnt
447 Gaudi::Guards::AuditorGuard guard(
this,
457 std::vector<Algorithm *>::iterator it;
460 if((*it)->sysBeginRun().isFailure()) fail =
true;
465 log <<
MSG::ERROR <<
" Error executing BeginRun for one or several sub-algorithms"
473 log <<
MSG::FATAL <<
" Exception with tag=" << Exception.
tag()
474 <<
" is caught " <<
endmsg;
479 catch(
const std::exception& Exception )
516 Gaudi::Utils::AlgContext cnt
523 Gaudi::Guards::AuditorGuard guard(
this,
533 std::vector<Algorithm *>::iterator it;
536 if ((*it)->sysEndRun().isFailure()) fail =
true;
541 log <<
MSG::ERROR <<
" Error calling endRun for one or several sub-algorithms"
549 log <<
MSG::FATAL <<
" Exception with tag=" << Exception.
tag()
550 <<
" is caught " <<
endmsg;
555 catch(
const std::exception& Exception )
594 Gaudi::Utils::AlgContext cnt
597 Gaudi::Guards::AuditorGuard guard(
this,
622 log <<
" Exception with tag=" << Exception.
tag()
623 <<
" is caught " <<
endmsg;
630 catch(
const std::exception& Exception )
676 Gaudi::Utils::AlgContext cnt
683 std::vector<Algorithm *>::iterator it;
685 (*it)->sysStop().ignore();
688 Gaudi::Guards::AuditorGuard guard(
this,
703 log <<
MSG::FATAL <<
"in sysStop(): exception with tag=" << Exception.
tag()
704 <<
" is caught" <<
endmsg;
709 catch(
const std::exception& Exception ) {
711 log <<
MSG::FATAL <<
"in sysStop(): standard std::exception is caught" <<
endmsg;
735 Gaudi::Utils::AlgContext cnt
743 std::vector<Algorithm *>::iterator it;
746 if (!(*it)->sysFinalize().isSuccess()) {
752 Gaudi::Guards::AuditorGuard guard(
this,
774 log <<
MSG::FATAL <<
" Exception with tag=" << Exception.
tag()
775 <<
" is caught " <<
endmsg;
780 catch(
const std::exception& Exception )
878 {
msgSvc()->setOutputLevel(
name(), level ) ; }
883 #define serviceAccessor(METHOD,INTERFACE,NAME,MEMBER) \
884 SmartIF<INTERFACE>& Algorithm::METHOD() const { \
885 if ( !MEMBER.isValid() ) { \
886 MEMBER = service(NAME); \
887 if( !MEMBER.isValid() ) { \
888 throw GaudiException("Service [" NAME "] not found", name(), StatusCode::FAILURE); \
990 throw GaudiException(
"Service [DetectorPersistencySvc] not found",
1099 if( jos.isValid() ) {
1106 if(jos->setMyProperties(
name(),
this ).isFailure()) {
1117 const std::string& name,
1131 pSubAlgorithm =
dynamic_cast<Algorithm*
>(tmp);
1176 void** ppSvc)
const {
1178 return helper.
getService(svcName, createIf, iid, ppSvc);
1183 const std::string& svcName,
1185 void** ppSvc)
const {
1192 return helper.
service(name, quiet, createIf);