30{
   33 
   35 
   38  double         E;
   39  double         D;
   40  double         cd;
   42  double         TTS_ns;
   45 
   46  try { 
   47 
   48    JParser<> zap(
"Program to plot PDF of Cherenkov light from EM-shower or scattered light from muon using interpolation tables.");
 
   49 
   52    zap[
'E'] = 
make_field(E,         
"shower energy [GeV]")        = 1.0;
 
   54    zap[
'c'] = 
make_field(cd,        
"cosine emission angle");
 
   55    zap[
'D'] = 
make_field(dir,       
"(theta, phi) of PMT [rad]");
 
   56    zap[
'T'] = 
make_field(TTS_ns,    
"PMT time smearing [ns]")     = 0.0;   
 
   59 
   60    zap(argc, argv);
   61  }
   62  catch(const exception &error) {
   63    FATAL(error.what() << endl);
 
   64  }
   65 
   66 
   73 
   74  const int N = inputFile.size();
   75 
   76  int    type[N];
   77  JPDF_t pdf [N];
   78 
   79  try {
   80 
   81    for (int i = 0; i != N; ++i) {
   82 
   83      NOTICE(
"loading input from file " << inputFile[i] << 
"... " << flush);
 
   84      
   86 
   87      pdf [i].load(inputFile[i].c_str());
   88 
   89      pdf [i].setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
 
   90      
   91      if (TTS_ns > 0.0) {
   92        pdf[i].blur(TTS_ns);
   93      }
   94      
   96    }
   97  }
  100  }
  101 
  102 
  104 
  105    for (double dt; cin >> dt; ) {
  106      
  107      for (int i = 0; i != N; ++i) {
  108 
  109        JFunction1D_t::result_type 
y = pdf[i](D, cd, dir.
getTheta(), dir.
getPhi(), dt);
 
  110      
  111        cout << setw(2)         << type[i]               << ' '
  113             << 
FIXED(5,1)      << D                     << 
' ' 
  114             << 
FIXED(5,2)      << cd                    << 
' ' 
  117             << 
FIXED(5,1)      << dt                    << 
' ' 
  122      }
  123    }
  124 
  125    return 0;
  126  }
  127 
  128 
  130    
  131  int function = 0;
  132    
  133  if (inputFile.size() == 1 &&
  134      inputFile.begin()->find(
getLabel(SCATTERED_LIGHT_FROM_EMSHOWER)) == string::npos) {
 
  135    function = 1;
  136  }
  137    
  138  
  139  const double t0   =  0.0;                                   
  140 
  142 
  143    if (function == 1) {
  144 
  146 
  148 
  149    } else {
  150 
  152 
  154    }
  155  }
  156 
  158    
  159  for (int i = 1; i <= h0.GetNbinsX(); ++i) {
  160      
  161    const double dt = h0.GetBinCenter(i) - t0;
  162 
  164 
  165    for (
int j = 0; 
j != N; ++
j) {
 
  167    }      
  168 
  169    h0.SetBinContent(i, get_value(Y));
  170  }
  171 
  172  out.Write();
  173  out.Close();
  174}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
Data structure for angles in three dimensions.
 
double getTheta() const
Get theta angle.
 
double getPhi() const
Get phi angle.
 
virtual const char * what() const override
Get error message.
 
Utility class to parse command line options.
 
Multi-dimensional PDF table for arrival time of Cherenkov light.
 
std::string getLabel(const JLocation &location)
Get module label for monitoring and other applications.
 
static const JZero zero
Function object to assign zero value.
 
int getPDFType(const std::string &file_name)
Get PDF type.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
Auxiliary data structure for floating point format specification.
 
Auxiliary data structure for floating point format specification.