ATLAS Offline Software
Classes | Public Member Functions | Static 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 ByteStreamOutputSvc interface methods. More...
 
virtual bool putEvent (const RawEvent *re, const EventContext &ctx) override
 context-aware method for writing the event More...
 
StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface) override
 Required of all Gaudi services: see Gaudi documentation for details. More...
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Retrieve interface ID. More...
 

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 ByteStreamOutputSvc for the conversion service to write the output.

Definition at line 25 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  : ByteStreamOutputSvc(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  if (!ByteStreamOutputSvc::initialize().isSuccess()) {
26  ATH_MSG_FATAL("Cannot initialize ByteStreamOutputSvc base class.");
27  return(StatusCode::FAILURE);
28  }
29 
30  // Retrieve ROBDataProviderSvc
31  if (!m_robProvider.retrieve().isSuccess()) {
32  ATH_MSG_FATAL("Cannot get ROBDataProviderSvc");
33  return(StatusCode::FAILURE);
34  }
35  return(StatusCode::SUCCESS);
36 }

◆ interfaceID()

const InterfaceID & ByteStreamOutputSvc::interfaceID ( )
inlinestaticinherited

Retrieve interface ID.

Declaration of the interface ID ( interface id, major version, minor version)

Definition at line 43 of file ByteStreamOutputSvc.h.

43  {
46  static const InterfaceID IID_ByteStreamOutputSvc("ByteStreamOutputSvc", 1, 0);
47  return(IID_ByteStreamOutputSvc);
48 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Service >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Service >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Service >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ putEvent() [1/2]

bool ByteStreamRDP_OutputSvc::putEvent ( const RawEvent re)
overridevirtual

Implementation of the ByteStreamOutputSvc interface methods.

Implements ByteStreamOutputSvc.

Definition at line 39 of file ByteStreamRDP_OutputSvc.cxx.

39  {
40  return putEvent(re, Gaudi::Hive::currentContext());
41 }

◆ putEvent() [2/2]

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

context-aware method for writing the event

Implements ByteStreamOutputSvc.

Definition at line 44 of file ByteStreamRDP_OutputSvc.cxx.

44  {
45  EventCache* cache = m_eventsCache.get(ctx);
46  cache->releaseEvent();
47  const uint32_t reSize = re->fragment_size_word();
48  const uint32_t* reStart = re->start();
49  cache->dataBuffer = std::make_unique<uint32_t[]>(reSize);
50  std::copy(reStart, reStart+reSize, cache->dataBuffer.get());
51 
52  // Create a cached RawEvent object from the cached data buffer
53  cache->rawEvent = std::make_unique<RawEvent>(cache->dataBuffer.get());
54 
55  // Give the RawEvent to ROBDataProvider
56  m_robProvider->setNextEvent(ctx, cache->rawEvent.get());
57 
58  return true;
59 }

◆ queryInterface()

StatusCode ByteStreamRDP_OutputSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
override

Required of all Gaudi services: see Gaudi documentation for details.

Definition at line 61 of file ByteStreamRDP_OutputSvc.cxx.

61  {
62  if (ByteStreamOutputSvc::interfaceID().versionMatch(riid)) {
63  *ppvInterface = dynamic_cast<ByteStreamOutputSvc*>(this);
64  } else {
65  // Interface is not directly available: try out a base class
66  return(::AthService::queryInterface(riid, ppvInterface));
67  }
68  addRef();
69  return(StatusCode::SUCCESS);
70 }

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 53 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 49 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 51 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 ByteStreamOutputSvc interface methods.
Definition: ByteStreamRDP_OutputSvc.cxx:39
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
initialize
void initialize()
Definition: run_EoverP.cxx:894
ByteStreamRDP_OutputSvc::m_bsOutputStreamName
Gaudi::Property< std::string > m_bsOutputStreamName
Definition: ByteStreamRDP_OutputSvc.h:53
ByteStreamRDP_OutputSvc::m_robProvider
ServiceHandle< IROBDataProviderSvc > m_robProvider
Definition: ByteStreamRDP_OutputSvc.h:51
ByteStreamOutputSvc::interfaceID
static const InterfaceID & interfaceID()
Retrieve interface ID.
Definition: ByteStreamOutputSvc.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ByteStreamOutputSvc::ByteStreamOutputSvc
ByteStreamOutputSvc(const std::string &name, ISvcLocator *svcloc)
constructor
Definition: ByteStreamOutputSvc.cxx:9
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:49
ByteStreamOutputSvc
This class provides the base class to services to write bytestream data. The concrete class can provi...
Definition: ByteStreamOutputSvc.h:25
calibdata.copy
bool copy
Definition: calibdata.py:27