14 static std::string undefFileName =
"UndefinedROOTOutputFileName";
41 if ( setProperties().isFailure() ) {
42 error() <<
"Could not set my properties" <<
endmsg;
45 if ( m_outputEnabled ) {
47 if ( undefFileName != m_defFileName ) {
48 m_hfile.reset( TFile::Open( m_defFileName.value().c_str(),
"RECREATE",
"GAUDI Histograms" ) );
52 info() <<
"Writing ROOT histograms to: " << m_defFileName.value() <<
endmsg;
54 info() <<
"Writing ROOT histograms disabled." <<
endmsg;
64 debug() <<
"RootHistCnv::PersSvc::finalize()" <<
endmsg;
65 if ( m_outputEnabled ) {
66 if ( undefFileName != m_defFileName ) {
67 m_hfile->Write(
"", TObject::kOverwrite );
79 if ( m_outputEnabled && undefFileName != m_defFileName ) {
84 if ( top.
ptr() == pObject ) {
85 TDirectory* pDir = m_hfile.get();
86 refpAddress =
new RootObjAddress( repSvcType(), CLID_DataObject, stat_dir, m_defFileName.value(),
87 long( pDir ), long( 0 ) );
92 error() <<
"Error while creating persistent Histogram:" << pReg->
identifier() <<
endmsg;
98 error() <<
"Internal error while creating Histogram persistent representations" <<
endmsg;
101 if ( m_outputEnabled && !m_prtWar ) {
103 warning() <<
"no ROOT output file name, " 104 <<
"Histograms cannot be persistified" <<
endmsg;
constexpr static const auto FAILURE
StatusCode finalize() override
Finalise the service.
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
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...
constexpr static const auto SUCCESS
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.