31int main(
int argc, 
char **argv)
 
   45    JParser<> zap(
"Demonstration program to plot RMS of arrival time of first hit as a function of the minimal distance of approach of a muon to the PMT.");
 
   49    zap[
'E'] = 
make_field(E_GeV,     
"muon energy [GeV]");
 
   50    zap[
'R'] = 
make_field(R_Hz,      
"background rate [Hz]");
 
   51    zap[
'D'] = 
make_field(dir,       
"(theta, phi) of PMT [rad]");
 
   56  catch(
const exception &error) {
 
   57    FATAL(error.what() << endl);
 
   67  JFunction1D_t::JSupervisor supervisor(
new JFunction1D_t::JDefaultResult(zero));
 
   69  const JPDFType_t pdf_t[] = { DIRECT_LIGHT_FROM_MUON,
 
   70                               SCATTERED_LIGHT_FROM_MUON,
 
   71                               DIRECT_LIGHT_FROM_EMSHOWERS,
 
   72                               SCATTERED_LIGHT_FROM_EMSHOWERS };
 
   74  const int  N = 
sizeof(pdf_t) / 
sizeof(pdf_t[0]);
 
   78  for (
int i = 0; i != N; ++i) {
 
   82      const string file_name = getFilename(inputFile, pdf_t[i]);
 
   84      NOTICE(
"loading input from file " << file_name << 
"... " << flush);
 
   86      pdf[i].load(file_name.c_str());
 
   94    pdf[i].setExceptionHandler(supervisor);
 
  118  for (vector<double>::const_iterator i = X.begin(); i != X.end(); ++i) {
 
  122    os << 
"t[" << *i << 
"]";
 
  124    buffer.push_back(
new TH1D(os.str().c_str(), NULL, 5000, -250.0, +250.0));
 
  130    vector<double>::const_iterator j = X.begin();
 
  131    vector<double>::const_iterator i = j++;
 
  133    x.push_back(*i - 0.5*(*j-*i));
 
  135    for (; j != X.end(); ++i, ++j) 
 
  136      x.push_back(0.5*(*i+*j));
 
  141    x.push_back(*j + 0.5*(*j-*i));
 
  144  TH1D rms(
"rms", NULL, X.size(), &x[0]);
 
  147  JFunction1D_t::result_type p[4];
 
  153  const double Tmin = -250.0;     
 
  154  const double Tmax = +250.0;     
 
  158  for (
size_t i = 0; i != X.size(); ++i) {
 
  161    const double R = X[i];
 
  165    for (
int j = 1; j <= h->GetNbinsX(); ++j) {
 
  167      const double t1 = h->GetBinCenter(j);
 
  173      for (
int k = 0; k != 4; ++k) {
 
  183        R_Hz * 1e-9 * (t1   - Tmin);
 
  191        R_Hz * 1e-9 * (Tmax - Tmin);
 
  201      const double W = exp(-v) * y / (1.0 - exp(-V));
 
  207      h->SetBinContent(j,W);
 
  216      const double sig = result.getFWHM() * 0.5 / sqrt(2.0*log(2.0));
 
  220      NOTICE(
"integral " << R << 
' ' << result.getIntegral() << endl);
 
  222    catch(
const exception&) {}
 
  227    const float w = 1.0 / (float) n;
 
  229    if (
debug > notice_t) {
 
  230      timer.
print(cout, w);