The Gaudi Framework
master (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
RecordOutputStream.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2023 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 "
RecordOutputStream.h
"
12
#include <
GaudiKernel/DataObject.h
>
13
14
// ----------------------------------------------------------------------------
15
// Implementation file for class: RecordOutputStream
16
//
17
// 30/08/2013: Marco Clemencic
18
// ----------------------------------------------------------------------------
19
DECLARE_COMPONENT
(
RecordOutputStream
)
20
21
// ============================================================================
22
// Initialization
23
// ============================================================================
24
StatusCode
RecordOutputStream
::
initialize
() {
25
StatusCode
sc =
Algorithm::initialize
();
// must be executed first
26
if
( sc.
isFailure
() )
return
sc;
// error printed already by Algorithm
27
28
if
(
msgLevel
(
MSG::DEBUG
) )
debug
() <<
"==> Initialize"
<<
endmsg
;
29
30
if
(
m_streamName
.empty() ) {
31
m_streamName
=
"Deferred:"
+
name
();
32
debug
() <<
"Using default OutputStreamName: '"
<<
m_streamName
<<
"'"
<<
endmsg
;
33
}
34
35
m_flagLocation
=
locationRoot
() +
"/"
+
m_streamName
;
36
return
StatusCode::SUCCESS
;
37
}
38
39
// ============================================================================
40
// Main execution
41
// ============================================================================
42
StatusCode
RecordOutputStream::execute
() {
43
if
(
msgLevel
(
MSG::DEBUG
) )
debug
() <<
"==> Execute"
<<
endmsg
;
44
45
DataObject
* tmp =
nullptr
;
46
if
( !
eventSvc
()->retrieveObject(
m_flagLocation
, tmp ) ) {
47
tmp =
new
DataObject
();
48
return
eventSvc
()->
registerObject
(
m_flagLocation
, tmp );
49
}
50
return
StatusCode::SUCCESS
;
51
}
DataObject.h
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition
MsgStream.h:198
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition
PluginServiceV1.h:45
RecordOutputStream.h
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition
CommonMessaging.h:118
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition
CommonMessaging.h:127
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition
DataObject.h:37
Gaudi::Algorithm::eventSvc
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
Definition
Algorithm.cpp:551
Gaudi::Algorithm::initialize
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition
Algorithm.h:175
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition
Algorithm.cpp:518
IDataProviderSvc::registerObject
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Definition
IDataProviderSvc.h:67
RecordOutputStream
Simple class that adds an entry to the Transient Event Store to record that the processing flow trigg...
Definition
RecordOutputStream.h:28
RecordOutputStream::execute
StatusCode execute() override
Algorithm execution.
Definition
RecordOutputStream.cpp:42
RecordOutputStream::locationRoot
static const std::string locationRoot()
Return the path in the Transient Store used to record the triggered instances.
Definition
RecordOutputStream.h:37
RecordOutputStream::m_flagLocation
std::string m_flagLocation
location of the DataObject flag used to record that this algorithm was called
Definition
RecordOutputStream.h:45
RecordOutputStream::initialize
StatusCode initialize() override
Algorithm initialization.
Definition
RecordOutputStream.cpp:24
RecordOutputStream::m_streamName
Gaudi::Property< std::string > m_streamName
Definition
RecordOutputStream.h:40
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::isFailure
bool isFailure() const
Definition
StatusCode.h:118
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition
StatusCode.h:99
MSG::DEBUG
@ DEBUG
Definition
IMessageSvc.h:22
GaudiMP
src
component
RecordOutputStream.cpp
Generated on
for The Gaudi Framework by
1.17.0