71{
72 TList* keylist = curdir->GetListOfKeys();
73
74 TIter nextkey(keylist);
75 TKey* key = 0;
76 while ((key = static_cast<TKey*>(nextkey()))) {
77 TObject* obj = curdir->FindObjectAny(key->GetName());
78 if (obj->IsA()->InheritsFrom("TH1")) {
79 TH1* h1 = static_cast<TH1*>(obj);
80
81 msg->
add(h1, h1->GetName());
82 numobjs++;
83 } else if (obj->IsA()->InheritsFrom(TDirectory::Class())) {
84
85 TDirectory* tdir = static_cast<TDirectory*>(obj);
86
87 TText subdir(0, 0, tdir->GetName());
88 msg->
add(&subdir,
"SUBDIR:" +
string(obj->GetName())) ;
89 numobjs++;
90 tdir->cd();
91 StreamHistograms(tdir, msg, numobjs);
92 TText command(0, 0, "COMMAND:EXIT");
93 msg->
add(&command,
"SUBDIR:EXIT");
94 numobjs++;
95 curdir->cd();
96 }
97 }
98 return 0;
99}
virtual void add(const TObject *, const std::string &name)
Add an object to be streamed.