#include #include #include #include #include #include "JTools/JFunction1D_t.hh" #include "JTools/JFunctionalMap_t.hh" #include "JPhysics/JPDFTable.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to add PDF tables of the arrival time of the Cherenkov light from a muon. * \author mdejong */ int main(int argc, char **argv) { using namespace std; vector inputFile; string outputFile; int debug; try { JParser<> zap("Auxiliary program to add PDF tables of the arrival time of the Cherenkov light from a muon."); zap['f'] = make_field(inputFile); zap['o'] = make_field(outputFile); zap['d'] = make_field(debug) = 2; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } if (inputFile.empty()) { FATAL("No input file(s)." << endl); } using namespace JPP; typedef JSplineFunction1D_t JFunction1D_t; typedef JMAPLIST::maplist JMapList_t; typedef JPDFTable JPDF_t; const JFunction1D_t::JSupervisor supervisor(new JFunction1D_t::JDefaultResult(0.0)); JPDF_t pdf; for (vector::const_iterator i = inputFile.begin(); i != inputFile.end(); ++i) { try { NOTICE("loading input from file " << *i << "... " << flush); JPDF_t buffer; buffer.load(i->c_str()); buffer.compile(); buffer.setExceptionHandler(supervisor); NOTICE("OK" << endl); if (pdf.empty()) pdf = buffer; else pdf.add(buffer); } catch(const JException& error) { FATAL(error.what() << endl); } } try { NOTICE("storing output to file " << outputFile << "... " << flush); pdf.store(outputFile.c_str()); NOTICE("OK" << endl); } catch(const JException& error) { FATAL(error << endl); } }