2 #define ROOTHISTCNV_RCONVERTER_CPP
15 #include "TDirectory.h"
49 if ( (p=full.find(
":",0)) != -1 ) {
50 fil = full.substr(0,p);
53 gDirectory->cd(fil.c_str());
56 while ( (p = full.find(
"/",i)) != -1) {
57 s = full.substr(i,p-i);
61 lpath.
push_back( full.substr(i,full.length()-
i) );
63 if ( full.substr(0,1) ==
"/") {
68 for(litr=lpath.
begin(); litr!=lpath.
end(); ++litr) {
70 if (! gDirectory->GetKey(litr->c_str()) ) {
71 gDirectory->mkdir(litr->c_str());
73 gDirectory->cd(litr->c_str());
86 long lf1 = loc.
find(
"/NTUPLES/");
87 long lf2 = loc.find(
"/stat/");
90 ll = loc.find(
"/",lf1+9);
92 }
else if (lf2 != -1) {
93 ll = loc.find(
"/",lf2+6);
97 log <<
MSG::ERROR <<
"diskDirectory(" << loc <<
")"
98 <<
" --> no leading /NTUPLES/ or /stat/" <<
endmsg;
106 dir = loc.substr(ll,loc.length()-ll);
116 return ( diskDirectory(loc) );
127 full = diskDirectory( loc );
130 if ( findTFile(loc,tf).isSuccess() ) {
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;
147 gDirectory->cd(sdir.c_str());
151 gDirectory->cd( full.substr(i,full.length()-
i).c_str() );
181 if ( 0 == refpAddr ) {
186 (
unsigned long)(pDir),
187 (
unsigned long)(pTObj),
226 StatusCode status = createAddress(rzdir, clid, obj.str(), pTobj, refpAddress);
228 unsigned long* ipar = (
unsigned long*)refpAddress->
ipar();
245 StatusCode status = dataMgr->objectParent(pReg, pParentReg);
249 TDirectory* pParentDir = (TDirectory*)pParAddr->
ipar()[0];
251 gDirectory->cd(pParentDir->GetPath());
271 TDirectory* pParentDir = changeDirectory(pObject);
273 TObject* pTObj = createPersistent(pObject);
277 return createAddress(pObject, pParentDir, 0, pAddr);
317 imap = s_fileMap.
find(
id);
319 if ( imap != s_fileMap.
end() ) {
320 log <<
MSG::ERROR <<
"cannot register TTree " <<
id
321 <<
": already exists" <<
endmsg;
325 s_fileMap[id] =
const_cast<TFile*
>(tfile);
344 log <<
MSG::ERROR <<
"Directory name does not start with \"/\": "
348 i2 =
id.find(
"/",i1+1);
353 i3 =
id.find(
"/",i2+1);
357 idm =
id.substr(0,i3);
361 imap = s_fileMap.
find(idm);
363 if ( imap == s_fileMap.
end() ) {
366 tfile = (*imap).second;
374 if (
id.size() > 0 &&
isdigit(
id[0]) ) {