Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
StopperAlg.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // Include files
12 #include "GaudiKernel/DataObject.h"
15 #include "GaudiKernel/MsgStream.h"
16 
17 #include "StopperAlg.h"
18 
19 // Static Factory declaration
20 
22 
23 //------------------------------------------------------------------------------
24 StatusCode StopperAlg::initialize() {
25  //------------------------------------------------------------------------------
26  return StatusCode::SUCCESS;
27 }
28 
29 //------------------------------------------------------------------------------
31  //------------------------------------------------------------------------------
32  static int count = 0;
33 
34  if ( ++count >= m_stopcount ) {
35  info() << "scheduling a event processing stop...." << endmsg;
36  auto evt = service<IEventProcessor>( "ApplicationMgr" );
37  if ( evt->stopRun().isFailure() ) {
38  error() << "unable to schedule a stopRun" << endmsg;
39  return StatusCode::FAILURE;
40  }
41  }
42 
43  return StatusCode::SUCCESS;
44 }
45 
46 //------------------------------------------------------------------------------
48  //------------------------------------------------------------------------------
49  return StatusCode::SUCCESS;
50 }
IOTest.evt
evt
Definition: IOTest.py:105
StopperAlg.h
IDataProviderSvc.h
StopperAlg
Definition: StopperAlg.h:24
StatusCode
Definition: StatusCode.h:65
StopperAlg::finalize
StatusCode finalize() override
Definition: StopperAlg.cpp:47
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
DataObject.h
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
StopperAlg::execute
StatusCode execute() override
standard execution method
Definition: StopperAlg.cpp:30
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
IEventProcessor.h
StopperAlg::m_stopcount
Gaudi::Property< int > m_stopcount
Definition: StopperAlg.h:35
MsgStream.h