ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
ByteStreamCnvSvc
src
ByteStreamRDP_OutputSvc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//===================================================================
6
// Implementation of ByteStreamRDP_OutputSvc
7
// Initial implementation Jan 10, 2003
8
//
9
//===================================================================
10
//
11
12
// Include files.
13
#include "
ByteStreamRDP_OutputSvc.h
"
14
#include "
ByteStreamCnvSvcBase/ROBDataProviderSvc.h
"
15
16
// Constructor.
17
ByteStreamRDP_OutputSvc::ByteStreamRDP_OutputSvc
(
const
std::string& name, ISvcLocator* svcloc)
18
: base_class(name, svcloc) {
19
if
(
m_bsOutputStreamName
.empty())
m_bsOutputStreamName
= name;
20
}
21
22
// Open the first input file and read the first event.
23
StatusCode
ByteStreamRDP_OutputSvc::initialize
() {
24
ATH_MSG_INFO
(
"Initializing"
);
25
26
// Retrieve ROBDataProviderSvc
27
ATH_CHECK
(
m_robProvider
.retrieve() );
28
29
return
StatusCode::SUCCESS;
30
}
31
32
// Receive the next event without explicit context
33
bool
ByteStreamRDP_OutputSvc::putEvent
(
const
RawEvent
*
re
) {
34
return
putEvent
(
re
, Gaudi::Hive::currentContext());
35
}
36
37
// Receive the next event
38
bool
ByteStreamRDP_OutputSvc::putEvent
(
const
RawEvent
*
re
,
const
EventContext& ctx) {
39
EventCache
* cache =
m_eventsCache
.get(ctx);
40
cache->releaseEvent();
41
const
uint32_t reSize =
re
->fragment_size_word();
42
const
uint32_t* reStart =
re
->start();
43
cache->dataBuffer = std::make_unique_for_overwrite<uint32_t[]>(reSize);
44
std::copy(reStart, reStart+reSize, cache->dataBuffer.get());
45
46
// Create a cached RawEvent object from the cached data buffer
47
cache->rawEvent = std::make_unique<RawEvent>(cache->dataBuffer.get());
48
49
// Give the RawEvent to ROBDataProvider
50
m_robProvider
->setNextEvent(ctx, cache->rawEvent.get());
51
52
return
true
;
53
}
re
const std::regex re(r_e)
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ByteStreamRDP_OutputSvc.h
ROBDataProviderSvc.h
RawEvent
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition
RawEvent.h:37
ByteStreamRDP_OutputSvc::putEvent
virtual bool putEvent(const RawEvent *re) override
Implementation of the IByteStreamOutputSvc interface methods.
Definition
ByteStreamRDP_OutputSvc.cxx:33
ByteStreamRDP_OutputSvc::initialize
virtual StatusCode initialize() override
Required of all Gaudi Services.
Definition
ByteStreamRDP_OutputSvc.cxx:23
ByteStreamRDP_OutputSvc::m_robProvider
ServiceHandle< IROBDataProviderSvc > m_robProvider
Definition
ByteStreamRDP_OutputSvc.h:49
ByteStreamRDP_OutputSvc::m_bsOutputStreamName
Gaudi::Property< std::string > m_bsOutputStreamName
Definition
ByteStreamRDP_OutputSvc.h:51
ByteStreamRDP_OutputSvc::m_eventsCache
SG::SlotSpecificObj< EventCache > m_eventsCache
Cache of event data for each slot.
Definition
ByteStreamRDP_OutputSvc.h:47
ByteStreamRDP_OutputSvc::ByteStreamRDP_OutputSvc
ByteStreamRDP_OutputSvc(const std::string &name, ISvcLocator *svcloc)
Constructors:
Definition
ByteStreamRDP_OutputSvc.cxx:17
ByteStreamRDP_OutputSvc::EventCache
Definition
ByteStreamRDP_OutputSvc.h:39
Generated on
for ATLAS Offline Software by
1.17.0