| The Gaudi Framework v32r1 (f65d50dc)

HiveReadAlgorithm.cpp
Go to the documentation of this file.
1 #include "GaudiAlg/GaudiAlgorithm.h"
2 #include "GaudiKernel/DataStoreItem.h"
3 #include "GaudiKernel/ThreadLocalContext.h"
4
5 class GAUDI_API HiveReadAlgorithm : public GaudiAlgorithm {
6 public:
7 using GaudiAlgorithm::GaudiAlgorithm;
8 StatusCode initialize() override;
9 StatusCode execute() override;
10 };
11
12 DECLARE_COMPONENT( HiveReadAlgorithm )
13
14 StatusCode HiveReadAlgorithm::initialize() {
15 StatusCode sc = GaudiAlgorithm::initialize();
16 if ( !sc ) return sc;
17 return evtSvc()->addPreLoadItem( DataStoreItem( "/Event", 99 ) );
18 }
19
20 StatusCode HiveReadAlgorithm::execute() {
21 info() << "Running now for event " << Gaudi::Hive::currentContext().evt() << endmsg;
22 return evtSvc()->preLoad();
23 }
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:40
GaudiAlgorithm::initialize
StatusCode initialize() override
standard initialization method
Definition: GaudiAlgorithm.cpp:42
ThreadLocalContext.h
GaudiAlgorithm.h
Header file for class GaudiAlgorithm.
GaudiAlgorithm::execute
StatusCode execute() override
standard execution method
Definition: GaudiAlgorithm.cpp:67
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
DataStoreItem.h
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
GaudiAlgorithm
The useful base class for data processing algorithms.
Definition: GaudiAlgorithm.h:94
Gaudi::Hive::currentContext
GAUDI_API const EventContext & currentContext()
Definition: ThreadLocalContext.cpp:20
HiveReadAlgorithm::execute
StatusCode execute() override
Definition: HiveReadAlgorithm.cpp:20
HiveReadAlgorithm
Definition: HiveReadAlgorithm.cpp:5
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiAlgorithm::GaudiAlgorithm
GaudiAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
Definition: GaudiAlgorithm.cpp:35