36TKey*
getObjKey( TDirectory* dir,
const std::string& path )
41 std::string::size_type i = path.find_first_of(
'/');
42 if( i != std::string::npos ) {
43 std::string dName( path, 0, i );
44 std::string pName( path, i+1, std::string::npos );
46 TDirectory* subDir = dir->GetDirectory(dName.c_str());
64 return dir->FindKey( path.c_str() );
80dolsr(
const TDirectory* dir, std::vector<std::string>& hists,
const TDirectory* topdir)
86 TIter keys(dir->GetListOfKeys());
88 std::string fullpath(dir->GetPath());
89 std::string toppath(topdir->GetPath());
90 std::string::size_type toppathlen = toppath.length();
91 while ((key =
dynamic_cast<TKey*
>(keys())) != NULL) {
92 if (std::string(key->GetClassName()).starts_with(
"TDirectory")) {
93 TDirectory* newdir =
dynamic_cast<TDirectory*
>(key->ReadObj());
95 std::cerr <<
"WARNING: cannot read directory "
96 << fullpath <<
"/" << key->GetName()
97 <<
"; skipping" << std::endl;
99 dolsr(newdir, hists, topdir);
103 if (std::string(key->GetName()) ==
"metadata") {
107 if (fullpath.substr(0, toppathlen) == toppath) {
109 if (toppath[toppathlen-1] ==
'/') extra = 0;
110 path = fullpath.substr(toppathlen + extra, std::string::npos);
114 hists.push_back(path+
"/"+std::string(key->GetName()));