All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
InputCopyStream Class Reference

Extension of OutputStream to copy the content of the main input file. More...

#include <src/PersistencySvc/InputCopyStream.h>

Inheritance diagram for InputCopyStream:
Collaboration diagram for InputCopyStream:

Public Member Functions

 InputCopyStream (const std::string &name, ISvcLocator *pSvcLocator)
 Standard algorithm Constructor. More...
 
virtual ~InputCopyStream ()
 Standard Destructor. More...
 
virtual StatusCode initialize ()
 Initialize the instance. More...
 
virtual StatusCode finalize ()
 Finalize the instance. More...
 
virtual StatusCode collectObjects ()
 Collect all objects to be written to the output stream. More...
 
- Public Member Functions inherited from OutputStream
 OutputStream (const std::string &name, ISvcLocator *pSvcLocator)
 Standard algorithm Constructor. More...
 
virtual ~OutputStream ()
 Standard Destructor. More...
 
virtual StatusCode execute ()
 Working entry point. More...
 
virtual StatusCode connectConversionSvc ()
 
virtual bool collect (IRegistry *dir, int level)
 Store agent's classback. More...
 
void clearItems (Items &itms)
 Clear item list. More...
 
void addItem (Items &itms, const std::string &descriptor)
 Add item to output streamer list. More...
 
void clearSelection ()
 Clear list of selected objects. More...
 
IDataSelectorselectedObjects ()
 Return the 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...
 
virtual ~Algorithm ()
 Destructor. More...
 
virtual StatusCode sysStart ()
 Reinitialization method invoked by the framework. More...
 
virtual StatusCode sysInitialize ()
 Initialization method invoked by the framework. More...
 
virtual StatusCode sysReinitialize ()
 Reinitialization method invoked by the framework. More...
 
virtual StatusCode sysRestart ()
 Restart method invoked by the framework. More...
 
virtual StatusCode sysExecute ()
 The actions to be performed by the algorithm on an event. More...
 
virtual StatusCode sysStop ()
 System stop. More...
 
virtual StatusCode sysFinalize ()
 System finalization. More...
 
virtual StatusCode sysBeginRun ()
 beginRun method invoked by the framework. More...
 
virtual StatusCode sysEndRun ()
 endRun method invoked by the framework. More...
 
virtual const std::string & name () const
 The identifying name of the algorithm object. More...
 
virtual const std::string & version () const
 The version of the algorithm. More...
 
virtual StatusCode configure ()
 Dummy implementation of IStateful::configure() method. More...
 
virtual StatusCode terminate ()
 Dummy implementation of IStateful::terminate() method. More...
 
virtual StatusCode start ()
 the default (empty) implementation of IStateful::start() method More...
 
virtual StatusCode stop ()
 the default (empty) implementation of IStateful::stop() method More...
 
virtual StatusCode reinitialize ()
 the default (empty) implementation of IStateful::reinitialize() method More...
 
virtual StatusCode restart ()
 the default (empty) implementation of IStateful::restart() method More...
 
virtual bool isExecuted () const
 Has this algorithm been executed since the last reset? More...
 
virtual void setExecuted (bool state)
 Set the executed flag to the specified state. More...
 
virtual void resetExecuted ()
 Reset the executed state of the Algorithm for the duration of the current event. More...
 
virtual StatusCode beginRun ()
 Algorithm begin run. More...
 
virtual StatusCode endRun ()
 Algorithm end run. This method is called at the end of the event loop. More...
 
virtual Gaudi::StateMachine::State FSMState () const
 returns the current state of the algorithm More...
 
virtual Gaudi::StateMachine::State targetFSMState () const
 returns the state the algorithm will be in after the ongoing transition More...
 
virtual bool isEnabled () const
 Is this algorithm enabled or disabled? More...
 
virtual bool filterPassed () const
 Did this algorithm pass or fail its filter criterion for the last event? More...
 
virtual void setFilterPassed (bool state)
 Set the filter passed flag to the specified state. 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...
 
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< ISvcLocator > & serviceLocator () const
 The standard service locator. More...
 
SmartIF< ISvcLocator > & svcLoc () const
 shortcut for method serviceLocator More...
 
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...
 
std::vector< Algorithm * > * subAlgorithms () const
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
virtual StatusCode setProperty (const Property &p)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode setProperty (const std::string &s)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode getProperty (Property *p) const
 Implementation of IProperty::getProperty. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Implementation of IProperty::getProperty. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Implementation of IProperty::getProperty. More...
 
virtual const std::vector
< Property * > & 
getProperties () const
 Implementation of IProperty::getProperties. 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...
 
- Public Member Functions inherited from extend_interfaces3< IAlgorithm, IProperty, IStateful >
virtual ~extend_interfaces3 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IAlgorithm
 DeclareInterfaceID (IAlgorithm, 4, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
- Public Member Functions inherited from IInterface
virtual void * i_cast (const InterfaceID &) const =0
 main cast function More...
 
virtual std::vector< std::string > getInterfaceNames () const =0
 Returns a vector of strings containing the names of all the implemented interfaces. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)=0
 Set the void** to the pointer to the requested interface of the instance. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from IStateful
 DeclareInterfaceID (IStateful, 1, 0)
 InterfaceID. More...
 
virtual ~IStateful ()
 

Protected Member Functions

virtual bool hasInput () const
 Overridden from the base class (InputCopyStream has always input). More...
 
- Protected Member Functions inherited from OutputStream
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...
 
- Protected Member Functions inherited from Algorithm
bool isInitialized () const
 Has the Algorithm already been initialized? More...
 
bool isFinalized () const
 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...
 

Private Attributes

IDataStoreLeavesm_leavesTool
 Pointer to the (public) tool used to retrieve the objects in a file. More...
 
std::vector< std::string > m_tesVetoList
 Names of TES locations to Veto. More...
 

Additional Inherited Members

- Public Types inherited from OutputStream
typedef std::vector
< DataStoreItem * > 
Items
 
typedef std::vector< std::string > ItemNames
 
typedef std::map< Algorithm
*, Items
AlgDependentItems
 
typedef std::map< std::string,
ItemNames
AlgDependentItemNames
 
- Public Types inherited from Algorithm
typedef
Gaudi::PluginService::Factory
< IAlgorithm *, const
std::string &, ISvcLocator * > 
Factory
 
- Public Types inherited from implements3< IAlgorithm, IProperty, IStateful >
typedef implements3 base_class
 Typedef to this class. More...
 
typedef extend_interfaces3
< IAlgorithm, IProperty,
IStateful
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces3< IAlgorithm, IProperty, IStateful >
typedef mpl::fold< typename
IAlgorithm::iid::iids::type,
typename mpl::fold< typename
IProperty::iid::iids::type,
typename
IStateful::iid::iids::type,
mpl::insert< mpl::_1, mpl::_2 >
>::type, mpl::insert< mpl::_1,
mpl::_2 > >::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IInterface
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...
 
typedef Gaudi::InterfaceId
< IInterface, 0, 0 > 
iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
- Protected Attributes inherited from OutputStream
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...
 
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...
 

Detailed Description

Extension of OutputStream to copy the content of the main input file.

On top of the standard behavior of OutputStream, this class takes also all the entries that come from the same file as the root entry in the data service.

Author
: M. Frank
: P. Koppenburg
: M. Clemencic

Definition at line 21 of file InputCopyStream.h.

Constructor & Destructor Documentation

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

Standard algorithm Constructor.

Definition at line 16 of file InputCopyStream.cpp.

17  : OutputStream ( name, pSvcLocator),
18  m_leavesTool ( NULL ),
19  m_tesVetoList ( )
20 {
21  m_doPreLoad = false;
22  m_doPreLoadOpt = false;
23  declareProperty( "TESVetoList", m_tesVetoList );
24 }
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Algorithm.h:397
std::vector< std::string > m_tesVetoList
Names of TES locations to Veto.
IDataStoreLeaves * m_leavesTool
Pointer to the (public) tool used to retrieve the objects in a file.
bool m_doPreLoad
Flag indicating whether data pre-loading should be performed.
Definition: OutputStream.h:37
virtual const std::string & name() const
The identifying name of the algorithm object.
Definition: Algorithm.cpp:837
bool m_doPreLoadOpt
Flag indicating whether optional items should be preloaded.
Definition: OutputStream.h:39
OutputStream(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm Constructor.
InputCopyStream::~InputCopyStream ( )
virtual

Standard Destructor.

Definition at line 27 of file InputCopyStream.cpp.

27 { }

Member Function Documentation

StatusCode InputCopyStream::collectObjects ( )
virtual

Collect all objects to be written to the output stream.

Reimplemented from OutputStream.

Definition at line 50 of file InputCopyStream.cpp.

51 {
52  // Get the objects in the same file as the root node
53  try
54  {
55  // Get all the leaves on the input stream
57 
58  // Do we need to veto anything ?
59  if ( UNLIKELY( !m_tesVetoList.empty() ) )
60  {
61  // Veto out locations
62  IDataStoreLeaves::LeavesList filteredLeaves;
63  filteredLeaves.reserve( leaves.size() );
64  for ( IDataStoreLeaves::LeavesList::const_iterator iL = leaves.begin();
65  iL != leaves.end(); ++iL )
66  {
67  if ( *iL && (*iL)->registry() )
68  {
69  if ( std::find( m_tesVetoList.begin(),
70  m_tesVetoList.end(),
71  (*iL)->registry()->identifier() ) == m_tesVetoList.end() )
72  {
73  filteredLeaves.push_back( (*iL) );
74  }
75  }
76  }
77 
78  // saved the veto'ed list
79  m_objects.assign( filteredLeaves.begin(), filteredLeaves.end() );
80 
81  }
82  else
83  {
84  // no veto'ing, so save everything
85  m_objects.assign( leaves.begin(), leaves.end() );
86  }
87  }
88  catch ( const GaudiException & e )
89  {
90  MsgStream log(msgSvc(), name());
91  log << MSG::ERROR << e.message() << endmsg;
92  return StatusCode::FAILURE;
93  }
94 
95  // Collect the other objects from the transient store (mandatory and optional)
97 }
virtual const std::string & message() const
error message to be printed
#define UNLIKELY(x)
Definition: Kernel.h:127
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Define general base for Gaudi exception.
IDataSelector m_objects
Collection of objects being selected.
Definition: OutputStream.h:76
std::vector< DataObject * > LeavesList
Returned type.
std::vector< std::string > m_tesVetoList
Names of TES locations to Veto.
IDataStoreLeaves * m_leavesTool
Pointer to the (public) tool used to retrieve the objects in a file.
virtual const std::string & name() const
The identifying name of the algorithm object.
Definition: Algorithm.cpp:837
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:896
virtual const LeavesList & leaves() const =0
Return the list of leaves.
virtual StatusCode collectObjects()
Collect all objects to be written to the output stream.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode InputCopyStream::finalize ( )
virtual

Finalize the instance.

Reimplemented from OutputStream.

Definition at line 42 of file InputCopyStream.cpp.

43 {
44  toolSvc()->releaseTool(m_leavesTool).ignore();
45  m_leavesTool = NULL;
46  return OutputStream::finalize();
47 }
SmartIF< IToolSvc > & toolSvc() const
The standard ToolSvc service, Return a pointer to the service if present.
IDataStoreLeaves * m_leavesTool
Pointer to the (public) tool used to retrieve the objects in a file.
virtual StatusCode finalize()
Terminate OutputStream.
virtual bool InputCopyStream::hasInput ( ) const
inlineprotectedvirtual

Overridden from the base class (InputCopyStream has always input).

Reimplemented from OutputStream.

Definition at line 52 of file InputCopyStream.h.

53  {
54  return true;
55  }
StatusCode InputCopyStream::initialize ( )
virtual

Initialize the instance.

Reimplemented from OutputStream.

Definition at line 30 of file InputCopyStream.cpp.

31 {
33  if ( sc.isFailure() ) return sc;
34 
35  sc = toolSvc()->retrieveTool("DataSvcFileEntriesTool", "InputCopyStreamTool",
36  m_leavesTool);
37 
38  return sc;
39 }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:72
SmartIF< IToolSvc > & toolSvc() const
The standard ToolSvc service, Return a pointer to the service if present.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
IDataStoreLeaves * m_leavesTool
Pointer to the (public) tool used to retrieve the objects in a file.
virtual StatusCode initialize()
Initialize OutputStream.

Member Data Documentation

IDataStoreLeaves* InputCopyStream::m_leavesTool
private

Pointer to the (public) tool used to retrieve the objects in a file.

Definition at line 44 of file InputCopyStream.h.

std::vector<std::string> InputCopyStream::m_tesVetoList
private

Names of TES locations to Veto.

Definition at line 47 of file InputCopyStream.h.


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