| The Gaudi Framework v32r1 (f65d50dc)

MinimalEventLoopMgr.cpp
Go to the documentation of this file.
1 #define GAUDIKERNEL_MINIMALEVENTLOOPMGR_CPP
2
3 #include "GaudiKernel/AppReturnCode.h"
4 #include "GaudiKernel/GaudiException.h"
5 #include "GaudiKernel/IAlgManager.h"
6 #include "GaudiKernel/IAlgorithm.h"
7 #include "GaudiKernel/IIncidentListener.h"
8 #include "GaudiKernel/IIncidentSvc.h"
9 #include "GaudiKernel/Incident.h"
10 #include "GaudiKernel/MsgStream.h"
11 #include "GaudiKernel/SmartIF.h"
12 #include "GaudiKernel/ThreadLocalContext.h"
13 #include "GaudiKernel/TypeNameString.h"
14
15 #include "GaudiKernel/MinimalEventLoopMgr.h"
16
17 #include <algorithm>
18
19 #define ON_DEBUG if ( UNLIKELY( outputLevel() <= MSG::DEBUG ) )
20 #define ON_VERBOSE if ( UNLIKELY( outputLevel() <= MSG::VERBOSE ) )
21
22 #define DEBMSG ON_DEBUG debug()
23 #define VERMSG ON_VERBOSE verbose()
24
25 //--------------------------------------------------------------------------------------------
26 // Standard Constructor
27 //--------------------------------------------------------------------------------------------
28 MinimalEventLoopMgr::MinimalEventLoopMgr( const std::string& nam, ISvcLocator* svcLoc )
29 : base_class( nam, svcLoc ), m_appMgrUI( svcLoc ) {}
30
31 //--------------------------------------------------------------------------------------------
32 // implementation of IAppMgrUI::initialize
33 //--------------------------------------------------------------------------------------------
34 StatusCode MinimalEventLoopMgr::initialize() {
35
36 if ( !m_appMgrUI ) return StatusCode::FAILURE;
37
38 StatusCode sc = Service::initialize();
39 if ( !sc.isSuccess() ) {
40 error() << "Failed to initialize Service Base class." << endmsg;
41 return StatusCode::FAILURE;
42 }
43
44 auto prpMgr = serviceLocator()->as<IProperty>();
45 if ( !prpMgr ) {
46 error() << "Error retrieving AppMgr interface IProperty." << endmsg;
47 return StatusCode::FAILURE;
48 }
49 if ( m_topAlgNames.value().empty() ) { setProperty( prpMgr->getProperty( "TopAlg" ) ).ignore(); }
50 if ( m_outStreamNames.value().empty() ) { setProperty( prpMgr->getProperty( "OutStream" ) ).ignore(); }
51
52 // Get the references to the services that are needed by the ApplicationMgr itself
53 m_incidentSvc = serviceLocator()->service( "IncidentSvc" );
54 if ( !m_incidentSvc ) {
55 fatal() << "Error retrieving IncidentSvc." << endmsg;
56 return StatusCode::FAILURE;
57 }
58
59 m_incidentSvc->addListener( &m_abortEventListener, IncidentType::AbortEvent );
60
61 // The state is changed at this moment to allow decodeXXXX() to do something
62 m_state = INITIALIZED;
63
64 // Get WhiteBoard interface if implemented by EventDataSvc
65 m_WB = service( "EventDataSvc" );
66
67 // setup the default EventContext with slot 0
68 Gaudi::Hive::setCurrentContextId( Gaudi::Hive::ContextIdType( 0 ) );
69
70 //--------------------------------------------------------------------------------------------
71 // Create output streams. Do not initialize them yet.
72 // The state is updated temporarily in order to enable the handler, which
73 // is also triggered by a change to the "OutputStream" Property.
74 //--------------------------------------------------------------------------------------------
75 sc = decodeOutStreams();
76 if ( !sc.isSuccess() ) {
77 error() << "Failed to initialize Output streams." << endmsg;
78 m_state = CONFIGURED;
79 return sc;
80 }
81 //--------------------------------------------------------------------------------------------
82 // Create all needed Top Algorithms. Do not initialize them yet.
83 // The state is updated temporarily in order to enable the handler, which
84 // is also triggered by a change to the "TopAlg" Property.
85 //--------------------------------------------------------------------------------------------
86 sc = decodeTopAlgs();
87 if ( !sc.isSuccess() ) {
88 error() << "Failed to initialize Top Algorithms streams." << endmsg;
89 m_state = CONFIGURED;
90 return sc;
91 }
92
93 // Initialize all the new TopAlgs. In fact Algorithms are protected against
94 // getting initialized twice.
95 for ( auto& ita : m_topAlgList ) {
96 sc = ita->sysInitialize();
97 if ( !sc.isSuccess() ) {
98 error() << "Unable to initialize Algorithm: " << ita->name() << endmsg;
99 return sc;
100 }
101 }
102 for ( auto& ita : m_outStreamList ) {
103 sc = ita->sysInitialize();
104 if ( !sc.isSuccess() ) {
105 error() << "Unable to initialize Output Stream: " << ita->name() << endmsg;
106 return sc;
107 }
108 }
109
110 // get hold of the Algorithm Execution State mgr
111 m_aess = serviceLocator()->service( "AlgExecStateSvc" );
112 if ( !m_aess ) {
113 fatal() << "Error retrieving AlgExecStateSvc." << endmsg;
114 return StatusCode::FAILURE;
115 }
116
117 if ( m_printCFExp && !m_topAlgList.empty() ) {
118 info() << "Control Flow Expression:" << endmsg;
119 std::stringstream expr;
120 auto& first = m_topAlgList.front();
121 for ( auto& ialg : m_topAlgList ) {
122 if ( ialg != first ) expr << " >> ";
123 ialg->toControlFlowExpression( expr );
124 }
125 info() << expr.str() << endmsg;
126 }
127 return StatusCode::SUCCESS;
128 }
129 //--------------------------------------------------------------------------------------------
130 // implementation of IAppMgrUI::start
131 //--------------------------------------------------------------------------------------------
132 StatusCode MinimalEventLoopMgr::start() {
133
134 StatusCode sc = Service::start();
135 if ( !sc.isSuccess() ) return sc;
136
137 // Start all the new TopAlgs. In fact Algorithms are protected against getting
138 // started twice.
139 for ( auto& ita : m_topAlgList ) {
140 sc = ita->sysStart();
141 if ( !sc.isSuccess() ) {
142 error() << "Unable to start Algorithm: " << ita->name() << endmsg;
143 return sc;
144 }
145 }
146 for ( auto& ita : m_outStreamList ) {
147 sc = ita->sysStart();
148 if ( !sc.isSuccess() ) {
149 error() << "Unable to start Output Stream: " << ita->name() << endmsg;
150 return sc;
151 }
152 }
153 return StatusCode::SUCCESS;
154 }
155 //--------------------------------------------------------------------------------------------
156 // implementation of IAppMgrUI::stop
157 //--------------------------------------------------------------------------------------------
158 StatusCode MinimalEventLoopMgr::stop() {
159
160 StatusCode sc( StatusCode::SUCCESS, true );
161
162 // Stop all the TopAlgs. In fact Algorithms are protected against getting
163 // stopped twice.
164 for ( auto& ita : m_topAlgList ) {
165 sc = ita->sysStop();
166 if ( !sc.isSuccess() ) {
167 error() << "Unable to stop Algorithm: " << ita->name() << endmsg;
168 return sc;
169 }
170 }
171 for ( auto& ita : m_outStreamList ) {
172 sc = ita->sysStop();
173 if ( !sc.isSuccess() ) {
174 error() << "Unable to stop Output Stream: " << ita->name() << endmsg;
175 return sc;
176 }
177 }
178
179 return Service::stop();
180 }
181
182 //--------------------------------------------------------------------------------------------
183 // implementation of IService::reinitialize
184 //--------------------------------------------------------------------------------------------
185 StatusCode MinimalEventLoopMgr::reinitialize() {
186 StatusCode sc = StatusCode::SUCCESS;
187
188 // Reinitialize all the TopAlgs.
189 for ( auto& ita : m_topAlgList ) {
190 sc = ita->sysReinitialize();
191 if ( !sc.isSuccess() ) {
192 error() << "Unable to reinitialize Algorithm: " << ita->name() << endmsg;
193 return sc;
194 }
195 }
196 for ( auto& ita : m_outStreamList ) {
197 sc = ita->sysReinitialize();
198 if ( !sc.isSuccess() ) {
199 error() << "Unable to reinitialize Output Stream: " << ita->name() << endmsg;
200 return sc;
201 }
202 }
203
204 return sc;
205 }
206 //--------------------------------------------------------------------------------------------
207 // implementation of IService::restart
208 //--------------------------------------------------------------------------------------------
209 StatusCode MinimalEventLoopMgr::restart() {
210 StatusCode sc = StatusCode::SUCCESS;
211
212 // Restart all the TopAlgs.
213 for ( auto& ita : m_topAlgList ) {
214 m_aess->resetErrorCount( ita );
215 sc = ita->sysRestart();
216 if ( !sc.isSuccess() ) {
217 error() << "Unable to restart Algorithm: " << ita->name() << endmsg;
218 return sc;
219 }
220 }
221 for ( auto& ita : m_outStreamList ) {
222 m_aess->resetErrorCount( ita );
223 sc = ita->sysRestart();
224 if ( !sc.isSuccess() ) {
225 error() << "Unable to restart Output Stream: " << ita->name() << endmsg;
226 return sc;
227 }
228 }
229
230 return sc;
231 }
232
233 //--------------------------------------------------------------------------------------------
234 // implementation of IService::finalize
235 //--------------------------------------------------------------------------------------------
236 StatusCode MinimalEventLoopMgr::finalize() {
237 StatusCode sc = StatusCode::SUCCESS;
238 StatusCode scRet = StatusCode::SUCCESS;
239 // Call the finalize() method of all top algorithms
240 for ( auto& ita : m_topAlgList ) {
241 sc = ita->sysFinalize();
242 if ( !sc.isSuccess() ) {
243 scRet = StatusCode::FAILURE;
244 warning() << "Finalization of algorithm " << ita->name() << " failed" << endmsg;
245 }
246 }
247 // Call the finalize() method of all Output streams
248 for ( auto& ita : m_outStreamList ) {
249 sc = ita->sysFinalize();
250 if ( !sc.isSuccess() ) {
251 scRet = StatusCode::FAILURE;
252 warning() << "Finalization of algorithm " << ita->name() << " failed" << endmsg;
253 }
254 }
255 // release all top algorithms
256 auto algMan = serviceLocator()->as<IAlgManager>();
257 for ( auto& ita : m_topAlgList ) {
258 if ( algMan->removeAlgorithm( ita ).isFailure() ) {
259 scRet = StatusCode::FAILURE;
260 warning() << "Problems removing Algorithm " << ita->name() << endmsg;
261 }
262 }
263 m_topAlgList.clear();
264 m_outStreamList.clear();
265 if ( sc.isSuccess() ) m_state = FINALIZED;
266
267 m_incidentSvc->removeListener( &m_abortEventListener, IncidentType::AbortEvent );
268
269 m_incidentSvc.reset();
270 m_appMgrUI.reset();
271
272 sc = Service::finalize();
273
274 if ( sc.isFailure() ) {
275 scRet = StatusCode::FAILURE;
276 error() << "Problems finalizing Service base class" << endmsg;
277 }
278
279 return scRet;
280 }
281
282 EventContext MinimalEventLoopMgr::createEventContext() { return EventContext{m_nevt++, 0}; }
283 //--------------------------------------------------------------------------------------------
284 // implementation of IAppMgrUI::nextEvent
285 //--------------------------------------------------------------------------------------------
286 StatusCode MinimalEventLoopMgr::nextEvent( int /* maxevt */ ) {
287 error() << "This method cannot be called on an object of type " << System::typeinfoName( typeid( *this ) ) << endmsg;
288 return StatusCode::FAILURE;
289 }
290
291 //--------------------------------------------------------------------------------------------
292 // IEventProcessing::executeRun
293 //--------------------------------------------------------------------------------------------
294 StatusCode MinimalEventLoopMgr::executeRun( int maxevt ) {
295 // Call now the nextEvent(...)
296 return nextEvent( maxevt );
297 }
298
299 namespace {
302 class RetCodeGuard {
303 public:
304 inline RetCodeGuard( SmartIF<IProperty> appmgr, int retcode )
305 : m_appmgr( std::move( appmgr ) ), m_retcode( retcode ) {}
306 inline void ignore() { m_retcode = Gaudi::ReturnCode::Success; }
307 inline ~RetCodeGuard() {
308 if ( UNLIKELY( Gaudi::ReturnCode::Success != m_retcode ) ) { Gaudi::setAppReturnCode( m_appmgr, m_retcode ); }
309 }
310
311 private:
312 SmartIF<IProperty> m_appmgr;
313 int m_retcode;
314 };
315 } // namespace
316 //--------------------------------------------------------------------------------------------
317 // Implementation of IEventProcessor::executeEvent(void* par)
318 //--------------------------------------------------------------------------------------------
319 StatusCode MinimalEventLoopMgr::executeEvent( EventContext&& context ) {
320 bool eventfailed = false;
321
322 m_aess->reset( context );
323
324 // select the appropriate store
325 if ( m_WB.isValid() ) m_WB->selectStore( context.slot() ).ignore();
326
327 // Get the IProperty interface of the ApplicationMgr to pass it to RetCodeGuard
328 const auto appmgr = serviceLocator()->as<IProperty>();
329 // Call the execute() method of all top algorithms
330 for ( auto& ita : m_topAlgList ) {
331 StatusCode sc( StatusCode::FAILURE );
332 try {
333 if ( UNLIKELY( m_abortEventListener.abortEvent ) ) {
334 DEBMSG << "AbortEvent incident fired by " << m_abortEventListener.abortEventSource << endmsg;
335 m_abortEventListener.abortEvent = false;
336 sc.ignore();
337 break;
338 }
339 RetCodeGuard rcg( appmgr, Gaudi::ReturnCode::UnhandledException );
340 sc = ita->sysExecute( context );
341 rcg.ignore(); // disarm the guard
342 } catch ( const GaudiException& Exception ) {
343 fatal() << ".executeEvent(): Exception with tag=" << Exception.tag() << " thrown by " << ita->name() << endmsg;
344 error() << Exception << endmsg;
345 } catch ( const std::exception& Exception ) {
346 fatal() << ".executeEvent(): Standard std::exception thrown by " << ita->name() << endmsg;
347 error() << Exception.what() << endmsg;
348 } catch ( ... ) { fatal() << ".executeEvent(): UNKNOWN Exception thrown by " << ita->name() << endmsg; }
349
350 if ( UNLIKELY( !sc.isSuccess() ) ) {
351 warning() << "Execution of algorithm " << ita->name() << " failed" << endmsg;
352 eventfailed = true;
353 }
354 }
355
356 m_aess->updateEventStatus( eventfailed, context );
357
358 // ensure that the abortEvent flag is cleared before the next event
359 if ( UNLIKELY( m_abortEventListener.abortEvent ) ) {
360 DEBMSG << "AbortEvent incident fired by " << m_abortEventListener.abortEventSource << endmsg;
361 m_abortEventListener.abortEvent = false;
362 }
363
364 // Call the execute() method of all output streams
365 for ( auto& ito : m_outStreamList ) {
366 AlgExecState& state = m_aess->algExecState( ito, context );
367 state.setFilterPassed( true );
368 StatusCode sc = ito->sysExecute( context );
369 if ( UNLIKELY( !sc.isSuccess() ) ) {
370 warning() << "Execution of output stream " << ito->name() << " failed" << endmsg;
371 eventfailed = true;
372 }
373 }
374
375 // Check if there was an error processing current event
376 if ( UNLIKELY( eventfailed ) ) {
377 error() << "Error processing event loop." << endmsg;
378 std::ostringstream ost;
379 m_aess->dump( ost, context );
380 debug() << "Dumping AlgExecStateSvc status:\n" << ost.str() << endmsg;
381 return StatusCode( StatusCode::FAILURE, true );
382 }
383
384 return StatusCode( StatusCode::SUCCESS, true );
385 }
386 //--------------------------------------------------------------------------------------------
387 // Implementation of IEventProcessor::stopRun()
388 //--------------------------------------------------------------------------------------------
389 StatusCode MinimalEventLoopMgr::stopRun() {
390 // Set the application return code
391 auto appmgr = serviceLocator()->as<IProperty>();
392 if ( Gaudi::setAppReturnCode( appmgr, Gaudi::ReturnCode::ScheduledStop ).isFailure() ) {
393 error() << "Could not set return code of the application (" << Gaudi::ReturnCode::ScheduledStop << ")" << endmsg;
394 }
395 m_scheduledStop = true;
396 return StatusCode::SUCCESS;
397 }
398
399 //--------------------------------------------------------------------------------------------
400 // Top algorithm List handler
401 //--------------------------------------------------------------------------------------------
402 void MinimalEventLoopMgr::topAlgHandler( Gaudi::Details::PropertyBase& /* theProp */ ) {
403 if ( !( decodeTopAlgs() ).isSuccess() ) {
404 throw GaudiException( "Failed to initialize Top Algorithms streams.", "MinimalEventLoopMgr::topAlgHandler",
405 StatusCode::FAILURE );
406 }
407 }
408
409 //--------------------------------------------------------------------------------------------
410 // decodeTopAlgNameList & topAlgNameListHandler
411 //--------------------------------------------------------------------------------------------
412 StatusCode MinimalEventLoopMgr::decodeTopAlgs() {
413 StatusCode sc = StatusCode::SUCCESS;
414 if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
415 auto algMan = serviceLocator()->as<IAlgManager>();
416 if ( algMan ) {
417 // Reset the existing Top Algorithm List
418 m_topAlgList.clear();
419 m_topAlgList.reserve( m_topAlgNames.value().size() );
420 for ( const auto& it : m_topAlgNames.value() ) {
421 Gaudi::Utils::TypeNameString item{it};
422 // Got the type and name. Now creating the algorithm, avoiding duplicate creation.
423 std::string item_name = item.name();
424 const bool CREATE = false;
425 SmartIF<IAlgorithm> alg = algMan->algorithm( item_name, CREATE );
426 if ( alg ) {
427 DEBMSG << "Top Algorithm " << item_name << " already exists" << endmsg;
428 } else {
429 DEBMSG << "Creating Top Algorithm " << item.type() << " with name " << item_name << endmsg;
430 IAlgorithm* ialg = nullptr;
431 StatusCode sc1 = algMan->createAlgorithm( item.type(), item_name, ialg );
432 if ( !sc1.isSuccess() ) {
433 error() << "Unable to create Top Algorithm " << item.type() << " with name " << item_name << endmsg;
434 return sc1;
435 }
436 alg = ialg; // manage reference counting
437 }
438 m_topAlgList.push_back( alg );
439 }
440 return sc;
441 }
442 sc = StatusCode::FAILURE;
443 }
444 return sc;
445 }
446
447 //--------------------------------------------------------------------------------------------
448 // Output stream List handler
449 //--------------------------------------------------------------------------------------------
450 void MinimalEventLoopMgr::outStreamHandler( Gaudi::Details::PropertyBase& /* theProp */ ) {
451 if ( !( decodeOutStreams() ).isSuccess() ) {
452 throw GaudiException( "Failed to initialize output streams.", "MinimalEventLoopMgr::outStreamHandler",
453 StatusCode::FAILURE );
454 }
455 }
456
457 //--------------------------------------------------------------------------------------------
458 // decodeOutStreamNameList & outStreamNameListHandler
459 //--------------------------------------------------------------------------------------------
460 StatusCode MinimalEventLoopMgr::decodeOutStreams() {
461 StatusCode sc = StatusCode::SUCCESS;
462 if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
463 auto algMan = serviceLocator()->as<IAlgManager>();
464 if ( algMan ) {
465 // Reset the existing Top Algorithm List
466 m_outStreamList.clear();
467 for ( const auto& it : m_outStreamNames.value() ) {
468 Gaudi::Utils::TypeNameString item( it, m_outStreamType );
469 const bool CREATE = false;
470 SmartIF<IAlgorithm> os = algMan->algorithm( item, CREATE );
471 if ( os ) {
472 DEBMSG << "Output Stream " << item.name() << " already exists" << endmsg;
473 } else {
474 DEBMSG << "Creating Output Stream " << it << endmsg;
475 IAlgorithm* ios = nullptr;
476 StatusCode sc1 = algMan->createAlgorithm( item.type(), item.name(), ios );
477 if ( !sc1.isSuccess() ) {
478 error() << "Unable to create Output Stream " << it << endmsg;
479 return sc1;
480 }
481 os = ios; // manage reference counting
482 }
483 m_outStreamList.push_back( os );
484 }
485 return sc;
486 }
487 sc = StatusCode::FAILURE;
488 }
489 return sc;
490 }
Gaudi::Hive::ContextIdType
std::size_t ContextIdType
Internal type used for the ContextId.
Definition: ThreadLocalContext.h:13
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
MinimalEventLoopMgr::topAlgHandler
void topAlgHandler(Gaudi::Details::PropertyBase &p)
Top algorithm List handler.
Definition: MinimalEventLoopMgr.cpp:402
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:60
SmartIF< IProperty >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
std::vector::empty
T empty(T... args)
MinimalEventLoopMgr::AbortEventListener::abortEvent
bool abortEvent
Flag signalling that the event being processed has to be aborted (skip all following top algs).
Definition: MinimalEventLoopMgr.h:40
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
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
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
MinimalEventLoopMgr::finalize
StatusCode finalize() override
implementation of IService::finalize
Definition: MinimalEventLoopMgr.cpp:236
MinimalEventLoopMgr::m_scheduledStop
bool m_scheduledStop
Scheduled stop of event processing.
Definition: MinimalEventLoopMgr.h:73
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:164
Gaudi::Hive::setCurrentContextId
GAUDI_API void setCurrentContextId(ContextIdType newId)
Used by the framework to change the value of the current context id.
Definition: ThreadLocalContext.cpp:23
PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyHolder.h:145
MsgStream.h
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:101
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
Service::start
StatusCode start() override
Definition: Service.cpp:129
std::vector::front
T front(T... args)
MinimalEventLoopMgr::m_aess
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:66
IAlgorithm.h
ThreadLocalContext.h
MinimalEventLoopMgr::initialize
StatusCode initialize() override
implementation of IService::initialize
Definition: MinimalEventLoopMgr.cpp:34
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:67
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:60
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
RetCodeGuard::~RetCodeGuard
~RetCodeGuard()
Definition: RetCodeGuard.h:13
MinimalEventLoopMgr::FINALIZED
Definition: MinimalEventLoopMgr.h:60
std
STL namespace.
MinimalEventLoopMgr::CONFIGURED
Definition: MinimalEventLoopMgr.h:60
Gaudi::Utils::TypeNameString::type
const std::string & type() const
Definition: TypeNameString.h:36
MinimalEventLoopMgr::outStreamHandler
void outStreamHandler(Gaudi::Details::PropertyBase &p)
Output stream List handler.
Definition: MinimalEventLoopMgr.cpp:450
MinimalEventLoopMgr::AbortEventListener::abortEventSource
std::string abortEventSource
Source of the AbortEvent incident.
Definition: MinimalEventLoopMgr.h:42
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:103
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:104
MinimalEventLoopMgr::decodeTopAlgs
StatusCode decodeTopAlgs()
decodeTopAlgNameList & topAlgNameListHandler
Definition: MinimalEventLoopMgr.cpp:412
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
std::stringstream
STL class.
MinimalEventLoopMgr::reinitialize
StatusCode reinitialize() override
implementation of IService::reinitialize
Definition: MinimalEventLoopMgr.cpp:185
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:25
std::string
STL class.
IAlgExecStateSvc::algExecState
virtual const AlgExecState & algExecState(const Gaudi::StringKey &algName, const EventContext &ctx) const =0
MinimalEventLoopMgr::stop
StatusCode stop() override
implementation of IService::stop
Definition: MinimalEventLoopMgr.cpp:158
Incident.h
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:71
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:76
gaudirun.retcode
retcode
Definition: gaudirun.py:582
std::vector::push_back
T push_back(T... args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
MinimalEventLoopMgr::m_outStreamNames
Gaudi::Property< std::vector< std::string > > m_outStreamNames
Definition: MinimalEventLoopMgr.h:52
IHiveWhiteBoard::selectStore
virtual StatusCode selectStore(size_t partitionIndex)=0
Activate an given 'slot' for all subsequent calls within the same thread id.
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:10
IAlgExecStateSvc::dump
virtual void dump(std::ostringstream &ost, const EventContext &ctx) const =0
MinimalEventLoopMgr::m_topAlgNames
Gaudi::Property< std::vector< std::string > > m_topAlgNames
Definition: MinimalEventLoopMgr.h:50
MinimalEventLoopMgr::m_WB
SmartIF< IHiveWhiteBoard > m_WB
< Event data service (whiteboard)
Definition: MinimalEventLoopMgr.h:131
std::exception::what
T what(T... args)
IIncidentSvc.h
MinimalEventLoopMgr::nextEvent
StatusCode nextEvent(int maxevt) override
implementation of IEventProcessor::nextEvent
Definition: MinimalEventLoopMgr.cpp:286
Gaudi::Utils::TypeNameString::name
const std::string & name() const
Definition: TypeNameString.h:37
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
RetCodeGuard::m_retcode
int m_retcode
Definition: RetCodeGuard.h:19
std::ostringstream
STL class.
GaudiException.h
SmartIF.h
compareRootHistos.state
def state
Definition: compareRootHistos.py:455
MinimalEventLoopMgr::start
StatusCode start() override
implementation of IService::start
Definition: MinimalEventLoopMgr.cpp:132
std::stringstream::str
T str(T... args)
MinimalEventLoopMgr::stopRun
StatusCode stopRun() override
implementation of IEventProcessor::stopRun( )
Definition: MinimalEventLoopMgr.cpp:389
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
Service::stop
StatusCode stop() override
Definition: Service.cpp:123
MinimalEventLoopMgr::m_abortEventListener
AbortEventListener m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: MinimalEventLoopMgr.h:75
std::vector::clear
T clear(T... args)
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
RetCodeGuard::m_appmgr
SmartIF< IProperty > m_appmgr
Definition: RetCodeGuard.h:18
MinimalEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: MinimalEventLoopMgr.h:64
std::exception
STL class.
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:49
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
MinimalEventLoopMgr::restart
StatusCode restart() override
implementation of IService::restart
Definition: MinimalEventLoopMgr.cpp:209
IAlgExecStateSvc::updateEventStatus
virtual void updateEventStatus(const bool &b, const EventContext &ctx)=0
MinimalEventLoopMgr::executeEvent
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
Definition: MinimalEventLoopMgr.cpp:319
AppReturnCode.h
IAlgExecStateSvc::reset
virtual void reset(const EventContext &ctx)=0
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:69
MinimalEventLoopMgr.h
Io::CREATE
Definition: IFileMgr.h:31
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
CommonMessaging
Definition: CommonMessaging.h:56
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MinimalEventLoopMgr::createEventContext
EventContext createEventContext() override
implementation of IEventProcessor::createEventContext()
Definition: MinimalEventLoopMgr.cpp:282
RetCodeGuard::RetCodeGuard
RetCodeGuard(const SmartIF< IProperty > &appmgr, int retcode)
Definition: RetCodeGuard.h:11
IAlgManager.h
IIncidentListener.h
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:83
RetCodeGuard::ignore
void ignore()
Definition: RetCodeGuard.h:12
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:86
IIncidentSvc::removeListener
virtual void removeListener(IIncidentListener *lis, const std::string &type="")=0
Remove listener.
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:22
MinimalEventLoopMgr::decodeOutStreams
StatusCode decodeOutStreams()
decodeOutStreamNameList & outStreamNameListHandler
Definition: MinimalEventLoopMgr.cpp:460
maxevt
int maxevt
Definition: Bootstrap.cpp:260
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:20
MinimalEventLoopMgr::executeRun
StatusCode executeRun(int maxevt) override
implementation of IEventProcessor::executeRun( )
Definition: MinimalEventLoopMgr.cpp:294
MinimalEventLoopMgr::m_printCFExp
Gaudi::Property< bool > m_printCFExp
Definition: MinimalEventLoopMgr.h:56
MinimalEventLoopMgr::m_outStreamType
Gaudi::Property< std::string > m_outStreamType
Definition: MinimalEventLoopMgr.h:54
AlgExecState
Definition: IAlgExecStateSvc.h:27
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:92
IAlgExecStateSvc::resetErrorCount
virtual void resetErrorCount(const IAlgorithm *iAlg)=0
MinimalEventLoopMgr::MinimalEventLoopMgr
MinimalEventLoopMgr(const std::string &nam, ISvcLocator *svcLoc)
Standard Constructor.
Definition: MinimalEventLoopMgr.cpp:28
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
MinimalEventLoopMgr::m_appMgrUI
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
Definition: MinimalEventLoopMgr.h:62
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:67
std::vector::reserve
T reserve(T... args)
MinimalEventLoopMgr::m_nevt
size_t m_nevt
Definition: MinimalEventLoopMgr.h:134