| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Protected Attributes | List of all members
HistogramPersistencySvc Class Reference

HistogramPersistencySvc class implementation definition. More...

`#include <src/HistogramPersistencySvc/HistogramPersistencySvc.h>`

Inheritance diagram for HistogramPersistencySvc:
[legend]
Collaboration diagram for HistogramPersistencySvc:
[legend]

## Public Types
typedef std::set< std::string > | Set
| for report: unconverted histograms More...
Public Types inherited from extends< Service, IConversionSvc, IPersistencySvc, IAddressCreator >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
Public Types inherited from Service
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces... >
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
| take union of the ext_iids of all Interfaces... More...

## Public Member Functions
PersistencySvc overrides
StatusCode | initialize () override
| Initialize the service. More...
StatusCode | reinitialize () override
| Reinitialize the service. More...
StatusCode | finalize () override
| Finalize the service. More...
StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
| Implementation of IConverter: Convert the transient object to the requested representation. More...
: Object implementation
| HistogramPersistencySvc (const std::string &name, ISvcLocator *svc)
| Standard Constructor. More...
| ~HistogramPersistencySvc () override=default
| Standard Destructor. More...
Public Member Functions inherited from PersistencySvc
long | repSvcType () const override
| Return default service type. More...
const CLID & | objType () const override
| Retrieve the class type of objects the converter produces. (DUMMY) More...
StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override
| Implementation of IConverter: Create the transient representation of an object. More...
StatusCode | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Implementation of IConverter: Resolve the references of the created transient object. More...
StatusCode | updateObj (IOpaqueAddress *pAddress, DataObject *refpObject) override
| Implementation of IConverter: Update the transient object from the other representation. More...
StatusCode | updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Implementation of IConverter: Update the references of an updated transient object. More...
StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
| Implementation of IConverter: Convert the transient object to the requested representation. More...
StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Implementation of IConverter: Resolve the references of the converted object. More...
StatusCode | updateRep (IOpaqueAddress *pAddress, DataObject *pObject) override
| Implementation of IConverter: Update the converted representation of a transient object. More...
StatusCode | updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Implementation of IConverter: Update the references of an already converted object. More...
StatusCode | setDataProvider (IDataProviderSvc *pStore) override
| Define transient datastore. More...
SmartIF< IDataProviderSvc > & | dataProvider () const override
| Access reference to transient datastore. More...
StatusCode | setConversionSvc (IConversionSvc *svc) override
| Set conversion service the converter is connected to. More...
SmartIF< IConversionSvc > & | conversionSvc () const override
| Get conversion service the converter is connected to. More...
StatusCode | setAddressCreator (IAddressCreator *creator) override
| Set address creator facility. More...
SmartIF< IAddressCreator > & | addressCreator () const override
| Retrieve address creator facility. More...
StatusCode | addConverter (IConverter *pConverter) override
| Add converter object to conversion service. More...
StatusCode | addConverter (const CLID &clid) override
| Add converter object to conversion service. More...
IConverter * | converter (const CLID &clid) override
| Retrieve converter from list. More...
StatusCode | removeConverter (const CLID &clid) override
| Remove converter object from conversion service (if present). More...
StatusCode | connectOutput (const std::string &outputFile, const std::string &openMode) override
| Connect the output file to the service with open mode. More...
StatusCode | connectOutput (const std::string &outputFile) override
| Connect the output file to the service. More...
StatusCode | commitOutput (const std::string &output, bool do_commit) override
| Commit pending output. More...
StatusCode | createAddress (long svc_type, const CLID &clid, const std::string *pars, const unsigned long *ipars, IOpaqueAddress *&refpAddress) override
| Create a Generic address using explicit arguments to identify a single object. More...
StatusCode | convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) override
| Convert an address to string form. More...
StatusCode | createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) override
| Convert an address in string form to object form. More...
StatusCode | addCnvService (IConversionSvc *service) override
| Add a new Service. More...
StatusCode | removeCnvService (long type) override
| Remove a Service. More...
StatusCode | setDefaultCnvService (long type) override
| Set default service type. More...
StatusCode | getService (long service_type, IConversionSvc *&refpSvc) override
| Retrieve conversion service identified by technology. More...
StatusCode | getService (const std::string &service_type, IConversionSvc *&refpSvc) override
| Retrieve conversion service identified by technology. More...
StatusCode | initialize () override
| Initialize the service. More...
StatusCode | finalize () override
| stop the service. More...
| PersistencySvc (const std::string &name, ISvcLocator *svc)
| Standard Constructor. More...
| ~PersistencySvc () override=default
| Standard Destructor. More...
Public Member Functions inherited from extends< Service, IConversionSvc, IPersistencySvc, IAddressCreator >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| ~extends () override=default
| Virtual destructor. More...
Public Member Functions inherited from Service
const std::string & | name () const override
| Retrieve name of the service. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
| Initialize Service. More...
StatusCode | sysStart () override
| Initialize Service. More...
StatusCode | sysStop () override
| Initialize Service. More...
StatusCode | sysFinalize () override
| Finalize Service. More...
StatusCode | sysReinitialize () override
| Re-initialize the Service. More...
StatusCode | sysRestart () override
| Re-initialize the Service. More...
| Service (std::string name, ISvcLocator *svcloc)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job. More...
template<class T >
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<typename IFace = IService>
SmartIF< IFace > | service (const std::string &name, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist. More...
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
| Declare used tool. More...
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| PropertyHolder ()=default
| ~PropertyHolder () override=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces... >
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected Attributes
Gaudi::Property< std::string > | m_histPersName {this, "HistogramPersistency", "", "name of the Hist Pers type"}
Gaudi::Property< std::string > | m_outputFile {this, "OutputFile", "", "name of the output file"}
Gaudi::Property< std::vector< std::string > > | m_convert
Gaudi::Property< std::vector< std::string > > | m_exclude
Gaudi::Property< bool > | m_warnings {this, "Warnings", true, "Set this property to false to suppress warning messages"}
Set | m_converted
| for the final report: the list of converted histograms More...
Set | m_excluded
| for the final report: the list of excluded histograms More...
Protected Attributes inherited from PersistencySvc
long | m_cnvDefType = TEST_StorageType
| Default service type. More...
SmartIF< IDataProviderSvc > | m_dataSvc
| Pointer to datma provider service. More...
Services | m_cnvServices
| List of convermsion workers. More...
SmartIF< IConversionSvc > | m_cnvDefault
| Default output service. More...
Gaudi::Property< std::vector< std::string > > | m_svcNames
bool | m_enable = true
| Flag to indicate that the service is enabled. More...
SmartIF< IAddressCreator > | m_addrCreator
| Pointer to the IAddressCreator interface of this, for addressCreator(). More...
Protected Attributes inherited from Service
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::Property< int > | m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
Gaudi::Property< bool > | m_auditInit {this, "AuditServices", false, "[[deprecated]] unused"}
Gaudi::Property< bool > | m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
Gaudi::Property< bool > | m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
Gaudi::Property< bool > | m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
Gaudi::Property< bool > | m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
Gaudi::Property< bool > | m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
Gaudi::Property< bool > | m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
SmartIF< IAuditorSvc > | m_pAuditorSvc
| Auditor Service. More...

## Additional Inherited Members
Protected Types inherited from PersistencySvc
typedef std::map< long, ServiceEntry > | Services
Protected Member Functions inherited from PersistencySvc
void | svcNamesHandler (Gaudi::Details::PropertyBase &theProp)
| Handlers for Service Names Property. More...
SmartIF< IConversionSvc > & | service (const std::string &nam)
| Retrieve conversion service by name. More...
SmartIF< IConversionSvc > & | service (long service_type)
| Retrieve conversion service from list. More...
SmartIF< IAddressCreator > & | addressCreator (long service_type)
| Retrieve address creator from list. More...
void | encodeAddrHdr (long service_type, const CLID &clid, std::string &address) const
| Retrieve string from storage type and clid. More...
void | decodeAddrHdr (const std::string &address, long &service_type, CLID &clid, std::string &address_trailer) const
| Retrieve storage type and clid from address header of string. More...
StatusCode | makeCall (int typ, IOpaqueAddress *&pAddress, DataObject *&pObject)
| Implementation helper. More...
bool | enable (bool value)
| Set enabled flag. More...
Protected Member Functions inherited from Service
| ~Service () override
| Standard Destructor. More...
int | outputLevel () const
| get the `Service's` output level More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level | setUpMessaging ()
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Detailed Description

HistogramPersistencySvc class implementation definition.

System: The LHCb Offline System

Package: HistogramPersistencySvc

Dependencies:

- PersistencySvc definition: "Kernel/Interfaces/PersistencySvc.h"

History:

    +---------+----------------------------------------------+---------+
    |    Date |                 Comment                      | Who     |
    +---------+----------------------------------------------+---------+
    | 3/11/98 | Initial version                              | M.Frank |
    +---------+----------------------------------------------+---------+

Author
  Markus Frank

Version
  1.0

Definition at line 47 of file HistogramPersistencySvc.h.

## Member Typedef Documentation

typedef std::set<std::string> HistogramPersistencySvc::Set

for report: unconverted histograms

Definition at line 73 of file HistogramPersistencySvc.h.

## Constructor & Destructor Documentation

HistogramPersistencySvc::HistogramPersistencySvc | ( | const std::string & | name,
|  | ISvcLocator * | svc
| ) |  |

Standard Constructor.

Definition at line 228 of file HistogramPersistencySvc.cpp.

229 : PersistencySvc( name, svc )
230 {
231 // bypass update handler
232 m_svcNames.value() = std::vector<std::string>{{"RootHistSvc"}};
233 }
PersistencySvc::m_svcNames
Gaudi::Property< std::vector< std::string > > m_svcNames
Definition: PersistencySvc.h:248
PersistencySvc::PersistencySvc
PersistencySvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Definition: PersistencySvc.cpp:556
std::vector< std::string >

HistogramPersistencySvc::~HistogramPersistencySvc | ( |  | ) |
| override default

Standard Destructor.

## Member Function Documentation

StatusCode HistogramPersistencySvc::createRep | ( | DataObject * | pObject,
|  | IOpaqueAddress *& | refpAddress
| ) |  |
| override

Implementation of IConverter: Convert the transient object to the requested representation.

Definition at line 195 of file HistogramPersistencySvc.cpp.

196 {
197 // enable the conversion
198 enable( true );
199 // conversion is possible ?
200 if ( "NONE" == m_histPersName ) {
201 enable( false );
202 return PersistencySvc::createRep( pObj, refpAddr ); // RETURN
203 }
204 // histogram ?
205 if ( dynamic_cast<AIDA::IBaseHistogram*>( pObj ) ) {
206
207 auto match_pObj = [&]( const std::string& s ) { return match( pObj, s ); };
208 // Empty ConvertHistos property means convert all
209 bool select = ( m_convert.empty() || std::any_of( m_convert.begin(), m_convert.end(), match_pObj ) ) &&
210 std::none_of( m_exclude.begin(), m_exclude.end(), match_pObj );
211 //
212 enable( select );
213 //
214 const auto& path = oname( pObj );
215 //
216 if ( !select ) {
217 m_excluded.insert( path );
218 } else {
219 m_converted.insert( path );
220 }
221 }
222 //
223 return PersistencySvc::createRep( pObj, refpAddr ); // RETURN
224 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
HistogramPersistencySvc::m_convert
Gaudi::Property< std::vector< std::string > > m_convert
Definition: HistogramPersistencySvc.h:78
HistogramPersistencySvc::m_excluded
Set m_excluded
for the final report: the list of excluded histograms
Definition: HistogramPersistencySvc.h:87
HistogramPersistencySvc::m_histPersName
Gaudi::Property< std::string > m_histPersName
Definition: HistogramPersistencySvc.h:76
HistogramPersistencySvc::m_converted
Set m_converted
for the final report: the list of converted histograms
Definition: HistogramPersistencySvc.h:85
std::string
STL class.
HistogramPersistencySvc::m_exclude
Gaudi::Property< std::vector< std::string > > m_exclude
Definition: HistogramPersistencySvc.h:80
PersistencySvc::enable
bool enable(bool value)
Set enabled flag.
Definition: PersistencySvc.cpp:549
PersistencySvc::createRep
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
Definition: PersistencySvc.cpp:136
std::set::insert
T insert(T...args)
std::any_of
T any_of(T...args)
gaudirun.s
string s
Definition: gaudirun.py:253

StatusCode HistogramPersistencySvc::finalize | ( |  | ) |
| override

Finalize the service.

Definition at line 58 of file HistogramPersistencySvc.cpp.

59 {
60 //
61 if ( !( m_convert.empty() && m_exclude.empty() ) ) { // print message if any of the two properties is used
62 info() << "Histograms Converted/Excluded: " << m_converted.size() << "/" << m_excluded.size() << endmsg;
63 }
64 if ( msgLevel( MSG::DEBUG ) ) {
65 if ( !m_excluded.empty() ) {
66 auto& log = debug();
67 log << "Excluded Histos : #" << m_excluded.size();
68 for ( const auto& item : m_excluded ) {
69 log << std::endl << " '" << item << "'";
70 }
71 log << endmsg;
72 }
73 //
74 if ( !m_converted.empty() ) {
75 auto& log = debug();
76 log << "Converted Histos : #" << m_converted.size();
77 for ( const auto& item : m_converted ) {
78 log << std::endl << " '" << item << "'";
79 }
80 log << endmsg;
81 }
82 }
83 return PersistencySvc::finalize();
84 }
std::set::empty
T empty(T...args)
HistogramPersistencySvc::m_convert
Gaudi::Property< std::vector< std::string > > m_convert
Definition: HistogramPersistencySvc.h:78
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:112
HistogramPersistencySvc::m_excluded
Set m_excluded
for the final report: the list of excluded histograms
Definition: HistogramPersistencySvc.h:87
MSG::DEBUG
Definition: IMessageSvc.h:16
std::endl
T endl(T...args)
HistogramPersistencySvc::m_converted
Set m_converted
for the final report: the list of converted histograms
Definition: HistogramPersistencySvc.h:85
HistogramPersistencySvc::m_exclude
Gaudi::Property< std::vector< std::string > > m_exclude
Definition: HistogramPersistencySvc.h:80
PersistencySvc::finalize
StatusCode finalize() override
stop the service.
Definition: PersistencySvc.cpp:537
std::set::size
T size(T...args)
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:115
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition: CommonMessaging.h:124
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode HistogramPersistencySvc::initialize | ( |  | ) |
| override

Initialize the service.

Definition at line 88 of file HistogramPersistencySvc.cpp.

89 {
90 StatusCode status = PersistencySvc::initialize();
91 return status.isSuccess() ? reinitialize() : status;
92 }
PersistencySvc::initialize
StatusCode initialize() override
Initialize the service.
Definition: PersistencySvc.cpp:525
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
HistogramPersistencySvc::reinitialize
StatusCode reinitialize() override
Reinitialize the service.
Definition: HistogramPersistencySvc.cpp:96
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26

StatusCode HistogramPersistencySvc::reinitialize | ( |  | ) |
| override

Reinitialize the service.

Definition at line 96 of file HistogramPersistencySvc.cpp.

97 {
98 // Obtain the IProperty of the ApplicationMgr
99 auto prpMgr = serviceLocator()->as<IProperty>();
100 if ( !prpMgr ) {
101 fatal() << "IProperty interface not found in ApplicationMgr." << endmsg;
102 return StatusCode::FAILURE;
103 } else {
104 setProperty( prpMgr->getProperty( "HistogramPersistency" ) ).ignore();
105 }
106
107 // To keep backward compatibility, we set the property of conversion service
108 // into JobOptions catalogue
109 if ( !m_outputFile.empty() ) {
110 auto joptsvc = serviceLocator()->service<IJobOptionsSvc>( "JobOptionsSvc" );
111 if ( joptsvc ) {
112 Gaudi::Property<std::string> p( "OutputFile", m_outputFile );
113 if ( m_histPersName == "ROOT" ) {
114 joptsvc->addPropertyToCatalogue( "RootHistSvc", p ).ignore();
115 } else if ( m_histPersName == "HBOOK" ) {
116 joptsvc->addPropertyToCatalogue( "HbookHistSvc", p ).ignore();
117 }
118 }
119 }
120
121 // Load the Histogram persistency service that's required as default
122 setConversionSvc( nullptr ).ignore();
123 if ( m_histPersName == "ROOT" ) {
124 setConversionSvc( service( "RootHistSvc" ) ).ignore();
125 if ( !conversionSvc() ) {
126 return StatusCode::FAILURE;
127 }
128 enable( true );
129 } else if ( m_histPersName == "HBOOK" ) {
130 setConversionSvc( service( "HbookHistSvc" ) ).ignore();
131 if ( !conversionSvc() ) {
132 return StatusCode::FAILURE;
133 }
134 enable( true );
135 } else if ( m_histPersName == "NONE" ) {
136 enable( false );
137 if ( m_warnings ) {
138 warning() << "Histograms saving not required." << endmsg;
139 }
140 } else {
141 setConversionSvc( service( m_histPersName ) ).ignore();
142 if ( !conversionSvc() ) {
143 return StatusCode::FAILURE;
144 }
145 enable( true );
146 if ( m_warnings ) {
147 warning() << "Unknown Histogram Persistency Mechanism " << m_histPersName << endmsg;
148 }
149 }
150 return StatusCode::SUCCESS;
151 }
PersistencySvc::service
SmartIF< IConversionSvc > & service(const std::string &nam)
Retrieve conversion service by name.
Definition: PersistencySvc.cpp:226
StatusCode::SUCCESS
Definition: StatusCode.h:29
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyHolder.h:208
HistogramPersistencySvc::m_histPersName
Gaudi::Property< std::string > m_histPersName
Definition: HistogramPersistencySvc.h:76
PersistencySvc::setConversionSvc
StatusCode setConversionSvc(IConversionSvc *svc) override
Set conversion service the converter is connected to.
Definition: PersistencySvc.cpp:190
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:109
HistogramPersistencySvc::m_outputFile
Gaudi::Property< std::string > m_outputFile
Definition: HistogramPersistencySvc.h:77
PersistencySvc::enable
bool enable(bool value)
Set enabled flag.
Definition: PersistencySvc.cpp:549
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:79
IJobOptionsSvc
Main interface for the JobOptions service.
Definition: IJobOptionsSvc.h:20
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:109
HistogramPersistencySvc::m_warnings
Gaudi::Property< bool > m_warnings
Definition: HistogramPersistencySvc.h:82
PersistencySvc::conversionSvc
SmartIF< IConversionSvc > & conversionSvc() const override
Get conversion service the converter is connected to.
Definition: PersistencySvc.cpp:197
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:100
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

## Member Data Documentation

Gaudi::Property<std::vector<std::string> > HistogramPersistencySvc::m_convert
| protected

Initial value:
{
this, "ConvertHistos", {}, "The list of patterns to be accepted for conversion"}

Definition at line 78 of file HistogramPersistencySvc.h.

Set HistogramPersistencySvc::m_converted
| protected

for the final report: the list of converted histograms

Definition at line 85 of file HistogramPersistencySvc.h.

Gaudi::Property<std::vector<std::string> > HistogramPersistencySvc::m_exclude
| protected

Initial value:
{
this, "ExcludeHistos", {}, "The list of patterns to be excluded from conversion"}

Definition at line 80 of file HistogramPersistencySvc.h.

Set HistogramPersistencySvc::m_excluded
| protected

for the final report: the list of excluded histograms

Definition at line 87 of file HistogramPersistencySvc.h.

Gaudi::Property<std::string> HistogramPersistencySvc::m_histPersName {this, "HistogramPersistency", "", "name of the Hist Pers type"}
| protected

Definition at line 76 of file HistogramPersistencySvc.h.

Gaudi::Property<std::string> HistogramPersistencySvc::m_outputFile {this, "OutputFile", "", "name of the output file"}
| protected

Definition at line 77 of file HistogramPersistencySvc.h.

Gaudi::Property<bool> HistogramPersistencySvc::m_warnings {this, "Warnings", true, "Set this property to false to suppress warning messages"}
| protected

Definition at line 82 of file HistogramPersistencySvc.h.

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

- GaudiCommonSvc/src/HistogramPersistencySvc/HistogramPersistencySvc.h
- GaudiCommonSvc/src/HistogramPersistencySvc/HistogramPersistencySvc.cpp