ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
TrigByteStreamCnvSvc Class Reference

A ByteStreamCnvSvc implementation for online use. More...

#include <TrigByteStreamCnvSvc.h>

Inheritance diagram for TrigByteStreamCnvSvc:
Collaboration diagram for TrigByteStreamCnvSvc:

Public Types

typedef std::unordered_map< CLID, WorkerEntryWorkers
 

Public Member Functions

 TrigByteStreamCnvSvc (const std::string &name, ISvcLocator *svcLoc)
 Standard constructor. More...
 
virtual ~TrigByteStreamCnvSvc ()
 Standard destructor. More...
 
virtual StatusCode initialize () override
 Required of all Gaudi Services. More...
 
virtual StatusCode finalize () override
 
virtual StatusCode connectOutput (const std::string &outputFile) override
 In the case of online BS data, this method creates the output FullEventFragment and fills its header. More...
 
StatusCode connectOutput (const std::string &outputFile, const EventContext &eventContext)
 In the case of online BS data, this method creates the output FullEventFragment and fills its header. More...
 
virtual StatusCode connectOutput (const std::string &outputFile, const std::string &openMode) override
 This overload is kept only for interface compatibility. More...
 
virtual StatusCode commitOutput (const std::string &outputFile, bool do_commit) override
 In the case of online BS data, this method binds and sends out the output FullEventFragment. More...
 
StatusCode commitOutput (const std::string &outputFile, bool do_commit, const EventContext &eventContext)
 In the case of online BS data, this method binds and sends out the output FullEventFragment. More...
 
virtual RawEventWritegetRawEvent () override
 Return a pointer to the raw event for the current event context. More...
 
RawEventWritegetRawEvent (const EventContext &eventContext) const
 Return a pointer to the raw event for the given event context. More...
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface) override
 Required of all Gaudi services: see Gaudi documentation for details. More...
 
virtual StatusCode updateServiceState (IOpaqueAddress *pAddress) override
 Checks whether an IOpaqueAddress is a GenericAddress. More...
 
virtual void handle (const Incident &) override
 Implementation of IIncidentListener: Handle for EndEvent incidence. 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 ()
 Gaudi interface id. More...
 

Protected Attributes

std::vector< std::string > m_initCnvs
 
Gaudi::Property< std::vector< std::string > > m_ROD2ROBmap {this,"ROD2ROBmap",{},"","OrderedSet<std::string>"}
 

Private Member Functions

RawEventWritesetRawEvent (std::unique_ptr< RawEventWrite > &&rawEventWrite, const EventContext &eventContext)
 Store new raw event in the cache. More...
 
void clearRawEvent (const EventContext &eventContext)
 Delete raw event from the cache. More...
 
void printRawEvent (const EventContext &eventContext) const
 Print contents of the raw event. More...
 
void monitorRawEvent (const std::unique_ptr< uint32_t[]> &rawEventPtr) const
 Fill histograms from contents of a FullEventFragment. More...
 
const EventContext * currentContext () const
 Hack used in HLT to avoid using ThreadLocalContext, see explanation in the implementation. More...
 

Private Attributes

ServiceHandle< StoreGateSvcm_evtStore {this, "EventStore", "StoreGateSvc"}
 
ServiceHandle< IROBDataProviderSvcm_robDataProviderSvc {this, "ROBDataProvider", "ROBDataProviderSvc"}
 
ToolHandle< GenericMonitoringToolm_monTool {this, "MonTool", "" , "Monitoring tool"}
 
SG::SlotSpecificObj< std::unique_ptr< RawEventWrite > > m_rawEventWriteCache
 
Flags which are not used by this service.

It only serves as an entity storing these values and some other components read it from here.

TODO: Remove this solution and move the properties where they are needed.

Gaudi::Property< bool > m_isSimulation {this, "IsSimulation", false}
 
Gaudi::Property< bool > m_isTestbeam {this, "IsTestbeam", false}
 flags for TestBeam EventType More...
 
Gaudi::Property< bool > m_isCalibration {this, "IsCalibration", false}
 flags for Calibration EventType More...
 
Flags which are not used by this service.

It only serves as an entity storing these values and some other components read it from here.

TODO: Remove this solution and move the properties where they are needed.

Gaudi::Property< bool > m_isSimulation {this, "IsSimulation", false}
 
Gaudi::Property< bool > m_isTestbeam {this, "IsTestbeam", false}
 flags for TestBeam EventType More...
 
Gaudi::Property< bool > m_isCalibration {this, "IsCalibration", false}
 flags for Calibration EventType More...
 
Flags which are not used by this service.

It only serves as an entity storing these values and some other components read it from here.

TODO: Remove this solution and move the properties where they are needed.

Gaudi::Property< bool > m_isSimulation {this, "IsSimulation", false}
 
Gaudi::Property< bool > m_isTestbeam {this, "IsTestbeam", false}
 flags for TestBeam EventType More...
 
Gaudi::Property< bool > m_isCalibration {this, "IsCalibration", false}
 flags for Calibration EventType More...
 

@c IConversionSvc implementation

virtual long repSvcType () const
 Retrieve the class type of the data store the converter uses. More...
 
const CLIDobjType () const
 Implementation of IConverter: dummy call. More...
 
virtual StatusCode setDataProvider (IDataProviderSvc *pService)
 Implementation of IConverter: Set Data provider service. More...
 
virtual SmartIF< IDataProviderSvc > & dataProvider () const
 Implementation of IConverter: Get Data provider service. More...
 
virtual StatusCode setConversionSvc (IConversionSvc *svc)
 Implementation of IConverter: Set conversion service the converter is connected to. More...
 
virtual SmartIF< IConversionSvc > & conversionSvc () const
 Implementation of IConverter: Get conversion service the converter is connected to. More...
 
virtual StatusCode setAddressCreator (IAddressCreator *creator)
 Set address creator facility. More...
 
virtual SmartIF< IAddressCreator > & addressCreator () const
 Retrieve address creator facility. More...
 
virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject)
 Implementation of IConverter: Create the transient representation of an object. More...
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Resolve the references of the created transient object. More...
 
virtual StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject)
 Implementation of IConverter: Update the transient object from the other representation. More...
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Update the references of an updated transient object. More...
 
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Implementation of IConverter: Convert the transient object to the requested representation. More...
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Resolve the references of the converted object. More...
 
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Update the converted representation of a transient object. More...
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Update the references of an already converted object. More...
 
virtual StatusCode addConverter (const CLID &clid)
 Add converter object to conversion service. More...
 
virtual StatusCode addConverter (IConverter *pConverter)
 Add converter object to conversion service. More...
 
virtual StatusCode removeConverter (const CLID &clid)
 Remove converter object from conversion service (if present). More...
 
virtual IConverter * converter (const CLID &wanted)
 Retrieve converter from list. More...
 
virtual StatusCode disconnectOutput (const std::string &output)
 Disconnect output files from the service. More...
 

@c IAddressCreator interface implementation

virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
 Create a Generic address using explicit arguments to identify a single object. More...
 
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress)
 Convert an address in string form to object form. More...
 
virtual StatusCode convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress)
 Convert an address to string form. More...
 
SmartIF< IDataProviderSvc > m_dataSvc
 Pointer to data provider service. More...
 
SmartIF< IAddressCreator > m_addressCreator
 Pointer to the address creation service interface. More...
 
SmartIF< IConversionSvc > m_cnvSvc
 Pointer to the IConversionSvc interface of this. More...
 
long m_type
 Conversion service type. More...
 
Workers m_workers
 List of conversion workers. More...
 
CallMutex m_conv_mut
 
typedef std::recursive_mutex CallMutex
 Mutex to protect Converter creation. More...
 
virtual SmartIF< IAddressCreator > & addressCreator ()
 Retrieve address creation interface. More...
 
virtual IConverter * createConverter (long typ, const CLID &clid, const ICnvFactory *fac)
 Create new Converter using factory. More...
 
virtual StatusCode configureConverter (long typ, const CLID &clid, IConverter *cnv)
 Configure the new converter before initialize is called. More...
 
virtual StatusCode initializeConverter (long typ, const CLID &clid, IConverter *cnv)
 Initialize the new converter. More...
 
virtual StatusCode activateConverter (long typ, const CLID &clid, IConverter *cnv)
 Activate the new converter after initialization. More...
 
virtual void loadConverter (DataObject *pObject)
 Load converter or dictionary needed by the converter. More...
 
StatusCode makeCall (int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
 

Detailed Description

A ByteStreamCnvSvc implementation for online use.

It overrides the connectOutput and commitOutput methods of the base class. In this implementation, they create the specific online HLT output and send it out directly to the TDAQ infrastructure without using an output service.

Definition at line 22 of file TrigByteStreamCnvSvc.h.

Member Typedef Documentation

◆ CallMutex

typedef std::recursive_mutex AthCnvSvc::CallMutex
protectedinherited

Mutex to protect Converter creation.

Definition at line 323 of file AthCnvSvc.h.

◆ Workers

typedef std::unordered_map<CLID,WorkerEntry> AthCnvSvc::Workers
inherited

Definition at line 106 of file AthCnvSvc.h.

Constructor & Destructor Documentation

◆ TrigByteStreamCnvSvc()

TrigByteStreamCnvSvc::TrigByteStreamCnvSvc ( const std::string &  name,
ISvcLocator *  svcLoc 
)

Standard constructor.

Definition at line 86 of file TrigByteStreamCnvSvc.cxx.

87 : ByteStreamCnvSvcBase(name, svcLoc) {}

◆ ~TrigByteStreamCnvSvc()

TrigByteStreamCnvSvc::~TrigByteStreamCnvSvc ( )
virtual

Standard destructor.

Definition at line 92 of file TrigByteStreamCnvSvc.cxx.

92 {}

Member Function Documentation

◆ activateConverter()

StatusCode AthCnvSvc::activateConverter ( long  typ,
const CLID clid,
IConverter *  cnv 
)
protectedvirtualinherited

Activate the new converter after initialization.

Definition at line 536 of file AthCnvSvc.cxx.

538 {
539  if (cnv) {
540  return StatusCode::SUCCESS;
541  }
542  return Status::NO_CONVERTER;
543 }

◆ addConverter() [1/2]

StatusCode AthCnvSvc::addConverter ( const CLID clid)
virtualinherited

Add converter object to conversion service.

Definition at line 336 of file AthCnvSvc.cxx.

337 {
338  // First look for the more specific converter
339  long typ = repSvcType();
340  IConverter* pConverter = createConverter(typ, clid, 0);
341  if ( 0 != pConverter ) {
342  StatusCode status = configureConverter( typ, clid, pConverter );
343  if ( status.isSuccess() ) {
344  status = initializeConverter( typ, clid, pConverter );
345  if ( status.isSuccess() ) {
346  status = activateConverter( typ, clid, pConverter );
347  if ( status.isSuccess() ) {
348  long conv_typ = pConverter->repSvcType();
349  const CLID& conv_clid = pConverter->objType();
350  typ = (typ<0xFF) ? typ : typ&0xFFFFFF00;
351  conv_typ = (conv_typ<0xFF) ? conv_typ : conv_typ&0xFFFFFF00;
352  if ( conv_typ == typ && conv_clid == clid ) {
353  return addConverter(pConverter);
354  }
355  }
356  }
357  }
358  pConverter->release();
359  }
360  return Status::NO_CONVERTER;
361 }

◆ addConverter() [2/2]

StatusCode AthCnvSvc::addConverter ( IConverter *  pConverter)
virtualinherited

Add converter object to conversion service.

Definition at line 365 of file AthCnvSvc.cxx.

366 {
367  if ( 0 != pConverter ) {
368  const CLID& clid = pConverter->objType();
369  removeConverter(clid).ignore();
370  m_workers.insert (std::make_pair(clid,WorkerEntry(clid, pConverter)));
371  pConverter->addRef();
372  return StatusCode::SUCCESS;
373  }
374  return Status::NO_CONVERTER;
375 }

◆ addressCreator() [1/2]

virtual SmartIF<IAddressCreator>& AthCnvSvc::addressCreator ( )
inlineprotectedvirtualinherited

Retrieve address creation interface.

Definition at line 300 of file AthCnvSvc.h.

301  {
302  return m_addressCreator;
303  }

◆ addressCreator() [2/2]

SmartIF< IAddressCreator > & AthCnvSvc::addressCreator ( ) const
virtualinherited

Retrieve address creator facility.

Definition at line 261 of file AthCnvSvc.cxx.

262 {
263  // FIXME: Ideally the return type should be const, but that would require
264  // changes in the Gaudi IConverter base class.
265  SmartIF<IAddressCreator>& svc ATLAS_THREAD_SAFE =
266  const_cast<SmartIF<IAddressCreator>&>(m_addressCreator);
267  return svc;
268 }

◆ clearRawEvent()

void TrigByteStreamCnvSvc::clearRawEvent ( const EventContext &  eventContext)
private

Delete raw event from the cache.

Definition at line 261 of file TrigByteStreamCnvSvc.cxx.

261  {
262  m_rawEventWriteCache.get(eventContext)->reset();
263 }

◆ commitOutput() [1/2]

StatusCode TrigByteStreamCnvSvc::commitOutput ( const std::string &  outputFile,
bool  do_commit 
)
overridevirtual

In the case of online BS data, this method binds and sends out the output FullEventFragment.

Reimplemented from AthCnvSvc.

Definition at line 163 of file TrigByteStreamCnvSvc.cxx.

163  {
164  const EventContext* eventContext = currentContext();
165  if (eventContext == nullptr) return StatusCode::FAILURE;
166  return commitOutput(outputFile, do_commit, *eventContext);
167 }

◆ commitOutput() [2/2]

StatusCode TrigByteStreamCnvSvc::commitOutput ( const std::string &  outputFile,
bool  do_commit,
const EventContext &  eventContext 
)

In the case of online BS data, this method binds and sends out the output FullEventFragment.

Definition at line 169 of file TrigByteStreamCnvSvc.cxx.

169  {
170  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
171 
172  if (msgLvl(MSG::DEBUG)) printRawEvent(eventContext);
173 
174  RawEventWrite* re = getRawEvent(eventContext);
175 
176  // Serialise the output FullEventFragment
177  std::unique_ptr<uint32_t[]> rawEventPtr;
178  try {
179  const eformat::write::node_t* top = re->bind();
180  uint32_t rawEventSize = re->size_word();
181  rawEventPtr = std::make_unique<uint32_t[]>(rawEventSize);
182  uint32_t copiedSize = eformat::write::copy(*top,rawEventPtr.get(),rawEventSize);
183  if(copiedSize!=rawEventSize) {
184  ATH_MSG_ERROR("FullEventFragment serialisation failed");
185  return StatusCode::FAILURE;
186  }
187  }
188  catch (const std::exception& e) {
189  ATH_MSG_ERROR("FullEventFragment serialisation failed, caught an unexpected std::exception " << e.what());
190  clearRawEvent(eventContext);
191  return StatusCode::FAILURE;
192  }
193  catch (...) {
194  ATH_MSG_ERROR("FullEventFragment serialisation failed, caught an unexpected exception");
195  clearRawEvent(eventContext);
196  return StatusCode::FAILURE;
197  }
198 
199  {
200  auto t_mon = Monitored::Timer("TIME_monitorRawEvent");
201  monitorRawEvent(rawEventPtr);
202  Monitored::Group(m_monTool, t_mon);
203  }
204 
205  // Send output to the DataCollector
206  StatusCode result = StatusCode::SUCCESS;
207  try {
208  auto t_eventDone = Monitored::Timer<std::chrono::duration<float, std::milli>>("TIME_eventDone");
209  hltinterface::DataCollector::instance()->eventDone(std::move(rawEventPtr));
210  Monitored::Group(m_monTool, t_eventDone);
211  ATH_MSG_DEBUG("Serialised FullEventFragment with HLT result was returned to DataCollector successfully, "
212  << "the eventDone call took " << (double)t_eventDone << " milliseconds");
213  }
214  catch (const std::exception& e) {
215  ATH_MSG_ERROR("Sending output to DataCollector failed, caught an unexpected std::exception " << e.what());
216  result = StatusCode::FAILURE;
217  }
218  catch (...) {
219  ATH_MSG_ERROR("Sending output to DataCollector failed, caught an unexpected exception");
220  result = StatusCode::FAILURE;
221  }
222 
223  clearRawEvent(eventContext);
224 
225  ATH_MSG_VERBOSE("end of " << __FUNCTION__);
226  return result;
227 }

◆ configureConverter()

StatusCode AthCnvSvc::configureConverter ( long  typ,
const CLID clid,
IConverter *  cnv 
)
protectedvirtualinherited

Configure the new converter before initialize is called.

Definition at line 510 of file AthCnvSvc.cxx.

512 {
513  if (cnv) {
514  cnv->setConversionSvc(this).ignore();
515  cnv->setAddressCreator(m_addressCreator).ignore();
516  cnv->setDataProvider(m_dataSvc).ignore();
517  return StatusCode::SUCCESS;
518  }
519  return Status::NO_CONVERTER;
520 
521 }

◆ connectOutput() [1/3]

StatusCode TrigByteStreamCnvSvc::connectOutput ( const std::string &  outputFile)
overridevirtual

In the case of online BS data, this method creates the output FullEventFragment and fills its header.

Reimplemented from AthCnvSvc.

Definition at line 125 of file TrigByteStreamCnvSvc.cxx.

125  {
126  const EventContext* eventContext = currentContext();
127  if (eventContext == nullptr) return StatusCode::FAILURE;
128  return connectOutput(outputFile, *eventContext);
129 }

◆ connectOutput() [2/3]

StatusCode TrigByteStreamCnvSvc::connectOutput ( const std::string &  outputFile,
const EventContext &  eventContext 
)

In the case of online BS data, this method creates the output FullEventFragment and fills its header.

Definition at line 131 of file TrigByteStreamCnvSvc.cxx.

131  {
132  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
133 
134  ATH_MSG_DEBUG("Creating new RawEventWrite for EventContext = " << eventContext);
135  // Create a new RawEventWrite and copy the header from the input RawEvent
136  RawEventWrite* re = setRawEvent(std::make_unique<RawEventWrite>(), eventContext);
137  const uint32_t* inputRawEvent = m_robDataProviderSvc->getEvent(eventContext)->start();
138  if (!inputRawEvent) {
139  ATH_MSG_ERROR("Input RawEvent is nullptr, cannot create output");
140  return StatusCode::FAILURE;
141  }
142  re->copy_header(inputRawEvent);
143 
144  ATH_MSG_VERBOSE("Created RawEventWrite pointer = " << re);
145 
146  ATH_MSG_VERBOSE("end of " << __FUNCTION__);
147  return StatusCode::SUCCESS;
148 }

◆ connectOutput() [3/3]

StatusCode TrigByteStreamCnvSvc::connectOutput ( const std::string &  outputFile,
const std::string &  openMode 
)
overridevirtual

This overload is kept only for interface compatibility.

Reimplemented from AthCnvSvc.

Definition at line 154 of file TrigByteStreamCnvSvc.cxx.

154  {
155  return connectOutput(outputFile);
156 }

◆ conversionSvc()

SmartIF< IConversionSvc > & AthCnvSvc::conversionSvc ( ) const
virtualinherited

Implementation of IConverter: Get conversion service the converter is connected to.

Definition at line 232 of file AthCnvSvc.cxx.

233 {
234  // FIXME: Ideally the return type should be const, but that would require
235  // changes in the Gaudi IConverter base class.
236  SmartIF<IConversionSvc>& svc ATLAS_THREAD_SAFE =
237  const_cast<SmartIF<IConversionSvc>&>(m_cnvSvc);
238  return svc;
239 }

◆ convertAddress()

StatusCode AthCnvSvc::convertAddress ( const IOpaqueAddress *  pAddress,
std::string &  refAddress 
)
virtualinherited

Convert an address to string form.

Reimplemented in AthenaPoolCnvSvc, Athena::NtupleCnvSvc, Athena::xAODCnvSvc, and Athena::RootCnvSvc.

Definition at line 459 of file AthCnvSvc.cxx.

461 {
462  refAddress = "";
463  return StatusCode::FAILURE;
464 }

◆ converter()

IConverter * AthCnvSvc::converter ( const CLID wanted)
virtualinherited

Retrieve converter from list.

Definition at line 394 of file AthCnvSvc.cxx.

395 {
396  std::lock_guard<CallMutex> lock(m_conv_mut);
397  Workers::iterator worker = m_workers.find (clid);
398  if ( worker != m_workers.end() ) {
399  return worker->second.converter();
400  }
401  if (addConverter (clid).isSuccess()) {
402  worker = m_workers.find (clid);
403  if (worker != m_workers.end()) {
404  return worker->second.converter();
405  }
406  } else {
407  ATH_MSG_INFO("problem adding converter for CLID [" << clid << "]");
408  }
409  return 0;
410 }

◆ createAddress() [1/2]

StatusCode AthCnvSvc::createAddress ( long  svc_type,
const CLID clid,
const std::string &  refAddress,
IOpaqueAddress *&  refpAddress 
)
virtualinherited

Convert an address in string form to object form.

Reimplemented in Athena::NtupleCnvSvc, Athena::xAODCnvSvc, AthenaPoolCnvSvc, and Athena::RootCnvSvc.

Definition at line 468 of file AthCnvSvc.cxx.

472 {
473  refpAddress = 0;
474  return StatusCode::FAILURE;
475 }

◆ createAddress() [2/2]

StatusCode AthCnvSvc::createAddress ( long  svc_type,
const CLID clid,
const std::string *  par,
const unsigned long *  ip,
IOpaqueAddress *&  refpAddress 
)
virtualinherited

Create a Generic address using explicit arguments to identify a single object.

Reimplemented in Athena::NtupleCnvSvc, Athena::xAODCnvSvc, AthenaPoolCnvSvc, and Athena::RootCnvSvc.

Definition at line 447 of file AthCnvSvc.cxx.

452 {
453  refpAddress = 0;
454  return StatusCode::FAILURE;
455 }

◆ createConverter()

IConverter * AthCnvSvc::createConverter ( long  typ,
const CLID clid,
const ICnvFactory *  fac 
)
protectedvirtualinherited

Create new Converter using factory.

Reimplemented in Athena::NtupleCnvSvc, Athena::xAODCnvSvc, and Athena::RootCnvSvc.

Definition at line 491 of file AthCnvSvc.cxx.

494 {
495 
496  std::unique_ptr<IConverter> cnv{Converter::Factory::create
497  (ConverterID(typ,clid), serviceLocator().get() )};
498 
499  if (!cnv) {
500  typ = (typ<0xFF) ? typ : typ&0xFFFFFF00;
501  cnv = Converter::Factory::create
502  (ConverterID(typ,clid), serviceLocator().get() );
503  }
504  return cnv.release();
505 
506 }

◆ createObj()

StatusCode AthCnvSvc::createObj ( IOpaqueAddress *  pAddress,
DataObject *&  refpObject 
)
virtualinherited

Implementation of IConverter: Create the transient representation of an object.

Reimplemented in Athena::NtupleCnvSvc, Athena::xAODCnvSvc, and AthenaPoolCnvSvc.

Definition at line 273 of file AthCnvSvc.cxx.

274 {
275  return makeCall (CREATE_OBJ, false, true, false, pAddress, refpObject);
276 }

◆ createRep()

StatusCode AthCnvSvc::createRep ( DataObject *  pObject,
IOpaqueAddress *&  refpAddress 
)
virtualinherited

Implementation of IConverter: Convert the transient object to the requested representation.

Reimplemented in Athena::NtupleCnvSvc, Athena::xAODCnvSvc, and AthenaPoolCnvSvc.

Definition at line 305 of file AthCnvSvc.cxx.

306 {
307  return makeCall (CREATE_REP, true, false, false, refpAddress, pObject);
308 }

◆ currentContext()

const EventContext * TrigByteStreamCnvSvc::currentContext ( ) const
private

Hack used in HLT to avoid using ThreadLocalContext, see explanation in the implementation.

Definition at line 230 of file TrigByteStreamCnvSvc.cxx.

230  {
231  // Get the EventContext via event store because the base class doesn't allow passing it explicitly as an argument
232  // and we don't want to use ThreadLocalContext. Don't use ReadHandle here because it calls ThreadLocalContext if
233  // not given a context (which we want to retrieve). This relies on IHiveWhiteBoard::selectStore being called on the
234  // current thread before we arrive here (it is done in HltEventLoopMgr).
235  const EventContext* eventContext = nullptr;
236  if (m_evtStore->retrieve(eventContext).isFailure()) {
237  ATH_MSG_ERROR("Failed to retrieve EventContext from the event store");
238  }
239  return eventContext;
240 }

◆ dataProvider()

SmartIF< IDataProviderSvc > & AthCnvSvc::dataProvider ( ) const
virtualinherited

Implementation of IConverter: Get Data provider service.

Returns
Pointer to data provider service

Definition at line 212 of file AthCnvSvc.cxx.

213 {
214  // FIXME: Ideally the return type should be const, but that would require
215  // changes in the Gaudi IConverter base class.
216  SmartIF<IDataProviderSvc>& svc ATLAS_THREAD_SAFE =
217  const_cast<SmartIF<IDataProviderSvc>&>(m_dataSvc);
218  return svc;
219 }

◆ disconnectOutput()

StatusCode AthCnvSvc::disconnectOutput ( const std::string &  output)
virtualinherited

Disconnect output files from the service.

Reimplemented in AthenaPoolCnvSvc.

Definition at line 437 of file AthCnvSvc.cxx.

438 {
439  return StatusCode::SUCCESS;
440 }

◆ fillObjRefs()

StatusCode AthCnvSvc::fillObjRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
virtualinherited

Implementation of IConverter: Resolve the references of the created transient object.

Definition at line 281 of file AthCnvSvc.cxx.

282 {
283  return makeCall (FILL_OBJ_REFS, false, true, true, pAddress, pObject);
284 }

◆ fillRepRefs()

StatusCode AthCnvSvc::fillRepRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
virtualinherited

Implementation of IConverter: Resolve the references of the converted object.


Reimplemented in Athena::NtupleCnvSvc, Athena::xAODCnvSvc, and AthenaPoolCnvSvc.

Definition at line 313 of file AthCnvSvc.cxx.

314 {
315  return makeCall (FILL_REP_REFS, true, false, false, pAddress, pObject);
316 }

◆ finalize()

StatusCode TrigByteStreamCnvSvc::finalize ( )
overridevirtual

Reimplemented from AthCnvSvc.

Definition at line 110 of file TrigByteStreamCnvSvc.cxx.

110  {
111  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
112  if (m_robDataProviderSvc.release().isFailure())
113  ATH_MSG_WARNING("Failed to release service " << m_robDataProviderSvc.typeAndName());
114  if (m_evtStore.release().isFailure())
115  ATH_MSG_WARNING("Failed to release service " << m_evtStore.typeAndName());
116  ATH_MSG_VERBOSE("end of " << __FUNCTION__);
118  return StatusCode::SUCCESS;
119 }

◆ getRawEvent() [1/2]

RawEventWrite * TrigByteStreamCnvSvc::getRawEvent ( )
overridevirtual

Return a pointer to the raw event for the current event context.

Implements IByteStreamEventAccess.

Definition at line 243 of file TrigByteStreamCnvSvc.cxx.

243  {
244  const EventContext* eventContext = currentContext();
245  if (eventContext == nullptr) return nullptr;
246  return getRawEvent(*eventContext);
247 }

◆ getRawEvent() [2/2]

RawEventWrite * TrigByteStreamCnvSvc::getRawEvent ( const EventContext &  eventContext) const

Return a pointer to the raw event for the given event context.

Definition at line 250 of file TrigByteStreamCnvSvc.cxx.

250  {
251  return m_rawEventWriteCache.get(eventContext)->get();
252 }

◆ handle()

void ByteStreamCnvSvcBase::handle ( const Incident &  )
overridevirtualinherited

Implementation of IIncidentListener: Handle for EndEvent incidence.

Definition at line 63 of file ByteStreamCnvSvcBase.cxx.

63  {
64  ServiceHandle<IClassIDSvc> clidSvc("ClassIDSvc", name());
65  if (!clidSvc.retrieve().isSuccess()) {
66  ATH_MSG_ERROR("Cannot get ClassIDSvc.");
67  return;
68  }
69  // Initialize the converters
70  for (const std::string& cnv : m_initCnvs) {
71  ATH_MSG_DEBUG("Accessing Converter for " << cnv);
72  CLID id;
73  if (!clidSvc->getIDOfTypeName(cnv, id).isSuccess()) {
74  ATH_MSG_WARNING("Cannot get CLID for " << cnv);
75  } else {
76  IConverter* cnv = converter(id);
77  if (cnv == 0) {
78  ATH_MSG_WARNING("Cannot get converter for " << cnv);
79  }
80  }
81  }
82  return;
83 }

◆ initialize()

StatusCode TrigByteStreamCnvSvc::initialize ( )
overridevirtual

Required of all Gaudi Services.

Initialize the service.

Reimplemented from ByteStreamCnvSvcBase.

Definition at line 97 of file TrigByteStreamCnvSvc.cxx.

97  {
98  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
100  ATH_CHECK(m_evtStore.retrieve());
101  ATH_CHECK(m_robDataProviderSvc.retrieve());
102  if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
103  ATH_MSG_VERBOSE("end of " << __FUNCTION__);
104  return StatusCode::SUCCESS;
105 }

◆ initializeConverter()

StatusCode AthCnvSvc::initializeConverter ( long  typ,
const CLID clid,
IConverter *  cnv 
)
protectedvirtualinherited

Initialize the new converter.

Definition at line 525 of file AthCnvSvc.cxx.

527 {
528  if (cnv) {
529  return cnv->initialize();
530  }
531  return Status::NO_CONVERTER;
532 }

◆ interfaceID()

static const InterfaceID& IByteStreamEventAccess::interfaceID ( )
inlinestaticinherited

Gaudi interface id.

Definition at line 20 of file IByteStreamEventAccess.h.

20 { return IID_IByteStreamEventAccess; }

◆ loadConverter()

void AthCnvSvc::loadConverter ( DataObject *  pObject)
protectedvirtualinherited

Load converter or dictionary needed by the converter.

Definition at line 547 of file AthCnvSvc.cxx.

548 {
549 }

◆ makeCall()

StatusCode AthCnvSvc::makeCall ( int  typ,
bool  ignore_add,
bool  ignore_obj,
bool  update,
IOpaqueAddress *&  pAddress,
DataObject *&  pObject 
)
protectedinherited

Definition at line 553 of file AthCnvSvc.cxx.

559 {
560  if ( 0 != pAddress || ignore_add ) {
561  if ( 0 != pObject || ignore_obj ) {
562  const CLID& obj_class =
563  (0 != pObject && !ignore_obj) ? pObject->clID()
564  : (0 != pAddress && !ignore_add)
565  ? pAddress->clID()
566  : CLID_NULL;
567  IConverter* cnv = converter(obj_class);
568  if ( !cnv && pObject ) {
569  //Give it a try to autoload the class (dictionary) for which the converter is needed
570  loadConverter( pObject);
571  cnv = converter(obj_class);
572  }
573 
574  StatusCode status(StatusCode::FAILURE);
575  if ( 0 != cnv ) {
576  switch(typ) {
577  case CREATE_OBJ:
578  status = cnv->createObj(pAddress, pObject);
579  break;
580  case FILL_OBJ_REFS:
581  status = cnv->fillObjRefs(pAddress, pObject);
582  break;
583  case UPDATE_OBJ:
584  status = cnv->updateObj(pAddress, pObject);
585  break;
586  case UPDATE_OBJ_REFS:
587  status = cnv->updateObjRefs(pAddress, pObject);
588  break;
589  case CREATE_REP:
590  status = cnv->createRep(pObject, pAddress);
591  break;
592  case FILL_REP_REFS:
593  status = cnv->fillRepRefs(pAddress, pObject);
594  break;
595  case UPDATE_REP:
596  status = cnv->updateRep(pAddress, pObject);
597  break;
598  case UPDATE_REP_REFS:
599  status = cnv->updateRepRefs(pAddress, pObject);
600  break;
601  default:
602  status = StatusCode::FAILURE;
603  break;
604  }
605  if ( status.isSuccess() && update ) {
606  status = updateServiceState(pAddress);
607  }
608  return status;
609  }
610  status.ignore();
611  msg(MSG::INFO) << "No converter for object ";
612  if ( pObject != 0 ) {
613  msg(MSG::INFO) << System::typeinfoName(typeid(*pObject));
614  }
615  msg(MSG::INFO) << " CLID= " << obj_class << endmsg;
616  return Status::NO_CONVERTER;
617  }
618  return Status::INVALID_OBJECT;
619  }
620  return Status::INVALID_ADDRESS;
621 }

◆ monitorRawEvent()

void TrigByteStreamCnvSvc::monitorRawEvent ( const std::unique_ptr< uint32_t[]> &  rawEventPtr) const
private

Fill histograms from contents of a FullEventFragment.

Definition at line 266 of file TrigByteStreamCnvSvc.cxx.

266  {
267  // Create a read fragment from the pointer
268  eformat::read::FullEventFragment rawEvent(rawEventPtr.get());
269 
270  // Monitor error code
271  if (rawEvent.nstatus() > 1) {
272  HLT::OnlineErrorCode errorCode = static_cast<HLT::OnlineErrorCode>(rawEvent.status()[1]);
273  std::ostringstream ss;
274  ss << errorCode;
275  auto monOnlineErrorCode = Monitored::Scalar<std::string>("OnlineErrorCode", ss.str());
276  Monitored::Group(m_monTool, monOnlineErrorCode);
277  }
278 
279  // Decode stream tags
280  std::vector<eformat::helper::StreamTag> streamTags;
281  try {
282  eformat::helper::decode(rawEvent.nstream_tag(), rawEvent.stream_tag(), streamTags);
283  }
284  catch (const std::exception& ex) {
285  ATH_MSG_ERROR("StreamTag decoding failed, caught an unexpected std::exception " << ex.what());
286  return;
287  }
288  catch (...) {
289  ATH_MSG_ERROR("StreamTag decoding failed, caught an unexpected exception");
290  return;
291  }
292 
293  // Get HLT result sizes
294  std::vector<eformat::read::ROBFragment> robs;
295  rawEvent.robs(robs);
296  std::vector<uint16_t> resultSizeMap_moduleID;
297  std::vector<uint32_t> resultSizeMap_size;
298  uint32_t totalSizeWords = 0;
299  try {
300  for (const eformat::read::ROBFragment& rob : robs) {
301  eformat::helper::SourceIdentifier sid(rob.rob_source_id());
302  if (sid.subdetector_id() != eformat::SubDetector::TDAQ_HLT)
303  continue;
304  const uint16_t module_id = sid.module_id();
305  const uint32_t size = rob.fragment_size_word();
306  totalSizeWords += size;
307  if (!contains(resultSizeMap_moduleID, module_id)) {
308  resultSizeMap_moduleID.push_back(module_id);
309  resultSizeMap_size.push_back(size);
310  }
311  else {
312  ATH_MSG_ERROR("HLT result ROB monitoring found multiple HLT ROBs with the same module ID " << module_id);
313  }
314  }
315  }
316  catch (const std::exception& ex) {
317  ATH_MSG_ERROR("HLT result ROB monitoring failed, caught an unexpected std::exception " << ex.what());
318  return;
319  }
320  catch (...) {
321  ATH_MSG_ERROR("HLT result ROB monitoring failed, caught an unexpected exception");
322  return;
323  }
324 
325  // Fill helper containers for monitoring
326  std::vector<std::string> sdFromRobList;
327  std::vector<std::string> sdFromSubDetList;
328  std::vector<std::string> streamTagCorrA;
329  std::vector<std::string> streamTagCorrB;
330  std::vector<float> streamResultSize; // Correlated with streamTags vector
331  streamTagCorrA.reserve(streamTags.size() * streamTags.size());
332  streamTagCorrB.reserve(streamTags.size() * streamTags.size());
333  streamResultSize.reserve(streamTags.size());
334  for (const eformat::helper::StreamTag& st : streamTags) {
335  bool hasHLTSubDet = st.dets.find(eformat::SubDetector::TDAQ_HLT) != st.dets.end();
336  bool includeAll = st.robs.empty() && (st.dets.empty() || hasHLTSubDet);
337  // includeAll means a stream with full event building or all HLT results included
338  uint32_t sizeWords = includeAll ? totalSizeWords : 0;
339  for (const eformat::SubDetector sd : st.dets) {
340  const std::string& detName = eformat::helper::SubDetectorDictionary.string(sd);
341  if (!contains(sdFromSubDetList, detName)) sdFromSubDetList.push_back(detName);
342  }
343  for (const uint32_t robid : st.robs) {
344  eformat::helper::SourceIdentifier sid(robid);
345  const std::string& detName = sid.human_detector();
346  if (!contains(sdFromRobList, detName)) sdFromRobList.push_back(detName);
347  if (!includeAll && sid.subdetector_id() == eformat::SubDetector::TDAQ_HLT) {
348  if (const int ix = index(resultSizeMap_moduleID, sid.module_id()); ix >= 0) {
349  sizeWords += resultSizeMap_size[ix];
350  }
351  else {
352  ATH_MSG_WARNING("Stream tag " << st.type << "_" << st.name << " declares " << sid.human()
353  << " in ROB list, but the ROBFragment is missing");
354  }
355  }
356  }
357  streamResultSize.push_back(sizeWords*wordsToKiloBytes);
358  for (const eformat::helper::StreamTag& st2 : streamTags) {
359  streamTagCorrA.push_back(mon_streamTypeName(st));
360  streamTagCorrB.push_back(mon_streamTypeName(st2));
361  }
362  }
363 
364  // General stream tag monitoring
365  auto monStreamTagsNum = Monitored::Scalar<size_t>("StreamTagsNum", streamTags.size());
366  auto monStreamTags = Monitored::Collection("StreamTags", streamTags, mon_streamTypeName);
367  auto monStreamTagsType = Monitored::Collection("StreamTagsType", streamTags, mon_streamType);
368  auto monStreamTagCorrA = Monitored::Collection("StreamTagCorrA", streamTagCorrA);
369  auto monStreamTagCorrB = Monitored::Collection("StreamTagCorrB", streamTagCorrB);
370  // PEB stream tag monitoring
371  auto monStreamIsPeb = Monitored::Collection("StreamTagIsPeb", streamTags, mon_streamIsPeb);
372  auto monPebRobsNum = Monitored::Collection("StreamTagsPebRobsNum", streamTags, mon_streamPebRobsNum);
373  auto monPebSubDetsNum = Monitored::Collection("StreamTagsPebSubDetsNum", streamTags, mon_streamPebSubDetsNum);
374  auto monSubDetsFromRobList = Monitored::Collection("StreamTagsPebSubDetsFromRobList", sdFromRobList);
375  auto monSubDetsFromSubDetList = Monitored::Collection("StreamTagsPebSubDetsFromSubDetList", sdFromSubDetList);
376  // Result size monitoring
377  auto monResultSizeTotal = Monitored::Scalar<float>("ResultSizeTotal", totalSizeWords*wordsToKiloBytes);
378  auto monResultSizeFullEvFrag = Monitored::Scalar<float>("ResultSizeFullEvFrag", rawEvent.fragment_size_word()*wordsToKiloBytes);
379  auto monResultCollModuleID = Monitored::Collection("ResultModuleID", resultSizeMap_moduleID);
380  auto monResultCollModuleSize = Monitored::Collection("ResultModuleSize", resultSizeMap_size, [](uint32_t sw){return sw*wordsToKiloBytes;});
381  auto monResultSizeByStream = Monitored::Collection("ResultSizeStream", streamResultSize);
382  // Collect all variables
383  Monitored::Group(m_monTool, monStreamTagsNum, monStreamTags, monStreamTagsType, monStreamTagCorrA,
384  monStreamTagCorrB, monStreamIsPeb, monPebRobsNum, monPebSubDetsNum, monSubDetsFromRobList,
385  monSubDetsFromSubDetList, monResultSizeTotal, monResultSizeFullEvFrag, monResultCollModuleID,
386  monResultCollModuleSize, monResultSizeByStream);
387 }

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

◆ objType()

const CLID & AthCnvSvc::objType ( ) const
inherited

Implementation of IConverter: dummy call.

Definition at line 179 of file AthCnvSvc.cxx.

180 {
181  return CLID_NULL;
182 }

◆ printRawEvent()

void TrigByteStreamCnvSvc::printRawEvent ( const EventContext &  eventContext) const
private

Print contents of the raw event.

Definition at line 390 of file TrigByteStreamCnvSvc.cxx.

390  {
391  RawEventWrite* re = getRawEvent(eventContext);
392 
393  if (!re) {
394  ATH_MSG_WARNING("RawEventWrite pointer is null");
395  return;
396  }
397  std::ostringstream ss;
398  ss << "Dumping header of the FullEventFragment with HLT result:" << std::endl;
399  ss << "--> status = "
400  << printNWordsHex<uint32_t>(re->nstatus(), re->status())
401  << std::endl;
402  ss << "--> source_id = " << printWordHex<uint32_t>(re->source_id()) << std::endl;
403  ss << "--> checksum_type = " << printWordHex<uint32_t>(re->checksum_type()) << std::endl;
404  ss << "--> compression_type = " << printWordHex<uint32_t>(re->compression_type()) << std::endl;
405  ss << "--> compression_level = " << re->compression_level() << std::endl;
406  ss << "--> bc_time_seconds = " << re->bc_time_seconds() << std::endl;
407  ss << "--> bc_time_nanoseconds = " << re->bc_time_nanoseconds() << std::endl;
408  ss << "--> global_id = " << re->global_id() << std::endl;
409  ss << "--> run_type = " << re->run_type() << std::endl;
410  ss << "--> run_no = " << re->run_no() << std::endl;
411  ss << "--> lumi_block = " << re->lumi_block() << std::endl;
412  ss << "--> lvl1_id = " << re->lvl1_id() << std::endl;
413  ss << "--> bc_id = " << re->bc_id() << std::endl;
414  ss << "--> lvl1_trigger_type = " << printWordHex<uint8_t>(re->lvl1_trigger_type()) << std::endl;
415  ss << "--> lvl1_trigger_info = "
416  << printNWordsHex<uint32_t>(re->nlvl1_trigger_info(), re->lvl1_trigger_info())
417  << std::endl;
418  ss << "--> lvl2_trigger_info = "
419  << printNWordsHex<uint32_t>(re->nlvl2_trigger_info(), re->lvl2_trigger_info())
420  << std::endl;
421  ss << "--> event_filter_info = "
422  << printNWordsHex<uint32_t>(re->nevent_filter_info(), re->event_filter_info())
423  << std::endl;
424  ss << "--> hlt_info = "
425  << printNWordsHex<uint32_t>(re->nhlt_info(), re->hlt_info())
426  << std::endl;
427 
428  std::vector<eformat::helper::StreamTag> stream_tags;
429  try {
430  eformat::helper::decode(re->nstream_tag(), re->stream_tag(), stream_tags);
431  }
432  catch (const std::exception& ex) {
433  ATH_MSG_ERROR("StreamTag decoding failed, caught an unexpected std::exception " << ex.what());
434  return;
435  }
436  catch (...) {
437  ATH_MSG_ERROR("StreamTag decoding failed, caught an unexpected exception");
438  return;
439  }
440  ss << "--> stream_tags = ";
441  bool first = true;
442  for (const auto& st : stream_tags) {
443  if (first) first=false;
444  else ss << " ";
445  ss << "{" << st.name << ", " << st.type << ", obeysLB=" << st.obeys_lumiblock << ", robs=[";
446  for (const auto& robid : st.robs) ss << printWordHex<uint32_t>(robid) << ", ";
447  ss << "], dets = [";
448  for (const auto& detid : st.dets) ss << printWordHex<uint8_t>(detid) << ", ";
449  ss << "]}" << std::endl;
450  }
451 
452  ATH_MSG_DEBUG(ss.str());
453 }

◆ queryInterface()

StatusCode ByteStreamCnvSvcBase::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
overridevirtualinherited

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

Reimplemented from AthCnvSvc.

Reimplemented in ByteStreamCnvSvc.

Definition at line 42 of file ByteStreamCnvSvcBase.cxx.

42  {
43  if (IByteStreamEventAccess::interfaceID().versionMatch(riid)) {
44  *ppvInterface = dynamic_cast<IByteStreamEventAccess*>(this);
45  } else {
46  // Interface is not directly available: try out a base class
47  return(::AthCnvSvc::queryInterface(riid, ppvInterface));
48  }
49  addRef();
50  return(StatusCode::SUCCESS);
51 }

◆ removeConverter()

StatusCode AthCnvSvc::removeConverter ( const CLID clid)
virtualinherited

Remove converter object from conversion service (if present).

Definition at line 379 of file AthCnvSvc.cxx.

380 {
381  Workers::iterator worker = m_workers.find (clid);
382  if ( worker != m_workers.end() ) {
383  worker->second.converter()->finalize().ignore();
384  worker->second.converter()->release();
385 
386  m_workers.erase (worker);
387  return StatusCode::SUCCESS;
388  }
389  return Status::NO_CONVERTER;
390 }

◆ repSvcType()

long AthCnvSvc::repSvcType ( ) const
virtualinherited

Retrieve the class type of the data store the converter uses.

Definition at line 172 of file AthCnvSvc.cxx.

173 {
174  return m_type;
175 }

◆ setAddressCreator()

StatusCode AthCnvSvc::setAddressCreator ( IAddressCreator *  creator)
virtualinherited

Set address creator facility.

Definition at line 243 of file AthCnvSvc.cxx.

244 {
245  m_addressCreator = creator;
248  for(Workers::iterator i=start; i != stop; ++i ) {
249  IConverter* cnv = i->second.converter();
250  if ( 0 != cnv ) {
251  if (cnv->setAddressCreator(m_addressCreator).isFailure()) {
252  ATH_MSG_ERROR ("setting Address Creator");
253  }
254  }
255  }
256  return StatusCode::SUCCESS;
257 }

◆ setConversionSvc()

StatusCode AthCnvSvc::setConversionSvc ( IConversionSvc *  svc)
virtualinherited

Implementation of IConverter: Set conversion service the converter is connected to.

Definition at line 224 of file AthCnvSvc.cxx.

225 {
226  return StatusCode::FAILURE;
227 }

◆ setDataProvider()

StatusCode AthCnvSvc::setDataProvider ( IDataProviderSvc *  pDataSvc)
virtualinherited

Implementation of IConverter: Set Data provider service.

Returns
Status code indicating success or failure
Parameters
pServicePointer to data provider service

Definition at line 189 of file AthCnvSvc.cxx.

190 {
191  if ( !pDataSvc ) return StatusCode::SUCCESS; //Atlas does not use DataSvc
192  if ( m_dataSvc ) m_dataSvc->release();
193  m_dataSvc = pDataSvc;
194  m_dataSvc->addRef();
197  for(Workers::iterator i=start; i != stop; ++i ) {
198  IConverter* cnv = i->second.converter();
199  if ( 0 != cnv ) {
200  if (cnv->setDataProvider(m_dataSvc).isFailure()) {
201  ATH_MSG_ERROR ("setting Data Provider");
202  }
203  }
204  }
205  return StatusCode::SUCCESS;
206 }

◆ setRawEvent()

RawEventWrite * TrigByteStreamCnvSvc::setRawEvent ( std::unique_ptr< RawEventWrite > &&  rawEventWrite,
const EventContext &  eventContext 
)
private

Store new raw event in the cache.

Definition at line 255 of file TrigByteStreamCnvSvc.cxx.

255  {
256  *(m_rawEventWriteCache.get(eventContext)) = std::move(rawEventWrite);
257  return getRawEvent(eventContext);
258 }

◆ updateObj()

StatusCode AthCnvSvc::updateObj ( IOpaqueAddress *  pAddress,
DataObject *  refpObject 
)
virtualinherited

Implementation of IConverter: Update the transient object from the other representation.

Definition at line 289 of file AthCnvSvc.cxx.

290 {
291  return makeCall (UPDATE_OBJ, false, true, false, pAddress, pObject);
292 }

◆ updateObjRefs()

StatusCode AthCnvSvc::updateObjRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
virtualinherited

Implementation of IConverter: Update the references of an updated transient object.

Definition at line 297 of file AthCnvSvc.cxx.

298 {
299  return makeCall (UPDATE_OBJ_REFS, false, true, true, pAddress, pObject);
300 }

◆ updateRep()

StatusCode AthCnvSvc::updateRep ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
virtualinherited

Implementation of IConverter: Update the converted representation of a transient object.

Definition at line 321 of file AthCnvSvc.cxx.

322 {
323  return makeCall (UPDATE_REP, true, false, false, pAddress, pObject);
324 }

◆ updateRepRefs()

StatusCode AthCnvSvc::updateRepRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
virtualinherited

Implementation of IConverter: Update the references of an already converted object.

Definition at line 329 of file AthCnvSvc.cxx.

330 {
331  return makeCall (UPDATE_REP_REFS, true, false, false, pAddress, pObject);
332 }

◆ updateServiceState()

StatusCode ByteStreamCnvSvcBase::updateServiceState ( IOpaqueAddress *  pAddress)
overridevirtualinherited

Checks whether an IOpaqueAddress is a GenericAddress.

Reimplemented from AthCnvSvc.

Definition at line 53 of file ByteStreamCnvSvcBase.cxx.

53  {
54  if (pAddress != 0) {
55  GenericAddress* pAddr = dynamic_cast<GenericAddress*>(pAddress);
56  if (pAddr != 0) {
57  return(StatusCode::SUCCESS);
58  }
59  }
60  return(StatusCode::FAILURE);
61 }

Member Data Documentation

◆ m_addressCreator

SmartIF<IAddressCreator> AthCnvSvc::m_addressCreator
protectedinherited

Pointer to the address creation service interface.

Definition at line 315 of file AthCnvSvc.h.

◆ m_cnvSvc

SmartIF<IConversionSvc> AthCnvSvc::m_cnvSvc
protectedinherited

Pointer to the IConversionSvc interface of this.

Definition at line 317 of file AthCnvSvc.h.

◆ m_conv_mut

CallMutex AthCnvSvc::m_conv_mut
protectedinherited

Definition at line 324 of file AthCnvSvc.h.

◆ m_dataSvc

SmartIF<IDataProviderSvc> AthCnvSvc::m_dataSvc
protectedinherited

Pointer to data provider service.

Definition at line 313 of file AthCnvSvc.h.

◆ m_evtStore

ServiceHandle<StoreGateSvc> TrigByteStreamCnvSvc::m_evtStore {this, "EventStore", "StoreGateSvc"}
private

Definition at line 65 of file TrigByteStreamCnvSvc.h.

◆ m_initCnvs

std::vector<std::string> ByteStreamCnvSvcBase::m_initCnvs
protectedinherited

Definition at line 40 of file ByteStreamCnvSvcBase.h.

◆ m_isCalibration

Gaudi::Property<bool> ByteStreamCnvSvcBase::m_isCalibration {this, "IsCalibration", false}
privateinherited

flags for Calibration EventType

Definition at line 55 of file ByteStreamCnvSvcBase.h.

◆ m_isSimulation

Gaudi::Property<bool> ByteStreamCnvSvcBase::m_isSimulation {this, "IsSimulation", false}
privateinherited

flags for Simulation EventType

Definition at line 51 of file ByteStreamCnvSvcBase.h.

◆ m_isTestbeam

Gaudi::Property<bool> ByteStreamCnvSvcBase::m_isTestbeam {this, "IsTestbeam", false}
privateinherited

flags for TestBeam EventType

Definition at line 53 of file ByteStreamCnvSvcBase.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> TrigByteStreamCnvSvc::m_monTool {this, "MonTool", "" , "Monitoring tool"}
private

Definition at line 67 of file TrigByteStreamCnvSvc.h.

◆ m_rawEventWriteCache

SG::SlotSpecificObj<std::unique_ptr<RawEventWrite> > TrigByteStreamCnvSvc::m_rawEventWriteCache
private

Definition at line 70 of file TrigByteStreamCnvSvc.h.

◆ m_robDataProviderSvc

ServiceHandle<IROBDataProviderSvc> TrigByteStreamCnvSvc::m_robDataProviderSvc {this, "ROBDataProvider", "ROBDataProviderSvc"}
private

Definition at line 66 of file TrigByteStreamCnvSvc.h.

◆ m_ROD2ROBmap

Gaudi::Property<std::vector<std::string> > ByteStreamCnvSvcBase::m_ROD2ROBmap {this,"ROD2ROBmap",{},"","OrderedSet<std::string>"}
protectedinherited

Definition at line 42 of file ByteStreamCnvSvcBase.h.

◆ m_type

long AthCnvSvc::m_type
protectedinherited

Conversion service type.

Definition at line 319 of file AthCnvSvc.h.

◆ m_workers

Workers AthCnvSvc::m_workers
protectedinherited

List of conversion workers.

Definition at line 321 of file AthCnvSvc.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AthCnvSvc::makeCall
StatusCode makeCall(int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
Definition: AthCnvSvc.cxx:553
ByteStreamCnvSvcBase::ByteStreamCnvSvcBase
ByteStreamCnvSvcBase(const std::string &name, ISvcLocator *pSvcLocator)
Standard Service Constructor.
Definition: ByteStreamCnvSvcBase.cxx:16
RawEventWrite
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
Definition: RawEvent.h:39
AthCnvSvc::finalize
virtual StatusCode finalize()
Definition: AthCnvSvc.cxx:116
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
UPDATE_REP
@ UPDATE_REP
Definition: AthCnvSvc.cxx:36
CREATE_REP
@ CREATE_REP
Definition: AthCnvSvc.cxx:34
get_generator_info.result
result
Definition: get_generator_info.py:21
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
AthCnvSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
Definition: AthCnvSvc.cxx:149
AthCnvSvc::removeConverter
virtual StatusCode removeConverter(const CLID &clid)
Remove converter object from conversion service (if present).
Definition: AthCnvSvc.cxx:379
TrigByteStreamCnvSvc::commitOutput
virtual StatusCode commitOutput(const std::string &outputFile, bool do_commit) override
In the case of online BS data, this method binds and sends out the output FullEventFragment.
Definition: TrigByteStreamCnvSvc.cxx:163
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TrigByteStreamCnvSvc::monitorRawEvent
void monitorRawEvent(const std::unique_ptr< uint32_t[]> &rawEventPtr) const
Fill histograms from contents of a FullEventFragment.
Definition: TrigByteStreamCnvSvc.cxx:266
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
AthCnvSvc::m_conv_mut
CallMutex m_conv_mut
Definition: AthCnvSvc.h:324
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
trigbs_dumpHLTContentInBS_run3.stream_tags
def stream_tags(event)
Definition: trigbs_dumpHLTContentInBS_run3.py:172
AthCnvSvc::activateConverter
virtual StatusCode activateConverter(long typ, const CLID &clid, IConverter *cnv)
Activate the new converter after initialization.
Definition: AthCnvSvc.cxx:536
AthCnvSvc::updateServiceState
virtual StatusCode updateServiceState(IOpaqueAddress *pAddress)
Update state of the service.
Definition: AthCnvSvc.cxx:479
SG::SlotSpecificObj::get
T * get(const EventContext &ctx)
Return pointer to the object for slot given by ctx.
AthCnvSvc::m_addressCreator
SmartIF< IAddressCreator > m_addressCreator
Pointer to the address creation service interface.
Definition: AthCnvSvc.h:315
AthCommonMsg< Service >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
IByteStreamEventAccess
interface for accessing raw data .
Definition: IByteStreamEventAccess.h:17
FILL_OBJ_REFS
@ FILL_OBJ_REFS
Definition: AthCnvSvc.cxx:31
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment
eformat::FullEventFragment< PointerType > FullEventFragment
Definition: RawEvent.h:26
TrigByteStreamCnvSvc::m_rawEventWriteCache
SG::SlotSpecificObj< std::unique_ptr< RawEventWrite > > m_rawEventWriteCache
Definition: TrigByteStreamCnvSvc.h:70
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
python.selector.AtlRunQuerySelectorLhcOlc.sd
sd
Definition: AtlRunQuerySelectorLhcOlc.py:612
TrigByteStreamCnvSvc::connectOutput
virtual StatusCode connectOutput(const std::string &outputFile) override
In the case of online BS data, this method creates the output FullEventFragment and fills its header.
Definition: TrigByteStreamCnvSvc.cxx:125
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
AthCnvSvc::configureConverter
virtual StatusCode configureConverter(long typ, const CLID &clid, IConverter *cnv)
Configure the new converter before initialize is called.
Definition: AthCnvSvc.cxx:510
UPDATE_REP_REFS
@ UPDATE_REP_REFS
Definition: AthCnvSvc.cxx:37
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
TrigByteStreamCnvSvc::setRawEvent
RawEventWrite * setRawEvent(std::unique_ptr< RawEventWrite > &&rawEventWrite, const EventContext &eventContext)
Store new raw event in the cache.
Definition: TrigByteStreamCnvSvc.cxx:255
TrigByteStreamCnvSvc::m_robDataProviderSvc
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
Definition: TrigByteStreamCnvSvc.h:66
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ByteStreamCnvSvcBase::m_initCnvs
std::vector< std::string > m_initCnvs
Definition: ByteStreamCnvSvcBase.h:40
python.HLT.CommonSequences.EventBuildingSequences.robs
robs
Definition: EventBuildingSequences.py:400
contains
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition: hcg.cxx:111
calibdata.exception
exception
Definition: calibdata.py:496
AthCnvSvc::m_cnvSvc
SmartIF< IConversionSvc > m_cnvSvc
Pointer to the IConversionSvc interface of this.
Definition: AthCnvSvc.h:317
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
AthCnvSvc::m_workers
Workers m_workers
List of conversion workers.
Definition: AthCnvSvc.h:321
AthCnvSvc::initializeConverter
virtual StatusCode initializeConverter(long typ, const CLID &clid, IConverter *cnv)
Initialize the new converter.
Definition: AthCnvSvc.cxx:525
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.PerfMonSerializer.decode
def decode(s)
Definition: PerfMonSerializer.py:388
AthCnvSvc::addConverter
virtual StatusCode addConverter(const CLID &clid)
Add converter object to conversion service.
Definition: AthCnvSvc.cxx:336
UPDATE_OBJ_REFS
@ UPDATE_OBJ_REFS
Definition: AthCnvSvc.cxx:33
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment
eformat::ROBFragment< PointerType > ROBFragment
Definition: RawEvent.h:27
AthCnvSvc::createConverter
virtual IConverter * createConverter(long typ, const CLID &clid, const ICnvFactory *fac)
Create new Converter using factory.
Definition: AthCnvSvc.cxx:491
AthCnvSvc::converter
virtual IConverter * converter(const CLID &wanted)
Retrieve converter from list.
Definition: AthCnvSvc.cxx:394
IByteStreamEventAccess::interfaceID
static const InterfaceID & interfaceID()
Gaudi interface id.
Definition: IByteStreamEventAccess.h:20
HLT::OnlineErrorCode
OnlineErrorCode
Definition: OnlineErrorCode.h:15
DeMoScan.index
string index
Definition: DeMoScan.py:362
dqt_zlumi_pandas.update
update
Definition: dqt_zlumi_pandas.py:42
TrigByteStreamCnvSvc::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigByteStreamCnvSvc.h:67
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
TrigByteStreamCnvSvc::m_evtStore
ServiceHandle< StoreGateSvc > m_evtStore
Definition: TrigByteStreamCnvSvc.h:65
TrigByteStreamCnvSvc::printRawEvent
void printRawEvent(const EventContext &eventContext) const
Print contents of the raw event.
Definition: TrigByteStreamCnvSvc.cxx:390
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DeMoScan.first
bool first
Definition: DeMoScan.py:534
re
const boost::regex re(r_e)
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< Service >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
TrigByteStreamCnvSvc::currentContext
const EventContext * currentContext() const
Hack used in HLT to avoid using ThreadLocalContext, see explanation in the implementation.
Definition: TrigByteStreamCnvSvc.cxx:230
AthCnvSvc::loadConverter
virtual void loadConverter(DataObject *pObject)
Load converter or dictionary needed by the converter.
Definition: AthCnvSvc.cxx:547
AthCnvSvc::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Pointer to data provider service.
Definition: AthCnvSvc.h:313
merge.status
status
Definition: merge.py:17
calibdata.copy
bool copy
Definition: calibdata.py:27
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigByteStreamCnvSvc::clearRawEvent
void clearRawEvent(const EventContext &eventContext)
Delete raw event from the cache.
Definition: TrigByteStreamCnvSvc.cxx:261
FILL_REP_REFS
@ FILL_REP_REFS
Definition: AthCnvSvc.cxx:35
AthCnvSvc::repSvcType
virtual long repSvcType() const
Retrieve the class type of the data store the converter uses.
Definition: AthCnvSvc.cxx:172
python.LArCondContChannels.detName
detName
Definition: LArCondContChannels.py:665
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
CREATE_OBJ
@ CREATE_OBJ
Definition: AthCnvSvc.cxx:30
AthCnvSvc::m_type
long m_type
Conversion service type.
Definition: AthCnvSvc.h:319
TrigByteStreamCnvSvc::getRawEvent
virtual RawEventWrite * getRawEvent() override
Return a pointer to the raw event for the current event context.
Definition: TrigByteStreamCnvSvc.cxx:243
ByteStreamCnvSvcBase::initialize
virtual StatusCode initialize() override
Required of all Gaudi Services.
Definition: ByteStreamCnvSvcBase.cxx:27
ServiceHandle< IClassIDSvc >
UPDATE_OBJ
@ UPDATE_OBJ
Definition: AthCnvSvc.cxx:32