#include #include #include #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" namespace { using namespace JPP; /** * Print class streamer version. * * \param out output stream * \param name class name * \param file pointer to ROOT file */ inline void print(std::ostream& out, const char* name, TFile* file = NULL) { using namespace std; using namespace JPP; TDictionary* dictionary = TDictionary::GetDictionary(name); out << setw(40) << left << name << ' '; if (dictionary != NULL) { out << setw( 4) << right << dynamic_cast(dictionary)->GetClassVersion() << ' '; } if (file != NULL) { out << setw(4) << right << getStreamerVersion(file, name); } cout << endl; } /** * Print class streamer version. * * \param out output stream * \param typelist type list * \param file pointer to ROOT file */ inline void print(std::ostream& out, JType typelist, TFile* file = NULL) {} /** * Print class streamer version. * * \param out output stream * \param typelist type list * \param file pointer to ROOT file */ template inline void print(std::ostream& out, JType< JTypeList > typelist, TFile* file = NULL) { print(out, JHead_t::Class_Name(), file); print(out, JType(), file); } } /** * \file * * Auxiliary program to print ROOT class version information. * \author mdejong */ int main(int argc, char **argv) { using namespace std; string input_file; string class_name; int debug; try { JParser<> zap("Auxiliary program to print ROOT class version information."); zap['f'] = make_field(input_file) = ""; zap['c'] = make_field(class_name) = ""; zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; JRootInputFile file; if (input_file != "") { try { file.open(input_file.c_str()); } catch(const exception& error) { FATAL(error.what() << endl); } if (!file.is_open()) { FATAL("Error opening file " << input_file << endl); } } if (class_name != "") print(cout, class_name.c_str(), file.getFile()); else print(cout, JType(), file.getFile()); }