14 static std::string undefFileName =
"UndefinedROOTOutputFileName";
42 if ( setProperties().isFailure() ) {
46 if ( m_outputEnabled ) {
48 if ( undefFileName != m_defFileName ) {
49 m_hfile.reset( TFile::Open( m_defFileName.value().c_str(),
"RECREATE",
"GAUDI Histograms" ) );
53 log <<
MSG::INFO <<
"Writing ROOT histograms to: " << m_defFileName.value() <<
endmsg;
67 if ( undefFileName != m_defFileName ) {
68 m_hfile->Write(
"", TObject::kOverwrite );
79 if ( m_outputEnabled && undefFileName != m_defFileName ) {
84 if ( top.
ptr() == pObject ) {
85 TDirectory* pDir = m_hfile.get();
87 new RootObjAddress( repSvcType(), CLID_DataObject, stat_dir, m_defFileName,
long( pDir ),
long( 0 ) );
100 err <<
MSG::ERROR <<
"Internal error while creating Histogram persistent representations" <<
endmsg;
103 if ( m_outputEnabled && !m_prtWar ) {
107 <<
"Histograms cannot be persistified" <<
endmsg;
Definition of the MsgStream class used to transmit messages.
StatusCode finalize() override
Finalise the service.
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
bool isFailure() const
Test for a status code of FAILURE.
IRegistry * registry() const
Get pointer to Registry.
#define DECLARE_COMPONENT(type)
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 const id_type & identifier() const =0
Full identifier (or key)
This class is used for returning status codes from appropriate routines.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
A small class used to access easily (and efficiently) data items residing in data stores...
Persistency service - to store histograms in ROOT format.
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
StatusCode finalize() override
stop the service.
StatusCode initialize() override
Initialize the service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.