GaudiCommon< PBASE > Class Template Reference

Implements the common functionality between GaudiTools and GaudiAlgorithms. More...

#include <GaudiAlg/GaudiCommon.h>

Inheritance diagram for GaudiCommon< PBASE >:
Collaboration diagram for GaudiCommon< PBASE >:

Public Member Functions

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
 Quicker version of the get function which bypasses the check on the retrieved data. 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 , 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...
 
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...
 
template<class TOOL >
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...
 
template<class TOOL >
TOOL * tool (const std::string &type, const IInterface *parent=0, bool create=true) const
 A useful method for the easy location of tools. More...
 
template<class SERVICE >
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...
 
const Statisticscounters () const
 accessor to all counters More...
 
StatEntitycounter (const std::string &tag) const
 accessor to certain counter by name More...
 
void resetMsgStream () const
 
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...
 
template<class CallerClass >
void registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=nullptr)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
template<class CallerClass , class CondType >
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...
 
template<class CallerClass >
void registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL)
 just to avoid conflicts with the version using a pointer to a template class. More...
 
template<class CallerClass , class TargetClass >
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 initialize () override
 standard initialization method More...
 
StatusCode finalize () override
 standard finalization method More...
 
StatusCode release (const IInterface *interface) const
 Manual forced (and 'safe') release of the active tool or service. 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...
 
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
 Quicker version of the get function which bypasses the check on the retrieved data. 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 , 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...
 
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...
 
template<class TOOL >
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...
 
template<class TOOL >
TOOL * tool (const std::string &type, const IInterface *parent=0, bool create=true) const
 A useful method for the easy location of tools. More...
 
template<class SERVICE >
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...
 
const Statisticscounters () const
 accessor to all counters More...
 
StatEntitycounter (const std::string &tag) const
 accessor to certain counter by name More...
 
void resetMsgStream () const
 
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...
 
template<class CallerClass >
void registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=nullptr)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
template<class CallerClass , class CondType >
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...
 
template<class CallerClass >
void registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL)
 just to avoid conflicts with the version using a pointer to a template class. More...
 
template<class CallerClass , class TargetClass >
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 initialize () override
 standard initialization method More...
 
StatusCode finalize () override
 standard finalization method More...
 
StatusCode release (const IInterface *interface) const
 Manual forced (and 'safe') release of the active tool or service. 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...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type get (IDataProviderSvc *service, const std::string &location, const bool useRootInTES) const
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type getIfExists (IDataProviderSvc *service, const std::string &location, const bool useRootInTES) const
 
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >::return_type getOrCreate (IDataProviderSvc *service, const std::string &location, const bool useRootInTES) const
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type get (IDataProviderSvc *service, const std::string &location, const bool useRootInTES) const
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type getIfExists (IDataProviderSvc *service, const std::string &location, const bool useRootInTES) const
 
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >::return_type getOrCreate (IDataProviderSvc *service, const std::string &location, const bool useRootInTES) const
 
- Public Member Functions inherited from CommonMessaging< PBASE >
 ~CommonMessaging () override=default
 Virtual destructor. More...
 
 ~CommonMessaging () override=default
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. 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...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () 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...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 

Protected Types

typedef std::map< std::string, StatEntityStatistics
 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 std::vector< SmartIF< IService > > Services
 storage for active services More...
 
typedef std::map< std::string, StatEntityStatistics
 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 std::vector< SmartIF< IService > > Services
 storage for active services More...
 

Protected Member Functions

 ~GaudiCommon () override=default
 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...
 
 ~GaudiCommon () override=default
 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 CommonMessaging< PBASE >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Protected Attributes

SmartIF< ICounterSummarySvcm_counterSummarySvc
 a pointer to the CounterSummarySvc More...
 
std::vector< std::string > m_counterList = std::vector<std::string>(1,".*")
 list of counters to declare. Set by property CounterList. This can be a regular expression. More...
 
std::vector< std::string > m_statEntityList = std::vector<std::string>(0)
 
- Protected Attributes inherited from CommonMessaging< PBASE >
SmartIF< IMessageSvcm_msgsvc
 Pointer to the message service;. More...
 
std::unique_ptr< MsgStreamm_msgStream
 The predefined message stream. More...
 
bool m_streamWithService
 Flag to create a new MsgStream if it was created without the message service. More...
 

Static Protected Attributes

static const bool IgnoreRootInTES = false
 Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...
 
static const bool UseRootInTES = true
 Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...
 

Private Member Functions

void msgLevelHandler (Property &theProp)
 Handle method for changes in the Messaging levels. More...
 
 GaudiCommon ()=delete
 
 GaudiCommon (const GaudiCommon &)=delete
 
GaudiCommonoperator= (const GaudiCommon &)=delete
 
void printErrorHandler (Property &)
 handler for "ErrorPrint" property More...
 
void printPropsHandler (Property &)
 handler for "PropertiesPrint" property More...
 
void printStatHandler (Property &)
 handler for "StatPrint" property More...
 
void addToToolList (IAlgTool *tool) const
 Add the given tool to the list of acquired tools. More...
 
void addToServiceList (SmartIF< IService > svc) const
 Add the given service to the list of acquired services. More...
 
void initGaudiCommonConstructor (const IInterface *parent=0)
 Constructor initializations. More...
 
void msgLevelHandler (Property &theProp)
 Handle method for changes in the Messaging levels. More...
 
 GaudiCommon ()=delete
 
 GaudiCommon (const GaudiCommon &)=delete
 
GaudiCommonoperator= (const GaudiCommon &)=delete
 
void printErrorHandler (Property &)
 handler for "ErrorPrint" property More...
 
void printPropsHandler (Property &)
 handler for "PropertiesPrint" property More...
 
void printStatHandler (Property &)
 handler for "StatPrint" property More...
 
void addToToolList (IAlgTool *tool) const
 Add the given tool to the list of acquired tools. More...
 
void addToServiceList (SmartIF< IService > svc) const
 Add the given service to the list of acquired services. More...
 
void initGaudiCommonConstructor (const IInterface *parent=0)
 Constructor initializations. More...
 

Private Attributes

MSG::Level m_msgLevel = MSG::NIL
 The message level. More...
 
std::unique_ptr< MsgStreamm_msgStream
 The predefined message stream. More...
 
AlgTools m_tools
 List of active tools. More...
 
Services m_services
 List of active services. More...
 
Counter m_errors
 Counter of errors. More...
 
Counter m_warnings
 counter of warnings More...
 
Counter m_infos
 counter of infos More...
 
Counter m_exceptions
 Counter of exceptions. More...
 
Statistics m_counters
 General counters. More...
 
IUpdateManagerSvcm_updMgrSvc = nullptr
 Pointer to the Update Manager Service instance. More...
 
bool m_typePrint = true
 insert the actual C++ type of the algorithm in the messages? More...
 
bool m_propsPrint = false
 print properties at initialization? More...
 
bool m_statPrint = true
 print counters at finalization ? More...
 
bool m_errorsPrint = true
 print warning and error counters at finalization ? More...
 
std::string m_context
 The context string. More...
 
std::string m_rootInTES
 The rootInTES string. More...
 
std::string m_rootOnTES
 The rootOnTES string. More...
 
double m_globalTimeOffset = 0
 The globalTimeOffset value. More...
 
std::string m_header
 the header row More...
 
std::string m_format1
 format for regular statistical printout rows More...
 
std::string m_format2
 format for "efficiency" statistical printout rows More...
 
bool m_useEffFormat
 flag to use the special "efficiency" format More...
 

Additional Inherited Members

- Public Types inherited from CommonMessaging< PBASE >
using base_class = CommonMessaging
 
using base_class = CommonMessaging
 

Detailed Description

template<class PBASE>
class GaudiCommon< PBASE >

Implements the common functionality between GaudiTools and GaudiAlgorithms.

Author
Chris Jones Chris.nosp@m.toph.nosp@m.er.Ro.nosp@m.b.Jo.nosp@m.nes@c.nosp@m.ern..nosp@m.ch
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
Rob Lambert Rob.L.nosp@m.ambe.nosp@m.rt@ce.nosp@m.rn.c.nosp@m.h
Date
2009-08-04

Definition at line 73 of file GaudiCommon.h.

Member Typedef Documentation

template<class PBASE>
typedef std::vector<IAlgTool*> GaudiCommon< PBASE >::AlgTools
protected

storage for active tools

Definition at line 106 of file GaudiCommon.h.

template<class PBASE>
typedef std::vector<IAlgTool*> GaudiCommon< PBASE >::AlgTools
protected

storage for active tools

Definition at line 106 of file GaudiCommon.h.

template<class PBASE>
typedef std::map<std::string,unsigned int> GaudiCommon< PBASE >::Counter
protected

the actual type error/warning counter

Definition at line 104 of file GaudiCommon.h.

template<class PBASE>
typedef std::map<std::string,unsigned int> GaudiCommon< PBASE >::Counter
protected

the actual type error/warning counter

Definition at line 104 of file GaudiCommon.h.

template<class PBASE>
typedef std::vector<SmartIF<IService> > GaudiCommon< PBASE >::Services
protected

storage for active services

Definition at line 108 of file GaudiCommon.h.

template<class PBASE>
typedef std::vector<SmartIF<IService> > GaudiCommon< PBASE >::Services
protected

storage for active services

Definition at line 108 of file GaudiCommon.h.

template<class PBASE>
typedef std::map<std::string,StatEntity> GaudiCommon< PBASE >::Statistics
protected

the actual type of general counters

Definition at line 102 of file GaudiCommon.h.

template<class PBASE>
typedef std::map<std::string,StatEntity> GaudiCommon< PBASE >::Statistics
protected

the actual type of general counters

Definition at line 102 of file GaudiCommon.h.

Constructor & Destructor Documentation

template<class PBASE>
GaudiCommon< PBASE >::GaudiCommon ( const std::string &  name,
ISvcLocator pSvcLocator 
)

Algorithm constructor.

template<class PBASE>
GaudiCommon< PBASE >::GaudiCommon ( const std::string &  type,
const std::string &  name,
const IInterface parent 
)

Tool constructor.

template<class PBASE>
GaudiCommon< PBASE >::~GaudiCommon ( )
overrideprotecteddefault

Destructor.

template<class PBASE>
GaudiCommon< PBASE >::GaudiCommon ( )
privatedelete
template<class PBASE>
GaudiCommon< PBASE >::GaudiCommon ( const GaudiCommon< PBASE > &  )
privatedelete
template<class PBASE>
GaudiCommon< PBASE >::GaudiCommon ( const std::string &  name,
ISvcLocator pSvcLocator 
)

Algorithm constructor.

template<class PBASE>
GaudiCommon< PBASE >::GaudiCommon ( const std::string &  type,
const std::string &  name,
const IInterface parent 
)

Tool constructor.

template<class PBASE>
GaudiCommon< PBASE >::~GaudiCommon ( )
overrideprotecteddefault

Destructor.

template<class PBASE>
GaudiCommon< PBASE >::GaudiCommon ( )
privatedelete
template<class PBASE>
GaudiCommon< PBASE >::GaudiCommon ( const GaudiCommon< PBASE > &  )
privatedelete

Member Function Documentation

template<class PBASE >
void GaudiCommon< PBASE >::addToServiceList ( SmartIF< IService svc) const
private

Add the given service to the list of acquired services.

Definition at line 437 of file GaudiCommon.icpp.

438 {
439  if (svc) {
440  auto i = std::lower_bound( std::begin(m_services), std::end(m_services), svc, GaudiCommon_details::svc_lt );
441  if ( i == std::end(m_services) || !GaudiCommon_details::svc_eq(*i,svc) ) {
442  m_services.insert( i, std::move(svc) );
443  } else {
444  this->warning() << "Service " << svc->name() << " already present -- skipping" << endmsg;
445  }
446  }
447 }
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
Services m_services
List of active services.
Definition: GaudiCommon.h:754
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
constexpr const struct GaudiCommon_details::svc_eq_t svc_eq
constexpr const struct GaudiCommon_details::svc_lt_t svc_lt
list i
Definition: ana.py:128
template<class PBASE>
void GaudiCommon< PBASE >::addToServiceList ( SmartIF< IService svc) const
private

Add the given service to the list of acquired services.

template<class PBASE >
void GaudiCommon< PBASE >::addToToolList ( IAlgTool tool) const
private

Add the given tool to the list of acquired tools.

Definition at line 419 of file GaudiCommon.icpp.

420 {
421  if( tool ) {
422  if ( this->msgLevel ( MSG::DEBUG ) ) {
423  this->debug() << "The tool of type '"
424  << System::typeinfoName(typeid(*tool))
425  << "' has been added with the name '"
426  << tool->name() << "'" << endmsg ;
427  }
428  m_tools.push_back( tool ) ;
429  }
430 }
AlgTools m_tools
List of active tools.
Definition: GaudiCommon.h:752
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
template<class PBASE>
void GaudiCommon< PBASE >::addToToolList ( IAlgTool tool) const
private

Add the given tool to the list of acquired tools.

template<class PBASE>
void GaudiCommon< PBASE >::Assert ( const bool  ok,
const std::string &  message = "",
const StatusCode  sc = StatusCode(StatusCode::FAILURE, true) 
) const
inline

Assertion - throw exception if the given condition is not fulfilled.

See also
GaudiException
Exceptions
Exceptionfor invalid condition
Parameters
okCondition which should be "true"
messageMessage to be associated with the exception
template<class PBASE >
void GaudiCommon< PBASE >::Assert ( const bool  ok,
const std::string &  message = "",
const StatusCode  sc = StatusCode(StatusCode::FAILURE, true) 
) const
inline

Assertion - throw exception if the given condition is not fulfilled.

See also
GaudiException
Exceptions
Exceptionfor invalid condition
Parameters
okCondition which should be "true"
messageMessage to be associated with the exception

Definition at line 221 of file GaudiCommonImp.h.

224 {
225  if (!ok) Exception( msg , sc );
226 }
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
void Exception(const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
Create and (re)-throw a given GaudiException.
template<class PBASE>
void GaudiCommon< PBASE >::Assert ( const bool  ok,
const char *  message,
const StatusCode  sc = StatusCode(StatusCode::FAILURE, true) 
) const
inline

Assertion - throw exception if the given condition is not fulfilled.

See also
GaudiException
Exceptions
Exceptionfor invalid condition
Parameters
okCondition which should be "true"
messageMessage to be associated with the exception
template<class PBASE >
void GaudiCommon< PBASE >::Assert ( const bool  ok,
const char *  message,
const StatusCode  sc = StatusCode(StatusCode::FAILURE, true) 
) const
inline

Assertion - throw exception if the given condition is not fulfilled.

See also
GaudiException
Exceptions
Exceptionfor invalid condition
Parameters
okCondition which should be "true"
messageMessage to be associated with the exception

Definition at line 239 of file GaudiCommonImp.h.

242 {
243  if (!ok) Exception( msg , sc );
244 }
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
void Exception(const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
Create and (re)-throw a given GaudiException.
template<class PBASE>
const std::string& GaudiCommon< PBASE >::context ( ) const
inline

Returns the "context" string. Used to identify different processing states.

Definition at line 721 of file GaudiCommon.h.

721 { return m_context; }
std::string m_context
The context string.
Definition: GaudiCommon.h:780
template<class PBASE>
const std::string& GaudiCommon< PBASE >::context ( ) const
inline

Returns the "context" string. Used to identify different processing states.

Definition at line 721 of file GaudiCommon.h.

721 { return m_context; }
std::string m_context
The context string.
Definition: GaudiCommon.h:780
template<class PBASE>
StatEntity& GaudiCommon< PBASE >::counter ( const std::string &  tag) const
inline

accessor to certain counter by name

if ( OK ) { ++counter("OK") ; }
// additive counter ('Flag')
counter("#Tracks") += tracks->size() ;
// multiplicative counter ('Weight')
counter("ProbTot") *= probability ;
See also
StatEntuty
Parameters
tagcounter name
Returns
the counter itself

Definition at line 511 of file GaudiCommon.h.

511 { return m_counters[tag] ; }
Statistics m_counters
General counters.
Definition: GaudiCommon.h:765
template<class PBASE>
StatEntity& GaudiCommon< PBASE >::counter ( const std::string &  tag) const
inline

accessor to certain counter by name

if ( OK ) { ++counter("OK") ; }
// additive counter ('Flag')
counter("#Tracks") += tracks->size() ;
// multiplicative counter ('Weight')
counter("ProbTot") *= probability ;
See also
StatEntuty
Parameters
tagcounter name
Returns
the counter itself

Definition at line 511 of file GaudiCommon.h.

511 { return m_counters[tag] ; }
Statistics m_counters
General counters.
Definition: GaudiCommon.h:765
template<class PBASE>
const Statistics& GaudiCommon< PBASE >::counters ( void  ) const
inline

accessor to all counters

Definition at line 492 of file GaudiCommon.h.

492 { return m_counters ; }
Statistics m_counters
General counters.
Definition: GaudiCommon.h:765
template<class PBASE>
const Statistics& GaudiCommon< PBASE >::counters ( ) const
inline

accessor to all counters

Definition at line 492 of file GaudiCommon.h.

492 { return m_counters ; }
Statistics m_counters
General counters.
Definition: GaudiCommon.h:765
template<class PBASE >
StatusCode GaudiCommon< PBASE >::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.

Also performs statistical analysis of the error messages and suppression after the defined number of error instances.

if( a < 0 ) { return Error("a is negative!") ;}
if( b < 0 ) { return Error("b is illegal!" , StatusCode(25) );
if( c < 0 )
{ return Error("c is negative" , StatusCode(35) , 50 );
See also
MsgStream
IMessageSvc
StatusCode
Parameters
msgError message
stStatusCode to return
mxMaximum number of printouts for this message
Returns
StatusCode

Definition at line 458 of file GaudiCommon.icpp.

461 {
462  // increase local counter of errors
463  const size_t num = ++m_errors[msg] ;
464  // If suppressed, just return
465  if ( num > mx ) { return st ; }
466  else if ( UNLIKELY(num == mx) ) // issue one-time suppression message
467  { return Print ( "The ERROR message is suppressed : '" +
468  msg + "'" , st , MSG::ERROR ) ; }
469  // return message
470  return Print ( msg , st , MSG::ERROR ) ;
471 }
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Counter m_errors
Counter of errors.
Definition: GaudiCommon.h:757
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.
#define UNLIKELY(x)
Definition: Kernel.h:126
template<class PBASE>
StatusCode GaudiCommon< PBASE >::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.

Also performs statistical analysis of the error messages and suppression after the defined number of error instances.

if( a < 0 ) { return Error("a is negative!") ;}
if( b < 0 ) { return Error("b is illegal!" , StatusCode(25) );
if( c < 0 )
{ return Error("c is negative" , StatusCode(35) , 50 );
See also
MsgStream
IMessageSvc
StatusCode
Parameters
msgError message
stStatusCode to return
mxMaximum number of printouts for this message
Returns
StatusCode
template<class PBASE>
bool GaudiCommon< PBASE >::errorsPrint ( ) const
inline

Print error counters at finalization ?

Definition at line 522 of file GaudiCommon.h.

522 { return m_errorsPrint ; }
bool m_errorsPrint
print warning and error counters at finalization ?
Definition: GaudiCommon.h:777
template<class PBASE>
bool GaudiCommon< PBASE >::errorsPrint ( ) const
inline

Print error counters at finalization ?

Definition at line 522 of file GaudiCommon.h.

522 { return m_errorsPrint ; }
bool m_errorsPrint
print warning and error counters at finalization ?
Definition: GaudiCommon.h:777
template<class PBASE >
void GaudiCommon< PBASE >::Exception ( const std::string &  msg,
const GaudiException exc,
const StatusCode  sc = StatusCode(StatusCode::FAILURE, true) 
) const

Create and (re)-throw a given GaudiException.

See also
GaudiException
Exceptions
GaudiExceptionalways thrown!
Parameters
msgException message
exc(previous) exception of type GaudiException

Definition at line 553 of file GaudiCommon.icpp.

556 {
557  // increase local counter of exceptions
558  ++m_exceptions[ msg ];
559  Print ( "Exception (re)throw: " + msg , sc , MSG::FATAL ).ignore();
560  throw GaudiException( this->name() + ":: " + msg , this->name() , sc, exc);
561 }
Define general base for Gaudi exception.
Counter m_exceptions
Counter of exceptions.
Definition: GaudiCommon.h:763
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
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.
void ignore() const
Definition: StatusCode.h:108
template<class PBASE>
void GaudiCommon< PBASE >::Exception ( const std::string &  msg,
const GaudiException exc,
const StatusCode  sc = StatusCode(StatusCode::FAILURE, true) 
) const

Create and (re)-throw a given GaudiException.

See also
GaudiException
Exceptions
GaudiExceptionalways thrown!
Parameters
msgException message
exc(previous) exception of type GaudiException
template<class PBASE>
void GaudiCommon< PBASE >::Exception ( const std::string &  msg,
const std::exception &  exc,
const StatusCode  sc = StatusCode(StatusCode::FAILURE, true) 
) const

Create and (re)-throw a given exception.

See also
GaudiException
Exceptions
std::exceptionalways thrown!
Parameters
msgException message
exc(previous) exception of type std::exception
scStatusCode
template<class PBASE >
void GaudiCommon< PBASE >::Exception ( const std::string &  msg,
const std::exception &  exc,
const StatusCode  sc = StatusCode(StatusCode::FAILURE, true) 
) const

Create and (re)-throw a given exception.

See also
GaudiException
Exceptions
std::exceptionalways thrown!
Parameters
msgException message
exc(previous) exception of type std::exception
scStatusCode

Definition at line 568 of file GaudiCommon.icpp.

571 {
572  // increase local counter of exceptions
573  ++m_exceptions[ msg ];
574  Print ( "Exception (re)throw: " + msg , sc , MSG::FATAL ).ignore();
575  throw GaudiException( this->name() + ":: " + msg+"("+exc.what()+")", "", sc );
576 }
Define general base for Gaudi exception.
Counter m_exceptions
Counter of exceptions.
Definition: GaudiCommon.h:763
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
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.
void ignore() const
Definition: StatusCode.h:108
template<class PBASE>
void GaudiCommon< PBASE >::Exception ( const std::string &  msg = "no message",
const StatusCode  sc = StatusCode(StatusCode::FAILURE, true) 
) const

Create and throw an exception with the given message.

See also
GaudiException
Exceptions
GaudiExceptionalways thrown!
Parameters
msgException message
scStatusCode
template<class PBASE >
void GaudiCommon< PBASE >::Exception ( const std::string &  msg = "no message",
const StatusCode  sc = StatusCode(StatusCode::FAILURE, true) 
) const

Create and throw an exception with the given message.

See also
GaudiException
Exceptions
GaudiExceptionalways thrown!
Parameters
msgException message
scStatusCode

Definition at line 583 of file GaudiCommon.icpp.

585 {
586  // increase local counter of exceptions
587  ++m_exceptions[ msg ];
588  Print ( "Exception throw: " + msg , sc , MSG::FATAL ).ignore();
589  throw GaudiException( this->name() + ":: " + msg , "", sc );
590 }
Define general base for Gaudi exception.
Counter m_exceptions
Counter of exceptions.
Definition: GaudiCommon.h:763
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
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.
void ignore() const
Definition: StatusCode.h:108
template<class PBASE >
template<class TYPE >
bool GaudiCommon< PBASE >::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 provider service
locationAddress in Gaudi Transient 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 91 of file GaudiCommonImp.h.

94 {
95  // check the environment
96  Assert( service , "exist():: IDataProvider* points to NULL!" ) ;
97  // check the data object
99  return checker ( service,
100  fullTESLocation ( location , useRootInTES ) ) ;
101 }
Helper structure for implementation of "exists"-functions for GaudiCommon
Definition: GetData.h:314
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.
const std::string fullTESLocation(const std::string &location, const bool useRootInTES) const
Returns the full correct event location given the rootInTes settings.
template<class PBASE>
template<class TYPE >
bool GaudiCommon< PBASE >::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.

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 provider service
locationAddress in Gaudi Transient 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
template<class PBASE >
StatusCode GaudiCommon< PBASE >::finalize ( )
override

standard finalization method

Returns
status code

Definition at line 258 of file GaudiCommon.icpp.

259 {
261 
262  // print the general information about statistical counters
263  if ( this->msgLevel(MSG::DEBUG) || (statPrint() && !counters().empty()) )
264  {
265  // print general statistical counters
267  }
268  //add all counters to the CounterSummarySvc
269  if(m_counterSummarySvc && this->svcLoc()->existsService("CounterSummarySvc"))
270  {
271  if ( this->msgLevel(MSG::DEBUG) ) this->debug() << "adding counters to CounterSummarySvc" << endmsg;
272 
275 
276  for( const auto& i : this->counters() )
277  {
278  if (statList.Or(i.first) )
279  m_counterSummarySvc->addCounter(this->name(),i.first,i.second,
281  else if (counterList.Or(i.first))
282  m_counterSummarySvc->addCounter(this->name(),i.first,i.second);
283  }
284  }
285  // release all located tools and services
286  if ( this->msgLevel(MSG::DEBUG) )
287  {
288  this->debug() << "Tools to release :";
289  for ( const auto& i : m_tools )
290  {
291  this->debug() << " " << i->name();
292  }
293  this->debug() << endmsg;
294  }
295  while ( !m_tools.empty() ) { sc = releaseTool( m_tools.back() ) && sc; }
296 
297  // release all located services
298  if ( this->msgLevel(MSG::DEBUG) )
299  {
300  this->debug() << "Services to release :";
301  for ( const auto& i : m_services )
302  {
303  this->debug() << " " << i->name();
304  }
305  this->debug() << endmsg;
306  }
307  while ( !m_services.empty() ) { sc = releaseSvc( m_services.front() ) && sc; }
308 
309  //release the CounterSummarySvc manually
311 
312  // format printout
313  if ( !m_errors.empty() || !m_warnings.empty() || !m_exceptions.empty() )
314  {
315  this->always() << "Exceptions/Errors/Warnings/Infos Statistics : "
316  << m_exceptions .size () << "/"
317  << m_errors .size () << "/"
318  << m_warnings .size () << "/"
319  << m_infos .size () << endmsg ;
320  if ( errorsPrint() ) { printErrors () ; }
321  }
322 
323  // delete the MsgStream
324  resetMsgStream();
325 
326  // clear *ALL* counters explicitly
327  m_counters .clear() ;
328  m_exceptions .clear() ;
329  m_infos .clear() ;
330  m_warnings .clear() ;
331  m_errors .clear() ;
332  m_counterList.clear() ;
333  m_statEntityList.clear() ;
334 
335  // finalize base class
336  return sc && PBASE::finalize();
337 }
Counter m_warnings
counter of warnings
Definition: GaudiCommon.h:759
AlgTools m_tools
List of active tools.
Definition: GaudiCommon.h:752
Counter m_exceptions
Counter of exceptions.
Definition: GaudiCommon.h:763
StatusCode releaseSvc(const IInterface *svc) const
manual forced (and 'safe') release of the service
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::vector< std::string > m_counterList
list of counters to declare. Set by property CounterList. This can be a regular expression.
Definition: GaudiCommon.h:115
Services m_services
List of active services.
Definition: GaudiCommon.h:754
void resetMsgStream() const
SmartIF< ICounterSummarySvc > m_counterSummarySvc
a pointer to the CounterSummarySvc
Definition: GaudiCommon.h:113
Statistics m_counters
General counters.
Definition: GaudiCommon.h:765
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
const Statistics & counters() const
accessor to all counters
Definition: GaudiCommon.h:492
bool statPrint() const
Print statistical counters at finalization ?
Definition: GaudiCommon.h:520
Counter m_errors
Counter of errors.
Definition: GaudiCommon.h:757
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual void addCounter(const std::string, const std::string name, const StatEntity &, const Gaudi::CounterSummary::SaveType saveType=Gaudi::CounterSummary::SaveSimpleCounter)=0
declare a counter, StatEntity, to be filled in the Counter summary
Counter m_infos
counter of infos
Definition: GaudiCommon.h:761
bool errorsPrint() const
Print error counters at finalization ?
Definition: GaudiCommon.h:522
StatusCode releaseTool(const IAlgTool *tool) const
manual forced (and 'safe') release of the tool
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
long printStat(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of statistical counters
std::vector< std::string > m_statEntityList
Definition: GaudiCommon.h:117
list i
Definition: ana.py:128
long printErrors(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of error counters
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
template<class PBASE>
StatusCode GaudiCommon< PBASE >::finalize ( )
override

standard finalization method

Returns
status code
template<class PBASE>
const std::string GaudiCommon< PBASE >::fullTESLocation ( const std::string &  location,
const bool  useRootInTES 
) const

Returns the full correct event location given the rootInTes settings.

template<class PBASE >
const std::string GaudiCommon< PBASE >::fullTESLocation ( const std::string &  location,
const bool  useRootInTES 
) const
inline

Returns the full correct event location given the rootInTes settings.

Definition at line 25 of file GaudiCommonImp.h.

27 {
28  // The logic is:
29  // if no R.I.T., give back location
30  // if R.I.T., this is the mapping:
31  // (note that R.I.T. contains a trailing '/')
32  // location -> result
33  // -------------------------------------------------
34  // "" -> R.I.T.[:-1] ("rit")
35  // "/Event" -> R.I.T.[:-1] ("rit")
36  // "/Event/MyObj" -> R.I.T. + "MyObj" ("rit/MyObj")
37  // "MyObj" -> R.I.T. + "MyObj" ("rit/MyObj")
38  return ( !useRootInTES || rootInTES().empty() ?
39  location
40  :
41  location.empty() || ( location == "/Event" ) ?
42  rootInTES().substr(0,rootInTES().size()-1)
43  :
44  0 == location.find("/Event/") ?
45  rootInTES() + location.substr(7)
46  :
47  rootInTES() + location );
48 }
const std::string & rootInTES() const
Returns the "rootInTES" string.
Definition: GaudiCommon.h:725
template<class PBASE>
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::get ( IDataProviderSvc service,
const std::string &  location,
const bool  useRootInTES 
) const
inline

Definition at line 55 of file GaudiCommonImp.h.

58 {
59  // check the environment
60  Assert( service , "get():: IDataProvider* points to NULL!" ) ;
61  // get the helper object:
63  return getter ( *this ,
64  service ,
65  fullTESLocation ( location , useRootInTES ) ) ;
66 }
Helper structure for implementation of "get"-functions for GaudiCommon
Definition: GaudiCommon.h:36
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.
const std::string fullTESLocation(const std::string &location, const bool useRootInTES) const
Returns the full correct event location given the rootInTes settings.
template<class PBASE>
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::get ( IDataProviderSvc service,
const std::string &  location,
const bool  useRootInTES 
) const
inline

Definition at line 55 of file GaudiCommonImp.h.

58 {
59  // check the environment
60  Assert( service , "get():: IDataProvider* points to NULL!" ) ;
61  // get the helper object:
63  return getter ( *this ,
64  service ,
65  fullTESLocation ( location , useRootInTES ) ) ;
66 }
Helper structure for implementation of "get"-functions for GaudiCommon
Definition: GaudiCommon.h:36
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.
const std::string fullTESLocation(const std::string &location, const bool useRootInTES) const
Returns the full correct event location given the rootInTes settings.
template<class PBASE>
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::get ( IDataProviderSvc svc,
const std::string &  location,
const bool  useRootInTES = true 
) const

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

// Will access MCHits from the given location
MCHits* hits = get<MCHits>( evtSvc () , "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
template<class PBASE>
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::get ( IDataProviderSvc svc,
const std::string &  location,
const bool  useRootInTES = true 
) const

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

// Will access MCHits from the given location
MCHits* hits = get<MCHits>( evtSvc () , "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
template<class PBASE>
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::getIfExists ( IDataProviderSvc service,
const std::string &  location,
const bool  useRootInTES 
) const
inline

Definition at line 73 of file GaudiCommonImp.h.

76 {
77  // check the environment
78  Assert( service , "get():: IDataProvider* points to NULL!" ) ;
79  // get the helper object:
81  return getter ( *this ,
82  service ,
83  fullTESLocation ( location , useRootInTES ),
84  false) ;
85 }
Helper structure for implementation of "get"-functions for GaudiCommon
Definition: GaudiCommon.h:36
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.
const std::string fullTESLocation(const std::string &location, const bool useRootInTES) const
Returns the full correct event location given the rootInTes settings.
template<class PBASE>
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::getIfExists ( IDataProviderSvc service,
const std::string &  location,
const bool  useRootInTES 
) const
inline

Definition at line 73 of file GaudiCommonImp.h.

76 {
77  // check the environment
78  Assert( service , "get():: IDataProvider* points to NULL!" ) ;
79  // get the helper object:
81  return getter ( *this ,
82  service ,
83  fullTESLocation ( location , useRootInTES ),
84  false) ;
85 }
Helper structure for implementation of "get"-functions for GaudiCommon
Definition: GaudiCommon.h:36
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.
const std::string fullTESLocation(const std::string &location, const bool useRootInTES) const
Returns the full correct event location given the rootInTes settings.
template<class PBASE>
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::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.

template<class PBASE>
template<class TYPE >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::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.

template<class PBASE>
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::getOrCreate ( IDataProviderSvc service,
const std::string &  location,
const bool  useRootInTES 
) const
inline

Definition at line 110 of file GaudiCommonImp.h.

113 {
114  // check the environment
115  Assert ( service , "getOrCreate():: svc points to NULL!" ) ;
116  // get the helper object
118  return getter ( *this ,
119  service ,
120  fullTESLocation( location, useRootInTES ) ,
121  location ) ;
122 }
Helper structure for implementation of "getOrCreate"-functions for GaudiCommon ...
Definition: GetData.h:402
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.
const std::string fullTESLocation(const std::string &location, const bool useRootInTES) const
Returns the full correct event location given the rootInTes settings.
template<class PBASE>
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::getOrCreate ( IDataProviderSvc service,
const std::string &  location,
const bool  useRootInTES 
) const
inline

Definition at line 110 of file GaudiCommonImp.h.

113 {
114  // check the environment
115  Assert ( service , "getOrCreate():: svc points to NULL!" ) ;
116  // get the helper object
118  return getter ( *this ,
119  service ,
120  fullTESLocation( location, useRootInTES ) ,
121  location ) ;
122 }
Helper structure for implementation of "getOrCreate"-functions for GaudiCommon ...
Definition: GetData.h:402
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.
const std::string fullTESLocation(const std::string &location, const bool useRootInTES) const
Returns the full correct event location given the rootInTes settings.
template<class PBASE>
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::getOrCreate ( IDataProviderSvc svc,
const std::string &  location,
const bool  useRootInTES = true 
) const

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 provider service
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 data object
template<class PBASE>
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData<TYPE>::return_type GaudiCommon< PBASE >::getOrCreate ( IDataProviderSvc svc,
const std::string &  location,
const bool  useRootInTES = true 
) const

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 provider service
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 data object
template<class PBASE>
double GaudiCommon< PBASE >::globalTimeOffset ( ) const
inline

Returns the "globalTimeOffset" double.

Definition at line 727 of file GaudiCommon.h.

727 { return m_globalTimeOffset; }
double m_globalTimeOffset
The globalTimeOffset value.
Definition: GaudiCommon.h:788
template<class PBASE>
double GaudiCommon< PBASE >::globalTimeOffset ( ) const
inline

Returns the "globalTimeOffset" double.

Definition at line 727 of file GaudiCommon.h.

727 { return m_globalTimeOffset; }
double m_globalTimeOffset
The globalTimeOffset value.
Definition: GaudiCommon.h:788
template<class PBASE>
StatusCode GaudiCommon< PBASE >::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.

Also performs statistical analysis of the info messages and suppression after the defined number of instances.

See also
MsgStream
IMessageSvc
StatusCode
GaudiCommon::Warning
Parameters
msgInfo message
stStatusCode to return
mxMaximum number of printouts for this message
Returns
The given StatusCode
template<class PBASE >
StatusCode GaudiCommon< PBASE >::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.

Also performs statistical analysis of the info messages and suppression after the defined number of instances.

See also
MsgStream
IMessageSvc
StatusCode
GaudiCommon::Warning
Parameters
msgInfo message
stStatusCode to return
mxMaximum number of printouts for this message
Returns
The given StatusCode

Definition at line 500 of file GaudiCommon.icpp.

503 {
504  // increase local counter of warnings
505  const size_t num = ++m_infos[msg] ;
506  // If suppressed, just return
507  if ( num > mx ) { return st ; }
508  else if ( UNLIKELY(num == mx) ) // issue one-time suppression message
509  { return Print ( "The INFO message is suppressed : '" +
510  msg + "'" , st , MSG::INFO ) ; }
511  // return message
512  return Print ( msg , st , MSG::INFO ) ;
513 }
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Counter m_infos
counter of infos
Definition: GaudiCommon.h:761
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.
#define UNLIKELY(x)
Definition: Kernel.h:126
template<class PBASE>
void GaudiCommon< PBASE >::initGaudiCommonConstructor ( const IInterface parent = 0)
private

Constructor initializations.

template<class PBASE >
void GaudiCommon< PBASE >::initGaudiCommonConstructor ( const IInterface parent = 0)
private

Constructor initializations.

< flag to use the special "efficiency" format

Definition at line 63 of file GaudiCommon.icpp.

64 {
65  // initialise data members
66 
67  // the header row for counters printout
68  m_header = " | Counter | # | sum | mean/eff^* | rms/err^* | min | max |" ;
69  // format for regular statistical printout rows
70  m_format1 = " | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |" ;
71  // format for "efficiency" statistical printout rows
72  m_format2 = " |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |" ;
73  // flag to use the special "efficiency" format
74  m_useEffFormat = true ;
75 
76  // job options
77  // print error counters at finalization ?
78  this->declareProperty
79  ( "ErrorsPrint" , m_errorsPrint ,
80  "Print the statistics of errors/warnings/exceptions")
81  -> declareUpdateHandler
83  // print properties at initialization?
84  this->declareProperty
85  ( "PropertiesPrint" , m_propsPrint ,
86  "Print the properties of the component ")
87  -> declareUpdateHandler
89  // print statistical counters at finalization ?
90  this->declareProperty
91  ( "StatPrint" , m_statPrint ,
92  "Print the table of counters" )
93  -> declareUpdateHandler
95  // insert the actual C++ type of the algorithm or tool in the messages?
96  this->declareProperty
97  ( "TypePrint" , m_typePrint ,
98  "Add the actal C++ component type into the messages" ) ;
99  // context
100  this->declareProperty ( "Context" , m_context ) ;
101  // root in TES
102  this->declareProperty ( "RootInTES" , m_rootInTES ) ;
103  // root on TES ( temporary )
104  this->declareProperty ( "RootOnTES" , m_rootOnTES ) ;
105  // global time offset
106  this->declareProperty ( "GlobalTimeOffset", m_globalTimeOffset ) ;
107 
108 
109  // the header row for counters printout
110  this->declareProperty
111  ( "StatTableHeader" , m_header ,
112  "The header row for the output Stat-table" ) ;
113  // format for regular statistical printout rows
114  this->declareProperty
115  ( "RegularRowFormat" , m_format1 ,
116  "The format for the regular row in the output Stat-table" ) ;
117  // format for "efficiency" statistical printout rows
118  this->declareProperty
119  ( "EfficiencyRowFormat" , m_format2 ,
120  "The format for the regular row in the output Stat-table" ) ;
121  // flag to use the special "efficiency" format
122  this->declareProperty
123  ( "UseEfficiencyRowFormat" , m_useEffFormat ,
124  "Use the special format for printout of efficiency counters" ) ;
125 
126 
127  //declare the list of simple counters to write.
128  this->declareProperty(
129  "CounterList",
130  m_counterList=std::vector<std::string>(1,".*"),
131  "RegEx list, of simple integer counters for CounterSummary.");
132  //declare the list of stat entities to write.
133  this->declareProperty(
134  "StatEntityList",
135  m_statEntityList=std::vector<std::string>(0),
136  "RegEx list, of StatEntity counters for CounterSummary.");
137 
138  // add handler for message level changes
139  this->outputLevelProperty().declareUpdateHandler( &GaudiCommon<PBASE>::msgLevelHandler, this );
140 
141  // setup context from parent if available
142  if ( parent )
143  {
144  if ( const GaudiAlgorithm* gAlg = dynamic_cast<const GaudiAlgorithm*>(parent) )
145  {
146  m_context = gAlg->context();
147  m_rootInTES = gAlg->rootInTES();
148  m_globalTimeOffset = gAlg->globalTimeOffset();
149  }
150  else if ( const GaudiTool* gTool = dynamic_cast<const GaudiTool*> (parent) )
151  {
152  m_context = gTool->context();
153  m_rootInTES = gTool->rootInTES();
154  m_globalTimeOffset = gTool->globalTimeOffset();
155  }
156  }
157 
158  // Get the job option service
159  auto jos = this->template service<IJobOptionsSvc>("JobOptionsSvc");
160  if (!jos) Exception("Cannot get JobOptionsSvc");
161 
162  // Get the "Context" option if in the file...
163  const auto myList = jos->getProperties( this->name() );
164  if ( myList )
165  {
166  // Iterate over the list to set the options
167  for ( const auto& iter : *myList )
168  {
169  const StringProperty* sp = dynamic_cast<const StringProperty*>(iter);
170  if ( sp )
171  {
172  if ( iter->name() == "Context" ) {
173  m_context = sp->value();
174  } else if ( iter->name() == "RootInTES" ) {
175  m_rootInTES = sp->value();
176  } else if ( iter->name() == "GlobalTimeOffset" ) {
177  m_globalTimeOffset = std::stod( sp->value() );
178  }
179  }
180  }
181  }
182 
183 }
double m_globalTimeOffset
The globalTimeOffset value.
Definition: GaudiCommon.h:788
std::string m_rootOnTES
The rootOnTES string.
Definition: GaudiCommon.h:786
std::vector< std::string > m_counterList
list of counters to declare. Set by property CounterList. This can be a regular expression.
Definition: GaudiCommon.h:115
bool m_typePrint
insert the actual C++ type of the algorithm in the messages?
Definition: GaudiCommon.h:771
bool m_useEffFormat
flag to use the special "efficiency" format
Definition: GaudiCommon.h:797
std::string m_format1
format for regular statistical printout rows
Definition: GaudiCommon.h:793
std::string m_rootInTES
The rootInTES string.
Definition: GaudiCommon.h:782
The useful base class for data processing algorithms.
std::string m_header
the header row
Definition: GaudiCommon.h:791
const TYPE & value() const
explicit conversion
Definition: Property.h:341
bool m_statPrint
print counters at finalization ?
Definition: GaudiCommon.h:775
std::string m_format2
format for "efficiency" statistical printout rows
Definition: GaudiCommon.h:795
The useful base class for tools.
Definition: GaudiTool.h:97
bool m_errorsPrint
print warning and error counters at finalization ?
Definition: GaudiCommon.h:777
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:73
std::vector< std::string > m_statEntityList
Definition: GaudiCommon.h:117
std::string m_context
The context string.
Definition: GaudiCommon.h:780
bool m_propsPrint
print properties at initialization?
Definition: GaudiCommon.h:773
void Exception(const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
Create and (re)-throw a given GaudiException.
template<class PBASE >
StatusCode GaudiCommon< PBASE >::initialize ( )
override

standard initialization method

Returns
status code

Definition at line 196 of file GaudiCommon.icpp.

197 {
198 
199  // initialize base class
200  const StatusCode sc = PBASE::initialize();
201  if ( sc.isFailure() )
202  { return Error ( "Failed to initialise base class PBASE", sc ) ; }
203 
204 
205  // some debug printout
206  if ( this->msgLevel(MSG::DEBUG) )
207  {
208  this->debug() << "Initialize base class GaudiCommon<" << System::typeinfoName(typeid(PBASE)) << ">" << endmsg;
209  if ( !context().empty() )
210  this->debug() << "Created with context = '" << context() << "'" << endmsg;
211  }
212 
213  // some temporary checks to see if people are using RootOnTES and warn if so
214  // TO BE REMOVED ASAP ...
215  if ( m_rootInTES.empty() && !m_rootOnTES.empty() )
216  {
218  Warning( "RootOnTES option is OBSOLETE -> Use RootInTES instead. RootInTES has been updated to "
220  }
221  else if ( !m_rootInTES.empty() && !m_rootOnTES.empty() )
222  {
223  Warning( "Options RootOnTES AND RootInTES are defined ! Use RootInTES. RootOnTES is ignored",
225  }
226 
227  // Check rootInTES ends with a /
228  if ( !m_rootInTES.empty() &&
229  m_rootInTES.substr(m_rootInTES.size()-1) != "/" ) m_rootInTES += "/";
230 
231  //Set up the CounterSummarySvc May need to be changed
232  m_counterSummarySvc = this->svcLoc()->service("CounterSummarySvc",false);
233  if (this->msgLevel(MSG::DEBUG))
234  {
235  if (!m_counterSummarySvc)
236  this->debug() << "could not locate CounterSummarySvc, no counter summary will be made" << endmsg;
237  else this->debug() << "found CounterSummarySvc OK" << endmsg;
238  }
239 
240  // properties will be printed if asked for or in "MSG::DEBUG" mode
241  if ( propsPrint() ) { printProps(MSG::ALWAYS); }
242  else if ( this->msgLevel(MSG::DEBUG) ) { printProps(MSG::DEBUG); }
243 
244  return sc;
245 }
def initialize()
Definition: AnalysisTest.py:12
std::string m_rootOnTES
The rootOnTES string.
Definition: GaudiCommon.h:786
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
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.
SmartIF< ICounterSummarySvc > m_counterSummarySvc
a pointer to the CounterSummarySvc
Definition: GaudiCommon.h:113
const std::string & context() const
Returns the "context" string. Used to identify different processing states.
Definition: GaudiCommon.h:721
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::string m_rootInTES
The rootInTES string.
Definition: GaudiCommon.h:782
bool propsPrint() const
Print properties at initialization ?
Definition: GaudiCommon.h:518
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.
void ignore() const
Definition: StatusCode.h:108
long printProps(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of properties
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
template<class PBASE>
StatusCode GaudiCommon< PBASE >::initialize ( )
override

standard initialization method

Returns
status code
template<class PBASE>
void GaudiCommon< PBASE >::msgLevelHandler ( Property theProp)
private

Handle method for changes in the Messaging levels.

Called whenever the property "OutputLevel" changes to perform all necessary actions locally.

Parameters
thePropReference to the Property that has changed
template<class PBASE >
void GaudiCommon< PBASE >::msgLevelHandler ( Property theProp)
private

Handle method for changes in the Messaging levels.

Called whenever the property "OutputLevel" changes to perform all necessary actions locally.

Parameters
thePropReference to the Property that has changed

Definition at line 681 of file GaudiCommon.icpp.

682 {
683  // Force a new MsgStream object, to pick up the new settings
684  resetMsgStream();
685 
686  // adjust internal message level
687  m_msgLevel =
688  this->outputLevel() < (int) MSG::NIL ? MSG::NIL :
689  this->outputLevel() >= (int) MSG::NUM_LEVELS ? MSG::ALWAYS :
690  MSG::Level( this->outputLevel() ) ;
691 
692  // Keep MessageSvc up to date if needed
693  if ( this->msgSvc()->outputLevel(this->name()) != this->outputLevel() )
694  {
695  this->msgSvc()->setOutputLevel( this->name(), this->outputLevel() );
696  }
697 
698  // printout message
699  if ( this->msgLevel(MSG::DEBUG) )
700  {
701  this->debug() << "Property update for "
702  << theProp.name() << " : new value = " << this->outputLevel() << endmsg;
703  }
704 }
const std::string & name() const
property name
Definition: Property.h:45
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
void resetMsgStream() const
virtual int outputLevel() const =0
Retrieve the current output level threshold.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MSG::Level m_msgLevel
The message level.
Definition: GaudiCommon.h:747
virtual void setOutputLevel(int new_level)=0
Set new global output level threshold.
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
template<class PBASE>
GaudiCommon& GaudiCommon< PBASE >::operator= ( const GaudiCommon< PBASE > &  )
privatedelete
template<class PBASE>
GaudiCommon& GaudiCommon< PBASE >::operator= ( const GaudiCommon< PBASE > &  )
privatedelete
template<class PBASE>
StatusCode GaudiCommon< PBASE >::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.

See also
MsgStream
IMessageSvc
StatusCode
Parameters
msgMessage to print
stStatusCode to return
levPrintout level for the given message
Returns
The given StatusCode
template<class PBASE >
StatusCode GaudiCommon< PBASE >::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.

See also
MsgStream
IMessageSvc
StatusCode
Parameters
msgMessage to print
stStatusCode to return
levPrintout level for the given message
Returns
The given StatusCode

Definition at line 520 of file GaudiCommon.icpp.

523 {
524  // perform printout ?
525  if ( !this->msgLevel( lvl ) ) { return st ; } // RETURN
526 
527  // use the predefined stream
528  MsgStream& str = this->msgStream( lvl ) ;
529  if ( typePrint() ) { str << System::typeinfoName(typeid(*this)) << ":: " ; }
530 
531  // print the message
532  str << msg ;
533 
534  // test status code
535  if ( st.isSuccess() ) { }
536  else if ( StatusCode::FAILURE != st.getCode() )
537  { str << " StatusCode=" << st.getCode() ; }
538  else
539  { str << " StatusCode=FAILURE" ; }
540 
541  // perform print operation
542  str << endmsg ;
543 
544  // return
545  return st;
546 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
unsigned long getCode() const
Get the status code by value.
Definition: StatusCode.h:93
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
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:299
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
MsgStream & msgStream() const
Return an uninitialized MsgStream.
bool typePrint() const
Insert the actual C++ type of the algorithm/tool in the messages ?
Definition: GaudiCommon.h:516
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
template<class PBASE >
void GaudiCommon< PBASE >::printErrorHandler ( Property )
private

handler for "ErrorPrint" property

Definition at line 748 of file GaudiCommon.icpp.

749 {
750  // no action if not yet initialized
751  if ( this -> FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; }
752  if ( this -> errorsPrint() ) { this -> printErrors () ; }
753 }
bool errorsPrint() const
Print error counters at finalization ?
Definition: GaudiCommon.h:522
long printErrors(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of error counters
template<class PBASE>
void GaudiCommon< PBASE >::printErrorHandler ( Property )
private

handler for "ErrorPrint" property

template<class PBASE>
long GaudiCommon< PBASE >::printErrors ( const MSG::Level  level = MSG::ALWAYS) const

perform the actual printout of error counters

Parameters
levelThe message level to print at
Returns
number of error counters
template<class PBASE >
long GaudiCommon< PBASE >::printErrors ( const MSG::Level  level = MSG::ALWAYS) const

perform the actual printout of error counters

Parameters
levelThe message level to print at
Returns
number of error counters

Definition at line 627 of file GaudiCommon.icpp.

628 {
629  // format for printout
630  boost::format ftm ( " #%|-10s| = %|.8s| %|23t| Message = '%s'" );
631 
632  auto print = [&](const Counter& c, const std::string& label) {
633  for (const auto& i : c ) {
634  this->msgStream(level)
635  << ( ftm % label % i.second % i.first )
636  << endmsg;
637  }
638  };
639 
640  print( m_exceptions, "EXCEPTIONS" );
641  print( m_errors, "ERRORS" );
642  print( m_warnings, "WARNINGS" );
643  print( m_infos, "INFOS" );
644 
645  // return total number of errors+warnings+exceptions
646  return
647  m_exceptions .size () +
648  m_errors .size () +
649  m_warnings .size () +
650  m_infos .size () ;
651 }
Counter m_warnings
counter of warnings
Definition: GaudiCommon.h:759
tuple c
Definition: gaudirun.py:392
Counter m_exceptions
Counter of exceptions.
Definition: GaudiCommon.h:763
std::map< std::string, unsigned int > Counter
the actual type error/warning counter
Definition: GaudiCommon.h:104
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MsgStream & msgStream() const
Return an uninitialized MsgStream.
Counter m_errors
Counter of errors.
Definition: GaudiCommon.h:757
Counter m_infos
counter of infos
Definition: GaudiCommon.h:761
list i
Definition: ana.py:128
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
template<class PBASE>
long GaudiCommon< PBASE >::printProps ( const MSG::Level  level = MSG::ALWAYS) const

perform the actual printout of properties

Parameters
levelThe message level to print at
Returns
number of properties
template<class PBASE >
long GaudiCommon< PBASE >::printProps ( const MSG::Level  level = MSG::ALWAYS) const

perform the actual printout of properties

perform the printout of properties

Parameters
levelThe message level to print at
Returns
number of properties
number of error counters

Definition at line 660 of file GaudiCommon.icpp.

661 {
662 
663  // print ALL properties
664  MsgStream& msg = this->msgStream ( level );
665  const auto& properties = this->getProperties() ;
666  msg << "List of ALL properties of "
667  << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
668  << " #properties = " << properties.size() << endmsg ;
669  for ( const auto& property : reverse(properties) )
670  {
671  msg << "Property ['Name': Value] = " << *property << endmsg ;
672  }
673  return properties.size() ;
674 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
reverse_wrapper< T > reverse(T &&iterable)
Definition: reverse.h:30
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
MsgStream & msgStream() const
Return an uninitialized MsgStream.
template<class PBASE >
void GaudiCommon< PBASE >::printPropsHandler ( Property )
private

handler for "PropertiesPrint" property

Definition at line 758 of file GaudiCommon.icpp.

759 {
760  // no action if not yet initialized
761  if ( this -> FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; }
762  if ( this -> propsPrint() ) { this -> printProps ( MSG::ALWAYS ) ; }
763 }
bool propsPrint() const
Print properties at initialization ?
Definition: GaudiCommon.h:518
long printProps(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of properties
template<class PBASE>
void GaudiCommon< PBASE >::printPropsHandler ( Property )
private

handler for "PropertiesPrint" property

template<class PBASE >
long GaudiCommon< PBASE >::printStat ( const MSG::Level  level = MSG::ALWAYS) const

perform the actual printout of statistical counters

Parameters
levelThe message level to print at
Returns
number of active statistical counters

Definition at line 597 of file GaudiCommon.icpp.

598 {
599  // print statistics
600  if ( counters().empty() ) { return 0 ; }
601  MsgStream& msg = this->msgStream ( level ) ;
602  //
603  msg << "Number of counters : " << counters().size() ;
604  //
605  if ( !counters().empty() ) { msg << std::endl << m_header ; }
606  //
607  for ( const auto& entry : counters() )
608  {
609  msg << std::endl
611  ( entry.first ,
612  entry.second ,
614  m_format1 , m_format2 );
615  }
616  //
617  msg << endmsg ;
618  //
619  return counters().size() ;
620 }
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
const Statistics & counters() const
accessor to all counters
Definition: GaudiCommon.h:492
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
bool m_useEffFormat
flag to use the special "efficiency" format
Definition: GaudiCommon.h:797
MsgStream & msgStream() const
Return an uninitialized MsgStream.
std::string m_format1
format for regular statistical printout rows
Definition: GaudiCommon.h:793
std::string m_header
the header row
Definition: GaudiCommon.h:791
std::string m_format2
format for "efficiency" statistical printout rows
Definition: GaudiCommon.h:795
GAUDI_API std::string formatAsTableRow(const StatEntity &counter, const bool flag, const std::string &format1=" |%|7d| |%|11.7g| |%|#11.5g| |%|#10.5g| |%|#10.5g| |%|#10.5g| |", const std::string &format2="*|%|7d| |%|11.5g| |(%|#9.7g| +- %|-#8.6g|)%%| ----- | ----- |")
print the counter in a form of the table row
Definition: StatEntity.cpp:299
template<class PBASE>
long GaudiCommon< PBASE >::printStat ( const MSG::Level  level = MSG::ALWAYS) const

perform the actual printout of statistical counters

Parameters
levelThe message level to print at
Returns
number of active statistical counters
template<class PBASE >
void GaudiCommon< PBASE >::printStatHandler ( Property )
private

handler for "StatPrint" property

Definition at line 768 of file GaudiCommon.icpp.

769 {
770  // no action if not yet initialized
771  if ( this -> FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; }
772  if ( this -> statPrint() ) { this -> printStat ( MSG::ALWAYS ) ; }
773 }
bool statPrint() const
Print statistical counters at finalization ?
Definition: GaudiCommon.h:520
long printStat(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of statistical counters
template<class PBASE>
void GaudiCommon< PBASE >::printStatHandler ( Property )
private

handler for "StatPrint" property

template<class PBASE>
bool GaudiCommon< PBASE >::propsPrint ( ) const
inline

Print properties at initialization ?

Definition at line 518 of file GaudiCommon.h.

518 { return m_propsPrint ; }
bool m_propsPrint
print properties at initialization?
Definition: GaudiCommon.h:773
template<class PBASE>
bool GaudiCommon< PBASE >::propsPrint ( ) const
inline

Print properties at initialization ?

Definition at line 518 of file GaudiCommon.h.

518 { return m_propsPrint ; }
bool m_propsPrint
print properties at initialization?
Definition: GaudiCommon.h:773
template<class PBASE >
DataObject * GaudiCommon< PBASE >::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.

See also
IDataProviderSvc
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 provider service
objectData object or container to be registered
locationLocation 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 715 of file GaudiCommon.icpp.

719 {
720  // check arguments
721  Assert ( svc , "put():: Invalid 'service'!" ) ;
722  Assert ( object , "put():: Invalid 'Object'!" ) ;
723  Assert ( !location.empty() , "put():: Invalid 'address' = '' " ) ;
724  // final data location
725  const std::string & fullLocation = fullTESLocation( location, useRootInTES );
726  // register the object!
727  const StatusCode status = '/' == fullLocation[0] ?
728  svc -> registerObject( fullLocation , object ) :
729  svc -> registerObject( "/Event/" + fullLocation , object ) ;
730  // check the result!
731  if ( status.isFailure() )
732  { Exception ( "put():: could not register '" +
733  System::typeinfoName( typeid( *object ) ) +
734  "' at address '" + fullLocation + "'" , status ) ; }
735  if ( this->msgLevel( MSG::DEBUG ) )
736  { Print( "The object of type '" +
737  System::typeinfoName( typeid( *object ) ) +
738  "' is registered in TS at address '"
739  + fullLocation + "'" , status , MSG::DEBUG ).ignore() ; }
740  return object;
741 }
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
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 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.
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.
const std::string fullTESLocation(const std::string &location, const bool useRootInTES) const
Returns the full correct event location given the rootInTes settings.
void ignore() const
Definition: StatusCode.h:108
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
void Exception(const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
Create and (re)-throw a given GaudiException.
template<class PBASE>
DataObject* GaudiCommon< PBASE >::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.

See also
IDataProviderSvc
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 provider service
objectData object or container to be registered
locationLocation 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.
template<class PBASE>
template<class CallerClass >
void GaudiCommon< PBASE >::registerCondition ( const std::string &  condition,
StatusCode(CallerClass::*)()  mf = nullptr 
)
inline

register the current instance to the UpdateManagerSvc as a consumer for a condition.

Parameters
conditionthe path inside the Transient Detector Store to the condition object.
mfoptional pointer to the member function to call when the condition object is updated. If the pointer is omitted the user must explicitly provide the class name to the method.
// ...
registerCondition("/dd/Conditions/Readout/MyDet/MyCond",&MyAlg::i_CallBack);
registerCondition<MyAlg>("/dd/Conditions/Readout/MyDet/MyOtherCond");
// ...
}

Definition at line 565 of file GaudiCommon.h.

565  {
566  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf);
567  }
IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
void registerCondition(CallerClass *instance, const std::string &condition="", typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
Register an object (algorithm instance) to the service.
template<class PBASE>
template<class CallerClass >
void GaudiCommon< PBASE >::registerCondition ( const std::string &  condition,
StatusCode(CallerClass::*)()  mf = nullptr 
)
inline

register the current instance to the UpdateManagerSvc as a consumer for a condition.

Parameters
conditionthe path inside the Transient Detector Store to the condition object.
mfoptional pointer to the member function to call when the condition object is updated. If the pointer is omitted the user must explicitly provide the class name to the method.
// ...
registerCondition("/dd/Conditions/Readout/MyDet/MyCond",&MyAlg::i_CallBack);
registerCondition<MyAlg>("/dd/Conditions/Readout/MyDet/MyOtherCond");
// ...
}

Definition at line 565 of file GaudiCommon.h.

565  {
566  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf);
567  }
IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
void registerCondition(CallerClass *instance, const std::string &condition="", typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
Register an object (algorithm instance) to the service.
template<class PBASE>
template<class CallerClass , class CondType >
void GaudiCommon< PBASE >::registerCondition ( const std::string &  condition,
CondType *&  condPtrDest,
StatusCode(CallerClass::*)()  mf = NULL 
)
inline

register the current instance to the UpdateManagerSvc as a consumer for a condition.

This version of the method allow the user to specify where to put a copy of the pointer to the condition object.

Parameters
conditionthe path inside the Transient Detector Store to the condition object.
condPtrDestpointer to fill with the location of the condition object. Note: the pointer can be safely used only in the execute method or in the member function triggered by the update.
mfoptional pointer to the member function to call when the condition object is updated. If the pointer is omitted the user must explicitly provide the class name to the method.
class MyAlg: public GaudiAlgorithm {
// ...
public:
virtual StatusCode i_CallBack();
private:
Condition *m_MyCond;
SpecialCondition *m_MyOtherCond;
// ...
};
// ...
registerCondition("/dd/Conditions/Readout/MyDet/MyCond",m_MyCond,&MyAlg::i_CallBack);
registerCondition<MyAlg>("/dd/Conditions/Readout/MyDet/MyOtherCond",m_MyOtherCond);
// ...
}

Definition at line 599 of file GaudiCommon.h.

600  {
601  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf,condPtrDest);
602  }
IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
void registerCondition(CallerClass *instance, const std::string &condition="", typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
Register an object (algorithm instance) to the service.
template<class PBASE>
template<class CallerClass , class CondType >
void GaudiCommon< PBASE >::registerCondition ( const std::string &  condition,
CondType *&  condPtrDest,
StatusCode(CallerClass::*)()  mf = NULL 
)
inline

register the current instance to the UpdateManagerSvc as a consumer for a condition.

This version of the method allow the user to specify where to put a copy of the pointer to the condition object.

Parameters
conditionthe path inside the Transient Detector Store to the condition object.
condPtrDestpointer to fill with the location of the condition object. Note: the pointer can be safely used only in the execute method or in the member function triggered by the update.
mfoptional pointer to the member function to call when the condition object is updated. If the pointer is omitted the user must explicitly provide the class name to the method.
class MyAlg: public GaudiAlgorithm {
// ...
public:
virtual StatusCode i_CallBack();
private:
Condition *m_MyCond;
SpecialCondition *m_MyOtherCond;
// ...
};
// ...
registerCondition("/dd/Conditions/Readout/MyDet/MyCond",m_MyCond,&MyAlg::i_CallBack);
registerCondition<MyAlg>("/dd/Conditions/Readout/MyDet/MyOtherCond",m_MyOtherCond);
// ...
}

Definition at line 599 of file GaudiCommon.h.

600  {
601  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf,condPtrDest);
602  }
IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
void registerCondition(CallerClass *instance, const std::string &condition="", typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
Register an object (algorithm instance) to the service.
template<class PBASE>
template<class CallerClass >
void GaudiCommon< PBASE >::registerCondition ( char *  condition,
StatusCode(CallerClass::*)()  mf = NULL 
)
inline

just to avoid conflicts with the version using a pointer to a template class.

Definition at line 605 of file GaudiCommon.h.

605  {
606  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),std::string(condition),mf);
607  }
IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
void registerCondition(CallerClass *instance, const std::string &condition="", typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
Register an object (algorithm instance) to the service.
template<class PBASE>
template<class CallerClass >
void GaudiCommon< PBASE >::registerCondition ( char *  condition,
StatusCode(CallerClass::*)()  mf = NULL 
)
inline

just to avoid conflicts with the version using a pointer to a template class.

Definition at line 605 of file GaudiCommon.h.

605  {
606  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),std::string(condition),mf);
607  }
IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
void registerCondition(CallerClass *instance, const std::string &condition="", typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
Register an object (algorithm instance) to the service.
template<class PBASE>
template<class CallerClass , class TargetClass >
void GaudiCommon< PBASE >::registerCondition ( TargetClass *  condition,
StatusCode(CallerClass::*)()  mf = NULL 
)
inline

register the current instance to the UpdateManagerSvc as a consumer for a condition.

Parameters
conditionthe path inside the Transient Detector Store to the condition object.
mfoptional pointer to the member function to call when the condition object is updated. If the pointer is omitted the user must explicitly provide the class name to the method.
// ...
registerCondition("/dd/Conditions/Readout/MyDet/MyCond",&MyAlg::i_CallBack);
registerCondition<MyAlg>("/dd/Conditions/Readout/MyDet/MyOtherCond");
// ...
}

Definition at line 624 of file GaudiCommon.h.

624  {
625  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf);
626  }
IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
void registerCondition(CallerClass *instance, const std::string &condition="", typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
Register an object (algorithm instance) to the service.
template<class PBASE>
template<class CallerClass , class TargetClass >
void GaudiCommon< PBASE >::registerCondition ( TargetClass *  condition,
StatusCode(CallerClass::*)()  mf = NULL 
)
inline

register the current instance to the UpdateManagerSvc as a consumer for a condition.

Parameters
conditionthe path inside the Transient Detector Store to the condition object.
mfoptional pointer to the member function to call when the condition object is updated. If the pointer is omitted the user must explicitly provide the class name to the method.
// ...
registerCondition("/dd/Conditions/Readout/MyDet/MyCond",&MyAlg::i_CallBack);
registerCondition<MyAlg>("/dd/Conditions/Readout/MyDet/MyOtherCond");
// ...
}

Definition at line 624 of file GaudiCommon.h.

624  {
625  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf);
626  }
IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
void registerCondition(CallerClass *instance, const std::string &condition="", typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
Register an object (algorithm instance) to the service.
template<class PBASE>
StatusCode GaudiCommon< PBASE >::release ( const IInterface interface) const

Manual forced (and 'safe') release of the active tool or service.

IMyTool* mytool = tool<IMyTool>( .... ) ;
mytool->spendCPUtime() ;
release ( mytool ) ;
IMySvc* msvc = svc<IMySvc>( .... ) ;
msvc->spendCPUtime() ;
release ( msvc ) ;
Parameters
interfaceInterface pointer to the interface to be released
Returns
StatusCode
Return values
StatusCode::SUCCESSTool or service was successfully released
StatusCode::FAILUREError releasing too or service
template<class PBASE >
StatusCode GaudiCommon< PBASE >::release ( const IInterface interface) const

Manual forced (and 'safe') release of the active tool or service.

IMyTool* mytool = tool<IMyTool>( .... ) ;
mytool->spendCPUtime() ;
release ( mytool ) ;
IMySvc* msvc = svc<IMySvc>( .... ) ;
msvc->spendCPUtime() ;
release ( msvc ) ;
Parameters
interfaceInterface pointer to the interface to be released
Returns
StatusCode
Return values
StatusCode::SUCCESSTool or service was successfully released
StatusCode::FAILUREError releasing too or service

Definition at line 348 of file GaudiCommon.icpp.

349 {
350  if ( !interface )
351  { return Error ( "release(IInterface):: IInterface* points to NULL!" ) ; }
352  // dispatch between tools and services
353  const IAlgTool* algTool = dynamic_cast<const IAlgTool*>( interface ) ;
354  // perform the actual release
355  return algTool ? releaseTool( algTool ) : releaseSvc( interface ) ;
356 }
StatusCode releaseSvc(const IInterface *svc) const
manual forced (and 'safe') release of the service
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.
StatusCode releaseTool(const IAlgTool *tool) const
manual forced (and 'safe') release of the tool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:22
template<class PBASE>
StatusCode GaudiCommon< PBASE >::releaseSvc ( const IInterface svc) const
protected

manual forced (and 'safe') release of the service

template<class PBASE >
StatusCode GaudiCommon< PBASE >::releaseSvc ( const IInterface svc) const
protected

manual forced (and 'safe') release of the service

Definition at line 398 of file GaudiCommon.icpp.

399 {
400  if( !Svc ) return Error ( "releaseSvc(IInterface):: IInterface* points to NULL!" ) ;
401  SmartIF<IService> svc{const_cast<IInterface*>(Svc)};
402  if (!svc) return Warning( "releaseSvc(IInterface):: IInterface* is not a service" );
403  auto it = std::lower_bound( std::begin(m_services), std::end(m_services), svc, GaudiCommon_details::svc_lt );
404  if (it == m_services.end() || !GaudiCommon_details::svc_eq(*it,svc)) {
405  return Warning( "releaseSvc(IInterface):: IInterface* is not active" );
406  }
407  if ( this->msgLevel(MSG::DEBUG) ) {
408  this->debug() << "Releasing service '" << (*it)->name() << "'" << endmsg;
409  }
410  m_services.erase(it);
411  return StatusCode::SUCCESS;
412 }
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
Services m_services
List of active services.
Definition: GaudiCommon.h:754
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.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
Definition of the basic interface.
Definition: IInterface.h:234
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.
constexpr const struct GaudiCommon_details::svc_eq_t svc_eq
constexpr const struct GaudiCommon_details::svc_lt_t svc_lt
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
template<class PBASE>
StatusCode GaudiCommon< PBASE >::releaseTool ( const IAlgTool tool) const
protected

manual forced (and 'safe') release of the tool

template<class PBASE >
StatusCode GaudiCommon< PBASE >::releaseTool ( const IAlgTool tool) const
protected

manual forced (and 'safe') release of the tool

Definition at line 363 of file GaudiCommon.icpp.

364 {
365  if( !algTool )
366  { return Error ( "releaseTool(IAlgTool):: IAlgTool* points to NULL!" ) ; }
367  if( !this->toolSvc() )
368  { return Error ( "releaseTool(IAlgTool):: IToolSvc* points to NULL!" ) ; }
369  // find a tool in the list of active tools
370  auto it = std::find( m_tools.rbegin() , m_tools.rend() , algTool ) ;
371  if( m_tools.rend() == it )
372  { return Warning("releaseTool(IAlgTool):: IAlgTool* is not active" ) ; }
373  // get the tool
374  IAlgTool* t = *it ;
375  // cache name
376  const std::string name = t->name();
377  if ( this->msgLevel(MSG::DEBUG) )
378  { this->debug() << "Releasing tool '" << name << "'" << endmsg; }
379  // remove the tool from the lists
380  m_tools.erase( --it.base() ) ;
381  // release tool
382  if ( this->msgLevel(MSG::DEBUG) ) {
383  this->debug() << "The tool '" << t->name() << "' of type '"
384  << System::typeinfoName(typeid(*t))
385  << "' is released" << endmsg;
386  }
387  const StatusCode sc = this->toolSvc()->releaseTool( t ) ;
388  return sc.isSuccess() ?
389  sc :
390  Warning( "releaseTool(IAlgTool):: error from IToolSvc releasing "+name , sc ) ;
391 }
AlgTools m_tools
List of active tools.
Definition: GaudiCommon.h:752
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
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:299
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.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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.
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:22
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
template<class PBASE >
void GaudiCommon< PBASE >::resetMsgStream ( ) const
inline

Definition at line 231 of file GaudiCommonImp.h.

232 {
233  m_msgStream.reset();
234 }
std::unique_ptr< MsgStream > m_msgStream
The predefined message stream.
Definition: GaudiCommon.h:750
template<class PBASE>
void GaudiCommon< PBASE >::resetMsgStream ( ) const
template<class PBASE>
const std::string& GaudiCommon< PBASE >::rootInTES ( ) const
inline

Returns the "rootInTES" string.

Used as the directory root in the TES for which all data access refers to (both saving and retrieving).

Definition at line 725 of file GaudiCommon.h.

725 { return m_rootInTES; }
std::string m_rootInTES
The rootInTES string.
Definition: GaudiCommon.h:782
template<class PBASE>
const std::string& GaudiCommon< PBASE >::rootInTES ( ) const
inline

Returns the "rootInTES" string.

Used as the directory root in the TES for which all data access refers to (both saving and retrieving).

Definition at line 725 of file GaudiCommon.h.

725 { return m_rootInTES; }
std::string m_rootInTES
The rootInTES string.
Definition: GaudiCommon.h:782
template<class PBASE>
StatusCode GaudiCommon< PBASE >::runUpdate ( )
inline

asks the UpdateManagerSvc to perform an update of the instance (if needed) without waiting the next BeginEvent incident.

It is useful if the instance can be instantiated after a BeginEvent incident, and used before the next one (for example with tools).

// ...
return runUpdate();
}

Definition at line 638 of file GaudiCommon.h.

638 { return updMgrSvc()->update(this); }
IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
StatusCode update(CallerClass *instance)
Update the given instance.
template<class PBASE>
StatusCode GaudiCommon< PBASE >::runUpdate ( )
inline

asks the UpdateManagerSvc to perform an update of the instance (if needed) without waiting the next BeginEvent incident.

It is useful if the instance can be instantiated after a BeginEvent incident, and used before the next one (for example with tools).

// ...
return runUpdate();
}

Definition at line 638 of file GaudiCommon.h.

638 { return updMgrSvc()->update(this); }
IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
StatusCode update(CallerClass *instance)
Update the given instance.
template<class PBASE>
const Services& GaudiCommon< PBASE >::services ( ) const
inline

get the list of aquired services

Definition at line 707 of file GaudiCommon.h.

707 { return m_services ; } // get all services
Services m_services
List of active services.
Definition: GaudiCommon.h:754
template<class PBASE>
const Services& GaudiCommon< PBASE >::services ( ) const
inline

get the list of aquired services

Definition at line 707 of file GaudiCommon.h.

707 { return m_services ; } // get all services
Services m_services
List of active services.
Definition: GaudiCommon.h:754
template<class PBASE>
bool GaudiCommon< PBASE >::statPrint ( ) const
inline

Print statistical counters at finalization ?

Definition at line 520 of file GaudiCommon.h.

520 { return m_statPrint ; }
bool m_statPrint
print counters at finalization ?
Definition: GaudiCommon.h:775
template<class PBASE>
bool GaudiCommon< PBASE >::statPrint ( ) const
inline

Print statistical counters at finalization ?

Definition at line 520 of file GaudiCommon.h.

520 { return m_statPrint ; }
bool m_statPrint
print counters at finalization ?
Definition: GaudiCommon.h:775
template<class PBASE>
template<class SERVICE >
SmartIF<SERVICE> GaudiCommon< PBASE >::svc ( const std::string &  name,
const bool  create = true 
) const

A useful method for the easy location of services.

IMyService* mySvc = svc<IMyService>( "MyServiceType" );
Attention
The services located with this method will be released automatically
See also
IService
ISevcLocator
Service
Exceptions
GaudiExceptionfor error in Algorithms::service
GaudiExceptionfor invalid service
Parameters
nameservice type name
createFlag for creation of non-existing services
Returns
A pointer to the service
template<class PBASE >
template<class SERVICE >
SmartIF< SERVICE > GaudiCommon< PBASE >::svc ( const std::string &  name,
const bool  create = true 
) const
inline

A useful method for the easy location of services.

IMyService* mySvc = svc<IMyService>( "MyServiceType" );
Attention
The services located with this method will be released automatically
See also
IService
ISevcLocator
Service
Exceptions
GaudiExceptionfor error in Algorithms::service
GaudiExceptionfor invalid service
Parameters
nameservice type name
createFlag for creation of non-existing services
Returns
A pointer to the service

Definition at line 178 of file GaudiCommonImp.h.

180 {
181  Assert ( this->svcLoc(), "ISvcLocator* points to NULL!" );
183  // check if we already have this service
184  auto it = std::lower_bound( std::begin(m_services), std::end(m_services), name, GaudiCommon_details::svc_lt );
185  if ( it != std::end(m_services) && GaudiCommon_details::svc_eq(*it,name) ) {
186  // Try to get the requested interface
187  s = *it;
188  // check the results
189  if ( !s ) {
190  Exception ("svc():: Could not retrieve Svc '" + name + "'", StatusCode::FAILURE);
191  }
192  } else {
193  auto baseSvc = this->svcLoc()->service(name, create);
194  // Try to get the requested interface
195  s = baseSvc;
196  // check the results
197  if ( !baseSvc || !s ) {
198  Exception ("svc():: Could not retrieve Svc '" + name + "'", StatusCode::FAILURE);
199  }
200  // add the tool into list of known tools, to be properly released
201  addToServiceList(baseSvc);
202  }
203  // return *VALID* located service
204  return s;
205 }
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
void addToServiceList(SmartIF< IService > svc) const
Add the given service to the list of acquired services.
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
Services m_services
List of active services.
Definition: GaudiCommon.h:754
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
constexpr const struct GaudiCommon_details::svc_eq_t svc_eq
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.
string s
Definition: gaudirun.py:246
constexpr const struct GaudiCommon_details::svc_lt_t svc_lt
void Exception(const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
Create and (re)-throw a given GaudiException.
template<class PBASE >
template<class TOOL >
TOOL * GaudiCommon< PBASE >::tool ( const std::string &  type,
const std::string &  name,
const IInterface parent = 0,
bool  create = true 
) const
inline

Useful method for the easy location of tools.

IMyTool* myTool =
tool<IMyTool>( "MyToolType", "MyToolName", this );
Attention
The tools located with this method will be released automatically
See also
IToolSvc
IAlgTool
Exceptions
GaudiExceptionfor invalid Tool Service
GaudiExceptionfor error from Tool Service
GaudiExceptionfor invalid tool
Parameters
typeTool type
nameTool name
parentTool parent
createFlag for creation of nonexisting tools
Returns
A pointer to the tool

Definition at line 128 of file GaudiCommonImp.h.

132 {
133  // for empty names delegate to another method
134  if ( name.empty() ) return tool<TOOL>( type , parent , create ) ;
135  Assert( this->toolSvc(), "tool():: IToolSvc* points to NULL!" ) ;
136  // get the tool from Tool Service
137  TOOL* Tool = nullptr ;
138  const StatusCode sc =
139  this->toolSvc()->retrieveTool ( type , name , Tool , parent , create ) ;
140  if ( sc.isFailure() )
141  { Exception("tool():: Could not retrieve Tool '" + type + "'/'" + name + "'", sc ) ; }
142  if ( !Tool )
143  { Exception("tool():: Could not retrieve Tool '" + type + "'/'" + name + "'" ) ; }
144  // add the tool into list of known tools to be properly released
145  addToToolList( Tool );
146  // return *VALID* located tool
147  return Tool ;
148 }
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
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.
void addToToolList(IAlgTool *tool) const
Add the given tool to the list of acquired tools.
string type
Definition: gaudirun.py:151
void Exception(const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
Create and (re)-throw a given GaudiException.
template<class PBASE>
template<class TOOL >
TOOL* GaudiCommon< PBASE >::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.

IMyTool* myTool =
tool<IMyTool>( "MyToolType", "MyToolName", this );
Attention
The tools located with this method will be released automatically
See also
IToolSvc
IAlgTool
Exceptions
GaudiExceptionfor invalid Tool Service
GaudiExceptionfor error from Tool Service
GaudiExceptionfor invalid tool
Parameters
typeTool type
nameTool name
parentTool parent
createFlag for creation of nonexisting tools
Returns
A pointer to the tool
template<class PBASE >
template<class TOOL >
TOOL * GaudiCommon< PBASE >::tool ( const std::string &  type,
const IInterface parent = 0,
bool  create = true 
) const
inline

A useful method for the easy location of tools.

IMyTool* myTool = tool<IMyTool>( "PublicToolType" );
Attention
The tools located with this method will be released automatically
See also
IToolSvc
IAlgTool
Exceptions
GaudiExceptionfor invalid Tool Service
GaudiExceptionfor error from Tool Service
GaudiExceptionfor invalid tool
Parameters
typeTool type, could be of "Type/Name" format
parentTool parent
createFlag for creation of non-existing tools
Returns
A pointer to the tool

Definition at line 154 of file GaudiCommonImp.h.

157 {
158  // check the environment
159  Assert ( PBASE::toolSvc(), "IToolSvc* points to NULL!" );
160  // retrieve the tool from Tool Service
161  TOOL* Tool = nullptr ;
162  const StatusCode sc =
163  this->toolSvc() -> retrieveTool ( type, Tool, parent , create );
164  if ( sc.isFailure() )
165  { Exception("tool():: Could not retrieve Tool '" + type + "'", sc ) ; }
166  if ( !Tool )
167  { Exception("tool():: Could not retrieve Tool '" + type + "'" ) ; }
168  // add the tool into the list of known tools to be properly released
169  addToToolList( Tool );
170  // return *VALID* located tool
171  return Tool ;
172 }
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
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.
void addToToolList(IAlgTool *tool) const
Add the given tool to the list of acquired tools.
string type
Definition: gaudirun.py:151
void Exception(const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
Create and (re)-throw a given GaudiException.
template<class PBASE>
template<class TOOL >
TOOL* GaudiCommon< PBASE >::tool ( const std::string &  type,
const IInterface parent = 0,
bool  create = true 
) const

A useful method for the easy location of tools.

IMyTool* myTool = tool<IMyTool>( "PublicToolType" );
Attention
The tools located with this method will be released automatically
See also
IToolSvc
IAlgTool
Exceptions
GaudiExceptionfor invalid Tool Service
GaudiExceptionfor error from Tool Service
GaudiExceptionfor invalid tool
Parameters
typeTool type, could be of "Type/Name" format
parentTool parent
createFlag for creation of non-existing tools
Returns
A pointer to the tool
template<class PBASE>
const AlgTools& GaudiCommon< PBASE >::tools ( ) const
inline

get the list of aquired tools

Definition at line 705 of file GaudiCommon.h.

705 { return m_tools ; } // get all tools
AlgTools m_tools
List of active tools.
Definition: GaudiCommon.h:752
template<class PBASE>
const AlgTools& GaudiCommon< PBASE >::tools ( ) const
inline

get the list of aquired tools

Definition at line 705 of file GaudiCommon.h.

705 { return m_tools ; } // get all tools
AlgTools m_tools
List of active tools.
Definition: GaudiCommon.h:752
template<class PBASE>
bool GaudiCommon< PBASE >::typePrint ( ) const
inline

Insert the actual C++ type of the algorithm/tool in the messages ?

Definition at line 516 of file GaudiCommon.h.

516 { return m_typePrint ; }
bool m_typePrint
insert the actual C++ type of the algorithm in the messages?
Definition: GaudiCommon.h:771
template<class PBASE>
bool GaudiCommon< PBASE >::typePrint ( ) const
inline

Insert the actual C++ type of the algorithm/tool in the messages ?

Definition at line 516 of file GaudiCommon.h.

516 { return m_typePrint ; }
bool m_typePrint
insert the actual C++ type of the algorithm in the messages?
Definition: GaudiCommon.h:771
template<class PBASE >
IUpdateManagerSvc * GaudiCommon< PBASE >::updMgrSvc ( ) const
inline

Short-cut to locate the Update Manager Service.

Definition at line 211 of file GaudiCommonImp.h.

212 {
213  if ( !m_updMgrSvc )
214  { m_updMgrSvc = svc<IUpdateManagerSvc>("UpdateManagerSvc",true); }
215  return m_updMgrSvc ;
216 }
IUpdateManagerSvc * m_updMgrSvc
Pointer to the Update Manager Service instance.
Definition: GaudiCommon.h:768
template<class PBASE>
IUpdateManagerSvc* GaudiCommon< PBASE >::updMgrSvc ( ) const
inline

Short-cut to locate the Update Manager Service.

template<class PBASE >
StatusCode GaudiCommon< PBASE >::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.

Also performs statistical analysis of the warning messages and suppression after the defined number of error instances.

if( a < 0 ) { return Warning("a is negative!") ;}
if( b < 0 ) { return Warning("b is illegal!" , StatusCode(25) );
if( c < 0 )
{ return Warning("c is negative" , StatusCode(35) , 50 );
See also
MsgStream
IMessageSvc
StatusCode
Parameters
msgWarning message
stStatusCode to return
mxMaximum number of printouts for this message
Returns
The given StatusCode

Definition at line 479 of file GaudiCommon.icpp.

482 {
483  // increase local counter of warnings
484  const size_t num = ++m_warnings[msg] ;
485  // If suppressed, just return
486  if ( num > mx ) { return st ; }
487  else if ( UNLIKELY(num == mx) ) // issue one-time suppression message
488  { return Print ( "The WARNING message is suppressed : '" +
489  msg + "'" , st , MSG::WARNING ) ; }
490  // return message
491  return Print ( msg , st , MSG::WARNING ) ;
492 }
Counter m_warnings
counter of warnings
Definition: GaudiCommon.h:759
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
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.
#define UNLIKELY(x)
Definition: Kernel.h:126
template<class PBASE>
StatusCode GaudiCommon< PBASE >::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.

Also performs statistical analysis of the warning messages and suppression after the defined number of error instances.

if( a < 0 ) { return Warning("a is negative!") ;}
if( b < 0 ) { return Warning("b is illegal!" , StatusCode(25) );
if( c < 0 )
{ return Warning("c is negative" , StatusCode(35) , 50 );
See also
MsgStream
IMessageSvc
StatusCode
Parameters
msgWarning message
stStatusCode to return
mxMaximum number of printouts for this message
Returns
The given StatusCode

Member Data Documentation

template<class PBASE>
static const bool GaudiCommon< PBASE >::IgnoreRootInTES = false
staticprotected

Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods.

If used with cause the RootInTES option to be IGNORED.

Useful to aid with code readability. e.g.

// Get data, ignoring the setting of rootInTES()
MyData * data = get<MyData>( "/Event/MyData", IgnoreRootInTES );

Definition at line 85 of file GaudiCommon.h.

template<class PBASE>
std::string GaudiCommon< PBASE >::m_context
private

The context string.

Definition at line 780 of file GaudiCommon.h.

template<class PBASE>
std::vector< std::string > GaudiCommon< PBASE >::m_counterList = std::vector<std::string>(1,".*")
protected

list of counters to declare. Set by property CounterList. This can be a regular expression.

Definition at line 115 of file GaudiCommon.h.

template<class PBASE>
Statistics GaudiCommon< PBASE >::m_counters
mutableprivate

General counters.

Definition at line 765 of file GaudiCommon.h.

template<class PBASE>
SmartIF< ICounterSummarySvc > GaudiCommon< PBASE >::m_counterSummarySvc
protected

a pointer to the CounterSummarySvc

Definition at line 113 of file GaudiCommon.h.

template<class PBASE>
Counter GaudiCommon< PBASE >::m_errors
mutableprivate

Counter of errors.

Definition at line 757 of file GaudiCommon.h.

template<class PBASE>
bool GaudiCommon< PBASE >::m_errorsPrint = true
private

print warning and error counters at finalization ?

Definition at line 777 of file GaudiCommon.h.

template<class PBASE>
Counter GaudiCommon< PBASE >::m_exceptions
mutableprivate

Counter of exceptions.

Definition at line 763 of file GaudiCommon.h.

template<class PBASE>
std::string GaudiCommon< PBASE >::m_format1
private

format for regular statistical printout rows

Definition at line 793 of file GaudiCommon.h.

template<class PBASE>
std::string GaudiCommon< PBASE >::m_format2
private

format for "efficiency" statistical printout rows

Definition at line 795 of file GaudiCommon.h.

template<class PBASE>
double GaudiCommon< PBASE >::m_globalTimeOffset = 0
private

The globalTimeOffset value.

Definition at line 788 of file GaudiCommon.h.

template<class PBASE>
std::string GaudiCommon< PBASE >::m_header
private

the header row

Definition at line 791 of file GaudiCommon.h.

template<class PBASE>
Counter GaudiCommon< PBASE >::m_infos
mutableprivate

counter of infos

Definition at line 761 of file GaudiCommon.h.

template<class PBASE>
MSG::Level GaudiCommon< PBASE >::m_msgLevel = MSG::NIL
private

The message level.

Definition at line 747 of file GaudiCommon.h.

template<class PBASE>
std::unique_ptr< MsgStream > GaudiCommon< PBASE >::m_msgStream
mutableprivate

The predefined message stream.

Definition at line 750 of file GaudiCommon.h.

template<class PBASE>
bool GaudiCommon< PBASE >::m_propsPrint = false
private

print properties at initialization?

Definition at line 773 of file GaudiCommon.h.

template<class PBASE>
std::string GaudiCommon< PBASE >::m_rootInTES
private

The rootInTES string.

Definition at line 782 of file GaudiCommon.h.

template<class PBASE>
std::string GaudiCommon< PBASE >::m_rootOnTES
private

The rootOnTES string.

Note, this job option is OBSOLETE, but retained temporarily to allow easy migration. Please update your code to use RootInTES instead. This option will be removed at some point.

Definition at line 786 of file GaudiCommon.h.

template<class PBASE>
Services GaudiCommon< PBASE >::m_services
mutableprivate

List of active services.

Definition at line 754 of file GaudiCommon.h.

template<class PBASE>
std::vector< std::string > GaudiCommon< PBASE >::m_statEntityList = std::vector<std::string>(0)
protected

Definition at line 117 of file GaudiCommon.h.

template<class PBASE>
bool GaudiCommon< PBASE >::m_statPrint = true
private

print counters at finalization ?

Definition at line 775 of file GaudiCommon.h.

template<class PBASE>
AlgTools GaudiCommon< PBASE >::m_tools
mutableprivate

List of active tools.

Definition at line 752 of file GaudiCommon.h.

template<class PBASE>
bool GaudiCommon< PBASE >::m_typePrint = true
private

insert the actual C++ type of the algorithm in the messages?

Definition at line 771 of file GaudiCommon.h.

template<class PBASE>
IUpdateManagerSvc * GaudiCommon< PBASE >::m_updMgrSvc = nullptr
mutableprivate

Pointer to the Update Manager Service instance.

Definition at line 768 of file GaudiCommon.h.

template<class PBASE>
bool GaudiCommon< PBASE >::m_useEffFormat
private

flag to use the special "efficiency" format

Definition at line 797 of file GaudiCommon.h.

template<class PBASE>
Counter GaudiCommon< PBASE >::m_warnings
mutableprivate

counter of warnings

Definition at line 759 of file GaudiCommon.h.

template<class PBASE>
static const bool GaudiCommon< PBASE >::UseRootInTES = true
staticprotected

Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods.

If used with cause the RootInTES option to be USED

Useful to aid with code readability. e.g.

// Get data, using the setting of rootInTES()
MyData * data = get<MyData>( "/Event/MyData", UseRootInTES );
// note the default setting is true, so this is equivalent to
MyData * data = get<MyData>( "/Event/MyData" );

Definition at line 97 of file GaudiCommon.h.


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