Jpp
Functions
JPrintTree.cc File Reference
#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

◆ main()

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  cout << *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  cout << setw(24) << left << (**i)->GetName() << ' '
132  << setw(32) << left << (*i)->getDictionary()->GetName() << ' '
133  << setw(10) << right << (**i)->GetEntries() << ' '
134  << setw( 6) << right << ((**i)->GetTotBytes() >> 20) << " [MB]" << endl;
135  }
136  }
137  }
138 }
JLANG::JType
Auxiliary class for a type holder.
Definition: JType.hh:19
std::vector
Definition: JSTDTypes.hh:12
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
debug
int debug
debug level
Definition: JSirene.cc:59
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
std
Definition: jaanetDictionary.h:36
FATAL
#define FATAL(A)
Definition: JMessage.hh:67