Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JPrintTree.cc File Reference

Auxiliary program to print ROOT TTree information. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "TError.h"
#include "TROOT.h"
#include "TFile.h"
#include "evt/Head.hh"
#include "evt/Evt.hh"
#include "JDAQ/JDAQEvent.hh"
#include "JDAQ/JDAQTimeslice.hh"
#include "JDAQ/JDAQSummaryslice.hh"
#include "antares-dataformat/TimeSlice.hh"
#include "antares-dataformat/PhysicsEvent.hh"
#include "JROOT/JTreeParameters.hh"
#include "JROOT/JTreeReader.hh"
#include "JSupport/JSupport.hh"
#include "JLang/JSinglePointer.hh"
#include "JLang/JBool.hh"
#include "JLang/JType.hh"
#include "JLang/JTypeList.hh"
#include "JLang/JNullType.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to print ROOT TTree information.

Author
mdejong

Definition in file JPrintTree.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 96 of file JPrintTree.cc.

97 {
98  using namespace std;
99 
100  vector<string> inputFile;
101  int debug;
102 
103  try {
104 
105  JParser<> zap("Auxiliary program to print ROOT TTree information.");
106 
107  zap['f'] = make_field(inputFile);
108  zap['d'] = make_field(debug) = 1;
109 
110  zap(argc, argv);
111  }
112  catch(const exception &error) {
113  FATAL(error.what() << endl);
114  }
115 
116  cout.tie(&cerr);
117 
119 
120  JTreeList inspector(typelist);
121 
122  for (vector<string>::const_iterator file = inputFile.begin(); file != inputFile.end(); ++file) {
123 
124  NOTICE(*file << endl);
125 
126  for (JTreeList::iterator i = inspector.begin(); i != inspector.end(); ++i) {
127 
128  gErrorIgnoreLevel = kFatal;
129 
130  if ((*i)->load(TFile::Open(file->c_str()))) {
131  NOTICE(""
132  << setw(24) << left << (**i)->GetName() << ' '
133  << setw(32) << left << (*i)->getDictionary()->GetName() << ' '
134  << setw(10) << right << (**i)->GetEntries() << ' '
135  << setw( 6) << right << ((**i)->GetTotBytes() >> 20) << " [MB]" << endl);
136  }
137  }
138  }
139 }
Utility class to parse command line options.
Definition: JParser.hh:1410
Auxiliary class for a type holder.
Definition: JType.hh:19
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1836
#define NOTICE(A)
Definition: JMessage.hh:62
int debug
debug level
Definition: JSirene.cc:59
#define FATAL(A)
Definition: JMessage.hh:65