ATLAS Offline Software
Classes | Public Member Functions | Private Attributes | List of all members
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: More...
 
virtual StatusCode initialize () override
 Required of all Gaudi Services. More...
 
virtual bool putEvent (const RawEvent *re) override
 Implementation of the IByteStreamOutputSvc interface methods. More...
 
virtual bool putEvent (const RawEvent *re, const EventContext &ctx) override
 

Private Attributes

SG::SlotSpecificObj< EventCachem_eventsCache
 Cache of event data for each slot. More...
 
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 }

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 }

◆ 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 }

◆ 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 }

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.

◆ 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.


The documentation for this class was generated from the following files:
ByteStreamRDP_OutputSvc::putEvent
virtual bool putEvent(const RawEvent *re) override
Implementation of the IByteStreamOutputSvc interface methods.
Definition: ByteStreamRDP_OutputSvc.cxx:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ByteStreamRDP_OutputSvc::m_bsOutputStreamName
Gaudi::Property< std::string > m_bsOutputStreamName
Definition: ByteStreamRDP_OutputSvc.h:51
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ByteStreamRDP_OutputSvc::m_robProvider
ServiceHandle< IROBDataProviderSvc > m_robProvider
Definition: ByteStreamRDP_OutputSvc.h:49
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
re
const boost::regex re(r_e)
ByteStreamRDP_OutputSvc::m_eventsCache
SG::SlotSpecificObj< EventCache > m_eventsCache
Cache of event data for each slot.
Definition: ByteStreamRDP_OutputSvc.h:47
calibdata.copy
bool copy
Definition: calibdata.py:27