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' ) {
67 if ( findTFile( ooname, rfile ).isFailure() ) {
71 rfile = TFile::Open( fname.
c_str(),
"READ" );
72 if ( rfile && rfile->IsOpen() ) {
73 regTFile( ooname, rfile ).ignore();
75 ipar[0] = (
unsigned long)rfile;
92 }
else if ( mode[0] ==
'U' ) {
99 }
else if ( mode[0] ==
'N' ) {
101 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for writing";
102 if ( !m_compLevel.empty() ) {
log <<
", CompressionLevel='" << m_compLevel <<
"'"; }
105 rfile = TFile::Open( fname.c_str(),
"RECREATE",
"Gaudi Trees" );
106 if ( !( rfile && rfile->IsOpen() ) ) {
110 if ( !m_compLevel.empty() ) {
112 rfile->SetCompressionSettings( settings.
level() );
115 regTFile( ooname, rfile ).ignore();
119 ipar[0] = (
unsigned long)rfile;
149 NTuple::File* pFile = dynamic_cast<NTuple::File*>( pObject );
150 if ( pFile && pFile->
isOpen() ) {
152 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
153 if ( findTFile( ooname, rfile ).isFailure() ) {
158 rfile->Write(
nullptr, TObject::kOverwrite );
170 mds = serviceLocator()->service(
"Gaudi::MetaDataSvc",
false );
virtual const std::string * par() const =0
Retrieve String parameters.
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.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
IRegistry * registry() const
Get pointer to Registry.
int level() const
Get the level.
StatusCode initialize() override
Initialise.
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
#define DECLARE_CONVERTER(x)
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()
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...
std::string m_compLevel
Compression setting, property RFileCnv.GlobalCompression.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual const Gaudi::Details::PropertyBase * getClientProperty(const std::string &client, const std::string &name) const =0
Get a property for a client.
constexpr static const auto FAILURE
bool isOpen() const
Access "open" flag.
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
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.