27int main(
int argc, 
char **argv)
 
   42    JParser<> zap(
"Example program to histogram time over threshold distributions.");
 
   54  catch(
const exception &error) {
 
   55    FATAL(error.what() << endl);
 
   71  const double dx   =   1.0;
 
   72  const double xmin =   0.0 - 0.5 * dx;
 
   73  const double xmax = round(parameters.
saturation) - 0.5*dx;
 
   74  const int    nx   = (int) ((xmax - xmin) / dx);
 
   76  TH1D h0(
"h0", NULL, nx, xmin, xmax);
 
   77  TH1D h1(
"h1", NULL, nx, xmin, xmax);
 
   78  TH1D h2(
"h2", NULL, nx, xmin, xmax);
 
   79  TH1D h3(
"h3", NULL, 500, 0.0, 100.0);
 
   84  DEBUG(
"    ToT      Probability " << endl);
 
   86  for (
int i = 1; i <= h0.GetNbinsX(); ++i) {
 
   88    const double x        = h0.GetBinCenter(i);
 
   92          << 
FIXED(7,3) << x        << 
"   " 
   93          << 
FIXED(7,5) << y << endl);
 
   95    h0.SetBinContent(i, y);
 
   99  if (numberOfHits > 0) {
 
  101    int number_of_hits = 0;
 
  103    for (
int i = 0; i != numberOfHits; ++i) {
 
  124    h1.Scale(1.0 / (
double) number_of_hits / dx);
 
  128  if (numberOfHits > 0) {
 
  130    int number_of_hits = 0;
 
  132    const double t_ns = 25.0;
 
  134    for (
int i = 0; i != numberOfHits; ++i) {
 
  147        h2.Fill(hit->tot_ns);
 
  152    h2.Scale(1.0 / (
double) number_of_hits / dx);
 
  160  for (
int i = 1; i <= h0.GetNbinsX(); ++i) {
 
  162    const Double_t x  = h0.GetBinCenter (i);
 
  163    const Double_t y0 = h0.GetBinContent(i);
 
  164    const Double_t y1 = h1.GetBinContent(i);
 
  165    const Double_t y2 = h2.GetBinContent(i);
 
  167    DEBUG(
"[" << setw(3) << i << 
"]"  << 
' '  
  168          << 
FIXED(5,1) << x  << 
' ' 
  169          << 
FIXED(6,4) << y0 << 
' ' 
  170          << 
FIXED(6,4) << y1 << 
' ' 
  171          << 
FIXED(6,4) << y2 << endl);
 
  173    ASSERT(fabs(y0 - y1) < precision);
 
  174    ASSERT(fabs(y0 - y2) < precision);
 
 
General purpose messaging.
 
#define DEBUG(A)
Message macros.
 
#define ASSERT(A,...)
Assert macro.
 
PMT analogue signal processor.
 
Utility class to parse command line options.
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
I/O formatting auxiliaries.
 
int main(int argc, char **argv)
 
Data structure for time calibration.
 
Template data structure for PMT I/O.
 
std::vector< JElement_t >::const_iterator const_iterator
 
virtual void processHits(const JPMTIdentifier &id, const JCalibration &calibration, const JStatus &status, const JPMTData< JPMTSignal > &input, JPMTData< JPMTPulse > &output) const override
Process hits.
 
Auxiliary class for map of PMT parameters.
 
const JPMTParameters & getPMTParameters(const JPMTIdentifier &id) const
Get PMT parameters.
 
Data structure for PMT parameters.
 
double saturation
saturation [ns]
 
Exception for accessing a value in a collection that is outside of its range.
 
Utility class to parse command line options.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
Auxiliary data structure for floating point format specification.
 
PMT analogue signal processor.
 
double getTimeOverThresholdProbability(const double tot_ns, const int NPE) const
Get probability of having a pulse with specific time-over-threshold.
 
virtual double getRandomCharge(const int NPE) const override
Get randomised charge according to gain and gain spread.
 
virtual double getTimeOverThreshold(const double npe) const override
Get time-over-threshold (ToT).
 
Data structure for PMT analogue signal.
 
Auxiliary class for handling status.
 
Empty structure for specification of parser element that is initialised (i.e. does not require input)...