7 const std::vector<PiecewiseScalingPolynomial>& a1vec,
8 const std::vector<PiecewiseScalingPolynomial>& a2vec,
9 const std::vector<uint32_t>& iEtaLimits,
10 const std::vector<std::pair<double,double> >&
cut,
11 const double minCharge,
12 const unsigned firstTimeSlice,
13 const unsigned lastTimeSlice)
16 iEtaLimits_(iEtaLimits),
18 minCharge_(minCharge),
19 tFirst_(firstTimeSlice),
23 "Invalid HBHENegativeEFilter constructor arguments");
32 if (nLimits >= static_cast<std::size_t>(UINT_MAX - 1
U))
34 for (std::size_t
i=1;
i<nLimits; ++
i)
38 if (
a1v_.size() != nLimits + 1)
40 if (
a2v_.size() != nLimits + 1)
43 const std::size_t sz =
cut_.size();
44 if (sz >= static_cast<std::size_t>(UINT_MAX - 1
U))
46 for (std::size_t i=1; i<sz; ++
i)
78 const uint32_t uEta =
std::abs(
id.ieta());
80 for (; which<nLimits; ++
which)
81 if (uEta < limits[which])
88 const double* ts,
const unsigned lenTS)
const 91 const unsigned sz =
cut_.size();
94 double chargeInWindow = 0.0;
96 chargeInWindow += ts[
i];
100 const std::pair<double,double>*
cut = &
cut_[0];
101 double cutValue = cut[0].second;
105 unsigned largerPoint = 0;
106 for (; cut[largerPoint].first <= chargeInWindow; ++largerPoint) {}
109 if (largerPoint >= sz)
110 cutValue = cut[sz - 1
U].second;
111 else if (largerPoint)
113 const double slope = (cut[largerPoint].second - cut[largerPoint-1
U].second)/
114 (cut[largerPoint].
first - cut[largerPoint-1
U].
first);
115 cutValue = cut[largerPoint-1
U].second + slope*
116 (chargeInWindow - cut[largerPoint-1
U].first);
127 const double ecorr = ts[
i] - a1(ts[
i-1
U]) - a2(ts[
i-2
U]);
128 passes = ecorr >= cutValue;
std::vector< PiecewiseScalingPolynomial > a1v_
unsigned getEtaIndex(const HcalDetId &id) const
std::vector< PiecewiseScalingPolynomial > a2v_
static const double slope[3]
std::vector< std::pair< double, double > > cut_
std::vector< uint32_t > iEtaLimits_
bool checkPassFilter(const HcalDetId &id, const double *ts, unsigned lenTS) const
bool operator==(const HBHENegativeEFilter &r) const
Abs< T >::type abs(const T &t)