31 int main(
int argc, 
char **argv)
 
   36   typedef JAbstractHistogram<double> JHistogram_t;
 
   44   JHistogram_t   histogram;
 
   49     JParser<> zap(
"Program to plot PDF of Cherenkov light from muon using interpolation tables.");
 
   53     zap[
'E'] = 
make_field(
E,         
"muon energy [GeV]")          = 1.0;
 
   54     zap[
'R'] = 
make_field(
R,         
"distance of approach [m]");
 
   55     zap[
'D'] = 
make_field(dir,       
"(theta, phi) of PMT [rad]");
 
   56     zap[
'T'] = 
make_field(TTS_ns,    
"PMT time smearing [ns]")     = 0.0;   
 
   57     zap[
'H'] = 
make_field(histogram, 
"histogram binning")          = JHistogram_t();
 
   62   catch(
const exception &error) {
 
   63     FATAL(error.what() << endl);
 
   67   typedef JSplineFunction1S_t                                     JFunction1D_t;
 
   69   typedef JMAPLIST<JPolint1FunctionalMap,
 
   70                    JPolint1FunctionalGridMap,
 
   71                    JPolint1FunctionalGridMap>::maplist            JMapList_t;
 
   72   typedef JPDFTable<JFunction1D_t, JMapList_t>                    JPDF_t;
 
   74   const int N = inputFile.size();
 
   81     for (
int i = 0; i != 
N; ++i) {
 
   83       NOTICE(
"loading input from file " << inputFile[i] << 
"... " << flush);
 
   87       pdf [i].load(inputFile[i].c_str());
 
   89       pdf [i].setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
 
   98   catch(
const JException& error) {
 
   99     FATAL(error.what() << endl);
 
  105     for (
double dt; cin >> dt; ) {
 
  107       for (
int i = 0; i != 
N; ++i) {
 
  109         JFunction1D_t::result_type y = pdf[i](
R, dir.getTheta(), dir.getPhi(), dt);
 
  117         cout << setw(2)         << type[i]        << 
' ' 
  119              << 
FIXED(5,1)      << R              << 
' ' 
  120              << 
FIXED(5,2)      << dir.getTheta() << 
' ' 
  121              << 
FIXED(5,2)      << dir.getPhi()   << 
' ' 
  122              << 
FIXED(5,1)      << dt             << 
' ' 
  141   const double t0   =  0.0;                                   
 
  143   if (!histogram.is_valid()) {
 
  147       histogram = JHistogram_t(t0 - 20.0, t0 + 50.0);
 
  149       histogram.setBinWidth(0.1);
 
  153       histogram = JHistogram_t(t0 - 20.0, t0 + 500.0);
 
  155       histogram.setBinWidth(0.5);
 
  159   TH1D h0(
"h0", NULL, histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit());
 
  160   TH1D 
h1(
"h1", NULL, histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit());
 
  161   TH1D h2(
"h2", NULL, histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit());
 
  163   for (
int i = 1; i <= h0.GetNbinsX(); ++i) {
 
  165     const double dt = h0.GetBinCenter(i) - t0;
 
  169     for (
int j = 0; 
j != 
N; ++
j) {
 
  171       JFunction1D_t::result_type y = pdf[
j](
R, dir.getTheta(), dir.getPhi(), dt);
 
Utility class to parse command line options. 
 
then for HISTOGRAM in h0 h1
 
static const JZero zero
Function object to assign zero value. 
 
Auxiliary data structure for floating point format specification. 
 
Various implementations of functional maps. 
 
Numbering scheme for PDF types. 
 
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung. 
 
I/O formatting auxiliaries. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
then usage $script[distance] fi case set_variable R
 
General purpose messaging. 
 
int getPDFType(const std::string &file_name)
Get PDF type. 
 
Utility class to parse command line options. 
 
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays. 
 
double getDeltaRaysFromMuon(const double E)
Equivalent EM-shower energy due to delta-rays per unit muon track length. 
 
Auxiliary data structure for floating point format specification. 
 
then usage $script[input file[working directory[option]]] nWhere option can be N
 
then usage $script[input file[working directory[option]]] nWhere option can be E
 
int main(int argc, char *argv[])