Go to the documentation of this file.
23 static std::string undefFileName =
"UndefinedROOTOutputFileName";
49 if ( m_outputEnabled ) {
51 if ( undefFileName != m_defFileName ) {
52 m_hfile.reset( TFile::Open( m_defFileName.value().c_str(),
"RECREATE",
"GAUDI Histograms" ) );
53 info() <<
"Writing ROOT histograms to: " << m_defFileName.value() <<
endmsg;
60 info() <<
"Writing ROOT histograms disabled." <<
endmsg;
70 debug() <<
"RootHistCnv::PersSvc::finalize()" <<
endmsg;
73 m_hfile->Write(
"", TObject::kOverwrite );
85 if ( m_outputEnabled && undefFileName != m_defFileName ) {
90 if (
top.ptr() == pObject ) {
91 TDirectory* pDir = m_hfile.get();
92 refpAddress =
new RootObjAddress( repSvcType(), CLID_DataObject, stat_dir, m_defFileName.value(),
93 long( pDir ),
long( 0 ) );
98 error() <<
"Error while creating persistent Histogram:" << pReg->
identifier() <<
endmsg;
104 error() <<
"Internal error while creating Histogram persistent representations" <<
endmsg;
107 if ( m_outputEnabled && !m_prtWar ) {
110 if ( undefFileName != m_defFileName ) {
111 warning() <<
"no ROOT output file name, "
112 <<
"Histograms cannot be persistified" <<
endmsg;
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Convert a collection of transient data objects into another representation.
std::unique_ptr< TFile > m_hfile
Pointer to the ROOT file.
Gaudi::Property< bool > m_outputEnabled
StatusCode finalize() override
Finalise the service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
constexpr static const auto SUCCESS
StatusCode initialize() override
Initialize the service.
A small class used to access easily (and efficiently) data items residing in data stores.
StatusCode finalize() override
stop the service.
#define DECLARE_COMPONENT(type)
virtual const id_type & identifier() const =0
Full identifier (or key)
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
constexpr static const auto FAILURE
Gaudi::Property< std::string > m_defFileName