46 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
47 char mode[2] = {char( ipar[1] ), 0};
58 static TROOT
root(
"root",
"ROOT I/O" );
66 if ( mode[0] ==
'O' ) {
70 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for reading" <<
endmsg;
76 ipar[0] = (
unsigned long)
rfile;
84 log <<
MSG::ERROR <<
"Couldn't open \"" << fname <<
"\" for reading" <<
endmsg;
89 log <<
MSG::DEBUG <<
"Root file \"" << fname <<
"\" already opened" <<
endmsg;
93 }
else if ( mode[0] ==
'U' ) {
95 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for updating" <<
endmsg;
100 }
else if ( mode[0] ==
'N' ) {
102 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for writing";
104 log <<
", CompressionLevel='" <<
m_compLevel <<
"'";
108 rfile = TFile::Open( fname.c_str(),
"RECREATE",
"Gaudi Trees" );
110 log <<
MSG::ERROR <<
"Could not open file " << fname <<
" for writing" <<
endmsg;
115 rfile->SetCompressionSettings( settings.
level() );
122 ipar[0] = (
unsigned long)
rfile;
153 if ( pFile && pFile->
isOpen() ) {
155 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
161 rfile->Write(
nullptr, TObject::kOverwrite );
177 if ( !
rfile->WriteObject( &m_metadata,
"info" ) ) {
constexpr static const auto FAILURE
Definition of the MsgStream class used to transmit messages.
Small smart pointer class with automatic reference counting for IInterface.
void setOpen(bool flag)
Set "open" flag.
TFile * rfile
Pointer to ROOT file.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
StatusCode initialize() override
Initialise.
const CLID & objType() const override
Retrieve the class type of objects the converter produces.
StatusCode initialize() override
Initialize the converter.
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Convert the transient object to the requested representation.
StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject) override
Convert the transient object to the requested representation.
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
#define DECLARE_CONVERTER(x)
StatusCode regTFile(const std::string, const TFile *)
StatusCode findTFile(const std::string, TFile *&)
virtual const std::string * par() const =0
Retrieve String parameters.
IRegistry * registry() const
Get pointer to Registry.
NTuple converter class definition.
StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Create the transient representation of an object.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Main interface for the JobOptions service.
GAUDI_API ISvcLocator * svcLocator()
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
This class is used for returning status codes from appropriate routines.
Create persistent and transient representations of data store directories.
Simple class to decode a ROOT compression settings string, of the form '<Alg>:<level>' into the integ...
bool isOpen() const
Access "open" flag.
std::string m_compLevel
Compression setting, property RFileCnv.GlobalCompression.
constexpr static const auto SUCCESS
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
int level() const
Get the level.
const StatusCode & ignore() const
Ignore/check StatusCode.
MSG::Level level() const
Retrieve output level.
Opaque address interface definition.
virtual const Gaudi::Details::PropertyBase * getClientProperty(const std::string &client, const std::string &name) const =0
Get a property for a client.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
A DataObject is the base class of any identifiable object on any data store.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Small class representing an N tuple file in the transient store.