5 return std::vector<float>(vd.begin(), vd.end());
9 : etas_(getVFloat(cpset,
"etaBins")), offsets_(getVFloat(cpset,
"offset")), scales_(getVFloat(cpset,
"scale")) {
10 if (cpset.
existsAs<std::vector<double>>(
"ptMin")) {
16 if (cpset.
existsAs<std::vector<double>>(
"ptMax")) {
25 else if (skind ==
"calo")
28 throw cms::Exception(
"Configuration",
"Bad kind of resolution: " + skind);
32 for (
unsigned int i = 0,
n = etas_.size();
i <
n; ++
i) {
35 if (abseta < etas_[i]) {
38 return pt * std::min<float>(1.f, std::hypot(pt * scales_[i] * 0.001, offsets_[i]));
40 return std::min<float>(
pt, pt * scales_[
i] + offsets_[
i]);
42 return pt * std::min<float>(1, scales_[
i] + offsets_[
i] / ptMins_[
i]);
43 return std::min<float>(
pt, pt * scales_[
i] + offsets_[
i]);
47 return std::min<float>(
pt, 0.3 * pt + 7);
std::vector< float > ptMins_
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
std::vector< DeviationSensor2D * > vd
std::vector< float > ptMaxs_
T getParameter(std::string const &) const
static std::vector< float > getVFloat(const edm::ParameterSet &cpset, const std::string &name)
float operator()(const float pt, const float abseta) const
std::vector< float > etas_