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

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

storage for active tools

Definition at line 107 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 105 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 105 of file GaudiCommon.h.

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

storage for active services

Definition at line 109 of file GaudiCommon.h.

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

storage for active services

Definition at line 109 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 103 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 103 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 439 of file GaudiCommon.icpp.

440 {
441  if (svc) {
442  auto i = std::lower_bound( std::begin(m_services), std::end(m_services), svc, GaudiCommon_details::svc_lt );
443  if ( i == std::end(m_services) || !GaudiCommon_details::svc_eq(*i,svc) ) {
444  m_services.insert( i, std::move(svc) );
445  } else {
446  this->warning() << "Service " << svc->name() << " already present -- skipping" << endmsg;
447  }
448  }
449 }
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:752
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 >::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 222 of file GaudiCommonImp.h.

225 {
226  if (!ok) Exception( msg , sc );
227 }
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 240 of file GaudiCommonImp.h.

243 {
244  if (!ok) Exception( msg , sc );
245 }
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:778
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:778
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 512 of file GaudiCommon.h.

512 { return m_counters[tag] ; }
Statistics m_counters
General counters.
Definition: GaudiCommon.h:763
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 512 of file GaudiCommon.h.

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

accessor to all counters

Definition at line 493 of file GaudiCommon.h.

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

accessor to all counters

Definition at line 493 of file GaudiCommon.h.

493 { return m_counters ; }
Statistics m_counters
General counters.
Definition: GaudiCommon.h:763
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 460 of file GaudiCommon.icpp.

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

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

Print error counters at finalization ?

Definition at line 523 of file GaudiCommon.h.

523 { return m_errorsPrint ; }
bool m_errorsPrint
print warning and error counters at finalization ?
Definition: GaudiCommon.h:775
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 555 of file GaudiCommon.icpp.

558 {
559  // increase local counter of exceptions
560  ++m_exceptions[ msg ];
561  Print ( "Exception (re)throw: " + msg , sc , MSG::FATAL ).ignore();
562  throw GaudiException( this->name() + ":: " + msg , this->name() , sc, exc);
563 }
Define general base for Gaudi exception.
Counter m_exceptions
Counter of exceptions.
Definition: GaudiCommon.h:761
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 570 of file GaudiCommon.icpp.

573 {
574  // increase local counter of exceptions
575  ++m_exceptions[ msg ];
576  Print ( "Exception (re)throw: " + msg , sc , MSG::FATAL ).ignore();
577  throw GaudiException( this->name() + ":: " + msg+"("+exc.what()+")", "", sc );
578 }
Define general base for Gaudi exception.
Counter m_exceptions
Counter of exceptions.
Definition: GaudiCommon.h:761
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 585 of file GaudiCommon.icpp.

587 {
588  // increase local counter of exceptions
589  ++m_exceptions[ msg ];
590  Print ( "Exception throw: " + msg , sc , MSG::FATAL ).ignore();
591  throw GaudiException( this->name() + ":: " + msg , "", sc );
592 }
Define general base for Gaudi exception.
Counter m_exceptions
Counter of exceptions.
Definition: GaudiCommon.h:761
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 92 of file GaudiCommonImp.h.

95 {
96  // check the environment
97  Assert( service , "exist():: IDataProvider* points to NULL!" ) ;
98  // check the data object
100  return checker ( service,
101  fullTESLocation ( location , useRootInTES ) ) ;
102 }
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 280 of file GaudiCommon.icpp.

281 {
283 
284  // print the general information about statistical counters
285  if ( this->msgLevel(MSG::DEBUG) || (statPrint() && !counters().empty()) )
286  {
287  // print general statistical counters
289  }
290  //add all counters to the CounterSummarySvc
291  if(m_counterSummarySvc && this->svcLoc()->existsService("CounterSummarySvc"))
292  {
293  if ( this->msgLevel(MSG::DEBUG) ) this->debug() << "adding counters to CounterSummarySvc" << endmsg;
294 
297 
298  for( const auto& i : this->counters() )
299  {
300  if (statList.Or(i.first) )
301  m_counterSummarySvc->addCounter(this->name(),i.first,i.second,
303  else if (counterList.Or(i.first))
304  m_counterSummarySvc->addCounter(this->name(),i.first,i.second);
305  }
306  }
307  // release all located tools and services
308  if ( this->msgLevel(MSG::DEBUG) )
309  {
310  this->debug() << "Tools to release :";
311  for ( const auto& i : PBASE::tools() )
312  {
313  this->debug() << " " << i->name();
314  }
315  this->debug() << endmsg;
316  }
317  while ( !PBASE::tools().empty() ) { sc = releaseTool( PBASE::tools().back() ) && sc; }
318 
319  // release all located services
320  if ( this->msgLevel(MSG::DEBUG) )
321  {
322  this->debug() << "Services to release :";
323  for ( const auto& i : m_services ) this->debug() << " " << i->name();
324  this->debug() << endmsg;
325  }
326  while ( !m_services.empty() ) { sc = releaseSvc( m_services.front() ) && sc; }
327 
328  //release the CounterSummarySvc manually
330 
331  // format printout
332  if ( !m_errors.empty() || !m_warnings.empty() || !m_exceptions.empty() )
333  {
334  this->always() << "Exceptions/Errors/Warnings/Infos Statistics : "
335  << m_exceptions .size () << "/"
336  << m_errors .size () << "/"
337  << m_warnings .size () << "/"
338  << m_infos .size () << endmsg ;
339  if ( errorsPrint() ) { printErrors () ; }
340  }
341 
342  // delete the MsgStream
343  resetMsgStream();
344 
345  // clear *ALL* counters explicitly
346  m_counters .clear() ;
347  m_exceptions .clear() ;
348  m_infos .clear() ;
349  m_warnings .clear() ;
350  m_errors .clear() ;
351  m_counterList.clear() ;
352  m_statEntityList.clear() ;
353 
354  // finalize base class
355  return sc && PBASE::finalize();
356 }
Counter m_warnings
counter of warnings
Definition: GaudiCommon.h:757
Counter m_exceptions
Counter of exceptions.
Definition: GaudiCommon.h:761
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:116
Services m_services
List of active services.
Definition: GaudiCommon.h:752
void resetMsgStream() const
SmartIF< ICounterSummarySvc > m_counterSummarySvc
a pointer to the CounterSummarySvc
Definition: GaudiCommon.h:114
Statistics m_counters
General counters.
Definition: GaudiCommon.h:763
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
const Statistics & counters() const
accessor to all counters
Definition: GaudiCommon.h:493
bool statPrint() const
Print statistical counters at finalization ?
Definition: GaudiCommon.h:521
Counter m_errors
Counter of errors.
Definition: GaudiCommon.h:755
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:759
bool errorsPrint() const
Print error counters at finalization ?
Definition: GaudiCommon.h:523
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:118
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
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  : location[0] == '/' ?
47  rootInTES() + location.substr(1)
48  : rootInTES() + location );
49 }
const std::string & rootInTES() const
Returns the "rootInTES" string.
Definition: GaudiCommon.h:725
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>
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 56 of file GaudiCommonImp.h.

59 {
60  // check the environment
61  Assert( service , "get():: IDataProvider* points to NULL!" ) ;
62  // get the helper object:
64  return getter ( *this ,
65  service ,
66  fullTESLocation ( location , useRootInTES ) ) ;
67 }
Helper structure for implementation of "get"-functions for GaudiCommon
Definition: GaudiCommon.h:37
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 56 of file GaudiCommonImp.h.

59 {
60  // check the environment
61  Assert( service , "get():: IDataProvider* points to NULL!" ) ;
62  // get the helper object:
64  return getter ( *this ,
65  service ,
66  fullTESLocation ( location , useRootInTES ) ) ;
67 }
Helper structure for implementation of "get"-functions for GaudiCommon
Definition: GaudiCommon.h:37
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 74 of file GaudiCommonImp.h.

77 {
78  // check the environment
79  Assert( service , "get():: IDataProvider* points to NULL!" ) ;
80  // get the helper object:
82  return getter ( *this ,
83  service ,
84  fullTESLocation ( location , useRootInTES ),
85  false) ;
86 }
Helper structure for implementation of "get"-functions for GaudiCommon
Definition: GaudiCommon.h:37
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 74 of file GaudiCommonImp.h.

77 {
78  // check the environment
79  Assert( service , "get():: IDataProvider* points to NULL!" ) ;
80  // get the helper object:
82  return getter ( *this ,
83  service ,
84  fullTESLocation ( location , useRootInTES ),
85  false) ;
86 }
Helper structure for implementation of "get"-functions for GaudiCommon
Definition: GaudiCommon.h:37
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 111 of file GaudiCommonImp.h.

114 {
115  // check the environment
116  Assert ( service , "getOrCreate():: svc points to NULL!" ) ;
117  // get the helper object
119  return getter ( *this ,
120  service ,
121  fullTESLocation( location, useRootInTES ) ,
122  location ) ;
123 }
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 111 of file GaudiCommonImp.h.

114 {
115  // check the environment
116  Assert ( service , "getOrCreate():: svc points to NULL!" ) ;
117  // get the helper object
119  return getter ( *this ,
120  service ,
121  fullTESLocation( location, useRootInTES ) ,
122  location ) ;
123 }
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:782
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:782
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 502 of file GaudiCommon.icpp.

505 {
506  // increase local counter of warnings
507  const size_t num = ++m_infos[msg] ;
508  // If suppressed, just return
509  if ( num > mx ) { return st ; }
510  else if ( UNLIKELY(num == mx) ) // issue one-time suppression message
511  { return Print ( "The INFO message is suppressed : '" +
512  msg + "'" , st , MSG::INFO ) ; }
513  // return message
514  return Print ( msg , st , MSG::INFO ) ;
515 }
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Counter m_infos
counter of infos
Definition: GaudiCommon.h:759
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 >::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>
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 64 of file GaudiCommon.icpp.

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

196 {
197 
198  // initialize base class
199  const StatusCode sc = PBASE::initialize();
200  if ( sc.isFailure() )
201  { return Error ( "Failed to initialise base class PBASE", sc ) ; }
202 
203 
204  // some debug printout
205  if ( this->msgLevel(MSG::DEBUG) )
206  {
207  this->debug() << "Initialize base class GaudiCommon<" << System::typeinfoName(typeid(PBASE)) << ">" << endmsg;
208  if ( !context().empty() )
209  this->debug() << "Created with context = '" << context() << "'" << endmsg;
210  }
211 
212  // Check rootInTES ends with a /
213  if ( !m_rootInTES.empty() &&
214  m_rootInTES.substr(m_rootInTES.size()-1) != "/" ) m_rootInTES += "/";
215 
216  //Set up the CounterSummarySvc May need to be changed
217  m_counterSummarySvc = this->svcLoc()->service("CounterSummarySvc",false);
218  if (this->msgLevel(MSG::DEBUG))
219  {
220  if (!m_counterSummarySvc)
221  this->debug() << "could not locate CounterSummarySvc, no counter summary will be made" << endmsg;
222  else this->debug() << "found CounterSummarySvc OK" << endmsg;
223  }
224 
225  // properties will be printed if asked for or in "MSG::DEBUG" mode
226  if ( propsPrint() ) { printProps(MSG::ALWAYS); }
227  else if ( this->msgLevel(MSG::DEBUG) ) { printProps(MSG::DEBUG); }
228 
229  //update DataHandles to point to full TES location
230 
231  //get root of DataManager
232  SmartIF<IDataManagerSvc> dataMgrSvc(PBASE::evtSvc());
233  std::string rootName(dataMgrSvc->rootName());
234  if ("" != rootName && '/' != rootName[rootName.size() - 1]) {
235  rootName = rootName + "/";
236  }
237 
238  auto fixLocation = [&] (const std::string & location) -> std::string {
239  std::string result = fullTESLocation(location, UseRootInTES);
240  //check whether we have an absolute path if yes return it - else prepend DataManager Root
241  result = (result[0] == '/' ? result : rootName + result);
242 
243  this->debug() << "Changing " << location << " to " << result << endmsg;
244 
245  return result;
246  };
247 
248  for(auto tag : PBASE::inputDataObjects()){
249  if(PBASE::inputDataObjects()[tag].isValid()){
250  PBASE::inputDataObjects()[tag].setDataProductName(
251  fixLocation(PBASE::inputDataObjects()[tag].dataProductName())).ignore();
252 
253  auto altAddress = PBASE::inputDataObjects()[tag].alternativeDataProductNames();
254  for(uint i = 0; i < altAddress.size(); ++i)
255  altAddress[i] = fixLocation(altAddress[i]);
256  PBASE::inputDataObjects()[tag].setAlternativeDataProductNames(altAddress).ignore();
257  }
258  }
259  for(auto tag : PBASE::outputDataObjects()){
260  if(PBASE::outputDataObjects()[tag].isValid()){
261  PBASE::outputDataObjects()[tag].setDataProductName(
262  fixLocation(PBASE::outputDataObjects()[tag].dataProductName())).ignore();
263  }
264  }
265 
266  return sc;
267 }
def initialize()
Definition: AnalysisTest.py:12
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:297
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:114
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:780
bool propsPrint() const
Print properties at initialization ?
Definition: GaudiCommon.h:519
const std::string fullTESLocation(const std::string &location, const bool useRootInTES) const
Returns the full correct event location given the rootInTes settings.
list i
Definition: ana.py:128
long printProps(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of properties
static const bool UseRootInTES
Simple definition to be used with the new useRootInTES argument get and put methods...
Definition: GaudiCommon.h:98
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 683 of file GaudiCommon.icpp.

684 {
685  // Force a new MsgStream object, to pick up the new settings
686  resetMsgStream();
687 
688  // adjust internal message level
689  m_msgLevel =
690  this->outputLevel() < (int) MSG::NIL ? MSG::NIL :
691  this->outputLevel() >= (int) MSG::NUM_LEVELS ? MSG::ALWAYS :
692  MSG::Level( this->outputLevel() ) ;
693 
694  // Keep MessageSvc up to date if needed
695  if ( this->msgSvc()->outputLevel(this->name()) != this->outputLevel() )
696  {
697  this->msgSvc()->setOutputLevel( this->name(), this->outputLevel() );
698  }
699 
700  // printout message
701  if ( this->msgLevel(MSG::DEBUG) )
702  {
703  this->debug() << "Property update for "
704  << theProp.name() << " : new value = " << this->outputLevel() << endmsg;
705  }
706 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
const std::string & name() const
property name
Definition: Property.h:45
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:745
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

Definition at line 522 of file GaudiCommon.icpp.

525 {
526  // perform printout ?
527  if ( !this->msgLevel( lvl ) ) { return st ; } // RETURN
528 
529  // use the predefined stream
530  MsgStream& str = this->msgStream( lvl ) ;
531  if ( typePrint() ) { str << System::typeinfoName(typeid(*this)) << ":: " ; }
532 
533  // print the message
534  str << msg ;
535 
536  // test status code
537  if ( st.isSuccess() ) { }
538  else if ( StatusCode::FAILURE != st.getCode() )
539  { str << " StatusCode=" << st.getCode() ; }
540  else
541  { str << " StatusCode=FAILURE" ; }
542 
543  // perform print operation
544  str << endmsg ;
545 
546  // return
547  return st;
548 }
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
unsigned long getCode() const
Get the status code by value.
Definition: StatusCode.h:93
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
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:517
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
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 >
void GaudiCommon< PBASE >::printErrorHandler ( Property )
private

handler for "ErrorPrint" property

Definition at line 750 of file GaudiCommon.icpp.

751 {
752  // no action if not yet initialized
753  if ( this -> FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; }
754  if ( this -> errorsPrint() ) { this -> printErrors () ; }
755 }
bool errorsPrint() const
Print error counters at finalization ?
Definition: GaudiCommon.h:523
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 629 of file GaudiCommon.icpp.

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

663 {
664 
665  // print ALL properties
666  MsgStream& msg = this->msgStream ( level );
667  const auto& properties = this->getProperties() ;
668  msg << "List of ALL properties of "
669  << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
670  << " #properties = " << properties.size() << endmsg ;
671  for ( const auto& property : reverse(properties) )
672  {
673  msg << "Property ['Name': Value] = " << *property << endmsg ;
674  }
675  return properties.size() ;
676 }
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:297
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

template<class PBASE >
void GaudiCommon< PBASE >::printPropsHandler ( Property )
private

handler for "PropertiesPrint" property

Definition at line 760 of file GaudiCommon.icpp.

761 {
762  // no action if not yet initialized
763  if ( this -> FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; }
764  if ( this -> propsPrint() ) { this -> printProps ( MSG::ALWAYS ) ; }
765 }
bool propsPrint() const
Print properties at initialization ?
Definition: GaudiCommon.h:519
long printProps(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of properties
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 >
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 599 of file GaudiCommon.icpp.

600 {
601  // print statistics
602  if ( counters().empty() ) { return 0 ; }
603  MsgStream& msg = this->msgStream ( level ) ;
604  //
605  msg << "Number of counters : " << counters().size() ;
606  //
607  if ( !counters().empty() ) { msg << std::endl << m_header ; }
608  //
609  for ( const auto& entry : counters() )
610  {
611  msg << std::endl
613  ( entry.first ,
614  entry.second ,
616  m_format1 , m_format2 );
617  }
618  //
619  msg << endmsg ;
620  //
621  return counters().size() ;
622 }
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:493
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
bool m_useEffFormat
flag to use the special "efficiency" format
Definition: GaudiCommon.h:791
MsgStream & msgStream() const
Return an uninitialized MsgStream.
std::string m_format1
format for regular statistical printout rows
Definition: GaudiCommon.h:787
std::string m_header
the header row
Definition: GaudiCommon.h:785
std::string m_format2
format for "efficiency" statistical printout rows
Definition: GaudiCommon.h:789
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 >
void GaudiCommon< PBASE >::printStatHandler ( Property )
private

handler for "StatPrint" property

Definition at line 770 of file GaudiCommon.icpp.

771 {
772  // no action if not yet initialized
773  if ( this -> FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; }
774  if ( this -> statPrint() ) { this -> printStat ( MSG::ALWAYS ) ; }
775 }
bool statPrint() const
Print statistical counters at finalization ?
Definition: GaudiCommon.h:521
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 519 of file GaudiCommon.h.

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

Print properties at initialization ?

Definition at line 519 of file GaudiCommon.h.

519 { return m_propsPrint ; }
bool m_propsPrint
print properties at initialization?
Definition: GaudiCommon.h:771
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 717 of file GaudiCommon.icpp.

721 {
722  // check arguments
723  Assert ( svc , "put():: Invalid 'service'!" ) ;
724  Assert ( object , "put():: Invalid 'Object'!" ) ;
725  Assert ( !location.empty() , "put():: Invalid 'address' = '' " ) ;
726  // final data location
727  const std::string & fullLocation = fullTESLocation( location, useRootInTES );
728  // register the object!
729  const StatusCode status = '/' == fullLocation[0] ?
730  svc -> registerObject( fullLocation , object ) :
731  svc -> registerObject( "/Event/" + fullLocation , object ) ;
732  // check the result!
733  if ( status.isFailure() )
734  { Exception ( "put():: could not register '" +
735  System::typeinfoName( typeid( *object ) ) +
736  "' at address '" + fullLocation + "'" , status ) ; }
737  if ( this->msgLevel( MSG::DEBUG ) )
738  { Print( "The object of type '" +
739  System::typeinfoName( typeid( *object ) ) +
740  "' is registered in TS at address '"
741  + fullLocation + "'" , status , MSG::DEBUG ).ignore() ; }
742  return object;
743 }
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
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 566 of file GaudiCommon.h.

566  {
567  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf);
568  }
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 566 of file GaudiCommon.h.

566  {
567  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf);
568  }
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 600 of file GaudiCommon.h.

601  {
602  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf,condPtrDest);
603  }
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 600 of file GaudiCommon.h.

601  {
602  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf,condPtrDest);
603  }
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 606 of file GaudiCommon.h.

606  {
607  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),std::string(condition),mf);
608  }
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 606 of file GaudiCommon.h.

606  {
607  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),std::string(condition),mf);
608  }
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 625 of file GaudiCommon.h.

625  {
626  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf);
627  }
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 625 of file GaudiCommon.h.

625  {
626  updMgrSvc()->registerCondition(dynamic_cast<CallerClass*>(this),condition,mf);
627  }
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 367 of file GaudiCommon.icpp.

368 {
369  if ( !interface )
370  { return Error ( "release(IInterface):: IInterface* points to NULL!" ) ; }
371  // dispatch between tools and services
372  const IAlgTool* algTool = dynamic_cast<const IAlgTool*>( interface ) ;
373  // perform the actual release
374  return algTool ? releaseTool( algTool ) : releaseSvc( interface ) ;
375 }
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:23
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 417 of file GaudiCommon.icpp.

418 {
419  if( !Svc ) return Error ( "releaseSvc(IInterface):: IInterface* points to NULL!" ) ;
420  SmartIF<IService> svc{const_cast<IInterface*>(Svc)};
421  if (!svc) return Warning( "releaseSvc(IInterface):: IInterface* is not a service" );
422  auto it = std::lower_bound( std::begin(m_services), std::end(m_services), svc, GaudiCommon_details::svc_lt );
423  if (it == m_services.end() || !GaudiCommon_details::svc_eq(*it,svc)) {
424  return Warning( "releaseSvc(IInterface):: IInterface* is not active" );
425  }
426  if ( this->msgLevel(MSG::DEBUG) ) {
427  this->debug() << "Releasing service '" << (*it)->name() << "'" << endmsg;
428  }
429  m_services.erase(it);
430  return StatusCode::SUCCESS;
431 }
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:752
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 382 of file GaudiCommon.icpp.

383 {
384  if( !algTool )
385  { return Error ( "releaseTool(IAlgTool):: IAlgTool* points to NULL!" ) ; }
386  if( !this->toolSvc() )
387  { return Error ( "releaseTool(IAlgTool):: IToolSvc* points to NULL!" ) ; }
388  // find a tool in the list of active tools
389  auto it = std::find( PBASE::tools().rbegin() , PBASE::tools().rend() , algTool ) ;
390  if( PBASE::tools().rend() == it )
391  { return Warning("releaseTool(IAlgTool):: IAlgTool* is not active" ) ; }
392  // get the tool
393  IAlgTool* t = *it ;
394  // cache name
395  const std::string name = t->name();
396  if ( this->msgLevel(MSG::DEBUG) )
397  { this->debug() << "Releasing tool '" << name << "'" << endmsg; }
398  // remove the tool from the lists
399  PBASE::deregisterTool(t);
400  // release tool
401  if ( this->msgLevel(MSG::DEBUG) ) {
402  this->debug() << "The tool '" << t->name() << "' of type '"
403  << System::typeinfoName(typeid(*t))
404  << "' is released" << endmsg;
405  }
406  const StatusCode sc = this->toolSvc()->releaseTool( t ) ;
407  return sc.isSuccess() ?
408  sc :
409  Warning( "releaseTool(IAlgTool):: error from IToolSvc releasing "+name , sc ) ;
410 }
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:297
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:23
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
template<class PBASE >
void GaudiCommon< PBASE >::resetMsgStream ( ) const
inline

Definition at line 232 of file GaudiCommonImp.h.

233 {
234  m_msgStream.reset();
235 }
std::unique_ptr< MsgStream > m_msgStream
The predefined message stream.
Definition: GaudiCommon.h:748
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:780
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:780
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 639 of file GaudiCommon.h.

639 { 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 639 of file GaudiCommon.h.

639 { 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:752
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:752
template<class PBASE>
bool GaudiCommon< PBASE >::statPrint ( ) const
inline

Print statistical counters at finalization ?

Definition at line 521 of file GaudiCommon.h.

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

Print statistical counters at finalization ?

Definition at line 521 of file GaudiCommon.h.

521 { return m_statPrint ; }
bool m_statPrint
print counters at finalization ?
Definition: GaudiCommon.h:773
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 179 of file GaudiCommonImp.h.

181 {
182  Assert ( this->svcLoc(), "ISvcLocator* points to NULL!" );
184  // check if we already have this service
185  auto it = std::lower_bound( std::begin(m_services), std::end(m_services), name, GaudiCommon_details::svc_lt );
186  if ( it != std::end(m_services) && GaudiCommon_details::svc_eq(*it,name) ) {
187  // Try to get the requested interface
188  s = *it;
189  // check the results
190  if ( !s ) {
191  Exception ("svc():: Could not retrieve Svc '" + name + "'", StatusCode::FAILURE);
192  }
193  } else {
194  auto baseSvc = this->svcLoc()->service(name, create);
195  // Try to get the requested interface
196  s = baseSvc;
197  // check the results
198  if ( !baseSvc || !s ) {
199  Exception ("svc():: Could not retrieve Svc '" + name + "'", StatusCode::FAILURE);
200  }
201  // add the tool into list of known tools, to be properly released
202  addToServiceList(baseSvc);
203  }
204  // return *VALID* located service
205  return s;
206 }
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:752
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:245
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 129 of file GaudiCommonImp.h.

133 {
134  // for empty names delegate to another method
135  if ( name.empty() ) return tool<TOOL>( type , parent , create ) ;
136  Assert( this->toolSvc(), "tool():: IToolSvc* points to NULL!" ) ;
137  // get the tool from Tool Service
138  TOOL* Tool = nullptr ;
139  const StatusCode sc =
140  this->toolSvc()->retrieveTool ( type , name , Tool , parent , create ) ;
141  if ( sc.isFailure() )
142  { Exception("tool():: Could not retrieve Tool '" + type + "'/'" + name + "'", sc ) ; }
143  if ( !Tool )
144  { Exception("tool():: Could not retrieve Tool '" + type + "'/'" + name + "'" ) ; }
145  // insert tool into list of tools
146  PBASE::registerTool(Tool);
147  // return *VALID* located tool
148  return Tool ;
149 }
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.
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 155 of file GaudiCommonImp.h.

158 {
159  // check the environment
160  Assert ( PBASE::toolSvc(), "IToolSvc* points to NULL!" );
161  // retrieve the tool from Tool Service
162  TOOL* Tool = nullptr ;
163  const StatusCode sc =
164  this->toolSvc() -> retrieveTool ( type, Tool, parent , create );
165  if ( sc.isFailure() )
166  { Exception("tool():: Could not retrieve Tool '" + type + "'", sc ) ; }
167  if ( !Tool )
168  { Exception("tool():: Could not retrieve Tool '" + type + "'" ) ; }
169  // add the tool into the list of known tools to be properly released
170  PBASE::registerTool(Tool);
171  // return *VALID* located tool
172  return Tool ;
173 }
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.
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>
bool GaudiCommon< PBASE >::typePrint ( ) const
inline

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

Definition at line 517 of file GaudiCommon.h.

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

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

Definition at line 517 of file GaudiCommon.h.

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

Short-cut to locate the Update Manager Service.

Definition at line 212 of file GaudiCommonImp.h.

213 {
214  if ( !m_updMgrSvc )
215  { m_updMgrSvc = svc<IUpdateManagerSvc>("UpdateManagerSvc",true); }
216  return m_updMgrSvc ;
217 }
IUpdateManagerSvc * m_updMgrSvc
Pointer to the Update Manager Service instance.
Definition: GaudiCommon.h:766
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 481 of file GaudiCommon.icpp.

484 {
485  // increase local counter of warnings
486  const size_t num = ++m_warnings[msg] ;
487  // If suppressed, just return
488  if ( num > mx ) { return st ; }
489  else if ( UNLIKELY(num == mx) ) // issue one-time suppression message
490  { return Print ( "The WARNING message is suppressed : '" +
491  msg + "'" , st , MSG::WARNING ) ; }
492  // return message
493  return Print ( msg , st , MSG::WARNING ) ;
494 }
Counter m_warnings
counter of warnings
Definition: GaudiCommon.h:757
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 86 of file GaudiCommon.h.

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

The context string.

Definition at line 778 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 116 of file GaudiCommon.h.

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

General counters.

Definition at line 763 of file GaudiCommon.h.

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

a pointer to the CounterSummarySvc

Definition at line 114 of file GaudiCommon.h.

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

Counter of errors.

Definition at line 755 of file GaudiCommon.h.

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

print warning and error counters at finalization ?

Definition at line 775 of file GaudiCommon.h.

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

Counter of exceptions.

Definition at line 761 of file GaudiCommon.h.

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

format for regular statistical printout rows

Definition at line 787 of file GaudiCommon.h.

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

format for "efficiency" statistical printout rows

Definition at line 789 of file GaudiCommon.h.

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

The globalTimeOffset value.

Definition at line 782 of file GaudiCommon.h.

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

the header row

Definition at line 785 of file GaudiCommon.h.

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

counter of infos

Definition at line 759 of file GaudiCommon.h.

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

The message level.

Definition at line 745 of file GaudiCommon.h.

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

The predefined message stream.

Definition at line 748 of file GaudiCommon.h.

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

print properties at initialization?

Definition at line 771 of file GaudiCommon.h.

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

The rootInTES string.

Definition at line 780 of file GaudiCommon.h.

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

List of active services.

Definition at line 752 of file GaudiCommon.h.

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

Definition at line 118 of file GaudiCommon.h.

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

print counters at finalization ?

Definition at line 773 of file GaudiCommon.h.

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

List of active tools.

Definition at line 750 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 769 of file GaudiCommon.h.

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

Pointer to the Update Manager Service instance.

Definition at line 766 of file GaudiCommon.h.

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

flag to use the special "efficiency" format

Definition at line 791 of file GaudiCommon.h.

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

counter of warnings

Definition at line 757 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 98 of file GaudiCommon.h.


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