CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Attributes
Selector< T > Class Template Referenceabstract

Functor that operates on <T> More...

#include "CommonTools/Utils/interface/Selector.h"

Inheritance diagram for Selector< T >:

Public Types

typedef std::binary_function
< T, pat::strbitset, bool > 
base_type
 
typedef std::pair< index_type,
size_t > 
cut_flow_item
 
typedef std::vector
< cut_flow_item
cut_flow_map
 
typedef T data_type
 
typedef std::map< index_type,
double > 
double_map
 
typedef pat::strbitset::index_type index_type
 
typedef std::map< index_type, int > int_map
 

Public Member Functions

void clear (std::string const &s)
 Turn off a given selection cut. More...
 
void clear (index_type const &i)
 
bool considerCut (std::string const &s) const
 consider the cut at index "s" More...
 
bool considerCut (index_type const &i) const
 
int cut (index_type const &i, int val) const
 Access the int cut values at index "s". More...
 
double cut (index_type const &i, double val) const
 Access the double cut values at index "s". More...
 
int cut (std::string s, int val) const
 Access the int cut values at index "s". More...
 
double cut (std::string s, double val) const
 Access the double cut values at index "s". More...
 
pat::strbitset getBitTemplate () const
 Get an empty bitset with the proper names. More...
 
double getPasses (std::string const &s) const
 Return the number of passing cases. More...
 
double getPasses (index_type const &i) const
 
bool ignoreCut (std::string const &s) const
 ignore the cut at index "s" More...
 
bool ignoreCut (index_type const &i) const
 
virtual bool operator() (T const &t, pat::strbitset &ret)=0
 This provides the interface for base classes to select objects. More...
 
virtual bool operator() (T const &t)
 This provides an alternative signature without the second ret. More...
 
virtual bool operator() (T const &t, edm::EventBase const &e, pat::strbitset &ret)
 This provides an alternative signature that includes extra information. More...
 
virtual bool operator() (T const &t, edm::EventBase const &e)
 This provides an alternative signature that includes extra information. More...
 
bool operator[] (std::string const &s) const
 
bool operator[] (index_type const &i) const
 
void passCut (pat::strbitset &ret, std::string const &s)
 Passing cuts. More...
 
void passCut (pat::strbitset &ret, index_type const &i)
 
void print (std::ostream &out) const
 Print the cut flow. More...
 
void printActiveCuts (std::ostream &out) const
 Print the cuts being considered. More...
 
virtual void push_back (std::string const &s)
 This is the registration of an individual cut string. More...
 
virtual void push_back (std::string const &s, int cut)
 This is the registration of an individual cut string, with an int cut value. More...
 
virtual void push_back (std::string const &s, double cut)
 This is the registration of an individual cut string, with a double cut value. More...
 
 Selector ()
 Constructor clears the bits. More...
 
void set (std::string const &s, bool val=true)
 Set a given selection cut, on or off. More...
 
void set (index_type const &i, bool val=true)
 
void set (std::string const &s, int cut, bool val=true)
 Set a given selection cut, on or off, and reset int cut value. More...
 
void set (index_type const &i, int cut, bool val=true)
 
void set (std::string const &s, double cut, bool val=true)
 Set a given selection cut, on or off, and reset int cut value. More...
 
void set (index_type const &i, double cut, bool val=true)
 
void setIgnored (pat::strbitset &ret)
 set ignored bits More...
 
void setIgnoredCuts (std::vector< std::string > const &bitsToIgnore)
 set the bits to ignore from a vector More...
 
virtual ~Selector ()
 

Protected Attributes

pat::strbitset bits_
 the bitset indexed by strings More...
 
cut_flow_map cutFlow_
 map of cut flows in "human" order More...
 
double_map doubleCuts_
 the double-value cut map More...
 
int_map intCuts_
 the int-value cut map More...
 
pat::strbitset retInternal_
 internal ret if users don't care about return bits More...
 

Detailed Description

template<class T>
class Selector< T >

Functor that operates on <T>

Implements a string-indexed bit_vector.

class template that implements an interface to Selector utilities. This allows the user to access individual cuts based on a string index. The user can then turn individual cuts on and off at will.

Author
Salvatore Rappoccio

Definition at line 24 of file Selector.h.

Member Typedef Documentation

template<class T>
typedef std::binary_function<T,pat::strbitset,bool> Selector< T >::base_type

Definition at line 28 of file Selector.h.

template<class T>
typedef std::pair<index_type, size_t> Selector< T >::cut_flow_item

Definition at line 30 of file Selector.h.

template<class T>
typedef std::vector<cut_flow_item> Selector< T >::cut_flow_map

Definition at line 31 of file Selector.h.

template<class T>
typedef T Selector< T >::data_type

Definition at line 27 of file Selector.h.

template<class T>
typedef std::map<index_type, double> Selector< T >::double_map

Definition at line 33 of file Selector.h.

template<class T>
typedef pat::strbitset::index_type Selector< T >::index_type

Definition at line 29 of file Selector.h.

template<class T>
typedef std::map<index_type, int> Selector< T >::int_map

Definition at line 32 of file Selector.h.

Constructor & Destructor Documentation

template<class T>
Selector< T >::Selector ( )
inline

Constructor clears the bits.

Definition at line 36 of file Selector.h.

36  {
37  bits_.clear();
38  intCuts_.clear();
39  doubleCuts_.clear();
40  cutFlow_.clear();
42  }
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:287
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:290
void clear()
clear the bitset and map
Definition: strbitset.h:75
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
Definition: Selector.h:212
double_map doubleCuts_
the double-value cut map
Definition: Selector.h:289
int_map intCuts_
the int-value cut map
Definition: Selector.h:288
template<class T>
virtual Selector< T >::~Selector ( )
inlinevirtual

Definition at line 43 of file Selector.h.

43 {}

Member Function Documentation

template<class T>
void Selector< T >::clear ( std::string const &  s)
inline

Turn off a given selection cut.

Definition at line 131 of file Selector.h.

Referenced by Selector< pat::Electron >::clear().

131  {
132  clear(index_type(&bits_,s));
133  }
pat::strbitset::index_type index_type
Definition: Selector.h:29
void clear(std::string const &s)
Turn off a given selection cut.
Definition: Selector.h:131
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
template<class T>
void Selector< T >::clear ( index_type const &  i)
inline

Definition at line 135 of file Selector.h.

135  {
136  bits_[i] = false;
137  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
template<class T>
bool Selector< T >::considerCut ( std::string const &  s) const
inline

consider the cut at index "s"

Definition at line 151 of file Selector.h.

Referenced by Selector< pat::Electron >::print(), and Selector< pat::Electron >::printActiveCuts().

151  {
152  return bits_[s] == true;
153  }
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
template<class T>
bool Selector< T >::considerCut ( index_type const &  i) const
inline

Definition at line 154 of file Selector.h.

154  {
155  return bits_[i] == true;
156  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
template<class T>
int Selector< T >::cut ( index_type const &  i,
int  val 
) const
inline

Access the int cut values at index "s".

Definition at line 194 of file Selector.h.

Referenced by Selector< pat::Electron >::cut(), Selector< pat::Electron >::push_back(), and Selector< pat::Electron >::set().

194  {
195  return intCuts_.find( i )->second;
196  };
int i
Definition: DBlmapReader.cc:9
int_map intCuts_
the int-value cut map
Definition: Selector.h:288
template<class T>
double Selector< T >::cut ( index_type const &  i,
double  val 
) const
inline

Access the double cut values at index "s".

Definition at line 198 of file Selector.h.

198  {
199  return doubleCuts_.find( i )->second;
200  };
int i
Definition: DBlmapReader.cc:9
double_map doubleCuts_
the double-value cut map
Definition: Selector.h:289
template<class T>
int Selector< T >::cut ( std::string  s,
int  val 
) const
inline

Access the int cut values at index "s".

Definition at line 203 of file Selector.h.

203  {
204  return cut( index_type(&bits_,s), val);
205  };
pat::strbitset::index_type index_type
Definition: Selector.h:29
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:194
template<class T>
double Selector< T >::cut ( std::string  s,
double  val 
) const
inline

Access the double cut values at index "s".

Definition at line 207 of file Selector.h.

207  {
208  return cut( index_type(&bits_,s), val);
209  };
pat::strbitset::index_type index_type
Definition: Selector.h:29
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:194
template<class T>
pat::strbitset Selector< T >::getBitTemplate ( ) const
inline

Get an empty bitset with the proper names.

Definition at line 212 of file Selector.h.

Referenced by SimpleJetFilter::filter(), WPlusJetsEventSelector::operator()(), and Selector< pat::Electron >::Selector().

212  {
214  ret.set(false);
215  for ( cut_flow_map::const_iterator cutsBegin = cutFlow_.begin(),
216  cutsEnd = cutFlow_.end(), icut = cutsBegin;
217  icut != cutsEnd; ++icut ) {
218  if ( ignoreCut(icut->first) ) ret[icut->first] = true;
219  }
220  return ret;
221  }
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
bool ignoreCut(std::string const &s) const
ignore the cut at index &quot;s&quot;
Definition: Selector.h:159
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:290
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144
template<class T>
double Selector< T >::getPasses ( std::string const &  s) const
inline

Return the number of passing cases.

Definition at line 269 of file Selector.h.

Referenced by Selector< pat::Electron >::getPasses().

269  {
270  return getPasses( index_type(&bits_,s) );
271  }
pat::strbitset::index_type index_type
Definition: Selector.h:29
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
double getPasses(std::string const &s) const
Return the number of passing cases.
Definition: Selector.h:269
template<class T>
double Selector< T >::getPasses ( index_type const &  i) const
inline

Definition at line 272 of file Selector.h.

272  {
273  cut_flow_map::const_iterator found = cutFlow_.end();
274  for ( cut_flow_map::const_iterator cutsBegin = cutFlow_.begin(),
275  cutsEnd = cutFlow_.end(), icut = cutsBegin;
276  icut != cutsEnd && found == cutsEnd; ++icut ) {
277  if ( icut->first == i ) {
278  found = icut;
279  }
280  }
281  return found->second;
282  }
int i
Definition: DBlmapReader.cc:9
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:290
template<class T>
bool Selector< T >::ignoreCut ( std::string const &  s) const
inline

ignore the cut at index "s"

Definition at line 159 of file Selector.h.

Referenced by Selector< pat::Electron >::getBitTemplate(), and Selector< pat::Electron >::setIgnored().

159  {
160  return bits_[s] == false;
161  }
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
template<class T>
bool Selector< T >::ignoreCut ( index_type const &  i) const
inline

Definition at line 162 of file Selector.h.

162  {
163  return bits_[i] == false;
164  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
template<class T>
virtual bool Selector< T >::operator() ( T const &  t,
pat::strbitset ret 
)
pure virtual
template<class T>
virtual bool Selector< T >::operator() ( T const &  t)
inlinevirtual

This provides an alternative signature without the second ret.

Definition at line 79 of file Selector.h.

80  {
81  retInternal_.set(false);
84  return (bool)retInternal_;
85  }
virtual bool operator()(T const &t, pat::strbitset &ret)=0
This provides the interface for base classes to select objects.
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:224
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:287
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144
template<class T>
virtual bool Selector< T >::operator() ( T const &  t,
edm::EventBase const &  e,
pat::strbitset ret 
)
inlinevirtual

This provides an alternative signature that includes extra information.

Reimplemented in MuonVPlusJetsIDSelectionFunctor.

Definition at line 89 of file Selector.h.

90  {
91  return operator()(t, ret);
92  }
virtual bool operator()(T const &t, pat::strbitset &ret)=0
This provides the interface for base classes to select objects.
template<class T>
virtual bool Selector< T >::operator() ( T const &  t,
edm::EventBase const &  e 
)
inlinevirtual

This provides an alternative signature that includes extra information.

Definition at line 95 of file Selector.h.

96  {
97  retInternal_.set(false);
100  return (bool)retInternal_;
101  }
virtual bool operator()(T const &t, pat::strbitset &ret)=0
This provides the interface for base classes to select objects.
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:224
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:287
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144
template<class T>
bool Selector< T >::operator[] ( std::string const &  s) const
inline

Access the selector cut at index "s". "true" means to consider the cut. "false" means to ignore the cut.

Definition at line 142 of file Selector.h.

142  {
143  return bits_[s];
144  }
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
template<class T>
bool Selector< T >::operator[] ( index_type const &  i) const
inline

Definition at line 146 of file Selector.h.

146  {
147  return bits_[i];
148  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
template<class T>
void Selector< T >::passCut ( pat::strbitset ret,
std::string const &  s 
)
inline

Passing cuts.

Definition at line 176 of file Selector.h.

Referenced by Selector< pat::Electron >::passCut().

176  {
177  passCut( ret, index_type(&bits_,s));
178  }
pat::strbitset::index_type index_type
Definition: Selector.h:29
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:176
template<class T>
void Selector< T >::passCut ( pat::strbitset ret,
index_type const &  i 
)
inline

Definition at line 180 of file Selector.h.

180  {
181  ret[i] = true;
182  cut_flow_map::iterator found = cutFlow_.end();
183  for ( cut_flow_map::iterator cutsBegin = cutFlow_.begin(),
184  cutsEnd = cutFlow_.end(), icut = cutsBegin;
185  icut != cutsEnd && found == cutsEnd; ++icut ) {
186  if ( icut->first == i ) {
187  found = icut;
188  }
189  }
190  ++(found->second);
191  }
int i
Definition: DBlmapReader.cc:9
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:290
template<class T>
void Selector< T >::print ( std::ostream &  out) const
inline

Print the cut flow.

Definition at line 233 of file Selector.h.

Referenced by WPlusJetsEventSelector::printSelectors().

233  {
234  for ( cut_flow_map::const_iterator cutsBegin = cutFlow_.begin(),
235  cutsEnd = cutFlow_.end(), icut = cutsBegin;
236  icut != cutsEnd; ++icut ) {
237  char buff[1000];
238  if ( considerCut( icut->first ) ) {
239  sprintf(buff, "%6lu : %20s %10lu",
240  static_cast<unsigned long>(icut - cutsBegin),
241  icut->first.str().c_str(),
242  static_cast<unsigned long>(icut->second) );
243  } else {
244  sprintf(buff, "%6lu : %20s %10s",
245  static_cast<unsigned long>(icut - cutsBegin),
246  icut->first.str().c_str(),
247  "off" );
248  }
249  out << buff << std::endl;
250  }
251  }
bool considerCut(std::string const &s) const
consider the cut at index &quot;s&quot;
Definition: Selector.h:151
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:290
tuple out
Definition: dbtoconf.py:99
template<class T>
void Selector< T >::printActiveCuts ( std::ostream &  out) const
inline

Print the cuts being considered.

Definition at line 254 of file Selector.h.

254  {
255  bool already_printed_one = false;
256  for ( cut_flow_map::const_iterator cutsBegin = cutFlow_.begin(),
257  cutsEnd = cutFlow_.end(), icut = cutsBegin;
258  icut != cutsEnd; ++icut ) {
259  if ( considerCut( icut->first ) ) {
260  if( already_printed_one ) out << ", ";
261  out << icut->first;
262  already_printed_one = true;
263  }
264  }
265  out << std::endl;
266  }
bool considerCut(std::string const &s) const
consider the cut at index &quot;s&quot;
Definition: Selector.h:151
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:290
tuple out
Definition: dbtoconf.py:99
template<class T>
virtual void Selector< T >::push_back ( std::string const &  s)
inlinevirtual

This is the registration of an individual cut string.

Definition at line 46 of file Selector.h.

46  {
47  bits_.push_back(s);
48  index_type i(&bits_,s);
49  // don't need to check to see if the key is already there,
50  // bits_ does that.
51  cutFlow_.push_back( cut_flow_item(i, 0) );
52  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset::index_type index_type
Definition: Selector.h:29
std::pair< index_type, size_t > cut_flow_item
Definition: Selector.h:30
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:290
void push_back(std::string s)
Definition: strbitset.h:99
template<class T>
virtual void Selector< T >::push_back ( std::string const &  s,
int  cut 
)
inlinevirtual

This is the registration of an individual cut string, with an int cut value.

Definition at line 56 of file Selector.h.

56  {
57  bits_.push_back(s);
58  index_type i(&bits_,s);
59  intCuts_[i] = cut;
60  // don't need to check to see if the key is already there,
61  // bits_ does that.
62  cutFlow_.push_back( cut_flow_item(i,0) );
63  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset::index_type index_type
Definition: Selector.h:29
std::pair< index_type, size_t > cut_flow_item
Definition: Selector.h:30
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:290
void push_back(std::string s)
Definition: strbitset.h:99
int_map intCuts_
the int-value cut map
Definition: Selector.h:288
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:194
template<class T>
virtual void Selector< T >::push_back ( std::string const &  s,
double  cut 
)
inlinevirtual

This is the registration of an individual cut string, with a double cut value.

Definition at line 66 of file Selector.h.

66  {
67  bits_.push_back(s);
68  index_type i(&bits_,s);
69  doubleCuts_[i] = cut;
70  // don't need to check to see if the key is already there,
71  // bits_ does that.
72  cutFlow_.push_back( cut_flow_item(i,0) );
73  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset::index_type index_type
Definition: Selector.h:29
std::pair< index_type, size_t > cut_flow_item
Definition: Selector.h:30
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:290
double_map doubleCuts_
the double-value cut map
Definition: Selector.h:289
void push_back(std::string s)
Definition: strbitset.h:99
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:194
template<class T>
void Selector< T >::set ( std::string const &  s,
bool  val = true 
)
inline

Set a given selection cut, on or off.

Definition at line 105 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral(), Selector< pat::Electron >::set(), and Selector< pat::Electron >::setIgnoredCuts().

105  {
106  set( index_type(&bits_,s), val);
107  }
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
Definition: Selector.h:105
pat::strbitset::index_type index_type
Definition: Selector.h:29
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
template<class T>
void Selector< T >::set ( index_type const &  i,
bool  val = true 
)
inline

Definition at line 108 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

108  {
109  bits_[i] = val;
110  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
template<class T>
void Selector< T >::set ( std::string const &  s,
int  cut,
bool  val = true 
)
inline

Set a given selection cut, on or off, and reset int cut value.

Definition at line 113 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

113  {
114  set( index_type(&bits_,s), cut);
115  }
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
Definition: Selector.h:105
pat::strbitset::index_type index_type
Definition: Selector.h:29
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:194
template<class T>
void Selector< T >::set ( index_type const &  i,
int  cut,
bool  val = true 
)
inline

Definition at line 116 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

116  {
117  bits_[i] = val;
118  intCuts_[i] = cut;
119  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
int_map intCuts_
the int-value cut map
Definition: Selector.h:288
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:194
template<class T>
void Selector< T >::set ( std::string const &  s,
double  cut,
bool  val = true 
)
inline

Set a given selection cut, on or off, and reset int cut value.

Definition at line 122 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

122  {
123  set( index_type(&bits_,s), cut);
124  }
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
Definition: Selector.h:105
pat::strbitset::index_type index_type
Definition: Selector.h:29
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:194
template<class T>
void Selector< T >::set ( index_type const &  i,
double  cut,
bool  val = true 
)
inline

Definition at line 125 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

125  {
126  bits_[i] = val;
127  doubleCuts_[i] = cut;
128  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
double_map doubleCuts_
the double-value cut map
Definition: Selector.h:289
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:194
template<class T>
void Selector< T >::setIgnored ( pat::strbitset ret)
inline

set ignored bits

Definition at line 224 of file Selector.h.

Referenced by Selector< pat::Electron >::operator()().

224  {
225  for ( cut_flow_map::const_iterator cutsBegin = cutFlow_.begin(),
226  cutsEnd = cutFlow_.end(), icut = cutsBegin;
227  icut != cutsEnd; ++icut ) {
228  if ( ignoreCut(icut->first) ) ret[icut->first] = true;
229  }
230  }
bool ignoreCut(std::string const &s) const
ignore the cut at index &quot;s&quot;
Definition: Selector.h:159
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:290
template<class T>
void Selector< T >::setIgnoredCuts ( std::vector< std::string > const &  bitsToIgnore)
inline

set the bits to ignore from a vector

Definition at line 167 of file Selector.h.

167  {
168  for ( std::vector<std::string>::const_iterator ignoreBegin = bitsToIgnore.begin(),
169  ignoreEnd = bitsToIgnore.end(), ibit = ignoreBegin;
170  ibit != ignoreEnd; ++ibit ) {
171  set(*ibit, false );
172  }
173  }
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
Definition: Selector.h:105

Member Data Documentation

template<class T>
pat::strbitset Selector< T >::bits_
protected
template<class T>
cut_flow_map Selector< T >::cutFlow_
protected
template<class T>
double_map Selector< T >::doubleCuts_
protected
template<class T>
int_map Selector< T >::intCuts_
protected
template<class T>
pat::strbitset Selector< T >::retInternal_
protected

internal ret if users don't care about return bits

Definition at line 287 of file Selector.h.

Referenced by Selector< pat::Electron >::operator()(), and Selector< pat::Electron >::Selector().