Belle II Software  release-05-02-19
TOPSignalShape.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 <TObject.h>
14 #include <vector>
15 #include <TSpline.h>
16 
17 namespace Belle2 {
27  class TOPSignalShape: public TObject {
28  public:
29 
34  {}
35 
44  TOPSignalShape(std::vector<double> shape, double timeBin, double tau,
45  double pole1, double pole2);
46 
50  TOPSignalShape(const TOPSignalShape& shape): TObject()
51  {
52  *this = shape;
53  m_interpolator = 0;
54  }
55 
60  {
61  if (this != &shape) {
62  m_shape = shape.getShape();
63  m_tmin = shape.getTMin();
64  m_tmax = shape.getTMax();
65  m_tau = shape.getTau();
66  m_pole1 = shape.getPole1();
67  m_pole2 = shape.getPole2();
68  if (m_interpolator) delete m_interpolator;
69  m_interpolator = 0;
70  }
71  return *this;
72  }
73 
78  {
79  if (m_interpolator) delete m_interpolator;
80  }
81 
87  double getValue(double t) const;
88 
93  double getTMin() const {return m_tmin;}
94 
99  double getTMax() const {return m_tmax;}
100 
105  double getTau() const {return m_tau;}
106 
111  double getPole1() const {return m_pole1;}
112 
117  double getPole2() const {return m_pole2;}
118 
123  const std::vector<double>& getShape() const {return m_shape;}
124 
129  const TSpline5* getInterpolator() const {return m_interpolator;}
130 
131  private:
132 
133  std::vector<double> m_shape;
134  double m_tmin = 0;
135  double m_tmax = 0;
136  double m_tau = 0;
137  double m_pole1 = 0;
138  double m_pole2 = 0;
141  mutable TSpline5* m_interpolator = 0;
142 
145  };
146 
148 } // end namespace Belle2
Belle2::TOPSignalShape::operator=
TOPSignalShape & operator=(const TOPSignalShape &shape)
Assignment operator.
Definition: TOPSignalShape.h:67
Belle2::TOPSignalShape::getShape
const std::vector< double > & getShape() const
Returns waveform values.
Definition: TOPSignalShape.h:131
Belle2::TOPSignalShape::m_tmax
double m_tmax
time of the last waveform sample [ns]
Definition: TOPSignalShape.h:143
Belle2::TOPSignalShape::getTau
double getTau() const
Returns time constant of the exponential used for the extrapolation of tail.
Definition: TOPSignalShape.h:113
Belle2::TOPSignalShape::getTMin
double getTMin() const
Returns time of the first waveform sample.
Definition: TOPSignalShape.h:101
Belle2::TOPSignalShape::getPole1
double getPole1() const
Returns first pole of noise bandwidth.
Definition: TOPSignalShape.h:119
Belle2::TOPSignalShape::m_interpolator
TSpline5 * m_interpolator
cache for the interpolator
Definition: TOPSignalShape.h:149
Belle2::TOPSignalShape::TOPSignalShape
TOPSignalShape()
Default constructor.
Definition: TOPSignalShape.h:41
Belle2::TOPSignalShape::getValue
double getValue(double t) const
Returns value at time t of the normalized waveform using interpolator.
Definition: TOPSignalShape.cc:77
Belle2::TOPSignalShape
Normalized shape of single photon pulse (waveform) Pulse must be positive.
Definition: TOPSignalShape.h:35
Belle2::TOPSignalShape::ClassDef
ClassDef(TOPSignalShape, 1)
ClassDef.
Belle2::TOPSignalShape::getInterpolator
const TSpline5 * getInterpolator() const
Returns interpolator.
Definition: TOPSignalShape.h:137
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPSignalShape::m_pole1
double m_pole1
noise bandwidth: first pole [GHz]
Definition: TOPSignalShape.h:145
Belle2::TOPSignalShape::m_pole2
double m_pole2
noise bandwidth: second pole [GHz]
Definition: TOPSignalShape.h:146
Belle2::TOPSignalShape::getPole2
double getPole2() const
Returns second pole of noise bandwidth.
Definition: TOPSignalShape.h:125
Belle2::TOPSignalShape::m_shape
std::vector< double > m_shape
waveform values
Definition: TOPSignalShape.h:141
Belle2::TOPSignalShape::m_tau
double m_tau
time constant of the exponential tail [ns]
Definition: TOPSignalShape.h:144
Belle2::TOPSignalShape::~TOPSignalShape
~TOPSignalShape()
Destructor.
Definition: TOPSignalShape.h:85
Belle2::TOPSignalShape::m_tmin
double m_tmin
time of the first waveform sample [ns]
Definition: TOPSignalShape.h:142
Belle2::TOPSignalShape::getTMax
double getTMax() const
Returns time of the last waveform sample.
Definition: TOPSignalShape.h:107