From 65cdf558402e0e53efc3a9233a47091bfeb707c1 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 7 Dec 2017 15:08:24 +0100 Subject: [PATCH 01/62] Rewired JobOptionsSvc in terms of a simple map string->string - added minimal interface `Gaudi::Interfaces::IOptionsSvc` - reimplemented `IJobOptionsSvc` methods using the new interface methods (`set`, `get` and `has`) - deprecated `IJobOptionsSvc` methods --- .../src/JobOptionsSvc/JobOptionsSvc.cpp | 70 ++++++--- .../src/JobOptionsSvc/JobOptionsSvc.h | 30 +++- .../src/JobOptionsSvc/PythonConfig.cpp | 9 +- GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.h | 18 +-- GaudiCoreSvc/src/JobOptionsSvc/SvcCatalog.cpp | 137 ------------------ GaudiCoreSvc/src/JobOptionsSvc/SvcCatalog.h | 60 -------- .../tests/qmtest/refs/Properties.ref | 2 +- .../tests/qmtest/refs/Properties2.ref | 4 +- .../tests/qmtest/refs/Properties_py.ref | 4 +- GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h | 20 +++ GaudiKernel/GaudiKernel/IJobOptionsSvc.h | 20 +-- GaudiKernel/GaudiKernel/JobHistory.h | 5 +- GaudiKernel/GaudiKernel/PropertyHolder.h | 8 +- GaudiKernel/src/Lib/JobHistory.cpp | 11 +- GaudiKernel/src/Lib/Property.cpp | 13 +- GaudiMonitor/src/HistorySvc.cpp | 8 +- RootHistCnv/src/RFileCnv.cpp | 3 + 17 files changed, 162 insertions(+), 260 deletions(-) delete mode 100644 GaudiCoreSvc/src/JobOptionsSvc/SvcCatalog.cpp delete mode 100644 GaudiCoreSvc/src/JobOptionsSvc/SvcCatalog.h create mode 100644 GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index d3543958ba..20c7d2cf78 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -2,6 +2,7 @@ // Local: // ============================================================================ #include "JobOptionsSvc.h" + #include "Analyzer.h" #include "Catalog.h" #include "Messages.h" @@ -14,6 +15,9 @@ // ============================================================================ #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/System.h" + +#include + // ============================================================================ DECLARE_COMPONENT( JobOptionsSvc ) // ============================================================================ @@ -49,42 +53,73 @@ StatusCode JobOptionsSvc::initialize() StatusCode JobOptionsSvc::addPropertyToCatalogue( const std::string& client, const Gaudi::Details::PropertyBase& property ) { - auto p = std::make_unique>( property.name(), "" ); - return property.load( *p ) ? m_svc_catalog.addProperty( client, p.release() ) : StatusCode::FAILURE; + set( client + '.' + property.name(), property.toString() ); + return StatusCode::SUCCESS; } // ============================================================================ StatusCode JobOptionsSvc::removePropertyFromCatalogue( const std::string& client, const std::string& name ) { - return m_svc_catalog.removeProperty( client, name ); + m_options.erase( client + '.' + name ); + return StatusCode::SUCCESS; } // ============================================================================ const JobOptionsSvc::PropertiesT* JobOptionsSvc::getProperties( const std::string& client ) const { - return m_svc_catalog.getProperties( client ); + PropertiesT props; + + const std::string key_base = client + '.'; + const auto key_base_size = key_base.size(); + for ( const auto& elem : m_options ) { + boost::string_ref key = elem.first; + // for keys that are 'client.name' (and name does not contain '.') + // we add an entry to the vector + if ( key.starts_with( key_base ) ) { + boost::string_ref name = key.substr( key_base_size ); + if ( name.find( '.' ) == std::string::npos ) { + props.push_back( getClientProperty( client, static_cast( name ) ) ); + } + } + } + // we are supposed to be the owner of the vector, so we need to keep it safe + return &( m_old_iface_compat_2[client] = std::move( props ) ); } // ============================================================================ StatusCode JobOptionsSvc::setMyProperties( const std::string& client, IProperty* myInt ) { - const auto* props = m_svc_catalog.getProperties( client ); - if ( !props ) { - return StatusCode::SUCCESS; - } + const std::string key_base = client + '.'; + const auto key_base_size = key_base.size(); bool fail = false; - for ( const auto& cur : *props ) { - StatusCode sc = myInt->setProperty( *cur ); - if ( sc.isFailure() ) { - error() << "Unable to set the property '" << cur->name() << "'" - << " of '" << client << "'. " - << "Check option and algorithm names, type and bounds." << endmsg; - fail = true; + for ( const auto& elem : m_options ) { + boost::string_ref key = elem.first; + if ( key.starts_with( key_base ) ) { + const auto name = static_cast( key.substr( key_base_size ) ); + // \fixme this has to change if we want nested properties + // if ( myInt->hasProperty( name ) ) { + if ( name.find( '.' ) == std::string::npos ) { + if ( !myInt->setProperty( name, elem.second ) ) { + error() << "Unable to set the property '" << name << "'" + << " of '" << client << "'. " + << "Check option and algorithm names, type and bounds." << endmsg; + fail = true; + // throw std::invalid_argument( "cannot set " + name + " of " + client + " to " + elem.second ); + } + } } } return fail ? StatusCode::FAILURE : StatusCode::SUCCESS; } /// Get the list of clients -std::vector JobOptionsSvc::getClients() const { return m_svc_catalog.getClients(); } +std::vector JobOptionsSvc::getClients() const +{ + std::set clients; + for ( const auto& elem : m_options ) { + const auto pos = elem.first.rfind( '.' ); + if ( pos != std::string::npos ) clients.emplace( elem.first, 0, pos ); + } + return {begin( clients ), end( clients )}; +} void JobOptionsSvc::dump( const std::string& file, const gp::Catalog& catalog ) const { @@ -102,8 +137,7 @@ void JobOptionsSvc::fillServiceCatalog( const gp::Catalog& catalog ) { for ( const auto& client : catalog ) { for ( const auto& current : client.second ) { - addPropertyToCatalogue( client.first, - Gaudi::Property{current.NameInClient(), current.ValueAsString()} ); + set( client.first + '.' + current.NameInClient(), current.ValueAsString() ); } } } diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index 2a8358487f..31329f2806 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -8,8 +8,9 @@ #include "GaudiKernel/Service.h" #include "GaudiKernel/StatusCode.h" -#include "SvcCatalog.h" +#include "Gaudi/Interfaces/IOptionsSvc.h" +#include #include namespace Gaudi @@ -20,10 +21,26 @@ namespace Gaudi } } -class JobOptionsSvc : public extends +class JobOptionsSvc : public extends, virtual public Gaudi::Interfaces::IOptionsSvc { public: typedef std::vector PropertiesT; + +private: + std::map m_options; + mutable std::map> m_old_iface_compat; + mutable std::map m_old_iface_compat_2; + +protected: + void set( const std::string& key, const std::string& value ) override { m_options[key] = value; } + std::string get( const std::string& key ) const override + { + auto item = m_options.find( key ); + return item != m_options.end() ? item->second : std::string{}; + } + bool has( const std::string& key ) const override { return m_options.find( key ) != m_options.end(); } + +public: // Constructor JobOptionsSvc( const std::string& name, ISvcLocator* svc ); @@ -50,7 +67,12 @@ public: const Gaudi::Details::PropertyBase* getClientProperty( const std::string& client, const std::string& name ) const override { - return m_svc_catalog.getProperty( client, name ); + const std::string key = client + '.' + name; + + auto value = get( key ); + + auto p = std::make_unique>( name, std::move( value ) ); + return ( m_old_iface_compat[key] = std::move( p ) ).get(); } /// Get the list of clients std::vector getClients() const override; @@ -75,7 +97,5 @@ private: Gaudi::Property m_dump{this, "DUMPFILE"}; Gaudi::Property m_pythonAction{this, "PYTHONACTION"}; Gaudi::Property m_pythonParams{this, "PYTHONPARAMS"}; - - SvcCatalog m_svc_catalog; }; #endif /* JOBOPTIONSSVC_H_ */ diff --git a/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.cpp b/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.cpp index a396ca74c2..07ea6130d5 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.cpp @@ -1,5 +1,7 @@ #include "PythonConfig.h" +#include + // boost includes #include "boost/python.hpp" using namespace boost::python; @@ -15,11 +17,12 @@ StatusCode PythonConfig::evaluateConfig( const std::string& filename, const std: object main_namespace = main_module.attr( "__dict__" ); // make the translator class known to Python - main_namespace["PythonAdaptor"] = class_( "PythonAdaptor", boost::python::init() ) - .def( "addPropertyToJobOptions", &PythonAdaptor::addPropertyToJobOptions ); + main_namespace["PythonAdaptor"] = + class_( "PythonAdaptor", boost::python::init() ) + .def( "addPropertyToJobOptions", &PythonAdaptor::addPropertyToJobOptions ); // create an instance of it and pass it to Python - PythonAdaptor adaptor( m_IJobOptionsSvc ); + PythonAdaptor adaptor( m_optsSvc ); main_namespace["adaptor"] = ptr( &adaptor ); // some python helper diff --git a/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.h b/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.h index 2a6603bb2b..1452347a0a 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.h @@ -1,9 +1,9 @@ #ifndef GAUDISVC_PYTHONCONFIG_H #define GAUDISVC_PYTHONCONFIG_H -#include "GaudiKernel/IJobOptionsSvc.h" -#include "GaudiKernel/IProperty.h" -#include "GaudiKernel/Property.h" -#include "GaudiKernel/SmartIF.h" +#include "Gaudi/Interfaces/IOptionsSvc.h" + +#include "GaudiKernel/StatusCode.h" + #include // Class to translate between Python and C++ worlds @@ -11,25 +11,25 @@ class PythonAdaptor { public: - PythonAdaptor( IJobOptionsSvc* jos ) : m_IJobOptionsSvc( jos ) {} + PythonAdaptor( Gaudi::Interfaces::IOptionsSvc* optsSvc ) : m_optsSvc( optsSvc ) {} void addPropertyToJobOptions( const std::string& client, const std::string& name, const std::string& value ) { - m_IJobOptionsSvc->addPropertyToCatalogue( client, Gaudi::Property( name, value ) ); + m_optsSvc->set( client + '.' + name, value ); } private: - SmartIF m_IJobOptionsSvc; + Gaudi::Interfaces::IOptionsSvc* m_optsSvc; }; // Helper class to be invoked by JobOptionsSvc class PythonConfig { public: - PythonConfig( IJobOptionsSvc* jos ) : m_IJobOptionsSvc( jos ){}; + PythonConfig( Gaudi::Interfaces::IOptionsSvc* optsSvc ) : m_optsSvc( optsSvc ) {} StatusCode evaluateConfig( const std::string& filename, const std::string& preAction, const std::string& postAction ); private: - SmartIF m_IJobOptionsSvc; + Gaudi::Interfaces::IOptionsSvc* m_optsSvc; }; #endif diff --git a/GaudiCoreSvc/src/JobOptionsSvc/SvcCatalog.cpp b/GaudiCoreSvc/src/JobOptionsSvc/SvcCatalog.cpp deleted file mode 100644 index a9b329d2f4..0000000000 --- a/GaudiCoreSvc/src/JobOptionsSvc/SvcCatalog.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// ============================================================================ -// Include files -// =========================================================================== -// STD & STL: -// =========================================================================== -#include -#include -// =========================================================================== -// Boost: -// =========================================================================== -#include "boost/algorithm/string.hpp" -// =========================================================================== -// Local -// =========================================================================== -#include "SvcCatalog.h" -// =========================================================================== -namespace -{ - constexpr struct select1st_t { - template - const S& operator()( const std::pair& p ) const - { - return p.first; - } - template - S& operator()( std::pair& p ) const - { - return p.first; - } - } select1st{}; -} -// =========================================================================== -SvcCatalog::~SvcCatalog() -{ - for ( const auto& cur : m_catalog ) { - for ( auto& prop : cur.second ) delete prop; - } -} -// ============================================================================ -StatusCode SvcCatalog::addProperty( const std::string& client, const Gaudi::Details::PropertyBase* property ) -{ - auto props = findProperties( client ); - if ( props ) { - removeProperty( client, property->name() ).ignore(); - props->push_back( property ); - } else { - m_catalog.emplace( client, PropertiesT{property} ); - } - return StatusCode::SUCCESS; -} -// ============================================================================ -StatusCode SvcCatalog::removeProperty( const std::string& client, const std::string& name ) -{ - auto props = findProperties( client ); - if ( props ) { - auto res = findProperty( *props, name ); - if ( res.first ) { - delete *res.second; - props->erase( res.second ); - } - } - return StatusCode::SUCCESS; -} -// ============================================================================ -const SvcCatalog::PropertiesT* SvcCatalog::getProperties( const std::string& client ) const -{ - return findProperties( client ); -} -// ============================================================================ -std::vector SvcCatalog::getClients() const -{ - std::vector result; - result.reserve( m_catalog.size() ); - std::transform( std::begin( m_catalog ), std::end( m_catalog ), std::back_inserter( result ), select1st ); - return result; -} -// ============================================================================ -const SvcCatalog::PropertiesT* SvcCatalog::findProperties( const std::string& client ) const -{ - auto result = m_catalog.find( client ); - return ( result != m_catalog.end() ) ? &result->second : nullptr; -} -// ============================================================================ -SvcCatalog::PropertiesT* SvcCatalog::findProperties( const std::string& client ) -{ - auto result = m_catalog.find( client ); - return ( result != m_catalog.end() ) ? &result->second : nullptr; -} -// ============================================================================ -std::pair SvcCatalog::findProperty( const SvcCatalog::PropertiesT& props, - const std::string& name ) const -{ - auto p = std::find_if( std::begin( props ), std::end( props ), [&]( const Gaudi::Details::PropertyBase* prop ) { - return boost::iequals( name, prop->name() ); - } ); - return {p != std::end( props ), p}; -} -// ============================================================================ -std::pair SvcCatalog::findProperty( SvcCatalog::PropertiesT& props, - const std::string& name ) -{ - auto p = std::find_if( std::begin( props ), std::end( props ), [&]( const Gaudi::Details::PropertyBase* prop ) { - return boost::iequals( name, prop->name() ); - } ); - return {p != std::end( props ), p}; -} -// ============================================================================ -std::ostream& SvcCatalog::fillStream( std::ostream& o ) const -{ - // loop over the clients: - for ( const auto& iclient : m_catalog ) { - o << "Client '" << iclient.first << "'" << std::endl; - for ( const auto& p : iclient.second ) { - if ( p ) o << "\t" << ( *p ) << std::endl; - } - } - // - return o; // RETURN -} -const Gaudi::Details::PropertyBase* SvcCatalog::getProperty( const std::string& client, const std::string& name ) const -{ - auto props = findProperties( client ); - if ( props ) { - const auto res = findProperty( *props, name ); - if ( res.first ) { - return *res.second; - } - } - return nullptr; -} -// ============================================================================ -// printoput operator -// ============================================================================ -std::ostream& operator<<( std::ostream& o, const SvcCatalog& c ) { return c.fillStream( o ); } -// ============================================================================ -// The END -// ============================================================================ diff --git a/GaudiCoreSvc/src/JobOptionsSvc/SvcCatalog.h b/GaudiCoreSvc/src/JobOptionsSvc/SvcCatalog.h deleted file mode 100644 index bd5ceabb1f..0000000000 --- a/GaudiCoreSvc/src/JobOptionsSvc/SvcCatalog.h +++ /dev/null @@ -1,60 +0,0 @@ -// ============================================================================ -#ifndef JOBOPTIONSSVC_SVCCATALOG_H -#define JOBOPTIONSSVC_SVCCATALOG_H 1 -// ============================================================================ -// Include files -// ============================================================================ -// STD & STL -// ============================================================================ -#include -#include -#include -// ============================================================================ -// GaudiKernel -// ============================================================================ -#include "GaudiKernel/Property.h" -#include "GaudiKernel/StatusCode.h" -// =========================================================================== - -/** @class SvcCatalog - * - * @author Alexander MAZUROV Alexander.Mazurov@gmail.com - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2006-05-13 - */ -class SvcCatalog final -{ -public: - typedef std::vector PropertiesT; - SvcCatalog() = default; - ~SvcCatalog(); - - StatusCode addProperty( const std::string& client, const Gaudi::Details::PropertyBase* property ); - - StatusCode removeProperty( const std::string& client, const std::string& name ); - const PropertiesT* getProperties( const std::string& client ) const; - std::vector getClients() const; - const Gaudi::Details::PropertyBase* getProperty( const std::string& client, const std::string& name ) const; - -public: - /// dump the content of catalog to std::ostream - std::ostream& fillStream( std::ostream& o ) const; - -private: - const PropertiesT* findProperties( const std::string& client ) const; - PropertiesT* findProperties( const std::string& client ); - std::pair findProperty( const PropertiesT& props, const std::string& name ) const; - std::pair findProperty( PropertiesT& props, const std::string& name ); - std::map m_catalog; -}; -// ============================================================================ -/// printoput operator -// ============================================================================ -std::ostream& operator<<( std::ostream& o, const SvcCatalog& c ); -// ============================================================================ - -// ============================================================================ -// The END -// ============================================================================ -#endif // JOBOPTIONSSVC_SVCCATALOG_H -// =========================================================================== diff --git a/GaudiExamples/tests/qmtest/refs/Properties.ref b/GaudiExamples/tests/qmtest/refs/Properties.ref index f271f7f5cc..05cb395188 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties.ref @@ -156,9 +156,9 @@ PropertyAlg INFO Properties of PropertyAlg: Bool, BoolArray, Double, D PropertyAlg INFO Properties of PropertyProxy: String PropertyAlg INFO ================================================= PropertyAlg INFO Changed property DoubleArray in catalogue +JobOptionsSvc ERROR Unable to set the property 'DoubleArray' of 'PropertyAlg'. Check option and algorithm names, type and bounds. PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO Update handler called for property: 'PDouble':10100000. -JobOptionsSvc ERROR Unable to set the property 'DoubleArray' of 'PropertyAlg'. Check option and algorithm names, type and bounds. PropertyAlg INFO DoubleArray = [-11, 2, 3.3, 0.0004] PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; diff --git a/GaudiExamples/tests/qmtest/refs/Properties2.ref b/GaudiExamples/tests/qmtest/refs/Properties2.ref index 54a147057c..35f4a128e2 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties2.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties2.ref @@ -152,13 +152,13 @@ PropertyAlg INFO Dump of the property catalogue.... PropertyAlg INFO Properties of AuditorSvc: Auditors PropertyAlg INFO Properties of Dummy1: Property PropertyAlg INFO Properties of Dummy2: Property -PropertyAlg INFO Properties of PropertyAlg: DoubleArray, Int64Array, EmptyArray, Bool, UInt64Array, StringArray, String, DoublePairArray, PDoubleArray, PDouble, PInt, BoolArray, Double, PStringArray, OutputLevel, Int64, PBoolArray, IntArray, PBool, UInt64, IntPairArray, PIntArray, Int, DoubleArrayWithUnits, PString, DoubleArrayWithoutUnits +PropertyAlg INFO Properties of PropertyAlg: Bool, BoolArray, Double, DoubleArray, DoubleArrayWithUnits, DoubleArrayWithoutUnits, DoublePairArray, EmptyArray, Int, Int64, Int64Array, IntArray, IntPairArray, OutputLevel, PBool, PBoolArray, PDouble, PDoubleArray, PInt, PIntArray, PString, PStringArray, String, StringArray, UInt64, UInt64Array PropertyAlg INFO Properties of PropertyProxy: String PropertyAlg INFO ================================================= PropertyAlg INFO Changed property DoubleArray in catalogue +JobOptionsSvc ERROR Unable to set the property 'DoubleArray' of 'PropertyAlg'. Check option and algorithm names, type and bounds. PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO Update handler called for property: 'PDouble':10100000. -JobOptionsSvc ERROR Unable to set the property 'DoubleArray' of 'PropertyAlg'. Check option and algorithm names, type and bounds. PropertyAlg INFO DoubleArray = [-11, 2, 3.3, 0.0004] PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; diff --git a/GaudiExamples/tests/qmtest/refs/Properties_py.ref b/GaudiExamples/tests/qmtest/refs/Properties_py.ref index a4a987f2a6..1806009bba 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties_py.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties_py.ref @@ -112,12 +112,12 @@ PropertyAlg INFO Dump of the property catalogue.... PropertyAlg INFO Properties of AuditorSvc: Auditors PropertyAlg INFO Properties of Dummy1: Property PropertyAlg INFO Properties of Dummy2: Property -PropertyAlg INFO Properties of PropertyAlg: DoubleArray, Int64Array, Bool, UInt64Array, StringArray, PBool, DoublePairArray, PDoubleArray, PDouble, PInt, BoolArray, Double, PStringArray, OutputLevel, Int64, PBoolArray, IntArray, String, UInt64, IntPairArray, PIntArray, Int, DoubleArrayWithUnits, PString, DoubleArrayWithoutUnits +PropertyAlg INFO Properties of PropertyAlg: Bool, BoolArray, Double, DoubleArray, DoubleArrayWithUnits, DoubleArrayWithoutUnits, DoublePairArray, Int, Int64, Int64Array, IntArray, IntPairArray, OutputLevel, PBool, PBoolArray, PDouble, PDoubleArray, PInt, PIntArray, PString, PStringArray, String, StringArray, UInt64, UInt64Array PropertyAlg INFO ================================================= PropertyAlg INFO Changed property DoubleArray in catalogue +JobOptionsSvc ERROR Unable to set the property 'DoubleArray' of 'PropertyAlg'. Check option and algorithm names, type and bounds. PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO Update handler called for property: 'PDouble':10100000. -JobOptionsSvc ERROR Unable to set the property 'DoubleArray' of 'PropertyAlg'. Check option and algorithm names, type and bounds. PropertyAlg INFO DoubleArray = [-11, 2, 3.3, 0.0004, 1e-20, 1e+20] PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; diff --git a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h new file mode 100644 index 0000000000..84f6c365ca --- /dev/null +++ b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +namespace Gaudi +{ + namespace Interfaces + { + class IOptionsSvc + { + public: + virtual void set( const std::string& key, const std::string& value ) = 0; + virtual std::string get( const std::string& key ) const = 0; + virtual bool has( const std::string& key ) const = 0; + + protected: + virtual ~IOptionsSvc() = default; + }; + } +} diff --git a/GaudiKernel/GaudiKernel/IJobOptionsSvc.h b/GaudiKernel/GaudiKernel/IJobOptionsSvc.h index 4d7b854471..77f77e98c0 100644 --- a/GaudiKernel/GaudiKernel/IJobOptionsSvc.h +++ b/GaudiKernel/GaudiKernel/IJobOptionsSvc.h @@ -27,22 +27,24 @@ public: @param client Name of the client algorithm or service @param me Address of the interface IProperty of the client */ - virtual StatusCode setMyProperties( const std::string& client, IProperty* me ) = 0; + [[deprecated]] virtual StatusCode setMyProperties( const std::string& client, IProperty* me ) = 0; /// Add a property into the JobOptions catalog - virtual StatusCode addPropertyToCatalogue( const std::string& client, - const Gaudi::Details::PropertyBase& property ) = 0; + [[deprecated]] virtual StatusCode addPropertyToCatalogue( const std::string& client, + const Gaudi::Details::PropertyBase& property ) = 0; /// Remove a property from the JobOptions catalog - virtual StatusCode removePropertyFromCatalogue( const std::string& client, const std::string& name ) = 0; + [[deprecated]] virtual StatusCode removePropertyFromCatalogue( const std::string& client, + const std::string& name ) = 0; /// Get the properties associated to a given client - virtual const std::vector* getProperties( const std::string& client ) const = 0; + [[deprecated]] virtual const std::vector* + getProperties( const std::string& client ) const = 0; /// Get a property for a client - virtual const Gaudi::Details::PropertyBase* getClientProperty( const std::string& client, - const std::string& name ) const = 0; + [[deprecated]] virtual const Gaudi::Details::PropertyBase* getClientProperty( const std::string& client, + const std::string& name ) const = 0; /// Get the list of clients - virtual std::vector getClients() const = 0; + [[deprecated]] virtual std::vector getClients() const = 0; /** look for file 'File' into search path 'Path' * and read it to update existing JobOptionsCatalogue @@ -50,7 +52,7 @@ public: * @param Path search path * @return status code */ - virtual StatusCode readOptions( const std::string& file, const std::string& path = "" ) = 0; + [[deprecated]] virtual StatusCode readOptions( const std::string& file, const std::string& path = "" ) = 0; }; #endif // KERNEL_IJOBOPTIONSSVC_H diff --git a/GaudiKernel/GaudiKernel/JobHistory.h b/GaudiKernel/GaudiKernel/JobHistory.h index 74aadd4a6c..32531aac42 100644 --- a/GaudiKernel/GaudiKernel/JobHistory.h +++ b/GaudiKernel/GaudiKernel/JobHistory.h @@ -4,10 +4,11 @@ #include "GaudiKernel/HistoryObj.h" #include "GaudiKernel/IVersHistoryObj.h" -#include "GaudiKernel/PropertyFwd.h" +#include "GaudiKernel/Property.h" #include #include +#include #include #include #include @@ -23,7 +24,7 @@ class GAUDI_API JobHistory : public HistoryObj, virtual public IVersHistoryObj { public: - typedef std::vector> PropertyPairList; + typedef std::vector>>> PropertyPairList; private: // data std::string m_release_version; diff --git a/GaudiKernel/GaudiKernel/PropertyHolder.h b/GaudiKernel/GaudiKernel/PropertyHolder.h index c463957f25..dddbd87024 100644 --- a/GaudiKernel/GaudiKernel/PropertyHolder.h +++ b/GaudiKernel/GaudiKernel/PropertyHolder.h @@ -179,8 +179,12 @@ public: */ StatusCode setProperty( const std::string& n, const std::string& v ) override { - Gaudi::Details::PropertyBase* p = property( n ); - return ( p && p->fromString( v ) ) ? StatusCode::SUCCESS : StatusCode::FAILURE; + try { + Gaudi::Details::PropertyBase* p = property( n ); + return ( p && p->fromString( v ) ) ? StatusCode::SUCCESS : StatusCode::FAILURE; + } catch ( ... ) { + return StatusCode::FAILURE; + } } /** set the property form the value * diff --git a/GaudiKernel/src/Lib/JobHistory.cpp b/GaudiKernel/src/Lib/JobHistory.cpp index 3553a6afc7..1bfc79d0f9 100644 --- a/GaudiKernel/src/Lib/JobHistory.cpp +++ b/GaudiKernel/src/Lib/JobHistory.cpp @@ -84,8 +84,11 @@ const CLID& JobHistory::classID() void JobHistory::addProperty( const std::string& client, const PropertyBase* prop ) { - // if (m_props.find(prop) == m_props.end()) - m_ppl.emplace_back( client, prop ); + /// \fixme strip optional quotes around the string + std::string prop_value = prop->toString(); + if ( !prop_value.empty() && prop_value[0] == '"' && prop_value[prop_value.size() - 1] == '"' ) + prop_value = prop_value.substr( 1, prop_value.size() - 2 ); + m_ppl.emplace_back( client, std::make_unique>( prop->name(), prop_value ) ); } void JobHistory::dump( std::ostream& ost, const bool isXML, int /*ind*/ ) const @@ -103,8 +106,8 @@ void JobHistory::dump( std::ostream& ost, const bool isXML, int /*ind*/ ) const ost << "Properties: [" << endl; ; for ( const auto& ipprop : propertyPairs() ) { - const std::string& client = ipprop.first; - const PropertyBase* prop = ipprop.second; + const auto& client = ipprop.first; + const auto& prop = ipprop.second; ost << client << ": "; prop->fillStream( ost ); ost << endl; diff --git a/GaudiKernel/src/Lib/Property.cpp b/GaudiKernel/src/Lib/Property.cpp index 11a7c70d91..22272091e7 100644 --- a/GaudiKernel/src/Lib/Property.cpp +++ b/GaudiKernel/src/Lib/Property.cpp @@ -21,7 +21,8 @@ // ============================================================================ // Boost // ============================================================================ -#include "boost/algorithm/string/compare.hpp" +#include +#include // ============================================================================ namespace { @@ -132,7 +133,15 @@ void GaudiHandleProperty::toStream( std::ostream& out ) const StatusCode GaudiHandleProperty::fromString( const std::string& s ) { - m_pValue->setTypeAndName( s ); + boost::string_ref tn = s; + /// \fixme strip optional quotes around the string + if ( ( tn.starts_with( '"' ) && tn.ends_with( '"' ) ) || ( tn.starts_with( '\'' ) && tn.ends_with( '\'' ) ) ) { + tn.remove_prefix( 1 ); + tn.remove_suffix( 1 ); + m_pValue->setTypeAndName( static_cast( tn ) ); + } else { + m_pValue->setTypeAndName( s ); + } useUpdateHandler(); return StatusCode::SUCCESS; } diff --git a/GaudiMonitor/src/HistorySvc.cpp b/GaudiMonitor/src/HistorySvc.cpp index c85ddcfb86..b44a6badb0 100644 --- a/GaudiMonitor/src/HistorySvc.cpp +++ b/GaudiMonitor/src/HistorySvc.cpp @@ -414,7 +414,7 @@ void HistorySvc::dumpProperties( std::ofstream& ofs ) const ofs << "GLOBAL" << std::endl; for ( const auto& prop : m_jobHistory->propertyPairs() ) { - ofs << prop.first << " " << dumpProp( prop.second ) << std::endl; + ofs << prop.first << " " << dumpProp( prop.second.get() ) << std::endl; } ofs << std::endl << "SERVICES" << std::endl; @@ -745,8 +745,8 @@ void HistorySvc::dumpState( std::ofstream& ofs ) const std::string client_currently_open = "start"; for ( auto& item : m_jobHistory->propertyPairs() ) { // client is the name of the component of the current property - const std::string& client = item.first; - const Gaudi::Details::PropertyBase* prp = item.second; + const auto& client = item.first; + const auto& prp = item.second; if ( m_outputFileTypeXML ) { @@ -758,7 +758,7 @@ void HistorySvc::dumpState( std::ofstream& ofs ) const ofs << client << " "; } - ofs << dumpProp( prp, m_outputFileTypeXML, 6 ) << endl; + ofs << dumpProp( prp.get(), m_outputFileTypeXML, 6 ) << endl; client_currently_open = client; diff --git a/RootHistCnv/src/RFileCnv.cpp b/RootHistCnv/src/RFileCnv.cpp index 1742fb4e1b..511d1a8872 100644 --- a/RootHistCnv/src/RFileCnv.cpp +++ b/RootHistCnv/src/RFileCnv.cpp @@ -32,6 +32,9 @@ StatusCode RootHistCnv::RFileCnv::initialize() auto jobSvc = svcLoc->service( "JobOptionsSvc" ); auto prop = jobSvc->getClientProperty( "RFileCnv", "GlobalCompression" ); if ( prop ) m_compLevel = prop->toString(); + /// \fixme strip optional quotes around the string + if ( !m_compLevel.empty() && m_compLevel[0] == '"' && m_compLevel[m_compLevel.size() - 1] == '"' ) + m_compLevel = m_compLevel.substr( 1, m_compLevel.size() - 2 ); // initialise base class return RDirectoryCnv::initialize(); -- GitLab From 0d045dee24c2431739313246741a8cfaf681d681 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Fri, 8 Dec 2017 12:08:56 +0100 Subject: [PATCH 02/62] Made IOptionsSvc lookup case insensitive for backward compatibility, but issuing a warning in case the wrong case is used --- GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp | 14 ++++++++++++++ GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h | 10 +++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index 20c7d2cf78..7db46303f2 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -110,6 +110,20 @@ StatusCode JobOptionsSvc::setMyProperties( const std::string& client, IProperty* return fail ? StatusCode::FAILURE : StatusCode::SUCCESS; } +JobOptionsSvc::StorageType::const_iterator JobOptionsSvc::find( const std::string& key, bool warn ) const +{ + StorageType::const_iterator iter = m_options.find( key ); + if ( iter == m_options.end() ) { // try case insensitive lookup + iter = std::find_if( m_options.begin(), m_options.end(), + [&key]( auto& item ) { return Gaudi::Utils::iequal( item.first, key ); } ); + if ( warn && iter != m_options.end() ) { + warning() << "mismatching case for property name: actual name is " << key << " but " << iter->first + << " is in the option files" << endmsg; + } + } + return iter; +} + /// Get the list of clients std::vector JobOptionsSvc::getClients() const { diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index 31329f2806..4bb0509503 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -27,18 +27,22 @@ public: typedef std::vector PropertiesT; private: - std::map m_options; + using StorageType = std::map; + + StorageType m_options; mutable std::map> m_old_iface_compat; mutable std::map m_old_iface_compat_2; + StorageType::const_iterator find( const std::string& key, bool warn ) const; + protected: void set( const std::string& key, const std::string& value ) override { m_options[key] = value; } std::string get( const std::string& key ) const override { - auto item = m_options.find( key ); + auto item = find( key, true ); return item != m_options.end() ? item->second : std::string{}; } - bool has( const std::string& key ) const override { return m_options.find( key ) != m_options.end(); } + bool has( const std::string& key ) const override { return find( key, false ) != m_options.end(); } public: // Constructor -- GitLab From a8deea424a2e391949ee793db903c562f81d54b2 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Wed, 13 Dec 2017 10:41:23 +0100 Subject: [PATCH 03/62] Added easy access to IOptionsSvc implementation --- GaudiKernel/CMakeLists.txt | 2 +- GaudiKernel/GaudiKernel/ISvcLocator.h | 12 ++++++++++++ GaudiKernel/src/Lib/ISvcLocator.cpp | 11 +++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 GaudiKernel/src/Lib/ISvcLocator.cpp diff --git a/GaudiKernel/CMakeLists.txt b/GaudiKernel/CMakeLists.txt index 6956946bbe..10ecc737f1 100644 --- a/GaudiKernel/CMakeLists.txt +++ b/GaudiKernel/CMakeLists.txt @@ -61,7 +61,7 @@ endif() #---Libraries--------------------------------------------------------------- gaudi_add_library(GaudiKernel src/Lib/*.cpp ${extra_sources} LINK_LIBRARIES ${CMAKE_DL_LIBS} Boost ROOT TBB GaudiPluginService ${extra_libraries} - INCLUDE_DIRS Boost ROOT TBB + INCLUDE_DIRS Boost ROOT TBB cppgsl PUBLIC_HEADERS Gaudi GaudiKernel) #---Tests------------------------------------------------------------------- diff --git a/GaudiKernel/GaudiKernel/ISvcLocator.h b/GaudiKernel/GaudiKernel/ISvcLocator.h index f1754b7ada..a20a8a5f8a 100644 --- a/GaudiKernel/GaudiKernel/ISvcLocator.h +++ b/GaudiKernel/GaudiKernel/ISvcLocator.h @@ -6,12 +6,21 @@ #include "GaudiKernel/ISvcManager.h" #include "GaudiKernel/SmartIF.h" #include "GaudiKernel/TypeNameString.h" + #include #include // Forward class declaration class IService; +namespace Gaudi +{ + namespace Interfaces + { + class IOptionsSvc; + } +} + /** @class ISvcLocator ISvcLocator.h GaudiKernel/ISvcLocator.h The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to locate services in the framework. Clients use this @@ -110,6 +119,9 @@ public: { return SmartIF{this}; } + + /// Direct access to Gaudi::Interfaces::IOptionsSvc implementation. + Gaudi::Interfaces::IOptionsSvc& getOptsSvc(); }; #endif // GAUDI_ISVCLOCATOR_H diff --git a/GaudiKernel/src/Lib/ISvcLocator.cpp b/GaudiKernel/src/Lib/ISvcLocator.cpp new file mode 100644 index 0000000000..e6950eb1e5 --- /dev/null +++ b/GaudiKernel/src/Lib/ISvcLocator.cpp @@ -0,0 +1,11 @@ +#include "GaudiKernel/ISvcLocator.h" + +#include "Gaudi/Interfaces/IOptionsSvc.h" + +#include + +Gaudi::Interfaces::IOptionsSvc& ISvcLocator::getOptsSvc() +{ + using namespace Gaudi::Interfaces; + return *gsl::not_null( dynamic_cast( service( "JobOptionsSvc" ).get() ) ); +} -- GitLab From 71b51036a85184f6119c197b01192b7d739f795e Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Mon, 18 Dec 2017 00:19:49 +0100 Subject: [PATCH 04/62] Improve IOptionsSvc interface - added default value to return for `get` - added `pop` method - added `item` method to get all options --- .../src/JobOptionsSvc/JobOptionsSvc.cpp | 2 +- .../src/JobOptionsSvc/JobOptionsSvc.h | 22 +++++++++++++++++-- GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h | 9 ++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index 7db46303f2..ae8d5cfe79 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -59,7 +59,7 @@ StatusCode JobOptionsSvc::addPropertyToCatalogue( const std::string& // ============================================================================ StatusCode JobOptionsSvc::removePropertyFromCatalogue( const std::string& client, const std::string& name ) { - m_options.erase( client + '.' + name ); + pop( client + '.' + name ); return StatusCode::SUCCESS; } // ============================================================================ diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index 4bb0509503..b3386aa0f8 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -37,12 +37,30 @@ private: protected: void set( const std::string& key, const std::string& value ) override { m_options[key] = value; } - std::string get( const std::string& key ) const override + std::string get( const std::string& key, const std::string& default_ = {} ) const override { auto item = find( key, true ); - return item != m_options.end() ? item->second : std::string{}; + return item != m_options.end() ? item->second : default_; + } + std::string pop( const std::string& key, const std::string& default_ = {} ) override + { + std::string result = default_; + + auto item = find( key, true ); + if ( item != m_options.end() ) { + m_options.erase( item ); + result = std::move( item->second ); + } + return result; } bool has( const std::string& key ) const override { return find( key, false ) != m_options.end(); } + std::vector> items() const override + { + std::vector> v; + v.reserve( m_options.size() ); + std::for_each( begin( m_options ), end( m_options ), [&v]( const auto& item ) { v.emplace_back( item ); } ); + return v; + } public: // Constructor diff --git a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h index 84f6c365ca..8b9f60a979 100644 --- a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h +++ b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h @@ -1,6 +1,8 @@ #pragma once #include +#include +#include namespace Gaudi { @@ -10,8 +12,11 @@ namespace Gaudi { public: virtual void set( const std::string& key, const std::string& value ) = 0; - virtual std::string get( const std::string& key ) const = 0; - virtual bool has( const std::string& key ) const = 0; + virtual std::string get( const std::string& key, const std::string& default_ = {} ) const = 0; + virtual std::string pop( const std::string& key, const std::string& default_ = {} ) = 0; + virtual bool has( const std::string& key ) const = 0; + + virtual std::vector> items() const = 0; protected: virtual ~IOptionsSvc() = default; -- GitLab From b78f3b1d515f24834c3f13d514beaacc926b0522 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Wed, 13 Dec 2017 11:18:38 +0100 Subject: [PATCH 05/62] Replaced Alg/Tool/Svc setProperties with PropertyHolder method --- Gaudi/python/Gaudi/Main.py | 18 +++++---- GaudiCommonSvc/src/ChronoStatSvc.cpp | 8 ---- .../PersistencySvc/EvtCollectionStream.cpp | 2 - .../src/ApplicationMgr/ApplicationMgr.cpp | 9 +---- GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp | 28 +------------- GaudiCoreSvc/src/ApplicationMgr/ToolSvc.h | 2 - GaudiCoreSvc/src/IncidentSvc/IncidentSvc.cpp | 19 ---------- GaudiCoreSvc/src/IncidentSvc/IncidentSvc.h | 2 - GaudiExamples/options/FileMgrTest.opts | 2 +- GaudiExamples/options/THistRead.opts | 2 +- GaudiExamples/options/THistWrite.opts | 2 +- .../src/RandomNumber/RandomNumberAlg.cpp | 5 ++- GaudiKernel/Gaudi/Algorithm.h | 9 ----- GaudiKernel/GaudiKernel/AlgTool.h | 10 ++--- GaudiKernel/GaudiKernel/Auditor.h | 7 ---- GaudiKernel/GaudiKernel/PropertyHolder.h | 31 +++++++++++++--- GaudiKernel/GaudiKernel/Service.h | 5 --- GaudiKernel/src/Lib/AlgTool.cpp | 11 ------ GaudiKernel/src/Lib/Algorithm.cpp | 20 +++------- GaudiKernel/src/Lib/Auditor.cpp | 23 ++++-------- GaudiKernel/src/Lib/Bootstrap.cpp | 9 +++-- GaudiKernel/src/Lib/Service.cpp | 29 ++++----------- GaudiPartProp/src/ParticlePropertySvc.cpp | 6 --- GaudiSvc/options/MultiStore.opts | 2 +- GaudiSvc/options/StoreExplorer.opts | 4 +- GaudiSvc/src/NTupleSvc/NTupleSvc.cpp | 23 +++++------- GaudiSvc/src/RndmGenSvc/RndmEngine.cpp | 8 ---- GaudiSvc/src/RndmGenSvc/RndmEngine.h | 2 - GaudiSvc/src/RndmGenSvc/RndmGenSvc.cpp | 37 +++++++++---------- RootHistCnv/src/PersSvc.cpp | 5 --- 30 files changed, 103 insertions(+), 237 deletions(-) diff --git a/Gaudi/python/Gaudi/Main.py b/Gaudi/python/Gaudi/Main.py index 85b6884636..35cf194e5d 100644 --- a/Gaudi/python/Gaudi/Main.py +++ b/Gaudi/python/Gaudi/Main.py @@ -63,6 +63,9 @@ class BootstrapHelper(object): def getService(self, name): return self.lib.py_bootstrap_getService(self.ptr, name) + def getOptionsSvc(self): + return self.lib.py_bootstrap_getOptionsSvc(self.ptr) + def setProperty(self, name, value): return BootstrapHelper.StatusCode(self.lib.py_bootstrap_setProperty(self.ptr, name, value)) @@ -92,11 +95,11 @@ class BootstrapHelper(object): functions = [('createApplicationMgr', IInterface_p, []), ('getService', IInterface_p, [IInterface_p, c_char_p]), + ('getOptionsSvc', c_void_p, [IInterface_p]), ('setProperty', c_bool, [ IInterface_p, c_char_p, c_char_p]), ('getProperty', c_char_p, [IInterface_p, c_char_p]), - ('addPropertyToCatalogue', c_bool, [ - IInterface_p, c_char_p, c_char_p, c_char_p]), + ('setOption', None, [c_void_p, c_char_p, c_char_p]), ('ROOT_VERSION_CODE', c_int, []), ] @@ -342,11 +345,10 @@ class gaudimain(object): self.log.error('Cannot set property %s.%s to %s', comp, p, v) sys.exit(10) - # feed JobOptionsSvc - comp = 'JobOptionsSvc' - jos = self.g.getService(comp) - if not jos: - self.log.error('Cannot get service %s', comp) + # feed options service + optssvc = self.g.getOptionsSvc() + if not optssvc: + self.log.error('Cannot get options service') sys.exit(10) for n in getNeededConfigurables(): c = Configurable.allConfigurables[n] @@ -363,7 +365,7 @@ class gaudimain(object): v = '"%s"' % v # need double quotes elif type(v) == long: v = '%d' % v # prevent pending 'L' - _bootstrap.addPropertyToCatalogue(jos, n, p, str(v)) + _bootstrap.setOption(optssvc, '.'.join((n, p)), str(v)) if hasattr(Configurable, "_configurationLocked"): Configurable._configurationLocked = True self.log.debug('basicInit: done') diff --git a/GaudiCommonSvc/src/ChronoStatSvc.cpp b/GaudiCommonSvc/src/ChronoStatSvc.cpp index dbb783442c..f445d2e267 100644 --- a/GaudiCommonSvc/src/ChronoStatSvc.cpp +++ b/GaudiCommonSvc/src/ChronoStatSvc.cpp @@ -89,14 +89,6 @@ StatusCode ChronoStatSvc::initialize() { StatusCode sc = Service::initialize(); if ( sc.isFailure() ) return sc; - /// - // Set my own properties - sc = setProperties(); - - if ( sc.isFailure() ) { - error() << "setting my properties" << endmsg; - return StatusCode::FAILURE; - } // only add an EndEvent listener if per-event output requested if ( !m_perEventFile.empty() ) { diff --git a/GaudiCommonSvc/src/PersistencySvc/EvtCollectionStream.cpp b/GaudiCommonSvc/src/PersistencySvc/EvtCollectionStream.cpp index 304e60850b..f96d7a4821 100644 --- a/GaudiCommonSvc/src/PersistencySvc/EvtCollectionStream.cpp +++ b/GaudiCommonSvc/src/PersistencySvc/EvtCollectionStream.cpp @@ -23,8 +23,6 @@ DECLARE_COMPONENT( EvtCollectionStream ) // initialize data writer StatusCode EvtCollectionStream::initialize() { - // Use the Job options service to set the Algorithm's parameters - setProperties(); // Get access to the DataManagerSvc m_pTupleSvc = serviceLocator()->service( m_storeName ); if ( !m_pTupleSvc ) { diff --git a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp index e61e34a6af..e6399b8b46 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp @@ -149,13 +149,12 @@ StatusCode ApplicationMgr::i_startup() log << MSG::FATAL << "Error creating JobOptionsSvc" << endmsg; return StatusCode::FAILURE; } - // Get the useful interface from Message services + // Get the useful interface from JobOptionsSvc services m_jobOptionsSvc = m_svcLocator->service( "JobOptionsSvc" ); if ( !m_jobOptionsSvc ) { log << MSG::FATAL << "Error retrieving JobOptionsSvc." << endmsg; return StatusCode::FAILURE; } - auto jobOptsIProp = jobsvc.as(); if ( !jobOptsIProp ) { log << MSG::FATAL << "Error locating JobOptionsSvc" << endmsg; @@ -258,11 +257,7 @@ StatusCode ApplicationMgr::configure() MsgStream log( m_messageSvc, name() ); // Get my own options using the Job options service if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Getting my own properties" << endmsg; - sc = m_jobOptionsSvc->setMyProperties( name(), this ); - if ( !sc.isSuccess() ) { - log << MSG::WARNING << "Problems getting my properties from JobOptionsSvc" << endmsg; - return sc; - } + setPropertiesFrom( serviceLocator()->getOptsSvc() ); } // Make sure that the OutputLevel is in sync diff --git a/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp b/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp index c2337e5b18..881a191dd3 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp @@ -51,26 +51,6 @@ ToolSvc::~ToolSvc() std::for_each( std::begin( m_observers ), std::end( m_observers ), [&]( IToolSvc::Observer* obs ) { obs->setUnregister( {} ); } ); } -//------------------------------------------------------------------------------ -StatusCode ToolSvc::initialize() -//------------------------------------------------------------------------------ -{ - - // initialize the Service Base class - StatusCode status = Service::initialize(); - if ( UNLIKELY( status.isFailure() ) ) { - error() << "Unable to initialize the Service" << endmsg; - return status; - } - - // set my own (ToolSvc) properties via the jobOptionService - if ( UNLIKELY( setProperties().isFailure() ) ) { - error() << "Unable to set base properties" << endmsg; - return StatusCode::FAILURE; - } - - return status; -} //------------------------------------------------------------------------------ StatusCode ToolSvc::finalize() @@ -522,13 +502,7 @@ StatusCode ToolSvc::create( const std::string& tooltype, const std::string& tool // to downcast IAlgTool to AlgTool in order to set the properties via the JobOptions // service AlgTool* mytool = dynamic_cast( toolguard.get() ); - if ( mytool ) { - StatusCode sc = mytool->setProperties(); - if ( UNLIKELY( sc.isFailure() ) ) { - error() << "Error setting properties for tool '" << fullname << "'" << endmsg; - return sc; - } - } + if ( mytool ) mytool->setPropertiesFrom( serviceLocator()->getOptsSvc() ); // Initialize the Tool StatusCode sc( StatusCode::FAILURE, true ); diff --git a/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.h b/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.h index 8369fa0cfc..423663eaa3 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.h +++ b/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.h @@ -30,8 +30,6 @@ public: /// Destructor. ~ToolSvc() override; - /// Initialize the service. - StatusCode initialize() override; /// Finalize the service. StatusCode finalize() override; diff --git a/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.cpp b/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.cpp index 2e74d2d212..d6b644e341 100644 --- a/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.cpp +++ b/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.cpp @@ -52,25 +52,6 @@ IncidentSvc::IncidentSvc( const std::string& name, ISvcLocator* svc ) : base_cla // ============================================================================ IncidentSvc::~IncidentSvc() { std::unique_lock lock( m_listenerMapMutex ); } // ============================================================================ -// Inherited Service overrides: -// ============================================================================ -StatusCode IncidentSvc::initialize() -{ - // initialize the Service Base class - StatusCode sc = Service::initialize(); - if ( sc.isFailure() ) return sc; - - m_currentIncidentType = nullptr; - - // set my own (IncidentSvc) properties via the jobOptionService - sc = setProperties(); - if ( UNLIKELY( sc.isFailure() ) ) { - error() << "Could not set my properties" << endmsg; - return sc; - } - return sc; -} -// ============================================================================ StatusCode IncidentSvc::finalize() { DEBMSG << m_timer.outputUserTime( "Incident timing: Mean(+-rms)/Min/Max:%3%(+-%4%)/%6%/%7%[ms] ", System::milliSec ) diff --git a/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.h b/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.h index bd53a49065..c8e940946e 100644 --- a/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.h +++ b/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.h @@ -59,8 +59,6 @@ private: public: // Inherited Service overrides: - // - StatusCode initialize() override; StatusCode finalize() override; // IIncidentSvc interfaces overwrite diff --git a/GaudiExamples/options/FileMgrTest.opts b/GaudiExamples/options/FileMgrTest.opts index 5502d8f6df..5e2c4b0d77 100644 --- a/GaudiExamples/options/FileMgrTest.opts +++ b/GaudiExamples/options/FileMgrTest.opts @@ -13,7 +13,7 @@ ApplicationMgr.TopAlg = { "FileMgrTest" }; // Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) MessageSvc.OutputLevel = 3; -MessageSvc.UseColors = true; +MessageSvc.useColors = true; FileMgrTest.OutputLevel = 2; FileMgr.OutputLevel = 2; FileMgr.LogFile = "filemgr.log"; diff --git a/GaudiExamples/options/THistRead.opts b/GaudiExamples/options/THistRead.opts index a3d208430f..9a5ffad2c9 100644 --- a/GaudiExamples/options/THistRead.opts +++ b/GaudiExamples/options/THistRead.opts @@ -13,7 +13,7 @@ ApplicationMgr.TopAlg = { "THistRead" }; // Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) MessageSvc.OutputLevel = 3; -MessageSvc.UseColors = true; +MessageSvc.useColors = true; THistSvc.OutputLevel = 2; ApplicationMgr.OutputLevel = 1; ServiceManager.OutputLevel = 2; diff --git a/GaudiExamples/options/THistWrite.opts b/GaudiExamples/options/THistWrite.opts index a56efac6d7..fbfa5d5ef5 100644 --- a/GaudiExamples/options/THistWrite.opts +++ b/GaudiExamples/options/THistWrite.opts @@ -13,7 +13,7 @@ ApplicationMgr.TopAlg = { "THistWrite" }; // Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) MessageSvc.OutputLevel = 3; -MessageSvc.UseColors = true; +MessageSvc.useColors = true; THistSvc.OutputLevel = 2; ApplicationMgr.OutputLevel = 1; ServiceManager.OutputLevel = 2; diff --git a/GaudiExamples/src/RandomNumber/RandomNumberAlg.cpp b/GaudiExamples/src/RandomNumber/RandomNumberAlg.cpp index 813c873db3..7af1e17ddd 100644 --- a/GaudiExamples/src/RandomNumber/RandomNumberAlg.cpp +++ b/GaudiExamples/src/RandomNumber/RandomNumberAlg.cpp @@ -46,8 +46,9 @@ RandomNumberAlg::~RandomNumberAlg() // nothing apart from print out info messages. StatusCode RandomNumberAlg::initialize() { - // Use the Job options service to set the Algorithm's parameters - StatusCode status = setProperties(); + StatusCode status = Algorithm::initialize(); + if ( !status ) return status; + // // The first example is for purists: // Every step is done by hand....tends to become complicated, diff --git a/GaudiKernel/Gaudi/Algorithm.h b/GaudiKernel/Gaudi/Algorithm.h index 3977abfe8f..7320960ba7 100644 --- a/GaudiKernel/Gaudi/Algorithm.h +++ b/GaudiKernel/Gaudi/Algorithm.h @@ -331,15 +331,6 @@ namespace Gaudi /// register for Algorithm Context Service? bool registerContext() const { return m_registerContext; } - /** Set the algorithm's properties. - * This method requests the job options service - * to set the values of any declared properties. - * The method is invoked from within sysInitialize() by the framework - * and does not need to be explicitly - * called by a concrete algorithm. - */ - StatusCode setProperties(); - // ========================================================================== using PropertyHolderImpl::declareProperty; diff --git a/GaudiKernel/GaudiKernel/AlgTool.h b/GaudiKernel/GaudiKernel/AlgTool.h index 1e67c3c464..a7a157f053 100644 --- a/GaudiKernel/GaudiKernel/AlgTool.h +++ b/GaudiKernel/GaudiKernel/AlgTool.h @@ -31,6 +31,7 @@ class ToolHandleInfo; #include // Forward declarations +class ToolSvc; /** @class AlgTool AlgTool.h GaudiKernel/AlgTool.h * @@ -48,6 +49,8 @@ class GAUDI_API AlgTool : public DataHandleHolderBase< PropertyHolder>>> { + friend ToolSvc; + public: using Factory = Gaudi::PluginService::Factory; @@ -115,13 +118,6 @@ public: /// The standard ToolSvc service, Return a pointer to the service if present IToolSvc* toolSvc() const; - /** Method for setting declared properties to the values specified in the - * jobOptions via the job option service. This method is called by the - * ToolSvc after creating the concrete tool, before passing it to the - * requesting parent and does not need to be called explicitly. - */ - StatusCode setProperties(); - /** Access a service by name, * creating it if it doesn't already exist. */ diff --git a/GaudiKernel/GaudiKernel/Auditor.h b/GaudiKernel/GaudiKernel/Auditor.h index b09ed9ac67..e82b02b1ae 100644 --- a/GaudiKernel/GaudiKernel/Auditor.h +++ b/GaudiKernel/GaudiKernel/Auditor.h @@ -121,13 +121,6 @@ public: return serviceLocator()->service( name, createIf ); } - /** Set the auditor's properties. This method requests the job options service - to set the values of any declared properties. The method is invoked from - within sysInitialize() by the framework and does not need to be explicitly - called by a concrete auditor. - */ - StatusCode setProperties(); - private: std::string m_name; ///< Auditor's name for identification diff --git a/GaudiKernel/GaudiKernel/PropertyHolder.h b/GaudiKernel/GaudiKernel/PropertyHolder.h index dddbd87024..aaa069f5c8 100644 --- a/GaudiKernel/GaudiKernel/PropertyHolder.h +++ b/GaudiKernel/GaudiKernel/PropertyHolder.h @@ -24,6 +24,7 @@ #include "GaudiKernel/Property.h" #include "GaudiKernel/detected.h" +#include "Gaudi/Interfaces/IOptionsSvc.h" // ============================================================================ namespace Gaudi { @@ -140,7 +141,7 @@ public: if ( !rsvc ) return nullptr; const std::string& nam = rname.empty() ? name : rname; Gaudi::Details::PropertyBase* p = property( nam, rsvc->getProperties() ); - m_remoteProperties.emplace_back( name, std::make_pair( rsvc, nam ) ); + m_remoteProperties.emplace_back( RemProperty{name, rsvc, nam} ); return p; } @@ -186,6 +187,7 @@ public: return StatusCode::FAILURE; } } + inline StatusCode setProperty( const std::string& n, const char* v ) { return setProperty( n, std::string{v} ); } /** set the property form the value * * @code @@ -292,14 +294,29 @@ protected: if ( lp ) return lp; // look for remote property for ( const auto& it : m_remoteProperties ) { - if ( !Gaudi::Utils::iequal( it.first, name ) ) continue; - const IProperty* p = it.second.first; + if ( !Gaudi::Utils::iequal( it.name, name ) ) continue; + const IProperty* p = it.owner; if ( !p ) continue; - return property( it.second.second, p->getProperties() ); + return property( it.remName, p->getProperties() ); } return nullptr; // RETURN } + void setPropertiesFrom( const Gaudi::Interfaces::IOptionsSvc& optsSvc ) + { + auto set_prop = [&optsSvc, this]( auto prop ) { + const std::string prop_full_name = this->name() + '.' + prop->name(); + if ( optsSvc.has( prop_full_name ) ) { + if ( !prop->fromString( optsSvc.get( prop_full_name ) ) ) + throw std::invalid_argument( "cannot set " + prop->name() + " of " + this->name() ); + } + }; + std::for_each( begin( m_properties ), end( m_properties ), set_prop ); + std::for_each( begin( m_remoteProperties ), end( m_remoteProperties ), [&set_prop, this]( auto& rem ) { + if ( rem.owner ) set_prop( this->property( rem.remName, rem.owner->getProperties() ) ); + } ); + } + private: /// get the property by name form the proposed list Gaudi::Details::PropertyBase* property( const std::string& name, @@ -325,7 +342,11 @@ private: } typedef std::vector Properties; - typedef std::pair> RemProperty; + struct RemProperty { + std::string name; + IProperty* owner = nullptr; + std::string remName; + }; typedef std::vector RemoteProperties; /// Collection of all declared properties. diff --git a/GaudiKernel/GaudiKernel/Service.h b/GaudiKernel/GaudiKernel/Service.h index 511ed7ddac..c778ac3ac7 100644 --- a/GaudiKernel/GaudiKernel/Service.h +++ b/GaudiKernel/GaudiKernel/Service.h @@ -73,11 +73,6 @@ public: /** Retrieve pointer to service locator */ SmartIF& serviceLocator() const override; - /** Method for setting declared properties to the values - specified for the job. - */ - StatusCode setProperties(); - /** Access a service by name, creating it if it doesn't already exist. */ template diff --git a/GaudiKernel/src/Lib/AlgTool.cpp b/GaudiKernel/src/Lib/AlgTool.cpp index 3a93ef5748..625a5c64a8 100644 --- a/GaudiKernel/src/Lib/AlgTool.cpp +++ b/GaudiKernel/src/Lib/AlgTool.cpp @@ -112,17 +112,6 @@ IToolSvc* AlgTool::toolSvc() const return m_ptoolSvc.get(); } -//------------------------------------------------------------------------------ -StatusCode AlgTool::setProperties() -//------------------------------------------------------------------------------ -{ - if ( !m_svcLocator ) return StatusCode::FAILURE; - auto jos = m_svcLocator->service( "JobOptionsSvc" ); - if ( !jos ) return StatusCode::FAILURE; - - return jos->setMyProperties( name(), this ); -} - //------------------------------------------------------------------------------ AlgTool::AlgTool( const std::string& type, const std::string& name, const IInterface* parent ) //------------------------------------------------------------------------------ diff --git a/GaudiKernel/src/Lib/Algorithm.cpp b/GaudiKernel/src/Lib/Algorithm.cpp index d2bccb846f..a8b53a0120 100644 --- a/GaudiKernel/src/Lib/Algorithm.cpp +++ b/GaudiKernel/src/Lib/Algorithm.cpp @@ -64,8 +64,12 @@ namespace Gaudi // has already been initialized. if ( Gaudi::StateMachine::INITIALIZED <= FSMState() ) return StatusCode::SUCCESS; + // this initializes the messaging, in case property update handlers need to print + // and update the property value bypassing the update handler + m_outputLevel.value() = setUpMessaging(); + // Set the Algorithm's properties - if ( !setProperties() ) return StatusCode::FAILURE; + setPropertiesFrom( serviceLocator()->getOptsSvc() ); // Bypass the initialization if the algorithm is disabled. // Need to do this after setProperties. @@ -718,20 +722,6 @@ namespace Gaudi return *const_cast*>( &m_pSvcLocator ); } - // Use the job options service to set declared properties - StatusCode Algorithm::setProperties() - { - if ( !m_pSvcLocator ) return StatusCode::FAILURE; - auto jos = m_pSvcLocator->service( "JobOptionsSvc" ); - if ( !jos ) return StatusCode::FAILURE; - - // this initializes the messaging, in case property update handlers need to print - // and update the property value bypassing the update handler - m_outputLevel.value() = setUpMessaging(); - - return jos->setMyProperties( name(), this ); - } - void Algorithm::initToolHandles() const { diff --git a/GaudiKernel/src/Lib/Auditor.cpp b/GaudiKernel/src/Lib/Auditor.cpp index 3c9faaffb6..ddf9ca4d28 100644 --- a/GaudiKernel/src/Lib/Auditor.cpp +++ b/GaudiKernel/src/Lib/Auditor.cpp @@ -23,8 +23,13 @@ StatusCode Auditor::sysInitialize() // Setup the default service ... this should be upgraded so as to be configurable. if ( !m_pSvcLocator ) return StatusCode::FAILURE; - // Set the Auditor's properties - sc = setProperties(); + // this initializes the messaging, in case property update handlers need to print + // and update the property value bypassing the update handler + m_outputLevel.value() = setUpMessaging(); + + // Set the Algorithm's properties + setPropertiesFrom( serviceLocator()->getOptsSvc() ); + if ( !sc.isSuccess() ) return StatusCode::FAILURE; { @@ -199,17 +204,3 @@ const std::string& Auditor::name() const { return m_name; } bool Auditor::isEnabled() const { return m_isEnabled; } SmartIF& Auditor::serviceLocator() const { return m_pSvcLocator; } - -// Use the job options service to set declared properties -StatusCode Auditor::setProperties() -{ - if ( !m_pSvcLocator ) return StatusCode::FAILURE; - auto jos = service( "JobOptionsSvc" ); - if ( !jos ) return StatusCode::FAILURE; - - // this initializes the messaging, in case property update handlers need to print - // and update the property value bypassing the update handler - m_outputLevel.value() = setUpMessaging(); - - return jos->setMyProperties( name(), this ); -} diff --git a/GaudiKernel/src/Lib/Bootstrap.cpp b/GaudiKernel/src/Lib/Bootstrap.cpp index 1e8a7d9fd5..0e32d3f632 100644 --- a/GaudiKernel/src/Lib/Bootstrap.cpp +++ b/GaudiKernel/src/Lib/Bootstrap.cpp @@ -240,6 +240,10 @@ IInterface* PyHelper( getService )( IInterface* app, char* name ) auto svcloc = SmartIF( app ); return svcloc ? svcloc->service( name ).get() : nullptr; } +Gaudi::Interfaces::IOptionsSvc* PyHelper( getOptionsSvc )( IInterface* app ) +{ + return &( SmartIF( app )->getOptsSvc() ); +} bool PyHelper( setProperty )( IInterface* p, char* name, char* value ) { auto prop = SmartIF( p ); @@ -255,10 +259,9 @@ bool PyHelper( configureApp )( IInterface* app ) auto ui = SmartIF( app ); return ui && ui->configure().isSuccess(); } -bool PyHelper( addPropertyToCatalogue )( IInterface* p, char* comp, char* name, char* value ) +void PyHelper( setOption )( Gaudi::Interfaces::IOptionsSvc* opts, char* name, char* value ) { - auto jos = SmartIF( p ); - return jos && jos->addPropertyToCatalogue( comp, Gaudi::Property( name, value ) ).isSuccess(); + opts->set( name, value ); } int PyHelper( ROOT_VERSION_CODE )() { return ROOT_VERSION_CODE; } diff --git a/GaudiKernel/src/Lib/Service.cpp b/GaudiKernel/src/Lib/Service.cpp index 3f385f924d..55bc2f335b 100644 --- a/GaudiKernel/src/Lib/Service.cpp +++ b/GaudiKernel/src/Lib/Service.cpp @@ -37,8 +37,14 @@ void Service::sysInitialize_imp() // check if we want to audit the initialize ( m_auditorInitialize ) ? auditorSvc().get() : nullptr, IAuditor::Initialize ); - m_initSC = setProperties(); - if ( !m_initSC ) return; + // initialize messaging (except for MessageSvc) + if ( name() != "MessageSvc" ) { + // this initializes the messaging, in case property update handlers need to print + // and update the property value bypassing the update handler + m_outputLevel.value() = setUpMessaging(); + } + + setPropertiesFrom( serviceLocator()->getOptsSvc() ); m_initSC = initialize(); // This should change the state to Gaudi::StateMachine::CONFIGURED if ( m_initSC.isSuccess() ) m_state = m_targetState; @@ -290,25 +296,6 @@ const std::string& Service::name() const { return m_name; } //--- Retrieve pointer to service locator SmartIF& Service::serviceLocator() const { return m_svcLocator; } -// Use the job options service to set declared properties -StatusCode Service::setProperties() -{ - const bool CREATEIF( true ); - auto jos = serviceLocator()->service( "JobOptionsSvc", CREATEIF ); - if ( !jos ) { - throw GaudiException( "Service [JobOptionsSvc] not found", name(), StatusCode::FAILURE ); - } - - // initialize messaging (except for MessageSvc) - if ( name() != "MessageSvc" ) { - // this initializes the messaging, in case property update handlers need to print - // and update the property value bypassing the update handler - m_outputLevel.value() = setUpMessaging(); - } - - return jos->setMyProperties( name(), this ); -} - //--- Local methods // Standard Constructor Service::Service( std::string name, ISvcLocator* svcloc ) : m_name( std::move( name ) ), m_svcLocator( svcloc ) diff --git a/GaudiPartProp/src/ParticlePropertySvc.cpp b/GaudiPartProp/src/ParticlePropertySvc.cpp index 2d19114c27..35354c2297 100644 --- a/GaudiPartProp/src/ParticlePropertySvc.cpp +++ b/GaudiPartProp/src/ParticlePropertySvc.cpp @@ -62,12 +62,6 @@ namespace Gaudi return sc; } - sc = setProperties(); - if ( sc.isFailure() ) { - error() << " Could not set the properties " << endmsg; - return sc; - } - m_fileAccess = service( "VFSSvc" ); if ( !m_fileAccess ) { error() << " Cannot retrieve the VFS service " << endmsg; diff --git a/GaudiSvc/options/MultiStore.opts b/GaudiSvc/options/MultiStore.opts index 9c781d1572..276567d5b8 100644 --- a/GaudiSvc/options/MultiStore.opts +++ b/GaudiSvc/options/MultiStore.opts @@ -3,7 +3,7 @@ EventDataSvc.Partitions = {"NAME='Buffer1' TYPE='EvtDataSvc/EvtBuff1'", "NAME='Buffer2' TYPE='EvtDataSvc/EvtBuff2'"}; EventDataSvc.DefaultPartition = "Buffer1"; ApplicationMgr.TopAlg += { "PartitionSwitchAlg/Switcher", "StoreExplorerAlg/Exp" }; -Exp.Printfreq = 1.0; +Exp.PrintFreq = 1.0; Switcher.Partition = "Buffer2"; Switcher.Tool = "PartitionSwitchTool"; Switcher.PartitionSwitchTool.Actor = "EventDataSvc"; diff --git a/GaudiSvc/options/StoreExplorer.opts b/GaudiSvc/options/StoreExplorer.opts index ed0ef55374..5af798d84e 100644 --- a/GaudiSvc/options/StoreExplorer.opts +++ b/GaudiSvc/options/StoreExplorer.opts @@ -1,5 +1,3 @@ ApplicationMgr.TopAlg += { "StoreExplorerAlg/Explorer" }; -Explorer.Printfreq = 1.0; +Explorer.PrintFreq = 1.0; Explorer.Load = 1; - - diff --git a/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp b/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp index be353e9068..03f1e1e825 100644 --- a/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp +++ b/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp @@ -59,19 +59,16 @@ StatusCode NTupleSvc::initialize() { StatusCode status = DataSvc::initialize(); if ( status.isSuccess() ) { - status = setProperties(); - if ( status.isSuccess() ) { - StatusCode iret( StatusCode::SUCCESS, true ); - DataObject* root = new NTuple::Directory(); - status = setRoot( m_rootName, root ); - for ( auto& i : m_output ) { - iret = connect( i ); - if ( !iret.isSuccess() ) status = iret; - } - for ( auto& j : m_input ) { - iret = connect( j ); - if ( !iret.isSuccess() ) status = iret; - } + StatusCode iret( StatusCode::SUCCESS, true ); + DataObject* root = new NTuple::Directory(); + status = setRoot( m_rootName, root ); + for ( auto& i : m_output ) { + iret = connect( i ); + if ( !iret.isSuccess() ) status = iret; + } + for ( auto& j : m_input ) { + iret = connect( j ); + if ( !iret.isSuccess() ) status = iret; } } return status; diff --git a/GaudiSvc/src/RndmGenSvc/RndmEngine.cpp b/GaudiSvc/src/RndmGenSvc/RndmEngine.cpp index 5f67f0be1a..c574a2ff6e 100644 --- a/GaudiSvc/src/RndmGenSvc/RndmEngine.cpp +++ b/GaudiSvc/src/RndmGenSvc/RndmEngine.cpp @@ -27,14 +27,6 @@ #include "GaudiKernel/MsgStream.h" #include "RndmEngine.h" -/// Service override: initialization -StatusCode RndmEngine::initialize() -{ - StatusCode status = Service::initialize(); - if ( status.isSuccess() ) status = setProperties(); - return status; -} - /** IRndmEngine interface implementation */ /// Input serialization from stream buffer. Restores the status of the generator engine. StreamBuffer& RndmEngine::serialize( StreamBuffer& str ) { return str; } diff --git a/GaudiSvc/src/RndmGenSvc/RndmEngine.h b/GaudiSvc/src/RndmGenSvc/RndmEngine.h index c733c161b8..7dad40f222 100644 --- a/GaudiSvc/src/RndmGenSvc/RndmEngine.h +++ b/GaudiSvc/src/RndmGenSvc/RndmEngine.h @@ -46,8 +46,6 @@ protected: using extends::extends; public: - /// Service override: initialization - StatusCode initialize() override; /// Single shot returning single random number double rndm() const override; /** Multiple shots returning vector with flat random numbers. diff --git a/GaudiSvc/src/RndmGenSvc/RndmGenSvc.cpp b/GaudiSvc/src/RndmGenSvc/RndmGenSvc.cpp index f1b9921a3b..9e47f7792d 100644 --- a/GaudiSvc/src/RndmGenSvc/RndmGenSvc.cpp +++ b/GaudiSvc/src/RndmGenSvc/RndmGenSvc.cpp @@ -38,26 +38,23 @@ StatusCode RndmGenSvc::initialize() auto mgr = serviceLocator()->as(); if ( status.isSuccess() ) { - status = setProperties(); - if ( status.isSuccess() ) { // Check if the Engine service exists: - // FIXME: (MCl) why RndmGenSvc cannot create the engine service in a standard way? - const bool CREATE = false; - std::string machName = name() + ".Engine"; - auto engine = serviceLocator()->service( machName, CREATE ); - if ( !engine && mgr ) { - using Gaudi::Utils::TypeNameString; - engine = mgr->createService( TypeNameString( machName, m_engineName ) ); - } - if ( engine ) { - auto serial = engine.as(); - auto service = engine.as(); - if ( serial && service ) { - status = service->sysInitialize(); - if ( status.isSuccess() ) { - m_engine = engine; - m_serialize = serial; - info() << "Using Random engine:" << m_engineName.value() << endmsg; - } + // FIXME: (MCl) why RndmGenSvc cannot create the engine service in a standard way? + const bool CREATE = false; + std::string machName = name() + ".Engine"; + auto engine = serviceLocator()->service( machName, CREATE ); + if ( !engine && mgr ) { + using Gaudi::Utils::TypeNameString; + engine = mgr->createService( TypeNameString( machName, m_engineName ) ); + } + if ( engine ) { + auto serial = engine.as(); + auto service = engine.as(); + if ( serial && service ) { + status = service->sysInitialize(); + if ( status.isSuccess() ) { + m_engine = engine; + m_serialize = serial; + info() << "Using Random engine:" << m_engineName.value() << endmsg; } } } diff --git a/RootHistCnv/src/PersSvc.cpp b/RootHistCnv/src/PersSvc.cpp index 803fc91e54..531e784b71 100644 --- a/RootHistCnv/src/PersSvc.cpp +++ b/RootHistCnv/src/PersSvc.cpp @@ -37,11 +37,6 @@ StatusCode RootHistCnv::PersSvc::initialize() StatusCode status = ConversionSvc::initialize(); if ( status.isFailure() ) return status; - // Get my properties from the JobOptionsSvc - if ( setProperties().isFailure() ) { - error() << "Could not set my properties" << endmsg; - return StatusCode::FAILURE; - } if ( m_outputEnabled ) { // Initialize ROOT if output file name is defined if ( undefFileName != m_defFileName ) { -- GitLab From 27b061630570db92ba976d66f7c9e2eee3085054 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Mon, 18 Dec 2017 13:01:45 +0100 Subject: [PATCH 06/62] Removed use of JobOptionsSvc deprecated methods --- GaudiAlg/src/lib/GaudiCommon.icpp | 26 ++++----- GaudiAlg/src/lib/GaudiSequencer.cpp | 40 ++++++-------- .../HistogramPersistencySvc.cpp | 14 +++-- GaudiExamples/src/Properties/PropertyAlg.cpp | 38 ++++++------- .../src/Properties/PropertyProxy.cpp | 22 ++++---- GaudiExamples/tests/qmtest/refs/History.ref | 3 +- .../tests/qmtest/refs/MetaDataSvc.ref | 8 +-- .../tests/qmtest/refs/Properties.ref | 54 +++++++++++++++---- .../tests/qmtest/refs/Properties2.ref | 43 +++++++++++---- .../tests/qmtest/refs/Properties_py.ref | 40 +++++++++++--- GaudiExamples/tests/qmtest/refs/THistRead.ref | 1 + .../tests/qmtest/refs/THistWrite.ref | 1 + .../qmtest/refs/conditional_output/write.ref | 3 -- GaudiKernel/GaudiKernel/JobHistory.h | 3 +- GaudiKernel/src/Lib/JobHistory.cpp | 19 ++++++- GaudiMonitor/src/HistorySvc.cpp | 35 +++++------- GaudiPolicy/python/GaudiTesting/BaseTest.py | 2 + GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp | 16 ++---- RootHistCnv/src/RFileCnv.cpp | 14 +++-- 19 files changed, 221 insertions(+), 161 deletions(-) diff --git a/GaudiAlg/src/lib/GaudiCommon.icpp b/GaudiAlg/src/lib/GaudiCommon.icpp index 28c6d2e079..6654b5a5a7 100644 --- a/GaudiAlg/src/lib/GaudiCommon.icpp +++ b/GaudiAlg/src/lib/GaudiCommon.icpp @@ -75,23 +75,15 @@ void GaudiCommon::initGaudiCommonConstructor( const IInterface* parent ) } } - // Get the job option service - auto jos = PBASE::template service( "JobOptionsSvc" ); - if ( !jos ) Exception( "Cannot get JobOptionsSvc" ); - - // Get the "Context" option if in the file... - const auto myList = jos->getProperties( this->name() ); - if ( myList ) { - // Iterate over the list to set the options - for ( const auto& iter : *myList ) { - const Gaudi::Property* sp = dynamic_cast*>( iter ); - if ( sp ) { - if ( iter->name().compare( "Context" ) == 0 ) { - m_context = sp->value(); - } else if ( iter->name().compare( "RootInTES" ) == 0 ) { - m_rootInTES = sp->value(); - } - } + // Get options values from IOptionsSvc + // \fixme this part is not needed because this method is called in the constructor, + // and properties are, anyway, set during the initialize... except for Context and + // RootInTES which might be set in the contructor by GaudiSequencer. + const auto& optsSvc = this->serviceLocator()->getOptsSvc(); + for ( auto p : {"Context", "RootInTES"} ) { + const std::string key = this->name() + '.' + p; + if ( optsSvc.has( key ) ) { + this->setProperty( p, optsSvc.get( key ) ).ignore(); } } } diff --git a/GaudiAlg/src/lib/GaudiSequencer.cpp b/GaudiAlg/src/lib/GaudiSequencer.cpp index 7cc52a5dce..d6ef303611 100644 --- a/GaudiAlg/src/lib/GaudiSequencer.cpp +++ b/GaudiAlg/src/lib/GaudiSequencer.cpp @@ -1,5 +1,6 @@ // Include files #include +#include #include // from Gaudi @@ -17,13 +18,6 @@ namespace bool isDefault( const std::string& s ) { return s.empty(); } - template - bool veto( const Container* props, const char* name ) - { // avoid changing properties explicitly present in the JOS... - return props && - std::any_of( begin( *props ), end( *props ), [name]( const auto* prop ) { return prop->name() == name; } ); - } - template void for_each_arg( F&& f, Args&&... args ) { @@ -37,33 +31,33 @@ namespace // set a-priori (effectively inheriting their values from the GaudiSequencer) class populate_JobOptionsSvc_t { - std::vector m_props; - IJobOptionsSvc* m_jos; - std::string m_name; + std::vector m_props; + Gaudi::Interfaces::IOptionsSvc& m_optsSvc; + std::string m_name; - template - void addPropertyToCatalogue( const Properties* props, const std::tuple& arg ) + template + void addPropertyToCatalogue( const std::tuple& arg ) { - const auto& key = std::get<0>( arg ); + const auto& key = m_name + '.' + std::get<0>( arg ); const auto& value = std::get<1>( arg ); - if ( isDefault( value ) || veto( props, key ) ) return; - m_jos->addPropertyToCatalogue( m_name, Gaudi::Property>{key, value} ).ignore(); + if ( isDefault( value ) || m_optsSvc.has( key ) ) return; + std::stringstream ss; + ss << quoted( value ); + m_optsSvc.set( key, ss.str() ); m_props.push_back( key ); } public: template - populate_JobOptionsSvc_t( std::string name, IJobOptionsSvc* jos, Args&&... args ) - : m_jos{jos}, m_name{std::move( name )} + populate_JobOptionsSvc_t( std::string name, Gaudi::Interfaces::IOptionsSvc& optsSvc, Args&&... args ) + : m_optsSvc{optsSvc}, m_name{std::move( name )} { - const auto* props = m_jos->getProperties( m_name ); - for_each_arg( [&]( auto&& arg ) { this->addPropertyToCatalogue( props, std::forward( arg ) ); }, + for_each_arg( [&]( auto&& arg ) { this->addPropertyToCatalogue( std::forward( arg ) ); }, std::forward( args )... ); } ~populate_JobOptionsSvc_t() { - std::for_each( begin( m_props ), end( m_props ), - [&]( const std::string& key ) { m_jos->removePropertyFromCatalogue( m_name, key ).ignore(); } ); + std::for_each( begin( m_props ), end( m_props ), [&]( const std::string& key ) { m_optsSvc.pop( key ); } ); } }; } @@ -188,7 +182,6 @@ StatusCode GaudiSequencer::decodeNames() m_entries.clear(); //== Get the "Context" option if in the file... - auto jos = service( "JobOptionsSvc" ); //= Get the Application manager, to see if algorithm exist auto appMgr = service( "ApplicationMgr" ); @@ -204,7 +197,8 @@ StatusCode GaudiSequencer::decodeNames() // ensure some magic properties are set while we create the subalgorithm so // that it effectively inherites 'our' settings -- if they have non-default // values... and are not set explicitly already. - populate_JobOptionsSvc_t populate_guard{theName, jos, std::forward_as_tuple( "Context", context() ), + populate_JobOptionsSvc_t populate_guard{theName, serviceLocator()->getOptsSvc(), + std::forward_as_tuple( "Context", context() ), std::forward_as_tuple( "RootInTES", rootInTES() )}; Gaudi::Algorithm* myAlg = nullptr; result = createSubAlgorithm( theType, theName, myAlg ); diff --git a/GaudiCommonSvc/src/HistogramPersistencySvc/HistogramPersistencySvc.cpp b/GaudiCommonSvc/src/HistogramPersistencySvc/HistogramPersistencySvc.cpp index a2a179fc7e..3b3d199742 100644 --- a/GaudiCommonSvc/src/HistogramPersistencySvc/HistogramPersistencySvc.cpp +++ b/GaudiCommonSvc/src/HistogramPersistencySvc/HistogramPersistencySvc.cpp @@ -107,14 +107,12 @@ StatusCode HistogramPersistencySvc::reinitialize() // To keep backward compatibility, we set the property of conversion service // into JobOptions catalogue if ( !m_outputFile.empty() ) { - auto joptsvc = serviceLocator()->service( "JobOptionsSvc" ); - if ( joptsvc ) { - Gaudi::Property p( "OutputFile", m_outputFile ); - if ( m_histPersName == "ROOT" ) { - joptsvc->addPropertyToCatalogue( "RootHistSvc", p ).ignore(); - } else if ( m_histPersName == "HBOOK" ) { - joptsvc->addPropertyToCatalogue( "HbookHistSvc", p ).ignore(); - } + auto& opts = serviceLocator()->getOptsSvc(); + const std::string outputFile = '"' + m_outputFile + '"'; + if ( m_histPersName == "ROOT" ) { + opts.set( "RootHistSvc.OutputFile", outputFile ); + } else if ( m_histPersName == "HBOOK" ) { + opts.set( "HbookHistSvc.OutputFile", outputFile ); } } diff --git a/GaudiExamples/src/Properties/PropertyAlg.cpp b/GaudiExamples/src/Properties/PropertyAlg.cpp index a501d7d825..23c44c85b7 100644 --- a/GaudiExamples/src/Properties/PropertyAlg.cpp +++ b/GaudiExamples/src/Properties/PropertyAlg.cpp @@ -240,34 +240,30 @@ StatusCode PropertyAlg::initialize() newlog << MSG::ALWAYS << "This should be printed ALWAYS" << endmsg; // Testing access to the JobOptions catalogue - auto jopts = service( "JobOptionsSvc" ); - if ( !jopts ) { - error() << " Unable to access the JobOptionsSvc" << endmsg; - return StatusCode::SUCCESS; - } + auto& opts = serviceLocator()->getOptsSvc(); // Dump of the catalogue info() << "=================================================" << endmsg; - info() << "Dump of the property catalogue.... " << endmsg; - for ( const auto& cit : jopts->getClients() ) { - using GaudiUtils::details::ostream_joiner; - ostream_joiner( - info() << " Properties of " << cit << ": ", *jopts->getProperties( cit ), ", ", - []( MsgStream& os, const Gaudi::Details::PropertyBase* p ) -> MsgStream& { return os << p->name(); } ) - << endmsg; - } + using GaudiUtils::details::ostream_joiner; + ostream_joiner( info() << "Dump of the property catalogue:\n", opts.items(), '\n', + []( MsgStream& os, const auto& item ) -> MsgStream& { + return os << std::get<0>( item ) << ": " << std::get<1>( item ); + } ) + << endmsg; info() << "=================================================" << endmsg; // Change an option of my own.... - jopts->addPropertyToCatalogue( name(), Gaudi::Property( "PInt", "155" ) ).ignore(); - Gaudi::Property> sap( "DoubleArray", {"12.12", "13.13"} ); - if ( jopts->addPropertyToCatalogue( name(), sap ).isSuccess() ) { - info() << "Changed property DoubleArray in catalogue" << endmsg; - jopts->setMyProperties( name(), this ).ignore(); - info() << "DoubleArray = " << m_doublearray.value() << endmsg; - } else { - error() << "Unable to change property in catalogue" << endmsg; + opts.set( name() + '.' + "PInt", "155" ); + setPropertiesFrom( opts ); + // trying to use an invalid value + opts.set( name() + '.' + "DoubleArray", "{\"12.12\", \"13.13\"}" ); + info() << "Changed property DoubleArray in catalogue" << endmsg; + try { + setPropertiesFrom( opts ); + } catch ( const std::invalid_argument& exc ) { + error() << "got invalid_argument exception: " << exc.what() << endmsg; } + info() << "DoubleArray = " << m_doublearray.value() << endmsg; info() << "=================================================" << endmsg; return StatusCode::SUCCESS; } diff --git a/GaudiExamples/src/Properties/PropertyProxy.cpp b/GaudiExamples/src/Properties/PropertyProxy.cpp index 286cf59bac..b5843280d8 100644 --- a/GaudiExamples/src/Properties/PropertyProxy.cpp +++ b/GaudiExamples/src/Properties/PropertyProxy.cpp @@ -1,5 +1,5 @@ -// Include files #include "PropertyProxy.h" + #include "GaudiKernel/DataObject.h" #include "GaudiKernel/IAlgManager.h" #include "GaudiKernel/IChronoStatSvc.h" @@ -7,8 +7,6 @@ #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/SmartIF.h" -// Static Factory declaration - DECLARE_COMPONENT( PropertyProxy ) // Constructor @@ -31,20 +29,26 @@ PropertyProxy::PropertyProxy( const std::string& name, ISvcLocator* ploc ) : Alg //------------------------------------------------------------------------------ StatusCode PropertyProxy::initialize() { - //------------------------------------------------------------------------------ + if ( !Algorithm::initialize() ) return StatusCode::FAILURE; + std::string value( "empty" ); std::string value1( "empty" ); - this->getProperty( "RInt", value ).ignore(); + if ( !this->getProperty( "RInt", value ) ) { + warning() << "failed to get property RInt" << endmsg; + } info() << " Got property this.RInt = " << value << ";" << endmsg; - this->setProperty( "RInt", "1001" ).ignore(); - info() << " Set property this.RInt = " - << "1001" - << ";" << endmsg; + info() << " Set property this.RInt = 1001;" << endmsg; + if ( !this->setProperty( "RInt", "1001" ) ) { + warning() << "failed to set property RInt" << endmsg; + } this->getProperty( "RInt", value ).ignore(); info() << " Got property this.RInt = " << value << ";" << endmsg; + if ( value != "1001" ) { + error() << "RInt value not what expected" << endmsg; + } this->getProperty( "String", value ).ignore(); m_remAlg->getProperty( "String", value1 ).ignore(); diff --git a/GaudiExamples/tests/qmtest/refs/History.ref b/GaudiExamples/tests/qmtest/refs/History.ref index 2b56bf78e7..4f81452d58 100644 --- a/GaudiExamples/tests/qmtest/refs/History.ref +++ b/GaudiExamples/tests/qmtest/refs/History.ref @@ -86,7 +86,6 @@ ToolSvc DEBUG START transition for AlgTools ServiceManager DEBUG Starting service EventLoopMgr ServiceManager DEBUG Starting service HistorySvc ApplicationMgr INFO Application Manager Started successfully -HistorySvc VERBOSE ServiceLocatorHelper::service: found service JobOptionsSvc HistorySvc DEBUG Registering algorithm: History HistorySvc INFO Registered 1 Algorithms HistorySvc INFO Registered 0 AlgTools @@ -174,7 +173,7 @@ StatusCodeSvc DEBUG all StatusCode instances where checked ServiceManager DEBUG Looping over all active services... ServiceManager DEBUG ---- StatusCodeSvc (refCount = 3) ServiceManager DEBUG ---- MessageSvc (refCount = 22) -ServiceManager DEBUG ---- JobOptionsSvc (refCount = 5) +ServiceManager DEBUG ---- JobOptionsSvc (refCount = 4) ServiceManager DEBUG ---- HistorySvc (refCount = 3) ServiceManager DEBUG ---- HistogramPersistencySvc (refCount = 3) ServiceManager DEBUG ---- HistogramDataSvc (refCount = 4) diff --git a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref index cdb8a47918..7129dbcbaa 100644 --- a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref +++ b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref @@ -131,11 +131,11 @@ NTupleSvc.Output:[ "MYLUN DATAFILE='TupleEx.root' OPT='NEW' TYP='ROOT'" ] NTupleSvc.OutputLevel:3 NTupleSvc.RootCLID:1 NTupleSvc.RootName:/NTUPLES -RFileCnv.GlobalCompression:LZMA:6 +RFileCnv.GlobalCompression:"LZMA:6" ToolSvc: -Tuple.NTupleLUN:MYLUN -Tuple2.NTupleLUN:MYLUN -Tuple3.NTupleLUN:MYLUN +Tuple.NTupleLUN:"MYLUN" +Tuple2.NTupleLUN:"MYLUN" +Tuple3.NTupleLUN:"MYLUN" ApplicationMgr INFO Application Manager Started successfully RFileCnv INFO opening Root file "TupleEx.root" for writing, CompressionLevel='LZMA:6' diff --git a/GaudiExamples/tests/qmtest/refs/Properties.ref b/GaudiExamples/tests/qmtest/refs/Properties.ref index 05cb395188..05e01a299e 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties.ref @@ -146,24 +146,56 @@ MsgTest ERROR This should be printed if threshold is ERROR MsgTest FATAL This should be printed if threshold is FATAL MsgTest SUCCESS This should be printed ALWAYS PropertyAlg INFO ================================================= -PropertyAlg INFO Dump of the property catalogue.... -PropertyAlg INFO Properties of ApplicationMgr: EvtMax, EvtSel, HistogramPersistency, StatusCodeCheck, TopAlg -PropertyAlg INFO Properties of AuditorSvc: Auditors -PropertyAlg INFO Properties of Dummy1: Property -PropertyAlg INFO Properties of Dummy2: Property -PropertyAlg INFO Properties of MessageSvc: OutputLevel, setDebug, setVerbose, setWarning -PropertyAlg INFO Properties of PropertyAlg: Bool, BoolArray, Double, DoubleArray, DoubleArrayWithUnits, DoubleArrayWithoutUnits, DoublePairArray, EmptyArray, Int, Int64, Int64Array, IntArray, IntPairArray, OutputLevel, PBool, PBoolArray, PDouble, PDoubleArray, PInt, PIntArray, PString, PStringArray, String, StringArray, UInt64, UInt64Array -PropertyAlg INFO Properties of PropertyProxy: String +PropertyAlg INFO Dump of the property catalogue: +ApplicationMgr.EvtMax: 1 +ApplicationMgr.EvtSel: "NONE" +ApplicationMgr.HistogramPersistency: "NONE" +ApplicationMgr.StatusCodeCheck: 1 +ApplicationMgr.TopAlg: ["PropertyAlg", "PropertyProxy"] +AuditorSvc.Auditors: ["ChronoAuditor"] +Dummy1.Property: 1 +Dummy2.Property: 1 +MessageSvc.OutputLevel: 3 +MessageSvc.setDebug: ["EventLoopMgr"] +MessageSvc.setVerbose: ["MsgTest"] +MessageSvc.setWarning: ["MsgTest"] +PropertyAlg.Bool: 0 +PropertyAlg.BoolArray: [0, 1, 0] +PropertyAlg.Double: 101.1e+10 +PropertyAlg.DoubleArray: [-11.0, 2., 3.3, 0.4e-03] +PropertyAlg.DoubleArrayWithUnits: [1100000.000000, -20.000000, 33.000000, 0.400000] +PropertyAlg.DoubleArrayWithoutUnits: [1100000.0, -20., 33.0, 0.4] +PropertyAlg.DoublePairArray: [[1.1, 2.1], [2.3, 4.5], [5.6, 6.7]] +PropertyAlg.EmptyArray: {} +PropertyAlg.Int: 101 +PropertyAlg.Int64: 4294967296 +PropertyAlg.Int64Array: [4294967296] +PropertyAlg.IntArray: [1, 2, 3, 5] +PropertyAlg.IntPairArray: [[1, 2], [3, 4], [5, 6]] +PropertyAlg.OutputLevel: 3 +PropertyAlg.PBool: 1 +PropertyAlg.PBoolArray: [1, 0, 1, 0] +PropertyAlg.PDouble: 101.E5 +PropertyAlg.PDoubleArray: [1.1, 2., 3.3] +PropertyAlg.PInt: 101 +PropertyAlg.PIntArray: [1, 2, 3, 5] +PropertyAlg.PString: "hundred one" +PropertyAlg.PStringArray: ["one", "two", "four"] +PropertyAlg.String: "hundred one" +PropertyAlg.StringArray: ["one", "two", "four"] +PropertyAlg.UInt64: 4294967296 +PropertyAlg.UInt64Array: [4294967296] +PropertyProxy.String: "This is set by the proxy" PropertyAlg INFO ================================================= -PropertyAlg INFO Changed property DoubleArray in catalogue -JobOptionsSvc ERROR Unable to set the property 'DoubleArray' of 'PropertyAlg'. Check option and algorithm names, type and bounds. PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO Update handler called for property: 'PDouble':10100000. +PropertyAlg INFO Changed property DoubleArray in catalogue +PropertyAlg ERROR got invalid_argument exception: cannot parse '{"12.12", "13.13"}' to std::vector > PropertyAlg INFO DoubleArray = [-11, 2, 3.3, 0.0004] PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; PropertyProxy INFO Set property this.RInt = 1001; -PropertyProxy INFO Got property this.RInt = 101; +PropertyProxy INFO Got property this.RInt = 1001; PropertyProxy INFO Got property this.String = This is set by the proxy; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. diff --git a/GaudiExamples/tests/qmtest/refs/Properties2.ref b/GaudiExamples/tests/qmtest/refs/Properties2.ref index 35f4a128e2..afc892dbae 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties2.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties2.ref @@ -148,22 +148,47 @@ MsgTest ERROR This should be printed if threshold is ERROR MsgTest FATAL This should be printed if threshold is FATAL MsgTest SUCCESS This should be printed ALWAYS PropertyAlg INFO ================================================= -PropertyAlg INFO Dump of the property catalogue.... -PropertyAlg INFO Properties of AuditorSvc: Auditors -PropertyAlg INFO Properties of Dummy1: Property -PropertyAlg INFO Properties of Dummy2: Property -PropertyAlg INFO Properties of PropertyAlg: Bool, BoolArray, Double, DoubleArray, DoubleArrayWithUnits, DoubleArrayWithoutUnits, DoublePairArray, EmptyArray, Int, Int64, Int64Array, IntArray, IntPairArray, OutputLevel, PBool, PBoolArray, PDouble, PDoubleArray, PInt, PIntArray, PString, PStringArray, String, StringArray, UInt64, UInt64Array -PropertyAlg INFO Properties of PropertyProxy: String +PropertyAlg INFO Dump of the property catalogue: +AuditorSvc.Auditors: ['ChronoAuditor'] +Dummy1.Property: True +Dummy2.Property: True +PropertyAlg.Bool: False +PropertyAlg.BoolArray: [False, True, False] +PropertyAlg.Double: 1.011e+12 +PropertyAlg.DoubleArray: [-11.0, 2.0, 3.3, 0.0004] +PropertyAlg.DoubleArrayWithUnits: [1100000.0, -20.0, 33.0, 0.4] +PropertyAlg.DoubleArrayWithoutUnits: [1100000.0, -20.0, 33.0, 0.4] +PropertyAlg.DoublePairArray: [(1.1, 2.1), (2.3, 4.5), (5.6, 6.7)] +PropertyAlg.EmptyArray: [] +PropertyAlg.Int: 101 +PropertyAlg.Int64: 4294967296 +PropertyAlg.Int64Array: [4294967296] +PropertyAlg.IntArray: [1, 2, 3, 5] +PropertyAlg.IntPairArray: [(1, 2), (3, 4), (5, 6)] +PropertyAlg.OutputLevel: 3 +PropertyAlg.PBool: True +PropertyAlg.PBoolArray: [True, False, True, False] +PropertyAlg.PDouble: 10100000.0 +PropertyAlg.PDoubleArray: [1.1, 2.0, 3.3] +PropertyAlg.PInt: 101 +PropertyAlg.PIntArray: [1, 2, 3, 5] +PropertyAlg.PString: "hundred one" +PropertyAlg.PStringArray: ['one', 'two', 'four'] +PropertyAlg.String: "hundred one" +PropertyAlg.StringArray: ['one', 'two', 'four'] +PropertyAlg.UInt64: 4294967296 +PropertyAlg.UInt64Array: [4294967296] +PropertyProxy.String: "This is set by the proxy" PropertyAlg INFO ================================================= -PropertyAlg INFO Changed property DoubleArray in catalogue -JobOptionsSvc ERROR Unable to set the property 'DoubleArray' of 'PropertyAlg'. Check option and algorithm names, type and bounds. PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO Update handler called for property: 'PDouble':10100000. +PropertyAlg INFO Changed property DoubleArray in catalogue +PropertyAlg ERROR got invalid_argument exception: cannot parse '{"12.12", "13.13"}' to std::vector > PropertyAlg INFO DoubleArray = [-11, 2, 3.3, 0.0004] PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; PropertyProxy INFO Set property this.RInt = 1001; -PropertyProxy INFO Got property this.RInt = 101; +PropertyProxy INFO Got property this.RInt = 1001; PropertyProxy INFO Got property this.String = This is set by the proxy; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. diff --git a/GaudiExamples/tests/qmtest/refs/Properties_py.ref b/GaudiExamples/tests/qmtest/refs/Properties_py.ref index 1806009bba..45b63bb90f 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties_py.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties_py.ref @@ -108,21 +108,45 @@ MsgTest ERROR This should be printed if threshold is ERROR MsgTest FATAL This should be printed if threshold is FATAL MsgTest SUCCESS This should be printed ALWAYS PropertyAlg INFO ================================================= -PropertyAlg INFO Dump of the property catalogue.... -PropertyAlg INFO Properties of AuditorSvc: Auditors -PropertyAlg INFO Properties of Dummy1: Property -PropertyAlg INFO Properties of Dummy2: Property -PropertyAlg INFO Properties of PropertyAlg: Bool, BoolArray, Double, DoubleArray, DoubleArrayWithUnits, DoubleArrayWithoutUnits, DoublePairArray, Int, Int64, Int64Array, IntArray, IntPairArray, OutputLevel, PBool, PBoolArray, PDouble, PDoubleArray, PInt, PIntArray, PString, PStringArray, String, StringArray, UInt64, UInt64Array +PropertyAlg INFO Dump of the property catalogue: +AuditorSvc.Auditors: ['ChronoAuditor/ChronoAuditor'] +Dummy1.Property: True +Dummy2.Property: True +PropertyAlg.Bool: False +PropertyAlg.BoolArray: [False, True, False] +PropertyAlg.Double: 1.011e+12 +PropertyAlg.DoubleArray: [-11.0, 2.0, 3.3, 0.0004, 1e-20, 1e+20] +PropertyAlg.DoubleArrayWithUnits: [1100000.0, -20.0, 33.0, 0.4] +PropertyAlg.DoubleArrayWithoutUnits: [1100000.0, -20.0, 33.0, 0.4] +PropertyAlg.DoublePairArray: [(1.1, 2.1), (2.3, 4.5), (5.6, 6.7)] +PropertyAlg.Int: 101 +PropertyAlg.Int64: 4294967296 +PropertyAlg.Int64Array: [4294967296] +PropertyAlg.IntArray: [1, 2, 3, 5] +PropertyAlg.IntPairArray: [(1, 2), (3, 4), (5, 6)] +PropertyAlg.OutputLevel: 3 +PropertyAlg.PBool: True +PropertyAlg.PBoolArray: [True, False, True, False] +PropertyAlg.PDouble: 10100000.0 +PropertyAlg.PDoubleArray: [1.1, 2.0, 3.3, 1e-20, 1e+20] +PropertyAlg.PInt: 101 +PropertyAlg.PIntArray: [1, 2, 3, 5] +PropertyAlg.PString: "hundred one" +PropertyAlg.PStringArray: ['one', 'two', 'four'] +PropertyAlg.String: "hundred one" +PropertyAlg.StringArray: ['one', 'two', 'four'] +PropertyAlg.UInt64: 4294967296 +PropertyAlg.UInt64Array: [4294967296L] PropertyAlg INFO ================================================= -PropertyAlg INFO Changed property DoubleArray in catalogue -JobOptionsSvc ERROR Unable to set the property 'DoubleArray' of 'PropertyAlg'. Check option and algorithm names, type and bounds. PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO Update handler called for property: 'PDouble':10100000. +PropertyAlg INFO Changed property DoubleArray in catalogue +PropertyAlg ERROR got invalid_argument exception: cannot parse '{"12.12", "13.13"}' to std::vector > PropertyAlg INFO DoubleArray = [-11, 2, 3.3, 0.0004, 1e-20, 1e+20] PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; PropertyProxy INFO Set property this.RInt = 1001; -PropertyProxy INFO Got property this.RInt = 101; +PropertyProxy INFO Got property this.RInt = 1001; PropertyProxy INFO Got property this.String = hundred one; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. diff --git a/GaudiExamples/tests/qmtest/refs/THistRead.ref b/GaudiExamples/tests/qmtest/refs/THistRead.ref index 359074fac7..2c4e8fff0a 100644 --- a/GaudiExamples/tests/qmtest/refs/THistRead.ref +++ b/GaudiExamples/tests/qmtest/refs/THistRead.ref @@ -30,6 +30,7 @@ ApplicationMgr DEBUG Loading declared DLL's ApplicationMgr VERBOSE added service EventLoopMgr/EventLoopMgr ApplicationMgr INFO Application Manager Configured successfully THistSvc DEBUG Property update for OutputLevel : new value = 2 +THistSvc DEBUG Delaying connection of Input Files until Initialize. now in OFFLINE THistSvc DEBUG Service base class initialized successfully THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED diff --git a/GaudiExamples/tests/qmtest/refs/THistWrite.ref b/GaudiExamples/tests/qmtest/refs/THistWrite.ref index 3c6191af31..3882b16c83 100644 --- a/GaudiExamples/tests/qmtest/refs/THistWrite.ref +++ b/GaudiExamples/tests/qmtest/refs/THistWrite.ref @@ -30,6 +30,7 @@ ApplicationMgr DEBUG Loading declared DLL's ApplicationMgr VERBOSE added service EventLoopMgr/EventLoopMgr ApplicationMgr INFO Application Manager Configured successfully THistSvc DEBUG Property update for OutputLevel : new value = 2 +THistSvc DEBUG Delaying connection of Input Files until Initialize. now in OFFLINE THistSvc DEBUG Service base class initialized successfully THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED diff --git a/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref b/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref index 6755759e7f..ce9f14a6c4 100644 --- a/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref +++ b/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref @@ -56,11 +56,8 @@ EventPersistenc... DEBUG Service base class initialized successfully EventLoopMgr VERBOSE ServiceLocatorHelper::service: found service EventDataSvc EventLoopMgr DEBUG Creating Output Stream OutputStream/OutputStream EventLoopMgr DEBUG Creating Top Algorithm GaudiTesting::PutDataObjectAlg with name DataCreator -DataCreator VERBOSE ServiceLocatorHelper::service: found service JobOptionsSvc EventLoopMgr DEBUG Creating Top Algorithm GaudiTesting::OddEventsFilter with name OddEvents -OddEvents VERBOSE ServiceLocatorHelper::service: found service JobOptionsSvc EventLoopMgr DEBUG Creating Top Algorithm GaudiTesting::EvenEventsFilter with name EvenEvents -EvenEvents VERBOSE ServiceLocatorHelper::service: found service JobOptionsSvc AlgContextSvc DEBUG Service base class initialized successfully AlgContextSvc VERBOSE ServiceLocatorHelper::service: found service IncidentSvc IncidentSvc DEBUG Adding [BeginEvent] listener 'AlgContextSvc' with priority 0 diff --git a/GaudiKernel/GaudiKernel/JobHistory.h b/GaudiKernel/GaudiKernel/JobHistory.h index 32531aac42..f95b20dc37 100644 --- a/GaudiKernel/GaudiKernel/JobHistory.h +++ b/GaudiKernel/GaudiKernel/JobHistory.h @@ -58,7 +58,8 @@ public: // functions static const CLID& classID(); // add a global property - void addProperty( const std::string&, const Gaudi::Details::PropertyBase* ); + [[deprecated]] void addProperty( const std::string&, const Gaudi::Details::PropertyBase* ); + void addProperty( const std::string& key, const std::string& value ); // Return the job history data. std::string release_version() const { return m_release_version; } diff --git a/GaudiKernel/src/Lib/JobHistory.cpp b/GaudiKernel/src/Lib/JobHistory.cpp index 1bfc79d0f9..f2616b4015 100644 --- a/GaudiKernel/src/Lib/JobHistory.cpp +++ b/GaudiKernel/src/Lib/JobHistory.cpp @@ -83,12 +83,27 @@ const CLID& JobHistory::classID() } void JobHistory::addProperty( const std::string& client, const PropertyBase* prop ) +{ + addProperty( client + '.' + prop->name(), prop->toString() ); +} + +void JobHistory::addProperty( const std::string& key, const std::string& value ) { /// \fixme strip optional quotes around the string - std::string prop_value = prop->toString(); + std::string prop_value = value; if ( !prop_value.empty() && prop_value[0] == '"' && prop_value[prop_value.size() - 1] == '"' ) prop_value = prop_value.substr( 1, prop_value.size() - 2 ); - m_ppl.emplace_back( client, std::make_unique>( prop->name(), prop_value ) ); + + std::string client, prop_name; + auto pos = key.rfind( '.' ); + if ( pos == std::string::npos ) { + prop_name = key; + } else { + client = key.substr( 0, pos ); + prop_name = key.substr( pos + 1 ); + } + + m_ppl.emplace_back( client, std::make_unique>( prop_name, prop_value ) ); } void JobHistory::dump( std::ostream& ost, const bool isXML, int /*ind*/ ) const diff --git a/GaudiMonitor/src/HistorySvc.cpp b/GaudiMonitor/src/HistorySvc.cpp index b44a6badb0..9cba2eb064 100644 --- a/GaudiMonitor/src/HistorySvc.cpp +++ b/GaudiMonitor/src/HistorySvc.cpp @@ -170,30 +170,21 @@ StatusCode HistorySvc::captureState() { if ( !m_jobHistory ) { - m_jobHistory.reset( new JobHistory ); - IJobOptionsSvc* jo; - if ( service( "JobOptionsSvc", jo ).isFailure() ) { - error() << "Could not get jobOptionsSvc - " - << "not adding properties to JobHistory" << endmsg; - } else { - - bool foundAppMgr( false ); + m_jobHistory = std::make_unique(); - for ( auto& client : jo->getClients() ) { - if ( client == "ApplicationMgr" ) foundAppMgr = true; - for ( auto prop : *jo->getProperties( client ) ) { - m_jobHistory->addProperty( client, prop ); - } - } + bool foundAppMgr( false ); + for ( const auto& item : serviceLocator()->getOptsSvc().items() ) { + m_jobHistory->addProperty( get<0>( item ), get<1>( item ) ); + foundAppMgr |= get<0>( item ).compare( 0, 15, "ApplicationMgr." ) == 0; + } - if ( !foundAppMgr ) { - auto ap = service( "ApplicationMgr" ); - if ( !ap ) { - error() << "could not get the ApplicationMgr" << endmsg; - } else { - for ( auto prop : ap->getProperties() ) { - m_jobHistory->addProperty( "ApplicationMgr", prop ); - } + if ( !foundAppMgr ) { + auto ap = service( "ApplicationMgr" ); + if ( !ap ) { + error() << "could not get the ApplicationMgr" << endmsg; + } else { + for ( auto prop : ap->getProperties() ) { + m_jobHistory->addProperty( "ApplicationMgr." + prop->name(), prop->toString() ); } } } diff --git a/GaudiPolicy/python/GaudiTesting/BaseTest.py b/GaudiPolicy/python/GaudiTesting/BaseTest.py index 9ba32e5f8e..611a6eeaa8 100644 --- a/GaudiPolicy/python/GaudiTesting/BaseTest.py +++ b/GaudiPolicy/python/GaudiTesting/BaseTest.py @@ -916,6 +916,8 @@ lineSkipper = LineSkipper(["//GP:", # The signal handler complains about SIGXCPU not # defined on some platforms 'SIGXCPU', + # Message removed with redesing of JobOptionsSvc + 'ServiceLocatorHelper::service: found service JobOptionsSvc', ], regexps=[ r"^JobOptionsSvc INFO *$", r"^# ", # Ignore python comments diff --git a/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp b/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp index 2d55b39a55..47ad864b04 100644 --- a/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp +++ b/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp @@ -6,9 +6,9 @@ */ // Framework include files +#include "Gaudi/Interfaces/IOptionsSvc.h" #include "GaudiKernel/IAlgManager.h" #include "GaudiKernel/IAlgorithm.h" -#include "GaudiKernel/IJobOptionsSvc.h" #include "GaudiKernel/IProperty.h" #include "GaudiKernel/IService.h" #include "GaudiKernel/ISvcLocator.h" @@ -62,18 +62,8 @@ StatusCode MetaDataSvc::collectData() { // save options for all clients - { - auto joSvc = service( "JobOptionsSvc" ); - if ( !joSvc.isValid() ) return StatusCode::FAILURE; - for ( const auto c : joSvc->getClients() ) { - // get options for this client - const auto props = joSvc->getProperties( c ); - if ( props ) { - for ( const auto prop : *props ) { - m_metadata[c + "." + prop->name()] = prop->toString(); - } - } - } + for ( const auto& p : serviceLocator()->getOptsSvc().items() ) { + m_metadata[std::get<0>( p )] = std::get<1>( p ); } for ( const auto* name : {"ApplicationMgr", "MessageSvc", "NTupleSvc"} ) { diff --git a/RootHistCnv/src/RFileCnv.cpp b/RootHistCnv/src/RFileCnv.cpp index 511d1a8872..bc76720897 100644 --- a/RootHistCnv/src/RFileCnv.cpp +++ b/RootHistCnv/src/RFileCnv.cpp @@ -6,6 +6,8 @@ #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/MsgStream.h" +#include "Gaudi/Interfaces/IOptionsSvc.h" + // ROOT #include "RFileCnv.h" #include "TFile.h" @@ -28,14 +30,10 @@ RootHistCnv::RFileCnv::RFileCnv( ISvcLocator* svc ) : RDirectoryCnv( svc, classI StatusCode RootHistCnv::RFileCnv::initialize() { // Set compression level property ... - ISvcLocator* svcLoc = Gaudi::svcLocator(); - auto jobSvc = svcLoc->service( "JobOptionsSvc" ); - auto prop = jobSvc->getClientProperty( "RFileCnv", "GlobalCompression" ); - if ( prop ) m_compLevel = prop->toString(); - /// \fixme strip optional quotes around the string - if ( !m_compLevel.empty() && m_compLevel[0] == '"' && m_compLevel[m_compLevel.size() - 1] == '"' ) - m_compLevel = m_compLevel.substr( 1, m_compLevel.size() - 2 ); - + const auto& optsSvc = serviceLocator()->getOptsSvc(); + if ( optsSvc.has( "RFileCnv.GlobalCompression" ) ) { + Gaudi::Parsers::parse( m_compLevel, optsSvc.get( "RFileCnv.GlobalCompression" ) ); + } // initialise base class return RDirectoryCnv::initialize(); } -- GitLab From 3aebe6345d42932c87858405ec2233a75547a552 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Sun, 31 Dec 2017 16:17:36 +0100 Subject: [PATCH 07/62] Restored setProperties method for backward compatibility --- GaudiKernel/Gaudi/Algorithm.h | 7 +++++++ GaudiKernel/GaudiKernel/AlgTool.h | 7 +++++++ GaudiKernel/GaudiKernel/Auditor.h | 7 +++++++ GaudiKernel/GaudiKernel/Service.h | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/GaudiKernel/Gaudi/Algorithm.h b/GaudiKernel/Gaudi/Algorithm.h index 7320960ba7..9af63d6730 100644 --- a/GaudiKernel/Gaudi/Algorithm.h +++ b/GaudiKernel/Gaudi/Algorithm.h @@ -331,6 +331,13 @@ namespace Gaudi /// register for Algorithm Context Service? bool registerContext() const { return m_registerContext; } + GAUDI_DEPRECATED_SINCE_v30r5( "it should not be called explicitely" ) StatusCode setProperties() + { + if ( !serviceLocator() ) return StatusCode::FAILURE; + setPropertiesFrom( serviceLocator()->getOptsSvc() ); + return StatusCode::SUCCESS; + } + // ========================================================================== using PropertyHolderImpl::declareProperty; diff --git a/GaudiKernel/GaudiKernel/AlgTool.h b/GaudiKernel/GaudiKernel/AlgTool.h index a7a157f053..303cfd1677 100644 --- a/GaudiKernel/GaudiKernel/AlgTool.h +++ b/GaudiKernel/GaudiKernel/AlgTool.h @@ -118,6 +118,13 @@ public: /// The standard ToolSvc service, Return a pointer to the service if present IToolSvc* toolSvc() const; + [[deprecated( "it should not be called explicitely" )]] StatusCode setProperties() + { + if ( !serviceLocator() ) return StatusCode::FAILURE; + setPropertiesFrom( serviceLocator()->getOptsSvc() ); + return StatusCode::SUCCESS; + } + /** Access a service by name, * creating it if it doesn't already exist. */ diff --git a/GaudiKernel/GaudiKernel/Auditor.h b/GaudiKernel/GaudiKernel/Auditor.h index e82b02b1ae..776cd5ff79 100644 --- a/GaudiKernel/GaudiKernel/Auditor.h +++ b/GaudiKernel/GaudiKernel/Auditor.h @@ -121,6 +121,13 @@ public: return serviceLocator()->service( name, createIf ); } + [[deprecated( "it should not be called explicitely" )]] StatusCode setProperties() + { + if ( !serviceLocator() ) return StatusCode::FAILURE; + setPropertiesFrom( serviceLocator()->getOptsSvc() ); + return StatusCode::SUCCESS; + } + private: std::string m_name; ///< Auditor's name for identification diff --git a/GaudiKernel/GaudiKernel/Service.h b/GaudiKernel/GaudiKernel/Service.h index c778ac3ac7..fc5f5dbd90 100644 --- a/GaudiKernel/GaudiKernel/Service.h +++ b/GaudiKernel/GaudiKernel/Service.h @@ -73,6 +73,13 @@ public: /** Retrieve pointer to service locator */ SmartIF& serviceLocator() const override; + [[deprecated( "it should not be called explicitely" )]] StatusCode setProperties() + { + if ( !serviceLocator() ) return StatusCode::FAILURE; + setPropertiesFrom( serviceLocator()->getOptsSvc() ); + return StatusCode::SUCCESS; + } + /** Access a service by name, creating it if it doesn't already exist. */ template -- GitLab From 05823a1ee0d468903345260a2832ccb956587d2d Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 28 Dec 2017 11:32:08 +0100 Subject: [PATCH 08/62] Use new IOptionsSvc in GaudiPython --- Gaudi/python/Gaudi/Main.py | 2 +- .../src/JobOptionsSvc/PythonConfig.cpp | 4 +- .../tests/qmtest/refs/Properties2.ref | 6 +- .../tests/qmtest/refs/Properties_py.ref | 4 +- GaudiPython/python/GaudiPython/Bindings.py | 70 ++++++------------- 5 files changed, 30 insertions(+), 56 deletions(-) diff --git a/Gaudi/python/Gaudi/Main.py b/Gaudi/python/Gaudi/Main.py index 35cf194e5d..e3c6267ca9 100644 --- a/Gaudi/python/Gaudi/Main.py +++ b/Gaudi/python/Gaudi/Main.py @@ -362,7 +362,7 @@ class gaudimain(object): # so we do it again to get it v = v.__resolve__() if type(v) == str: - v = '"%s"' % v # need double quotes + v = repr(v) # need double quotes elif type(v) == long: v = '%d' % v # prevent pending 'L' _bootstrap.setOption(optssvc, '.'.join((n, p)), str(v)) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.cpp b/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.cpp index 07ea6130d5..8b2e29507d 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.cpp @@ -33,8 +33,8 @@ StatusCode PythonConfig::evaluateConfig( const std::string& filename, const std: "applyConfigurableUsers\napplyConfigurableUsers()\n"; command += postAction; command += "\nfor n, c in Configurable.allConfigurables.items():\n for p, v in c.getValuedProperties().items() " - ":\n v = expandvars(v)\n if type(v) == str : v = '\"%s\"' % v # need double quotes\n elif " - "type(v) == long: v = '%d' % v # prevent pending 'L'\n adaptor.addPropertyToJobOptions(n,p,str(v))"; + ":\n v = expandvars(v)\n if type(v) == str : v = repr(v) # need double quotes\n elif " + "type(v) == long: v = '%d' % v # prevent pending 'L'\n adaptor.addPropertyToJobOptions(n,p,str(v))"; // Now fire off the translation handle<> ignored( ( PyRun_String( command.c_str(), Py_file_input, main_namespace.ptr(), main_namespace.ptr() ) ) ); diff --git a/GaudiExamples/tests/qmtest/refs/Properties2.ref b/GaudiExamples/tests/qmtest/refs/Properties2.ref index afc892dbae..237e2010a5 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties2.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties2.ref @@ -172,13 +172,13 @@ PropertyAlg.PDouble: 10100000.0 PropertyAlg.PDoubleArray: [1.1, 2.0, 3.3] PropertyAlg.PInt: 101 PropertyAlg.PIntArray: [1, 2, 3, 5] -PropertyAlg.PString: "hundred one" +PropertyAlg.PString: 'hundred one' PropertyAlg.PStringArray: ['one', 'two', 'four'] -PropertyAlg.String: "hundred one" +PropertyAlg.String: 'hundred one' PropertyAlg.StringArray: ['one', 'two', 'four'] PropertyAlg.UInt64: 4294967296 PropertyAlg.UInt64Array: [4294967296] -PropertyProxy.String: "This is set by the proxy" +PropertyProxy.String: 'This is set by the proxy' PropertyAlg INFO ================================================= PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO Update handler called for property: 'PDouble':10100000. diff --git a/GaudiExamples/tests/qmtest/refs/Properties_py.ref b/GaudiExamples/tests/qmtest/refs/Properties_py.ref index 45b63bb90f..1a1684c7f7 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties_py.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties_py.ref @@ -131,9 +131,9 @@ PropertyAlg.PDouble: 10100000.0 PropertyAlg.PDoubleArray: [1.1, 2.0, 3.3, 1e-20, 1e+20] PropertyAlg.PInt: 101 PropertyAlg.PIntArray: [1, 2, 3, 5] -PropertyAlg.PString: "hundred one" +PropertyAlg.PString: 'hundred one' PropertyAlg.PStringArray: ['one', 'two', 'four'] -PropertyAlg.String: "hundred one" +PropertyAlg.String: 'hundred one' PropertyAlg.StringArray: ['one', 'two', 'four'] PropertyAlg.UInt64: 4294967296 PropertyAlg.UInt64Array: [4294967296L] diff --git a/GaudiPython/python/GaudiPython/Bindings.py b/GaudiPython/python/GaudiPython/Bindings.py index 83c2be7d04..6c49d4b31f 100644 --- a/GaudiPython/python/GaudiPython/Bindings.py +++ b/GaudiPython/python/GaudiPython/Bindings.py @@ -57,12 +57,17 @@ SUCCESS = gbl.StatusCode(gbl.StatusCode.SUCCESS, True) FAILURE = gbl.StatusCode(gbl.StatusCode.FAILURE, True) # Helper to create a StringProperty cppyy.gbl.gInterpreter.Declare(''' +#include namespace GaudiPython { namespace Helpers { Gaudi::Property mkStringProperty(const std::string &name, const std::string &value) { return Gaudi::Property{name, value}; } -}}''') + void setProperty(ISvcLocator* svcLoc, std::string key, std::string value) { + gsl::not_null(svcLoc)->getOptsSvc().set(key, value); + } +}} +''') # toIntArray, toShortArray, etc. for l in [l for l in dir(Helper) if re.match("^to.*Array$", l)]: @@ -254,53 +259,23 @@ class iProperty(object): """ if hasattr(value, 'toStringProperty'): # user defined behaviour - value = '%s' % value.toStringProperty() + value = str(value.toStringProperty()) + elif hasattr(value, 'toString'): + value = str(value.toString()) + elif type(value) == long: + value = '%d' % value # prevent pending 'L' + else: + value = repr(value) + ip = self.getInterface() if ip: if not gbl.Gaudi.Utils.hasProperty(ip, name): raise AttributeError, 'property %s does not exist' % name - prop = ip.getProperty(name) - - if ROOT6WorkAroundEnabled('ROOT-7201'): - canSetValue = (hasattr(prop, 'value') and - 'const&[' not in prop.value.func_doc and - type(value) == type(prop.value())) - else: - canSetValue = (hasattr(prop, 'value') and - type(value) == type(prop.value())) - - if canSetValue: - if not prop.setValue(value): - raise AttributeError, 'property %s could not be set from %s' % ( - name, value) - else: - if tuple == type(value): - value = str(value) - elif hasattr(value, 'toString'): - value = value.toString() - elif not long == type(value): - value = '%s' % value - else: - value = '%d' % value - if ROOT6WorkAroundEnabled('ROOT-6028'): - sc = cppyy.gbl.GaudiPython.Helper.setPropertyFromString( - prop, value) - else: - sc = prop.fromString(value) - if sc.isFailure(): - raise AttributeError, 'property %s could not be set from %s' % ( - name, value) + ip.setProperty(name, value) else: - if type(value) == str: - value = '"%s"' % value # need double quotes - elif type(value) == tuple: - value = str(value) - elif hasattr(value, 'toString'): - value = value.toString() - elif type(value) == long: - value = '%d' % value # prevent pending 'L' - sp = gbl.GaudiPython.Helpers.mkStringProperty(name, str(value)) - self._optsvc.addPropertyToCatalogue(self._name, sp).ignore() + gbl.GaudiPython.Helpers.setProperty(self._svcloc, + '.'.join([self._name, name]), + value) def __getattr__(self, name): """ @@ -969,7 +944,6 @@ class AppMgr(iService): self.__dict__['_optsvc'] = InterfaceCast(gbl.IJobOptionsSvc)( Helper.service(self._svcloc, 'JobOptionsSvc')) # ------Configurables initialization (part2)------------------------------- - mkStringProperty = gbl.GaudiPython.Helpers.mkStringProperty for n in getNeededConfigurables(): c = Configurable.allConfigurables[n] if n in ['ApplicationMgr', 'MessageSvc']: @@ -982,11 +956,11 @@ class AppMgr(iService): # so we do it again to get it v = v.__resolve__() if type(v) == str: - v = '"%s"' % v # need double quotes - elif type(v) == long: + v = repr(v) # need double quotes + if type(v) == long: v = '%d' % v # prevent pending 'L' - self._optsvc.addPropertyToCatalogue( - n, mkStringProperty(p, str(v))) + gbl.GaudiPython.Helpers.setProperty(self._svcloc, + '.'.join([n, p]), str(v)) if hasattr(Configurable, "_configurationLocked"): Configurable._configurationLocked = True -- GitLab From 1d20b9c29c6de0c2147391cbf71c8ec88d2cc2f6 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 28 Dec 2017 11:39:28 +0100 Subject: [PATCH 09/62] Removed asymmetry Property wrt Property --- GaudiExamples/scripts/StringKeyEx.py | 4 +- GaudiExamples/tests/qmtest/refs/Aida2Root.ref | 66 +++++++++---------- GaudiExamples/tests/qmtest/refs/AlgTools.ref | 42 ++++++------ GaudiExamples/tests/qmtest/refs/AlgTools2.ref | 58 ++++++++-------- .../tests/qmtest/refs/AlgTools_pyopts.ref | 28 ++++---- .../tests/qmtest/refs/EvtColsEx/Write.ref | 37 ++++++----- .../tests/qmtest/refs/GaudiCommonTests.ref | 30 +++++---- .../tests/qmtest/refs/Histograms.ref | 44 ++++++------- .../tests/qmtest/refs/MetaDataSvc.ref | 56 ++++++++-------- .../tests/qmtest/refs/Properties.ref | 6 +- .../tests/qmtest/refs/Properties2.ref | 6 +- .../tests/qmtest/refs/Properties_py.ref | 6 +- .../qmtest/refs/ROOT_IO/ExtCollWrite.ref | 39 +++++------ .../qmtest/refs/TBB/GaudiCommonTests.ref | 30 +++++---- .../qmtest/refs/conditional_output/write.ref | 47 ++++++------- GaudiKernel/Gaudi/Parsers/Grammars.h | 1 + GaudiKernel/GaudiKernel/Property.h | 6 -- GaudiKernel/src/Lib/StringKey.cpp | 2 +- GaudiKernel/src/Util/genconf.cpp | 2 +- GaudiKernel/tests/src/test_Property.cpp | 31 +-------- GaudiPolicy/python/GaudiTesting/BaseTest.py | 1 + 21 files changed, 261 insertions(+), 281 deletions(-) diff --git a/GaudiExamples/scripts/StringKeyEx.py b/GaudiExamples/scripts/StringKeyEx.py index ed9168b6a9..6e0620bdfa 100755 --- a/GaudiExamples/scripts/StringKeyEx.py +++ b/GaudiExamples/scripts/StringKeyEx.py @@ -57,13 +57,13 @@ if '__main__' == __name__: key = SK('new Key') - print 'set new key: ', key + print 'set new key: %r' % key ske.Key = key keys = [key, 'rrr', SK('s')] - print 'set new keys: ', keys + print 'set new keys: %r' % keys ske.Keys = keys diff --git a/GaudiExamples/tests/qmtest/refs/Aida2Root.ref b/GaudiExamples/tests/qmtest/refs/Aida2Root.ref index 2c7890ce67..39e3b6cc6f 100644 --- a/GaudiExamples/tests/qmtest/refs/Aida2Root.ref +++ b/GaudiExamples/tests/qmtest/refs/Aida2Root.ref @@ -34,13 +34,13 @@ SimpleHistos DEBUG could not locate CounterSummarySvc, no counter summary SimpleHistos DEBUG List of ALL properties of GaudiHistoAlgorithm/SimpleHistos #properties = 52 SimpleHistos DEBUG Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } SimpleHistos DEBUG Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False -SimpleHistos DEBUG Property ['Name': Value] = 'HeaderFor1DHistoTable':| Title | # | Mean | RMS | Skewness | Kurtosis | -SimpleHistos DEBUG Property ['Name': Value] = 'ShortFormatFor1DHistoTable': | %1$-25.25s %2% -SimpleHistos DEBUG Property ['Name': Value] = 'FormatFor1DHistoTable':| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g | +SimpleHistos DEBUG Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' +SimpleHistos DEBUG Property ['Name': Value] = 'ShortFormatFor1DHistoTable':' | %1$-25.25s %2%' +SimpleHistos DEBUG Property ['Name': Value] = 'FormatFor1DHistoTable':'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' SimpleHistos DEBUG Property ['Name': Value] = 'MonitorHistograms':True SimpleHistos DEBUG Property ['Name': Value] = 'FullDetail':False -SimpleHistos DEBUG Property ['Name': Value] = 'HistoDir':SimpleHistos -SimpleHistos DEBUG Property ['Name': Value] = 'HistoTopDir': +SimpleHistos DEBUG Property ['Name': Value] = 'HistoDir':'SimpleHistos' +SimpleHistos DEBUG Property ['Name': Value] = 'HistoTopDir':'' SimpleHistos DEBUG Property ['Name': Value] = 'HistoOffSet':0 SimpleHistos DEBUG Property ['Name': Value] = 'HistoSplitDir':False SimpleHistos DEBUG Property ['Name': Value] = 'HistoCheckForNaN':True @@ -52,11 +52,11 @@ SimpleHistos DEBUG Property ['Name': Value] = 'VetoObjects':[ ] SimpleHistos DEBUG Property ['Name': Value] = 'StatEntityList':[ ] SimpleHistos DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] SimpleHistos DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -SimpleHistos DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -SimpleHistos DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -SimpleHistos DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -SimpleHistos DEBUG Property ['Name': Value] = 'RootInTES': -SimpleHistos DEBUG Property ['Name': Value] = 'Context': +SimpleHistos DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +SimpleHistos DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +SimpleHistos DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +SimpleHistos DEBUG Property ['Name': Value] = 'RootInTES':'' +SimpleHistos DEBUG Property ['Name': Value] = 'Context':'' SimpleHistos DEBUG Property ['Name': Value] = 'TypePrint':True SimpleHistos DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False SimpleHistos DEBUG Property ['Name': Value] = 'StatPrint':True @@ -67,7 +67,7 @@ SimpleHistos DEBUG Property ['Name': Value] = 'IsIOBound':False SimpleHistos DEBUG Property ['Name': Value] = 'NeededResources':[ ] SimpleHistos DEBUG Property ['Name': Value] = 'Cardinality':1 SimpleHistos DEBUG Property ['Name': Value] = 'RegisterForContextService':True -SimpleHistos DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +SimpleHistos DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' SimpleHistos DEBUG Property ['Name': Value] = 'Timeline':False SimpleHistos DEBUG Property ['Name': Value] = 'AuditStop':False SimpleHistos DEBUG Property ['Name': Value] = 'AuditStart':False @@ -100,13 +100,13 @@ Histos2 SUCCESS Property ['Name': Value] = 'Histo2':('',-5.00000,5.00 Histos2 SUCCESS Property ['Name': Value] = 'Histo1':('Histogram1',-3.00000,3.00000,200) Histos2 SUCCESS Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } Histos2 SUCCESS Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False -Histos2 SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':| Title | # | Mean | RMS | Skewness | Kurtosis | -Histos2 SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable': | %1$-25.25s %2% -Histos2 SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g | +Histos2 SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' +Histos2 SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable':' | %1$-25.25s %2%' +Histos2 SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' Histos2 SUCCESS Property ['Name': Value] = 'MonitorHistograms':True Histos2 SUCCESS Property ['Name': Value] = 'FullDetail':False -Histos2 SUCCESS Property ['Name': Value] = 'HistoDir':Histos2 -Histos2 SUCCESS Property ['Name': Value] = 'HistoTopDir': +Histos2 SUCCESS Property ['Name': Value] = 'HistoDir':'Histos2' +Histos2 SUCCESS Property ['Name': Value] = 'HistoTopDir':'' Histos2 SUCCESS Property ['Name': Value] = 'HistoOffSet':0 Histos2 SUCCESS Property ['Name': Value] = 'HistoSplitDir':False Histos2 SUCCESS Property ['Name': Value] = 'HistoCheckForNaN':True @@ -118,11 +118,11 @@ Histos2 SUCCESS Property ['Name': Value] = 'VetoObjects':[ ] Histos2 SUCCESS Property ['Name': Value] = 'StatEntityList':[ ] Histos2 SUCCESS Property ['Name': Value] = 'CounterList':[ '.*' ] Histos2 SUCCESS Property ['Name': Value] = 'UseEfficiencyRowFormat':True -Histos2 SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -Histos2 SUCCESS Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -Histos2 SUCCESS Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -Histos2 SUCCESS Property ['Name': Value] = 'RootInTES': -Histos2 SUCCESS Property ['Name': Value] = 'Context': +Histos2 SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Histos2 SUCCESS Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Histos2 SUCCESS Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Histos2 SUCCESS Property ['Name': Value] = 'RootInTES':'' +Histos2 SUCCESS Property ['Name': Value] = 'Context':'' Histos2 SUCCESS Property ['Name': Value] = 'TypePrint':True Histos2 SUCCESS Property ['Name': Value] = 'PrintEmptyCounters':False Histos2 SUCCESS Property ['Name': Value] = 'StatPrint':True @@ -133,7 +133,7 @@ Histos2 SUCCESS Property ['Name': Value] = 'IsIOBound':False Histos2 SUCCESS Property ['Name': Value] = 'NeededResources':[ ] Histos2 SUCCESS Property ['Name': Value] = 'Cardinality':1 Histos2 SUCCESS Property ['Name': Value] = 'RegisterForContextService':True -Histos2 SUCCESS Property ['Name': Value] = 'MonitorService':MonitorSvc +Histos2 SUCCESS Property ['Name': Value] = 'MonitorService':'MonitorSvc' Histos2 SUCCESS Property ['Name': Value] = 'Timeline':False Histos2 SUCCESS Property ['Name': Value] = 'AuditStop':False Histos2 SUCCESS Property ['Name': Value] = 'AuditStart':False @@ -158,13 +158,13 @@ Aida2Root SUCCESS Property ['Name': Value] = 'Histos2D':[ 'SimpleHistos Aida2Root SUCCESS Property ['Name': Value] = 'Histos1D':[ 'SimpleHistos/Gaussian mean=0, sigma=1' , 'SimpleHistos/101' , 'SimpleHistos/102' , 'SimpleHistos/1111' , 'SimpleHistos/test1' , 'SimpleHistos/subdir2/bino' , 'SimpleHistos/subdir1/bino' , 'SimpleHistos/poisson' ] Aida2Root SUCCESS Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } Aida2Root SUCCESS Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False -Aida2Root SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':| Title | # | Mean | RMS | Skewness | Kurtosis | -Aida2Root SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable': | %1$-25.25s %2% -Aida2Root SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g | +Aida2Root SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' +Aida2Root SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable':' | %1$-25.25s %2%' +Aida2Root SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' Aida2Root SUCCESS Property ['Name': Value] = 'MonitorHistograms':True Aida2Root SUCCESS Property ['Name': Value] = 'FullDetail':False -Aida2Root SUCCESS Property ['Name': Value] = 'HistoDir':Aida2Root -Aida2Root SUCCESS Property ['Name': Value] = 'HistoTopDir': +Aida2Root SUCCESS Property ['Name': Value] = 'HistoDir':'Aida2Root' +Aida2Root SUCCESS Property ['Name': Value] = 'HistoTopDir':'' Aida2Root SUCCESS Property ['Name': Value] = 'HistoOffSet':0 Aida2Root SUCCESS Property ['Name': Value] = 'HistoSplitDir':False Aida2Root SUCCESS Property ['Name': Value] = 'HistoCheckForNaN':True @@ -176,11 +176,11 @@ Aida2Root SUCCESS Property ['Name': Value] = 'VetoObjects':[ ] Aida2Root SUCCESS Property ['Name': Value] = 'StatEntityList':[ ] Aida2Root SUCCESS Property ['Name': Value] = 'CounterList':[ '.*' ] Aida2Root SUCCESS Property ['Name': Value] = 'UseEfficiencyRowFormat':True -Aida2Root SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -Aida2Root SUCCESS Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -Aida2Root SUCCESS Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -Aida2Root SUCCESS Property ['Name': Value] = 'RootInTES': -Aida2Root SUCCESS Property ['Name': Value] = 'Context': +Aida2Root SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Aida2Root SUCCESS Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Aida2Root SUCCESS Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Aida2Root SUCCESS Property ['Name': Value] = 'RootInTES':'' +Aida2Root SUCCESS Property ['Name': Value] = 'Context':'' Aida2Root SUCCESS Property ['Name': Value] = 'TypePrint':True Aida2Root SUCCESS Property ['Name': Value] = 'PrintEmptyCounters':False Aida2Root SUCCESS Property ['Name': Value] = 'StatPrint':True @@ -191,7 +191,7 @@ Aida2Root SUCCESS Property ['Name': Value] = 'IsIOBound':False Aida2Root SUCCESS Property ['Name': Value] = 'NeededResources':[ ] Aida2Root SUCCESS Property ['Name': Value] = 'Cardinality':1 Aida2Root SUCCESS Property ['Name': Value] = 'RegisterForContextService':True -Aida2Root SUCCESS Property ['Name': Value] = 'MonitorService':MonitorSvc +Aida2Root SUCCESS Property ['Name': Value] = 'MonitorService':'MonitorSvc' Aida2Root SUCCESS Property ['Name': Value] = 'Timeline':False Aida2Root SUCCESS Property ['Name': Value] = 'AuditStop':False Aida2Root SUCCESS Property ['Name': Value] = 'AuditStart':False diff --git a/GaudiExamples/tests/qmtest/refs/AlgTools.ref b/GaudiExamples/tests/qmtest/refs/AlgTools.ref index 0e52ad0f39..95387e2cd5 100644 --- a/GaudiExamples/tests/qmtest/refs/AlgTools.ref +++ b/GaudiExamples/tests/qmtest/refs/AlgTools.ref @@ -62,63 +62,65 @@ ToolSvc.ToolA DEBUG Property update for OutputLevel : new value = 2 ToolSvc.ToolA DEBUG Initialize ToolSvc.ToolA DEBUG Initialize base class GaudiCommon ToolSvc.ToolA DEBUG could not locate CounterSummarySvc, no counter summary will be made -ToolSvc.ToolA DEBUG List of ALL properties of TestTool/ToolSvc.ToolA #properties = 24 +ToolSvc.ToolA DEBUG List of ALL properties of TestTool/ToolSvc.ToolA #properties = 25 ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Tools':[ 'TestTool/ToolB' ] -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ContextService':AlgContextSvc +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ContextService':'AlgContextSvc' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatEntityList':[ ] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RootInTES': -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Context': +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RootInTES':'' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Context':'' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'TypePrint':True ToolSvc.ToolA DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatPrint':True ToolSvc.ToolA DEBUG Property ['Name': Value] = 'PropertiesPrint':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ErrorsPrint':True -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraOutputs':[] -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraInputs':[] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditRestart':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditReinitialize':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditFinalize':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditStop':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditStart':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditInitialize':False -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditTools':False +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'OutputLevel':2 +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraOutputs':[] +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraInputs':[] ToolSvc.ToolA DEBUG Loading tool ToolB of type TestTool ToolSvc.ToolB DEBUG Property update for OutputLevel : new value = 2 ToolSvc.ToolB DEBUG Initialize ToolSvc.ToolB DEBUG Initialize base class GaudiCommon ToolSvc.ToolB DEBUG could not locate CounterSummarySvc, no counter summary will be made -ToolSvc.ToolB DEBUG List of ALL properties of TestTool/ToolSvc.ToolB #properties = 24 +ToolSvc.ToolB DEBUG List of ALL properties of TestTool/ToolSvc.ToolB #properties = 25 ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Tools':[ 'TestTool/ToolA' ] -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ContextService':AlgContextSvc +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ContextService':'AlgContextSvc' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatEntityList':[ ] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RootInTES': -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Context': +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RootInTES':'' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Context':'' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'TypePrint':True ToolSvc.ToolB DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatPrint':True ToolSvc.ToolB DEBUG Property ['Name': Value] = 'PropertiesPrint':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ErrorsPrint':True -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraOutputs':[] -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraInputs':[] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditRestart':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditReinitialize':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditFinalize':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditStop':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditStart':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditInitialize':False -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditTools':False +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'OutputLevel':2 +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraOutputs':[] +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraInputs':[] ToolSvc.ToolB DEBUG Loading tool ToolA of type TestTool ToolSvc.ToolB DEBUG Registering tool ToolSvc.ToolA ToolSvc.ToolA DEBUG Registering tool ToolSvc.ToolB diff --git a/GaudiExamples/tests/qmtest/refs/AlgTools2.ref b/GaudiExamples/tests/qmtest/refs/AlgTools2.ref index 361f7907c2..88223e30db 100644 --- a/GaudiExamples/tests/qmtest/refs/AlgTools2.ref +++ b/GaudiExamples/tests/qmtest/refs/AlgTools2.ref @@ -48,17 +48,17 @@ MyAlg DEBUG Property ['Name': Value] = 'UnusedToolHandle':TestToo MyAlg DEBUG Property ['Name': Value] = 'GenericToolHandle':MyTool/GenericToolHandle MyAlg DEBUG Property ['Name': Value] = 'PubToolHandle':MyTool/PubToolHandle MyAlg DEBUG Property ['Name': Value] = 'PrivToolHandle':MyTool/PrivToolHandle -MyAlg DEBUG Property ['Name': Value] = 'ToolWithName':MyTool +MyAlg DEBUG Property ['Name': Value] = 'ToolWithName':'MyTool' MyAlg DEBUG Property ['Name': Value] = 'RequireObjects':[ ] MyAlg DEBUG Property ['Name': Value] = 'VetoObjects':[ ] MyAlg DEBUG Property ['Name': Value] = 'StatEntityList':[ ] MyAlg DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] MyAlg DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -MyAlg DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -MyAlg DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -MyAlg DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -MyAlg DEBUG Property ['Name': Value] = 'RootInTES': -MyAlg DEBUG Property ['Name': Value] = 'Context': +MyAlg DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +MyAlg DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +MyAlg DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +MyAlg DEBUG Property ['Name': Value] = 'RootInTES':'' +MyAlg DEBUG Property ['Name': Value] = 'Context':'' MyAlg DEBUG Property ['Name': Value] = 'TypePrint':True MyAlg DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False MyAlg DEBUG Property ['Name': Value] = 'StatPrint':True @@ -69,7 +69,7 @@ MyAlg DEBUG Property ['Name': Value] = 'IsIOBound':False MyAlg DEBUG Property ['Name': Value] = 'NeededResources':[ ] MyAlg DEBUG Property ['Name': Value] = 'Cardinality':1 MyAlg DEBUG Property ['Name': Value] = 'RegisterForContextService':True -MyAlg DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +MyAlg DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' MyAlg DEBUG Property ['Name': Value] = 'Timeline':False MyAlg DEBUG Property ['Name': Value] = 'AuditStop':False MyAlg DEBUG Property ['Name': Value] = 'AuditStart':False @@ -111,18 +111,18 @@ MyAlg.MyGaudiTool DEBUG Initialize base class GaudiCommon MyAlg.MyGaudiTool DEBUG could not locate CounterSummarySvc, no counter summary will be made MyAlg.MyGaudiTool DEBUG List of ALL properties of MyGaudiTool/MyAlg.MyGaudiTool #properties = 28 MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'Bool':True -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'String':hundred +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'String':'hundred' MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'Double':100.00000 MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'Int':100 -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'ContextService':AlgContextSvc +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'ContextService':'AlgContextSvc' MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'StatEntityList':[ ] MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'RootInTES': -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'Context': +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'RootInTES':'' +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'Context':'' MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'TypePrint':True MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'StatPrint':True @@ -135,7 +135,7 @@ MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'AuditStop':False MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'AuditStart':False MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'AuditInitialize':False MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'AuditTools':False -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'OutputLevel':2 MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'ExtraOutputs':[] MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'ExtraInputs':[] @@ -206,15 +206,15 @@ ToolSvc.ToolA DEBUG Initialize base class GaudiCommon ToolSvc.ToolA DEBUG could not locate CounterSummarySvc, no counter summary will be made ToolSvc.ToolA DEBUG List of ALL properties of TestTool/ToolSvc.ToolA #properties = 25 ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Tools':[ 'TestTool/ToolB' ] -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ContextService':AlgContextSvc +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ContextService':'AlgContextSvc' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatEntityList':[ ] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RootInTES': -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Context': +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RootInTES':'' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Context':'' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'TypePrint':True ToolSvc.ToolA DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatPrint':True @@ -227,7 +227,7 @@ ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditStop':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditStart':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditInitialize':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditTools':False -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'OutputLevel':2 ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraOutputs':[] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraInputs':[] @@ -238,15 +238,15 @@ ToolSvc.ToolB DEBUG Initialize base class GaudiCommon ToolSvc.ToolB DEBUG could not locate CounterSummarySvc, no counter summary will be made ToolSvc.ToolB DEBUG List of ALL properties of TestTool/ToolSvc.ToolB #properties = 25 ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Tools':[ 'TestTool/ToolA' ] -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ContextService':AlgContextSvc +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ContextService':'AlgContextSvc' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatEntityList':[ ] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RootInTES': -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Context': +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RootInTES':'' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Context':'' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'TypePrint':True ToolSvc.ToolB DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatPrint':True @@ -259,7 +259,7 @@ ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditStop':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditStart':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditInitialize':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditTools':False -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'OutputLevel':2 ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraOutputs':[] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraInputs':[] diff --git a/GaudiExamples/tests/qmtest/refs/AlgTools_pyopts.ref b/GaudiExamples/tests/qmtest/refs/AlgTools_pyopts.ref index 5b65ed2dbd..938eb9f983 100644 --- a/GaudiExamples/tests/qmtest/refs/AlgTools_pyopts.ref +++ b/GaudiExamples/tests/qmtest/refs/AlgTools_pyopts.ref @@ -93,15 +93,15 @@ ToolSvc.ToolA DEBUG Initialize base class GaudiCommon ToolSvc.ToolA DEBUG could not locate CounterSummarySvc, no counter summary will be made ToolSvc.ToolA DEBUG List of ALL properties of TestTool/ToolSvc.ToolA #properties = 25 ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Tools':[ 'TestTool/ToolB' ] -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ContextService':AlgContextSvc +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ContextService':'AlgContextSvc' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatEntityList':[ ] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RootInTES': -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Context': +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RootInTES':'' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Context':'' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'TypePrint':True ToolSvc.ToolA DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatPrint':True @@ -114,7 +114,7 @@ ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditStop':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditStart':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditInitialize':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditTools':False -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'OutputLevel':2 ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraOutputs':[] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraInputs':[] @@ -125,15 +125,15 @@ ToolSvc.ToolB DEBUG Initialize base class GaudiCommon ToolSvc.ToolB DEBUG could not locate CounterSummarySvc, no counter summary will be made ToolSvc.ToolB DEBUG List of ALL properties of TestTool/ToolSvc.ToolB #properties = 25 ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Tools':[ 'TestTool/ToolA' ] -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ContextService':AlgContextSvc +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ContextService':'AlgContextSvc' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatEntityList':[ ] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RootInTES': -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Context': +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RootInTES':'' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Context':'' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'TypePrint':True ToolSvc.ToolB DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatPrint':True @@ -146,7 +146,7 @@ ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditStop':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditStart':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditInitialize':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditTools':False -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'OutputLevel':2 ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraOutputs':[] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraInputs':[] diff --git a/GaudiExamples/tests/qmtest/refs/EvtColsEx/Write.ref b/GaudiExamples/tests/qmtest/refs/EvtColsEx/Write.ref index 2384a1f88f..bb09045a0c 100644 --- a/GaudiExamples/tests/qmtest/refs/EvtColsEx/Write.ref +++ b/GaudiExamples/tests/qmtest/refs/EvtColsEx/Write.ref @@ -30,30 +30,30 @@ RndmGenSvc.Engine INFO Generator engine type:CLHEP::RanluxEngine RndmGenSvc.Engine INFO Current Seed:1234567 Luxury:3 RndmGenSvc INFO Using Random engine:HepRndm::Engine EvtTupleSvc INFO Added stream file:PFN:EvtColsEx.tags as EVTCOLS -Fill SUCCESS List of ALL properties of Gaudi::Examples::EvtColAlg/Fill #properties = 64 -Fill SUCCESS Property ['Name': Value] = 'EvtColDir':Fill -Fill SUCCESS Property ['Name': Value] = 'EvtColTopDir': -Fill SUCCESS Property ['Name': Value] = 'EvtColLUN':EVTCOLS +Fill SUCCESS List of ALL properties of Gaudi::Examples::EvtColAlg/Fill #properties = 65 +Fill SUCCESS Property ['Name': Value] = 'EvtColDir':'Fill' +Fill SUCCESS Property ['Name': Value] = 'EvtColTopDir':'' +Fill SUCCESS Property ['Name': Value] = 'EvtColLUN':'EVTCOLS' Fill SUCCESS Property ['Name': Value] = 'EvtColOffSet':0 Fill SUCCESS Property ['Name': Value] = 'EvtColSplitDir':False Fill SUCCESS Property ['Name': Value] = 'EvtColsPrint':True Fill SUCCESS Property ['Name': Value] = 'EvtColsProduce':True -Fill SUCCESS Property ['Name': Value] = 'NTupleDir':Fill -Fill SUCCESS Property ['Name': Value] = 'NTupleTopDir': -Fill SUCCESS Property ['Name': Value] = 'NTupleLUN':FILE1 +Fill SUCCESS Property ['Name': Value] = 'NTupleDir':'Fill' +Fill SUCCESS Property ['Name': Value] = 'NTupleTopDir':'' +Fill SUCCESS Property ['Name': Value] = 'NTupleLUN':'FILE1' Fill SUCCESS Property ['Name': Value] = 'NTupleOffSet':0 Fill SUCCESS Property ['Name': Value] = 'NTupleSplitDir':False Fill SUCCESS Property ['Name': Value] = 'NTuplePrint':False Fill SUCCESS Property ['Name': Value] = 'NTupleProduce':False Fill SUCCESS Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } Fill SUCCESS Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False -Fill SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':| Title | # | Mean | RMS | Skewness | Kurtosis | -Fill SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable': | %1$-25.25s %2% -Fill SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g | +Fill SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' +Fill SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable':' | %1$-25.25s %2%' +Fill SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' Fill SUCCESS Property ['Name': Value] = 'MonitorHistograms':True Fill SUCCESS Property ['Name': Value] = 'FullDetail':False -Fill SUCCESS Property ['Name': Value] = 'HistoDir':Fill -Fill SUCCESS Property ['Name': Value] = 'HistoTopDir': +Fill SUCCESS Property ['Name': Value] = 'HistoDir':'Fill' +Fill SUCCESS Property ['Name': Value] = 'HistoTopDir':'' Fill SUCCESS Property ['Name': Value] = 'HistoOffSet':0 Fill SUCCESS Property ['Name': Value] = 'HistoSplitDir':False Fill SUCCESS Property ['Name': Value] = 'HistoCheckForNaN':True @@ -65,21 +65,22 @@ Fill SUCCESS Property ['Name': Value] = 'VetoObjects':[ ] Fill SUCCESS Property ['Name': Value] = 'StatEntityList':[ ] Fill SUCCESS Property ['Name': Value] = 'CounterList':[ '.*' ] Fill SUCCESS Property ['Name': Value] = 'UseEfficiencyRowFormat':True -Fill SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -Fill SUCCESS Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -Fill SUCCESS Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -Fill SUCCESS Property ['Name': Value] = 'RootInTES': -Fill SUCCESS Property ['Name': Value] = 'Context': +Fill SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Fill SUCCESS Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Fill SUCCESS Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Fill SUCCESS Property ['Name': Value] = 'RootInTES':'' +Fill SUCCESS Property ['Name': Value] = 'Context':'' Fill SUCCESS Property ['Name': Value] = 'TypePrint':False Fill SUCCESS Property ['Name': Value] = 'PrintEmptyCounters':False Fill SUCCESS Property ['Name': Value] = 'StatPrint':True Fill SUCCESS Property ['Name': Value] = 'PropertiesPrint':True Fill SUCCESS Property ['Name': Value] = 'ErrorsPrint':True +Fill SUCCESS Property ['Name': Value] = 'FilterCircularDependencies':True Fill SUCCESS Property ['Name': Value] = 'IsIOBound':False Fill SUCCESS Property ['Name': Value] = 'NeededResources':[ ] Fill SUCCESS Property ['Name': Value] = 'Cardinality':1 Fill SUCCESS Property ['Name': Value] = 'RegisterForContextService':True -Fill SUCCESS Property ['Name': Value] = 'MonitorService':MonitorSvc +Fill SUCCESS Property ['Name': Value] = 'MonitorService':'MonitorSvc' Fill SUCCESS Property ['Name': Value] = 'Timeline':False Fill SUCCESS Property ['Name': Value] = 'AuditStop':False Fill SUCCESS Property ['Name': Value] = 'AuditStart':False diff --git a/GaudiExamples/tests/qmtest/refs/GaudiCommonTests.ref b/GaudiExamples/tests/qmtest/refs/GaudiCommonTests.ref index 604cb0a8ba..24ecd863ca 100644 --- a/GaudiExamples/tests/qmtest/refs/GaudiCommonTests.ref +++ b/GaudiExamples/tests/qmtest/refs/GaudiCommonTests.ref @@ -26,27 +26,28 @@ StatusCodeSvc INFO initialize Test1 DEBUG Property update for OutputLevel : new value = 2 Test1 DEBUG Initialize base class GaudiCommon Test1 DEBUG could not locate CounterSummarySvc, no counter summary will be made -Test1 DEBUG List of ALL properties of GaudiCommonTests/Test1 #properties = 35 +Test1 DEBUG List of ALL properties of GaudiCommonTests/Test1 #properties = 36 Test1 DEBUG Property ['Name': Value] = 'RequireObjects':[ ] Test1 DEBUG Property ['Name': Value] = 'VetoObjects':[ ] Test1 DEBUG Property ['Name': Value] = 'StatEntityList':[ ] Test1 DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] Test1 DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -Test1 DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -Test1 DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -Test1 DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -Test1 DEBUG Property ['Name': Value] = 'RootInTES': -Test1 DEBUG Property ['Name': Value] = 'Context': +Test1 DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Test1 DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Test1 DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Test1 DEBUG Property ['Name': Value] = 'RootInTES':'' +Test1 DEBUG Property ['Name': Value] = 'Context':'' Test1 DEBUG Property ['Name': Value] = 'TypePrint':True Test1 DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False Test1 DEBUG Property ['Name': Value] = 'StatPrint':True Test1 DEBUG Property ['Name': Value] = 'PropertiesPrint':False Test1 DEBUG Property ['Name': Value] = 'ErrorsPrint':True +Test1 DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True Test1 DEBUG Property ['Name': Value] = 'IsIOBound':False Test1 DEBUG Property ['Name': Value] = 'NeededResources':[ ] Test1 DEBUG Property ['Name': Value] = 'Cardinality':1 Test1 DEBUG Property ['Name': Value] = 'RegisterForContextService':True -Test1 DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +Test1 DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' Test1 DEBUG Property ['Name': Value] = 'Timeline':False Test1 DEBUG Property ['Name': Value] = 'AuditStop':False Test1 DEBUG Property ['Name': Value] = 'AuditStart':False @@ -69,27 +70,28 @@ Test1 DEBUG Data Deps for Test1 Test2 DEBUG Property update for OutputLevel : new value = 2 Test2 DEBUG Initialize base class GaudiCommon Test2 DEBUG could not locate CounterSummarySvc, no counter summary will be made -Test2 DEBUG List of ALL properties of GaudiCommonTests/Test2 #properties = 35 +Test2 DEBUG List of ALL properties of GaudiCommonTests/Test2 #properties = 36 Test2 DEBUG Property ['Name': Value] = 'RequireObjects':[ ] Test2 DEBUG Property ['Name': Value] = 'VetoObjects':[ ] Test2 DEBUG Property ['Name': Value] = 'StatEntityList':[ ] Test2 DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] Test2 DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -Test2 DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -Test2 DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -Test2 DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -Test2 DEBUG Property ['Name': Value] = 'RootInTES':microDST/ -Test2 DEBUG Property ['Name': Value] = 'Context': +Test2 DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Test2 DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Test2 DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Test2 DEBUG Property ['Name': Value] = 'RootInTES':'microDST/' +Test2 DEBUG Property ['Name': Value] = 'Context':'' Test2 DEBUG Property ['Name': Value] = 'TypePrint':True Test2 DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False Test2 DEBUG Property ['Name': Value] = 'StatPrint':True Test2 DEBUG Property ['Name': Value] = 'PropertiesPrint':False Test2 DEBUG Property ['Name': Value] = 'ErrorsPrint':True +Test2 DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True Test2 DEBUG Property ['Name': Value] = 'IsIOBound':False Test2 DEBUG Property ['Name': Value] = 'NeededResources':[ ] Test2 DEBUG Property ['Name': Value] = 'Cardinality':1 Test2 DEBUG Property ['Name': Value] = 'RegisterForContextService':True -Test2 DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +Test2 DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' Test2 DEBUG Property ['Name': Value] = 'Timeline':False Test2 DEBUG Property ['Name': Value] = 'AuditStop':False Test2 DEBUG Property ['Name': Value] = 'AuditStart':False diff --git a/GaudiExamples/tests/qmtest/refs/Histograms.ref b/GaudiExamples/tests/qmtest/refs/Histograms.ref index be1b69fcfd..e8fc9660ec 100644 --- a/GaudiExamples/tests/qmtest/refs/Histograms.ref +++ b/GaudiExamples/tests/qmtest/refs/Histograms.ref @@ -32,13 +32,13 @@ SimpleHistos DEBUG could not locate CounterSummarySvc, no counter summary SimpleHistos DEBUG List of ALL properties of GaudiHistoAlgorithm/SimpleHistos #properties = 52 SimpleHistos DEBUG Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } SimpleHistos DEBUG Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False -SimpleHistos DEBUG Property ['Name': Value] = 'HeaderFor1DHistoTable':| Title | # | Mean | RMS | Skewness | Kurtosis | -SimpleHistos DEBUG Property ['Name': Value] = 'ShortFormatFor1DHistoTable': | %1$-25.25s %2% -SimpleHistos DEBUG Property ['Name': Value] = 'FormatFor1DHistoTable':| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g | +SimpleHistos DEBUG Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' +SimpleHistos DEBUG Property ['Name': Value] = 'ShortFormatFor1DHistoTable':' | %1$-25.25s %2%' +SimpleHistos DEBUG Property ['Name': Value] = 'FormatFor1DHistoTable':'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' SimpleHistos DEBUG Property ['Name': Value] = 'MonitorHistograms':True SimpleHistos DEBUG Property ['Name': Value] = 'FullDetail':False -SimpleHistos DEBUG Property ['Name': Value] = 'HistoDir':SimpleHistos -SimpleHistos DEBUG Property ['Name': Value] = 'HistoTopDir': +SimpleHistos DEBUG Property ['Name': Value] = 'HistoDir':'SimpleHistos' +SimpleHistos DEBUG Property ['Name': Value] = 'HistoTopDir':'' SimpleHistos DEBUG Property ['Name': Value] = 'HistoOffSet':0 SimpleHistos DEBUG Property ['Name': Value] = 'HistoSplitDir':False SimpleHistos DEBUG Property ['Name': Value] = 'HistoCheckForNaN':True @@ -50,11 +50,11 @@ SimpleHistos DEBUG Property ['Name': Value] = 'VetoObjects':[ ] SimpleHistos DEBUG Property ['Name': Value] = 'StatEntityList':[ ] SimpleHistos DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] SimpleHistos DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -SimpleHistos DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -SimpleHistos DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -SimpleHistos DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -SimpleHistos DEBUG Property ['Name': Value] = 'RootInTES': -SimpleHistos DEBUG Property ['Name': Value] = 'Context': +SimpleHistos DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +SimpleHistos DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +SimpleHistos DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +SimpleHistos DEBUG Property ['Name': Value] = 'RootInTES':'' +SimpleHistos DEBUG Property ['Name': Value] = 'Context':'' SimpleHistos DEBUG Property ['Name': Value] = 'TypePrint':True SimpleHistos DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False SimpleHistos DEBUG Property ['Name': Value] = 'StatPrint':True @@ -65,7 +65,7 @@ SimpleHistos DEBUG Property ['Name': Value] = 'IsIOBound':False SimpleHistos DEBUG Property ['Name': Value] = 'NeededResources':[ ] SimpleHistos DEBUG Property ['Name': Value] = 'Cardinality':1 SimpleHistos DEBUG Property ['Name': Value] = 'RegisterForContextService':True -SimpleHistos DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +SimpleHistos DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' SimpleHistos DEBUG Property ['Name': Value] = 'Timeline':False SimpleHistos DEBUG Property ['Name': Value] = 'AuditStop':False SimpleHistos DEBUG Property ['Name': Value] = 'AuditStart':False @@ -98,13 +98,13 @@ Histos2 SUCCESS Property ['Name': Value] = 'Histo2':('',-5.00000,5.00 Histos2 SUCCESS Property ['Name': Value] = 'Histo1':('Histogram1',-3.00000,3.00000,200) Histos2 SUCCESS Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } Histos2 SUCCESS Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False -Histos2 SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':| Title | # | Mean | RMS | Skewness | Kurtosis | -Histos2 SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable': | %1$-25.25s %2% -Histos2 SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g | +Histos2 SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' +Histos2 SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable':' | %1$-25.25s %2%' +Histos2 SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' Histos2 SUCCESS Property ['Name': Value] = 'MonitorHistograms':True Histos2 SUCCESS Property ['Name': Value] = 'FullDetail':False -Histos2 SUCCESS Property ['Name': Value] = 'HistoDir':Histos2 -Histos2 SUCCESS Property ['Name': Value] = 'HistoTopDir': +Histos2 SUCCESS Property ['Name': Value] = 'HistoDir':'Histos2' +Histos2 SUCCESS Property ['Name': Value] = 'HistoTopDir':'' Histos2 SUCCESS Property ['Name': Value] = 'HistoOffSet':0 Histos2 SUCCESS Property ['Name': Value] = 'HistoSplitDir':False Histos2 SUCCESS Property ['Name': Value] = 'HistoCheckForNaN':True @@ -116,11 +116,11 @@ Histos2 SUCCESS Property ['Name': Value] = 'VetoObjects':[ ] Histos2 SUCCESS Property ['Name': Value] = 'StatEntityList':[ ] Histos2 SUCCESS Property ['Name': Value] = 'CounterList':[ '.*' ] Histos2 SUCCESS Property ['Name': Value] = 'UseEfficiencyRowFormat':True -Histos2 SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -Histos2 SUCCESS Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -Histos2 SUCCESS Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -Histos2 SUCCESS Property ['Name': Value] = 'RootInTES': -Histos2 SUCCESS Property ['Name': Value] = 'Context': +Histos2 SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Histos2 SUCCESS Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Histos2 SUCCESS Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Histos2 SUCCESS Property ['Name': Value] = 'RootInTES':'' +Histos2 SUCCESS Property ['Name': Value] = 'Context':'' Histos2 SUCCESS Property ['Name': Value] = 'TypePrint':True Histos2 SUCCESS Property ['Name': Value] = 'PrintEmptyCounters':False Histos2 SUCCESS Property ['Name': Value] = 'StatPrint':True @@ -131,7 +131,7 @@ Histos2 SUCCESS Property ['Name': Value] = 'IsIOBound':False Histos2 SUCCESS Property ['Name': Value] = 'NeededResources':[ ] Histos2 SUCCESS Property ['Name': Value] = 'Cardinality':1 Histos2 SUCCESS Property ['Name': Value] = 'RegisterForContextService':True -Histos2 SUCCESS Property ['Name': Value] = 'MonitorService':MonitorSvc +Histos2 SUCCESS Property ['Name': Value] = 'MonitorService':'MonitorSvc' Histos2 SUCCESS Property ['Name': Value] = 'Timeline':False Histos2 SUCCESS Property ['Name': Value] = 'AuditStop':False Histos2 SUCCESS Property ['Name': Value] = 'AuditStart':False diff --git a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref index 7129dbcbaa..124e3fff6c 100644 --- a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref +++ b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref @@ -21,36 +21,36 @@ Gaudi::MetaDataSvc DEBUG started Gaudi::MetaDataSvc DEBUG Metadata collected: ApplicationMgr.ActivateHistory:False ApplicationMgr.AlgTypeAliases:{ } -ApplicationMgr.AppName:ApplicationMgr -ApplicationMgr.AppVersion: +ApplicationMgr.AppName:'ApplicationMgr' +ApplicationMgr.AppVersion:'' ApplicationMgr.AuditAlgorithms:False ApplicationMgr.AuditServices:False ApplicationMgr.AuditTools:False ApplicationMgr.CreateSvc:[ ] ApplicationMgr.Dlls:[ ] ApplicationMgr.Environment:{ } -ApplicationMgr.EventLoop:EventLoopMgr +ApplicationMgr.EventLoop:'EventLoopMgr' ApplicationMgr.EvtMax:10 -ApplicationMgr.EvtSel:NONE +ApplicationMgr.EvtSel:'NONE' ApplicationMgr.Exit:0 ApplicationMgr.ExtSvc:[ 'RndmGenSvc' , 'Gaudi::MetaDataSvc' ] ApplicationMgr.ExtSvcCreates:True ApplicationMgr.Go:0 -ApplicationMgr.HistogramPersistency:ROOT +ApplicationMgr.HistogramPersistency:'ROOT' ApplicationMgr.InitializationLoopCheck:True -ApplicationMgr.JobOptionsPath: -ApplicationMgr.JobOptionsPostAction: -ApplicationMgr.JobOptionsPreAction: -ApplicationMgr.JobOptionsSvcType:JobOptionsSvc -ApplicationMgr.JobOptionsType:NONE -ApplicationMgr.MessageSvcType:MessageSvc +ApplicationMgr.JobOptionsPath:'' +ApplicationMgr.JobOptionsPostAction:'' +ApplicationMgr.JobOptionsPreAction:'' +ApplicationMgr.JobOptionsSvcType:'JobOptionsSvc' +ApplicationMgr.JobOptionsType:'NONE' +ApplicationMgr.MessageSvcType:'MessageSvc' ApplicationMgr.OutStream:[ ] -ApplicationMgr.OutStreamType:OutputStream +ApplicationMgr.OutStreamType:'OutputStream' ApplicationMgr.OutputLevel:3 ApplicationMgr.PluginDebugLevel:0 ApplicationMgr.PropertiesPrint:False ApplicationMgr.ReturnCode:0 -ApplicationMgr.Runable:AppMgrRunable +ApplicationMgr.Runable:'AppMgrRunable' ApplicationMgr.StalledEventMonitoring:False ApplicationMgr.StatusCodeCheck:False ApplicationMgr.StopOnSignal:False @@ -67,13 +67,13 @@ JobOptionsSvc.AuditRestart:False JobOptionsSvc.AuditServices:False JobOptionsSvc.AuditStart:False JobOptionsSvc.AuditStop:False -JobOptionsSvc.DUMPFILE: +JobOptionsSvc.DUMPFILE:'' JobOptionsSvc.OutputLevel:3 -JobOptionsSvc.PATH:../options/job.opts -JobOptionsSvc.PYTHONACTION: -JobOptionsSvc.PYTHONPARAMS: -JobOptionsSvc.SEARCHPATH:/workspace/build/GAUDI/GAUDI_HEAD/GaudiExamples/tests/qmtest:/workspace/build/GAUDI/GAUDI_HEAD/GaudiExamples/options -JobOptionsSvc.TYPE:NONE +JobOptionsSvc.PATH:'../options/job.opts' +JobOptionsSvc.PYTHONACTION:'' +JobOptionsSvc.PYTHONPARAMS:'' +JobOptionsSvc.SEARCHPATH:'/home/marco/Devel/workspace/Gaudi/GaudiExamples/tests/qmtest:/home/marco/Devel/workspace/Gaudi/GaudiExamples/options' +JobOptionsSvc.TYPE:'NONE' MessageSvc.AuditFinalize:False MessageSvc.AuditInitialize:False MessageSvc.AuditReinitialize:False @@ -81,7 +81,7 @@ MessageSvc.AuditRestart:False MessageSvc.AuditServices:False MessageSvc.AuditStart:False MessageSvc.AuditStop:False -MessageSvc.Format:% F%18W%S%7W%R%T %0W%M +MessageSvc.Format:'% F%18W%S%7W%R%T %0W%M' MessageSvc.OutputLevel:3 MessageSvc.alwaysColorCode:[ ] MessageSvc.alwaysLimit:0 @@ -106,7 +106,7 @@ MessageSvc.setVerbose:[ ] MessageSvc.setWarning:[ ] MessageSvc.showStats:False MessageSvc.statLevel:0 -MessageSvc.timeFormat:%Y-%m-%d %H:%M:%S,%f +MessageSvc.timeFormat:'%Y-%m-%d %H:%M:%S,%f' MessageSvc.tracedInactiveSources:[ ] MessageSvc.useColors:False MessageSvc.verboseColorCode:[ ] @@ -120,8 +120,8 @@ NTupleSvc.AuditRestart:False NTupleSvc.AuditServices:False NTupleSvc.AuditStart:False NTupleSvc.AuditStop:False -NTupleSvc.DataAccessName:DataAccess -NTupleSvc.DataFaultName:DataFault +NTupleSvc.DataAccessName:'DataAccess' +NTupleSvc.DataFaultName:'DataFault' NTupleSvc.EnableAccessHandler:False NTupleSvc.EnableFaultHandler:False NTupleSvc.ForceLeaves:False @@ -130,12 +130,12 @@ NTupleSvc.Input:[ ] NTupleSvc.Output:[ "MYLUN DATAFILE='TupleEx.root' OPT='NEW' TYP='ROOT'" ] NTupleSvc.OutputLevel:3 NTupleSvc.RootCLID:1 -NTupleSvc.RootName:/NTUPLES -RFileCnv.GlobalCompression:"LZMA:6" +NTupleSvc.RootName:'/NTUPLES' +RFileCnv.GlobalCompression:'LZMA:6' ToolSvc: -Tuple.NTupleLUN:"MYLUN" -Tuple2.NTupleLUN:"MYLUN" -Tuple3.NTupleLUN:"MYLUN" +Tuple.NTupleLUN:'MYLUN' +Tuple2.NTupleLUN:'MYLUN' +Tuple3.NTupleLUN:'MYLUN' ApplicationMgr INFO Application Manager Started successfully RFileCnv INFO opening Root file "TupleEx.root" for writing, CompressionLevel='LZMA:6' diff --git a/GaudiExamples/tests/qmtest/refs/Properties.ref b/GaudiExamples/tests/qmtest/refs/Properties.ref index 05e01a299e..ff70fa4a33 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties.ref @@ -78,7 +78,7 @@ PropertyAlg INFO DoublePairArray = [] PropertyAlg INFO PInt = 'PInt':100 PropertyAlg INFO Read handler called for property: 'PDouble':100.00000 PropertyAlg INFO PDouble = 'PDouble':100.00000 -PropertyAlg INFO PString = 'PString':hundred +PropertyAlg INFO PString = 'PString':'hundred' PropertyAlg INFO PBool = 'PBool':False PropertyAlg INFO PIntArray = 'PIntArray':[ ] PropertyAlg INFO PDoubleArray = 'PDoubleArray':[ ] @@ -106,7 +106,7 @@ PropertyAlg INFO DoublePairArray = [(1.1, 2.1), (2.3, 4.5), (5.6, 6.7) PropertyAlg INFO PInt = 'PInt':101 PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO PDouble = 'PDouble':10100000. -PropertyAlg INFO PString = 'PString':hundred one +PropertyAlg INFO PString = 'PString':'hundred one' PropertyAlg INFO PBool = 'PBool':True PropertyAlg INFO PIntArray = 'PIntArray':[ 1 , 2 , 3 , 5 ] PropertyAlg INFO PDoubleArray = 'PDoubleArray':[ 1.1000000 , 2.0000000 , 3.3000000 ] @@ -196,7 +196,7 @@ PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; PropertyProxy INFO Set property this.RInt = 1001; PropertyProxy INFO Got property this.RInt = 1001; -PropertyProxy INFO Got property this.String = This is set by the proxy; +PropertyProxy INFO Got property this.String = 'This is set by the proxy'; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. HistogramPersis...WARNING Histograms saving not required. diff --git a/GaudiExamples/tests/qmtest/refs/Properties2.ref b/GaudiExamples/tests/qmtest/refs/Properties2.ref index 237e2010a5..3ee558369b 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties2.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties2.ref @@ -80,7 +80,7 @@ PropertyAlg INFO DoublePairArray = [] PropertyAlg INFO PInt = 'PInt':100 PropertyAlg INFO Read handler called for property: 'PDouble':100.00000 PropertyAlg INFO PDouble = 'PDouble':100.00000 -PropertyAlg INFO PString = 'PString':hundred +PropertyAlg INFO PString = 'PString':'hundred' PropertyAlg INFO PBool = 'PBool':False PropertyAlg INFO PIntArray = 'PIntArray':[ ] PropertyAlg INFO PDoubleArray = 'PDoubleArray':[ ] @@ -108,7 +108,7 @@ PropertyAlg INFO DoublePairArray = [(1.1, 2.1), (2.3, 4.5), (5.6, 6.7) PropertyAlg INFO PInt = 'PInt':101 PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO PDouble = 'PDouble':10100000. -PropertyAlg INFO PString = 'PString':hundred one +PropertyAlg INFO PString = 'PString':'hundred one' PropertyAlg INFO PBool = 'PBool':True PropertyAlg INFO PIntArray = 'PIntArray':[ 1 , 2 , 3 , 5 ] PropertyAlg INFO PDoubleArray = 'PDoubleArray':[ 1.1000000 , 2.0000000 , 3.3000000 ] @@ -189,7 +189,7 @@ PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; PropertyProxy INFO Set property this.RInt = 1001; PropertyProxy INFO Got property this.RInt = 1001; -PropertyProxy INFO Got property this.String = This is set by the proxy; +PropertyProxy INFO Got property this.String = 'This is set by the proxy'; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. HistogramPersis...WARNING Histograms saving not required. diff --git a/GaudiExamples/tests/qmtest/refs/Properties_py.ref b/GaudiExamples/tests/qmtest/refs/Properties_py.ref index 1a1684c7f7..bab7cec0a1 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties_py.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties_py.ref @@ -40,7 +40,7 @@ PropertyAlg INFO DoublePairArray = [] PropertyAlg INFO PInt = 'PInt':100 PropertyAlg INFO Read handler called for property: 'PDouble':100.00000 PropertyAlg INFO PDouble = 'PDouble':100.00000 -PropertyAlg INFO PString = 'PString':hundred +PropertyAlg INFO PString = 'PString':'hundred' PropertyAlg INFO PBool = 'PBool':False PropertyAlg INFO PIntArray = 'PIntArray':[ ] PropertyAlg INFO PDoubleArray = 'PDoubleArray':[ ] @@ -68,7 +68,7 @@ PropertyAlg INFO DoublePairArray = [(1.1, 2.1), (2.3, 4.5), (5.6, 6.7) PropertyAlg INFO PInt = 'PInt':101 PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO PDouble = 'PDouble':10100000. -PropertyAlg INFO PString = 'PString':hundred one +PropertyAlg INFO PString = 'PString':'hundred one' PropertyAlg INFO PBool = 'PBool':True PropertyAlg INFO PIntArray = 'PIntArray':[ 1 , 2 , 3 , 5 ] PropertyAlg INFO PDoubleArray = 'PDoubleArray':[ 1.1000000 , 2.0000000 , 3.3000000 , 1.0000000e-20 , 1.0000000e+20 ] @@ -147,7 +147,7 @@ PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; PropertyProxy INFO Set property this.RInt = 1001; PropertyProxy INFO Got property this.RInt = 1001; -PropertyProxy INFO Got property this.String = hundred one; +PropertyProxy INFO Got property this.String = 'hundred one'; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. HistogramPersis...WARNING Histograms saving not required. diff --git a/GaudiExamples/tests/qmtest/refs/ROOT_IO/ExtCollWrite.ref b/GaudiExamples/tests/qmtest/refs/ROOT_IO/ExtCollWrite.ref index 834c440812..0a3a0c5e5a 100644 --- a/GaudiExamples/tests/qmtest/refs/ROOT_IO/ExtCollWrite.ref +++ b/GaudiExamples/tests/qmtest/refs/ROOT_IO/ExtCollWrite.ref @@ -35,31 +35,31 @@ EventAlgs INFO Member list: Gaudi::Examples::ExtendedEvtCol/Fill RndmGenSvc.Engine INFO Generator engine type:CLHEP::RanluxEngine RndmGenSvc.Engine INFO Current Seed:1234567 Luxury:3 RndmGenSvc INFO Using Random engine:HepRndm::Engine -Fill SUCCESS List of ALL properties of Gaudi::Examples::ExtendedEvtCol/Fill #properties = 65 -Fill SUCCESS Property ['Name': Value] = 'Tracks':MyTracks -Fill SUCCESS Property ['Name': Value] = 'EvtColDir':Fill -Fill SUCCESS Property ['Name': Value] = 'EvtColTopDir': -Fill SUCCESS Property ['Name': Value] = 'EvtColLUN':EXTEVT +Fill SUCCESS List of ALL properties of Gaudi::Examples::ExtendedEvtCol/Fill #properties = 66 +Fill SUCCESS Property ['Name': Value] = 'Tracks':'MyTracks' +Fill SUCCESS Property ['Name': Value] = 'EvtColDir':'Fill' +Fill SUCCESS Property ['Name': Value] = 'EvtColTopDir':'' +Fill SUCCESS Property ['Name': Value] = 'EvtColLUN':'EXTEVT' Fill SUCCESS Property ['Name': Value] = 'EvtColOffSet':0 Fill SUCCESS Property ['Name': Value] = 'EvtColSplitDir':False Fill SUCCESS Property ['Name': Value] = 'EvtColsPrint':True Fill SUCCESS Property ['Name': Value] = 'EvtColsProduce':True -Fill SUCCESS Property ['Name': Value] = 'NTupleDir':Fill -Fill SUCCESS Property ['Name': Value] = 'NTupleTopDir': -Fill SUCCESS Property ['Name': Value] = 'NTupleLUN':FILE1 +Fill SUCCESS Property ['Name': Value] = 'NTupleDir':'Fill' +Fill SUCCESS Property ['Name': Value] = 'NTupleTopDir':'' +Fill SUCCESS Property ['Name': Value] = 'NTupleLUN':'FILE1' Fill SUCCESS Property ['Name': Value] = 'NTupleOffSet':0 Fill SUCCESS Property ['Name': Value] = 'NTupleSplitDir':False Fill SUCCESS Property ['Name': Value] = 'NTuplePrint':False Fill SUCCESS Property ['Name': Value] = 'NTupleProduce':False Fill SUCCESS Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } Fill SUCCESS Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False -Fill SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':| Title | # | Mean | RMS | Skewness | Kurtosis | -Fill SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable': | %1$-25.25s %2% -Fill SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g | +Fill SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' +Fill SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable':' | %1$-25.25s %2%' +Fill SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' Fill SUCCESS Property ['Name': Value] = 'MonitorHistograms':True Fill SUCCESS Property ['Name': Value] = 'FullDetail':False -Fill SUCCESS Property ['Name': Value] = 'HistoDir':Fill -Fill SUCCESS Property ['Name': Value] = 'HistoTopDir': +Fill SUCCESS Property ['Name': Value] = 'HistoDir':'Fill' +Fill SUCCESS Property ['Name': Value] = 'HistoTopDir':'' Fill SUCCESS Property ['Name': Value] = 'HistoOffSet':0 Fill SUCCESS Property ['Name': Value] = 'HistoSplitDir':False Fill SUCCESS Property ['Name': Value] = 'HistoCheckForNaN':True @@ -71,21 +71,22 @@ Fill SUCCESS Property ['Name': Value] = 'VetoObjects':[ ] Fill SUCCESS Property ['Name': Value] = 'StatEntityList':[ ] Fill SUCCESS Property ['Name': Value] = 'CounterList':[ '.*' ] Fill SUCCESS Property ['Name': Value] = 'UseEfficiencyRowFormat':True -Fill SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -Fill SUCCESS Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -Fill SUCCESS Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -Fill SUCCESS Property ['Name': Value] = 'RootInTES': -Fill SUCCESS Property ['Name': Value] = 'Context': +Fill SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Fill SUCCESS Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Fill SUCCESS Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Fill SUCCESS Property ['Name': Value] = 'RootInTES':'' +Fill SUCCESS Property ['Name': Value] = 'Context':'' Fill SUCCESS Property ['Name': Value] = 'TypePrint':False Fill SUCCESS Property ['Name': Value] = 'PrintEmptyCounters':False Fill SUCCESS Property ['Name': Value] = 'StatPrint':True Fill SUCCESS Property ['Name': Value] = 'PropertiesPrint':True Fill SUCCESS Property ['Name': Value] = 'ErrorsPrint':True +Fill SUCCESS Property ['Name': Value] = 'FilterCircularDependencies':True Fill SUCCESS Property ['Name': Value] = 'IsIOBound':False Fill SUCCESS Property ['Name': Value] = 'NeededResources':[ ] Fill SUCCESS Property ['Name': Value] = 'Cardinality':1 Fill SUCCESS Property ['Name': Value] = 'RegisterForContextService':True -Fill SUCCESS Property ['Name': Value] = 'MonitorService':MonitorSvc +Fill SUCCESS Property ['Name': Value] = 'MonitorService':'MonitorSvc' Fill SUCCESS Property ['Name': Value] = 'Timeline':False Fill SUCCESS Property ['Name': Value] = 'AuditStop':False Fill SUCCESS Property ['Name': Value] = 'AuditStart':False diff --git a/GaudiExamples/tests/qmtest/refs/TBB/GaudiCommonTests.ref b/GaudiExamples/tests/qmtest/refs/TBB/GaudiCommonTests.ref index 365d07ae79..6a9f48a1f3 100644 --- a/GaudiExamples/tests/qmtest/refs/TBB/GaudiCommonTests.ref +++ b/GaudiExamples/tests/qmtest/refs/TBB/GaudiCommonTests.ref @@ -30,27 +30,28 @@ StatusCodeSvc INFO initialize Test1 DEBUG Property update for OutputLevel : new value = 2 Test1 DEBUG Initialize base class GaudiCommon Test1 DEBUG could not locate CounterSummarySvc, no counter summary will be made -Test1 DEBUG List of ALL properties of GaudiCommonTests/Test1 #properties = 35 +Test1 DEBUG List of ALL properties of GaudiCommonTests/Test1 #properties = 36 Test1 DEBUG Property ['Name': Value] = 'RequireObjects':[ ] Test1 DEBUG Property ['Name': Value] = 'VetoObjects':[ ] Test1 DEBUG Property ['Name': Value] = 'StatEntityList':[ ] Test1 DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] Test1 DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -Test1 DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -Test1 DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -Test1 DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -Test1 DEBUG Property ['Name': Value] = 'RootInTES': -Test1 DEBUG Property ['Name': Value] = 'Context': +Test1 DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Test1 DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Test1 DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Test1 DEBUG Property ['Name': Value] = 'RootInTES':'' +Test1 DEBUG Property ['Name': Value] = 'Context':'' Test1 DEBUG Property ['Name': Value] = 'TypePrint':True Test1 DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False Test1 DEBUG Property ['Name': Value] = 'StatPrint':True Test1 DEBUG Property ['Name': Value] = 'PropertiesPrint':False Test1 DEBUG Property ['Name': Value] = 'ErrorsPrint':True +Test1 DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True Test1 DEBUG Property ['Name': Value] = 'IsIOBound':False Test1 DEBUG Property ['Name': Value] = 'NeededResources':[ ] Test1 DEBUG Property ['Name': Value] = 'Cardinality':1 Test1 DEBUG Property ['Name': Value] = 'RegisterForContextService':True -Test1 DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +Test1 DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' Test1 DEBUG Property ['Name': Value] = 'Timeline':False Test1 DEBUG Property ['Name': Value] = 'AuditStop':False Test1 DEBUG Property ['Name': Value] = 'AuditStart':False @@ -73,27 +74,28 @@ Test1 DEBUG Data Deps for Test1 Test2 DEBUG Property update for OutputLevel : new value = 2 Test2 DEBUG Initialize base class GaudiCommon Test2 DEBUG could not locate CounterSummarySvc, no counter summary will be made -Test2 DEBUG List of ALL properties of GaudiCommonTests/Test2 #properties = 35 +Test2 DEBUG List of ALL properties of GaudiCommonTests/Test2 #properties = 36 Test2 DEBUG Property ['Name': Value] = 'RequireObjects':[ ] Test2 DEBUG Property ['Name': Value] = 'VetoObjects':[ ] Test2 DEBUG Property ['Name': Value] = 'StatEntityList':[ ] Test2 DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] Test2 DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -Test2 DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -Test2 DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -Test2 DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -Test2 DEBUG Property ['Name': Value] = 'RootInTES':microDST/ -Test2 DEBUG Property ['Name': Value] = 'Context': +Test2 DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Test2 DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Test2 DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Test2 DEBUG Property ['Name': Value] = 'RootInTES':'microDST/' +Test2 DEBUG Property ['Name': Value] = 'Context':'' Test2 DEBUG Property ['Name': Value] = 'TypePrint':True Test2 DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False Test2 DEBUG Property ['Name': Value] = 'StatPrint':True Test2 DEBUG Property ['Name': Value] = 'PropertiesPrint':False Test2 DEBUG Property ['Name': Value] = 'ErrorsPrint':True +Test2 DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True Test2 DEBUG Property ['Name': Value] = 'IsIOBound':False Test2 DEBUG Property ['Name': Value] = 'NeededResources':[ ] Test2 DEBUG Property ['Name': Value] = 'Cardinality':1 Test2 DEBUG Property ['Name': Value] = 'RegisterForContextService':True -Test2 DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +Test2 DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' Test2 DEBUG Property ['Name': Value] = 'Timeline':False Test2 DEBUG Property ['Name': Value] = 'AuditStop':False Test2 DEBUG Property ['Name': Value] = 'AuditStart':False diff --git a/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref b/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref index ce9f14a6c4..2912ad03f8 100644 --- a/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref +++ b/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref @@ -69,29 +69,30 @@ TimelineSvc DEBUG initialize DataCreator VERBOSE ServiceLocatorHelper::service: found service TimelineSvc DataCreator DEBUG Initialize base class GaudiCommon DataCreator DEBUG could not locate CounterSummarySvc, no counter summary will be made -DataCreator DEBUG List of ALL properties of GaudiTesting::PutDataObjectAlg/DataCreator #properties = 37 -DataCreator DEBUG Property ['Name': Value] = 'DataSvc':EventDataSvc +DataCreator DEBUG List of ALL properties of GaudiTesting::PutDataObjectAlg/DataCreator #properties = 38 +DataCreator DEBUG Property ['Name': Value] = 'DataSvc':'EventDataSvc' DataCreator DEBUG Property ['Name': Value] = 'Paths':[ 'A' , 'B' , 'C' , 'D' ] DataCreator DEBUG Property ['Name': Value] = 'RequireObjects':[ ] DataCreator DEBUG Property ['Name': Value] = 'VetoObjects':[ ] DataCreator DEBUG Property ['Name': Value] = 'StatEntityList':[ ] DataCreator DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] DataCreator DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -DataCreator DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -DataCreator DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -DataCreator DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -DataCreator DEBUG Property ['Name': Value] = 'RootInTES': -DataCreator DEBUG Property ['Name': Value] = 'Context': +DataCreator DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +DataCreator DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +DataCreator DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +DataCreator DEBUG Property ['Name': Value] = 'RootInTES':'' +DataCreator DEBUG Property ['Name': Value] = 'Context':'' DataCreator DEBUG Property ['Name': Value] = 'TypePrint':True DataCreator DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False DataCreator DEBUG Property ['Name': Value] = 'StatPrint':True DataCreator DEBUG Property ['Name': Value] = 'PropertiesPrint':False DataCreator DEBUG Property ['Name': Value] = 'ErrorsPrint':True +DataCreator DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True DataCreator DEBUG Property ['Name': Value] = 'IsIOBound':False DataCreator DEBUG Property ['Name': Value] = 'NeededResources':[ ] DataCreator DEBUG Property ['Name': Value] = 'Cardinality':1 DataCreator DEBUG Property ['Name': Value] = 'RegisterForContextService':True -DataCreator DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +DataCreator DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' DataCreator DEBUG Property ['Name': Value] = 'Timeline':False DataCreator DEBUG Property ['Name': Value] = 'AuditStop':False DataCreator DEBUG Property ['Name': Value] = 'AuditStart':False @@ -121,27 +122,28 @@ OddEvents VERBOSE ServiceLocatorHelper::service: found service EventData OddEvents VERBOSE ServiceLocatorHelper::service: found service TimelineSvc OddEvents DEBUG Initialize base class GaudiCommon OddEvents DEBUG could not locate CounterSummarySvc, no counter summary will be made -OddEvents DEBUG List of ALL properties of GaudiTesting::OddEventsFilter/OddEvents #properties = 35 +OddEvents DEBUG List of ALL properties of GaudiTesting::OddEventsFilter/OddEvents #properties = 36 OddEvents DEBUG Property ['Name': Value] = 'RequireObjects':[ ] OddEvents DEBUG Property ['Name': Value] = 'VetoObjects':[ ] OddEvents DEBUG Property ['Name': Value] = 'StatEntityList':[ ] OddEvents DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] OddEvents DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -OddEvents DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -OddEvents DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -OddEvents DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -OddEvents DEBUG Property ['Name': Value] = 'RootInTES': -OddEvents DEBUG Property ['Name': Value] = 'Context': +OddEvents DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +OddEvents DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +OddEvents DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +OddEvents DEBUG Property ['Name': Value] = 'RootInTES':'' +OddEvents DEBUG Property ['Name': Value] = 'Context':'' OddEvents DEBUG Property ['Name': Value] = 'TypePrint':True OddEvents DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False OddEvents DEBUG Property ['Name': Value] = 'StatPrint':True OddEvents DEBUG Property ['Name': Value] = 'PropertiesPrint':False OddEvents DEBUG Property ['Name': Value] = 'ErrorsPrint':True +OddEvents DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True OddEvents DEBUG Property ['Name': Value] = 'IsIOBound':False OddEvents DEBUG Property ['Name': Value] = 'NeededResources':[ ] OddEvents DEBUG Property ['Name': Value] = 'Cardinality':1 OddEvents DEBUG Property ['Name': Value] = 'RegisterForContextService':True -OddEvents DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +OddEvents DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' OddEvents DEBUG Property ['Name': Value] = 'Timeline':False OddEvents DEBUG Property ['Name': Value] = 'AuditStop':False OddEvents DEBUG Property ['Name': Value] = 'AuditStart':False @@ -169,27 +171,28 @@ EvenEvents VERBOSE ServiceLocatorHelper::service: found service EventData EvenEvents VERBOSE ServiceLocatorHelper::service: found service TimelineSvc EvenEvents DEBUG Initialize base class GaudiCommon EvenEvents DEBUG could not locate CounterSummarySvc, no counter summary will be made -EvenEvents DEBUG List of ALL properties of GaudiTesting::EvenEventsFilter/EvenEvents #properties = 35 +EvenEvents DEBUG List of ALL properties of GaudiTesting::EvenEventsFilter/EvenEvents #properties = 36 EvenEvents DEBUG Property ['Name': Value] = 'RequireObjects':[ ] EvenEvents DEBUG Property ['Name': Value] = 'VetoObjects':[ ] EvenEvents DEBUG Property ['Name': Value] = 'StatEntityList':[ ] EvenEvents DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] EvenEvents DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -EvenEvents DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -EvenEvents DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -EvenEvents DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -EvenEvents DEBUG Property ['Name': Value] = 'RootInTES': -EvenEvents DEBUG Property ['Name': Value] = 'Context': +EvenEvents DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +EvenEvents DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +EvenEvents DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +EvenEvents DEBUG Property ['Name': Value] = 'RootInTES':'' +EvenEvents DEBUG Property ['Name': Value] = 'Context':'' EvenEvents DEBUG Property ['Name': Value] = 'TypePrint':True EvenEvents DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False EvenEvents DEBUG Property ['Name': Value] = 'StatPrint':True EvenEvents DEBUG Property ['Name': Value] = 'PropertiesPrint':False EvenEvents DEBUG Property ['Name': Value] = 'ErrorsPrint':True +EvenEvents DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True EvenEvents DEBUG Property ['Name': Value] = 'IsIOBound':False EvenEvents DEBUG Property ['Name': Value] = 'NeededResources':[ ] EvenEvents DEBUG Property ['Name': Value] = 'Cardinality':1 EvenEvents DEBUG Property ['Name': Value] = 'RegisterForContextService':True -EvenEvents DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +EvenEvents DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' EvenEvents DEBUG Property ['Name': Value] = 'Timeline':False EvenEvents DEBUG Property ['Name': Value] = 'AuditStop':False EvenEvents DEBUG Property ['Name': Value] = 'AuditStart':False diff --git a/GaudiKernel/Gaudi/Parsers/Grammars.h b/GaudiKernel/Gaudi/Parsers/Grammars.h index c4c104c5f6..5a82c025a6 100644 --- a/GaudiKernel/Gaudi/Parsers/Grammars.h +++ b/GaudiKernel/Gaudi/Parsers/Grammars.h @@ -97,6 +97,7 @@ namespace Gaudi str = qi::lexeme[begin_quote[qi::_a = qi::_1] > *( ( enc::char_( '\\' ) >> quote( qi::_a ) )[qi::_val += qi::_a] | + ( enc::char_( '\\' ) >> enc::char_( '\\' ) )[qi::_val += '\\'] | ( enc::char_[qi::_val += qi::_1] - quote( qi::_a ) ) ) > quote( qi::_a )]; } //------------------------------------------------------------------------------ diff --git a/GaudiKernel/GaudiKernel/Property.h b/GaudiKernel/GaudiKernel/Property.h index b01c6b4b25..7f15cd47ef 100644 --- a/GaudiKernel/GaudiKernel/Property.h +++ b/GaudiKernel/GaudiKernel/Property.h @@ -197,12 +197,6 @@ namespace Gaudi } } }; - // Specialization of toString for strings (identity function) - template <> - inline std::string DefaultStringConverterImpl::toString( const std::string& v ) - { - return v; - } // This class provides a default implementation of StringConverter based // on the overloadable parse() and toStream() global Gaudi methods. diff --git a/GaudiKernel/src/Lib/StringKey.cpp b/GaudiKernel/src/Lib/StringKey.cpp index 0c296c14ea..3c4cdbf2d2 100644 --- a/GaudiKernel/src/Lib/StringKey.cpp +++ b/GaudiKernel/src/Lib/StringKey.cpp @@ -34,7 +34,7 @@ std::string Gaudi::StringKey::toString() const { return Gaudi::Utils::toString( // ============================================================================ // the representation of the object // ============================================================================ -std::string Gaudi::StringKey::__str__() const { return toString(); } +std::string Gaudi::StringKey::__str__() const { return m_str; } // ============================================================================ // the representation of the object // ============================================================================ diff --git a/GaudiKernel/src/Util/genconf.cpp b/GaudiKernel/src/Util/genconf.cpp index 33e0c86412..d4251dd54f 100644 --- a/GaudiKernel/src/Util/genconf.cpp +++ b/GaudiKernel/src/Util/genconf.cpp @@ -767,7 +767,7 @@ void configGenerator::pythonizeValue( const PropertyBase* p, string& pvalue, str } ptype = "float"; } else if ( ti == typeIndex() ) { - pvalue = "'" + cvalue + "'"; + pvalue = cvalue; ptype = "str"; } else if ( ti == typeIndex() ) { const GaudiHandleProperty& hdl = dynamic_cast( *p ); diff --git a/GaudiKernel/tests/src/test_Property.cpp b/GaudiKernel/tests/src/test_Property.cpp index eb1655e584..477fc9db0b 100644 --- a/GaudiKernel/tests/src/test_Property.cpp +++ b/GaudiKernel/tests/src/test_Property.cpp @@ -82,9 +82,9 @@ BOOST_AUTO_TEST_CASE( string_conversion ) BOOST_CHECK( p1.value() == "" ); p1 = "abc"; BOOST_CHECK( p1.value() == "abc" ); - BOOST_CHECK( p1.fromString( "xyz" ) ); + BOOST_CHECK( p1.fromString( "'xyz'" ) ); BOOST_CHECK( p1.value() == "xyz" ); - BOOST_CHECK( p1.toString() == "xyz" ); + BOOST_CHECK( p1.toString() == "'xyz'" ); } { Gaudi::Property p2{"p2", 10}; @@ -104,33 +104,6 @@ BOOST_AUTO_TEST_CASE( string_conversion ) BOOST_CHECK( p3.value() == true ); BOOST_CHECK( p3.toString() == "True" ); } - { - Gaudi::Property dst{0}; - Gaudi::Property src{"321"}; - BOOST_CHECK( dst.value() == 0 ); - BOOST_CHECK( dst.assign( src ) ); - BOOST_CHECK( dst.value() == 321 ); - dst = 100; - BOOST_CHECK( dst.value() == 100 ); - BOOST_CHECK( dst.load( src ) ); - BOOST_CHECK( src.value() == "100" ); - } - { - // string property as from options - Gaudi::Property opt{"\"NONE\""}; - Gaudi::Property p{}; - BOOST_CHECK( opt.load( p ) ); - BOOST_CHECK( p.value() == "NONE" ); - } - { - // string property as from options - Gaudi::Property opt{"\"NONE\""}; - std::string dst; - Gaudi::Property p{"test", dst}; - BOOST_CHECK( opt.load( p ) ); - BOOST_CHECK( p.value() == "NONE" ); - BOOST_CHECK( dst == "NONE" ); - } } template diff --git a/GaudiPolicy/python/GaudiTesting/BaseTest.py b/GaudiPolicy/python/GaudiTesting/BaseTest.py index 611a6eeaa8..68f87334d0 100644 --- a/GaudiPolicy/python/GaudiTesting/BaseTest.py +++ b/GaudiPolicy/python/GaudiTesting/BaseTest.py @@ -889,6 +889,7 @@ for w, o, r in [ (None, r"^(.*(DEBUG|SUCCESS) List of ALL properties of .*#properties = )\d+", r"\1NN"), ('ApplicationMgr', r'(declareMultiSvcType|addMultiSvc): ', ''), + ("Property", r"( = '[^']+':)'(.*)'", r'\1\2'), ]: # [ ("TIMER.TIMER","[0-9]+[0-9.]*", "") ] normalizeExamples += RegexpReplacer(o, r, w) -- GitLab From d15059870738a1c2b9dc3f5c238ea3ae482d07e8 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Sat, 30 Dec 2017 11:53:17 +0100 Subject: [PATCH 10/62] Add Doxygen comments. --- .../src/JobOptionsSvc/JobOptionsSvc.h | 5 +++- GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index b3386aa0f8..8c5b0648f1 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -33,9 +33,12 @@ private: mutable std::map> m_old_iface_compat; mutable std::map m_old_iface_compat_2; + /// Find an option key in the options storage using case insensitive comparison. + /// If the found key does not match the case of the requested one, a warning is printed. StorageType::const_iterator find( const std::string& key, bool warn ) const; protected: + /// @{ void set( const std::string& key, const std::string& value ) override { m_options[key] = value; } std::string get( const std::string& key, const std::string& default_ = {} ) const override { @@ -61,7 +64,7 @@ protected: std::for_each( begin( m_options ), end( m_options ), [&v]( const auto& item ) { v.emplace_back( item ); } ); return v; } - + /// @} public: // Constructor JobOptionsSvc( const std::string& name, ISvcLocator* svc ); diff --git a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h index 8b9f60a979..ba62f9f07a 100644 --- a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h +++ b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h @@ -8,14 +8,41 @@ namespace Gaudi { namespace Interfaces { + /** Interface for a component that manages application configuration options. + + Options are to be recorded as pairs of strings: option id and value. + The value must be the string representation of the a value, as understood by + `Gaudi::Property::fromString()`. + + For example, if an Algorithm defines two properties as in + \code + class MyAlg: public Algorithm { + Gaudi::Property m_hname{this, "HistoName", "none"}; + Gaudi::Property m_threshold{this, "Threshold", 1.0}; + }; + \endcode + + The IOptionsSvc instance should be populated with something like + \code + auto& optsSvc = sericeLocator()->getOptsSvc(); + optsSvc.set("AlgInstanceName.HistoName", "'my_histogram'"); + optsSvc.set("AlgInstanceName.Threshold", "2.345"); + \endcode + */ class IOptionsSvc { public: + /// Set the value of an option, overriding the old value, if any. virtual void set( const std::string& key, const std::string& value ) = 0; + /// Get the value of an options, returning the specified _default_ value if not found. virtual std::string get( const std::string& key, const std::string& default_ = {} ) const = 0; + /// Get the value of an options, removing it from the storage, returning the specified _default_ value if not + /// found. virtual std::string pop( const std::string& key, const std::string& default_ = {} ) = 0; + /// Test if an option key is availble in the catalog. virtual bool has( const std::string& key ) const = 0; + /// Return all known options with their values. virtual std::vector> items() const = 0; protected: -- GitLab From 00c699830fdcad490c76b372655b8d10b3a9d63f Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Mon, 5 Mar 2018 12:40:20 +0100 Subject: [PATCH 11/62] Fixed use of property in ViewTester --- GaudiHive/src/ViewTester.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GaudiHive/src/ViewTester.cpp b/GaudiHive/src/ViewTester.cpp index 718ef3b737..e0aee83edf 100644 --- a/GaudiHive/src/ViewTester.cpp +++ b/GaudiHive/src/ViewTester.cpp @@ -79,11 +79,11 @@ StatusCode ViewTester::execute() // the execution of the algorithm StatusCode sc = scheduler->scheduleEventView( &context, m_viewNodeName, std::move( viewContext ) ); if ( sc.isSuccess() ) - info() << "Attached view " << viewName << " to node " << m_viewNodeName.toString() << " for " << context + info() << "Attached view " << viewName << " to node " << m_viewNodeName.value() << " for " << context << endmsg; else - error() << "Unable to attach view " << viewName << " to node " << m_viewNodeName.toString() << " for " - << context << endmsg; + error() << "Unable to attach view " << viewName << " to node " << m_viewNodeName.value() << " for " << context + << endmsg; } } else { // Disable the view node if there are no views -- GitLab From c2a0928d2b4d8efac3a2a61eeb2148f4950d1dce Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Mon, 5 Mar 2018 17:08:30 +0100 Subject: [PATCH 12/62] Make new PropertyHolder methods public --- GaudiKernel/GaudiKernel/PropertyHolder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GaudiKernel/GaudiKernel/PropertyHolder.h b/GaudiKernel/GaudiKernel/PropertyHolder.h index aaa069f5c8..2c3abfb218 100644 --- a/GaudiKernel/GaudiKernel/PropertyHolder.h +++ b/GaudiKernel/GaudiKernel/PropertyHolder.h @@ -285,7 +285,7 @@ public: } ); } // ========================================================================== -protected: + /// \fixme property and setPropertiesFrom should be protected // get local or remote property by name Gaudi::Details::PropertyBase* property( const std::string& name ) const { -- GitLab From 580085d8002b80dd75784ead39b7eb3681cf50e8 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Mon, 5 Mar 2018 17:10:00 +0100 Subject: [PATCH 13/62] Add macro to detect presence of Gaudi::Interfaces::IOptionsSvc --- GaudiKernel/GaudiKernel/ISvcLocator.h | 1 + 1 file changed, 1 insertion(+) diff --git a/GaudiKernel/GaudiKernel/ISvcLocator.h b/GaudiKernel/GaudiKernel/ISvcLocator.h index a20a8a5f8a..0bb0fd6959 100644 --- a/GaudiKernel/GaudiKernel/ISvcLocator.h +++ b/GaudiKernel/GaudiKernel/ISvcLocator.h @@ -20,6 +20,7 @@ namespace Gaudi class IOptionsSvc; } } +#define GAUDI_HAS_IOPTIONS_SVC /** @class ISvcLocator ISvcLocator.h GaudiKernel/ISvcLocator.h The ISvcLocator is the interface implemented by the Service Factory in the -- GitLab From 089f7b8ea4eb33fdfa5867734a297f001263f8a8 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Tue, 11 Sep 2018 11:34:06 +0200 Subject: [PATCH 14/62] Fix small typo in THistSvc --- GaudiExamples/tests/qmtest/refs/THistRead.ref | 2 +- GaudiExamples/tests/qmtest/refs/THistRead.ref.dbg | 2 +- GaudiExamples/tests/qmtest/refs/THistWrite.ref | 2 +- GaudiExamples/tests/qmtest/refs/THistWrite.ref.dbg | 2 +- GaudiSvc/src/THistSvc/THistSvc.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GaudiExamples/tests/qmtest/refs/THistRead.ref b/GaudiExamples/tests/qmtest/refs/THistRead.ref index 2c4e8fff0a..a22ff610ed 100644 --- a/GaudiExamples/tests/qmtest/refs/THistRead.ref +++ b/GaudiExamples/tests/qmtest/refs/THistRead.ref @@ -32,7 +32,7 @@ ApplicationMgr INFO Application Manager Configured successfully THistSvc DEBUG Property update for OutputLevel : new value = 2 THistSvc DEBUG Delaying connection of Input Files until Initialize. now in OFFLINE THistSvc DEBUG Service base class initialized successfully -THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED +THistSvc DEBUG Delaying connection of Output Files until Initialize. now in CONFIGURED THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED THistSvc DEBUG got the FileMgr THistSvc DEBUG Now connecting of Input Files diff --git a/GaudiExamples/tests/qmtest/refs/THistRead.ref.dbg b/GaudiExamples/tests/qmtest/refs/THistRead.ref.dbg index 70cad8994a..9fb934d8a6 100644 --- a/GaudiExamples/tests/qmtest/refs/THistRead.ref.dbg +++ b/GaudiExamples/tests/qmtest/refs/THistRead.ref.dbg @@ -31,7 +31,7 @@ ApplicationMgr VERBOSE addMultiSvc: added service EventLoopMgr/EventLoopMgr[ ApplicationMgr INFO Application Manager Configured successfully THistSvc DEBUG Property update for OutputLevel : new value = 2 THistSvc DEBUG Service base class initialized successfully -THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED +THistSvc DEBUG Delaying connection of Output Files until Initialize. now in CONFIGURED THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED THistSvc DEBUG got the FileMgr THistSvc DEBUG Now connecting of Input Files diff --git a/GaudiExamples/tests/qmtest/refs/THistWrite.ref b/GaudiExamples/tests/qmtest/refs/THistWrite.ref index 3882b16c83..fe48e77832 100644 --- a/GaudiExamples/tests/qmtest/refs/THistWrite.ref +++ b/GaudiExamples/tests/qmtest/refs/THistWrite.ref @@ -32,7 +32,7 @@ ApplicationMgr INFO Application Manager Configured successfully THistSvc DEBUG Property update for OutputLevel : new value = 2 THistSvc DEBUG Delaying connection of Input Files until Initialize. now in OFFLINE THistSvc DEBUG Service base class initialized successfully -THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED +THistSvc DEBUG Delaying connection of Output Files until Initialize. now in CONFIGURED THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED THistSvc DEBUG got the FileMgr THistSvc DEBUG Opening TFile "tuple2.rt" stream: "upd" mode: "A" comp level: 1 diff --git a/GaudiExamples/tests/qmtest/refs/THistWrite.ref.dbg b/GaudiExamples/tests/qmtest/refs/THistWrite.ref.dbg index b8b23e6a9a..dc894d2675 100644 --- a/GaudiExamples/tests/qmtest/refs/THistWrite.ref.dbg +++ b/GaudiExamples/tests/qmtest/refs/THistWrite.ref.dbg @@ -31,7 +31,7 @@ ApplicationMgr VERBOSE added service EventLoopMgr/EventLoopMgr ApplicationMgr INFO Application Manager Configured successfully THistSvc DEBUG Property update for OutputLevel : new value = 2 THistSvc DEBUG Service base class initialized successfully -THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED +THistSvc DEBUG Delaying connection of Output Files until Initialize. now in CONFIGURED THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED THistSvc DEBUG got the FileMgr THistSvc DEBUG Opening TFile "tuple2.rt" stream: "upd" mode: "A" comp level: 1 diff --git a/GaudiSvc/src/THistSvc/THistSvc.cpp b/GaudiSvc/src/THistSvc/THistSvc.cpp index 37bfe295bf..b982e2ea0d 100644 --- a/GaudiSvc/src/THistSvc/THistSvc.cpp +++ b/GaudiSvc/src/THistSvc/THistSvc.cpp @@ -1753,7 +1753,7 @@ void THistSvc::setupInputFile() void THistSvc::setupOutputFile() { if ( FSMState() < Gaudi::StateMachine::CONFIGURED || !m_okToConnect ) { - debug() << "Delaying connection of Input Files until Initialize" + debug() << "Delaying connection of Output Files until Initialize" << ". now in " << FSMState() << endmsg; m_delayConnect = true; } else { -- GitLab From 5e6280dec40fcc2910ab26d5607a29d711328a9a Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Mon, 10 Sep 2018 23:22:47 +0200 Subject: [PATCH 15/62] Bind properties to entries in options service --- .../src/ApplicationMgr/ApplicationMgr.cpp | 2 +- .../src/ApplicationMgr/ApplicationMgr.h | 21 +- GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp | 2 +- .../src/JobOptionsSvc/JobOptionsSvc.h | 41 +- GaudiExamples/src/Properties/PropertyAlg.cpp | 12 +- .../gaudiexamples.qms/properties.qms/all.qmt | 5 + .../gaudiexamples.qms/properties.qms/all2.qmt | 5 + .../properties.qms/all_py.qmt | 5 + .../tests/qmtest/refs/MetaDataSvc.ref | 377 +++++++++++++++++- .../tests/qmtest/refs/Properties.ref | 299 ++++++++++++-- .../tests/qmtest/refs/Properties2.ref | 298 ++++++++++++-- .../tests/qmtest/refs/Properties_py.ref | 285 +++++++++++-- .../tests/qmtest/refs/THistRead.ref.dbg | 1 + .../tests/qmtest/refs/THistWrite.ref | 2 +- .../tests/qmtest/refs/THistWrite.ref.dbg | 1 + GaudiKernel/CMakeLists.txt | 3 + GaudiKernel/Gaudi/Algorithm.h | 2 +- GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h | 6 + GaudiKernel/GaudiKernel/AlgTool.h | 2 +- GaudiKernel/GaudiKernel/Auditor.h | 2 +- GaudiKernel/GaudiKernel/Property.h | 91 ++++- GaudiKernel/GaudiKernel/PropertyHolder.h | 12 +- GaudiKernel/GaudiKernel/Service.h | 2 +- GaudiKernel/src/Lib/Algorithm.cpp | 2 +- GaudiKernel/src/Lib/Auditor.cpp | 2 +- GaudiKernel/src/Lib/Service.cpp | 2 +- .../tests/src/test_WeekPropertyRef.cpp | 133 ++++++ GaudiPython/python/GaudiPython/Bindings.py | 33 +- GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp | 69 ---- 29 files changed, 1461 insertions(+), 256 deletions(-) create mode 100644 GaudiKernel/tests/src/test_WeekPropertyRef.cpp diff --git a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp index e6399b8b46..4b7ca7f679 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp @@ -257,7 +257,7 @@ StatusCode ApplicationMgr::configure() MsgStream log( m_messageSvc, name() ); // Get my own options using the Job options service if ( log.level() <= MSG::DEBUG ) log << MSG::DEBUG << "Getting my own properties" << endmsg; - setPropertiesFrom( serviceLocator()->getOptsSvc() ); + bindPropertiesTo( serviceLocator()->getOptsSvc() ); } // Make sure that the OutputLevel is in sync diff --git a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h index b5fb4ac54d..00c695e909 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h +++ b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h @@ -240,15 +240,18 @@ protected: Gaudi::Property m_appVersion{this, "AppVersion", {}, "The version of the application"}; Gaudi::Property m_actHistory{this, "ActivateHistory", false, "Activate HistorySvc"}; Gaudi::Property m_codeCheck{this, "StatusCodeCheck", false, "Activate StatusCode checking"}; - Gaudi::Property m_pluginDebugLevel{ - this, "PluginDebugLevel", 0, - [this]( auto& ) { - // Setup debug level for the plugin system - MsgStream log( m_messageSvc, this->name() ); - log << MSG::INFO << "Updating Gaudi::PluginService::SetDebug(level) to level=" << m_pluginDebugLevel << endmsg; - Gaudi::PluginService::SetDebug( m_pluginDebugLevel ); - }, - "Debug level for the plugin system"}; + Gaudi::Property m_pluginDebugLevel{this, "PluginDebugLevel", 0, + [this]( auto& ) { + // Setup debug level for the plugin system + if ( m_pluginDebugLevel.value() ) { + MsgStream log( m_messageSvc, this->name() ); + log << MSG::INFO + << "Updating Gaudi::PluginService::SetDebug(level) to level=" + << m_pluginDebugLevel.value() << endmsg; + } + Gaudi::PluginService::SetDebug( m_pluginDebugLevel ); + }, + "Debug level for the plugin system"}; Gaudi::Property> m_createSvcNameList{ this, "CreateSvc", {}, "List of extra services to be created"}; diff --git a/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp b/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp index 881a191dd3..b1cffe9f77 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp @@ -502,7 +502,7 @@ StatusCode ToolSvc::create( const std::string& tooltype, const std::string& tool // to downcast IAlgTool to AlgTool in order to set the properties via the JobOptions // service AlgTool* mytool = dynamic_cast( toolguard.get() ); - if ( mytool ) mytool->setPropertiesFrom( serviceLocator()->getOptsSvc() ); + if ( mytool ) mytool->bindPropertiesTo( serviceLocator()->getOptsSvc() ); // Initialize the Tool StatusCode sc( StatusCode::FAILURE, true ); diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index 8c5b0648f1..9781e41b9a 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -27,9 +27,10 @@ public: typedef std::vector PropertiesT; private: - using StorageType = std::map; + using StorageType = std::map; StorageType m_options; + mutable std::map> m_old_iface_compat; mutable std::map m_old_iface_compat_2; @@ -39,11 +40,25 @@ private: protected: /// @{ - void set( const std::string& key, const std::string& value ) override { m_options[key] = value; } + void set( const std::string& key, const std::string& value ) override + { + auto item = find( key, true ); + if ( item != m_options.end() && key != item->first ) { + if ( !item->second.isBound() ) { // do not remove references to properties + m_options.erase( item ); // Storage is case insensitive, and I want to use the latest version of the case + item = m_options.end(); + } + } + if ( item == m_options.end() ) { + m_options.emplace( key, value ); + } else { + m_options.find( item->first )->second = value; + } + } std::string get( const std::string& key, const std::string& default_ = {} ) const override { auto item = find( key, true ); - return item != m_options.end() ? item->second : default_; + return item != m_options.end() ? std::string{item->second} : default_; } std::string pop( const std::string& key, const std::string& default_ = {} ) override { @@ -51,8 +66,8 @@ protected: auto item = find( key, true ); if ( item != m_options.end() ) { - m_options.erase( item ); result = std::move( item->second ); + m_options.erase( item ); } return result; } @@ -64,7 +79,25 @@ protected: std::for_each( begin( m_options ), end( m_options ), [&v]( const auto& item ) { v.emplace_back( item ); } ); return v; } + void bind( const std::string& prefix, Gaudi::Details::PropertyBase* property ) override + { + const auto key = prefix + '.' + property->name(); + + auto item = find( key, true ); + if ( item != m_options.end() && key != item->first ) { + // Storage is case insensitive, and I want to use the what the property dictates + auto new_item = m_options.emplace( key, std::move( m_options.find( item->first )->second ) ); + m_options.erase( item ); + item = new_item.first; + } + if ( item == m_options.end() ) { + m_options.emplace( key, *property ); + } else { + m_options.find( key )->second = *property; + } + } /// @} + public: // Constructor JobOptionsSvc( const std::string& name, ISvcLocator* svc ); diff --git a/GaudiExamples/src/Properties/PropertyAlg.cpp b/GaudiExamples/src/Properties/PropertyAlg.cpp index 23c44c85b7..412e8aaefd 100644 --- a/GaudiExamples/src/Properties/PropertyAlg.cpp +++ b/GaudiExamples/src/Properties/PropertyAlg.cpp @@ -253,13 +253,13 @@ StatusCode PropertyAlg::initialize() info() << "=================================================" << endmsg; // Change an option of my own.... - opts.set( name() + '.' + "PInt", "155" ); - setPropertiesFrom( opts ); - // trying to use an invalid value - opts.set( name() + '.' + "DoubleArray", "{\"12.12\", \"13.13\"}" ); - info() << "Changed property DoubleArray in catalogue" << endmsg; + opts.set( name() + '.' + "PInt", "154" ); + info() << "PInt= " << p_int << " [should be 154]" << endmsg; + try { - setPropertiesFrom( opts ); + info() << "Try to assign invalid value to DoubleArray" << endmsg; + // trying to use an invalid value + opts.set( name() + '.' + "DoubleArray", "{\"12.12\", \"13.13\"}" ); } catch ( const std::invalid_argument& exc ) { error() << "got invalid_argument exception: " << exc.what() << endmsg; } diff --git a/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all.qmt b/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all.qmt index 022a14e632..08751fb4c0 100644 --- a/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all.qmt +++ b/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all.qmt @@ -3,4 +3,9 @@ $GAUDIEXAMPLESROOT/options/Properties.opts true refs/Properties.ref + +preprocessor = (normalizeExamples + + RegexpReplacer(r"(JobOptionsSvc\.(SEARCH)?PATH|ApplicationMgr\.JobOptionsPath): '.*'", r"\1: '...'")) +validateWithReference(preproc=preprocessor) + diff --git a/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all2.qmt b/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all2.qmt index 1c7f6e336d..c1ad8e502e 100644 --- a/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all2.qmt +++ b/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all2.qmt @@ -4,4 +4,9 @@ $GAUDIEXAMPLESROOT/options/Properties.opts true refs/Properties2.ref + +preprocessor = (normalizeExamples + + RegexpReplacer(r"(JobOptionsSvc\.(SEARCH)?PATH|ApplicationMgr\.JobOptionsPath): '.*'", r"\1: '...'")) +validateWithReference(preproc=preprocessor) + diff --git a/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all_py.qmt b/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all_py.qmt index 93ce1e3ec4..223f4175e0 100644 --- a/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all_py.qmt +++ b/GaudiExamples/tests/qmtest/gaudiexamples.qms/properties.qms/all_py.qmt @@ -4,4 +4,9 @@ $GAUDIEXAMPLESROOT/options/Properties.py true refs/Properties_py.ref + +preprocessor = (normalizeExamples + + RegexpReplacer(r"(JobOptionsSvc\.(SEARCH)?PATH|ApplicationMgr\.JobOptionsPath): '.*'", r"\1: '...'")) +validateWithReference(preproc=preprocessor) + diff --git a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref index 124e3fff6c..7af9b68c94 100644 --- a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref +++ b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref @@ -1,9 +1,10 @@ -# --> Including file '/workspace/build/GAUDI/GAUDI_HEAD/GaudiExamples/options/TupleEx.py' -# <-- End of file '/workspace/build/GAUDI/GAUDI_HEAD/GaudiExamples/options/TupleEx.py' +# setting LC_ALL to "C" +# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/TupleEx.py' +# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/TupleEx.py' ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v999r999) - running on lbbuild41.cern.ch on Wed Jul 18 05:29:14 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on pclhcb117 on Tue Sep 18 16:59:46 2018 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully RndmGenSvc.Engine INFO Generator engine type:CLHEP::RanluxEngine @@ -19,6 +20,33 @@ EventLoopMgr WARNING No events will be processed from external input. ApplicationMgr INFO Application Manager Initialized successfully Gaudi::MetaDataSvc DEBUG started Gaudi::MetaDataSvc DEBUG Metadata collected: +AlgContextSvc.AuditFinalize:False +AlgContextSvc.AuditInitialize:False +AlgContextSvc.AuditReinitialize:False +AlgContextSvc.AuditRestart:False +AlgContextSvc.AuditServices:False +AlgContextSvc.AuditStart:False +AlgContextSvc.AuditStop:False +AlgContextSvc.BypassIncidents:False +AlgContextSvc.Check:True +AlgContextSvc.OutputLevel:3 +AlgExecStateSvc.AuditFinalize:False +AlgExecStateSvc.AuditInitialize:False +AlgExecStateSvc.AuditReinitialize:False +AlgExecStateSvc.AuditRestart:False +AlgExecStateSvc.AuditServices:False +AlgExecStateSvc.AuditStart:False +AlgExecStateSvc.AuditStop:False +AlgExecStateSvc.OutputLevel:3 +AppMgrRunable.AuditFinalize:False +AppMgrRunable.AuditInitialize:False +AppMgrRunable.AuditReinitialize:False +AppMgrRunable.AuditRestart:False +AppMgrRunable.AuditServices:False +AppMgrRunable.AuditStart:False +AppMgrRunable.AuditStop:False +AppMgrRunable.EvtMax:10 +AppMgrRunable.OutputLevel:3 ApplicationMgr.ActivateHistory:False ApplicationMgr.AlgTypeAliases:{ } ApplicationMgr.AppName:'ApplicationMgr' @@ -57,9 +85,95 @@ ApplicationMgr.StopOnSignal:False ApplicationMgr.SvcMapping:[ 'EvtDataSvc/EventDataSvc' , 'DetDataSvc/DetectorDataSvc' , 'HistogramSvc/HistogramDataSvc' , 'HbookCnv::PersSvc/HbookHistSvc' , 'RootHistCnv::PersSvc/RootHistSvc' , 'EvtPersistencySvc/EventPersistencySvc' , 'DetPersistencySvc/DetectorPersistencySvc' , 'HistogramPersistencySvc/HistogramPersistencySvc' ] ApplicationMgr.SvcOptMapping:[ ] ApplicationMgr.TopAlg:[ 'TupleAlg/Tuple' , 'TupleAlg2/Tuple2' , 'TupleAlg3/Tuple3' ] +EventDataSvc.AuditFinalize:False +EventDataSvc.AuditInitialize:False +EventDataSvc.AuditReinitialize:False +EventDataSvc.AuditRestart:False +EventDataSvc.AuditServices:False +EventDataSvc.AuditStart:False +EventDataSvc.AuditStop:False +EventDataSvc.DataAccessName:'DataAccess' +EventDataSvc.DataFaultName:'DataFault' +EventDataSvc.EnableAccessHandler:False +EventDataSvc.EnableFaultHandler:False +EventDataSvc.ForceLeaves:False +EventDataSvc.InhibitPathes:[ ] +EventDataSvc.OutputLevel:3 +EventDataSvc.RootCLID:110 +EventDataSvc.RootName:'/Event' +EventLoopMgr.AuditFinalize:False +EventLoopMgr.AuditInitialize:False +EventLoopMgr.AuditReinitialize:False +EventLoopMgr.AuditRestart:False +EventLoopMgr.AuditServices:False +EventLoopMgr.AuditStart:False +EventLoopMgr.AuditStop:False +EventLoopMgr.EvtSel:'NONE' +EventLoopMgr.HistogramPersistency:'' +EventLoopMgr.OutStream:[ ] +EventLoopMgr.OutStreamType:'OutputStream' +EventLoopMgr.OutputLevel:3 +EventLoopMgr.PrintControlFlowExpression:False +EventLoopMgr.TopAlg:[ 'TupleAlg/Tuple' , 'TupleAlg2/Tuple2' , 'TupleAlg3/Tuple3' ] +EventLoopMgr.Warnings:True +EventPersistencySvc.AuditFinalize:False +EventPersistencySvc.AuditInitialize:False +EventPersistencySvc.AuditReinitialize:False +EventPersistencySvc.AuditRestart:False +EventPersistencySvc.AuditServices:False +EventPersistencySvc.AuditStart:False +EventPersistencySvc.AuditStop:False +EventPersistencySvc.CnvServices:[ ] +EventPersistencySvc.OutputLevel:3 +Gaudi::MetaDataSvc.AuditFinalize:False +Gaudi::MetaDataSvc.AuditInitialize:False +Gaudi::MetaDataSvc.AuditReinitialize:False +Gaudi::MetaDataSvc.AuditRestart:False +Gaudi::MetaDataSvc.AuditServices:False +Gaudi::MetaDataSvc.AuditStart:False +Gaudi::MetaDataSvc.AuditStop:False +Gaudi::MetaDataSvc.Enabled:True Gaudi::MetaDataSvc.OutputLevel:2 -IAlgManager.Algorithms:Tuple, Tuple2, Tuple3 -ISvcLocator.Services:MessageSvc, JobOptionsSvc, RndmGenSvc.Engine, RndmGenSvc, Gaudi::MetaDataSvc, AppMgrRunable, IncidentSvc, EventPersistencySvc, EventDataSvc, AlgContextSvc, TimelineSvc, RootHistSvc, HistogramPersistencySvc, HistogramDataSvc, NTupleSvc, AlgExecStateSvc, EventLoopMgr, ToolSvc +HistogramDataSvc.AuditFinalize:False +HistogramDataSvc.AuditInitialize:False +HistogramDataSvc.AuditReinitialize:False +HistogramDataSvc.AuditRestart:False +HistogramDataSvc.AuditServices:False +HistogramDataSvc.AuditStart:False +HistogramDataSvc.AuditStop:False +HistogramDataSvc.DataAccessName:'DataAccess' +HistogramDataSvc.DataFaultName:'DataFault' +HistogramDataSvc.EnableAccessHandler:False +HistogramDataSvc.EnableFaultHandler:False +HistogramDataSvc.ForceLeaves:False +HistogramDataSvc.InhibitPathes:[ ] +HistogramDataSvc.Input:[ ] +HistogramDataSvc.OutputLevel:3 +HistogramDataSvc.Predefined1DHistos:{ } +HistogramDataSvc.RootCLID:1 +HistogramDataSvc.RootName:'/stat' +HistogramPersistencySvc.AuditFinalize:False +HistogramPersistencySvc.AuditInitialize:False +HistogramPersistencySvc.AuditReinitialize:False +HistogramPersistencySvc.AuditRestart:False +HistogramPersistencySvc.AuditServices:False +HistogramPersistencySvc.AuditStart:False +HistogramPersistencySvc.AuditStop:False +HistogramPersistencySvc.CnvServices:[ 'RootHistSvc' ] +HistogramPersistencySvc.ConvertHistos:[ ] +HistogramPersistencySvc.ExcludeHistos:[ ] +HistogramPersistencySvc.HistogramPersistency:'ROOT' +HistogramPersistencySvc.OutputFile:'' +HistogramPersistencySvc.OutputLevel:3 +HistogramPersistencySvc.Warnings:True +IncidentSvc.AuditFinalize:False +IncidentSvc.AuditInitialize:False +IncidentSvc.AuditReinitialize:False +IncidentSvc.AuditRestart:False +IncidentSvc.AuditServices:False +IncidentSvc.AuditStart:False +IncidentSvc.AuditStop:False +IncidentSvc.OutputLevel:3 JobOptionsSvc.AuditFinalize:False JobOptionsSvc.AuditInitialize:False JobOptionsSvc.AuditReinitialize:False @@ -131,11 +245,259 @@ NTupleSvc.Output:[ "MYLUN DATAFILE='TupleEx.root' OPT='NEW' TYP='ROOT'" ] NTupleSvc.OutputLevel:3 NTupleSvc.RootCLID:1 NTupleSvc.RootName:'/NTUPLES' +NTupleSvcConversions.AuditFinalize:False +NTupleSvcConversions.AuditInitialize:False +NTupleSvcConversions.AuditReinitialize:False +NTupleSvcConversions.AuditRestart:False +NTupleSvcConversions.AuditServices:False +NTupleSvcConversions.AuditStart:False +NTupleSvcConversions.AuditStop:False +NTupleSvcConversions.OutputLevel:3 RFileCnv.GlobalCompression:'LZMA:6' -ToolSvc: +RndmGenSvc.AuditFinalize:False +RndmGenSvc.AuditInitialize:False +RndmGenSvc.AuditReinitialize:False +RndmGenSvc.AuditRestart:False +RndmGenSvc.AuditServices:False +RndmGenSvc.AuditStart:False +RndmGenSvc.AuditStop:False +RndmGenSvc.Engine:'HepRndm::Engine' +RndmGenSvc.Engine.AuditFinalize:False +RndmGenSvc.Engine.AuditInitialize:False +RndmGenSvc.Engine.AuditReinitialize:False +RndmGenSvc.Engine.AuditRestart:False +RndmGenSvc.Engine.AuditServices:False +RndmGenSvc.Engine.AuditStart:False +RndmGenSvc.Engine.AuditStop:False +RndmGenSvc.Engine.Column:0 +RndmGenSvc.Engine.Luxury:3 +RndmGenSvc.Engine.OutputLevel:3 +RndmGenSvc.Engine.Row:1 +RndmGenSvc.Engine.Seeds:[ 1234567 , 0 ] +RndmGenSvc.Engine.SetSingleton:False +RndmGenSvc.Engine.UseTable:False +RndmGenSvc.OutputLevel:3 +RootHistSvc.AuditFinalize:False +RootHistSvc.AuditInitialize:False +RootHistSvc.AuditReinitialize:False +RootHistSvc.AuditRestart:False +RootHistSvc.AuditServices:False +RootHistSvc.AuditStart:False +RootHistSvc.AuditStop:False +RootHistSvc.ForceAlphaIds:False +RootHistSvc.OutputEnabled:True +RootHistSvc.OutputFile:'UndefinedROOTOutputFileName' +RootHistSvc.OutputLevel:3 +TimelineSvc.AuditFinalize:False +TimelineSvc.AuditInitialize:False +TimelineSvc.AuditReinitialize:False +TimelineSvc.AuditRestart:False +TimelineSvc.AuditServices:False +TimelineSvc.AuditStart:False +TimelineSvc.AuditStop:False +TimelineSvc.DumpTimeline:False +TimelineSvc.OutputLevel:3 +TimelineSvc.Partial:False +TimelineSvc.RecordTimeline:False +TimelineSvc.TimelineFile:'timeline.csv' +Tuple.AuditAlgorithms:False +Tuple.AuditBeginRun:False +Tuple.AuditEndRun:False +Tuple.AuditExecute:False +Tuple.AuditFinalize:False +Tuple.AuditInitialize:False +Tuple.AuditReinitialize:False +Tuple.AuditRestart:False +Tuple.AuditStart:False +Tuple.AuditStop:False +Tuple.AutoStringIDPurgeMap:{ '/' : '=SLASH=' } +Tuple.Cardinality:1 +Tuple.Context:'' +Tuple.CounterList:[ '.*' ] +Tuple.EfficiencyRowFormat:' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Tuple.Enable:True +Tuple.ErrorMax:1 +Tuple.ErrorsPrint:True +Tuple.EvtColDir:'Tuple' +Tuple.EvtColLUN:'EVTCOL' +Tuple.EvtColOffSet:0 +Tuple.EvtColSplitDir:False +Tuple.EvtColTopDir:'' +Tuple.EvtColsPrint:False +Tuple.EvtColsProduce:False +Tuple.ExtraInputs:[] +Tuple.ExtraOutputs:[] +Tuple.FilterCircularDependencies:True +Tuple.FormatFor1DHistoTable:'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' +Tuple.FullDetail:False +Tuple.HeaderFor1DHistoTable:'| Title | # | Mean | RMS | Skewness | Kurtosis |' +Tuple.HistoCheckForNaN:True +Tuple.HistoCountersPrint:True +Tuple.HistoDir:'Tuple' +Tuple.HistoOffSet:0 +Tuple.HistoPrint:False +Tuple.HistoProduce:True +Tuple.HistoSplitDir:False +Tuple.HistoTopDir:'' +Tuple.IsIOBound:False +Tuple.MonitorHistograms:True +Tuple.MonitorService:'MonitorSvc' +Tuple.NTupleDir:'Tuple' Tuple.NTupleLUN:'MYLUN' +Tuple.NTupleOffSet:0 +Tuple.NTuplePrint:True +Tuple.NTupleProduce:True +Tuple.NTupleSplitDir:False +Tuple.NTupleTopDir:'' +Tuple.NeededResources:[ ] +Tuple.OutputLevel:3 +Tuple.PrintEmptyCounters:False +Tuple.PropertiesPrint:False +Tuple.RegisterForContextService:True +Tuple.RegularRowFormat:' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Tuple.RequireObjects:[ ] +Tuple.RootInTES:'' +Tuple.ShortFormatFor1DHistoTable:' | %1$-25.25s %2%' +Tuple.StatEntityList:[ ] +Tuple.StatPrint:True +Tuple.StatTableHeader:' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Tuple.Timeline:False +Tuple.TypePrint:True +Tuple.UseEfficiencyRowFormat:True +Tuple.UseSequencialNumericAutoIDs:False +Tuple.VetoObjects:[ ] +Tuple2.AuditAlgorithms:False +Tuple2.AuditBeginRun:False +Tuple2.AuditEndRun:False +Tuple2.AuditExecute:False +Tuple2.AuditFinalize:False +Tuple2.AuditInitialize:False +Tuple2.AuditReinitialize:False +Tuple2.AuditRestart:False +Tuple2.AuditStart:False +Tuple2.AuditStop:False +Tuple2.AutoStringIDPurgeMap:{ '/' : '=SLASH=' } +Tuple2.Cardinality:1 +Tuple2.Context:'' +Tuple2.CounterList:[ '.*' ] +Tuple2.EfficiencyRowFormat:' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Tuple2.Enable:True +Tuple2.ErrorMax:1 +Tuple2.ErrorsPrint:True +Tuple2.EvtColDir:'Tuple2' +Tuple2.EvtColLUN:'EVTCOL' +Tuple2.EvtColOffSet:0 +Tuple2.EvtColSplitDir:False +Tuple2.EvtColTopDir:'' +Tuple2.EvtColsPrint:False +Tuple2.EvtColsProduce:False +Tuple2.ExtraInputs:[] +Tuple2.ExtraOutputs:[] +Tuple2.FilterCircularDependencies:True +Tuple2.FormatFor1DHistoTable:'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' +Tuple2.FullDetail:False +Tuple2.HeaderFor1DHistoTable:'| Title | # | Mean | RMS | Skewness | Kurtosis |' +Tuple2.HistoCheckForNaN:True +Tuple2.HistoCountersPrint:True +Tuple2.HistoDir:'Tuple2' +Tuple2.HistoOffSet:0 +Tuple2.HistoPrint:False +Tuple2.HistoProduce:True +Tuple2.HistoSplitDir:False +Tuple2.HistoTopDir:'' +Tuple2.IsIOBound:False +Tuple2.MonitorHistograms:True +Tuple2.MonitorService:'MonitorSvc' +Tuple2.NTupleDir:'Tuple2' Tuple2.NTupleLUN:'MYLUN' +Tuple2.NTupleOffSet:0 +Tuple2.NTuplePrint:True +Tuple2.NTupleProduce:True +Tuple2.NTupleSplitDir:False +Tuple2.NTupleTopDir:'' +Tuple2.NeededResources:[ ] +Tuple2.OutputLevel:3 +Tuple2.PrintEmptyCounters:False +Tuple2.PropertiesPrint:False +Tuple2.RegisterForContextService:True +Tuple2.RegularRowFormat:' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Tuple2.RequireObjects:[ ] +Tuple2.RootInTES:'' +Tuple2.ShortFormatFor1DHistoTable:' | %1$-25.25s %2%' +Tuple2.StatEntityList:[ ] +Tuple2.StatPrint:True +Tuple2.StatTableHeader:' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Tuple2.Timeline:False +Tuple2.TypePrint:True +Tuple2.UseEfficiencyRowFormat:True +Tuple2.UseSequencialNumericAutoIDs:False +Tuple2.VetoObjects:[ ] +Tuple3.AuditAlgorithms:False +Tuple3.AuditBeginRun:False +Tuple3.AuditEndRun:False +Tuple3.AuditExecute:False +Tuple3.AuditFinalize:False +Tuple3.AuditInitialize:False +Tuple3.AuditReinitialize:False +Tuple3.AuditRestart:False +Tuple3.AuditStart:False +Tuple3.AuditStop:False +Tuple3.AutoStringIDPurgeMap:{ '/' : '=SLASH=' } +Tuple3.Cardinality:1 +Tuple3.Context:'' +Tuple3.CounterList:[ '.*' ] +Tuple3.EfficiencyRowFormat:' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Tuple3.Enable:True +Tuple3.ErrorMax:1 +Tuple3.ErrorsPrint:True +Tuple3.EvtColDir:'Tuple3' +Tuple3.EvtColLUN:'EVTCOL' +Tuple3.EvtColOffSet:0 +Tuple3.EvtColSplitDir:False +Tuple3.EvtColTopDir:'' +Tuple3.EvtColsPrint:False +Tuple3.EvtColsProduce:False +Tuple3.ExtraInputs:[] +Tuple3.ExtraOutputs:[] +Tuple3.FilterCircularDependencies:True +Tuple3.FormatFor1DHistoTable:'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' +Tuple3.FullDetail:False +Tuple3.HeaderFor1DHistoTable:'| Title | # | Mean | RMS | Skewness | Kurtosis |' +Tuple3.HistoCheckForNaN:True +Tuple3.HistoCountersPrint:True +Tuple3.HistoDir:'Tuple3' +Tuple3.HistoOffSet:0 +Tuple3.HistoPrint:False +Tuple3.HistoProduce:True +Tuple3.HistoSplitDir:False +Tuple3.HistoTopDir:'' +Tuple3.IsIOBound:False +Tuple3.MonitorHistograms:True +Tuple3.MonitorService:'MonitorSvc' +Tuple3.NTupleDir:'Tuple3' Tuple3.NTupleLUN:'MYLUN' +Tuple3.NTupleOffSet:0 +Tuple3.NTuplePrint:True +Tuple3.NTupleProduce:True +Tuple3.NTupleSplitDir:False +Tuple3.NTupleTopDir:'' +Tuple3.NeededResources:[ ] +Tuple3.OutputLevel:3 +Tuple3.PrintEmptyCounters:False +Tuple3.PropertiesPrint:False +Tuple3.RegisterForContextService:True +Tuple3.RegularRowFormat:' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Tuple3.RequireObjects:[ ] +Tuple3.RootInTES:'' +Tuple3.ShortFormatFor1DHistoTable:' | %1$-25.25s %2%' +Tuple3.StatEntityList:[ ] +Tuple3.StatPrint:True +Tuple3.StatTableHeader:' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Tuple3.Timeline:False +Tuple3.TypePrint:True +Tuple3.UseEfficiencyRowFormat:True +Tuple3.UseSequencialNumericAutoIDs:False +Tuple3.VetoObjects:[ ] ApplicationMgr INFO Application Manager Started successfully RFileCnv INFO opening Root file "TupleEx.root" for writing, CompressionLevel='LZMA:6' @@ -246,7 +608,6 @@ Tuple3 SUCCESS ID=VectorMaps Title="Tuple with VectorMaps/'ExtraI Tuple3 SUCCESS ID=Vectors-3D Title="Tuple with Vectors in 3D " #items=6 {p3X,p3Y,p3Z,v3X,v3Y,v3Z} RootHistSvc WARNING no ROOT output file name, Histograms cannot be persistified EventLoopMgr INFO Histograms converted successfully according to request. -ToolSvc INFO Removing all tools created by ToolSvc RFileCnv INFO dumping contents of /NTUPLES/MYLUN TFile: name=TupleEx.root, title=Gaudi Trees, option=CREATE ****************************************************************************** diff --git a/GaudiExamples/tests/qmtest/refs/Properties.ref b/GaudiExamples/tests/qmtest/refs/Properties.ref index ff70fa4a33..4c7bde309d 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties.ref @@ -1,17 +1,17 @@ -JobOptionsSvc INFO # =======> /home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Services.opts +JobOptionsSvc INFO # =======> /home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Services.opts JobOptionsSvc INFO # (12,1): AuditorSvc.Auditors = ["ChronoAuditor"] -JobOptionsSvc INFO # =======> /home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Common.opts +JobOptionsSvc INFO # =======> /home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Common.opts JobOptionsSvc INFO # (9,1): ApplicationMgr.StatusCodeCheck = 1 -JobOptionsSvc INFO # =======> /home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/units.opts +JobOptionsSvc INFO # =======> /home/marco/Devel/workspace/Gaudi/GaudiExamples/options/units.opts JobOptionsSvc INFO # (1,1): 1 m = 1000 JobOptionsSvc INFO # (2,1): 1 cm = 10 JobOptionsSvc INFO # (3,1): 1 mm = 1 JobOptionsSvc INFO # (4,1): 1 m2 = 1e+06 -JobOptionsSvc INFO # =======> /home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/optsub1/dummy1.opts +JobOptionsSvc INFO # =======> /home/marco/Devel/workspace/Gaudi/GaudiExamples/options/optsub1/dummy1.opts JobOptionsSvc INFO # (2,1): Dummy1.Property = 1 -JobOptionsSvc INFO # =======> /home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/optsub2/dummy2.opts +JobOptionsSvc INFO # =======> /home/marco/Devel/workspace/Gaudi/GaudiExamples/options/optsub2/dummy2.opts JobOptionsSvc INFO # (2,1): Dummy2.Property = 1 -JobOptionsSvc INFO # =======> /home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts +JobOptionsSvc INFO # =======> /home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts JobOptionsSvc INFO # (14,1): ApplicationMgr.TopAlg = ["PropertyAlg"] JobOptionsSvc INFO # (16,1): ApplicationMgr.TopAlg += ["PropertyAlg", "PropertyProxy"] JobOptionsSvc INFO # (18,1): ApplicationMgr.TopAlg -= ["PropertyAlg"] @@ -49,11 +49,11 @@ JobOptionsSvc INFO # (71,1): PropertyProxy.String = "This is set by the p JobOptionsSvc INFO # (74,1): MessageSvc.setDebug += ["EventLoopMgr"] JobOptionsSvc INFO # (75,1): MessageSvc.setVerbose += ["MsgTest"] JobOptionsSvc INFO # (79,1): MessageSvc.setWarning += ["MsgTest"] -JobOptionsSvc INFO Job options successfully read in from /home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts +JobOptionsSvc INFO Job options successfully read in from /home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v4r1) - running on pclhcb117 on Fri Jun 24 17:52:45 2016 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on marco-XPS-13 on Mon Sep 10 17:45:22 2018 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully StatusCodeSvc INFO initialize @@ -146,50 +146,265 @@ MsgTest ERROR This should be printed if threshold is ERROR MsgTest FATAL This should be printed if threshold is FATAL MsgTest SUCCESS This should be printed ALWAYS PropertyAlg INFO ================================================= +PropertyAlg INFO Read handler called for property: 'PDouble':999.00000 PropertyAlg INFO Dump of the property catalogue: +AppMgrRunable.AuditFinalize: False +AppMgrRunable.AuditInitialize: False +AppMgrRunable.AuditReinitialize: False +AppMgrRunable.AuditRestart: False +AppMgrRunable.AuditServices: False +AppMgrRunable.AuditStart: False +AppMgrRunable.AuditStop: False +AppMgrRunable.EvtMax: 1 +AppMgrRunable.OutputLevel: 3 +ApplicationMgr.ActivateHistory: False +ApplicationMgr.AlgTypeAliases: { } +ApplicationMgr.AppName: 'ApplicationMgr' +ApplicationMgr.AppVersion: '' +ApplicationMgr.AuditAlgorithms: False +ApplicationMgr.AuditServices: False +ApplicationMgr.AuditTools: False +ApplicationMgr.CreateSvc: [ ] +ApplicationMgr.Dlls: [ ] +ApplicationMgr.Environment: { } +ApplicationMgr.EventLoop: 'EventLoopMgr' ApplicationMgr.EvtMax: 1 -ApplicationMgr.EvtSel: "NONE" -ApplicationMgr.HistogramPersistency: "NONE" -ApplicationMgr.StatusCodeCheck: 1 -ApplicationMgr.TopAlg: ["PropertyAlg", "PropertyProxy"] +ApplicationMgr.EvtSel: 'NONE' +ApplicationMgr.Exit: 0 +ApplicationMgr.ExtSvc: [ 'EventDataSvc' , 'DetectorDataSvc' ] +ApplicationMgr.ExtSvcCreates: True +ApplicationMgr.Go: 0 +ApplicationMgr.HistogramPersistency: 'NONE' +ApplicationMgr.InitializationLoopCheck: True +ApplicationMgr.JobOptionsPath: '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts' +ApplicationMgr.JobOptionsPostAction: '' +ApplicationMgr.JobOptionsPreAction: '' +ApplicationMgr.JobOptionsSvcType: 'JobOptionsSvc' +ApplicationMgr.JobOptionsType: 'FILE' +ApplicationMgr.MessageSvcType: 'MessageSvc' +ApplicationMgr.OutStream: [ ] +ApplicationMgr.OutStreamType: 'OutputStream' +ApplicationMgr.OutputLevel: 3 +ApplicationMgr.PluginDebugLevel: 0 +ApplicationMgr.PropertiesPrint: False +ApplicationMgr.ReturnCode: 0 +ApplicationMgr.Runable: 'AppMgrRunable' +ApplicationMgr.StalledEventMonitoring: False +ApplicationMgr.StatusCodeCheck: True +ApplicationMgr.StopOnSignal: False +ApplicationMgr.SvcMapping: [ 'EvtDataSvc/EventDataSvc' , 'DetDataSvc/DetectorDataSvc' , 'HistogramSvc/HistogramDataSvc' , 'HbookCnv::PersSvc/HbookHistSvc' , 'RootHistCnv::PersSvc/RootHistSvc' , 'EvtPersistencySvc/EventPersistencySvc' , 'DetPersistencySvc/DetectorPersistencySvc' , 'HistogramPersistencySvc/HistogramPersistencySvc' ] +ApplicationMgr.SvcOptMapping: [ ] +ApplicationMgr.TopAlg: [ 'PropertyAlg' , 'PropertyProxy' ] AuditorSvc.Auditors: ["ChronoAuditor"] +DetectorDataSvc.AllowLoadInRunning: True +DetectorDataSvc.AuditFinalize: False +DetectorDataSvc.AuditInitialize: False +DetectorDataSvc.AuditReinitialize: False +DetectorDataSvc.AuditRestart: False +DetectorDataSvc.AuditServices: False +DetectorDataSvc.AuditStart: False +DetectorDataSvc.AuditStop: False +DetectorDataSvc.DataAccessName: 'DataAccess' +DetectorDataSvc.DataFaultName: 'DataFault' +DetectorDataSvc.DetDbLocation: 'empty' +DetectorDataSvc.DetDbRootName: 'dd' +DetectorDataSvc.DetStorageType: 7 +DetectorDataSvc.EnableAccessHandler: False +DetectorDataSvc.EnableFaultHandler: False +DetectorDataSvc.ForceLeaves: False +DetectorDataSvc.InhibitPathes: [ ] +DetectorDataSvc.OutputLevel: 3 +DetectorDataSvc.PersistencySvc: 'DetectorPersistencySvc' +DetectorDataSvc.RootCLID: 3 +DetectorDataSvc.RootName: '/dd' +DetectorDataSvc.UsePersistency: False +DetectorPersistencySvc.AuditFinalize: False +DetectorPersistencySvc.AuditInitialize: False +DetectorPersistencySvc.AuditReinitialize: False +DetectorPersistencySvc.AuditRestart: False +DetectorPersistencySvc.AuditServices: False +DetectorPersistencySvc.AuditStart: False +DetectorPersistencySvc.AuditStop: False +DetectorPersistencySvc.CnvServices: [ ] +DetectorPersistencySvc.OutputLevel: 3 Dummy1.Property: 1 Dummy2.Property: 1 +EventDataSvc.AuditFinalize: False +EventDataSvc.AuditInitialize: False +EventDataSvc.AuditReinitialize: False +EventDataSvc.AuditRestart: False +EventDataSvc.AuditServices: False +EventDataSvc.AuditStart: False +EventDataSvc.AuditStop: False +EventDataSvc.DataAccessName: 'DataAccess' +EventDataSvc.DataFaultName: 'DataFault' +EventDataSvc.EnableAccessHandler: False +EventDataSvc.EnableFaultHandler: False +EventDataSvc.ForceLeaves: False +EventDataSvc.InhibitPathes: [ ] +EventDataSvc.OutputLevel: 3 +EventDataSvc.RootCLID: 110 +EventDataSvc.RootName: '/Event' +EventLoopMgr.AuditFinalize: False +EventLoopMgr.AuditInitialize: False +EventLoopMgr.AuditReinitialize: False +EventLoopMgr.AuditRestart: False +EventLoopMgr.AuditServices: False +EventLoopMgr.AuditStart: False +EventLoopMgr.AuditStop: False +EventLoopMgr.EvtSel: '' +EventLoopMgr.HistogramPersistency: '' +EventLoopMgr.OutStream: [ ] +EventLoopMgr.OutStreamType: 'OutputStream' +EventLoopMgr.OutputLevel: 2 +EventLoopMgr.PrintControlFlowExpression: False +EventLoopMgr.TopAlg: [ 'PropertyAlg' , 'PropertyProxy' ] +EventLoopMgr.Warnings: True +EventPersistencySvc.AuditFinalize: False +EventPersistencySvc.AuditInitialize: False +EventPersistencySvc.AuditReinitialize: False +EventPersistencySvc.AuditRestart: False +EventPersistencySvc.AuditServices: False +EventPersistencySvc.AuditStart: False +EventPersistencySvc.AuditStop: False +EventPersistencySvc.CnvServices: [ ] +EventPersistencySvc.OutputLevel: 3 +IncidentSvc.AuditFinalize: False +IncidentSvc.AuditInitialize: False +IncidentSvc.AuditReinitialize: False +IncidentSvc.AuditRestart: False +IncidentSvc.AuditServices: False +IncidentSvc.AuditStart: False +IncidentSvc.AuditStop: False +IncidentSvc.OutputLevel: 3 +JobOptionsSvc.AuditFinalize: False +JobOptionsSvc.AuditInitialize: False +JobOptionsSvc.AuditReinitialize: False +JobOptionsSvc.AuditRestart: False +JobOptionsSvc.AuditServices: False +JobOptionsSvc.AuditStart: False +JobOptionsSvc.AuditStop: False +JobOptionsSvc.DUMPFILE: '' +JobOptionsSvc.OutputLevel: 3 +JobOptionsSvc.PATH: '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts' +JobOptionsSvc.PYTHONACTION: '' +JobOptionsSvc.PYTHONPARAMS: '' +JobOptionsSvc.SEARCHPATH: '/home/marco/Devel/workspace/Gaudi/GaudiExamples/tests/qmtest:/home/marco/Devel/workspace/Gaudi/GaudiExamples/options' +JobOptionsSvc.TYPE: 'FILE' +MessageSvc.AuditFinalize: False +MessageSvc.AuditInitialize: False +MessageSvc.AuditReinitialize: False +MessageSvc.AuditRestart: False +MessageSvc.AuditServices: False +MessageSvc.AuditStart: False +MessageSvc.AuditStop: False +MessageSvc.Format: '% F%18W%S%7W%R%T %0W%M' MessageSvc.OutputLevel: 3 -MessageSvc.setDebug: ["EventLoopMgr"] -MessageSvc.setVerbose: ["MsgTest"] -MessageSvc.setWarning: ["MsgTest"] -PropertyAlg.Bool: 0 -PropertyAlg.BoolArray: [0, 1, 0] -PropertyAlg.Double: 101.1e+10 -PropertyAlg.DoubleArray: [-11.0, 2., 3.3, 0.4e-03] -PropertyAlg.DoubleArrayWithUnits: [1100000.000000, -20.000000, 33.000000, 0.400000] -PropertyAlg.DoubleArrayWithoutUnits: [1100000.0, -20., 33.0, 0.4] -PropertyAlg.DoublePairArray: [[1.1, 2.1], [2.3, 4.5], [5.6, 6.7]] -PropertyAlg.EmptyArray: {} +MessageSvc.alwaysColorCode: [ ] +MessageSvc.alwaysLimit: 0 +MessageSvc.countInactive: False +MessageSvc.debugColorCode: [ ] +MessageSvc.debugLimit: 500 +MessageSvc.defaultLimit: 500 +MessageSvc.enableSuppression: False +MessageSvc.errorColorCode: [ 'white' , 'red' ] +MessageSvc.errorLimit: 500 +MessageSvc.fatalColorCode: [ 'blue' , 'red' ] +MessageSvc.fatalLimit: 500 +MessageSvc.infoColorCode: [ ] +MessageSvc.infoLimit: 500 +MessageSvc.loggedStreams: { } +MessageSvc.setAlways: [ ] +MessageSvc.setDebug: [ 'EventLoopMgr' ] +MessageSvc.setError: [ ] +MessageSvc.setFatal: [ ] +MessageSvc.setInfo: [ ] +MessageSvc.setVerbose: [ 'MsgTest' ] +MessageSvc.setWarning: [ 'MsgTest' ] +MessageSvc.showStats: False +MessageSvc.statLevel: 0 +MessageSvc.timeFormat: '%Y-%m-%d %H:%M:%S,%f' +MessageSvc.tracedInactiveSources: [ ] +MessageSvc.useColors: False +MessageSvc.verboseColorCode: [ ] +MessageSvc.verboseLimit: 500 +MessageSvc.warningColorCode: [ 'yellow' ] +MessageSvc.warningLimit: 500 +PropertyAlg.AuditAlgorithms: False +PropertyAlg.AuditBeginRun: False +PropertyAlg.AuditEndRun: False +PropertyAlg.AuditExecute: False +PropertyAlg.AuditFinalize: False +PropertyAlg.AuditInitialize: False +PropertyAlg.AuditReinitialize: False +PropertyAlg.AuditRestart: False +PropertyAlg.AuditStart: False +PropertyAlg.AuditStop: False +PropertyAlg.Bool: False +PropertyAlg.BoolArray: [ False , True , False ] +PropertyAlg.Cardinality: 1 +PropertyAlg.Double: 1.0110000e+12 +PropertyAlg.DoubleArray: [ -11.000000 , 2.0000000 , 3.3000000 , 0.00040000000 ] +PropertyAlg.DoubleArrayWithUnits: [ 1100000.0 , -20.000000 , 33.000000 , 0.40000000 ] +PropertyAlg.DoubleArrayWithoutUnits: [ 1100000.0 , -20.000000 , 33.000000 , 0.40000000 ] +PropertyAlg.DoublePairArray: [ ( 1.1000000 , 2.1000000 ) , ( 2.3000000 , 4.5000000 ) , ( 5.6000000 , 6.7000000 ) ] +PropertyAlg.EmptyArray: [ ] +PropertyAlg.Enable: True +PropertyAlg.ErrorMax: 1 +PropertyAlg.ExtraInputs: [] +PropertyAlg.ExtraOutputs: [] +PropertyAlg.FilterCircularDependencies: True PropertyAlg.Int: 101 PropertyAlg.Int64: 4294967296 -PropertyAlg.Int64Array: [4294967296] -PropertyAlg.IntArray: [1, 2, 3, 5] -PropertyAlg.IntPairArray: [[1, 2], [3, 4], [5, 6]] +PropertyAlg.Int64Array: [ 4294967296 ] +PropertyAlg.IntArray: [ 1 , 2 , 3 , 5 ] +PropertyAlg.IntPairArray: [ ( 1 , 2 ) , ( 3 , 4 ) , ( 5 , 6 ) ] +PropertyAlg.IsIOBound: False +PropertyAlg.MonitorService: 'MonitorSvc' +PropertyAlg.NeededResources: [ ] PropertyAlg.OutputLevel: 3 -PropertyAlg.PBool: 1 -PropertyAlg.PBoolArray: [1, 0, 1, 0] -PropertyAlg.PDouble: 101.E5 -PropertyAlg.PDoubleArray: [1.1, 2., 3.3] -PropertyAlg.PInt: 101 -PropertyAlg.PIntArray: [1, 2, 3, 5] -PropertyAlg.PString: "hundred one" -PropertyAlg.PStringArray: ["one", "two", "four"] -PropertyAlg.String: "hundred one" -PropertyAlg.StringArray: ["one", "two", "four"] +PropertyAlg.PBool: False +PropertyAlg.PBoolArray: [ True , False , True , False ] +PropertyAlg.PDouble: 999.00000 +PropertyAlg.PDoubleArray: [ 1.1000000 , 2.0000000 , 3.3000000 ] +PropertyAlg.PInt: 155 +PropertyAlg.PIntArray: [ 1 , 2 , 3 , 5 ] +PropertyAlg.PString: 'hundred one' +PropertyAlg.PStringArray: [ 'one' , 'two' , 'four' ] +PropertyAlg.RegisterForContextService: False +PropertyAlg.String: 'hundred one' +PropertyAlg.StringArray: [ 'one' , 'two' , 'four' ] +PropertyAlg.Timeline: False PropertyAlg.UInt64: 4294967296 -PropertyAlg.UInt64Array: [4294967296] +PropertyAlg.UInt64Array: [ 4294967296 ] PropertyProxy.String: "This is set by the proxy" +StatusCodeSvc.AbortOnError: False +StatusCodeSvc.AuditFinalize: False +StatusCodeSvc.AuditInitialize: False +StatusCodeSvc.AuditReinitialize: False +StatusCodeSvc.AuditRestart: False +StatusCodeSvc.AuditServices: False +StatusCodeSvc.AuditStart: False +StatusCodeSvc.AuditStop: False +StatusCodeSvc.Filter: [ ] +StatusCodeSvc.IgnoreDicts: True +StatusCodeSvc.OutputLevel: 3 +StatusCodeSvc.SuppressCheck: False +TimelineSvc.AuditFinalize: False +TimelineSvc.AuditInitialize: False +TimelineSvc.AuditReinitialize: False +TimelineSvc.AuditRestart: False +TimelineSvc.AuditServices: False +TimelineSvc.AuditStart: False +TimelineSvc.AuditStop: False +TimelineSvc.DumpTimeline: False +TimelineSvc.OutputLevel: 3 +TimelineSvc.Partial: False +TimelineSvc.RecordTimeline: False +TimelineSvc.TimelineFile: 'timeline.csv' PropertyAlg INFO ================================================= -PropertyAlg INFO Read handler called for property: 'PDouble':10100000. -PropertyAlg INFO Update handler called for property: 'PDouble':10100000. -PropertyAlg INFO Changed property DoubleArray in catalogue +PropertyAlg INFO PInt= 'PInt':154 [should be 154] +PropertyAlg INFO Try to assign invalid value to DoubleArray PropertyAlg ERROR got invalid_argument exception: cannot parse '{"12.12", "13.13"}' to std::vector > PropertyAlg INFO DoubleArray = [-11, 2, 3.3, 0.0004] PropertyAlg INFO ================================================= @@ -204,7 +419,7 @@ ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully PropertyAlg INFO executing.... PropertyProxy INFO executing.... -EventLoopMgr DEBUG ---> Loop Finished - WSS 41.0586 | total time (skipping 1st evt) 92116 ns +EventLoopMgr DEBUG ---> Loop Finished - WSS 48.9531 | total time (skipping 1st evt) 153636 ns ApplicationMgr INFO Application Manager Stopped successfully PropertyAlg INFO finalizing.... PropertyProxy INFO finalizing.... diff --git a/GaudiExamples/tests/qmtest/refs/Properties2.ref b/GaudiExamples/tests/qmtest/refs/Properties2.ref index 3ee558369b..098e759409 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties2.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties2.ref @@ -1,19 +1,19 @@ # setting LC_ALL to "C" -# --> Including file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts' -# --> Including file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Common.opts' -# --> Including file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Services.opts' +# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts' +# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Common.opts' +# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Services.opts' # AuditorSvc.Auditors = { "ChronoAuditor" }; -# <-- End of file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Services.opts' +# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Services.opts' # ApplicationMgr.StatusCodeCheck = true; -# <-- End of file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Common.opts' -# --> Including file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/units.opts' -# <-- End of file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/units.opts' -# --> Including file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/optsub1/dummy1.opts' +# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Common.opts' +# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/units.opts' +# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/units.opts' +# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/optsub1/dummy1.opts' # Dummy1.Property=true; -# --> Including file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/optsub2/dummy2.opts' +# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/optsub2/dummy2.opts' # Dummy2.Property=true; -# <-- End of file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/optsub2/dummy2.opts' -# <-- End of file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/optsub1/dummy1.opts' +# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/optsub2/dummy2.opts' +# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/optsub1/dummy1.opts' # ApplicationMgr.TopAlg = { "PropertyAlg" }; # ApplicationMgr.TopAlg += { "PropertyAlg", "PropertyProxy" }; # ApplicationMgr.TopAlg -= { "PropertyAlg" }; @@ -51,11 +51,11 @@ # MessageSvc.setDebug += {"EventLoopMgr"}; # MessageSvc.setVerbose += {"MsgTest"}; # MessageSvc.setWarning += {"MsgTest"}; -# <-- End of file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts' +# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts' ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v4r1) - running on pclhcb117 on Fri Jun 24 17:52:46 2016 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on marco-XPS-13 on Mon Sep 10 17:45:23 2018 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully StatusCodeSvc INFO initialize @@ -148,41 +148,265 @@ MsgTest ERROR This should be printed if threshold is ERROR MsgTest FATAL This should be printed if threshold is FATAL MsgTest SUCCESS This should be printed ALWAYS PropertyAlg INFO ================================================= +PropertyAlg INFO Read handler called for property: 'PDouble':999.00000 PropertyAlg INFO Dump of the property catalogue: +AppMgrRunable.AuditFinalize: False +AppMgrRunable.AuditInitialize: False +AppMgrRunable.AuditReinitialize: False +AppMgrRunable.AuditRestart: False +AppMgrRunable.AuditServices: False +AppMgrRunable.AuditStart: False +AppMgrRunable.AuditStop: False +AppMgrRunable.EvtMax: 1 +AppMgrRunable.OutputLevel: 3 +ApplicationMgr.ActivateHistory: False +ApplicationMgr.AlgTypeAliases: { } +ApplicationMgr.AppName: 'ApplicationMgr' +ApplicationMgr.AppVersion: '' +ApplicationMgr.AuditAlgorithms: False +ApplicationMgr.AuditServices: False +ApplicationMgr.AuditTools: False +ApplicationMgr.CreateSvc: [ ] +ApplicationMgr.Dlls: [ ] +ApplicationMgr.Environment: { } +ApplicationMgr.EventLoop: 'EventLoopMgr' +ApplicationMgr.EvtMax: 1 +ApplicationMgr.EvtSel: 'NONE' +ApplicationMgr.Exit: 0 +ApplicationMgr.ExtSvc: [ 'EventDataSvc' , 'DetectorDataSvc' ] +ApplicationMgr.ExtSvcCreates: True +ApplicationMgr.Go: 0 +ApplicationMgr.HistogramPersistency: 'NONE' +ApplicationMgr.InitializationLoopCheck: True +ApplicationMgr.JobOptionsPath: '' +ApplicationMgr.JobOptionsPostAction: '' +ApplicationMgr.JobOptionsPreAction: '' +ApplicationMgr.JobOptionsSvcType: 'JobOptionsSvc' +ApplicationMgr.JobOptionsType: 'NONE' +ApplicationMgr.MessageSvcType: 'MessageSvc' +ApplicationMgr.OutStream: [ ] +ApplicationMgr.OutStreamType: 'OutputStream' +ApplicationMgr.OutputLevel: 3 +ApplicationMgr.PluginDebugLevel: 0 +ApplicationMgr.PropertiesPrint: False +ApplicationMgr.ReturnCode: 0 +ApplicationMgr.Runable: 'AppMgrRunable' +ApplicationMgr.StalledEventMonitoring: False +ApplicationMgr.StatusCodeCheck: True +ApplicationMgr.StopOnSignal: False +ApplicationMgr.SvcMapping: [ 'EvtDataSvc/EventDataSvc' , 'DetDataSvc/DetectorDataSvc' , 'HistogramSvc/HistogramDataSvc' , 'HbookCnv::PersSvc/HbookHistSvc' , 'RootHistCnv::PersSvc/RootHistSvc' , 'EvtPersistencySvc/EventPersistencySvc' , 'DetPersistencySvc/DetectorPersistencySvc' , 'HistogramPersistencySvc/HistogramPersistencySvc' ] +ApplicationMgr.SvcOptMapping: [ ] +ApplicationMgr.TopAlg: [ 'PropertyAlg' , 'PropertyProxy' ] AuditorSvc.Auditors: ['ChronoAuditor'] +DetectorDataSvc.AllowLoadInRunning: True +DetectorDataSvc.AuditFinalize: False +DetectorDataSvc.AuditInitialize: False +DetectorDataSvc.AuditReinitialize: False +DetectorDataSvc.AuditRestart: False +DetectorDataSvc.AuditServices: False +DetectorDataSvc.AuditStart: False +DetectorDataSvc.AuditStop: False +DetectorDataSvc.DataAccessName: 'DataAccess' +DetectorDataSvc.DataFaultName: 'DataFault' +DetectorDataSvc.DetDbLocation: 'empty' +DetectorDataSvc.DetDbRootName: 'dd' +DetectorDataSvc.DetStorageType: 7 +DetectorDataSvc.EnableAccessHandler: False +DetectorDataSvc.EnableFaultHandler: False +DetectorDataSvc.ForceLeaves: False +DetectorDataSvc.InhibitPathes: [ ] +DetectorDataSvc.OutputLevel: 3 +DetectorDataSvc.PersistencySvc: 'DetectorPersistencySvc' +DetectorDataSvc.RootCLID: 3 +DetectorDataSvc.RootName: '/dd' +DetectorDataSvc.UsePersistency: False +DetectorPersistencySvc.AuditFinalize: False +DetectorPersistencySvc.AuditInitialize: False +DetectorPersistencySvc.AuditReinitialize: False +DetectorPersistencySvc.AuditRestart: False +DetectorPersistencySvc.AuditServices: False +DetectorPersistencySvc.AuditStart: False +DetectorPersistencySvc.AuditStop: False +DetectorPersistencySvc.CnvServices: [ ] +DetectorPersistencySvc.OutputLevel: 3 Dummy1.Property: True Dummy2.Property: True +EventDataSvc.AuditFinalize: False +EventDataSvc.AuditInitialize: False +EventDataSvc.AuditReinitialize: False +EventDataSvc.AuditRestart: False +EventDataSvc.AuditServices: False +EventDataSvc.AuditStart: False +EventDataSvc.AuditStop: False +EventDataSvc.DataAccessName: 'DataAccess' +EventDataSvc.DataFaultName: 'DataFault' +EventDataSvc.EnableAccessHandler: False +EventDataSvc.EnableFaultHandler: False +EventDataSvc.ForceLeaves: False +EventDataSvc.InhibitPathes: [ ] +EventDataSvc.OutputLevel: 3 +EventDataSvc.RootCLID: 110 +EventDataSvc.RootName: '/Event' +EventLoopMgr.AuditFinalize: False +EventLoopMgr.AuditInitialize: False +EventLoopMgr.AuditReinitialize: False +EventLoopMgr.AuditRestart: False +EventLoopMgr.AuditServices: False +EventLoopMgr.AuditStart: False +EventLoopMgr.AuditStop: False +EventLoopMgr.EvtSel: '' +EventLoopMgr.HistogramPersistency: '' +EventLoopMgr.OutStream: [ ] +EventLoopMgr.OutStreamType: 'OutputStream' +EventLoopMgr.OutputLevel: 2 +EventLoopMgr.PrintControlFlowExpression: False +EventLoopMgr.TopAlg: [ 'PropertyAlg' , 'PropertyProxy' ] +EventLoopMgr.Warnings: True +EventPersistencySvc.AuditFinalize: False +EventPersistencySvc.AuditInitialize: False +EventPersistencySvc.AuditReinitialize: False +EventPersistencySvc.AuditRestart: False +EventPersistencySvc.AuditServices: False +EventPersistencySvc.AuditStart: False +EventPersistencySvc.AuditStop: False +EventPersistencySvc.CnvServices: [ ] +EventPersistencySvc.OutputLevel: 3 +IncidentSvc.AuditFinalize: False +IncidentSvc.AuditInitialize: False +IncidentSvc.AuditReinitialize: False +IncidentSvc.AuditRestart: False +IncidentSvc.AuditServices: False +IncidentSvc.AuditStart: False +IncidentSvc.AuditStop: False +IncidentSvc.OutputLevel: 3 +JobOptionsSvc.AuditFinalize: False +JobOptionsSvc.AuditInitialize: False +JobOptionsSvc.AuditReinitialize: False +JobOptionsSvc.AuditRestart: False +JobOptionsSvc.AuditServices: False +JobOptionsSvc.AuditStart: False +JobOptionsSvc.AuditStop: False +JobOptionsSvc.DUMPFILE: '' +JobOptionsSvc.OutputLevel: 3 +JobOptionsSvc.PATH: '../options/job.opts' +JobOptionsSvc.PYTHONACTION: '' +JobOptionsSvc.PYTHONPARAMS: '' +JobOptionsSvc.SEARCHPATH: '/home/marco/Devel/workspace/Gaudi/GaudiExamples/tests/qmtest:/home/marco/Devel/workspace/Gaudi/GaudiExamples/options' +JobOptionsSvc.TYPE: 'NONE' +MessageSvc.AuditFinalize: False +MessageSvc.AuditInitialize: False +MessageSvc.AuditReinitialize: False +MessageSvc.AuditRestart: False +MessageSvc.AuditServices: False +MessageSvc.AuditStart: False +MessageSvc.AuditStop: False +MessageSvc.Format: '% F%18W%S%7W%R%T %0W%M' +MessageSvc.OutputLevel: 3 +MessageSvc.alwaysColorCode: [ ] +MessageSvc.alwaysLimit: 0 +MessageSvc.countInactive: False +MessageSvc.debugColorCode: [ ] +MessageSvc.debugLimit: 500 +MessageSvc.defaultLimit: 500 +MessageSvc.enableSuppression: False +MessageSvc.errorColorCode: [ 'white' , 'red' ] +MessageSvc.errorLimit: 500 +MessageSvc.fatalColorCode: [ 'blue' , 'red' ] +MessageSvc.fatalLimit: 500 +MessageSvc.infoColorCode: [ ] +MessageSvc.infoLimit: 500 +MessageSvc.loggedStreams: { } +MessageSvc.setAlways: [ ] +MessageSvc.setDebug: [ 'EventLoopMgr' ] +MessageSvc.setError: [ ] +MessageSvc.setFatal: [ ] +MessageSvc.setInfo: [ ] +MessageSvc.setVerbose: [ 'MsgTest' ] +MessageSvc.setWarning: [ 'MsgTest' ] +MessageSvc.showStats: False +MessageSvc.statLevel: 0 +MessageSvc.timeFormat: '%Y-%m-%d %H:%M:%S,%f' +MessageSvc.tracedInactiveSources: [ ] +MessageSvc.useColors: False +MessageSvc.verboseColorCode: [ ] +MessageSvc.verboseLimit: 500 +MessageSvc.warningColorCode: [ 'yellow' ] +MessageSvc.warningLimit: 500 +PropertyAlg.AuditAlgorithms: False +PropertyAlg.AuditBeginRun: False +PropertyAlg.AuditEndRun: False +PropertyAlg.AuditExecute: False +PropertyAlg.AuditFinalize: False +PropertyAlg.AuditInitialize: False +PropertyAlg.AuditReinitialize: False +PropertyAlg.AuditRestart: False +PropertyAlg.AuditStart: False +PropertyAlg.AuditStop: False PropertyAlg.Bool: False -PropertyAlg.BoolArray: [False, True, False] -PropertyAlg.Double: 1.011e+12 -PropertyAlg.DoubleArray: [-11.0, 2.0, 3.3, 0.0004] -PropertyAlg.DoubleArrayWithUnits: [1100000.0, -20.0, 33.0, 0.4] -PropertyAlg.DoubleArrayWithoutUnits: [1100000.0, -20.0, 33.0, 0.4] -PropertyAlg.DoublePairArray: [(1.1, 2.1), (2.3, 4.5), (5.6, 6.7)] -PropertyAlg.EmptyArray: [] +PropertyAlg.BoolArray: [ False , True , False ] +PropertyAlg.Cardinality: 1 +PropertyAlg.Double: 1.0110000e+12 +PropertyAlg.DoubleArray: [ -11.000000 , 2.0000000 , 3.3000000 , 0.00040000000 ] +PropertyAlg.DoubleArrayWithUnits: [ 1100000.0 , -20.000000 , 33.000000 , 0.40000000 ] +PropertyAlg.DoubleArrayWithoutUnits: [ 1100000.0 , -20.000000 , 33.000000 , 0.40000000 ] +PropertyAlg.DoublePairArray: [ ( 1.1000000 , 2.1000000 ) , ( 2.3000000 , 4.5000000 ) , ( 5.6000000 , 6.7000000 ) ] +PropertyAlg.EmptyArray: [ ] +PropertyAlg.Enable: True +PropertyAlg.ErrorMax: 1 +PropertyAlg.ExtraInputs: [] +PropertyAlg.ExtraOutputs: [] +PropertyAlg.FilterCircularDependencies: True PropertyAlg.Int: 101 PropertyAlg.Int64: 4294967296 -PropertyAlg.Int64Array: [4294967296] -PropertyAlg.IntArray: [1, 2, 3, 5] -PropertyAlg.IntPairArray: [(1, 2), (3, 4), (5, 6)] +PropertyAlg.Int64Array: [ 4294967296 ] +PropertyAlg.IntArray: [ 1 , 2 , 3 , 5 ] +PropertyAlg.IntPairArray: [ ( 1 , 2 ) , ( 3 , 4 ) , ( 5 , 6 ) ] +PropertyAlg.IsIOBound: False +PropertyAlg.MonitorService: 'MonitorSvc' +PropertyAlg.NeededResources: [ ] PropertyAlg.OutputLevel: 3 -PropertyAlg.PBool: True -PropertyAlg.PBoolArray: [True, False, True, False] -PropertyAlg.PDouble: 10100000.0 -PropertyAlg.PDoubleArray: [1.1, 2.0, 3.3] -PropertyAlg.PInt: 101 -PropertyAlg.PIntArray: [1, 2, 3, 5] +PropertyAlg.PBool: False +PropertyAlg.PBoolArray: [ True , False , True , False ] +PropertyAlg.PDouble: 999.00000 +PropertyAlg.PDoubleArray: [ 1.1000000 , 2.0000000 , 3.3000000 ] +PropertyAlg.PInt: 155 +PropertyAlg.PIntArray: [ 1 , 2 , 3 , 5 ] PropertyAlg.PString: 'hundred one' -PropertyAlg.PStringArray: ['one', 'two', 'four'] +PropertyAlg.PStringArray: [ 'one' , 'two' , 'four' ] +PropertyAlg.RegisterForContextService: False PropertyAlg.String: 'hundred one' -PropertyAlg.StringArray: ['one', 'two', 'four'] +PropertyAlg.StringArray: [ 'one' , 'two' , 'four' ] +PropertyAlg.Timeline: False PropertyAlg.UInt64: 4294967296 -PropertyAlg.UInt64Array: [4294967296] +PropertyAlg.UInt64Array: [ 4294967296 ] PropertyProxy.String: 'This is set by the proxy' +StatusCodeSvc.AbortOnError: False +StatusCodeSvc.AuditFinalize: False +StatusCodeSvc.AuditInitialize: False +StatusCodeSvc.AuditReinitialize: False +StatusCodeSvc.AuditRestart: False +StatusCodeSvc.AuditServices: False +StatusCodeSvc.AuditStart: False +StatusCodeSvc.AuditStop: False +StatusCodeSvc.Filter: [ ] +StatusCodeSvc.IgnoreDicts: True +StatusCodeSvc.OutputLevel: 3 +StatusCodeSvc.SuppressCheck: False +TimelineSvc.AuditFinalize: False +TimelineSvc.AuditInitialize: False +TimelineSvc.AuditReinitialize: False +TimelineSvc.AuditRestart: False +TimelineSvc.AuditServices: False +TimelineSvc.AuditStart: False +TimelineSvc.AuditStop: False +TimelineSvc.DumpTimeline: False +TimelineSvc.OutputLevel: 3 +TimelineSvc.Partial: False +TimelineSvc.RecordTimeline: False +TimelineSvc.TimelineFile: 'timeline.csv' PropertyAlg INFO ================================================= -PropertyAlg INFO Read handler called for property: 'PDouble':10100000. -PropertyAlg INFO Update handler called for property: 'PDouble':10100000. -PropertyAlg INFO Changed property DoubleArray in catalogue +PropertyAlg INFO PInt= 'PInt':154 [should be 154] +PropertyAlg INFO Try to assign invalid value to DoubleArray PropertyAlg ERROR got invalid_argument exception: cannot parse '{"12.12", "13.13"}' to std::vector > PropertyAlg INFO DoubleArray = [-11, 2, 3.3, 0.0004] PropertyAlg INFO ================================================= @@ -197,7 +421,7 @@ ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully PropertyAlg INFO executing.... PropertyProxy INFO executing.... -EventLoopMgr DEBUG ---> Loop Finished - WSS 51.3164 | total time (skipping 1st evt) 75895 ns +EventLoopMgr DEBUG ---> Loop Finished - WSS 58.9219 | total time (skipping 1st evt) 201140 ns ApplicationMgr INFO Application Manager Stopped successfully PropertyAlg INFO finalizing.... PropertyProxy INFO finalizing.... diff --git a/GaudiExamples/tests/qmtest/refs/Properties_py.ref b/GaudiExamples/tests/qmtest/refs/Properties_py.ref index bab7cec0a1..8f144df897 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties_py.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties_py.ref @@ -1,12 +1,12 @@ # setting LC_ALL to "C" -# --> Including file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Properties.py' -# --> Including file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/optsub1/dummy1.opts' +# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Properties.py' +# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/optsub1/dummy1.opts' # Dummy1.Property=true; -# --> Including file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/optsub2/dummy2.opts' +# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/optsub2/dummy2.opts' # Dummy2.Property=true; -# <-- End of file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/optsub2/dummy2.opts' -# <-- End of file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/optsub1/dummy1.opts' -# <-- End of file '/home/marcocle/Devel/workspace/Gaudi/GaudiExamples/options/Properties.py' +# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/optsub2/dummy2.opts' +# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/optsub1/dummy1.opts' +# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Properties.py' # applying configuration of GaudiExamplesCommonConf # /***** User GaudiExamplesCommonConf/GaudiExamplesCommonConf **************************************** # |-OutputLevel = 3 (default: 3) @@ -14,8 +14,8 @@ # \----- (End of User GaudiExamplesCommonConf/GaudiExamplesCommonConf) ------------------------------- ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v4r1) - running on pclhcb117 on Fri Jun 24 17:52:46 2016 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on marco-XPS-13 on Mon Sep 10 17:45:23 2018 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully StatusCodeSvc INFO initialize @@ -108,39 +108,264 @@ MsgTest ERROR This should be printed if threshold is ERROR MsgTest FATAL This should be printed if threshold is FATAL MsgTest SUCCESS This should be printed ALWAYS PropertyAlg INFO ================================================= +PropertyAlg INFO Read handler called for property: 'PDouble':999.00000 PropertyAlg INFO Dump of the property catalogue: +AppMgrRunable.AuditFinalize: False +AppMgrRunable.AuditInitialize: False +AppMgrRunable.AuditReinitialize: False +AppMgrRunable.AuditRestart: False +AppMgrRunable.AuditServices: False +AppMgrRunable.AuditStart: False +AppMgrRunable.AuditStop: False +AppMgrRunable.EvtMax: 1 +AppMgrRunable.OutputLevel: 3 +ApplicationMgr.ActivateHistory: False +ApplicationMgr.AlgTypeAliases: { } +ApplicationMgr.AppName: 'ApplicationMgr' +ApplicationMgr.AppVersion: '' +ApplicationMgr.AuditAlgorithms: False +ApplicationMgr.AuditServices: False +ApplicationMgr.AuditTools: False +ApplicationMgr.CreateSvc: [ ] +ApplicationMgr.Dlls: [ ] +ApplicationMgr.Environment: { } +ApplicationMgr.EventLoop: 'EventLoopMgr' +ApplicationMgr.EvtMax: 1 +ApplicationMgr.EvtSel: 'NONE' +ApplicationMgr.Exit: 0 +ApplicationMgr.ExtSvc: [ 'EventDataSvc' , 'DetectorDataSvc' ] +ApplicationMgr.ExtSvcCreates: True +ApplicationMgr.Go: 0 +ApplicationMgr.HistogramPersistency: 'NONE' +ApplicationMgr.InitializationLoopCheck: True +ApplicationMgr.JobOptionsPath: '' +ApplicationMgr.JobOptionsPostAction: '' +ApplicationMgr.JobOptionsPreAction: '' +ApplicationMgr.JobOptionsSvcType: 'JobOptionsSvc' +ApplicationMgr.JobOptionsType: 'NONE' +ApplicationMgr.MessageSvcType: 'MessageSvc' +ApplicationMgr.OutStream: [ ] +ApplicationMgr.OutStreamType: 'OutputStream' +ApplicationMgr.OutputLevel: 3 +ApplicationMgr.PluginDebugLevel: 0 +ApplicationMgr.PropertiesPrint: False +ApplicationMgr.ReturnCode: 0 +ApplicationMgr.Runable: 'AppMgrRunable' +ApplicationMgr.StalledEventMonitoring: False +ApplicationMgr.StatusCodeCheck: True +ApplicationMgr.StopOnSignal: False +ApplicationMgr.SvcMapping: [ 'EvtDataSvc/EventDataSvc' , 'DetDataSvc/DetectorDataSvc' , 'HistogramSvc/HistogramDataSvc' , 'HbookCnv::PersSvc/HbookHistSvc' , 'RootHistCnv::PersSvc/RootHistSvc' , 'EvtPersistencySvc/EventPersistencySvc' , 'DetPersistencySvc/DetectorPersistencySvc' , 'HistogramPersistencySvc/HistogramPersistencySvc' ] +ApplicationMgr.SvcOptMapping: [ ] +ApplicationMgr.TopAlg: [ 'PropertyAlg/PropertyAlg' , 'PropertyProxy/PropertyProxy' ] AuditorSvc.Auditors: ['ChronoAuditor/ChronoAuditor'] +DetectorDataSvc.AllowLoadInRunning: True +DetectorDataSvc.AuditFinalize: False +DetectorDataSvc.AuditInitialize: False +DetectorDataSvc.AuditReinitialize: False +DetectorDataSvc.AuditRestart: False +DetectorDataSvc.AuditServices: False +DetectorDataSvc.AuditStart: False +DetectorDataSvc.AuditStop: False +DetectorDataSvc.DataAccessName: 'DataAccess' +DetectorDataSvc.DataFaultName: 'DataFault' +DetectorDataSvc.DetDbLocation: 'empty' +DetectorDataSvc.DetDbRootName: 'dd' +DetectorDataSvc.DetStorageType: 7 +DetectorDataSvc.EnableAccessHandler: False +DetectorDataSvc.EnableFaultHandler: False +DetectorDataSvc.ForceLeaves: False +DetectorDataSvc.InhibitPathes: [ ] +DetectorDataSvc.OutputLevel: 3 +DetectorDataSvc.PersistencySvc: 'DetectorPersistencySvc' +DetectorDataSvc.RootCLID: 3 +DetectorDataSvc.RootName: '/dd' +DetectorDataSvc.UsePersistency: False +DetectorPersistencySvc.AuditFinalize: False +DetectorPersistencySvc.AuditInitialize: False +DetectorPersistencySvc.AuditReinitialize: False +DetectorPersistencySvc.AuditRestart: False +DetectorPersistencySvc.AuditServices: False +DetectorPersistencySvc.AuditStart: False +DetectorPersistencySvc.AuditStop: False +DetectorPersistencySvc.CnvServices: [ ] +DetectorPersistencySvc.OutputLevel: 3 Dummy1.Property: True Dummy2.Property: True +EventDataSvc.AuditFinalize: False +EventDataSvc.AuditInitialize: False +EventDataSvc.AuditReinitialize: False +EventDataSvc.AuditRestart: False +EventDataSvc.AuditServices: False +EventDataSvc.AuditStart: False +EventDataSvc.AuditStop: False +EventDataSvc.DataAccessName: 'DataAccess' +EventDataSvc.DataFaultName: 'DataFault' +EventDataSvc.EnableAccessHandler: False +EventDataSvc.EnableFaultHandler: False +EventDataSvc.ForceLeaves: False +EventDataSvc.InhibitPathes: [ ] +EventDataSvc.OutputLevel: 3 +EventDataSvc.RootCLID: 110 +EventDataSvc.RootName: '/Event' +EventLoopMgr.AuditFinalize: False +EventLoopMgr.AuditInitialize: False +EventLoopMgr.AuditReinitialize: False +EventLoopMgr.AuditRestart: False +EventLoopMgr.AuditServices: False +EventLoopMgr.AuditStart: False +EventLoopMgr.AuditStop: False +EventLoopMgr.EvtSel: '' +EventLoopMgr.HistogramPersistency: '' +EventLoopMgr.OutStream: [ ] +EventLoopMgr.OutStreamType: 'OutputStream' +EventLoopMgr.OutputLevel: 2 +EventLoopMgr.PrintControlFlowExpression: False +EventLoopMgr.TopAlg: [ 'PropertyAlg/PropertyAlg' , 'PropertyProxy/PropertyProxy' ] +EventLoopMgr.Warnings: True +EventPersistencySvc.AuditFinalize: False +EventPersistencySvc.AuditInitialize: False +EventPersistencySvc.AuditReinitialize: False +EventPersistencySvc.AuditRestart: False +EventPersistencySvc.AuditServices: False +EventPersistencySvc.AuditStart: False +EventPersistencySvc.AuditStop: False +EventPersistencySvc.CnvServices: [ ] +EventPersistencySvc.OutputLevel: 3 +IncidentSvc.AuditFinalize: False +IncidentSvc.AuditInitialize: False +IncidentSvc.AuditReinitialize: False +IncidentSvc.AuditRestart: False +IncidentSvc.AuditServices: False +IncidentSvc.AuditStart: False +IncidentSvc.AuditStop: False +IncidentSvc.OutputLevel: 3 +JobOptionsSvc.AuditFinalize: False +JobOptionsSvc.AuditInitialize: False +JobOptionsSvc.AuditReinitialize: False +JobOptionsSvc.AuditRestart: False +JobOptionsSvc.AuditServices: False +JobOptionsSvc.AuditStart: False +JobOptionsSvc.AuditStop: False +JobOptionsSvc.DUMPFILE: '' +JobOptionsSvc.OutputLevel: 3 +JobOptionsSvc.PATH: '../options/job.opts' +JobOptionsSvc.PYTHONACTION: '' +JobOptionsSvc.PYTHONPARAMS: '' +JobOptionsSvc.SEARCHPATH: '/home/marco/Devel/workspace/Gaudi/GaudiExamples/tests/qmtest:/home/marco/Devel/workspace/Gaudi/GaudiExamples/options' +JobOptionsSvc.TYPE: 'NONE' +MessageSvc.AuditFinalize: False +MessageSvc.AuditInitialize: False +MessageSvc.AuditReinitialize: False +MessageSvc.AuditRestart: False +MessageSvc.AuditServices: False +MessageSvc.AuditStart: False +MessageSvc.AuditStop: False +MessageSvc.Format: '% F%18W%S%7W%R%T %0W%M' +MessageSvc.OutputLevel: 3 +MessageSvc.alwaysColorCode: [ ] +MessageSvc.alwaysLimit: 0 +MessageSvc.countInactive: False +MessageSvc.debugColorCode: [ ] +MessageSvc.debugLimit: 500 +MessageSvc.defaultLimit: 500 +MessageSvc.enableSuppression: False +MessageSvc.errorColorCode: [ 'white' , 'red' ] +MessageSvc.errorLimit: 500 +MessageSvc.fatalColorCode: [ 'blue' , 'red' ] +MessageSvc.fatalLimit: 500 +MessageSvc.infoColorCode: [ ] +MessageSvc.infoLimit: 500 +MessageSvc.loggedStreams: { } +MessageSvc.setAlways: [ ] +MessageSvc.setDebug: [ 'EventLoopMgr' ] +MessageSvc.setError: [ ] +MessageSvc.setFatal: [ ] +MessageSvc.setInfo: [ ] +MessageSvc.setVerbose: [ 'MsgTest' ] +MessageSvc.setWarning: [ 'MsgTest' ] +MessageSvc.showStats: False +MessageSvc.statLevel: 0 +MessageSvc.timeFormat: '%Y-%m-%d %H:%M:%S,%f' +MessageSvc.tracedInactiveSources: [ ] +MessageSvc.useColors: False +MessageSvc.verboseColorCode: [ ] +MessageSvc.verboseLimit: 500 +MessageSvc.warningColorCode: [ 'yellow' ] +MessageSvc.warningLimit: 500 +PropertyAlg.AuditAlgorithms: False +PropertyAlg.AuditBeginRun: False +PropertyAlg.AuditEndRun: False +PropertyAlg.AuditExecute: False +PropertyAlg.AuditFinalize: False +PropertyAlg.AuditInitialize: False +PropertyAlg.AuditReinitialize: False +PropertyAlg.AuditRestart: False +PropertyAlg.AuditStart: False +PropertyAlg.AuditStop: False PropertyAlg.Bool: False -PropertyAlg.BoolArray: [False, True, False] -PropertyAlg.Double: 1.011e+12 -PropertyAlg.DoubleArray: [-11.0, 2.0, 3.3, 0.0004, 1e-20, 1e+20] -PropertyAlg.DoubleArrayWithUnits: [1100000.0, -20.0, 33.0, 0.4] -PropertyAlg.DoubleArrayWithoutUnits: [1100000.0, -20.0, 33.0, 0.4] -PropertyAlg.DoublePairArray: [(1.1, 2.1), (2.3, 4.5), (5.6, 6.7)] +PropertyAlg.BoolArray: [ False , True , False ] +PropertyAlg.Cardinality: 1 +PropertyAlg.Double: 1.0110000e+12 +PropertyAlg.DoubleArray: [ -11.000000 , 2.0000000 , 3.3000000 , 0.00040000000 , 1.0000000e-20 , 1.0000000e+20 ] +PropertyAlg.DoubleArrayWithUnits: [ 1100000.0 , -20.000000 , 33.000000 , 0.40000000 ] +PropertyAlg.DoubleArrayWithoutUnits: [ 1100000.0 , -20.000000 , 33.000000 , 0.40000000 ] +PropertyAlg.DoublePairArray: [ ( 1.1000000 , 2.1000000 ) , ( 2.3000000 , 4.5000000 ) , ( 5.6000000 , 6.7000000 ) ] +PropertyAlg.EmptyArray: [ ] +PropertyAlg.Enable: True +PropertyAlg.ErrorMax: 1 +PropertyAlg.ExtraInputs: [] +PropertyAlg.ExtraOutputs: [] +PropertyAlg.FilterCircularDependencies: True PropertyAlg.Int: 101 PropertyAlg.Int64: 4294967296 -PropertyAlg.Int64Array: [4294967296] -PropertyAlg.IntArray: [1, 2, 3, 5] -PropertyAlg.IntPairArray: [(1, 2), (3, 4), (5, 6)] +PropertyAlg.Int64Array: [ 4294967296 ] +PropertyAlg.IntArray: [ 1 , 2 , 3 , 5 ] +PropertyAlg.IntPairArray: [ ( 1 , 2 ) , ( 3 , 4 ) , ( 5 , 6 ) ] +PropertyAlg.IsIOBound: False +PropertyAlg.MonitorService: 'MonitorSvc' +PropertyAlg.NeededResources: [ ] PropertyAlg.OutputLevel: 3 -PropertyAlg.PBool: True -PropertyAlg.PBoolArray: [True, False, True, False] -PropertyAlg.PDouble: 10100000.0 -PropertyAlg.PDoubleArray: [1.1, 2.0, 3.3, 1e-20, 1e+20] -PropertyAlg.PInt: 101 -PropertyAlg.PIntArray: [1, 2, 3, 5] +PropertyAlg.PBool: False +PropertyAlg.PBoolArray: [ True , False , True , False ] +PropertyAlg.PDouble: 999.00000 +PropertyAlg.PDoubleArray: [ 1.1000000 , 2.0000000 , 3.3000000 , 1.0000000e-20 , 1.0000000e+20 ] +PropertyAlg.PInt: 155 +PropertyAlg.PIntArray: [ 1 , 2 , 3 , 5 ] PropertyAlg.PString: 'hundred one' -PropertyAlg.PStringArray: ['one', 'two', 'four'] +PropertyAlg.PStringArray: [ 'one' , 'two' , 'four' ] +PropertyAlg.RegisterForContextService: False PropertyAlg.String: 'hundred one' -PropertyAlg.StringArray: ['one', 'two', 'four'] +PropertyAlg.StringArray: [ 'one' , 'two' , 'four' ] +PropertyAlg.Timeline: False PropertyAlg.UInt64: 4294967296 -PropertyAlg.UInt64Array: [4294967296L] +PropertyAlg.UInt64Array: [ 4294967296 ] +StatusCodeSvc.AbortOnError: False +StatusCodeSvc.AuditFinalize: False +StatusCodeSvc.AuditInitialize: False +StatusCodeSvc.AuditReinitialize: False +StatusCodeSvc.AuditRestart: False +StatusCodeSvc.AuditServices: False +StatusCodeSvc.AuditStart: False +StatusCodeSvc.AuditStop: False +StatusCodeSvc.Filter: [ ] +StatusCodeSvc.IgnoreDicts: True +StatusCodeSvc.OutputLevel: 3 +StatusCodeSvc.SuppressCheck: False +TimelineSvc.AuditFinalize: False +TimelineSvc.AuditInitialize: False +TimelineSvc.AuditReinitialize: False +TimelineSvc.AuditRestart: False +TimelineSvc.AuditServices: False +TimelineSvc.AuditStart: False +TimelineSvc.AuditStop: False +TimelineSvc.DumpTimeline: False +TimelineSvc.OutputLevel: 3 +TimelineSvc.Partial: False +TimelineSvc.RecordTimeline: False +TimelineSvc.TimelineFile: 'timeline.csv' PropertyAlg INFO ================================================= -PropertyAlg INFO Read handler called for property: 'PDouble':10100000. -PropertyAlg INFO Update handler called for property: 'PDouble':10100000. -PropertyAlg INFO Changed property DoubleArray in catalogue +PropertyAlg INFO PInt= 'PInt':154 [should be 154] +PropertyAlg INFO Try to assign invalid value to DoubleArray PropertyAlg ERROR got invalid_argument exception: cannot parse '{"12.12", "13.13"}' to std::vector > PropertyAlg INFO DoubleArray = [-11, 2, 3.3, 0.0004, 1e-20, 1e+20] PropertyAlg INFO ================================================= @@ -155,7 +380,7 @@ ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully PropertyAlg INFO executing.... PropertyProxy INFO executing.... -EventLoopMgr DEBUG ---> Loop Finished - WSS 55.8086 | total time (skipping 1st evt) 78452 ns +EventLoopMgr DEBUG ---> Loop Finished - WSS 65.7539 | total time (skipping 1st evt) 210934 ns ApplicationMgr INFO Application Manager Stopped successfully PropertyAlg INFO finalizing.... PropertyProxy INFO finalizing.... diff --git a/GaudiExamples/tests/qmtest/refs/THistRead.ref.dbg b/GaudiExamples/tests/qmtest/refs/THistRead.ref.dbg index 9fb934d8a6..5def8f13a4 100644 --- a/GaudiExamples/tests/qmtest/refs/THistRead.ref.dbg +++ b/GaudiExamples/tests/qmtest/refs/THistRead.ref.dbg @@ -30,6 +30,7 @@ ApplicationMgr DEBUG Loading declared DLL's ApplicationMgr VERBOSE addMultiSvc: added service EventLoopMgr/EventLoopMgr ApplicationMgr INFO Application Manager Configured successfully THistSvc DEBUG Property update for OutputLevel : new value = 2 +THistSvc DEBUG Delaying connection of Input Files until Initialize. now in OFFLINE THistSvc DEBUG Service base class initialized successfully THistSvc DEBUG Delaying connection of Output Files until Initialize. now in CONFIGURED THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED diff --git a/GaudiExamples/tests/qmtest/refs/THistWrite.ref b/GaudiExamples/tests/qmtest/refs/THistWrite.ref index fe48e77832..31f336fc17 100644 --- a/GaudiExamples/tests/qmtest/refs/THistWrite.ref +++ b/GaudiExamples/tests/qmtest/refs/THistWrite.ref @@ -30,7 +30,7 @@ ApplicationMgr DEBUG Loading declared DLL's ApplicationMgr VERBOSE added service EventLoopMgr/EventLoopMgr ApplicationMgr INFO Application Manager Configured successfully THistSvc DEBUG Property update for OutputLevel : new value = 2 -THistSvc DEBUG Delaying connection of Input Files until Initialize. now in OFFLINE +THistSvc DEBUG Delaying connection of Output Files until Initialize. now in OFFLINE THistSvc DEBUG Service base class initialized successfully THistSvc DEBUG Delaying connection of Output Files until Initialize. now in CONFIGURED THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED diff --git a/GaudiExamples/tests/qmtest/refs/THistWrite.ref.dbg b/GaudiExamples/tests/qmtest/refs/THistWrite.ref.dbg index dc894d2675..07f3254e78 100644 --- a/GaudiExamples/tests/qmtest/refs/THistWrite.ref.dbg +++ b/GaudiExamples/tests/qmtest/refs/THistWrite.ref.dbg @@ -30,6 +30,7 @@ ApplicationMgr DEBUG Loading declared DLL's ApplicationMgr VERBOSE added service EventLoopMgr/EventLoopMgr ApplicationMgr INFO Application Manager Configured successfully THistSvc DEBUG Property update for OutputLevel : new value = 2 +THistSvc DEBUG Delaying connection of Output Files until Initialize. now in OFFLINE THistSvc DEBUG Service base class initialized successfully THistSvc DEBUG Delaying connection of Output Files until Initialize. now in CONFIGURED THistSvc DEBUG Delaying connection of Input Files until Initialize. now in CONFIGURED diff --git a/GaudiKernel/CMakeLists.txt b/GaudiKernel/CMakeLists.txt index 10ecc737f1..6c3bae7f3f 100644 --- a/GaudiKernel/CMakeLists.txt +++ b/GaudiKernel/CMakeLists.txt @@ -145,6 +145,9 @@ gaudi_add_unit_test(test_PropertyHolder tests/src/test_PropertyHolder.cpp gaudi_add_unit_test(test_Property tests/src/test_Property.cpp LINK_LIBRARIES GaudiKernel TYPE Boost) +gaudi_add_unit_test(test_WeekPropertyRef tests/src/test_WeekPropertyRef.cpp + LINK_LIBRARIES GaudiKernel + TYPE Boost) gaudi_add_unit_test(test_StatusCode tests/src/test_StatusCode.cpp LINK_LIBRARIES GaudiKernel TYPE Boost) diff --git a/GaudiKernel/Gaudi/Algorithm.h b/GaudiKernel/Gaudi/Algorithm.h index 9af63d6730..652384e350 100644 --- a/GaudiKernel/Gaudi/Algorithm.h +++ b/GaudiKernel/Gaudi/Algorithm.h @@ -334,7 +334,7 @@ namespace Gaudi GAUDI_DEPRECATED_SINCE_v30r5( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; - setPropertiesFrom( serviceLocator()->getOptsSvc() ); + bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; } diff --git a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h index ba62f9f07a..820302da13 100644 --- a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h +++ b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h @@ -6,6 +6,10 @@ namespace Gaudi { + namespace Details + { + class PropertyBase; + } namespace Interfaces { /** Interface for a component that manages application configuration options. @@ -45,6 +49,8 @@ namespace Gaudi /// Return all known options with their values. virtual std::vector> items() const = 0; + virtual void bind( const std::string& prefix, Gaudi::Details::PropertyBase* property ) = 0; + protected: virtual ~IOptionsSvc() = default; }; diff --git a/GaudiKernel/GaudiKernel/AlgTool.h b/GaudiKernel/GaudiKernel/AlgTool.h index 303cfd1677..c07521c64e 100644 --- a/GaudiKernel/GaudiKernel/AlgTool.h +++ b/GaudiKernel/GaudiKernel/AlgTool.h @@ -121,7 +121,7 @@ public: [[deprecated( "it should not be called explicitely" )]] StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; - setPropertiesFrom( serviceLocator()->getOptsSvc() ); + bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; } diff --git a/GaudiKernel/GaudiKernel/Auditor.h b/GaudiKernel/GaudiKernel/Auditor.h index 776cd5ff79..5b7fe896f2 100644 --- a/GaudiKernel/GaudiKernel/Auditor.h +++ b/GaudiKernel/GaudiKernel/Auditor.h @@ -124,7 +124,7 @@ public: [[deprecated( "it should not be called explicitely" )]] StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; - setPropertiesFrom( serviceLocator()->getOptsSvc() ); + bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; } diff --git a/GaudiKernel/GaudiKernel/Property.h b/GaudiKernel/GaudiKernel/Property.h index 7f15cd47ef..e6781c2356 100644 --- a/GaudiKernel/GaudiKernel/Property.h +++ b/GaudiKernel/GaudiKernel/Property.h @@ -23,6 +23,8 @@ namespace Gaudi { namespace Details { + class WeekPropertyRef; + // ============================================================================ /** PropertyBase base class allowing PropertyBase* collections to be "homogeneous" * @@ -84,7 +86,7 @@ namespace Gaudi public: /// virtual destructor - virtual ~PropertyBase() = default; + virtual inline ~PropertyBase(); /// set the new value for the property name void setName( std::string value ) { m_name = to_view( std::move( value ) ); } /// set the documentation string @@ -140,8 +142,95 @@ namespace Gaudi const std::type_info* m_typeinfo; /// type of owner of the property (if defined) const std::type_info* m_ownerType = nullptr; + + friend WeekPropertyRef; + std::set m_weekReferences; + void add( WeekPropertyRef* ref ) + { + if ( ref ) m_weekReferences.insert( ref ); + } + void remove( WeekPropertyRef* ref ) { m_weekReferences.erase( ref ); } + }; + + /// Optional reference to a property that can be used to refer to a sting or + /// to the strin representation of a property instance value + class GAUDI_API WeekPropertyRef + { + friend PropertyBase; + + public: + WeekPropertyRef() = default; + WeekPropertyRef( std::string value ) : m_value{std::move( value )}, m_unset{false} {} + WeekPropertyRef( PropertyBase& property ) : m_property{&property} { property.add( this ); } + WeekPropertyRef( const WeekPropertyRef& other ) = delete; + WeekPropertyRef( WeekPropertyRef&& other ) + : m_property{other.m_property}, m_value{std::move( other.m_value )}, m_unset{other.m_unset} + { + if ( m_property ) { + other.m_property = nullptr; + m_property->remove( &other ); + m_property->add( this ); + } + } + ~WeekPropertyRef() + { + if ( m_property ) m_property->remove( this ); + } + WeekPropertyRef& operator=( WeekPropertyRef&& other ) + { + if ( this != &other ) { + if ( m_property ) m_property->remove( this ); + m_property = other.m_property; + other.m_property = nullptr; + if ( m_property ) { + m_property->remove( &other ); + m_property->add( this ); + } + m_value = std::move( other.m_value ); + m_unset = other.m_unset; + } + return *this; + } + WeekPropertyRef& operator=( PropertyBase& value ) + { + if ( m_property != &value ) { + if ( m_property ) { + m_property->remove( this ); + if ( !m_unset ) m_value = m_property->toString(); + } + if ( !m_unset ) value.fromString( m_value ).ignore(); + m_property = &value; + value.add( this ); + } + return *this; + } + WeekPropertyRef& operator=( const std::string& value ) + { + if ( m_property ) m_property->fromString( value ).ignore(); + m_value = value; + m_unset = false; + return *this; + } + operator std::string() const { return m_property ? m_property->toString() : m_value; } + + inline bool isBound() const { return m_property; } + inline bool isSet() const { return !m_unset; } + + private: + PropertyBase* m_property = nullptr; + std::string m_value; + bool m_unset = true; + + void detach() { m_property = nullptr; } }; + inline PropertyBase::~PropertyBase() + { + for ( auto ref : m_weekReferences ) { + ref->detach(); + } + } + inline std::ostream& operator<<( std::ostream& stream, const PropertyBase& prop ) { return prop.fillStream( stream ); diff --git a/GaudiKernel/GaudiKernel/PropertyHolder.h b/GaudiKernel/GaudiKernel/PropertyHolder.h index 2c3abfb218..be04f634f4 100644 --- a/GaudiKernel/GaudiKernel/PropertyHolder.h +++ b/GaudiKernel/GaudiKernel/PropertyHolder.h @@ -285,7 +285,7 @@ public: } ); } // ========================================================================== - /// \fixme property and setPropertiesFrom should be protected + /// \fixme property and bindPropertiesTo should be protected // get local or remote property by name Gaudi::Details::PropertyBase* property( const std::string& name ) const { @@ -302,15 +302,9 @@ public: return nullptr; // RETURN } - void setPropertiesFrom( const Gaudi::Interfaces::IOptionsSvc& optsSvc ) + void bindPropertiesTo( Gaudi::Interfaces::IOptionsSvc& optsSvc ) { - auto set_prop = [&optsSvc, this]( auto prop ) { - const std::string prop_full_name = this->name() + '.' + prop->name(); - if ( optsSvc.has( prop_full_name ) ) { - if ( !prop->fromString( optsSvc.get( prop_full_name ) ) ) - throw std::invalid_argument( "cannot set " + prop->name() + " of " + this->name() ); - } - }; + auto set_prop = [&optsSvc, this]( auto prop ) { optsSvc.bind( this->name(), prop ); }; std::for_each( begin( m_properties ), end( m_properties ), set_prop ); std::for_each( begin( m_remoteProperties ), end( m_remoteProperties ), [&set_prop, this]( auto& rem ) { if ( rem.owner ) set_prop( this->property( rem.remName, rem.owner->getProperties() ) ); diff --git a/GaudiKernel/GaudiKernel/Service.h b/GaudiKernel/GaudiKernel/Service.h index fc5f5dbd90..49e3f67bff 100644 --- a/GaudiKernel/GaudiKernel/Service.h +++ b/GaudiKernel/GaudiKernel/Service.h @@ -76,7 +76,7 @@ public: [[deprecated( "it should not be called explicitely" )]] StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; - setPropertiesFrom( serviceLocator()->getOptsSvc() ); + bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; } diff --git a/GaudiKernel/src/Lib/Algorithm.cpp b/GaudiKernel/src/Lib/Algorithm.cpp index a8b53a0120..8b5831603a 100644 --- a/GaudiKernel/src/Lib/Algorithm.cpp +++ b/GaudiKernel/src/Lib/Algorithm.cpp @@ -69,7 +69,7 @@ namespace Gaudi m_outputLevel.value() = setUpMessaging(); // Set the Algorithm's properties - setPropertiesFrom( serviceLocator()->getOptsSvc() ); + bindPropertiesTo( serviceLocator()->getOptsSvc() ); // Bypass the initialization if the algorithm is disabled. // Need to do this after setProperties. diff --git a/GaudiKernel/src/Lib/Auditor.cpp b/GaudiKernel/src/Lib/Auditor.cpp index ddf9ca4d28..dd3e19e0f9 100644 --- a/GaudiKernel/src/Lib/Auditor.cpp +++ b/GaudiKernel/src/Lib/Auditor.cpp @@ -28,7 +28,7 @@ StatusCode Auditor::sysInitialize() m_outputLevel.value() = setUpMessaging(); // Set the Algorithm's properties - setPropertiesFrom( serviceLocator()->getOptsSvc() ); + bindPropertiesTo( serviceLocator()->getOptsSvc() ); if ( !sc.isSuccess() ) return StatusCode::FAILURE; diff --git a/GaudiKernel/src/Lib/Service.cpp b/GaudiKernel/src/Lib/Service.cpp index 55bc2f335b..56d70f1246 100644 --- a/GaudiKernel/src/Lib/Service.cpp +++ b/GaudiKernel/src/Lib/Service.cpp @@ -44,7 +44,7 @@ void Service::sysInitialize_imp() m_outputLevel.value() = setUpMessaging(); } - setPropertiesFrom( serviceLocator()->getOptsSvc() ); + bindPropertiesTo( serviceLocator()->getOptsSvc() ); m_initSC = initialize(); // This should change the state to Gaudi::StateMachine::CONFIGURED if ( m_initSC.isSuccess() ) m_state = m_targetState; diff --git a/GaudiKernel/tests/src/test_WeekPropertyRef.cpp b/GaudiKernel/tests/src/test_WeekPropertyRef.cpp new file mode 100644 index 0000000000..f4f1840e38 --- /dev/null +++ b/GaudiKernel/tests/src/test_WeekPropertyRef.cpp @@ -0,0 +1,133 @@ +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE test_PropertyHolder +#include + +#include "GaudiKernel/Property.h" + +struct MyClass { +}; + +using WPR = Gaudi::Details::WeekPropertyRef; + +BOOST_AUTO_TEST_CASE( default_constructor ) +{ + WPR r; + BOOST_CHECK( !r.isBound() ); + BOOST_CHECK( !r.isSet() ); + BOOST_CHECK_EQUAL( std::string{r}, "" ); + r = "42"; + BOOST_CHECK( r.isSet() ); + BOOST_CHECK_EQUAL( std::string{r}, "42" ); +} + +BOOST_AUTO_TEST_CASE( construct_from_string ) +{ + WPR r{"42"}; + BOOST_CHECK( !r.isBound() ); + BOOST_CHECK( r.isSet() ); + BOOST_CHECK_EQUAL( std::string{r}, "42" ); +} + +BOOST_AUTO_TEST_CASE( construct_from_property ) +{ + Gaudi::Property p; + + WPR r{p}; + + BOOST_CHECK( r.isBound() ); + BOOST_CHECK( !r.isSet() ); +} + +BOOST_AUTO_TEST_CASE( assignment ) +{ + { + WPR r; + r = "42"; + BOOST_CHECK( r.isSet() ); + BOOST_CHECK_EQUAL( std::string{r}, "42" ); + } +} + +BOOST_AUTO_TEST_CASE( binding ) +{ + { + Gaudi::Property p; + { + WPR r{p}; + r = "42"; + BOOST_CHECK( r.isSet() ); + BOOST_CHECK_EQUAL( p.value(), 42 ); + } + // it would be nice to check that p knows about r, until r goes out of scope + } + + { + WPR r; + { + Gaudi::Property p; + BOOST_CHECK_EQUAL( p.value(), 0 ); + r = p; + BOOST_CHECK( r.isBound() ); + BOOST_CHECK( !r.isSet() ); + } + BOOST_CHECK( !r.isBound() ); + + r = "42"; + { + Gaudi::Property p; + r = p; + BOOST_CHECK( r.isBound() ); + BOOST_CHECK( r.isSet() ); + BOOST_CHECK_EQUAL( p.value(), 42 ); + + p = 100; + BOOST_CHECK_EQUAL( std::string{r}, "100" ); + } + + BOOST_CHECK_EQUAL( std::string{r}, "42" ); + } +} + +BOOST_AUTO_TEST_CASE( moving ) +{ + { + WPR r; + BOOST_CHECK( !r.isBound() ); + BOOST_CHECK( !r.isSet() ); + BOOST_CHECK_EQUAL( std::string{r}, "" ); + + r = WPR{"42"}; + BOOST_CHECK( !r.isBound() ); + BOOST_CHECK( r.isSet() ); + BOOST_CHECK_EQUAL( std::string{r}, "42" ); + } + { + WPR r{WPR{"42"}}; + BOOST_CHECK( !r.isBound() ); + BOOST_CHECK( r.isSet() ); + BOOST_CHECK_EQUAL( std::string{r}, "42" ); + } + { + Gaudi::Property p{42}; + WPR r{WPR{p}}; + BOOST_CHECK( r.isBound() ); + BOOST_CHECK( !r.isSet() ); + BOOST_CHECK_EQUAL( std::string{r}, "42" ); + } +} + +BOOST_AUTO_TEST_CASE( exceptions ) +{ + { + Gaudi::Property p{42}; + WPR r{p}; + BOOST_CHECK_THROW( r = "'abc'", std::invalid_argument ); + BOOST_CHECK_EQUAL( p.value(), 42 ); + } + { + WPR r{"'abc'"}; + Gaudi::Property p{42}; + BOOST_CHECK_THROW( r = p, std::invalid_argument ); + BOOST_CHECK_EQUAL( p.value(), 42 ); + } +} diff --git a/GaudiPython/python/GaudiPython/Bindings.py b/GaudiPython/python/GaudiPython/Bindings.py index 6c49d4b31f..4399f266e0 100644 --- a/GaudiPython/python/GaudiPython/Bindings.py +++ b/GaudiPython/python/GaudiPython/Bindings.py @@ -1189,37 +1189,8 @@ class AppMgr(iService): if sc.isFailure(): raise RuntimeError, ' Unable to read file "' + tmpfilename + '" ' os.remove(tmpfilename) - # We need to make sure that the options are taken by the ApplicationMgr - # The state is already configured, so we need to do something.... - if self.FSMState() != Gaudi.StateMachine.OFFLINE: - - # get job-options-service, @see class iJobOptSvc - jos = self.optSvc() - - # list of all libraries - _dlls = jos.getProperty(self.name(), 'DLLs') - # take care about libraries : APPEND if not done yet - if _dlls: - libs = [l for l in _dlls if not l in self.DLLs] - if libs: - self.DLLs += libs - - # all external services - _svcs = jos.getProperty(self.name(), 'ExtSvc') - # take care about services : APPEND if not done yet - if _svcs: - svcs = [s for s in _svcs if not s in self.ExtSvc] - if svcs: - self.ExtSvc += svcs - - # get all properties - props = jos.getProperties(self.name()) - # finally treat all other properties (presumably scalar properties) - for key in props: - if 'DLLS' == key or 'EXTSVC' == key: - continue - self.__setattr__(key, props[key]) - return SUCCESS # RETURN + + return SUCCESS def configure(self): return self._appmgr.configure() diff --git a/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp b/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp index 47ad864b04..f99d196685 100644 --- a/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp +++ b/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp @@ -18,36 +18,6 @@ using Gaudi::MetaDataSvc; -namespace -{ - const auto get_name = []( const auto* i ) { return i->name(); }; - - struct Identity { - template - auto operator()( T&& t ) const -> decltype( auto ) - { - return std::forward( t ); - } - }; - - template - std::string join( Iterator first, Iterator last, Sep sep, Projection proj = {} ) - { - std::string s; - if ( first != last ) s += proj( *first++ ); - for ( ; first != last; ++first ) { - s += sep; - s += proj( *first ); - } - return s; - } - template - std::string join( const Container& c, Sep sep, Projection proj = {} ) - { - return join( begin( c ), end( c ), std::move( sep ), std::move( proj ) ); - } -} - DECLARE_COMPONENT( MetaDataSvc ) StatusCode MetaDataSvc::start() @@ -66,45 +36,6 @@ StatusCode MetaDataSvc::collectData() m_metadata[std::get<0>( p )] = std::get<1>( p ); } - for ( const auto* name : {"ApplicationMgr", "MessageSvc", "NTupleSvc"} ) { - auto svc = service( name ); - if ( !svc.isValid() ) continue; - const auto prefix = name + std::string{"."}; - for ( const auto* prop : svc->getProperties() ) { - m_metadata[prefix + prop->name()] = prop->toString(); - } - } - - /* - * TOOLS - * */ - SmartIF tSvc( serviceLocator()->service( "ToolSvc" ) ); - if ( tSvc.isValid() ) { - m_metadata["ToolSvc"] = join( tSvc->getInstances( "" ), ", " ); - } - - /* - * SERVICES - * */ - m_metadata["ISvcLocator.Services"] = join( serviceLocator()->getServices(), ", ", get_name ); - - /* - * ALGORITHMS - * */ - SmartIF algMan( serviceLocator() ); - m_metadata["IAlgManager.Algorithms"] = join( algMan->getAlgorithms(), ", ", get_name ); - - /* - * JOB OPTIONS SERVICE - * */ - { - auto joSvc = service( "JobOptionsSvc" ); - if ( !joSvc.isValid() ) return StatusCode::FAILURE; - for ( const auto* prop : joSvc->getProperties() ) { - m_metadata["JobOptionsSvc." + prop->name()] = prop->toString(); - } - } - if ( msgLevel( MSG::DEBUG ) ) { debug() << "Metadata collected:\n"; for ( const auto& item : m_metadata ) { -- GitLab From 00dec700888f32898ab1d5409cb21ffd093820e2 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Tue, 11 Sep 2018 12:53:23 +0200 Subject: [PATCH 16/62] Add warning about properties set in options, but not used --- .../src/JobOptionsSvc/JobOptionsSvc.cpp | 17 +++++++++++++++++ GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h | 1 + 2 files changed, 18 insertions(+) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index ae8d5cfe79..5f88b2e089 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -48,6 +48,23 @@ StatusCode JobOptionsSvc::initialize() } return sc; } +StatusCode JobOptionsSvc::stop() +{ + std::vector unused; + unused.reserve( m_options.size() ); + + for ( const auto& p : m_options ) { + if ( !p.second.isBound() ) unused.emplace_back( p.first ); + } + + if ( !unused.empty() ) { + auto& log = warning(); + log << unused.size() << " unused properties:"; + for ( const auto& k : unused ) log << "\n - " << k; + log << endmsg; + } + return Service::stop(); +} // ============================================================================ StatusCode JobOptionsSvc::addPropertyToCatalogue( const std::string& client, diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index 9781e41b9a..f6f7be59a9 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -103,6 +103,7 @@ public: JobOptionsSvc( const std::string& name, ISvcLocator* svc ); StatusCode initialize() override; + StatusCode stop() override; /** Override default properties of the calling client @param client Name of the client algorithm or service -- GitLab From e223305545850108126cd5b8d8126f0bb6cdbbdb Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Wed, 12 Sep 2018 16:27:53 +0200 Subject: [PATCH 17/62] Allow declaration of defaults for options matching a regular expression --- .../src/JobOptionsSvc/JobOptionsSvc.cpp | 52 ++++++++++++++++++ .../src/JobOptionsSvc/JobOptionsSvc.h | 23 +++----- .../job_opts_svc.qms/global_defaults.qmt | 53 +++++++++++++++++++ .../tests/qmtest/refs/MetaDataSvc.ref | 1 + .../tests/qmtest/refs/Properties.ref | 1 + .../tests/qmtest/refs/Properties2.ref | 1 + .../tests/qmtest/refs/Properties_py.ref | 1 + GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h | 6 +++ 8 files changed, 122 insertions(+), 16 deletions(-) create mode 100644 GaudiExamples/tests/qmtest/gaudiexamples.qms/job_opts_svc.qms/global_defaults.qmt diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index 5f88b2e089..80aaae321a 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -15,6 +15,7 @@ // ============================================================================ #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/System.h" +#include #include @@ -29,6 +30,14 @@ JobOptionsSvc::JobOptionsSvc( const std::string& name, ISvcLocator* svc ) : base { if ( System::isEnvSet( "JOBOPTSEARCHPATH" ) ) m_dir_search_path = System::getEnv( "JOBOPTSEARCHPATH" ); if ( System::isEnvSet( "JOBOPTSDUMPFILE" ) ) m_dump = System::getEnv( "JOBOPTSDUMPFILE" ); + + m_globalDefaultsProp.declareUpdateHandler( [this]( Gaudi::Details::PropertyBase& ) { + m_globalDefaults.clear(); + m_globalDefaults.reserve( m_globalDefaultsProp.size() ); + for ( const auto& p : m_globalDefaultsProp ) { + m_globalDefaults.emplace_back( p.first, p.second ); + } + } ); } // ============================================================================ StatusCode JobOptionsSvc::initialize() @@ -208,3 +217,46 @@ StatusCode JobOptionsSvc::readOptions( const std::string& file, const std::strin // ---------------------------------------------------------------------------- return sc; } + +void JobOptionsSvc::bind( const std::string& prefix, Gaudi::Details::PropertyBase* property ) +{ + const auto key = prefix + '.' + property->name(); + + std::tuple defaultValue{false, ""}; + if ( !has( key ) && !m_globalDefaults.empty() ) { // look for a global default only if it was not set + std::smatch match; + for ( const auto& p : m_globalDefaults ) { + if ( regex_match( key, match, p.first ) ) { + defaultValue = {true, p.second}; + } + } + } + + auto item = find( key, true ); + if ( item != m_options.end() && key != item->first ) { + // Storage is case insensitive, and I want to use the what the property dictates + auto new_item = m_options.emplace( key, std::move( m_options.find( item->first )->second ) ); + m_options.erase( item ); + item = new_item.first; + } + if ( item == m_options.end() ) { + m_options.emplace( key, *property ); + } else { + m_options.find( key )->second = *property; + } + + // at this point the property is bound, so we can set the default if needed + if ( std::get<0>( defaultValue ) ) set( key, std::string{std::get<1>( defaultValue )} ); +} + +void JobOptionsSvc::broadcast( const std::regex& filter, const std::string& value, OnlyDefaults defaults_only ) +{ + std::smatch match; + for ( auto& p : m_options ) { + if ( !defaults_only || !p.second.isSet() ) { + if ( regex_match( p.first, match, filter ) ) { + p.second = value; + } + } + } +} diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index f6f7be59a9..644cbdb584 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -79,23 +79,9 @@ protected: std::for_each( begin( m_options ), end( m_options ), [&v]( const auto& item ) { v.emplace_back( item ); } ); return v; } - void bind( const std::string& prefix, Gaudi::Details::PropertyBase* property ) override - { - const auto key = prefix + '.' + property->name(); + void bind( const std::string& prefix, Gaudi::Details::PropertyBase* property ) override; - auto item = find( key, true ); - if ( item != m_options.end() && key != item->first ) { - // Storage is case insensitive, and I want to use the what the property dictates - auto new_item = m_options.emplace( key, std::move( m_options.find( item->first )->second ) ); - m_options.erase( item ); - item = new_item.first; - } - if ( item == m_options.end() ) { - m_options.emplace( key, *property ); - } else { - m_options.find( key )->second = *property; - } - } + void broadcast( const std::regex& filter, const std::string& value, OnlyDefaults defaults_only ) override; /// @} public: @@ -156,5 +142,10 @@ private: Gaudi::Property m_dump{this, "DUMPFILE"}; Gaudi::Property m_pythonAction{this, "PYTHONACTION"}; Gaudi::Property m_pythonParams{this, "PYTHONPARAMS"}; + + Gaudi::Property>> m_globalDefaultsProp{ + this, "GlobalDefaults", {}, "Allow definition of global defaults for properties as list of pairs (regex, value)"}; + + std::vector> m_globalDefaults; }; #endif /* JOBOPTIONSSVC_H_ */ diff --git a/GaudiExamples/tests/qmtest/gaudiexamples.qms/job_opts_svc.qms/global_defaults.qmt b/GaudiExamples/tests/qmtest/gaudiexamples.qms/job_opts_svc.qms/global_defaults.qmt new file mode 100644 index 0000000000..1add0e13e6 --- /dev/null +++ b/GaudiExamples/tests/qmtest/gaudiexamples.qms/job_opts_svc.qms/global_defaults.qmt @@ -0,0 +1,53 @@ + + +gaudirun.py + +from Gaudi.Configuration import * +from Configurables import HelloWorld + +app = ApplicationMgr(EvtSel='NONE', EvtMax=1) + +app.TopAlg=[HelloWorld('alg{}'.format(i)) for i in range(10)] +app.TopAlg[5].OutputLevel = 4 + +JobOptionsSvc(GlobalDefaults=[(r'.*[135]\.OutputLevel$', '1'), + (r'.*[24]\.OutputLevel$', '2'), + ]) + + +findReferenceBlock(''' +alg0 INFO initializing.... +alg1 DEBUG Property update for OutputLevel : new value = 1 +alg1 VERBOSE ServiceLocatorHelper::service: found service EventDataSvc +alg1 VERBOSE ServiceLocatorHelper::service: found service TimelineSvc +alg1 INFO initializing.... +alg1 VERBOSE ServiceLocatorHelper::service: found service AlgExecStateSvc +alg1 DEBUG input handles: 0 +alg1 DEBUG output handles: 0 +alg1 DEBUG Data Deps for alg1 +alg2 DEBUG Property update for OutputLevel : new value = 2 +alg2 INFO initializing.... +alg2 DEBUG input handles: 0 +alg2 DEBUG output handles: 0 +alg2 DEBUG Data Deps for alg2 +alg3 DEBUG Property update for OutputLevel : new value = 1 +alg3 VERBOSE ServiceLocatorHelper::service: found service EventDataSvc +alg3 VERBOSE ServiceLocatorHelper::service: found service TimelineSvc +alg3 INFO initializing.... +alg3 VERBOSE ServiceLocatorHelper::service: found service AlgExecStateSvc +alg3 DEBUG input handles: 0 +alg3 DEBUG output handles: 0 +alg3 DEBUG Data Deps for alg3 +alg4 DEBUG Property update for OutputLevel : new value = 2 +alg4 INFO initializing.... +alg4 DEBUG input handles: 0 +alg4 DEBUG output handles: 0 +alg4 DEBUG Data Deps for alg4 +alg6 INFO initializing.... +alg7 INFO initializing.... +alg8 INFO initializing.... +alg9 INFO initializing.... +''') + +true + diff --git a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref index 7af9b68c94..d6720232d7 100644 --- a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref +++ b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref @@ -182,6 +182,7 @@ JobOptionsSvc.AuditServices:False JobOptionsSvc.AuditStart:False JobOptionsSvc.AuditStop:False JobOptionsSvc.DUMPFILE:'' +JobOptionsSvc.GlobalDefaults:[ ] JobOptionsSvc.OutputLevel:3 JobOptionsSvc.PATH:'../options/job.opts' JobOptionsSvc.PYTHONACTION:'' diff --git a/GaudiExamples/tests/qmtest/refs/Properties.ref b/GaudiExamples/tests/qmtest/refs/Properties.ref index 4c7bde309d..09f73cca33 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties.ref @@ -285,6 +285,7 @@ JobOptionsSvc.AuditServices: False JobOptionsSvc.AuditStart: False JobOptionsSvc.AuditStop: False JobOptionsSvc.DUMPFILE: '' +JobOptionsSvc.GlobalDefaults: [ ] JobOptionsSvc.OutputLevel: 3 JobOptionsSvc.PATH: '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts' JobOptionsSvc.PYTHONACTION: '' diff --git a/GaudiExamples/tests/qmtest/refs/Properties2.ref b/GaudiExamples/tests/qmtest/refs/Properties2.ref index 098e759409..e73ce1b3ec 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties2.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties2.ref @@ -287,6 +287,7 @@ JobOptionsSvc.AuditServices: False JobOptionsSvc.AuditStart: False JobOptionsSvc.AuditStop: False JobOptionsSvc.DUMPFILE: '' +JobOptionsSvc.GlobalDefaults: [ ] JobOptionsSvc.OutputLevel: 3 JobOptionsSvc.PATH: '../options/job.opts' JobOptionsSvc.PYTHONACTION: '' diff --git a/GaudiExamples/tests/qmtest/refs/Properties_py.ref b/GaudiExamples/tests/qmtest/refs/Properties_py.ref index 8f144df897..fd09ba7d19 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties_py.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties_py.ref @@ -247,6 +247,7 @@ JobOptionsSvc.AuditServices: False JobOptionsSvc.AuditStart: False JobOptionsSvc.AuditStop: False JobOptionsSvc.DUMPFILE: '' +JobOptionsSvc.GlobalDefaults: [ ] JobOptionsSvc.OutputLevel: 3 JobOptionsSvc.PATH: '../options/job.opts' JobOptionsSvc.PYTHONACTION: '' diff --git a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h index 820302da13..82e0ab3392 100644 --- a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h +++ b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h @@ -1,5 +1,7 @@ #pragma once +#include +#include #include #include #include @@ -51,6 +53,10 @@ namespace Gaudi virtual void bind( const std::string& prefix, Gaudi::Details::PropertyBase* property ) = 0; + using OnlyDefaults = Gaudi::tagged_bool; + virtual void broadcast( const std::regex& filter, const std::string& value, + OnlyDefaults defaults = OnlyDefaults{true} ) = 0; + protected: virtual ~IOptionsSvc() = default; }; -- GitLab From 94ca9f2dcfbed486f0e2905d28ffe3efdda766fb Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 13 Sep 2018 12:06:37 +0200 Subject: [PATCH 18/62] Use string_view instead of boost::string_ref --- .../src/JobOptionsSvc/JobOptionsSvc.cpp | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index 80aaae321a..e24a10ed75 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -17,7 +17,27 @@ #include "GaudiKernel/System.h" #include -#include +#if __cplusplus >= 201703 +#include +#else +#include +namespace std +{ + using experimental::string_view; +} +#endif + +namespace +{ +#if __cplusplus >= 202000 + inline bool starts_with( std::string_view s, std::string_view prefix ) { return s.starts_with( prefix ); } +#else + inline bool starts_with( const std::string_view s, const std::string& prefix ) + { + return s.substr( 0, prefix.size() ) == prefix; + } +#endif +} // ============================================================================ DECLARE_COMPONENT( JobOptionsSvc ) @@ -59,7 +79,7 @@ StatusCode JobOptionsSvc::initialize() } StatusCode JobOptionsSvc::stop() { - std::vector unused; + std::vector unused; unused.reserve( m_options.size() ); for ( const auto& p : m_options ) { @@ -96,11 +116,11 @@ const JobOptionsSvc::PropertiesT* JobOptionsSvc::getProperties( const std::strin const std::string key_base = client + '.'; const auto key_base_size = key_base.size(); for ( const auto& elem : m_options ) { - boost::string_ref key = elem.first; + std::string_view key = elem.first; // for keys that are 'client.name' (and name does not contain '.') // we add an entry to the vector - if ( key.starts_with( key_base ) ) { - boost::string_ref name = key.substr( key_base_size ); + if ( starts_with( key, key_base ) ) { + std::string_view name = key.substr( key_base_size ); if ( name.find( '.' ) == std::string::npos ) { props.push_back( getClientProperty( client, static_cast( name ) ) ); } @@ -117,8 +137,8 @@ StatusCode JobOptionsSvc::setMyProperties( const std::string& client, IProperty* bool fail = false; for ( const auto& elem : m_options ) { - boost::string_ref key = elem.first; - if ( key.starts_with( key_base ) ) { + std::string_view key = elem.first; + if ( starts_with( key, key_base ) ) { const auto name = static_cast( key.substr( key_base_size ) ); // \fixme this has to change if we want nested properties // if ( myInt->hasProperty( name ) ) { @@ -222,7 +242,7 @@ void JobOptionsSvc::bind( const std::string& prefix, Gaudi::Details::PropertyBas { const auto key = prefix + '.' + property->name(); - std::tuple defaultValue{false, ""}; + std::tuple defaultValue{false, ""}; if ( !has( key ) && !m_globalDefaults.empty() ) { // look for a global default only if it was not set std::smatch match; for ( const auto& p : m_globalDefaults ) { -- GitLab From 07f62046162945671ce6322f67fc4d937552a472 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Wed, 3 Oct 2018 17:29:23 +0200 Subject: [PATCH 19/62] Add method to check if an option was explicitly set or not. --- GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h | 6 ++++++ GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index 644cbdb584..fcb4e0706e 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -79,6 +79,12 @@ protected: std::for_each( begin( m_options ), end( m_options ), [&v]( const auto& item ) { v.emplace_back( item ); } ); return v; } + bool isSet( const std::string& key ) const override + { + const auto& item = find( key, false ); + return item != m_options.end() && item->second.isSet(); + } + void bind( const std::string& prefix, Gaudi::Details::PropertyBase* property ) override; void broadcast( const std::regex& filter, const std::string& value, OnlyDefaults defaults_only ) override; diff --git a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h index 82e0ab3392..fb179cd63b 100644 --- a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h +++ b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h @@ -47,6 +47,8 @@ namespace Gaudi virtual std::string pop( const std::string& key, const std::string& default_ = {} ) = 0; /// Test if an option key is availble in the catalog. virtual bool has( const std::string& key ) const = 0; + /// Test if an option key was explicitly set or not. + virtual bool isSet( const std::string& key ) const = 0; /// Return all known options with their values. virtual std::vector> items() const = 0; -- GitLab From 4f27e6b91d6506f53d81e135bbdc9738df55654b Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 4 Oct 2018 14:11:25 +0200 Subject: [PATCH 20/62] Add JobOptionsSvc unit tests --- GaudiCoreSvc/CMakeLists.txt | 5 +++ GaudiCoreSvc/tests/src/test_JOS.cpp | 59 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 GaudiCoreSvc/tests/src/test_JOS.cpp diff --git a/GaudiCoreSvc/CMakeLists.txt b/GaudiCoreSvc/CMakeLists.txt index bbb66f112a..ea6cc93c48 100644 --- a/GaudiCoreSvc/CMakeLists.txt +++ b/GaudiCoreSvc/CMakeLists.txt @@ -26,3 +26,8 @@ gaudi_add_module(GaudiCoreSvc src/AlgExecStateSvc/*.cpp LINK_LIBRARIES GaudiKernel Boost TBB PythonLibs ${extralibs} INCLUDE_DIRS TBB PythonLibs) + +gaudi_add_unit_test(test_JOS tests/src/test_JOS.cpp + LINK_LIBRARIES GaudiKernel TYPE Boost) + +add_dependencies(test_JOS GaudiCoreSvc) diff --git a/GaudiCoreSvc/tests/src/test_JOS.cpp b/GaudiCoreSvc/tests/src/test_JOS.cpp new file mode 100644 index 0000000000..4f4a477dcc --- /dev/null +++ b/GaudiCoreSvc/tests/src/test_JOS.cpp @@ -0,0 +1,59 @@ +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE test_JOS +#include + +#include +#include +#include +#include +#include + +#include + +#include + +BOOST_AUTO_TEST_CASE( JobOptionsSvc ) +{ + // Load required libraries (bypass PluginService) + { + System::ImageHandle handle; + System::loadDynamicLib( "libGaudiCoreSvc.so", &handle ); + } + + // == Begin Bootstrap + // Instantiate the application + auto app = Gaudi::createApplicationMgr(); + + SmartIF appProp{app}; + BOOST_REQUIRE( appProp ); + + // prevent reading of options file + appProp->setProperty( "JobOptionsType", "'NONE'" ).ignore(); + // prevent printout of ApplicationMgr banner + appProp->setProperty( "AppName", "''" ).ignore(); + appProp->setProperty( "OutputLevel", "6" ).ignore(); + + BOOST_REQUIRE( app->configure() ); + // == End Bootstrap + + auto& jos = Gaudi::svcLocator()->getOptsSvc(); + + BOOST_CHECK( jos.has( "ApplicationMgr.AppName" ) ); + BOOST_CHECK( !jos.isSet( "ApplicationMgr.AppName" ) ); + BOOST_CHECK( jos.get( "ApplicationMgr.AppName" ) == "''" ); + jos.set( "ApplicationMgr.AppName", "'test_JOS.exe'" ); + BOOST_CHECK( jos.has( "ApplicationMgr.AppName" ) ); + BOOST_CHECK( jos.isSet( "ApplicationMgr.AppName" ) ); + BOOST_CHECK( jos.get( "ApplicationMgr.AppName" ) == "'test_JOS.exe'" ); + + BOOST_CHECK( jos.items().size() == 92 ); + + BOOST_CHECK( !jos.has( "MyAlg.SomeOpt" ) ); + BOOST_CHECK( !jos.isSet( "MyAlg.SomeOpt" ) ); + jos.set( "MyAlg.SomeOpt", "42" ); + BOOST_CHECK( jos.has( "MyAlg.SomeOpt" ) ); + BOOST_CHECK( jos.isSet( "MyAlg.SomeOpt" ) ); + BOOST_CHECK( jos.get( "MyAlg.SomeOpt" ) == "42" ); + + BOOST_CHECK( jos.items().size() == 93 ); +} -- GitLab From 4ebb3f957edeaa31ec238caae12d45f01ba537ea Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 4 Oct 2018 14:34:33 +0200 Subject: [PATCH 21/62] Add filtering versions of IOptionsSvc::items --- GaudiCoreSvc/tests/src/test_JOS.cpp | 2 ++ GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/GaudiCoreSvc/tests/src/test_JOS.cpp b/GaudiCoreSvc/tests/src/test_JOS.cpp index 4f4a477dcc..b28e95873d 100644 --- a/GaudiCoreSvc/tests/src/test_JOS.cpp +++ b/GaudiCoreSvc/tests/src/test_JOS.cpp @@ -56,4 +56,6 @@ BOOST_AUTO_TEST_CASE( JobOptionsSvc ) BOOST_CHECK( jos.get( "MyAlg.SomeOpt" ) == "42" ); BOOST_CHECK( jos.items().size() == 93 ); + BOOST_CHECK( jos.items( [&jos]( const auto& p ) { return jos.isSet( std::get<0>( p ) ); } ).size() == 2 ); + BOOST_CHECK( jos.items( std::regex{".*Level"} ).size() == 5 ); } diff --git a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h index fb179cd63b..84ea789dc4 100644 --- a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h +++ b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h @@ -53,6 +53,22 @@ namespace Gaudi /// Return all known options with their values. virtual std::vector> items() const = 0; + template + std::vector> items( UnaryPredicate predicate ) const + { + auto v = this->items(); + v.erase( std::remove_if( begin( v ), end( v ), + [&predicate]( const auto& element ) { return !predicate( element ); } ), + v.end() ); + return v; + } + std::vector> items( const std::regex& filter ) const + { + std::smatch match; + return items( + [&filter, &match]( const auto& element ) { return regex_match( std::get<0>( element ), match, filter ); } ); + } + virtual void bind( const std::string& prefix, Gaudi::Details::PropertyBase* property ) = 0; using OnlyDefaults = Gaudi::tagged_bool; -- GitLab From 064316ed671c87f5ab4aa3464ec18e58cb453791 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 4 Oct 2018 17:54:13 +0200 Subject: [PATCH 22/62] Make IOptionsSvc inherit from IInterface --- GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h | 2 +- GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h | 7 ++++--- GaudiKernel/GaudiKernel/ISvcLocator.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index fcb4e0706e..500f01a3a8 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -21,7 +21,7 @@ namespace Gaudi } } -class JobOptionsSvc : public extends, virtual public Gaudi::Interfaces::IOptionsSvc +class JobOptionsSvc : public extends { public: typedef std::vector PropertiesT; diff --git a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h index 84ea789dc4..f76406c016 100644 --- a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h +++ b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -35,9 +36,9 @@ namespace Gaudi optsSvc.set("AlgInstanceName.Threshold", "2.345"); \endcode */ - class IOptionsSvc - { - public: + struct IOptionsSvc : virtual public IInterface { + DeclareInterfaceID( IOptionsSvc, 1, 0 ); + /// Set the value of an option, overriding the old value, if any. virtual void set( const std::string& key, const std::string& value ) = 0; /// Get the value of an options, returning the specified _default_ value if not found. diff --git a/GaudiKernel/GaudiKernel/ISvcLocator.h b/GaudiKernel/GaudiKernel/ISvcLocator.h index 0bb0fd6959..a7c4a7a1c0 100644 --- a/GaudiKernel/GaudiKernel/ISvcLocator.h +++ b/GaudiKernel/GaudiKernel/ISvcLocator.h @@ -17,7 +17,7 @@ namespace Gaudi { namespace Interfaces { - class IOptionsSvc; + struct IOptionsSvc; } } #define GAUDI_HAS_IOPTIONS_SVC -- GitLab From 07fc8405fc6a392c4d4564ccce45ae1e9830c091 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 4 Oct 2018 18:04:19 +0200 Subject: [PATCH 23/62] Update Doxygen documentation --- GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h | 28 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h index f76406c016..60c56ed95c 100644 --- a/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h +++ b/GaudiKernel/Gaudi/Interfaces/IOptionsSvc.h @@ -37,6 +37,7 @@ namespace Gaudi \endcode */ struct IOptionsSvc : virtual public IInterface { + /// InterfaceID declaration. DeclareInterfaceID( IOptionsSvc, 1, 0 ); /// Set the value of an option, overriding the old value, if any. @@ -46,14 +47,17 @@ namespace Gaudi /// Get the value of an options, removing it from the storage, returning the specified _default_ value if not /// found. virtual std::string pop( const std::string& key, const std::string& default_ = {} ) = 0; - /// Test if an option key is availble in the catalog. + /// %Test if an option key is availble in the catalog. virtual bool has( const std::string& key ) const = 0; - /// Test if an option key was explicitly set or not. + /// %Test if an option key was explicitly set or not. virtual bool isSet( const std::string& key ) const = 0; - /// Return all known options with their values. + /// @name Methods to query options. + /// These methods allow to extract the list of know options with their values. + /// @{ + /** Return all known options with their values. */ virtual std::vector> items() const = 0; - + /** Return all known options with their values for which `predicate` evaluates to true. */ template std::vector> items( UnaryPredicate predicate ) const { @@ -63,16 +67,32 @@ namespace Gaudi v.end() ); return v; } + /** Return all known options with their values for which the key matches the given regular expression. */ std::vector> items( const std::regex& filter ) const { std::smatch match; return items( [&filter, &match]( const auto& element ) { return regex_match( std::get<0>( element ), match, filter ); } ); } + /// @} + /// Register a Gaudi::Property instance to the option service. + /// + /// The option will be bound to the property with name `.`, and immediately + /// assigned the value set in the options service, if any. + /// + /// After the binding, setting a property value via IOptionsSvc::set will automatically set the value + /// of the Gaudi::Property instance, and IOptionsSvc::get will return the string representation of the + /// value of the Gaudi::Property instance. virtual void bind( const std::string& prefix, Gaudi::Details::PropertyBase* property ) = 0; using OnlyDefaults = Gaudi::tagged_bool; + + /// Broadcast version of IOptionsSvc::set. + /// + /// With IOptionsSvc::broadcast it is possible to assign one value to all known properties matching a + /// regular expression. By default, only default values are overridden, but explicitly assigned values + /// can also be overridden passing `OnlyDefaults{false}` as third argument to the method. virtual void broadcast( const std::regex& filter, const std::string& value, OnlyDefaults defaults = OnlyDefaults{true} ) = 0; -- GitLab From 982ebbebe59df33602a1d70214d660489f91b7f3 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Fri, 5 Oct 2018 10:27:23 +0200 Subject: [PATCH 24/62] Rename JobOptionsSvc::find to i_find to clarify it's not std::find --- GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp | 4 ++-- GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index e24a10ed75..4e3949d747 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -156,7 +156,7 @@ StatusCode JobOptionsSvc::setMyProperties( const std::string& client, IProperty* return fail ? StatusCode::FAILURE : StatusCode::SUCCESS; } -JobOptionsSvc::StorageType::const_iterator JobOptionsSvc::find( const std::string& key, bool warn ) const +JobOptionsSvc::StorageType::const_iterator JobOptionsSvc::i_find( const std::string& key, bool warn ) const { StorageType::const_iterator iter = m_options.find( key ); if ( iter == m_options.end() ) { // try case insensitive lookup @@ -252,7 +252,7 @@ void JobOptionsSvc::bind( const std::string& prefix, Gaudi::Details::PropertyBas } } - auto item = find( key, true ); + auto item = i_find( key, true ); if ( item != m_options.end() && key != item->first ) { // Storage is case insensitive, and I want to use the what the property dictates auto new_item = m_options.emplace( key, std::move( m_options.find( item->first )->second ) ); diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index 500f01a3a8..a4076c27dd 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -36,13 +36,13 @@ private: /// Find an option key in the options storage using case insensitive comparison. /// If the found key does not match the case of the requested one, a warning is printed. - StorageType::const_iterator find( const std::string& key, bool warn ) const; + StorageType::const_iterator i_find( const std::string& key, bool warn ) const; protected: /// @{ void set( const std::string& key, const std::string& value ) override { - auto item = find( key, true ); + auto item = i_find( key, true ); if ( item != m_options.end() && key != item->first ) { if ( !item->second.isBound() ) { // do not remove references to properties m_options.erase( item ); // Storage is case insensitive, and I want to use the latest version of the case @@ -57,21 +57,21 @@ protected: } std::string get( const std::string& key, const std::string& default_ = {} ) const override { - auto item = find( key, true ); + auto item = i_find( key, true ); return item != m_options.end() ? std::string{item->second} : default_; } std::string pop( const std::string& key, const std::string& default_ = {} ) override { std::string result = default_; - auto item = find( key, true ); + auto item = i_find( key, true ); if ( item != m_options.end() ) { result = std::move( item->second ); m_options.erase( item ); } return result; } - bool has( const std::string& key ) const override { return find( key, false ) != m_options.end(); } + bool has( const std::string& key ) const override { return i_find( key, false ) != m_options.end(); } std::vector> items() const override { std::vector> v; @@ -81,7 +81,7 @@ protected: } bool isSet( const std::string& key ) const override { - const auto& item = find( key, false ); + const auto& item = i_find( key, false ); return item != m_options.end() && item->second.isSet(); } -- GitLab From 03b882519d5b9929824a5428776b4ff45b688759 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Fri, 5 Oct 2018 23:11:34 +0200 Subject: [PATCH 25/62] Backward compatibility hack to hide changed behaviour of Property --- .../src/JobOptionsSvc/JobOptionsSvc.cpp | 9 ++- GaudiCoreSvc/tests/src/test_JOS.cpp | 73 ++++++++++++++----- GaudiKernel/GaudiKernel/Property.h | 3 + GaudiKernel/tests/src/test_Property.cpp | 19 +++++ GaudiPolicy/python/GaudiTesting/BaseTest.py | 2 + 5 files changed, 87 insertions(+), 19 deletions(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index 4e3949d747..bc948185a1 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -99,7 +99,14 @@ StatusCode JobOptionsSvc::stop() StatusCode JobOptionsSvc::addPropertyToCatalogue( const std::string& client, const Gaudi::Details::PropertyBase& property ) { - set( client + '.' + property.name(), property.toString() ); + if ( property.type_info() == &typeid( std::string ) ) { + // relatively convoluted way to strip unneeded quotes. + Gaudi::Property tmp; + tmp.assign( property ); + set( client + '.' + property.name(), tmp.value() ); + } else { + set( client + '.' + property.name(), property.toString() ); + } return StatusCode::SUCCESS; } // ============================================================================ diff --git a/GaudiCoreSvc/tests/src/test_JOS.cpp b/GaudiCoreSvc/tests/src/test_JOS.cpp index b28e95873d..b3a79995ea 100644 --- a/GaudiCoreSvc/tests/src/test_JOS.cpp +++ b/GaudiCoreSvc/tests/src/test_JOS.cpp @@ -4,37 +4,48 @@ #include #include +#include #include #include +#include #include #include #include -BOOST_AUTO_TEST_CASE( JobOptionsSvc ) -{ - // Load required libraries (bypass PluginService) +struct Fixture { + Fixture() { - System::ImageHandle handle; - System::loadDynamicLib( "libGaudiCoreSvc.so", &handle ); - } + // Load required libraries (bypass PluginService) + { + System::ImageHandle handle; + System::loadDynamicLib( "libGaudiCoreSvc.so", &handle ); + } - // == Begin Bootstrap - // Instantiate the application - auto app = Gaudi::createApplicationMgr(); + // == Begin Bootstrap + // Instantiate the application + auto app = Gaudi::createApplicationMgr(); - SmartIF appProp{app}; - BOOST_REQUIRE( appProp ); + SmartIF appProp{app}; + BOOST_REQUIRE( appProp ); - // prevent reading of options file - appProp->setProperty( "JobOptionsType", "'NONE'" ).ignore(); - // prevent printout of ApplicationMgr banner - appProp->setProperty( "AppName", "''" ).ignore(); - appProp->setProperty( "OutputLevel", "6" ).ignore(); + // prevent reading of options file + appProp->setProperty( "JobOptionsType", "'NONE'" ).ignore(); + // prevent printout of ApplicationMgr banner + appProp->setProperty( "AppName", "''" ).ignore(); + appProp->setProperty( "OutputLevel", "6" ).ignore(); + + BOOST_REQUIRE( app->configure() ); + // == End Bootstrap + } - BOOST_REQUIRE( app->configure() ); - // == End Bootstrap + ~Fixture() {} +}; + +BOOST_AUTO_TEST_CASE( JobOptionsSvc ) +{ + Fixture f; auto& jos = Gaudi::svcLocator()->getOptsSvc(); @@ -59,3 +70,29 @@ BOOST_AUTO_TEST_CASE( JobOptionsSvc ) BOOST_CHECK( jos.items( [&jos]( const auto& p ) { return jos.isSet( std::get<0>( p ) ); } ).size() == 2 ); BOOST_CHECK( jos.items( std::regex{".*Level"} ).size() == 5 ); } + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +BOOST_AUTO_TEST_CASE( BackwardCompatibility ) +{ + Fixture f; + + auto& jos_new = Gaudi::svcLocator()->getOptsSvc(); + auto jos = Gaudi::svcLocator()->service( "JobOptionsSvc" ).as(); + BOOST_REQUIRE( jos ); + + { + Gaudi::Property bp{true}; + std::string bpv = bp.toString(); + Gaudi::Property sp( "MeasureTime", bpv ); + jos->addPropertyToCatalogue( "SomeClient", sp ); + BOOST_CHECK( jos_new.get( "SomeClient.MeasureTime" ) == "True" ); + } + + { + jos_new.set( "Parent.SomeNumber", "42" ); + auto p = jos->getClientProperty( "Parent", "SomeNumber" ); + BOOST_REQUIRE( p ); + jos->addPropertyToCatalogue( "Parent.Child", *p ); + BOOST_CHECK( jos_new.get( "Parent.Child.SomeNumber" ) == "42" ); + } +} diff --git a/GaudiKernel/GaudiKernel/Property.h b/GaudiKernel/GaudiKernel/Property.h index e6781c2356..6628731fa0 100644 --- a/GaudiKernel/GaudiKernel/Property.h +++ b/GaudiKernel/GaudiKernel/Property.h @@ -830,6 +830,9 @@ namespace Gaudi ( std::is_same::value ) ? nullptr : dynamic_cast( &source ); if ( p ) { *this = p->value(); + } else if ( source.type_info() == &typeid( std::string ) ) { + auto s = dynamic_cast*>( &source ); + this->fromString( s->value() ).ignore(); } else { this->fromString( source.toString() ).ignore(); } diff --git a/GaudiKernel/tests/src/test_Property.cpp b/GaudiKernel/tests/src/test_Property.cpp index 477fc9db0b..b0c3c22d4a 100644 --- a/GaudiKernel/tests/src/test_Property.cpp +++ b/GaudiKernel/tests/src/test_Property.cpp @@ -198,4 +198,23 @@ BOOST_AUTO_TEST_CASE( backward_compatibility ) BOOST_CHECK( ip.updateCallBack() ); BOOST_CHECK( p->updateCallBack() ); } + + { + Gaudi::Property p{"OutputLevel", "6"}; + Gaudi::Property i; + i.assign( p ); + BOOST_CHECK( i.value() == 6 ); + } + { + Gaudi::Property p{"OutputLevel", 6}; + Gaudi::Property i; + i.assign( p ); + BOOST_CHECK( i.value() == 6 ); + } + { + Gaudi::Property p{"OutputLevel", "6"}; + Gaudi::Property i; + i.assign( p ); + BOOST_CHECK( i.value() == "6" ); + } } diff --git a/GaudiPolicy/python/GaudiTesting/BaseTest.py b/GaudiPolicy/python/GaudiTesting/BaseTest.py index 68f87334d0..5f2837a677 100644 --- a/GaudiPolicy/python/GaudiTesting/BaseTest.py +++ b/GaudiPolicy/python/GaudiTesting/BaseTest.py @@ -919,6 +919,8 @@ lineSkipper = LineSkipper(["//GP:", 'SIGXCPU', # Message removed with redesing of JobOptionsSvc 'ServiceLocatorHelper::service: found service JobOptionsSvc', + # Ignore warnings for properties case mismatch + 'mismatching case for property name:', ], regexps=[ r"^JobOptionsSvc INFO *$", r"^# ", # Ignore python comments -- GitLab From 7999777d6d79756e5a3cda636206f04037732bd2 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Mon, 8 Oct 2018 14:05:14 +0200 Subject: [PATCH 26/62] Postpone deprecation warnigns to Gaudi v32r0 schedule IJobOptionsSvc to be removed in Gaudi v33r0 --- GaudiKernel/Gaudi/Algorithm.h | 3 +- GaudiKernel/Gaudi/DeprecationHelpers.h | 10 +++++++ GaudiKernel/GaudiKernel/AlgTool.h | 3 +- GaudiKernel/GaudiKernel/Auditor.h | 3 +- GaudiKernel/GaudiKernel/IJobOptionsSvc.h | 35 ++++++++++++++++-------- GaudiKernel/GaudiKernel/JobHistory.h | 4 ++- GaudiKernel/GaudiKernel/Service.h | 3 +- 7 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 GaudiKernel/Gaudi/DeprecationHelpers.h diff --git a/GaudiKernel/Gaudi/Algorithm.h b/GaudiKernel/Gaudi/Algorithm.h index 652384e350..b9779041fa 100644 --- a/GaudiKernel/Gaudi/Algorithm.h +++ b/GaudiKernel/Gaudi/Algorithm.h @@ -32,6 +32,7 @@ #include "GaudiKernel/PropertyHolder.h" #include "GaudiKernel/System.h" #include "GaudiKernel/ToolHandle.h" +#include #include // For concurrency @@ -331,7 +332,7 @@ namespace Gaudi /// register for Algorithm Context Service? bool registerContext() const { return m_registerContext; } - GAUDI_DEPRECATED_SINCE_v30r5( "it should not be called explicitely" ) StatusCode setProperties() + GAUDI_DEPRECATED_SINCE_v32r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); diff --git a/GaudiKernel/Gaudi/DeprecationHelpers.h b/GaudiKernel/Gaudi/DeprecationHelpers.h new file mode 100644 index 0000000000..c5d5730216 --- /dev/null +++ b/GaudiKernel/Gaudi/DeprecationHelpers.h @@ -0,0 +1,10 @@ +#pragma once +/** @file Declaration of preprocessor macros to help schedule deprecations. */ + +#include + +#if GAUDI_VERSION >= CALC_GAUDI_VERSION( 32, 0 ) && GAUDI_MAJOR_VERSION < 999 +#define GAUDI_DEPRECATED_SINCE_v32r0( REASON ) [[deprecated( REASON )]] +#else +#define GAUDI_DEPRECATED_SINCE_v32r0( REASON ) +#endif diff --git a/GaudiKernel/GaudiKernel/AlgTool.h b/GaudiKernel/GaudiKernel/AlgTool.h index c07521c64e..37b715738d 100644 --- a/GaudiKernel/GaudiKernel/AlgTool.h +++ b/GaudiKernel/GaudiKernel/AlgTool.h @@ -16,6 +16,7 @@ #include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/PropertyHolder.h" #include "GaudiKernel/ToolHandle.h" +#include #include #include "GaudiKernel/DataHandle.h" @@ -118,7 +119,7 @@ public: /// The standard ToolSvc service, Return a pointer to the service if present IToolSvc* toolSvc() const; - [[deprecated( "it should not be called explicitely" )]] StatusCode setProperties() + GAUDI_DEPRECATED_SINCE_v32r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); diff --git a/GaudiKernel/GaudiKernel/Auditor.h b/GaudiKernel/GaudiKernel/Auditor.h index 5b7fe896f2..69e266a114 100644 --- a/GaudiKernel/GaudiKernel/Auditor.h +++ b/GaudiKernel/GaudiKernel/Auditor.h @@ -9,6 +9,7 @@ #include "GaudiKernel/ISvcLocator.h" /*used by service(..)*/ #include "GaudiKernel/PropertyFwd.h" #include "GaudiKernel/PropertyHolder.h" +#include #include #include #include @@ -121,7 +122,7 @@ public: return serviceLocator()->service( name, createIf ); } - [[deprecated( "it should not be called explicitely" )]] StatusCode setProperties() + GAUDI_DEPRECATED_SINCE_v32r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); diff --git a/GaudiKernel/GaudiKernel/IJobOptionsSvc.h b/GaudiKernel/GaudiKernel/IJobOptionsSvc.h index 77f77e98c0..35387ab6cd 100644 --- a/GaudiKernel/GaudiKernel/IJobOptionsSvc.h +++ b/GaudiKernel/GaudiKernel/IJobOptionsSvc.h @@ -1,9 +1,10 @@ #ifndef KERNEL_IJOBOPTIONSSVC_H #define KERNEL_IJOBOPTIONSSVC_H - // Include files #include "GaudiKernel/IInterface.h" #include "GaudiKernel/PropertyFwd.h" +#include + #include #include @@ -11,6 +12,14 @@ class StatusCode; class IProperty; +#if GAUDI_MAJOR_VERSION < 999 +#if GAUDI_VERSION >= CALC_GAUDI_VERSION( 33, 0 ) +#error "deprecated header: to be removed in v33r0" +#elif GAUDI_VERSION >= CALC_GAUDI_VERSION( 32, 0 ) +#warning "deprecated header: to be removed in v33r0" +#endif +#endif + /** @class IJobOptionsSvc IJobOptionsSvc.h GaudiKernel/IJobOptionsSvc.h Main interface for the JobOptions service @@ -27,24 +36,25 @@ public: @param client Name of the client algorithm or service @param me Address of the interface IProperty of the client */ - [[deprecated]] virtual StatusCode setMyProperties( const std::string& client, IProperty* me ) = 0; + GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual StatusCode + setMyProperties( const std::string& client, IProperty* me ) = 0; /// Add a property into the JobOptions catalog - [[deprecated]] virtual StatusCode addPropertyToCatalogue( const std::string& client, - const Gaudi::Details::PropertyBase& property ) = 0; + GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual StatusCode + addPropertyToCatalogue( const std::string& client, const Gaudi::Details::PropertyBase& property ) = 0; /// Remove a property from the JobOptions catalog - [[deprecated]] virtual StatusCode removePropertyFromCatalogue( const std::string& client, - const std::string& name ) = 0; + GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual StatusCode + removePropertyFromCatalogue( const std::string& client, const std::string& name ) = 0; /// Get the properties associated to a given client - [[deprecated]] virtual const std::vector* - getProperties( const std::string& client ) const = 0; + GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual const + std::vector* getProperties( const std::string& client ) const = 0; /// Get a property for a client - [[deprecated]] virtual const Gaudi::Details::PropertyBase* getClientProperty( const std::string& client, - const std::string& name ) const = 0; + GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual const + Gaudi::Details::PropertyBase* getClientProperty( const std::string& client, const std::string& name ) const = 0; /// Get the list of clients - [[deprecated]] virtual std::vector getClients() const = 0; + GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual std::vector getClients() const = 0; /** look for file 'File' into search path 'Path' * and read it to update existing JobOptionsCatalogue @@ -52,7 +62,8 @@ public: * @param Path search path * @return status code */ - [[deprecated]] virtual StatusCode readOptions( const std::string& file, const std::string& path = "" ) = 0; + GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual StatusCode + readOptions( const std::string& file, const std::string& path = "" ) = 0; }; #endif // KERNEL_IJOBOPTIONSSVC_H diff --git a/GaudiKernel/GaudiKernel/JobHistory.h b/GaudiKernel/GaudiKernel/JobHistory.h index f95b20dc37..a61bf4237b 100644 --- a/GaudiKernel/GaudiKernel/JobHistory.h +++ b/GaudiKernel/GaudiKernel/JobHistory.h @@ -5,6 +5,7 @@ #include "GaudiKernel/HistoryObj.h" #include "GaudiKernel/IVersHistoryObj.h" #include "GaudiKernel/Property.h" +#include #include #include @@ -58,7 +59,8 @@ public: // functions static const CLID& classID(); // add a global property - [[deprecated]] void addProperty( const std::string&, const Gaudi::Details::PropertyBase* ); + GAUDI_DEPRECATED_SINCE_v32r0( "use addProperty( string, string ) instead" ) void addProperty( + const std::string&, const Gaudi::Details::PropertyBase* ); void addProperty( const std::string& key, const std::string& value ); // Return the job history data. diff --git a/GaudiKernel/GaudiKernel/Service.h b/GaudiKernel/GaudiKernel/Service.h index 49e3f67bff..cdd4b05c11 100644 --- a/GaudiKernel/GaudiKernel/Service.h +++ b/GaudiKernel/GaudiKernel/Service.h @@ -14,6 +14,7 @@ #include "GaudiKernel/ServiceLocatorHelper.h" #include "GaudiKernel/SmartIF.h" #include "GaudiKernel/ToolHandle.h" +#include #include // ============================================================================ @@ -73,7 +74,7 @@ public: /** Retrieve pointer to service locator */ SmartIF& serviceLocator() const override; - [[deprecated( "it should not be called explicitely" )]] StatusCode setProperties() + GAUDI_DEPRECATED_SINCE_v32r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); -- GitLab From 98bf65b239bd70d9d77cd0d60ade41e03ed99ea3 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Wed, 10 Oct 2018 09:28:57 +0200 Subject: [PATCH 27/62] temporary! avoid c++gsl --- GaudiKernel/src/Lib/ISvcLocator.cpp | 6 ++++-- GaudiPython/python/GaudiPython/Bindings.py | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/GaudiKernel/src/Lib/ISvcLocator.cpp b/GaudiKernel/src/Lib/ISvcLocator.cpp index e6950eb1e5..5337d2f584 100644 --- a/GaudiKernel/src/Lib/ISvcLocator.cpp +++ b/GaudiKernel/src/Lib/ISvcLocator.cpp @@ -2,10 +2,12 @@ #include "Gaudi/Interfaces/IOptionsSvc.h" -#include +#include Gaudi::Interfaces::IOptionsSvc& ISvcLocator::getOptsSvc() { using namespace Gaudi::Interfaces; - return *gsl::not_null( dynamic_cast( service( "JobOptionsSvc" ).get() ) ); + auto p = dynamic_cast( service( "JobOptionsSvc" ).get() ); + if ( !p ) throw std::runtime_error( "cannot dynamic_cast JobOptionsSvc to IOptionsSvc*" ); + return *p; } diff --git a/GaudiPython/python/GaudiPython/Bindings.py b/GaudiPython/python/GaudiPython/Bindings.py index 4399f266e0..0dddfd84be 100644 --- a/GaudiPython/python/GaudiPython/Bindings.py +++ b/GaudiPython/python/GaudiPython/Bindings.py @@ -57,14 +57,15 @@ SUCCESS = gbl.StatusCode(gbl.StatusCode.SUCCESS, True) FAILURE = gbl.StatusCode(gbl.StatusCode.FAILURE, True) # Helper to create a StringProperty cppyy.gbl.gInterpreter.Declare(''' -#include +#include namespace GaudiPython { namespace Helpers { Gaudi::Property mkStringProperty(const std::string &name, const std::string &value) { return Gaudi::Property{name, value}; } void setProperty(ISvcLocator* svcLoc, std::string key, std::string value) { - gsl::not_null(svcLoc)->getOptsSvc().set(key, value); + if ( !svcLoc ) throw std::runtime_error( "invalid ISvcLocator pointer" ); + svcLoc->getOptsSvc().set(key, value); } }} ''') -- GitLab From 58fe39bd186b4d38aae7d692b1ca6e545a0bd571 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Fri, 19 Oct 2018 07:33:00 +0200 Subject: [PATCH 28/62] Minor fix to printout of TimelineSvc --- GaudiHive/src/TimelineSvc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GaudiHive/src/TimelineSvc.cpp b/GaudiHive/src/TimelineSvc.cpp index ab9fd58fff..3ed066361e 100644 --- a/GaudiHive/src/TimelineSvc.cpp +++ b/GaudiHive/src/TimelineSvc.cpp @@ -41,7 +41,7 @@ StatusCode TimelineSvc::finalize() if ( m_dumpTimeline && m_events.size() > 0 ) { MsgStream log( msgSvc(), name() ); - log << MSG::INFO << "Outputting timeline with " << m_events.size() << " entries to file " << m_timelineFile + log << MSG::INFO << "Outputting timeline with " << m_events.size() << " entries to file " << m_timelineFile.value() << endmsg; outputTimeline(); -- GitLab From 030228b6f8f373bb45817430fee57ad5d1eca2f3 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Tue, 5 Mar 2019 23:04:25 +0100 Subject: [PATCH 29/62] removed unused code --- GaudiPython/GaudiPython/Helpers.h | 5 ----- GaudiPython/python/GaudiPython/Bindings.py | 4 ---- 2 files changed, 9 deletions(-) diff --git a/GaudiPython/GaudiPython/Helpers.h b/GaudiPython/GaudiPython/Helpers.h index 3b54422c9c..6ad8025469 100644 --- a/GaudiPython/GaudiPython/Helpers.h +++ b/GaudiPython/GaudiPython/Helpers.h @@ -198,11 +198,6 @@ namespace GaudiPython { static T* toAddress( void* a ) { return (T*)a; } - - // FIXME: (MCl) workaround for ROOT-6028, ROOT-6054, ROOT-6073 - static StatusCode setPropertyFromString( Gaudi::Details::PropertyBase& p, const std::string& s ) { - return p.fromString( s ); - } }; template PyObject* Helper::toArray( int*, Py_ssize_t ); diff --git a/GaudiPython/python/GaudiPython/Bindings.py b/GaudiPython/python/GaudiPython/Bindings.py index f8dfe2b49d..3d63227835 100644 --- a/GaudiPython/python/GaudiPython/Bindings.py +++ b/GaudiPython/python/GaudiPython/Bindings.py @@ -59,10 +59,6 @@ FAILURE = gbl.StatusCode(gbl.StatusCode.FAILURE, True) cppyy.gbl.gInterpreter.Declare(''' #include namespace GaudiPython { namespace Helpers { - Gaudi::Property mkStringProperty(const std::string &name, - const std::string &value) { - return Gaudi::Property{name, value}; - } void setProperty(ISvcLocator* svcLoc, std::string key, std::string value) { if ( !svcLoc ) throw std::runtime_error( "invalid ISvcLocator pointer" ); svcLoc->getOptsSvc().set(key, value); -- GitLab From 78388ba769f24bac48b86c5760744993aa29c59e Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Wed, 6 Mar 2019 21:24:54 +0100 Subject: [PATCH 30/62] Distinguish between setProperty and setPropertyRepr - moved setProperty(name, value) from Propertyholder to IProperty - renamed setProperty(name, repr) to setPropertyRepr(name, repr) this is needed to be able to tell is a string is meant to be a value or the represenataion of a value --- GaudiAlg/src/lib/GaudiCommon.icpp | 2 +- .../src/JobOptionsSvc/JobOptionsSvc.cpp | 2 +- GaudiCoreSvc/tests/src/test_JOS.cpp | 8 ++- GaudiExamples/src/CounterEx/CounterAlg.cpp | 2 +- GaudiExamples/src/CounterEx/CounterNewAlg.cpp | 2 +- GaudiExamples/src/EvtColsEx/EvtColAlg.cpp | 18 +++--- .../ExtendedProperties/ExtendedProperties.cpp | 2 +- GaudiExamples/src/GPython/ScriptingMain.cpp | 2 +- GaudiExamples/src/Histograms/Aida2Root.cpp | 2 +- GaudiExamples/src/IO/ExtendedEvtCol.cpp | 18 +++--- GaudiExamples/src/IO/ReadAlg.cpp | 2 +- GaudiExamples/src/Properties/PropertyAlg.cpp | 8 +-- .../src/Properties/PropertyProxy.cpp | 2 +- GaudiKernel/GaudiKernel/IProperty.h | 40 +++++++++++- GaudiKernel/GaudiKernel/PropertyHolder.h | 64 ++++--------------- GaudiKernel/GaudiKernel/PropertyMgr.h | 2 +- GaudiKernel/src/Lib/Bootstrap.cpp | 2 +- GaudiKernel/src/Lib/GaudiMain.cpp | 2 +- GaudiKernel/src/Lib/Property.cpp | 6 +- GaudiKernel/src/Lib/PropertyMgr.cpp | 4 +- GaudiKernel/src/Util/genconf.cpp | 4 +- GaudiKernel/tests/src/test_PropertyHolder.cpp | 3 +- GaudiPython/GaudiPython/Algorithm.h | 4 +- GaudiPython/python/GaudiPython/Bindings.py | 2 +- 24 files changed, 100 insertions(+), 103 deletions(-) diff --git a/GaudiAlg/src/lib/GaudiCommon.icpp b/GaudiAlg/src/lib/GaudiCommon.icpp index 99084bff35..830eabc3ad 100644 --- a/GaudiAlg/src/lib/GaudiCommon.icpp +++ b/GaudiAlg/src/lib/GaudiCommon.icpp @@ -81,7 +81,7 @@ void GaudiCommon::initGaudiCommonConstructor( const IInterface* parent ) const auto& optsSvc = this->serviceLocator()->getOptsSvc(); for ( auto p : {"Context", "RootInTES"} ) { const std::string key = this->name() + '.' + p; - if ( optsSvc.has( key ) ) { this->setProperty( p, optsSvc.get( key ) ).ignore(); } + if ( optsSvc.has( key ) ) { this->setPropertyRepr( p, optsSvc.get( key ) ).ignore(); } } } //============================================================================= diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index ae7cae14d5..8878d7f4e4 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -138,7 +138,7 @@ StatusCode JobOptionsSvc::setMyProperties( const std::string& client, IProperty* // \fixme this has to change if we want nested properties // if ( myInt->hasProperty( name ) ) { if ( name.find( '.' ) == std::string::npos ) { - if ( !myInt->setProperty( name, elem.second ) ) { + if ( !myInt->setPropertyRepr( name, elem.second ) ) { error() << "Unable to set the property '" << name << "'" << " of '" << client << "'. " << "Check option and algorithm names, type and bounds." << endmsg; diff --git a/GaudiCoreSvc/tests/src/test_JOS.cpp b/GaudiCoreSvc/tests/src/test_JOS.cpp index 7752e37b71..2b91662b02 100644 --- a/GaudiCoreSvc/tests/src/test_JOS.cpp +++ b/GaudiCoreSvc/tests/src/test_JOS.cpp @@ -30,10 +30,10 @@ struct Fixture { BOOST_REQUIRE( appProp ); // prevent reading of options file - appProp->setProperty( "JobOptionsType", "'NONE'" ).ignore(); + appProp->setProperty( "JobOptionsType", "NONE" ).ignore(); // prevent printout of ApplicationMgr banner - appProp->setProperty( "AppName", "''" ).ignore(); - appProp->setProperty( "OutputLevel", "6" ).ignore(); + appProp->setPropertyRepr( "AppName", "''" ).ignore(); + appProp->setProperty( "OutputLevel", 6 ).ignore(); BOOST_REQUIRE( app->configure() ); // == End Bootstrap @@ -49,7 +49,9 @@ BOOST_AUTO_TEST_CASE( JobOptionsSvc ) { BOOST_CHECK( jos.has( "ApplicationMgr.AppName" ) ); BOOST_CHECK( !jos.isSet( "ApplicationMgr.AppName" ) ); + BOOST_CHECK( jos.get( "ApplicationMgr.JobOptionsType" ) == "'NONE'" ); BOOST_CHECK( jos.get( "ApplicationMgr.AppName" ) == "''" ); + BOOST_CHECK( jos.get( "ApplicationMgr.OutputLevel" ) == "6" ); jos.set( "ApplicationMgr.AppName", "'test_JOS.exe'" ); BOOST_CHECK( jos.has( "ApplicationMgr.AppName" ) ); BOOST_CHECK( jos.isSet( "ApplicationMgr.AppName" ) ); diff --git a/GaudiExamples/src/CounterEx/CounterAlg.cpp b/GaudiExamples/src/CounterEx/CounterAlg.cpp index 2c1dfd9401..4b423efa1c 100644 --- a/GaudiExamples/src/CounterEx/CounterAlg.cpp +++ b/GaudiExamples/src/CounterEx/CounterAlg.cpp @@ -47,7 +47,7 @@ public: * @param pSvc pointer to Service Locator */ CounterAlg( const std::string& name, ISvcLocator* pSvc ) : GaudiAlgorithm( name, pSvc ) { - setProperty( "StatPrint", "true" ).ignore(); + setProperty( "StatPrint", true ).ignore(); } // copy constructor is disabled diff --git a/GaudiExamples/src/CounterEx/CounterNewAlg.cpp b/GaudiExamples/src/CounterEx/CounterNewAlg.cpp index 142166cc18..8385f8720a 100644 --- a/GaudiExamples/src/CounterEx/CounterNewAlg.cpp +++ b/GaudiExamples/src/CounterEx/CounterNewAlg.cpp @@ -49,7 +49,7 @@ public: CounterNewAlg( const std::string& name, ISvcLocator* pSvc ) : Producer( name, pSvc, KeyValue( "OutputLocation", "dummy" ) ) { - setProperty( "StatPrint", "true" ).ignore(); + setProperty( "StatPrint", true ).ignore(); } private: diff --git a/GaudiExamples/src/EvtColsEx/EvtColAlg.cpp b/GaudiExamples/src/EvtColsEx/EvtColAlg.cpp index cfa7bf85cf..17c30c97ed 100644 --- a/GaudiExamples/src/EvtColsEx/EvtColAlg.cpp +++ b/GaudiExamples/src/EvtColsEx/EvtColAlg.cpp @@ -54,15 +54,15 @@ namespace Gaudi { */ EvtColAlg( const std::string& name, ISvcLocator* pSvc ) : GaudiTupleAlg( name, pSvc ) { /// redefine the default values for various properties - setProperty( "NTupleProduce", "false" ).ignore(); - setProperty( "NTuplePrint", "false" ).ignore(); - setProperty( "HistogramProduce", "false" ).ignore(); - setProperty( "HistogramPrint", "false" ).ignore(); - setProperty( "PropertiesPrint", "true" ).ignore(); - setProperty( "StatPrint", "true" ).ignore(); - setProperty( "TypePrint", "false" ).ignore(); - setProperty( "EvtColsProduce", "true" ).ignore(); - setProperty( "EvtColsPrint", "true" ).ignore(); + setProperty( "NTupleProduce", false ).ignore(); + setProperty( "NTuplePrint", false ).ignore(); + setProperty( "HistogramProduce", false ).ignore(); + setProperty( "HistogramPrint", false ).ignore(); + setProperty( "PropertiesPrint", true ).ignore(); + setProperty( "StatPrint", true ).ignore(); + setProperty( "TypePrint", false ).ignore(); + setProperty( "EvtColsProduce", true ).ignore(); + setProperty( "EvtColsPrint", true ).ignore(); } private: diff --git a/GaudiExamples/src/ExtendedProperties/ExtendedProperties.cpp b/GaudiExamples/src/ExtendedProperties/ExtendedProperties.cpp index 9a78daa889..9ad631b5a3 100644 --- a/GaudiExamples/src/ExtendedProperties/ExtendedProperties.cpp +++ b/GaudiExamples/src/ExtendedProperties/ExtendedProperties.cpp @@ -50,7 +50,7 @@ public: StatusCode execute() override; ExtendedProperties( const std::string& name, ISvcLocator* pSvc ) : GaudiAlgorithm( name, pSvc ) { - setProperty( "PropertiesPrint", "true" ).ignore(); + setProperty( "PropertiesPrint", true ).ignore(); m_20["key"] = "value"; m_21.value().push_back( 123 ); diff --git a/GaudiExamples/src/GPython/ScriptingMain.cpp b/GaudiExamples/src/GPython/ScriptingMain.cpp index eebba5b6bb..dc5d5782c4 100644 --- a/GaudiExamples/src/GPython/ScriptingMain.cpp +++ b/GaudiExamples/src/GPython/ScriptingMain.cpp @@ -25,7 +25,7 @@ int main( int argc, char** argv ) { propMgr->setProperty( "JobOptionsPath", opts ); if ( opts.compare( opts.length() - 3, 3, ".py" ) == 0 ) { propMgr->setProperty( "JobOptionsType", "NONE" ); - propMgr->setProperty( "DLLs", "['SIPython']" ); + propMgr->setPropertyRepr( "DLLs", "['SIPython']" ); propMgr->setProperty( "Runable", "PythonScriptingSvc" ); } diff --git a/GaudiExamples/src/Histograms/Aida2Root.cpp b/GaudiExamples/src/Histograms/Aida2Root.cpp index edffe6d037..e7751c1fab 100644 --- a/GaudiExamples/src/Histograms/Aida2Root.cpp +++ b/GaudiExamples/src/Histograms/Aida2Root.cpp @@ -50,7 +50,7 @@ public: public: // standard constructor Aida2Root( const std::string& name, ISvcLocator* pSvc ) : GaudiHistoAlg( name, pSvc ) { - setProperty( "PropertiesPrint", "True" ).ignore(); + setProperty( "PropertiesPrint", true ).ignore(); } private: diff --git a/GaudiExamples/src/IO/ExtendedEvtCol.cpp b/GaudiExamples/src/IO/ExtendedEvtCol.cpp index 3948f4397a..9d06741dbc 100644 --- a/GaudiExamples/src/IO/ExtendedEvtCol.cpp +++ b/GaudiExamples/src/IO/ExtendedEvtCol.cpp @@ -43,15 +43,15 @@ namespace Gaudi { */ ExtendedEvtCol( const std::string& name, ISvcLocator* pSvc ) : GaudiTupleAlg( name, pSvc ) { /// redefine the default values for various properties - setProperty( "NTupleProduce", "false" ).ignore(); - setProperty( "NTuplePrint", "false" ).ignore(); - setProperty( "HistogramProduce", "false" ).ignore(); - setProperty( "HistogramPrint", "false" ).ignore(); - setProperty( "PropertiesPrint", "true" ).ignore(); - setProperty( "StatPrint", "true" ).ignore(); - setProperty( "TypePrint", "false" ).ignore(); - setProperty( "EvtColsProduce", "true" ).ignore(); - setProperty( "EvtColsPrint", "true" ).ignore(); + setProperty( "NTupleProduce", false ).ignore(); + setProperty( "NTuplePrint", false ).ignore(); + setProperty( "HistogramProduce", false ).ignore(); + setProperty( "HistogramPrint", false ).ignore(); + setProperty( "PropertiesPrint", true ).ignore(); + setProperty( "StatPrint", true ).ignore(); + setProperty( "TypePrint", false ).ignore(); + setProperty( "EvtColsProduce", true ).ignore(); + setProperty( "EvtColsPrint", true ).ignore(); } private: diff --git a/GaudiExamples/src/IO/ReadAlg.cpp b/GaudiExamples/src/IO/ReadAlg.cpp index 152131ef62..9d5181df4a 100644 --- a/GaudiExamples/src/IO/ReadAlg.cpp +++ b/GaudiExamples/src/IO/ReadAlg.cpp @@ -43,7 +43,7 @@ StatusCode ReadAlg::initialize() { } if ( !m_incidentName.empty() ) { auto prp = m_recordSvc.as(); - setProperty( "IncidentName", prp->getProperty( "IncidentName" ) ); + setPropertyRepr( "IncidentName", prp->getProperty( "IncidentName" ).toString() ); m_incidentSvc = service( "IncidentSvc", true ); if ( !m_incidentSvc ) { error() << "Failed to access IncidentSvc." << endmsg; diff --git a/GaudiExamples/src/Properties/PropertyAlg.cpp b/GaudiExamples/src/Properties/PropertyAlg.cpp index ae321281d9..385d2fb410 100644 --- a/GaudiExamples/src/Properties/PropertyAlg.cpp +++ b/GaudiExamples/src/Properties/PropertyAlg.cpp @@ -180,14 +180,14 @@ StatusCode PropertyAlg::initialize() { appmgr->getProperty( "ExtSvc", value ).ignore(); info() << " Got property ApplicationMgr.ExtSvc = " << value << ";" << endmsg; - appmgr->setProperty( "ExtSvc", "[\"EvtDataSvc/EventDataSvc\", \"DetDataSvc/DetectorDataSvc\"]" ).ignore(); + appmgr->setPropertyRepr( "ExtSvc", "[\"EvtDataSvc/EventDataSvc\", \"DetDataSvc/DetectorDataSvc\"]" ).ignore(); info() << " Set property ApplicationMgr.ExtSvc = " << " [\"EvtDataSvc/EventDataSvc\", \"DetDataSvc/DetectorDataSvc\"]" << ";" << endmsg; appmgr->getProperty( "ExtSvc", value ).ignore(); info() << " Got property ApplicationMgr.ExtSvc = " << value << ";" << endmsg; - appmgr->setProperty( "ExtSvc", "[ 'EventDataSvc', 'DetectorDataSvc']" ).ignore(); + appmgr->setPropertyRepr( "ExtSvc", "[ 'EventDataSvc', 'DetectorDataSvc']" ).ignore(); info() << " Set property ApplicationMgr.ExtSvc = " << " [ 'EventDataSvc', 'DetectorDataSvc']" << ";" << endmsg; @@ -206,13 +206,13 @@ StatusCode PropertyAlg::initialize() { for ( auto& c : cases ) { p_bool = m_bool = !std::get<1>( c ); try { - sc = setProperty( "PBool", std::get<0>( c ) ); + sc = setPropertyRepr( "PBool", std::get<0>( c ) ); } catch ( ... ) { sc = StatusCode::FAILURE; } if ( !sc || ( p_bool != std::get<1>( c ) ) ) { error() << "PBool can not be set to " << std::get<0>( c ) << endmsg; } try { - sc = setProperty( "Bool", std::get<0>( c ) ); + sc = setPropertyRepr( "Bool", std::get<0>( c ) ); } catch ( ... ) { sc = StatusCode::FAILURE; } if ( !sc || ( m_bool != std::get<1>( c ) ) ) { error() << "Bool can not be set to " << std::get<0>( c ) << endmsg; } } diff --git a/GaudiExamples/src/Properties/PropertyProxy.cpp b/GaudiExamples/src/Properties/PropertyProxy.cpp index 7513e174eb..f9b9912e32 100644 --- a/GaudiExamples/src/Properties/PropertyProxy.cpp +++ b/GaudiExamples/src/Properties/PropertyProxy.cpp @@ -36,7 +36,7 @@ StatusCode PropertyProxy::initialize() { info() << " Got property this.RInt = " << value << ";" << endmsg; info() << " Set property this.RInt = 1001;" << endmsg; - if ( !this->setProperty( "RInt", "1001" ) ) { warning() << "failed to set property RInt" << endmsg; } + if ( !this->setProperty( "RInt", 1001 ) ) { warning() << "failed to set property RInt" << endmsg; } this->getProperty( "RInt", value ).ignore(); info() << " Got property this.RInt = " << value << ";" << endmsg; diff --git a/GaudiKernel/GaudiKernel/IProperty.h b/GaudiKernel/GaudiKernel/IProperty.h index 87526a6f28..8f33c82c3f 100644 --- a/GaudiKernel/GaudiKernel/IProperty.h +++ b/GaudiKernel/GaudiKernel/IProperty.h @@ -4,6 +4,7 @@ // Include Files #include "GaudiKernel/IInterface.h" #include "GaudiKernel/PropertyFwd.h" +#include "GaudiKernel/ToStream.h" #include #include #include @@ -20,15 +21,48 @@ class GAUDI_API IProperty : virtual public IInterface { public: /// InterfaceID - DeclareInterfaceID( IProperty, 2, 1 ); + DeclareInterfaceID( IProperty, 3, 0 ); /// Set the property by property virtual StatusCode setProperty( const Gaudi::Details::PropertyBase& p // Reference to the input property ) = 0; /// Set the property by string virtual StatusCode setProperty( const std::string& s ) = 0; - /// Set the property by std::string - virtual StatusCode setProperty( const std::string& n, const std::string& v ) = 0; + /// Set the property by name and value representation + virtual StatusCode setPropertyRepr( const std::string& n, const std::string& r ) = 0; + StatusCode setProperty( const std::string& n, const char* v ) { return setProperty( n, std::string{v} ); } + /** set the property form the value + * + * @code + * + * std::vector data = ... ; + * setProperty( "Data" , data ) ; + * + * std::map cuts = ... ; + * setProperty( "Cuts" , cuts ) ; + * + * std::map dict = ... ; + * setProperty( "Dictionary" , dict ) ; + * + * @endcode + * + * Note: the interface IProperty allows setting of the properties either + * directly from other properties or from strings only + * + * This is very convenient in resetting of the default + * properties in the derived classes. + * + * @param name name of the property + * @param value value of the property + * @see Gaudi::Utils::setProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + template + StatusCode setProperty( const std::string& name, const TYPE& value ) { + using Gaudi::Utils::toString; + return hasProperty( name ) ? setPropertyRepr( name, toString( value ) ) : StatusCode::FAILURE; + } /// Get the property by property virtual StatusCode getProperty( Gaudi::Details::PropertyBase* p // Pointer to property to be set ) const = 0; diff --git a/GaudiKernel/GaudiKernel/PropertyHolder.h b/GaudiKernel/GaudiKernel/PropertyHolder.h index a6b82e2e08..348bfb05dc 100644 --- a/GaudiKernel/GaudiKernel/PropertyHolder.h +++ b/GaudiKernel/GaudiKernel/PropertyHolder.h @@ -140,6 +140,7 @@ public: // ========================================================================== // IProperty implementation // ========================================================================== + using IProperty::setProperty; /** set the property form another property * @see IProperty */ @@ -159,63 +160,19 @@ public: std::string value; StatusCode sc = Gaudi::Parsers::parse( name, value, s ); if ( sc.isFailure() ) return sc; - return setProperty( name, value ); + return setPropertyRepr( name, value ); } // ========================================================================== - /** set the property from name and the value + /** set the property from name and value string representation * @see IProperty */ - StatusCode setProperty( const std::string& n, const std::string& v ) override { + StatusCode setPropertyRepr( const std::string& n, const std::string& r ) override { try { Gaudi::Details::PropertyBase* p = property( n ); - return ( p && p->fromString( v ) ) ? StatusCode::SUCCESS : StatusCode::FAILURE; + /// @fixme SUCCESS is not required to be checked for compatibility with Gaudi::Utils::setProperty + return ( p && p->fromString( r ) ) ? StatusCode{StatusCode::SUCCESS, true} : StatusCode::FAILURE; } catch ( ... ) { return StatusCode::FAILURE; } } - inline StatusCode setProperty( const std::string& n, const char* v ) { return setProperty( n, std::string{v} ); } - /** set the property form the value - * - * @code - * - * std::vector data = ... ; - * setProperty( "Data" , data ) ; - * - * std::map cuts = ... ; - * setProperty( "Cuts" , cuts ) ; - * - * std::map dict = ... ; - * setProperty( "Dictionary" , dict ) ; - * - * @endcode - * - * Note: the interface IProperty allows setting of the properties either - * directly from other properties or from strings only - * - * This is very convenient in resetting of the default - * properties in the derived classes. - * E.g. without this method one needs to convert - * everything into strings to use IProperty::setProperty - * - * @code - * - * setProperty ( "OutputLevel" , "1" ) ; - * setProperty ( "Enable" , "True" ) ; - * setProperty ( "ErrorMax" , "10" ) ; - * - * @endcode - * - * For simple cases it is more or less ok, but for complicated properties - * it is just ugly.. - * - * @param name name of the property - * @param value value of the property - * @see Gaudi::Utils::setProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - template - StatusCode setProperty( const std::string& name, const TYPE& value ) { - return Gaudi::Utils::setProperty( this, name, value ); - } // ========================================================================== /** get the property * @see IProperty @@ -258,9 +215,12 @@ public: * @see IProperty */ bool hasProperty( const std::string& name ) const override { - return any_of( begin( m_properties ), end( m_properties ), [&name]( const Gaudi::Details::PropertyBase* prop ) { - return Gaudi::Utils::iequal( prop->name(), name ); - } ); + return any_of( begin( m_properties ), end( m_properties ), + [&name]( const Gaudi::Details::PropertyBase* prop ) { + return Gaudi::Utils::iequal( prop->name(), name ); + } ) || + any_of( begin( m_remoteProperties ), end( m_remoteProperties ), + [&name]( const auto& prop ) { return Gaudi::Utils::iequal( prop.name, name ); } ); } // ========================================================================== /// \fixme property and bindPropertiesTo should be protected diff --git a/GaudiKernel/GaudiKernel/PropertyMgr.h b/GaudiKernel/GaudiKernel/PropertyMgr.h index 11e2e288cb..ef5b5f811a 100644 --- a/GaudiKernel/GaudiKernel/PropertyMgr.h +++ b/GaudiKernel/GaudiKernel/PropertyMgr.h @@ -85,7 +85,7 @@ public: /** set the property from name and the value * @see IProperty */ - StatusCode setProperty( const std::string& n, const std::string& v ) override; + StatusCode setPropertyRepr( const std::string& n, const std::string& v ) override; // ========================================================================== /** get the property * @see IProperty diff --git a/GaudiKernel/src/Lib/Bootstrap.cpp b/GaudiKernel/src/Lib/Bootstrap.cpp index b2bbebf19d..112c1c19d4 100644 --- a/GaudiKernel/src/Lib/Bootstrap.cpp +++ b/GaudiKernel/src/Lib/Bootstrap.cpp @@ -235,7 +235,7 @@ Gaudi::Interfaces::IOptionsSvc* PyHelper( getOptionsSvc )( IInterface* app ) { } bool PyHelper( setProperty )( IInterface* p, char* name, char* value ) { auto prop = SmartIF( p ); - return prop && prop->setProperty( name, value ).isSuccess(); + return prop && prop->setPropertyRepr( name, value ).isSuccess(); } const char* PyHelper( getProperty )( IInterface* p, char* name ) { auto prop = SmartIF( p ); diff --git a/GaudiKernel/src/Lib/GaudiMain.cpp b/GaudiKernel/src/Lib/GaudiMain.cpp index 2a1b12c777..ea958a6661 100644 --- a/GaudiKernel/src/Lib/GaudiMain.cpp +++ b/GaudiKernel/src/Lib/GaudiMain.cpp @@ -29,7 +29,7 @@ extern "C" GAUDI_API int GaudiMain( int argc, char** argv ) { if ( opts.compare( opts.length() - 3, 3, ".py" ) == 0 ) { propMgr->setProperty( "EvtSel", "NONE" ).ignore(); propMgr->setProperty( "JobOptionsType", "NONE" ).ignore(); - propMgr->setProperty( "DLLs", "['GaudiPython']" ).ignore(); + propMgr->setPropertyRepr( "DLLs", "['GaudiPython']" ).ignore(); propMgr->setProperty( "Runable", "PythonScriptingSvc" ).ignore(); } diff --git a/GaudiKernel/src/Lib/Property.cpp b/GaudiKernel/src/Lib/Property.cpp index b6b061329c..5c4a8590fc 100644 --- a/GaudiKernel/src/Lib/Property.cpp +++ b/GaudiKernel/src/Lib/Property.cpp @@ -95,7 +95,7 @@ bool Gaudi::Utils::hasProperty( const IInterface* p, const std::string& name ) { // ============================================================================ bool Gaudi::Utils::hasProperty( const IProperty* p, const std::string& name ) { // delegate the actual work to another method ; - return p && getProperty( p, name ); + return p && p->hasProperty( name ); } // ============================================================================ // @@ -340,8 +340,8 @@ StatusCode Gaudi::Utils::setProperty( IProperty* component, const std::string& n StatusCode Gaudi::Utils::setProperty( IProperty* component, const std::string& name, const std::string& value, const std::string& doc ) { if ( !component ) { return StatusCode::FAILURE; } // RETURN - if ( !hasProperty( component, name ) ) { return StatusCode::FAILURE; } - StatusCode sc = component->setProperty( name, value ); + if ( !component->hasProperty( name ) ) { return StatusCode::FAILURE; } + StatusCode sc = component->setPropertyRepr( name, value ); if ( !doc.empty() ) { PropertyBase* p = getProperty( component, name ); if ( p ) { p->setDocumentation( doc ); } diff --git a/GaudiKernel/src/Lib/PropertyMgr.cpp b/GaudiKernel/src/Lib/PropertyMgr.cpp index 6f71d270b5..2570f24700 100644 --- a/GaudiKernel/src/Lib/PropertyMgr.cpp +++ b/GaudiKernel/src/Lib/PropertyMgr.cpp @@ -141,14 +141,14 @@ StatusCode PropertyMgr::setProperty( const PropertyBase& p ) { StatusCode PropertyMgr::setProperty( const std::string& i ) { std::string name, value; StatusCode sc = Gaudi::Parsers::parse( name, value, i ); - return sc.isFailure() ? sc : setProperty( name, value ); + return sc.isFailure() ? sc : setPropertyRepr( name, value ); } // ===================================================================== /* set a property from the string * Implementation of IProperty::setProperty */ // ===================================================================== -StatusCode PropertyMgr::setProperty( const std::string& n, const std::string& v ) { +StatusCode PropertyMgr::setPropertyRepr( const std::string& n, const std::string& v ) { PropertyBase* p = property( n ); return ( p && p->fromString( v ) ) ? StatusCode::SUCCESS : StatusCode::FAILURE; } diff --git a/GaudiKernel/src/Util/genconf.cpp b/GaudiKernel/src/Util/genconf.cpp index 0f67361c5c..fdf2e8bb91 100644 --- a/GaudiKernel/src/Util/genconf.cpp +++ b/GaudiKernel/src/Util/genconf.cpp @@ -785,10 +785,10 @@ int createAppMgr() propMgr->setProperty( "JobOptionsType", "NONE" ); // No job options propMgr->setProperty( "AppName", "" ); // No initial printout message - propMgr->setProperty( "OutputLevel", "7" ); // No other printout messages + propMgr->setProperty( "OutputLevel", 7 ); // No other printout messages appUI->configure(); auto msgSvc = SmartIF{iface}.as(); - msgSvc->setProperty( "setWarning", "['DefaultName', 'PropertyHolder']" ); + msgSvc->setPropertyRepr( "setWarning", "['DefaultName', 'PropertyHolder']" ); msgSvc->setProperty( "Format", "%T %0W%M" ); return EXIT_SUCCESS; } diff --git a/GaudiKernel/tests/src/test_PropertyHolder.cpp b/GaudiKernel/tests/src/test_PropertyHolder.cpp index 0a511fe3b6..1fecfbded3 100644 --- a/GaudiKernel/tests/src/test_PropertyHolder.cpp +++ b/GaudiKernel/tests/src/test_PropertyHolder.cpp @@ -43,8 +43,9 @@ BOOST_AUTO_TEST_CASE( backward_compatibility ) { AnonymousPropertyHolder mgr; Gaudi::Property> vp{&mgr, "name", {}}; - Gaudi::Utils::setProperty( &mgr, "name", std::vector{{"All"}} ); + auto sc = Gaudi::Utils::setProperty( &mgr, "name", std::vector{{"All"}} ); + BOOST_CHECK( sc.isSuccess() ); BOOST_CHECK( vp == std::vector{{"All"}} ); } } diff --git a/GaudiPython/GaudiPython/Algorithm.h b/GaudiPython/GaudiPython/Algorithm.h index ec2bf03c41..2a88b4107b 100644 --- a/GaudiPython/GaudiPython/Algorithm.h +++ b/GaudiPython/GaudiPython/Algorithm.h @@ -66,8 +66,8 @@ namespace GaudiPython { */ PyAlg( PyObject* self, const std::string& name ) : ALGORITHM( name, Gaudi::svcLocator() ), m_self( self ) { // the printout of actual type for embedded algorithm has no sense - this->setProperty( "TypePrint", "false" ); - this->setProperty( "StatPrint", "true" ); + this->setProperty( "TypePrint", false ); + this->setProperty( "StatPrint", true ); // The owner of the Algorithm is Python (as creator) therefore // it should not be deleted by Gaudi (added an extra addRef()). this->addRef(); diff --git a/GaudiPython/python/GaudiPython/Bindings.py b/GaudiPython/python/GaudiPython/Bindings.py index 3d63227835..57487ba8f3 100644 --- a/GaudiPython/python/GaudiPython/Bindings.py +++ b/GaudiPython/python/GaudiPython/Bindings.py @@ -279,7 +279,7 @@ class iProperty(object): if ip: if not gbl.Gaudi.Utils.hasProperty(ip, name): raise AttributeError, 'property %s does not exist' % name - ip.setProperty(name, value) + ip.setPropertyRepr(name, value) else: gbl.GaudiPython.Helpers.setProperty(self._svcloc, '.'.join( [self._name, name]), value) -- GitLab From 1f16cdfc3da6c5cc8aa9de42b4b21e2c4b0dc350 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Sun, 26 May 2019 11:46:16 +0200 Subject: [PATCH 31/62] Make report of unused properties optional --- .../src/JobOptionsSvc/JobOptionsSvc.cpp | 22 ++++++++++--------- .../src/JobOptionsSvc/JobOptionsSvc.h | 2 ++ GaudiCoreSvc/tests/src/test_JOS.cpp | 4 ++-- .../tests/qmtest/refs/MetaDataSvc.ref | 5 +++-- .../tests/qmtest/refs/Properties.ref | 1 + .../tests/qmtest/refs/Properties2.ref | 1 + .../tests/qmtest/refs/Properties_py.ref | 1 + 7 files changed, 22 insertions(+), 14 deletions(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index 8878d7f4e4..2672ccf09c 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -71,18 +71,20 @@ StatusCode JobOptionsSvc::initialize() { return sc; } StatusCode JobOptionsSvc::stop() { - std::vector unused; - unused.reserve( m_options.size() ); + if ( m_reportUnused ) { + std::vector unused; + unused.reserve( m_options.size() ); - for ( const auto& p : m_options ) { - if ( !p.second.isBound() ) unused.emplace_back( p.first ); - } + for ( const auto& p : m_options ) { + if ( !p.second.isBound() ) unused.emplace_back( p.first ); + } - if ( !unused.empty() ) { - auto& log = warning(); - log << unused.size() << " unused properties:"; - for ( const auto& k : unused ) log << "\n - " << k; - log << endmsg; + if ( !unused.empty() ) { + auto& log = warning(); + log << unused.size() << " unused properties:"; + for ( const auto& k : unused ) log << "\n - " << k; + log << endmsg; + } } return Service::stop(); } diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index d1e705e1b1..136612455b 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -143,6 +143,8 @@ private: Gaudi::Property>> m_globalDefaultsProp{ this, "GlobalDefaults", {}, "Allow definition of global defaults for properties as list of pairs (regex, value)"}; + Gaudi::Property m_reportUnused{this, "ReportUnused", false, "Print report of properties set, but not used"}; + std::vector> m_globalDefaults; }; #endif /* JOBOPTIONSSVC_H_ */ diff --git a/GaudiCoreSvc/tests/src/test_JOS.cpp b/GaudiCoreSvc/tests/src/test_JOS.cpp index 50cf7a0852..a6f7fcdcd1 100644 --- a/GaudiCoreSvc/tests/src/test_JOS.cpp +++ b/GaudiCoreSvc/tests/src/test_JOS.cpp @@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE( JobOptionsSvc ) { BOOST_CHECK( jos.isSet( "ApplicationMgr.AppName" ) ); BOOST_CHECK( jos.get( "ApplicationMgr.AppName" ) == "'test_JOS.exe'" ); - BOOST_CHECK( jos.items().size() == 93 ); + BOOST_CHECK( jos.items().size() == 94 ); BOOST_CHECK( !jos.has( "MyAlg.SomeOpt" ) ); BOOST_CHECK( !jos.isSet( "MyAlg.SomeOpt" ) ); @@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE( JobOptionsSvc ) { BOOST_CHECK( jos.isSet( "MyAlg.SomeOpt" ) ); BOOST_CHECK( jos.get( "MyAlg.SomeOpt" ) == "42" ); - BOOST_CHECK( jos.items().size() == 94 ); + BOOST_CHECK( jos.items().size() == 95 ); BOOST_CHECK( jos.items( [&jos]( const auto& p ) { return jos.isSet( std::get<0>( p ) ); } ).size() == 2 ); BOOST_CHECK( jos.items( std::regex{".*Level"} ).size() == 5 ); } diff --git a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref index 494ee21b8a..a339d135fd 100644 --- a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref +++ b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref @@ -3,8 +3,8 @@ # <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/TupleEx.py' ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v30r3) - running on pclhcb117 on Tue Sep 18 16:59:46 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v32r0) + running on marco-XPS-13 on Sun May 26 11:41:28 2019 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully RndmGenSvc.Engine INFO Generator engine type:CLHEP::RanluxEngine @@ -188,6 +188,7 @@ JobOptionsSvc.OutputLevel:3 JobOptionsSvc.PATH:'../options/job.opts' JobOptionsSvc.PYTHONACTION:'' JobOptionsSvc.PYTHONPARAMS:'' +JobOptionsSvc.ReportUnused:False JobOptionsSvc.SEARCHPATH:'/home/marco/Devel/workspace/Gaudi/GaudiExamples/tests/qmtest:/home/marco/Devel/workspace/Gaudi/GaudiExamples/options' JobOptionsSvc.TYPE:'NONE' MessageSvc.AuditFinalize:False diff --git a/GaudiExamples/tests/qmtest/refs/Properties.ref b/GaudiExamples/tests/qmtest/refs/Properties.ref index 51b51169b0..81d9de47b0 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties.ref @@ -291,6 +291,7 @@ JobOptionsSvc.OutputLevel: 3 JobOptionsSvc.PATH: '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Properties.opts' JobOptionsSvc.PYTHONACTION: '' JobOptionsSvc.PYTHONPARAMS: '' +JobOptionsSvc.ReportUnused: False JobOptionsSvc.SEARCHPATH: '/home/marco/Devel/workspace/Gaudi/GaudiExamples/tests/qmtest:/home/marco/Devel/workspace/Gaudi/GaudiExamples/options' JobOptionsSvc.TYPE: 'FILE' MessageSvc.AuditFinalize: False diff --git a/GaudiExamples/tests/qmtest/refs/Properties2.ref b/GaudiExamples/tests/qmtest/refs/Properties2.ref index ddced760a2..181d8c9cd7 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties2.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties2.ref @@ -293,6 +293,7 @@ JobOptionsSvc.OutputLevel: 3 JobOptionsSvc.PATH: '../options/job.opts' JobOptionsSvc.PYTHONACTION: '' JobOptionsSvc.PYTHONPARAMS: '' +JobOptionsSvc.ReportUnused: False JobOptionsSvc.SEARCHPATH: '/home/marco/Devel/workspace/Gaudi/GaudiExamples/tests/qmtest:/home/marco/Devel/workspace/Gaudi/GaudiExamples/options' JobOptionsSvc.TYPE: 'NONE' MessageSvc.AuditFinalize: False diff --git a/GaudiExamples/tests/qmtest/refs/Properties_py.ref b/GaudiExamples/tests/qmtest/refs/Properties_py.ref index fdaa09672e..24661193e4 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties_py.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties_py.ref @@ -253,6 +253,7 @@ JobOptionsSvc.OutputLevel: 3 JobOptionsSvc.PATH: '../options/job.opts' JobOptionsSvc.PYTHONACTION: '' JobOptionsSvc.PYTHONPARAMS: '' +JobOptionsSvc.ReportUnused: False JobOptionsSvc.SEARCHPATH: '/home/marco/Devel/workspace/Gaudi/GaudiExamples/tests/qmtest:/home/marco/Devel/workspace/Gaudi/GaudiExamples/options' JobOptionsSvc.TYPE: 'NONE' MessageSvc.AuditFinalize: False -- GitLab From a132b3df8ba0c47cb4aafd40c1f49e40f6fdc983 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Mon, 27 May 2019 13:09:16 +0200 Subject: [PATCH 32/62] Update IJobOptionsSvc deprecation warnings --- GaudiKernel/Gaudi/Algorithm.h | 2 +- GaudiKernel/Gaudi/DeprecationHelpers.h | 6 +++--- GaudiKernel/GaudiKernel/AlgTool.h | 2 +- GaudiKernel/GaudiKernel/Auditor.h | 2 +- GaudiKernel/GaudiKernel/IJobOptionsSvc.h | 18 +++++++++--------- GaudiKernel/GaudiKernel/JobHistory.h | 2 +- GaudiKernel/GaudiKernel/Service.h | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/GaudiKernel/Gaudi/Algorithm.h b/GaudiKernel/Gaudi/Algorithm.h index 8db71fcb5d..e5c7df8254 100644 --- a/GaudiKernel/Gaudi/Algorithm.h +++ b/GaudiKernel/Gaudi/Algorithm.h @@ -322,7 +322,7 @@ namespace Gaudi { /// register for Algorithm Context Service? bool registerContext() const { return m_registerContext; } - GAUDI_DEPRECATED_SINCE_v32r0( "it should not be called explicitely" ) StatusCode setProperties() { + GAUDI_DEPRECATED_SINCE_v33r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; diff --git a/GaudiKernel/Gaudi/DeprecationHelpers.h b/GaudiKernel/Gaudi/DeprecationHelpers.h index ae43e1857b..60b047f5b2 100644 --- a/GaudiKernel/Gaudi/DeprecationHelpers.h +++ b/GaudiKernel/Gaudi/DeprecationHelpers.h @@ -3,8 +3,8 @@ #include -#if GAUDI_VERSION >= CALC_GAUDI_VERSION( 32, 0 ) && GAUDI_MAJOR_VERSION < 999 -# define GAUDI_DEPRECATED_SINCE_v32r0( REASON ) [[deprecated( REASON )]] +#if GAUDI_VERSION >= CALC_GAUDI_VERSION( 33, 0 ) && GAUDI_MAJOR_VERSION < 999 +# define GAUDI_DEPRECATED_SINCE_v33r0( REASON ) [[deprecated( REASON )]] #else -# define GAUDI_DEPRECATED_SINCE_v32r0( REASON ) +# define GAUDI_DEPRECATED_SINCE_v33r0( REASON ) #endif diff --git a/GaudiKernel/GaudiKernel/AlgTool.h b/GaudiKernel/GaudiKernel/AlgTool.h index 5bd24330df..e66fa4cabd 100644 --- a/GaudiKernel/GaudiKernel/AlgTool.h +++ b/GaudiKernel/GaudiKernel/AlgTool.h @@ -118,7 +118,7 @@ public: /// The standard ToolSvc service, Return a pointer to the service if present IToolSvc* toolSvc() const; - GAUDI_DEPRECATED_SINCE_v32r0( "it should not be called explicitely" ) StatusCode setProperties() { + GAUDI_DEPRECATED_SINCE_v33r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; diff --git a/GaudiKernel/GaudiKernel/Auditor.h b/GaudiKernel/GaudiKernel/Auditor.h index fb23a770b3..7c8924f0a5 100644 --- a/GaudiKernel/GaudiKernel/Auditor.h +++ b/GaudiKernel/GaudiKernel/Auditor.h @@ -119,7 +119,7 @@ public: return serviceLocator()->service( name, createIf ); } - GAUDI_DEPRECATED_SINCE_v32r0( "it should not be called explicitely" ) StatusCode setProperties() { + GAUDI_DEPRECATED_SINCE_v33r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; diff --git a/GaudiKernel/GaudiKernel/IJobOptionsSvc.h b/GaudiKernel/GaudiKernel/IJobOptionsSvc.h index 712fff29db..03e11c75b7 100644 --- a/GaudiKernel/GaudiKernel/IJobOptionsSvc.h +++ b/GaudiKernel/GaudiKernel/IJobOptionsSvc.h @@ -14,9 +14,9 @@ class IProperty; #if GAUDI_MAJOR_VERSION < 999 # if GAUDI_VERSION >= CALC_GAUDI_VERSION( 34, 0 ) -# error "deprecated header: to be removed in v33r0" +# error "deprecated header: to be removed in v34r0" # elif GAUDI_VERSION >= CALC_GAUDI_VERSION( 33, 0 ) -# warning "deprecated header: to be removed in v33r0" +# warning "deprecated header: to be removed in v34r0" # endif #endif @@ -35,25 +35,25 @@ public: @param client Name of the client algorithm or service @param me Address of the interface IProperty of the client */ - GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual StatusCode + GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual StatusCode setMyProperties( const std::string& client, IProperty* me ) = 0; /// Add a property into the JobOptions catalog - GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual StatusCode + GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual StatusCode addPropertyToCatalogue( const std::string& client, const Gaudi::Details::PropertyBase& property ) = 0; /// Remove a property from the JobOptions catalog - GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual StatusCode + GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual StatusCode removePropertyFromCatalogue( const std::string& client, const std::string& name ) = 0; /// Get the properties associated to a given client - GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual const + GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual const std::vector* getProperties( const std::string& client ) const = 0; /// Get a property for a client - GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual const + GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual const Gaudi::Details::PropertyBase* getClientProperty( const std::string& client, const std::string& name ) const = 0; /// Get the list of clients - GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual std::vector getClients() const = 0; + GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual std::vector getClients() const = 0; /** look for file 'File' into search path 'Path' * and read it to update existing JobOptionsCatalogue @@ -61,7 +61,7 @@ public: * @param Path search path * @return status code */ - GAUDI_DEPRECATED_SINCE_v32r0( "will be removed in v33r0" ) virtual StatusCode + GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual StatusCode readOptions( const std::string& file, const std::string& path = "" ) = 0; }; diff --git a/GaudiKernel/GaudiKernel/JobHistory.h b/GaudiKernel/GaudiKernel/JobHistory.h index e1c65b5c0a..e8fdc89b3d 100644 --- a/GaudiKernel/GaudiKernel/JobHistory.h +++ b/GaudiKernel/GaudiKernel/JobHistory.h @@ -58,7 +58,7 @@ public: // functions static const CLID& classID(); // add a global property - GAUDI_DEPRECATED_SINCE_v32r0( "use addProperty( string, string ) instead" ) void addProperty( + GAUDI_DEPRECATED_SINCE_v33r0( "use addProperty( string, string ) instead" ) void addProperty( const std::string&, const Gaudi::Details::PropertyBase* ); void addProperty( const std::string& key, const std::string& value ); diff --git a/GaudiKernel/GaudiKernel/Service.h b/GaudiKernel/GaudiKernel/Service.h index 872c53c2b0..b69e22a7df 100644 --- a/GaudiKernel/GaudiKernel/Service.h +++ b/GaudiKernel/GaudiKernel/Service.h @@ -73,7 +73,7 @@ public: /** Retrieve pointer to service locator */ SmartIF& serviceLocator() const override; - GAUDI_DEPRECATED_SINCE_v32r0( "it should not be called explicitely" ) StatusCode setProperties() { + GAUDI_DEPRECATED_SINCE_v33r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; -- GitLab From fad7e1d1c704e546188f5aeb9ae086b3b19048b6 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 30 May 2019 22:51:08 +0200 Subject: [PATCH 33/62] Let parse exceptions propagate from setProperty --- GaudiExamples/src/testing/TestAppMgrStateMachine.cpp | 2 +- GaudiKernel/GaudiKernel/PropertyHolder.h | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/GaudiExamples/src/testing/TestAppMgrStateMachine.cpp b/GaudiExamples/src/testing/TestAppMgrStateMachine.cpp index 5c4a46e98e..27b74889f8 100644 --- a/GaudiExamples/src/testing/TestAppMgrStateMachine.cpp +++ b/GaudiExamples/src/testing/TestAppMgrStateMachine.cpp @@ -20,7 +20,7 @@ int main() { } propMgr->setProperty( "JobOptionsType", "NONE" ).ignore(); - propMgr->setProperty( "EvtMax", "1" ).ignore(); + propMgr->setProperty( "EvtMax", 1 ).ignore(); CHECK( appMgr->configure() ); CHECK( appMgr->initialize() ); diff --git a/GaudiKernel/GaudiKernel/PropertyHolder.h b/GaudiKernel/GaudiKernel/PropertyHolder.h index 348bfb05dc..723e939257 100644 --- a/GaudiKernel/GaudiKernel/PropertyHolder.h +++ b/GaudiKernel/GaudiKernel/PropertyHolder.h @@ -146,9 +146,7 @@ public: */ StatusCode setProperty( const Gaudi::Details::PropertyBase& p ) override { Gaudi::Details::PropertyBase* pp = property( p.name() ); - try { - if ( pp && pp->assign( p ) ) return StatusCode::SUCCESS; - } catch ( ... ) {} + if ( pp && pp->assign( p ) ) return StatusCode::SUCCESS; return StatusCode::FAILURE; } // ========================================================================== @@ -167,11 +165,9 @@ public: * @see IProperty */ StatusCode setPropertyRepr( const std::string& n, const std::string& r ) override { - try { - Gaudi::Details::PropertyBase* p = property( n ); - /// @fixme SUCCESS is not required to be checked for compatibility with Gaudi::Utils::setProperty - return ( p && p->fromString( r ) ) ? StatusCode{StatusCode::SUCCESS, true} : StatusCode::FAILURE; - } catch ( ... ) { return StatusCode::FAILURE; } + Gaudi::Details::PropertyBase* p = property( n ); + /// @fixme SUCCESS is not required to be checked for compatibility with Gaudi::Utils::setProperty + return ( p && p->fromString( r ) ) ? StatusCode{StatusCode::SUCCESS, true} : StatusCode{StatusCode::FAILURE, true}; } // ========================================================================== /** get the property -- GitLab From 16b89ff9e5d3bdcc8f7c9dae90fb893ac8ff984e Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Fri, 31 May 2019 16:55:36 +0200 Subject: [PATCH 34/62] Add IProperty::setProperty from name and PropertyBase --- GaudiKernel/GaudiKernel/IProperty.h | 11 ++++++----- GaudiKernel/GaudiKernel/PropertyHolder.h | 6 +++--- GaudiKernel/GaudiKernel/PropertyMgr.h | 2 +- GaudiKernel/src/Lib/PropertyMgr.cpp | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/GaudiKernel/GaudiKernel/IProperty.h b/GaudiKernel/GaudiKernel/IProperty.h index 8f33c82c3f..c2cbf355fd 100644 --- a/GaudiKernel/GaudiKernel/IProperty.h +++ b/GaudiKernel/GaudiKernel/IProperty.h @@ -3,7 +3,7 @@ // Include Files #include "GaudiKernel/IInterface.h" -#include "GaudiKernel/PropertyFwd.h" +#include "GaudiKernel/Property.h" #include "GaudiKernel/ToStream.h" #include #include @@ -23,9 +23,10 @@ public: /// InterfaceID DeclareInterfaceID( IProperty, 3, 0 ); - /// Set the property by property - virtual StatusCode setProperty( const Gaudi::Details::PropertyBase& p // Reference to the input property - ) = 0; + /// Set the property from a property + StatusCode setProperty( const Gaudi::Details::PropertyBase& p ) { return setProperty( p.name(), p ); } + /// Set the property from a property with a different name + virtual StatusCode setProperty( const std::string& name, const Gaudi::Details::PropertyBase& p ) = 0; /// Set the property by string virtual StatusCode setProperty( const std::string& s ) = 0; /// Set the property by name and value representation @@ -58,7 +59,7 @@ public: * @author Vanya BELYAEV ibelyaev@physics.syr.edu * @date 2007-05-13 */ - template + template >> StatusCode setProperty( const std::string& name, const TYPE& value ) { using Gaudi::Utils::toString; return hasProperty( name ) ? setPropertyRepr( name, toString( value ) ) : StatusCode::FAILURE; diff --git a/GaudiKernel/GaudiKernel/PropertyHolder.h b/GaudiKernel/GaudiKernel/PropertyHolder.h index 723e939257..6a20d9811f 100644 --- a/GaudiKernel/GaudiKernel/PropertyHolder.h +++ b/GaudiKernel/GaudiKernel/PropertyHolder.h @@ -141,11 +141,11 @@ public: // IProperty implementation // ========================================================================== using IProperty::setProperty; - /** set the property form another property + /** set the property from another property with a different name * @see IProperty */ - StatusCode setProperty( const Gaudi::Details::PropertyBase& p ) override { - Gaudi::Details::PropertyBase* pp = property( p.name() ); + StatusCode setProperty( const std::string& name, const Gaudi::Details::PropertyBase& p ) override { + Gaudi::Details::PropertyBase* pp = property( name ); if ( pp && pp->assign( p ) ) return StatusCode::SUCCESS; return StatusCode::FAILURE; } diff --git a/GaudiKernel/GaudiKernel/PropertyMgr.h b/GaudiKernel/GaudiKernel/PropertyMgr.h index ef5b5f811a..1b577fb47c 100644 --- a/GaudiKernel/GaudiKernel/PropertyMgr.h +++ b/GaudiKernel/GaudiKernel/PropertyMgr.h @@ -75,7 +75,7 @@ public: /** set the property form another property * @see IProperty */ - StatusCode setProperty( const Gaudi::Details::PropertyBase& p ) override; + StatusCode setProperty( const std::string& name, const Gaudi::Details::PropertyBase& p ) override; // ========================================================================== /** set the property from the property formatted string * @see IProperty diff --git a/GaudiKernel/src/Lib/PropertyMgr.cpp b/GaudiKernel/src/Lib/PropertyMgr.cpp index 2570f24700..7acd77d321 100644 --- a/GaudiKernel/src/Lib/PropertyMgr.cpp +++ b/GaudiKernel/src/Lib/PropertyMgr.cpp @@ -124,8 +124,8 @@ PropertyBase* PropertyMgr::property( const std::string& name ) const { * Implementation of IProperty::setProperty */ // ===================================================================== -StatusCode PropertyMgr::setProperty( const PropertyBase& p ) { - PropertyBase* pp = property( p.name() ); +StatusCode PropertyMgr::setProperty( const std::string& name, const PropertyBase& p ) { + PropertyBase* pp = property( name ); try { if ( pp && pp->assign( p ) ) return StatusCode::SUCCESS; } // RETURN -- GitLab From 4a8cab2a162e1aa25c6bd43a65ef926d71b20317 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Fri, 31 May 2019 18:29:47 +0200 Subject: [PATCH 35/62] Reorganize Gaudi::Property headers --- GaudiAlg/GaudiAlg/EventCounter.h | 2 +- GaudiAlg/GaudiAlg/FixTESPath.h | 2 +- GaudiAlg/GaudiAlg/Prescaler.h | 2 +- GaudiAlg/GaudiAlg/Sequencer.h | 2 +- GaudiAlg/src/lib/GaudiCommon.icpp | 2 +- .../src/HistogramSvc/HistogramSvc.cpp | 2 +- .../src/PersistencySvc/OutputStream.h | 2 +- .../src/IncidentSvc/DataOnDemandSvc.cpp | 2 +- .../src/IncidentSvc/IncidentProcAlg.h | 2 +- .../src/JobOptionsSvc/JobOptionsSvc.h | 2 +- GaudiCoreSvc/src/MessageSvc/MessageSvc.h | 2 +- GaudiExamples/src/AlgSequencer/HelloWorld.h | 2 +- GaudiExamples/src/AlgSequencer/StopperAlg.h | 2 +- GaudiExamples/src/AlgSequencer/SubAlg.h | 2 +- GaudiExamples/src/AlgSequencer/TemplatedAlg.h | 2 +- GaudiExamples/src/AlgTools/MyAlgorithm.h | 2 +- .../src/IncidentSvc/IncidentAsyncTestSvc.h | 2 +- GaudiExamples/src/Properties/PropertyAlg.h | 2 +- GaudiExamples/src/Properties/PropertyProxy.h | 2 +- GaudiHive/GaudiHive/HiveTestAlgorithm.h | 2 +- GaudiHive/src/bin/concurrentRun.cpp | 2 +- GaudiKernel/Gaudi/Algorithm.h | 2 +- GaudiKernel/Gaudi/Details/Property.h | 204 +++ GaudiKernel/Gaudi/Details/PropertyBase.h | 207 +++ GaudiKernel/Gaudi/Property.h | 1098 ++++++++++++ GaudiKernel/Gaudi/PropertyFwd.h | 18 + GaudiKernel/GaudiKernel/AppReturnCode.h | 2 +- GaudiKernel/GaudiKernel/Auditor.h | 2 +- GaudiKernel/GaudiKernel/CArrayAsProperty.h | 2 +- .../GaudiKernel/DataHandleHolderBase.h | 2 +- GaudiKernel/GaudiKernel/DataObjIDProperty.h | 2 +- .../GaudiKernel/EventSelectorDataStream.h | 2 +- GaudiKernel/GaudiKernel/GaudiHandle.h | 2 +- GaudiKernel/GaudiKernel/HistoProperty.h | 2 +- GaudiKernel/GaudiKernel/IJobOptionsSvc.h | 2 +- GaudiKernel/GaudiKernel/IProperty.h | 10 +- GaudiKernel/GaudiKernel/IVersHistoryObj.h | 2 +- GaudiKernel/GaudiKernel/JobHistory.h | 2 +- GaudiKernel/GaudiKernel/Property.h | 1524 +---------------- GaudiKernel/GaudiKernel/PropertyFwd.h | 41 +- GaudiKernel/GaudiKernel/PropertyHolder.h | 2 +- GaudiKernel/GaudiKernel/PropertyMgr.h | 2 +- GaudiKernel/GaudiKernel/Service.h | 2 +- GaudiKernel/dict/dictionary.h | 2 +- GaudiKernel/src/Lib/HistoryObj.cpp | 2 +- GaudiKernel/src/Lib/JobHistory.cpp | 2 +- GaudiKernel/src/Lib/Property.cpp | 2 +- GaudiKernel/tests/src/profile_Property.cpp | 2 +- GaudiKernel/tests/src/test_Property.cpp | 2 +- .../tests/src/test_WeekPropertyRef.cpp | 2 +- GaudiMP/dict/gaudimp_dict.h | 2 +- GaudiMP/src/component/IoComponentMgr.cpp | 2 +- GaudiPython/GaudiPython/Helpers.h | 2 +- GaudiPython/dict/kernel.h | 2 +- GaudiPython/src/Lib/Helpers.cpp | 2 +- GaudiSvc/src/NTupleSvc/NTupleSvc.cpp | 2 +- GaudiSvc/src/NTupleSvc/TagCollectionSvc.cpp | 2 +- GaudiSvc/src/THistSvc/THistSvc.cpp | 2 +- 58 files changed, 1617 insertions(+), 1587 deletions(-) create mode 100644 GaudiKernel/Gaudi/Details/Property.h create mode 100644 GaudiKernel/Gaudi/Details/PropertyBase.h create mode 100644 GaudiKernel/Gaudi/Property.h create mode 100644 GaudiKernel/Gaudi/PropertyFwd.h diff --git a/GaudiAlg/GaudiAlg/EventCounter.h b/GaudiAlg/GaudiAlg/EventCounter.h index f1ec7679d5..b08d8c0ce4 100644 --- a/GaudiAlg/GaudiAlg/EventCounter.h +++ b/GaudiAlg/GaudiAlg/EventCounter.h @@ -1,5 +1,5 @@ #include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/Property.h" +#include class GAUDI_API EventCounter : public Algorithm { public: diff --git a/GaudiAlg/GaudiAlg/FixTESPath.h b/GaudiAlg/GaudiAlg/FixTESPath.h index 27afe5eff5..c73ee0abe1 100644 --- a/GaudiAlg/GaudiAlg/FixTESPath.h +++ b/GaudiAlg/GaudiAlg/FixTESPath.h @@ -9,7 +9,7 @@ #include "GaudiKernel/Algorithm.h" #include "GaudiKernel/IDataManagerSvc.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" +#include namespace FixTESPathDetails { std::unique_ptr fixDataHandlePath( std::string_view rit, std::string rootName, MsgStream* dbg ); diff --git a/GaudiAlg/GaudiAlg/Prescaler.h b/GaudiAlg/GaudiAlg/Prescaler.h index 14813859fb..4f6abbb5c6 100644 --- a/GaudiAlg/GaudiAlg/Prescaler.h +++ b/GaudiAlg/GaudiAlg/Prescaler.h @@ -1,6 +1,6 @@ #include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/Property.h" +#include class GAUDI_API Prescaler : public GaudiAlgorithm { diff --git a/GaudiAlg/GaudiAlg/Sequencer.h b/GaudiAlg/GaudiAlg/Sequencer.h index a09b38255a..ba78bfb829 100644 --- a/GaudiAlg/GaudiAlg/Sequencer.h +++ b/GaudiAlg/GaudiAlg/Sequencer.h @@ -2,7 +2,7 @@ #define ALGORITHM_SEQUENCER_H // Include files -#include "GaudiKernel/Property.h" +#include #include #include diff --git a/GaudiAlg/src/lib/GaudiCommon.icpp b/GaudiAlg/src/lib/GaudiCommon.icpp index 71139bfddd..a1c31c9435 100644 --- a/GaudiAlg/src/lib/GaudiCommon.icpp +++ b/GaudiAlg/src/lib/GaudiCommon.icpp @@ -28,13 +28,13 @@ #include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ObjectVector.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/SmartDataPtr.h" #include "GaudiKernel/SmartRef.h" #include "GaudiKernel/Stat.h" #include "GaudiKernel/StatEntity.h" #include "GaudiKernel/System.h" #include "GaudiKernel/reverse.h" +#include // ============================================================================ // GaudiAlg // ============================================================================ diff --git a/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.cpp b/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.cpp index 93cc4dcac6..c66396a648 100644 --- a/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.cpp +++ b/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.cpp @@ -20,7 +20,7 @@ #include "GaudiKernel/DataObject.h" #include "GaudiKernel/GenericAddress.h" #include "GaudiKernel/IConversionSvc.h" -#include "GaudiKernel/Property.h" +#include // Local #include "GaudiPI.h" diff --git a/GaudiCommonSvc/src/PersistencySvc/OutputStream.h b/GaudiCommonSvc/src/PersistencySvc/OutputStream.h index 56b4296155..0d406a608d 100644 --- a/GaudiCommonSvc/src/PersistencySvc/OutputStream.h +++ b/GaudiCommonSvc/src/PersistencySvc/OutputStream.h @@ -5,7 +5,7 @@ #include "GaudiKernel/Algorithm.h" #include "GaudiKernel/IDataSelector.h" #include "GaudiKernel/IIncidentSvc.h" -#include "GaudiKernel/Property.h" +#include // STL include files #include diff --git a/GaudiCoreSvc/src/IncidentSvc/DataOnDemandSvc.cpp b/GaudiCoreSvc/src/IncidentSvc/DataOnDemandSvc.cpp index 9e9041b5d2..ba2caac843 100644 --- a/GaudiCoreSvc/src/IncidentSvc/DataOnDemandSvc.cpp +++ b/GaudiCoreSvc/src/IncidentSvc/DataOnDemandSvc.cpp @@ -22,10 +22,10 @@ #include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/LockedChrono.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/ThreadLocalContext.h" #include "GaudiKernel/ToStream.h" #include "GaudiKernel/TypeNameString.h" +#include // ============================================================================ // Local // ============================================================================ diff --git a/GaudiCoreSvc/src/IncidentSvc/IncidentProcAlg.h b/GaudiCoreSvc/src/IncidentSvc/IncidentProcAlg.h index 25a5d494f9..385a39f80e 100644 --- a/GaudiCoreSvc/src/IncidentSvc/IncidentProcAlg.h +++ b/GaudiCoreSvc/src/IncidentSvc/IncidentProcAlg.h @@ -4,7 +4,7 @@ #include "GaudiKernel/Algorithm.h" #include "GaudiKernel/IIncidentSvc.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" +#include class GAUDI_API IncidentProcAlg : public Algorithm { public: diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index 136612455b..66194f5154 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -3,10 +3,10 @@ #include "GaudiKernel/IJobOptionsSvc.h" #include "GaudiKernel/IProperty.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/PropertyHolder.h" #include "GaudiKernel/Service.h" #include "GaudiKernel/StatusCode.h" +#include #include "Gaudi/Interfaces/IOptionsSvc.h" diff --git a/GaudiCoreSvc/src/MessageSvc/MessageSvc.h b/GaudiCoreSvc/src/MessageSvc/MessageSvc.h index 2c8fc2b6b3..8f52f191c8 100644 --- a/GaudiCoreSvc/src/MessageSvc/MessageSvc.h +++ b/GaudiCoreSvc/src/MessageSvc/MessageSvc.h @@ -12,9 +12,9 @@ #include "GaudiKernel/IMessageSvc.h" #include "GaudiKernel/Message.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/Service.h" #include "GaudiKernel/StatusCode.h" +#include // Forward declarations class ISvcLocator; diff --git a/GaudiExamples/src/AlgSequencer/HelloWorld.h b/GaudiExamples/src/AlgSequencer/HelloWorld.h index 6e7b623427..6583110fdb 100644 --- a/GaudiExamples/src/AlgSequencer/HelloWorld.h +++ b/GaudiExamples/src/AlgSequencer/HelloWorld.h @@ -4,7 +4,7 @@ // Include files #include "GaudiKernel/Algorithm.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" +#include /** @class HelloWorld Trivial Algorithm for tutotial purposes diff --git a/GaudiExamples/src/AlgSequencer/StopperAlg.h b/GaudiExamples/src/AlgSequencer/StopperAlg.h index c9053276b1..a7f0e3442e 100644 --- a/GaudiExamples/src/AlgSequencer/StopperAlg.h +++ b/GaudiExamples/src/AlgSequencer/StopperAlg.h @@ -4,7 +4,7 @@ // Include files #include "GaudiAlg/GaudiAlgorithm.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" +#include /** @class ParentAlg Trivial Algorithm for tutotial purposes diff --git a/GaudiExamples/src/AlgSequencer/SubAlg.h b/GaudiExamples/src/AlgSequencer/SubAlg.h index 7cdf608a3a..fa26198333 100644 --- a/GaudiExamples/src/AlgSequencer/SubAlg.h +++ b/GaudiExamples/src/AlgSequencer/SubAlg.h @@ -4,7 +4,7 @@ // Include files #include "GaudiKernel/Algorithm.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" +#include /** @class SubAlg Trivial Algorithm for tutotial purposes diff --git a/GaudiExamples/src/AlgSequencer/TemplatedAlg.h b/GaudiExamples/src/AlgSequencer/TemplatedAlg.h index 9c8c6409ca..750a414d10 100644 --- a/GaudiExamples/src/AlgSequencer/TemplatedAlg.h +++ b/GaudiExamples/src/AlgSequencer/TemplatedAlg.h @@ -4,7 +4,7 @@ // Include files #include "GaudiAlg/GaudiAlgorithm.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" +#include /** @class TemplateAlg Trivial Algorithm for tutotial purposes diff --git a/GaudiExamples/src/AlgTools/MyAlgorithm.h b/GaudiExamples/src/AlgTools/MyAlgorithm.h index 2979966c9a..9f292fbdb7 100644 --- a/GaudiExamples/src/AlgTools/MyAlgorithm.h +++ b/GaudiExamples/src/AlgTools/MyAlgorithm.h @@ -4,7 +4,7 @@ // Include files #include "GaudiKernel/Algorithm.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" +#include // Forward references class IMyTool; diff --git a/GaudiExamples/src/IncidentSvc/IncidentAsyncTestSvc.h b/GaudiExamples/src/IncidentSvc/IncidentAsyncTestSvc.h index fbbbe32868..d1d87c7535 100644 --- a/GaudiExamples/src/IncidentSvc/IncidentAsyncTestSvc.h +++ b/GaudiExamples/src/IncidentSvc/IncidentAsyncTestSvc.h @@ -3,11 +3,11 @@ #include "GaudiKernel/EventContextHash.h" #include "GaudiKernel/IIncidentListener.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/Service.h" #include "GaudiKernel/SmartIF.h" #include "IIncidentAsyncTestSvc.h" #include "tbb/concurrent_unordered_map.h" +#include #include class ISvcLocator; class IMessageSvc; diff --git a/GaudiExamples/src/Properties/PropertyAlg.h b/GaudiExamples/src/Properties/PropertyAlg.h index 37c1e527d0..4efca9d4b1 100644 --- a/GaudiExamples/src/Properties/PropertyAlg.h +++ b/GaudiExamples/src/Properties/PropertyAlg.h @@ -4,7 +4,7 @@ // Include files #include "GaudiKernel/Algorithm.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" +#include /** @class PropertyAlg Trivial Algorithm for tutorial purposes diff --git a/GaudiExamples/src/Properties/PropertyProxy.h b/GaudiExamples/src/Properties/PropertyProxy.h index a27c0aa6cf..a332d963c7 100644 --- a/GaudiExamples/src/Properties/PropertyProxy.h +++ b/GaudiExamples/src/Properties/PropertyProxy.h @@ -4,7 +4,7 @@ // Include files #include "GaudiKernel/Algorithm.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" +#include /** @class PropertyProxy Trivial Algorithm for tutotial purposes diff --git a/GaudiHive/GaudiHive/HiveTestAlgorithm.h b/GaudiHive/GaudiHive/HiveTestAlgorithm.h index beb4017bea..820c374a75 100644 --- a/GaudiHive/GaudiHive/HiveTestAlgorithm.h +++ b/GaudiHive/GaudiHive/HiveTestAlgorithm.h @@ -7,7 +7,7 @@ // #include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/Property.h" +#include class GAUDI_API HiveTestAlgorithm : public GaudiAlgorithm { public: diff --git a/GaudiHive/src/bin/concurrentRun.cpp b/GaudiHive/src/bin/concurrentRun.cpp index e2f4a09073..2fe674a371 100644 --- a/GaudiHive/src/bin/concurrentRun.cpp +++ b/GaudiHive/src/bin/concurrentRun.cpp @@ -2,8 +2,8 @@ #include "GaudiKernel/IAppMgrUI.h" #include "GaudiKernel/IProperty.h" #include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/SmartIF.h" +#include #include #include diff --git a/GaudiKernel/Gaudi/Algorithm.h b/GaudiKernel/Gaudi/Algorithm.h index e5c7df8254..1d490024c7 100644 --- a/GaudiKernel/Gaudi/Algorithm.h +++ b/GaudiKernel/Gaudi/Algorithm.h @@ -29,12 +29,12 @@ #include "GaudiKernel/INTupleSvc.h" #include "GaudiKernel/IRndmGenSvc.h" #include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/PropertyHolder.h" #include "GaudiKernel/System.h" #include "GaudiKernel/ToolHandle.h" #include #include +#include // For concurrency #include "GaudiKernel/DataHandle.h" diff --git a/GaudiKernel/Gaudi/Details/Property.h b/GaudiKernel/Gaudi/Details/Property.h new file mode 100644 index 0000000000..240c4f47de --- /dev/null +++ b/GaudiKernel/Gaudi/Details/Property.h @@ -0,0 +1,204 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Gaudi::Details::Property { + using ImmediatelyInvokeHandler = Gaudi::tagged_bool; + + // ========================================================================== + // The following code is going to be a bit unpleasant, but as far as its + // author can tell, it is as simple as the design constraints and C++'s + // implementation constraints will allow. If you disagree, please submit + // a patch which simplifies it. Here is the underlying design rationale: + // + // - For any given type T used in a Property, we want to have an + // associated StringConverter struct which explains how to convert a + // value of that type into a string (toString) and parse that string + // back (fromString). + // - There is a default implementation, called DefaultStringConverter, + // which is based on the overloadable parse() and toStream() global + // methods of Gaudi. Its exact behaviour varies depending on whether T + // is default-constructible or only copy-constructible, which requires a + // layer of SFINAE indirection. + // - Some people want to be able to specialize StringConverter as an + // alternative to defining parse/toStream overloads. This interferes + // with the SFINAE tricks used by DefaultStringConverter, so we cannot + // just call a DefaultStringConverter a StringConverter and must add one + // more layer to the StringConverter type hierarchy. + + // This class factors out commonalities between DefaultStringConverters + template + struct DefaultStringConverterImpl { + public: + virtual ~DefaultStringConverterImpl() = default; + std::string toString( const TYPE& v ) { + using Gaudi::Utils::toString; + return toString( v ); + } + + // Implementation of fromString depends on whether TYPE is default- + // constructible (fastest, easiest) or only copy-constructible (still + // doable as long as the caller can provide a valid value of TYPE) + virtual TYPE fromString( const TYPE& ref_value, const std::string& s ) = 0; + + protected: + void fromStringImpl( TYPE& buffer, const std::string& s ) { + using Gaudi::Parsers::InputData; + if ( !parse( buffer, InputData{s} ).isSuccess() ) { + throw std::invalid_argument( "cannot parse '" + s + "' to " + System::typeinfoName( typeid( TYPE ) ) ); + } + } + }; + + // This class provides a default implementation of StringConverter based + // on the overloadable parse() and toStream() global Gaudi methods. + // + // It leverages the fact that TYPE is default-constructible if it can, and + // falls back fo a requirement of copy-constructibility if it must. So + // here is the "default" implementation for copy-constructible types... + // + template + struct DefaultStringConverter : DefaultStringConverterImpl { + TYPE fromString( const TYPE& ref_value, const std::string& s ) final override { + TYPE buffer = ref_value; + this->fromStringImpl( buffer, s ); + return buffer; + } + }; + // ...and here is the preferred impl for default-constructible types: + template + struct DefaultStringConverter::value>> + : DefaultStringConverterImpl { + TYPE fromString( const TYPE& /* ref_value */, const std::string& s ) final override { + TYPE buffer{}; + this->fromStringImpl( buffer, s ); + return buffer; + } + }; + + // Specializable StringConverter struct with a default implementation + template + struct StringConverter : DefaultStringConverter {}; + + struct NullVerifier { + template + void operator()( const TYPE& ) const {} + }; + template + struct BoundedVerifier { + void operator()( const TYPE& value ) const { + using Gaudi::Utils::toString; + // throw the exception if the limit is defined and value is outside + if ( ( m_hasLowerBound && ( value < m_lowerBound ) ) || ( m_hasUpperBound && ( m_upperBound < value ) ) ) + throw std::out_of_range( "value " + toString( value ) + " outside range" ); + } + + /// Return if it has a lower bound + bool hasLower() const { return m_hasLowerBound; } + /// Return if it has a lower bound + bool hasUpper() const { return m_hasUpperBound; } + /// Return the lower bound value + const TYPE& lower() const { return m_lowerBound; } + /// Return the upper bound value + const TYPE& upper() const { return m_upperBound; } + + /// Set lower bound value + void setLower( const TYPE& value ) { + m_hasLowerBound = true; + m_lowerBound = value; + } + /// Set upper bound value + void setUpper( const TYPE& value ) { + m_hasUpperBound = true; + m_upperBound = value; + } + /// Clear lower bound value + void clearLower() { + m_hasLowerBound = false; + m_lowerBound = TYPE(); + } + /// Clear upper bound value + void clearUpper() { + m_hasUpperBound = false; + m_upperBound = TYPE(); + } + + /// Set both bounds (lower and upper) at the same time + void setBounds( const TYPE& lower, const TYPE& upper ) { + setLower( lower ); + setUpper( upper ); + } + + /// Clear both bounds (lower and upper) at the same time + void clearBounds() { + clearLower(); + clearUpper(); + } + + private: + /// Data members + bool m_hasLowerBound{false}; + bool m_hasUpperBound{false}; + TYPE m_lowerBound{}; + TYPE m_upperBound{}; + }; + + /// helper to disable a while triggering it, to avoid infinite recursion + struct SwapCall { + using callback_t = std::function; + callback_t tmp, &orig; + SwapCall( callback_t& input ) : orig( input ) { tmp.swap( orig ); } + ~SwapCall() { orig.swap( tmp ); } + void operator()( PropertyBase& p ) const { tmp( p ); } + }; + + struct NoHandler { + void useReadHandler( const PropertyBase& ) const {} + void setReadHandler( std::function ) { + throw std::logic_error( "setReadHandler not implemented for this class" ); + } + std::function getReadHandler() const { return nullptr; } + void useUpdateHandler( const PropertyBase& ) const {} + void setUpdateHandler( std::function ) { + throw std::logic_error( "setUpdateHandler not implemented for this class" ); + } + std::function getUpdateHandler() const { return nullptr; } + }; + struct ReadHandler : NoHandler { + mutable std::function m_readCallBack; + void useReadHandler( const PropertyBase& p ) const { + if ( m_readCallBack ) { SwapCall{m_readCallBack}( const_cast( p ) ); } + } + void setReadHandler( std::function fun ) { m_readCallBack = std::move( fun ); } + std::function getReadHandler() const { return m_readCallBack; } + }; + struct UpdateHandler : NoHandler { + std::function m_updateCallBack; + void useUpdateHandler( PropertyBase& p ) { + if ( m_updateCallBack ) { + try { + SwapCall{m_updateCallBack}( p ); + } catch ( const std::exception& x ) { + throw std::invalid_argument( "failure in update handler of '" + p.name() + "': " + x.what() ); + } + } + } + void setUpdateHandler( std::function fun ) { m_updateCallBack = std::move( fun ); } + std::function getUpdateHandler() const { return m_updateCallBack; } + }; + struct ReadUpdateHandler : ReadHandler, UpdateHandler { + using ReadHandler::getReadHandler; + using ReadHandler::setReadHandler; + using ReadHandler::useReadHandler; + using UpdateHandler::getUpdateHandler; + using UpdateHandler::setUpdateHandler; + using UpdateHandler::useUpdateHandler; + }; +} // namespace Gaudi::Details::Property diff --git a/GaudiKernel/Gaudi/Details/PropertyBase.h b/GaudiKernel/Gaudi/Details/PropertyBase.h new file mode 100644 index 0000000000..8a3b4cc6da --- /dev/null +++ b/GaudiKernel/Gaudi/Details/PropertyBase.h @@ -0,0 +1,207 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Gaudi::Details { + class WeekPropertyRef; + + // ============================================================================ + /** PropertyBase base class allowing PropertyBase* collections to be "homogeneous" + * + * \author Paul Maley + * \author CTDay + * \author Vanya BELYAEV ibelyaev@physics.syr.edu + * \author Marco Clemencic + */ + class GAUDI_API PropertyBase { + + public: + /// property name + const std::string name() const { return std::string{m_name}; } + /// property documentation + std::string documentation() const { return std::string{m_documentation}; } + /// property type-info + const std::type_info* type_info() const { return m_typeinfo; } + /// property type + std::string type() const { return m_typeinfo->name(); } + /// export the property value to the destination + virtual bool load( PropertyBase& dest ) const = 0; + /// import the property value form the source + virtual bool assign( const PropertyBase& source ) = 0; + + public: + /// value -> string + virtual std::string toString() const = 0; + /// value -> stream + virtual void toStream( std::ostream& out ) const = 0; + /// string -> value + virtual StatusCode fromString( const std::string& value ) = 0; + + public: + /// set new callback for reading + virtual PropertyBase& declareReadHandler( std::function fun ) = 0; + /// set new callback for update + virtual PropertyBase& declareUpdateHandler( std::function fun ) = 0; + + /// get a reference to the readCallBack + virtual const std::function readCallBack() const = 0; + /// get a reference to the updateCallBack + virtual const std::function updateCallBack() const = 0; + + /// manual trigger for callback for update + virtual bool useUpdateHandler() = 0; + + template + PropertyBase& declareReadHandler( void ( HT::*MF )( PropertyBase& ), HT* instance ) { + return declareReadHandler( [=]( PropertyBase& p ) { ( instance->*MF )( p ); } ); + } + + template + PropertyBase& declareUpdateHandler( void ( HT::*MF )( PropertyBase& ), HT* instance ) { + return declareUpdateHandler( [=]( PropertyBase& p ) { ( instance->*MF )( p ); } ); + } + + public: + /// virtual destructor + virtual inline ~PropertyBase(); + /// set the new value for the property name + void setName( std::string value ) { m_name = to_view( std::move( value ) ); } + /// set the documentation string + void setDocumentation( std::string value ) { m_documentation = to_view( std::move( value ) ); } + /// the printout of the property value + virtual std::ostream& fillStream( std::ostream& ) const; + /// clones the current property + virtual PropertyBase* clone() const = 0; + + /// set the type of the owner class (used for documentation) + void setOwnerType( const std::type_info& ownerType ) { m_ownerType = &ownerType; } + + /// set the type of the owner class (used for documentation) + template + void setOwnerType() { + setOwnerType( typeid( OWNER ) ); + } + + /// get the type of the owner class (used for documentation) + const std::type_info* ownerType() const { return m_ownerType; } + + /// get the string for the type of the owner class (used for documentation) + std::string ownerTypeName() const { + return m_ownerType ? System::typeinfoName( *m_ownerType ) : std::string( "unknown owner type" ); + } + + protected: + /// constructor from the property name and the type + PropertyBase( const std::type_info& type, std::string name = "", std::string doc = "" ) + : m_name( to_view( std::move( name ) ) ), m_documentation( to_view( std::move( doc ) ) ), m_typeinfo( &type ) {} + /// constructor from the property name and the type + PropertyBase( std::string name, const std::type_info& type ) + : m_name( to_view( std::move( name ) ) ), m_documentation( m_name ), m_typeinfo( &type ) {} + /// copy constructor + PropertyBase( const PropertyBase& ) = default; + /// assignment operator + PropertyBase& operator=( const PropertyBase& ) = default; + + private: + /// helper to map a string to a reliable std::string_view + static std::string_view to_view( std::string str ); + /// property name + std::string_view m_name; + /// property doc string + std::string_view m_documentation; + /// property type + const std::type_info* m_typeinfo; + /// type of owner of the property (if defined) + const std::type_info* m_ownerType = nullptr; + + friend WeekPropertyRef; + std::set m_weekReferences; + void add( WeekPropertyRef* ref ) { + if ( ref ) m_weekReferences.insert( ref ); + } + void remove( WeekPropertyRef* ref ) { m_weekReferences.erase( ref ); } + }; + + /// Optional reference to a property that can be used to refer to a sting or + /// to the string representation of a property instance value + class GAUDI_API WeekPropertyRef { + friend PropertyBase; + + public: + WeekPropertyRef() = default; + WeekPropertyRef( std::string value ) : m_value{std::move( value )}, m_unset{false} {} + WeekPropertyRef( PropertyBase& property ) : m_property{&property} { property.add( this ); } + WeekPropertyRef( const WeekPropertyRef& other ) = delete; + WeekPropertyRef( WeekPropertyRef&& other ) + : m_property{other.m_property}, m_value{std::move( other.m_value )}, m_unset{other.m_unset} { + if ( m_property ) { + other.m_property = nullptr; + m_property->remove( &other ); + m_property->add( this ); + } + } + ~WeekPropertyRef() { + if ( m_property ) m_property->remove( this ); + } + WeekPropertyRef& operator=( WeekPropertyRef&& other ) { + if ( this != &other ) { + if ( m_property ) m_property->remove( this ); + m_property = other.m_property; + other.m_property = nullptr; + if ( m_property ) { + m_property->remove( &other ); + m_property->add( this ); + } + m_value = std::move( other.m_value ); + m_unset = other.m_unset; + } + return *this; + } + WeekPropertyRef& operator=( PropertyBase& value ) { + if ( m_property != &value ) { + if ( m_property ) { + m_property->remove( this ); + if ( !m_unset ) m_value = m_property->toString(); + } + if ( !m_unset ) value.fromString( m_value ).ignore(); + m_property = &value; + value.add( this ); + } + return *this; + } + WeekPropertyRef& operator=( const std::string& value ) { + if ( m_property ) m_property->fromString( value ).ignore(); + m_value = value; + m_unset = false; + return *this; + } + operator std::string() const { return m_property ? m_property->toString() : m_value; } + + inline bool isBound() const { return m_property; } + inline bool isSet() const { return !m_unset; } + + private: + PropertyBase* m_property = nullptr; + std::string m_value; + bool m_unset = true; + + void detach() { m_property = nullptr; } + }; + + inline PropertyBase::~PropertyBase() { + for ( auto ref : m_weekReferences ) { ref->detach(); } + } + + inline std::ostream& operator<<( std::ostream& stream, const PropertyBase& prop ) { + return prop.fillStream( stream ); + } +} // namespace Gaudi::Details diff --git a/GaudiKernel/Gaudi/Property.h b/GaudiKernel/Gaudi/Property.h new file mode 100644 index 0000000000..7971e9eaf1 --- /dev/null +++ b/GaudiKernel/Gaudi/Property.h @@ -0,0 +1,1098 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Gaudi { + // ============================================================================ + /** Implementation of property with value of concrete type. + * + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2006-02-27 + * @author Marco Clemencic + * @date 2016-06-16 + */ + // ============================================================================ + template + class Property : public Details::PropertyBase { + public: + // ========================================================================== + /// Hosted type + using StorageType = TYPE; + using ValueType = typename std::remove_reference::type; + using VerifierType = VERIFIER; + using HandlersType = HANDLERS; + // ========================================================================== + + private: + /// Storage. + StorageType m_value; + VerifierType m_verifier; + HandlersType m_handlers; + /// helper typedefs for SFINAE + /// @{ + template + using is_this_type = std::is_same>; + template + using not_copying = std::enable_if_t::value>; + /// @} + public: + // ========================================================================== + /// the constructor with property name, value and documentation. + template + Property( std::string name, T&& value, std::string doc = "" ) + : Details::PropertyBase( typeid( ValueType ), std::move( name ), std::move( doc ) ) + , m_value( std::forward( value ) ) { + m_verifier( m_value ); + } + /// Autodeclaring constructor with property name, value and documentation. + /// @note the use std::enable_if is required to avoid ambiguities + template ::value>, + typename = std::enable_if_t::value>> + Property( OWNER* owner, std::string name ) : Property( std::move( name ), ValueType{}, "" ) { + owner->declareProperty( *this ); + setOwnerType(); + } + + /// Autodeclaring constructor with property name, value and documentation. + /// @note the use std::enable_if is required to avoid ambiguities + template ::value>> + Property( OWNER* owner, std::string name, T&& value, std::string doc = "" ) + : Property( std::move( name ), std::forward( value ), std::move( doc ) ) { + owner->declareProperty( *this ); + setOwnerType(); + } + + /// Autodeclaring constructor with property name, value, updateHandler and documentation. + /// @note the use std::enable_if is required to avoid ambiguities + template ::value>> + Property( OWNER* owner, std::string name, T&& value, std::function handler, + std::string doc = "" ) + : Property( owner, std::move( name ), std::forward( value ), std::move( doc ) ) { + declareUpdateHandler( std::move( handler ) ); + } + + /// Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation. + /// @note the use std::enable_if is required to avoid ambiguities + template ::value>> + Property( OWNER* owner, std::string name, T&& value, void ( OWNER::*handler )( PropertyBase& ), + std::string doc = "" ) + : Property( + owner, std::move( name ), std::forward( value ), + [owner, handler]( PropertyBase& p ) { ( owner->*handler )( p ); }, std::move( doc ) ) {} + /// Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation. + /// @note the use std::enable_if is required to avoid ambiguities + template ::value>> + Property( OWNER* owner, std::string name, T&& value, void ( OWNER::*handler )(), std::string doc = "" ) + : Property( + owner, std::move( name ), std::forward( value ), + [owner, handler]( PropertyBase& ) { ( owner->*handler )(); }, std::move( doc ) ) {} + + /// Autodeclaring constructor with property name, value, updateHandler and documentation. + /// @note the use std::enable_if is required to avoid ambiguities + template ::value>> + Property( OWNER* owner, std::string name, T&& value, std::function handler, + Details::Property::ImmediatelyInvokeHandler invoke, std::string doc = "" ) + : Property( owner, std::move( name ), std::forward( value ), std::move( handler ), std::move( doc ) ) { + if ( invoke ) useUpdateHandler(); + } + + /// Construct an anonymous property from a value. + /// This constructor is not generated if T is the current type, so that the + /// compiler picks up the copy constructor instead of this one. + template > + Property( T&& v ) : Details::PropertyBase( typeid( ValueType ), "", "" ), m_value( std::forward( v ) ) {} + + /// Construct an anonymous property with default constructed value. + /// Can be used only if StorageType is default constructible. + template ::value>> + Property() : Details::PropertyBase( typeid( ValueType ), "", "" ), m_value() {} + + using Details::PropertyBase::declareReadHandler; + using Details::PropertyBase::declareUpdateHandler; + + /// set new callback for reading + Details::PropertyBase& declareReadHandler( std::function fun ) override { + m_handlers.setReadHandler( std::move( fun ) ); + return *this; + } + /// set new callback for update + Details::PropertyBase& declareUpdateHandler( std::function fun ) override { + m_handlers.setUpdateHandler( std::move( fun ) ); + return *this; + } + + /// get a reference to the readCallBack + const std::function readCallBack() const override { + return m_handlers.getReadHandler(); + } + /// get a reference to the updateCallBack + const std::function updateCallBack() const override { + return m_handlers.getUpdateHandler(); + } + + /// manual trigger for callback for update + bool useUpdateHandler() override { + m_handlers.useUpdateHandler( *this ); + return true; + } + + /// Automatic conversion to value (const reference). + operator const ValueType&() const { + m_handlers.useReadHandler( *this ); + return m_value; + } + // /// Automatic conversion to value (reference). + // operator ValueType& () { + // useReadHandler(); + // return m_value; + // } + + /// equality comparison + template + bool operator==( const T& other ) const { + return m_value == other; + } + + /// inequality comparison + template + bool operator!=( const T& other ) const { + return m_value != other; + } + + /// "less" comparison + template + bool operator<( const T& other ) const { + return m_value < other; + } + + /// allow addition if possible between the property and the other types + template + decltype( auto ) operator+( const T& other ) const { + return m_value + other; + } + + /// Assignment from value. + template + Property& operator=( T&& v ) { + m_verifier( v ); + m_value = std::forward( v ); + m_handlers.useUpdateHandler( *this ); + return *this; + } + + /// Accessor to verifier. + const VerifierType& verifier() const { return m_verifier; } + /// Accessor to verifier. + VerifierType& verifier() { return m_verifier; } + + /// Backward compatibility (\deprecated will be removed) + /// @{ + const ValueType& value() const { return *this; } + ValueType& value() { return const_cast( (const ValueType&)*this ); } + bool setValue( const ValueType& v ) { + *this = v; + return true; + } + bool set( const ValueType& v ) { + *this = v; + return true; + } + Details::PropertyBase* clone() const override { return new Property( *this ); } + /// @} + + /// @name Helpers for easy use of string and vector properties. + /// @{ + /// They are instantiated only if they are implemented in the wrapped class. + template + decltype( auto ) size() const { + return value().size(); + } + template + decltype( auto ) length() const { + return value().length(); + } + template + decltype( auto ) empty() const { + return value().empty(); + } + template + decltype( auto ) clear() { + value().clear(); + } + template + decltype( auto ) begin() const { + return value().begin(); + } + template + decltype( auto ) end() const { + return value().end(); + } + template + decltype( auto ) begin() { + return value().begin(); + } + template + decltype( auto ) end() { + return value().end(); + } + template + decltype( auto ) operator[]( const ARG& arg ) const { + return value()[arg]; + } + template + decltype( auto ) operator[]( const ARG& arg ) { + return value()[arg]; + } + template + decltype( auto ) find( const typename T::key_type& key ) const { + return value().find( key ); + } + template + decltype( auto ) find( const typename T::key_type& key ) { + return value().find( key ); + } + template + decltype( auto ) erase( ARG arg ) { + return value().erase( arg ); + } + template + Property& operator++() { + ++value(); + return *this; + } + template + ValueType operator++( int ) { + return m_value++; + } + template + Property& operator--() { + --value(); + return *this; + } + template + ValueType operator--( int ) { + return m_value--; + } + template + Property& operator+=( const T& other ) { + m_value += other; + return *this; + } + template + Property& operator-=( const T& other ) { + m_value -= other; + return *this; + } + /// Helpers for DataHandles and derived classes + template + decltype( auto ) key() const { + return value().key(); + } + template + decltype( auto ) objKey() const { + return value().objKey(); + } + template + decltype( auto ) fullKey() const { + return value().fullKey(); + } + template + decltype( auto ) initialize() { + return value().initialize(); + } + template + decltype( auto ) makeHandles() const { + return value().makeHandles(); + } + template + decltype( auto ) makeHandles( const ARG& arg ) const { + return value().makeHandles( arg ); + } + /// @} + // ========================================================================== + + // Delegate operator() to the value + template + decltype( std::declval()( std::declval()... ) ) operator()( Args&&... args ) const + noexcept( noexcept( std::declval()( std::declval()... ) ) ) { + return value()( std::forward( args )... ); + } + + public: + /// get the value from another property + bool assign( const Details::PropertyBase& source ) override { + // Check if the property of is of "the same" type, except for strings + const Property* p = + ( std::is_same::value ) ? nullptr : dynamic_cast( &source ); + if ( p ) { + *this = p->value(); + } else if ( source.type_info() == &typeid( std::string ) ) { + auto s = dynamic_cast*>( &source ); + this->fromString( s->value() ).ignore(); + } else { + this->fromString( source.toString() ).ignore(); + } + return true; + } + /// set value to another property + bool load( Details::PropertyBase& dest ) const override { + // delegate to the 'opposite' method + return dest.assign( *this ); + } + /// string -> value + StatusCode fromString( const std::string& source ) override { + using Converter = Details::Property::StringConverter; + *this = Converter().fromString( m_value, source ); + return StatusCode::SUCCESS; + } + /// value -> string + std::string toString() const override { + using Converter = Details::Property::StringConverter; + return Converter().toString( *this ); + } + /// value -> stream + void toStream( std::ostream& out ) const override { + m_handlers.useReadHandler( *this ); + using Utils::toStream; + toStream( m_value, out ); + } + }; + + /// delegate (value == property) to property operator== + template + bool operator==( const T& v, const Property& p ) { + return p == v; + } + + /// delegate (value != property) to property operator!= + template + bool operator!=( const T& v, const Property& p ) { + return p != v; + } + + /// implemantation of (value + property) + template + decltype( auto ) operator+( const T& v, const Property& p ) { + return v + p.value(); + } + + template + using CheckedProperty = Property, HANDLERS>; + + template + using PropertyWithReadHandler = + Property; + +} // namespace Gaudi + +template +using SimpleProperty = Gaudi::Property; + +template +using SimplePropertyRef = Gaudi::Property; + +// Typedef Properties for built-in types +typedef Gaudi::Property BooleanProperty; +typedef Gaudi::Property CharProperty; +typedef Gaudi::Property SignedCharProperty; +typedef Gaudi::Property UnsignedCharProperty; +typedef Gaudi::Property ShortProperty; +typedef Gaudi::Property UnsignedShortProperty; +typedef Gaudi::Property IntegerProperty; +typedef Gaudi::Property UnsignedIntegerProperty; +typedef Gaudi::Property LongProperty; +typedef Gaudi::Property UnsignedLongProperty; +typedef Gaudi::Property LongLongProperty; +typedef Gaudi::Property UnsignedLongLongProperty; +typedef Gaudi::Property FloatProperty; +typedef Gaudi::Property DoubleProperty; +typedef Gaudi::Property LongDoubleProperty; + +typedef Gaudi::Property StringProperty; + +// Typedef PropertyRefs for built-in types +typedef Gaudi::Property BooleanPropertyRef; +typedef Gaudi::Property CharPropertyRef; +typedef Gaudi::Property SignedCharPropertyRef; +typedef Gaudi::Property UnsignedCharPropertyRef; +typedef Gaudi::Property ShortPropertyRef; +typedef Gaudi::Property UnsignedShortPropertyRef; +typedef Gaudi::Property IntegerPropertyRef; +typedef Gaudi::Property UnsignedIntegerPropertyRef; +typedef Gaudi::Property LongPropertyRef; +typedef Gaudi::Property UnsignedLongPropertyRef; +typedef Gaudi::Property LongLongPropertyRef; +typedef Gaudi::Property UnsignedLongLongPropertyRef; +typedef Gaudi::Property FloatPropertyRef; +typedef Gaudi::Property DoublePropertyRef; +typedef Gaudi::Property LongDoublePropertyRef; + +typedef Gaudi::Property StringPropertyRef; + +// Typedef "Arrays" of Properties for built-in types +typedef Gaudi::Property> BooleanArrayProperty; +typedef Gaudi::Property> CharArrayProperty; +typedef Gaudi::Property> SignedCharArrayProperty; +typedef Gaudi::Property> UnsignedCharArrayProperty; +typedef Gaudi::Property> ShortArrayProperty; +typedef Gaudi::Property> UnsignedShortArrayProperty; +typedef Gaudi::Property> IntegerArrayProperty; +typedef Gaudi::Property> UnsignedIntegerArrayProperty; +typedef Gaudi::Property> LongArrayProperty; +typedef Gaudi::Property> UnsignedLongArrayProperty; +typedef Gaudi::Property> LongLongArrayProperty; +typedef Gaudi::Property> UnsignedLongLongArrayProperty; +typedef Gaudi::Property> FloatArrayProperty; +typedef Gaudi::Property> DoubleArrayProperty; +typedef Gaudi::Property> LongDoubleArrayProperty; + +typedef Gaudi::Property> StringArrayProperty; + +// Typedef "Arrays" of PropertyRefs for built-in types +typedef Gaudi::Property&> BooleanArrayPropertyRef; +typedef Gaudi::Property&> CharArrayPropertyRef; +typedef Gaudi::Property&> SignedCharArrayPropertyRef; +typedef Gaudi::Property&> UnsignedCharArrayPropertyRef; +typedef Gaudi::Property&> ShortArrayPropertyRef; +typedef Gaudi::Property&> UnsignedShortArrayPropertyRef; +typedef Gaudi::Property&> IntegerArrayPropertyRef; +typedef Gaudi::Property&> UnsignedIntegerArrayPropertyRef; +typedef Gaudi::Property&> LongArrayPropertyRef; +typedef Gaudi::Property&> UnsignedLongArrayPropertyRef; +typedef Gaudi::Property&> LongLongArrayPropertyRef; +typedef Gaudi::Property&> UnsignedLongLongArrayPropertyRef; +typedef Gaudi::Property&> FloatArrayPropertyRef; +typedef Gaudi::Property&> DoubleArrayPropertyRef; +typedef Gaudi::Property&> LongDoubleArrayPropertyRef; + +typedef Gaudi::Property&> StringArrayPropertyRef; + +/// Helper class to simplify the migration old properties deriving directly from +/// PropertyBase. +template +class PropertyWithHandlers : public Gaudi::Details::PropertyBase { + Handler m_handlers; + +public: + using PropertyBase::PropertyBase; + + /// set new callback for reading + PropertyBase& declareReadHandler( std::function fun ) override { + m_handlers.setReadHandler( std::move( fun ) ); + return *this; + } + /// set new callback for update + PropertyBase& declareUpdateHandler( std::function fun ) override { + m_handlers.setUpdateHandler( std::move( fun ) ); + return *this; + } + + /// get a reference to the readCallBack + const std::function readCallBack() const override { return m_handlers.getReadHandler(); } + /// get a reference to the updateCallBack + const std::function updateCallBack() const override { return m_handlers.getUpdateHandler(); } + + /// use the call-back function at reading, if available + void useReadHandler() const { m_handlers.useReadHandler( *this ); } + + /// use the call-back function at update, if available + bool useUpdateHandler() override { + m_handlers.useUpdateHandler( *this ); + return true; + } +}; + +// forward-declaration is sufficient here +class GaudiHandleBase; + +// implementation in header file only where the GaudiHandleBase class +// definition is not needed. The rest goes into the .cpp file. +// The goal is to decouple the header files, to avoid that the whole +// world depends on GaudiHandle.h +class GAUDI_API GaudiHandleProperty : public PropertyWithHandlers<> { +public: + GaudiHandleProperty( std::string name, GaudiHandleBase& ref ); + + GaudiHandleProperty& operator=( const GaudiHandleBase& value ) { + setValue( value ); + return *this; + } + + GaudiHandleProperty* clone() const override { return new GaudiHandleProperty( *this ); } + + bool load( PropertyBase& destination ) const override { return destination.assign( *this ); } + + bool assign( const PropertyBase& source ) override { return fromString( source.toString() ).isSuccess(); } + + std::string toString() const override; + + void toStream( std::ostream& out ) const override; + + StatusCode fromString( const std::string& s ) override; + + const GaudiHandleBase& value() const { + useReadHandler(); + return *m_pValue; + } + + bool setValue( const GaudiHandleBase& value ); + +private: + /** Pointer to the real property. Reference would be better, but ROOT does not + support references yet */ + GaudiHandleBase* m_pValue; +}; + +// forward-declaration is sufficient here +class GaudiHandleArrayBase; + +class GAUDI_API GaudiHandleArrayProperty : public PropertyWithHandlers<> { +public: + GaudiHandleArrayProperty( std::string name, GaudiHandleArrayBase& ref ); + + GaudiHandleArrayProperty& operator=( const GaudiHandleArrayBase& value ) { + setValue( value ); + return *this; + } + + GaudiHandleArrayProperty* clone() const override { return new GaudiHandleArrayProperty( *this ); } + + bool load( PropertyBase& destination ) const override { return destination.assign( *this ); } + + bool assign( const PropertyBase& source ) override { return fromString( source.toString() ).isSuccess(); } + + std::string toString() const override; + + void toStream( std::ostream& out ) const override; + + StatusCode fromString( const std::string& s ) override; + + const GaudiHandleArrayBase& value() const { + useReadHandler(); + return *m_pValue; + } + + bool setValue( const GaudiHandleArrayBase& value ); + +private: + /** Pointer to the real property. Reference would be better, but ROOT does not + support references yet */ + GaudiHandleArrayBase* m_pValue; +}; + +namespace Gaudi { + namespace Utils { + // ======================================================================== + /** simple function which check the existence of the property with + * the given name. + * + * @code + * + * const IProperty* p = ... ; + * + * const bool = hasProperty( p , "Context" ) ; + * + * @endcode + * + * @param p pointer to IProperty object + * @param name property name (case insensitive) + * @return true if "p" has a property with such name + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2006-09-09 + */ + GAUDI_API bool hasProperty( const IProperty* p, const std::string& name ); + // ======================================================================== + /** simple function which check the existence of the property with + * the given name. + * + * @code + * + * IInterface* p = . + * + * const bool = hasProperty( p , "Context" ) ; + * + * @endcode + * + * @param p pointer to IInterface object (any component) + * @param name property name (case insensitive) + * @return true if "p" has a property with such name + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2006-09-09 + */ + GAUDI_API bool hasProperty( const IInterface* p, const std::string& name ); + // ======================================================================== + /** simple function which gets the property with given name + * from the component + * + * @code + * + * const IProperty* p = ... ; + * + * const Gaudi::Details::PropertyBase* pro = getProperty( p , "Context" ) ; + * + * @endcode + * + * @param p pointer to IProperty object + * @param name property name (case insensitive) + * @return property with the given name (if exists), NULL otherwise + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2006-09-09 + */ + GAUDI_API Gaudi::Details::PropertyBase* getProperty( const IProperty* p, const std::string& name ); + // ======================================================================== + /** simple function which gets the property with given name + * from the component + * + * @code + * + * const IInterface* p = ... ; + * + * const Gaudi::Details::PropertyBase* pro = getProperty( p , "Context" ) ; + * + * @endcode + * + * @param p pointer to IInterface object + * @param name property name (case insensitive) + * @return property with the given name (if exists), NULL otherwise + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2006-09-09 + */ + GAUDI_API Gaudi::Details::PropertyBase* getProperty( const IInterface* p, const std::string& name ); + // ======================================================================== + /** check the property by name from the list of the properties + * + * @code + * + * IJobOptionsSvc* svc = ... ; + * + * const std::string client = ... ; + * + * // get the property: + * bool context = + * hasProperty ( svc->getProperties( client ) , "Context" ) + * + * @endcode + * + * @see IJobOptionsSvc + * + * @param p list of properties + * @param name property name (case insensitive) + * @return true if the property exists + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2006-09-09 + */ + GAUDI_API bool hasProperty( const std::vector* p, const std::string& name ); + // ======================================================================== + /** get the property by name from the list of the properties + * + * @code + * + * IJobOptionsSvc* svc = ... ; + * + * const std::string client = ... ; + * + * // get the property: + * const Gaudi::Details::PropertyBase* context = + * getProperty ( svc->getProperties( client ) , "Context" ) + * + * @endcode + * + * @see IJobOptionsSvc + * + * @param p list of properties + * @param name property name (case insensitive) + * @return property with the given name (if exists), NULL otherwise + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2006-09-09 + */ + GAUDI_API const Gaudi::Details::PropertyBase* + getProperty( const std::vector* p, const std::string& name ); + // ======================================================================== + /** simple function to set the property of the given object from the value + * + * @code + * + * IProperty* component = ... ; + * + * std::vector data = ... ; + * StatusCode sc = setProperty ( componet , "Data" , data ) ; + * + * @endcode + * + * Note: the interface IProperty allows setting of the properties either + * directly from other properties or from strings only + * + * @param component component which needs to be configured + * @param name name of the property + * @param value value of the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + template + StatusCode setProperty( IProperty* component, const std::string& name, const TYPE& value, const std::string& doc ); + // ======================================================================== + /** simple function to set the property of the given object from the value + * + * @code + * + * IProperty* component = ... ; + * + * std::vector data = ... ; + * StatusCode sc = setProperty ( componet , "Data" , data ) ; + * + * @endcode + * + * Note: the interface IProperty allows setting of the properties either + * directly from other properties or from strings only + * + * @param component component which needs to be configured + * @param name name of the property + * @param value value of the property + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + template + StatusCode setProperty( IProperty* component, const std::string& name, const TYPE& value ) { + return setProperty( component, name, value, std::string() ); + } + // ======================================================================== + /** the full specialization of the + * previous method setProperty( IProperty, std::string, const TYPE&) + * for standard strings + * + * @param component component which needs to be configured + * @param name name of the property + * @param value value of the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + GAUDI_API StatusCode setProperty( IProperty* component, const std::string& name, const std::string& value, + const std::string& doc = "" ); + // ======================================================================== + /** the full specialization of the + * method setProperty( IProperty, std::string, const TYPE&) + * for C-strings + * + * @param component component which needs to be configured + * @param name name of the property + * @param value value of the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + GAUDI_API StatusCode setProperty( IProperty* component, const std::string& name, const char* value, + const std::string& doc = "" ); + // ======================================================================== + /** the full specialization of the + * method setProperty( IProperty, std::string, const TYPE&) + * for C-arrays + * + * @param component component which needs to be configured + * @param name name of the property + * @param value value of the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + template + StatusCode setProperty( IProperty* component, const std::string& name, const char ( &value )[N], + const std::string& doc = "" ) { + return component ? setProperty( component, name, std::string( value, value + N ), doc ) : StatusCode::FAILURE; + } + // ======================================================================== + /** simple function to set the property of the given object from the value + * + * @code + * + * IProperty* component = ... ; + * + * std::vector data = ... ; + * StatusCode sc = setProperty ( component , "Data" , data ) ; + * + * std::map cuts = ... ; + * sc = setProperty ( component , "Cuts" , cuts ) ; + * + * std::map dict = ... ; + * sc = setProperty ( component , "Dictionary" , dict ) ; + * + * @endcode + * + * Note: the native interface IProperty allows setting of the + * properties either directly from other properties or + * from strings only + * + * @param component component which needs to be configured + * @param name name of the property + * @param value value of the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + template + StatusCode setProperty( IProperty* component, const std::string& name, const TYPE& value, const std::string& doc ) { + using Gaudi::Utils::toString; + return component && hasProperty( component, name ) + ? Gaudi::Utils::setProperty( component, name, toString( value ), doc ) + : StatusCode::FAILURE; + } + // ======================================================================== + /** simple function to set the property of the given object from another + * property + * + * @code + * + * IProperty* component = ... ; + * + * const Gaudi::Details::PropertyBase* prop = ... ; + * StatusCode sc = setProperty ( component , "Data" , prop ) ; + * + * @endcode + * + * @param component component which needs to be configured + * @param name name of the property + * @param property the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + GAUDI_API StatusCode setProperty( IProperty* component, const std::string& name, + const Gaudi::Details::PropertyBase* property, const std::string& doc = "" ); + // ======================================================================== + /** simple function to set the property of the given object from another + * property + * + * @code + * + * IProperty* component = ... ; + * + * const Gaudi::Details::PropertyBase& prop = ... ; + * StatusCode sc = setProperty ( component , "Data" , prop ) ; + * + * @endcode + * + * @param component component which needs to be configured + * @param name name of the property + * @param property the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + GAUDI_API StatusCode setProperty( IProperty* component, const std::string& name, + const Gaudi::Details::PropertyBase& property, const std::string& doc = "" ); + // ======================================================================== + /** simple function to set the property of the given object from another + * property + * + * @code + * + * IProperty* component = ... ; + * + * Gaudi::Property > m_data = ... ; + * + * StatusCode sc = setProperty ( component , "Data" , prop ) ; + * + * @endcode + * + * @param component component which needs to be configured + * @param name name of the property + * @param value the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + template + StatusCode setProperty( IProperty* component, const std::string& name, const Gaudi::Property& value, + const std::string& doc = "" ) { + return setProperty( component, name, &value, doc ); + } + // ======================================================================== + /** simple function to set the property of the given object from the value + * + * @code + * + * IInterface* component = ... ; + * + * std::vector data = ... ; + * StatusCode sc = setProperty ( component , "Data" , data ) ; + * + * @endcode + * + * @param component component which needs to be configured + * @param name name of the property + * @param value value of the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + template + StatusCode setProperty( IInterface* component, const std::string& name, const TYPE& value, + const std::string& doc = "" ) { + if ( !component ) { return StatusCode::FAILURE; } + auto property = SmartIF{component}; + return property ? setProperty( property, name, value, doc ) : StatusCode::FAILURE; + } + // ======================================================================== + /** the full specialization of the + * method setProperty( IInterface , std::string, const TYPE&) + * for standard strings + * + * @param component component which needs to be configured + * @param name name of the property + * @param value value of the property + * @param doc the new documentation string + * + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + GAUDI_API StatusCode setProperty( IInterface* component, const std::string& name, const std::string& value, + const std::string& doc = "" ); + // ======================================================================== + /** the full specialization of the + * method setProperty( IInterface , std::string, const TYPE&) + * for C-strings + * + * @param component component which needs to be configured + * @param name name of the property + * @param value value of the property + * @param doc the new documentation string + * + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + GAUDI_API StatusCode setProperty( IInterface* component, const std::string& name, const char* value, + const std::string& doc = "" ); + // ======================================================================== + /** the full specialization of the + * method setProperty( IInterface, std::string, const TYPE&) + * for C-arrays + * + * @param component component which needs to be configured + * @param name name of the property + * @param value value of the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + template + StatusCode setProperty( IInterface* component, const std::string& name, const char ( &value )[N], + const std::string& doc = "" ) { + if ( 0 == component ) { return StatusCode::FAILURE; } + return setProperty( component, name, std::string{value, value + N}, doc ); + } + // ======================================================================== + /** simple function to set the property of the given object from another + * property + * + * @code + * + * IInterface* component = ... ; + * + * const Gaudi::Details::PropertyBase* prop = ... ; + * StatusCode sc = setProperty ( component , "Data" , prop ) ; + * + * @endcode + * + * @param component component which needs to be configured + * @param name name of the property + * @param property the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + GAUDI_API StatusCode setProperty( IInterface* component, const std::string& name, + const Gaudi::Details::PropertyBase* property, const std::string& doc = "" ); + // ======================================================================== + /** simple function to set the property of the given object from another + * property + * + * @code + * + * IInterface* component = ... ; + * + * const Gaudi::Details::PropertyBase& prop = ... ; + * StatusCode sc = setProperty ( component , "Data" , prop ) ; + * + * @endcode + * + * @param component component which needs to be configured + * @param name name of the property + * @param property the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + GAUDI_API StatusCode setProperty( IInterface* component, const std::string& name, + const Gaudi::Details::PropertyBase& property, const std::string& doc = "" ); + // ======================================================================== + /** simple function to set the property of the given object from another + * property + * + * @code + * + * IInterface* component = ... ; + * + * Gaudi::Property > m_data = ... ; + * + * StatusCode sc = setProperty ( component , "Data" , prop ) ; + * + * @endcode + * + * @param component component which needs to be configured + * @param name name of the property + * @param value the property + * @param doc the new documentation string + * + * @see IProperty + * @author Vanya BELYAEV ibelyaev@physics.syr.edu + * @date 2007-05-13 + */ + template + StatusCode setProperty( IInterface* component, const std::string& name, const Gaudi::Property& value, + const std::string& doc = "" ) { + return setProperty( component, name, &value, doc ); + } + // ======================================================================== + } // namespace Utils +} // end of namespace Gaudi diff --git a/GaudiKernel/Gaudi/PropertyFwd.h b/GaudiKernel/Gaudi/PropertyFwd.h new file mode 100644 index 0000000000..573bd1bd09 --- /dev/null +++ b/GaudiKernel/Gaudi/PropertyFwd.h @@ -0,0 +1,18 @@ +#pragma once +/// Forward declarations for Gaudi/Property.h + +/// macro to help implementing backward compatible changed +/// in derived projects +#define GAUDI_PROPERTY_v2 + +namespace Gaudi { + namespace Details { + class PropertyBase; + namespace Property { + struct NullVerifier; + struct UpdateHandler; + } // namespace Property + } // namespace Details + template + class Property; +} // namespace Gaudi diff --git a/GaudiKernel/GaudiKernel/AppReturnCode.h b/GaudiKernel/GaudiKernel/AppReturnCode.h index 005e03fa4d..590e647f56 100644 --- a/GaudiKernel/GaudiKernel/AppReturnCode.h +++ b/GaudiKernel/GaudiKernel/AppReturnCode.h @@ -7,7 +7,7 @@ #define APPRETURNCODE_H_ #include "GaudiKernel/IProperty.h" -#include "GaudiKernel/Property.h" +#include namespace Gaudi { /// ApplicationMgr return code definitions. diff --git a/GaudiKernel/GaudiKernel/Auditor.h b/GaudiKernel/GaudiKernel/Auditor.h index 7c8924f0a5..516ce89b2b 100644 --- a/GaudiKernel/GaudiKernel/Auditor.h +++ b/GaudiKernel/GaudiKernel/Auditor.h @@ -7,10 +7,10 @@ #include "GaudiKernel/IProperty.h" #include "GaudiKernel/IService.h" #include "GaudiKernel/ISvcLocator.h" /*used by service(..)*/ -#include "GaudiKernel/PropertyFwd.h" #include "GaudiKernel/PropertyHolder.h" #include #include +#include #include #include diff --git a/GaudiKernel/GaudiKernel/CArrayAsProperty.h b/GaudiKernel/GaudiKernel/CArrayAsProperty.h index dea40c1ef9..9599493ec9 100644 --- a/GaudiKernel/GaudiKernel/CArrayAsProperty.h +++ b/GaudiKernel/GaudiKernel/CArrayAsProperty.h @@ -3,7 +3,7 @@ #endif #ifndef GAUDIKERNEL_CARRAYASPROPERTY_H # define GAUDIKERNEL_CARRAYASPROPERTY_H -# include "GaudiKernel/Property.h" +# include namespace Gaudi { template diff --git a/GaudiKernel/GaudiKernel/DataHandleHolderBase.h b/GaudiKernel/GaudiKernel/DataHandleHolderBase.h index fe1dfce11c..5eaeab5fc6 100644 --- a/GaudiKernel/GaudiKernel/DataHandleHolderBase.h +++ b/GaudiKernel/GaudiKernel/DataHandleHolderBase.h @@ -5,7 +5,7 @@ #include "GaudiKernel/DataObjID.h" #include "GaudiKernel/GaudiException.h" #include "GaudiKernel/IDataHandleHolder.h" -#include "GaudiKernel/Property.h" +#include #include #include diff --git a/GaudiKernel/GaudiKernel/DataObjIDProperty.h b/GaudiKernel/GaudiKernel/DataObjIDProperty.h index 8af5681c6f..4a00d3aa91 100644 --- a/GaudiKernel/GaudiKernel/DataObjIDProperty.h +++ b/GaudiKernel/GaudiKernel/DataObjIDProperty.h @@ -2,7 +2,7 @@ #define GAUDIKERNEL_DATAOBJIDPROPERTY_H 1 #include "GaudiKernel/DataObjID.h" -#include "GaudiKernel/Property.h" +#include [[deprecated( "replace DataObjIDProperty by Gaudi::Property" )]] typedef Gaudi::Property DataObjIDProperty; diff --git a/GaudiKernel/GaudiKernel/EventSelectorDataStream.h b/GaudiKernel/GaudiKernel/EventSelectorDataStream.h index 10570b6148..687683a383 100644 --- a/GaudiKernel/GaudiKernel/EventSelectorDataStream.h +++ b/GaudiKernel/GaudiKernel/EventSelectorDataStream.h @@ -14,7 +14,7 @@ // Include files #include "GaudiKernel/IEvtSelector.h" -#include "GaudiKernel/Property.h" +#include // STL include files #include diff --git a/GaudiKernel/GaudiKernel/GaudiHandle.h b/GaudiKernel/GaudiKernel/GaudiHandle.h index 1db016e497..bd5c536cc9 100644 --- a/GaudiKernel/GaudiKernel/GaudiHandle.h +++ b/GaudiKernel/GaudiKernel/GaudiHandle.h @@ -4,8 +4,8 @@ // Includes #include "GaudiKernel/GaudiException.h" #include "GaudiKernel/IInterface.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/System.h" +#include #include #include diff --git a/GaudiKernel/GaudiKernel/HistoProperty.h b/GaudiKernel/GaudiKernel/HistoProperty.h index 069c26b19f..363300f7ce 100644 --- a/GaudiKernel/GaudiKernel/HistoProperty.h +++ b/GaudiKernel/GaudiKernel/HistoProperty.h @@ -6,7 +6,7 @@ // GaudiKernel // ============================================================================ #include "GaudiKernel/HistoDef.h" -#include "GaudiKernel/Property.h" +#include namespace Gaudi { namespace Details { namespace Property { diff --git a/GaudiKernel/GaudiKernel/IJobOptionsSvc.h b/GaudiKernel/GaudiKernel/IJobOptionsSvc.h index 03e11c75b7..f626d88b80 100644 --- a/GaudiKernel/GaudiKernel/IJobOptionsSvc.h +++ b/GaudiKernel/GaudiKernel/IJobOptionsSvc.h @@ -2,8 +2,8 @@ #define KERNEL_IJOBOPTIONSSVC_H // Include files #include "GaudiKernel/IInterface.h" -#include "GaudiKernel/PropertyFwd.h" #include +#include #include #include diff --git a/GaudiKernel/GaudiKernel/IProperty.h b/GaudiKernel/GaudiKernel/IProperty.h index c2cbf355fd..ba0b03a51a 100644 --- a/GaudiKernel/GaudiKernel/IProperty.h +++ b/GaudiKernel/GaudiKernel/IProperty.h @@ -1,10 +1,9 @@ -#ifndef GAUDIKERNEL_IPROPERTY_H -#define GAUDIKERNEL_IPROPERTY_H +#pragma once // Include Files -#include "GaudiKernel/IInterface.h" -#include "GaudiKernel/Property.h" -#include "GaudiKernel/ToStream.h" +#include +#include +#include #include #include #include @@ -78,4 +77,3 @@ public: /// Return true if we have a property with the given name. virtual bool hasProperty( const std::string& name ) const = 0; }; -#endif // GAUDIKERNEL_IPROPERTY_H diff --git a/GaudiKernel/GaudiKernel/IVersHistoryObj.h b/GaudiKernel/GaudiKernel/IVersHistoryObj.h index de56be9a21..35fc94a999 100644 --- a/GaudiKernel/GaudiKernel/IVersHistoryObj.h +++ b/GaudiKernel/GaudiKernel/IVersHistoryObj.h @@ -2,7 +2,7 @@ #define GAUDIKERNEL_IVERSHISTORYOBJ_H #include "GaudiKernel/Kernel.h" // GAUDI_API -#include "GaudiKernel/PropertyFwd.h" +#include #include #include diff --git a/GaudiKernel/GaudiKernel/JobHistory.h b/GaudiKernel/GaudiKernel/JobHistory.h index e8fdc89b3d..672115d896 100644 --- a/GaudiKernel/GaudiKernel/JobHistory.h +++ b/GaudiKernel/GaudiKernel/JobHistory.h @@ -4,8 +4,8 @@ #include "GaudiKernel/HistoryObj.h" #include "GaudiKernel/IVersHistoryObj.h" -#include "GaudiKernel/Property.h" #include +#include #include #include diff --git a/GaudiKernel/GaudiKernel/Property.h b/GaudiKernel/GaudiKernel/Property.h index ddd43176f4..80ed82b1bf 100644 --- a/GaudiKernel/GaudiKernel/Property.h +++ b/GaudiKernel/GaudiKernel/Property.h @@ -1,1499 +1,25 @@ -#ifndef GAUDIKERNEL_PROPERTY_H -#define GAUDIKERNEL_PROPERTY_H -// ============================================================================ -// STD & STL -// ============================================================================ -#include -#include -#include -#include -// ============================================================================ -// Application C++ Class Headers -// ============================================================================ -#include "GaudiKernel/IProperty.h" -#include "GaudiKernel/Kernel.h" -#include "GaudiKernel/PropertyFwd.h" -#include "GaudiKernel/SmartIF.h" -#include "GaudiKernel/TaggedBool.h" -#include "GaudiKernel/ToStream.h" -#include -#include - -namespace Gaudi { - namespace Details { - class WeekPropertyRef; - - // ============================================================================ - /** PropertyBase base class allowing PropertyBase* collections to be "homogeneous" - * - * \author Paul Maley - * \author CTDay - * \author Vanya BELYAEV ibelyaev@physics.syr.edu - * \author Marco Clemencic - */ - class GAUDI_API PropertyBase { - - public: - /// property name - const std::string name() const { return std::string{m_name}; } - /// property documentation - std::string documentation() const { return std::string{m_documentation}; } - /// property type-info - const std::type_info* type_info() const { return m_typeinfo; } - /// property type - std::string type() const { return m_typeinfo->name(); } - /// export the property value to the destination - virtual bool load( PropertyBase& dest ) const = 0; - /// import the property value form the source - virtual bool assign( const PropertyBase& source ) = 0; - - public: - /// value -> string - virtual std::string toString() const = 0; - /// value -> stream - virtual void toStream( std::ostream& out ) const = 0; - /// string -> value - virtual StatusCode fromString( const std::string& value ) = 0; - - public: - /// set new callback for reading - virtual PropertyBase& declareReadHandler( std::function fun ) = 0; - /// set new callback for update - virtual PropertyBase& declareUpdateHandler( std::function fun ) = 0; - - /// get a reference to the readCallBack - virtual const std::function readCallBack() const = 0; - /// get a reference to the updateCallBack - virtual const std::function updateCallBack() const = 0; - - /// manual trigger for callback for update - virtual bool useUpdateHandler() = 0; - - template - PropertyBase& declareReadHandler( void ( HT::*MF )( PropertyBase& ), HT* instance ) { - return declareReadHandler( [=]( PropertyBase& p ) { ( instance->*MF )( p ); } ); - } - - template - PropertyBase& declareUpdateHandler( void ( HT::*MF )( PropertyBase& ), HT* instance ) { - return declareUpdateHandler( [=]( PropertyBase& p ) { ( instance->*MF )( p ); } ); - } - - public: - /// virtual destructor - virtual inline ~PropertyBase(); - /// set the new value for the property name - void setName( std::string value ) { m_name = to_view( std::move( value ) ); } - /// set the documentation string - void setDocumentation( std::string value ) { m_documentation = to_view( std::move( value ) ); } - /// the printout of the property value - virtual std::ostream& fillStream( std::ostream& ) const; - /// clones the current property - virtual PropertyBase* clone() const = 0; - - /// set the type of the owner class (used for documentation) - void setOwnerType( const std::type_info& ownerType ) { m_ownerType = &ownerType; } - - /// set the type of the owner class (used for documentation) - template - void setOwnerType() { - setOwnerType( typeid( OWNER ) ); - } - - /// get the type of the owner class (used for documentation) - const std::type_info* ownerType() const { return m_ownerType; } - - /// get the string for the type of the owner class (used for documentation) - std::string ownerTypeName() const { - return m_ownerType ? System::typeinfoName( *m_ownerType ) : std::string( "unknown owner type" ); - } - - protected: - /// constructor from the property name and the type - PropertyBase( const std::type_info& type, std::string name = "", std::string doc = "" ) - : m_name( to_view( std::move( name ) ) ) - , m_documentation( to_view( std::move( doc ) ) ) - , m_typeinfo( &type ) {} - /// constructor from the property name and the type - PropertyBase( std::string name, const std::type_info& type ) - : m_name( to_view( std::move( name ) ) ), m_documentation( m_name ), m_typeinfo( &type ) {} - /// copy constructor - PropertyBase( const PropertyBase& ) = default; - /// assignment operator - PropertyBase& operator=( const PropertyBase& ) = default; - - private: - /// helper to map a string to a reliable std::string_view - static std::string_view to_view( std::string str ); - /// property name - std::string_view m_name; - /// property doc string - std::string_view m_documentation; - /// property type - const std::type_info* m_typeinfo; - /// type of owner of the property (if defined) - const std::type_info* m_ownerType = nullptr; - - friend WeekPropertyRef; - std::set m_weekReferences; - void add( WeekPropertyRef* ref ) { - if ( ref ) m_weekReferences.insert( ref ); - } - void remove( WeekPropertyRef* ref ) { m_weekReferences.erase( ref ); } - }; - - /// Optional reference to a property that can be used to refer to a sting or - /// to the strin representation of a property instance value - class GAUDI_API WeekPropertyRef { - friend PropertyBase; - - public: - WeekPropertyRef() = default; - WeekPropertyRef( std::string value ) : m_value{std::move( value )}, m_unset{false} {} - WeekPropertyRef( PropertyBase& property ) : m_property{&property} { property.add( this ); } - WeekPropertyRef( const WeekPropertyRef& other ) = delete; - WeekPropertyRef( WeekPropertyRef&& other ) - : m_property{other.m_property}, m_value{std::move( other.m_value )}, m_unset{other.m_unset} { - if ( m_property ) { - other.m_property = nullptr; - m_property->remove( &other ); - m_property->add( this ); - } - } - ~WeekPropertyRef() { - if ( m_property ) m_property->remove( this ); - } - WeekPropertyRef& operator=( WeekPropertyRef&& other ) { - if ( this != &other ) { - if ( m_property ) m_property->remove( this ); - m_property = other.m_property; - other.m_property = nullptr; - if ( m_property ) { - m_property->remove( &other ); - m_property->add( this ); - } - m_value = std::move( other.m_value ); - m_unset = other.m_unset; - } - return *this; - } - WeekPropertyRef& operator=( PropertyBase& value ) { - if ( m_property != &value ) { - if ( m_property ) { - m_property->remove( this ); - if ( !m_unset ) m_value = m_property->toString(); - } - if ( !m_unset ) value.fromString( m_value ).ignore(); - m_property = &value; - value.add( this ); - } - return *this; - } - WeekPropertyRef& operator=( const std::string& value ) { - if ( m_property ) m_property->fromString( value ).ignore(); - m_value = value; - m_unset = false; - return *this; - } - operator std::string() const { return m_property ? m_property->toString() : m_value; } - - inline bool isBound() const { return m_property; } - inline bool isSet() const { return !m_unset; } - - private: - PropertyBase* m_property = nullptr; - std::string m_value; - bool m_unset = true; - - void detach() { m_property = nullptr; } - }; - - inline PropertyBase::~PropertyBase() { - for ( auto ref : m_weekReferences ) { ref->detach(); } - } - - inline std::ostream& operator<<( std::ostream& stream, const PropertyBase& prop ) { - return prop.fillStream( stream ); - } - - namespace Property { - using ImmediatelyInvokeHandler = Gaudi::tagged_bool; - - // ========================================================================== - // The following code is going to be a bit unpleasant, but as far as its - // author can tell, it is as simple as the design constraints and C++'s - // implementation constraints will allow. If you disagree, please submit - // a patch which simplifies it. Here is the underlying design rationale: - // - // - For any given type T used in a Property, we want to have an - // associated StringConverter struct which explains how to convert a - // value of that type into a string (toString) and parse that string - // back (fromString). - // - There is a default implementation, called DefaultStringConverter, - // which is based on the overloadable parse() and toStream() global - // methods of Gaudi. Its exact behaviour varies depending on whether T - // is default-constructible or only copy-constructible, which requires a - // layer of SFINAE indirection. - // - Some people want to be able to specialize StringConverter as an - // alternative to defining parse/toStream overloads. This interferes - // with the SFINAE tricks used by DefaultStringConverter, so we cannot - // just call a DefaultStringConverter a StringConverter and must add one - // more layer to the StringConverter type hierarchy. - - // This class factors out commonalities between DefaultStringConverters - template - struct DefaultStringConverterImpl { - public: - virtual ~DefaultStringConverterImpl() = default; - std::string toString( const TYPE& v ) { - using Gaudi::Utils::toString; - return toString( v ); - } - - // Implementation of fromString depends on whether TYPE is default- - // constructible (fastest, easiest) or only copy-constructible (still - // doable as long as the caller can provide a valid value of TYPE) - virtual TYPE fromString( const TYPE& ref_value, const std::string& s ) = 0; - - protected: - void fromStringImpl( TYPE& buffer, const std::string& s ) { - using Gaudi::Parsers::InputData; - if ( !parse( buffer, InputData{s} ).isSuccess() ) { - throw std::invalid_argument( "cannot parse '" + s + "' to " + System::typeinfoName( typeid( TYPE ) ) ); - } - } - }; - - // This class provides a default implementation of StringConverter based - // on the overloadable parse() and toStream() global Gaudi methods. - // - // It leverages the fact that TYPE is default-constructible if it can, and - // falls back fo a requirement of copy-constructibility if it must. So - // here is the "default" implementation for copy-constructible types... - // - template - struct DefaultStringConverter : DefaultStringConverterImpl { - TYPE fromString( const TYPE& ref_value, const std::string& s ) final override { - TYPE buffer = ref_value; - this->fromStringImpl( buffer, s ); - return buffer; - } - }; - // ...and here is the preferred impl for default-constructible types: - template - struct DefaultStringConverter::value>> - : DefaultStringConverterImpl { - TYPE fromString( const TYPE& /* ref_value */, const std::string& s ) final override { - TYPE buffer{}; - this->fromStringImpl( buffer, s ); - return buffer; - } - }; - - // Specializable StringConverter struct with a default implementation - template - struct StringConverter : DefaultStringConverter {}; - - struct NullVerifier { - template - void operator()( const TYPE& ) const {} - }; - template - struct BoundedVerifier { - void operator()( const TYPE& value ) const { - using Gaudi::Utils::toString; - // throw the exception if the limit is defined and value is outside - if ( ( m_hasLowerBound && ( value < m_lowerBound ) ) || ( m_hasUpperBound && ( m_upperBound < value ) ) ) - throw std::out_of_range( "value " + toString( value ) + " outside range" ); - } - - /// Return if it has a lower bound - bool hasLower() const { return m_hasLowerBound; } - /// Return if it has a lower bound - bool hasUpper() const { return m_hasUpperBound; } - /// Return the lower bound value - const TYPE& lower() const { return m_lowerBound; } - /// Return the upper bound value - const TYPE& upper() const { return m_upperBound; } - - /// Set lower bound value - void setLower( const TYPE& value ) { - m_hasLowerBound = true; - m_lowerBound = value; - } - /// Set upper bound value - void setUpper( const TYPE& value ) { - m_hasUpperBound = true; - m_upperBound = value; - } - /// Clear lower bound value - void clearLower() { - m_hasLowerBound = false; - m_lowerBound = TYPE(); - } - /// Clear upper bound value - void clearUpper() { - m_hasUpperBound = false; - m_upperBound = TYPE(); - } - - /// Set both bounds (lower and upper) at the same time - void setBounds( const TYPE& lower, const TYPE& upper ) { - setLower( lower ); - setUpper( upper ); - } - - /// Clear both bounds (lower and upper) at the same time - void clearBounds() { - clearLower(); - clearUpper(); - } - - private: - /// Data members - bool m_hasLowerBound{false}; - bool m_hasUpperBound{false}; - TYPE m_lowerBound{}; - TYPE m_upperBound{}; - }; - - /// helper to disable a while triggering it, to avoid infinite recursion - struct SwapCall { - using callback_t = std::function; - callback_t tmp, &orig; - SwapCall( callback_t& input ) : orig( input ) { tmp.swap( orig ); } - ~SwapCall() { orig.swap( tmp ); } - void operator()( PropertyBase& p ) const { tmp( p ); } - }; - - struct NoHandler { - void useReadHandler( const PropertyBase& ) const {} - void setReadHandler( std::function ) { - throw std::logic_error( "setReadHandler not implemented for this class" ); - } - std::function getReadHandler() const { return nullptr; } - void useUpdateHandler( const PropertyBase& ) const {} - void setUpdateHandler( std::function ) { - throw std::logic_error( "setUpdateHandler not implemented for this class" ); - } - std::function getUpdateHandler() const { return nullptr; } - }; - struct ReadHandler : NoHandler { - mutable std::function m_readCallBack; - void useReadHandler( const PropertyBase& p ) const { - if ( m_readCallBack ) { SwapCall{m_readCallBack}( const_cast( p ) ); } - } - void setReadHandler( std::function fun ) { m_readCallBack = std::move( fun ); } - std::function getReadHandler() const { return m_readCallBack; } - }; - struct UpdateHandler : NoHandler { - std::function m_updateCallBack; - void useUpdateHandler( PropertyBase& p ) { - if ( m_updateCallBack ) { - try { - SwapCall{m_updateCallBack}( p ); - } catch ( const std::exception& x ) { - throw std::invalid_argument( "failure in update handler of '" + p.name() + "': " + x.what() ); - } - } - } - void setUpdateHandler( std::function fun ) { m_updateCallBack = std::move( fun ); } - std::function getUpdateHandler() const { return m_updateCallBack; } - }; - struct ReadUpdateHandler : ReadHandler, UpdateHandler { - using ReadHandler::getReadHandler; - using ReadHandler::setReadHandler; - using ReadHandler::useReadHandler; - using UpdateHandler::getUpdateHandler; - using UpdateHandler::setUpdateHandler; - using UpdateHandler::useUpdateHandler; - }; - } // namespace Property - - } // namespace Details - - // ============================================================================ - /** Implementation of property with value of concrete type. - * - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2006-02-27 - * @author Marco Clemencic - * @date 2016-06-16 - */ - // ============================================================================ - template - class Property : public Details::PropertyBase { - public: - // ========================================================================== - /// Hosted type - using StorageType = TYPE; - using ValueType = typename std::remove_reference::type; - using VerifierType = VERIFIER; - using HandlersType = HANDLERS; - // ========================================================================== - - private: - /// Storage. - StorageType m_value; - VerifierType m_verifier; - HandlersType m_handlers; - /// helper typedefs for SFINAE - /// @{ - template - using is_this_type = std::is_same>; - template - using not_copying = std::enable_if_t::value>; - /// @} - public: - // ========================================================================== - /// the constructor with property name, value and documentation. - template - Property( std::string name, T&& value, std::string doc = "" ) - : Details::PropertyBase( typeid( ValueType ), std::move( name ), std::move( doc ) ) - , m_value( std::forward( value ) ) { - m_verifier( m_value ); - } - /// Autodeclaring constructor with property name, value and documentation. - /// @note the use std::enable_if is required to avoid ambiguities - template ::value>, - typename = std::enable_if_t::value>> - Property( OWNER* owner, std::string name ) : Property( std::move( name ), ValueType{}, "" ) { - owner->declareProperty( *this ); - setOwnerType(); - } - - /// Autodeclaring constructor with property name, value and documentation. - /// @note the use std::enable_if is required to avoid ambiguities - template ::value>> - Property( OWNER* owner, std::string name, T&& value, std::string doc = "" ) - : Property( std::move( name ), std::forward( value ), std::move( doc ) ) { - owner->declareProperty( *this ); - setOwnerType(); - } - - /// Autodeclaring constructor with property name, value, updateHandler and documentation. - /// @note the use std::enable_if is required to avoid ambiguities - template ::value>> - Property( OWNER* owner, std::string name, T&& value, std::function handler, - std::string doc = "" ) - : Property( owner, std::move( name ), std::forward( value ), std::move( doc ) ) { - declareUpdateHandler( std::move( handler ) ); - } - - /// Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation. - /// @note the use std::enable_if is required to avoid ambiguities - template ::value>> - Property( OWNER* owner, std::string name, T&& value, void ( OWNER::*handler )( PropertyBase& ), - std::string doc = "" ) - : Property( - owner, std::move( name ), std::forward( value ), - [owner, handler]( PropertyBase& p ) { ( owner->*handler )( p ); }, std::move( doc ) ) {} - /// Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation. - /// @note the use std::enable_if is required to avoid ambiguities - template ::value>> - Property( OWNER* owner, std::string name, T&& value, void ( OWNER::*handler )(), std::string doc = "" ) - : Property( - owner, std::move( name ), std::forward( value ), - [owner, handler]( PropertyBase& ) { ( owner->*handler )(); }, std::move( doc ) ) {} - - /// Autodeclaring constructor with property name, value, updateHandler and documentation. - /// @note the use std::enable_if is required to avoid ambiguities - template ::value>> - Property( OWNER* owner, std::string name, T&& value, std::function handler, - Details::Property::ImmediatelyInvokeHandler invoke, std::string doc = "" ) - : Property( owner, std::move( name ), std::forward( value ), std::move( handler ), std::move( doc ) ) { - if ( invoke ) useUpdateHandler(); - } - - /// Construct an anonymous property from a value. - /// This constructor is not generated if T is the current type, so that the - /// compiler picks up the copy constructor instead of this one. - template > - Property( T&& v ) : Details::PropertyBase( typeid( ValueType ), "", "" ), m_value( std::forward( v ) ) {} - - /// Construct an anonymous property with default constructed value. - /// Can be used only if StorageType is default constructible. - template ::value>> - Property() : Details::PropertyBase( typeid( ValueType ), "", "" ), m_value() {} - - using Details::PropertyBase::declareReadHandler; - using Details::PropertyBase::declareUpdateHandler; - - /// set new callback for reading - Details::PropertyBase& declareReadHandler( std::function fun ) override { - m_handlers.setReadHandler( std::move( fun ) ); - return *this; - } - /// set new callback for update - Details::PropertyBase& declareUpdateHandler( std::function fun ) override { - m_handlers.setUpdateHandler( std::move( fun ) ); - return *this; - } - - /// get a reference to the readCallBack - const std::function readCallBack() const override { - return m_handlers.getReadHandler(); - } - /// get a reference to the updateCallBack - const std::function updateCallBack() const override { - return m_handlers.getUpdateHandler(); - } - - /// manual trigger for callback for update - bool useUpdateHandler() override { - m_handlers.useUpdateHandler( *this ); - return true; - } - - /// Automatic conversion to value (const reference). - operator const ValueType&() const { - m_handlers.useReadHandler( *this ); - return m_value; - } - // /// Automatic conversion to value (reference). - // operator ValueType& () { - // useReadHandler(); - // return m_value; - // } - - /// equality comparison - template - bool operator==( const T& other ) const { - return m_value == other; - } - - /// inequality comparison - template - bool operator!=( const T& other ) const { - return m_value != other; - } - - /// "less" comparison - template - bool operator<( const T& other ) const { - return m_value < other; - } - - /// allow addition if possible between the property and the other types - template - decltype( auto ) operator+( const T& other ) const { - return m_value + other; - } - - /// Assignment from value. - template - Property& operator=( T&& v ) { - m_verifier( v ); - m_value = std::forward( v ); - m_handlers.useUpdateHandler( *this ); - return *this; - } - - /// Accessor to verifier. - const VerifierType& verifier() const { return m_verifier; } - /// Accessor to verifier. - VerifierType& verifier() { return m_verifier; } - - /// Backward compatibility (\deprecated will be removed) - /// @{ - const ValueType& value() const { return *this; } - ValueType& value() { return const_cast( (const ValueType&)*this ); } - bool setValue( const ValueType& v ) { - *this = v; - return true; - } - bool set( const ValueType& v ) { - *this = v; - return true; - } - Details::PropertyBase* clone() const override { return new Property( *this ); } - /// @} - - /// @name Helpers for easy use of string and vector properties. - /// @{ - /// They are instantiated only if they are implemented in the wrapped class. - template - decltype( auto ) size() const { - return value().size(); - } - template - decltype( auto ) length() const { - return value().length(); - } - template - decltype( auto ) empty() const { - return value().empty(); - } - template - decltype( auto ) clear() { - value().clear(); - } - template - decltype( auto ) begin() const { - return value().begin(); - } - template - decltype( auto ) end() const { - return value().end(); - } - template - decltype( auto ) begin() { - return value().begin(); - } - template - decltype( auto ) end() { - return value().end(); - } - template - decltype( auto ) operator[]( const ARG& arg ) const { - return value()[arg]; - } - template - decltype( auto ) operator[]( const ARG& arg ) { - return value()[arg]; - } - template - decltype( auto ) find( const typename T::key_type& key ) const { - return value().find( key ); - } - template - decltype( auto ) find( const typename T::key_type& key ) { - return value().find( key ); - } - template - decltype( auto ) erase( ARG arg ) { - return value().erase( arg ); - } - template - Property& operator++() { - ++value(); - return *this; - } - template - ValueType operator++( int ) { - return m_value++; - } - template - Property& operator--() { - --value(); - return *this; - } - template - ValueType operator--( int ) { - return m_value--; - } - template - Property& operator+=( const T& other ) { - m_value += other; - return *this; - } - template - Property& operator-=( const T& other ) { - m_value -= other; - return *this; - } - /// Helpers for DataHandles and derived classes - template - decltype( auto ) key() const { - return value().key(); - } - template - decltype( auto ) objKey() const { - return value().objKey(); - } - template - decltype( auto ) fullKey() const { - return value().fullKey(); - } - template - decltype( auto ) initialize() { - return value().initialize(); - } - template - decltype( auto ) makeHandles() const { - return value().makeHandles(); - } - template - decltype( auto ) makeHandles( const ARG& arg ) const { - return value().makeHandles( arg ); - } - /// @} - // ========================================================================== - - // Delegate operator() to the value - template - decltype( std::declval()( std::declval()... ) ) operator()( Args&&... args ) const - noexcept( noexcept( std::declval()( std::declval()... ) ) ) { - return value()( std::forward( args )... ); - } - - public: - /// get the value from another property - bool assign( const Details::PropertyBase& source ) override { - // Check if the property of is of "the same" type, except for strings - const Property* p = - ( std::is_same::value ) ? nullptr : dynamic_cast( &source ); - if ( p ) { - *this = p->value(); - } else if ( source.type_info() == &typeid( std::string ) ) { - auto s = dynamic_cast*>( &source ); - this->fromString( s->value() ).ignore(); - } else { - this->fromString( source.toString() ).ignore(); - } - return true; - } - /// set value to another property - bool load( Details::PropertyBase& dest ) const override { - // delegate to the 'opposite' method - return dest.assign( *this ); - } - /// string -> value - StatusCode fromString( const std::string& source ) override { - using Converter = Details::Property::StringConverter; - *this = Converter().fromString( m_value, source ); - return StatusCode::SUCCESS; - } - /// value -> string - std::string toString() const override { - using Converter = Details::Property::StringConverter; - return Converter().toString( *this ); - } - /// value -> stream - void toStream( std::ostream& out ) const override { - m_handlers.useReadHandler( *this ); - using Utils::toStream; - toStream( m_value, out ); - } - }; - - /// delegate (value == property) to property operator== - template - bool operator==( const T& v, const Property& p ) { - return p == v; - } - - /// delegate (value != property) to property operator!= - template - bool operator!=( const T& v, const Property& p ) { - return p != v; - } - - /// implemantation of (value + property) - template - decltype( auto ) operator+( const T& v, const Property& p ) { - return v + p.value(); - } - - template - using CheckedProperty = Property, HANDLERS>; - - template - using PropertyWithReadHandler = - Property; - -} // namespace Gaudi - -template -using SimpleProperty = Gaudi::Property; - -template -using SimplePropertyRef = Gaudi::Property; - -// Typedef Properties for built-in types -typedef Gaudi::Property BooleanProperty; -typedef Gaudi::Property CharProperty; -typedef Gaudi::Property SignedCharProperty; -typedef Gaudi::Property UnsignedCharProperty; -typedef Gaudi::Property ShortProperty; -typedef Gaudi::Property UnsignedShortProperty; -typedef Gaudi::Property IntegerProperty; -typedef Gaudi::Property UnsignedIntegerProperty; -typedef Gaudi::Property LongProperty; -typedef Gaudi::Property UnsignedLongProperty; -typedef Gaudi::Property LongLongProperty; -typedef Gaudi::Property UnsignedLongLongProperty; -typedef Gaudi::Property FloatProperty; -typedef Gaudi::Property DoubleProperty; -typedef Gaudi::Property LongDoubleProperty; - -typedef Gaudi::Property StringProperty; - -// Typedef PropertyRefs for built-in types -typedef Gaudi::Property BooleanPropertyRef; -typedef Gaudi::Property CharPropertyRef; -typedef Gaudi::Property SignedCharPropertyRef; -typedef Gaudi::Property UnsignedCharPropertyRef; -typedef Gaudi::Property ShortPropertyRef; -typedef Gaudi::Property UnsignedShortPropertyRef; -typedef Gaudi::Property IntegerPropertyRef; -typedef Gaudi::Property UnsignedIntegerPropertyRef; -typedef Gaudi::Property LongPropertyRef; -typedef Gaudi::Property UnsignedLongPropertyRef; -typedef Gaudi::Property LongLongPropertyRef; -typedef Gaudi::Property UnsignedLongLongPropertyRef; -typedef Gaudi::Property FloatPropertyRef; -typedef Gaudi::Property DoublePropertyRef; -typedef Gaudi::Property LongDoublePropertyRef; - -typedef Gaudi::Property StringPropertyRef; - -// Typedef "Arrays" of Properties for built-in types -typedef Gaudi::Property> BooleanArrayProperty; -typedef Gaudi::Property> CharArrayProperty; -typedef Gaudi::Property> SignedCharArrayProperty; -typedef Gaudi::Property> UnsignedCharArrayProperty; -typedef Gaudi::Property> ShortArrayProperty; -typedef Gaudi::Property> UnsignedShortArrayProperty; -typedef Gaudi::Property> IntegerArrayProperty; -typedef Gaudi::Property> UnsignedIntegerArrayProperty; -typedef Gaudi::Property> LongArrayProperty; -typedef Gaudi::Property> UnsignedLongArrayProperty; -typedef Gaudi::Property> LongLongArrayProperty; -typedef Gaudi::Property> UnsignedLongLongArrayProperty; -typedef Gaudi::Property> FloatArrayProperty; -typedef Gaudi::Property> DoubleArrayProperty; -typedef Gaudi::Property> LongDoubleArrayProperty; - -typedef Gaudi::Property> StringArrayProperty; - -// Typedef "Arrays" of PropertyRefs for built-in types -typedef Gaudi::Property&> BooleanArrayPropertyRef; -typedef Gaudi::Property&> CharArrayPropertyRef; -typedef Gaudi::Property&> SignedCharArrayPropertyRef; -typedef Gaudi::Property&> UnsignedCharArrayPropertyRef; -typedef Gaudi::Property&> ShortArrayPropertyRef; -typedef Gaudi::Property&> UnsignedShortArrayPropertyRef; -typedef Gaudi::Property&> IntegerArrayPropertyRef; -typedef Gaudi::Property&> UnsignedIntegerArrayPropertyRef; -typedef Gaudi::Property&> LongArrayPropertyRef; -typedef Gaudi::Property&> UnsignedLongArrayPropertyRef; -typedef Gaudi::Property&> LongLongArrayPropertyRef; -typedef Gaudi::Property&> UnsignedLongLongArrayPropertyRef; -typedef Gaudi::Property&> FloatArrayPropertyRef; -typedef Gaudi::Property&> DoubleArrayPropertyRef; -typedef Gaudi::Property&> LongDoubleArrayPropertyRef; - -typedef Gaudi::Property&> StringArrayPropertyRef; - -/// Helper class to simplify the migration old properties deriving directly from -/// PropertyBase. -template -class PropertyWithHandlers : public Gaudi::Details::PropertyBase { - Handler m_handlers; - -public: - using PropertyBase::PropertyBase; - - /// set new callback for reading - PropertyBase& declareReadHandler( std::function fun ) override { - m_handlers.setReadHandler( std::move( fun ) ); - return *this; - } - /// set new callback for update - PropertyBase& declareUpdateHandler( std::function fun ) override { - m_handlers.setUpdateHandler( std::move( fun ) ); - return *this; - } - - /// get a reference to the readCallBack - const std::function readCallBack() const override { return m_handlers.getReadHandler(); } - /// get a reference to the updateCallBack - const std::function updateCallBack() const override { return m_handlers.getUpdateHandler(); } - - /// use the call-back function at reading, if available - void useReadHandler() const { m_handlers.useReadHandler( *this ); } - - /// use the call-back function at update, if available - bool useUpdateHandler() override { - m_handlers.useUpdateHandler( *this ); - return true; - } -}; - -// forward-declaration is sufficient here -class GaudiHandleBase; - -// implementation in header file only where the GaudiHandleBase class -// definition is not needed. The rest goes into the .cpp file. -// The goal is to decouple the header files, to avoid that the whole -// world depends on GaudiHandle.h -class GAUDI_API GaudiHandleProperty : public PropertyWithHandlers<> { -public: - GaudiHandleProperty( std::string name, GaudiHandleBase& ref ); - - GaudiHandleProperty& operator=( const GaudiHandleBase& value ) { - setValue( value ); - return *this; - } - - GaudiHandleProperty* clone() const override { return new GaudiHandleProperty( *this ); } - - bool load( PropertyBase& destination ) const override { return destination.assign( *this ); } - - bool assign( const PropertyBase& source ) override { return fromString( source.toString() ).isSuccess(); } - - std::string toString() const override; - - void toStream( std::ostream& out ) const override; - - StatusCode fromString( const std::string& s ) override; - - const GaudiHandleBase& value() const { - useReadHandler(); - return *m_pValue; - } - - bool setValue( const GaudiHandleBase& value ); - -private: - /** Pointer to the real property. Reference would be better, but ROOT does not - support references yet */ - GaudiHandleBase* m_pValue; -}; - -// forward-declaration is sufficient here -class GaudiHandleArrayBase; - -class GAUDI_API GaudiHandleArrayProperty : public PropertyWithHandlers<> { -public: - GaudiHandleArrayProperty( std::string name, GaudiHandleArrayBase& ref ); - - GaudiHandleArrayProperty& operator=( const GaudiHandleArrayBase& value ) { - setValue( value ); - return *this; - } - - GaudiHandleArrayProperty* clone() const override { return new GaudiHandleArrayProperty( *this ); } - - bool load( PropertyBase& destination ) const override { return destination.assign( *this ); } - - bool assign( const PropertyBase& source ) override { return fromString( source.toString() ).isSuccess(); } - - std::string toString() const override; - - void toStream( std::ostream& out ) const override; - - StatusCode fromString( const std::string& s ) override; - - const GaudiHandleArrayBase& value() const { - useReadHandler(); - return *m_pValue; - } - - bool setValue( const GaudiHandleArrayBase& value ); - -private: - /** Pointer to the real property. Reference would be better, but ROOT does not - support references yet */ - GaudiHandleArrayBase* m_pValue; -}; - -namespace Gaudi { - namespace Utils { - // ======================================================================== - /** simple function which check the existence of the property with - * the given name. - * - * @code - * - * const IProperty* p = ... ; - * - * const bool = hasProperty( p , "Context" ) ; - * - * @endcode - * - * @param p pointer to IProperty object - * @param name property name (case insensitive) - * @return true if "p" has a property with such name - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2006-09-09 - */ - GAUDI_API bool hasProperty( const IProperty* p, const std::string& name ); - // ======================================================================== - /** simple function which check the existence of the property with - * the given name. - * - * @code - * - * IInterface* p = . - * - * const bool = hasProperty( p , "Context" ) ; - * - * @endcode - * - * @param p pointer to IInterface object (any component) - * @param name property name (case insensitive) - * @return true if "p" has a property with such name - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2006-09-09 - */ - GAUDI_API bool hasProperty( const IInterface* p, const std::string& name ); - // ======================================================================== - /** simple function which gets the property with given name - * from the component - * - * @code - * - * const IProperty* p = ... ; - * - * const Gaudi::Details::PropertyBase* pro = getProperty( p , "Context" ) ; - * - * @endcode - * - * @param p pointer to IProperty object - * @param name property name (case insensitive) - * @return property with the given name (if exists), NULL otherwise - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2006-09-09 - */ - GAUDI_API Gaudi::Details::PropertyBase* getProperty( const IProperty* p, const std::string& name ); - // ======================================================================== - /** simple function which gets the property with given name - * from the component - * - * @code - * - * const IInterface* p = ... ; - * - * const Gaudi::Details::PropertyBase* pro = getProperty( p , "Context" ) ; - * - * @endcode - * - * @param p pointer to IInterface object - * @param name property name (case insensitive) - * @return property with the given name (if exists), NULL otherwise - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2006-09-09 - */ - GAUDI_API Gaudi::Details::PropertyBase* getProperty( const IInterface* p, const std::string& name ); - // ======================================================================== - /** check the property by name from the list of the properties - * - * @code - * - * IJobOptionsSvc* svc = ... ; - * - * const std::string client = ... ; - * - * // get the property: - * bool context = - * hasProperty ( svc->getProperties( client ) , "Context" ) - * - * @endcode - * - * @see IJobOptionsSvc - * - * @param p list of properties - * @param name property name (case insensitive) - * @return true if the property exists - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2006-09-09 - */ - GAUDI_API bool hasProperty( const std::vector* p, const std::string& name ); - // ======================================================================== - /** get the property by name from the list of the properties - * - * @code - * - * IJobOptionsSvc* svc = ... ; - * - * const std::string client = ... ; - * - * // get the property: - * const Gaudi::Details::PropertyBase* context = - * getProperty ( svc->getProperties( client ) , "Context" ) - * - * @endcode - * - * @see IJobOptionsSvc - * - * @param p list of properties - * @param name property name (case insensitive) - * @return property with the given name (if exists), NULL otherwise - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2006-09-09 - */ - GAUDI_API const Gaudi::Details::PropertyBase* - getProperty( const std::vector* p, const std::string& name ); - // ======================================================================== - /** simple function to set the property of the given object from the value - * - * @code - * - * IProperty* component = ... ; - * - * std::vector data = ... ; - * StatusCode sc = setProperty ( componet , "Data" , data ) ; - * - * @endcode - * - * Note: the interface IProperty allows setting of the properties either - * directly from other properties or from strings only - * - * @param component component which needs to be configured - * @param name name of the property - * @param value value of the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - template - StatusCode setProperty( IProperty* component, const std::string& name, const TYPE& value, const std::string& doc ); - // ======================================================================== - /** simple function to set the property of the given object from the value - * - * @code - * - * IProperty* component = ... ; - * - * std::vector data = ... ; - * StatusCode sc = setProperty ( componet , "Data" , data ) ; - * - * @endcode - * - * Note: the interface IProperty allows setting of the properties either - * directly from other properties or from strings only - * - * @param component component which needs to be configured - * @param name name of the property - * @param value value of the property - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - template - StatusCode setProperty( IProperty* component, const std::string& name, const TYPE& value ) { - return setProperty( component, name, value, std::string() ); - } - // ======================================================================== - /** the full specialization of the - * previous method setProperty( IProperty, std::string, const TYPE&) - * for standard strings - * - * @param component component which needs to be configured - * @param name name of the property - * @param value value of the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - GAUDI_API StatusCode setProperty( IProperty* component, const std::string& name, const std::string& value, - const std::string& doc = "" ); - // ======================================================================== - /** the full specialization of the - * method setProperty( IProperty, std::string, const TYPE&) - * for C-strings - * - * @param component component which needs to be configured - * @param name name of the property - * @param value value of the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - GAUDI_API StatusCode setProperty( IProperty* component, const std::string& name, const char* value, - const std::string& doc = "" ); - // ======================================================================== - /** the full specialization of the - * method setProperty( IProperty, std::string, const TYPE&) - * for C-arrays - * - * @param component component which needs to be configured - * @param name name of the property - * @param value value of the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - template - StatusCode setProperty( IProperty* component, const std::string& name, const char ( &value )[N], - const std::string& doc = "" ) { - return component ? setProperty( component, name, std::string( value, value + N ), doc ) : StatusCode::FAILURE; - } - // ======================================================================== - /** simple function to set the property of the given object from the value - * - * @code - * - * IProperty* component = ... ; - * - * std::vector data = ... ; - * StatusCode sc = setProperty ( component , "Data" , data ) ; - * - * std::map cuts = ... ; - * sc = setProperty ( component , "Cuts" , cuts ) ; - * - * std::map dict = ... ; - * sc = setProperty ( component , "Dictionary" , dict ) ; - * - * @endcode - * - * Note: the native interface IProperty allows setting of the - * properties either directly from other properties or - * from strings only - * - * @param component component which needs to be configured - * @param name name of the property - * @param value value of the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - template - StatusCode setProperty( IProperty* component, const std::string& name, const TYPE& value, const std::string& doc ) { - using Gaudi::Utils::toString; - return component && hasProperty( component, name ) - ? Gaudi::Utils::setProperty( component, name, toString( value ), doc ) - : StatusCode::FAILURE; - } - // ======================================================================== - /** simple function to set the property of the given object from another - * property - * - * @code - * - * IProperty* component = ... ; - * - * const Gaudi::Details::PropertyBase* prop = ... ; - * StatusCode sc = setProperty ( component , "Data" , prop ) ; - * - * @endcode - * - * @param component component which needs to be configured - * @param name name of the property - * @param property the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - GAUDI_API StatusCode setProperty( IProperty* component, const std::string& name, - const Gaudi::Details::PropertyBase* property, const std::string& doc = "" ); - // ======================================================================== - /** simple function to set the property of the given object from another - * property - * - * @code - * - * IProperty* component = ... ; - * - * const Gaudi::Details::PropertyBase& prop = ... ; - * StatusCode sc = setProperty ( component , "Data" , prop ) ; - * - * @endcode - * - * @param component component which needs to be configured - * @param name name of the property - * @param property the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - GAUDI_API StatusCode setProperty( IProperty* component, const std::string& name, - const Gaudi::Details::PropertyBase& property, const std::string& doc = "" ); - // ======================================================================== - /** simple function to set the property of the given object from another - * property - * - * @code - * - * IProperty* component = ... ; - * - * Gaudi::Property > m_data = ... ; - * - * StatusCode sc = setProperty ( component , "Data" , prop ) ; - * - * @endcode - * - * @param component component which needs to be configured - * @param name name of the property - * @param value the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - template - StatusCode setProperty( IProperty* component, const std::string& name, const Gaudi::Property& value, - const std::string& doc = "" ) { - return setProperty( component, name, &value, doc ); - } - // ======================================================================== - /** simple function to set the property of the given object from the value - * - * @code - * - * IInterface* component = ... ; - * - * std::vector data = ... ; - * StatusCode sc = setProperty ( component , "Data" , data ) ; - * - * @endcode - * - * @param component component which needs to be configured - * @param name name of the property - * @param value value of the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - template - StatusCode setProperty( IInterface* component, const std::string& name, const TYPE& value, - const std::string& doc = "" ) { - if ( !component ) { return StatusCode::FAILURE; } - auto property = SmartIF{component}; - return property ? setProperty( property, name, value, doc ) : StatusCode::FAILURE; - } - // ======================================================================== - /** the full specialization of the - * method setProperty( IInterface , std::string, const TYPE&) - * for standard strings - * - * @param component component which needs to be configured - * @param name name of the property - * @param value value of the property - * @param doc the new documentation string - * - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - GAUDI_API StatusCode setProperty( IInterface* component, const std::string& name, const std::string& value, - const std::string& doc = "" ); - // ======================================================================== - /** the full specialization of the - * method setProperty( IInterface , std::string, const TYPE&) - * for C-strings - * - * @param component component which needs to be configured - * @param name name of the property - * @param value value of the property - * @param doc the new documentation string - * - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - GAUDI_API StatusCode setProperty( IInterface* component, const std::string& name, const char* value, - const std::string& doc = "" ); - // ======================================================================== - /** the full specialization of the - * method setProperty( IInterface, std::string, const TYPE&) - * for C-arrays - * - * @param component component which needs to be configured - * @param name name of the property - * @param value value of the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - template - StatusCode setProperty( IInterface* component, const std::string& name, const char ( &value )[N], - const std::string& doc = "" ) { - if ( 0 == component ) { return StatusCode::FAILURE; } - return setProperty( component, name, std::string{value, value + N}, doc ); - } - // ======================================================================== - /** simple function to set the property of the given object from another - * property - * - * @code - * - * IInterface* component = ... ; - * - * const Gaudi::Details::PropertyBase* prop = ... ; - * StatusCode sc = setProperty ( component , "Data" , prop ) ; - * - * @endcode - * - * @param component component which needs to be configured - * @param name name of the property - * @param property the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - GAUDI_API StatusCode setProperty( IInterface* component, const std::string& name, - const Gaudi::Details::PropertyBase* property, const std::string& doc = "" ); - // ======================================================================== - /** simple function to set the property of the given object from another - * property - * - * @code - * - * IInterface* component = ... ; - * - * const Gaudi::Details::PropertyBase& prop = ... ; - * StatusCode sc = setProperty ( component , "Data" , prop ) ; - * - * @endcode - * - * @param component component which needs to be configured - * @param name name of the property - * @param property the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - GAUDI_API StatusCode setProperty( IInterface* component, const std::string& name, - const Gaudi::Details::PropertyBase& property, const std::string& doc = "" ); - // ======================================================================== - /** simple function to set the property of the given object from another - * property - * - * @code - * - * IInterface* component = ... ; - * - * Gaudi::Property > m_data = ... ; - * - * StatusCode sc = setProperty ( component , "Data" , prop ) ; - * - * @endcode - * - * @param component component which needs to be configured - * @param name name of the property - * @param value the property - * @param doc the new documentation string - * - * @see IProperty - * @author Vanya BELYAEV ibelyaev@physics.syr.edu - * @date 2007-05-13 - */ - template - StatusCode setProperty( IInterface* component, const std::string& name, const Gaudi::Property& value, - const std::string& doc = "" ) { - return setProperty( component, name, &value, doc ); - } - // ======================================================================== - } // namespace Utils -} // end of namespace Gaudi -// ============================================================================ -// The END -// ============================================================================ -#endif // GAUDIKERNEL_PROPERTY_H +#pragma once + +#include + +#if GAUDI_MAJOR_VERSION < 999 +# if GAUDI_VERSION >= CALC_GAUDI_VERSION( 34, 0 ) +# error "deprecated header: to be removed in v34r0, use " +# elif GAUDI_VERSION >= CALC_GAUDI_VERSION( 33, 0 ) +# warning "deprecated header: to be removed in v34r0, use " +# endif +#endif + +#include + +/// \fixme backward compatibility hack for old Property base class +using Property + //[[deprecated("use Gaudi::Details::PropertyBase instead")]] + = Gaudi::Details::PropertyBase; + +/// \fixme backward compatibility hack for PropertyWithValue +template +using PropertyWithValue + //[[deprecated("use Gaudi::Property instead")]] + = Gaudi::Property; diff --git a/GaudiKernel/GaudiKernel/PropertyFwd.h b/GaudiKernel/GaudiKernel/PropertyFwd.h index 8eda3f0956..6522fb0fb3 100644 --- a/GaudiKernel/GaudiKernel/PropertyFwd.h +++ b/GaudiKernel/GaudiKernel/PropertyFwd.h @@ -1,34 +1,13 @@ -/// Forward declarations for Property.h. +#pragma once -#ifndef PROPERTY_FWD_H -#define PROPERTY_FWD_H - -/// macro to help implementing backward compatible changed -/// in derived projects -#define GAUDI_PROPERTY_v2 - -namespace Gaudi { - namespace Details { - class PropertyBase; - namespace Property { - struct NullVerifier; - struct UpdateHandler; - } // namespace Property - } // namespace Details - template - class Property; -} // namespace Gaudi - -/// \fixme backward compatibility hack for old Property base class -using Property - //[[deprecated("use Gaudi::Details::PropertyBase instead")]] - = Gaudi::Details::PropertyBase; - -/// \fixme backward compatibility hack for PropertyWithValue -template -using PropertyWithValue - //[[deprecated("use Gaudi::Property instead")]] - = Gaudi::Property; +#include +#if GAUDI_MAJOR_VERSION < 999 +# if GAUDI_VERSION >= CALC_GAUDI_VERSION( 34, 0 ) +# error "deprecated header: to be removed in v34r0, use " +# elif GAUDI_VERSION >= CALC_GAUDI_VERSION( 33, 0 ) +# warning "deprecated header: to be removed in v34r0, use " +# endif #endif + +#include diff --git a/GaudiKernel/GaudiKernel/PropertyHolder.h b/GaudiKernel/GaudiKernel/PropertyHolder.h index 6a20d9811f..57d7f92eb9 100644 --- a/GaudiKernel/GaudiKernel/PropertyHolder.h +++ b/GaudiKernel/GaudiKernel/PropertyHolder.h @@ -21,8 +21,8 @@ #include "GaudiKernel/IProperty.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/detected.h" +#include #include "Gaudi/Interfaces/IOptionsSvc.h" // ============================================================================ diff --git a/GaudiKernel/GaudiKernel/PropertyMgr.h b/GaudiKernel/GaudiKernel/PropertyMgr.h index 1b577fb47c..f49c5b010d 100644 --- a/GaudiKernel/GaudiKernel/PropertyMgr.h +++ b/GaudiKernel/GaudiKernel/PropertyMgr.h @@ -15,7 +15,7 @@ #include "GaudiKernel/DataObjectHandleBase.h" #include "GaudiKernel/GaudiHandle.h" #include "GaudiKernel/IProperty.h" -#include "GaudiKernel/Property.h" +#include // ============================================================================ diff --git a/GaudiKernel/GaudiKernel/Service.h b/GaudiKernel/GaudiKernel/Service.h index b69e22a7df..6484026605 100644 --- a/GaudiKernel/GaudiKernel/Service.h +++ b/GaudiKernel/GaudiKernel/Service.h @@ -9,13 +9,13 @@ #include "GaudiKernel/IService.h" #include "GaudiKernel/IStateful.h" #include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/PropertyHolder.h" #include "GaudiKernel/ServiceLocatorHelper.h" #include "GaudiKernel/SmartIF.h" #include "GaudiKernel/ToolHandle.h" #include #include +#include // ============================================================================ #include diff --git a/GaudiKernel/dict/dictionary.h b/GaudiKernel/dict/dictionary.h index fd7eb7d1f8..d8774ccab4 100644 --- a/GaudiKernel/dict/dictionary.h +++ b/GaudiKernel/dict/dictionary.h @@ -19,7 +19,6 @@ #include "GaudiKernel/NTuple.h" #include "GaudiKernel/NTupleImplementation.h" #include "GaudiKernel/ObjectVector.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/RegistryEntry.h" #include "GaudiKernel/RndmGenerators.h" #include "GaudiKernel/Service.h" @@ -27,6 +26,7 @@ #include "GaudiKernel/SmartRefVector.h" #include "GaudiKernel/System.h" #include "GaudiKernel/Time.h" +#include #include "GaudiKernel/DataObjectHandle.h" #include "GaudiKernel/IAddressCreator.h" diff --git a/GaudiKernel/src/Lib/HistoryObj.cpp b/GaudiKernel/src/Lib/HistoryObj.cpp index f0932de80a..14344cd52f 100644 --- a/GaudiKernel/src/Lib/HistoryObj.cpp +++ b/GaudiKernel/src/Lib/HistoryObj.cpp @@ -10,7 +10,7 @@ #define GAUDIKERNEL_HISTORYOBJ_CPP #include "GaudiKernel/HistoryObj.h" -#include "GaudiKernel/Property.h" +#include using namespace std; diff --git a/GaudiKernel/src/Lib/JobHistory.cpp b/GaudiKernel/src/Lib/JobHistory.cpp index 995c77605e..0d7a16ee76 100644 --- a/GaudiKernel/src/Lib/JobHistory.cpp +++ b/GaudiKernel/src/Lib/JobHistory.cpp @@ -11,8 +11,8 @@ /////////////////////////////////////////////////////////////////////////// #include "GaudiKernel/JobHistory.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/System.h" +#include #include #include diff --git a/GaudiKernel/src/Lib/Property.cpp b/GaudiKernel/src/Lib/Property.cpp index 3add8c2dea..d02789f8b3 100644 --- a/GaudiKernel/src/Lib/Property.cpp +++ b/GaudiKernel/src/Lib/Property.cpp @@ -15,9 +15,9 @@ // ============================================================================ #include "GaudiKernel/GaudiHandle.h" #include "GaudiKernel/IProperty.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/PropertyHolder.h" #include "GaudiKernel/SmartIF.h" +#include // ============================================================================ // Boost // ============================================================================ diff --git a/GaudiKernel/tests/src/profile_Property.cpp b/GaudiKernel/tests/src/profile_Property.cpp index 19e9641035..81e3acec72 100644 --- a/GaudiKernel/tests/src/profile_Property.cpp +++ b/GaudiKernel/tests/src/profile_Property.cpp @@ -1,4 +1,4 @@ -#include "GaudiKernel/Property.h" +#include #include #include diff --git a/GaudiKernel/tests/src/test_Property.cpp b/GaudiKernel/tests/src/test_Property.cpp index c7365459e1..ff0b464952 100644 --- a/GaudiKernel/tests/src/test_Property.cpp +++ b/GaudiKernel/tests/src/test_Property.cpp @@ -2,7 +2,7 @@ #define BOOST_TEST_MODULE test_PropertyHolder #include -#include "GaudiKernel/Property.h" +#include struct MyClass {}; diff --git a/GaudiKernel/tests/src/test_WeekPropertyRef.cpp b/GaudiKernel/tests/src/test_WeekPropertyRef.cpp index c0eeb6a2cc..24679f058c 100644 --- a/GaudiKernel/tests/src/test_WeekPropertyRef.cpp +++ b/GaudiKernel/tests/src/test_WeekPropertyRef.cpp @@ -2,7 +2,7 @@ #define BOOST_TEST_MODULE test_PropertyHolder #include -#include "GaudiKernel/Property.h" +#include struct MyClass {}; diff --git a/GaudiMP/dict/gaudimp_dict.h b/GaudiMP/dict/gaudimp_dict.h index 0810f13f20..560ed0a08d 100644 --- a/GaudiMP/dict/gaudimp_dict.h +++ b/GaudiMP/dict/gaudimp_dict.h @@ -12,12 +12,12 @@ #include "GaudiKernel/Chrono.h" #include "GaudiKernel/ChronoEntity.h" #include "GaudiKernel/ParticleProperty.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/Range.h" #include "GaudiKernel/SerializeSTL.h" #include "GaudiKernel/Stat.h" #include "GaudiKernel/StatEntity.h" #include "GaudiKernel/StringKey.h" +#include #ifdef _WIN32 # include "GaudiKernel/GaudiHandle.h" diff --git a/GaudiMP/src/component/IoComponentMgr.cpp b/GaudiMP/src/component/IoComponentMgr.cpp index 3ddac22f0f..2325f71a30 100644 --- a/GaudiMP/src/component/IoComponentMgr.cpp +++ b/GaudiMP/src/component/IoComponentMgr.cpp @@ -10,8 +10,8 @@ #include "GaudiKernel/FileIncident.h" #include "GaudiKernel/IFileMgr.h" #include "GaudiKernel/IIncidentSvc.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/ServiceHandle.h" +#include // BOOST includes #include #include diff --git a/GaudiPython/GaudiPython/Helpers.h b/GaudiPython/GaudiPython/Helpers.h index 6ad8025469..2974c8cf4a 100644 --- a/GaudiPython/GaudiPython/Helpers.h +++ b/GaudiPython/GaudiPython/Helpers.h @@ -11,7 +11,7 @@ #include "GaudiKernel/IHistogramSvc.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/Property.h" +#include // FIXME: (MCl) workaround for ROOT-5850 namespace AIDA { diff --git a/GaudiPython/dict/kernel.h b/GaudiPython/dict/kernel.h index 448924549f..3abb97a89c 100644 --- a/GaudiPython/dict/kernel.h +++ b/GaudiPython/dict/kernel.h @@ -15,13 +15,13 @@ #include "GaudiKernel/Map.h" #include "GaudiKernel/MapBase.h" #include "GaudiKernel/ParticleProperty.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/Range.h" #include "GaudiKernel/SerializeSTL.h" #include "GaudiKernel/Stat.h" #include "GaudiKernel/StatEntity.h" #include "GaudiKernel/StringKey.h" #include "GaudiKernel/VectorMap.h" +#include #ifdef _WIN32 # include "GaudiKernel/GaudiHandle.h" diff --git a/GaudiPython/src/Lib/Helpers.cpp b/GaudiPython/src/Lib/Helpers.cpp index 0c64a7f3a1..d2176d994a 100644 --- a/GaudiPython/src/Lib/Helpers.cpp +++ b/GaudiPython/src/Lib/Helpers.cpp @@ -10,8 +10,8 @@ #include "GaudiKernel/IProperty.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/SmartIF.h" +#include // ============================================================================ // GaudiPython // ============================================================================ diff --git a/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp b/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp index 77a59041e7..3401e405e7 100644 --- a/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp +++ b/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp @@ -35,9 +35,9 @@ #include "GaudiKernel/ConversionSvc.h" #include "GaudiKernel/NTupleImplementation.h" -#include "GaudiKernel/Property.h" #include "GaudiKernel/Selector.h" #include "GaudiKernel/reverse.h" +#include #include "NTupleSvc.h" diff --git a/GaudiSvc/src/NTupleSvc/TagCollectionSvc.cpp b/GaudiSvc/src/NTupleSvc/TagCollectionSvc.cpp index 62e58753d4..985f3be9ce 100644 --- a/GaudiSvc/src/NTupleSvc/TagCollectionSvc.cpp +++ b/GaudiSvc/src/NTupleSvc/TagCollectionSvc.cpp @@ -34,7 +34,7 @@ #include "GaudiKernel/ISvcManager.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" +#include #include "TagCollectionSvc.h" diff --git a/GaudiSvc/src/THistSvc/THistSvc.cpp b/GaudiSvc/src/THistSvc/THistSvc.cpp index c085b1c795..7b2799d440 100644 --- a/GaudiSvc/src/THistSvc/THistSvc.cpp +++ b/GaudiSvc/src/THistSvc/THistSvc.cpp @@ -24,7 +24,7 @@ #include "GaudiKernel/IIoComponentMgr.h" #include "GaudiKernel/IJobOptionsSvc.h" #include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/Property.h" +#include // local headers #include "THistSvc.h" -- GitLab From 6a53920c39c5119de93bd90ed99f97939a46a678 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Fri, 31 May 2019 21:58:09 +0200 Subject: [PATCH 36/62] Hide change in TimelineSvc INFO output in tests --- GaudiPolicy/python/GaudiTesting/BaseTest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/GaudiPolicy/python/GaudiTesting/BaseTest.py b/GaudiPolicy/python/GaudiTesting/BaseTest.py index 9bccb50d0b..d69c4b02c0 100644 --- a/GaudiPolicy/python/GaudiTesting/BaseTest.py +++ b/GaudiPolicy/python/GaudiTesting/BaseTest.py @@ -928,6 +928,7 @@ for w, o, r in [ r"\1NN"), ('ApplicationMgr', r'(declareMultiSvcType|addMultiSvc): ', ''), ("Property", r"( = '[^']+':)'(.*)'", r'\1\2'), + ('TimelineSvc', "to file 'TimelineFile':", "to file "), ]: # [ ("TIMER.TIMER","[0-9]+[0-9.]*", "") ] normalizeExamples += RegexpReplacer(o, r, w) -- GitLab From 255623b6cc550d16daa781aeb034229a7d5b7843 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 7 Nov 2019 00:53:58 +0100 Subject: [PATCH 37/62] add more b/w compatibility checks --- GaudiKernel/tests/src/test_Property.cpp | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/GaudiKernel/tests/src/test_Property.cpp b/GaudiKernel/tests/src/test_Property.cpp index 1183af9971..c9c8a3d45b 100644 --- a/GaudiKernel/tests/src/test_Property.cpp +++ b/GaudiKernel/tests/src/test_Property.cpp @@ -222,3 +222,43 @@ BOOST_AUTO_TEST_CASE( backward_compatibility ) { BOOST_CHECK( i.value() == "6" ); } } + +BOOST_AUTO_TEST_CASE( backward_compatibility_2 ) { + // string conversion compatibility + { + Gaudi::Property dst{0}; + Gaudi::Property src{"321"}; + BOOST_CHECK( dst.value() == 0 ); + BOOST_CHECK( dst.assign( src ) ); + BOOST_CHECK( dst.value() == 321 ); + dst = 100; + BOOST_CHECK( dst.value() == 100 ); + BOOST_CHECK( dst.load( src ) ); + BOOST_CHECK( src.value() == "100" ); + } + { + // string property as from options + Gaudi::Property opt{"\"NONE\""}; + Gaudi::Property p{}; + BOOST_CHECK( opt.load( p ) ); + BOOST_CHECK( p.value() == "NONE" ); + } + { + // string property as from options + Gaudi::Property opt{"\"NONE\""}; + std::string dst; + Gaudi::Property p{"test", dst}; + BOOST_CHECK( opt.load( p ) ); + BOOST_CHECK( p.value() == "NONE" ); + BOOST_CHECK( dst == "NONE" ); + } + { + Gaudi::Property p1{"p1", ""}; + BOOST_CHECK( p1.value() == "" ); + p1 = "abc"; + BOOST_CHECK( p1.value() == "abc" ); + BOOST_CHECK( p1.fromString( "xyz" ) ); + BOOST_CHECK( p1.value() == "xyz" ); + BOOST_CHECK( p1.toString() == "'xyz'" ); + } +} -- GitLab From ab23050f5598792975e3598a3bfe61f22f4a9a8f Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Fri, 8 Nov 2019 02:09:33 +0100 Subject: [PATCH 38/62] temporary! Restore Property special behaviour for backward compatibility --- GaudiKernel/GaudiKernel/IProperty.h | 9 +++++++++ GaudiKernel/tests/src/test_PropertyHolder.cpp | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/GaudiKernel/GaudiKernel/IProperty.h b/GaudiKernel/GaudiKernel/IProperty.h index ba0b03a51a..fce34c6136 100644 --- a/GaudiKernel/GaudiKernel/IProperty.h +++ b/GaudiKernel/GaudiKernel/IProperty.h @@ -31,6 +31,15 @@ public: /// Set the property by name and value representation virtual StatusCode setPropertyRepr( const std::string& n, const std::string& r ) = 0; StatusCode setProperty( const std::string& n, const char* v ) { return setProperty( n, std::string{v} ); } + StatusCode setProperty( const std::string& name, const std::string& value ) { + using Gaudi::Utils::toString; + if ( hasProperty( name ) ) { + try { + return setPropertyRepr( name, toString( value ) ); + } catch ( std::invalid_argument& ) { return setPropertyRepr( name, value ); } + } + return StatusCode::FAILURE; + } /** set the property form the value * * @code diff --git a/GaudiKernel/tests/src/test_PropertyHolder.cpp b/GaudiKernel/tests/src/test_PropertyHolder.cpp index 1fecfbded3..ed708a394e 100644 --- a/GaudiKernel/tests/src/test_PropertyHolder.cpp +++ b/GaudiKernel/tests/src/test_PropertyHolder.cpp @@ -48,4 +48,11 @@ BOOST_AUTO_TEST_CASE( backward_compatibility ) { BOOST_CHECK( sc.isSuccess() ); BOOST_CHECK( vp == std::vector{{"All"}} ); } + { + AnonymousPropertyHolder mgr; + Gaudi::Property p{&mgr, "flag", false}; + + BOOST_CHECK( mgr.setProperty( "flag", "true" ) ); + BOOST_CHECK_EQUAL( p, true ); + } } -- GitLab From 4bf3fb7fb53aa25879550ae4995ce35c568b9bc1 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Fri, 8 Nov 2019 02:38:54 +0100 Subject: [PATCH 39/62] Better workaround for IProperty::setProperty(string, string) --- GaudiKernel/GaudiKernel/IProperty.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/GaudiKernel/GaudiKernel/IProperty.h b/GaudiKernel/GaudiKernel/IProperty.h index fce34c6136..f1940f58ea 100644 --- a/GaudiKernel/GaudiKernel/IProperty.h +++ b/GaudiKernel/GaudiKernel/IProperty.h @@ -31,15 +31,7 @@ public: /// Set the property by name and value representation virtual StatusCode setPropertyRepr( const std::string& n, const std::string& r ) = 0; StatusCode setProperty( const std::string& n, const char* v ) { return setProperty( n, std::string{v} ); } - StatusCode setProperty( const std::string& name, const std::string& value ) { - using Gaudi::Utils::toString; - if ( hasProperty( name ) ) { - try { - return setPropertyRepr( name, toString( value ) ); - } catch ( std::invalid_argument& ) { return setPropertyRepr( name, value ); } - } - return StatusCode::FAILURE; - } + /** set the property form the value * * @code @@ -70,7 +62,19 @@ public: template >> StatusCode setProperty( const std::string& name, const TYPE& value ) { using Gaudi::Utils::toString; - return hasProperty( name ) ? setPropertyRepr( name, toString( value ) ) : StatusCode::FAILURE; + if ( !hasProperty( name ) ) return StatusCode::FAILURE; + try { + return setPropertyRepr( name, toString( value ) ); + } catch ( std::invalid_argument& ) { + if constexpr ( std::is_convertible_v ) { + // This is to cover cases like IProperty::setProperty( "flag", "true" ); + // \fixme we should add an optional warning from this branch + return setPropertyRepr( name, value ); + } else { + throw; + } + } + return StatusCode::FAILURE; } /// Get the property by property virtual StatusCode getProperty( Gaudi::Details::PropertyBase* p // Pointer to property to be set -- GitLab From 8021a2241404ea6fce49dffe27bdbe28dcc383fb Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Fri, 8 Nov 2019 01:42:31 +0000 Subject: [PATCH 40/62] Fixed formatting patch generated by https://gitlab.cern.ch/clemenci/Gaudi/-/jobs/6083060 --- GaudiKernel/GaudiKernel/IProperty.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GaudiKernel/GaudiKernel/IProperty.h b/GaudiKernel/GaudiKernel/IProperty.h index f1940f58ea..5113fc312a 100644 --- a/GaudiKernel/GaudiKernel/IProperty.h +++ b/GaudiKernel/GaudiKernel/IProperty.h @@ -31,7 +31,7 @@ public: /// Set the property by name and value representation virtual StatusCode setPropertyRepr( const std::string& n, const std::string& r ) = 0; StatusCode setProperty( const std::string& n, const char* v ) { return setProperty( n, std::string{v} ); } - + /** set the property form the value * * @code -- GitLab From 5473e4647cace24c2130c7321cfdad38c23d3d55 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Tue, 12 Nov 2019 11:16:58 +0100 Subject: [PATCH 41/62] Better exception when setting properties fail --- GaudiKernel/GaudiKernel/IProperty.h | 5 ++++- GaudiKernel/GaudiKernel/PropertyHolder.h | 11 ++++++++--- GaudiKernel/tests/src/test_PropertyHolder.cpp | 9 +++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/GaudiKernel/GaudiKernel/IProperty.h b/GaudiKernel/GaudiKernel/IProperty.h index 5113fc312a..82e3802e44 100644 --- a/GaudiKernel/GaudiKernel/IProperty.h +++ b/GaudiKernel/GaudiKernel/IProperty.h @@ -2,10 +2,13 @@ // Include Files #include +#include #include +#include #include #include #include +#include #include /** @class IProperty IProperty.h GaudiKernel/IProperty.h @@ -65,7 +68,7 @@ public: if ( !hasProperty( name ) ) return StatusCode::FAILURE; try { return setPropertyRepr( name, toString( value ) ); - } catch ( std::invalid_argument& ) { + } catch ( const GaudiException& ) { if constexpr ( std::is_convertible_v ) { // This is to cover cases like IProperty::setProperty( "flag", "true" ); // \fixme we should add an optional warning from this branch diff --git a/GaudiKernel/GaudiKernel/PropertyHolder.h b/GaudiKernel/GaudiKernel/PropertyHolder.h index f3f137b62e..805b72dae5 100644 --- a/GaudiKernel/GaudiKernel/PropertyHolder.h +++ b/GaudiKernel/GaudiKernel/PropertyHolder.h @@ -165,9 +165,14 @@ public: * @see IProperty */ StatusCode setPropertyRepr( const std::string& n, const std::string& r ) override { - Gaudi::Details::PropertyBase* p = property( n ); - /// @fixme SUCCESS is not required to be checked for compatibility with Gaudi::Utils::setProperty - return ( p && p->fromString( r ) ) ? StatusCode{StatusCode::SUCCESS, true} : StatusCode{StatusCode::FAILURE, true}; + try { + Gaudi::Details::PropertyBase* p = property( n ); + /// @fixme SUCCESS is not required to be checked for compatibility with Gaudi::Utils::setProperty + return ( p && p->fromString( r ) ) ? StatusCode{StatusCode::SUCCESS, true} + : StatusCode{StatusCode::FAILURE, true}; + } catch ( const std::invalid_argument& err ) { + throw GaudiException{"error setting property " + n, this->name(), StatusCode::FAILURE, err}; + } } // ========================================================================== /** get the property diff --git a/GaudiKernel/tests/src/test_PropertyHolder.cpp b/GaudiKernel/tests/src/test_PropertyHolder.cpp index ed708a394e..9bee9b9b36 100644 --- a/GaudiKernel/tests/src/test_PropertyHolder.cpp +++ b/GaudiKernel/tests/src/test_PropertyHolder.cpp @@ -55,4 +55,13 @@ BOOST_AUTO_TEST_CASE( backward_compatibility ) { BOOST_CHECK( mgr.setProperty( "flag", "true" ) ); BOOST_CHECK_EQUAL( p, true ); } + { + AnonymousPropertyHolder mgr; + Gaudi::Property p{&mgr, "int_prop", false}; + + BOOST_CHECK_EXCEPTION( + mgr.setProperty( "int_prop", "abc" ), GaudiException, []( const GaudiException& err ) -> bool { + return err.message() == "error setting property int_prop: std::invalid_argument, cannot parse 'abc' to int"; + } ); + } } -- GitLab From 535a3354c16217cb0db377c3967c212001a2d8b8 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 14 Nov 2019 14:30:10 +0100 Subject: [PATCH 42/62] Fix segfault in property to property assignment --- GaudiKernel/Gaudi/Property.h | 19 ++++++++----------- GaudiKernel/tests/src/test_Property.cpp | 18 +++++++++++++----- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/GaudiKernel/Gaudi/Property.h b/GaudiKernel/Gaudi/Property.h index 357d41b8a3..9900499de3 100644 --- a/GaudiKernel/Gaudi/Property.h +++ b/GaudiKernel/Gaudi/Property.h @@ -334,17 +334,14 @@ namespace Gaudi { public: /// get the value from another property bool assign( const Details::PropertyBase& source ) override { - // Check if the property of is of "the same" type, except for strings - const Property* p = - ( std::is_same_v ) ? nullptr : dynamic_cast( &source ); - if ( p ) { - *this = p->value(); - } else if ( source.type_info() == &typeid( std::string ) ) { - auto s = dynamic_cast*>( &source ); - this->fromString( s->value() ).ignore(); - } else { - this->fromString( source.toString() ).ignore(); + auto repr = source.toString(); + // if the source property is string, use the value + if ( source.type_info() == &typeid( std::string ) ) { + std::string tmp; + Parsers::parse( tmp, repr ).ignore(); + repr = tmp; } + this->fromString( repr ).ignore(); return true; } /// set value to another property @@ -369,7 +366,7 @@ namespace Gaudi { using Utils::toStream; toStream( m_value, out ); } - }; + }; // namespace Gaudi /// delegate (value == property) to property operator== template diff --git a/GaudiKernel/tests/src/test_Property.cpp b/GaudiKernel/tests/src/test_Property.cpp index c9c8a3d45b..0bdaa6f142 100644 --- a/GaudiKernel/tests/src/test_Property.cpp +++ b/GaudiKernel/tests/src/test_Property.cpp @@ -237,20 +237,28 @@ BOOST_AUTO_TEST_CASE( backward_compatibility_2 ) { BOOST_CHECK( src.value() == "100" ); } { - // string property as from options + Gaudi::Property src{"src", + "42"}; + Gaudi::Property dst{"dst", 0}; + + BOOST_CHECK( dst.assign( src ) ); + BOOST_CHECK_EQUAL( dst.value(), 42 ); + } + { + // string property as from options (old JobOptionsSvc) Gaudi::Property opt{"\"NONE\""}; Gaudi::Property p{}; BOOST_CHECK( opt.load( p ) ); - BOOST_CHECK( p.value() == "NONE" ); + BOOST_CHECK_EQUAL( p.value(), "NONE" ); } { - // string property as from options + // string property as from options (old JobOptionsSvc) Gaudi::Property opt{"\"NONE\""}; std::string dst; Gaudi::Property p{"test", dst}; BOOST_CHECK( opt.load( p ) ); - BOOST_CHECK( p.value() == "NONE" ); - BOOST_CHECK( dst == "NONE" ); + BOOST_CHECK_EQUAL( p.value(), "NONE" ); + BOOST_CHECK_EQUAL( dst, "NONE" ); } { Gaudi::Property p1{"p1", ""}; -- GitLab From f9077c6801be2f4cbf75881723de401068eaeb95 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Tue, 19 Nov 2019 22:38:19 +0100 Subject: [PATCH 43/62] Add more types to pickle write/read test --- Gaudi/tests/python/TestConf.py | 6 +++++- Gaudi/tests/qmtest/gaudi.qms/pickle_read.qmt | 7 ++++++- Gaudi/tests/qmtest/gaudi.qms/pickle_write.qmt | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Gaudi/tests/python/TestConf.py b/Gaudi/tests/python/TestConf.py index aba355d198..d8d404d889 100644 --- a/Gaudi/tests/python/TestConf.py +++ b/Gaudi/tests/python/TestConf.py @@ -4,6 +4,7 @@ Bunch of fake configurables used for testing. from GaudiKernel.GaudiHandles import * from GaudiKernel.Proxy.Configurable import * +from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase class APublicTool(ConfigurableAlgTool): @@ -40,7 +41,10 @@ class MyTestTool(ConfigurableAlgTool): __slots__ = { 'PubToolHndl': PublicToolHandle('APublicTool'), 'PrivToolHndl': PrivateToolHandle('APrivateTool'), - 'PrivEmptyToolHndl': PrivateToolHandle('') + 'PrivEmptyToolHndl': PrivateToolHandle(''), + 'Text': 'some text', + 'Int': 23, + 'DataHandle': DataObjectHandleBase('Location', 'R'), } def __init__(self, name=Configurable.DefaultName, **kwargs): diff --git a/Gaudi/tests/qmtest/gaudi.qms/pickle_read.qmt b/Gaudi/tests/qmtest/gaudi.qms/pickle_read.qmt index 9c6a885969..db04d62745 100644 --- a/Gaudi/tests/qmtest/gaudi.qms/pickle_read.qmt +++ b/Gaudi/tests/qmtest/gaudi.qms/pickle_read.qmt @@ -9,10 +9,15 @@ gaudi.pickle_writePASS +from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase + conf_dict = eval('\n'.join(stdout.splitlines())) expected = { 'ToolSvc.MyTestTool': { 'PubToolHndl' : 'Public1', 'PrivToolHndl' : 'Pivate1', - 'PrivEmptyToolHndl' : ''} } + 'PrivEmptyToolHndl' : '', + 'Int' : 42, + 'Text' : 'value', + 'DataHandle' : '/Event/X'} } if conf_dict != expected: causes.append("configuration result") diff --git a/Gaudi/tests/qmtest/gaudi.qms/pickle_write.qmt b/Gaudi/tests/qmtest/gaudi.qms/pickle_write.qmt index 39858d20fd..29cc17511f 100644 --- a/Gaudi/tests/qmtest/gaudi.qms/pickle_write.qmt +++ b/Gaudi/tests/qmtest/gaudi.qms/pickle_write.qmt @@ -17,6 +17,10 @@ from Configurables import MyTestTool MyTestTool().PubToolHndl = "Public1" MyTestTool().PrivToolHndl = "Pivate1" MyTestTool().PrivEmptyToolHndl = "" + +MyTestTool().Int = 42 +MyTestTool().Text = 'value' +MyTestTool().DataHandle = '/Event/X' #------------------------------------------------------------------------------/ -- GitLab From f2d5f491ebc300680bc18545f6e24c7ac820ccac Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Wed, 20 Nov 2019 14:11:08 +0100 Subject: [PATCH 44/62] Add another check in test_JOS --- GaudiCoreSvc/tests/src/test_JOS.cpp | 38 ++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/GaudiCoreSvc/tests/src/test_JOS.cpp b/GaudiCoreSvc/tests/src/test_JOS.cpp index a6f7fcdcd1..18fdbb1391 100644 --- a/GaudiCoreSvc/tests/src/test_JOS.cpp +++ b/GaudiCoreSvc/tests/src/test_JOS.cpp @@ -49,26 +49,26 @@ BOOST_AUTO_TEST_CASE( JobOptionsSvc ) { BOOST_CHECK( jos.has( "ApplicationMgr.AppName" ) ); BOOST_CHECK( !jos.isSet( "ApplicationMgr.AppName" ) ); - BOOST_CHECK( jos.get( "ApplicationMgr.JobOptionsType" ) == "'NONE'" ); - BOOST_CHECK( jos.get( "ApplicationMgr.AppName" ) == "''" ); - BOOST_CHECK( jos.get( "ApplicationMgr.OutputLevel" ) == "6" ); + BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.JobOptionsType" ), "'NONE'" ); + BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.AppName" ), "''" ); + BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.OutputLevel" ), "6" ); jos.set( "ApplicationMgr.AppName", "'test_JOS.exe'" ); BOOST_CHECK( jos.has( "ApplicationMgr.AppName" ) ); BOOST_CHECK( jos.isSet( "ApplicationMgr.AppName" ) ); - BOOST_CHECK( jos.get( "ApplicationMgr.AppName" ) == "'test_JOS.exe'" ); + BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.AppName" ), "'test_JOS.exe'" ); - BOOST_CHECK( jos.items().size() == 94 ); + BOOST_CHECK_EQUAL( jos.items().size(), 94 ); BOOST_CHECK( !jos.has( "MyAlg.SomeOpt" ) ); BOOST_CHECK( !jos.isSet( "MyAlg.SomeOpt" ) ); jos.set( "MyAlg.SomeOpt", "42" ); BOOST_CHECK( jos.has( "MyAlg.SomeOpt" ) ); BOOST_CHECK( jos.isSet( "MyAlg.SomeOpt" ) ); - BOOST_CHECK( jos.get( "MyAlg.SomeOpt" ) == "42" ); + BOOST_CHECK_EQUAL( jos.get( "MyAlg.SomeOpt" ), "42" ); - BOOST_CHECK( jos.items().size() == 95 ); - BOOST_CHECK( jos.items( [&jos]( const auto& p ) { return jos.isSet( std::get<0>( p ) ); } ).size() == 2 ); - BOOST_CHECK( jos.items( std::regex{".*Level"} ).size() == 5 ); + BOOST_CHECK_EQUAL( jos.items().size(), 95 ); + BOOST_CHECK_EQUAL( jos.items( [&jos]( const auto& p ) { return jos.isSet( std::get<0>( p ) ); } ).size(), 2 ); + BOOST_CHECK_EQUAL( jos.items( std::regex{".*Level"} ).size(), 5 ); } #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE( BackwardCompatibility ) { std::string bpv = bp.toString(); Gaudi::Property sp( "MeasureTime", bpv ); jos->addPropertyToCatalogue( "SomeClient", sp ); - BOOST_CHECK( jos_new.get( "SomeClient.MeasureTime" ) == "True" ); + BOOST_CHECK_EQUAL( jos_new.get( "SomeClient.MeasureTime" ), "True" ); } { @@ -92,6 +92,22 @@ BOOST_AUTO_TEST_CASE( BackwardCompatibility ) { auto p = jos->getClientProperty( "Parent", "SomeNumber" ); BOOST_REQUIRE( p ); jos->addPropertyToCatalogue( "Parent.Child", *p ); - BOOST_CHECK( jos_new.get( "Parent.Child.SomeNumber" ) == "42" ); + BOOST_CHECK_EQUAL( jos_new.get( "Parent.Child.SomeNumber" ), "42" ); + + auto sp = dynamic_cast*>( p ); + BOOST_REQUIRE( sp ); + BOOST_CHECK_EQUAL( sp->value(), "42" ); + } + + { + jos_new.set( "Parent.SomeText", "\"lorem ipsum\"" ); + auto p = jos->getClientProperty( "Parent", "SomeText" ); + BOOST_REQUIRE( p ); + jos->addPropertyToCatalogue( "Parent.Child", *p ); + BOOST_CHECK_EQUAL( jos_new.get( "Parent.Child.SomeText" ), "\"lorem ipsum\"" ); + + auto sp = dynamic_cast*>( p ); + BOOST_REQUIRE( sp ); + BOOST_CHECK_EQUAL( sp->value(), "\"lorem ipsum\"" ); } } -- GitLab From cfd9f236487fb0af9ac1ea0bc7177ec2c3d5f73c Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Wed, 20 Nov 2019 23:17:38 +0100 Subject: [PATCH 45/62] Properly restore asymmetry between Property and Property --- GaudiCoreSvc/tests/src/test_JOS.cpp | 25 ++++++++++++++- .../tests/qmtest/refs/Properties.ref | 2 +- .../tests/qmtest/refs/Properties2.ref | 2 +- .../tests/qmtest/refs/Properties_py.ref | 2 +- GaudiKernel/Gaudi/Details/Property.h | 8 ++++- GaudiKernel/Gaudi/Details/PropertyBase.h | 2 +- GaudiKernel/Gaudi/Property.h | 31 ++++++++++++++----- GaudiKernel/GaudiKernel/IProperty.h | 21 +++++-------- GaudiKernel/src/Lib/Property.cpp | 10 ++++-- GaudiKernel/src/Util/genconf.cpp | 2 +- GaudiKernel/tests/src/test_Property.cpp | 6 ++-- 11 files changed, 78 insertions(+), 33 deletions(-) diff --git a/GaudiCoreSvc/tests/src/test_JOS.cpp b/GaudiCoreSvc/tests/src/test_JOS.cpp index 18fdbb1391..c9f29bfa4f 100644 --- a/GaudiCoreSvc/tests/src/test_JOS.cpp +++ b/GaudiCoreSvc/tests/src/test_JOS.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -42,6 +43,14 @@ struct Fixture { ~Fixture() {} }; +namespace { + /// Helper to allow instantiation of PropertyHolder. + struct TestPropertyHolder : public PropertyHolder> { + const std::string& name() const override { return m_name; } + std::string m_name{"test"}; + }; +} // namespace + BOOST_AUTO_TEST_CASE( JobOptionsSvc ) { Fixture f; @@ -71,6 +80,20 @@ BOOST_AUTO_TEST_CASE( JobOptionsSvc ) { BOOST_CHECK_EQUAL( jos.items( std::regex{".*Level"} ).size(), 5 ); } +BOOST_AUTO_TEST_CASE( PropertyBinding ) { + Fixture f; + + auto& jos = Gaudi::svcLocator()->getOptsSvc(); + + TestPropertyHolder ph; + Gaudi::Property p1{&ph, "p1", "v1"}; + + ph.bindPropertiesTo( jos ); + + BOOST_CHECK( jos.has( "test.p1" ) ); + BOOST_CHECK_EQUAL( jos.get( "test.p1" ), "'v1'" ); +} + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" BOOST_AUTO_TEST_CASE( BackwardCompatibility ) { Fixture f; @@ -104,7 +127,7 @@ BOOST_AUTO_TEST_CASE( BackwardCompatibility ) { auto p = jos->getClientProperty( "Parent", "SomeText" ); BOOST_REQUIRE( p ); jos->addPropertyToCatalogue( "Parent.Child", *p ); - BOOST_CHECK_EQUAL( jos_new.get( "Parent.Child.SomeText" ), "\"lorem ipsum\"" ); + BOOST_CHECK_EQUAL( jos_new.get( "Parent.Child.SomeText" ), "lorem ipsum" ); auto sp = dynamic_cast*>( p ); BOOST_REQUIRE( sp ); diff --git a/GaudiExamples/tests/qmtest/refs/Properties.ref b/GaudiExamples/tests/qmtest/refs/Properties.ref index 1986bc33a8..371a445e7c 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties.ref @@ -414,7 +414,7 @@ PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; PropertyProxy INFO Set property this.RInt = 1001; PropertyProxy INFO Got property this.RInt = 1001; -PropertyProxy INFO Got property this.String = 'This is set by the proxy'; +PropertyProxy INFO Got property this.String = This is set by the proxy; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. HistogramPersis...WARNING Histograms saving not required. diff --git a/GaudiExamples/tests/qmtest/refs/Properties2.ref b/GaudiExamples/tests/qmtest/refs/Properties2.ref index 2ad651a194..ca6413bfe7 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties2.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties2.ref @@ -416,7 +416,7 @@ PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; PropertyProxy INFO Set property this.RInt = 1001; PropertyProxy INFO Got property this.RInt = 1001; -PropertyProxy INFO Got property this.String = 'This is set by the proxy'; +PropertyProxy INFO Got property this.String = This is set by the proxy; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. HistogramPersis...WARNING Histograms saving not required. diff --git a/GaudiExamples/tests/qmtest/refs/Properties_py.ref b/GaudiExamples/tests/qmtest/refs/Properties_py.ref index 89b5915a44..f50295bda6 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties_py.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties_py.ref @@ -375,7 +375,7 @@ PropertyAlg INFO ================================================= PropertyProxy INFO Got property this.RInt = 101; PropertyProxy INFO Set property this.RInt = 1001; PropertyProxy INFO Got property this.RInt = 1001; -PropertyProxy INFO Got property this.String = 'hundred "one"'; +PropertyProxy INFO Got property this.String = hundred "one"; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. HistogramPersis...WARNING Histograms saving not required. diff --git a/GaudiKernel/Gaudi/Details/Property.h b/GaudiKernel/Gaudi/Details/Property.h index 240c4f47de..a2c8cfc1fd 100644 --- a/GaudiKernel/Gaudi/Details/Property.h +++ b/GaudiKernel/Gaudi/Details/Property.h @@ -57,6 +57,12 @@ namespace Gaudi::Details::Property { } }; + // Specialization of toString for strings (identity function) + template <> + inline std::string DefaultStringConverterImpl::toString( const std::string& v ) { + return v; + } + // This class provides a default implementation of StringConverter based // on the overloadable parse() and toStream() global Gaudi methods. // @@ -74,7 +80,7 @@ namespace Gaudi::Details::Property { }; // ...and here is the preferred impl for default-constructible types: template - struct DefaultStringConverter::value>> + struct DefaultStringConverter>> : DefaultStringConverterImpl { TYPE fromString( const TYPE& /* ref_value */, const std::string& s ) final override { TYPE buffer{}; diff --git a/GaudiKernel/Gaudi/Details/PropertyBase.h b/GaudiKernel/Gaudi/Details/PropertyBase.h index 8a3b4cc6da..b4e89bbe5d 100644 --- a/GaudiKernel/Gaudi/Details/PropertyBase.h +++ b/GaudiKernel/Gaudi/Details/PropertyBase.h @@ -184,7 +184,7 @@ namespace Gaudi::Details { m_unset = false; return *this; } - operator std::string() const { return m_property ? m_property->toString() : m_value; } + operator std::string() const; inline bool isBound() const { return m_property; } inline bool isSet() const { return !m_unset; } diff --git a/GaudiKernel/Gaudi/Property.h b/GaudiKernel/Gaudi/Property.h index 2cfaf73bbe..731eff299b 100644 --- a/GaudiKernel/Gaudi/Property.h +++ b/GaudiKernel/Gaudi/Property.h @@ -166,6 +166,23 @@ namespace Gaudi { return m_value; } + /// Properly quote string properties when printing them + std::ostream& fillStream( std::ostream& stream ) const override { + stream << " '" << name() << "':"; + if constexpr ( std::is_same_v ) { + using Gaudi::Utils::toStream; + toStream( value(), stream ); + } else { + stream << toString(); + } + return stream; + } + + operator std::string_view() const { + m_handlers.useReadHandler( *this ); + return m_value; + } + /// equality comparison template bool operator==( const T& other ) const { @@ -340,14 +357,14 @@ namespace Gaudi { public: /// get the value from another property bool assign( const Details::PropertyBase& source ) override { - auto repr = source.toString(); - // if the source property is string, use the value - if ( source.type_info() == &typeid( std::string ) ) { - std::string tmp; - Parsers::parse( tmp, repr ).ignore(); - repr = tmp; + // Check if the property is of "the same" type, except for strings + const Property* p = + ( std::is_same_v ) ? nullptr : dynamic_cast( &source ); + if ( p ) { + *this = p->value(); + } else { + this->fromString( source.toString() ).ignore(); } - this->fromString( repr ).ignore(); return true; } /// set value to another property diff --git a/GaudiKernel/GaudiKernel/IProperty.h b/GaudiKernel/GaudiKernel/IProperty.h index 82e3802e44..b2eae577c8 100644 --- a/GaudiKernel/GaudiKernel/IProperty.h +++ b/GaudiKernel/GaudiKernel/IProperty.h @@ -33,7 +33,13 @@ public: virtual StatusCode setProperty( const std::string& s ) = 0; /// Set the property by name and value representation virtual StatusCode setPropertyRepr( const std::string& n, const std::string& r ) = 0; - StatusCode setProperty( const std::string& n, const char* v ) { return setProperty( n, std::string{v} ); } + /// Special case for string literals + StatusCode setProperty( const std::string& name, const char* v ) { return setProperty( name, std::string{v} ); } + /// Special case for std::string + StatusCode setProperty( const std::string& name, const std::string& v ) { + if ( !hasProperty( name ) ) return StatusCode::FAILURE; + return setPropertyRepr( name, v ); + } /** set the property form the value * @@ -66,18 +72,7 @@ public: StatusCode setProperty( const std::string& name, const TYPE& value ) { using Gaudi::Utils::toString; if ( !hasProperty( name ) ) return StatusCode::FAILURE; - try { - return setPropertyRepr( name, toString( value ) ); - } catch ( const GaudiException& ) { - if constexpr ( std::is_convertible_v ) { - // This is to cover cases like IProperty::setProperty( "flag", "true" ); - // \fixme we should add an optional warning from this branch - return setPropertyRepr( name, value ); - } else { - throw; - } - } - return StatusCode::FAILURE; + return setPropertyRepr( name, toString( value ) ); } /// Get the property by property virtual StatusCode getProperty( Gaudi::Details::PropertyBase* p // Pointer to property to be set diff --git a/GaudiKernel/src/Lib/Property.cpp b/GaudiKernel/src/Lib/Property.cpp index d02789f8b3..ffaecdf247 100644 --- a/GaudiKernel/src/Lib/Property.cpp +++ b/GaudiKernel/src/Lib/Property.cpp @@ -18,6 +18,7 @@ #include "GaudiKernel/PropertyHolder.h" #include "GaudiKernel/SmartIF.h" #include +#include // ============================================================================ // Boost // ============================================================================ @@ -504,6 +505,9 @@ StatusCode Gaudi::Utils::setProperty( IInterface* component, const std::string& } // ============================================================================ -// ============================================================================ -// The END -// ============================================================================ +Gaudi::Details::WeekPropertyRef::operator std::string() const { + using Gaudi::Utils::toString; + return m_property ? ( ( m_property->type_info() == &typeid( std::string ) ) ? toString( m_property->toString() ) + : m_property->toString() ) + : m_value; +} diff --git a/GaudiKernel/src/Util/genconf.cpp b/GaudiKernel/src/Util/genconf.cpp index 7e2cc8607d..e9b18d515d 100644 --- a/GaudiKernel/src/Util/genconf.cpp +++ b/GaudiKernel/src/Util/genconf.cpp @@ -747,7 +747,7 @@ void configGenerator::pythonizeValue( const PropertyBase* p, string& pvalue, str } ptype = "float"; } else if ( ti == typeIndex() ) { - pvalue = cvalue; + pvalue = "'" + cvalue + "'"; ptype = "str"; } else if ( ti == typeIndex() ) { const GaudiHandleProperty& hdl = dynamic_cast( *p ); diff --git a/GaudiKernel/tests/src/test_Property.cpp b/GaudiKernel/tests/src/test_Property.cpp index efa13a413f..a5f14902b6 100644 --- a/GaudiKernel/tests/src/test_Property.cpp +++ b/GaudiKernel/tests/src/test_Property.cpp @@ -81,11 +81,11 @@ BOOST_AUTO_TEST_CASE( string_conversion ) { BOOST_CHECK_EQUAL( p1.value(), "abc" ); BOOST_CHECK( p1.fromString( "'xyz'" ) ); BOOST_CHECK_EQUAL( p1.value(), "xyz" ); - BOOST_CHECK_EQUAL( p1.toString(), "'xyz'" ); + BOOST_CHECK_EQUAL( p1.toString(), "xyz" ); p1 = "with \"quotes\" inside"; BOOST_CHECK_EQUAL( p1.value(), "with \"quotes\" inside" ); - BOOST_CHECK_EQUAL( p1.toString(), "'with \"quotes\" inside'" ); + BOOST_CHECK_EQUAL( p1.toString(), "with \"quotes\" inside" ); Gaudi::Property tgt{"p1", ""}; @@ -263,7 +263,7 @@ BOOST_AUTO_TEST_CASE( backward_compatibility_2 ) { BOOST_CHECK_EQUAL( p1.value(), "abc" ); BOOST_CHECK( p1.fromString( "xyz" ) ); BOOST_CHECK_EQUAL( p1.value(), "xyz" ); - BOOST_CHECK_EQUAL( p1.toString(), "'xyz'" ); + BOOST_CHECK_EQUAL( p1.toString(), "xyz" ); } { // this covers the fix to a segfault observed in a few cases Gaudi::Property src{"src", -- GitLab From c906d3a87f43c5af896c0edeca77c93ead54d80a Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Wed, 20 Nov 2019 23:23:34 +0100 Subject: [PATCH 46/62] fix typo in class name --- .../src/JobOptionsSvc/JobOptionsSvc.h | 2 +- GaudiKernel/CMakeLists.txt | 2 +- GaudiKernel/Gaudi/Details/PropertyBase.h | 34 +++++++++---------- GaudiKernel/src/Lib/Property.cpp | 2 +- ...opertyRef.cpp => test_WeakPropertyRef.cpp} | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) rename GaudiKernel/tests/src/{test_WeekPropertyRef.cpp => test_WeakPropertyRef.cpp} (98%) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index 66194f5154..b69d3abfad 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -24,7 +24,7 @@ public: typedef std::vector PropertiesT; private: - using StorageType = std::map; + using StorageType = std::map; StorageType m_options; diff --git a/GaudiKernel/CMakeLists.txt b/GaudiKernel/CMakeLists.txt index aab32f3526..328808832e 100644 --- a/GaudiKernel/CMakeLists.txt +++ b/GaudiKernel/CMakeLists.txt @@ -153,7 +153,7 @@ gaudi_add_unit_test(test_PropertyHolder tests/src/test_PropertyHolder.cpp gaudi_add_unit_test(test_Property tests/src/test_Property.cpp LINK_LIBRARIES GaudiKernel TYPE Boost) -gaudi_add_unit_test(test_WeekPropertyRef tests/src/test_WeekPropertyRef.cpp +gaudi_add_unit_test(test_WeakPropertyRef tests/src/test_WeakPropertyRef.cpp LINK_LIBRARIES GaudiKernel TYPE Boost) gaudi_add_unit_test(test_StatusCode tests/src/test_StatusCode.cpp diff --git a/GaudiKernel/Gaudi/Details/PropertyBase.h b/GaudiKernel/Gaudi/Details/PropertyBase.h index b4e89bbe5d..00dcf715fa 100644 --- a/GaudiKernel/Gaudi/Details/PropertyBase.h +++ b/GaudiKernel/Gaudi/Details/PropertyBase.h @@ -12,7 +12,7 @@ #include namespace Gaudi::Details { - class WeekPropertyRef; + class WeakPropertyRef; // ============================================================================ /** PropertyBase base class allowing PropertyBase* collections to be "homogeneous" @@ -123,25 +123,25 @@ namespace Gaudi::Details { /// type of owner of the property (if defined) const std::type_info* m_ownerType = nullptr; - friend WeekPropertyRef; - std::set m_weekReferences; - void add( WeekPropertyRef* ref ) { - if ( ref ) m_weekReferences.insert( ref ); + friend WeakPropertyRef; + std::set m_weakReferences; + void add( WeakPropertyRef* ref ) { + if ( ref ) m_weakReferences.insert( ref ); } - void remove( WeekPropertyRef* ref ) { m_weekReferences.erase( ref ); } + void remove( WeakPropertyRef* ref ) { m_weakReferences.erase( ref ); } }; /// Optional reference to a property that can be used to refer to a sting or /// to the string representation of a property instance value - class GAUDI_API WeekPropertyRef { + class GAUDI_API WeakPropertyRef { friend PropertyBase; public: - WeekPropertyRef() = default; - WeekPropertyRef( std::string value ) : m_value{std::move( value )}, m_unset{false} {} - WeekPropertyRef( PropertyBase& property ) : m_property{&property} { property.add( this ); } - WeekPropertyRef( const WeekPropertyRef& other ) = delete; - WeekPropertyRef( WeekPropertyRef&& other ) + WeakPropertyRef() = default; + WeakPropertyRef( std::string value ) : m_value{std::move( value )}, m_unset{false} {} + WeakPropertyRef( PropertyBase& property ) : m_property{&property} { property.add( this ); } + WeakPropertyRef( const WeakPropertyRef& other ) = delete; + WeakPropertyRef( WeakPropertyRef&& other ) : m_property{other.m_property}, m_value{std::move( other.m_value )}, m_unset{other.m_unset} { if ( m_property ) { other.m_property = nullptr; @@ -149,10 +149,10 @@ namespace Gaudi::Details { m_property->add( this ); } } - ~WeekPropertyRef() { + ~WeakPropertyRef() { if ( m_property ) m_property->remove( this ); } - WeekPropertyRef& operator=( WeekPropertyRef&& other ) { + WeakPropertyRef& operator=( WeakPropertyRef&& other ) { if ( this != &other ) { if ( m_property ) m_property->remove( this ); m_property = other.m_property; @@ -166,7 +166,7 @@ namespace Gaudi::Details { } return *this; } - WeekPropertyRef& operator=( PropertyBase& value ) { + WeakPropertyRef& operator=( PropertyBase& value ) { if ( m_property != &value ) { if ( m_property ) { m_property->remove( this ); @@ -178,7 +178,7 @@ namespace Gaudi::Details { } return *this; } - WeekPropertyRef& operator=( const std::string& value ) { + WeakPropertyRef& operator=( const std::string& value ) { if ( m_property ) m_property->fromString( value ).ignore(); m_value = value; m_unset = false; @@ -198,7 +198,7 @@ namespace Gaudi::Details { }; inline PropertyBase::~PropertyBase() { - for ( auto ref : m_weekReferences ) { ref->detach(); } + for ( auto ref : m_weakReferences ) { ref->detach(); } } inline std::ostream& operator<<( std::ostream& stream, const PropertyBase& prop ) { diff --git a/GaudiKernel/src/Lib/Property.cpp b/GaudiKernel/src/Lib/Property.cpp index ffaecdf247..4a79e83236 100644 --- a/GaudiKernel/src/Lib/Property.cpp +++ b/GaudiKernel/src/Lib/Property.cpp @@ -505,7 +505,7 @@ StatusCode Gaudi::Utils::setProperty( IInterface* component, const std::string& } // ============================================================================ -Gaudi::Details::WeekPropertyRef::operator std::string() const { +Gaudi::Details::WeakPropertyRef::operator std::string() const { using Gaudi::Utils::toString; return m_property ? ( ( m_property->type_info() == &typeid( std::string ) ) ? toString( m_property->toString() ) : m_property->toString() ) diff --git a/GaudiKernel/tests/src/test_WeekPropertyRef.cpp b/GaudiKernel/tests/src/test_WeakPropertyRef.cpp similarity index 98% rename from GaudiKernel/tests/src/test_WeekPropertyRef.cpp rename to GaudiKernel/tests/src/test_WeakPropertyRef.cpp index 24679f058c..9fea2dac26 100644 --- a/GaudiKernel/tests/src/test_WeekPropertyRef.cpp +++ b/GaudiKernel/tests/src/test_WeakPropertyRef.cpp @@ -6,7 +6,7 @@ struct MyClass {}; -using WPR = Gaudi::Details::WeekPropertyRef; +using WPR = Gaudi::Details::WeakPropertyRef; BOOST_AUTO_TEST_CASE( default_constructor ) { WPR r; -- GitLab From 7fd4f638d2af53a1952096311703d644659c8682 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 21 Nov 2019 09:56:59 +0100 Subject: [PATCH 47/62] reorganized test_JOS test cases --- GaudiCoreSvc/CMakeLists.txt | 9 +- GaudiCoreSvc/tests/src/test_JOS.cpp | 136 ------------------- GaudiCoreSvc/tests/src/test_JOS/base.cpp | 37 +++++ GaudiCoreSvc/tests/src/test_JOS/binding.cpp | 23 ++++ GaudiCoreSvc/tests/src/test_JOS/bwcompat.cpp | 50 +++++++ GaudiCoreSvc/tests/src/test_JOS/fixture.h | 45 ++++++ 6 files changed, 160 insertions(+), 140 deletions(-) delete mode 100644 GaudiCoreSvc/tests/src/test_JOS.cpp create mode 100644 GaudiCoreSvc/tests/src/test_JOS/base.cpp create mode 100644 GaudiCoreSvc/tests/src/test_JOS/binding.cpp create mode 100644 GaudiCoreSvc/tests/src/test_JOS/bwcompat.cpp create mode 100644 GaudiCoreSvc/tests/src/test_JOS/fixture.h diff --git a/GaudiCoreSvc/CMakeLists.txt b/GaudiCoreSvc/CMakeLists.txt index ea6cc93c48..482e866462 100644 --- a/GaudiCoreSvc/CMakeLists.txt +++ b/GaudiCoreSvc/CMakeLists.txt @@ -27,7 +27,8 @@ gaudi_add_module(GaudiCoreSvc LINK_LIBRARIES GaudiKernel Boost TBB PythonLibs ${extralibs} INCLUDE_DIRS TBB PythonLibs) -gaudi_add_unit_test(test_JOS tests/src/test_JOS.cpp - LINK_LIBRARIES GaudiKernel TYPE Boost) - -add_dependencies(test_JOS GaudiCoreSvc) +foreach(name IN ITEMS base binding bwcompat) + gaudi_add_unit_test(test_JOS_${name} tests/src/test_JOS/${name}.cpp + LINK_LIBRARIES GaudiKernel TYPE Boost) + add_dependencies(test_JOS_${name} GaudiCoreSvc) +endforeach() diff --git a/GaudiCoreSvc/tests/src/test_JOS.cpp b/GaudiCoreSvc/tests/src/test_JOS.cpp deleted file mode 100644 index c9f29bfa4f..0000000000 --- a/GaudiCoreSvc/tests/src/test_JOS.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#define BOOST_TEST_DYN_LINK -#define BOOST_TEST_MODULE test_JOS -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -struct Fixture { - Fixture() { - // Load required libraries (bypass PluginService) - { - System::ImageHandle handle; - System::loadDynamicLib( "libGaudiCoreSvc.so", &handle ); - } - - // == Begin Bootstrap - // Instantiate the application - auto app = Gaudi::createApplicationMgr(); - - SmartIF appProp{app}; - BOOST_REQUIRE( appProp ); - - // prevent reading of options file - appProp->setProperty( "JobOptionsType", "NONE" ).ignore(); - // prevent printout of ApplicationMgr banner - appProp->setPropertyRepr( "AppName", "''" ).ignore(); - appProp->setProperty( "OutputLevel", 6 ).ignore(); - - BOOST_REQUIRE( app->configure() ); - // == End Bootstrap - } - - ~Fixture() {} -}; - -namespace { - /// Helper to allow instantiation of PropertyHolder. - struct TestPropertyHolder : public PropertyHolder> { - const std::string& name() const override { return m_name; } - std::string m_name{"test"}; - }; -} // namespace - -BOOST_AUTO_TEST_CASE( JobOptionsSvc ) { - Fixture f; - - auto& jos = Gaudi::svcLocator()->getOptsSvc(); - - BOOST_CHECK( jos.has( "ApplicationMgr.AppName" ) ); - BOOST_CHECK( !jos.isSet( "ApplicationMgr.AppName" ) ); - BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.JobOptionsType" ), "'NONE'" ); - BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.AppName" ), "''" ); - BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.OutputLevel" ), "6" ); - jos.set( "ApplicationMgr.AppName", "'test_JOS.exe'" ); - BOOST_CHECK( jos.has( "ApplicationMgr.AppName" ) ); - BOOST_CHECK( jos.isSet( "ApplicationMgr.AppName" ) ); - BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.AppName" ), "'test_JOS.exe'" ); - - BOOST_CHECK_EQUAL( jos.items().size(), 94 ); - - BOOST_CHECK( !jos.has( "MyAlg.SomeOpt" ) ); - BOOST_CHECK( !jos.isSet( "MyAlg.SomeOpt" ) ); - jos.set( "MyAlg.SomeOpt", "42" ); - BOOST_CHECK( jos.has( "MyAlg.SomeOpt" ) ); - BOOST_CHECK( jos.isSet( "MyAlg.SomeOpt" ) ); - BOOST_CHECK_EQUAL( jos.get( "MyAlg.SomeOpt" ), "42" ); - - BOOST_CHECK_EQUAL( jos.items().size(), 95 ); - BOOST_CHECK_EQUAL( jos.items( [&jos]( const auto& p ) { return jos.isSet( std::get<0>( p ) ); } ).size(), 2 ); - BOOST_CHECK_EQUAL( jos.items( std::regex{".*Level"} ).size(), 5 ); -} - -BOOST_AUTO_TEST_CASE( PropertyBinding ) { - Fixture f; - - auto& jos = Gaudi::svcLocator()->getOptsSvc(); - - TestPropertyHolder ph; - Gaudi::Property p1{&ph, "p1", "v1"}; - - ph.bindPropertiesTo( jos ); - - BOOST_CHECK( jos.has( "test.p1" ) ); - BOOST_CHECK_EQUAL( jos.get( "test.p1" ), "'v1'" ); -} - -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -BOOST_AUTO_TEST_CASE( BackwardCompatibility ) { - Fixture f; - - auto& jos_new = Gaudi::svcLocator()->getOptsSvc(); - auto jos = Gaudi::svcLocator()->service( "JobOptionsSvc" ).as(); - BOOST_REQUIRE( jos ); - - { - Gaudi::Property bp{true}; - std::string bpv = bp.toString(); - Gaudi::Property sp( "MeasureTime", bpv ); - jos->addPropertyToCatalogue( "SomeClient", sp ); - BOOST_CHECK_EQUAL( jos_new.get( "SomeClient.MeasureTime" ), "True" ); - } - - { - jos_new.set( "Parent.SomeNumber", "42" ); - auto p = jos->getClientProperty( "Parent", "SomeNumber" ); - BOOST_REQUIRE( p ); - jos->addPropertyToCatalogue( "Parent.Child", *p ); - BOOST_CHECK_EQUAL( jos_new.get( "Parent.Child.SomeNumber" ), "42" ); - - auto sp = dynamic_cast*>( p ); - BOOST_REQUIRE( sp ); - BOOST_CHECK_EQUAL( sp->value(), "42" ); - } - - { - jos_new.set( "Parent.SomeText", "\"lorem ipsum\"" ); - auto p = jos->getClientProperty( "Parent", "SomeText" ); - BOOST_REQUIRE( p ); - jos->addPropertyToCatalogue( "Parent.Child", *p ); - BOOST_CHECK_EQUAL( jos_new.get( "Parent.Child.SomeText" ), "lorem ipsum" ); - - auto sp = dynamic_cast*>( p ); - BOOST_REQUIRE( sp ); - BOOST_CHECK_EQUAL( sp->value(), "\"lorem ipsum\"" ); - } -} diff --git a/GaudiCoreSvc/tests/src/test_JOS/base.cpp b/GaudiCoreSvc/tests/src/test_JOS/base.cpp new file mode 100644 index 0000000000..76d6858493 --- /dev/null +++ b/GaudiCoreSvc/tests/src/test_JOS/base.cpp @@ -0,0 +1,37 @@ +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE test_JOS +#include + +#include "fixture.h" + +#include +#include + +BOOST_AUTO_TEST_CASE( JobOptionsSvc ) { + Fixture f; + + auto& jos = Gaudi::svcLocator()->getOptsSvc(); + + BOOST_CHECK( jos.has( "ApplicationMgr.AppName" ) ); + BOOST_CHECK( !jos.isSet( "ApplicationMgr.AppName" ) ); + BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.JobOptionsType" ), "'NONE'" ); + BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.AppName" ), "''" ); + BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.OutputLevel" ), "6" ); + jos.set( "ApplicationMgr.AppName", "'test_JOS.exe'" ); + BOOST_CHECK( jos.has( "ApplicationMgr.AppName" ) ); + BOOST_CHECK( jos.isSet( "ApplicationMgr.AppName" ) ); + BOOST_CHECK_EQUAL( jos.get( "ApplicationMgr.AppName" ), "'test_JOS.exe'" ); + + BOOST_CHECK_EQUAL( jos.items().size(), 94 ); + + BOOST_CHECK( !jos.has( "MyAlg.SomeOpt" ) ); + BOOST_CHECK( !jos.isSet( "MyAlg.SomeOpt" ) ); + jos.set( "MyAlg.SomeOpt", "42" ); + BOOST_CHECK( jos.has( "MyAlg.SomeOpt" ) ); + BOOST_CHECK( jos.isSet( "MyAlg.SomeOpt" ) ); + BOOST_CHECK_EQUAL( jos.get( "MyAlg.SomeOpt" ), "42" ); + + BOOST_CHECK_EQUAL( jos.items().size(), 95 ); + BOOST_CHECK_EQUAL( jos.items( [&jos]( const auto& p ) { return jos.isSet( std::get<0>( p ) ); } ).size(), 2 ); + BOOST_CHECK_EQUAL( jos.items( std::regex{".*Level"} ).size(), 5 ); +} diff --git a/GaudiCoreSvc/tests/src/test_JOS/binding.cpp b/GaudiCoreSvc/tests/src/test_JOS/binding.cpp new file mode 100644 index 0000000000..e9526821d3 --- /dev/null +++ b/GaudiCoreSvc/tests/src/test_JOS/binding.cpp @@ -0,0 +1,23 @@ +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE test_JOS +#include + +#include "fixture.h" + +#include +#include +#include + +BOOST_AUTO_TEST_CASE( PropertyBinding ) { + Fixture f; + + auto& jos = Gaudi::svcLocator()->getOptsSvc(); + + TestPropertyHolder ph; + Gaudi::Property p1{&ph, "p1", "v1"}; + + ph.bindPropertiesTo( jos ); + + BOOST_CHECK( jos.has( "test.p1" ) ); + BOOST_CHECK_EQUAL( jos.get( "test.p1" ), "'v1'" ); +} diff --git a/GaudiCoreSvc/tests/src/test_JOS/bwcompat.cpp b/GaudiCoreSvc/tests/src/test_JOS/bwcompat.cpp new file mode 100644 index 0000000000..faa1dfb717 --- /dev/null +++ b/GaudiCoreSvc/tests/src/test_JOS/bwcompat.cpp @@ -0,0 +1,50 @@ +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE test_JOS +#include + +#include "fixture.h" + +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +BOOST_AUTO_TEST_CASE( BackwardCompatibility ) { + Fixture f; + + auto& jos_new = Gaudi::svcLocator()->getOptsSvc(); + auto jos = Gaudi::svcLocator()->service( "JobOptionsSvc" ).as(); + BOOST_REQUIRE( jos ); + + { + Gaudi::Property bp{true}; + std::string bpv = bp.toString(); + Gaudi::Property sp( "MeasureTime", bpv ); + jos->addPropertyToCatalogue( "SomeClient", sp ); + BOOST_CHECK_EQUAL( jos_new.get( "SomeClient.MeasureTime" ), "True" ); + } + + { + jos_new.set( "Parent.SomeNumber", "42" ); + auto p = jos->getClientProperty( "Parent", "SomeNumber" ); + BOOST_REQUIRE( p ); + jos->addPropertyToCatalogue( "Parent.Child", *p ); + BOOST_CHECK_EQUAL( jos_new.get( "Parent.Child.SomeNumber" ), "42" ); + + auto sp = dynamic_cast*>( p ); + BOOST_REQUIRE( sp ); + BOOST_CHECK_EQUAL( sp->value(), "42" ); + } + + { + jos_new.set( "Parent.SomeText", "\"lorem ipsum\"" ); + auto p = jos->getClientProperty( "Parent", "SomeText" ); + BOOST_REQUIRE( p ); + jos->addPropertyToCatalogue( "Parent.Child", *p ); + BOOST_CHECK_EQUAL( jos_new.get( "Parent.Child.SomeText" ), "lorem ipsum" ); + + auto sp = dynamic_cast*>( p ); + BOOST_REQUIRE( sp ); + BOOST_CHECK_EQUAL( sp->value(), "\"lorem ipsum\"" ); + } +} diff --git a/GaudiCoreSvc/tests/src/test_JOS/fixture.h b/GaudiCoreSvc/tests/src/test_JOS/fixture.h new file mode 100644 index 0000000000..e6f007e9e8 --- /dev/null +++ b/GaudiCoreSvc/tests/src/test_JOS/fixture.h @@ -0,0 +1,45 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include + +struct Fixture { + Fixture( const std::string& jos_name = "JobOptionsSvc" ) { + // Load required libraries (bypass PluginService) + { + System::ImageHandle handle; + System::loadDynamicLib( "libGaudiCoreSvc.so", &handle ); + } + + // == Begin Bootstrap + // Instantiate the application + auto app = Gaudi::createApplicationMgr(); + + SmartIF appProp{app}; + BOOST_REQUIRE( appProp ); + + appProp->setProperty( "JobOptionsSvcType", jos_name ).ignore(); + // prevent reading of options file + appProp->setProperty( "JobOptionsType", "NONE" ).ignore(); + // prevent printout of ApplicationMgr banner + appProp->setPropertyRepr( "AppName", "''" ).ignore(); + appProp->setProperty( "OutputLevel", 6 ).ignore(); + + BOOST_REQUIRE( app->configure() ); + // == End Bootstrap + } + + ~Fixture() = default; +}; + +/// Helper to allow instantiation of PropertyHolder. +struct TestPropertyHolder : public PropertyHolder> { + const std::string& name() const override { return m_name; } + std::string m_name{"test"}; +}; -- GitLab From 140c11ae400f9f7463fb12d90318b27e2709000b Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 21 Nov 2019 14:59:35 +0100 Subject: [PATCH 48/62] Set MessageSvc default output level at constrution time --- GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp index f7555f6f99..2f311b47ed 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp @@ -130,6 +130,7 @@ StatusCode ApplicationMgr::i_startup() { log << MSG::FATAL << "Error retrieving MessageSvc." << endmsg; return StatusCode::FAILURE; } + m_messageSvc.as()->setProperty( "OutputLevel", m_outputLevel ); auto jobsvc = svcManager()->createService( Gaudi::Utils::TypeNameString( "JobOptionsSvc", m_jobOptionsSvcType ) ); // Create the Job Options service -- GitLab From bfe1639fdceac0693398fcea815bda2fb3d5271c Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 21 Nov 2019 15:01:39 +0100 Subject: [PATCH 49/62] Allow use of custom IJopOptionsSvc that does not inherit from IOptionsSvc --- GaudiCoreSvc/CMakeLists.txt | 2 +- GaudiCoreSvc/src/ApplicationMgr/JOSAdapter.h | 127 ++++++++++++++++++ .../src/ApplicationMgr/ServiceManager.cpp | 9 ++ GaudiCoreSvc/tests/src/test_JOS/custom.cpp | 116 ++++++++++++++++ GaudiCoreSvc/tests/src/test_JOS/fixture.h | 4 +- 5 files changed, 255 insertions(+), 3 deletions(-) create mode 100644 GaudiCoreSvc/src/ApplicationMgr/JOSAdapter.h create mode 100644 GaudiCoreSvc/tests/src/test_JOS/custom.cpp diff --git a/GaudiCoreSvc/CMakeLists.txt b/GaudiCoreSvc/CMakeLists.txt index 482e866462..6d61ff35ab 100644 --- a/GaudiCoreSvc/CMakeLists.txt +++ b/GaudiCoreSvc/CMakeLists.txt @@ -27,7 +27,7 @@ gaudi_add_module(GaudiCoreSvc LINK_LIBRARIES GaudiKernel Boost TBB PythonLibs ${extralibs} INCLUDE_DIRS TBB PythonLibs) -foreach(name IN ITEMS base binding bwcompat) +foreach(name IN ITEMS base binding bwcompat custom) gaudi_add_unit_test(test_JOS_${name} tests/src/test_JOS/${name}.cpp LINK_LIBRARIES GaudiKernel TYPE Boost) add_dependencies(test_JOS_${name} GaudiCoreSvc) diff --git a/GaudiCoreSvc/src/ApplicationMgr/JOSAdapter.h b/GaudiCoreSvc/src/ApplicationMgr/JOSAdapter.h new file mode 100644 index 0000000000..c1963d276b --- /dev/null +++ b/GaudiCoreSvc/src/ApplicationMgr/JOSAdapter.h @@ -0,0 +1,127 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +namespace Gaudi::Details { + + /// Adapter to provide IOptionsSvc interface over custom implementations of IJobOptionsSvc. + struct JOSAdapter final : extends { + public: + JOSAdapter( SmartIF jos, ISvcLocator* svcLoc ) + : extends{jos.as()->name(), svcLoc}, m_jos{std::move( jos )} {} + using Service::getProperties; + + StatusCode queryInterface( const InterfaceID& ti, void** pp ) override { + auto sc = m_jos->queryInterface( ti, pp ); + if ( !sc ) sc = extends::queryInterface( ti, pp ); + return sc; + } + + StatusCode initialize() override { + auto sc = extends::initialize(); + if ( !sc ) return sc; + return m_jos.as()->initialize(); + } + StatusCode start() override { + auto sc = extends::start(); + if ( !sc ) return sc; + return m_jos.as()->start(); + } + StatusCode stop() override { + auto sc = extends::stop(); + if ( !sc ) return sc; + return m_jos.as()->stop(); + } + StatusCode finalize() override { + auto sc = m_jos.as()->finalize(); + if ( !sc ) return sc; + return extends::finalize(); + } + + // forward IJobOptionsSvc calls + StatusCode setMyProperties( const std::string& client, IProperty* me ) override { + return m_jos->setMyProperties( client, me ); + } + StatusCode addPropertyToCatalogue( const std::string& client, + const Gaudi::Details::PropertyBase& property ) override { + return m_jos->addPropertyToCatalogue( client, property ); + } + StatusCode removePropertyFromCatalogue( const std::string& client, const std::string& name ) override { + return m_jos->removePropertyFromCatalogue( client, name ); + } + const std::vector* getProperties( const std::string& client ) const override { + return m_jos->getProperties( client ); + } + const Gaudi::Details::PropertyBase* getClientProperty( const std::string& client, + const std::string& name ) const override { + return m_jos->getClientProperty( client, name ); + } + std::vector getClients() const override { return m_jos->getClients(); } + StatusCode readOptions( const std::string& file, const std::string& path = "" ) override { + return m_jos->readOptions( file, path ); + } + + // adapt IOptionsSvc interface + void set( const std::string& key, const std::string& value ) override { + auto [client, name] = i_splitKey( key ); + Gaudi::Property p; + p.setName( name ); + p.fromString( value ); + if ( auto sc = addPropertyToCatalogue( client, p ); !sc ) { + throw GaudiException{"failed to set property " + key + " to " + value, name, sc}; + } + } + std::string get( const std::string& key, const std::string& default_ ) const override { + auto [client, name] = i_splitKey( key ); + auto p = getClientProperty( client, name ); + if ( !p ) return default_; + return p->toString(); + } + std::string pop( const std::string& key, const std::string& default_ ) override { + auto [client, name] = i_splitKey( key ); + auto value = get( key, default_ ); + removePropertyFromCatalogue( client, name ).ignore(); + return value; + } + bool has( const std::string& key ) const override { + auto [client, name] = i_splitKey( key ); + return getClientProperty( client, name ); + } + bool isSet( const std::string& key ) const override { + return has( key ); // in IJobOptionsSvc a property is set only if registered + } + + std::vector> items() const override { + std::vector> data; + for ( auto& client : getClients() ) { + for ( auto p : *getProperties( client ) ) { data.emplace_back( client + p->name(), p->toString() ); } + } + return data; + } + + void bind( const std::string& prefix, Gaudi::Details::PropertyBase* property ) override { + // in IJobOptionsSvc bind just set client property + auto p = getClientProperty( prefix, property->name() ); + if ( p ) property->assign( *p ); + } + + void broadcast( const std::regex&, const std::string&, OnlyDefaults ) override { + // no-op: cannot be implemented without actual property binding + } + + private: + inline static std::tuple i_splitKey( const std::string& key ) { + auto sep = key.rfind( '.' ); + if ( sep == key.npos ) { throw std::invalid_argument{"cannot split key without at least one '.'"}; } + return {key.substr( 0, sep ), key.substr( sep + 1 )}; + } + + SmartIF m_jos; + }; +} // namespace Gaudi::Details diff --git a/GaudiCoreSvc/src/ApplicationMgr/ServiceManager.cpp b/GaudiCoreSvc/src/ApplicationMgr/ServiceManager.cpp index 157dfd2e7d..78fa250bf3 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ServiceManager.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/ServiceManager.cpp @@ -12,6 +12,8 @@ #include "GaudiKernel/TypeNameString.h" #include "GaudiKernel/reverse.h" +#include "JOSAdapter.h" + #include #include #include @@ -89,6 +91,13 @@ SmartIF& ServiceManager::createService( const Gaudi::Utils::TypeNameSt return no_service; } + if ( name == "JobOptionsSvc" ) { + if ( !dynamic_cast( service ) ) { + warning() << typeName << " does not implement Gaudi::Interfaces::IOptionsSvc, using interface adapter" << endmsg; + service = new Gaudi::Details::JOSAdapter{service, this}; + } + } + m_listsvc.push_back( service ); service->setServiceManager( this ); return m_listsvc.back().service; // DANGER: returns a reference to a SmartIF in m_listsvc, and hence does no longer diff --git a/GaudiCoreSvc/tests/src/test_JOS/custom.cpp b/GaudiCoreSvc/tests/src/test_JOS/custom.cpp new file mode 100644 index 0000000000..ece3240934 --- /dev/null +++ b/GaudiCoreSvc/tests/src/test_JOS/custom.cpp @@ -0,0 +1,116 @@ +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE test_JOS +#include + +#include "fixture.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* +Test that we can use custom implementations of IJobOptionsSvc that do not implement IOptionsSvc. +*/ + +/// Minimal IJobOptionsSvc implementation for testing. +struct CustomJOS : extends { + using extends::extends; + using Service::getProperties; + + ~CustomJOS() { + for ( auto& c : m_catalog ) { + for ( auto p : *c.second ) { delete p; } + delete c.second; + } + } + + StatusCode setMyProperties( const std::string& client, IProperty* me ) override { + debug() << "setMyProperties(" << client << ", " << me << ')' << endmsg; + auto props = getProperties( client ); + if ( props ) + for ( auto p : *props ) me->setProperty( *p ); + return StatusCode::SUCCESS; + } + StatusCode addPropertyToCatalogue( const std::string& client, + const Gaudi::Details::PropertyBase& property ) override { + debug() << "addPropertyToCatalogue(" << client << ", " << property << ')' << endmsg; + auto p = std::make_unique>( property.name(), property.toString() ); + debug() << " " << *p << endmsg; + if ( !getProperties( client ) ) m_catalog[client] = new std::vector{}; + m_catalog[client]->push_back( p.release() ); + return StatusCode::SUCCESS; + } + StatusCode removePropertyFromCatalogue( const std::string& client, const std::string& name ) override { + debug() << "removePropertyFromCatalogue(" << client << ", " << name << ')' << endmsg; + auto it = m_catalog.find( client ); + if ( it != end( m_catalog ) ) { + auto props = it->second; + props->erase( remove_if( props->begin(), props->end(), [&name]( auto p ) { return p->name() == name; } ), + props->end() ); + } + return StatusCode::SUCCESS; + } + const std::vector* getProperties( const std::string& client ) const override { + debug() << "getProperties(" << client << ')' << endmsg; + auto it = m_catalog.find( client ); + return ( it != end( m_catalog ) ) ? it->second : nullptr; + } + const Gaudi::Details::PropertyBase* getClientProperty( const std::string& client, + const std::string& name ) const override { + debug() << "getClientProperty(" << client << ", " << name << ')' << endmsg; + const Gaudi::Details::PropertyBase* prop = nullptr; + + auto props = getProperties( client ); + if ( props ) { + debug() << props << ' ' << props->size() << endmsg; + for ( auto tmp : *props ) { + debug() << " -> " << *tmp << endmsg; + if ( tmp->name() == name ) prop = tmp; + } + } + debug() << " --> " << prop << endmsg; + return prop; + } + std::vector getClients() const override { + debug() << "getClients()" << endmsg; + std::vector data; + data.reserve( m_catalog.size() ); + for_each( begin( m_catalog ), end( m_catalog ), [&data]( auto item ) { data.emplace_back( item.first ); } ); + return data; + } + StatusCode readOptions( const std::string&, const std::string& ) override { return StatusCode::SUCCESS; } + + Gaudi::Property m_type{this, "TYPE"}; + Gaudi::Property m_path{this, "PATH"}; + + std::map*> m_catalog; +}; + +DECLARE_COMPONENT( CustomJOS ) + +BOOST_AUTO_TEST_CASE( JOS_adapter ) { + Fixture f{"CustomJOS"}; + + auto& jos = Gaudi::svcLocator()->getOptsSvc(); + + TestPropertyHolder ph; + Gaudi::Property p1{&ph, "p1", ""}; + Gaudi::Property p2{&ph, "p2", 0}; + + jos.set( "test.p1", "'v2'" ); + jos.set( "test.p2", "10" ); + + ph.bindPropertiesTo( jos ); + + BOOST_CHECK( jos.has( "test.p1" ) ); + BOOST_CHECK_EQUAL( jos.get( "test.p1" ), "v2" ); + BOOST_CHECK( jos.has( "test.p2" ) ); + BOOST_CHECK_EQUAL( jos.get( "test.p2" ), "10" ); + BOOST_CHECK( !jos.has( "test.no" ) ); +} diff --git a/GaudiCoreSvc/tests/src/test_JOS/fixture.h b/GaudiCoreSvc/tests/src/test_JOS/fixture.h index e6f007e9e8..ebb509f019 100644 --- a/GaudiCoreSvc/tests/src/test_JOS/fixture.h +++ b/GaudiCoreSvc/tests/src/test_JOS/fixture.h @@ -10,7 +10,7 @@ #include struct Fixture { - Fixture( const std::string& jos_name = "JobOptionsSvc" ) { + Fixture( const std::string& jos_name = "JobOptionsSvc", int outLevel = 6 ) { // Load required libraries (bypass PluginService) { System::ImageHandle handle; @@ -29,7 +29,7 @@ struct Fixture { appProp->setProperty( "JobOptionsType", "NONE" ).ignore(); // prevent printout of ApplicationMgr banner appProp->setPropertyRepr( "AppName", "''" ).ignore(); - appProp->setProperty( "OutputLevel", 6 ).ignore(); + appProp->setProperty( "OutputLevel", outLevel ).ignore(); BOOST_REQUIRE( app->configure() ); // == End Bootstrap -- GitLab From 09a38fb5cf396f62b0d3978c3575da2c838e94af Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 5 Dec 2019 09:08:49 +0100 Subject: [PATCH 50/62] Fix backward compatibility issue with unpickling of options --- GaudiPython/python/GaudiPython/Bindings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GaudiPython/python/GaudiPython/Bindings.py b/GaudiPython/python/GaudiPython/Bindings.py index 141cbbf229..4c6e1759fb 100644 --- a/GaudiPython/python/GaudiPython/Bindings.py +++ b/GaudiPython/python/GaudiPython/Bindings.py @@ -281,7 +281,7 @@ class iProperty(object): elif type(value) == long: value = '%d' % value # prevent pending 'L' else: - value = repr(value) + value = str(value) ip = self.getInterface() if ip: -- GitLab From 8847d08d5fe9c585da73f44e921fda1f7afce928 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 5 Dec 2019 13:04:46 +0100 Subject: [PATCH 51/62] Fix backward compatibility issue observed by ATLAS (+tests) --- GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h | 5 ++--- GaudiCoreSvc/tests/src/test_JOS/bwcompat.cpp | 2 +- GaudiPython/CMakeLists.txt | 6 ++++++ GaudiPython/tests/test_appmgr_props_from_strings.py | 3 +++ GaudiPython/tests/test_atlas_jos_verify_case.py | 5 +++++ 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 GaudiPython/tests/test_appmgr_props_from_strings.py create mode 100644 GaudiPython/tests/test_atlas_jos_verify_case.py diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index b69d3abfad..0cd8851d6c 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -111,9 +111,8 @@ public: const std::string& name ) const override { const std::string key = client + '.' + name; - auto value = get( key ); - - auto p = std::make_unique>( name, std::move( value ) ); + auto p = std::make_unique>( name, "" ); + p->fromString( get( key ) ); return ( m_old_iface_compat[key] = std::move( p ) ).get(); } /// Get the list of clients diff --git a/GaudiCoreSvc/tests/src/test_JOS/bwcompat.cpp b/GaudiCoreSvc/tests/src/test_JOS/bwcompat.cpp index faa1dfb717..8d2fc01db1 100644 --- a/GaudiCoreSvc/tests/src/test_JOS/bwcompat.cpp +++ b/GaudiCoreSvc/tests/src/test_JOS/bwcompat.cpp @@ -45,6 +45,6 @@ BOOST_AUTO_TEST_CASE( BackwardCompatibility ) { auto sp = dynamic_cast*>( p ); BOOST_REQUIRE( sp ); - BOOST_CHECK_EQUAL( sp->value(), "\"lorem ipsum\"" ); + BOOST_CHECK_EQUAL( sp->value(), "lorem ipsum" ); } } diff --git a/GaudiPython/CMakeLists.txt b/GaudiPython/CMakeLists.txt index 17d54e9ca2..c9c5d5f73d 100644 --- a/GaudiPython/CMakeLists.txt +++ b/GaudiPython/CMakeLists.txt @@ -58,3 +58,9 @@ gaudi_add_dictionary(GaudiPython dict/kernel.h dict/selection_kernel.xml #---Installation------------------------------------------------------------ gaudi_install_python_modules() + +foreach(t IN ITEMS test_appmgr_props_from_strings test_atlas_jos_verify_case) + gaudi_add_test(${t} + COMMAND nosetests -v + ${CMAKE_CURRENT_SOURCE_DIR}/tests/${t}.py) +endforeach() diff --git a/GaudiPython/tests/test_appmgr_props_from_strings.py b/GaudiPython/tests/test_appmgr_props_from_strings.py new file mode 100644 index 0000000000..2f414c3188 --- /dev/null +++ b/GaudiPython/tests/test_appmgr_props_from_strings.py @@ -0,0 +1,3 @@ +def test(): + from GaudiPython import AppMgr + app = AppMgr(selfoptions={'AlgTypeAliases': '{}'}) diff --git a/GaudiPython/tests/test_atlas_jos_verify_case.py b/GaudiPython/tests/test_atlas_jos_verify_case.py new file mode 100644 index 0000000000..7dfde1da5c --- /dev/null +++ b/GaudiPython/tests/test_atlas_jos_verify_case.py @@ -0,0 +1,5 @@ +def test(): + from GaudiPython import AppMgr + app = AppMgr(selfoptions={'MessageSvcType': 'MessageSvc'}) + prop = app._optsvc.getClientProperty(app.name(), 'MessageSvcType') + assert prop.value() == 'MessageSvc' -- GitLab From 761f9581a6af9e14e89884b789fdb1ba9a5a3fa1 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Fri, 6 Dec 2019 13:45:32 +0000 Subject: [PATCH 52/62] Added missing .ignore() --- GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index 0cd8851d6c..bcba024be9 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -112,7 +112,7 @@ public: const std::string key = client + '.' + name; auto p = std::make_unique>( name, "" ); - p->fromString( get( key ) ); + p->fromString( get( key ) ).ignore(); return ( m_old_iface_compat[key] = std::move( p ) ).get(); } /// Get the list of clients -- GitLab From 58afb1cb7c29a0036291d1840d6c08ec9b5015db Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Sun, 22 Dec 2019 23:28:14 +0100 Subject: [PATCH 53/62] Updated JOS deprecation warnings (postpone to v34) --- GaudiKernel/Gaudi/Algorithm.h | 2 +- GaudiKernel/Gaudi/DeprecationHelpers.h | 6 +++--- GaudiKernel/GaudiKernel/AlgTool.h | 2 +- GaudiKernel/GaudiKernel/Auditor.h | 2 +- GaudiKernel/GaudiKernel/IJobOptionsSvc.h | 22 +++++++++++----------- GaudiKernel/GaudiKernel/JobHistory.h | 2 +- GaudiKernel/GaudiKernel/Property.h | 8 ++++---- GaudiKernel/GaudiKernel/PropertyFwd.h | 8 ++++---- GaudiKernel/GaudiKernel/Service.h | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/GaudiKernel/Gaudi/Algorithm.h b/GaudiKernel/Gaudi/Algorithm.h index 58093fb947..c19b816fa0 100644 --- a/GaudiKernel/Gaudi/Algorithm.h +++ b/GaudiKernel/Gaudi/Algorithm.h @@ -310,7 +310,7 @@ namespace Gaudi { /// register for Algorithm Context Service? bool registerContext() const { return m_registerContext; } - GAUDI_DEPRECATED_SINCE_v33r0( "it should not be called explicitely" ) StatusCode setProperties() { + GAUDI_DEPRECATED_SINCE_v34r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; diff --git a/GaudiKernel/Gaudi/DeprecationHelpers.h b/GaudiKernel/Gaudi/DeprecationHelpers.h index d42bc04b19..fbbc6c1ad8 100644 --- a/GaudiKernel/Gaudi/DeprecationHelpers.h +++ b/GaudiKernel/Gaudi/DeprecationHelpers.h @@ -13,8 +13,8 @@ #include -#if GAUDI_VERSION >= CALC_GAUDI_VERSION( 33, 0 ) && GAUDI_MAJOR_VERSION < 999 -# define GAUDI_DEPRECATED_SINCE_v33r0( REASON ) [[deprecated( REASON )]] +#if GAUDI_VERSION >= CALC_GAUDI_VERSION( 34, 0 ) && GAUDI_MAJOR_VERSION < 999 +# define GAUDI_DEPRECATED_SINCE_v34r0( REASON ) [[deprecated( REASON )]] #else -# define GAUDI_DEPRECATED_SINCE_v33r0( REASON ) +# define GAUDI_DEPRECATED_SINCE_v34r0( REASON ) #endif diff --git a/GaudiKernel/GaudiKernel/AlgTool.h b/GaudiKernel/GaudiKernel/AlgTool.h index 8d920e1f9a..17f183740c 100644 --- a/GaudiKernel/GaudiKernel/AlgTool.h +++ b/GaudiKernel/GaudiKernel/AlgTool.h @@ -128,7 +128,7 @@ public: /// The standard ToolSvc service, Return a pointer to the service if present IToolSvc* toolSvc() const; - GAUDI_DEPRECATED_SINCE_v33r0( "it should not be called explicitely" ) StatusCode setProperties() { + GAUDI_DEPRECATED_SINCE_v34r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; diff --git a/GaudiKernel/GaudiKernel/Auditor.h b/GaudiKernel/GaudiKernel/Auditor.h index 01cb78be41..a4f725916a 100644 --- a/GaudiKernel/GaudiKernel/Auditor.h +++ b/GaudiKernel/GaudiKernel/Auditor.h @@ -123,7 +123,7 @@ public: return serviceLocator()->service( name, createIf ); } - GAUDI_DEPRECATED_SINCE_v33r0( "it should not be called explicitely" ) StatusCode setProperties() { + GAUDI_DEPRECATED_SINCE_v34r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; diff --git a/GaudiKernel/GaudiKernel/IJobOptionsSvc.h b/GaudiKernel/GaudiKernel/IJobOptionsSvc.h index e8b6f8ac6f..adb6205bad 100644 --- a/GaudiKernel/GaudiKernel/IJobOptionsSvc.h +++ b/GaudiKernel/GaudiKernel/IJobOptionsSvc.h @@ -23,10 +23,10 @@ class StatusCode; class IProperty; #if GAUDI_MAJOR_VERSION < 999 -# if GAUDI_VERSION >= CALC_GAUDI_VERSION( 34, 0 ) -# error "deprecated header: to be removed in v34r0" -# elif GAUDI_VERSION >= CALC_GAUDI_VERSION( 33, 0 ) -# warning "deprecated header: to be removed in v34r0" +# if GAUDI_VERSION >= CALC_GAUDI_VERSION( 35, 0 ) +# error "deprecated header: removed in v35r0" +# elif GAUDI_VERSION >= CALC_GAUDI_VERSION( 34, 0 ) +# warning "deprecated header: to be removed in v35r0" # endif #endif @@ -45,25 +45,25 @@ public: @param client Name of the client algorithm or service @param me Address of the interface IProperty of the client */ - GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual StatusCode + GAUDI_DEPRECATED_SINCE_v34r0( "will be removed in v34r0" ) virtual StatusCode setMyProperties( const std::string& client, IProperty* me ) = 0; /// Add a property into the JobOptions catalog - GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual StatusCode + GAUDI_DEPRECATED_SINCE_v34r0( "will be removed in v34r0" ) virtual StatusCode addPropertyToCatalogue( const std::string& client, const Gaudi::Details::PropertyBase& property ) = 0; /// Remove a property from the JobOptions catalog - GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual StatusCode + GAUDI_DEPRECATED_SINCE_v34r0( "will be removed in v34r0" ) virtual StatusCode removePropertyFromCatalogue( const std::string& client, const std::string& name ) = 0; /// Get the properties associated to a given client - GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual const + GAUDI_DEPRECATED_SINCE_v34r0( "will be removed in v34r0" ) virtual const std::vector* getProperties( const std::string& client ) const = 0; /// Get a property for a client - GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual const + GAUDI_DEPRECATED_SINCE_v34r0( "will be removed in v34r0" ) virtual const Gaudi::Details::PropertyBase* getClientProperty( const std::string& client, const std::string& name ) const = 0; /// Get the list of clients - GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual std::vector getClients() const = 0; + GAUDI_DEPRECATED_SINCE_v34r0( "will be removed in v34r0" ) virtual std::vector getClients() const = 0; /** look for file 'File' into search path 'Path' * and read it to update existing JobOptionsCatalogue @@ -71,7 +71,7 @@ public: * @param Path search path * @return status code */ - GAUDI_DEPRECATED_SINCE_v33r0( "will be removed in v34r0" ) virtual StatusCode + GAUDI_DEPRECATED_SINCE_v34r0( "will be removed in v34r0" ) virtual StatusCode readOptions( const std::string& file, const std::string& path = "" ) = 0; }; diff --git a/GaudiKernel/GaudiKernel/JobHistory.h b/GaudiKernel/GaudiKernel/JobHistory.h index a7401cfb8b..f90f7652e0 100644 --- a/GaudiKernel/GaudiKernel/JobHistory.h +++ b/GaudiKernel/GaudiKernel/JobHistory.h @@ -68,7 +68,7 @@ public: // functions static const CLID& classID(); // add a global property - GAUDI_DEPRECATED_SINCE_v33r0( "use addProperty( string, string ) instead" ) void addProperty( + GAUDI_DEPRECATED_SINCE_v34r0( "use addProperty( string, string ) instead" ) void addProperty( const std::string&, const Gaudi::Details::PropertyBase* ); void addProperty( const std::string& key, const std::string& value ); diff --git a/GaudiKernel/GaudiKernel/Property.h b/GaudiKernel/GaudiKernel/Property.h index 395181846c..0aae2ee089 100644 --- a/GaudiKernel/GaudiKernel/Property.h +++ b/GaudiKernel/GaudiKernel/Property.h @@ -13,10 +13,10 @@ #include #if GAUDI_MAJOR_VERSION < 999 -# if GAUDI_VERSION >= CALC_GAUDI_VERSION( 34, 0 ) -# error "deprecated header: to be removed in v34r0, use " -# elif GAUDI_VERSION >= CALC_GAUDI_VERSION( 33, 0 ) -# warning "deprecated header: to be removed in v34r0, use " +# if GAUDI_VERSION >= CALC_GAUDI_VERSION( 35, 0 ) +# error "deprecated header: removed in v35r0, use " +# elif GAUDI_VERSION >= CALC_GAUDI_VERSION( 34, 0 ) +# warning "deprecated header: to be removed in v35r0, use " # endif #endif diff --git a/GaudiKernel/GaudiKernel/PropertyFwd.h b/GaudiKernel/GaudiKernel/PropertyFwd.h index 971d477a5b..0ceac16729 100644 --- a/GaudiKernel/GaudiKernel/PropertyFwd.h +++ b/GaudiKernel/GaudiKernel/PropertyFwd.h @@ -13,10 +13,10 @@ #include #if GAUDI_MAJOR_VERSION < 999 -# if GAUDI_VERSION >= CALC_GAUDI_VERSION( 34, 0 ) -# error "deprecated header: to be removed in v34r0, use " -# elif GAUDI_VERSION >= CALC_GAUDI_VERSION( 33, 0 ) -# warning "deprecated header: to be removed in v34r0, use " +# if GAUDI_VERSION >= CALC_GAUDI_VERSION( 35, 0 ) +# error "deprecated header: removed in v35r0, use " +# elif GAUDI_VERSION >= CALC_GAUDI_VERSION( 34, 0 ) +# warning "deprecated header: to be removed in v35r0, use " # endif #endif diff --git a/GaudiKernel/GaudiKernel/Service.h b/GaudiKernel/GaudiKernel/Service.h index 9bcd6ecf50..93cb17d13f 100644 --- a/GaudiKernel/GaudiKernel/Service.h +++ b/GaudiKernel/GaudiKernel/Service.h @@ -83,7 +83,7 @@ public: /** Retrieve pointer to service locator */ SmartIF& serviceLocator() const override; - GAUDI_DEPRECATED_SINCE_v33r0( "it should not be called explicitely" ) StatusCode setProperties() { + GAUDI_DEPRECATED_SINCE_v34r0( "it should not be called explicitely" ) StatusCode setProperties() { if ( !serviceLocator() ) return StatusCode::FAILURE; bindPropertiesTo( serviceLocator()->getOptsSvc() ); return StatusCode::SUCCESS; -- GitLab From fb5831673a5f18c6c897d5399ee1943635b98cf9 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Mon, 23 Dec 2019 01:31:02 +0100 Subject: [PATCH 54/62] Restore old property parsing error policy - by default return StatusCode::FAILURE - the policy can be changed via - the function Gaudi::Details::Property::setParsingErrorPolicy - the env variable GAUDI_PROPERTY_PARSING_ERROR_DEFAULT_POLICY - the macro GAUDI_PROPERTY_PARSING_ERROR_DEFAULT_POLICY --- GaudiExamples/src/Properties/PropertyAlg.cpp | 4 ++ GaudiKernel/Gaudi/Details/Property.h | 4 ++ GaudiKernel/Gaudi/Property.h | 28 ++++++++++-- GaudiKernel/src/Lib/Property.cpp | 43 +++++++++++++++++++ GaudiKernel/tests/src/test_PropertyHolder.cpp | 7 +++ .../tests/src/test_WeakPropertyRef.cpp | 3 ++ 6 files changed, 85 insertions(+), 4 deletions(-) diff --git a/GaudiExamples/src/Properties/PropertyAlg.cpp b/GaudiExamples/src/Properties/PropertyAlg.cpp index e6439f632d..52103e2fba 100644 --- a/GaudiExamples/src/Properties/PropertyAlg.cpp +++ b/GaudiExamples/src/Properties/PropertyAlg.cpp @@ -254,6 +254,8 @@ StatusCode PropertyAlg::initialize() { opts.set( name() + '.' + "PInt", "154" ); info() << "PInt= " << p_int << " [should be 154]" << endmsg; + auto orig_policy = + Gaudi::Details::Property::setParsingErrorPolicy( Gaudi::Details::Property::ParsingErrorPolicy::Exception ); try { info() << "Try to assign invalid value to DoubleArray" << endmsg; // trying to use an invalid value @@ -261,6 +263,8 @@ StatusCode PropertyAlg::initialize() { } catch ( const std::invalid_argument& exc ) { error() << "got invalid_argument exception: " << exc.what() << endmsg; } + Gaudi::Details::Property::setParsingErrorPolicy( orig_policy ); + info() << "DoubleArray = " << m_doublearray.value() << endmsg; info() << "=================================================" << endmsg; return StatusCode::SUCCESS; diff --git a/GaudiKernel/Gaudi/Details/Property.h b/GaudiKernel/Gaudi/Details/Property.h index 8ec69ea521..b935cdb706 100644 --- a/GaudiKernel/Gaudi/Details/Property.h +++ b/GaudiKernel/Gaudi/Details/Property.h @@ -217,4 +217,8 @@ namespace Gaudi::Details::Property { using UpdateHandler::setUpdateHandler; using UpdateHandler::useUpdateHandler; }; + + enum class ParsingErrorPolicy { Ignore, Warning, Exception, Abort }; + ParsingErrorPolicy parsingErrorPolicy(); + ParsingErrorPolicy setParsingErrorPolicy( ParsingErrorPolicy p ); } // namespace Gaudi::Details::Property diff --git a/GaudiKernel/Gaudi/Property.h b/GaudiKernel/Gaudi/Property.h index 8192df47b8..50befde0ed 100644 --- a/GaudiKernel/Gaudi/Property.h +++ b/GaudiKernel/Gaudi/Property.h @@ -377,7 +377,7 @@ namespace Gaudi { if ( p ) { *this = p->value(); } else { - this->fromString( source.toString() ).ignore(); + return this->fromString( source.toString() ).isSuccess(); } return true; } @@ -388,9 +388,29 @@ namespace Gaudi { } /// string -> value StatusCode fromString( const std::string& source ) override { - using Converter = Details::Property::StringConverter; - *this = Converter().fromString( m_value, source ); - return StatusCode::SUCCESS; + try { + using Converter = Details::Property::StringConverter; + *this = Converter().fromString( m_value, source ); + return StatusCode::SUCCESS; + } catch ( const std::invalid_argument& err ) { + using Details::Property::parsingErrorPolicy; + using Details::Property::ParsingErrorPolicy; + switch ( parsingErrorPolicy() ) { + case ParsingErrorPolicy::Ignore: + break; + case ParsingErrorPolicy::Exception: + throw; + break; + case ParsingErrorPolicy::Warning: + std::cerr << "Property '" << name() << "': " << err.what() << '\n'; + break; + case ParsingErrorPolicy::Abort: + std::cerr << "Property '" << name() << "': " << err.what() << '\n'; + std::abort(); + break; + } + return StatusCode::FAILURE; + } } /// value -> string std::string toString() const override { diff --git a/GaudiKernel/src/Lib/Property.cpp b/GaudiKernel/src/Lib/Property.cpp index 4a6f4a34a3..55c3b5d328 100644 --- a/GaudiKernel/src/Lib/Property.cpp +++ b/GaudiKernel/src/Lib/Property.cpp @@ -521,3 +521,46 @@ Gaudi::Details::WeakPropertyRef::operator std::string() const { : m_property->toString() ) : m_value; } + +namespace Gaudi::Details::Property { + namespace { +#ifndef GAUDI_PROPERTY_PARSING_ERROR_DEFAULT_POLICY +# define GAUDI_PROPERTY_PARSING_ERROR_DEFAULT_POLICY Ignore +#endif + ParsingErrorPolicy g_parsingErrorPolicy = ParsingErrorPolicy::GAUDI_PROPERTY_PARSING_ERROR_DEFAULT_POLICY; + } // namespace + ParsingErrorPolicy parsingErrorPolicy() { return g_parsingErrorPolicy; } + ParsingErrorPolicy setParsingErrorPolicy( ParsingErrorPolicy p ) { + auto tmp = g_parsingErrorPolicy; + g_parsingErrorPolicy = p; + return tmp; + } +} // namespace Gaudi::Details::Property + +namespace { + struct InitParsingErrorPolicy { + InitParsingErrorPolicy() { + using Gaudi::Details::Property::ParsingErrorPolicy; + using Gaudi::Details::Property::setParsingErrorPolicy; + std::string policy; + if ( System::getEnv( "GAUDI_PROPERTY_PARSING_ERROR_DEFAULT_POLICY", policy ) ) { + switch ( policy[0] ) { + case 'I': + setParsingErrorPolicy( ParsingErrorPolicy::Ignore ); + break; + case 'W': + setParsingErrorPolicy( ParsingErrorPolicy::Warning ); + break; + case 'E': + setParsingErrorPolicy( ParsingErrorPolicy::Exception ); + break; + case 'A': + setParsingErrorPolicy( ParsingErrorPolicy::Abort ); + break; + default: + break; + } + } + } + } initParsingErrorPolicy; +} // namespace diff --git a/GaudiKernel/tests/src/test_PropertyHolder.cpp b/GaudiKernel/tests/src/test_PropertyHolder.cpp index 2881ddf845..5bc569acd1 100644 --- a/GaudiKernel/tests/src/test_PropertyHolder.cpp +++ b/GaudiKernel/tests/src/test_PropertyHolder.cpp @@ -69,9 +69,16 @@ BOOST_AUTO_TEST_CASE( backward_compatibility ) { AnonymousPropertyHolder mgr; Gaudi::Property p{&mgr, "int_prop", false}; + auto orig_policy = + Gaudi::Details::Property::setParsingErrorPolicy( Gaudi::Details::Property::ParsingErrorPolicy::Exception ); BOOST_CHECK_EXCEPTION( mgr.setProperty( "int_prop", "abc" ), GaudiException, []( const GaudiException& err ) -> bool { return err.message() == "error setting property int_prop: std::invalid_argument, cannot parse 'abc' to int"; } ); + + Gaudi::Details::Property::setParsingErrorPolicy( Gaudi::Details::Property::ParsingErrorPolicy::Ignore ); + BOOST_TEST( mgr.setProperty( "int_prop", "abc" ) == StatusCode::FAILURE ); + + Gaudi::Details::Property::setParsingErrorPolicy( orig_policy ); } } diff --git a/GaudiKernel/tests/src/test_WeakPropertyRef.cpp b/GaudiKernel/tests/src/test_WeakPropertyRef.cpp index 71d8e9f1ee..c0218b2d72 100644 --- a/GaudiKernel/tests/src/test_WeakPropertyRef.cpp +++ b/GaudiKernel/tests/src/test_WeakPropertyRef.cpp @@ -120,6 +120,8 @@ BOOST_AUTO_TEST_CASE( moving ) { } BOOST_AUTO_TEST_CASE( exceptions ) { + auto orig_policy = + Gaudi::Details::Property::setParsingErrorPolicy( Gaudi::Details::Property::ParsingErrorPolicy::Exception ); { Gaudi::Property p{42}; WPR r{p}; @@ -132,4 +134,5 @@ BOOST_AUTO_TEST_CASE( exceptions ) { BOOST_CHECK_THROW( r = p, std::invalid_argument ); BOOST_CHECK_EQUAL( p.value(), 42 ); } + Gaudi::Details::Property::setParsingErrorPolicy( orig_policy ); } -- GitLab From 8910a5c1b99c255dd0ab4b391096a83668d54476 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Mon, 23 Dec 2019 14:02:39 +0100 Subject: [PATCH 55/62] Fix reference files --- GaudiExamples/tests/qmtest/refs/Aida2Root.ref | 13 +++--- GaudiExamples/tests/qmtest/refs/AlgTools2.ref | 43 +++++++++--------- .../tests/qmtest/refs/AlgTools_pyopts.ref | 21 +++++---- .../tests/qmtest/refs/Histograms.ref | 22 +++++----- .../tests/qmtest/refs/Histograms_opts.ref | 44 +++++++++---------- .../tests/qmtest/refs/MetaDataSvc.ref | 6 --- .../tests/qmtest/refs/Properties.ref | 7 +-- .../tests/qmtest/refs/Properties2.ref | 7 +-- .../tests/qmtest/refs/Properties_py.ref | 7 +-- .../qmtest/refs/conditional_output/write.ref | 40 ++++++++--------- 10 files changed, 96 insertions(+), 114 deletions(-) diff --git a/GaudiExamples/tests/qmtest/refs/Aida2Root.ref b/GaudiExamples/tests/qmtest/refs/Aida2Root.ref index 5947dcac0c..e7b446ad7a 100644 --- a/GaudiExamples/tests/qmtest/refs/Aida2Root.ref +++ b/GaudiExamples/tests/qmtest/refs/Aida2Root.ref @@ -18,7 +18,6 @@ JobOptionsSvc INFO # (41,1): ApplicationMgr.EvtMax = 50000 JobOptionsSvc INFO # (42,1): ApplicationMgr.EvtSel = "NONE" JobOptionsSvc INFO # (49,1): ApplicationMgr.HistogramPersistency = "ROOT" JobOptionsSvc INFO # (50,1): RootHistSvc.OutputFile = "histo.root" -JobOptionsSvc INFO # (59,1): HistogramDataSvc.Input = ["InFile DATAFILE='../data/input.hbook' TYP='HBOOK'"] JobOptionsSvc INFO # (61,1): HistogramDataSvc.Predefined1DHistos = {"/stat/Histos2/2":["TEST2", -100, 200]} JobOptionsSvc INFO # (65,1): HistogramDataSvc.OutputLevel = 2 JobOptionsSvc INFO # =======> /home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Aida2Root.opts @@ -33,7 +32,7 @@ ApplicationMgr INFO Application Manager Configured successfully SimpleHistos DEBUG Property update for OutputLevel : new value = 2 SimpleHistos DEBUG Initialize base class GaudiCommon SimpleHistos DEBUG could not locate CounterSummarySvc, no counter summary will be made -SimpleHistos DEBUG List of ALL properties of GaudiHistoAlgorithm/SimpleHistos #properties = 52 +SimpleHistos DEBUG List of ALL properties of GaudiHistoAlgorithm/SimpleHistos #properties = 50 SimpleHistos DEBUG Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } SimpleHistos DEBUG Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False SimpleHistos DEBUG Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' @@ -63,7 +62,7 @@ SimpleHistos DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False SimpleHistos DEBUG Property ['Name': Value] = 'StatPrint':True SimpleHistos DEBUG Property ['Name': Value] = 'PropertiesPrint':False SimpleHistos DEBUG Property ['Name': Value] = 'ErrorsPrint':True -SimpleHistos DEBUG Property ['Name': Value] = 'RootInTES': +SimpleHistos DEBUG Property ['Name': Value] = 'RootInTES':'' SimpleHistos DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True SimpleHistos DEBUG Property ['Name': Value] = 'IsIOBound':False SimpleHistos DEBUG Property ['Name': Value] = 'NeededResources':[ ] @@ -94,7 +93,7 @@ SimpleHistos DEBUG GaudiHistoAlgorithm:: The histogram path is set to be SimpleHistos DEBUG input handles: 0 SimpleHistos DEBUG output handles: 0 SimpleHistos DEBUG Data Deps for SimpleHistos -Histos2 SUCCESS List of ALL properties of Gaudi::Examples::HistoProps/Histos2 #properties = 54 +Histos2 SUCCESS List of ALL properties of Gaudi::Examples::HistoProps/Histos2 #properties = 52 Histos2 SUCCESS Property ['Name': Value] = 'Histo2':('',-5.00000,5.00000,200) Histos2 SUCCESS Property ['Name': Value] = 'Histo1':('Histogram1',-3.00000,3.00000,200) Histos2 SUCCESS Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } @@ -126,7 +125,7 @@ Histos2 SUCCESS Property ['Name': Value] = 'PrintEmptyCounters':False Histos2 SUCCESS Property ['Name': Value] = 'StatPrint':True Histos2 SUCCESS Property ['Name': Value] = 'PropertiesPrint':True Histos2 SUCCESS Property ['Name': Value] = 'ErrorsPrint':True -Histos2 SUCCESS Property ['Name': Value] = 'RootInTES': +Histos2 SUCCESS Property ['Name': Value] = 'RootInTES':'' Histos2 SUCCESS Property ['Name': Value] = 'FilterCircularDependencies':True Histos2 SUCCESS Property ['Name': Value] = 'IsIOBound':False Histos2 SUCCESS Property ['Name': Value] = 'NeededResources':[ ] @@ -147,7 +146,7 @@ Histos2 SUCCESS Property ['Name': Value] = 'Enable':True Histos2 SUCCESS Property ['Name': Value] = 'OutputLevel':3 Histos2 SUCCESS Property ['Name': Value] = 'ExtraOutputs':[] Histos2 SUCCESS Property ['Name': Value] = 'ExtraInputs':[] -Aida2Root SUCCESS List of ALL properties of Aida2Root/Aida2Root #properties = 57 +Aida2Root SUCCESS List of ALL properties of Aida2Root/Aida2Root #properties = 55 Aida2Root SUCCESS Property ['Name': Value] = 'Profs2D':[ 'SimpleHistos/321' , 'SimpleHistos/2dprof' ] Aida2Root SUCCESS Property ['Name': Value] = 'Profs1D':[ 'SimpleHistos/Expo V Gauss 1DProf' ] Aida2Root SUCCESS Property ['Name': Value] = 'Histos3D':[ 'SimpleHistos/3D plot AutoID' , 'SimpleHistos/3d' ] @@ -182,7 +181,7 @@ Aida2Root SUCCESS Property ['Name': Value] = 'PrintEmptyCounters':False Aida2Root SUCCESS Property ['Name': Value] = 'StatPrint':True Aida2Root SUCCESS Property ['Name': Value] = 'PropertiesPrint':True Aida2Root SUCCESS Property ['Name': Value] = 'ErrorsPrint':True -Aida2Root SUCCESS Property ['Name': Value] = 'RootInTES': +Aida2Root SUCCESS Property ['Name': Value] = 'RootInTES':'' Aida2Root SUCCESS Property ['Name': Value] = 'FilterCircularDependencies':True Aida2Root SUCCESS Property ['Name': Value] = 'IsIOBound':False Aida2Root SUCCESS Property ['Name': Value] = 'NeededResources':[ ] diff --git a/GaudiExamples/tests/qmtest/refs/AlgTools2.ref b/GaudiExamples/tests/qmtest/refs/AlgTools2.ref index a61764d15a..62019fb856 100644 --- a/GaudiExamples/tests/qmtest/refs/AlgTools2.ref +++ b/GaudiExamples/tests/qmtest/refs/AlgTools2.ref @@ -35,7 +35,7 @@ StatusCodeSvc INFO initialize MyAlg DEBUG Property update for OutputLevel : new value = 2 MyAlg DEBUG Initialize base class GaudiCommon MyAlg DEBUG could not locate CounterSummarySvc, no counter summary will be made -MyAlg DEBUG List of ALL properties of MyGaudiAlgorithm/MyAlg #properties = 51 +MyAlg DEBUG List of ALL properties of MyGaudiAlgorithm/MyAlg #properties = 49 MyAlg DEBUG Property ['Name': Value] = 'UndefinedToolHandle': MyAlg DEBUG Property ['Name': Value] = 'LegacyToolHandle':MyTool/LegacyToolHandle MyAlg DEBUG Property ['Name': Value] = 'trackSelection':/Event/MyAnalysis/Tracks @@ -55,16 +55,16 @@ MyAlg DEBUG Property ['Name': Value] = 'VetoObjects':[ ] MyAlg DEBUG Property ['Name': Value] = 'StatEntityList':[ ] MyAlg DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] MyAlg DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -MyAlg DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -MyAlg DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -MyAlg DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -MyAlg DEBUG Property ['Name': Value] = 'Context': +MyAlg DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +MyAlg DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +MyAlg DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +MyAlg DEBUG Property ['Name': Value] = 'Context':'' MyAlg DEBUG Property ['Name': Value] = 'TypePrint':True MyAlg DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False MyAlg DEBUG Property ['Name': Value] = 'StatPrint':True MyAlg DEBUG Property ['Name': Value] = 'PropertiesPrint':False MyAlg DEBUG Property ['Name': Value] = 'ErrorsPrint':True -MyAlg DEBUG Property ['Name': Value] = 'RootInTES': +MyAlg DEBUG Property ['Name': Value] = 'RootInTES':'' MyAlg DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True MyAlg DEBUG Property ['Name': Value] = 'IsIOBound':False MyAlg DEBUG Property ['Name': Value] = 'NeededResources':[ ] @@ -117,16 +117,16 @@ MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'ContextService':'AlgConte MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'StatEntityList':[ ] MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'Context': +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'Context':'' MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'TypePrint':True MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'StatPrint':True MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'PropertiesPrint':False MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'ErrorsPrint':True -MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'RootInTES': +MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'RootInTES':'' MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'AuditRestart':False MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'AuditReinitialize':False MyAlg.MyGaudiTool DEBUG Property ['Name': Value] = 'AuditFinalize':False @@ -222,16 +222,16 @@ ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ContextService':'AlgConte ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatEntityList':[ ] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Context': +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Context':'' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'TypePrint':True ToolSvc.ToolA DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatPrint':True ToolSvc.ToolA DEBUG Property ['Name': Value] = 'PropertiesPrint':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ErrorsPrint':True -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RootInTES': +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RootInTES':'' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditRestart':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditReinitialize':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditFinalize':False @@ -254,16 +254,16 @@ ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ContextService':'AlgConte ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatEntityList':[ ] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Context': +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Context':'' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'TypePrint':True ToolSvc.ToolB DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatPrint':True ToolSvc.ToolB DEBUG Property ['Name': Value] = 'PropertiesPrint':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ErrorsPrint':True -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RootInTES': +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RootInTES':'' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditRestart':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditReinitialize':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditFinalize':False @@ -280,7 +280,6 @@ ToolSvc.ToolB DEBUG Registering tool ToolSvc.ToolA ToolSvc.ToolA DEBUG Registering tool ToolSvc.ToolB EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully MyAlg INFO executing.... diff --git a/GaudiExamples/tests/qmtest/refs/AlgTools_pyopts.ref b/GaudiExamples/tests/qmtest/refs/AlgTools_pyopts.ref index 1fa10a119c..6b4d8c36ed 100644 --- a/GaudiExamples/tests/qmtest/refs/AlgTools_pyopts.ref +++ b/GaudiExamples/tests/qmtest/refs/AlgTools_pyopts.ref @@ -107,16 +107,16 @@ ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ContextService':'AlgConte ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatEntityList':[ ] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] ToolSvc.ToolA DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Context': +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'Context':'' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'TypePrint':True ToolSvc.ToolA DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatPrint':True ToolSvc.ToolA DEBUG Property ['Name': Value] = 'PropertiesPrint':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ErrorsPrint':True -ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RootInTES': +ToolSvc.ToolA DEBUG Property ['Name': Value] = 'RootInTES':'' ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditRestart':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditReinitialize':False ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditFinalize':False @@ -139,16 +139,16 @@ ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ContextService':'AlgConte ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatEntityList':[ ] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] ToolSvc.ToolB DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Context': +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'Context':'' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'TypePrint':True ToolSvc.ToolB DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatPrint':True ToolSvc.ToolB DEBUG Property ['Name': Value] = 'PropertiesPrint':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ErrorsPrint':True -ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RootInTES': +ToolSvc.ToolB DEBUG Property ['Name': Value] = 'RootInTES':'' ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditRestart':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditReinitialize':False ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditFinalize':False @@ -165,7 +165,6 @@ ToolSvc.ToolB DEBUG Registering tool ToolSvc.ToolA ToolSvc.ToolA DEBUG Registering tool ToolSvc.ToolB EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully MyAlg INFO executing.... diff --git a/GaudiExamples/tests/qmtest/refs/Histograms.ref b/GaudiExamples/tests/qmtest/refs/Histograms.ref index ea32a59706..c1ee02b3e5 100644 --- a/GaudiExamples/tests/qmtest/refs/Histograms.ref +++ b/GaudiExamples/tests/qmtest/refs/Histograms.ref @@ -1,16 +1,14 @@ # setting LC_ALL to "C" -# --> Including file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Histograms.py' -# <-- End of file '/home/marco/Devel/workspace/Gaudi/GaudiExamples/options/Histograms.py' ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v32r2) - running on marco-XPS-13 on Fri Nov 22 18:11:39 2019 + Welcome to ApplicationMgr (GaudiCoreSvc v33r0) + running on marco-XPS-13 on Mon Dec 23 12:39:15 2019 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully SimpleHistos DEBUG Property update for OutputLevel : new value = 2 SimpleHistos DEBUG Initialize base class GaudiCommon SimpleHistos DEBUG could not locate CounterSummarySvc, no counter summary will be made -SimpleHistos DEBUG List of ALL properties of GaudiHistoAlgorithm/SimpleHistos #properties = 52 +SimpleHistos DEBUG List of ALL properties of GaudiHistoAlgorithm/SimpleHistos #properties = 50 SimpleHistos DEBUG Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } SimpleHistos DEBUG Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False SimpleHistos DEBUG Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' @@ -40,7 +38,7 @@ SimpleHistos DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False SimpleHistos DEBUG Property ['Name': Value] = 'StatPrint':True SimpleHistos DEBUG Property ['Name': Value] = 'PropertiesPrint':False SimpleHistos DEBUG Property ['Name': Value] = 'ErrorsPrint':True -SimpleHistos DEBUG Property ['Name': Value] = 'RootInTES': +SimpleHistos DEBUG Property ['Name': Value] = 'RootInTES':'' SimpleHistos DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True SimpleHistos DEBUG Property ['Name': Value] = 'IsIOBound':False SimpleHistos DEBUG Property ['Name': Value] = 'NeededResources':[ ] @@ -61,6 +59,8 @@ SimpleHistos DEBUG Property ['Name': Value] = 'Enable':True SimpleHistos DEBUG Property ['Name': Value] = 'OutputLevel':2 SimpleHistos DEBUG Property ['Name': Value] = 'ExtraOutputs':[] SimpleHistos DEBUG Property ['Name': Value] = 'ExtraInputs':[] +HistogramDataSvc DEBUG Property update for OutputLevel : new value = 2 +HistogramDataSvc DEBUG Service base class initialized successfully RootHistSvc INFO Writing ROOT histograms to: histo.root HistogramPersis... INFO Added successfully Conversion service:RootHistSvc HistogramDataSvc INFO Added stream file:../data/input.hbook as InFile @@ -212,11 +212,11 @@ EventLoopMgr INFO Histograms converted successfully according to request *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -1DAutoID INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.0004(+-0.0632)/ 0/ 10 [ms] #=49999 -1DForcedAlphaID INFO Time User : Tot= 50 [ms] Ave/Min/Max=0.001(+- 0.1)/ 0/ 10 [ms] #=49999 -1DForcedNumericID INFO Time User : Tot= 50 [ms] Ave/Min/Max=0.001(+- 0.1)/ 0/ 10 [ms] #=49999 -1DOldStyle INFO Time User : Tot= 60 [ms] Ave/Min/Max=0.0012(+- 0.11)/ 0/ 10 [ms] #=49999 -ChronoStatSvc INFO Time User : Tot= 0.96 [s] #= 1 +1DForcedAlphaID INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.0006(+-0.0775)/ 0/ 10 [ms] #=49999 +1DAutoID INFO Time User : Tot= 80 [ms] Ave/Min/Max=0.0016(+-0.126)/ 0/ 10 [ms] #=49999 +1DOldStyle INFO Time User : Tot= 50 [ms] Ave/Min/Max=0.001(+- 0.1)/ 0/ 10 [ms] #=49999 +1DForcedNumericID INFO Time User : Tot= 90 [ms] Ave/Min/Max=0.0018(+-0.134)/ 0/ 10 [ms] #=49999 +ChronoStatSvc INFO Time User : Tot= 1.43 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/GaudiExamples/tests/qmtest/refs/Histograms_opts.ref b/GaudiExamples/tests/qmtest/refs/Histograms_opts.ref index 0f18e56bcb..11501b24fe 100644 --- a/GaudiExamples/tests/qmtest/refs/Histograms_opts.ref +++ b/GaudiExamples/tests/qmtest/refs/Histograms_opts.ref @@ -33,13 +33,13 @@ SimpleHistos DEBUG could not locate CounterSummarySvc, no counter summary SimpleHistos DEBUG List of ALL properties of GaudiHistoAlgorithm/SimpleHistos #properties = 50 SimpleHistos DEBUG Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } SimpleHistos DEBUG Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False -SimpleHistos DEBUG Property ['Name': Value] = 'HeaderFor1DHistoTable':| Title | # | Mean | RMS | Skewness | Kurtosis | -SimpleHistos DEBUG Property ['Name': Value] = 'ShortFormatFor1DHistoTable': | %1$-25.25s %2% -SimpleHistos DEBUG Property ['Name': Value] = 'FormatFor1DHistoTable':| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g | +SimpleHistos DEBUG Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' +SimpleHistos DEBUG Property ['Name': Value] = 'ShortFormatFor1DHistoTable':' | %1$-25.25s %2%' +SimpleHistos DEBUG Property ['Name': Value] = 'FormatFor1DHistoTable':'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' SimpleHistos DEBUG Property ['Name': Value] = 'MonitorHistograms':True SimpleHistos DEBUG Property ['Name': Value] = 'FullDetail':False -SimpleHistos DEBUG Property ['Name': Value] = 'HistoDir':SimpleHistos -SimpleHistos DEBUG Property ['Name': Value] = 'HistoTopDir': +SimpleHistos DEBUG Property ['Name': Value] = 'HistoDir':'SimpleHistos' +SimpleHistos DEBUG Property ['Name': Value] = 'HistoTopDir':'' SimpleHistos DEBUG Property ['Name': Value] = 'HistoOffSet':0 SimpleHistos DEBUG Property ['Name': Value] = 'HistoSplitDir':False SimpleHistos DEBUG Property ['Name': Value] = 'HistoCheckForNaN':True @@ -51,22 +51,22 @@ SimpleHistos DEBUG Property ['Name': Value] = 'VetoObjects':[ ] SimpleHistos DEBUG Property ['Name': Value] = 'StatEntityList':[ ] SimpleHistos DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] SimpleHistos DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -SimpleHistos DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -SimpleHistos DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -SimpleHistos DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -SimpleHistos DEBUG Property ['Name': Value] = 'Context': +SimpleHistos DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +SimpleHistos DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +SimpleHistos DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +SimpleHistos DEBUG Property ['Name': Value] = 'Context':'' SimpleHistos DEBUG Property ['Name': Value] = 'TypePrint':True SimpleHistos DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False SimpleHistos DEBUG Property ['Name': Value] = 'StatPrint':True SimpleHistos DEBUG Property ['Name': Value] = 'PropertiesPrint':False SimpleHistos DEBUG Property ['Name': Value] = 'ErrorsPrint':True -SimpleHistos DEBUG Property ['Name': Value] = 'RootInTES': +SimpleHistos DEBUG Property ['Name': Value] = 'RootInTES':'' SimpleHistos DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True SimpleHistos DEBUG Property ['Name': Value] = 'IsIOBound':False SimpleHistos DEBUG Property ['Name': Value] = 'NeededResources':[ ] SimpleHistos DEBUG Property ['Name': Value] = 'Cardinality':1 SimpleHistos DEBUG Property ['Name': Value] = 'RegisterForContextService':True -SimpleHistos DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc +SimpleHistos DEBUG Property ['Name': Value] = 'MonitorService':'MonitorSvc' SimpleHistos DEBUG Property ['Name': Value] = 'Timeline':False SimpleHistos DEBUG Property ['Name': Value] = 'AuditStop':False SimpleHistos DEBUG Property ['Name': Value] = 'AuditStart':False @@ -96,13 +96,13 @@ Histos2 SUCCESS Property ['Name': Value] = 'Histo2':('',-5.00000,5.00 Histos2 SUCCESS Property ['Name': Value] = 'Histo1':('Histogram1',-3.00000,3.00000,200) Histos2 SUCCESS Property ['Name': Value] = 'AutoStringIDPurgeMap':{ '/' : '=SLASH=' } Histos2 SUCCESS Property ['Name': Value] = 'UseSequencialNumericAutoIDs':False -Histos2 SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':| Title | # | Mean | RMS | Skewness | Kurtosis | -Histos2 SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable': | %1$-25.25s %2% -Histos2 SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g | +Histos2 SUCCESS Property ['Name': Value] = 'HeaderFor1DHistoTable':'| Title | # | Mean | RMS | Skewness | Kurtosis |' +Histos2 SUCCESS Property ['Name': Value] = 'ShortFormatFor1DHistoTable':' | %1$-25.25s %2%' +Histos2 SUCCESS Property ['Name': Value] = 'FormatFor1DHistoTable':'| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |' Histos2 SUCCESS Property ['Name': Value] = 'MonitorHistograms':True Histos2 SUCCESS Property ['Name': Value] = 'FullDetail':False -Histos2 SUCCESS Property ['Name': Value] = 'HistoDir':Histos2 -Histos2 SUCCESS Property ['Name': Value] = 'HistoTopDir': +Histos2 SUCCESS Property ['Name': Value] = 'HistoDir':'Histos2' +Histos2 SUCCESS Property ['Name': Value] = 'HistoTopDir':'' Histos2 SUCCESS Property ['Name': Value] = 'HistoOffSet':0 Histos2 SUCCESS Property ['Name': Value] = 'HistoSplitDir':False Histos2 SUCCESS Property ['Name': Value] = 'HistoCheckForNaN':True @@ -114,22 +114,22 @@ Histos2 SUCCESS Property ['Name': Value] = 'VetoObjects':[ ] Histos2 SUCCESS Property ['Name': Value] = 'StatEntityList':[ ] Histos2 SUCCESS Property ['Name': Value] = 'CounterList':[ '.*' ] Histos2 SUCCESS Property ['Name': Value] = 'UseEfficiencyRowFormat':True -Histos2 SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -Histos2 SUCCESS Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -Histos2 SUCCESS Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -Histos2 SUCCESS Property ['Name': Value] = 'Context': +Histos2 SUCCESS Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +Histos2 SUCCESS Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +Histos2 SUCCESS Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +Histos2 SUCCESS Property ['Name': Value] = 'Context':'' Histos2 SUCCESS Property ['Name': Value] = 'TypePrint':True Histos2 SUCCESS Property ['Name': Value] = 'PrintEmptyCounters':False Histos2 SUCCESS Property ['Name': Value] = 'StatPrint':True Histos2 SUCCESS Property ['Name': Value] = 'PropertiesPrint':True Histos2 SUCCESS Property ['Name': Value] = 'ErrorsPrint':True -Histos2 SUCCESS Property ['Name': Value] = 'RootInTES': +Histos2 SUCCESS Property ['Name': Value] = 'RootInTES':'' Histos2 SUCCESS Property ['Name': Value] = 'FilterCircularDependencies':True Histos2 SUCCESS Property ['Name': Value] = 'IsIOBound':False Histos2 SUCCESS Property ['Name': Value] = 'NeededResources':[ ] Histos2 SUCCESS Property ['Name': Value] = 'Cardinality':1 Histos2 SUCCESS Property ['Name': Value] = 'RegisterForContextService':True -Histos2 SUCCESS Property ['Name': Value] = 'MonitorService':MonitorSvc +Histos2 SUCCESS Property ['Name': Value] = 'MonitorService':'MonitorSvc' Histos2 SUCCESS Property ['Name': Value] = 'Timeline':False Histos2 SUCCESS Property ['Name': Value] = 'AuditStop':False Histos2 SUCCESS Property ['Name': Value] = 'AuditStart':False diff --git a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref index 6720dc7f74..8b6df07a34 100644 --- a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref +++ b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref @@ -304,8 +304,6 @@ TimelineSvc.Partial:False TimelineSvc.RecordTimeline:False TimelineSvc.TimelineFile:'timeline.csv' Tuple.AuditAlgorithms:False -Tuple.AuditBeginRun:False -Tuple.AuditEndRun:False Tuple.AuditExecute:False Tuple.AuditFinalize:False Tuple.AuditInitialize:False @@ -370,8 +368,6 @@ Tuple.UseEfficiencyRowFormat:True Tuple.UseSequencialNumericAutoIDs:False Tuple.VetoObjects:[ ] Tuple2.AuditAlgorithms:False -Tuple2.AuditBeginRun:False -Tuple2.AuditEndRun:False Tuple2.AuditExecute:False Tuple2.AuditFinalize:False Tuple2.AuditInitialize:False @@ -436,8 +432,6 @@ Tuple2.UseEfficiencyRowFormat:True Tuple2.UseSequencialNumericAutoIDs:False Tuple2.VetoObjects:[ ] Tuple3.AuditAlgorithms:False -Tuple3.AuditBeginRun:False -Tuple3.AuditEndRun:False Tuple3.AuditExecute:False Tuple3.AuditFinalize:False Tuple3.AuditInitialize:False diff --git a/GaudiExamples/tests/qmtest/refs/Properties.ref b/GaudiExamples/tests/qmtest/refs/Properties.ref index 371a445e7c..c030528227 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties.ref @@ -106,7 +106,7 @@ PropertyAlg INFO DoublePairArray = [(1.1, 2.1), (2.3, 4.5), (5.6, 6.7) PropertyAlg INFO PInt = 'PInt':101 PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO PDouble = 'PDouble':10100000. -PropertyAlg INFO PString = 'PString':"hundred 'one'" +PropertyAlg INFO PString = 'PString':'hundred \'one\'' PropertyAlg INFO PBool = 'PBool':True PropertyAlg INFO PIntArray = 'PIntArray':[ 1 , 2 , 3 , 5 ] PropertyAlg INFO PDoubleArray = 'PDoubleArray':[ 1.1000000 , 2.0000000 , 3.3000000 ] @@ -334,8 +334,6 @@ MessageSvc.verboseLimit: 500 MessageSvc.warningColorCode: [ 'yellow' ] MessageSvc.warningLimit: 500 PropertyAlg.AuditAlgorithms: False -PropertyAlg.AuditBeginRun: False -PropertyAlg.AuditEndRun: False PropertyAlg.AuditExecute: False PropertyAlg.AuditFinalize: False PropertyAlg.AuditInitialize: False @@ -372,7 +370,7 @@ PropertyAlg.PDouble: 999.00000 PropertyAlg.PDoubleArray: [ 1.1000000 , 2.0000000 , 3.3000000 ] PropertyAlg.PInt: 155 PropertyAlg.PIntArray: [ 1 , 2 , 3 , 5 ] -PropertyAlg.PString: "hundred 'one'" +PropertyAlg.PString: 'hundred \'one\'' PropertyAlg.PStringArray: [ 'one' , 'two' , 'four' ] PropertyAlg.RegisterForContextService: False PropertyAlg.String: 'hundred "one"' @@ -417,7 +415,6 @@ PropertyProxy INFO Got property this.RInt = 1001; PropertyProxy INFO Got property this.String = This is set by the proxy; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully PropertyAlg INFO executing.... diff --git a/GaudiExamples/tests/qmtest/refs/Properties2.ref b/GaudiExamples/tests/qmtest/refs/Properties2.ref index ca6413bfe7..6330c4ab40 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties2.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties2.ref @@ -108,7 +108,7 @@ PropertyAlg INFO DoublePairArray = [(1.1, 2.1), (2.3, 4.5), (5.6, 6.7) PropertyAlg INFO PInt = 'PInt':101 PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO PDouble = 'PDouble':10100000. -PropertyAlg INFO PString = 'PString':"hundred 'one'" +PropertyAlg INFO PString = 'PString':'hundred \'one\'' PropertyAlg INFO PBool = 'PBool':True PropertyAlg INFO PIntArray = 'PIntArray':[ 1 , 2 , 3 , 5 ] PropertyAlg INFO PDoubleArray = 'PDoubleArray':[ 1.1000000 , 2.0000000 , 3.3000000 ] @@ -336,8 +336,6 @@ MessageSvc.verboseLimit: 500 MessageSvc.warningColorCode: [ 'yellow' ] MessageSvc.warningLimit: 500 PropertyAlg.AuditAlgorithms: False -PropertyAlg.AuditBeginRun: False -PropertyAlg.AuditEndRun: False PropertyAlg.AuditExecute: False PropertyAlg.AuditFinalize: False PropertyAlg.AuditInitialize: False @@ -374,7 +372,7 @@ PropertyAlg.PDouble: 999.00000 PropertyAlg.PDoubleArray: [ 1.1000000 , 2.0000000 , 3.3000000 ] PropertyAlg.PInt: 155 PropertyAlg.PIntArray: [ 1 , 2 , 3 , 5 ] -PropertyAlg.PString: "hundred 'one'" +PropertyAlg.PString: 'hundred \'one\'' PropertyAlg.PStringArray: [ 'one' , 'two' , 'four' ] PropertyAlg.RegisterForContextService: False PropertyAlg.String: 'hundred "one"' @@ -419,7 +417,6 @@ PropertyProxy INFO Got property this.RInt = 1001; PropertyProxy INFO Got property this.String = This is set by the proxy; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully PropertyAlg INFO executing.... diff --git a/GaudiExamples/tests/qmtest/refs/Properties_py.ref b/GaudiExamples/tests/qmtest/refs/Properties_py.ref index f50295bda6..508fb237ac 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties_py.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties_py.ref @@ -68,7 +68,7 @@ PropertyAlg INFO DoublePairArray = [(1.1, 2.1), (2.3, 4.5), (5.6, 6.7) PropertyAlg INFO PInt = 'PInt':101 PropertyAlg INFO Read handler called for property: 'PDouble':10100000. PropertyAlg INFO PDouble = 'PDouble':10100000. -PropertyAlg INFO PString = 'PString':"hundred 'one'" +PropertyAlg INFO PString = 'PString':'hundred \'one\'' PropertyAlg INFO PBool = 'PBool':True PropertyAlg INFO PIntArray = 'PIntArray':[ 1 , 2 , 3 , 5 ] PropertyAlg INFO PDoubleArray = 'PDoubleArray':[ 1.1000000 , 2.0000000 , 3.3000000 , 1.0000000e-20 , 1.0000000e+20 ] @@ -296,8 +296,6 @@ MessageSvc.verboseLimit: 500 MessageSvc.warningColorCode: [ 'yellow' ] MessageSvc.warningLimit: 500 PropertyAlg.AuditAlgorithms: False -PropertyAlg.AuditBeginRun: False -PropertyAlg.AuditEndRun: False PropertyAlg.AuditExecute: False PropertyAlg.AuditFinalize: False PropertyAlg.AuditInitialize: False @@ -334,7 +332,7 @@ PropertyAlg.PDouble: 999.00000 PropertyAlg.PDoubleArray: [ 1.1000000 , 2.0000000 , 3.3000000 , 1.0000000e-20 , 1.0000000e+20 ] PropertyAlg.PInt: 155 PropertyAlg.PIntArray: [ 1 , 2 , 3 , 5 ] -PropertyAlg.PString: "hundred 'one'" +PropertyAlg.PString: 'hundred \'one\'' PropertyAlg.PStringArray: [ 'one' , 'two' , 'four' ] PropertyAlg.RegisterForContextService: False PropertyAlg.String: 'hundred "one"' @@ -378,7 +376,6 @@ PropertyProxy INFO Got property this.RInt = 1001; PropertyProxy INFO Got property this.String = hundred "one"; EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully PropertyAlg INFO executing.... diff --git a/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref b/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref index fe24d84de6..5bedcf2a5a 100644 --- a/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref +++ b/GaudiExamples/tests/qmtest/refs/conditional_output/write.ref @@ -71,24 +71,24 @@ DataCreator VERBOSE ServiceLocatorHelper::service: found service TimelineS DataCreator VERBOSE ServiceLocatorHelper::service: found service EventDataSvc DataCreator DEBUG Initialize base class GaudiCommon DataCreator DEBUG could not locate CounterSummarySvc, no counter summary will be made -DataCreator DEBUG List of ALL properties of GaudiTesting::PutDataObjectAlg/DataCreator #properties = 39 -DataCreator DEBUG Property ['Name': Value] = 'DataSvc':EventDataSvc +DataCreator DEBUG List of ALL properties of GaudiTesting::PutDataObjectAlg/DataCreator #properties = 37 +DataCreator DEBUG Property ['Name': Value] = 'DataSvc':'EventDataSvc' DataCreator DEBUG Property ['Name': Value] = 'Paths':[ 'A' , 'B' , 'C' , 'D' ] DataCreator DEBUG Property ['Name': Value] = 'RequireObjects':[ ] DataCreator DEBUG Property ['Name': Value] = 'VetoObjects':[ ] DataCreator DEBUG Property ['Name': Value] = 'StatEntityList':[ ] DataCreator DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] DataCreator DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -DataCreator DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -DataCreator DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -DataCreator DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -DataCreator DEBUG Property ['Name': Value] = 'Context': +DataCreator DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +DataCreator DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +DataCreator DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +DataCreator DEBUG Property ['Name': Value] = 'Context':'' DataCreator DEBUG Property ['Name': Value] = 'TypePrint':True DataCreator DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False DataCreator DEBUG Property ['Name': Value] = 'StatPrint':True DataCreator DEBUG Property ['Name': Value] = 'PropertiesPrint':False DataCreator DEBUG Property ['Name': Value] = 'ErrorsPrint':True -DataCreator DEBUG Property ['Name': Value] = 'RootInTES': +DataCreator DEBUG Property ['Name': Value] = 'RootInTES':'' DataCreator DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True DataCreator DEBUG Property ['Name': Value] = 'IsIOBound':False DataCreator DEBUG Property ['Name': Value] = 'NeededResources':[ ] @@ -122,22 +122,22 @@ OddEvents VERBOSE ServiceLocatorHelper::service: found service TimelineS OddEvents VERBOSE ServiceLocatorHelper::service: found service EventDataSvc OddEvents DEBUG Initialize base class GaudiCommon OddEvents DEBUG could not locate CounterSummarySvc, no counter summary will be made -OddEvents DEBUG List of ALL properties of GaudiTesting::OddEventsFilter/OddEvents #properties = 37 +OddEvents DEBUG List of ALL properties of GaudiTesting::OddEventsFilter/OddEvents #properties = 35 OddEvents DEBUG Property ['Name': Value] = 'RequireObjects':[ ] OddEvents DEBUG Property ['Name': Value] = 'VetoObjects':[ ] OddEvents DEBUG Property ['Name': Value] = 'StatEntityList':[ ] OddEvents DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] OddEvents DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -OddEvents DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -OddEvents DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -OddEvents DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -OddEvents DEBUG Property ['Name': Value] = 'Context': +OddEvents DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +OddEvents DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +OddEvents DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +OddEvents DEBUG Property ['Name': Value] = 'Context':'' OddEvents DEBUG Property ['Name': Value] = 'TypePrint':True OddEvents DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False OddEvents DEBUG Property ['Name': Value] = 'StatPrint':True OddEvents DEBUG Property ['Name': Value] = 'PropertiesPrint':False OddEvents DEBUG Property ['Name': Value] = 'ErrorsPrint':True -OddEvents DEBUG Property ['Name': Value] = 'RootInTES': +OddEvents DEBUG Property ['Name': Value] = 'RootInTES':'' OddEvents DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True OddEvents DEBUG Property ['Name': Value] = 'IsIOBound':False OddEvents DEBUG Property ['Name': Value] = 'NeededResources':[ ] @@ -169,22 +169,22 @@ EvenEvents VERBOSE ServiceLocatorHelper::service: found service TimelineS EvenEvents VERBOSE ServiceLocatorHelper::service: found service EventDataSvc EvenEvents DEBUG Initialize base class GaudiCommon EvenEvents DEBUG could not locate CounterSummarySvc, no counter summary will be made -EvenEvents DEBUG List of ALL properties of GaudiTesting::EvenEventsFilter/EvenEvents #properties = 37 +EvenEvents DEBUG List of ALL properties of GaudiTesting::EvenEventsFilter/EvenEvents #properties = 35 EvenEvents DEBUG Property ['Name': Value] = 'RequireObjects':[ ] EvenEvents DEBUG Property ['Name': Value] = 'VetoObjects':[ ] EvenEvents DEBUG Property ['Name': Value] = 'StatEntityList':[ ] EvenEvents DEBUG Property ['Name': Value] = 'CounterList':[ '.*' ] EvenEvents DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True -EvenEvents DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- | -EvenEvents DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| | -EvenEvents DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max | -EvenEvents DEBUG Property ['Name': Value] = 'Context': +EvenEvents DEBUG Property ['Name': Value] = 'EfficiencyRowFormat':' |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |' +EvenEvents DEBUG Property ['Name': Value] = 'RegularRowFormat':' | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |' +EvenEvents DEBUG Property ['Name': Value] = 'StatTableHeader':' | Counter | # | sum | mean/eff^* | rms/err^* | min | max |' +EvenEvents DEBUG Property ['Name': Value] = 'Context':'' EvenEvents DEBUG Property ['Name': Value] = 'TypePrint':True EvenEvents DEBUG Property ['Name': Value] = 'PrintEmptyCounters':False EvenEvents DEBUG Property ['Name': Value] = 'StatPrint':True EvenEvents DEBUG Property ['Name': Value] = 'PropertiesPrint':False EvenEvents DEBUG Property ['Name': Value] = 'ErrorsPrint':True -EvenEvents DEBUG Property ['Name': Value] = 'RootInTES': +EvenEvents DEBUG Property ['Name': Value] = 'RootInTES':'' EvenEvents DEBUG Property ['Name': Value] = 'FilterCircularDependencies':True EvenEvents DEBUG Property ['Name': Value] = 'IsIOBound':False EvenEvents DEBUG Property ['Name': Value] = 'NeededResources':[ ] @@ -238,7 +238,7 @@ EventLoopMgr WARNING No events will be processed from external input. HistogramDataSvc DEBUG Service base class initialized successfully HistogramDataSvc VERBOSE ServiceLocatorHelper::service: found service IncidentSvc HistogramPersis... DEBUG Service base class initialized successfully -HistogramPersis...WARNING Histograms saving not required. +HistogramPersis... DEBUG Histograms saving not required. HistogramDataSvc VERBOSE ServiceLocatorHelper::service: found service HistogramPersistencySvc ApplicationMgr INFO Application Manager Initialized successfully ServiceManager DEBUG Starting service FileRecordDataSvc -- GitLab From b6bb28325693193c09e46f35c081b06b5e517e40 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 12 Mar 2020 16:01:17 +0100 Subject: [PATCH 56/62] Fix for ROOT IO test algorithm --- GaudiExamples/src/IO/ReadAlg.cpp | 29 +++++++++++++------ .../tests/qmtest/refs/ROOT_IO/CollRead.ref | 16 +++++----- .../tests/qmtest/refs/ROOT_IO/ExtCollRead.ref | 18 +++++++----- .../tests/qmtest/refs/ROOT_IO/Write.ref | 5 +++- 4 files changed, 43 insertions(+), 25 deletions(-) diff --git a/GaudiExamples/src/IO/ReadAlg.cpp b/GaudiExamples/src/IO/ReadAlg.cpp index e182d9e479..9b6eb446bb 100644 --- a/GaudiExamples/src/IO/ReadAlg.cpp +++ b/GaudiExamples/src/IO/ReadAlg.cpp @@ -46,22 +46,33 @@ DECLARE_COMPONENT( ReadAlg ) // Initialize //-------------------------------------------------------------------- StatusCode ReadAlg::initialize() { + auto sc = Algorithm::initialize(); + if ( !sc ) return sc; + m_recordSvc = service( "FileRecordDataSvc", true ); if ( !m_recordSvc ) { error() << "Unable to retrieve run records service" << endmsg; return StatusCode::FAILURE; } - if ( !m_incidentName.empty() ) { + + if ( m_incidentName.empty() ) { auto prp = m_recordSvc.as(); - if ( auto sc = setPropertyRepr( "IncidentName", prp->getProperty( "IncidentName" ).toString() ) ) return sc; - m_incidentSvc = service( "IncidentSvc", true ); - if ( !m_incidentSvc ) { - error() << "Failed to access IncidentSvc." << endmsg; - return StatusCode::FAILURE; + + if ( ( sc = setPropertyRepr( "IncidentName", prp->getProperty( "IncidentName" ).toString() ) ).isFailure() ) { + error() << "Failed to copy FileRecordDataSvc.IncidentName (" << prp->getProperty( "IncidentName" ).toString() + << ')' << endmsg; + return sc; } - m_incidentSvc->addListener( this, m_incidentName ); } - return StatusCode::SUCCESS; + + m_incidentSvc = service( "IncidentSvc", true ); + if ( !m_incidentSvc ) { + error() << "Failed to access IncidentSvc." << endmsg; + return StatusCode::FAILURE; + } + m_incidentSvc->addListener( this, m_incidentName ); + + return sc; } //-------------------------------------------------------------------- @@ -71,7 +82,7 @@ StatusCode ReadAlg::finalize() { if ( m_incidentSvc ) m_incidentSvc->removeListener( this ); m_incidentSvc.reset(); m_recordSvc.reset(); - return StatusCode::SUCCESS; + return Algorithm::finalize(); } //-------------------------------------------------------------------- diff --git a/GaudiExamples/tests/qmtest/refs/ROOT_IO/CollRead.ref b/GaudiExamples/tests/qmtest/refs/ROOT_IO/CollRead.ref index ab9edf5fc1..c89739162e 100644 --- a/GaudiExamples/tests/qmtest/refs/ROOT_IO/CollRead.ref +++ b/GaudiExamples/tests/qmtest/refs/ROOT_IO/CollRead.ref @@ -28,7 +28,6 @@ ApplicationMgr INFO Application Manager Configured successfully EvtTupleSvc INFO Added stream file:PFN:ROOT_IO.tags as EventSelector.DataStreamTool_1 Gaudi::RootData... INFO Connect to existing Database file:PFN:ROOT_IO.tags as /EventSelector.DataStreamTool_1 for READ EventSelector INFO Stream:EventSelector.DataStreamTool_1 Def:COLLECTION='Dir1/Dir2/Dir3/Collection' DATAFILE='PFN:ROOT_IO.tags' SVC='Gaudi::RootCnvSvc' SEL='(Ntrack>15)' FUN='Gaudi::Examples::EvtCollectionSelector' -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully Gaudi::Examples::EvtCollectionSelector -> #tracks : 93 @@ -39,9 +38,13 @@ Gaudi::Examples::EvtCollectionSelector SELECTED : True EventSelector SUCCESS Reading Event record 1. Record number within stream 1: 1 EventPersistenc... INFO Added successfully Conversion service:RootCnvSvc FileRecordPersi... INFO Added successfully Conversion service:RootCnvSvc +ReadAlg SUCCESS Got incident: NEW_FILE_RECORD Source:/FileRecords/D24FDF3A-4164-EA11-A0AF-001E67C9B019 +ReadAlg SUCCESS Received incident:NEW_FILE_RECORD: /FileRecords/D24FDF3A-4164-EA11-A0AF-001E67C9B019 +ReadAlg SUCCESS Incident: FileInfo record: /FileRecords/D24FDF3A-4164-EA11-A0AF-001E67C9B019/EvtCount=1000 +ReadAlg SUCCESS Incident: FileInfo record: /FileRecords/D24FDF3A-4164-EA11-A0AF-001E67C9B019/SumCount=123456 ReadAlg INFO ========= EVENT:2 RUN:999 TIME:1445375073.028799 0 (0) 1 (1) 2 (2) -ReadAlg SUCCESS FileInfo record: F68C0456-5A77-E511-9E13-001E67ABF0AC/EvtCount=1000 -ReadAlg SUCCESS FileInfo record: F68C0456-5A77-E511-9E13-001E67ABF0AC/SumCount=123456 +ReadAlg SUCCESS FileInfo record: D24FDF3A-4164-EA11-A0AF-001E67C9B019/EvtCount=1000 +ReadAlg SUCCESS FileInfo record: D24FDF3A-4164-EA11-A0AF-001E67C9B019/SumCount=123456 Gaudi::Examples::EvtCollectionSelector -> #tracks : 76 Gaudi::Examples::EvtCollectionSelector -> Momenta(Var): [0]=17.7422 [1]=16.7922 [2]=17.6961 [3]=16.0612 [4]=15.7365 Gaudi::Examples::EvtCollectionSelector -> Momenta(Fix): [0]=17.7422 [1]=16.7922 [2]=17.6961 [3]=16.0612 [4]=15.7365 @@ -186,13 +189,12 @@ Gaudi::Examples::EvtCollectionSelector SELECTED : True ReadAlg INFO ========= EVENT:1000 RUN:999 TIME:1445375097.009053 0 (0) 1 (1) 2 (2) Gaudi::RootNTup... INFO End of input Ntuple. EventLoopMgr INFO No more events in event selection -EventLoopMgr INFO ---> Loop Finished - WSS 164.902 | total time (skipping 1st evt) 150737631 ns ApplicationMgr INFO Application Manager Stopped successfully EventLoopMgr INFO Histograms converted successfully according to request. -RootCnvSvc INFO Disconnected data IO:02802356-5A77-E511-9E13-001E67ABF0AC [ROOTIO.mdst] -RootCnvSvc INFO Disconnected data IO:F68C0456-5A77-E511-9E13-001E67ABF0AC [ROOTIO.dst] +RootCnvSvc INFO Disconnected data IO:A4B01A3B-4164-EA11-A0AF-001E67C9B019 [ROOTIO.mdst] +RootCnvSvc INFO Disconnected data IO:D24FDF3A-4164-EA11-A0AF-001E67C9B019 [ROOTIO.dst] ToolSvc INFO Removing all tools created by ToolSvc -EvtTupleSvc.Eve... INFO Disconnected data IO:724BB682-5A77-E511-860B-001E67ABF0AC [ROOT_IO.tags] +EvtTupleSvc.Eve... INFO Disconnected data IO:B26A8544-4164-EA11-8CAA-001E67C9B019 [ROOT_IO.tags] ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully Number of MyTrack instances:2 diff --git a/GaudiExamples/tests/qmtest/refs/ROOT_IO/ExtCollRead.ref b/GaudiExamples/tests/qmtest/refs/ROOT_IO/ExtCollRead.ref index fa4e0e97cd..f4e71b36cf 100644 --- a/GaudiExamples/tests/qmtest/refs/ROOT_IO/ExtCollRead.ref +++ b/GaudiExamples/tests/qmtest/refs/ROOT_IO/ExtCollRead.ref @@ -28,7 +28,6 @@ ApplicationMgr INFO Application Manager Configured successfully EvtTupleSvc INFO Added stream file:PFN:ROOT_IO.etags as EventSelector.DataStreamTool_1 Gaudi::RootData... INFO Connect to existing Database file:PFN:ROOT_IO.etags as /EventSelector.DataStreamTool_1 for READ EventSelector INFO Stream:EventSelector.DataStreamTool_1 Def:COLLECTION='Fill/MyCOL1' DATAFILE='PFN:ROOT_IO.etags' SVC='Gaudi::RootCnvSvc' SEL='(Ntrack>9 && Ntrack<20 && Energy<180)' FUN='Gaudi::Examples::EvtExtCollectionSelector' -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr INFO Application Manager Started successfully Gaudi::Examples::EvtExtCollectionSelector -> #tracks : 10 @@ -99,9 +98,13 @@ Gaudi::Examples::EvtCollectionSelector SELECTED : True EventSelector SUCCESS Reading Event record 1. Record number within stream 2: 1 EventPersistenc... INFO Added successfully Conversion service:RootCnvSvc FileRecordPersi... INFO Added successfully Conversion service:RootCnvSvc +ReadAlg SUCCESS Got incident: NEW_FILE_RECORD Source:/FileRecords/D24FDF3A-4164-EA11-A0AF-001E67C9B019 +ReadAlg SUCCESS Received incident:NEW_FILE_RECORD: /FileRecords/D24FDF3A-4164-EA11-A0AF-001E67C9B019 +ReadAlg SUCCESS Incident: FileInfo record: /FileRecords/D24FDF3A-4164-EA11-A0AF-001E67C9B019/EvtCount=1000 +ReadAlg SUCCESS Incident: FileInfo record: /FileRecords/D24FDF3A-4164-EA11-A0AF-001E67C9B019/SumCount=123456 ReadAlg INFO ========= EVENT:2 RUN:999 TIME:1445375073.028799 0 (0) 1 (1) 2 (2) -ReadAlg SUCCESS FileInfo record: F68C0456-5A77-E511-9E13-001E67ABF0AC/EvtCount=1000 -ReadAlg SUCCESS FileInfo record: F68C0456-5A77-E511-9E13-001E67ABF0AC/SumCount=123456 +ReadAlg SUCCESS FileInfo record: D24FDF3A-4164-EA11-A0AF-001E67C9B019/EvtCount=1000 +ReadAlg SUCCESS FileInfo record: D24FDF3A-4164-EA11-A0AF-001E67C9B019/SumCount=123456 Gaudi::Examples::EvtCollectionSelector -> #tracks : 76 Gaudi::Examples::EvtCollectionSelector -> Momenta(Var): [0]=17.7422 [1]=16.7922 [2]=17.6961 [3]=16.0612 [4]=15.7365 Gaudi::Examples::EvtCollectionSelector -> Momenta(Fix): [0]=17.7422 [1]=16.7922 [2]=17.6961 [3]=16.0612 [4]=15.7365 @@ -171,14 +174,13 @@ Gaudi::Examples::EvtCollectionSelector SELECTED : True ReadAlg INFO ========= EVENT:1000 RUN:999 TIME:1445375097.009053 0 (0) 1 (1) 2 (2) Gaudi::RootNTup... INFO End of input Ntuple. EventLoopMgr INFO No more events in event selection -EventLoopMgr INFO ---> Loop Finished - WSS 169.738 | total time (skipping 1st evt) 68179944 ns ApplicationMgr INFO Application Manager Stopped successfully EventLoopMgr INFO Histograms converted successfully according to request. -RootCnvSvc INFO Disconnected data IO:02802356-5A77-E511-9E13-001E67ABF0AC [ROOTIO.mdst] -RootCnvSvc INFO Disconnected data IO:F68C0456-5A77-E511-9E13-001E67ABF0AC [ROOTIO.dst] +RootCnvSvc INFO Disconnected data IO:A4B01A3B-4164-EA11-A0AF-001E67C9B019 [ROOTIO.mdst] +RootCnvSvc INFO Disconnected data IO:D24FDF3A-4164-EA11-A0AF-001E67C9B019 [ROOTIO.dst] ToolSvc INFO Removing all tools created by ToolSvc -EvtTupleSvc.Eve... INFO Disconnected data IO:94EA728C-5A77-E511-AF30-001E67ABF0AC [ROOT_IO.etags] -EvtTupleSvc.Eve... INFO Disconnected data IO:724BB682-5A77-E511-860B-001E67ABF0AC [ROOT_IO.tags] +EvtTupleSvc.Eve... INFO Disconnected data IO:3011CD4B-4164-EA11-866F-001E67C9B019 [ROOT_IO.etags] +EvtTupleSvc.Eve... INFO Disconnected data IO:B26A8544-4164-EA11-8CAA-001E67C9B019 [ROOT_IO.tags] ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully Number of MyTrack instances:2 diff --git a/GaudiExamples/tests/qmtest/refs/ROOT_IO/Write.ref b/GaudiExamples/tests/qmtest/refs/ROOT_IO/Write.ref index d9385be29b..f03af0379c 100644 --- a/GaudiExamples/tests/qmtest/refs/ROOT_IO/Write.ref +++ b/GaudiExamples/tests/qmtest/refs/ROOT_IO/Write.ref @@ -74,6 +74,8 @@ WriteAlg DEBUG Data Deps for WriteAlg ReadAlg VERBOSE ServiceLocatorHelper::service: found service EventDataSvc ReadAlg VERBOSE ServiceLocatorHelper::service: found service TimelineSvc ReadAlg VERBOSE ServiceLocatorHelper::service: found service FileRecordDataSvc +ReadAlg VERBOSE ServiceLocatorHelper::service: found service IncidentSvc +IncidentSvc DEBUG Adding [NEW_FILE_RECORD] listener 'ReadAlg' with priority 0 ReadAlg VERBOSE ServiceLocatorHelper::service: found service AlgExecStateSvc ReadAlg DEBUG input handles: 0 ReadAlg DEBUG output handles: 0 @@ -1321,6 +1323,7 @@ ServiceManager DEBUG Stopping service AppMgrRunable ServiceManager DEBUG Stopping service FileRecordDataSvc ApplicationMgr INFO Application Manager Stopped successfully ServiceManager DEBUG Finalizing service EventLoopMgr +IncidentSvc DEBUG Removing [NEW_FILE_RECORD] listener 'ReadAlg' RootDst INFO Events output: 1000 RootMini INFO Events output: 1000 FileRecords INFO Set up File Summary Record @@ -1346,8 +1349,8 @@ ServiceManager DEBUG Finalizing service IncidentSvc IncidentSvc DEBUG Incident timing: Mean(+-rms)/Min/Max:0(+-0)/0/0[ms] Total:0[s] ServiceManager DEBUG Finalizing service AppMgrRunable ServiceManager DEBUG Finalizing service FileRecordDataSvc -IncidentSvc DEBUG Removing [SAVE_FILE_RECORD] listener 'FileRecordDataSvc' IncidentSvc DEBUG Removing [FILE_OPEN_READ] listener 'FileRecordDataSvc' +IncidentSvc DEBUG Removing [SAVE_FILE_RECORD] listener 'FileRecordDataSvc' ServiceManager DEBUG Looping over all active services... ServiceManager DEBUG ---- MessageSvc (refCount = 27) ServiceManager DEBUG ---- JobOptionsSvc (refCount = 3) -- GitLab From f7fc8a5eac1d4f101b5cf37abaac903b6839cd2c Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Wed, 29 Apr 2020 21:04:14 +0000 Subject: [PATCH 57/62] Fixed formatting patch generated by https://gitlab.cern.ch/clemenci/Gaudi/-/jobs/8187270 --- GaudiPython/python/GaudiPython/Bindings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GaudiPython/python/GaudiPython/Bindings.py b/GaudiPython/python/GaudiPython/Bindings.py index 61c6899dd8..a5bc97aed9 100644 --- a/GaudiPython/python/GaudiPython/Bindings.py +++ b/GaudiPython/python/GaudiPython/Bindings.py @@ -84,7 +84,7 @@ namespace GaudiPython { namespace Helpers { # toIntArray, toShortArray, etc. for l in [l for l in dir(Helper) if re.match("^to.*Array$", l)]: - exec ("%s = Helper.%s" % (l, l)) + exec("%s = Helper.%s" % (l, l)) __all__.append(l) # FIXME: (MCl) Hack to handle ROOT 5.18 and ROOT >= 5.20 -- GitLab From a7dc19d17580ecd928154ddae45ea3225750e808 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 30 Apr 2020 19:11:43 +0200 Subject: [PATCH 58/62] Fix normalization of test stdout --- GaudiPolicy/python/GaudiTesting/BaseTest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GaudiPolicy/python/GaudiTesting/BaseTest.py b/GaudiPolicy/python/GaudiTesting/BaseTest.py index 02a015bc7a..f5f24099b8 100644 --- a/GaudiPolicy/python/GaudiTesting/BaseTest.py +++ b/GaudiPolicy/python/GaudiTesting/BaseTest.py @@ -961,7 +961,7 @@ for w, o, r in [ r"^(.*(DEBUG|SUCCESS) List of ALL properties of .*#properties = )\d+", r"\1NN"), ('ApplicationMgr', r'(declareMultiSvcType|addMultiSvc): ', ''), - ("Property ['Name': Value]", r"( = '[^']+':)'(.*)'", r'\1\2'), + (r"Property \['Name': Value\]", r"( = '[^']+':)'(.*)'", r'\1\2'), ('TimelineSvc', "to file 'TimelineFile':", "to file "), ('DataObjectHandleBase', r'DataObjectHandleBase\("([^"]*)"\)', r"'\1'"), ]: # [ ("TIMER.TIMER","[0-9]+[0-9.]*", "") ] -- GitLab From a8a9861b4a23e7454b765d0b1ce00340169cf8c1 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Tue, 7 Jul 2020 11:35:03 +0200 Subject: [PATCH 59/62] Add micro benchmark for IOptionsSvc::set --- GaudiCoreSvc/CMakeLists.txt | 4 ++ GaudiCoreSvc/tests/src/test_JOS/benchmark.cpp | 71 +++++++++++++++++++ GaudiCoreSvc/tests/src/test_JOS/fixture.h | 10 ++- 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 GaudiCoreSvc/tests/src/test_JOS/benchmark.cpp diff --git a/GaudiCoreSvc/CMakeLists.txt b/GaudiCoreSvc/CMakeLists.txt index 4988d2ede8..5828698fd2 100644 --- a/GaudiCoreSvc/CMakeLists.txt +++ b/GaudiCoreSvc/CMakeLists.txt @@ -42,3 +42,7 @@ foreach(name IN ITEMS base binding bwcompat custom) LINK_LIBRARIES GaudiKernel TYPE Boost) add_dependencies(test_JOS_${name} GaudiCoreSvc) endforeach() + +gaudi_add_executable(JOS_benchmark tests/src/test_JOS/benchmark.cpp + LINK_LIBRARIES GaudiKernel) +add_dependencies(JOS_benchmark GaudiCoreSvc) diff --git a/GaudiCoreSvc/tests/src/test_JOS/benchmark.cpp b/GaudiCoreSvc/tests/src/test_JOS/benchmark.cpp new file mode 100644 index 0000000000..0dc26a4de0 --- /dev/null +++ b/GaudiCoreSvc/tests/src/test_JOS/benchmark.cpp @@ -0,0 +1,71 @@ +/***********************************************************************************\ +* (c) Copyright 2020 CERN for the benefit of the LHCb and ATLAS collaborations * +* * +* This software is distributed under the terms of the Apache version 2 licence, * +* copied verbatim in the file "COPYING". * +* * +* In applying this licence, CERN does not waive the privileges and immunities * +* granted to it by virtue of its status as an Intergovernmental Organization * +* or submit itself to any jurisdiction. * +\***********************************************************************************/ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define NO_BOOST +#include "fixture.h" + +// function adapted from from +// - https://stackoverflow.com/a/24586587 +// - https://stackoverflow.com/a/12468109 +// - https://en.cppreference.com/w/cpp/algorithm/generate_n#Example +std::string random_string( std::string::size_type length ) { + auto randchar = []() { + const char charset[] = "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "._"; + + static std::mt19937 rng; // default constructed, seeded with fixed seed + + static std::uniform_int_distribution pick( 0, sizeof( charset ) - 2 ); + return charset[pick( rng )]; + }; + std::string str( length, 0 ); + std::generate_n( str.begin(), length, randchar ); + return str; +} + +int main( int argc, char* argv[] ) { + Fixture f; + + auto& jos = Gaudi::svcLocator()->getOptsSvc(); + + std::cout << "preparing the data" << std::endl; + std::size_t n_entries = 10000; + if ( argc > 1 ) { n_entries = std::atol( argv[1] ); } + + std::vector> m_input_data; + m_input_data.reserve( n_entries ); + std::generate_n( back_inserter( m_input_data ), n_entries, []() { + return std::pair{random_string( 20 + std::rand() % 80 ), random_string( std::rand() % 20 )}; + } ); + + std::cout << "adding " << n_entries << " properties" << std::endl; + + auto start = std::chrono::high_resolution_clock::now(); + for ( const auto& item : m_input_data ) jos.set( item.first, item.second ); + auto end = std::chrono::high_resolution_clock::now(); + + std::chrono::duration diff = end - start; + std::cout << "elapsed time: " << diff.count() << " s\n"; +} diff --git a/GaudiCoreSvc/tests/src/test_JOS/fixture.h b/GaudiCoreSvc/tests/src/test_JOS/fixture.h index 3e9d0ec042..2701042610 100644 --- a/GaudiCoreSvc/tests/src/test_JOS/fixture.h +++ b/GaudiCoreSvc/tests/src/test_JOS/fixture.h @@ -17,7 +17,11 @@ #include #include -#include +#ifndef NO_BOOST +# include +#else +# define BOOST_REQUIRE( x ) +#endif struct Fixture { Fixture( const std::string& jos_name = "JobOptionsSvc", int outLevel = 6 ) { @@ -53,3 +57,7 @@ struct TestPropertyHolder : public PropertyHolder Date: Tue, 7 Jul 2020 13:09:51 +0200 Subject: [PATCH 60/62] Optimize case insensitive fallback --- .../src/JobOptionsSvc/JobOptionsSvc.cpp | 20 +++++++++++++++++-- .../src/JobOptionsSvc/JobOptionsSvc.h | 8 +++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp index 16d2bbc795..90e147d032 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp @@ -27,6 +27,9 @@ #include "GaudiKernel/System.h" #include +#include +#include + #if __cplusplus >= 201703 # include #else @@ -44,6 +47,10 @@ namespace { return s.substr( 0, prefix.size() ) == prefix; } #endif + + void make_lower( std::string& s ) { + std::transform( s.begin(), s.end(), s.begin(), []( unsigned char c ) { return std::tolower( c ); } ); + } } // namespace // ============================================================================ @@ -172,8 +179,11 @@ StatusCode JobOptionsSvc::setMyProperties( const std::string& client, IProperty* JobOptionsSvc::StorageType::const_iterator JobOptionsSvc::i_find( const std::string& key, bool warn ) const { StorageType::const_iterator iter = m_options.find( key ); if ( iter == m_options.end() ) { // try case insensitive lookup - iter = std::find_if( m_options.begin(), m_options.end(), - [&key]( auto& item ) { return Gaudi::Utils::iequal( item.first, key ); } ); + std::string l_key = key; + make_lower( l_key ); + + auto l_iter = m_lower_to_correct_case.find( l_key ); + if ( l_iter != m_lower_to_correct_case.end() ) iter = m_options.find( l_iter->second ); if ( warn && iter != m_options.end() ) { warning() << "mismatching case for property name: actual name is " << key << " but " << iter->first << " is in the option files" << endmsg; @@ -182,6 +192,12 @@ JobOptionsSvc::StorageType::const_iterator JobOptionsSvc::i_find( const std::str return iter; } +void JobOptionsSvc::i_update_case_insensitive_map( const std::string& key ) { + std::string l_key = key; + make_lower( l_key ); + m_lower_to_correct_case[l_key] = key; +} + /// Get the list of clients std::vector JobOptionsSvc::getClients() const { std::set clients; diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index e4a0631b98..c5d946b108 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -34,10 +34,13 @@ public: typedef std::vector PropertiesT; private: - using StorageType = std::map; + using StorageType = std::unordered_map; StorageType m_options; + /// Helper to handle of the case mismatches in property names + std::unordered_map m_lower_to_correct_case; + mutable std::map> m_old_iface_compat; mutable std::map m_old_iface_compat_2; @@ -45,6 +48,8 @@ private: /// If the found key does not match the case of the requested one, a warning is printed. StorageType::const_iterator i_find( const std::string& key, bool warn ) const; + void i_update_case_insensitive_map( const std::string& key ); + protected: /// @{ void set( const std::string& key, const std::string& value ) override { @@ -57,6 +62,7 @@ protected: } if ( item == m_options.end() ) { m_options.emplace( key, value ); + i_update_case_insensitive_map( key ); } else { m_options.find( item->first )->second = value; } -- GitLab From 91367507e01add2939fdaf68951142e9c06b2bc1 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Tue, 7 Jul 2020 16:30:52 +0200 Subject: [PATCH 61/62] Fix tests --- GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h | 1 + GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref | 6 +++--- GaudiExamples/tests/qmtest/refs/Properties.ref | 2 +- GaudiExamples/tests/qmtest/refs/Properties2.ref | 2 +- GaudiExamples/tests/qmtest/refs/Properties_py.ref | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h index c5d946b108..7ad3f51fc1 100644 --- a/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h +++ b/GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h @@ -86,6 +86,7 @@ protected: std::vector> v; v.reserve( m_options.size() ); std::for_each( begin( m_options ), end( m_options ), [&v]( const auto& item ) { v.emplace_back( item ); } ); + std::sort( begin( v ), end( v ) ); return v; } bool isSet( const std::string& key ) const override { diff --git a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref index 8b6df07a34..715f2b3d99 100644 --- a/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref +++ b/GaudiExamples/tests/qmtest/refs/MetaDataSvc.ref @@ -312,6 +312,7 @@ Tuple.AuditRestart:False Tuple.AuditStart:False Tuple.AuditStop:False Tuple.AutoStringIDPurgeMap:{ '/' : '=SLASH=' } +Tuple.Blocking:False Tuple.Cardinality:1 Tuple.Context:'' Tuple.CounterList:[ '.*' ] @@ -340,7 +341,6 @@ Tuple.HistoPrint:False Tuple.HistoProduce:True Tuple.HistoSplitDir:False Tuple.HistoTopDir:'' -Tuple.IsIOBound:False Tuple.MonitorHistograms:True Tuple.MonitorService:'MonitorSvc' Tuple.NTupleDir:'Tuple' @@ -376,6 +376,7 @@ Tuple2.AuditRestart:False Tuple2.AuditStart:False Tuple2.AuditStop:False Tuple2.AutoStringIDPurgeMap:{ '/' : '=SLASH=' } +Tuple2.Blocking:False Tuple2.Cardinality:1 Tuple2.Context:'' Tuple2.CounterList:[ '.*' ] @@ -404,7 +405,6 @@ Tuple2.HistoPrint:False Tuple2.HistoProduce:True Tuple2.HistoSplitDir:False Tuple2.HistoTopDir:'' -Tuple2.IsIOBound:False Tuple2.MonitorHistograms:True Tuple2.MonitorService:'MonitorSvc' Tuple2.NTupleDir:'Tuple2' @@ -440,6 +440,7 @@ Tuple3.AuditRestart:False Tuple3.AuditStart:False Tuple3.AuditStop:False Tuple3.AutoStringIDPurgeMap:{ '/' : '=SLASH=' } +Tuple3.Blocking:False Tuple3.Cardinality:1 Tuple3.Context:'' Tuple3.CounterList:[ '.*' ] @@ -468,7 +469,6 @@ Tuple3.HistoPrint:False Tuple3.HistoProduce:True Tuple3.HistoSplitDir:False Tuple3.HistoTopDir:'' -Tuple3.IsIOBound:False Tuple3.MonitorHistograms:True Tuple3.MonitorService:'MonitorSvc' Tuple3.NTupleDir:'Tuple3' diff --git a/GaudiExamples/tests/qmtest/refs/Properties.ref b/GaudiExamples/tests/qmtest/refs/Properties.ref index c030528227..610cb6da75 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties.ref @@ -341,6 +341,7 @@ PropertyAlg.AuditReinitialize: False PropertyAlg.AuditRestart: False PropertyAlg.AuditStart: False PropertyAlg.AuditStop: False +PropertyAlg.Blocking: False PropertyAlg.Bool: False PropertyAlg.BoolArray: [ False , True , False ] PropertyAlg.Cardinality: 1 @@ -360,7 +361,6 @@ PropertyAlg.Int64: 4294967296 PropertyAlg.Int64Array: [ 4294967296 ] PropertyAlg.IntArray: [ 1 , 2 , 3 , 5 ] PropertyAlg.IntPairArray: [ ( 1 , 2 ) , ( 3 , 4 ) , ( 5 , 6 ) ] -PropertyAlg.IsIOBound: False PropertyAlg.MonitorService: 'MonitorSvc' PropertyAlg.NeededResources: [ ] PropertyAlg.OutputLevel: 3 diff --git a/GaudiExamples/tests/qmtest/refs/Properties2.ref b/GaudiExamples/tests/qmtest/refs/Properties2.ref index 6330c4ab40..e9c60e329a 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties2.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties2.ref @@ -343,6 +343,7 @@ PropertyAlg.AuditReinitialize: False PropertyAlg.AuditRestart: False PropertyAlg.AuditStart: False PropertyAlg.AuditStop: False +PropertyAlg.Blocking: False PropertyAlg.Bool: False PropertyAlg.BoolArray: [ False , True , False ] PropertyAlg.Cardinality: 1 @@ -362,7 +363,6 @@ PropertyAlg.Int64: 4294967296 PropertyAlg.Int64Array: [ 4294967296 ] PropertyAlg.IntArray: [ 1 , 2 , 3 , 5 ] PropertyAlg.IntPairArray: [ ( 1 , 2 ) , ( 3 , 4 ) , ( 5 , 6 ) ] -PropertyAlg.IsIOBound: False PropertyAlg.MonitorService: 'MonitorSvc' PropertyAlg.NeededResources: [ ] PropertyAlg.OutputLevel: 3 diff --git a/GaudiExamples/tests/qmtest/refs/Properties_py.ref b/GaudiExamples/tests/qmtest/refs/Properties_py.ref index 508fb237ac..4f13b01c61 100644 --- a/GaudiExamples/tests/qmtest/refs/Properties_py.ref +++ b/GaudiExamples/tests/qmtest/refs/Properties_py.ref @@ -303,6 +303,7 @@ PropertyAlg.AuditReinitialize: False PropertyAlg.AuditRestart: False PropertyAlg.AuditStart: False PropertyAlg.AuditStop: False +PropertyAlg.Blocking: False PropertyAlg.Bool: False PropertyAlg.BoolArray: [ False , True , False ] PropertyAlg.Cardinality: 1 @@ -322,7 +323,6 @@ PropertyAlg.Int64: 4294967296 PropertyAlg.Int64Array: [ 4294967296 ] PropertyAlg.IntArray: [ 1 , 2 , 3 , 5 ] PropertyAlg.IntPairArray: [ ( 1 , 2 ) , ( 3 , 4 ) , ( 5 , 6 ) ] -PropertyAlg.IsIOBound: False PropertyAlg.MonitorService: 'MonitorSvc' PropertyAlg.NeededResources: [ ] PropertyAlg.OutputLevel: 3 -- GitLab From 1ab545dfd28e4218e0c637e57f5d6a80e0974a25 Mon Sep 17 00:00:00 2001 From: Marco Clemencic Date: Thu, 23 Jul 2020 08:16:38 +0200 Subject: [PATCH 62/62] mask new optional INFO message in tests --- GaudiPolicy/python/GaudiTesting/BaseTest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GaudiPolicy/python/GaudiTesting/BaseTest.py b/GaudiPolicy/python/GaudiTesting/BaseTest.py index f63e638767..e61d017707 100644 --- a/GaudiPolicy/python/GaudiTesting/BaseTest.py +++ b/GaudiPolicy/python/GaudiTesting/BaseTest.py @@ -1000,6 +1000,8 @@ lineSkipper = LineSkipper( 'mismatching case for property name:', # Message demoted to DEBUG in gaudi/Gaudi!992 'Histograms saving not required.', + # Message added in gaudi/Gaudi!577 + 'Properties are dumped into', ], regexps=[ r"^JobOptionsSvc INFO *$", -- GitLab