CMS 3D CMS Logo

MuonVPlusJetsIDSelectionFunctor.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_PatUtils_interface_MuonVPlusJetsIDSelectionFunctor_h
2 #define PhysicsTools_PatUtils_interface_MuonVPlusJetsIDSelectionFunctor_h
3 
4 #ifndef __GCCXML__
6 #endif
11 
14 
15 #include <iostream>
16 
17 class MuonVPlusJetsIDSelectionFunctor : public Selector<pat::Muon> {
18 
19  public: // interface
20 
21  bool verbose_;
22 
24 
26 
27 #ifndef __GCCXML__
30  {
32  pvSrcToken_ = iC.consumes<std::vector<reco::Vertex> >(pvSrc_);
33  }
34 #endif
35 
37 
38  verbose_ = false;
39 
40  std::string versionStr = parameters.getParameter<std::string>("version");
41 
43 
44  if ( versionStr == "SUMMER08" ) {
45  version = SUMMER08;
46  }
47  else if ( versionStr == "FIRSTDATA" ) {
48  version = FIRSTDATA;
49  }
50  else if ( versionStr == "SPRING10" ) {
51  version = SPRING10;
52  }
53  else if ( versionStr == "FALL10" ) {
54  version = FALL10;
55  if (verbose_) std::cout << "\nMUON SELECTION - you are using FALL10 Selection" << std::endl;
56  }
57  else if (versionStr == "KITQCD") {
58  version = KITQCD;
59  if (verbose_) std::cout << "\nMUON SELECTION - you are using KITQCD Selection" << std::endl;
60  }
61  else {
62  throw cms::Exception("InvalidInput") << "Expect version to be one of SUMMER08, FIRSTDATA, SPRING10, FALL10" << std::endl;
63  }
64 
65  initialize( version,
66  parameters.getParameter<double>("Chi2"),
67  parameters.getParameter<double>("D0") ,
68  parameters.getParameter<double>("ED0") ,
69  parameters.getParameter<double>("SD0") ,
70  parameters.getParameter<int> ("NHits") ,
71  parameters.getParameter<int> ("NValMuHits"),
72  parameters.getParameter<double>("ECalVeto") ,
73  parameters.getParameter<double>("HCalVeto") ,
74  parameters.getParameter<double>("RelIso"),
75  parameters.getParameter<double>("LepZ"),
76  parameters.getParameter<int>("nPixelHits"),
77  parameters.getParameter<int>("nMatchedStations")
78  );
79  if ( parameters.exists("cutsToIgnore") )
80  setIgnoredCuts( parameters.getParameter<std::vector<std::string> >("cutsToIgnore") );
81 
83 
84  recalcDBFromBSp_ = parameters.getParameter<bool>("RecalcFromBeamSpot");
85  pvSrc_ = parameters.getParameter<edm::InputTag>("pvSrc");
86  }
87 
88 
90  double chi2 = 10.0,
91  double d0 = 0.2,
92  double ed0 = 999.0,
93  double sd0 = 999.0,
94  int nhits = 11,
95  int nValidMuonHits = 0,
96  double ecalveto = 4.0,
97  double hcalveto = 6.0,
98  double reliso = 0.05,
99  double maxLepZ = 1.0,
100  int minPixelHits = 1,
101  int minNMatches = 1
102  ) : recalcDBFromBSp_(false) {
103  initialize( version, chi2, d0, ed0, sd0, nhits, nValidMuonHits, ecalveto, hcalveto, reliso,
104  maxLepZ, minPixelHits, minNMatches );
105 
107  }
108 
109 
110 
111 
113  double chi2 = 10.0,
114  double d0 = 999.0,
115  double ed0 = 999.0,
116  double sd0 = 3.0,
117  int nhits = 11,
118  int nValidMuonHits = 0,
119  double ecalveto = 4.0,
120  double hcalveto = 6.0,
121  double reliso = 0.05,
122  double maxLepZ = 1.0,
123  int minPixelHits = 1,
124  int minNMatches = 1 )
125  {
126  version_ = version;
127 
128  push_back("Chi2", chi2 );
129  push_back("D0", d0 );
130  push_back("ED0", ed0 );
131  push_back("SD0", sd0 );
132  push_back("NHits", nhits );
133  push_back("NValMuHits", nValidMuonHits );
134  push_back("ECalVeto", ecalveto);
135  push_back("HCalVeto", hcalveto);
136  push_back("RelIso", reliso );
137  push_back("LepZ", maxLepZ);
138  push_back("nPixelHits",minPixelHits);
139  push_back("nMatchedStations", minNMatches);
140 
141  set("Chi2");
142  set("D0");
143  set("ED0");
144  set("SD0");
145  set("NHits");
146  set("NValMuHits");
147  set("ECalVeto");
148  set("HCalVeto");
149  set("RelIso");
150  set("LepZ");
151  set("nPixelHits");
152  set("nMatchedStations");
153 
154  indexChi2_ = index_type(&bits_, "Chi2" );
155  indexD0_ = index_type(&bits_, "D0" );
156  indexED0_ = index_type(&bits_, "ED0" );
157  indexSD0_ = index_type(&bits_, "SD0" );
158  indexNHits_ = index_type(&bits_, "NHits" );
159  indexNValMuHits_ = index_type(&bits_, "NValMuHits" );
160  indexECalVeto_ = index_type(&bits_, "ECalVeto" );
161  indexHCalVeto_ = index_type(&bits_, "HCalVeto" );
162  indexRelIso_ = index_type(&bits_, "RelIso" );
163  indexLepZ_ = index_type( &bits_, "LepZ");
164  indexPixHits_ = index_type( &bits_, "nPixelHits");
165  indexStations_ = index_type( &bits_, "nMatchedStations");
166 
167  if ( version == FALL10) {
168  set("ED0", false );
169  set("SD0", false);
170  set("ECalVeto",false);
171  set("HCalVeto",false);
172  } else if ( version == SPRING10) {
173  set("ED0", false );
174  set("SD0", false);
175  set("ECalVeto",false);
176  set("HCalVeto",false);
177  set("LepZ", false);
178  set("nPixelHits", false);
179  set("nMatchedStations", false);
180  } else if ( version_ == FIRSTDATA ) {
181  set("D0", false );
182  set("ED0", false );
183  set("NValMuHits",false);
184  set("LepZ", false);
185  set("nPixelHits", false);
186  set("nMatchedStations", false);
187  } else if (version == SUMMER08 ) {
188  set("SD0", false);
189  set("NValMuHits",false);
190  set("LepZ", false);
191  set("nPixelHits", false);
192  set("nMatchedStations", false);
193 
194  }
195 
196  }
197 
198  // Allow for multiple definitions of the cuts.
199  bool operator()( const pat::Muon & muon, edm::EventBase const & event, pat::strbitset & ret ) override
200  {
201 
202  if (version_ == FALL10 ) return fall10Cuts(muon, event, ret);
203  else if (version_ == SPRING10 ) return spring10Cuts(muon, event, ret);
204  else if ( version_ == SUMMER08 ) return summer08Cuts( muon, ret );
205  else if ( version_ == FIRSTDATA ) return firstDataCuts( muon, ret );
206  else if ( version_ == KITQCD ) {
207  if (verbose_) std::cout << "Calling KIT selection method" << std::endl;
208  return kitQCDCuts (muon, event, ret);
209  }
210  else {
211  return false;
212  }
213  }
214 
215  // For compatibility with older versions.
216  bool operator()( const pat::Muon & muon, pat::strbitset & ret ) override
217  {
218 
219  if (version_ == SPRING10 || version_ == FALL10 ) throw cms::Exception("LogicError")
220  << "MuonVPlusJetsSelectionFunctor SPRING10 and FALL10 versions needs the event! Call operator()(muon,event,ret)"
221  <<std::endl;
222 
223  else if ( version_ == SUMMER08 ) return summer08Cuts( muon, ret );
224  else if ( version_ == FIRSTDATA ) return firstDataCuts( muon, ret );
225  else {
226  return false;
227  }
228  }
229 
230 
232 
233  // cuts based on craft 08 analysis.
235  {
236 
237  ret.set(false);
238 
239  double norm_chi2 = muon.normChi2();
240  double corr_d0 = muon.dB();
241  int nhits = static_cast<int>( muon.numberOfValidHits() );
242 
243  double ecalVeto = muon.isolationR03().emVetoEt;
244  double hcalVeto = muon.isolationR03().hadVetoEt;
245 
246  double hcalIso = muon.hcalIso();
247  double ecalIso = muon.ecalIso();
248  double trkIso = muon.trackIso();
249  double pt = muon.pt() ;
250 
251  double relIso = (ecalIso + hcalIso + trkIso) / pt;
252 
253  if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ );
254  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
255  if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ );
256  if ( hcalVeto < cut(indexHCalVeto_,double())|| ignoreCut(indexHCalVeto_)) passCut(ret, indexHCalVeto_);
257  if ( ecalVeto < cut(indexECalVeto_,double())|| ignoreCut(indexECalVeto_)) passCut(ret, indexECalVeto_);
258  if ( relIso < cut(indexRelIso_, double()) || ignoreCut(indexRelIso_) ) passCut(ret, indexRelIso_ );
259 
260  setIgnored(ret);
261 
262  return (bool)ret;
263  }
264 
265 
266 
267  // cuts based on craft 08 analysis.
269  {
270 
271  ret.set(false);
272 
273  double norm_chi2 = muon.normChi2();
274  double corr_d0 = muon.dB();
275  double corr_ed0 = muon.edB();
276  double corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
277  int nhits = static_cast<int>( muon.numberOfValidHits() );
278 
279  double ecalVeto = muon.isolationR03().emVetoEt;
280  double hcalVeto = muon.isolationR03().hadVetoEt;
281 
282  double hcalIso = muon.hcalIso();
283  double ecalIso = muon.ecalIso();
284  double trkIso = muon.trackIso();
285  double pt = muon.pt() ;
286 
287  double relIso = (ecalIso + hcalIso + trkIso) / pt;
288 
289  if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ );
290  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
291  if ( fabs(corr_ed0)< cut(indexED0_, double()) || ignoreCut(indexED0_) ) passCut(ret, indexED0_ );
292  if ( fabs(corr_sd0)< cut(indexSD0_, double()) || ignoreCut(indexSD0_) ) passCut(ret, indexSD0_ );
293  if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ );
294  if ( hcalVeto < cut(indexHCalVeto_,double())|| ignoreCut(indexHCalVeto_)) passCut(ret, indexHCalVeto_);
295  if ( ecalVeto < cut(indexECalVeto_,double())|| ignoreCut(indexECalVeto_)) passCut(ret, indexECalVeto_);
296  if ( relIso < cut(indexRelIso_, double()) || ignoreCut(indexRelIso_) ) passCut(ret, indexRelIso_ );
297 
298  setIgnored(ret);
299 
300  return (bool)ret;
301  }
302 
303  // cuts based on top group L+J synchronization exercise
305  {
306 
307  ret.set(false);
308 
309  double norm_chi2 = muon.normChi2();
310  double corr_d0 = muon.dB();
311  double corr_ed0 = muon.edB();
312  double corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
313 
314  //If required, recalculate the impact parameter using the beam spot
315  if (recalcDBFromBSp_) {
316 
317  //Get the beam spot
318  reco::TrackBase::Point beamPoint(0,0,0);
320  edm::Handle<reco::BeamSpot> beamSpotHandle;
321  event.getByLabel(beamLineSrc_, beamSpotHandle);
322 
323  if( beamSpotHandle.isValid() ){
324  beamSpot = *beamSpotHandle;
325  } else{
326  edm::LogError("DataNotAvailable")
327  << "No beam spot available from EventSetup, not adding high level selection \n";
328  }
329  beamPoint = reco::TrackBase::Point ( beamSpot.x0(), beamSpot.y0(), beamSpot.z0() );
330 
331  //Use the beamspot to correct the impact parameter and uncertainty
333  if ( innerTrack.isNonnull() && innerTrack.isAvailable() ) {
334  corr_d0 = -1.0 * innerTrack->dxy( beamPoint );
335  corr_ed0 = sqrt( innerTrack->d0Error() * innerTrack->d0Error()
336  + 0.5* beamSpot.BeamWidthX()*beamSpot.BeamWidthX()
337  + 0.5* beamSpot.BeamWidthY()*beamSpot.BeamWidthY() );
338  corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
339 
340  } else {
341  corr_d0 = 999.;
342  corr_ed0 = 999.;
343  }
344  }
345 
346  int nhits = static_cast<int>( muon.numberOfValidHits() );
347  int nValidMuonHits = static_cast<int> (muon.globalTrack()->hitPattern().numberOfValidMuonHits());
348 
349  double ecalVeto = muon.isolationR03().emVetoEt;
350  double hcalVeto = muon.isolationR03().hadVetoEt;
351 
352  double hcalIso = muon.hcalIso();
353  double ecalIso = muon.ecalIso();
354  double trkIso = muon.trackIso();
355  double pt = muon.pt() ;
356 
357  double relIso = (ecalIso + hcalIso + trkIso) / pt;
358 
359  if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ );
360  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
361  if ( fabs(corr_ed0)< cut(indexED0_, double()) || ignoreCut(indexED0_) ) passCut(ret, indexED0_ );
362  if ( fabs(corr_sd0)< cut(indexSD0_, double()) || ignoreCut(indexSD0_) ) passCut(ret, indexSD0_ );
363  if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ );
364  if ( nValidMuonHits> cut(indexNValMuHits_,int()) || ignoreCut(indexNValMuHits_)) passCut(ret, indexNValMuHits_ );
365  if ( hcalVeto < cut(indexHCalVeto_,double())|| ignoreCut(indexHCalVeto_)) passCut(ret, indexHCalVeto_);
366  if ( ecalVeto < cut(indexECalVeto_,double())|| ignoreCut(indexECalVeto_)) passCut(ret, indexECalVeto_);
367  if ( relIso < cut(indexRelIso_, double()) || ignoreCut(indexRelIso_) ) passCut(ret, indexRelIso_ );
368 
369  setIgnored(ret);
370 
371  return (bool)ret;
372  }
373 
374 
375 
376 
377  // cuts based on top group L+J synchronization exercise
379  {
380 
381  ret.set(false);
382 
383  double norm_chi2 = muon.normChi2();
384  double corr_d0 = muon.dB();
385  double corr_ed0 = muon.edB();
386  double corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
387 
388  // Get the PV for the muon z requirement
390  event.getByLabel( pvSrc_, pvtxHandle_ );
391 
392  double zvtx = -999;
393  if ( !pvtxHandle_->empty() ) {
394  zvtx = pvtxHandle_->at(0).z();
395  } else {
396  throw cms::Exception("InvalidInput") << " There needs to be at least one primary vertex in the event." << std::endl;
397  }
398 
399  //If required, recalculate the impact parameter using the beam spot
400  if (recalcDBFromBSp_) {
401 
402  //Get the beam spot
403  reco::TrackBase::Point beamPoint(0,0,0);
405  edm::Handle<reco::BeamSpot> beamSpotHandle;
406  event.getByLabel(beamLineSrc_, beamSpotHandle);
407 
408  if( beamSpotHandle.isValid() ){
409  beamSpot = *beamSpotHandle;
410  } else{
411  edm::LogError("DataNotAvailable")
412  << "No beam spot available from EventSetup, not adding high level selection \n";
413  }
414  beamPoint = reco::TrackBase::Point ( beamSpot.x0(), beamSpot.y0(), beamSpot.z0() );
415 
416  //Use the beamspot to correct the impact parameter and uncertainty
418  if ( innerTrack.isNonnull() && innerTrack.isAvailable() ) {
419  corr_d0 = -1.0 * innerTrack->dxy( beamPoint );
420  corr_ed0 = sqrt( innerTrack->d0Error() * innerTrack->d0Error()
421  + 0.5* beamSpot.BeamWidthX()*beamSpot.BeamWidthX()
422  + 0.5* beamSpot.BeamWidthY()*beamSpot.BeamWidthY() );
423  corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
424 
425  } else {
426  corr_d0 = 999.;
427  corr_ed0 = 999.;
428  }
429  }
430 
431  int nhits = static_cast<int>( muon.numberOfValidHits() );
432  int nValidMuonHits = static_cast<int> (muon.globalTrack()->hitPattern().numberOfValidMuonHits());
433 
434  double ecalVeto = muon.isolationR03().emVetoEt;
435  double hcalVeto = muon.isolationR03().hadVetoEt;
436 
437  double hcalIso = muon.hcalIso();
438  double ecalIso = muon.ecalIso();
439  double trkIso = muon.trackIso();
440  double pt = muon.pt() ;
441 
442  double relIso = (ecalIso + hcalIso + trkIso) / pt;
443 
444 
445  double z_mu = muon.vertex().z();
446 
447  int nPixelHits = muon.innerTrack()->hitPattern().pixelLayersWithMeasurement();
448 
449  int nMatchedStations = muon.numberOfMatches();
450 
451  if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ );
452  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
453  if ( fabs(corr_ed0)< cut(indexED0_, double()) || ignoreCut(indexED0_) ) passCut(ret, indexED0_ );
454  if ( fabs(corr_sd0)< cut(indexSD0_, double()) || ignoreCut(indexSD0_) ) passCut(ret, indexSD0_ );
455  if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ );
456  if ( nValidMuonHits> cut(indexNValMuHits_,int()) || ignoreCut(indexNValMuHits_)) passCut(ret, indexNValMuHits_ );
457  if ( hcalVeto < cut(indexHCalVeto_,double())|| ignoreCut(indexHCalVeto_)) passCut(ret, indexHCalVeto_);
458  if ( ecalVeto < cut(indexECalVeto_,double())|| ignoreCut(indexECalVeto_)) passCut(ret, indexECalVeto_);
459  if ( relIso < cut(indexRelIso_, double()) || ignoreCut(indexRelIso_) ) passCut(ret, indexRelIso_ );
460  if ( fabs(z_mu-zvtx)< cut(indexLepZ_, double()) || ignoreCut(indexLepZ_) ) passCut(ret, indexLepZ_ );
461  if ( nPixelHits > cut(indexPixHits_,int()) || ignoreCut(indexPixHits_)) passCut(ret, indexPixHits_);
462  if ( nMatchedStations> cut(indexStations_,int()) || ignoreCut(indexStations_)) passCut(ret, indexStations_);
463 
464  setIgnored(ret);
465 
466  return (bool)ret;
467  }
468 
469 
470  // cuts based on top group L+J synchronization exercise
471  // this is a copy of fall 10 cuts
472  // with a hack to include a double-sided reliso cut
473 
475  {
476 
477  ret.set(false);
478 
479  double norm_chi2 = muon.normChi2();
480  double corr_d0 = muon.dB();
481  double corr_ed0 = muon.edB();
482  double corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
483 
484  // Get the PV for the muon z requirement
486  event.getByLabel( pvSrc_, pvtxHandle_ );
487 
488  double zvtx = -999;
489  if ( !pvtxHandle_->empty() ) {
490  zvtx = pvtxHandle_->at(0).z();
491  } else {
492  throw cms::Exception("InvalidInput") << " There needs to be at least one primary vertex in the event." << std::endl;
493  }
494 
495  //If required, recalculate the impact parameter using the beam spot
496  if (recalcDBFromBSp_) {
497 
498  //Get the beam spot
499  reco::TrackBase::Point beamPoint(0,0,0);
501  edm::Handle<reco::BeamSpot> beamSpotHandle;
502  event.getByLabel(beamLineSrc_, beamSpotHandle);
503 
504  if( beamSpotHandle.isValid() ){
505  beamSpot = *beamSpotHandle;
506  } else{
507  edm::LogError("DataNotAvailable")
508  << "No beam spot available from EventSetup, not adding high level selection \n";
509  }
510  beamPoint = reco::TrackBase::Point ( beamSpot.x0(), beamSpot.y0(), beamSpot.z0() );
511 
512  //Use the beamspot to correct the impact parameter and uncertainty
514  if ( innerTrack.isNonnull() && innerTrack.isAvailable() ) {
515  corr_d0 = -1.0 * innerTrack->dxy( beamPoint );
516  corr_ed0 = sqrt( innerTrack->d0Error() * innerTrack->d0Error()
517  + 0.5* beamSpot.BeamWidthX()*beamSpot.BeamWidthX()
518  + 0.5* beamSpot.BeamWidthY()*beamSpot.BeamWidthY() );
519  corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
520 
521  } else {
522  corr_d0 = 999.;
523  corr_ed0 = 999.;
524  }
525  }
526 
527  int nhits = static_cast<int>( muon.numberOfValidHits() );
528  int nValidMuonHits = static_cast<int> (muon.globalTrack()->hitPattern().numberOfValidMuonHits());
529 
530  double ecalVeto = muon.isolationR03().emVetoEt;
531  double hcalVeto = muon.isolationR03().hadVetoEt;
532 
533  double hcalIso = muon.hcalIso();
534  double ecalIso = muon.ecalIso();
535  double trkIso = muon.trackIso();
536  double pt = muon.pt() ;
537 
538  double relIso = (ecalIso + hcalIso + trkIso) / pt;
539 
540 
541  double z_mu = muon.vertex().z();
542 
543  int nPixelHits = muon.innerTrack()->hitPattern().pixelLayersWithMeasurement();
544 
545  int nMatchedStations = muon.numberOfMatches();
546 
547  if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ );
548  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
549  if ( fabs(corr_ed0)< cut(indexED0_, double()) || ignoreCut(indexED0_) ) passCut(ret, indexED0_ );
550  if ( fabs(corr_sd0)< cut(indexSD0_, double()) || ignoreCut(indexSD0_) ) passCut(ret, indexSD0_ );
551  if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ );
552  if ( nValidMuonHits> cut(indexNValMuHits_,int()) || ignoreCut(indexNValMuHits_)) passCut(ret, indexNValMuHits_ );
553  if ( hcalVeto < cut(indexHCalVeto_,double())|| ignoreCut(indexHCalVeto_)) passCut(ret, indexHCalVeto_);
554  if ( ecalVeto < cut(indexECalVeto_,double())|| ignoreCut(indexECalVeto_)) passCut(ret, indexECalVeto_);
555  if ( fabs(z_mu-zvtx)< cut(indexLepZ_, double()) || ignoreCut(indexLepZ_) ) passCut(ret, indexLepZ_ );
556  if ( nPixelHits > cut(indexPixHits_,int()) || ignoreCut(indexPixHits_)) passCut(ret, indexPixHits_);
557  if ( nMatchedStations> cut(indexStations_,int()) || ignoreCut(indexStations_)) passCut(ret, indexStations_);
558 
559 
561  //
562  // JMS Dec 13 2010
563  // HACK
564  // Need double-sided relIso cut to implement data-driven QCD
565  //
566  //
568  if ( ((relIso > 0.2) && (relIso < 0.75))
570 
571 
572 
573 
574  setIgnored(ret);
575 
576  return (bool)ret;
577  }
578 
579 
580 
581 
582  private: // member variables
583 
587 #ifndef __GCCXML__
589 #endif
591 #ifndef __GCCXML__
593 #endif
594 
607 
608 
609 };
610 
611 #endif
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
double z0() const
z coordinate
Definition: BeamSpot.h:68
float ecalIso() const
Definition: Muon.h:183
bool fall10Cuts(const pat::Muon &muon, edm::EventBase const &event, pat::strbitset &ret)
edm::EDGetTokenT< std::vector< reco::Vertex > > pvSrcToken_
bool firstDataCuts(const pat::Muon &muon, pat::strbitset &ret)
void initialize(Version_t version, double chi2=10.0, double d0=999.0, double ed0=999.0, double sd0=3.0, int nhits=11, int nValidMuonHits=0, double ecalveto=4.0, double hcalveto=6.0, double reliso=0.05, double maxLepZ=1.0, int minPixelHits=1, int minNMatches=1)
bool operator()(const pat::Muon &muon, edm::EventBase const &event, pat::strbitset &ret) override
MuonVPlusJetsIDSelectionFunctor(edm::ParameterSet const &parameters, edm::ConsumesCollector &iC)
bool exists(std::string const &parameterName) const
checks if a parameter exists
float hadVetoEt
hcal sum-et in the veto region in r-phi
Definition: MuonIsolation.h:15
double dB(IPTYPE type) const
double pt() const final
transverse momentum
pat::strbitset::index_type index_type
Definition: Selector.h:27
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:222
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:285
float trackIso() const
Definition: Muon.h:179
bool summer08Cuts(const pat::Muon &muon, pat::strbitset &ret)
float hcalIso() const
Definition: Muon.h:187
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:284
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:174
reco::TrackRef innerTrack() const override
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
Definition: Muon.h:72
T sqrt(T t)
Definition: SSEVec.h:18
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
Definition: Selector.h:157
const Point & vertex() const override
vertex position (overwritten by PF...)
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Definition: Selector.h:44
math::XYZPoint Point
point in the space
Definition: TrackBase.h:83
bool isValid() const
Definition: HandleBase.h:74
Functor that operates on <T>
Definition: Selector.h:23
double edB(IPTYPE type) const
edm::EDGetTokenT< reco::BeamSpot > beamLineSrcToken_
MuonVPlusJetsIDSelectionFunctor(Version_t version, double chi2=10.0, double d0=0.2, double ed0=999.0, double sd0=999.0, int nhits=11, int nValidMuonHits=0, double ecalveto=4.0, double hcalveto=6.0, double reliso=0.05, double maxLepZ=1.0, int minPixelHits=1, int minNMatches=1)
bool spring10Cuts(const pat::Muon &muon, edm::EventBase const &event, pat::strbitset &ret)
bool operator()(const pat::Muon &muon, pat::strbitset &ret) override
float emVetoEt
ecal sum-et in the veto region in r-phi
Definition: MuonIsolation.h:14
reco::TrackRef globalTrack() const override
reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon) ...
Definition: Muon.h:80
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
Definition: Selector.h:210
MuonVPlusJetsIDSelectionFunctor(edm::ParameterSet const &parameters)
double y0() const
y coordinate
Definition: BeamSpot.h:66
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
Definition: Selector.h:165
unsigned int numberOfValidHits() const
numberOfValidHits returns the number of valid hits on the global track.
bool kitQCDCuts(const pat::Muon &muon, edm::EventBase const &event, pat::strbitset &ret)
double normChi2() const
Norm chi2 gives the normalized chi2 of the global track.
Analysis-level muon class.
Definition: Muon.h:51
const MuonIsolation & isolationR03() const
Definition: Muon.h:162
Definition: event.py:1
int cut(index_type const &i, int val) const
Access the int cut values at index "s".
Definition: Selector.h:192
double x0() const
x coordinate
Definition: BeamSpot.h:64