CMS 3D CMS Logo

MuonSelectors.cc
Go to the documentation of this file.
7 
8 namespace muon {
11  bool found = false;
12  for (int i = 0; selectionTypeStringToEnumMap[i].label && (!found); ++i)
13  if (!strcmp(label.c_str(), selectionTypeStringToEnumMap[i].label)) {
14  found = true;
16  }
17 
18  // in case of unrecognized selection type
19  if (!found)
20  throw cms::Exception("MuonSelectorError") << label << " is not a recognized SelectionType";
21  return value;
22  }
23 
26  bool found = false;
27  for (int i = 0; selectorStringToEnumMap[i].label && (!found); ++i)
28  if (!strcmp(label.c_str(), selectorStringToEnumMap[i].label)) {
29  found = true;
31  }
32 
33  // in case of unrecognized selection type
34  if (!found)
35  throw cms::Exception("MuonSelectorError") << label << " is not a recognized reco::Muon::Selector";
36  return value;
37  }
38 } // namespace muon
39 
41  double maxChamberDist,
42  double maxChamberDistPull,
43  reco::Muon::ArbitrationType arbitrationType) {
44  unsigned int theMask = 0;
45 
46  for (int stationIdx = 1; stationIdx < 5; ++stationIdx)
47  for (int detectorIdx = 1; detectorIdx < 3; ++detectorIdx)
48  if (muon.trackDist(stationIdx, detectorIdx, arbitrationType) < maxChamberDist &&
49  muon.trackDist(stationIdx, detectorIdx, arbitrationType) /
50  muon.trackDistErr(stationIdx, detectorIdx, arbitrationType) <
51  maxChamberDistPull)
52  theMask += 1 << ((stationIdx - 1) + 4 * (detectorIdx - 1));
53 
54  return theMask;
55 }
56 
57 // ------------ method to calculate the calo compatibility for a track with matched muon info ------------
58 float muon::caloCompatibility(const reco::Muon& muon) { return muon.caloCompatibility(); }
59 
60 // ------------ method to calculate the segment compatibility for a track with matched muon info ------------
62  bool use_weight_regain_at_chamber_boundary = true;
63  bool use_match_dist_penalty = true;
64 
65  int nr_of_stations_crossed = 0;
66  int nr_of_stations_with_segment = 0;
67  std::vector<int> stations_w_track(8);
68  std::vector<int> station_has_segmentmatch(8);
69  std::vector<int> station_was_crossed(8);
70  std::vector<float> stations_w_track_at_boundary(8);
71  std::vector<float> station_weight(8);
72  int position_in_stations = 0;
73  float full_weight = 0.;
74 
75  for (int i = 1; i <= 8; ++i) {
76  // ********************************************************;
77  // *** fill local info for this muon (do some counting) ***;
78  // ************** begin ***********************************;
79  if (i <= 4) { // this is the section for the DTs
80  if (muon.trackDist(i, 1, arbitrationType) < 999999) { //current "raw" info that a track is close to a chamber
81  ++nr_of_stations_crossed;
82  station_was_crossed[i - 1] = 1;
83  if (muon.trackDist(i, 1, arbitrationType) > -10.)
84  stations_w_track_at_boundary[i - 1] = muon.trackDist(i, 1, arbitrationType);
85  else
86  stations_w_track_at_boundary[i - 1] = 0.;
87  }
88  //current "raw" info that a segment is matched to the current track
89  if (muon.segmentX(i, 1, arbitrationType) < 999999) {
90  ++nr_of_stations_with_segment;
91  station_has_segmentmatch[i - 1] = 1;
92  }
93  } else { // this is the section for the CSCs
94  if (muon.trackDist(i - 4, 2, arbitrationType) < 999999) { //current "raw" info that a track is close to a chamber
95  ++nr_of_stations_crossed;
96  station_was_crossed[i - 1] = 1;
97  if (muon.trackDist(i - 4, 2, arbitrationType) > -10.)
98  stations_w_track_at_boundary[i - 1] = muon.trackDist(i - 4, 2, arbitrationType);
99  else
100  stations_w_track_at_boundary[i - 1] = 0.;
101  }
102  //current "raw" info that a segment is matched to the current track
103  if (muon.segmentX(i - 4, 2, arbitrationType) < 999999) {
104  ++nr_of_stations_with_segment;
105  station_has_segmentmatch[i - 1] = 1;
106  }
107  }
108  // rough estimation of chamber border efficiency (should be parametrized better, this is just a quick guess):
109  // TF1 * merf = new TF1("merf","-0.5*(TMath::Erf(x/6.)-1)",-100,100);
110  // use above value to "unpunish" missing segment if close to border, i.e. rather than not adding any weight, add
111  // the one from the function. Only for dist ~> -10 cm, else full punish!.
112 
113  // ********************************************************;
114  // *** fill local info for this muon (do some counting) ***;
115  // ************** end *************************************;
116  }
117 
118  // ********************************************************;
119  // *** calculate weights for each station *****************;
120  // ************** begin ***********************************;
121  // const float slope = 0.5;
122  // const float attenuate_weight_regain = 1.;
123  // if attenuate_weight_regain < 1., additional punishment if track is close to boundary and no segment
124  const float attenuate_weight_regain = 0.5;
125 
126  for (int i = 1; i <= 8; ++i) { // loop over all possible stations
127 
128  // first set all weights if a station has been crossed
129  // later penalize if a station did not have a matching segment
130 
131  //old logic if(station_has_segmentmatch[i-1] > 0 ) { // the track has an associated segment at the current station
132  if (station_was_crossed[i - 1] > 0) { // the track crossed this chamber (or was nearby)
133  // - Apply a weight depending on the "depth" of the muon passage.
134  // - The station_weight is later reduced for stations with badly matched segments.
135  // - Even if there is no segment but the track passes close to a chamber boundary, the
136  // weight is set non zero and can go up to 0.5 of the full weight if the track is quite
137  // far from any station.
138  ++position_in_stations;
139 
140  switch (nr_of_stations_crossed) { // define different weights depending on how many stations were crossed
141  case 1:
142  station_weight[i - 1] = 1.;
143  break;
144  case 2:
145  if (position_in_stations == 1)
146  station_weight[i - 1] = 0.33;
147  else
148  station_weight[i - 1] = 0.67;
149  break;
150  case 3:
151  if (position_in_stations == 1)
152  station_weight[i - 1] = 0.23;
153  else if (position_in_stations == 2)
154  station_weight[i - 1] = 0.33;
155  else
156  station_weight[i - 1] = 0.44;
157  break;
158  case 4:
159  if (position_in_stations == 1)
160  station_weight[i - 1] = 0.10;
161  else if (position_in_stations == 2)
162  station_weight[i - 1] = 0.20;
163  else if (position_in_stations == 3)
164  station_weight[i - 1] = 0.30;
165  else
166  station_weight[i - 1] = 0.40;
167  break;
168 
169  default:
170  // LogTrace("MuonIdentification")<<" // Message: A muon candidate track has more than 4 stations with matching segments.";
171  // LogTrace("MuonIdentification")<<" // Did not expect this - please let me know: ibloch@fnal.gov";
172  // for all other cases
173  station_weight[i - 1] = 1. / nr_of_stations_crossed;
174  }
175 
176  if (use_weight_regain_at_chamber_boundary) { // reconstitute some weight if there is no match but the segment is close to a boundary:
177  if (station_has_segmentmatch[i - 1] <= 0 && stations_w_track_at_boundary[i - 1] != 0.) {
178  // if segment is not present but track in inefficient region, do not count as "missing match" but add some reduced weight.
179  // original "match weight" is currently reduced by at least attenuate_weight_regain, variing with an error function down to 0 if the track is
180  // inside the chamber.
181  // remark: the additional scale of 0.5 normalizes Err to run from 0 to 1 in y
182  station_weight[i - 1] = station_weight[i - 1] * attenuate_weight_regain * 0.5 *
183  (TMath::Erf(stations_w_track_at_boundary[i - 1] / 6.) + 1.);
184  } else if (station_has_segmentmatch[i - 1] <= 0 &&
185  stations_w_track_at_boundary[i - 1] == 0.) { // no segment match and track well inside chamber
186  // full penalization
187  station_weight[i - 1] = 0.;
188  }
189  } else { // always fully penalize tracks with no matching segment, whether the segment is close to the boundary or not.
190  if (station_has_segmentmatch[i - 1] <= 0)
191  station_weight[i - 1] = 0.;
192  }
193 
194  // if track has matching segment, but the matching is not high quality, penalize
195  if (station_has_segmentmatch[i - 1] > 0 && 42 == 42) {
196  if (i <= 4) { // we are in the DTs
197  if (muon.dY(i, 1, arbitrationType) < 999999 &&
198  muon.dX(i, 1, arbitrationType) < 999999) { // have both X and Y match
199  if (TMath::Sqrt(TMath::Power(muon.pullX(i, 1, arbitrationType), 2.) +
200  TMath::Power(muon.pullY(i, 1, arbitrationType), 2.)) > 1.) {
201  // reduce weight
202  if (use_match_dist_penalty) {
203  // only use pull if 3 sigma is not smaller than 3 cm
204  if (TMath::Sqrt(TMath::Power(muon.dX(i, 1, arbitrationType), 2.) +
205  TMath::Power(muon.dY(i, 1, arbitrationType), 2.)) < 3. &&
206  TMath::Sqrt(TMath::Power(muon.pullX(i, 1, arbitrationType), 2.) +
207  TMath::Power(muon.pullY(i, 1, arbitrationType), 2.)) > 3.) {
208  station_weight[i - 1] *=
209  1. /
210  TMath::Power(TMath::Max((double)TMath::Sqrt(TMath::Power(muon.dX(i, 1, arbitrationType), 2.) +
211  TMath::Power(muon.dY(i, 1, arbitrationType), 2.)),
212  (double)1.),
213  .25);
214  } else {
215  station_weight[i - 1] *=
216  1. / TMath::Power(TMath::Sqrt(TMath::Power(muon.pullX(i, 1, arbitrationType), 2.) +
217  TMath::Power(muon.pullY(i, 1, arbitrationType), 2.)),
218  .25);
219  }
220  }
221  }
222  } else if (muon.dY(i, 1, arbitrationType) >= 999999) { // has no match in Y
223  // has a match in X. Pull larger that 1 to avoid increasing the weight (just penalize, don't anti-penalize)
224  if (muon.pullX(i, 1, arbitrationType) > 1.) {
225  // reduce weight
226  if (use_match_dist_penalty) {
227  // only use pull if 3 sigma is not smaller than 3 cm
228  if (muon.dX(i, 1, arbitrationType) < 3. && muon.pullX(i, 1, arbitrationType) > 3.) {
229  station_weight[i - 1] *=
230  1. / TMath::Power(TMath::Max((double)muon.dX(i, 1, arbitrationType), (double)1.), .25);
231  } else {
232  station_weight[i - 1] *= 1. / TMath::Power(muon.pullX(i, 1, arbitrationType), .25);
233  }
234  }
235  }
236  } else { // has no match in X
237  // has a match in Y. Pull larger that 1 to avoid increasing the weight (just penalize, don't anti-penalize)
238  if (muon.pullY(i, 1, arbitrationType) > 1.) {
239  // reduce weight
240  if (use_match_dist_penalty) {
241  // only use pull if 3 sigma is not smaller than 3 cm
242  if (muon.dY(i, 1, arbitrationType) < 3. && muon.pullY(i, 1, arbitrationType) > 3.) {
243  station_weight[i - 1] *=
244  1. / TMath::Power(TMath::Max((double)muon.dY(i, 1, arbitrationType), (double)1.), .25);
245  } else {
246  station_weight[i - 1] *= 1. / TMath::Power(muon.pullY(i, 1, arbitrationType), .25);
247  }
248  }
249  }
250  }
251  } else { // We are in the CSCs
252  if (TMath::Sqrt(TMath::Power(muon.pullX(i - 4, 2, arbitrationType), 2.) +
253  TMath::Power(muon.pullY(i - 4, 2, arbitrationType), 2.)) > 1.) {
254  // reduce weight
255  if (use_match_dist_penalty) {
256  // only use pull if 3 sigma is not smaller than 3 cm
257  if (TMath::Sqrt(TMath::Power(muon.dX(i - 4, 2, arbitrationType), 2.) +
258  TMath::Power(muon.dY(i - 4, 2, arbitrationType), 2.)) < 3. &&
259  TMath::Sqrt(TMath::Power(muon.pullX(i - 4, 2, arbitrationType), 2.) +
260  TMath::Power(muon.pullY(i - 4, 2, arbitrationType), 2.)) > 3.) {
261  station_weight[i - 1] *=
262  1. /
263  TMath::Power(TMath::Max((double)TMath::Sqrt(TMath::Power(muon.dX(i - 4, 2, arbitrationType), 2.) +
264  TMath::Power(muon.dY(i - 4, 2, arbitrationType), 2.)),
265  (double)1.),
266  .25);
267  } else {
268  station_weight[i - 1] *=
269  1. / TMath::Power(TMath::Sqrt(TMath::Power(muon.pullX(i - 4, 2, arbitrationType), 2.) +
270  TMath::Power(muon.pullY(i - 4, 2, arbitrationType), 2.)),
271  .25);
272  }
273  }
274  }
275  }
276  }
277 
278  // Thoughts:
279  // - should penalize if the segment has only x OR y info
280  // - should also use the segment direction, as it now works!
281 
282  } else { // track did not pass a chamber in this station - just reset weight
283  station_weight[i - 1] = 0.;
284  }
285 
286  //increment final weight for muon:
287  full_weight += station_weight[i - 1];
288  }
289 
290  // if we don't expect any matches, we set the compatibility to
291  // 0.5 as the track is as compatible with a muon as it is with
292  // background - we should maybe rather set it to -0.5!
293  if (nr_of_stations_crossed == 0) {
294  // full_weight = attenuate_weight_regain*0.5;
295  full_weight = 0.5;
296  }
297 
298  // ********************************************************;
299  // *** calculate weights for each station *****************;
300  // ************** end *************************************;
301 
302  return full_weight;
303 }
304 
307  double minCompatibility,
308  reco::Muon::ArbitrationType arbitrationType) {
309  if (!muon.isMatchesValid())
310  return false;
311  bool goodMuon = false;
312 
313  switch (type) {
314  case TM2DCompatibility:
315  // Simplistic first cut in the 2D segment- vs calo-compatibility plane. Will have to be refined!
316  if (((0.8 * caloCompatibility(muon)) + (1.2 * segmentCompatibility(muon, arbitrationType))) > minCompatibility)
317  goodMuon = true;
318  else
319  goodMuon = false;
320  return goodMuon;
321  break;
322  default:
323  // LogTrace("MuonIdentification")<<" // Invalid Algorithm Type called!";
324  goodMuon = false;
325  return goodMuon;
326  break;
327  }
328 }
329 
332  int minNumberOfMatches,
333  double maxAbsDx,
334  double maxAbsPullX,
335  double maxAbsDy,
336  double maxAbsPullY,
337  double maxChamberDist,
338  double maxChamberDistPull,
339  reco::Muon::ArbitrationType arbitrationType,
340  bool syncMinNMatchesNRequiredStationsInBarrelOnly,
341  bool applyAlsoAngularCuts) {
342  if (!muon.isMatchesValid())
343  return false;
344  bool goodMuon = false;
345 
346  if (type == TMLastStation) {
347  // To satisfy my own paranoia, if the user specifies that the
348  // minimum number of matches is zero, then return true.
349  if (minNumberOfMatches == 0)
350  return true;
351 
352  unsigned int theStationMask = muon.stationMask(arbitrationType);
353  unsigned int theRequiredStationMask =
354  RequiredStationMask(muon, maxChamberDist, maxChamberDistPull, arbitrationType);
355 
356  // Require that there be at least a minimum number of segments
357  int numSegs = 0;
358  int numRequiredStations = 0;
359  for (int it = 0; it < 8; ++it) {
360  if (theStationMask & 1 << it)
361  ++numSegs;
362  if (theRequiredStationMask & 1 << it)
363  ++numRequiredStations;
364  }
365 
366  // Make sure the minimum number of matches is not greater than
367  // the number of required stations but still greater than zero
368  if (syncMinNMatchesNRequiredStationsInBarrelOnly) {
369  // Note that we only do this in the barrel region!
370  if (fabs(muon.eta()) < 1.2) {
371  if (minNumberOfMatches > numRequiredStations)
372  minNumberOfMatches = numRequiredStations;
373  if (minNumberOfMatches < 1) //SK: this only happens for negative values
374  minNumberOfMatches = 1;
375  }
376  } else {
377  if (minNumberOfMatches > numRequiredStations)
378  minNumberOfMatches = numRequiredStations;
379  if (minNumberOfMatches < 1) //SK: this only happens for negative values
380  minNumberOfMatches = 1;
381  }
382 
383  if (numSegs >= minNumberOfMatches)
384  goodMuon = true;
385 
386  // Require that last required station have segment
387  // If there are zero required stations keep track
388  // of the last station with a segment so that we may
389  // apply the quality cuts below to it instead
390  int lastSegBit = 0;
391  if (theRequiredStationMask) {
392  for (int stationIdx = 7; stationIdx >= 0; --stationIdx)
393  if (theRequiredStationMask & 1 << stationIdx) {
394  if (theStationMask & 1 << stationIdx) {
395  lastSegBit = stationIdx;
396  goodMuon &= 1;
397  break;
398  } else {
399  goodMuon = false;
400  break;
401  }
402  }
403  } else {
404  for (int stationIdx = 7; stationIdx >= 0; --stationIdx)
405  if (theStationMask & 1 << stationIdx) {
406  lastSegBit = stationIdx;
407  break;
408  }
409  }
410 
411  if (!goodMuon)
412  return false;
413 
414  // Impose pull cuts on last segment
415  int station = 0, detector = 0;
416  station = lastSegBit < 4 ? lastSegBit + 1 : lastSegBit - 3;
417  detector = lastSegBit < 4 ? 1 : 2;
418 
419  // Check x information
420  if (fabs(muon.pullX(station, detector, arbitrationType, true)) > maxAbsPullX &&
421  fabs(muon.dX(station, detector, arbitrationType)) > maxAbsDx)
422  return false;
423 
424  if (applyAlsoAngularCuts && fabs(muon.pullDxDz(station, detector, arbitrationType, true)) > maxAbsPullX)
425  return false;
426 
427  // Is this a tight algorithm, i.e. do we bother to check y information?
428  if (maxAbsDy < 999999) { // really if maxAbsDy < 1E9 as currently defined
429 
430  // Check y information
431  if (detector == 2) { // CSC
432  if (fabs(muon.pullY(station, 2, arbitrationType, true)) > maxAbsPullY &&
433  fabs(muon.dY(station, 2, arbitrationType)) > maxAbsDy)
434  return false;
435 
436  if (applyAlsoAngularCuts && fabs(muon.pullDyDz(station, 2, arbitrationType, true)) > maxAbsPullY)
437  return false;
438  } else {
439  //
440  // In DT, if this is a "Tight" algorithm and the last segment is
441  // missing y information (always the case in station 4!!!), impose
442  // respective cuts on the next station in the stationMask that has
443  // a segment with y information. If there are no segments with y
444  // information then there is nothing to penalize. Should we
445  // penalize in Tight for having zero segments with y information?
446  // That is the fundamental question. Of course I am being uber
447  // paranoid; if this is a good muon then there will probably be at
448  // least one segment with y information but not always. Suppose
449  // somehow a muon only creates segments in station 4, then we
450  // definitely do not want to require that there be at least one
451  // segment with y information because we will lose it completely.
452  //
453 
454  for (int stationIdx = station; stationIdx > 0; --stationIdx) {
455  if (!(theStationMask & 1 << (stationIdx - 1))) // don't bother if the station is not in the stationMask
456  continue;
457 
458  if (muon.dY(stationIdx, 1, arbitrationType) > 999998) // no y-information
459  continue;
460 
461  if (fabs(muon.pullY(stationIdx, 1, arbitrationType, true)) > maxAbsPullY &&
462  fabs(muon.dY(stationIdx, 1, arbitrationType)) > maxAbsDy) {
463  return false;
464  }
465 
466  if (applyAlsoAngularCuts && fabs(muon.pullDyDz(stationIdx, 1, arbitrationType, true)) > maxAbsPullY)
467  return false;
468 
469  // If we get this far then great this is a good muon
470  return true;
471  }
472  }
473  }
474 
475  return goodMuon;
476  } // TMLastStation
477 
478  // TMOneStation requires only that there be one "good" segment, regardless
479  // of the required stations. We do not penalize if there are absolutely zero
480  // segments with y information in the Tight algorithm. Maybe I'm being
481  // paranoid but so be it. If it's really a good muon then we will probably
482  // find at least one segment with both x and y information but you never
483  // know, and I don't want to deal with a potential inefficiency in the DT
484  // like we did with the original TMLastStation. Incidentally, not penalizing
485  // for total lack of y information in the Tight algorithm is what is done in
486  // the new TMLastStation
487  //
488  if (type == TMOneStation) {
489  unsigned int theStationMask = muon.stationMask(arbitrationType);
490 
491  // Of course there must be at least one segment
492  if (!theStationMask)
493  return false;
494 
495  int station = 0, detector = 0;
496  // Keep track of whether or not there is a DT segment with y information.
497  // In the end, if it turns out there are absolutely zero DT segments with
498  // y information, require only that there was a segment with good x info.
499  // This of course only applies to the Tight algorithms.
500  bool existsGoodDTSegX = false;
501  bool existsDTSegY = false;
502 
503  // Impose cuts on the segments in the station mask until we find a good one
504  // Might as well start with the lowest bit to speed things up.
505  for (int stationIdx = 0; stationIdx <= 7; ++stationIdx)
506  if (theStationMask & 1 << stationIdx) {
507  station = stationIdx < 4 ? stationIdx + 1 : stationIdx - 3;
508  detector = stationIdx < 4 ? 1 : 2;
509 
510  if ((fabs(muon.pullX(station, detector, arbitrationType, true)) > maxAbsPullX &&
511  fabs(muon.dX(station, detector, arbitrationType)) > maxAbsDx) ||
512  (applyAlsoAngularCuts && fabs(muon.pullDxDz(station, detector, arbitrationType, true)) > maxAbsPullX))
513  continue;
514  else if (detector == 1)
515  existsGoodDTSegX = true;
516 
517  // Is this a tight algorithm? If yes, use y information
518  if (maxAbsDy < 999999) {
519  if (detector == 2) { // CSC
520  if ((fabs(muon.pullY(station, 2, arbitrationType, true)) > maxAbsPullY &&
521  fabs(muon.dY(station, 2, arbitrationType)) > maxAbsDy) ||
522  (applyAlsoAngularCuts && fabs(muon.pullDyDz(station, 2, arbitrationType, true)) > maxAbsPullY))
523  continue;
524  } else {
525  if (muon.dY(station, 1, arbitrationType) > 999998) // no y-information
526  continue;
527  else
528  existsDTSegY = true;
529 
530  if ((fabs(muon.pullY(station, 1, arbitrationType, true)) > maxAbsPullY &&
531  fabs(muon.dY(station, 1, arbitrationType)) > maxAbsDy) ||
532  (applyAlsoAngularCuts && fabs(muon.pullDyDz(station, 1, arbitrationType, true)) > maxAbsPullY)) {
533  continue;
534  }
535  }
536  }
537 
538  // If we get this far then great this is a good muon
539  return true;
540  }
541 
542  // If we get this far then for sure there are no "good" CSC segments. For
543  // DT, check if there were any segments with y information. If there
544  // were none, but there was a segment with good x, then we're happy. If
545  // there WERE segments with y information, then they must have been shit
546  // since we are here so fail it. Of course, if this is a Loose algorithm
547  // then fail immediately since if we had good x we would already have
548  // returned true
549  if (maxAbsDy < 999999) {
550  if (existsDTSegY)
551  return false;
552  else if (existsGoodDTSegX)
553  return true;
554  } else
555  return false;
556  } // TMOneStation
557 
558  if (type == RPCMu) {
559  if (minNumberOfMatches == 0)
560  return true;
561 
562  int nMatch = 0;
563  for (std::vector<reco::MuonChamberMatch>::const_iterator chamberMatch = muon.matches().begin();
564  chamberMatch != muon.matches().end();
565  ++chamberMatch) {
566  if (chamberMatch->detector() != 3)
567  continue;
568 
569  const double trkX = chamberMatch->x;
570  const double errX = chamberMatch->xErr;
571 
572  for (std::vector<reco::MuonRPCHitMatch>::const_iterator rpcMatch = chamberMatch->rpcMatches.begin();
573  rpcMatch != chamberMatch->rpcMatches.end();
574  ++rpcMatch) {
575  const double rpcX = rpcMatch->x;
576 
577  const double dX = fabs(rpcX - trkX);
578  if (dX < maxAbsDx or dX / errX < maxAbsPullX) {
579  ++nMatch;
580  break;
581  }
582  }
583  }
584 
585  if (nMatch >= minNumberOfMatches)
586  return true;
587  else
588  return false;
589  } // RPCMu
590 
591  if (type == ME0Mu) {
592  if (minNumberOfMatches == 0)
593  return true;
594 
595  int nMatch = 0;
596  for (const auto& chamberMatch : muon.matches()) {
597  if (chamberMatch.detector() != MuonSubdetId::ME0)
598  continue;
599 
600  const double trkX = chamberMatch.x;
601  const double errX = chamberMatch.xErr;
602  const double trkY = chamberMatch.y;
603  const double errY = chamberMatch.yErr;
604 
605  for (const auto& segment : chamberMatch.me0Matches) {
606  const double me0X = segment.x;
607  const double me0ErrX = segment.xErr;
608  const double me0Y = segment.y;
609  const double me0ErrY = segment.yErr;
610 
611  const double dX = fabs(me0X - trkX);
612  const double dY = fabs(me0Y - trkY);
613  const double pullX = dX / std::sqrt(errX + me0ErrX);
614  const double pullY = dY / std::sqrt(errY + me0ErrY);
615 
616  if ((dX < maxAbsDx or pullX < maxAbsPullX) and (dY < maxAbsDy or pullY < maxAbsPullY)) {
617  ++nMatch;
618  break;
619  }
620  }
621  }
622 
623  return (nMatch >= minNumberOfMatches);
624  } // ME0Mu
625 
626  if (type == GEMMu) {
627  if (minNumberOfMatches == 0)
628  return true;
629 
630  int nMatch = 0;
631  for (const auto& chamberMatch : muon.matches()) {
632  if (chamberMatch.detector() != MuonSubdetId::GEM)
633  continue;
634 
635  const double trkX = chamberMatch.x;
636  const double errX = chamberMatch.xErr;
637  const double trkY = chamberMatch.y;
638  const double errY = chamberMatch.yErr;
639 
640  for (const auto& segment : chamberMatch.gemMatches) {
641  const double gemX = segment.x;
642  const double gemErrX = segment.xErr;
643  const double gemY = segment.y;
644  const double gemErrY = segment.yErr;
645 
646  const double dX = fabs(gemX - trkX);
647  const double dY = fabs(gemY - trkY);
648  const double pullX = dX / std::sqrt(errX + gemErrX);
649  const double pullY = dY / std::sqrt(errY + gemErrY);
650 
651  if ((dX < maxAbsDx or pullX < maxAbsPullX) and (dY < maxAbsDy or pullY < maxAbsPullY)) {
652  ++nMatch;
653  break;
654  }
655  }
656  }
657 
658  return (nMatch >= minNumberOfMatches);
659  } // GEMMu
660 
661  return goodMuon;
662 }
663 
665  switch (type) {
666  case muon::All:
667  return true;
668  break;
670  return muon.isGlobalMuon();
671  break;
673  return muon.isTrackerMuon();
674  break;
676  return muon.isStandAloneMuon();
677  break;
679  return muon.isTrackerMuon() && muon.numberOfMatches(arbitrationType) > 0;
680  break;
681  case muon::AllArbitrated:
682  return !muon.isTrackerMuon() || muon.numberOfMatches(arbitrationType) > 0;
683  break;
685  return muon.isGlobalMuon() && muon.globalTrack()->normalizedChi2() < 10. &&
686  muon.globalTrack()->hitPattern().numberOfValidMuonHits() > 0;
687  break;
688  // For "Loose" algorithms we choose maximum y quantity cuts of 1E9 instead of
689  // 9999 as before. We do this because the muon methods return 999999 (note
690  // there are six 9's) when the requested information is not available. For
691  // example, if a muon fails to traverse the z measuring superlayer in a station
692  // in the DT, then all methods involving segmentY in this station return
693  // 999999 to demonstrate that the information is missing. In order to not
694  // penalize muons for missing y information in Loose algorithms where we do
695  // not care at all about y information, we raise these limits. In the
696  // TMLastStation and TMOneStation algorithms we actually use this huge number
697  // to determine whether to consider y information at all.
699  return muon.isTrackerMuon() &&
700  isGoodMuon(muon, TMLastStation, 2, 3, 3, 1E9, 1E9, -3, -3, arbitrationType, true, false);
701  break;
703  return muon.isTrackerMuon() &&
704  isGoodMuon(muon, TMLastStation, 2, 3, 3, 3, 3, -3, -3, arbitrationType, true, false);
705  break;
707  return muon.isTrackerMuon() &&
708  isGoodMuon(muon, TMOneStation, 1, 3, 3, 1E9, 1E9, 1E9, 1E9, arbitrationType, false, false);
709  break;
711  return muon.isTrackerMuon() &&
712  isGoodMuon(muon, TMOneStation, 1, 3, 3, 3, 3, 1E9, 1E9, arbitrationType, false, false);
713  break;
715  if (muon.pt() < 8. && fabs(muon.eta()) < 1.2)
716  return muon.isTrackerMuon() &&
717  isGoodMuon(muon, TMOneStation, 1, 3, 3, 1E9, 1E9, 1E9, 1E9, arbitrationType, false, false);
718  else
719  return muon.isTrackerMuon() &&
720  isGoodMuon(muon, TMLastStation, 2, 3, 3, 1E9, 1E9, -3, -3, arbitrationType, false, false);
721  break;
723  if (muon.pt() < 8. && fabs(muon.eta()) < 1.2)
724  return muon.isTrackerMuon() &&
725  isGoodMuon(muon, TMOneStation, 1, 3, 3, 3, 3, 1E9, 1E9, arbitrationType, false, false);
726  else
727  return muon.isTrackerMuon() &&
728  isGoodMuon(muon, TMLastStation, 2, 3, 3, 3, 3, -3, -3, arbitrationType, false, false);
729  break;
730  //compatibility loose
732  return muon.isTrackerMuon() && isGoodMuon(muon, TM2DCompatibility, 0.7, arbitrationType);
733  break;
734  //compatibility tight
736  return muon.isTrackerMuon() && isGoodMuon(muon, TM2DCompatibility, 1.0, arbitrationType);
737  break;
739  return muon.isGlobalMuon() && muon.isQualityValid() &&
740  fabs(muon.combinedQuality().trkRelChi2 - muon.innerTrack()->normalizedChi2()) < 2.0;
741  break;
743  return muon.isGlobalMuon() && muon.isQualityValid() &&
744  fabs(muon.combinedQuality().staRelChi2 - muon.outerTrack()->normalizedChi2()) < 2.0;
745  break;
746  case muon::GMTkKinkTight:
747  return muon.isGlobalMuon() && muon.isQualityValid() && muon.combinedQuality().trkKink < 100.0;
748  break;
750  return muon.isTrackerMuon() &&
751  isGoodMuon(muon, TMLastStation, 2, 3, 3, 1E9, 1E9, -3, -3, arbitrationType, false, true);
752  break;
754  return muon.isTrackerMuon() &&
755  isGoodMuon(muon, TMLastStation, 2, 3, 3, 3, 3, -3, -3, arbitrationType, false, true);
756  break;
758  return muon.isTrackerMuon() &&
759  isGoodMuon(muon, TMOneStation, 1, 3, 3, 1E9, 1E9, 1E9, 1E9, arbitrationType, false, true);
760  break;
762  return muon.isTrackerMuon() &&
763  isGoodMuon(muon, TMOneStation, 1, 3, 3, 3, 3, 1E9, 1E9, arbitrationType, false, true);
764  break;
766  if (muon.pt() < 8. && fabs(muon.eta()) < 1.2)
767  return muon.isTrackerMuon() &&
768  isGoodMuon(muon, TMOneStation, 1, 3, 3, 1E9, 1E9, 1E9, 1E9, arbitrationType, false, false);
769  else
770  return muon.isTrackerMuon() &&
771  isGoodMuon(muon, TMLastStation, 2, 3, 3, 1E9, 1E9, -3, -3, arbitrationType, true, false);
772  break;
774  if (muon.pt() < 8. && fabs(muon.eta()) < 1.2)
775  return muon.isTrackerMuon() &&
776  isGoodMuon(muon, TMOneStation, 1, 3, 3, 3, 3, 1E9, 1E9, arbitrationType, false, false);
777  else
778  return muon.isTrackerMuon() &&
779  isGoodMuon(muon, TMLastStation, 2, 3, 3, 3, 3, -3, -3, arbitrationType, true, false);
780  break;
781  case muon::RPCMuLoose:
782  return muon.isRPCMuon() && isGoodMuon(muon, RPCMu, 2, 20, 4, 1e9, 1e9, 1e9, 1e9, arbitrationType, false, false);
783  break;
784  case muon::AllME0Muons:
785  return muon.isME0Muon();
786  break;
788  return muon.isME0Muon() &&
789  isGoodMuon(muon, ME0Mu, 1, 1e9, 1e9, 1e9, 1e9, 1e9, 1e9, arbitrationType, false, false);
790  break;
791  case muon::AllGEMMuons:
792  return muon.isGEMMuon();
793  break;
795  return muon.isGEMMuon() &&
796  isGoodMuon(muon, GEMMu, 1, 1e9, 1e9, 1e9, 1e9, 1e9, 1e9, arbitrationType, false, false);
797  break;
799  return isLooseTriggerMuon(muon);
800  break;
801  default:
802  return false;
803  }
804 }
805 
807  const reco::Muon& muon1, const reco::Muon& muon2, double pullX, double pullY, bool checkAdjacentChambers) {
808  unsigned int nMatches1 = muon1.numberOfMatches(reco::Muon::SegmentAndTrackArbitration);
809  unsigned int nMatches2 = muon2.numberOfMatches(reco::Muon::SegmentAndTrackArbitration);
810  unsigned int betterMuon = (muon1.pt() > muon2.pt() ? 1 : 2);
811  for (std::vector<reco::MuonChamberMatch>::const_iterator chamber1 = muon1.matches().begin();
812  chamber1 != muon1.matches().end();
813  ++chamber1)
814  for (std::vector<reco::MuonChamberMatch>::const_iterator chamber2 = muon2.matches().begin();
815  chamber2 != muon2.matches().end();
816  ++chamber2) {
817  // if ( (chamber1->segmentMatches.empty() || chamber2->segmentMatches.empty()) ) continue;
818 
819  // handle case where both muons have information about the same chamber
820  // here we know how close they are
821  if (chamber1->id == chamber2->id) {
822  // found the same chamber
823  if (fabs(chamber1->x - chamber2->x) <
824  pullX * sqrt(chamber1->xErr * chamber1->xErr + chamber2->xErr * chamber2->xErr)) {
825  if (betterMuon == 1)
826  nMatches2--;
827  else
828  nMatches1--;
829  if (nMatches1 == 0 || nMatches2 == 0)
830  return true;
831  continue;
832  }
833  if (fabs(chamber1->y - chamber2->y) <
834  pullY * sqrt(chamber1->yErr * chamber1->yErr + chamber2->yErr * chamber2->yErr)) {
835  if (betterMuon == 1)
836  nMatches2--;
837  else
838  nMatches1--;
839  if (nMatches1 == 0 || nMatches2 == 0)
840  return true;
841  }
842  } else {
843  if (!checkAdjacentChambers)
844  continue;
845  // check if tracks are pointing into overlaping region of the CSC detector
846  if (chamber1->id.subdetId() != MuonSubdetId::CSC || chamber2->id.subdetId() != MuonSubdetId::CSC)
847  continue;
848  CSCDetId id1(chamber1->id);
849  CSCDetId id2(chamber2->id);
850  if (id1.endcap() != id2.endcap())
851  continue;
852  if (id1.station() != id2.station())
853  continue;
854  if (id1.ring() != id2.ring())
855  continue;
856  if (abs(id1.chamber() - id2.chamber()) > 1)
857  continue;
858  // FIXME: we don't handle 18->1; 36->1 transitions since
859  // I don't know how to check for sure how many chambers
860  // are there. Probably need to hard code some checks.
861 
862  // Now we have to make sure that both tracks are close to an edge
863  // FIXME: ignored Y coordinate for now
864  if (fabs(chamber1->edgeX) > chamber1->xErr * pullX)
865  continue;
866  if (fabs(chamber2->edgeX) > chamber2->xErr * pullX)
867  continue;
868  if (chamber1->x * chamber2->x < 0) { // check if the same edge
869  if (betterMuon == 1)
870  nMatches2--;
871  else
872  nMatches1--;
873  if (nMatches1 == 0 || nMatches2 == 0)
874  return true;
875  }
876  }
877  }
878  return false;
879 }
880 
882  // Requirements:
883  // - no depencence on information not availabe in the muon object
884  // - use only robust inputs
885  bool tk_id = muon::isGoodMuon(muon, TMOneStationTight);
886  if (not tk_id)
887  return false;
888  bool layer_requirements = muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
889  muon.innerTrack()->hitPattern().pixelLayersWithMeasurement() > 0;
890  bool match_requirements =
891  (muon.expectedNnumberOfMatchedStations() < 2) or (muon.numberOfMatchedStations() > 1) or (muon.pt() < 8);
892  return layer_requirements and match_requirements;
893 }
894 
896  if (!muon.isPFMuon() || !muon.isGlobalMuon())
897  return false;
898 
899  bool muID = isGoodMuon(muon, GlobalMuonPromptTight) && (muon.numberOfMatchedStations() > 1);
900 
901  bool hits = muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
902  muon.innerTrack()->hitPattern().numberOfValidPixelHits() > 0;
903 
904  bool ip =
905  fabs(muon.muonBestTrack()->dxy(vtx.position())) < 0.2 && fabs(muon.muonBestTrack()->dz(vtx.position())) < 0.5;
906 
907  return muID && hits && ip;
908 }
909 
911  return muon.isPFMuon() && (muon.isGlobalMuon() || muon.isTrackerMuon());
912 }
913 
914 bool muon::isMediumMuon(const reco::Muon& muon, bool run2016_hip_mitigation) {
915  if (not isLooseMuon(muon))
916  return false;
917  if (run2016_hip_mitigation) {
918  if (muon.innerTrack()->validFraction() < 0.49)
919  return false;
920  } else {
921  if (muon.innerTrack()->validFraction() < 0.8)
922  return false;
923  }
924 
925  bool goodGlb = muon.isGlobalMuon() && muon.globalTrack()->normalizedChi2() < 3. &&
926  muon.combinedQuality().chi2LocalPosition < 12. && muon.combinedQuality().trkKink < 20.;
927 
928  return (segmentCompatibility(muon) > (goodGlb ? 0.303 : 0.451));
929 }
930 
931 bool muon::isSoftMuon(const reco::Muon& muon, const reco::Vertex& vtx, bool run2016_hip_mitigation) {
933 
934  if (!muID)
935  return false;
936 
937  bool layers = muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
938  muon.innerTrack()->hitPattern().pixelLayersWithMeasurement() > 0;
939 
940  bool ishighq = muon.innerTrack()->quality(reco::Track::highPurity);
941 
942  bool ip = fabs(muon.innerTrack()->dxy(vtx.position())) < 0.3 && fabs(muon.innerTrack()->dz(vtx.position())) < 20.;
943 
944  return layers && ip && (ishighq | run2016_hip_mitigation);
945 }
946 
948  if (!muon.isGlobalMuon())
949  return false;
950 
951  bool muValHits = (muon.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 ||
952  muon.tunePMuonBestTrack()->hitPattern().numberOfValidMuonHits() > 0);
953 
954  bool muMatchedSt = muon.numberOfMatchedStations() > 1;
955  if (!muMatchedSt) {
956  if (muon.isTrackerMuon() && muon.numberOfMatchedStations() == 1) {
957  if (muon.expectedNnumberOfMatchedStations() < 2 || !(muon.stationMask() == 1 || muon.stationMask() == 16) ||
958  muon.numberOfMatchedRPCLayers() > 2)
959  muMatchedSt = true;
960  }
961  }
962 
963  bool muID = muValHits && muMatchedSt;
964 
965  bool hits = muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
966  muon.innerTrack()->hitPattern().numberOfValidPixelHits() > 0;
967 
968  bool momQuality = muon.tunePMuonBestTrack()->ptError() / muon.tunePMuonBestTrack()->pt() < 0.3;
969 
970  bool ip = fabs(muon.innerTrack()->dxy(vtx.position())) < 0.2 && fabs(muon.innerTrack()->dz(vtx.position())) < 0.5;
971 
972  return muID && hits && momQuality && ip;
973 }
974 
976  bool muID = muon.isTrackerMuon() && muon.track().isNonnull() && (muon.numberOfMatchedStations() > 1);
977  if (!muID)
978  return false;
979 
980  bool hits = muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
981  muon.innerTrack()->hitPattern().numberOfValidPixelHits() > 0;
982 
983  bool momQuality = muon.tunePMuonBestTrack()->ptError() / muon.tunePMuonBestTrack()->pt() < 0.3;
984 
985  bool ip = fabs(muon.innerTrack()->dxy(vtx.position())) < 0.2 && fabs(muon.innerTrack()->dz(vtx.position())) < 0.5;
986 
987  return muID && hits && momQuality && ip;
988 }
989 
990 int muon::sharedSegments(const reco::Muon& mu, const reco::Muon& mu2, unsigned int segmentArbitrationMask) {
991  int ret = 0;
992 
993  // Will do with a stupid double loop, since creating and filling a map is probably _more_ inefficient for a single lookup.
994  for (std::vector<reco::MuonChamberMatch>::const_iterator chamberMatch = mu.matches().begin();
995  chamberMatch != mu.matches().end();
996  ++chamberMatch) {
997  if (chamberMatch->segmentMatches.empty())
998  continue;
999  for (std::vector<reco::MuonChamberMatch>::const_iterator chamberMatch2 = mu2.matches().begin();
1000  chamberMatch2 != mu2.matches().end();
1001  ++chamberMatch2) {
1002  if (chamberMatch2->segmentMatches.empty())
1003  continue;
1004  if (chamberMatch2->id() != chamberMatch->id())
1005  continue;
1006  for (std::vector<reco::MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
1007  segmentMatch != chamberMatch->segmentMatches.end();
1008  ++segmentMatch) {
1009  if (!segmentMatch->isMask(segmentArbitrationMask))
1010  continue;
1011  for (std::vector<reco::MuonSegmentMatch>::const_iterator segmentMatch2 = chamberMatch2->segmentMatches.begin();
1012  segmentMatch2 != chamberMatch2->segmentMatches.end();
1013  ++segmentMatch2) {
1014  if (!segmentMatch2->isMask(segmentArbitrationMask))
1015  continue;
1016  if ((segmentMatch->cscSegmentRef.isNonnull() &&
1017  segmentMatch->cscSegmentRef == segmentMatch2->cscSegmentRef) ||
1018  (segmentMatch->dtSegmentRef.isNonnull() && segmentMatch->dtSegmentRef == segmentMatch2->dtSegmentRef)) {
1019  ++ret;
1020  } // is the same
1021  } // segment of mu2 in chamber
1022  } // segment of mu1 in chamber
1023  } // chamber of mu2
1024  } // chamber of mu1
1025 
1026  return ret;
1027 }
1028 
1030  const auto& combinedTime = muon.time();
1031  const auto& rpcTime = muon.rpcTime();
1032  bool combinedTimeIsOk = (combinedTime.nDof > 7);
1033  bool rpcTimeIsOk = (rpcTime.nDof > 1 && fabs(rpcTime.timeAtIpInOutErr) < 0.001);
1034  bool outOfTime = false;
1035  if (rpcTimeIsOk) {
1036  if ((fabs(rpcTime.timeAtIpInOut) > 10) && !(combinedTimeIsOk && fabs(combinedTime.timeAtIpInOut) < 10))
1037  outOfTime = true;
1038  } else {
1039  if (combinedTimeIsOk && (combinedTime.timeAtIpInOut > 20 || combinedTime.timeAtIpInOut < -45))
1040  outOfTime = true;
1041  }
1042  return outOfTime;
1043 }
1044 
1046  reco::Vertex const* vertex,
1047  bool run2016_hip_mitigation) {
1048  // https://twiki.cern.ch/twiki/bin/viewauth/CMS/SWGuideMuonIdRun2
1049  unsigned int selectors = muon.selectors();
1050  // Compute Id and Isolation variables
1051  double chIso = muon.pfIsolationR04().sumChargedHadronPt;
1052  double nIso = muon.pfIsolationR04().sumNeutralHadronEt;
1053  double phoIso = muon.pfIsolationR04().sumPhotonEt;
1054  double puIso = muon.pfIsolationR04().sumPUPt;
1055  double dbCorrectedIsolation = chIso + std::max(nIso + phoIso - .5 * puIso, 0.);
1056  double dbCorrectedRelIso = dbCorrectedIsolation / muon.pt();
1057  double tkRelIso = muon.isolationR03().sumPt / muon.pt();
1058 
1059  // Base selectors
1060  if (muon::isLooseMuon(muon))
1062  if (vertex) {
1063  if (muon::isTightMuon(muon, *vertex))
1065  if (muon::isSoftMuon(muon, *vertex, run2016_hip_mitigation))
1071  }
1072  if (muon::isMediumMuon(muon, run2016_hip_mitigation)) {
1074  if (vertex and fabs(muon.muonBestTrack()->dz(vertex->position())) < 0.1 and
1075  fabs(muon.muonBestTrack()->dxy(vertex->position())) < 0.02)
1077  }
1078 
1079  // PF isolation
1080  if (dbCorrectedRelIso < 0.40)
1082  if (dbCorrectedRelIso < 0.25)
1084  if (dbCorrectedRelIso < 0.20)
1086  if (dbCorrectedRelIso < 0.15)
1088  if (dbCorrectedRelIso < 0.10)
1090  if (dbCorrectedRelIso < 0.05)
1092 
1093  // Tracker isolation
1094  if (tkRelIso < 0.10)
1096  if (tkRelIso < 0.05)
1098 
1099  // Trigger selectors
1100  if (isLooseTriggerMuon(muon))
1102 
1103  // Timing
1104  if (!outOfTimeMuon(muon))
1106 
1107  return static_cast<reco::Muon::Selector>(selectors);
1108 }
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
MuonSubdetId::GEM
static constexpr int GEM
Definition: MuonSubdetId.h:14
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
muon::TMOneStation
Definition: MuonSelectors.h:155
muon::SelectorStringToEnum::value
reco::Muon::Selector value
Definition: MuonSelectors.h:105
muon::GEMMu
Definition: MuonSelectors.h:155
mps_fire.i
i
Definition: mps_fire.py:355
muon::isSoftMuon
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
Definition: MuonSelectors.cc:931
reco::Muon::SegmentAndTrackArbitration
Definition: Muon.h:190
reco::Muon::CutBasedIdTrkHighPt
Definition: Muon.h:207
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
muon
Definition: MuonCocktails.h:17
fftjetvertexadder_cfi.errY
errY
Definition: fftjetvertexadder_cfi.py:38
muon::segmentCompatibility
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
Definition: MuonSelectors.cc:61
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
muon::TMLastStation
Definition: MuonSelectors.h:155
relativeConstraints.station
station
Definition: relativeConstraints.py:67
reco::Muon::Selector
Selector
Definition: Muon.h:201
globals_cff.id1
id1
Definition: globals_cff.py:32
reco::Muon::matches
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:145
muon::GlobalMuonPromptTight
Definition: MuonSelectors.h:26
muon::TMLastStationTight
Definition: MuonSelectors.h:28
muon::TrackerMuonArbitrated
Definition: MuonSelectors.h:24
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
reco::Muon::TkIsoLoose
Definition: Muon.h:213
muon::isLooseTriggerMuon
bool isLooseTriggerMuon(const reco::Muon &)
Definition: MuonSelectors.cc:881
reco::Muon::CutBasedIdLoose
Definition: Muon.h:202
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
reco::Muon::TkIsoTight
Definition: Muon.h:214
muon::RPCMuLoose
Definition: MuonSelectors.h:53
muon::AllGEMMuons
Definition: MuonSelectors.h:56
CSCDetId.h
muon::GMTkChiCompatibility
Definition: MuonSelectors.h:35
reco::Muon
Definition: Muon.h:27
muon::ME0Mu
Definition: MuonSelectors.h:155
reco::Muon::CutBasedIdMedium
Definition: Muon.h:203
muon::isGoodMuon
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
Definition: MuonSelectors.cc:664
muon::isLooseMuon
bool isLooseMuon(const reco::Muon &)
Definition: MuonSelectors.cc:910
Track.h
muon::SelectionTypeStringToEnum::value
SelectionType value
Definition: MuonSelectors.h:64
muon::isTrackerHighPtMuon
bool isTrackerHighPtMuon(const reco::Muon &, const reco::Vertex &)
Definition: MuonSelectors.cc:975
muon::selectionTypeFromString
SelectionType selectionTypeFromString(const std::string &label)
Definition: MuonSelectors.cc:9
reco::Muon::PFIsoLoose
Definition: Muon.h:209
muon::SelectionType
SelectionType
Selector type.
Definition: MuonSelectors.h:19
MuonSelectors.h
reco::Muon::PFIsoVeryLoose
Definition: Muon.h:208
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
muon::caloCompatibility
float caloCompatibility(const reco::Muon &muon)
Definition: MuonSelectors.cc:58
muon::TMLastStationOptimizedLowPtLoose
Definition: MuonSelectors.h:33
HLT_2018_cff.maxAbsPullY
maxAbsPullY
Definition: HLT_2018_cff.py:10226
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
muon::AllGlobalMuons
Definition: MuonSelectors.h:21
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
muon::isHighPtMuon
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
Definition: MuonSelectors.cc:947
muon::GMTkKinkTight
Definition: MuonSelectors.h:37
muon::TMOneStationTight
Definition: MuonSelectors.h:32
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
muon::isTightMuon
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
Definition: MuonSelectors.cc:895
selectors
Definition: selectors.py:1
reco::Muon::TriggerIdLoose
Definition: Muon.h:224
muon::TMLastStationAngTight
Definition: MuonSelectors.h:39
reco::Muon::PFIsoVeryTight
Definition: Muon.h:212
muon::AllME0Muons
Definition: MuonSelectors.h:54
CSCDetId
Definition: CSCDetId.h:26
muon::overlap
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
Definition: MuonSelectors.cc:806
value
Definition: value.py:1
muon::ME0MuonArbitrated
Definition: MuonSelectors.h:55
muons_cff.tkRelIso
tkRelIso
Definition: muons_cff.py:142
Max
T Max(T a, T b)
Definition: MathUtil.h:44
MuonSubdetId::ME0
static constexpr int ME0
Definition: MuonSubdetId.h:15
reco::Muon::CutBasedIdMediumPrompt
Definition: Muon.h:204
muon::TMLastStationOptimizedBarrelLowPtLoose
Definition: MuonSelectors.h:50
muon::All
Definition: MuonSelectors.h:20
muon::isMediumMuon
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
Definition: MuonSelectors.cc:914
muon::TMOneStationLoose
Definition: MuonSelectors.h:31
MuonRPCHitMatch.h
MuonSubdetId.h
muon::AllArbitrated
Definition: MuonSelectors.h:25
reco::Muon::PFIsoTight
Definition: Muon.h:211
muon::makeSelectorBitset
reco::Muon::Selector makeSelectorBitset(reco::Muon const &muon, reco::Vertex const *vertex=nullptr, bool run2016_hip_mitigation=false)
Definition: MuonSelectors.cc:1045
muon::TMLastStationOptimizedBarrelLowPtTight
Definition: MuonSelectors.h:52
muon::TM2DCompatibilityTight
Definition: MuonSelectors.h:30
reco::Muon::CutBasedIdGlobalHighPt
Definition: Muon.h:206
muon::selectionTypeStringToEnumMap
static const SelectionTypeStringToEnum selectionTypeStringToEnumMap[]
Definition: MuonSelectors.h:67
type
type
Definition: HCALResponse.h:21
reco::Muon::PFIsoVeryVeryTight
Definition: Muon.h:226
muon::sharedSegments
int sharedSegments(const reco::Muon &muon1, const reco::Muon &muon2, unsigned int segmentArbitrationMask=reco::MuonSegmentMatch::BestInChamberByDR)
Definition: MuonSelectors.cc:990
muon::selectorStringToEnumMap
static const SelectorStringToEnum selectorStringToEnumMap[]
Definition: MuonSelectors.h:108
BadChargedCandidateFilter_cfi.segmentCompatibility
segmentCompatibility
Definition: BadChargedCandidateFilter_cfi.py:14
HLT_2018_cff.minNumberOfMatches
minNumberOfMatches
Definition: HLT_2018_cff.py:10328
outOfTimeMuon
bool outOfTimeMuon(const reco::Muon &muon)
Definition: MuonSelectors.cc:1029
reco::Muon::PFIsoMedium
Definition: Muon.h:210
relativeConstraints.value
value
Definition: relativeConstraints.py:53
muon::GEMMuonArbitrated
Definition: MuonSelectors.h:57
muon::selectorFromString
reco::Muon::Selector selectorFromString(const std::string &label)
Definition: MuonSelectors.cc:24
Exception
Definition: hltDiff.cc:246
muon::AlgorithmType
AlgorithmType
Definition: MuonSelectors.h:155
reco::Muon::numberOfMatches
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
muon::TMLastStationLoose
Definition: MuonSelectors.h:27
reco::Muon::SoftCutBasedId
Definition: Muon.h:215
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
muon::SelectorStringToEnum::label
const char * label
Definition: MuonSelectors.h:104
muon::SelectionTypeStringToEnum::label
const char * label
Definition: MuonSelectors.h:63
muon::TMLastStationOptimizedLowPtTight
Definition: MuonSelectors.h:34
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
muon::TM2DCompatibility
Definition: MuonSelectors.h:155
muon::TMLastStationAngLoose
Definition: MuonSelectors.h:38
muon::AllStandAloneMuons
Definition: MuonSelectors.h:22
muon::GMStaChiCompatibility
Definition: MuonSelectors.h:36
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
muon::TriggerIdLoose
Definition: MuonSelectors.h:58
HLT_2018_cff.maxAbsPullX
maxAbsPullX
Definition: HLT_2018_cff.py:10225
muon::TMOneStationAngTight
Definition: MuonSelectors.h:41
globals_cff.id2
id2
Definition: globals_cff.py:33
muon::RPCMu
Definition: MuonSelectors.h:155
muon::AllTrackerMuons
Definition: MuonSelectors.h:23
muon::RequiredStationMask
unsigned int RequiredStationMask(const reco::Muon &muon, double maxChamberDist, double maxChamberDistPull, reco::Muon::ArbitrationType arbitrationType)
Definition: MuonSelectors.cc:40
HLT_2018_cff.maxAbsDy
maxAbsDy
Definition: HLT_2018_cff.py:10306
fftjetvertexadder_cfi.errX
errX
Definition: fftjetvertexadder_cfi.py:37
muon::TMOneStationAngLoose
Definition: MuonSelectors.h:40
HLT_2018_cff.maxAbsDx
maxAbsDx
Definition: HLT_2018_cff.py:10326
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
label
const char * label
Definition: PFTauDecayModeTools.cc:11
reco::Vertex
Definition: Vertex.h:35
reco::Muon::CutBasedIdTight
Definition: Muon.h:205
reco::Muon::ArbitrationType
ArbitrationType
define arbitration schemes
Definition: Muon.h:187
muon::TM2DCompatibilityLoose
Definition: MuonSelectors.h:29
reco::Muon::InTimeMuon
Definition: Muon.h:225
reco::TrackBase::highPurity
Definition: TrackBase.h:154