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>
46 varFunc_ = hltdqm::getUnaryFuncFloat<ObjType>(varName_);
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>
71 float varVal = varFunc_(obj);
72 for (
auto&
range : allowedRanges_) {
73 if (varVal >=
range.first && varVal <
range.second)
std::vector< std::pair< float, float > > allowedRanges_
static edm::ParameterSetDescription makePSetDescription()
const uint16_t range(const Frame &aFrame)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T getParameter(std::string const &) const
bool operator()(const ObjType &obj) const
tuple config
parse the configuration file
const std::string & varName() const
std::function< float(const ObjType &)> varFunc_
VarRangeCut(const edm::ParameterSet &config)