30 int 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);
53 DEBUG(
"Input: " << *input << endl);
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;
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
I/O formatting auxiliaries.
Utility class to parse command line options.
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer.
bool isTObject(const TKey *key)
Check if given key corresponds to a TObject.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).