Auxiliary program to print ROOT TTree information.  
More...
#include <string>
#include <iostream>
#include <iomanip>
#include "TError.h"
#include "TROOT.h"
#include "TFile.h"
#include "TKey.h"
#include "TTree.h"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
 
Go to the source code of this file.
 | 
| int  | main (int argc, char **argv) | 
|   | 
Auxiliary program to print ROOT TTree information. 
- Author
 - mdejong 
 
Definition in file JPrintTree.cc.
 
      
        
          | int main  | 
          ( | 
          int  | 
          argc,  | 
        
        
           | 
           | 
          char **  | 
          argv  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 22 of file JPrintTree.cc.
   31     JParser<> zap(
"Auxiliary program to print ROOT TTree information.");
 
   38   catch(
const exception &error) {
 
   39     FATAL(error.what() << endl);
 
   44   gErrorIgnoreLevel = kFatal;
 
   46   int number_of_errors = 0;
 
   50     TFile* file = TFile::Open(file_name->c_str());
 
   52     cout << *file_name << flush;
 
   58       TIter iter(file->GetListOfKeys(), kIterBackward);
 
   60       for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
 
   62         TKey* p = 
dynamic_cast<TKey*
>(file->GetListOfKeys()->Before(key));
 
   64         if (p == NULL || strcmp(key->GetName(), p->GetName()) != 0) {                      
 
   66           TTree* tree = 
dynamic_cast<TTree*
>(key->ReadObj());
 
   70             TBranch* branch = 
dynamic_cast<TBranch*
>(tree->GetListOfBranches()->At(0));    
 
   73               cout << setw(24) << left  <<  key->GetName()             << 
' ' 
   74                    << setw(32) << left  <<  branch->GetClassName()     << 
' '  
   75                    << setw(10) << right <<  tree->GetEntries()         << 
' ' 
   76                    << setw( 6) << right << (tree->GetTotBytes() >> 20) << 
" [MB]" << endl;
 
   86       cout << 
" not opened." << endl;
 
   90   return (number_of_errors == 0 ? 0 : 1);
 
Utility class to parse command line options. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object