49 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
50 char mode[2] = { char(ipar[1]), 0 };
61 static TROOT
root(
"root",
"ROOT I/O");
64 log <<
MSG::VERBOSE <<
"ROOT already initialized, debug = " 70 if ( mode[0] ==
'O' ) {
74 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for reading" 81 ipar[0] = (
unsigned long)
rfile;
89 log <<
MSG::ERROR <<
"Couldn't open \"" << fname <<
"\" for reading" 95 log <<
MSG::DEBUG <<
"Root file \"" << fname <<
"\" already opened" 101 }
else if ( mode[0] ==
'U' ) {
103 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for updating" 109 }
else if ( mode[0] ==
'N' ) {
111 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for writing";
113 { log <<
", CompressionLevel='" <<
m_compLevel <<
"'"; }
116 rfile = TFile::Open( fname.c_str(),
"RECREATE",
"Gaudi Trees" );
118 log <<
MSG::ERROR <<
"Could not open file " << fname <<
" for writing" 125 rfile->SetCompressionSettings(settings.
level());
132 ipar[0] = (
unsigned long)
rfile;
166 if ( pFile && pFile->
isOpen() ) {
168 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
174 rfile->Write(
nullptr,TObject::kOverwrite);
190 if(!
rfile->WriteObject(&m_metadata,
"info")){
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.
MSG::Level level()
Retrieve output level.
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.
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.
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
#define DECLARE_NAMESPACE_CONVERTER_FACTORY(n, x)
int level() const
Get the 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.