1#ifndef RECON_EVENT_COMPOSITEPULSE_H_
2#define RECON_EVENT_COMPOSITEPULSE_H_
46 void addOrMerge(
const std::pair<double, double>& hit,
double hit_merge_ns);
60 double findCrossing(
double low,
double high,
double level,
86 double at(
double time)
const {
88 for (
auto hit :
hits_)
89 signal += hit.first *
pulse_func_.Eval(time - hit.second);
94 const std::vector<std::pair<double, double>>&
hits()
const {
return hits_; }
102 std::vector<std::pair<double, double>>
hits_;
const std::vector< std::pair< double, double > > & hits() const
Get list of individual pulses that are entering the chip.
std::vector< std::pair< double, double > > hits_
pulses entering the chip
double operator()(double time) const
Evaluating this object as a function gives the same result as at.
double gain_
gain for current chip we are emulating
CompositePulse(TF1 func, const double &gain, const double &pedestal)
Constructore.
void setGainPedestal(double gain, double pedestal)
Configure the pulses for the current chip.
TF1 pulse_func_
reference to pulse shape function shared by all pulses
double pedestal_
pedestal for current chip we are emulating
double at(double time) const
Measure the voltage at the input time.
void addOrMerge(const std::pair< double, double > &hit, double hit_merge_ns)
Put another hit into this composite pulse.
double findCrossing(double low, double high, double level, double prec=0.01)
Find the time at which we cross the input level.