6#include "TrigScint/QIEInputPulse.h"
14 toff_.push_back(toff);
15 ampl_.push_back(ampl);
19 if (
ampl_.size() == 0)
return 0;
21 for (
int i = 0; i <
ampl_.size(); i++) {
38 if (T <
toff_[
id])
return 0;
42 float y1 = 1 / (1 + exp((
toff_[
id] - T) /
rt_));
43 float y2 = 1 / (1 + exp((
toff_[
id] - T) /
ft_));
44 return ((y1 - y2) / nc);
49 for (
int id = 0;
id <
ampl_.size();
id++) {
58 if (T <=
toff_[
id])
return 0;
62 float t = T -
toff_[id];
74 float mx = (a + b) / 2;
90 float T_ = T -
toff_[id];
91 float E1 = exp(-T_ /
rt_);
92 float E2 = exp(-T_ /
ft_);
94 float v1 = E1 / (
rt_ * pow(1 + E1, 2));
95 float v2 = E2 / (
ft_ * pow(1 + E2, 2));
97 return ((v1 - v2) / nc);
125 if (
id >=
ampl_.size())
return 0;
126 if (t_ <=
toff_[
id])
return 0;
127 if (
ampl_[
id] == 0)
return 0;
132 float T = t_ -
toff_[id];
134 return (nc * (1 - exp(-
k_ * T)));
144 return nc * (1 - exp(-
k_ *
tmax_));
149 for (
int id = 0;
id <
ampl_.size();
id++) {
158 if (
id >=
ampl_.size())
return 0;
159 if (T <=
toff_[
id])
return 0;
161 float t = T -
toff_[id];
165 if (t <=
tmax_)
return (nc *
k_ * exp(-
k_ * t));
170 if (T <=
toff_[
id])
return 0;
171 float t = T -
toff_[id];
174 if (t <
tmax_)
return (nc * (
k_ * t + exp(-
k_ * t) - 1) /
k_);
float EvalSingle(float T, int id) override
Evaluate the pulse at time T.
float Max(int id) override
maximum of the pulse
Bimoid(float start, float qq)
Constructor.
float Integrate(float T1, float T2) override
Integrate the pulse from T1 to T2.
float Derivative(float T, int id) override
Differentiate pulse at time T.
float I_Int(float T, int id)
Indefinite integral at time T.
float Max(int id) override
maximum of the pulse
float k_
1/RC time constant (for the capacitor)
float I_Int(float T, int id)
Indefinite integral at time T.
float Integrate(float T1, float T2) override
Integrate the pulse from T1 to T2.
Expo()
The default constructor.
float Derivative(float T, int id) override
Differentiate pulse at time T.
void SetRiseFall(float rr, float ff)
Set Rise and Fall time of the pulse.
float tmax_
time when pulse attains maximum
float EvalSingle(float T, int id) override
Evaluate the pulse at time T.