ATLAS Offline Software
Loading...
Searching...
No Matches
ByteStreamRDP_OutputSvc Class Reference

Writing the data to ROBDataProviderSvc for transient BS. More...

#include <ByteStreamRDP_OutputSvc.h>

Inheritance diagram for ByteStreamRDP_OutputSvc:
Collaboration diagram for ByteStreamRDP_OutputSvc:

Classes

struct  EventCache

Public Member Functions

 ByteStreamRDP_OutputSvc (const std::string &name, ISvcLocator *svcloc)
 Constructors:
virtual StatusCode initialize () override
 Required of all Gaudi Services.
virtual bool putEvent (const RawEvent *re) override
 Implementation of the IByteStreamOutputSvc interface methods.
virtual bool putEvent (const RawEvent *re, const EventContext &ctx) override

Private Attributes

SG::SlotSpecificObj< EventCachem_eventsCache
 Cache of event data for each slot.
ServiceHandle< IROBDataProviderSvcm_robProvider
Gaudi::Property< std::string > m_bsOutputStreamName

Detailed Description

Writing the data to ROBDataProviderSvc for transient BS.

        RDP == RobDataProvider

Description: An class for writing FullEventFragment into RobDataProvider this class implements the interface IByteStreamOutputSvc for the conversion service to write the output.

Definition at line 26 of file ByteStreamRDP_OutputSvc.h.

Constructor & Destructor Documentation

◆ ByteStreamRDP_OutputSvc()

ByteStreamRDP_OutputSvc::ByteStreamRDP_OutputSvc ( const std::string & name,
ISvcLocator * svcloc )

Constructors:

Definition at line 17 of file ByteStreamRDP_OutputSvc.cxx.

18 : base_class(name, svcloc) {
20}
Gaudi::Property< std::string > m_bsOutputStreamName

Member Function Documentation

◆ initialize()

StatusCode ByteStreamRDP_OutputSvc::initialize ( )
overridevirtual

Required of all Gaudi Services.

Definition at line 23 of file ByteStreamRDP_OutputSvc.cxx.

23 {
24 ATH_MSG_INFO("Initializing");
25
26 // Retrieve ROBDataProviderSvc
27 ATH_CHECK( m_robProvider.retrieve() );
28
29 return StatusCode::SUCCESS;
30}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
ServiceHandle< IROBDataProviderSvc > m_robProvider

◆ putEvent() [1/2]

bool ByteStreamRDP_OutputSvc::putEvent ( const RawEvent * re)
overridevirtual

Implementation of the IByteStreamOutputSvc interface methods.

Definition at line 33 of file ByteStreamRDP_OutputSvc.cxx.

33 {
34 return putEvent(re, Gaudi::Hive::currentContext());
35}
const boost::regex re(r_e)
virtual bool putEvent(const RawEvent *re) override
Implementation of the IByteStreamOutputSvc interface methods.

◆ putEvent() [2/2]

bool ByteStreamRDP_OutputSvc::putEvent ( const RawEvent * re,
const EventContext & ctx )
overridevirtual

Definition at line 38 of file ByteStreamRDP_OutputSvc.cxx.

38 {
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}
SG::SlotSpecificObj< EventCache > m_eventsCache
Cache of event data for each slot.
setEventNumber uint32_t

Member Data Documentation

◆ m_bsOutputStreamName

Gaudi::Property<std::string> ByteStreamRDP_OutputSvc::m_bsOutputStreamName
private
Initial value:
{
this, "BSOutputStreamName", "", "Stream name for multiple output"}

Definition at line 51 of file ByteStreamRDP_OutputSvc.h.

51 {
52 this, "BSOutputStreamName", "", "Stream name for multiple output"};

◆ m_eventsCache

SG::SlotSpecificObj<EventCache> ByteStreamRDP_OutputSvc::m_eventsCache
private

Cache of event data for each slot.

Definition at line 47 of file ByteStreamRDP_OutputSvc.h.

◆ m_robProvider

ServiceHandle<IROBDataProviderSvc> ByteStreamRDP_OutputSvc::m_robProvider
private
Initial value:
{
this, "ROBDataProviderSvc", "ROBDataProviderSvc", "ROB data provider"}

Definition at line 49 of file ByteStreamRDP_OutputSvc.h.

49 {
50 this, "ROBDataProviderSvc", "ROBDataProviderSvc", "ROB data provider"};

The documentation for this class was generated from the following files: