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

Auxiliary program to print ROOT class version information. More...

#include <string>
#include <iostream>
#include <iomanip>
#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 "JTrigger/JTriggerParameters.hh"
#include "JROOT/JRootToolkit.hh"
#include "JSupport/JSupport.hh"
#include "JLang/JTypeList.hh"
#include "JLang/JType.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 class version information.

Author
mdejong

Definition in file JPrintRootVersion.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 93 of file JPrintRootVersion.cc.

94 {
95  using namespace std;
96 
97  string input_file;
98  string class_name;
99  int debug;
100 
101  try {
102 
103  JParser<> zap("Auxiliary program to print ROOT class version information.");
104 
105  zap['f'] = make_field(input_file) = "";
106  zap['c'] = make_field(class_name) = "";
107  zap['d'] = make_field(debug) = 1;
108 
109  zap(argc, argv);
110  }
111  catch(const exception &error) {
112  FATAL(error.what() << endl);
113  }
114 
115  cout.tie(&cerr);
116 
117  using namespace JPP;
118 
119  JRootInputFile file;
120 
121  if (input_file != "") {
122 
123  try {
124  file.open(input_file.c_str());
125  }
126  catch(const exception& error) {
127  FATAL(error.what() << endl);
128  }
129 
130  if (!file.is_open()) {
131  FATAL("Error opening file " << input_file << endl);
132  }
133  }
134 
135  if (class_name != "")
136  print(cout, class_name.c_str(), file.getFile());
137  else
138  print(cout, JType<JAllDataTypes_t>(), file.getFile());
139 }
Utility class to parse command line options.
Definition: JParser.hh:1410
Auxiliary class for a type holder.
Definition: JType.hh:19
void print(const TH1 &h1, std::ostream &out)
Print histogram parameters.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1836
ROOT input file.
Definition: JRootFile.hh:101
int debug
debug level
Definition: JSirene.cc:59
virtual void open(const char *file_name)
Open file.
Definition: JRootFile.hh:131
#define FATAL(A)
Definition: JMessage.hh:65