29 static const char* plain_t =
"plain";
30 static const char* single_t =
"single";
31 static const char* json_t =
"JSON";
39 int main(
int argc,
char **argv)
52 JParser<> zap(
"Auxiliary program to print Jpp meta data.");
55 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
57 zap[
'O'] =
make_field(option) = plain_t, single_t, json_t;
62 catch(
const exception &error) {
63 FATAL(error.what() << endl);
68 if (application !=
"") {
70 TFile* in = TFile::Open(inputFile.c_str(),
"exists");
72 if (in != NULL && in->IsOpen()) {
74 const TRegexp regexp(application.c_str());
76 TIter iter(in->GetListOfKeys());
78 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
80 const TString tag(key->GetName());
82 if (tag.Index(regexp) != -1) {
84 TNamed* named =
dynamic_cast<TNamed*
>(key->ReadObj());
87 cout << named->GetName() <<
"[" << key->GetCycle() <<
"] " << named->GetTitle() << endl;
96 ERROR(
"Error opening file: " << inputFile << endl);
101 JMultipleFileScanner<JMetaTypes_t> in(inputFile, numberOfEvents);
103 JObjectMultiplexer<JMetaTypes_t> abc(in);
105 if (option == single_t) {
109 while (abc.hasNext()) {
111 JMeta* meta = abc.next();
113 if (option == plain_t) {
115 cout << *meta << endl;
117 }
else if (option == single_t ||
122 for (JMeta::const_iterator i = meta->begin(); i != meta->end(); ++i) {
123 if (i->first != application_t) {
124 cout <<
double_quote(i->first) <<
" : " <<
double_quote(i->second) << (i->first != meta->rbegin()->first ?
"," :
"") << endl;
137 if (option == single_t) {
Utility class to parse command line options.
static const char *const application_t
Definition of meta data parameters.
std::string double_quote(const std::string &value)
Quote string.
JLimit JLimit_t
Type definition of limit.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
ROOT TTree parameter settings.
int main(int argc, char *argv[])