CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
10 
13 
14 #include <iostream>
15 
16 class MuonVPlusJetsIDSelectionFunctor : public Selector<pat::Muon> {
17 
18  public: // interface
19 
20  bool verbose_;
21 
23 
25 
26 #ifndef __GCCXML__
29  {
31  pvSrcToken_ = iC.consumes<std::vector<reco::Vertex> >(pvSrc_);
32  }
33 #endif
34 
36 
37  verbose_ = false;
38 
39  std::string versionStr = parameters.getParameter<std::string>("version");
40 
42 
43  if ( versionStr == "SUMMER08" ) {
44  version = SUMMER08;
45  }
46  else if ( versionStr == "FIRSTDATA" ) {
47  version = FIRSTDATA;
48  }
49  else if ( versionStr == "SPRING10" ) {
50  version = SPRING10;
51  }
52  else if ( versionStr == "FALL10" ) {
53  version = FALL10;
54  if (verbose_) std::cout << "\nMUON SELECTION - you are using FALL10 Selection" << std::endl;
55  }
56  else if (versionStr == "KITQCD") {
57  version = KITQCD;
58  if (verbose_) std::cout << "\nMUON SELECTION - you are using KITQCD Selection" << std::endl;
59  }
60  else {
61  throw cms::Exception("InvalidInput") << "Expect version to be one of SUMMER08, FIRSTDATA, SPRING10, FALL10" << std::endl;
62  }
63 
64  initialize( version,
65  parameters.getParameter<double>("Chi2"),
66  parameters.getParameter<double>("D0") ,
67  parameters.getParameter<double>("ED0") ,
68  parameters.getParameter<double>("SD0") ,
69  parameters.getParameter<int> ("NHits") ,
70  parameters.getParameter<int> ("NValMuHits"),
71  parameters.getParameter<double>("ECalVeto") ,
72  parameters.getParameter<double>("HCalVeto") ,
73  parameters.getParameter<double>("RelIso"),
74  parameters.getParameter<double>("LepZ"),
75  parameters.getParameter<int>("nPixelHits"),
76  parameters.getParameter<int>("nMatchedStations")
77  );
78  if ( parameters.exists("cutsToIgnore") )
79  setIgnoredCuts( parameters.getParameter<std::vector<std::string> >("cutsToIgnore") );
80 
82 
83  recalcDBFromBSp_ = parameters.getParameter<bool>("RecalcFromBeamSpot");
84  pvSrc_ = parameters.getParameter<edm::InputTag>("pvSrc");
85  }
86 
87 
89  double chi2 = 10.0,
90  double d0 = 0.2,
91  double ed0 = 999.0,
92  double sd0 = 999.0,
93  int nhits = 11,
94  int nValidMuonHits = 0,
95  double ecalveto = 4.0,
96  double hcalveto = 6.0,
97  double reliso = 0.05,
98  double maxLepZ = 1.0,
99  int minPixelHits = 1,
100  int minNMatches = 1
101  ) : recalcDBFromBSp_(false) {
102  initialize( version, chi2, d0, ed0, sd0, nhits, nValidMuonHits, ecalveto, hcalveto, reliso,
103  maxLepZ, minPixelHits, minNMatches );
104 
106  }
107 
108 
109 
110 
112  double chi2 = 10.0,
113  double d0 = 999.0,
114  double ed0 = 999.0,
115  double sd0 = 3.0,
116  int nhits = 11,
117  int nValidMuonHits = 0,
118  double ecalveto = 4.0,
119  double hcalveto = 6.0,
120  double reliso = 0.05,
121  double maxLepZ = 1.0,
122  int minPixelHits = 1,
123  int minNMatches = 1 )
124  {
125  version_ = version;
126 
127  push_back("Chi2", chi2 );
128  push_back("D0", d0 );
129  push_back("ED0", ed0 );
130  push_back("SD0", sd0 );
131  push_back("NHits", nhits );
132  push_back("NValMuHits", nValidMuonHits );
133  push_back("ECalVeto", ecalveto);
134  push_back("HCalVeto", hcalveto);
135  push_back("RelIso", reliso );
136  push_back("LepZ", maxLepZ);
137  push_back("nPixelHits",minPixelHits);
138  push_back("nMatchedStations", minNMatches);
139 
140  set("Chi2");
141  set("D0");
142  set("ED0");
143  set("SD0");
144  set("NHits");
145  set("NValMuHits");
146  set("ECalVeto");
147  set("HCalVeto");
148  set("RelIso");
149  set("LepZ");
150  set("nPixelHits");
151  set("nMatchedStations");
152 
153  indexChi2_ = index_type(&bits_, "Chi2" );
154  indexD0_ = index_type(&bits_, "D0" );
155  indexED0_ = index_type(&bits_, "ED0" );
156  indexSD0_ = index_type(&bits_, "SD0" );
157  indexNHits_ = index_type(&bits_, "NHits" );
158  indexNValMuHits_ = index_type(&bits_, "NValMuHits" );
159  indexECalVeto_ = index_type(&bits_, "ECalVeto" );
160  indexHCalVeto_ = index_type(&bits_, "HCalVeto" );
161  indexRelIso_ = index_type(&bits_, "RelIso" );
162  indexLepZ_ = index_type( &bits_, "LepZ");
163  indexPixHits_ = index_type( &bits_, "nPixelHits");
164  indexStations_ = index_type( &bits_, "nMatchedStations");
165 
166  if ( version == FALL10) {
167  set("ED0", false );
168  set("SD0", false);
169  set("ECalVeto",false);
170  set("HCalVeto",false);
171  } else if ( version == SPRING10) {
172  set("ED0", false );
173  set("SD0", false);
174  set("ECalVeto",false);
175  set("HCalVeto",false);
176  set("LepZ", false);
177  set("nPixelHits", false);
178  set("nMatchedStations", false);
179  } else if ( version_ == FIRSTDATA ) {
180  set("D0", false );
181  set("ED0", false );
182  set("NValMuHits",false);
183  set("LepZ", false);
184  set("nPixelHits", false);
185  set("nMatchedStations", false);
186  } else if (version == SUMMER08 ) {
187  set("SD0", false);
188  set("NValMuHits",false);
189  set("LepZ", false);
190  set("nPixelHits", false);
191  set("nMatchedStations", false);
192 
193  }
194 
195  }
196 
197  // Allow for multiple definitions of the cuts.
199  {
200 
201  if (version_ == FALL10 ) return fall10Cuts(muon, event, ret);
202  else if (version_ == SPRING10 ) return spring10Cuts(muon, event, ret);
203  else if ( version_ == SUMMER08 ) return summer08Cuts( muon, ret );
204  else if ( version_ == FIRSTDATA ) return firstDataCuts( muon, ret );
205  else if ( version_ == KITQCD ) {
206  if (verbose_) std::cout << "Calling KIT selection method" << std::endl;
207  return kitQCDCuts (muon, event, ret);
208  }
209  else {
210  return false;
211  }
212  }
213 
214  // For compatibility with older versions.
216  {
217 
218  if (version_ == SPRING10 || version_ == FALL10 ) throw cms::Exception("LogicError")
219  << "MuonVPlusJetsSelectionFunctor SPRING10 and FALL10 versions needs the event! Call operator()(muon,event,ret)"
220  <<std::endl;
221 
222  else if ( version_ == SUMMER08 ) return summer08Cuts( muon, ret );
223  else if ( version_ == FIRSTDATA ) return firstDataCuts( muon, ret );
224  else {
225  return false;
226  }
227  }
228 
229 
231 
232  // cuts based on craft 08 analysis.
234  {
235 
236  ret.set(false);
237 
238  double norm_chi2 = muon.normChi2();
239  double corr_d0 = muon.dB();
240  int nhits = static_cast<int>( muon.numberOfValidHits() );
241 
242  double ecalVeto = muon.isolationR03().emVetoEt;
243  double hcalVeto = muon.isolationR03().hadVetoEt;
244 
245  double hcalIso = muon.hcalIso();
246  double ecalIso = muon.ecalIso();
247  double trkIso = muon.trackIso();
248  double pt = muon.pt() ;
249 
250  double relIso = (ecalIso + hcalIso + trkIso) / pt;
251 
252  if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ );
253  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
254  if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ );
255  if ( hcalVeto < cut(indexHCalVeto_,double())|| ignoreCut(indexHCalVeto_)) passCut(ret, indexHCalVeto_);
256  if ( ecalVeto < cut(indexECalVeto_,double())|| ignoreCut(indexECalVeto_)) passCut(ret, indexECalVeto_);
257  if ( relIso < cut(indexRelIso_, double()) || ignoreCut(indexRelIso_) ) passCut(ret, indexRelIso_ );
258 
259  setIgnored(ret);
260 
261  return (bool)ret;
262  }
263 
264 
265 
266  // cuts based on craft 08 analysis.
268  {
269 
270  ret.set(false);
271 
272  double norm_chi2 = muon.normChi2();
273  double corr_d0 = muon.dB();
274  double corr_ed0 = muon.edB();
275  double corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
276  int nhits = static_cast<int>( muon.numberOfValidHits() );
277 
278  double ecalVeto = muon.isolationR03().emVetoEt;
279  double hcalVeto = muon.isolationR03().hadVetoEt;
280 
281  double hcalIso = muon.hcalIso();
282  double ecalIso = muon.ecalIso();
283  double trkIso = muon.trackIso();
284  double pt = muon.pt() ;
285 
286  double relIso = (ecalIso + hcalIso + trkIso) / pt;
287 
288  if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ );
289  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
290  if ( fabs(corr_ed0)< cut(indexED0_, double()) || ignoreCut(indexED0_) ) passCut(ret, indexED0_ );
291  if ( fabs(corr_sd0)< cut(indexSD0_, double()) || ignoreCut(indexSD0_) ) passCut(ret, indexSD0_ );
292  if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ );
293  if ( hcalVeto < cut(indexHCalVeto_,double())|| ignoreCut(indexHCalVeto_)) passCut(ret, indexHCalVeto_);
294  if ( ecalVeto < cut(indexECalVeto_,double())|| ignoreCut(indexECalVeto_)) passCut(ret, indexECalVeto_);
295  if ( relIso < cut(indexRelIso_, double()) || ignoreCut(indexRelIso_) ) passCut(ret, indexRelIso_ );
296 
297  setIgnored(ret);
298 
299  return (bool)ret;
300  }
301 
302  // cuts based on top group L+J synchronization exercise
304  {
305 
306  ret.set(false);
307 
308  double norm_chi2 = muon.normChi2();
309  double corr_d0 = muon.dB();
310  double corr_ed0 = muon.edB();
311  double corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
312 
313  //If required, recalculate the impact parameter using the beam spot
314  if (recalcDBFromBSp_) {
315 
316  //Get the beam spot
317  reco::TrackBase::Point beamPoint(0,0,0);
319  edm::Handle<reco::BeamSpot> beamSpotHandle;
320  event.getByLabel(beamLineSrc_, beamSpotHandle);
321 
322  if( beamSpotHandle.isValid() ){
323  beamSpot = *beamSpotHandle;
324  } else{
325  edm::LogError("DataNotAvailable")
326  << "No beam spot available from EventSetup, not adding high level selection \n";
327  }
328  beamPoint = reco::TrackBase::Point ( beamSpot.x0(), beamSpot.y0(), beamSpot.z0() );
329 
330  //Use the beamspot to correct the impact parameter and uncertainty
332  if ( innerTrack.isNonnull() && innerTrack.isAvailable() ) {
333  corr_d0 = -1.0 * innerTrack->dxy( beamPoint );
334  corr_ed0 = sqrt( innerTrack->d0Error() * innerTrack->d0Error()
335  + 0.5* beamSpot.BeamWidthX()*beamSpot.BeamWidthX()
336  + 0.5* beamSpot.BeamWidthY()*beamSpot.BeamWidthY() );
337  corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
338 
339  } else {
340  corr_d0 = 999.;
341  corr_ed0 = 999.;
342  }
343  }
344 
345  int nhits = static_cast<int>( muon.numberOfValidHits() );
346  int nValidMuonHits = static_cast<int> (muon.globalTrack()->hitPattern().numberOfValidMuonHits());
347 
348  double ecalVeto = muon.isolationR03().emVetoEt;
349  double hcalVeto = muon.isolationR03().hadVetoEt;
350 
351  double hcalIso = muon.hcalIso();
352  double ecalIso = muon.ecalIso();
353  double trkIso = muon.trackIso();
354  double pt = muon.pt() ;
355 
356  double relIso = (ecalIso + hcalIso + trkIso) / pt;
357 
358  if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ );
359  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
360  if ( fabs(corr_ed0)< cut(indexED0_, double()) || ignoreCut(indexED0_) ) passCut(ret, indexED0_ );
361  if ( fabs(corr_sd0)< cut(indexSD0_, double()) || ignoreCut(indexSD0_) ) passCut(ret, indexSD0_ );
362  if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ );
363  if ( nValidMuonHits> cut(indexNValMuHits_,int()) || ignoreCut(indexNValMuHits_)) passCut(ret, indexNValMuHits_ );
364  if ( hcalVeto < cut(indexHCalVeto_,double())|| ignoreCut(indexHCalVeto_)) passCut(ret, indexHCalVeto_);
365  if ( ecalVeto < cut(indexECalVeto_,double())|| ignoreCut(indexECalVeto_)) passCut(ret, indexECalVeto_);
366  if ( relIso < cut(indexRelIso_, double()) || ignoreCut(indexRelIso_) ) passCut(ret, indexRelIso_ );
367 
368  setIgnored(ret);
369 
370  return (bool)ret;
371  }
372 
373 
374 
375 
376  // cuts based on top group L+J synchronization exercise
378  {
379 
380  ret.set(false);
381 
382  double norm_chi2 = muon.normChi2();
383  double corr_d0 = muon.dB();
384  double corr_ed0 = muon.edB();
385  double corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
386 
387  // Get the PV for the muon z requirement
389  event.getByLabel( pvSrc_, pvtxHandle_ );
390 
391  double zvtx = -999;
392  if ( pvtxHandle_->size() > 0 ) {
393  zvtx = pvtxHandle_->at(0).z();
394  } else {
395  throw cms::Exception("InvalidInput") << " There needs to be at least one primary vertex in the event." << std::endl;
396  }
397 
398  //If required, recalculate the impact parameter using the beam spot
399  if (recalcDBFromBSp_) {
400 
401  //Get the beam spot
402  reco::TrackBase::Point beamPoint(0,0,0);
404  edm::Handle<reco::BeamSpot> beamSpotHandle;
405  event.getByLabel(beamLineSrc_, beamSpotHandle);
406 
407  if( beamSpotHandle.isValid() ){
408  beamSpot = *beamSpotHandle;
409  } else{
410  edm::LogError("DataNotAvailable")
411  << "No beam spot available from EventSetup, not adding high level selection \n";
412  }
413  beamPoint = reco::TrackBase::Point ( beamSpot.x0(), beamSpot.y0(), beamSpot.z0() );
414 
415  //Use the beamspot to correct the impact parameter and uncertainty
417  if ( innerTrack.isNonnull() && innerTrack.isAvailable() ) {
418  corr_d0 = -1.0 * innerTrack->dxy( beamPoint );
419  corr_ed0 = sqrt( innerTrack->d0Error() * innerTrack->d0Error()
420  + 0.5* beamSpot.BeamWidthX()*beamSpot.BeamWidthX()
421  + 0.5* beamSpot.BeamWidthY()*beamSpot.BeamWidthY() );
422  corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
423 
424  } else {
425  corr_d0 = 999.;
426  corr_ed0 = 999.;
427  }
428  }
429 
430  int nhits = static_cast<int>( muon.numberOfValidHits() );
431  int nValidMuonHits = static_cast<int> (muon.globalTrack()->hitPattern().numberOfValidMuonHits());
432 
433  double ecalVeto = muon.isolationR03().emVetoEt;
434  double hcalVeto = muon.isolationR03().hadVetoEt;
435 
436  double hcalIso = muon.hcalIso();
437  double ecalIso = muon.ecalIso();
438  double trkIso = muon.trackIso();
439  double pt = muon.pt() ;
440 
441  double relIso = (ecalIso + hcalIso + trkIso) / pt;
442 
443 
444  double z_mu = muon.vertex().z();
445 
446  int nPixelHits = muon.innerTrack()->hitPattern().pixelLayersWithMeasurement();
447 
448  int nMatchedStations = muon.numberOfMatches();
449 
450  if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ );
451  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
452  if ( fabs(corr_ed0)< cut(indexED0_, double()) || ignoreCut(indexED0_) ) passCut(ret, indexED0_ );
453  if ( fabs(corr_sd0)< cut(indexSD0_, double()) || ignoreCut(indexSD0_) ) passCut(ret, indexSD0_ );
454  if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ );
455  if ( nValidMuonHits> cut(indexNValMuHits_,int()) || ignoreCut(indexNValMuHits_)) passCut(ret, indexNValMuHits_ );
456  if ( hcalVeto < cut(indexHCalVeto_,double())|| ignoreCut(indexHCalVeto_)) passCut(ret, indexHCalVeto_);
457  if ( ecalVeto < cut(indexECalVeto_,double())|| ignoreCut(indexECalVeto_)) passCut(ret, indexECalVeto_);
458  if ( relIso < cut(indexRelIso_, double()) || ignoreCut(indexRelIso_) ) passCut(ret, indexRelIso_ );
459  if ( fabs(z_mu-zvtx)< cut(indexLepZ_, double()) || ignoreCut(indexLepZ_) ) passCut(ret, indexLepZ_ );
460  if ( nPixelHits > cut(indexPixHits_,int()) || ignoreCut(indexPixHits_)) passCut(ret, indexPixHits_);
461  if ( nMatchedStations> cut(indexStations_,int()) || ignoreCut(indexStations_)) passCut(ret, indexStations_);
462 
463  setIgnored(ret);
464 
465  return (bool)ret;
466  }
467 
468 
469  // cuts based on top group L+J synchronization exercise
470  // this is a copy of fall 10 cuts
471  // with a hack to include a double-sided reliso cut
472 
474  {
475 
476  ret.set(false);
477 
478  double norm_chi2 = muon.normChi2();
479  double corr_d0 = muon.dB();
480  double corr_ed0 = muon.edB();
481  double corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
482 
483  // Get the PV for the muon z requirement
485  event.getByLabel( pvSrc_, pvtxHandle_ );
486 
487  double zvtx = -999;
488  if ( pvtxHandle_->size() > 0 ) {
489  zvtx = pvtxHandle_->at(0).z();
490  } else {
491  throw cms::Exception("InvalidInput") << " There needs to be at least one primary vertex in the event." << std::endl;
492  }
493 
494  //If required, recalculate the impact parameter using the beam spot
495  if (recalcDBFromBSp_) {
496 
497  //Get the beam spot
498  reco::TrackBase::Point beamPoint(0,0,0);
500  edm::Handle<reco::BeamSpot> beamSpotHandle;
501  event.getByLabel(beamLineSrc_, beamSpotHandle);
502 
503  if( beamSpotHandle.isValid() ){
504  beamSpot = *beamSpotHandle;
505  } else{
506  edm::LogError("DataNotAvailable")
507  << "No beam spot available from EventSetup, not adding high level selection \n";
508  }
509  beamPoint = reco::TrackBase::Point ( beamSpot.x0(), beamSpot.y0(), beamSpot.z0() );
510 
511  //Use the beamspot to correct the impact parameter and uncertainty
513  if ( innerTrack.isNonnull() && innerTrack.isAvailable() ) {
514  corr_d0 = -1.0 * innerTrack->dxy( beamPoint );
515  corr_ed0 = sqrt( innerTrack->d0Error() * innerTrack->d0Error()
516  + 0.5* beamSpot.BeamWidthX()*beamSpot.BeamWidthX()
517  + 0.5* beamSpot.BeamWidthY()*beamSpot.BeamWidthY() );
518  corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
519 
520  } else {
521  corr_d0 = 999.;
522  corr_ed0 = 999.;
523  }
524  }
525 
526  int nhits = static_cast<int>( muon.numberOfValidHits() );
527  int nValidMuonHits = static_cast<int> (muon.globalTrack()->hitPattern().numberOfValidMuonHits());
528 
529  double ecalVeto = muon.isolationR03().emVetoEt;
530  double hcalVeto = muon.isolationR03().hadVetoEt;
531 
532  double hcalIso = muon.hcalIso();
533  double ecalIso = muon.ecalIso();
534  double trkIso = muon.trackIso();
535  double pt = muon.pt() ;
536 
537  double relIso = (ecalIso + hcalIso + trkIso) / pt;
538 
539 
540  double z_mu = muon.vertex().z();
541 
542  int nPixelHits = muon.innerTrack()->hitPattern().pixelLayersWithMeasurement();
543 
544  int nMatchedStations = muon.numberOfMatches();
545 
546  if ( norm_chi2 < cut(indexChi2_, double()) || ignoreCut(indexChi2_) ) passCut(ret, indexChi2_ );
547  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
548  if ( fabs(corr_ed0)< cut(indexED0_, double()) || ignoreCut(indexED0_) ) passCut(ret, indexED0_ );
549  if ( fabs(corr_sd0)< cut(indexSD0_, double()) || ignoreCut(indexSD0_) ) passCut(ret, indexSD0_ );
550  if ( nhits >= cut(indexNHits_, int() ) || ignoreCut(indexNHits_) ) passCut(ret, indexNHits_ );
551  if ( nValidMuonHits> cut(indexNValMuHits_,int()) || ignoreCut(indexNValMuHits_)) passCut(ret, indexNValMuHits_ );
552  if ( hcalVeto < cut(indexHCalVeto_,double())|| ignoreCut(indexHCalVeto_)) passCut(ret, indexHCalVeto_);
553  if ( ecalVeto < cut(indexECalVeto_,double())|| ignoreCut(indexECalVeto_)) passCut(ret, indexECalVeto_);
554  if ( fabs(z_mu-zvtx)< cut(indexLepZ_, double()) || ignoreCut(indexLepZ_) ) passCut(ret, indexLepZ_ );
555  if ( nPixelHits > cut(indexPixHits_,int()) || ignoreCut(indexPixHits_)) passCut(ret, indexPixHits_);
556  if ( nMatchedStations> cut(indexStations_,int()) || ignoreCut(indexStations_)) passCut(ret, indexStations_);
557 
558 
560  //
561  // JMS Dec 13 2010
562  // HACK
563  // Need double-sided relIso cut to implement data-driven QCD
564  //
565  //
567  if ( ((relIso > 0.2) && (relIso < 0.75))
569 
570 
571 
572 
573  setIgnored(ret);
574 
575  return (bool)ret;
576  }
577 
578 
579 
580 
581  private: // member variables
582 
586 #ifndef __GCCXML__
588 #endif
590 #ifndef __GCCXML__
592 #endif
593 
606 
607 
608 };
609 
610 #endif
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
Definition: Selector.h:105
double z0() const
z coordinate
Definition: BeamSpot.h:68
float ecalIso() const
Definition: Muon.h:174
dictionary parameters
Definition: Parameters.py:2
bool fall10Cuts(const pat::Muon &muon, edm::EventBase const &event, pat::strbitset &ret)
reco::TrackRef innerTrack() const
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
Definition: Muon.h:72
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)
virtual const Point & vertex() const
vertex position (overwritten by PF...)
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
pat::strbitset::index_type index_type
Definition: Selector.h:29
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
bool operator()(const pat::Muon &muon, pat::strbitset &ret)
This provides the interface for base classes to select objects.
virtual double pt() const
transverse momentum
float trackIso() const
Definition: Muon.h:170
bool summer08Cuts(const pat::Muon &muon, pat::strbitset &ret)
float hcalIso() const
Definition: Muon.h:178
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
T sqrt(T t)
Definition: SSEVec.h:48
bool ignoreCut(std::string const &s) const
ignore the cut at index &quot;s&quot;
Definition: Selector.h:159
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:46
math::XYZPoint Point
point in the space
Definition: TrackBase.h:83
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isValid() const
Definition: HandleBase.h:75
Functor that operates on &lt;T&gt;
Definition: Selector.h:24
double edB(IPTYPE type) const
edm::EDGetTokenT< reco::BeamSpot > beamLineSrcToken_
reco::TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon) ...
Definition: Muon.h:80
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)
float emVetoEt
ecal sum-et in the veto region in r-phi
Definition: MuonIsolation.h:14
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:212
MuonVPlusJetsIDSelectionFunctor(edm::ParameterSet const &parameters)
double y0() const
y coordinate
Definition: BeamSpot.h:66
bool operator()(const pat::Muon &muon, edm::EventBase const &event, pat::strbitset &ret)
This provides an alternative signature that includes extra information.
tuple cout
Definition: gather_cfg.py:121
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
Definition: Selector.h:167
volatile std::atomic< bool > shutdown_flag false
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:49
const MuonIsolation & isolationR03() const
Definition: Muon.h:158
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:194
double x0() const
x coordinate
Definition: BeamSpot.h:64