7 : qNSecPerBin_(1. / kNBinsPerNSec), indexOfMax_(0), timeOfMax_(0.), shape_(
DVec(k1NSecBinsTotal, 0.0)) {}
10 std::array<float, 3> times_tmp = {{0., 0., 0.}};
18 unsigned int index_LT1 = 0;
19 unsigned int index_LT2 = 0;
24 if (amplitude > threshold1 && index_LT1 == 0)
27 if (amplitude > threshold2 && index_LT2 == 0) {
34 unsigned int index_FT1 = 0;
39 if (amplitude > threshold1 && index_FT1 == 0) {
49 shape_[index_LT1 - 1] * scale,
50 shape_[index_LT1] * scale);
54 (index_LT2 - 1) * qNSecPerBin_,
55 index_LT2 * qNSecPerBin_,
56 shape_[index_LT2 - 1] * scale,
57 shape_[index_LT2] * scale);
61 (index_FT1 - 1) * qNSecPerBin_,
62 index_FT1 * qNSecPerBin_,
63 shape_[index_FT1 - 1] * scale,
64 shape_[index_FT1] * scale);
78 for (
unsigned int i = 0;
i <
shape_.size(); ++
i) {
93 LogDebug(
"MTDShapeBase") <<
" MTD pulse shape requested for out of range time " << aTime;
105 const double&
y,
const double& x1,
const double& x2,
const double& y1,
const double& y2)
const {
107 throw cms::Exception(
"BadValue") <<
" MTDShapeBase: Trying to interpolate two points with the same x coordinate!";
109 double a = (y2 - y1) / (x2 - x1);
110 double b = y1 - a * x1;
virtual void fillShape(DVec &aVec) const =0
const double qNSecPerBin_
unsigned int timeIndex(double aTime) const
unsigned int indexOfMax() const
static constexpr unsigned int kNBinsPerNSec
static constexpr unsigned int k1NSecBinsTotal
double operator()(double aTime) const override
std::array< float, 3 > timeAtThr(const float scale, const float threshold1, const float threshold2) const
double linear_interpolation(const double &y, const double &x1, const double &x2, const double &y1, const double &y2) const
std::vector< double > DVec