ATLAS Offline Software
Loading...
Searching...
No Matches
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.
15
16// Constructor.
17ByteStreamRDP_OutputSvc::ByteStreamRDP_OutputSvc(const std::string& name, ISvcLocator* svcloc)
18 : base_class(name, svcloc) {
20}
21
22// Open the first input file and read the first event.
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
34 return putEvent(re, Gaudi::Hive::currentContext());
35}
36
37// Receive the next event
38bool 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<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}
const boost::regex re(r_e)
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition RawEvent.h:37
virtual bool putEvent(const RawEvent *re) override
Implementation of the IByteStreamOutputSvc interface methods.
virtual StatusCode initialize() override
Required of all Gaudi Services.
ServiceHandle< IROBDataProviderSvc > m_robProvider
Gaudi::Property< std::string > m_bsOutputStreamName
SG::SlotSpecificObj< EventCache > m_eventsCache
Cache of event data for each slot.
ByteStreamRDP_OutputSvc(const std::string &name, ISvcLocator *svcloc)
Constructors:
std::unique_ptr< RawEvent > rawEvent
Current event fragment.
std::unique_ptr< uint32_t[]> dataBuffer
Underlying data structure.