1 #ifndef DQMOffline_Trigger_VarRangeCut_h 2 #define DQMOffline_Trigger_VarRangeCut_h 26 #include <boost/algorithm/string.hpp> 28 template <
typename ObjType>
43 template <
typename ObjType>
48 for (
auto range : ranges) {
49 std::vector<std::string> splitRange;
51 if (splitRange.size() != 2)
53 <<
"in VarRangeCut::VarRangeCut range " <<
range <<
" is not of format X:Y" << std::endl;
54 allowedRanges_.push_back({std::stof(splitRange[0]), std::stof(splitRange[1])});
58 template <
typename ObjType>
62 desc.
add<std::vector<std::string> >(
"allowedRanges", std::vector<std::string>());
66 template <
typename ObjType>
73 if (varVal >=
range.first && varVal <
range.second)
std::vector< std::string_view > split(std::string_view, const char *)
T getParameter(std::string const &) const
std::vector< std::pair< float, float > > allowedRanges_
static edm::ParameterSetDescription makePSetDescription()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool operator()(const ObjType &obj) const
const std::string & varName() const
std::function< float(const ObjType &)> varFunc_
VarRangeCut(const edm::ParameterSet &config)