4#include <Math/SpecFuncMathCore.h>
11double Heaviside(
const double t,
const double t0) {
14 else if (
fabs(t - t0) < Garfield::Small)
25 std::string shaperType) :
30 std::transform(shaperType.begin(), shaperType.end(),
31 shaperType.begin(), toupper);
32 if (shaperType ==
"UNIPOLAR") {
33 m_type = ShaperType::Unipolar;
35 m_prefactor = exp(m_n);
36 m_transfer_func_sq = (exp(2 * m_n) / pow(2 * m_n, 2 * m_n)) * m_tp *
37 ROOT::Math::tgamma(2 * m_n);
38 }
else if (shaperType ==
"BIPOLAR") {
39 m_type = ShaperType::Bipolar;
40 const double r = m_n - sqrt(m_n);
42 m_prefactor = exp(r) / sqrt(m_n);
43 m_transfer_func_sq = (exp(2 * r) / pow(2 * r, 2 * m_n)) * r * m_tp *
44 ROOT::Math::tgamma(2 * m_n - 1);
46 std::cerr << m_className <<
": Unknown shaper type.\n";
52 case ShaperType::Unipolar:
54 case ShaperType::Bipolar:
63 double f = m_prefactor * pow(t / m_tp, m_n) * exp(-t / m_tau) * Heaviside(t, 0.);
68 double f = m_prefactor * (m_n - t / m_tau) * pow(t / m_tp, m_n - 1) * exp(-t / m_tau) * Heaviside(t, 0.);
double BipolarShaper(const double t) const
Transfer function for a bipolar shaper.
Shaper()=delete
Default constructor.
double Shape(const double t) const
Evaluate the transfer function.
double UnipolarShaper(const double t) const
Transfer function for a unipolar shaper.
DoubleAc fabs(const DoubleAc &f)