1 #ifndef DQMOffline_Trigger_VarRangeCut_h 2 #define DQMOffline_Trigger_VarRangeCut_h 27 #include <boost/algorithm/string.hpp> 29 template<
typename ObjType>
44 template<
typename ObjType>
50 for(
auto range: ranges){
51 std::vector<std::string> splitRange;
53 if(splitRange.size()!=2)
throw cms::Exception(
"ConfigError") <<
"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>
63 desc.
add<std::vector<std::string> >(
"allowedRanges",std::vector<std::string>());
67 template<
typename ObjType>
74 if(varVal>=range.first && varVal<range.second)
return true;
T getParameter(std::string const &) const
static edm::ParameterSetDescription makePSetDescription()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool operator()(const ObjType &obj) const
const std::string & varName() const
std::vector< std::pair< float, float > > allowedRanges_
std::function< float(const ObjType &)> varFunc_
VarRangeCut(const edm::ParameterSet &config)