Belle II Software  release-05-02-19
PulseHeightGenerator.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <math.h>
14 
15 namespace Belle2 {
20  namespace TOP {
21 
27  class PulseHeightGenerator {
28 
29  public:
30 
35  {}
36 
44  PulseHeightGenerator(double x0, double p1, double p2, double xmax);
45 
51  double getValue(double x) const
52  {
53  x /= m_x0;
54  return pow(x, m_p1) * exp(-pow(x, m_p2));
55  }
56 
61  double generate() const;
62 
63  private:
64 
65  double m_x0 = 0;
66  double m_p1 = 0;
67  double m_p2 = 0;
68  double m_xmax = 0;
69  double m_vPeak = 0;
71  };
72 
73 
74  } // TOP
76 } // Belle2
Belle2::TOP::PulseHeightGenerator::PulseHeightGenerator
PulseHeightGenerator()
Default constructor.
Definition: PulseHeightGenerator.h:42
Belle2::TOP::PulseHeightGenerator::m_vPeak
double m_vPeak
peak value
Definition: PulseHeightGenerator.h:77
Belle2::TOP::PulseHeightGenerator::m_xmax
double m_xmax
upper bound of range [ADC counts]
Definition: PulseHeightGenerator.h:76
Belle2::TOP::PulseHeightGenerator::m_p1
double m_p1
distribution parameter, must be non-negative
Definition: PulseHeightGenerator.h:74
Belle2::TOP::PulseHeightGenerator::generate
double generate() const
Returns generated pulse height.
Definition: PulseHeightGenerator.cc:45
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOP::PulseHeightGenerator::getValue
double getValue(double x) const
Returns distribution value at x.
Definition: PulseHeightGenerator.h:59
Belle2::TOP::PulseHeightGenerator::m_x0
double m_x0
distribution parameter [ADC counts]
Definition: PulseHeightGenerator.h:73
Belle2::TOP::PulseHeightGenerator::m_p2
double m_p2
distribution parameter
Definition: PulseHeightGenerator.h:75