The Gaudi Framework  master (37c0b60a)
OutputStream Class Reference

A small to stream Data I/O. More...

#include </builds/gaudi/Gaudi/GaudiCommonSvc/src/PersistencySvc/OutputStream.h>

Inheritance diagram for OutputStream:
Collaboration diagram for OutputStream:

Public Types

typedef std::vector< DataStoreItem * > Items
 
typedef std::vector< std::stringItemNames
 
typedef std::map< Gaudi::Algorithm *, ItemsAlgDependentItems
 
typedef std::map< std::string, ItemNamesAlgDependentItemNames
 
- Public Types inherited from Gaudi::Algorithm
typedef Gaudi::PluginService::Factory< IAlgorithm *(const std::string &, ISvcLocator *)> Factory
 
- Public Types inherited from extends< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >, IDataHandleHolder >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces... >
 Typedef to the base of this class. More...
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
using PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
 Typedef used to refer to this class from derived classes, as in. More...
 
- Public Types inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
using base_class = CommonMessaging
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
 take union of the ext_iids of all Interfaces... More...
 

Public Member Functions

StatusCode start () override
 Start OutputStream. More...
 
StatusCode initialize () override
 Initialize OutputStream. More...
 
StatusCode finalize () override
 Terminate OutputStream. More...
 
StatusCode execute () override
 Working entry point. More...
 
virtual StatusCode connectConversionSvc ()
 
virtual bool collect (IRegistry *dir, int level)
 Store agent's classback. More...
 
virtual StatusCode collectObjects ()
 Collect all objects to be written to the output stream. More...
 
void clearSelection ()
 Clear list of selected objects. More...
 
- Public Member Functions inherited from Gaudi::details::LegacyAlgorithmAdapter
 LegacyAlgorithmAdapter (std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
 
const EventContextgetContext () const
 
bool isExecuted () const
 Has this algorithm been executed since the last reset? More...
 
void setExecuted (bool state) const
 Set the executed flag to the specified state. More...
 
bool filterPassed () const
 Did this algorithm pass or fail its filter criterion for the last event? More...
 
void setFilterPassed (bool state) const
 Set the filter passed flag to the specified state. More...
 
- Public Member Functions inherited from Gaudi::Algorithm
 Algorithm (std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
 Constructor. More...
 
StatusCode sysStart () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysInitialize () override
 Initialization method invoked by the framework. More...
 
StatusCode sysReinitialize () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysRestart () override
 Restart method invoked by the framework. More...
 
StatusCode sysExecute (const EventContext &ctx) override
 The actions to be performed by the algorithm on an event. More...
 
StatusCode sysStop () override
 System stop. More...
 
StatusCode sysFinalize () override
 System finalization. More...
 
const std::stringname () const override
 The identifying name of the algorithm object. More...
 
const Gaudi::StringKeynameKey () const override
 
const std::stringtype () const override
 The type of the algorithm object. More...
 
void setType (std::string type) override
 
const std::stringversion () const override
 
unsigned int index () const override
 
StatusCode configure () override
 Dummy implementation of IStateful::configure() method. More...
 
StatusCode terminate () override
 Dummy implementation of IStateful::terminate() method. More...
 
StatusCode initialize () override
 the default (empty) implementation of IStateful::initialize() method More...
 
StatusCode start () override
 the default (empty) implementation of IStateful::start() method More...
 
StatusCode stop () override
 the default (empty) implementation of IStateful::stop() method More...
 
StatusCode finalize () override
 the default (empty) implementation of IStateful::finalize() method More...
 
StatusCode reinitialize () override
 the default (empty) implementation of IStateful::reinitialize() method More...
 
StatusCode restart () override
 the default (empty) implementation of IStateful::restart() method More...
 
Gaudi::StateMachine::State FSMState () const override
 returns the current state of the algorithm More...
 
Gaudi::StateMachine::State targetFSMState () const override
 returns the state the algorithm will be in after the ongoing transition More...
 
bool isEnabled () const override
 Is this algorithm enabled or disabled? More...
 
bool isSequence () const override
 Are we a Sequence? More...
 
unsigned int errorCount () const
 Get the number of failures of the algorithm. More...
 
template<class T >
StatusCode service (std::string_view name, T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (std::string_view svcType, std::string_view svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
SmartIF< IServiceservice (std::string_view name, const bool createIf=true, const bool quiet=false) const
 Return a pointer to the service identified by name (or "type/name") More...
 
template<class T >
SmartIF< T > service (std::string_view name, bool createIf=true, bool quiet=false) const
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
SmartIF< IChronoStatSvc > & chronoSvc () const
 The standard Chrono & Stat service, Return a pointer to the service if present. More...
 
SmartIF< IDataProviderSvc > & detSvc () const
 The standard detector data service. More...
 
SmartIF< IConversionSvc > & detCnvSvc () const
 The standard detector data persistency conversion service. More...
 
SmartIF< IDataProviderSvc > & eventSvc () const
 The standard event data service. More...
 
SmartIF< IDataProviderSvc > & evtSvc () const
 shortcut for method eventSvc More...
 
SmartIF< IConversionSvc > & eventCnvSvc () const
 The standard event data persistency conversion service. More...
 
SmartIF< IHistogramSvc > & histoSvc () const
 The standard histogram service. More...
 
SmartIF< INTupleSvc > & ntupleSvc () const
 The standard N tuple service. More...
 
SmartIF< IRndmGenSvc > & randSvc () const
 The standard RandomGen service, Return a pointer to the service if present. More...
 
SmartIF< IToolSvc > & toolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present. More...
 
SmartIF< IExceptionSvc > & exceptionSvc () const
 Get the exception Service. More...
 
SmartIF< IAlgContextSvc > & contextSvc () const
 get Algorithm Context Service More...
 
SmartIF< ITimelineSvc > & timelineSvc () const
 
SmartIF< ISvcLocator > & serviceLocator () const override
 The standard service locator. More...
 
SmartIF< ISvcLocator > & svcLoc () const
 shortcut for method serviceLocator More...
 
SmartIF< IHiveWhiteBoard > & whiteboard () const
 
SmartIF< IAlgExecStateSvc > & algExecStateSvc () const
 
bool registerContext () const
 register for Algorithm Context Service? More...
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
 
SmartIF< IMonitorSvc > & monitorSvc () const
 Access the monitor service. More...
 
template<class T >
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information. More...
 
void declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
 Declare monitoring information (special case) More...
 
void acceptDHVisitor (IDataHandleVisitor *) const override
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, bool createIf=true)
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
 
template<class T >
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
bool isAsynchronous () const
 
void setAsynchronous (bool value)
 
unsigned int cardinality () const override
 Return the cardinality. More...
 
const std::vector< std::string > & neededResources () const override
 
AlgExecStateexecState (const EventContext &ctx) const override
 reference to AlgExecState of Alg More...
 
std::ostreamtoControlFlowExpression (std::ostream &os) const override
 Produce string represention of the control flow expression. More...
 
- Public Member Functions inherited from DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >
std::vector< Gaudi::DataHandle * > inputHandles () const override
 
std::vector< Gaudi::DataHandle * > outputHandles () const override
 
virtual const DataObjIDCollextraInputDeps () const override
 
virtual const DataObjIDCollextraOutputDeps () const override
 
void declare (Gaudi::DataHandle &handle) override
 
void renounce (Gaudi::DataHandle &handle) override
 
bool renounceInput (const DataObjID &id) override
 
const DataObjIDCollinputDataObjs () const override
 
const DataObjIDColloutputDataObjs () const override
 
void addDependency (const DataObjID &id, const Gaudi::DataHandle::Mode &mode) override
 
- Public Member Functions inherited from extends< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >, IDataHandleHolder >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property. More...
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property. More...
 
virtual StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p)=0
 Set the property from a property with a different name. More...
 
virtual StatusCode setProperty (const std::string &s)=0
 Set the property by string. More...
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals. More...
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string. More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name More...
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string More...
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties More...
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name. More...
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected More...
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream) More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 

Protected Member Functions

Gaudi::AlgorithmdecodeAlgorithm (const std::string &theName)
 Decode a single algorithm name. More...
 
void decodeAlgorithms (Gaudi::Property< std::vector< std::string >> &theNames, std::vector< Gaudi::Algorithm * > &theAlgs)
 Decode specified list of Algorithms. More...
 
bool isEventAccepted () const
 Test whether this event should be output. More...
 
DataStoreItemfindItem (const std::string &path)
 Find single item identified by its path (exact match) More...
 
virtual StatusCode writeObjects ()
 Select the different objects and write them to file. More...
 
virtual bool hasInput () const
 Tell if the instance has been configured with input items or not. More...
 
- Protected Member Functions inherited from Gaudi::details::LegacyAlgorithmAdapter
bool isReEntrant () const override
 
- Protected Member Functions inherited from Gaudi::Algorithm
std::vector< IAlgTool * > & tools ()
 
bool isInitialized () const override
 Has the Algorithm already been initialized? More...
 
bool isFinalized () const override
 Has the Algorithm already been finalized? More...
 
void setIndex (const unsigned int &idx) override
 set instantiation index of Alg More...
 
bool isReEntrant () const override
 
- Protected Member Functions inherited from DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >
void initDataHandleHolder ()
 initializes all handles - called by the sysInitialize method of any descendant of this More...
 
- Protected Member Functions inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 Set up local caches. More...
 
MSG::Level resetMessaging ()
 Reinitialize internal states. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Protected Attributes

Gaudi::Property< ItemNamesm_itemNames { this, "ItemList", {}, "vector of item names to be saved to this stream" }
 
Gaudi::Property< ItemNamesm_optItemNames
 
Gaudi::Property< AlgDependentItemNamesm_algDependentItemList
 
Gaudi::Property< bool > m_doPreLoad
 
Gaudi::Property< bool > m_doPreLoadOpt
 
Gaudi::Property< std::stringm_output { this, "Output", {}, "name of the output file specification" }
 
Gaudi::Property< std::stringm_outputName { this, "OutputFile", {}, "name of the output file" }
 
Gaudi::Property< std::stringm_storeName
 
Gaudi::Property< std::stringm_persName
 
Gaudi::Property< std::vector< std::string > > m_acceptNames
 
Gaudi::Property< std::vector< std::string > > m_requireNames
 
Gaudi::Property< std::vector< std::string > > m_vetoNames
 
Gaudi::Property< bool > m_verifyItems
 
bool m_fireIncidents = true
 should I fire incidents for writing opening/closing etc? in the baseclass, always fire the incidents by default in e.g. More...
 
SmartIF< IIncidentSvcm_incidentSvc
 Reference to the incident service. More...
 
std::string m_outputType = "UPDATE"
 Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE) More...
 
SmartIF< IDataProviderSvcm_pDataProvider
 Keep reference to the data provider service. More...
 
SmartIF< IDataManagerSvcm_pDataManager
 Keep reference to the data manager service. More...
 
SmartIF< IConversionSvcm_pConversionSvc
 Keep reference to the data conversion service. More...
 
DataStoreItemm_currentItem
 Keep track of the current item. More...
 
Items m_itemList
 Vector of items to be saved to this stream. More...
 
Items m_optItemList
 Vector of optional items to be saved to this stream. More...
 
AlgDependentItems m_algDependentItems
 Items to be saved for specific algorithms. More...
 
IDataSelector m_objects
 Collection of objects being selected. More...
 
int m_events
 Number of events written to this output stream. More...
 
std::vector< Gaudi::Algorithm * > m_acceptAlgs
 Vector of Algorithms that this stream accepts. More...
 
std::vector< Gaudi::Algorithm * > m_requireAlgs
 Vector of Algorithms that this stream requires. More...
 
std::vector< Gaudi::Algorithm * > m_vetoAlgs
 Vector of Algorithms that this stream is vetoed by. More...
 
- Protected Attributes inherited from Gaudi::Algorithm
std::unique_ptr< IDataHandleVisitorm_updateDataHandles
 Hook for for derived classes to provide a custom visitor for data handles. More...
 
- Protected Attributes inherited from DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >
DataObjIDColl m_inputDataObjs
 
DataObjIDColl m_outputDataObjs
 

Private Member Functions

void clearItems (Items &itms)
 Clear item list. More...
 
void addItem (Items &itms, const std::string &descriptor)
 Add item to output streamer list. More...
 
IDataSelectorselectedObjects ()
 Return the list of selected objects. More...
 
StatusCode collectFromSubTree (DataObject *)
 

Additional Inherited Members

- Public Attributes inherited from Gaudi::Algorithm
friend AlgorithmManager
 

Detailed Description

A small to stream Data I/O.

Author: M.Frank author R. Lambert Version: 1.0

Definition at line 38 of file OutputStream.h.

Member Typedef Documentation

◆ AlgDependentItemNames

◆ AlgDependentItems

◆ ItemNames

Definition at line 41 of file OutputStream.h.

◆ Items

Definition at line 40 of file OutputStream.h.

Member Function Documentation

◆ addItem()

void OutputStream::addItem ( Items itms,
const std::string descriptor 
)
private

Add item to output streamer list.

Definition at line 342 of file OutputStream.cpp.

342  {
343  int level = 0;
344  auto sep = descriptor.rfind( "#" );
345  std::string obj_path = descriptor.substr( 0, sep );
346  if ( sep != std::string::npos ) {
347  std::string slevel = descriptor.substr( sep + 1 );
348  level = ( slevel == "*" ) ? 9999999 : std::stoi( slevel );
349  }
350  if ( m_verifyItems ) {
351  size_t idx = obj_path.find( "/", 1 );
352  while ( idx != std::string::npos ) {
353  std::string sub_item = obj_path.substr( 0, idx );
354  if ( !findItem( sub_item ) ) addItem( itms, sub_item + "#1" );
355  idx = obj_path.find( "/", idx + 1 );
356  }
357  }
358  itms.push_back( new DataStoreItem( obj_path, level ) );
359  const auto& item = itms.back();
360  ON_DEBUG
361  debug() << "Adding OutputStream item " << item->path() << " with " << item->depth() << " level(s)." << endmsg;
362 }

◆ clearItems()

void OutputStream::clearItems ( Items itms)
private

Clear item list.

Definition at line 325 of file OutputStream.cpp.

325  {
326  for ( auto& i : itms ) delete i;
327  itms.clear();
328 }

◆ clearSelection()

void OutputStream::clearSelection ( )

Clear list of selected objects.

Definition at line 322 of file OutputStream.cpp.

322 { m_objects.clear(); }

◆ collect()

bool OutputStream::collect ( IRegistry dir,
int  level 
)
virtual

Store agent's classback.

Definition at line 233 of file OutputStream.cpp.

233  {
234  if ( level < m_currentItem->depth() ) {
235  if ( dir->object() ) {
236  /*
237  std::cout << "Analysing ("
238  << dir->name()
239  << ") Object:"
240  << ((dir->object()==0) ? "UNLOADED" : "LOADED")
241  << std::endl;
242  */
243  m_objects.push_back( dir->object() );
244  return true;
245  }
246  }
247  return false;
248 }

◆ collectFromSubTree()

StatusCode OutputStream::collectFromSubTree ( DataObject pObj)
private

Definition at line 517 of file OutputStream.cpp.

517  {
518  return m_pDataManager->traverseSubTree( pObj,
519  [this]( IRegistry* r, int level ) { return this->collect( r, level ); } );
520 }

◆ collectObjects()

StatusCode OutputStream::collectObjects ( )
virtual

Collect all objects to be written to the output stream.

Reimplemented in InputCopyStream, and CopyInputStream.

Definition at line 251 of file OutputStream.cpp.

251  {
253 
254  // Traverse the tree and collect the requested objects
255  for ( auto& i : m_itemList ) {
256  DataObject* obj = nullptr;
257  m_currentItem = i;
258  StatusCode iret = m_pDataProvider->retrieveObject( m_currentItem->path(), obj );
259  if ( iret.isSuccess() ) {
260  iret = collectFromSubTree( obj );
261  if ( !iret.isSuccess() ) status = iret;
262  } else {
263  error() << "Cannot write mandatory object(s) (Not found) " << m_currentItem->path() << endmsg;
264  status = iret;
265  }
266  }
267 
268  // Traverse the tree and collect the requested objects (tolerate missing items here)
269  for ( auto& i : m_optItemList ) {
270  DataObject* obj = nullptr;
271  m_currentItem = i;
272  StatusCode iret = m_pDataProvider->retrieveObject( m_currentItem->path(), obj );
273  if ( iret.isSuccess() ) iret = collectFromSubTree( obj );
274  if ( !iret.isSuccess() ) {
275  ON_DEBUG
276  debug() << "Ignore request to write non-mandatory object(s) " << m_currentItem->path() << endmsg;
277  }
278  }
279 
280  // Collect objects dependent on particular algorithms
281  for ( const auto& iAlgItems : m_algDependentItems ) {
282  auto alg = iAlgItems.first;
283  const Items& items = iAlgItems.second;
284  if ( passed( alg ) ) {
285  ON_DEBUG
286  debug() << "Algorithm '" << alg->name() << "' fired. Adding " << items << endmsg;
287  for ( const auto& i : items ) {
288  DataObject* obj = nullptr;
289  m_currentItem = i;
290  StatusCode iret = m_pDataProvider->retrieveObject( m_currentItem->path(), obj );
291  if ( iret.isSuccess() ) {
292  iret = collectFromSubTree( obj );
293  if ( !iret.isSuccess() ) status = iret;
294  } else {
295  error() << "Cannot write mandatory (algorithm dependent) object(s) (Not found) " << m_currentItem->path()
296  << endmsg;
297  status = iret;
298  }
299  }
300  }
301  }
302 
303  if ( status.isSuccess() ) {
304  // Remove duplicates from the list of objects, preserving the order in the list
306  std::vector<DataObject*> tmp; // temporary vector with the reduced list
307  tmp.reserve( m_objects.size() );
308  for ( auto& o : m_objects ) {
309  if ( !unique.count( o ) ) {
310  // if the pointer is not in the set, add it to both the set and the temporary vector
311  unique.insert( o );
312  tmp.push_back( o );
313  }
314  }
315  m_objects.swap( tmp ); // swap the data of the two vectors
316  }
317 
318  return status;
319 }

◆ connectConversionSvc()

StatusCode OutputStream::connectConversionSvc ( )
virtual

Definition at line 365 of file OutputStream.cpp.

365  {
367  // Get output file from input
368  std::string dbType, svc, shr;
369  for ( auto attrib : Gaudi::Utils::AttribStringParser( m_output ) ) {
370  const std::string& tag = attrib.tag;
371  const std::string& val = attrib.value;
372  switch ( ::toupper( tag[0] ) ) {
373  case 'D':
374  m_outputName = val;
375  break;
376  case 'T':
377  dbType = val;
378  break;
379  case 'S':
380  switch ( ::toupper( tag[1] ) ) {
381  case 'V':
382  svc = val;
383  break;
384  case 'H':
385  shr = "YES";
386  break;
387  }
388  break;
389  case 'O': // OPT='<NEW<CREATE,WRITE,RECREATE>, UPDATE>'
390  switch ( ::toupper( val[0] ) ) {
391  case 'R':
392  if ( ::strncasecmp( val.c_str(), "RECREATE", 3 ) == 0 )
393  m_outputType = "RECREATE";
394  else if ( ::strncasecmp( val.c_str(), "READ", 3 ) == 0 )
395  m_outputType = "READ";
396  break;
397  case 'C':
398  case 'N':
399  case 'W':
400  m_outputType = "NEW";
401  break;
402  case 'U':
403  m_outputType = "UPDATE";
404  break;
405  default:
406  m_outputType = "???";
407  break;
408  }
409  break;
410  default:
411  break;
412  }
413  }
414  if ( !shr.empty() ) m_outputType += "|SHARED";
415  // Get access to the default Persistency service
416  // The default service is the same for input as for output.
417  // If this is not desired, then a specialized OutputStream must overwrite
418  // this value.
419  if ( !dbType.empty() || !svc.empty() ) {
420  std::string typ = !dbType.empty() ? dbType : svc;
421  auto ipers = serviceLocator()->service<IPersistencySvc>( m_persName );
422  if ( !ipers ) {
423  fatal() << "Unable to locate IPersistencySvc interface of " << m_persName << endmsg;
424  return StatusCode::FAILURE;
425  }
426  IConversionSvc* cnvSvc = nullptr;
427  status = ipers->getService( typ, cnvSvc );
428  if ( !status.isSuccess() ) {
429  fatal() << "Unable to locate IConversionSvc interface of database type " << typ << endmsg;
430  return status;
431  }
432  // Increase reference count and keep service.
433  m_pConversionSvc = cnvSvc;
434  } else {
435  fatal() << "Unable to locate IConversionSvc interface (Unknown technology) " << endmsg
436  << "You either have to specify a technology name or a service name!" << endmsg
437  << "Please correct the job option \"" << name() << ".Output\" !" << endmsg;
438  return StatusCode::FAILURE;
439  }
440  return StatusCode::SUCCESS;
441 }

◆ decodeAlgorithm()

Gaudi::Algorithm * OutputStream::decodeAlgorithm ( const std::string theName)
protected

Decode a single algorithm name.

Definition at line 443 of file OutputStream.cpp.

443  {
444  Gaudi::Algorithm* theAlgorithm = nullptr;
445 
446  auto theAlgMgr = serviceLocator()->as<IAlgManager>();
447  if ( theAlgMgr ) {
448  // Check whether the supplied name corresponds to an existing
449  // Algorithm object.
450  SmartIF<IAlgorithm>& theIAlg = theAlgMgr->algorithm( theName );
451  if ( theIAlg ) {
452  try {
453  theAlgorithm = dynamic_cast<Gaudi::Algorithm*>( theIAlg.get() );
454  } catch ( ... ) {
455  // do nothing
456  }
457  }
458  } else {
459  fatal() << "Can't locate ApplicationMgr!!!" << endmsg;
460  }
461 
462  if ( !theAlgorithm ) { warning() << "Failed to decode Algorithm name " << theName << endmsg; }
463 
464  return theAlgorithm;
465 }

◆ decodeAlgorithms()

void OutputStream::decodeAlgorithms ( Gaudi::Property< std::vector< std::string >> &  theNames,
std::vector< Gaudi::Algorithm * > &  theAlgs 
)
protected

Decode specified list of Algorithms.

Definition at line 467 of file OutputStream.cpp.

468  {
469  // Reset the list of Algorithms
470  theAlgs.clear();
471 
472  // Build the list of Algorithms from the names list
473  for ( const auto& it : theNames.value() ) {
474 
475  auto theAlgorithm = decodeAlgorithm( it );
476  if ( theAlgorithm ) {
477  // Check that the specified algorithm doesn't already exist in the list
478  if ( std::find( std::begin( theAlgs ), std::end( theAlgs ), theAlgorithm ) == std::end( theAlgs ) ) {
479  theAlgorithm->addRef();
480  theAlgs.push_back( theAlgorithm );
481  }
482  } else {
483  info() << it << " doesn't exist - ignored" << endmsg;
484  }
485  }
486 }

◆ execute()

StatusCode OutputStream::execute ( )
overridevirtual

Working entry point.

Implements Algorithm.

Reimplemented in SequentialOutputStream, RecordStream, and RunRecordStream.

Definition at line 161 of file OutputStream.cpp.

161  {
162  // Clear any previously existing item list
163  clearSelection();
164  // Test whether this event should be output
165  if ( isEventAccepted() ) {
166  const StatusCode sc = writeObjects();
167  clearSelection();
168  ++m_events;
169  if ( sc.isSuccess() && m_fireIncidents ) {
170  m_incidentSvc->fireIncident( Incident( m_outputName, IncidentType::WroteToOutputFile ) );
171  } else if ( m_fireIncidents ) {
172  m_incidentSvc->fireIncident( Incident( m_outputName, IncidentType::FailOutputFile ) );
173  }
174  return sc;
175  }
176  return StatusCode::SUCCESS;
177 }

◆ finalize()

StatusCode OutputStream::finalize ( )
override

Terminate OutputStream.

Definition at line 148 of file OutputStream.cpp.

148  {
149  info() << "Events output: " << m_events << endmsg;
150  if ( m_fireIncidents ) m_incidentSvc->fireIncident( Incident( m_outputName, IncidentType::EndOutputFile ) );
157  return StatusCode::SUCCESS;
158 }

◆ findItem()

DataStoreItem * OutputStream::findItem ( const std::string path)
protected

Find single item identified by its path (exact match)

Definition at line 331 of file OutputStream.cpp.

331  {
332  auto matchPath = [&]( const DataStoreItem* i ) { return i->path() == path; };
333  auto i = std::find_if( m_itemList.begin(), m_itemList.end(), matchPath );
334  if ( i == m_itemList.end() ) {
335  i = std::find_if( m_optItemList.begin(), m_optItemList.end(), matchPath );
336  if ( i == m_optItemList.end() ) return nullptr;
337  }
338  return *i;
339 }

◆ hasInput()

bool OutputStream::hasInput ( ) const
protectedvirtual

Tell if the instance has been configured with input items or not.

Reimplemented in InputCopyStream, and CopyInputStream.

Definition at line 513 of file OutputStream.cpp.

513  {
514  return !( m_itemNames.empty() && m_optItemNames.empty() && m_algDependentItemList.empty() );
515 }

◆ initialize()

StatusCode OutputStream::initialize ( )
override

Initialize OutputStream.

Definition at line 53 of file OutputStream.cpp.

53  {
54  auto status = Algorithm::initialize();
55  if ( status.isFailure() ) return status;
56 
57  if ( m_output.empty() ) {
58  fatal() << "property Output not set. OutputStream instances require an output" << endmsg;
59  return StatusCode::FAILURE;
60  }
61 
62  // Reset the number of events written
63  m_events = 0;
64  // Get access to the DataManagerSvc
66  if ( !m_pDataManager ) {
67  fatal() << "Unable to locate IDataManagerSvc interface" << endmsg;
68  return StatusCode::FAILURE;
69  }
70  // Get access to the IncidentService
71  m_incidentSvc = serviceLocator()->service( "IncidentSvc" );
72  if ( !m_incidentSvc ) {
73  warning() << "Error retrieving IncidentSvc." << endmsg;
74  return StatusCode::FAILURE;
75  }
76  // Get access to the assigned data service
78  if ( !m_pDataProvider ) {
79  fatal() << "Unable to locate IDataProviderSvc interface of " << m_storeName << endmsg;
80  return StatusCode::FAILURE;
81  }
82  if ( hasInput() ) {
84  if ( !status.isSuccess() ) {
85  fatal() << "Unable to connect to conversion service." << endmsg;
86  if ( m_outputName != "" && m_fireIncidents )
87  m_incidentSvc->fireIncident( Incident( m_outputName, IncidentType::FailOutputFile ) );
88  return status;
89  }
90  }
91 
92  // Clear the list with optional items
94  // Clear the item list
96 
97  // Take the new item list from the properties.
98  ON_DEBUG debug() << "ItemList : " << m_itemNames.value() << endmsg;
99  for ( const auto& i : m_itemNames ) addItem( m_itemList, i );
100 
101  // Take the new item list from the properties.
102  ON_DEBUG debug() << "OptItemList : " << m_optItemNames.value() << endmsg;
103  for ( const auto& i : m_optItemNames ) addItem( m_optItemList, i );
104 
105  // prepare the algorithm selected dependent locations
106  ON_DEBUG debug() << "AlgDependentItemList : " << m_algDependentItemList.value() << endmsg;
107  for ( const auto& a : m_algDependentItemList ) {
108  // Get the algorithm pointer
109  auto theAlgorithm = decodeAlgorithm( a.first );
110  if ( theAlgorithm ) {
111  // Get the item list for this alg
112  auto& items = m_algDependentItems[theAlgorithm];
113  // Clear the list for this alg
114  clearItems( items );
115  // fill the list again
116  for ( const auto& i : a.second ) addItem( items, i );
117  }
118  }
119 
120  // Take the item list to the data service preload list.
121  if ( m_doPreLoad ) {
122  for ( auto& j : m_itemList ) m_pDataProvider->addPreLoadItem( *j ).ignore();
123  // Not working: bad reference counting! pdataSvc->release();
124  }
125 
126  if ( m_doPreLoadOpt ) {
127  for ( auto& j : m_optItemList ) m_pDataProvider->addPreLoadItem( *j ).ignore();
128  }
129  info() << "Data source: " << m_storeName.value() << " output: " << m_output.value() << endmsg;
130 
131  // Decode the accept, required and veto Algorithms. The logic is the following:
132  // a. The event is accepted if all lists are empty.
133  // b. The event is provisionally accepted if any Algorithm in the accept list
134  // has been executed and has indicated that its filter is passed. This
135  // provisional acceptance can be overridden by the other lists.
136  // c. The event is rejected unless all Algorithms in the required list have
137  // been executed and have indicated that their filter passed.
138  // d. The event is rejected if any Algorithm in the veto list has been
139  // executed and has indicated that its filter has passed.
143 
144  return StatusCode::SUCCESS;
145 }

◆ isEventAccepted()

bool OutputStream::isEventAccepted ( ) const
protected

Test whether this event should be output.

Definition at line 488 of file OutputStream.cpp.

488  {
489  // Loop over all Algorithms in the accept list to see
490  // whether any have been executed and have their filter
491  // passed flag set. Any match causes the event to be
492  // provisionally accepted.
493  bool result = m_acceptAlgs.empty() || std::any_of( std::begin( m_acceptAlgs ), std::end( m_acceptAlgs ), passed );
494 
495  // Loop over all Algorithms in the required list to see
496  // whether all have been executed and have their filter
497  // passed flag set. Any mismatch causes the event to be
498  // rejected.
499  if ( result && !m_requireAlgs.empty() ) {
500  result = std::all_of( std::begin( m_requireAlgs ), std::end( m_requireAlgs ), passed );
501  }
502 
503  // Loop over all Algorithms in the veto list to see
504  // whether any have been executed and have their filter
505  // passed flag set. Any match causes the event to be
506  // rejected.
507  if ( result && !m_vetoAlgs.empty() ) {
508  result = std::none_of( std::begin( m_vetoAlgs ), std::end( m_vetoAlgs ), passed );
509  }
510  return result;
511 }

◆ selectedObjects()

IDataSelector* OutputStream::selectedObjects ( )
inlineprivate

Return the list of selected objects.

Definition at line 165 of file OutputStream.h.

165 { return &m_objects; }

◆ start()

StatusCode OutputStream::start ( )
override

Start OutputStream.

Definition at line 45 of file OutputStream.cpp.

45  {
46  return Algorithm::start().andThen( [this]() {
47  // Open the output file now to ensure it is always written even if empty
48  return m_pConversionSvc->connectOutput( m_outputName, m_outputType );
49  } );
50 }

◆ writeObjects()

StatusCode OutputStream::writeObjects ( )
protectedvirtual

Select the different objects and write them to file.

Reimplemented in TagCollectionStream, and SequentialOutputStream.

Definition at line 180 of file OutputStream.cpp.

180  {
181  // Connect the output file to the service
182  StatusCode status = collectObjects();
183  if ( status.isSuccess() ) {
185  if ( sel->begin() != sel->end() ) {
186  status = m_pConversionSvc->connectOutput( m_outputName, m_outputType );
187  if ( status.isSuccess() ) {
188  // Now pass the collection to the persistency service
189  IOpaqueAddress* pAddress = nullptr;
190  for ( auto& j : *sel ) {
191  try {
192  const StatusCode iret = m_pConversionSvc->createRep( j, pAddress );
193  if ( !iret.isSuccess() ) {
194  status = iret;
195  continue;
196  }
197  IRegistry* pReg = j->registry();
198  pReg->setAddress( pAddress );
199  } catch ( const std::exception& excpt ) {
200  const std::string loc = ( j->registry() ? j->registry()->identifier() : "UnRegistered" );
201  fatal() << "std::exception during createRep for '" << loc << "' " << System::typeinfoName( typeid( *j ) )
202  << endmsg;
203  fatal() << excpt.what() << endmsg;
204  throw;
205  }
206  }
207  for ( auto& j : *sel ) {
208  try {
209  IRegistry* pReg = j->registry();
210  const StatusCode iret = m_pConversionSvc->fillRepRefs( pReg->address(), j );
211  if ( !iret.isSuccess() ) status = iret;
212  } catch ( const std::exception& excpt ) {
213  const std::string loc = ( j->registry() ? j->registry()->identifier() : "UnRegistered" );
214  fatal() << "std::exception during fillRepRefs for '" << loc << "'" << System::typeinfoName( typeid( *j ) )
215  << endmsg;
216  fatal() << excpt.what() << endmsg;
217  throw;
218  }
219  }
220  // Commit the data if there was no error; otherwise possibly discard
221  if ( status.isSuccess() ) {
222  status = m_pConversionSvc->commitOutput( m_outputName, true );
223  } else {
224  m_pConversionSvc->commitOutput( m_outputName, false ).ignore();
225  }
226  }
227  }
228  }
229  return status;
230 }

Member Data Documentation

◆ m_acceptAlgs

std::vector<Gaudi::Algorithm*> OutputStream::m_acceptAlgs
protected

Vector of Algorithms that this stream accepts.

Definition at line 120 of file OutputStream.h.

◆ m_acceptNames

Gaudi::Property<std::vector<std::string> > OutputStream::m_acceptNames
protected
Initial value:
{
this,
"AcceptAlgs",
{},
[this]( auto& ) { this->decodeAlgorithms( this->m_acceptNames, this->m_acceptAlgs ); },
"names of Algorithms that this stream accepts" }

Definition at line 69 of file OutputStream.h.

◆ m_algDependentItemList

Gaudi::Property<AlgDependentItemNames> OutputStream::m_algDependentItemList
protected
Initial value:
{
this,
"AlgDependentItemList",
{},
"mapping between algorithm names, and a list of items for which, if the "
"algorithm in question accepted the event, they should be also stored" }

Definition at line 53 of file OutputStream.h.

◆ m_algDependentItems

AlgDependentItems OutputStream::m_algDependentItems
protected

Items to be saved for specific algorithms.

Definition at line 113 of file OutputStream.h.

◆ m_currentItem

DataStoreItem* OutputStream::m_currentItem
protected

Keep track of the current item.

Definition at line 107 of file OutputStream.h.

◆ m_doPreLoad

Gaudi::Property<bool> OutputStream::m_doPreLoad
protected
Initial value:
{ this, "Preload", true,
"flag indicating whether data pre-loading should be performed" }

Definition at line 59 of file OutputStream.h.

◆ m_doPreLoadOpt

Gaudi::Property<bool> OutputStream::m_doPreLoadOpt
protected
Initial value:
{ this, "PreloadOptItems", false,
"flag indicating whether optional items should be preloaded" }

Definition at line 61 of file OutputStream.h.

◆ m_events

int OutputStream::m_events
protected

Number of events written to this output stream.

Definition at line 117 of file OutputStream.h.

◆ m_fireIncidents

bool OutputStream::m_fireIncidents = true
protected

should I fire incidents for writing opening/closing etc? in the baseclass, always fire the incidents by default in e.g.

RecordStream this will be set to false, and configurable

Definition at line 93 of file OutputStream.h.

◆ m_incidentSvc

SmartIF<IIncidentSvc> OutputStream::m_incidentSvc
protected

Reference to the incident service.

Definition at line 96 of file OutputStream.h.

◆ m_itemList

Items OutputStream::m_itemList
protected

Vector of items to be saved to this stream.

Definition at line 109 of file OutputStream.h.

◆ m_itemNames

Gaudi::Property<ItemNames> OutputStream::m_itemNames { this, "ItemList", {}, "vector of item names to be saved to this stream" }
protected

Definition at line 50 of file OutputStream.h.

◆ m_objects

IDataSelector OutputStream::m_objects
protected

Collection of objects being selected.

Definition at line 115 of file OutputStream.h.

◆ m_optItemList

Items OutputStream::m_optItemList
protected

Vector of optional items to be saved to this stream.

Definition at line 111 of file OutputStream.h.

◆ m_optItemNames

Gaudi::Property<ItemNames> OutputStream::m_optItemNames
protected
Initial value:
{
this, "OptItemList", {}, "vector of optional item names to be saved to this stream" }

Definition at line 51 of file OutputStream.h.

◆ m_output

Gaudi::Property<std::string> OutputStream::m_output { this, "Output", {}, "name of the output file specification" }
protected

Definition at line 63 of file OutputStream.h.

◆ m_outputName

Gaudi::Property<std::string> OutputStream::m_outputName { this, "OutputFile", {}, "name of the output file" }
protected

Definition at line 64 of file OutputStream.h.

◆ m_outputType

std::string OutputStream::m_outputType = "UPDATE"
protected

Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE)

Definition at line 99 of file OutputStream.h.

◆ m_pConversionSvc

SmartIF<IConversionSvc> OutputStream::m_pConversionSvc
protected

Keep reference to the data conversion service.

Definition at line 105 of file OutputStream.h.

◆ m_pDataManager

SmartIF<IDataManagerSvc> OutputStream::m_pDataManager
protected

Keep reference to the data manager service.

Definition at line 103 of file OutputStream.h.

◆ m_pDataProvider

SmartIF<IDataProviderSvc> OutputStream::m_pDataProvider
protected

Keep reference to the data provider service.

Definition at line 101 of file OutputStream.h.

◆ m_persName

Gaudi::Property<std::string> OutputStream::m_persName
protected
Initial value:
{ this, "EvtConversionSvc", "EventPersistencySvc",
"name of the persistency service capable to write data from the store" }

Definition at line 67 of file OutputStream.h.

◆ m_requireAlgs

std::vector<Gaudi::Algorithm*> OutputStream::m_requireAlgs
protected

Vector of Algorithms that this stream requires.

Definition at line 122 of file OutputStream.h.

◆ m_requireNames

Gaudi::Property<std::vector<std::string> > OutputStream::m_requireNames
protected
Initial value:
{
this,
"RequireAlgs",
{},
[this]( auto& ) { this->decodeAlgorithms( this->m_requireNames, this->m_requireAlgs ); },
"names of Algorithms that this stream requires" }

Definition at line 75 of file OutputStream.h.

◆ m_storeName

Gaudi::Property<std::string> OutputStream::m_storeName
protected
Initial value:
{ this, "EvtDataSvc", "EventDataSvc",
"name of the service managing the data store" }

Definition at line 65 of file OutputStream.h.

◆ m_verifyItems

Gaudi::Property<bool> OutputStream::m_verifyItems
protected
Initial value:
{ this, "VerifyItems", true,
"flag to indicate that item consistency should be checked" }

Definition at line 87 of file OutputStream.h.

◆ m_vetoAlgs

std::vector<Gaudi::Algorithm*> OutputStream::m_vetoAlgs
protected

Vector of Algorithms that this stream is vetoed by.

Definition at line 124 of file OutputStream.h.

◆ m_vetoNames

Gaudi::Property<std::vector<std::string> > OutputStream::m_vetoNames
protected
Initial value:
{
this,
"VetoAlgs",
{},
[this]( auto& ) { this->decodeAlgorithms( this->m_vetoNames, this->m_vetoAlgs ); },
"names of Algorithms that this stream is vetoed by" }

Definition at line 81 of file OutputStream.h.


The documentation for this class was generated from the following files:
OutputStream::collectObjects
virtual StatusCode collectObjects()
Collect all objects to be written to the output stream.
Definition: OutputStream.cpp:251
OutputStream::m_verifyItems
Gaudi::Property< bool > m_verifyItems
Definition: OutputStream.h:87
OutputStream::m_requireAlgs
std::vector< Gaudi::Algorithm * > m_requireAlgs
Vector of Algorithms that this stream requires.
Definition: OutputStream.h:122
toupper
void toupper(std::string &s)
Definition: ExceptionSvc.cpp:36
OutputStream::m_currentItem
DataStoreItem * m_currentItem
Keep track of the current item.
Definition: OutputStream.h:107
OutputStream::clearItems
void clearItems(Items &itms)
Clear item list.
Definition: OutputStream.cpp:325
std::string
STL class.
OutputStream::m_vetoNames
Gaudi::Property< std::vector< std::string > > m_vetoNames
Definition: OutputStream.h:81
OutputStream::m_fireIncidents
bool m_fireIncidents
should I fire incidents for writing opening/closing etc? in the baseclass, always fire the incidents ...
Definition: OutputStream.h:93
std::exception
STL class.
StatusCode::andThen
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
Definition: StatusCode.h:163
OutputStream::m_optItemList
Items m_optItemList
Vector of optional items to be saved to this stream.
Definition: OutputStream.h:111
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:526
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
OutputStream::m_outputType
std::string m_outputType
Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE)
Definition: OutputStream.h:99
OutputStream::m_events
int m_events
Number of events written to this output stream.
Definition: OutputStream.h:117
std::vector::reserve
T reserve(T... args)
OutputStream::m_optItemNames
Gaudi::Property< ItemNames > m_optItemNames
Definition: OutputStream.h:51
IOpaqueAddress
Definition: IOpaqueAddress.h:33
std::vector< DataObject * >
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:96
std::string::find
T find(T... args)
std::vector::size
T size(T... args)
OutputStream::m_output
Gaudi::Property< std::string > m_output
Definition: OutputStream.h:63
Gaudi::Algorithm::initialize
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition: Algorithm.h:178
Gaudi::Algorithm::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Algorithm.cpp:570
ON_DEBUG
#define ON_DEBUG
Definition: OutputStream.cpp:36
IRegistry
Definition: IRegistry.h:32
OutputStream::selectedObjects
IDataSelector * selectedObjects()
Return the list of selected objects.
Definition: OutputStream.h:165
std::any_of
T any_of(T... args)
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:315
Gaudi::Algorithm::start
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Definition: Algorithm.h:180
OutputStream::m_doPreLoad
Gaudi::Property< bool > m_doPreLoad
Definition: OutputStream.h:59
OutputStream::m_pConversionSvc
SmartIF< IConversionSvc > m_pConversionSvc
Keep reference to the data conversion service.
Definition: OutputStream.h:105
OutputStream::m_outputName
Gaudi::Property< std::string > m_outputName
Definition: OutputStream.h:64
std::vector::clear
T clear(T... args)
std::vector::push_back
T push_back(T... args)
OutputStream::m_vetoAlgs
std::vector< Gaudi::Algorithm * > m_vetoAlgs
Vector of Algorithms that this stream is vetoed by.
Definition: OutputStream.h:124
OutputStream::m_requireNames
Gaudi::Property< std::vector< std::string > > m_requireNames
Definition: OutputStream.h:75
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:81
IAlgManager
Definition: IAlgManager.h:37
std::stoi
T stoi(T... args)
OutputStream::collect
virtual bool collect(IRegistry *dir, int level)
Store agent's classback.
Definition: OutputStream.cpp:233
OutputStream::findItem
DataStoreItem * findItem(const std::string &path)
Find single item identified by its path (exact match)
Definition: OutputStream.cpp:331
OutputStream::connectConversionSvc
virtual StatusCode connectConversionSvc()
Definition: OutputStream.cpp:365
OutputStream::m_pDataProvider
SmartIF< IDataProviderSvc > m_pDataProvider
Keep reference to the data provider service.
Definition: OutputStream.h:101
StatusCode
Definition: StatusCode.h:65
OutputStream::m_algDependentItems
AlgDependentItems m_algDependentItems
Items to be saved for specific algorithms.
Definition: OutputStream.h:113
ProduceConsume.j
j
Definition: ProduceConsume.py:104
DataStoreItem
Definition: DataStoreItem.h:27
OutputStream::clearSelection
void clearSelection()
Clear list of selected objects.
Definition: OutputStream.cpp:322
Gaudi::Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:90
std::string::c_str
T c_str(T... args)
OutputStream::Items
std::vector< DataStoreItem * > Items
Definition: OutputStream.h:40
OutputStream::addItem
void addItem(Items &itms, const std::string &descriptor)
Add item to output streamer list.
Definition: OutputStream.cpp:342
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:237
OutputStream::hasInput
virtual bool hasInput() const
Tell if the instance has been configured with input items or not.
Definition: OutputStream.cpp:513
OutputStream::writeObjects
virtual StatusCode writeObjects()
Select the different objects and write them to file.
Definition: OutputStream.cpp:180
OutputStream::m_algDependentItemList
Gaudi::Property< AlgDependentItemNames > m_algDependentItemList
Definition: OutputStream.h:53
OutputStream::m_pDataManager
SmartIF< IDataManagerSvc > m_pDataManager
Keep reference to the data manager service.
Definition: OutputStream.h:103
SmartIF< IAlgorithm >
IRegistry::setAddress
virtual void setAddress(IOpaqueAddress *pAddress)=0
Set/Update Opaque storage address.
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
OutputStream::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: OutputStream.h:96
Gaudi::Property::useUpdateHandler
bool useUpdateHandler() override
manual trigger for callback for update
Definition: Property.h:159
gaudirun.level
level
Definition: gaudirun.py:364
IOTest.sel
sel
Definition: IOTest.py:106
OutputStream::m_itemList
Items m_itemList
Vector of items to be saved to this stream.
Definition: OutputStream.h:109
std::vector::swap
T swap(T... args)
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:117
OutputStream::m_storeName
Gaudi::Property< std::string > m_storeName
Definition: OutputStream.h:65
std::string::substr
T substr(T... args)
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
IPersistencySvc
Definition: IPersistencySvc.h:29
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
std::begin
T begin(T... args)
OutputStream::m_doPreLoadOpt
Gaudi::Property< bool > m_doPreLoadOpt
Definition: OutputStream.h:61
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
OutputStream::decodeAlgorithm
Gaudi::Algorithm * decodeAlgorithm(const std::string &theName)
Decode a single algorithm name.
Definition: OutputStream.cpp:443
DataObject
Definition: DataObject.h:36
OutputStream::isEventAccepted
bool isEventAccepted() const
Test whether this event should be output.
Definition: OutputStream.cpp:488
std::string::empty
T empty(T... args)
std::unique
T unique(T... args)
DataStoreItem::path
const std::string & path() const
Accessor: Retrieve load path.
Definition: DataStoreItem.h:66
std::end
T end(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
OutputStream::decodeAlgorithms
void decodeAlgorithms(Gaudi::Property< std::vector< std::string >> &theNames, std::vector< Gaudi::Algorithm * > &theAlgs)
Decode specified list of Algorithms.
Definition: OutputStream.cpp:467
OutputStream::m_itemNames
Gaudi::Property< ItemNames > m_itemNames
Definition: OutputStream.h:50
Incident
Definition: Incident.h:27
Gaudi::Utils::AttribStringParser
Parse attribute strings allowing iteration over the various attributes.
Definition: AttribStringParser.h:40
std::set
STL class.
std::string::rfind
T rfind(T... args)
OutputStream::collectFromSubTree
StatusCode collectFromSubTree(DataObject *)
Definition: OutputStream.cpp:517
OutputStream::m_objects
IDataSelector m_objects
Collection of objects being selected.
Definition: OutputStream.h:115
std::exception::what
T what(T... args)
OutputStream::m_acceptAlgs
std::vector< Gaudi::Algorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
Definition: OutputStream.h:120
OutputStream::m_persName
Gaudi::Property< std::string > m_persName
Definition: OutputStream.h:67
OutputStream::m_acceptNames
Gaudi::Property< std::vector< std::string > > m_acceptNames
Definition: OutputStream.h:69
IConversionSvc
Definition: IConversionSvc.h:47