Belle II Software  release-06-00-14
TOPSignalShape.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <TObject.h>
12 #include <vector>
13 #include <TSpline.h>
14 
15 namespace Belle2 {
25  class TOPSignalShape: public TObject {
26  public:
27 
32  {}
33 
42  TOPSignalShape(std::vector<double> shape, double timeBin, double tau,
43  double pole1, double pole2);
44 
48  TOPSignalShape(const TOPSignalShape& shape): TObject()
49  {
50  *this = shape;
51  m_interpolator = 0;
52  }
53 
58  {
59  if (this != &shape) {
60  m_shape = shape.getShape();
61  m_tmin = shape.getTMin();
62  m_tmax = shape.getTMax();
63  m_tau = shape.getTau();
64  m_pole1 = shape.getPole1();
65  m_pole2 = shape.getPole2();
66  if (m_interpolator) delete m_interpolator;
67  m_interpolator = 0;
68  }
69  return *this;
70  }
71 
76  {
77  if (m_interpolator) delete m_interpolator;
78  }
79 
85  double getValue(double t) const;
86 
91  double getTMin() const {return m_tmin;}
92 
97  double getTMax() const {return m_tmax;}
98 
103  double getTau() const {return m_tau;}
104 
109  double getPole1() const {return m_pole1;}
110 
115  double getPole2() const {return m_pole2;}
116 
121  const std::vector<double>& getShape() const {return m_shape;}
122 
127  const TSpline5* getInterpolator() const {return m_interpolator;}
128 
129  private:
130 
131  std::vector<double> m_shape;
132  double m_tmin = 0;
133  double m_tmax = 0;
134  double m_tau = 0;
135  double m_pole1 = 0;
136  double m_pole2 = 0;
139  mutable TSpline5* m_interpolator = 0;
140 
143  };
144 
146 } // end namespace Belle2
Normalized shape of single photon pulse (waveform) Pulse must be positive.
const TSpline5 * getInterpolator() const
Returns interpolator.
double getTMin() const
Returns time of the first waveform sample.
double getTau() const
Returns time constant of the exponential used for the extrapolation of tail.
double getTMax() const
Returns time of the last waveform sample.
const std::vector< double > & getShape() const
Returns waveform values.
ClassDef(TOPSignalShape, 1)
ClassDef.
std::vector< double > m_shape
waveform values
TOPSignalShape(const TOPSignalShape &shape)
Copy constructor.
double m_pole2
noise bandwidth: second pole [GHz]
TSpline5 * m_interpolator
cache for the interpolator
double m_tau
time constant of the exponential tail [ns]
double m_tmin
time of the first waveform sample [ns]
double m_tmax
time of the last waveform sample [ns]
TOPSignalShape & operator=(const TOPSignalShape &shape)
Assignment operator.
double getPole2() const
Returns second pole of noise bandwidth.
double m_pole1
noise bandwidth: first pole [GHz]
double getPole1() const
Returns first pole of noise bandwidth.
TOPSignalShape()
Default constructor.
~TOPSignalShape()
Destructor.
double getValue(double t) const
Returns value at time t of the normalized waveform using interpolator.
Abstract base class for different kinds of events.