29{
   32 
   34 
   37  double         E;
   38  double         D;
   39  double         ct;
   40  double         TTS_ns;
   43 
   44  try { 
   45 
   46    JParser<> zap(
"Program to plot PDF of Cherenkov light from bright point using interpolation tables.");
 
   47 
   50    zap[
'E'] = 
make_field(E,         
"shower energy [GeV]")        = 1.0;
 
   53    zap[
'T'] = 
make_field(TTS_ns,    
"PMT time smearing [ns]")     = 0.0;   
 
   56 
   57    zap(argc, argv);
   58  }
   59  catch(const exception &error) {
   60    FATAL(error.what() << endl);
 
   61  }
   62 
   64 
   69 
   70  const int N = inputFile.size();
   71 
   72  int    type[N];
   73  JPDF_t pdf [N];
   74 
   75  try {
   76 
   77    for (int i = 0; i != N; ++i) {
   78 
   79      NOTICE(
"loading input from file " << inputFile[i] << 
"... " << flush);
 
   80      
   82 
   83      pdf [i].load(inputFile[i].c_str());
   84 
   85      pdf [i].setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
 
   86      
   87      if (TTS_ns > 0.0) {
   88        pdf[i].blur(TTS_ns);
   89      }
   90      
   92    }
   93  }
   96  }
   97 
   98 
  100 
  101    for (double dt; cin >> dt; ) {
  102      
  103      for (int i = 0; i != N; ++i) {
  104 
  105        JFunction1D_t::result_type 
y = pdf[i](D, ct, dt);
 
  106      
  107        cout << setw(2)         << type[i]               << ' '
  109             << 
FIXED(5,1)      << D                     << 
' ' 
  110             << 
FIXED(5,2)      << ct                    << 
' ' 
  111             << 
FIXED(5,1)      << dt                    << 
' ' 
  116      }
  117    }
  118 
  119    return 0;
  120  }
  121 
  122 
  124    
  125  int function = 0;
  126    
  127  if (inputFile.size() == 1 &&
  128      inputFile.begin()->find(
getLabel(SCATTERED_LIGHT_FROM_BRIGHT_POINT)) == string::npos) {
 
  129    function = 1;
  130  }
  131    
  132  
  133  const double t0   =  0.0;                                   
  134 
  136 
  137    if (function == 1) {
  138 
  140 
  142 
  143    } else {
  144 
  146 
  148    }
  149  }
  150 
  152    
  153  for (int i = 1; i <= h0.GetNbinsX(); ++i) {
  154      
  155    const double dt = h0.GetBinCenter(i) - t0;
  156 
  158 
  159    for (
int j = 0; 
j != N; ++
j) {
 
  160      Y += pdf[
j](D, ct, dt) * E;
 
  161    }      
  162 
  163    h0.SetBinContent(i, get_value(Y));
  164  }
  165 
  166  out.Write();
  167  out.Close();
  168}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
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.