The Gaudi Framework
v36r11 (bdb84f5f)
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
"
13
#include "
GaudiKernel/IDataProviderSvc.h
"
14
#include "
GaudiKernel/IEventProcessor.h
"
15
#include "
GaudiKernel/MsgStream.h
"
16
17
#include "
StopperAlg.h
"
18
19
// Static Factory declaration
20
21
DECLARE_COMPONENT
(
StopperAlg
)
22
23
//------------------------------------------------------------------------------
24
StatusCode
StopperAlg
::initialize() {
25
//------------------------------------------------------------------------------
26
return
StatusCode::SUCCESS
;
27
}
28
29
//------------------------------------------------------------------------------
30
StatusCode
StopperAlg::execute
() {
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
//------------------------------------------------------------------------------
47
StatusCode
StopperAlg::finalize
() {
48
//------------------------------------------------------------------------------
49
return
StatusCode::SUCCESS
;
50
}
IOTest.evt
evt
Definition:
IOTest.py:110
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
GaudiExamples
src
AlgSequencer
StopperAlg.cpp
Generated on Mon Feb 27 2023 19:04:35 for The Gaudi Framework by
1.8.18