OutputStream Class Reference

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

#include <src/PersistencySvc/OutputStream.h>

Inheritance diagram for OutputStream:
Collaboration diagram for OutputStream:

Public Types

typedef std::vector< DataStoreItem * > Items
 
typedef std::vector< std::string > ItemNames
 
typedef std::map< Algorithm *, ItemsAlgDependentItems
 
typedef std::map< std::string, ItemNamesAlgDependentItemNames
 
- Public Types inherited from Algorithm
typedef Gaudi::PluginService::Factory< IAlgorithm *, const std::string &, ISvcLocator * > Factory
 
typedef Gaudi::PluginService::Factory< IAlgorithm *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from implements< Interfaces >
using base_class = implements< Interfaces...>
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using iids = typename extend_interfaces_base::ext_iids
 
using base_class = implements< Interfaces...>
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using iids = typename extend_interfaces_base::ext_iids
 
- 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...
 
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

 OutputStream (const std::string &name, ISvcLocator *pSvcLocator)
 Standard algorithm Constructor. More...
 
virtual ~OutputStream ()=default
 Standard Destructor. 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 Algorithm
 Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
 Constructor. More...
 
 ~Algorithm () override=default
 Destructor. 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 () 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...
 
StatusCode sysBeginRun () override
 beginRun method invoked by the framework. More...
 
StatusCode sysEndRun () override
 endRun method invoked by the framework. More...
 
const std::string & name () const override
 The identifying name of the algorithm object. More...
 
const std::string & type () const override
 The type of the algorithm object. More...
 
void setType (const std::string &type) override
 
const std::string & version () const override
 
unsigned int index () 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 isExecuted () const override
 Has this algorithm been executed since the last reset? More...
 
void setExecuted (bool state) override
 Set the executed flag to the specified state. More...
 
void resetExecuted () override
 Reset the executed state of the Algorithm for the duration of the current event. More...
 
StatusCode beginRun () override
 Algorithm begin run. More...
 
StatusCode endRun () override
 Algorithm end run. This method is called at the end of the event loop. More...
 
bool isEnabled () const override
 Is this algorithm enabled or disabled? More...
 
bool filterPassed () const override
 Did this algorithm pass or fail its filter criterion for the last event? More...
 
void setFilterPassed (bool state) override
 Set the filter passed flag to the specified state. More...
 
int errorCount () const
 Get the number of failures of the algorithm. More...
 
template<class T >
StatusCode service (const std::string &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 (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
SmartIF< IServiceservice (const std::string &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 (const std::string &name, bool createIf=true, bool quiet=false) const
 
void setOutputLevel (int level)
 Set the output level for current algorithm. More...
 
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< IChronoStatSvc > & chronoStatService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & detSvc () const
 The standard detector data service. More...
 
SmartIF< IDataProviderSvc > & detDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & detCnvSvc () const
 The standard detector data persistency conversion service. More...
 
SmartIF< IConversionSvc > & detDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & eventSvc () const
 The standard event data service. More...
 
SmartIF< IDataProviderSvc > & evtSvc () const
 shortcut for method eventSvc More...
 
SmartIF< IDataProviderSvc > & eventDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & eventCnvSvc () const
 The standard event data persistency conversion service. More...
 
SmartIF< IConversionSvc > & eventDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IHistogramSvc > & histoSvc () const
 The standard histogram service. More...
 
SmartIF< IHistogramSvc > & histogramDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
SmartIF< IMessageSvc > & messageService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< INTupleSvc > & ntupleSvc () const
 The standard N tuple service. More...
 
SmartIF< INTupleSvc > & ntupleService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IRndmGenSvc > & randSvc () const
 AIDA-based NTuple service Returns a pointer to the AIDATuple 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
 The standard service locator. More...
 
SmartIF< ISvcLocator > & svcLoc () const
 shortcut for method serviceLocator More...
 
SmartIF< IHiveWhiteBoard > & whiteboard () const
 
bool registerContext () const
 register for Algorithm Context Service? More...
 
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
 Create a sub algorithm. More...
 
const std::vector< Algorithm * > * subAlgorithms () const
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
std::vector< Algorithm * > * subAlgorithms ()
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
StatusCode setProperty (const Property &p) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &s) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 Implementation of IProperty::setProperty. More...
 
StatusCode getProperty (Property *p) const override
 Implementation of IProperty::getProperty. More...
 
const PropertygetProperty (const std::string &name) const override
 Implementation of IProperty::getProperty. More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const override
 Implementation of IProperty::getProperties. More...
 
bool hasProperty (const std::string &name) const override
 Implementation of IProperty::hasProperty. More...
 
StatusCode setProperties ()
 Set the algorithm's properties. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
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...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
EventContextgetContext ()
 get the context More...
 
void setContext (EventContext *context)
 set the context More...
 
template<typename T >
 __attribute__ ((deprecated)) StatusCode declareDataObj(const std
 Declare data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::vector< std::string > &addresses, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareOutput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::WRITE)
 Declare output data object. More...
 
__attribute__((deprecated)) const std const DataObjectDescriptorCollectioninputDataObjects () const override
 Return the handles declared in the algorithm. More...
 
const DataObjectDescriptorCollectionoutputDataObjects () const override
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
template<class T >
StatusCode declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Private tool. More...
 
template<class T >
StatusCode declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Public tool. More...
 
const std::vector< IAlgTool * > & tools () const
 
bool isClonable () const override
 Specifies the clonability of the algorithm. More...
 
unsigned int cardinality () const override
 Return the cardinality. More...
 
const std::vector< std::string > & neededResources () const override
 
 Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
 Constructor. More...
 
 ~Algorithm () override=default
 Destructor. 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 () 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...
 
StatusCode sysBeginRun () override
 beginRun method invoked by the framework. More...
 
StatusCode sysEndRun () override
 endRun method invoked by the framework. More...
 
const std::string & name () const override
 The identifying name of the algorithm object. More...
 
const std::string & type () const override
 The type of the algorithm object. More...
 
void setType (const std::string &type) override
 
const std::string & version () const override
 
unsigned int index () 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 isExecuted () const override
 Has this algorithm been executed since the last reset? More...
 
void setExecuted (bool state) override
 Set the executed flag to the specified state. More...
 
void resetExecuted () override
 Reset the executed state of the Algorithm for the duration of the current event. More...
 
StatusCode beginRun () override
 Algorithm begin run. More...
 
StatusCode endRun () override
 Algorithm end run. This method is called at the end of the event loop. More...
 
bool isEnabled () const override
 Is this algorithm enabled or disabled? More...
 
bool filterPassed () const override
 Did this algorithm pass or fail its filter criterion for the last event? More...
 
void setFilterPassed (bool state) override
 Set the filter passed flag to the specified state. More...
 
int errorCount () const
 Get the number of failures of the algorithm. More...
 
template<class T >
StatusCode service (const std::string &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 (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
SmartIF< IServiceservice (const std::string &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 (const std::string &name, bool createIf=true, bool quiet=false) const
 
void setOutputLevel (int level)
 Set the output level for current algorithm. More...
 
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< IChronoStatSvc > & chronoStatService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & detSvc () const
 The standard detector data service. More...
 
SmartIF< IDataProviderSvc > & detDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & detCnvSvc () const
 The standard detector data persistency conversion service. More...
 
SmartIF< IConversionSvc > & detDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & eventSvc () const
 The standard event data service. More...
 
SmartIF< IDataProviderSvc > & evtSvc () const
 shortcut for method eventSvc More...
 
SmartIF< IDataProviderSvc > & eventDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & eventCnvSvc () const
 The standard event data persistency conversion service. More...
 
SmartIF< IConversionSvc > & eventDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IHistogramSvc > & histoSvc () const
 The standard histogram service. More...
 
SmartIF< IHistogramSvc > & histogramDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
SmartIF< IMessageSvc > & messageService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< INTupleSvc > & ntupleSvc () const
 The standard N tuple service. More...
 
SmartIF< INTupleSvc > & ntupleService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IRndmGenSvc > & randSvc () const
 AIDA-based NTuple service Returns a pointer to the AIDATuple 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
 The standard service locator. More...
 
SmartIF< ISvcLocator > & svcLoc () const
 shortcut for method serviceLocator More...
 
SmartIF< IHiveWhiteBoard > & whiteboard () const
 
bool registerContext () const
 register for Algorithm Context Service? More...
 
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
 Create a sub algorithm. More...
 
const std::vector< Algorithm * > * subAlgorithms () const
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
std::vector< Algorithm * > * subAlgorithms ()
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
StatusCode setProperty (const Property &p) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &s) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 Implementation of IProperty::setProperty. More...
 
StatusCode getProperty (Property *p) const override
 Implementation of IProperty::getProperty. More...
 
const PropertygetProperty (const std::string &name) const override
 Implementation of IProperty::getProperty. More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const override
 Implementation of IProperty::getProperties. More...
 
bool hasProperty (const std::string &name) const override
 Implementation of IProperty::hasProperty. More...
 
StatusCode setProperties ()
 Set the algorithm's properties. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
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...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
EventContextgetContext ()
 get the context More...
 
void setContext (EventContext *context)
 set the context More...
 
template<typename T >
 __attribute__ ((deprecated)) StatusCode declareDataObj(const std
 Declare data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::vector< std::string > &addresses, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareOutput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::WRITE)
 Declare output data object. More...
 
__attribute__((deprecated)) const std const DataObjectDescriptorCollectioninputDataObjects () const override
 Return the handles declared in the algorithm. More...
 
const DataObjectDescriptorCollectionoutputDataObjects () const override
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
template<class T >
StatusCode declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Private tool. More...
 
template<class T >
StatusCode declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Public tool. More...
 
const std::vector< IAlgTool * > & tools () const
 
bool isClonable () const override
 Specifies the clonability of the algorithm. More...
 
unsigned int cardinality () const override
 Return the cardinality. More...
 
const std::vector< std::string > & neededResources () const override
 
- Public Member Functions inherited from implements< Interfaces >
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::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 implements ()=default
 Default constructor. More...
 
 implements (const implements &)
 Copy constructor (zero the reference count) More...
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count). More...
 
 ~implements () override=default
 Virtual destructor. More...
 
unsigned long addRef () override
 Reference Interface instance. More...
 
unsigned long release () override
 Release Interface instance. More...
 
unsigned long refCount () const override
 Current reference count. More...
 
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::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 implements ()=default
 Default constructor. More...
 
 implements (const implements &)
 Copy constructor (zero the reference count) More...
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count). More...
 
 ~implements () override=default
 Virtual destructor. More...
 
unsigned long addRef () override
 Reference Interface instance. More...
 
unsigned long release () override
 Release Interface instance. More...
 
unsigned long refCount () const override
 Current reference count. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Protected Member Functions

StatusCode decodeAcceptAlgs ()
 Decode list of Algorithms that this stream accepts. More...
 
void acceptAlgsHandler (Property &theProp)
 Handler for AcceptAlgs Property. More...
 
StatusCode decodeRequireAlgs ()
 Decode list of Algorithms that this stream requires. More...
 
void requireAlgsHandler (Property &theProp)
 Handler for RequireAlgs Property. More...
 
StatusCode decodeVetoAlgs ()
 Decode list of Algorithms that this stream is vetoed by. More...
 
void vetoAlgsHandler (Property &theProp)
 Handler for VetoAlgs Property. More...
 
AlgorithmdecodeAlgorithm (const std::string &theName)
 Decode a single algorithm name. More...
 
StatusCode decodeAlgorithms (StringArrayProperty &theNames, std::vector< 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 Algorithm
DataObjectDescriptorCollectioninputDataObjects ()
 
DataObjectDescriptorCollectionoutputDataObjects ()
 
std::vector< IAlgTool * > & tools ()
 
void addSubAlgorithmDataObjectHandles ()
 
bool isInitialized () const override
 Has the Algorithm already been initialized? More...
 
bool isFinalized () const override
 Has the Algorithm already been finalized? More...
 
int outputLevel () const
 retrieve the Algorithm output level More...
 
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property. More...
 
void initOutputLevel (Property &prop)
 Callback for output level property. More...
 
DataObjectDescriptorCollectioninputDataObjects ()
 
DataObjectDescriptorCollectionoutputDataObjects ()
 
std::vector< IAlgTool * > & tools ()
 
void addSubAlgorithmDataObjectHandles ()
 
bool isInitialized () const override
 Has the Algorithm already been initialized? More...
 
bool isFinalized () const override
 Has the Algorithm already been finalized? More...
 
int outputLevel () const
 retrieve the Algorithm output level More...
 
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property. More...
 
void initOutputLevel (Property &prop)
 Callback for output level property. More...
 

Protected Attributes

SmartIF< IIncidentSvcm_incidentSvc
 Reference to the incident service. More...
 
bool m_doPreLoad
 Flag indicating whether data pre-loading should be performed. More...
 
bool m_doPreLoadOpt
 Flag indicating whether optional items should be preloaded. More...
 
bool m_verifyItems
 Flag to indicate that item consistency should be checked. More...
 
std::string m_storeName
 Name of the service managing the data store. More...
 
std::string m_persName
 Name of the persistency service capable to write data from the store. More...
 
std::string m_output
 Name of the output file specification. More...
 
std::string m_outputName
 Name of the output file. More...
 
std::string m_outputType
 Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE) More...
 
std::unique_ptr< OutputStreamAgentm_agent
 Keep reference of agent. 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...
 
ItemNames m_itemNames
 Vector of item names. More...
 
Items m_itemList
 Vector of items to be saved to this stream. More...
 
ItemNames m_optItemNames
 Vector of item names. More...
 
Items m_optItemList
 Vector of optional items to be saved to this stream. More...
 
AlgDependentItemNames m_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. 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...
 
StringArrayProperty m_acceptNames
 Vector of names of Algorithms that this stream accepts. More...
 
StringArrayProperty m_requireNames
 Vector of names of Algorithms that this stream requires. More...
 
StringArrayProperty m_vetoNames
 Vector of names of Algorithms that this stream is vetoed by. More...
 
std::vector< Algorithm * > m_acceptAlgs
 Vector of Algorithms that this stream accepts. More...
 
std::vector< Algorithm * > m_requireAlgs
 Vector of Algorithms that this stream requires. More...
 
std::vector< Algorithm * > m_vetoAlgs
 Vector of Algorithms that this stream is vetoed by. More...
 
bool m_fireIncidents
 should I fire incidents for writing opening/closing etc? More...
 
- Protected Attributes inherited from Algorithm
EventContextm_event_context
 Event specific data for multiple event processing. More...
 
- Protected Attributes inherited from implements< Interfaces >
std::atomic_ulong m_refCount = {0}
 Reference counter. More...
 

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

Detailed Description

A small to stream Data I/O.

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

Definition at line 29 of file OutputStream.h.

Member Typedef Documentation

typedef std::map< std::string, ItemNames > OutputStream::AlgDependentItemNames

Definition at line 34 of file OutputStream.h.

Definition at line 33 of file OutputStream.h.

typedef std::vector<std::string> OutputStream::ItemNames

Definition at line 32 of file OutputStream.h.

typedef std::vector<DataStoreItem*> OutputStream::Items

Definition at line 31 of file OutputStream.h.

Constructor & Destructor Documentation

OutputStream::OutputStream ( const std::string &  name,
ISvcLocator pSvcLocator 
)

Standard algorithm Constructor.

in the baseclass, always fire the incidents by default in e.g. RecordStream this will be set to false, and configurable

in the baseclass, always fire the incidents by default in RecordStream this will be set to false, and configurable

Definition at line 30 of file OutputStream.cpp.

31 : Algorithm(name, pSvcLocator),
32  m_agent { new OutputStreamAgent(this) }
33 {
34  m_doPreLoad = true;
35  m_doPreLoadOpt = false;
36  m_verifyItems = true;
37  m_outputType = "UPDATE";
38  m_storeName = "EventDataSvc";
39  m_persName = "EventPersistencySvc";
42  m_fireIncidents = true;
43  declareProperty("ItemList", m_itemNames);
44  declareProperty("OptItemList", m_optItemNames);
45  declareProperty("AlgDependentItemList", m_algDependentItemList);
46  declareProperty("Preload", m_doPreLoad);
47  declareProperty("PreloadOptItems", m_doPreLoadOpt);
48  declareProperty("Output", m_output);
49  declareProperty("OutputFile", m_outputName);
50  declareProperty("EvtDataSvc", m_storeName);
51  declareProperty("EvtConversionSvc", m_persName);
52  declareProperty("AcceptAlgs", m_acceptNames);
53  declareProperty("RequireAlgs", m_requireNames);
54  declareProperty("VetoAlgs", m_vetoNames);
55  declareProperty("VerifyItems", m_verifyItems);
58 
59  // Associate action handlers with the AcceptAlgs, RequireAlgs and VetoAlgs.
63 
64  //setProperty( "OutputLevel", 2 );
65 
66 }
StringArrayProperty m_acceptNames
Vector of names of Algorithms that this stream accepts.
Definition: OutputStream.h:82
std::string m_storeName
Name of the service managing the data store.
Definition: OutputStream.h:45
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
std::string m_outputType
Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE)
Definition: OutputStream.h:53
StringArrayProperty m_vetoNames
Vector of names of Algorithms that this stream is vetoed by.
Definition: OutputStream.h:86
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Algorithm.h:435
std::string m_outputName
Name of the output file.
Definition: OutputStream.h:51
void requireAlgsHandler(Property &theProp)
Handler for RequireAlgs Property.
std::string m_persName
Name of the persistency service capable to write data from the store.
Definition: OutputStream.h:47
AlgDependentItemNames m_algDependentItemList
Mapping between algorithm names, and a list of items for which, if the algorithm in question accepted...
Definition: OutputStream.h:74
std::unique_ptr< OutputStreamAgent > m_agent
Keep reference of agent.
Definition: OutputStream.h:55
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
bool m_verifyItems
Flag to indicate that item consistency should be checked.
Definition: OutputStream.h:43
bool m_doPreLoad
Flag indicating whether data pre-loading should be performed.
Definition: OutputStream.h:39
bool m_doPreLoadOpt
Flag indicating whether optional items should be preloaded.
Definition: OutputStream.h:41
Algorithm(const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
Constructor.
Definition: Algorithm.cpp:39
ItemNames m_itemNames
Vector of item names.
Definition: OutputStream.h:65
ItemNames m_optItemNames
Vector of item names.
Definition: OutputStream.h:69
void acceptAlgsHandler(Property &theProp)
Handler for AcceptAlgs Property.
StringArrayProperty m_requireNames
Vector of names of Algorithms that this stream requires.
Definition: OutputStream.h:84
std::string m_output
Name of the output file specification.
Definition: OutputStream.h:49
void vetoAlgsHandler(Property &theProp)
Handler for VetoAlgs Property.
bool m_fireIncidents
should I fire incidents for writing opening/closing etc?
Definition: OutputStream.h:125
virtual OutputStream::~OutputStream ( )
virtualdefault

Standard Destructor.

Member Function Documentation

void OutputStream::acceptAlgsHandler ( Property theProp)
protected

Handler for AcceptAlgs Property.

Definition at line 514 of file OutputStream.cpp.

514  {
516  if (sc.isFailure()) {
517  throw GaudiException("Failure in OutputStream::decodeAlgorithms",
518  "OutputStream::acceptAlgsHandler",sc);
519  }
520 }
StringArrayProperty m_acceptNames
Vector of names of Algorithms that this stream accepts.
Definition: OutputStream.h:82
Define general base for Gaudi exception.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
std::vector< Algorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
Definition: OutputStream.h:88
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode decodeAlgorithms(StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs)
Decode specified list of Algorithms.
void OutputStream::addItem ( Items itms,
const std::string &  descriptor 
)
private

Add item to output streamer list.

Definition at line 403 of file OutputStream.cpp.

403  {
404  MsgStream log(msgSvc(), name());
405  int level = 0;
406  auto sep = descriptor.rfind("#");
407  std::string obj_path = descriptor.substr(0,sep);
408  if ( sep != std::string::npos ) {
409  std::string slevel = descriptor.substr(sep+1);
410  level = ( slevel == "*" ) ? 9999999 : std::stoi(slevel);
411  }
412  if ( m_verifyItems ) {
413  size_t idx = obj_path.find("/",1);
414  while(idx != std::string::npos) {
415  std::string sub_item = obj_path.substr(0,idx);
416  if ( !findItem(sub_item) ) addItem(itms, sub_item+"#1");
417  idx = obj_path.find("/",idx+1);
418  }
419  }
420  itms.push_back( new DataStoreItem(obj_path, level) );
421  const auto& item = itms.back();
422  ON_DEBUG
423  log << MSG::DEBUG << "Adding OutputStream item " << item->path()
424  << " with " << item->depth()
425  << " level(s)." << endmsg;
426 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
DataStoreItem * findItem(const std::string &path)
Find single item identified by its path (exact match)
bool m_verifyItems
Flag to indicate that item consistency should be checked.
Definition: OutputStream.h:43
void addItem(Items &itms, const std::string &descriptor)
Add item to output streamer list.
tuple item
print s1,s2
Definition: ana.py:146
#define ON_DEBUG
list itms
Definition: ana.py:135
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
void OutputStream::clearItems ( Items itms)
private

Clear item list.

Definition at line 385 of file OutputStream.cpp.

385  {
386  for ( auto& i : itms ) delete i;
387  itms.clear();
388 }
list itms
Definition: ana.py:135
list i
Definition: ana.py:128
void OutputStream::clearSelection ( )

Clear list of selected objects.

Definition at line 380 of file OutputStream.cpp.

380  {
381  m_objects.clear();
382 }
IDataSelector m_objects
Collection of objects being selected.
Definition: OutputStream.h:78
bool OutputStream::collect ( IRegistry dir,
int  level 
)
virtual

Store agent's classback.

Definition at line 278 of file OutputStream.cpp.

278  {
279  if ( level < m_currentItem->depth() ) {
280  if ( dir->object() ) {
281  /*
282  std::cout << "Analysing ("
283  << dir->name()
284  << ") Object:"
285  << ((dir->object()==0) ? "UNLOADED" : "LOADED")
286  << std::endl;
287  */
288  m_objects.push_back(dir->object());
289  return true;
290  }
291  }
292  return false;
293 }
IDataSelector m_objects
Collection of objects being selected.
Definition: OutputStream.h:78
virtual DataObject * object() const =0
Retrieve object behind the link.
StatusCode OutputStream::collectObjects ( )
virtual

Collect all objects to be written to the output stream.

Reimplemented in InputCopyStream.

Definition at line 296 of file OutputStream.cpp.

296  {
297  MsgStream log(msgSvc(), name());
299 
300  // Traverse the tree and collect the requested objects
301  for ( auto& i : m_itemList) {
302  DataObject* obj = nullptr;
303  m_currentItem = i;
305  if ( iret.isSuccess() ) {
306  iret = m_pDataManager->traverseSubTree(obj, m_agent.get());
307  if ( !iret.isSuccess() ) status = iret;
308  }
309  else {
310  log << MSG::ERROR << "Cannot write mandatory object(s) (Not found) "
311  << m_currentItem->path() << endmsg;
312  status = iret;
313  }
314  }
315 
316  // Traverse the tree and collect the requested objects (tolerate missing items here)
317  for ( auto& i : m_optItemList ) {
318  DataObject* obj = nullptr;
319  m_currentItem = i;
321  if ( iret.isSuccess() ) {
322  iret = m_pDataManager->traverseSubTree(obj, m_agent.get());
323  }
324  if ( !iret.isSuccess() ) {
325  ON_DEBUG
326  log << MSG::DEBUG << "Ignore request to write non-mandatory object(s) "
327  << m_currentItem->path() << endmsg;
328  }
329  }
330 
331  // Collect objects dependent on particular algorithms
332  for ( const auto& iAlgItems : m_algDependentItems )
333  {
334  Algorithm * alg = iAlgItems.first;
335  const Items& items = iAlgItems.second;
336  if ( alg->isExecuted() && alg->filterPassed() )
337  {
338  ON_DEBUG
339  log << MSG::DEBUG << "Algorithm '" << alg->name() << "' fired. Adding " << items << endmsg;
340  for ( const auto& i : items )
341  {
342  DataObject* obj = nullptr;
343  m_currentItem = i;
345  if ( iret.isSuccess() )
346  {
347  iret = m_pDataManager->traverseSubTree(obj,m_agent.get());
348  if ( !iret.isSuccess() ) status = iret;
349  }
350  else
351  {
352  log << MSG::ERROR << "Cannot write mandatory (algorithm dependent) object(s) (Not found) "
353  << m_currentItem->path() << endmsg;
354  status = iret;
355  }
356  }
357  }
358  }
359 
360  if (status.isSuccess())
361  {
362  // Remove duplicates from the list of objects, preserving the order in the list
363  std::set<DataObject*> unique;
364  std::vector<DataObject*> tmp; // temporary vector with the reduced list
365  tmp.reserve(m_objects.size());
366  for (auto& o : m_objects ) {
367  if (!unique.count(o)) {
368  // if the pointer is not in the set, add it to both the set and the temporary vector
369  unique.insert(o);
370  tmp.push_back(o);
371  }
372  }
373  m_objects.swap(tmp); // swap the data of the two vectors
374  }
375 
376  return status;
377 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
IDataSelector m_objects
Collection of objects being selected.
Definition: OutputStream.h:78
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
DataStoreItem * m_currentItem
Keep track of the current item.
Definition: OutputStream.h:63
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
bool filterPassed() const override
Did this algorithm pass or fail its filter criterion for the last event?
Definition: Algorithm.cpp:948
SmartIF< IDataProviderSvc > m_pDataProvider
Keep reference to the data provider service.
Definition: OutputStream.h:57
std::unique_ptr< OutputStreamAgent > m_agent
Keep reference of agent.
Definition: OutputStream.h:55
const std::string & path() const
Accessor: Retrieve load path.
Definition: DataStoreItem.h:65
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
AlgDependentItems m_algDependentItems
Items to be saved for specific algorithms.
Definition: OutputStream.h:76
std::vector< DataStoreItem * > Items
Definition: OutputStream.h:31
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool isExecuted() const override
Has this algorithm been executed since the last reset?
Definition: Algorithm.cpp:931
Items m_itemList
Vector of items to be saved to this stream.
Definition: OutputStream.h:67
SmartIF< IDataManagerSvc > m_pDataManager
Keep reference to the data manager service.
Definition: OutputStream.h:59
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:77
#define ON_DEBUG
virtual StatusCode traverseSubTree(const std::string &sub_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name...
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
list i
Definition: ana.py:128
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
Items m_optItemList
Vector of optional items to be saved to this stream.
Definition: OutputStream.h:71
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
StatusCode OutputStream::connectConversionSvc ( )
virtual

Definition at line 429 of file OutputStream.cpp.

429  {
430  StatusCode status = StatusCode(StatusCode::FAILURE, true);
431  MsgStream log(msgSvc(), name());
432  // Get output file from input
433  std::string dbType, svc, shr;
434  for(auto attrib: Gaudi::Utils::AttribStringParser(m_output)) {
435  const std::string& tag = attrib.tag;
436  const std::string& val = attrib.value;
437  switch( ::toupper(tag[0]) ) {
438  case 'D':
439  m_outputName = val;
440  break;
441  case 'T':
442  dbType = val;
443  break;
444  case 'S':
445  switch( ::toupper(tag[1]) ) {
446  case 'V': svc = val; break;
447  case 'H': shr = "YES"; break;
448  }
449  break;
450  case 'O': // OPT='<NEW<CREATE,WRITE,RECREATE>, UPDATE>'
451  switch( ::toupper(val[0]) ) {
452  case 'R':
453  if ( ::strncasecmp(val.c_str(),"RECREATE",3)==0 )
454  m_outputType = "RECREATE";
455  else if ( ::strncasecmp(val.c_str(),"READ",3)==0 )
456  m_outputType = "READ";
457  break;
458  case 'C':
459  case 'N':
460  case 'W':
461  m_outputType = "NEW";
462  break;
463  case 'U':
464  m_outputType = "UPDATE";
465  break;
466  default:
467  m_outputType = "???";
468  break;
469  }
470  break;
471  default:
472  break;
473  }
474  }
475  if ( !shr.empty() ) m_outputType += "|SHARED";
476  // Get access to the default Persistency service
477  // The default service is the same for input as for output.
478  // If this is not desired, then a specialized OutputStream must overwrite
479  // this value.
480  if ( !dbType.empty() || !svc.empty() ) {
481  std::string typ = !dbType.empty() ? dbType : svc;
483  if( !ipers ) {
484  log << MSG::FATAL << "Unable to locate IPersistencySvc interface of " << m_persName << endmsg;
485  return StatusCode::FAILURE;
486  }
487  IConversionSvc *cnvSvc = nullptr;
488  status = ipers->getService(typ, cnvSvc);
489  if( !status.isSuccess() ) {
490  log << MSG::FATAL << "Unable to locate IConversionSvc interface of database type " << typ << endmsg;
491  return status;
492  }
493  // Increase reference count and keep service.
494  m_pConversionSvc = cnvSvc;
495  }
496  else
497  {
498  log << MSG::FATAL
499  << "Unable to locate IConversionSvc interface (Unknown technology) " << endmsg
500  << "You either have to specify a technology name or a service name!" << endmsg
501  << "Please correct the job option \"" << name() << ".Output\" !" << endmsg;
502  return StatusCode::FAILURE;
503  }
504  return StatusCode::SUCCESS;
505 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Algorithm.cpp:1045
std::string m_outputType
Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE)
Definition: OutputStream.h:53
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::string m_outputName
Name of the output file.
Definition: OutputStream.h:51
std::string m_persName
Name of the persistency service capable to write data from the store.
Definition: OutputStream.h:47
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
SmartIF< IConversionSvc > m_pConversionSvc
Keep reference to the data conversion service.
Definition: OutputStream.h:61
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Data persistency service interface.
std::string m_output
Name of the output file specification.
Definition: OutputStream.h:49
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
void toupper(std::string &s)
StatusCode OutputStream::decodeAcceptAlgs ( )
protected

Decode list of Algorithms that this stream accepts.

Definition at line 507 of file OutputStream.cpp.

507  {
508  MsgStream log(msgSvc(), name());
509  ON_DEBUG
510  log << MSG::DEBUG << "AcceptAlgs : " << m_acceptNames.value() << endmsg;
512 }
StringArrayProperty m_acceptNames
Vector of names of Algorithms that this stream accepts.
Definition: OutputStream.h:82
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::vector< Algorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
Definition: OutputStream.h:88
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
const TYPE & value() const
explicit conversion
Definition: Property.h:341
StatusCode decodeAlgorithms(StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs)
Decode specified list of Algorithms.
#define ON_DEBUG
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
Algorithm * OutputStream::decodeAlgorithm ( const std::string &  theName)
protected

Decode a single algorithm name.

Definition at line 552 of file OutputStream.cpp.

553 {
554  Algorithm * theAlgorithm = nullptr;
555 
556  auto theAlgMgr = serviceLocator()->as<IAlgManager>();
557  if ( theAlgMgr )
558  {
559  // Check whether the supplied name corresponds to an existing
560  // Algorithm object.
561  SmartIF<IAlgorithm> &theIAlg = theAlgMgr->algorithm(theName);
562  if ( theIAlg )
563  {
564  try
565  {
566  theAlgorithm = dynamic_cast<Algorithm*>(theIAlg.get());
567  }
568  catch(...)
569  {
570  // do nothing
571  }
572  }
573  }
574  else
575  {
576  MsgStream log( msgSvc( ), name( ) );
577  log << MSG::FATAL << "Can't locate ApplicationMgr!!!" << endmsg;
578  }
579 
580  if ( !theAlgorithm )
581  {
582  MsgStream log( msgSvc( ), name( ) );
583  log << MSG::WARNING
584  << "Failed to decode Algorithm name " << theName << endmsg;
585  }
586 
587  return theAlgorithm;
588 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Algorithm.cpp:1045
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:77
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode OutputStream::decodeAlgorithms ( StringArrayProperty theNames,
std::vector< Algorithm * > &  theAlgs 
)
protected

Decode specified list of Algorithms.

Definition at line 590 of file OutputStream.cpp.

592 {
593  // Reset the list of Algorithms
594  theAlgs.clear( );
595 
597 
598  // Build the list of Algorithms from the names list
599  for ( const auto& it : theNames.value() )
600  {
601 
602  Algorithm * theAlgorithm = decodeAlgorithm( it );
603  if ( theAlgorithm )
604  {
605  // Check that the specified algorithm doesn't already exist in the list
606  if ( std::find( std::begin(theAlgs), std::end(theAlgs), theAlgorithm ) == std::end(theAlgs) ) {
607  theAlgorithm->addRef();
608  theAlgs.push_back( theAlgorithm );
609  }
610  }
611  else
612  {
613  MsgStream log( msgSvc( ), name( ) );
614  log << MSG::INFO << it << " doesn't exist - ignored" << endmsg;
615  }
616 
617  }
618  result = StatusCode::SUCCESS;
619 
620  return result;
621 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:44
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
const TYPE & value() const
explicit conversion
Definition: Property.h:341
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:77
Algorithm * decodeAlgorithm(const std::string &theName)
Decode a single algorithm name.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode OutputStream::decodeRequireAlgs ( )
protected

Decode list of Algorithms that this stream requires.

Definition at line 522 of file OutputStream.cpp.

522  {
523  MsgStream log(msgSvc(), name());
524  ON_DEBUG
525  log << MSG::DEBUG << "RequireAlgs : " << m_requireNames.value() << endmsg;
527 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::vector< Algorithm * > m_requireAlgs
Vector of Algorithms that this stream requires.
Definition: OutputStream.h:90
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
const TYPE & value() const
explicit conversion
Definition: Property.h:341
StatusCode decodeAlgorithms(StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs)
Decode specified list of Algorithms.
StringArrayProperty m_requireNames
Vector of names of Algorithms that this stream requires.
Definition: OutputStream.h:84
#define ON_DEBUG
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode OutputStream::decodeVetoAlgs ( )
protected

Decode list of Algorithms that this stream is vetoed by.

Definition at line 537 of file OutputStream.cpp.

537  {
538  MsgStream log(msgSvc(), name());
539  ON_DEBUG
540  log << MSG::DEBUG << "VetoAlgs : " << m_vetoNames.value() << endmsg;
542 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StringArrayProperty m_vetoNames
Vector of names of Algorithms that this stream is vetoed by.
Definition: OutputStream.h:86
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
const TYPE & value() const
explicit conversion
Definition: Property.h:341
StatusCode decodeAlgorithms(StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs)
Decode specified list of Algorithms.
#define ON_DEBUG
std::vector< Algorithm * > m_vetoAlgs
Vector of Algorithms that this stream is vetoed by.
Definition: OutputStream.h:92
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode OutputStream::execute ( )
override

Working entry point.

Definition at line 175 of file OutputStream.cpp.

176 {
177  // Clear any previously existing item list
178  clearSelection();
179  // Test whether this event should be output
180  if ( isEventAccepted() )
181  {
182  const StatusCode sc = writeObjects();
183  clearSelection();
184  ++m_events;
185  if ( sc.isSuccess() && m_fireIncidents )
186  {
188  IncidentType::WroteToOutputFile));
189  }
190  else if ( m_fireIncidents )
191  {
193  IncidentType::FailOutputFile));
194  }
195  return sc;
196  }
197  return StatusCode::SUCCESS;
198 }
bool isEventAccepted() const
Test whether this event should be output.
int m_events
Number of events written to this output stream.
Definition: OutputStream.h:80
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::string m_outputName
Name of the output file.
Definition: OutputStream.h:51
virtual StatusCode writeObjects()
Select the different objects and write them to file.
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
void clearSelection()
Clear list of selected objects.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: OutputStream.h:37
Base class for all Incidents (computing events).
Definition: Incident.h:16
bool m_fireIncidents
should I fire incidents for writing opening/closing etc?
Definition: OutputStream.h:125
StatusCode OutputStream::finalize ( )
override

Terminate OutputStream.

Definition at line 160 of file OutputStream.cpp.

160  {
161  MsgStream log(msgSvc(), name());
162  log << MSG::INFO << "Events output: " << m_events << endmsg;
164  IncidentType::EndOutputFile));
171  return StatusCode::SUCCESS;
172 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
void clearItems(Items &itms)
Clear item list.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
int m_events
Number of events written to this output stream.
Definition: OutputStream.h:80
std::string m_outputName
Name of the output file.
Definition: OutputStream.h:51
SmartIF< IDataProviderSvc > m_pDataProvider
Keep reference to the data provider service.
Definition: OutputStream.h:57
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
SmartIF< IConversionSvc > m_pConversionSvc
Keep reference to the data conversion service.
Definition: OutputStream.h:61
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
Items m_itemList
Vector of items to be saved to this stream.
Definition: OutputStream.h:67
SmartIF< IDataManagerSvc > m_pDataManager
Keep reference to the data manager service.
Definition: OutputStream.h:59
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: OutputStream.h:37
Base class for all Incidents (computing events).
Definition: Incident.h:16
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
bool m_fireIncidents
should I fire incidents for writing opening/closing etc?
Definition: OutputStream.h:125
Items m_optItemList
Vector of optional items to be saved to this stream.
Definition: OutputStream.h:71
DataStoreItem * OutputStream::findItem ( const std::string &  path)
protected

Find single item identified by its path (exact match)

Definition at line 392 of file OutputStream.cpp.

392  {
393  auto matchPath = [&](const DataStoreItem* i) { return i->path() == path; } ;
394  auto i = std::find_if( m_itemList.begin(), m_itemList.end(), matchPath );
395  if (i == m_itemList.end()) {
396  i = std::find_if( m_optItemList.begin(), m_optItemList.end(), matchPath );
397  if (i == m_optItemList.end()) return nullptr;
398  }
399  return *i;
400 }
list path
Definition: __init__.py:15
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
Items m_itemList
Vector of items to be saved to this stream.
Definition: OutputStream.h:67
list i
Definition: ana.py:128
Items m_optItemList
Vector of optional items to be saved to this stream.
Definition: OutputStream.h:71
bool OutputStream::hasInput ( ) const
protectedvirtual

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

Reimplemented in InputCopyStream.

Definition at line 652 of file OutputStream.cpp.

652  {
653  return !(m_itemNames.empty() && m_optItemNames.empty() &&
654  m_algDependentItemList.empty());
655 }
AlgDependentItemNames m_algDependentItemList
Mapping between algorithm names, and a list of items for which, if the algorithm in question accepted...
Definition: OutputStream.h:74
ItemNames m_itemNames
Vector of item names.
Definition: OutputStream.h:65
ItemNames m_optItemNames
Vector of item names.
Definition: OutputStream.h:69
StatusCode OutputStream::initialize ( )
override

Initialize OutputStream.

Definition at line 70 of file OutputStream.cpp.

70  {
71  MsgStream log(msgSvc(), name());
72 
73  // Reset the number of events written
74  m_events = 0;
75  // Get access to the DataManagerSvc
77  if( !m_pDataManager ) {
78  log << MSG::FATAL << "Unable to locate IDataManagerSvc interface" << endmsg;
79  return StatusCode::FAILURE;
80  }
81  // Get access to the IncidentService
82  m_incidentSvc = serviceLocator()->service("IncidentSvc");
83  if( !m_incidentSvc ) {
84  log << MSG::WARNING << "Error retrieving IncidentSvc." << endmsg;
85  return StatusCode::FAILURE;
86  }
87  // Get access to the assigned data service
89  if( !m_pDataProvider ) {
90  log << MSG::FATAL << "Unable to locate IDataProviderSvc interface of " << m_storeName << endmsg;
91  return StatusCode::FAILURE;
92  }
93  if ( hasInput() ) {
95  if( !status.isSuccess() ) {
96  log << MSG::FATAL << "Unable to connect to conversion service." << endmsg;
98  IncidentType::FailOutputFile));
99  return status;
100  }
101  }
102 
103  // Clear the list with optional items
105  // Clear the item list
107 
108  // Take the new item list from the properties.
109  ON_DEBUG log << MSG::DEBUG << "ItemList : " << m_itemNames << endmsg;
110  for( const auto& i : m_itemNames ) addItem( m_itemList, i );
111 
112  // Take the new item list from the properties.
113  ON_DEBUG log << MSG::DEBUG << "OptItemList : " << m_optItemNames << endmsg;
114  for( const auto& i : m_optItemNames ) addItem( m_optItemList, i );
115 
116  // prepare the algorithm selected dependent locations
117  ON_DEBUG log << MSG::DEBUG << "AlgDependentItemList : " << m_algDependentItemList << endmsg;
118  for ( const auto& a : m_algDependentItemList )
119  {
120  // Get the algorithm pointer
121  Algorithm * theAlgorithm = decodeAlgorithm( a.first );
122  if ( theAlgorithm )
123  {
124  // Get the item list for this alg
125  auto& items = m_algDependentItems[theAlgorithm];
126  // Clear the list for this alg
127  clearItems( items );
128  // fill the list again
129  for ( const auto& i : a.second ) addItem( items, i );
130  }
131  }
132 
133  // Take the item list to the data service preload list.
134  if ( m_doPreLoad ) {
135  for(auto& j : m_itemList) m_pDataProvider->addPreLoadItem( *j ).ignore();
136  // Not working: bad reference counting! pdataSvc->release();
137  }
138 
139  if ( m_doPreLoadOpt ) {
140  for(auto& j : m_optItemList) m_pDataProvider->addPreLoadItem( *j ).ignore();
141  }
142  log << MSG::INFO << "Data source: " << m_storeName << " output: " << m_output << endmsg;
143 
144  // Decode the accept, required and veto Algorithms. The logic is the following:
145  // a. The event is accepted if all lists are empty.
146  // b. The event is provisionally accepted if any Algorithm in the accept list
147  // has been executed and has indicated that its filter is passed. This
148  // provisional acceptance can be overridden by the other lists.
149  // c. The event is rejected unless all Algorithms in the required list have
150  // been executed and have indicated that their filter passed.
151  // d. The event is rejected if any Algorithm in the veto list has been
152  // executed and has indicated that its filter has passed.
155  decodeVetoAlgs ().ignore();
156  return StatusCode::SUCCESS;
157 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
void clearItems(Items &itms)
Clear item list.
virtual bool hasInput() const
Tell if the instance has been configured with input items or not.
StatusCode decodeRequireAlgs()
Decode list of Algorithms that this stream requires.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::string m_storeName
Name of the service managing the data store.
Definition: OutputStream.h:45
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Algorithm.cpp:1045
int m_events
Number of events written to this output stream.
Definition: OutputStream.h:80
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::string m_outputName
Name of the output file.
Definition: OutputStream.h:51
SmartIF< IDataProviderSvc > m_pDataProvider
Keep reference to the data provider service.
Definition: OutputStream.h:57
AlgDependentItemNames m_algDependentItemList
Mapping between algorithm names, and a list of items for which, if the algorithm in question accepted...
Definition: OutputStream.h:74
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
virtual StatusCode connectConversionSvc()
AlgDependentItems m_algDependentItems
Items to be saved for specific algorithms.
Definition: OutputStream.h:76
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Items m_itemList
Vector of items to be saved to this stream.
Definition: OutputStream.h:67
bool m_doPreLoad
Flag indicating whether data pre-loading should be performed.
Definition: OutputStream.h:39
void addItem(Items &itms, const std::string &descriptor)
Add item to output streamer list.
bool m_doPreLoadOpt
Flag indicating whether optional items should be preloaded.
Definition: OutputStream.h:41
SmartIF< IDataManagerSvc > m_pDataManager
Keep reference to the data manager service.
Definition: OutputStream.h:59
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: OutputStream.h:37
StatusCode decodeVetoAlgs()
Decode list of Algorithms that this stream is vetoed by.
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:77
ItemNames m_itemNames
Vector of item names.
Definition: OutputStream.h:65
ItemNames m_optItemNames
Vector of item names.
Definition: OutputStream.h:69
Base class for all Incidents (computing events).
Definition: Incident.h:16
#define ON_DEBUG
Algorithm * decodeAlgorithm(const std::string &theName)
Decode a single algorithm name.
void ignore() const
Definition: StatusCode.h:108
std::string m_output
Name of the output file specification.
Definition: OutputStream.h:49
list i
Definition: ana.py:128
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode decodeAcceptAlgs()
Decode list of Algorithms that this stream accepts.
bool m_fireIncidents
should I fire incidents for writing opening/closing etc?
Definition: OutputStream.h:125
Items m_optItemList
Vector of optional items to be saved to this stream.
Definition: OutputStream.h:71
bool OutputStream::isEventAccepted ( ) const
protected

Test whether this event should be output.

Definition at line 623 of file OutputStream.cpp.

623  {
624  auto passed = [](const Algorithm* alg) { return alg->isExecuted()
625  && alg->filterPassed(); };
626 
627  // Loop over all Algorithms in the accept list to see
628  // whether any have been executed and have their filter
629  // passed flag set. Any match causes the event to be
630  // provisionally accepted.
631  bool result = m_acceptAlgs.empty() ||
632  std::any_of( std::begin(m_acceptAlgs), std::end(m_acceptAlgs), passed);
633 
634  // Loop over all Algorithms in the required list to see
635  // whether all have been executed and have their filter
636  // passed flag set. Any mismatch causes the event to be
637  // rejected.
638  if ( result && !m_requireAlgs.empty() ) {
639  result = std::all_of( std::begin(m_requireAlgs), std::end(m_requireAlgs), passed);
640  }
641 
642  // Loop over all Algorithms in the veto list to see
643  // whether any have been executed and have their filter
644  // passed flag set. Any match causes the event to be
645  // rejected.
646  if ( result && !m_vetoAlgs.empty() ) {
647  result = std::none_of( std::begin(m_vetoAlgs), std::end(m_vetoAlgs), passed);
648  }
649  return result;
650 }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
std::vector< Algorithm * > m_requireAlgs
Vector of Algorithms that this stream requires.
Definition: OutputStream.h:90
std::vector< Algorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
Definition: OutputStream.h:88
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:77
std::vector< Algorithm * > m_vetoAlgs
Vector of Algorithms that this stream is vetoed by.
Definition: OutputStream.h:92
void OutputStream::requireAlgsHandler ( Property theProp)
protected

Handler for RequireAlgs Property.

Definition at line 529 of file OutputStream.cpp.

529  {
531  if (sc.isFailure()) {
532  throw GaudiException("Failure in OutputStream::decodeAlgorithms",
533  "OutputStream::requireAlgsHandler",sc);
534  }
535 }
Define general base for Gaudi exception.
std::vector< Algorithm * > m_requireAlgs
Vector of Algorithms that this stream requires.
Definition: OutputStream.h:90
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode decodeAlgorithms(StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs)
Decode specified list of Algorithms.
StringArrayProperty m_requireNames
Vector of names of Algorithms that this stream requires.
Definition: OutputStream.h:84
IDataSelector* OutputStream::selectedObjects ( )
inlineprivate

Return the list of selected objects.

Definition at line 152 of file OutputStream.h.

152 { return &m_objects; }
IDataSelector m_objects
Collection of objects being selected.
Definition: OutputStream.h:78
void OutputStream::vetoAlgsHandler ( Property theProp)
protected

Handler for VetoAlgs Property.

Definition at line 544 of file OutputStream.cpp.

544  {
546  if (sc.isFailure()) {
547  throw GaudiException("Failure in OutputStream::decodeAlgorithms",
548  "OutputStream::vetoAlgsHandler",sc);
549  }
550 }
Define general base for Gaudi exception.
StringArrayProperty m_vetoNames
Vector of names of Algorithms that this stream is vetoed by.
Definition: OutputStream.h:86
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode decodeAlgorithms(StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs)
Decode specified list of Algorithms.
std::vector< Algorithm * > m_vetoAlgs
Vector of Algorithms that this stream is vetoed by.
Definition: OutputStream.h:92
StatusCode OutputStream::writeObjects ( )
protectedvirtual

Select the different objects and write them to file.

Reimplemented in TagCollectionStream, and SequentialOutputStream.

Definition at line 201 of file OutputStream.cpp.

202 {
203  // Connect the output file to the service
204  StatusCode status = collectObjects();
205  if ( status.isSuccess() )
206  {
208  if ( sel->begin() != sel->end() )
209  {
211  if ( status.isSuccess() )
212  {
213  // Now pass the collection to the persistency service
214  IOpaqueAddress* pAddress = nullptr;
215  for ( auto& j : *sel )
216  {
217  try
218  {
219  const StatusCode iret = m_pConversionSvc->createRep( j, pAddress );
220  if ( !iret.isSuccess() )
221  {
222  status = iret;
223  continue;
224  }
225  IRegistry* pReg = j->registry();
226  pReg->setAddress(pAddress);
227  }
228  catch ( const std::exception & excpt )
229  {
230  MsgStream log( msgSvc(), name() );
231  const std::string loc = ( j->registry() ?
232  j->registry()->identifier() : "UnRegistered" );
233  log << MSG::FATAL
234  << "std::exception during createRep for '" << loc << "' "
235  << System::typeinfoName( typeid(*j) )
236  << endmsg;
237  log << MSG::FATAL << excpt.what() << endmsg;
238  throw;
239  }
240  }
241  for ( auto& j : *sel )
242  {
243  try
244  {
245  IRegistry* pReg = j->registry();
246  const StatusCode iret = m_pConversionSvc->fillRepRefs( pReg->address(), j );
247  if ( !iret.isSuccess() ) status = iret;
248  }
249  catch ( const std::exception & excpt )
250  {
251  MsgStream log( msgSvc(), name() );
252  const std::string loc = ( j->registry() ?
253  j->registry()->identifier() : "UnRegistered" );
254  log << MSG::FATAL
255  << "std::exception during fillRepRefs for '" << loc << "'"
256  << System::typeinfoName( typeid(*j) )
257  << endmsg;
258  log << MSG::FATAL << excpt.what() << endmsg;
259  throw;
260  }
261  }
262  // Commit the data if there was no error; otherwise possibly discard
263  if ( status.isSuccess() )
264  {
265  status = m_pConversionSvc->commitOutput(m_outputName, true);
266  }
267  else
268  {
270  }
271  }
272  }
273  }
274  return status;
275 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::string m_outputType
Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE)
Definition: OutputStream.h:53
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
std::string m_outputName
Name of the output file.
Definition: OutputStream.h:51
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
IDataSelector * selectedObjects()
Return the list of selected objects.
Definition: OutputStream.h:152
std::vector< DataObject * > IDataSelector
This is only a placeholder to allow me compiling until the responsible guy does his work! M...
Definition: IDataSelector.h:8
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
SmartIF< IConversionSvc > m_pConversionSvc
Keep reference to the data conversion service.
Definition: OutputStream.h:61
virtual StatusCode connectOutput(const std::string &outputFile)=0
Connect the output file to the service.
virtual StatusCode commitOutput(const std::string &outputFile, bool do_commit)=0
Commit pending output.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual void setAddress(IOpaqueAddress *pAddress)=0
Set/Update Opaque storage address.
Opaque address interface definition.
void ignore() const
Definition: StatusCode.h:108
virtual StatusCode collectObjects()
Collect all objects to be written to the output stream.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001

Member Data Documentation

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

Vector of Algorithms that this stream accepts.

Definition at line 88 of file OutputStream.h.

StringArrayProperty OutputStream::m_acceptNames
protected

Vector of names of Algorithms that this stream accepts.

Definition at line 82 of file OutputStream.h.

std::unique_ptr<OutputStreamAgent> OutputStream::m_agent
protected

Keep reference of agent.

Definition at line 55 of file OutputStream.h.

AlgDependentItemNames OutputStream::m_algDependentItemList
protected

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 74 of file OutputStream.h.

AlgDependentItems OutputStream::m_algDependentItems
protected

Items to be saved for specific algorithms.

Definition at line 76 of file OutputStream.h.

DataStoreItem* OutputStream::m_currentItem
protected

Keep track of the current item.

Definition at line 63 of file OutputStream.h.

bool OutputStream::m_doPreLoad
protected

Flag indicating whether data pre-loading should be performed.

Definition at line 39 of file OutputStream.h.

bool OutputStream::m_doPreLoadOpt
protected

Flag indicating whether optional items should be preloaded.

Definition at line 41 of file OutputStream.h.

int OutputStream::m_events
protected

Number of events written to this output stream.

Definition at line 80 of file OutputStream.h.

bool OutputStream::m_fireIncidents
protected

should I fire incidents for writing opening/closing etc?

Definition at line 125 of file OutputStream.h.

SmartIF<IIncidentSvc> OutputStream::m_incidentSvc
protected

Reference to the incident service.

Definition at line 37 of file OutputStream.h.

Items OutputStream::m_itemList
protected

Vector of items to be saved to this stream.

Definition at line 67 of file OutputStream.h.

ItemNames OutputStream::m_itemNames
protected

Vector of item names.

Definition at line 65 of file OutputStream.h.

IDataSelector OutputStream::m_objects
protected

Collection of objects being selected.

Definition at line 78 of file OutputStream.h.

Items OutputStream::m_optItemList
protected

Vector of optional items to be saved to this stream.

Definition at line 71 of file OutputStream.h.

ItemNames OutputStream::m_optItemNames
protected

Vector of item names.

Definition at line 69 of file OutputStream.h.

std::string OutputStream::m_output
protected

Name of the output file specification.

Definition at line 49 of file OutputStream.h.

std::string OutputStream::m_outputName
protected

Name of the output file.

Definition at line 51 of file OutputStream.h.

std::string OutputStream::m_outputType
protected

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

Definition at line 53 of file OutputStream.h.

SmartIF<IConversionSvc> OutputStream::m_pConversionSvc
protected

Keep reference to the data conversion service.

Definition at line 61 of file OutputStream.h.

SmartIF<IDataManagerSvc> OutputStream::m_pDataManager
protected

Keep reference to the data manager service.

Definition at line 59 of file OutputStream.h.

SmartIF<IDataProviderSvc> OutputStream::m_pDataProvider
protected

Keep reference to the data provider service.

Definition at line 57 of file OutputStream.h.

std::string OutputStream::m_persName
protected

Name of the persistency service capable to write data from the store.

Definition at line 47 of file OutputStream.h.

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

Vector of Algorithms that this stream requires.

Definition at line 90 of file OutputStream.h.

StringArrayProperty OutputStream::m_requireNames
protected

Vector of names of Algorithms that this stream requires.

Definition at line 84 of file OutputStream.h.

std::string OutputStream::m_storeName
protected

Name of the service managing the data store.

Definition at line 45 of file OutputStream.h.

bool OutputStream::m_verifyItems
protected

Flag to indicate that item consistency should be checked.

Definition at line 43 of file OutputStream.h.

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

Vector of Algorithms that this stream is vetoed by.

Definition at line 92 of file OutputStream.h.

StringArrayProperty OutputStream::m_vetoNames
protected

Vector of names of Algorithms that this stream is vetoed by.

Definition at line 86 of file OutputStream.h.


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