Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Shaper.hh
Go to the documentation of this file.
1#ifndef G_SHAPER_H
2#define G_SHAPER_H
3
4#include <string>
5#include <cmath>
6
7namespace Garfield {
8
9/// Class for signal processing
10
11class Shaper {
12 public:
13 /// Default constructor.
14 Shaper() = delete;
15 /// Constructor.
16 Shaper(const unsigned int n, const double tau, const double g,
17 std::string shaperType);
18 /// Destructor.
20
21 /// Evaluate the transfer function.
22 double Shape(const double t) const;
23 /// Transfer function for a unipolar shaper.
24 double UnipolarShaper(const double t) const;
25 /// Transfer function for a bipolar shaper.
26 double BipolarShaper(const double t) const;
27 /// Time for the transfer function to rise from zero to peak height.
28 double PeakingTime() const { return m_tp; }
29
30 /// Return the integral of the transfer function squared.
31 double TransferFuncSq() const { return m_transfer_func_sq; }
32
33 /// Is it a unipolar shaper?
34 bool IsUnipolar() const { return (m_type == ShaperType::Unipolar); }
35 /// Is it a bipolar shaper?
36 bool IsBipolar() const { return (m_type == ShaperType::Bipolar); }
37 /// Retrieve the parameters.
38 void GetParameters(unsigned int& n, double& tp) {
39 n = m_n;
40 tp = m_tp;
41 }
42
43 private:
44 std::string m_className = "Shaper";
45
46 // Shaper type.
47 enum class ShaperType { Unipolar = 0, Bipolar };
48 ShaperType m_type = ShaperType::Unipolar;
49 // Order of the shaper.
50 unsigned int m_n = 1;
51 // Time constant.
52 double m_tau = 1.;
53 // Peaking time.
54 double m_tp = 1.;
55 // Normalization factor.
56 double m_prefactor = 1.;
57 // Gain.
58 double m_g = 1.;
59 // Integral of the transfer function squared.
60 double m_transfer_func_sq = -1.;
61};
62}
63
64#endif
bool IsUnipolar() const
Is it a unipolar shaper?
Definition Shaper.hh:34
double BipolarShaper(const double t) const
Transfer function for a bipolar shaper.
Definition Shaper.cc:67
Shaper()=delete
Default constructor.
double PeakingTime() const
Time for the transfer function to rise from zero to peak height.
Definition Shaper.hh:28
double TransferFuncSq() const
Return the integral of the transfer function squared.
Definition Shaper.hh:31
void GetParameters(unsigned int &n, double &tp)
Retrieve the parameters.
Definition Shaper.hh:38
~Shaper()
Destructor.
Definition Shaper.hh:19
double Shape(const double t) const
Evaluate the transfer function.
Definition Shaper.cc:50
bool IsBipolar() const
Is it a bipolar shaper?
Definition Shaper.hh:36
double UnipolarShaper(const double t) const
Transfer function for a unipolar shaper.
Definition Shaper.cc:62