#include #include #include "TFile.h" #include "TH1D.h" #include "JROOT/JRootFileWriter.hh" #include "JROOT/JRootToolkit.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Program to test JROOT::putObject methods. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; string outputFile; int debug; try { JParser<> zap("Program to test JROOT::putObject methods."); zap['o'] = make_field(outputFile) = "abc.root"; zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } TH1D h0("h0", "A0", 1, 0.0, 1.0); TH1D h1("h1", "A1", 1, 0.0, 1.0); TFile out(outputFile.c_str(), "recreate"); putObject(out, h0); out << h1; out.Write(); out.Close(); return 0; }