35 throw cms::Exception(
"MuonSelectorError") <<
label <<
" is not a recognized reco::Muon::Selector";
41 double maxChamberDist,
42 double maxChamberDistPull,
44 unsigned int theMask = 0;
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) <
52 theMask += 1 << ((stationIdx - 1) + 4 * (detectorIdx - 1));
62 bool use_weight_regain_at_chamber_boundary =
true;
63 bool use_match_dist_penalty =
true;
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.;
75 for (
int i = 1;
i <= 8; ++
i) {
80 if (
muon.trackDist(
i, 1, arbitrationType) < 999999) {
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);
86 stations_w_track_at_boundary[
i - 1] = 0.;
89 if (
muon.segmentX(
i, 1, arbitrationType) < 999999) {
90 ++nr_of_stations_with_segment;
91 station_has_segmentmatch[
i - 1] = 1;
94 if (
muon.trackDist(
i - 4, 2, arbitrationType) < 999999) {
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);
100 stations_w_track_at_boundary[
i - 1] = 0.;
103 if (
muon.segmentX(
i - 4, 2, arbitrationType) < 999999) {
104 ++nr_of_stations_with_segment;
105 station_has_segmentmatch[
i - 1] = 1;
124 const float attenuate_weight_regain = 0.5;
126 for (
int i = 1;
i <= 8; ++
i) {
132 if (station_was_crossed[
i - 1] > 0) {
138 ++position_in_stations;
140 switch (nr_of_stations_crossed) {
142 station_weight[
i - 1] = 1.;
145 if (position_in_stations == 1)
146 station_weight[
i - 1] = 0.33;
148 station_weight[
i - 1] = 0.67;
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;
156 station_weight[
i - 1] = 0.44;
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;
166 station_weight[
i - 1] = 0.40;
173 station_weight[
i - 1] = 1. / nr_of_stations_crossed;
176 if (use_weight_regain_at_chamber_boundary) {
177 if (station_has_segmentmatch[
i - 1] <= 0 && stations_w_track_at_boundary[
i - 1] != 0.) {
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.) {
187 station_weight[
i - 1] = 0.;
190 if (station_has_segmentmatch[
i - 1] <= 0)
191 station_weight[
i - 1] = 0.;
195 if (station_has_segmentmatch[
i - 1] > 0 && 42 == 42) {
197 if (
muon.dY(
i, 1, arbitrationType) < 999999 &&
198 muon.dX(
i, 1, arbitrationType) < 999999) {
199 if (TMath::Sqrt(TMath::Power(
muon.pullX(
i, 1, arbitrationType), 2.) +
200 TMath::Power(
muon.pullY(
i, 1, arbitrationType), 2.)) > 1.) {
202 if (use_match_dist_penalty) {
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] *=
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.)),
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.)),
222 }
else if (
muon.dY(
i, 1, arbitrationType) >= 999999) {
224 if (
muon.pullX(
i, 1, arbitrationType) > 1.) {
226 if (use_match_dist_penalty) {
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);
232 station_weight[
i - 1] *= 1. / TMath::Power(
muon.pullX(
i, 1, arbitrationType), .25);
238 if (
muon.pullY(
i, 1, arbitrationType) > 1.) {
240 if (use_match_dist_penalty) {
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);
246 station_weight[
i - 1] *= 1. / TMath::Power(
muon.pullY(
i, 1, arbitrationType), .25);
252 if (TMath::Sqrt(TMath::Power(
muon.pullX(
i - 4, 2, arbitrationType), 2.) +
253 TMath::Power(
muon.pullY(
i - 4, 2, arbitrationType), 2.)) > 1.) {
255 if (use_match_dist_penalty) {
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] *=
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.)),
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.)),
283 station_weight[
i - 1] = 0.;
287 full_weight += station_weight[
i - 1];
293 if (nr_of_stations_crossed == 0) {
307 double minCompatibility,
309 if (!
muon.isMatchesValid())
311 bool goodMuon =
false;
337 double maxChamberDist,
338 double maxChamberDistPull,
340 bool syncMinNMatchesNRequiredStationsInBarrelOnly,
341 bool applyAlsoAngularCuts) {
342 if (!
muon.isMatchesValid())
344 bool goodMuon =
false;
352 unsigned int theStationMask =
muon.stationMask(arbitrationType);
353 unsigned int theRequiredStationMask =
358 int numRequiredStations = 0;
359 for (
int it = 0; it < 8; ++it) {
360 if (theStationMask & 1 << it)
362 if (theRequiredStationMask & 1 << it)
363 ++numRequiredStations;
368 if (syncMinNMatchesNRequiredStationsInBarrelOnly) {
370 if (fabs(
muon.eta()) < 1.2) {
391 if (theRequiredStationMask) {
392 for (
int stationIdx = 7; stationIdx >= 0; --stationIdx)
393 if (theRequiredStationMask & 1 << stationIdx) {
394 if (theStationMask & 1 << stationIdx) {
395 lastSegBit = stationIdx;
404 for (
int stationIdx = 7; stationIdx >= 0; --stationIdx)
405 if (theStationMask & 1 << stationIdx) {
406 lastSegBit = stationIdx;
416 station = lastSegBit < 4 ? lastSegBit + 1 : lastSegBit - 3;
454 for (
int stationIdx =
station; stationIdx > 0; --stationIdx) {
455 if (!(theStationMask & 1 << (stationIdx - 1)))
458 if (
muon.dY(stationIdx, 1, arbitrationType) > 999998)
461 if (fabs(
muon.pullY(stationIdx, 1, arbitrationType,
true)) >
maxAbsPullY &&
462 fabs(
muon.dY(stationIdx, 1, arbitrationType)) >
maxAbsDy) {
466 if (applyAlsoAngularCuts && fabs(
muon.pullDyDz(stationIdx, 1, arbitrationType,
true)) >
maxAbsPullY)
489 unsigned int theStationMask =
muon.stationMask(arbitrationType);
500 bool existsGoodDTSegX =
false;
501 bool existsDTSegY =
false;
505 for (
int stationIdx = 0; stationIdx <= 7; ++stationIdx)
506 if (theStationMask & 1 << stationIdx) {
507 station = stationIdx < 4 ? stationIdx + 1 : stationIdx - 3;
515 existsGoodDTSegX =
true;
552 else if (existsGoodDTSegX)
563 for (std::vector<reco::MuonChamberMatch>::const_iterator chamberMatch =
muon.matches().begin();
564 chamberMatch !=
muon.matches().end();
566 if (chamberMatch->detector() != 3)
569 const double trkX = chamberMatch->x;
570 const double errX = chamberMatch->xErr;
572 for (std::vector<reco::MuonRPCHitMatch>::const_iterator rpcMatch = chamberMatch->rpcMatches.begin();
573 rpcMatch != chamberMatch->rpcMatches.end();
575 const double rpcX = rpcMatch->x;
577 const double dX = fabs(rpcX - trkX);
596 for (
const auto& chamberMatch :
muon.matches()) {
600 const double trkX = chamberMatch.x;
601 const double errX = chamberMatch.xErr;
602 const double trkY = chamberMatch.y;
603 const double errY = chamberMatch.yErr;
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;
611 const double dX = fabs(me0X - trkX);
612 const double dY = fabs(me0Y - trkY);
631 for (
const auto& chamberMatch :
muon.matches()) {
635 const double trkX = chamberMatch.x;
636 const double errX = chamberMatch.xErr;
637 const double trkY = chamberMatch.y;
638 const double errY = chamberMatch.yErr;
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;
646 const double dX = fabs(gemX - trkX);
647 const double dY = fabs(gemY - trkY);
670 return muon.isGlobalMuon();
673 return muon.isTrackerMuon();
676 return muon.isStandAloneMuon();
679 return muon.isTrackerMuon() &&
muon.numberOfMatches(arbitrationType) > 0;
682 return !
muon.isTrackerMuon() ||
muon.numberOfMatches(arbitrationType) > 0;
685 return muon.isGlobalMuon() &&
muon.globalTrack()->normalizedChi2() < 10. &&
686 muon.globalTrack()->hitPattern().numberOfValidMuonHits() > 0;
699 return muon.isTrackerMuon() &&
700 isGoodMuon(
muon,
TMLastStation, 2, 3, 3, 1E9, 1E9, -3, -3, arbitrationType,
true,
false);
703 return muon.isTrackerMuon() &&
704 isGoodMuon(
muon,
TMLastStation, 2, 3, 3, 3, 3, -3, -3, arbitrationType,
true,
false);
707 return muon.isTrackerMuon() &&
708 isGoodMuon(
muon,
TMOneStation, 1, 3, 3, 1E9, 1E9, 1E9, 1E9, arbitrationType,
false,
false);
711 return muon.isTrackerMuon() &&
712 isGoodMuon(
muon,
TMOneStation, 1, 3, 3, 3, 3, 1E9, 1E9, arbitrationType,
false,
false);
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);
719 return muon.isTrackerMuon() &&
720 isGoodMuon(
muon,
TMLastStation, 2, 3, 3, 1E9, 1E9, -3, -3, arbitrationType,
false,
false);
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);
727 return muon.isTrackerMuon() &&
728 isGoodMuon(
muon,
TMLastStation, 2, 3, 3, 3, 3, -3, -3, arbitrationType,
false,
false);
739 return muon.isGlobalMuon() &&
muon.isQualityValid() &&
740 fabs(
muon.combinedQuality().trkRelChi2 -
muon.innerTrack()->normalizedChi2()) < 2.0;
743 return muon.isGlobalMuon() &&
muon.isQualityValid() &&
744 fabs(
muon.combinedQuality().staRelChi2 -
muon.outerTrack()->normalizedChi2()) < 2.0;
747 return muon.isGlobalMuon() &&
muon.isQualityValid() &&
muon.combinedQuality().trkKink < 100.0;
750 return muon.isTrackerMuon() &&
751 isGoodMuon(
muon,
TMLastStation, 2, 3, 3, 1E9, 1E9, -3, -3, arbitrationType,
false,
true);
754 return muon.isTrackerMuon() &&
755 isGoodMuon(
muon,
TMLastStation, 2, 3, 3, 3, 3, -3, -3, arbitrationType,
false,
true);
758 return muon.isTrackerMuon() &&
759 isGoodMuon(
muon,
TMOneStation, 1, 3, 3, 1E9, 1E9, 1E9, 1E9, arbitrationType,
false,
true);
762 return muon.isTrackerMuon() &&
763 isGoodMuon(
muon,
TMOneStation, 1, 3, 3, 3, 3, 1E9, 1E9, arbitrationType,
false,
true);
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);
770 return muon.isTrackerMuon() &&
771 isGoodMuon(
muon,
TMLastStation, 2, 3, 3, 1E9, 1E9, -3, -3, arbitrationType,
true,
false);
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);
778 return muon.isTrackerMuon() &&
779 isGoodMuon(
muon,
TMLastStation, 2, 3, 3, 3, 3, -3, -3, arbitrationType,
true,
false);
782 return muon.isRPCMuon() &&
isGoodMuon(
muon,
RPCMu, 2, 20, 4, 1e9, 1e9, 1e9, 1e9, arbitrationType,
false,
false);
785 return muon.isME0Muon();
788 return muon.isME0Muon() &&
789 isGoodMuon(
muon,
ME0Mu, 1, 1e9, 1e9, 1e9, 1e9, 1e9, 1e9, arbitrationType,
false,
false);
792 return muon.isGEMMuon();
795 return muon.isGEMMuon() &&
796 isGoodMuon(
muon,
GEMMu, 1, 1e9, 1e9, 1e9, 1e9, 1e9, 1e9, arbitrationType,
false,
false);
807 const reco::Muon& muon1,
const reco::Muon& muon2,
double pullX,
double pullY,
bool checkAdjacentChambers) {
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();
814 for (std::vector<reco::MuonChamberMatch>::const_iterator chamber2 = muon2.
matches().begin();
815 chamber2 != muon2.
matches().end();
821 if (chamber1->id == chamber2->id) {
823 if (fabs(chamber1->x - chamber2->x) <
824 pullX *
sqrt(chamber1->xErr * chamber1->xErr + chamber2->xErr * chamber2->xErr)) {
829 if (nMatches1 == 0 || nMatches2 == 0)
833 if (fabs(chamber1->y - chamber2->y) <
834 pullY *
sqrt(chamber1->yErr * chamber1->yErr + chamber2->yErr * chamber2->yErr)) {
839 if (nMatches1 == 0 || nMatches2 == 0)
843 if (!checkAdjacentChambers)
850 if (
id1.endcap() !=
id2.endcap())
852 if (
id1.station() !=
id2.station())
854 if (
id1.ring() !=
id2.ring())
856 if (
abs(
id1.chamber() -
id2.chamber()) > 1)
864 if (fabs(chamber1->edgeX) > chamber1->xErr * pullX)
866 if (fabs(chamber2->edgeX) > chamber2->xErr * pullX)
868 if (chamber1->x * chamber2->x < 0) {
873 if (nMatches1 == 0 || nMatches2 == 0)
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;
896 if (!
muon.isPFMuon() || !
muon.isGlobalMuon())
901 bool hits =
muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
902 muon.innerTrack()->hitPattern().numberOfValidPixelHits() > 0;
905 fabs(
muon.muonBestTrack()->dxy(
vtx.position())) < 0.2 && fabs(
muon.muonBestTrack()->dz(
vtx.position())) < 0.5;
907 return muID &&
hits && ip;
911 return muon.isPFMuon() && (
muon.isGlobalMuon() ||
muon.isTrackerMuon());
917 if (run2016_hip_mitigation) {
918 if (
muon.innerTrack()->validFraction() < 0.49)
921 if (
muon.innerTrack()->validFraction() < 0.8)
925 bool goodGlb =
muon.isGlobalMuon() &&
muon.globalTrack()->normalizedChi2() < 3. &&
926 muon.combinedQuality().chi2LocalPosition < 12. &&
muon.combinedQuality().trkKink < 20.;
937 bool layers =
muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
938 muon.innerTrack()->hitPattern().pixelLayersWithMeasurement() > 0;
942 bool ip = fabs(
muon.innerTrack()->dxy(
vtx.position())) < 0.3 && fabs(
muon.innerTrack()->dz(
vtx.position())) < 20.;
944 return layers && ip && (ishighq | run2016_hip_mitigation);
948 if (!
muon.isGlobalMuon())
951 bool muValHits = (
muon.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 ||
952 muon.tunePMuonBestTrack()->hitPattern().numberOfValidMuonHits() > 0);
954 bool muMatchedSt =
muon.numberOfMatchedStations() > 1;
956 if (
muon.isTrackerMuon() &&
muon.numberOfMatchedStations() == 1) {
957 if (
muon.expectedNnumberOfMatchedStations() < 2 || !(
muon.stationMask() == 1 ||
muon.stationMask() == 16) ||
958 muon.numberOfMatchedRPCLayers() > 2)
963 bool muID = muValHits && muMatchedSt;
965 bool hits =
muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
966 muon.innerTrack()->hitPattern().numberOfValidPixelHits() > 0;
968 bool momQuality =
muon.tunePMuonBestTrack()->ptError() /
muon.tunePMuonBestTrack()->pt() < 0.3;
970 bool ip = fabs(
muon.innerTrack()->dxy(
vtx.position())) < 0.2 && fabs(
muon.innerTrack()->dz(
vtx.position())) < 0.5;
972 return muID &&
hits && momQuality && ip;
976 bool muID =
muon.isTrackerMuon() &&
muon.track().isNonnull() && (
muon.numberOfMatchedStations() > 1);
980 bool hits =
muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
981 muon.innerTrack()->hitPattern().numberOfValidPixelHits() > 0;
983 bool momQuality =
muon.tunePMuonBestTrack()->ptError() /
muon.tunePMuonBestTrack()->pt() < 0.3;
985 bool ip = fabs(
muon.innerTrack()->dxy(
vtx.position())) < 0.2 && fabs(
muon.innerTrack()->dz(
vtx.position())) < 0.5;
987 return muID &&
hits && momQuality && ip;
994 for (std::vector<reco::MuonChamberMatch>::const_iterator chamberMatch =
mu.matches().begin();
995 chamberMatch !=
mu.matches().end();
997 if (chamberMatch->segmentMatches.empty())
999 for (std::vector<reco::MuonChamberMatch>::const_iterator chamberMatch2 = mu2.
matches().begin();
1000 chamberMatch2 != mu2.
matches().end();
1002 if (chamberMatch2->segmentMatches.empty())
1004 if (chamberMatch2->id() != chamberMatch->id())
1006 for (std::vector<reco::MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
1007 segmentMatch != chamberMatch->segmentMatches.end();
1009 if (!segmentMatch->isMask(segmentArbitrationMask))
1011 for (std::vector<reco::MuonSegmentMatch>::const_iterator segmentMatch2 = chamberMatch2->segmentMatches.begin();
1012 segmentMatch2 != chamberMatch2->segmentMatches.end();
1014 if (!segmentMatch2->isMask(segmentArbitrationMask))
1016 if ((segmentMatch->cscSegmentRef.isNonnull() &&
1017 segmentMatch->cscSegmentRef == segmentMatch2->cscSegmentRef) ||
1018 (segmentMatch->dtSegmentRef.isNonnull() && segmentMatch->dtSegmentRef == segmentMatch2->dtSegmentRef)) {
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;
1036 if ((fabs(rpcTime.timeAtIpInOut) > 10) && !(combinedTimeIsOk && fabs(combinedTime.timeAtIpInOut) < 10))
1039 if (combinedTimeIsOk && (combinedTime.timeAtIpInOut > 20 || combinedTime.timeAtIpInOut < -45))
1047 bool run2016_hip_mitigation) {
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();
1074 if (
vertex and fabs(
muon.muonBestTrack()->dz(
vertex->position())) < 0.1 and
1075 fabs(
muon.muonBestTrack()->dxy(
vertex->position())) < 0.02)
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)
1107 return static_cast<reco::Muon::Selector>(
selectors);