LDMX Software
QIEInputPulse.h
1
2#ifndef TRIGSCINT_QIEINPUTPULSE_H
3#define TRIGSCINT_QIEINPUTPULSE_H
4
5//---< C++ >---//
6#include <vector>
7
8namespace trigscint {
9
18 public:
22 virtual ~QIEInputPulse() = default;
26 float Eval(float T);
27
31 virtual float EvalSingle(float T, int id) = 0;
32
36 virtual float Integrate(float T1, float T2) = 0;
37
41 virtual float Derivative(float T, int id) = 0;
42
46 virtual float Max(int id) = 0;
47
53 void AddPulse(float toff, float ampl);
54
58 int GetNPulses() { return ampl_.size(); }
59
60 protected:
62 std::vector<float> toff_;
63
65 std::vector<float> ampl_;
66};
67
74class Bimoid : public QIEInputPulse {
75 public:
77 Bimoid(float start, float qq);
78
80 virtual ~Bimoid() = default;
81
85 float EvalSingle(float T, int id) override;
86
90 float I_Int(float T, int id);
91
95 float Integrate(float T1, float T2) override;
96
100 float Max(int id) override;
101
105 float Derivative(float T, int id) override;
106
107 private:
109 float rt_;
111 float ft_;
112};
113
122class Expo : public QIEInputPulse {
123 public:
127 Expo();
128
134 Expo(float k, float tmax);
135
139 virtual ~Expo() = default;
143 float GetRise() { return rt_; }
144
148 float GetFall() { return ft_; }
149
155 void SetRiseFall(float rr, float ff);
156
160 float EvalSingle(float T, int id) override;
161
165 float Integrate(float T1, float T2) override;
166
170 float Max(int id) override;
171
175 float Derivative(float T, int id) override;
176
177 private:
179 float k_;
181 float tmax_;
183 float rt_{-1};
185 float ft_{-1};
186
190 float I_Int(float T, int id);
191};
192
193} // namespace trigscint
194#endif
Pulse made out of difference of two sigmoids.
float EvalSingle(float T, int id) override
Evaluate the pulse at time T.
float Max(int id) override
maximum of the pulse
virtual ~Bimoid()=default
Default Destructor.
float Integrate(float T1, float T2) override
Integrate the pulse from T1 to T2.
float ft_
fall time
float Derivative(float T, int id) override
Differentiate pulse at time T.
float rt_
rise time
float I_Int(float T, int id)
Indefinite integral at time T.
piece-wise exponential pulse, modelled as an output of a capacitor
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 ft_
Fall Time.
float Integrate(float T1, float T2) override
Integrate the pulse from T1 to T2.
Expo()
The default constructor.
float GetFall()
Get Fall time of the pulse.
float Derivative(float T, int id) override
Differentiate pulse at time T.
virtual ~Expo()=default
main constructor
void SetRiseFall(float rr, float ff)
Set Rise and Fall time of the pulse.
float GetRise()
Get Rise time of the pulse.
float rt_
Rise Time.
float tmax_
time when pulse attains maximum
float EvalSingle(float T, int id) override
Evaluate the pulse at time T.
The base class to store the most important functions.
float Eval(float T)
Evaluate the pulse train at time T.
std::vector< float > ampl_
collection of pulse amplitudes
std::vector< float > toff_
collection of pulse time offsets
virtual float Integrate(float T1, float T2)=0
Integrate the pulse from T1 to T2.
virtual float Derivative(float T, int id)=0
Differentiate pulse at time T.
virtual float EvalSingle(float T, int id)=0
Evaluate the pulse train at time T.
virtual float Max(int id)=0
maximum of the pulse
int GetNPulses()
Get the number of pulses in the collection.
void AddPulse(float toff, float ampl)
To add a pulse to the collection.
virtual ~QIEInputPulse()=default
Destructor.