| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
RootHistCnv::RConverter Class Reference

Root Converter. More...

`#include <src/RConverter.h>`

Inheritance diagram for RootHistCnv::RConverter:
[legend]
Collaboration diagram for RootHistCnv::RConverter:
[legend]

## Public Member Functions
StatusCode | createRep (DataObject *pObj, IOpaqueAddress *&refpAddr) override
| Convert the transient object to the requested representation. More...
long | repSvcType () const override
StatusCode | error (const std::string &msg)
StatusCode | regTFile (const std::string, const TFile *)
StatusCode | findTFile (const std::string, TFile *&)
std::string | diskDirectory (const std::string &loc)
std::string | directory (const std::string &loc)
void | setDirectory (const std::string &loc)
void | setDiskDirectory (const std::string &loc)
StatusCode | createDirectory (const std::string &loc)
StatusCode | createDiskDirectory (const std::string &loc)
std::string | getDirectory ()
std::string | convertId (const std::string &) const
Public Member Functions inherited from Converter
StatusCode | initialize () override
| Initialize the converter. More...
StatusCode | finalize () override
| Initialize the converter. More...
StatusCode | setDataProvider (IDataProviderSvc *svc) override
| Set Data provider service. More...
SmartIF< IDataProviderSvc > & | dataProvider () const override
| Get Data provider service. More...
StatusCode | setConversionSvc (IConversionSvc *svc) override
| Set conversion service the converter is connected to. More...
SmartIF< IConversionSvc > & | conversionSvc () const override
| Get conversion service the converter is connected to. More...
StatusCode | setAddressCreator (IAddressCreator *creator) override
| Set address creator facility. More...
SmartIF< IAddressCreator > & | addressCreator () const override
| Retrieve address creator facility. More...
const CLID & | objType () const override
| Retrieve the class type of objects the converter produces. More...
virtual long | i_repSvcType () const
| Retrieve the class type of the data store the converter uses. More...
StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override
| Create the transient representation of an object. More...
StatusCode | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Resolve the references of the created transient object. More...
StatusCode | updateObj (IOpaqueAddress *pAddress, DataObject *refpObject) override
| Update the transient object from the other representation. More...
StatusCode | updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Update the references of an updated transient object. More...
StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
| Convert the transient object to the requested representation. More...
StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Resolve the references of the converted object. More...
StatusCode | updateRep (IOpaqueAddress *pAddress, DataObject *pObject) override
| Update the converted representation of a transient object. More...
StatusCode | updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Update the references of an already converted object. More...
| Converter (long storage_type, const CLID &class_type, ISvcLocator *svc=0)
| Standard Constructor. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=false) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &type, const std::string &name, T *&psvc) const
| Access a service by name, type creating it if it doesn't already exist. More...
SmartIF< IService > | service (const std::string &name, const bool createIf=true) const
| Return a pointer to the service identified by name (or "type/name") More...
Public Member Functions inherited from implements< IConverter >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| implements ()=default
| Default constructor. More...
| implements (const implements &)
| Copy constructor (zero the reference count) More...
implements & | operator= (const implements &)
| Assignment operator (do not touch the reference count). More...
| ~implements () override=default
| Virtual destructor. More...
unsigned long | addRef () override
| Reference Interface instance. More...
unsigned long | release () override
| Release Interface instance. More...
unsigned long | refCount () const override
| Current reference count. More...
Public Member Functions inherited from extend_interfaces< Interfaces... >
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Static Public Member Functions
static long | storageType ()
| Inquire storage type. More...

## Protected Member Functions
| RConverter (const CLID &clid, ISvcLocator *svc)
| Standard constructor. More...
| ~RConverter () override=default
| Standard destructor. More...
virtual StatusCode | readObject (IOpaqueAddress *pAddr, DataObject *&refpObj)
| Create the transient representation of an object. More...
virtual TObject * | createPersistent (DataObject *pObj)
| Create the persistent representation of an object. More...
StatusCode | createAddress (DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
| Create address of the transient object according to the requested representation. More...
StatusCode | createAddress (const std::string &rzdir, const CLID &clid, long id, TObject *pTobj, IOpaqueAddress *&refpAddress)
StatusCode | createAddress (const std::string &rzdir, const CLID &clid, const std::string &title, TObject *pTobj, IOpaqueAddress *&refpAddress)
TDirectory * | changeDirectory (DataObject *pObject)
| Switch to object directory (=Parent directory) More...
Protected Member Functions inherited from Converter
| ~Converter () override=default
| Standard Destructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const
| Retrieve pointer to service locator. More...
SmartIF< IMessageSvc > & | msgSvc () const
| Retrieve pointer to message service. More...
SmartIF< IDataManagerSvc > & | dataManager () const
| Get Data Manager service. More...

## Additional Inherited Members
Public Types inherited from Converter
typedef Gaudi::PluginService::Factory< IConverter *, ISvcLocator * > | Factory
Public Types inherited from implements< IConverter >
using | base_class = implements< Interfaces... >
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
using | iids = typename extend_interfaces_base::ext_iids
Public Types inherited from extend_interfaces< Interfaces... >
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
| take union of the ext_iids of all Interfaces... More...
Protected Attributes inherited from implements< IConverter >
std::atomic_ulong | m_refCount
| Reference counter. More...

## Detailed Description

Root Converter.

Author
  Charles Leggett

Definition at line 33 of file RConverter.h.

## Constructor & Destructor Documentation

RootHistCnv::RConverter::RConverter | ( | const CLID & | clid,
|  | ISvcLocator * | svc
| ) |  |
| inline protected

Standard constructor.

Definition at line 58 of file RConverter.h.

58 : Converter( storageType(), clid, svc ) {}
Converter::Converter
Converter(long storage_type, const CLID &class_type, ISvcLocator *svc=0)
Standard Constructor.
Definition: Converter.cpp:115
RootHistCnv::RConverter::storageType
static long storageType()
Inquire storage type.
Definition: RConverter.h:39

RootHistCnv::RConverter::~RConverter | ( |  | ) |
| override protected default

Standard destructor.

## Member Function Documentation

TDirectory * RootHistCnv::RConverter::changeDirectory | ( | DataObject * | pObject | ) |
| protected

Switch to object directory (=Parent directory)

Definition at line 205 of file RConverter.cpp.

207 {
208 if ( pObject ) {
209 IRegistry* pReg = pObject->registry();
210 if ( pReg ) {
211 auto dataMgr = dataProvider().as<IDataManagerSvc>();
212 if ( dataMgr ) {
213 IRegistry* pParentReg = nullptr;
214 StatusCode status = dataMgr->objectParent( pReg, pParentReg );
215 if ( status.isSuccess() ) {
216 IOpaqueAddress* pParAddr = pParentReg->address();
217 if ( pParAddr ) {
218 TDirectory* pParentDir = (TDirectory*)pParAddr->ipar()[0];
219 if ( pParentDir ) {
220 gDirectory->cd( pParentDir->GetPath() );
221 return pParentDir;
222 }
223 }
224 }
225 }
226 }
227 }
228 return nullptr;
229 }
IDataManagerSvc
Definition: IDataManagerSvc.h:46
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:115
IOpaqueAddress::ipar
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
Converter::dataProvider
SmartIF< IDataProviderSvc > & dataProvider() const override
Get Data provider service.
Definition: Converter.cpp:74
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.

std::string RootHistCnv::RConverter::convertId | ( | const std::string & | id | ) | const

Definition at line 319 of file RConverter.cpp.

321 {
322 bool forced = false;
323 if ( id.size() > 0 && isdigit( id[0] ) ) {
324 try {
325 Gaudi::Property<bool> tmp;
326 tmp.assign( conversionSvc().as<IProperty>()->getProperty( "ForceAlphaIds" ) );
327 forced = tmp.value();
328 } catch ( ... ) {
329 }
330 }
331 if ( forced )
332 return "h" + id;
333 else
334 return id;
335 }
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
Converter::conversionSvc
SmartIF< IConversionSvc > & conversionSvc() const override
Get conversion service the converter is connected to.
Definition: Converter.cpp:87
std::isdigit
T isdigit(T...args)
Gaudi::Property::assign
bool assign(const Details::PropertyBase &source) override
get the value from another property
Definition: Property.h:630
Gaudi::Property::value
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:478
Gaudi::Utils::getProperty
GAUDI_API Gaudi::Details::PropertyBase * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:223

StatusCode RootHistCnv::RConverter::createAddress | ( | DataObject * | pObject,
|  | TDirectory * | pDir,
|  | TObject * | pTObject,
|  | IOpaqueAddress *& | refpAddr
| ) |  |
| protected

Create address of the transient object according to the requested representation.

Definition at line 160 of file RConverter.cpp.

163 {
164 // Get address again....it does not change
165 IRegistry* pReg = pObj->registry();
166 if ( pReg ) {
167 refpAddr = pReg->address();
168 if ( !refpAddr ) {
169 refpAddr = new RootObjAddress( repSvcType(), objType(), pReg->name(), "", (unsigned long)( pDir ),
170 (unsigned long)( pTObj ), pTObj );
171
172 return StatusCode::SUCCESS;
173 }
174 }
175 return StatusCode::FAILURE;
176 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
Converter::objType
const CLID & objType() const override
Retrieve the class type of objects the converter produces.
Definition: Converter.cpp:14
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
RootHistCnv::RConverter::repSvcType
long repSvcType() const override
Definition: RConverter.h:40
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
StatusCode::FAILURE
Definition: StatusCode.h:29
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.

StatusCode RootHistCnv::RConverter::createAddress | ( | const std::string & | rzdir,
|  | const CLID & | clid,
|  | long | id,
|  | TObject * | pTobj,
|  | IOpaqueAddress *& | refpAddress
| ) |  |
| protected

Definition at line 190 of file RConverter.cpp.

193 {
194 auto obj = std::to_string( id );
195 StatusCode status = createAddress( rzdir, clid, obj, pTobj, refpAddress );
196 if ( status.isSuccess() ) {
197 unsigned long* ipar = (unsigned long*)refpAddress->ipar();
198 ipar[0] = id;
199 }
200 return status;
201 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
std::to_string
T to_string(T...args)
IOpaqueAddress::ipar
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
RootHistCnv::RConverter::createAddress
StatusCode createAddress(DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
Create address of the transient object according to the requested representation. ...
Definition: RConverter.cpp:160

StatusCode RootHistCnv::RConverter::createAddress | ( | const std::string & | rzdir,
|  | const CLID & | clid,
|  | const std::string & | title,
|  | TObject * | pTobj,
|  | IOpaqueAddress *& | refpAddress
| ) |  |
| protected

Definition at line 179 of file RConverter.cpp.

182 {
183 auto pA = new RootObjAddress( repSvcType(), clid, rzdir, title, 0, 0, pTObj );
184
185 refpAddress = pA;
186 return StatusCode::SUCCESS;
187 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
RootHistCnv::RConverter::repSvcType
long repSvcType() const override
Definition: RConverter.h:40

StatusCode RootHistCnv::RConverter::createDirectory | ( | const std::string & | loc | ) |

Definition at line 25 of file RConverter.cpp.

27 {
28 MsgStream log( msgSvc(), "RConverter::createDir" );
29
30 // Get rid of leading /NTUPLES
31 std::string full = diskDirectory( loc );
32
33 std::string fil, cur, s;
34 TDirectory* gDir = gDirectory;
35
36 TFile* tf = nullptr;
37 if ( findTFile( loc, tf ).isSuccess() ) {
38 tf->cd();
39 }
40
41 std::vector<std::string> lpath;
42 int i = 1;
43
44 auto p = full.find( ":", 0 );
45 if ( p != std::string::npos ) {
46 fil = full.substr( 0, p );
47 i = p + 1;
48 fil += ":/";
49 gDirectory->cd( fil.c_str() );
50 }
51
52 while ( ( p = full.find( "/", i ) ) != std::string::npos ) {
53 s = full.substr( i, p - i );
54 lpath.push_back( s );
55 i = p + 1;
56 }
57 lpath.push_back( full.substr( i ) );
58
59 if ( full.compare( 0, 1, "/" ) == 0 ) gDirectory->cd( "/" );
60
61 for ( const auto& litr : lpath ) {
62 cur = litr;
63 if ( !gDirectory->GetKey( litr.c_str() ) ) {
64 gDirectory->mkdir( litr.c_str() );
65 }
66 gDirectory->cd( litr.c_str() );
67 }
68
69 gDirectory = gDir;
70
71 return StatusCode::SUCCESS;
72 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
RootHistCnv::RConverter::diskDirectory
std::string diskDirectory(const std::string &loc)
Definition: RConverter.cpp:74
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:103
RootHistCnv::RConverter::findTFile
StatusCode findTFile(const std::string, TFile *&)
Definition: RConverter.cpp:286
std::string
STL class.
std::vector::push_back
T push_back(T...args)
std::string::find
T find(T...args)
std::vector< std::string >
std::string::c_str
T c_str(T...args)
gaudirun.s
string s
Definition: gaudirun.py:253
std::string::substr
T substr(T...args)
std::string::compare
T compare(T...args)
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode RootHistCnv::RConverter::createDiskDirectory | ( | const std::string & | loc | ) |

TObject * RootHistCnv::RConverter::createPersistent | ( | DataObject * | pObj | ) |
| protected virtual

Create the persistent representation of an object.

Reimplemented in RootHistCnv::RHistogramCnv< T, S, Q >.

Definition at line 268 of file RConverter.cpp.

268 { return nullptr; }

StatusCode RootHistCnv::RConverter::createRep | ( | DataObject * | pObj,
|  | IOpaqueAddress *& | refpAddr
| ) |  |
| override

Convert the transient object to the requested representation.

Definition at line 233 of file RConverter.cpp.

235 {
236 GlobalDirectoryRestore restore;
237 pAddr = nullptr;
238 try {
239 TDirectory* pParentDir = changeDirectory( pObject );
240 if ( pParentDir ) {
241 TObject* pTObj = createPersistent( pObject );
242 if ( pTObj ) {
243 pTObj->Write();
244 delete pTObj;
245 return createAddress( pObject, pParentDir, nullptr, pAddr );
246 }
247 }
248 } catch ( ... ) {
249 }
250 MsgStream log( msgSvc(), "RConverter" );
251 log << MSG::ERROR << "Failed to create persistent Object!" << endmsg;
252 return StatusCode::FAILURE;
253 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:103
RootHistCnv::RConverter::changeDirectory
TDirectory * changeDirectory(DataObject *pObject)
Switch to object directory (=Parent directory)
Definition: RConverter.cpp:205
RootHistCnv::RConverter::createPersistent
virtual TObject * createPersistent(DataObject *pObj)
Create the persistent representation of an object.
Definition: RConverter.cpp:268
GlobalDirectoryRestore
Definition: RConverter.h:16
MSG::ERROR
Definition: IMessageSvc.h:16
StatusCode::FAILURE
Definition: StatusCode.h:29
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
RootHistCnv::RConverter::createAddress
StatusCode createAddress(DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
Create address of the transient object according to the requested representation. ...
Definition: RConverter.cpp:160
Gaudi.Configuration.log
log
Definition: Configuration.py:13

std::string RootHistCnv::RConverter::directory | ( | const std::string & | loc | ) |

Definition at line 106 of file RConverter.cpp.

108 {
109 return diskDirectory( loc );
110 }
RootHistCnv::RConverter::diskDirectory
std::string diskDirectory(const std::string &loc)
Definition: RConverter.cpp:74

std::string RootHistCnv::RConverter::diskDirectory | ( | const std::string & | loc | ) |

Definition at line 74 of file RConverter.cpp.

76 {
77 // Get rid of leading /NTUPLES/{INPUT_STREAM} or /stat/{INPUT_STREAM}
78 std::string dir;
79 long lf1 = loc.find( "/NTUPLES/" );
80 long lf2 = loc.find( "/stat/" );
81 long ll;
82 if ( lf1 != -1 ) {
83 ll = loc.find( "/", lf1 + 9 );
84
85 } else if ( lf2 != -1 ) {
86 ll = loc.find( "/", lf2 + 6 );
87
88 } else {
89 MsgStream log( msgSvc(), "RConverter" );
90 log << MSG::ERROR << "diskDirectory(" << loc << ")"
91 << " --> no leading /NTUPLES/ or /stat/" << endmsg;
92 return loc;
93 }
94 // dir = loc.substr(ll+8);
95
96 if ( ll == -1 ) {
97 dir = "/";
98 } else {
99 dir = loc.substr( ll );
100 }
101
102 return dir;
103 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:103
std::string
STL class.
std::string::find
T find(T...args)
MSG::ERROR
Definition: IMessageSvc.h:16
std::string::substr
T substr(T...args)
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode RootHistCnv::RConverter::error | ( | const std::string & | msg | ) |

Definition at line 337 of file RConverter.cpp.

339 {
340 MsgStream log( msgSvc(), "RootHistCnv" );
341 log << MSG::ERROR << msg << endmsg;
342 return StatusCode::FAILURE;
343 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:103
MSG::ERROR
Definition: IMessageSvc.h:16
StatusCode::FAILURE
Definition: StatusCode.h:29
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

StatusCode RootHistCnv::RConverter::findTFile | ( | const std::string | id,
|  | TFile *& | tfile
| ) |  |

Definition at line 286 of file RConverter.cpp.

288 {
289 MsgStream log( msgSvc(), "RConverter" );
290 tfile = nullptr;
291
292 std::string idm;
293
294 // make sure we only get first two parts of id
295 int i1, i2, i3;
296 i1 = id.find( "/", 0 );
297 if ( i1 != 0 ) {
298 log << MSG::ERROR << "Directory name does not start with \"/\": " << id << endmsg;
299 return StatusCode::FAILURE;
300 }
301 i2 = id.find( "/", i1 + 1 );
302 if ( i2 == -1 ) {
303 log << MSG::ERROR << "Directory name has only one part: " << id << endmsg;
304 return StatusCode::FAILURE;
305 }
306 i3 = id.find( "/", i2 + 1 );
307 if ( i3 == -1 ) {
308 idm = id;
309 } else {
310 idm = id.substr( 0, i3 );
311 }
312
313 auto imap = s_fileMap.find( idm );
314 if ( imap == s_fileMap.end() ) return StatusCode::FAILURE;
315 tfile = imap->second;
316 return StatusCode::SUCCESS;
317 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:103
std::string
STL class.
std::string::find
T find(T...args)
MSG::ERROR
Definition: IMessageSvc.h:16
std::string::substr
T substr(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:29
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

std::string RootHistCnv::RConverter::getDirectory | ( |  | ) |

Definition at line 153 of file RConverter.cpp.

155 {
156 return gDirectory->GetPath();
157 }

StatusCode RootHistCnv::RConverter::readObject | ( | IOpaqueAddress * | pAddr,
|  | DataObject *& | refpObj
| ) |  |
| protected virtual

Create the transient representation of an object.

Definition at line 256 of file RConverter.cpp.

257 {
258 // MsgStream log(msgSvc(), "RConverter::readObject");
259 // log << MSG::WARNING << pAddr->par()[0] << " <> " << pAddr->par()[1]
260 // << " <> "
261 // << pAddr->ipar()[0] << " <> " << pAddr->ipar()[1] << " <> "
262 // << pAddr->registry()->identifier() << endmsg;
263
264 return StatusCode::SUCCESS;
265 }
StatusCode::SUCCESS
Definition: StatusCode.h:29

StatusCode RootHistCnv::RConverter::regTFile | ( | const std::string | id,
|  | const TFile * | tfile
| ) |  |

Definition at line 271 of file RConverter.cpp.

273 {
274 auto imap = s_fileMap.find( id );
275 if ( imap != s_fileMap.end() ) {
276 MsgStream log( msgSvc(), "RConverter" );
277 log << MSG::ERROR << "cannot register TTree " << id << ": already exists" << endmsg;
278 return StatusCode::FAILURE;
279 }
280 s_fileMap[id] = const_cast<TFile*>( tfile );
281
282 return StatusCode::SUCCESS;
283 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:103
MSG::ERROR
Definition: IMessageSvc.h:16
StatusCode::FAILURE
Definition: StatusCode.h:29
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

long RootHistCnv::RConverter::repSvcType | ( |  | ) | const
| inline override

Definition at line 40 of file RConverter.h.

40 { return i_repSvcType(); }
Converter::i_repSvcType
virtual long i_repSvcType() const
Retrieve the class type of the data store the converter uses.
Definition: Converter.cpp:17

void RootHistCnv::RConverter::setDirectory | ( | const std::string & | loc | ) |

Definition at line 113 of file RConverter.cpp.

115 {
116 MsgStream log( msgSvc(), "RConverter" );
117 TFile* tf = nullptr;
118
119 std::string full = diskDirectory( loc );
120
121 // get associated TFile
122 if ( findTFile( loc, tf ).isSuccess() ) {
123 tf->cd();
124 } else {
125 log << MSG::ERROR << "error getting TFile name " << loc << endmsg;
126 }
127
128 int p, i = 1;
129 std::string cur, sdir;
130
131 gDirectory->cd( "/" );
132 while ( ( p = full.find( "/", i ) ) != -1 ) {
133 sdir = full.substr( i, p - i );
134 if ( !gDirectory->GetKey( sdir.c_str() ) ) {
135 log << MSG::ERROR << "cannot cd to " << full << " from " << gDirectory->GetPath() << endmsg;
136 return;
137 }
138 gDirectory->cd( sdir.c_str() );
139
140 i = p + 1;
141 }
142 gDirectory->cd( full.substr( i ).c_str() );
143 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
RootHistCnv::RConverter::diskDirectory
std::string diskDirectory(const std::string &loc)
Definition: RConverter.cpp:74
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:103
RootHistCnv::RConverter::findTFile
StatusCode findTFile(const std::string, TFile *&)
Definition: RConverter.cpp:286
std::string
STL class.
std::string::find
T find(T...args)
std::string::c_str
T c_str(T...args)
MSG::ERROR
Definition: IMessageSvc.h:16
std::string::substr
T substr(T...args)
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13

void RootHistCnv::RConverter::setDiskDirectory | ( | const std::string & | loc | ) |

Definition at line 146 of file RConverter.cpp.

148 {
149 setDirectory( loc );
150 }
RootHistCnv::RConverter::setDirectory
void setDirectory(const std::string &loc)
Definition: RConverter.cpp:113

static long RootHistCnv::RConverter::storageType | ( |  | ) |
| inline static

Inquire storage type.

Definition at line 39 of file RConverter.h.

39 { return ROOT_StorageType; }
ROOT_StorageType
const long ROOT_StorageType
Definition: ClassID.h:52

The documentation for this class was generated from the following files:

- RootHistCnv/src/RConverter.h
- RootHistCnv/src/RConverter.cpp