39 jobSvc->setMyProperties(
"RFileCnv",pmgr.
get()) );
52 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
53 char mode[2] = { char(ipar[1]), 0 };
64 static TROOT
root(
"root",
"ROOT I/O");
67 log <<
MSG::VERBOSE <<
"ROOT already initialized, debug = "
73 if ( mode[0] ==
'O' ) {
75 if (findTFile(ooname,rfile).isFailure()) {
77 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for reading"
80 rfile = TFile::Open(fname.
c_str(),
"READ");
81 if ( rfile && rfile->IsOpen() ) {
82 regTFile(ooname,rfile).ignore();
84 ipar[0] = (
unsigned long)rfile;
92 log <<
MSG::ERROR <<
"Couldn't open \"" << fname <<
"\" for reading"
98 log <<
MSG::DEBUG <<
"Root file \"" << fname <<
"\" already opened"
104 }
else if ( mode[0] ==
'U' ) {
106 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for updating"
112 }
else if ( mode[0] ==
'N' ) {
114 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for writing";
115 if ( !m_compLevel.empty() )
116 { log <<
", CompressionLevel='" << m_compLevel <<
"'"; }
119 rfile = TFile::Open( fname.c_str(),
"RECREATE",
"Gaudi Trees" );
120 if ( ! ( rfile && rfile->IsOpen() ) ) {
121 log <<
MSG::ERROR <<
"Could not open file " << fname <<
" for writing"
125 if ( !m_compLevel.empty() )
128 rfile->SetCompressionSettings(settings.
level());
131 regTFile(ooname,rfile).ignore();
135 ipar[0] = (
unsigned long)rfile;
169 if ( pFile && pFile->
isOpen() ) {
171 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
172 if (findTFile(ooname,rfile).isFailure()) {
177 rfile->Write(
nullptr,TObject::kOverwrite);
189 mds = serviceLocator()->service(
"Gaudi::MetaDataSvc",
false);
193 if(!rfile->WriteObject(&m_metadata,
"info")){
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...
StatusCode initialize() override
Initialise.
MSG::Level level()
Retrieve output level.
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.
Property manager helper class.
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()
Property * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none")
Declare a property (templated)
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 '
:' into the integ...
bool isOpen() const
Access "open" flag.
std::string m_compLevel
Compression setting.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
#define DECLARE_NAMESPACE_CONVERTER_FACTORY(n, x)
int level() const
Get the level.
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.