Jpp  master_rocky-43-ge265d140c
the software that should make you happy
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 "km3net-dataformat/offline/Head.hh"
#include "km3net-dataformat/offline/MultiHead.hh"
#include "km3net-dataformat/offline/Evt.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQSummarysliceIO.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

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 94 of file JPrintRootVersion.cc.

95 {
96  using namespace std;
97 
98  string input_file;
99  string class_name;
100  int debug;
101 
102  try {
103 
104  JParser<> zap("Auxiliary program to print ROOT class version information.");
105 
106  zap['f'] = make_field(input_file) = "";
107  zap['c'] = make_field(class_name) = "";
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 
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 }
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level
Definition: JSirene.cc:69
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2142
Utility class to parse command line options.
Definition: JParser.hh:1698
TFile * getFile() const
Get file.
Definition: JRootFile.hh:66
virtual bool is_open() const override
Check is file is open.
Definition: JRootFile.hh:77
ROOT input file.
Definition: JRootFile.hh:97
virtual void open(const char *file_name) override
Open file.
Definition: JRootFile.hh:136
std::ostream & print(std::ostream &out, const JTestSummary &summary, const char delimiter=' ', const bool useColors=true)
Print test summary.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
Auxiliary class for a type holder.
Definition: JType.hh:19