CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
SimpleCutBasedElectronIDSelectionFunctor Class Reference

#include <SimpleCutBasedElectronIDSelectionFunctor.h>

Inheritance diagram for SimpleCutBasedElectronIDSelectionFunctor:
Selector< pat::Electron >

Public Types

enum  Version_t {
  relIso95 = 0, cIso95, relIso90, cIso90,
  relIso85, cIso85, relIso80, cIso80,
  relIso70, cIso70, relIso60, cIso60,
  NONE
}
 
- Public Types inherited from Selector< pat::Electron >
typedef std::pair< index_type, size_t > cut_flow_item
 
typedef std::vector< cut_flow_itemcut_flow_map
 
typedef pat::Electron 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 initialize (Version_t version)
 
void initialize (Double_t trackIso_EB, Double_t ecalIso_EB, Double_t hcalIso_EB, Double_t sihih_EB, Double_t dphi_EB, Double_t deta_EB, Double_t hoe_EB, Double_t cIso_EB, Double_t trackIso_EE, Double_t ecalIso_EE, Double_t hcalIso_EE, Double_t sihih_EE, Double_t dphi_EE, Double_t deta_EE, Double_t hoe_EE, Double_t cIso_EE, Int_t conversionRejection, Int_t maxNumberOfExpectedMissingHits)
 
bool operator() (const pat::Electron &electron, pat::strbitset &ret) override
 This provides the interface for base classes to select objects. More...
 
 SimpleCutBasedElectronIDSelectionFunctor ()
 
 SimpleCutBasedElectronIDSelectionFunctor (edm::ParameterSet const &parameters)
 
 SimpleCutBasedElectronIDSelectionFunctor (Version_t version)
 
bool spring10Variables (const pat::Electron &electron, pat::strbitset &ret)
 
- Public Member Functions inherited from Selector< pat::Electron >
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() (pat::Electron const &t)
 This provides an alternative signature without the second ret. More...
 
virtual bool operator() (pat::Electron const &t, edm::EventBase const &e, pat::strbitset &ret)
 This provides an alternative signature that includes extra information. More...
 
virtual bool operator() (pat::Electron 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 ()
 

Private Attributes

Version_t version_
 

Additional Inherited Members

- Protected Attributes inherited from Selector< pat::Electron >
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

Definition at line 60 of file SimpleCutBasedElectronIDSelectionFunctor.h.

Member Enumeration Documentation

◆ Version_t

Enumerator
relIso95 
cIso95 
relIso90 
cIso90 
relIso85 
cIso85 
relIso80 
cIso80 
relIso70 
cIso70 
relIso60 
cIso60 
NONE 

Definition at line 62 of file SimpleCutBasedElectronIDSelectionFunctor.h.

62  {
63  relIso95 = 0,
64  cIso95,
65  relIso90,
66  cIso90,
67  relIso85,
68  cIso85,
69  relIso80,
70  cIso80,
71  relIso70,
72  cIso70,
73  relIso60,
74  cIso60,
75  NONE
76  };

Constructor & Destructor Documentation

◆ SimpleCutBasedElectronIDSelectionFunctor() [1/3]

SimpleCutBasedElectronIDSelectionFunctor::SimpleCutBasedElectronIDSelectionFunctor ( )
inline

Definition at line 78 of file SimpleCutBasedElectronIDSelectionFunctor.h.

78 {}

◆ SimpleCutBasedElectronIDSelectionFunctor() [2/3]

SimpleCutBasedElectronIDSelectionFunctor::SimpleCutBasedElectronIDSelectionFunctor ( edm::ParameterSet const &  parameters)
inline

Definition at line 81 of file SimpleCutBasedElectronIDSelectionFunctor.h.

References Selector< pat::Electron >::getBitTemplate(), initialize(), and Selector< pat::Electron >::retInternal_.

81  {
82  // get the cuts from the PS
83  initialize(parameters.getParameter<Double_t>("trackIso_EB"),
84  parameters.getParameter<Double_t>("ecalIso_EB"),
85  parameters.getParameter<Double_t>("hcalIso_EB"),
86  parameters.getParameter<Double_t>("sihih_EB"),
87  parameters.getParameter<Double_t>("dphi_EB"),
88  parameters.getParameter<Double_t>("deta_EB"),
89  parameters.getParameter<Double_t>("hoe_EB"),
90  parameters.getParameter<Double_t>("cIso_EB"),
91  parameters.getParameter<Double_t>("trackIso_EE"),
92  parameters.getParameter<Double_t>("ecalIso_EE"),
93  parameters.getParameter<Double_t>("hcalIso_EE"),
94  parameters.getParameter<Double_t>("sihih_EE"),
95  parameters.getParameter<Double_t>("dphi_EE"),
96  parameters.getParameter<Double_t>("deta_EE"),
97  parameters.getParameter<Double_t>("hoe_EE"),
98  parameters.getParameter<Double_t>("cIso_EE"),
99  parameters.getParameter<Int_t>("conversionRejection"),
100  parameters.getParameter<Int_t>("maxNumberOfExpectedMissingHits"));
102  }
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:242
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
Definition: Selector.h:168

◆ SimpleCutBasedElectronIDSelectionFunctor() [3/3]

SimpleCutBasedElectronIDSelectionFunctor::SimpleCutBasedElectronIDSelectionFunctor ( Version_t  version)
inline

Definition at line 104 of file SimpleCutBasedElectronIDSelectionFunctor.h.

References cIso80, gather_cfg::cout, Selector< pat::Electron >::getBitTemplate(), initialize(), NONE, Selector< pat::Electron >::retInternal_, and BeamSplash_cfg::version.

104  {
105  if (version == NONE) {
106  std::cout << "SimpleCutBasedElectronIDSelectionFunctor: If you want to use version NONE "
107  << "then you have also to provide the selection cuts by yourself " << std::endl;
108  std::cout << "SimpleCutBasedElectronIDSelectionFunctor: ID Version is changed to 80cIso " << std::endl;
109  version = cIso80;
110  }
113  }
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:242
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
Definition: Selector.h:168

Member Function Documentation

◆ initialize() [1/2]

void SimpleCutBasedElectronIDSelectionFunctor::initialize ( Version_t  version)
inline

Definition at line 115 of file SimpleCutBasedElectronIDSelectionFunctor.h.

References cIso60, cIso70, cIso80, cIso85, cIso90, cIso95, Selector< pat::Electron >::push_back(), relIso60, relIso70, relIso80, relIso85, relIso90, relIso95, BeamSplash_cfg::version, and version_.

Referenced by SimpleCutBasedElectronIDSelectionFunctor().

115  {
116  version_ = version;
117  // push back the variables
118  push_back("trackIso_EB");
119  push_back("ecalIso_EB");
120  push_back("hcalIso_EB");
121  push_back("sihih_EB");
122  push_back("dphi_EB");
123  push_back("deta_EB");
124  push_back("hoe_EB");
125  push_back("cIso_EB");
126 
127  push_back("trackIso_EE");
128  push_back("ecalIso_EE");
129  push_back("hcalIso_EE");
130  push_back("sihih_EE");
131  push_back("dphi_EE");
132  push_back("deta_EE");
133  push_back("hoe_EE");
134  push_back("cIso_EE");
135 
136  push_back("conversionRejection");
137  push_back("maxNumberOfExpectedMissingHits");
138 
139  if (version_ == relIso95) {
140  set("trackIso_EB", 1.5e-01);
141  set("ecalIso_EB", 2.0e+00);
142  set("hcalIso_EB", 1.2e-01);
143  set("sihih_EB", 1.0e-02);
144  set("dphi_EB", 8.0e-01);
145  set("deta_EB", 7.0e-03);
146  set("hoe_EB", 1.5e-01);
147  set("cIso_EB", 10000.);
148 
149  set("trackIso_EE", 8.0e-02);
150  set("ecalIso_EE", 6.0e-02);
151  set("hcalIso_EE", 5.0e-02);
152  set("sihih_EE", 3.0e-02);
153  set("dphi_EE", 7.0e-01);
154  set("deta_EE", 1.0e-02);
155  set("hoe_EE", 7.0e-02);
156  set("cIso_EE", 10000.);
157 
158  set("conversionRejection", 0);
159  set("maxNumberOfExpectedMissingHits", 1);
160 
161  } else if (version_ == cIso95) {
162  set("trackIso_EB", 100000.);
163  set("ecalIso_EB", 100000.);
164  set("hcalIso_EB", 100000.);
165  set("sihih_EB", 1.0e-02);
166  set("dphi_EB", 8.0e-01);
167  set("deta_EB", 7.0e-03);
168  set("hoe_EB", 1.5e-01);
169  set("cIso_EB", 1.5e-01);
170 
171  set("trackIso_EE", 100000.);
172  set("ecalIso_EE", 100000.);
173  set("hcalIso_EE", 100000.);
174  set("sihih_EE", 3.0e-02);
175  set("dphi_EE", 7.0e-01);
176  set("deta_EE", 1.0e-02);
177  set("hoe_EE", 7.0e-02);
178  set("cIso_EE", 1.0e-01);
179 
180  set("conversionRejection", 0);
181  set("maxNumberOfExpectedMissingHits", 1);
182 
183  } else if (version_ == relIso90) {
184  set("trackIso_EB", 1.2e-01);
185  set("ecalIso_EB", 9.0e-02);
186  set("hcalIso_EB", 1.0e-01);
187  set("sihih_EB", 1.0e-02);
188  set("dphi_EB", 8.0e-01);
189  set("deta_EB", 7.0e-03);
190  set("hoe_EB", 1.2e-01);
191  set("cIso_EB", 10000.);
192 
193  set("trackIso_EE", 5.0e-02);
194  set("ecalIso_EE", 6.0e-02);
195  set("hcalIso_EE", 3.0e-02);
196  set("sihih_EE", 3.0e-02);
197  set("dphi_EE", 7.0e-01);
198  set("deta_EE", 9.0e-03);
199  set("hoe_EE", 5.0e-02);
200  set("cIso_EE", 10000.);
201 
202  set("conversionRejection", 1);
203  set("maxNumberOfExpectedMissingHits", 1);
204  } else if (version_ == cIso90) {
205  set("trackIso_EB", 100000.);
206  set("ecalIso_EB", 100000.);
207  set("hcalIso_EB", 100000.);
208  set("sihih_EB", 1.0e-02);
209  set("dphi_EB", 8.0e-01);
210  set("deta_EB", 7.0e-03);
211  set("hoe_EB", 1.2e-01);
212  set("cIso_EB", 1.0e-01);
213 
214  set("trackIso_EE", 100000.);
215  set("ecalIso_EE", 100000.);
216  set("hcalIso_EE", 100000.);
217  set("sihih_EE", 3.0e-02);
218  set("dphi_EE", 7.0e-01);
219  set("deta_EE", 9.0e-03);
220  set("hoe_EE", 5.0e-02);
221  set("cIso_EE", 7.0e-02);
222 
223  set("conversionRejection", 1);
224  set("maxNumberOfExpectedMissingHits", 1);
225  } else if (version_ == relIso85) {
226  set("trackIso_EB", 9.0e-02);
227  set("ecalIso_EB", 8.0e-02);
228  set("hcalIso_EB", 1.0e-01);
229  set("sihih_EB", 1.0e-02);
230  set("dphi_EB", 6.0e-02);
231  set("deta_EB", 6.0e-03);
232  set("hoe_EB", 4.0e-02);
233  set("cIso_EB", 10000.);
234 
235  set("trackIso_EE", 5.0e-02);
236  set("ecalIso_EE", 5.0e-02);
237  set("hcalIso_EE", 2.5e-02);
238  set("sihih_EE", 3.0e-02);
239  set("dphi_EE", 4.0e-02);
240  set("deta_EE", 7.0e-03);
241  set("hoe_EE", 2.5e-02);
242  set("cIso_EE", 10000.);
243 
244  set("conversionRejection", 1);
245  set("maxNumberOfExpectedMissingHits", 1);
246  } else if (version_ == cIso85) {
247  set("trackIso_EB", 100000.);
248  set("ecalIso_EB", 100000.);
249  set("hcalIso_EB", 100000.);
250  set("sihih_EB", 1.0e-02);
251  set("dphi_EB", 6.0e-02);
252  set("deta_EB", 6.0e-03);
253  set("hoe_EB", 4.0e-02);
254  set("cIso_EB", 9.0e-02);
255 
256  set("trackIso_EE", 100000.);
257  set("ecalIso_EE", 100000.);
258  set("hcalIso_EE", 100000.);
259  set("sihih_EE", 3.0e-02);
260  set("dphi_EE", 4.0e-02);
261  set("deta_EE", 7.0e-03);
262  set("hoe_EE", 2.5e-02);
263  set("cIso_EE", 6.0e-02);
264 
265  set("conversionRejection", 1);
266  set("maxNumberOfExpectedMissingHits", 1);
267  } else if (version_ == relIso80) {
268  set("trackIso_EB", 9.0e-02);
269  set("ecalIso_EB", 7.0e-02);
270  set("hcalIso_EB", 1.0e-01);
271  set("sihih_EB", 1.0e-02);
272  set("dphi_EB", 6.0e-02);
273  set("deta_EB", 4.0e-03);
274  set("hoe_EB", 4.0e-02);
275  set("cIso_EB", 100000.);
276 
277  set("trackIso_EE", 4.0e-02);
278  set("ecalIso_EE", 5.0e-02);
279  set("hcalIso_EE", 2.5e-02);
280  set("sihih_EE", 3.0e-02);
281  set("dphi_EE", 3.0e-02);
282  set("deta_EE", 7.0e-03);
283  set("hoe_EE", 2.5e-02);
284  set("cIso_EE", 100000.);
285 
286  set("conversionRejection", 1);
287  set("maxNumberOfExpectedMissingHits", 0);
288  } else if (version_ == cIso80) {
289  set("trackIso_EB", 100000.);
290  set("ecalIso_EB", 100000.);
291  set("hcalIso_EB", 100000.);
292  set("sihih_EB", 1.0e-02);
293  set("dphi_EB", 6.0e-02);
294  set("deta_EB", 4.0e-03);
295  set("hoe_EB", 4.0e-02);
296  set("cIso_EB", 7.0e-02);
297 
298  set("trackIso_EE", 100000.);
299  set("ecalIso_EE", 100000.);
300  set("hcalIso_EE", 100000.);
301  set("sihih_EE", 3.0e-02);
302  set("dphi_EE", 3.0e-02);
303  set("deta_EE", 7.0e-03);
304  set("hoe_EE", 2.5e-02);
305  set("cIso_EE", 6.0e-02);
306 
307  set("conversionRejection", 1);
308  set("maxNumberOfExpectedMissingHits", 0);
309  } else if (version_ == relIso70) {
310  set("trackIso_EB", 5.0e-02);
311  set("ecalIso_EB", 6.0e-02);
312  set("hcalIso_EB", 3.0e-02);
313  set("sihih_EB", 1.0e-02);
314  set("dphi_EB", 3.0e-02);
315  set("deta_EB", 4.0e-03);
316  set("hoe_EB", 2.5e-02);
317  set("cIso_EB", 100000.);
318 
319  set("trackIso_EE", 2.5e-02);
320  set("ecalIso_EE", 2.5e-02);
321  set("hcalIso_EE", 2.0e-02);
322  set("sihih_EE", 3.0e-02);
323  set("dphi_EE", 2.0e-02);
324  set("deta_EE", 5.0e-03);
325  set("hoe_EE", 2.5e-02);
326  set("cIso_EE", 100000.);
327 
328  set("conversionRejection", 1);
329  set("maxNumberOfExpectedMissingHits", 0);
330  } else if (version_ == cIso70) {
331  set("trackIso_EB", 100000.);
332  set("ecalIso_EB", 100000.);
333  set("hcalIso_EB", 100000.);
334  set("sihih_EB", 1.0e-02);
335  set("dphi_EB", 3.0e-02);
336  set("deta_EB", 4.0e-03);
337  set("hoe_EB", 2.5e-02);
338  set("cIso_EB", 4.0e-02);
339 
340  set("trackIso_EE", 100000.);
341  set("ecalIso_EE", 100000.);
342  set("hcalIso_EE", 100000.);
343  set("sihih_EE", 3.0e-02);
344  set("dphi_EE", 2.0e-02);
345  set("deta_EE", 5.0e-03);
346  set("hoe_EE", 2.5e-02);
347  set("cIso_EE", 3.0e-02);
348 
349  set("conversionRejection", 1);
350  set("maxNumberOfExpectedMissingHits", 0);
351  } else if (version_ == relIso60) {
352  set("trackIso_EB", 4.0e-02);
353  set("ecalIso_EB", 4.0e-02);
354  set("hcalIso_EB", 3.0e-02);
355  set("sihih_EB", 1.0e-02);
356  set("dphi_EB", 2.5e-02);
357  set("deta_EB", 4.0e-03);
358  set("hoe_EB", 2.5e-02);
359  set("cIso_EB", 100000.);
360 
361  set("trackIso_EE", 2.5e-02);
362  set("ecalIso_EE", 2.0e-02);
363  set("hcalIso_EE", 2.0e-02);
364  set("sihih_EE", 3.0e-02);
365  set("dphi_EE", 2.0e-02);
366  set("deta_EE", 5.0e-03);
367  set("hoe_EE", 2.5e-02);
368  set("cIso_EE", 100000.);
369 
370  set("conversionRejection", 1);
371  set("maxNumberOfExpectedMissingHits", 0);
372  } else if (version_ == cIso60) {
373  set("trackIso_EB", 100000.);
374  set("ecalIso_EB", 100000.);
375  set("hcalIso_EB", 100000.);
376  set("sihih_EB", 1.0e-02);
377  set("dphi_EB", 2.5e-02);
378  set("deta_EB", 4.0e-03);
379  set("hoe_EB", 2.5e-02);
380  set("cIso_EB", 3.0e-02);
381 
382  set("trackIso_EE", 100000.);
383  set("ecalIso_EE", 100000.);
384  set("hcalIso_EE", 100000.);
385  set("sihih_EE", 3.0e-02);
386  set("dphi_EE", 2.0e-02);
387  set("deta_EE", 5.0e-03);
388  set("hoe_EE", 2.5e-02);
389  set("cIso_EE", 2.0e-02);
390 
391  set("conversionRejection", 1);
392  set("maxNumberOfExpectedMissingHits", 0);
393  }
394  }
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Definition: Selector.h:42

◆ initialize() [2/2]

void SimpleCutBasedElectronIDSelectionFunctor::initialize ( Double_t  trackIso_EB,
Double_t  ecalIso_EB,
Double_t  hcalIso_EB,
Double_t  sihih_EB,
Double_t  dphi_EB,
Double_t  deta_EB,
Double_t  hoe_EB,
Double_t  cIso_EB,
Double_t  trackIso_EE,
Double_t  ecalIso_EE,
Double_t  hcalIso_EE,
Double_t  sihih_EE,
Double_t  dphi_EE,
Double_t  deta_EE,
Double_t  hoe_EE,
Double_t  cIso_EE,
Int_t  conversionRejection,
Int_t  maxNumberOfExpectedMissingHits 
)
inline

Definition at line 396 of file SimpleCutBasedElectronIDSelectionFunctor.h.

References NONE, Selector< pat::Electron >::push_back(), and version_.

413  {
414  version_ = NONE;
415  push_back("trackIso_EB");
416  push_back("ecalIso_EB");
417  push_back("hcalIso_EB");
418  push_back("sihih_EB");
419  push_back("dphi_EB");
420  push_back("deta_EB");
421  push_back("hoe_EB");
422  push_back("cIso_EB");
423 
424  push_back("trackIso_EE");
425  push_back("ecalIso_EE");
426  push_back("hcalIso_EE");
427  push_back("sihih_EE");
428  push_back("dphi_EE");
429  push_back("deta_EE");
430  push_back("hoe_EE");
431  push_back("cIso_EE");
432 
433  push_back("conversionRejection");
434  push_back("maxNumberOfExpectedMissingHits");
435 
436  set("trackIso_EB", trackIso_EB);
437  set("ecalIso_EB", ecalIso_EB);
438  set("hcalIso_EB", hcalIso_EB);
439  set("sihih_EB", sihih_EB);
440  set("dphi_EB", dphi_EB);
441  set("deta_EB", deta_EB);
442  set("hoe_EB", hoe_EB);
443  set("cIso_EB", cIso_EB);
444 
445  set("trackIso_EE", trackIso_EE);
446  set("ecalIso_EE", ecalIso_EE);
447  set("hcalIso_EE", hcalIso_EE);
448  set("sihih_EE", sihih_EE);
449  set("dphi_EE", dphi_EE);
450  set("deta_EE", deta_EE);
451  set("hoe_EE", hoe_EE);
452  set("cIso_EE", cIso_EE);
453 
454  set("conversionRejection", conversionRejection);
455  set("maxNumberOfExpectedMissingHits", maxNumberOfExpectedMissingHits);
456  }
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Definition: Selector.h:42

◆ operator()()

bool SimpleCutBasedElectronIDSelectionFunctor::operator() ( const pat::Electron t,
pat::strbitset ret 
)
inlineoverridevirtual

This provides the interface for base classes to select objects.

Implements Selector< pat::Electron >.

Definition at line 458 of file SimpleCutBasedElectronIDSelectionFunctor.h.

References HPSPFTauProducerPuppi_cfi::electron, runTheMatrix::ret, and spring10Variables().

458  {
459  // for the time being only Spring10 variable definition
460  return spring10Variables(electron, ret);
461  }
ret
prodAgent to be discontinued
bool spring10Variables(const pat::Electron &electron, pat::strbitset &ret)

◆ spring10Variables()

bool SimpleCutBasedElectronIDSelectionFunctor::spring10Variables ( const pat::Electron electron,
pat::strbitset ret 
)
inline

Definition at line 464 of file SimpleCutBasedElectronIDSelectionFunctor.h.

References Selector< pat::Electron >::cut(), HPSPFTauProducerPuppi_cfi::electron, Selector< pat::Electron >::ignoreCut(), SiStripPI::max, reco::HitPattern::MISSING_INNER_HITS, Selector< pat::Electron >::passCut(), runTheMatrix::ret, and Selector< pat::Electron >::setIgnored().

Referenced by operator()().

464  {
465  ret.set(false);
466  //
467  Double_t eleET = electron.p4().Pt();
468  Double_t trackIso = electron.dr03TkSumPt() / eleET;
469  Double_t ecalIso = electron.dr03EcalRecHitSumEt() / eleET;
470  Double_t hcalIso = electron.dr03HcalTowerSumEt() / eleET;
471  Double_t sihih = electron.sigmaIetaIeta();
472  Double_t Dphi = electron.deltaPhiSuperClusterTrackAtVtx();
473  Double_t Deta = electron.deltaEtaSuperClusterTrackAtVtx();
474  Double_t HoE = electron.hadronicOverEm();
475  Double_t cIso = 0;
476  if (electron.isEB()) {
477  cIso =
478  (electron.dr03TkSumPt() + std::max(0., electron.dr03EcalRecHitSumEt() - 1.) + electron.dr03HcalTowerSumEt()) /
479  eleET;
480  } else {
481  cIso = (electron.dr03TkSumPt() + electron.dr03EcalRecHitSumEt() + electron.dr03HcalTowerSumEt()) / eleET;
482  }
483  Int_t innerHits = electron.gsfTrack()->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS);
484  // in 39 conversion rejection variables are accessible from Gsf electron
485  Double_t dist = electron.convDist(); // default value is -9999 if conversion partner not found
486  Double_t dcot = electron.convDcot(); // default value is -9999 if conversion partner not found
487  Bool_t isConv = fabs(dist) < 0.02 && fabs(dcot) < 0.02;
488  // now apply the cuts
489  if (electron.isEB()) { // BARREL case
490  // check the EB cuts
491  if (trackIso < cut("trackIso_EB", double()) || ignoreCut("trackIso_EB"))
492  passCut(ret, "trackIso_EB");
493  if (ecalIso < cut("ecalIso_EB", double()) || ignoreCut("ecalIso_EB"))
494  passCut(ret, "ecalIso_EB");
495  if (hcalIso < cut("hcalIso_EB", double()) || ignoreCut("hcalIso_EB"))
496  passCut(ret, "hcalIso_EB");
497  if (sihih < cut("sihih_EB", double()) || ignoreCut("sihih_EB"))
498  passCut(ret, "sihih_EB");
499  if (fabs(Dphi) < cut("dphi_EB", double()) || ignoreCut("dphi_EB"))
500  passCut(ret, "dphi_EB");
501  if (fabs(Deta) < cut("deta_EB", double()) || ignoreCut("deta_EB"))
502  passCut(ret, "deta_EB");
503  if (HoE < cut("hoe_EB", double()) || ignoreCut("hoe_EB"))
504  passCut(ret, "hoe_EB");
505  if (cIso < cut("cIso_EB", double()) || ignoreCut("cIso_EB"))
506  passCut(ret, "cIso_EB");
507  // pass all the EE cuts
508  passCut(ret, "trackIso_EE");
509  passCut(ret, "ecalIso_EE");
510  passCut(ret, "hcalIso_EE");
511  passCut(ret, "sihih_EE");
512  passCut(ret, "dphi_EE");
513  passCut(ret, "deta_EE");
514  passCut(ret, "hoe_EE");
515  passCut(ret, "cIso_EE");
516  } else { // ENDCAPS case
517  // check the EE cuts
518  if (trackIso < cut("trackIso_EE", double()) || ignoreCut("trackIso_EE"))
519  passCut(ret, "trackIso_EE");
520  if (ecalIso < cut("ecalIso_EE", double()) || ignoreCut("ecalIso_EE"))
521  passCut(ret, "ecalIso_EE");
522  if (hcalIso < cut("hcalIso_EE", double()) || ignoreCut("hcalIso_EE"))
523  passCut(ret, "hcalIso_EE");
524  if (sihih < cut("sihih_EE", double()) || ignoreCut("sihih_EE"))
525  passCut(ret, "sihih_EE");
526  if (fabs(Dphi) < cut("dphi_EE", double()) || ignoreCut("dphi_EE"))
527  passCut(ret, "dphi_EE");
528  if (fabs(Deta) < cut("deta_EE", double()) || ignoreCut("deta_EE"))
529  passCut(ret, "deta_EE");
530  if (HoE < cut("hoe_EE", double()) || ignoreCut("hoe_EE"))
531  passCut(ret, "hoe_EE");
532  if (cIso < cut("cIso_EE", double()) || ignoreCut("cIso_EE"))
533  passCut(ret, "cIso_EE");
534  // pass all the EB cuts
535  passCut(ret, "trackIso_EB");
536  passCut(ret, "ecalIso_EB");
537  passCut(ret, "hcalIso_EB");
538  passCut(ret, "sihih_EB");
539  passCut(ret, "dphi_EB");
540  passCut(ret, "deta_EB");
541  passCut(ret, "hoe_EB");
542  passCut(ret, "cIso_EB");
543  }
544 
545  // conversion rejection common for EB and EE
546  if (innerHits <= cut("maxNumberOfExpectedMissingHits", int()))
547  passCut(ret, "maxNumberOfExpectedMissingHits");
548  if (0 == cut("conversionRejection", int()) || isConv == false)
549  passCut(ret, "conversionRejection");
550  setIgnored(ret);
551  return (bool)ret;
552  }
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
Definition: Selector.h:127
ret
prodAgent to be discontinued
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:181
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:142
int cut(index_type const &i, int val) const
Access the int cut values at index "s".
Definition: Selector.h:158

Member Data Documentation

◆ version_

Version_t SimpleCutBasedElectronIDSelectionFunctor::version_
private

Definition at line 556 of file SimpleCutBasedElectronIDSelectionFunctor.h.

Referenced by initialize().