| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

MinimalEventLoopMgr.cpp
Go to the documentation of this file.
1 #define GAUDIKERNEL_MINIMALEVENTLOOPMGR_CPP
2
3 #include "GaudiKernel/SmartIF.h"
4 #include "GaudiKernel/MsgStream.h"
5 #include "GaudiKernel/IAlgorithm.h"
6 #include "GaudiKernel/IAlgManager.h"
7 #include "GaudiKernel/TypeNameString.h"
8 #include "GaudiKernel/GaudiException.h"
9 #include "GaudiKernel/ThreadGaudi.h"
10 #include "GaudiKernel/Incident.h"
11 #include "GaudiKernel/IIncidentListener.h"
12 #include "GaudiKernel/IIncidentSvc.h"
13 #include "GaudiKernel/AppReturnCode.h"
14
15 #include "GaudiKernel/MinimalEventLoopMgr.h"
16
17 #include <algorithm>
18
19 namespace {
20 class AbortEventListener: public implements<IIncidentListener> {
21 public:
22 AbortEventListener(bool &flag, std::string &source):m_flag(flag),
23 m_source(source){
24 addRef(); // Initial count set to 1
25 }
26 ~AbortEventListener() override = default;
28 void handle(const Incident& i) override {
29 if (i.type() == IncidentType::AbortEvent) {
30 m_flag = true;
31 m_source = i.source();
32 }
33 }
34
35 private:
37 bool &m_flag;
39 std::string &m_source;
40 };
41 }
42
43 #define ON_DEBUG if (UNLIKELY(outputLevel() <= MSG::DEBUG))
44 #define ON_VERBOSE if (UNLIKELY(outputLevel() <= MSG::VERBOSE))
45
46 #define DEBMSG ON_DEBUG debug()
47 #define VERMSG ON_VERBOSE verbose()
48
49 //--------------------------------------------------------------------------------------------
50 // Standard Constructor
51 //--------------------------------------------------------------------------------------------
52 MinimalEventLoopMgr::MinimalEventLoopMgr(const std::string& nam, ISvcLocator* svcLoc)
53 : base_class(nam, svcLoc), m_appMgrUI(svcLoc)
54 {
55 declareProperty("TopAlg", m_topAlgNames );
56 declareProperty("OutStream", m_outStreamNames );
57 declareProperty("OutStreamType", m_outStreamType = "OutputStream");
58 m_topAlgNames.declareUpdateHandler ( &MinimalEventLoopMgr::topAlgHandler, this );
59 m_outStreamNames.declareUpdateHandler( &MinimalEventLoopMgr::outStreamHandler, this );
60 }
61
62 //--------------------------------------------------------------------------------------------
63 // implementation of IAppMgrUI::initialize
64 //--------------------------------------------------------------------------------------------
65 StatusCode MinimalEventLoopMgr::initialize() {
66
67 if ( !m_appMgrUI ) return StatusCode::FAILURE;
68
69 StatusCode sc = Service::initialize();
70 if ( !sc.isSuccess() ) {
71 error() << "Failed to initialize Service Base class." << endmsg;
72 return StatusCode::FAILURE;
73 }
74
75 auto prpMgr = serviceLocator()->as<IProperty>();
76 if ( !prpMgr ) {
77 error() << "Error retrieving AppMgr interface IProperty." << endmsg;
78 return StatusCode::FAILURE;
79 }
80 if ( m_topAlgNames.value().empty() ) {
81 setProperty(prpMgr->getProperty("TopAlg")).ignore();
82 }
83 if ( m_outStreamNames.value().empty() ) {
84 setProperty(prpMgr->getProperty("OutStream")).ignore();
85 }
86
87 // Get the references to the services that are needed by the ApplicationMgr itself
88 m_incidentSvc = serviceLocator()->service("IncidentSvc");
89 if( !m_incidentSvc ) {
90 fatal() << "Error retrieving IncidentSvc." << endmsg;
91 return StatusCode::FAILURE;
92 }
93
94 m_abortEventListener = new AbortEventListener(m_abortEvent,m_abortEventSource);
95 m_incidentSvc->addListener(m_abortEventListener,IncidentType::AbortEvent);
96
97 // The state is changed at this moment to allow decodeXXXX() to do something
98 m_state = INITIALIZED;
99
100 //--------------------------------------------------------------------------------------------
101 // Create output streams. Do not initialize them yet.
102 // The state is updated temporarily in order to enable the handler, which
103 // is also triggered by a change to the "OutputStream" Property.
104 //--------------------------------------------------------------------------------------------
105 sc = decodeOutStreams();
106 if ( !sc.isSuccess() ) {
107 error() << "Failed to initialize Output streams." << endmsg;
108 m_state = CONFIGURED;
109 return sc;
110 }
111 //--------------------------------------------------------------------------------------------
112 // Create all needed Top Algorithms. Do not initialize them yet.
113 // The state is updated temporarily in order to enable the handler, which
114 // is also triggered by a change to the "TopAlg" Property.
115 //--------------------------------------------------------------------------------------------
116 sc = decodeTopAlgs();
117 if ( !sc.isSuccess() ) {
118 error() << "Failed to initialize Top Algorithms streams." << endmsg;
119 m_state = CONFIGURED;
120 return sc;
121 }
122
123 // Initialize all the new TopAlgs. In fact Algorithms are protected against getting
124 // initialized twice.
125 for (auto& ita : m_topAlgList ) {
126 sc = ita->sysInitialize();
127 if( !sc.isSuccess() ) {
128 error() << "Unable to initialize Algorithm: " << ita->name() << endmsg;
129 return sc;
130 }
131 }
132 for (auto& ita : m_outStreamList ) {
133 sc = ita->sysInitialize();
134 if( !sc.isSuccess() ) {
135 error() << "Unable to initialize Output Stream: " << ita->name() << endmsg;
136 return sc;
137 }
138 }
139
140 return StatusCode::SUCCESS;
141 }
142 //--------------------------------------------------------------------------------------------
143 // implementation of IAppMgrUI::start
144 //--------------------------------------------------------------------------------------------
145 StatusCode MinimalEventLoopMgr::start() {
146
147 StatusCode sc = Service::start();
148 if ( ! sc.isSuccess() ) return sc;
149
150 // Start all the new TopAlgs. In fact Algorithms are protected against getting
151 // started twice.
152 for (auto& ita : m_topAlgList) {
153 sc = ita->sysStart();
154 if( !sc.isSuccess() ) {
155 error() << "Unable to start Algorithm: " << ita->name() << endmsg;
156 return sc;
157 }
158 }
159 for (auto& ita : m_outStreamList ) {
160 sc = ita->sysStart();
161 if( !sc.isSuccess() ) {
162 error() << "Unable to start Output Stream: " << ita->name() << endmsg;
163 return sc;
164 }
165 }
166 return StatusCode::SUCCESS;
167 }
168 //--------------------------------------------------------------------------------------------
169 // implementation of IAppMgrUI::stop
170 //--------------------------------------------------------------------------------------------
171 StatusCode MinimalEventLoopMgr::stop() {
172
173 StatusCode sc(StatusCode::SUCCESS,true);
174
175 // Stop all the TopAlgs. In fact Algorithms are protected against getting
176 // stopped twice.
177 for (auto & ita : m_topAlgList ) {
178 sc = ita->sysStop();
179 if( !sc.isSuccess() ) {
180 error() << "Unable to stop Algorithm: " << ita->name() << endmsg;
181 return sc;
182 }
183 }
184 for (auto &ita : m_outStreamList ) {
185 sc = ita->sysStop();
186 if( !sc.isSuccess() ) {
187 error() << "Unable to stop Output Stream: " << ita->name() << endmsg;
188 return sc;
189 }
190 }
191
192 return Service::stop();
193 }
194
195 //--------------------------------------------------------------------------------------------
196 // implementation of IService::reinitialize
197 //--------------------------------------------------------------------------------------------
198 StatusCode MinimalEventLoopMgr::reinitialize() {
199 StatusCode sc = StatusCode::SUCCESS;
200
201 // Reinitialize all the TopAlgs.
202 for (auto& ita : m_topAlgList) {
203 sc = ita->sysReinitialize();
204 if( !sc.isSuccess() ) {
205 error() << "Unable to reinitialize Algorithm: " << ita->name() << endmsg;
206 return sc;
207 }
208 }
209 for (auto &ita : m_outStreamList ) {
210 sc = ita->sysReinitialize();
211 if( !sc.isSuccess() ) {
212 error() << "Unable to reinitialize Output Stream: " << ita->name() << endmsg;
213 return sc;
214 }
215 }
216
217 return sc;
218 }
219 //--------------------------------------------------------------------------------------------
220 // implementation of IService::restart
221 //--------------------------------------------------------------------------------------------
222 StatusCode MinimalEventLoopMgr::restart() {
223 StatusCode sc = StatusCode::SUCCESS;
224
225 // Restart all the TopAlgs.
226 for (auto& ita : m_topAlgList ) {
227 sc = ita->sysRestart();
228 if( !sc.isSuccess() ) {
229 error() << "Unable to restart Algorithm: " << ita->name() << endmsg;
230 return sc;
231 }
232 }
233 for (auto& ita : m_outStreamList ) {
234 sc = ita->sysRestart();
235 if( !sc.isSuccess() ) {
236 error() << "Unable to restart Output Stream: " << ita->name() << endmsg;
237 return sc;
238 }
239 }
240
241 return sc;
242 }
243
244 //--------------------------------------------------------------------------------------------
245 // implementation of IService::finalize
246 //--------------------------------------------------------------------------------------------
247 StatusCode MinimalEventLoopMgr::finalize() {
248 StatusCode sc = StatusCode::SUCCESS;
249 StatusCode scRet = StatusCode::SUCCESS;
250 // Call the finalize() method of all top algorithms
251 for (auto& ita : m_topAlgList ) {
252 sc = ita->sysFinalize();
253 if( !sc.isSuccess() ) {
254 scRet = StatusCode::FAILURE;
255 warning() << "Finalization of algorithm " << ita->name() << " failed" << endmsg;
256 }
257 }
258 // Call the finalize() method of all Output streams
259 for (auto &ita : m_outStreamList) {
260 sc = ita->sysFinalize();
261 if( !sc.isSuccess() ) {
262 scRet = StatusCode::FAILURE;
263 warning() << "Finalization of algorithm " << ita->name() << " failed" << endmsg;
264 }
265 }
266 // release all top algorithms
267 auto algMan = serviceLocator()->as<IAlgManager>();
268 for (auto &ita : m_topAlgList ) {
269 if (algMan->removeAlgorithm(ita).isFailure()) {
270 scRet = StatusCode::FAILURE;
271 warning() << "Problems removing Algorithm " << ita->name() << endmsg;
272 }
273 }
274 m_topAlgList.clear();
275 m_outStreamList.clear();
276 if ( sc.isSuccess() ) m_state = FINALIZED;
277
278 m_incidentSvc->removeListener(m_abortEventListener, IncidentType::AbortEvent);
279 m_abortEventListener.reset();
280
281 m_incidentSvc.reset();
282 m_appMgrUI.reset();
283
284 sc = Service::finalize();
285
286 if (sc.isFailure()) {
287 scRet = StatusCode::FAILURE;
288 error() << "Problems finalizing Service base class" << endmsg;
289 }
290
291 return scRet;
292 }
293
294 //--------------------------------------------------------------------------------------------
295 // implementation of IAppMgrUI::nextEvent
296 //--------------------------------------------------------------------------------------------
297 StatusCode MinimalEventLoopMgr::nextEvent(int /* maxevt */) {
298 error() << "This method cannot be called on an object of type "
299 << System::typeinfoName(typeid(*this)) << endmsg;
300 return StatusCode::FAILURE;
301 }
302
303 //--------------------------------------------------------------------------------------------
304 // IEventProcessing::executeRun
305 //--------------------------------------------------------------------------------------------
306 StatusCode MinimalEventLoopMgr::executeRun( int maxevt ) {
307 StatusCode sc;
308 bool eventfailed = false;
309
310 // Call the beginRun() method of all top algorithms
311 for (auto& ita : m_topAlgList ) {
312 sc = ita->sysBeginRun();
313 if (!sc.isSuccess()) {
314 warning() << "beginRun() of algorithm " << ita->name() << " failed" << endmsg;
315 eventfailed = true;
316 }
317 }
318
319 // Call now the nextEvent(...)
320 sc = nextEvent(maxevt);
321 if (!sc.isSuccess()) eventfailed = true;
322
323 // Call the endRun() method of all top algorithms
324 for (auto& ita : m_topAlgList) {
325 sc = ita->sysEndRun();
326 if (!sc.isSuccess()) {
327 warning() << "endRun() of algorithm " << ita->name() << " failed" << endmsg;
328 eventfailed = true;
329 }
330 }
331
332 return eventfailed ? StatusCode::FAILURE : StatusCode::SUCCESS;
333 }
334
335 namespace {
338 class RetCodeGuard {
339 public:
340 inline RetCodeGuard(SmartIF<IProperty> appmgr, int retcode):
341 m_appmgr(std::move(appmgr)), m_retcode(retcode) {}
342 inline void ignore() {
343 m_retcode = Gaudi::ReturnCode::Success;
344 }
345 inline ~RetCodeGuard() {
346 if (UNLIKELY(Gaudi::ReturnCode::Success != m_retcode)) {
347 Gaudi::setAppReturnCode(m_appmgr, m_retcode);
348 }
349 }
350 private:
351 SmartIF<IProperty> m_appmgr;
352 int m_retcode;
353 };
354 }
355 //--------------------------------------------------------------------------------------------
356 // Implementation of IEventProcessor::executeEvent(void* par)
357 //--------------------------------------------------------------------------------------------
358 StatusCode MinimalEventLoopMgr::executeEvent(void* /* par */) {
359 bool eventfailed = false;
360
361 // Call the resetExecuted() method of ALL "known" algorithms
362 // (before we were reseting only the topalgs)
363 auto algMan = serviceLocator()->as<IAlgManager>();
364 if (LIKELY(algMan.isValid())) {
365 const auto& allAlgs = algMan->getAlgorithms();
366 std::for_each( std::begin(allAlgs), std::end(allAlgs),
367 [](IAlgorithm* alg) {
368 if (LIKELY(alg!=nullptr)) alg->resetExecuted();
369 } );
370 }
371
372 // Get the IProperty interface of the ApplicationMgr to pass it to RetCodeGuard
373 const auto appmgr = serviceLocator()->as<IProperty>();
374 // Call the execute() method of all top algorithms
375 for (auto& ita : m_topAlgList ) {
376 StatusCode sc(StatusCode::FAILURE);
377 try {
378 if (UNLIKELY(m_abortEvent)) {
379 DEBMSG << "AbortEvent incident fired by "
380 << m_abortEventSource << endmsg;
381 m_abortEvent = false;
382 sc.ignore();
383 break;
384 }
385 RetCodeGuard rcg(appmgr, Gaudi::ReturnCode::UnhandledException);
386 sc = ita->sysExecute();
387 rcg.ignore(); // disarm the guard
388 } catch ( const GaudiException& Exception ) {
389 fatal() << ".executeEvent(): Exception with tag=" << Exception.tag()
390 << " thrown by " << ita->name() << endmsg;
391 error() << Exception << endmsg;
392 } catch ( const std::exception& Exception ) {
393 fatal() << ".executeEvent(): Standard std::exception thrown by "
394 << ita->name() << endmsg;
395 error() << Exception.what() << endmsg;
396 } catch(...) {
397 fatal() << ".executeEvent(): UNKNOWN Exception thrown by "
398 << ita->name() << endmsg;
399 }
400
401 if (UNLIKELY(!sc.isSuccess())) {
402 warning() << "Execution of algorithm " << ita->name() << " failed" << endmsg;
403 eventfailed = true;
404 }
405 }
406
407 // ensure that the abortEvent flag is cleared before the next event
408 if (UNLIKELY(m_abortEvent)) {
409 DEBMSG << "AbortEvent incident fired by " << m_abortEventSource << endmsg;
410 m_abortEvent = false;
411 }
412
413 // Call the execute() method of all output streams
414 for (auto& ito : m_outStreamList) {
415 ito->resetExecuted();
416 StatusCode sc;
417 sc = ito->sysExecute();
418 if (UNLIKELY(!sc.isSuccess())) {
419 warning() << "Execution of output stream " << ito->name() << " failed" << endmsg;
420 eventfailed = true;
421 }
422 }
423
424 // Check if there was an error processing current event
425 if (UNLIKELY(eventfailed)){
426 error() << "Error processing event loop." << endmsg;
427 return StatusCode(StatusCode::FAILURE,true);
428 }
429 return StatusCode(StatusCode::SUCCESS,true);
430 }
431 //--------------------------------------------------------------------------------------------
432 // Implementation of IEventProcessor::stopRun()
433 //--------------------------------------------------------------------------------------------
434 StatusCode MinimalEventLoopMgr::stopRun() {
435 // Set the application return code
436 auto appmgr = serviceLocator()->as<IProperty>();
437 if(Gaudi::setAppReturnCode(appmgr, Gaudi::ReturnCode::ScheduledStop).isFailure()) {
438 error() << "Could not set return code of the application ("
439 << Gaudi::ReturnCode::ScheduledStop << ")" << endmsg;
440 }
441 m_scheduledStop = true;
442 return StatusCode::SUCCESS;
443 }
444
445 //--------------------------------------------------------------------------------------------
446 // Top algorithm List handler
447 //--------------------------------------------------------------------------------------------
448 void MinimalEventLoopMgr::topAlgHandler( Property& /* theProp */ ) {
449 if ( !(decodeTopAlgs( )).isSuccess() ) {
450 throw GaudiException("Failed to initialize Top Algorithms streams.",
451 "MinimalEventLoopMgr::topAlgHandler",
452 StatusCode::FAILURE);
453 }
454 }
455
456 //--------------------------------------------------------------------------------------------
457 // decodeTopAlgNameList & topAlgNameListHandler
458 //--------------------------------------------------------------------------------------------
459 StatusCode MinimalEventLoopMgr::decodeTopAlgs() {
460 StatusCode sc = StatusCode::SUCCESS;
461 if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
462 auto algMan = serviceLocator()->as<IAlgManager>();
463 if ( algMan ) {
464 // Reset the existing Top Algorithm List
465 m_topAlgList.clear( );
466 m_topAlgList.reserve( m_topAlgNames.value().size() );
467 for (const auto& it : m_topAlgNames.value( )) {
468 Gaudi::Utils::TypeNameString item{it};
469 // Got the type and name. Now creating the algorithm, avoiding duplicate creation.
470 std::string item_name = item.name() + getGaudiThreadIDfromName(name());
471 const bool CREATE = false;
472 SmartIF<IAlgorithm> alg = algMan->algorithm(item_name, CREATE);
473 if (alg) {
474 DEBMSG << "Top Algorithm " << item_name << " already exists" << endmsg;
475 }
476 else {
477 DEBMSG << "Creating Top Algorithm " << item.type() << " with name " << item_name << endmsg;
478 IAlgorithm *ialg = nullptr;
479 StatusCode sc1 = algMan->createAlgorithm(item.type(), item_name, ialg);
480 if( !sc1.isSuccess() ) {
481 error() << "Unable to create Top Algorithm " << item.type() << " with name " << item_name << endmsg;
482 return sc1;
483 }
484 alg = ialg; // manage reference counting
485 }
486 m_topAlgList.push_back(alg);
487 }
488 return sc;
489 }
490 sc = StatusCode::FAILURE;
491 }
492 return sc;
493 }
494
495 //--------------------------------------------------------------------------------------------
496 // Output stream List handler
497 //--------------------------------------------------------------------------------------------
498 void MinimalEventLoopMgr::outStreamHandler( Property& /* theProp */ ) {
499 if ( !(decodeOutStreams( )).isSuccess() ) {
500 throw GaudiException("Failed to initialize output streams.",
501 "MinimalEventLoopMgr::outStreamHandler",
502 StatusCode::FAILURE);
503 }
504 }
505
506 //--------------------------------------------------------------------------------------------
507 // decodeOutStreamNameList & outStreamNameListHandler
508 //--------------------------------------------------------------------------------------------
509 StatusCode MinimalEventLoopMgr::decodeOutStreams( ) {
510 StatusCode sc = StatusCode::SUCCESS;
511 if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
512 auto algMan = serviceLocator()->as<IAlgManager>();
513 if ( algMan ) {
514 // Reset the existing Top Algorithm List
515 m_outStreamList.clear();
516 for (const auto& it : m_outStreamNames.value( ) ) {
517 Gaudi::Utils::TypeNameString item(it, m_outStreamType);
518 DEBMSG << "Creating " << m_outStreamType << it << endmsg;
519 const bool CREATE = false;
520 SmartIF<IAlgorithm> os = algMan->algorithm( item, CREATE );
521 if (os) {
522 DEBMSG << "Output Stream " << item.name() << " already exists" << endmsg;
523 } else {
524 DEBMSG << "Creating Output Stream " << it << endmsg;
525 IAlgorithm* ios = nullptr;
526 StatusCode sc1 = algMan->createAlgorithm( item.type(), item.name(), ios );
527 if( !sc1.isSuccess() ) {
528 error() << "Unable to create Output Stream " << it << endmsg;
529 return sc1;
530 }
531 os = ios; // manage reference counting
532 }
533 m_outStreamList.push_back( os );
534 }
535 return sc;
536 }
537 sc = StatusCode::FAILURE;
538 }
539 return sc;
540 }
541
542
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:68
gaudirun.retcode
tuple retcode
Definition: gaudirun.py:478
SmartIF< IProperty >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
std::vector::empty
T empty(T...args)
implements
Base class used to implement the interfaces.
Definition: implements.h:9
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
RetCodeGuard
Helper class to set the application return code in case of early exit (e.g.
Definition: RetCodeGuard.h:9
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
MinimalEventLoopMgr::finalize
StatusCode finalize() override
implementation of IService::finalize
Definition: MinimalEventLoopMgr.cpp:247
Incident::type
const std::string & type() const
Access to the incident type.
Definition: Incident.h:41
MinimalEventLoopMgr::m_scheduledStop
bool m_scheduledStop
Scheduled stop of event processing.
Definition: MinimalEventLoopMgr.h:51
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:193
MsgStream.h
Property::declareUpdateHandler
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
Service::start
StatusCode start() override
Definition: Service.cpp:152
Incident::source
const std::string & source() const
Access to the source of the incident.
Definition: Incident.h:47
IAlgorithm.h
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
MinimalEventLoopMgr::initialize
StatusCode initialize() override
implementation of IService::initialize
Definition: MinimalEventLoopMgr.cpp:65
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:33
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
Service::setProperty
StatusCode setProperty(const Property &p) override
Definition: Service.cpp:330
RetCodeGuard::~RetCodeGuard
~RetCodeGuard()
Definition: RetCodeGuard.h:16
MinimalEventLoopMgr::FINALIZED
Definition: MinimalEventLoopMgr.h:33
std
STL namespace.
MinimalEventLoopMgr::outStreamHandler
void outStreamHandler(Property &p)
Output stream List handler.
Definition: MinimalEventLoopMgr.cpp:498
MinimalEventLoopMgr::CONFIGURED
Definition: MinimalEventLoopMgr.h:33
std::end
T end(T...args)
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
IAlgManager::getAlgorithms
virtual const std::vector< IAlgorithm * > & getAlgorithms() const =0
Return the list of Algorithms.
MinimalEventLoopMgr::decodeTopAlgs
StatusCode decodeTopAlgs()
decodeTopAlgNameList & topAlgNameListHandler
Definition: MinimalEventLoopMgr.cpp:459
IAlgorithm::resetExecuted
virtual void resetExecuted()=0
Reset the Algorithm executed state for the current event.
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
ThreadGaudi.h
MinimalEventLoopMgr::reinitialize
StatusCode reinitialize() override
implementation of IService::reinitialize
Definition: MinimalEventLoopMgr.cpp:198
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:25
std::string
STL class.
MinimalEventLoopMgr::stop
StatusCode stop() override
implementation of IService::stop
Definition: MinimalEventLoopMgr.cpp:171
Incident.h
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:49
Gaudi::ReturnCode::UnhandledException
constexpr int UnhandledException
Definition: AppReturnCode.h:27
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
std::vector::push_back
T push_back(T...args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
MinimalEventLoopMgr::m_abortEventSource
std::string m_abortEventSource
Source of the AbortEvent incident.
Definition: MinimalEventLoopMgr.h:58
MinimalEventLoopMgr::m_abortEventListener
SmartIF< IIncidentListener > m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: MinimalEventLoopMgr.h:53
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
StatusCode::FAILURE
Definition: StatusCode.h:29
std::exception::what
T what(T...args)
IIncidentSvc.h
implements::addRef
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:44
MinimalEventLoopMgr::nextEvent
StatusCode nextEvent(int maxevt) override
implementation of IEventProcessor::nextEvent
Definition: MinimalEventLoopMgr.cpp:297
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
RetCodeGuard::m_retcode
int m_retcode
Definition: RetCodeGuard.h:23
MsgStream::clear
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:222
GaudiException.h
SmartIF.h
MinimalEventLoopMgr::start
StatusCode start() override
implementation of IService::start
Definition: MinimalEventLoopMgr.cpp:145
MinimalEventLoopMgr::stopRun
StatusCode stopRun() override
implementation of IEventProcessor::stopRun( )
Definition: MinimalEventLoopMgr.cpp:434
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
MinimalEventLoopMgr::topAlgHandler
void topAlgHandler(Property &p)
Top algorithm List handler.
Definition: MinimalEventLoopMgr.cpp:448
Service::stop
StatusCode stop() override
Definition: Service.cpp:146
std::vector::clear
T clear(T...args)
RetCodeGuard::m_appmgr
SmartIF< IProperty > m_appmgr
Definition: RetCodeGuard.h:22
MinimalEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: MinimalEventLoopMgr.h:37
std::exception
STL class.
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:50
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:25
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
MinimalEventLoopMgr::restart
StatusCode restart() override
implementation of IService::restart
Definition: MinimalEventLoopMgr.cpp:222
LIKELY
#define LIKELY(x)
Definition: Kernel.h:125
AppReturnCode.h
std::vector::size
T size(T...args)
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:41
MinimalEventLoopMgr.h
std::begin
T begin(T...args)
Io::CREATE
Definition: IFileMgr.h:30
Gaudi::Utils::TypeNameString::type
const std::string & type() const
Definition: TypeNameString.h:22
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17
IIncidentSvc::addListener
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
TypeNameString.h
ana.item
tuple item
print s1,s2
Definition: ana.py:146
CommonMessaging
Definition: CommonMessaging.h:58
RetCodeGuard::RetCodeGuard
RetCodeGuard(const SmartIF< IProperty > &appmgr, int retcode)
Definition: RetCodeGuard.h:11
IAlgManager.h
IIncidentListener.h
MinimalEventLoopMgr::m_outStreamType
std::string m_outStreamType
Out Stream type.
Definition: MinimalEventLoopMgr.h:43
RetCodeGuard::ignore
void ignore()
Definition: RetCodeGuard.h:13
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
IIncidentSvc::removeListener
virtual void removeListener(IIncidentListener *lis, const std::string &type="")=0
Remove listener.
Gaudi::Utils::TypeNameString::name
const std::string & name() const
Definition: TypeNameString.h:23
MinimalEventLoopMgr::m_topAlgNames
StringArrayProperty m_topAlgNames
List of top level algorithms names.
Definition: MinimalEventLoopMgr.h:45
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:46
MinimalEventLoopMgr::decodeOutStreams
StatusCode decodeOutStreams()
decodeOutStreamNameList & outStreamNameListHandler
Definition: MinimalEventLoopMgr.cpp:509
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:112
Service::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:215
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:16
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
std::for_each
T for_each(T...args)
MinimalEventLoopMgr::executeRun
StatusCode executeRun(int maxevt) override
implementation of IEventProcessor::executeRun( )
Definition: MinimalEventLoopMgr.cpp:306
getGaudiThreadIDfromName
GAUDI_API std::string getGaudiThreadIDfromName(const std::string &name)
helper function to extract Gaudi Thread ID from thread copy name
Definition: ThreadGaudi.cpp:26
ana.i
list i
Definition: ana.py:128
MinimalEventLoopMgr::m_outStreamNames
StringArrayProperty m_outStreamNames
List of output stream names.
Definition: MinimalEventLoopMgr.h:47
MinimalEventLoopMgr::MinimalEventLoopMgr
MinimalEventLoopMgr(const std::string &nam, ISvcLocator *svcLoc)
Standard Constructor.
Definition: MinimalEventLoopMgr.cpp:52
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_appMgrUI
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
Definition: MinimalEventLoopMgr.h:35
MinimalEventLoopMgr::executeEvent
StatusCode executeEvent(void *par) override
implementation of IEventProcessor::executeEvent(void* par)
Definition: MinimalEventLoopMgr.cpp:358
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39
std::vector::reserve
T reserve(T...args)
MinimalEventLoopMgr::m_abortEvent
bool m_abortEvent
Flag signalling that the event being processedhas to be aborted (skip all following top algs)...
Definition: MinimalEventLoopMgr.h:56