13 static std::string undefFileName =
"UndefinedROOTOutputFileName";
40 if ( setProperties().isFailure() ) {
41 error() <<
"Could not set my properties" <<
endmsg;
44 if ( m_outputEnabled ) {
46 if ( undefFileName != m_defFileName ) {
47 m_hfile.reset( TFile::Open( m_defFileName.value().c_str(),
"RECREATE",
"GAUDI Histograms" ) );
51 info() <<
"Writing ROOT histograms to: " << m_defFileName.value() <<
endmsg;
53 info() <<
"Writing ROOT histograms disabled." <<
endmsg;
63 debug() <<
"RootHistCnv::PersSvc::finalize()" <<
endmsg;
64 if ( m_outputEnabled ) {
65 if ( undefFileName != m_defFileName ) {
66 m_hfile->Write(
"", TObject::kOverwrite );
78 if ( m_outputEnabled && undefFileName != m_defFileName ) {
83 if ( top.
ptr() == pObject ) {
84 TDirectory* pDir = m_hfile.get();
85 refpAddress =
new RootObjAddress( repSvcType(), CLID_DataObject, stat_dir, m_defFileName.value(),
86 long( pDir ), long( 0 ) );
91 error() <<
"Error while creating persistent Histogram:" << pReg->
identifier() <<
endmsg;
97 error() <<
"Internal error while creating Histogram persistent representations" <<
endmsg;
100 if ( m_outputEnabled && !m_prtWar ) {
102 warning() <<
"no ROOT output file name, " 103 <<
"Histograms cannot be persistified" <<
endmsg;
StatusCode finalize() override
Finalise the service.
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
constexpr static const auto SUCCESS
IRegistry * registry() const
Get pointer to Registry.
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Convert a collection of transient data objects into another representation.
TYPE * ptr()
Automatic conversion to data type.
#define DECLARE_COMPONENT(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...
constexpr static const auto FAILURE
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.