43 if ( optsSvc.has(
"RFileCnv.GlobalCompression" ) ) {
64 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
65 char mode[2] = { char( ipar[1] ), 0 };
67 std::string fname = pAddress->
par()[0];
68 std::string ooname = pAddress->
par()[1];
70 const std::string* spar = pAddress->
par();
72 std::string oname = spar[1].substr( spar[1].find(
"/", 1 ) + 1 );
76 static TROOT root(
"root",
"ROOT I/O" );
84 if ( mode[0] ==
'O' ) {
88 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for reading" <<
endmsg;
90 rfile = TFile::Open( fname.c_str(),
"READ" );
94 ipar[0] = (
unsigned long)
rfile;
102 log <<
MSG::ERROR <<
"Couldn't open \"" << fname <<
"\" for reading" <<
endmsg;
107 log <<
MSG::DEBUG <<
"Root file \"" << fname <<
"\" already opened" <<
endmsg;
111 }
else if ( mode[0] ==
'U' ) {
113 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for updating" <<
endmsg;
118 }
else if ( mode[0] ==
'N' ) {
120 log <<
MSG::INFO <<
"opening Root file \"" << fname <<
"\" for writing";
124 rfile = TFile::Open( fname.c_str(),
"RECREATE",
"Gaudi Trees" );
126 log <<
MSG::ERROR <<
"Could not open file " << fname <<
" for writing" <<
endmsg;
131 rfile->SetCompressionSettings( settings.
level() );
139 ipar[0] = (
unsigned long)
rfile;
167 std::string ooname = pAddress->
par()[1];
170 if ( pFile && pFile->
isOpen() ) {
172 unsigned long* ipar = (
unsigned long*)pAddress->
ipar();
178 rfile->Write(
nullptr, TObject::kOverwrite );
193 std::map<std::string, std::string> m_metadata = mds->getMetaDataMap();
#define DECLARE_CONVERTER(x)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode initialize() override
Initialize the converter.
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
const CLID & objType() const override
Retrieve the class type of objects the converter produces.
SmartIF< IService > service(const std::string &name, const bool createIf=true) const
Return a pointer to the service identified by name (or "type/name")
A DataObject is the base class of any identifiable object on any data store.
IRegistry * registry() const
Get pointer to Registry.
Opaque address interface definition.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
virtual const std::string * par() const =0
Retrieve String parameters.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Gaudi::Interfaces::IOptionsSvc & getOptsSvc()
Direct access to Gaudi::Interfaces::IOptionsSvc implementation.
Definition of the MsgStream class used to transmit messages.
Small class representing an N tuple file in the transient store.
void setOpen(bool flag)
Set "open" flag.
bool isOpen() const
Access "open" flag.
StatusCode findTFile(const std::string &, TFile *&)
StatusCode regTFile(const std::string &, const TFile *)
RDirectoryCnv(ISvcLocator *svc)
Standard constructor.
NTuple converter class definition.
StatusCode initialize() override
Initialise.
std::string m_compLevel
Compression setting, property RFileCnv.GlobalCompression.
TFile * rfile
Pointer to ROOT file.
SmartIF< IIncidentSvc > m_incSvc
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Convert the transient object to the requested representation.
static const CLID & classID()
Inquire class type.
StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Create the transient representation of an object.
RFileCnv(ISvcLocator *svc)
Standard constructor.
StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject) override
Convert the transient object to the requested representation.
Simple class to decode a ROOT compression settings string, of the form '<Alg>:<level>' into the integ...
int level() const
Get the level.
Small smart pointer class with automatic reference counting for IInterface.
This class is used for returning status codes from appropriate routines.
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
StatusCode parse(GaudiUtils::HashMap< K, V > &result, std::string_view input)
Basic parser for the types of HashMap used in DODBasicMapper.