30int main(
int argc,
char **argv)
40 JParser<> zap(
"Auxiliary program to print title of ROOT objects.");
42 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
47 catch(
const exception &error) {
48 FATAL(error.what() << endl);
51 for (vector<JRootObjectID>::const_iterator input = inputFile.begin(); input != inputFile.end(); ++input) {
53 DEBUG(
"Input: " << *input << endl);
55 TDirectory* dir = getDirectory(*input);
58 ERROR(
"File: " << input->getFullFilename() <<
" not opened." << endl);
62 const TRegexp regexp(input->getObjectName());
64 TIter iter(dir->GetListOfKeys());
66 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
68 const TString tag(key->GetName());
70 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
74 if (tag.Contains(regexp) && isTObject(key) && TClass::GetClass(key->GetClassName())->IsTObject()) {
76 TObject*
object = key->ReadObj();
78 cout <<
object->GetTitle() << endl;