2 #include "GaudiKernel/DataObject.h"
3 #include "GaudiKernel/MsgStream.h"
4 #include "GaudiKernel/ISvcLocator.h"
5 #include "GaudiKernel/IRegistry.h"
6 #include "GaudiKernel/SmartDataPtr.h"
26 static std::string stat_dir =
"/stat";
27 static std::string undefFileName =
"UndefinedROOTOutputFileName";
40 if (setProperties().isFailure()) {
68 if( undefFileName != m_defFileName ) {
69 m_hfile->Write(
"",TObject::kOverwrite);
81 if( m_outputEnabled && undefFileName != m_defFileName ) {
86 if ( top.
ptr() == pObject ) {
87 TDirectory* pDir = m_hfile.get();
101 <<
"Error while creating persistent Histogram:"
111 <<
"Internal error while creating Histogram persistent representations"
115 if (m_outputEnabled && !m_prtWar) {
119 <<
"no ROOT output file name, "
120 <<
"Histograms cannot be persistified" <<
endmsg;
130 declareProperty(
"OutputFile",
m_defFileName = undefFileName);
131 declareProperty(
"ForceAlphaIds",
m_alphaIds =
false);
133 "Flag to enable/disable the output to file.");
bool m_outputEnabled
Flag to enable/disable the output to file.
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Implementation of IConverter: Convert the transient object to the requested representation.
Definition of the MsgStream class used to transmit messages.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode finalize() override
Finalise the service.
PersSvc(const std::string &name, ISvcLocator *svc)
Standard constructor.
bool isFailure() const
Test for a status code of FAILURE.
IRegistry * registry() const
Get pointer to Registry.
std::string m_defFileName
Default file name.
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Convert a collection of transient data objects into another representation.
TYPE * ptr()
Automatic conversion to data type.
virtual StatusCode finalize()
stop the service.
This class is used for returning status codes from appropriate routines.
#define DECLARE_COMPONENT(type)
The IRegistry represents the entry door to the environment any data object residing in a transient da...
bool m_alphaIds
Force alphabetic histograms/ntuple IDs.
A small class used to access easily (and efficiently) data items residing in data stores...
Persistency service - to store histograms in ROOT format.
virtual StatusCode initialize()
Initialize the service.
virtual const id_type & identifier() const =0
Full identifier (or key)
Opaque address interface definition.
Base class for all conversion services.
std::unique_ptr< TFile > m_hfile
Pointer to the ROOT file.
A DataObject is the base class of any identifiable object on any data store.
StatusCode initialize() override
Initialise the service.
const long ROOT_StorageType