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