All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RootHistCnv::RConverter Class Reference

Root Converter. More...

#include <src/RConverter.h>

Inheritance diagram for RootHistCnv::RConverter:
Collaboration diagram for RootHistCnv::RConverter:

Public Member Functions

virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&refpAddr)
 Convert the transient object to the requested representation. More...
 
long repSvcType () const
 Retrieve the class type of the data store the converter uses. More...
 
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
virtual StatusCode initialize ()
 Initialize the converter. More...
 
virtual StatusCode finalize ()
 Initialize the converter. More...
 
virtual StatusCode setDataProvider (IDataProviderSvc *svc)
 Set Data provider service. More...
 
virtual SmartIF
< IDataProviderSvc > & 
dataProvider () const
 Get Data provider service. More...
 
virtual StatusCode setConversionSvc (IConversionSvc *svc)
 Set conversion service the converter is connected to. More...
 
virtual SmartIF< IConversionSvc > & conversionSvc () const
 Get conversion service the converter is connected to. More...
 
virtual StatusCode setAddressCreator (IAddressCreator *creator)
 Set address creator facility. More...
 
virtual SmartIF
< IAddressCreator > & 
addressCreator () const
 Retrieve address creator facility. More...
 
virtual const CLIDobjType () const
 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...
 
virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject)
 Create the transient representation of an object. More...
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the created transient object. More...
 
virtual StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject)
 Update the transient object from the other representation. More...
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Update the references of an updated transient object. More...
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object. More...
 
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
 Update the converted representation of a transient object. More...
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 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< IServiceservice (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 extend_interfaces1< IConverter >
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IConverter
 DeclareInterfaceID (IConverter, 3, 0)
 InterfaceID. More...
 
virtual ~IConverter ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IInterface
virtual void * i_cast (const InterfaceID &) const =0
 main cast function More...
 
virtual std::vector< std::string > getInterfaceNames () const =0
 Returns a vector of strings containing the names of all the implemented interfaces. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)=0
 Set the void** to the pointer to the requested interface of the instance. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 

Static Public Member Functions

static long storageType ()
 Inquire storage type. More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 

Protected Member Functions

 RConverter (const CLID &clid, ISvcLocator *svc)
 Standard constructor. More...
 
virtual ~RConverter ()
 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
virtual ~Converter ()
 Standard Destructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 Retrieve pointer to message service. More...
 
SmartIF< IMessageSvc > & messageService () const
 
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 implements1< IConverter >
typedef implements1 base_class
 Typedef to this class. More...
 
typedef extend_interfaces1
< IConverter
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces1< IConverter >
typedef IConverter::iid::iids::type ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IConverter
enum  Status {
  INVALID_ADDRESS = IInterface::LAST_ERROR+1, INVALID_OBJECT, NO_MEMORY, BAD_STORAGE_TYPE,
  NO_SOURCE_OBJECT, ICONVERSIONSVC_LAST_ERROR
}
 Status code. More...
 
- Public Types inherited from IInterface
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...
 
typedef Gaudi::InterfaceId
< IInterface, 0, 0 > 
iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 

Detailed Description

Root Converter.

Author
Charles Leggett

Definition at line 34 of file RConverter.h.

Constructor & Destructor Documentation

RootHistCnv::RConverter::RConverter ( const CLID clid,
ISvcLocator svc 
)
inlineprotected

Standard constructor.

Definition at line 59 of file RConverter.h.

60  : Converter(storageType(), clid, svc) { }
Converter(long storage_type, const CLID &class_type, ISvcLocator *svc=0)
Standard Constructor.
Definition: Converter.cpp:147
static long storageType()
Inquire storage type.
Definition: RConverter.h:40
virtual RootHistCnv::RConverter::~RConverter ( )
inlineprotectedvirtual

Standard destructor.

Definition at line 62 of file RConverter.h.

62 { }

Member Function Documentation

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

Switch to object directory (=Parent directory)

Definition at line 236 of file RConverter.cpp.

238 {
239  if ( pObject ) {
240  IRegistry* pReg = pObject->registry();
241  if ( pReg ) {
243  if ( dataMgr.isValid() ) {
244  IRegistry* pParentReg = 0;
245  StatusCode status = dataMgr->objectParent(pReg, pParentReg);
246  if ( status.isSuccess() ) {
247  IOpaqueAddress* pParAddr = pParentReg->address();
248  if ( pParAddr ) {
249  TDirectory* pParentDir = (TDirectory*)pParAddr->ipar()[0];
250  if ( pParentDir ) {
251  gDirectory->cd(pParentDir->GetPath());
252  return pParentDir;
253  }
254  }
255  }
256  }
257  }
258  }
259  return 0;
260 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual SmartIF< IDataProviderSvc > & dataProvider() const
Get Data provider service.
Definition: Converter.cpp:94
Opaque address interface definition.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
std::string RootHistCnv::RConverter::convertId ( const std::string &  id) const

Definition at line 370 of file RConverter.cpp.

372 {
373  bool forced = false;
374  if ( id.size() > 0 && isdigit(id[0]) ) {
375  try {
376  BooleanProperty tmp;
377  tmp.assign(SmartIF<IProperty>(conversionSvc())->getProperty( "ForceAlphaIds"));
378  forced = (bool)tmp;
379  }
380  catch ( ... ) { }
381  }
382  if (forced ) return std::string("h") + id;
383  else return id;
384 }
virtual SmartIF< IConversionSvc > & conversionSvc() const
Get conversion service the converter is connected to.
Definition: Converter.cpp:110
GAUDI_API Property * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:349
virtual bool assign(const Property &source)
get the value from another property
Definition: Property.h:283
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 171 of file RConverter.cpp.

176 {
177  // Get address again....it does not change
178  IRegistry* pReg = pObj->registry();
179  if ( 0 != pReg ) {
180  refpAddr = pReg->address();
181  if ( 0 == refpAddr ) {
182  refpAddr = new RootObjAddress(repSvcType(),
183  objType(),
184  pReg->name(),
185  "",
186  (unsigned long)(pDir),
187  (unsigned long)(pTObj),
188  pTObj);
189 
190  return StatusCode::SUCCESS;
191  }
192  }
193  return StatusCode::FAILURE;
194 }
virtual const name_type & name() const =0
Name of the directory (or key)
long repSvcType() const
Retrieve the class type of the data store the converter uses.
Definition: RConverter.h:41
virtual const CLID & objType() const
Retrieve the class type of objects the converter produces.
Definition: Converter.cpp:16
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
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 218 of file RConverter.cpp.

224 {
225  std::ostringstream obj; obj << id;
226  StatusCode status = createAddress(rzdir, clid, obj.str(), pTobj, refpAddress);
227  if ( status.isSuccess() ) {
228  unsigned long* ipar = (unsigned long*)refpAddress->ipar();
229  ipar[0] = id;
230  }
231  return status;
232 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
StatusCode createAddress(DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
Create address of the transient object according to the requested representation. ...
Definition: RConverter.cpp:171
StatusCode RootHistCnv::RConverter::createAddress ( const std::string &  rzdir,
const CLID clid,
const std::string &  title,
TObject *  pTobj,
IOpaqueAddress *&  refpAddress 
)
protected

Definition at line 197 of file RConverter.cpp.

203 {
204  RootObjAddress* pA = new RootObjAddress(repSvcType(),
205  clid,
206  rzdir,
207  title,
208  0,
209  0,
210  pTObj );
211 
212  refpAddress = pA;
213  return StatusCode::SUCCESS;
214 }
long repSvcType() const
Retrieve the class type of the data store the converter uses.
Definition: RConverter.h:41
StatusCode RootHistCnv::RConverter::createDirectory ( const std::string &  loc)

Definition at line 26 of file RConverter.cpp.

28 {
29  MsgStream log(msgSvc(), "RConverter::createDir");
30 
31  // Get rid of leading /NTUPLES
32  std::string full;
33  full = diskDirectory( loc );
34 
35  int p,i;
36  std::string fil,cur,s;
37  TDirectory *gDir;
38 
39  gDir = gDirectory;
40 
41  TFile *tf;
42  if ( findTFile(loc,tf).isSuccess() ) {
43  tf->cd();
44  }
45 
46  std::list<std::string> lpath;
47  i = 1;
48 
49  if ( (p=full.find(":",0)) != -1 ) {
50  fil = full.substr(0,p);
51  i = p+1;
52  fil += ":/";
53  gDirectory->cd(fil.c_str());
54  }
55 
56  while ( (p = full.find("/",i)) != -1) {
57  s = full.substr(i,p-i);
58  lpath.push_back(s);
59  i = p+1;
60  }
61  lpath.push_back( full.substr(i,full.length()-i) );
62 
63  if ( full.substr(0,1) == "/") {
64  gDirectory->cd("/");
65  }
66 
67  std::list<std::string>::const_iterator litr;
68  for(litr=lpath.begin(); litr!=lpath.end(); ++litr) {
69  cur = *litr;
70  if (! gDirectory->GetKey(litr->c_str()) ) {
71  gDirectory->mkdir(litr->c_str());
72  }
73  gDirectory->cd(litr->c_str());
74  }
75 
76  gDirectory = gDir;
77 
78  return StatusCode::SUCCESS;
79 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
std::string diskDirectory(const std::string &loc)
Definition: RConverter.cpp:81
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:131
StatusCode findTFile(const std::string, TFile *&)
Definition: RConverter.cpp:331
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
StatusCode RootHistCnv::RConverter::createDiskDirectory ( const std::string &  loc)
TObject * RootHistCnv::RConverter::createPersistent ( DataObject pObj)
protectedvirtual

Create the persistent representation of an object.

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

Definition at line 302 of file RConverter.cpp.

303 {
304  return 0;
305 }
StatusCode RootHistCnv::RConverter::createRep ( DataObject pObj,
IOpaqueAddress *&  refpAddr 
)
virtual

Convert the transient object to the requested representation.

Reimplemented from Converter.

Reimplemented in RootHistCnv::RFileCnv, RootHistCnv::RNTupleCnv, RootHistCnv::RDirectoryCnv, and RootHistCnv::DirectoryCnv.

Definition at line 264 of file RConverter.cpp.

267 {
268  GlobalDirectoryRestore restore;
269  pAddr = 0;
270  try {
271  TDirectory* pParentDir = changeDirectory(pObject);
272  if ( pParentDir ) {
273  TObject* pTObj = createPersistent(pObject);
274  if ( pTObj ) {
275  pTObj->Write();
276  delete pTObj;
277  return createAddress(pObject, pParentDir, 0, pAddr);
278  }
279  }
280  }
281  catch (...) {
282  }
283  MsgStream log (msgSvc(), "RConverter");
284  log << MSG::ERROR << "Failed to create persistent Object!" << endmsg;
285  return StatusCode::FAILURE;
286 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:131
TDirectory * changeDirectory(DataObject *pObject)
Switch to object directory (=Parent directory)
Definition: RConverter.cpp:236
virtual TObject * createPersistent(DataObject *pObj)
Create the persistent representation of an object.
Definition: RConverter.cpp:302
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode createAddress(DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
Create address of the transient object according to the requested representation. ...
Definition: RConverter.cpp:171
std::string RootHistCnv::RConverter::directory ( const std::string &  loc)

Definition at line 113 of file RConverter.cpp.

115 {
116  return ( diskDirectory(loc) );
117 }
std::string diskDirectory(const std::string &loc)
Definition: RConverter.cpp:81
std::string RootHistCnv::RConverter::diskDirectory ( const std::string &  loc)

Definition at line 81 of file RConverter.cpp.

83 {
84  // Get rid of leading /NTUPLES/{INPUT_STREAM} or /stat/{INPUT_STREAM}
85  std::string dir;
86  long lf1 = loc.find("/NTUPLES/");
87  long lf2 = loc.find("/stat/");
88  long ll;
89  if (lf1 != -1) {
90  ll = loc.find("/",lf1+9);
91 
92  } else if (lf2 != -1) {
93  ll = loc.find("/",lf2+6);
94 
95  } else {
96  MsgStream log(msgSvc(), "RConverter");
97  log << MSG::ERROR << "diskDirectory(" << loc << ")"
98  << " --> no leading /NTUPLES/ or /stat/" << endmsg;
99  return loc;
100  }
101  // dir = loc.substr(ll+8,loc.length()-ll-8);
102 
103  if (ll == -1) {
104  dir = "/";
105  } else {
106  dir = loc.substr(ll,loc.length()-ll);
107  }
108 
109  return dir;
110 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:131
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode RootHistCnv::RConverter::error ( const std::string &  msg)

Definition at line 386 of file RConverter.cpp.

388 {
389  MsgStream log(msgSvc(), "RootHistCnv");
390  log << MSG::ERROR << msg << endmsg;
391  return StatusCode::FAILURE;
392 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:131
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode RootHistCnv::RConverter::findTFile ( const std::string  id,
TFile *&  tfile 
)

Definition at line 331 of file RConverter.cpp.

334 {
335  MsgStream log(msgSvc(), "RConverter");
336  tfile = 0;
337 
338  std::string idm;
339 
340  // make sure we only get first two parts of id
341  int i1,i2,i3;
342  i1 = id.find("/",0);
343  if (i1 != 0) {
344  log << MSG::ERROR << "Directory name does not start with \"/\": "
345  << id << endmsg;
346  return StatusCode::FAILURE;
347  }
348  i2 = id.find("/",i1+1);
349  if (i2 == -1) {
350  log << MSG::ERROR << "Directory name has only one part: " << id << endmsg;
351  return StatusCode::FAILURE;
352  }
353  i3 = id.find("/",i2+1);
354  if (i3 == -1) {
355  idm = id;
356  } else {
357  idm = id.substr(0,i3);
358  }
359 
360  std::map<std::string,TFile*>::const_iterator imap;
361  imap = s_fileMap.find(idm);
362 
363  if ( imap == s_fileMap.end() ) {
364  return StatusCode::FAILURE;
365  }
366  tfile = (*imap).second;
367  return StatusCode::SUCCESS;
368 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:131
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::string RootHistCnv::RConverter::getDirectory ( )

Definition at line 162 of file RConverter.cpp.

164 {
165  std::string dir = gDirectory->GetPath();
166  return (dir);
167 }
StatusCode RootHistCnv::RConverter::readObject ( IOpaqueAddress pAddr,
DataObject *&  refpObj 
)
protectedvirtual

Create the transient representation of an object.

Definition at line 289 of file RConverter.cpp.

291 {
292 // MsgStream log(msgSvc(), "RConverter::readObject");
293 // log << MSG::WARNING << pAddr->par()[0] << " <> " << pAddr->par()[1]
294 // << " <> "
295 // << pAddr->ipar()[0] << " <> " << pAddr->ipar()[1] << " <> "
296 // << pAddr->registry()->identifier() << endmsg;
297 
298  return StatusCode::SUCCESS;
299 }
StatusCode RootHistCnv::RConverter::regTFile ( const std::string  id,
const TFile *  tfile 
)

Definition at line 309 of file RConverter.cpp.

312 {
313 
314  MsgStream log(msgSvc(), "RConverter");
315 
316  std::map<std::string,TFile*>::const_iterator imap;
317  imap = s_fileMap.find(id);
318 
319  if ( imap != s_fileMap.end() ) {
320  log << MSG::ERROR << "cannot register TTree " << id
321  << ": already exists" << endmsg;
322  return StatusCode::FAILURE;
323  }
324 
325  s_fileMap[id] = const_cast<TFile*>(tfile);
326 
327  return StatusCode::SUCCESS;
328 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:131
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
long RootHistCnv::RConverter::repSvcType ( ) const
inlinevirtual

Retrieve the class type of the data store the converter uses.

Returns
Class type information about the source data store type the converter will use to retrieve the information.

Implements IConverter.

Definition at line 41 of file RConverter.h.

41 { return i_repSvcType(); }
virtual long i_repSvcType() const
Retrieve the class type of the data store the converter uses.
Definition: Converter.cpp:21
void RootHistCnv::RConverter::setDirectory ( const std::string &  loc)

Definition at line 120 of file RConverter.cpp.

122 {
123  MsgStream log(msgSvc(), "RConverter");
124  std::string full, id;
125  TFile *tf;
126 
127  full = diskDirectory( loc );
128 
129  // get associated TFile
130  if ( findTFile(loc,tf).isSuccess() ) {
131  tf->cd();
132  } else {
133  log << MSG::ERROR << "error getting TFile name " << loc << endmsg;
134  }
135 
136  int p,i=1;
137  std::string cur,sdir;
138 
139  gDirectory->cd("/");
140  while ( (p = full.find("/",i)) != -1) {
141  sdir = full.substr(i,p-i);
142  if (! gDirectory->GetKey(sdir.c_str()) ) {
143  log << MSG::ERROR << "cannot cd to " << full << " from "
144  << gDirectory->GetPath() << endmsg;
145  return;
146  }
147  gDirectory->cd(sdir.c_str());
148 
149  i = p+1;
150  }
151  gDirectory->cd( full.substr(i,full.length()-i).c_str() );
152 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
std::string diskDirectory(const std::string &loc)
Definition: RConverter.cpp:81
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:131
StatusCode findTFile(const std::string, TFile *&)
Definition: RConverter.cpp:331
list i
Definition: ana.py:128
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void RootHistCnv::RConverter::setDiskDirectory ( const std::string &  loc)

Definition at line 155 of file RConverter.cpp.

157 {
158  setDirectory(loc);
159 }
void setDirectory(const std::string &loc)
Definition: RConverter.cpp:120
static long RootHistCnv::RConverter::storageType ( )
inlinestatic

Inquire storage type.

Definition at line 40 of file RConverter.h.

40 { return ROOT_StorageType; }
const long ROOT_StorageType
Definition: ClassID.h:53

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