6#include "TrigScint/QIEInputPulse.h"
13 toff_.push_back(toff);
14 ampl_.push_back(ampl);
18 if (
ampl_.size() == 0)
return 0;
20 for (
int i = 0; i <
ampl_.size(); i++) {
37 if (T <
toff_[
id])
return 0;
41 float y1 = 1 / (1 + exp((
toff_[
id] - T) /
rt_));
42 float y2 = 1 / (1 + exp((
toff_[
id] - T) /
ft_));
43 return ((y1 - y2) / nc);
48 for (
int id = 0;
id <
ampl_.size();
id++) {
57 if (T <=
toff_[
id])
return 0;
61 float t = T -
toff_[id];
73 float mx = (a + b) / 2;
89 float t = T -
toff_[id];
90 float e1 = exp(-t /
rt_);
91 float e2 = exp(-t /
ft_);
93 float v1 = e1 / (
rt_ * pow(1 + e1, 2));
94 float v2 = e2 / (
ft_ * pow(1 + e2, 2));
96 return ((v1 - v2) / nc);
124 if (
id >=
ampl_.size())
return 0;
125 if (t_ <=
toff_[
id])
return 0;
126 if (
ampl_[
id] == 0)
return 0;
131 float t = t_ -
toff_[id];
133 return (nc * (1 - exp(-
k_ * t)));
143 return nc * (1 - exp(-
k_ *
tmax_));
148 for (
int id = 0;
id <
ampl_.size();
id++) {
157 if (
id >=
ampl_.size())
return 0;
158 if (T <=
toff_[
id])
return 0;
160 float t = T -
toff_[id];
164 if (t <=
tmax_)
return (nc *
k_ * exp(-
k_ * t));
169 if (T <=
toff_[
id])
return 0;
170 float t = T -
toff_[id];
173 if (t <
tmax_)
return (nc * (
k_ * t + exp(-
k_ * t) - 1) /
k_);
float iInt(float T, int id)
Indefinite integral 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 evalSingle(float T, int id) override
Evaluate the pulse at time T.
float derivative(float T, int id) override
Differentiate pulse at time T.
float evalSingle(float T, int id) override
Evaluate the pulse at time T.
float iInt(float T, int id)
Indefinite integral at time T.
float k_
1/RC time constant (for the capacitor)
float derivative(float T, int id) override
Differentiate pulse at time T.
Expo()
The default constructor.
float max(int id) override
maximum of the pulse
float integrate(float T1, float T2) override
Integrate the pulse from T1 to T2.
float tmax_
time when pulse attains maximum
void setRiseFall(float rr, float ff)
Set Rise and Fall time of the pulse.