#include #include #include #include #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" #include "JTools/JFunction1D_t.hh" #include "JTools/JFunctionalMap_t.hh" #include "JPhysics/JPDFTable.hh" /** * \file * Auxiliary program to apply the transition time spread (TTS) of the PMTs to interpolation tables of PDFs. * \author mdejong */ int main(int argc, char **argv) { using namespace std; string inputFile; string outputFile; int numberOfPoints; double epsilon; double TTS; int debug; try { JParser<> zap("Auxiliary program to apply the transition time spread (TTS) of the PMTs to interpolation tables of PDFs."); zap['f'] = make_field(inputFile); zap['o'] = make_field(outputFile); zap['n'] = make_field(numberOfPoints) = 25; zap['e'] = make_field(epsilon) = 1.0e-10; zap['T'] = make_field(TTS) = 0.0; // [ns] zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; typedef JSplineFunction1D_t JFunction1D_t; typedef JMAPLIST::maplist JMapList_t; typedef JPDFTable JPDF_t; JPDF_t pdf; try { NOTICE("loading input from file " << inputFile << "... " << flush); pdf.load(inputFile.c_str()); NOTICE("OK" << endl); } catch(const JException& error) { FATAL(error.what() << endl); } pdf.setExceptionHandler(new JFunction1D_t::JDefaultResult(0.0)); NOTICE("Gauss-Hermite integration... " << flush); pdf.blur(TTS, numberOfPoints, epsilon); NOTICE("OK" << endl); NOTICE("storing output to file " << outputFile << "... " << flush); pdf.store(outputFile.c_str()); NOTICE("OK" << endl); }