45 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
46 char mode[2] = {char( ipar[1] ), 0};
57 static TROOT
root(
"root",
"ROOT I/O" );
65 if ( mode[0] ==
'O' ) {
69 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for reading" <<
endmsg;
75 ipar[0] = (
unsigned long)
rfile;
83 log <<
MSG::ERROR <<
"Couldn't open \"" << fname <<
"\" for reading" <<
endmsg;
88 log <<
MSG::DEBUG <<
"Root file \"" << fname <<
"\" already opened" <<
endmsg;
92 }
else if ( mode[0] ==
'U' ) {
94 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for updating" <<
endmsg;
99 }
else if ( mode[0] ==
'N' ) {
101 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for writing";
105 rfile = TFile::Open( fname.c_str(),
"RECREATE",
"Gaudi Trees" );
107 log <<
MSG::ERROR <<
"Could not open file " << fname <<
" for writing" <<
endmsg;
112 rfile->SetCompressionSettings( settings.
level() );
119 ipar[0] = (
unsigned long)
rfile;
150 if ( pFile && pFile->
isOpen() ) {
152 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
158 rfile->Write(
nullptr, TObject::kOverwrite );
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.
constexpr static const auto SUCCESS
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.
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
int level() const
Get the level.
const StatusCode & ignore() const
Ignore/check StatusCode.
constexpr static const auto FAILURE
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.