31   JPMTParameters parameters;
 
   39     JProperties properties = parameters.getProperties();
 
   41     JParser<> zap(
"Example program to histogram time over threshold distributions.");
 
   52   catch(
const exception &error) {
 
   53     FATAL(error.what() << endl);
 
   58     cout << 
"PMT parameters:" << endl;
 
   62   const JPMTAnalogueSignalProcessor cpu(parameters);
 
   64   const JPMTIdentifier pmt(1,0);
 
   65   const JCalibration   calibration;
 
   67   const JPMTDefaultSimulator simulator(parameters, pmt);
 
   69   JPMTData<JPMTSignal> input;
 
   70   JPMTData<JPMTPulse>  output;
 
   77   const double xmin =  -0.5;
 
   78   const double xmax = 255.5;
 
   79   const double dx   =   1.0;
 
   80   const int    nx   = (int) ((xmax - xmin) / dx);
 
   82   TH1D h0(
"h0", NULL, nx, xmin, xmax);
 
   83   TH1D h1(
"h1", NULL, nx, xmin, xmax);
 
   84   TH1D h2(
"h2", NULL, nx, xmin, xmax);
 
   89   DEBUG(
"    ToT      npe   dP/dnpe dP/dToT" << endl);
 
   91   for (
int i = 1; i <= h0.GetNbinsX(); ++i) {
 
   93     const double x   = h0.GetBinCenter(i);
 
   94     const double npe = cpu.getNPE(x);
 
   95     const double y   = cpu.getProbability(npe, NPE);
 
   96     const double v   = cpu.getDerivative(npe);
 
   99           << 
FIXED(5,1) << x   << 
"   " 
  100           << 
FIXED(7,3) << npe << 
"   " 
  101           << 
FIXED(5,3) << y   << 
"   " 
  102           << 
FIXED(6,4) << y*v << endl);
 
  104     h0.SetBinContent(i, y*v);
 
  108   if (numberOfHits > 0) {
 
  110     for (
int i = 0; i != numberOfHits; ++i) {
 
  112       const double npe = cpu.getRandomAmplitude(NPE);
 
  114       if (cpu.applyThreshold(npe)) {
 
  116         const double tot_ns = cpu.getTimeOverThreshold(npe);
 
  122     h1.Scale(1.0 / (
double) numberOfHits / dx);
 
  126   if (numberOfHits > 0) {
 
  128     const double t_ns = 25.0;
 
  130     for (
int i = 0; i != numberOfHits; ++i) {
 
  135       input.push_back(JPMTSignal(t_ns, NPE));
 
  137       simulator.processHits(pmt, calibration, input, output);
 
  139       for (JPMTData<JPMTPulse>::const_iterator hit = output.begin(); hit != output.end(); ++hit) {
 
  140         h2.Fill(hit->tot_ns);
 
  144     h2.Scale(1.0 / (
double) numberOfHits / dx);
 
  147   for (
int i = 1; i <= h0.GetNbinsX(); ++i) {
 
  149     const Double_t x  = h0.GetBinCenter (i);
 
  150     const Double_t y0 = h0.GetBinContent(i);
 
  151     const Double_t y1 = h1.GetBinContent(i);
 
  152     const Double_t y2 = h2.GetBinContent(i);
 
  154     DEBUG(
"[" << setw(3) << i << 
"]"  << 
' '  
  155           << 
FIXED(5,1) << x  << 
' ' 
  156           << 
FIXED(6,4) << y0 << 
' ' 
  157           << 
FIXED(6,4) << y1 << 
' ' 
  158           << 
FIXED(6,4) << y2 << endl);
 
  160     ASSERT(fabs(y0 - y1) < precision);
 
  161     ASSERT(fabs(y0 - y2) < precision);
 
Utility class to parse command line options. 
 
Utility class to parse parameter values. 
 
Simple data structure to support I/O of equations (see class JLANG::JEquation). 
 
Empty structure for specification of parser element that is initialised (i.e. 
 
Auxiliary data structure for floating point format specification. 
 
#define ASSERT(A)
Assert macro. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
#define DEBUG(A)
Message macros.