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
Version
Id:
Selector.h,v 1.14 2013/05/27 12:59:15 eulisse Exp

Definition at line 25 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 29 of file Selector.h.

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

Definition at line 31 of file Selector.h.

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

Definition at line 32 of file Selector.h.

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

Definition at line 28 of file Selector.h.

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

Definition at line 34 of file Selector.h.

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

Definition at line 30 of file Selector.h.

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

Definition at line 33 of file Selector.h.

Constructor & Destructor Documentation

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

Constructor clears the bits.

Definition at line 37 of file Selector.h.

37  {
38  bits_.clear();
39  intCuts_.clear();
40  doubleCuts_.clear();
41  cutFlow_.clear();
43  }
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:288
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:287
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:291
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:213
double_map doubleCuts_
the double-value cut map
Definition: Selector.h:290
int_map intCuts_
the int-value cut map
Definition: Selector.h:289
template<class T>
virtual Selector< T >::~Selector ( )
inlinevirtual

Definition at line 44 of file Selector.h.

44 {}

Member Function Documentation

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

Turn off a given selection cut.

Definition at line 132 of file Selector.h.

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

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

Definition at line 136 of file Selector.h.

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

consider the cut at index "s"

Definition at line 152 of file Selector.h.

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

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

Definition at line 155 of file Selector.h.

155  {
156  return bits_[i] == true;
157  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:287
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 195 of file Selector.h.

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

195  {
196  return intCuts_.find( i )->second;
197  };
int i
Definition: DBlmapReader.cc:9
int_map intCuts_
the int-value cut map
Definition: Selector.h:289
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 199 of file Selector.h.

199  {
200  return doubleCuts_.find( i )->second;
201  };
int i
Definition: DBlmapReader.cc:9
double_map doubleCuts_
the double-value cut map
Definition: Selector.h:290
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 204 of file Selector.h.

204  {
205  return cut( index_type(&bits_,s), val);
206  };
pat::strbitset::index_type index_type
Definition: Selector.h:30
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:287
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:195
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 208 of file Selector.h.

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

Get an empty bitset with the proper names.

Definition at line 213 of file Selector.h.

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

213  {
215  ret.set(false);
216  for ( cut_flow_map::const_iterator cutsBegin = cutFlow_.begin(),
217  cutsEnd = cutFlow_.end(), icut = cutsBegin;
218  icut != cutsEnd; ++icut ) {
219  if ( ignoreCut(icut->first) ) ret[icut->first] = true;
220  }
221  return ret;
222  }
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:287
bool ignoreCut(std::string const &s) const
ignore the cut at index &quot;s&quot;
Definition: Selector.h:160
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:291
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 270 of file Selector.h.

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

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

Definition at line 273 of file Selector.h.

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

ignore the cut at index "s"

Definition at line 160 of file Selector.h.

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

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

Definition at line 163 of file Selector.h.

163  {
164  return bits_[i] == false;
165  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:287
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 80 of file Selector.h.

81  {
82  retInternal_.set(false);
85  return (bool)retInternal_;
86  }
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:225
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:288
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, and PFElectronSelector.

Definition at line 90 of file Selector.h.

91  {
92  return operator()(t, ret);
93  }
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 96 of file Selector.h.

97  {
98  retInternal_.set(false);
101  return (bool)retInternal_;
102  }
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:225
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:288
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 143 of file Selector.h.

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

Definition at line 147 of file Selector.h.

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

Passing cuts.

Definition at line 177 of file Selector.h.

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

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

Definition at line 181 of file Selector.h.

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

Print the cut flow.

Definition at line 234 of file Selector.h.

Referenced by WPlusJetsEventSelector::printSelectors().

234  {
235  for ( cut_flow_map::const_iterator cutsBegin = cutFlow_.begin(),
236  cutsEnd = cutFlow_.end(), icut = cutsBegin;
237  icut != cutsEnd; ++icut ) {
238  char buff[1000];
239  if ( considerCut( icut->first ) ) {
240  sprintf(buff, "%6lu : %20s %10lu",
241  static_cast<unsigned long>(icut - cutsBegin),
242  icut->first.str().c_str(),
243  static_cast<unsigned long>(icut->second) );
244  } else {
245  sprintf(buff, "%6lu : %20s %10s",
246  static_cast<unsigned long>(icut - cutsBegin),
247  icut->first.str().c_str(),
248  "off" );
249  }
250  out << buff << std::endl;
251  }
252  }
bool considerCut(std::string const &s) const
consider the cut at index &quot;s&quot;
Definition: Selector.h:152
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:291
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 255 of file Selector.h.

255  {
256  bool already_printed_one = false;
257  for ( cut_flow_map::const_iterator cutsBegin = cutFlow_.begin(),
258  cutsEnd = cutFlow_.end(), icut = cutsBegin;
259  icut != cutsEnd; ++icut ) {
260  if ( considerCut( icut->first ) ) {
261  if( already_printed_one ) out << ", ";
262  out << icut->first;
263  already_printed_one = true;
264  }
265  }
266  out << std::endl;
267  }
bool considerCut(std::string const &s) const
consider the cut at index &quot;s&quot;
Definition: Selector.h:152
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:291
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 47 of file Selector.h.

47  {
48  bits_.push_back(s);
49  index_type i(&bits_,s);
50  // don't need to check to see if the key is already there,
51  // bits_ does that.
52  cutFlow_.push_back( cut_flow_item(i, 0) );
53  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset::index_type index_type
Definition: Selector.h:30
std::pair< index_type, size_t > cut_flow_item
Definition: Selector.h:31
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:287
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:291
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 57 of file Selector.h.

57  {
58  bits_.push_back(s);
59  index_type i(&bits_,s);
60  intCuts_[i] = cut;
61  // don't need to check to see if the key is already there,
62  // bits_ does that.
63  cutFlow_.push_back( cut_flow_item(i,0) );
64  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset::index_type index_type
Definition: Selector.h:30
std::pair< index_type, size_t > cut_flow_item
Definition: Selector.h:31
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:287
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:291
void push_back(std::string s)
Definition: strbitset.h:99
int_map intCuts_
the int-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:195
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 67 of file Selector.h.

67  {
68  bits_.push_back(s);
69  index_type i(&bits_,s);
70  doubleCuts_[i] = cut;
71  // don't need to check to see if the key is already there,
72  // bits_ does that.
73  cutFlow_.push_back( cut_flow_item(i,0) );
74  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset::index_type index_type
Definition: Selector.h:30
std::pair< index_type, size_t > cut_flow_item
Definition: Selector.h:31
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:287
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:291
double_map doubleCuts_
the double-value cut map
Definition: Selector.h:290
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:195
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 106 of file Selector.h.

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

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

Definition at line 109 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

109  {
110  bits_[i] = val;
111  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:287
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 114 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

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

Definition at line 117 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

117  {
118  bits_[i] = val;
119  intCuts_[i] = cut;
120  }
int i
Definition: DBlmapReader.cc:9
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:287
int_map intCuts_
the int-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:195
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 123 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

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

Definition at line 126 of file Selector.h.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

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

set ignored bits

Definition at line 225 of file Selector.h.

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

225  {
226  for ( cut_flow_map::const_iterator cutsBegin = cutFlow_.begin(),
227  cutsEnd = cutFlow_.end(), icut = cutsBegin;
228  icut != cutsEnd; ++icut ) {
229  if ( ignoreCut(icut->first) ) ret[icut->first] = true;
230  }
231  }
bool ignoreCut(std::string const &s) const
ignore the cut at index &quot;s&quot;
Definition: Selector.h:160
cut_flow_map cutFlow_
map of cut flows in &quot;human&quot; order
Definition: Selector.h:291
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 168 of file Selector.h.

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

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 288 of file Selector.h.

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