12 const std::map<std::string, unsigned>& n2idx,
13 const std::vector<double>&
values,
16 : name_(name), hash_(hash), bitmap_(bitmap), mask_(mask), values_(values) {
17 for (
const auto&
val : n2idx) {
24 unsigned internal_idx = 0;
27 return names_[internal_idx];
30 throw cms::Exception(
"IndexNotFound") <<
"index = " << idx <<
" has no corresponding cut name!";
36 throw cms::Exception(
"OutOfBounds") << idx <<
" is out of bounds for this cut flow!";
43 if (found_name ==
names_.end() || *found_name !=
name) {
44 throw cms::Exception(
"UnknownName") <<
"Cut name: " << name <<
" is not known for this cutflow!";
51 throw cms::Exception(
"OutOfBounds") << idx <<
" is out of bounds for this cut flow!";
58 if (found_name ==
names_.end() || *found_name !=
name) {
59 throw cms::Exception(
"UnknownName") <<
"Cut name: " << name <<
" is not known for this cutflow!";
66 throw cms::Exception(
"OutOfBounds") << idx <<
" is out of bounds for this cut flow!";
73 if (found_name ==
names_.end() || *found_name !=
name) {
74 throw cms::Exception(
"UnknownName") <<
"Cut name: " << name <<
" is not known for this cutflow!";
81 unsigned mask =
mask_;
82 for (
const unsigned idx : idxs) {
84 throw cms::Exception(
"OutOfBounds") << idx <<
" is out of bounds for this cut flow!";
86 mask = mask | 1 << idx;
88 bitmap = bitmap | mask;
94 unsigned mask =
mask_;
97 if (found_name ==
names_.end() || *found_name !=
name) {
98 throw cms::Exception(
"UnknownName") <<
"Cut name: " <<
name <<
" is not known for this cutflow!";
102 bitmap = bitmap | mask;
108 unsigned mask =
mask_;
110 throw cms::Exception(
"OutOfBounds") << idx <<
" is out of bounds for this cut flow!";
112 mask = mask | 1 << idx;
113 bitmap = bitmap | mask;
119 unsigned mask =
mask_;
121 if (found_name ==
names_.end() || *found_name !=
name) {
122 throw cms::Exception(
"UnknownName") <<
"Cut name: " << name <<
" is not known for this cutflow!";
125 bitmap = bitmap | mask;
bool getCutResultByIndex(const unsigned idx) const
std::vector< unsigned > indices_
std::vector< std::string > names_
bool getCutResultByName(const std::string &name) const
const std::string names[nVars_]
bool isCutMasked(const unsigned idx) const
std::vector< double > values_
double getCutValue(const unsigned idx) const
bool getCutBit(const unsigned idx) const
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
const std::string & getNameAtIndex(const unsigned idx) const
CutFlowResult getCutFlowResultMasking(const unsigned idx) const
double getValueCutUpon(const unsigned idx) const
bool getMaskBit(const unsigned idx) const