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

The useful base class for data processing algorithms. More...

#include <GaudiAlg/GaudiAlgorithm.h>

Inheritance diagram for GaudiAlgorithm:
Collaboration diagram for GaudiAlgorithm:

Public Member Functions

virtual StatusCode initialize ()
 standard initialization method More...
 
virtual StatusCode execute ()
 standard execution method More...
 
virtual StatusCode finalize ()
 standard finalization method More...
 
virtual StatusCode sysExecute ()
 the generic actions for the execution. More...
 
void put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const
 Register a data object or container into Gaudi Event Transient Store. More...
 
void put (DataObject *object, const std::string &address, const bool useRootInTES=true) const
 Register a data object or container into Gaudi Event Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >
::return_type 
get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >
::return_type 
getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >
::return_type 
get (const std::string &location, const bool useRootInTES=true) const
 Templated access to the data from Gaudi Event Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >
::return_type 
getIfExists (const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
template<class TYPE >
TYPE * getDet (IDataProviderSvc *svc, const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >
::return_type 
getDetIfExists (IDataProviderSvc *svc, const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
TYPE * getDet (const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >
::return_type 
getDetIfExists (const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
bool exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Check the existence of a data object or container in the Gaudi Transient Event Store. More...
 
template<class TYPE >
bool exist (const std::string &location, const bool useRootInTES=true) const
 Check the existence of a data object or container in the Gaudi Transient Event Store. More...
 
template<class TYPE >
bool existDet (IDataProviderSvc *svc, const std::string &location) const
 Check the existence of detector objects in the Gaudi Transient Detector Store. More...
 
template<class TYPE >
bool existDet (const std::string &location) const
 Check the existence of detector objects in the Gaudi Transient Detector Store. More...
 
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >
::return_type 
getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Get the existing data object from Gaudi Event Transient store. More...
 
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >
::return_type 
getOrCreate (const std::string &location, const bool useRootInTES=true) const
 Get the existing data object from Gaudi Event Transient store. More...
 
 GaudiAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Standard constructor (protected) More...
 
virtual ~GaudiAlgorithm ()
 destructor, virtual and protected More...
 
SmartIF< INTupleSvc > & evtColSvc () const
 Access the standard event collection service. More...
 
- Public Member Functions inherited from GaudiCommon< Algorithm >
Gaudi::Utils::GetData< TYPE >
::return_type 
get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
Gaudi::Utils::GetData< TYPE >
::return_type 
getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Quicker version of the get function which bypasses the check on the retrieved data. More...
 
bool exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Check the existence of a data object or container in the Gaudi Transient Event Store. More...
 
Gaudi::Utils::GetData< TYPE >
::return_type 
getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Get the existing data object from Gaudi Event Transient store. More...
 
DataObjectput (IDataProviderSvc *svc, DataObject *object, const std::string &location, const bool useRootInTES=true) const
 Register a data object or container into Gaudi Event Transient Store. More...
 
TOOL * tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const
 Useful method for the easy location of tools. More...
 
TOOL * tool (const std::string &type, const IInterface *parent=0, bool create=true) const
 A useful method for the easy location of tools. More...
 
SmartIF< SERVICE > svc (const std::string &name, const bool create=true) const
 A useful method for the easy location of services. More...
 
IUpdateManagerSvcupdMgrSvc () const
 Short-cut to locate the Update Manager Service. More...
 
StatusCode Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
 Print the error message and return with the given StatusCode. More...
 
StatusCode Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
 Print the warning message and return with the given StatusCode. More...
 
StatusCode Info (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const size_t mx=10) const
 Print the info message and return with the given StatusCode. More...
 
StatusCode Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const
 Print the message and return with the given StatusCode. More...
 
void Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Assertion - throw exception if the given condition is not fulfilled. More...
 
void Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Assertion - throw exception if the given condition is not fulfilled. More...
 
void Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Create and (re)-throw a given GaudiException. More...
 
void Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Create and (re)-throw a given exception. More...
 
void Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Create and throw an exception with the given message. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream ( MSG::ALWAYS ) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream ( MSG::FATAL ) More...
 
MsgStreamerr () const
 shortcut for the method msgStream ( MSG::ERROR ) More...
 
MsgStreamerror () const
 shortcut for the method msgStream ( MSG::ERROR ) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream ( MSG::WARNING ) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream ( MSG::INFO ) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream ( MSG::DEBUG ) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream ( MSG::VERBOSE ) More...
 
MsgStreammsg () const
 shortcut for the method msgStream ( MSG::INFO ) More...
 
const Statisticscounters () const
 accessor to all counters More...
 
StatEntitycounter (const std::string &tag) const
 accessor to certain counter by name More...
 
MSG::Level msgLevel () const
 The current message service output level. More...
 
bool msgLevel (const MSG::Level level) const
 Test the output level. More...
 
void resetMsgStream () const
 Reset (delete) the current message stream object. More...
 
bool typePrint () const
 Insert the actual C++ type of the algorithm/tool in the messages ? More...
 
bool propsPrint () const
 Print properties at initialization ? More...
 
bool statPrint () const
 Print statistical counters at finalization ? More...
 
bool errorsPrint () const
 Print error counters at finalization ? More...
 
long printStat (const MSG::Level level=MSG::ALWAYS) const
 perform the actual printout of statistical counters More...
 
long printErrors (const MSG::Level level=MSG::ALWAYS) const
 perform the actual printout of error counters More...
 
long printProps (const MSG::Level level=MSG::ALWAYS) const
 perform the actual printout of properties More...
 
void registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=NULL)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
void registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
void registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL)
 just to avoid conflicts with the version using a pointer to a template class. More...
 
void registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
StatusCode runUpdate ()
 asks the UpdateManagerSvc to perform an update of the instance (if needed) without waiting the next BeginEvent incident. More...
 
 GaudiCommon (const std::string &name, ISvcLocator *pSvcLocator)
 Algorithm constructor. More...
 
 GaudiCommon (const std::string &type, const std::string &name, const IInterface *parent)
 Tool constructor. More...
 
StatusCode release (const IInterface *interface) const
 Manual forced (and 'safe') release of the active tool or service. More...
 
virtual unsigned long release ()
 Un-hide IInterface::release (ICC warning #1125) More...
 
const AlgToolstools () const
 get the list of aquired tools More...
 
const Servicesservices () const
 get the list of aquired services More...
 
const std::string & context () const
 Returns the "context" string. Used to identify different processing states. More...
 
const std::string & rootInTES () const
 Returns the "rootInTES" string. More...
 
double globalTimeOffset () const
 Returns the "globalTimeOffset" double. More...
 
const std::string fullTESLocation (const std::string &location, const bool useRootInTES) const
 Returns the full correct event location given the rootInTes settings. 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 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 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 ()
 

Private Member Functions

 GaudiAlgorithm ()
 no public default constructor More...
 
 GaudiAlgorithm (const GaudiAlgorithm &)
 no public copy More...
 
GaudiAlgorithmoperator= (const GaudiAlgorithm &)
 no public assignment More...
 

Private Attributes

SmartIF< INTupleSvcm_evtColSvc
 Event Tag Collection Service. More...
 
std::vector< std::string > m_vetoObjs
 skip the event if any of these objects are present in TES More...
 
std::vector< std::string > m_requireObjs
 process the event only if one or more of these objects are present in TES More...
 

Additional Inherited Members

- 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 Types inherited from GaudiCommon< Algorithm >
typedef std::map< std::string,
StatEntity
Statistics
 the actual type of general counters More...
 
typedef std::map< std::string,
unsigned int > 
Counter
 the actual type error/warning counter More...
 
typedef std::vector< IAlgTool * > AlgTools
 storage for active tools More...
 
typedef GaudiUtils::HashMap
< std::string, SmartIF
< IService > > 
Services
 storage for active services More...
 
- Protected Member Functions inherited from GaudiCommon< Algorithm >
virtual ~GaudiCommon ()
 Destructor. More...
 
StatusCode releaseTool (const IAlgTool *tool) const
 manual forced (and 'safe') release of the tool More...
 
StatusCode releaseSvc (const IInterface *svc) const
 manual forced (and 'safe') release of the service 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...
 
- Protected Attributes inherited from GaudiCommon< Algorithm >
ICounterSummarySvcm_counterSummarySvc
 a pointer to the CounterSummarySvc More...
 
std::vector< std::string > m_counterList
 list of counters to declare. Set by property CounterList. This can be a regular expression. More...
 
std::vector< std::string > m_statEntityList
 
- Static Protected Attributes inherited from GaudiCommon< Algorithm >
static const bool IgnoreRootInTES
 Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...
 
static const bool UseRootInTES
 Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...
 

Detailed Description

The useful base class for data processing algorithms.

Small extension of ordinary the Algorithm base class.

This base class allows "easy"(=="1 line") access to tools and services. This access is safe in the sense that there is no need to worry about the reference counts for tools and services.

The base class allows "easy" (=="1 line") access to data in Gaudi Transient Stores. The functionality includes the checking of the presence of the data at the given location, checking the validity of the data, retrieval of valid data and "forced" retrieve of valid data (create if there is no data).

The base class allows to perform an easy error, warning and exception treatments, including the accumulated statistics of exceptions, errors and warnings.

The base class also includes utilities for general statistical counters.

It has been reported that usage of this base class results in significant shrinkage of existing code lines.

Attention
See also the class GaudiCommon, which implements some of the common functionality between GaudiTool and GaudiAlgorithm.
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
Chris Jones Chris.nosp@m.toph.nosp@m.er.Ro.nosp@m.b.Jo.nosp@m.nes@c.nosp@m.ern..nosp@m.ch
Date
30/06/2001

Definition at line 94 of file GaudiAlgorithm.h.

Constructor & Destructor Documentation

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

Standard constructor (protected)

See also
Algorithm
Parameters
namename of the algorithm
pSvcLocatorpointer to Service Locator

Definition at line 36 of file GaudiAlgorithm.cpp.

38  : GaudiCommon<Algorithm> ( name , pSvcLocator )
39  //
40  , m_evtColSvc () // pointer to Event Tag Collection Service
41 {
42  m_vetoObjs.clear();
43  m_requireObjs.clear();
44 
45  setProperty ( "RegisterForContextService" , true ).ignore() ;
46 
47  declareProperty( "VetoObjects", m_vetoObjs,
48  "Skip execute if one or more of these TES objects exists" );
49  declareProperty( "RequireObjects", m_requireObjs,
50  "Execute only if one or more of these TES objects exists" );
51 }
virtual StatusCode setProperty(const Property &p)
Implementation of IProperty::setProperty.
Definition: Algorithm.cpp:1141
SmartIF< INTupleSvc > m_evtColSvc
Event Tag Collection Service.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Algorithm.h:397
virtual const std::string & name() const
The identifying name of the algorithm object.
Definition: Algorithm.cpp:837
std::vector< std::string > m_vetoObjs
skip the event if any of these objects are present in TES
std::vector< std::string > m_requireObjs
process the event only if one or more of these objects are present in TES
void ignore() const
Definition: StatusCode.h:107
GaudiAlgorithm::~GaudiAlgorithm ( )
virtual

destructor, virtual and protected

Definition at line 55 of file GaudiAlgorithm.cpp.

55 { }
GaudiAlgorithm::GaudiAlgorithm ( )
private

no public default constructor

GaudiAlgorithm::GaudiAlgorithm ( const GaudiAlgorithm )
private

no public copy

Member Function Documentation

SmartIF< INTupleSvc > & GaudiAlgorithm::evtColSvc ( ) const

Access the standard event collection service.

Returns
pointer to the event collection service

Definition at line 94 of file GaudiAlgorithm.cpp.

95 {
96  if ( !m_evtColSvc.isValid() )
97  { m_evtColSvc = svc< INTupleSvc > ( "EvtTupleSvc" , true ) ; }
98  //
99  return m_evtColSvc ;
100 }
SmartIF< INTupleSvc > m_evtColSvc
Event Tag Collection Service.
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:51
StatusCode GaudiAlgorithm::execute ( )
virtual

standard execution method

See also
Algorithm
IAlgorithm
Returns
status code

Implements IAlgorithm.

Reimplemented in GaudiSequencer, RecordOutputStream, ReplayOutputStream, Prescaler, EventNodeKiller, and CallgrindProfile.

Definition at line 87 of file GaudiAlgorithm.cpp.

88 {
89  return Error ( "Default GaudiAlgorithm execute method called !!" ) ;
90 }
StatusCode Error(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the error message and return with the given StatusCode.
template<class TYPE >
bool GaudiAlgorithm::exist ( IDataProviderSvc svc,
const std::string &  location,
const bool  useRootInTES = true 
) const
inline

Check the existence of a data object or container in the Gaudi Transient Event Store.

bool a1 = exist<DataObject>( evtSvc(), "/Event/MyObject" ) ;
bool a2 = exist<MyHits> ( evtSvc(), "/Event/MyHits" ) ;
Attention
The method respects the setting of the job option RootInTES by prepending the value of this to the data location that is passed. The default setting for RootInTES is "" so has no effect. This behavior can be suppressed by passing the argument useRootInTES = false
Parameters
svcPointer to data service (data provider)
locationAddress in Gaudi Transient Event Store
useRootInTESFlag to turn on(TRUE) off(FALSE) the use of the RootInTES location property
Returns
Boolean indicating status of the request
Return values
trueData object or container exists and implements a proper interface
trueFailed to locate the data object or container

Definition at line 502 of file GaudiAlgorithm.h.

505  {
506  return GaudiCommon<Algorithm>::exist<TYPE> ( svc , location , useRootInTES ) ;
507  }
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
SmartIF< SERVICE > svc(const std::string &name, const bool create=true) const
A useful method for the easy location of services.
template<class TYPE >
bool GaudiAlgorithm::exist ( const std::string &  location,
const bool  useRootInTES = true 
) const
inline

Check the existence of a data object or container in the Gaudi Transient Event Store.

bool a1 = exist<DataObject>( "/Event/MyObject" ) ;
bool a2 = exist<MyHits> ( "/Event/MyHits" ) ;
Attention
The method respects the setting of the job option RootInTES by prepending the value of this to the data location that is passed. The default setting for RootInTES is "" so has no effect. This behavior can be suppressed by passing the argument useRootInTES = false
Parameters
locationAddress in Gaudi Transient Event Store
useRootInTESFlag to turn on(TRUE) off(FALSE) the use of the RootInTES location property
Returns
Boolean indicating status of the request
Return values
trueData object or container exists and implements a proper interface
trueFailed to locate the data object or container

Definition at line 535 of file GaudiAlgorithm.h.

537  {
538  return GaudiCommon<Algorithm>::exist<TYPE> ( evtSvc() , location , useRootInTES ) ;
539  }
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition: Algorithm.h:257
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
template<class TYPE >
bool GaudiAlgorithm::existDet ( IDataProviderSvc svc,
const std::string &  location 
) const
inline

Check the existence of detector objects in the Gaudi Transient Detector Store.

bool a1 = existDet<DataObject> ( detSvc(), "/dd/Structure/MyObject" ) ;
bool a2 = existDet<Material> ( detSvc(), "/dd/Structure/Material/Air" ) ;
Parameters
svcPointer to data service (data provider)
locationAddress in Gaudi Transient Detector Store
Returns
Boolean indicating status of the request
Return values
trueDetector object exists and implements a proper interface
falseFailed to locate the data object

Definition at line 558 of file GaudiAlgorithm.h.

560  {
561  return GaudiCommon<Algorithm>::exist<TYPE> ( svc , location , false ) ;
562  }
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
SmartIF< SERVICE > svc(const std::string &name, const bool create=true) const
A useful method for the easy location of services.
template<class TYPE >
bool GaudiAlgorithm::existDet ( const std::string &  location) const
inline

Check the existence of detector objects in the Gaudi Transient Detector Store.

bool a1 = existDet<DataObject> ( "/dd/Structure/MyObject" ) ;
bool a2 = existDet<Material> ( "/dd/Structure/Material/Air" ) ;
Parameters
locationAddress in Gaudi Transient Detector Store
Returns
Boolean indicating status of the request
Return values
trueDetector object exists and implements a proper interface
falseFailed to locate the data object

Definition at line 580 of file GaudiAlgorithm.h.

581  {
582  return GaudiCommon<Algorithm>::exist<TYPE> ( detSvc() , location , false ) ;
583  }
SmartIF< IDataProviderSvc > & detSvc() const
The standard detector data service.
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
StatusCode GaudiAlgorithm::finalize ( )
virtual

standard finalization method

See also
Algorithm
IAlgorithm
Returns
status code

Reimplemented from GaudiCommon< Algorithm >.

Reimplemented in GaudiHistos< GaudiAlgorithm >, GaudiTuples< GaudiHistoAlg >, GaudiTupleAlg, GaudiHistoAlg, GaudiSequencer, RecordOutputStream, ReplayOutputStream, Prescaler, and CallgrindProfile.

Definition at line 73 of file GaudiAlgorithm.cpp.

74 {
75  if ( msgLevel(MSG::DEBUG) )
76  debug() << "Finalize base class GaudiAlgorithm" << endmsg;
77 
78  // reset pointers
79  m_evtColSvc.reset() ;
80 
81  // finalize the base class and return
83 }
SmartIF< INTupleSvc > m_evtColSvc
Event Tag Collection Service.
virtual StatusCode finalize()
standard finalization method
MSG::Level msgLevel() const
The current message service output level.
Definition: GaudiCommon.h:532
MsgStream & debug() const
shortcut for the method msgStream ( MSG::DEBUG )
Definition: GaudiCommon.h:499
void reset(TYPE *ptr=0)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:74
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiAlgorithm::get ( IDataProviderSvc svc,
const std::string &  location,
const bool  useRootInTES = true 
) const
inline

Templated access to the data in Gaudi Transient Store.

Quick and safe access to the data in Gaudi transient store. The method located the data at given address and perform the debug printout about located data

MCHits* hits = get<MCHits>( evtSvc() , "/Event/MC/Hits" );
Attention
The method respects the setting of the job option RootInTES by prepending the value of this to the data location that is passed. The default setting for RootInTES is "" so has no effect. This behavior can be suppressed by passing the argument useRootInTES = false
See also
IDataProviderSvc
SmartDataPtr
Exceptions
GaudiExceptionfor Invalid Data Provider Service
GaudiExceptionfor invalid/unavailable data
Parameters
svcPointer to data service (data provider)
locationdata location/address in Gaudi Transient Store
useRootInTESFlag to turn on(TRUE) off(FALSE) the use of the RootInTES location property
Returns
pointer to the data object

Definition at line 246 of file GaudiAlgorithm.h.

249  {
250  return GaudiCommon<Algorithm>::get<TYPE> ( svc , location , useRootInTES ) ;
251  }
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
SmartIF< SERVICE > svc(const std::string &name, const bool create=true) const
A useful method for the easy location of services.
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiAlgorithm::get ( const std::string &  location,
const bool  useRootInTES = true 
) const
inline

Templated access to the data from Gaudi Event Transient Store.

Quick and safe access to the data in Gaudi transient store.

The method located the data at the given address and perform the debug printout about located data.

MCParticles* mcps = get<MCParticles>( MCParticleLocation::Default );
Attention
The method respects the setting of the job option RootInTES by prepending the value of this to the data location that is passed. The default setting for RootInTES is "" so has no effect. This behavior can be suppressed by passing the argument useRootInTES = false
Parameters
locationData location/address in Gaudi Transient Store
useRootInTESFlag to turn on(TRUE) off(FALSE) the use of the RootInTES location property
Returns
Pointer to the data object

Definition at line 323 of file GaudiAlgorithm.h.

325  {
326  return GaudiCommon<Algorithm>::get<TYPE> ( evtSvc() , location , useRootInTES ) ;
327  }
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition: Algorithm.h:257
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
template<class TYPE >
TYPE* GaudiAlgorithm::getDet ( IDataProviderSvc svc,
const std::string &  location 
) const
inline

Templated access to the detector data from the Gaudi Detector Transient Store.

Quick and safe access to the detector data in Gaudi transient store.

The method located the detector at the given address and perform the debug printout about located detector.

MyDet* mdet = getDet<MyDet>( detSvc() , "/dd/Structure/LHCb/MyDet" );
Parameters
svcPointer to data service (data provider)
locationDetector location/address in Gaudi Transient Store
Returns
Pointer to the detector object

Definition at line 388 of file GaudiAlgorithm.h.

390  {
391  return GaudiCommon<Algorithm>::get<TYPE> ( svc , location , false ) ;
392  }
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
SmartIF< SERVICE > svc(const std::string &name, const bool create=true) const
A useful method for the easy location of services.
template<class TYPE >
TYPE* GaudiAlgorithm::getDet ( const std::string &  location) const
inline

Templated access to the detector data from the Gaudi Detector Transient Store.

Quick and safe access to the detector data in Gaudi transient store.

The method located the detector at the given address and perform the debug printout about located detector.

MyDet* mdet = getDet<MyDet>( "/dd/Structure/LHCb/MyDet" );
Parameters
locationDetector location/address in Gaudi Transient Store
Returns
Pointer to the detector object

Definition at line 442 of file GaudiAlgorithm.h.

443  {
444  return GaudiCommon<Algorithm>::get<TYPE> ( detSvc() , location , false ) ;
445  }
SmartIF< IDataProviderSvc > & detSvc() const
The standard detector data service.
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiAlgorithm::getDetIfExists ( IDataProviderSvc svc,
const std::string &  location 
) const
inline

Templated access to the detector data from the Gaudi Detector Transient Store.

Quick and safe access to the detector data in Gaudi transient store.

The method located the detector at the given address and perform the debug printout about located detector.

Skips the check on the data as performed by 'get'. No exception is thrown if the data is missing.

MyDet* mdet = getDetIfExists<MyDet>( detSvc() , "/dd/Structure/LHCb/MyDet" );
Parameters
svcPointer to data service (data provider)
locationDetector location/address in Gaudi Transient Store
Returns
Pointer to the detector object
Return values
NULLIf the detector object does not exist.

Definition at line 418 of file GaudiAlgorithm.h.

420  {
421  return GaudiCommon<Algorithm>::getIfExists<TYPE> ( svc , location , false ) ;
422  }
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
SmartIF< SERVICE > svc(const std::string &name, const bool create=true) const
A useful method for the easy location of services.
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiAlgorithm::getDetIfExists ( const std::string &  location) const
inline

Templated access to the detector data from the Gaudi Detector Transient Store.

Quick and safe access to the detector data in Gaudi transient store.

The method located the detector at the given address and perform the debug printout about located detector.

Skips the check on the data as performed by 'get'. No exception is thrown if the data is missing.

MyDet* mdet = getDetIfExists<MyDet>( "/dd/Structure/LHCb/MyDet" );
Parameters
locationDetector location/address in Gaudi Transient Store
Returns
Pointer to the detector object
Return values
NULLIf the detector object does not exist.

Definition at line 470 of file GaudiAlgorithm.h.

471  {
472  return GaudiCommon<Algorithm>::getIfExists<TYPE> ( detSvc() , location , false ) ;
473  }
SmartIF< IDataProviderSvc > & detSvc() const
The standard detector data service.
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiAlgorithm::getIfExists ( IDataProviderSvc svc,
const std::string &  location,
const bool  useRootInTES = true 
) const
inline

Templated access to the data in Gaudi Transient Store.

Quick and safe access to the data in Gaudi transient store. The method located the data at given address and perform the debug printout about located data.

Skips the check on the data as performed by 'get'. No exception is thrown if the data is missing.

MCHits* hits = getIfExists<MCHits>( evtSvc() , "/Event/MC/Hits" );
Attention
The method respects the setting of the job option RootInTES by prepending the value of this to the data location that is passed. The default setting for RootInTES is "" so has no effect. This behavior can be suppressed by passing the argument useRootInTES = false
See also
IDataProviderSvc
SmartDataPtr
Parameters
svcPointer to data service (data provider)
locationdata location/address in Gaudi Transient Store
useRootInTESFlag to turn on(TRUE) off(FALSE) the use of the RootInTES location property
Returns
pointer to the data object.
Return values
NULLIf data does not exist.

Definition at line 288 of file GaudiAlgorithm.h.

291  {
292  return GaudiCommon<Algorithm>::getIfExists<TYPE> ( svc , location , useRootInTES ) ;
293  }
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
SmartIF< SERVICE > svc(const std::string &name, const bool create=true) const
A useful method for the easy location of services.
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiAlgorithm::getIfExists ( const std::string &  location,
const bool  useRootInTES = true 
) const
inline

Templated access to the data in Gaudi Transient Store.

Quick and safe access to the data in Gaudi transient store. The method located the data at given address and perform the debug printout about located data.

Skips the check on the data as performed by 'get'. No exception is thrown if the data is missing.

MCHits* hits = getIfExists<MCHits>( "/Event/MC/Hits" );
Attention
The method respects the setting of the job option RootInTES by prepending the value of this to the data location that is passed. The default setting for RootInTES is "" so has no effect. This behavior can be suppressed by passing the argument useRootInTES = false
See also
IDataProviderSvc
SmartDataPtr
Parameters
locationdata location/address in Gaudi Transient Store
useRootInTESFlag to turn on(TRUE) off(FALSE) the use of the RootInTES location property
Returns
pointer to the data object.
Return values
NULLIf data does not exist.

Definition at line 363 of file GaudiAlgorithm.h.

365  {
366  return GaudiCommon<Algorithm>::getIfExists<TYPE> ( evtSvc() , location , useRootInTES ) ;
367  }
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition: Algorithm.h:257
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData<TYPE>::return_type GaudiAlgorithm::getOrCreate ( IDataProviderSvc svc,
const std::string &  location,
const bool  useRootInTES = true 
) const
inline

Get the existing data object from Gaudi Event Transient store.

Alternatively, create new object and register it in TES and return if object does not exist.

MyHits* hits = getOrCreate<MyHits,MyHits>( evtSvc() , "/Event/MyHits" ) ;
Attention
The method respects the setting of the job option RootInTES by prepending the value of this to the data location that is passed. The default setting for RootInTES is "" so has no effect. This behavior can be suppressed by passing the argument useRootInTES = false
Exceptions
GaudiExceptionfor Invalid Data Provider Service
GaudiExceptionfor invalid/unavailable data
Parameters
svcPointer to data service (data provider)
locationLocation in Gaudi Transient Event Store
useRootInTESFlag to turn on(TRUE) off(FALSE) the use of the RootInTES location property
Returns
A valid pointer to the object

Definition at line 614 of file GaudiAlgorithm.h.

617  {
618  return GaudiCommon<Algorithm>::getOrCreate<TYPE,TYPE2> ( svc , location , useRootInTES ) ;
619  }
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
SmartIF< SERVICE > svc(const std::string &name, const bool create=true) const
A useful method for the easy location of services.
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData<TYPE>::return_type GaudiAlgorithm::getOrCreate ( const std::string &  location,
const bool  useRootInTES = true 
) const
inline

Get the existing data object from Gaudi Event Transient store.

Alternatively, create new object and register it in TES and return if object does not exist.

MyHits* hits = getOrCreate<MyHits,MyHits>( "/Event/MyHits" ) ;
Attention
The method respects the setting of the job option RootInTES by prepending the value of this to the data location that is passed. The default setting for RootInTES is "" so has no effect. This behavior can be suppressed by passing the argument useRootInTES = false
Exceptions
GaudiExceptionfor Invalid Data Provider Service
GaudiExceptionfor invalid/unavailable data
Parameters
locationLocation in Gaudi Transient Event Store
useRootInTESFlag to turn on(TRUE) off(FALSE) the use of the RootInTES location property
Returns
A valid pointer to the object

Definition at line 649 of file GaudiAlgorithm.h.

651  {
652  return GaudiCommon<Algorithm>::getOrCreate<TYPE,TYPE2> ( evtSvc() , location , useRootInTES ) ;
653  }
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition: Algorithm.h:257
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:59
StatusCode GaudiAlgorithm::initialize ( )
virtual

standard initialization method

See also
Algorithm
IAlgorithm
Returns
status code

Reimplemented from GaudiCommon< Algorithm >.

Reimplemented in GaudiHistos< GaudiAlgorithm >, GaudiTuples< GaudiHistoAlg >, GaudiTupleAlg, GaudiHistoAlg, GaudiSequencer, RecordOutputStream, Prescaler, ReplayOutputStream, and CallgrindProfile.

Definition at line 59 of file GaudiAlgorithm.cpp.

60 {
61  // initialize the base class
63  if ( sc.isFailure() ) { return sc; }
64 
65  // Add any customisations here, that cannot go in GaudiCommon
66 
67  // return
68  return sc;
69 }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode initialize()
standard initialization method
GaudiAlgorithm& GaudiAlgorithm::operator= ( const GaudiAlgorithm )
private

no public assignment

void GaudiAlgorithm::put ( IDataProviderSvc svc,
DataObject object,
const std::string &  address,
const bool  useRootInTES = true 
) const
inline

Register a data object or container into Gaudi Event Transient Store.

MCHits * hits = new MCHits();
put( evtSvc(), hits, "/Event/MC/Hits" );
Attention
The method respects the setting of the job option RootInTES by prepending the value of this to the data location that is passed. The default setting for RootInTES is "" so has no effect. This behavior can be suppressed by passing the argument useRootInTES = false
See also
IDataProviderSvc
Parameters
svcPointer to data provider service
objectData object or container to be registered
addressAddress in Gaudi Event Transient Store ("/Event" could be omitted )
useRootInTESFlag to turn on(TRUE) off(FALSE) the use of the RootInTES location property
Exceptions
GaudiExceptionfor invalid event data service
GaudiExceptionfor invalid object
GaudiExceptionfor error result from event data service
Returns
StatusCode
Return values
StatusCode::SUCCESSData was successfully placed in the TES.
StatusCode::FAILUREFailed to store data in the TES.

Definition at line 166 of file GaudiAlgorithm.h.

170  {
171  GaudiCommon<Algorithm>::put ( svc , object , address , useRootInTES ) ;
172  }
DataObject * put(IDataProviderSvc *svc, DataObject *object, const std::string &location, const bool useRootInTES=true) const
Register a data object or container into Gaudi Event Transient Store.
void GaudiAlgorithm::put ( DataObject object,
const std::string &  address,
const bool  useRootInTES = true 
) const
inline

Register a data object or container into Gaudi Event Transient Store.

See also
IDataProviderSvc
MCHits * hits = new MCHits();
put( hits, "/Event/MC/Hits" );
Attention
The method respects the setting of the job option RootInTES by prepending the value of this to the data location that is passed. The default setting for RootInTES is "" so has no effect. This behavior can be suppressed by passing the argument useRootInTES = false
Parameters
objectData object or container to be registered
addressAddress in Gaudi Event Transient Store ("/Event" could be omitted )
useRootInTESFlag to turn on(TRUE) off(FALSE) the use of the RootInTES location property
Exceptions
GaudiExceptionfor invalid event data service
GaudiExceptionfor invalid object
GaudiExceptionfor error result from event data service
Returns
StatusCode
Return values
StatusCode::SUCCESSData was successfully placed in the TES.
StatusCode::FAILUREFailed to store data in the TES.

Definition at line 205 of file GaudiAlgorithm.h.

208  {
209  GaudiCommon<Algorithm>::put ( evtSvc() , object , address , useRootInTES ) ;
210  }
DataObject * put(IDataProviderSvc *svc, DataObject *object, const std::string &location, const bool useRootInTES=true) const
Register a data object or container into Gaudi Event Transient Store.
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition: Algorithm.h:257
StatusCode GaudiAlgorithm::sysExecute ( )
virtual

the generic actions for the execution.

See also
Algorithm
IAlgorithm
Algorithm::sysExecute
Returns
status code

< guard/sentry

Reimplemented from Algorithm.

Definition at line 109 of file GaudiAlgorithm.cpp.

110 {
111  IAlgContextSvc* ctx = 0 ;
112  if ( registerContext() ) { ctx = contextSvc() ; }
113  // Lock the context
114  Gaudi::Utils::AlgContext cnt ( ctx , this ) ;
115 
116  // Do not execute if one or more of the m_vetoObjs exist in TES
117  for( std::vector<std::string>::iterator it = m_vetoObjs.begin();
118  it != m_vetoObjs.end(); it++ ) {
119  if( exist<DataObject>(*it) ) {
120  debug() << *it << " found, skipping event " << endmsg;
121  return StatusCode::SUCCESS;
122  }
123  }
124 
125  // Execute if m_requireObjs is empty
126  bool doIt = m_requireObjs.empty() ? true : false;
127 
128  // Execute also if one or more of the m_requireObjs exist in TES
129  for( std::vector<std::string>::iterator it = m_requireObjs.begin();
130  it != m_requireObjs.end(); it++ ) {
131  if( exist<DataObject>(*it) ) {
132  doIt = true;
133  break;
134  }
135  }
136 
137  if( doIt )
138  // execute the generic method:
139  return Algorithm::sysExecute() ;
140  else
141  return StatusCode::SUCCESS;
142 }
SmartIF< IAlgContextSvc > & contextSvc() const
get Algorithm Context Service
Helper "sentry" class to automatize the safe register/unregister the algorithm's context.
virtual StatusCode sysExecute()
The actions to be performed by the algorithm on an event.
Definition: Algorithm.cpp:578
MsgStream & debug() const
shortcut for the method msgStream ( MSG::DEBUG )
Definition: GaudiCommon.h:499
bool registerContext() const
register for Algorithm Context Service?
Definition: Algorithm.h:322
std::vector< std::string > m_vetoObjs
skip the event if any of these objects are present in TES
std::vector< std::string > m_requireObjs
process the event only if one or more of these objects are present in TES
An abstract interface for Algorithm Context Service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

Member Data Documentation

SmartIF<INTupleSvc> GaudiAlgorithm::m_evtColSvc
mutableprivate

Event Tag Collection Service.

Definition at line 688 of file GaudiAlgorithm.h.

std::vector<std::string> GaudiAlgorithm::m_requireObjs
private

process the event only if one or more of these objects are present in TES

Definition at line 692 of file GaudiAlgorithm.h.

std::vector<std::string> GaudiAlgorithm::m_vetoObjs
private

skip the event if any of these objects are present in TES

Definition at line 690 of file GaudiAlgorithm.h.


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