37 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: Constructor called";
39 produces<reco::MuonCollection>();
40 produces<reco::CaloMuonCollection>();
41 produces<reco::MuonTimeExtraMap>(
"combined");
42 produces<reco::MuonTimeExtraMap>(
"dt");
43 produces<reco::MuonTimeExtraMap>(
"csc");
74 iConfig.
getParameter<
double>(
"ptThresholdToFillCandidateP4WithGlobalFit");
76 iConfig.
getParameter<
double>(
"sigmaThresholdToFillCandidateP4WithGlobalFit");
87 theTimingFiller_ = std::make_unique<MuonTimingFiller>(timingParameters, consumesCollector());
92 theShowerDigiFiller_ = std::make_unique<MuonShowerDigiFiller>(showerDigiParameters, consumesCollector());
137 <<
"Number of input collection labels is different from number of types. " 138 <<
"For each collection label there should be exactly one collection type specified.";
140 throw cms::Exception(
"ConfigurationError") <<
"Number of input collections should be from 1 to 8.";
145 <<
"========================================================================\n" 146 <<
"Debugging mode with truth matching is turned on!!! Make sure you understand what you are doing!\n" 147 <<
"========================================================================\n";
153 glbQualToken_ = consumes<edm::ValueMap<reco::MuonQuality> >(glbQualTag);
170 rpcHitToken_ = consumes<RPCRecHitCollection>(rpcHitTag);
173 gemHitToken_ = consumes<GEMRecHitCollection>(gemHitTag);
240 LogTrace(
"MuonIdentification") <<
"Number of input outer secondary tracks: " 283 LogTrace(
"MuonIdentification") <<
"Creating a muon from a track " <<
track.get()->pt()
284 <<
" Pt (GeV), eta: " <<
track.get()->eta();
287 LogTrace(
"MuonIdentification") <<
"Muon created from a track ";
290 aMuon.setBestTrack(
type);
291 aMuon.setTunePBestTrack(
type);
294 <<
"Muon created from a track and setMuonBestTrack, setBestTrack and setTunePBestTrack called";
300 LogTrace(
"MuonIdentification") <<
"Creating a CaloMuon from a Muon";
305 if (
muon.isEnergyValid())
314 LogTrace(
"MuonIdentification") <<
"Creating a muon from a link to tracks object";
321 bool useSigmaSwitch =
false;
329 if (tpfmsRef.
isNull() && pickyRef.isNull() && dytRef.isNull()) {
330 edm::LogWarning(
"MakeMuonWithTEV") <<
"Failed to get TEV refits, fall back to sigma switch.";
331 useSigmaSwitch =
true;
334 useSigmaSwitch =
true;
337 if (useSigmaSwitch) {
339 links.trackerTrack(),
344 links.trackerTrack(),
350 aMuon =
makeMuon(*chosenTrack.first);
379 const double p =
track.p();
382 LogTrace(
"MuonIdentification") <<
"Skipped low momentum track (Pt,P): " <<
pt <<
", " <<
track.p() <<
" GeV";
390 LogTrace(
"MuonIdentification") <<
"Skipped track with large pseudo rapidity (Eta: " <<
track.eta() <<
" )";
401 const auto subdetId =
id.subdetId();
412 if (!
muon.isMatchesValid() ||
track.extra().isNull() ||
track.extra()->recHitsSize() == 0)
415 int numberOfCommonDetIds = 0;
416 const std::vector<reco::MuonChamberMatch>&
matches(
muon.matches());
418 if (
match.segmentMatches.empty())
421 bool foundCommonDetId =
false;
422 for (
auto hit =
track.extra()->recHitsBegin();
hit !=
track.extra()->recHitsEnd(); ++
hit) {
428 foundCommonDetId =
true;
432 if (foundCommonDetId) {
433 ++numberOfCommonDetIds;
437 return numberOfCommonDetIds;
448 const int nHitsGood = goodMuon.
globalTrack()->hitPattern().numberOfValidMuonHits();
449 const int nHitsBad = badMuon.
globalTrack()->hitPattern().numberOfValidMuonHits();
450 if (
std::min(nHitsGood, nHitsBad) > 10) {
451 const double chi2Good = goodMuon.
globalTrack()->normalizedChi2();
452 const double chi2Bad = badMuon.
globalTrack()->normalizedChi2();
453 return (chi2Good <= chi2Bad);
456 return (nHitsGood >= nHitsBad);
460 auto outputMuons = std::make_unique<reco::MuonCollection>();
461 auto caloMuons = std::make_unique<reco::CaloMuonCollection>();
473 outputMuons->push_back(
muon);
480 std::vector<bool> goodmuons(nLink,
true);
483 for (
unsigned int i = 0;
i < nLink - 1; ++
i) {
485 if (iLink.trackerTrack().isNull() || !
checkLinks(&iLink))
487 for (
unsigned int j =
i + 1;
j < nLink; ++
j) {
491 if (iLink.trackerTrack() == jLink.trackerTrack()) {
497 goodmuons[
j] =
false;
499 goodmuons[
i] =
false;
504 for (
unsigned int i = 0;
i < nLink - 1; ++
i) {
508 if (iLink.standAloneTrack().isNull() || !
checkLinks(&iLink))
510 for (
unsigned int j =
i + 1;
j < nLink; ++
j) {
516 if (iLink.standAloneTrack() == jLink.standAloneTrack()) {
518 goodmuons[
j] =
false;
520 goodmuons[
i] =
false;
525 for (
unsigned int i = 0;
i < nLink; ++
i) {
533 for (
const auto&
muon : *outputMuons) {
534 if (
muon.track() == iLink.trackerTrack() &&
muon.standAloneMuon() == iLink.standAloneTrack() &&
535 muon.combinedMuon() == iLink.globalTrack()) {
541 outputMuons->push_back(
makeMuon(iLink));
549 LogTrace(
"MuonIdentification") <<
"Creating tracker muons";
550 std::vector<TrackDetectorAssociator::Direction> directions1, directions2;
566 if (!(*recoVertices)[0].isFake())
570 bool splitTrack =
false;
573 const auto&
directions = splitTrack ? directions1 : directions2;
602 for (
auto&
muon : *outputMuons) {
620 LogTrace(
"MuonIdentification") <<
"Found a corresponding global muon. Set energy, matches and move on";
625 if (goodTrackerMuon || goodRPCMuon || goodGEMMuon || goodME0Muon) {
628 LogTrace(
"MuonIdentification") <<
"track failed minimal number of muon matches requirement";
640 LogTrace(
"MuonIdentification") <<
"Looking for new muons among stand alone muon tracks";
642 const unsigned int nsecond =
644 for (
unsigned int i = 0;
i < nouter + nsecond; ++
i) {
645 const auto& outerTrack =
652 for (
auto&
muon : *outputMuons) {
653 if (!
muon.standAloneMuon().isNull()) {
655 if (
muon.standAloneMuon().get() == &outerTrack ||
656 (
muon.standAloneMuon()->extra().isNonnull() &&
657 muon.standAloneMuon()->extra().get() == outerTrack.extra().get())) {
670 LogTrace(
"MuonIdentification") <<
"Found associated tracker muon. Set a reference and move on";
672 muon.setOuterTrack(refToTrack);
679 LogTrace(
"MuonIdentification") <<
"No associated stand alone track is found. Making a muon";
693 LogTrace(
"MuonIdentification") <<
"Dress up muons if it's necessary";
695 const int nMuons = outputMuons->size();
697 std::vector<reco::MuonTimeExtra> dtTimeColl(
nMuons);
698 std::vector<reco::MuonTimeExtra> cscTimeColl(
nMuons);
699 std::vector<reco::MuonTimeExtra> combinedTimeColl(
nMuons);
700 std::vector<reco::IsoDeposit> trackDepColl(
nMuons);
701 std::vector<reco::IsoDeposit> ecalDepColl(
nMuons);
702 std::vector<reco::IsoDeposit> hcalDepColl(
nMuons);
703 std::vector<reco::IsoDeposit> hoDepColl(
nMuons);
704 std::vector<reco::IsoDeposit> jetDepColl(
nMuons);
707 for (
unsigned int i = 0;
i < outputMuons->size(); ++
i) {
708 auto&
muon = outputMuons->at(
i);
714 if (
muon.isStandAloneMuon()) {
721 LogTrace(
"MuonIdentification") <<
"THIS SHOULD NEVER HAPPEN";
730 LogDebug(
"MuonIdentification") <<
"";
741 iEvent, iSetup,
muon, trackDepColl[
i], ecalDepColl[
i], hcalDepColl[
i], hoDepColl[
i], jetDepColl[
i]);
753 muonTime.
nDof = combinedTime.
nDof();
759 muon.setTime(muonTime);
760 muon.setRPCTime(rpcTime);
761 dtTimeColl[
i] = dtTime;
762 cscTimeColl[
i] = cscTime;
763 combinedTimeColl[
i] = combinedTime;
766 LogTrace(
"MuonIdentification") <<
"number of muons produced: " << outputMuons->size();
776 auto oMap = std::make_unique<MapType>();
778 typename MapType::Filler
filler(*oMap);
779 filler.insert(refH, vec.begin(), vec.end());
785 fillMap(muonHandle, combinedTimeColl,
iEvent,
"combined");
786 fillMap(muonHandle, dtTimeColl,
iEvent,
"dt");
787 fillMap(muonHandle, cscTimeColl,
iEvent,
"csc");
833 for (
auto& chamberMatch :
muon.matches()) {
834 if (chamberMatch.gemMatches.empty())
836 numMatches += chamberMatch.gemMatches.size();
852 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId";
862 <<
"Failed to fill muon id information for a muon with undefined references to tracks";
866 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fillEnergy = " <<
fillEnergy_;
881 for (
auto hit :
info.crossedHcalRecHits) {
892 if (!
info.crossedEcalIds.empty())
894 if (!
info.crossedHcalIds.empty())
898 for (
const auto&
hit :
info.ecalRecHits) {
899 if (
hit->
id() != emMaxId)
905 for (
const auto&
hit :
info.hcalRecHits) {
906 if (
hit->
id() != hadMaxId)
917 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fill muon match info ";
918 std::vector<reco::MuonChamberMatch> muonChamberMatches;
919 unsigned int nubmerOfMatchesAccordingToTrackAssociator = 0;
928 const auto& lErr =
chamber.tState.localError();
929 const auto& lPos =
chamber.tState.localPosition();
930 const auto& lDir =
chamber.tState.localDirection();
932 const auto& localError = lErr.positionError();
933 matchedChamber.
x = lPos.x();
934 matchedChamber.
y = lPos.y();
935 matchedChamber.
xErr =
sqrt(localError.xx());
936 matchedChamber.
yErr =
sqrt(localError.yy());
938 matchedChamber.
dXdZ = lDir.z() != 0 ? lDir.x() / lDir.z() : 9999;
939 matchedChamber.
dYdZ = lDir.z() != 0 ? lDir.y() / lDir.z() : 9999;
942 matchedChamber.
dXdZErr = trajectoryCovMatrix(1, 1) > 0 ?
sqrt(trajectoryCovMatrix(1, 1)) : 0;
943 matchedChamber.
dYdZErr = trajectoryCovMatrix(2, 2) > 0 ?
sqrt(trajectoryCovMatrix(2, 2)) : 0;
957 ++nubmerOfMatchesAccordingToTrackAssociator;
960 for (
const auto& segment :
chamber.segments) {
962 matchedSegment.
x = segment.segmentLocalPosition.x();
963 matchedSegment.
y = segment.segmentLocalPosition.y();
964 matchedSegment.
dXdZ =
965 segment.segmentLocalDirection.z() ? segment.segmentLocalDirection.x() / segment.segmentLocalDirection.z() : 0;
966 matchedSegment.
dYdZ =
967 segment.segmentLocalDirection.z() ? segment.segmentLocalDirection.y() / segment.segmentLocalDirection.z() : 0;
968 matchedSegment.
xErr = segment.segmentLocalErrorXX > 0 ?
sqrt(segment.segmentLocalErrorXX) : 0;
969 matchedSegment.
yErr = segment.segmentLocalErrorYY > 0 ?
sqrt(segment.segmentLocalErrorYY) : 0;
970 matchedSegment.
dXdZErr = segment.segmentLocalErrorDxDz > 0 ?
sqrt(segment.segmentLocalErrorDxDz) : 0;
971 matchedSegment.
dYdZErr = segment.segmentLocalErrorDyDz > 0 ?
sqrt(segment.segmentLocalErrorDyDz) : 0;
972 matchedSegment.
t0 = segment.t0;
973 matchedSegment.
mask = 0;
978 matchedSegment.
hasZed_ = segment.hasZed;
979 matchedSegment.
hasPhi_ = segment.hasPhi;
981 bool matchedX =
false;
982 bool matchedY =
false;
983 LogTrace(
"MuonIdentification") <<
" matching local x, segment x: " << matchedSegment.
x 984 <<
", chamber x: " << matchedChamber.
x <<
", max: " <<
maxAbsDx_;
985 LogTrace(
"MuonIdentification") <<
" matching local y, segment y: " << matchedSegment.
y 986 <<
", chamber y: " << matchedChamber.
y <<
", max: " <<
maxAbsDy_;
987 const double matchedSegChDx =
std::abs(matchedSegment.
x - matchedChamber.
x);
988 const double matchedSegChDy =
std::abs(matchedSegment.
y - matchedChamber.
y);
989 if (matchedSegment.
xErr > 0 && matchedChamber.
xErr > 0)
990 LogTrace(
"MuonIdentification") <<
" xpull: " 993 if (matchedSegment.
yErr > 0 && matchedChamber.
yErr > 0)
994 LogTrace(
"MuonIdentification") <<
" ypull: " 1000 else if (matchedSegment.
xErr > 0 && matchedChamber.
xErr > 0) {
1002 if (matchedSegChDx * matchedSegChDx <
maxAbsPullX2_ * invMatchedSegChPullX2)
1007 else if (matchedSegment.
yErr > 0 && matchedChamber.
yErr > 0) {
1009 if (matchedSegChDy * matchedSegChDy <
maxAbsPullY2_ * invMatchedSegChPullY2)
1012 if (matchedX && matchedY) {
1014 matchedChamber.
me0Matches.push_back(matchedSegment);
1016 matchedChamber.
gemMatches.push_back(matchedSegment);
1021 muonChamberMatches.push_back(matchedChamber);
1025 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fill RPC info";
1030 const auto& lErr =
chamber.tState.localError();
1031 const auto& lPos =
chamber.tState.localPosition();
1032 const auto& lDir =
chamber.tState.localDirection();
1036 LocalError localError = lErr.positionError();
1037 matchedChamber.
x = lPos.x();
1038 matchedChamber.
y = lPos.y();
1042 matchedChamber.
dXdZ = lDir.z() != 0 ? lDir.x() / lDir.z() : 9999;
1043 matchedChamber.
dYdZ = lDir.z() != 0 ? lDir.y() / lDir.z() : 9999;
1046 matchedChamber.
dXdZErr = trajectoryCovMatrix(1, 1) > 0 ?
sqrt(trajectoryCovMatrix(1, 1)) : 0;
1047 matchedChamber.
dYdZErr = trajectoryCovMatrix(2, 2) > 0 ?
sqrt(trajectoryCovMatrix(2, 2)) : 0;
1059 if (rpcRecHit.rawId() !=
chamber.id.rawId())
1062 rpcHitMatch.
x = rpcRecHit.localPosition().x();
1063 rpcHitMatch.
mask = 0;
1064 rpcHitMatch.
bx = rpcRecHit.BunchX();
1066 const double absDx =
std::abs(rpcRecHit.localPosition().x() -
chamber.tState.localPosition().x());
1067 if (absDx <= 20
or absDx * absDx <= 16 * localError.
xx())
1068 matchedChamber.
rpcMatches.push_back(rpcHitMatch);
1071 muonChamberMatches.push_back(matchedChamber);
1076 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fill GEM info";
1083 const auto& lErr =
chamber.tState.localError();
1084 const auto& lPos =
chamber.tState.localPosition();
1085 const auto& lDir =
chamber.tState.localDirection();
1089 LocalError localError = lErr.positionError();
1090 matchedChamber.
x = lPos.x();
1091 matchedChamber.
y = lPos.y();
1095 matchedChamber.
dXdZ = lDir.z() != 0 ? lDir.x() / lDir.z() : 9999;
1096 matchedChamber.
dYdZ = lDir.z() != 0 ? lDir.y() / lDir.z() : 9999;
1099 matchedChamber.
dXdZErr = trajectoryCovMatrix(1, 1) > 0 ?
sqrt(trajectoryCovMatrix(1, 1)) : 0;
1100 matchedChamber.
dYdZErr = trajectoryCovMatrix(2, 2) > 0 ?
sqrt(trajectoryCovMatrix(2, 2)) : 0;
1121 gemHitMatch.
x =
gemRecHit.localPosition().x();
1122 gemHitMatch.
mask = 0;
1126 if (absDx <= 5
or absDx * absDx <= 16 * localError.
xx())
1130 muonChamberMatches.push_back(matchedChamber);
1136 LogTrace(
"MuonIdentification") <<
"number of muon chambers: " << aMuon.
matches().size() <<
"\n" 1137 <<
"number of chambers with segments according to the associator requirements: " 1138 << nubmerOfMatchesAccordingToTrackAssociator;
1139 LogTrace(
"MuonIdentification") <<
"number of segment matches with the producer requirements: " 1150 if (
muon->isTrackerMuon()) {
1159 if ((
muon->type() & (~
mask)) == 0) {
1178 std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> > chamberPairs;
1179 std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> > stationPairs;
1180 std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> >
1184 for (
unsigned int muonIndex1 = 0; muonIndex1 < pOutputMuons->size(); ++muonIndex1) {
1185 auto& muon1 = pOutputMuons->at(muonIndex1);
1187 for (
auto& chamber1 : muon1.matches()) {
1189 std::vector<reco::MuonSegmentMatch>* segmentMatches1 =
getSegmentMatches(chamber1, muonType);
1191 if (segmentMatches1->empty())
1193 chamberPairs.clear();
1195 for (
auto& segment1 : *segmentMatches1) {
1196 chamberPairs.push_back(std::make_pair(&chamber1, &segment1));
1197 if (!segment1.isMask())
1199 arbitrationPairs.clear();
1200 arbitrationPairs.push_back(std::make_pair(&chamber1, &segment1));
1204 if (muon1.type() & muonType) {
1206 for (
unsigned int muonIndex2 = muonIndex1 + 1; muonIndex2 < pOutputMuons->size(); ++muonIndex2) {
1207 auto& muon2 = pOutputMuons->at(muonIndex2);
1209 if (!(muon2.type() & muonType))
1212 for (
auto& chamber2 : muon2.matches()) {
1214 std::vector<reco::MuonSegmentMatch>* segmentMatches2 =
getSegmentMatches(chamber2, muonType);
1215 for (
auto& segment2 : *segmentMatches2) {
1216 if (segment2.isMask())
1221 approxEqual(segment2.dXdZErr, segment1.dXdZErr) &&
1222 approxEqual(segment2.dYdZErr, segment1.dYdZErr)) {
1223 arbitrationPairs.push_back(std::make_pair(&chamber2, &segment2));
1231 if (arbitrationPairs.empty())
1233 if (arbitrationPairs.size() == 1) {
1240 sort(arbitrationPairs.begin(),
1241 arbitrationPairs.end(),
1244 sort(arbitrationPairs.begin(),
1245 arbitrationPairs.end(),
1248 sort(arbitrationPairs.begin(),
1249 arbitrationPairs.end(),
1252 sort(arbitrationPairs.begin(),
1253 arbitrationPairs.end(),
1256 for (
auto& ap : arbitrationPairs) {
1265 for (
auto& segment2 : chamber1.segmentMatches) {
1266 if (segment1.cscSegmentRef.isNull() || segment2.cscSegmentRef.isNull())
1268 if (
meshAlgo_->isDuplicateOf(segment1.cscSegmentRef, segment2.cscSegmentRef) &&
1269 (segment2.mask & 0x1e0000) && (segment1.mask & 0x1e0000)) {
1279 if (chamberPairs.empty())
1281 if (chamberPairs.size() == 1) {
1287 sort(chamberPairs.begin(),
1291 sort(chamberPairs.begin(),
1295 sort(chamberPairs.begin(),
1299 sort(chamberPairs.begin(),
1308 for (
int detectorIndex = 1; detectorIndex <= 5;
1311 stationPairs.clear();
1314 for (
auto&
chamber : muon1.matches()) {
1318 if (segmentMatches->empty())
1321 for (
auto& segment : *segmentMatches) {
1322 stationPairs.push_back(std::make_pair(&
chamber, &segment));
1326 if (stationPairs.empty())
1328 if (stationPairs.size() == 1) {
1334 sort(stationPairs.begin(),
1338 sort(stationPairs.begin(),
1342 sort(stationPairs.begin(),
1346 sort(stationPairs.begin(),
1378 <<
"Failed to compute muon isolation information for a muon with undefined references to tracks";
1387 if (caloDeps.size() != 3) {
1388 LogTrace(
"MuonIdentification") <<
"Failed to fill vector of calorimeter isolation deposits!";
1440 if (muonId.
sector() <= 12)
1442 if (muonId.
sector() == 13)
1444 if (muonId.
sector() == 14)
1457 if (
muon.isStandAloneMuon())
1458 return muon.standAloneMuon()->innerPosition().phi();
1460 if (
muon.matches().empty()) {
1461 if (
muon.innerTrack().isAvailable() &&
muon.innerTrack()->extra().isAvailable())
1462 return muon.innerTrack()->outerPosition().phi();
1491 const bool trackBAD =
links->trackerTrack().isNull();
1492 const bool staBAD =
links->standAloneTrack().isNull();
1493 const bool glbBAD =
links->globalTrack().isNull();
1494 if (trackBAD || staBAD || glbBAD) {
1495 edm::LogWarning(
"muonIDbadLinks") <<
"Global muon links to constituent tracks are invalid: trkBad " << trackBAD
1496 <<
" standaloneBad " << staBAD <<
" globalBad " << glbBAD
1497 <<
". There should be no such object. Muon is skipped.";
1505 desc.setAllowAnything();
1507 desc.add<
bool>(
"arbitrateTrackerMuons",
false);
1508 desc.add<
bool>(
"storeCrossedHcalRecHits",
false);
1509 desc.add<
bool>(
"fillShowerDigis",
false);
1518 descTrkAsoPar.
add<
bool>(
"useGEM",
false);
1519 descTrkAsoPar.
add<
bool>(
"useME0",
false);
1520 descTrkAsoPar.
add<
bool>(
"preselectMuonTracks",
false);
1535 descCalo.
add<
bool>(
"UseEcalRecHitsFlag",
false);
1536 descCalo.add<
bool>(
"UseHcalRecHitsFlag",
false);
1537 descCalo.add<
bool>(
"UseHORecHitsFlag",
false);
1538 descCalo.add<
bool>(
"EcalRecHitThresh",
false);
1539 descCalo.add<
bool>(
"HcalCutsFromDB",
false);
1540 descCalo.add<
int>(
"MaxSeverityHB", 9);
1541 descCalo.add<
int>(
"MaxSeverityHE", 9);
std::string hoDepositName_
constexpr double deltaPhi(double phi1, double phi2)
MuonQuality combinedQuality() const
get energy deposition information
static const unsigned int BelongsToTrackByME1aClean
std::string jetDepositName_
bool isGoodRPCMuon(const reco::Muon &muon)
bool approxEqual(const double a, const double b, const double tol=1E-3) const
edm::EDGetTokenT< reco::TrackCollection > innerTrackCollectionToken_
reco::Muon makeMuon(edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::TrackRef &track, TrackType type)
T getParameter(std::string const &) const
GEMSegmentRef gemSegmentRef
static const unsigned int GlobalMuon
void fillMuonIsolation(edm::Event &, const edm::EventSetup &, reco::Muon &aMuon, reco::IsoDeposit &trackDep, reco::IsoDeposit &ecalDep, reco::IsoDeposit &hcalDep, reco::IsoDeposit &hoDep, reco::IsoDeposit &jetDep)
edm::EDGetTokenT< edm::ValueMap< reco::MuonQuality > > glbQualToken_
DTRecSegment4DRef dtSegmentRef
TrackRef combinedMuon() const override
reference to a stand-alone muon Track
std::vector< reco::MuonSegmentMatch > gemMatches
static bool crossedIP(const reco::Track &track)
float sumPt
sum-pt of tracks
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
static void truthMatchMuon(const edm::Event &iEvent, const GlobalTrackingGeometry &iGeometry, reco::Muon &aMuon)
TrackDetectorAssociator trackAssociator_
CSCSegmentRef cscSegmentRef
std::unique_ptr< MuonKinkFinder > trackerKinkFinder_
static const unsigned int Arbitrated
segment mask flags
void fillMuonId(edm::Event &, const edm::EventSetup &, reco::Muon &, TrackDetectorAssociator::Direction direction=TrackDetectorAssociator::InsideOut)
void setAllowAnything()
allow any parameter label/value pairs
edm::Handle< reco::MuonTrackLinksCollection > linkCollectionHandle_
edm::EDGetTokenT< RPCRecHitCollection > rpcHitToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
bool isGoodGEMMuon(const reco::Muon &muon)
int overlap(const reco::Muon &muon, const reco::Track &track)
bool fillCaloCompatibility_
std::string trackDepositName_
void fillArbitrationInfo(reco::MuonCollection *, unsigned int muonType=reco::Muon::TrackerMuon)
T const * product() const
constexpr bool isUninitialized() const noexcept
std::vector< reco::MuonGEMHitMatch > gemHitMatches
std::vector< CaloMuon > CaloMuonCollection
collection of Muon objects
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomTokenRun_
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
void produce(edm::Event &, const edm::EventSetup &) override
float hadVetoEt
hcal sum-et in the veto region in r-phi
double p() const
momentum vector magnitude
double evaluate(const reco::Muon &)
bool isNonnull() const
Checks for non-null.
std::vector< Vertex > VertexCollection
collection of Vertex objects
MuonCaloCompatibility muonCaloCompatibility_
static const unsigned int BestInStationByDRSlope
edm::EDGetTokenT< reco::TrackToTrackMap > pickyCollectionToken_
static std::string toStr(const ICTypeKey k)
bool arbitrateTrackerMuons_
static const unsigned int BelongsToTrackByDXSlope
void setCalEnergy(const MuonEnergy &calEnergy)
set energy deposition information
void fillGlbQuality(edm::Event &, const edm::EventSetup &, reco::Muon &aMuon)
TrackRef track() const override
reference to a Track
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorTrack_
static const unsigned int BestInStationByDR
std::vector< Muon > MuonCollection
collection of Muon objects
bool isTrackerMuon() const override
std::unique_ptr< MuonTimingFiller > theTimingFiller_
virtual void setTunePBestTrack(MuonTrackType muonType)
double phiOfMuonInteractionRegion(const reco::Muon &muon) const
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > globalGeomToken_
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorCalo_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void init(edm::Event &, const edm::EventSetup &)
virtual void setInnerTrack(const TrackRef &t)
set reference to Track
float caloCompatibility() const
edm::EDGetTokenT< reco::TrackToTrackMap > tpfmsCollectionToken_
std::vector< reco::MuonSegmentMatch > me0Matches
std::unique_ptr< MuonShowerDigiFiller > theShowerDigiFiller_
edm::Handle< reco::VertexCollection > pvHandle_
double ptThresholdToFillCandidateP4WithGlobalFit_
void addDefault(ParameterSetDescription const &psetDescription)
reco::Muon::MuonTrackTypePair sigmaSwitch(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const double nSigma=2., const double ptThreshold=200.)
TrackAssociatorParameters parameters_
bool isGoodME0Muon(const reco::Muon &muon)
reco::Muon::MuonTrackTypePair tevOptimized(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const reco::TrackRef &tpfmsTrack, const reco::TrackRef &pickyTrack, const reco::TrackRef &dytTrack, const double ptThreshold=200., const double tune1=17., const double tune2=40., const double dptcut=0.25)
void fillTrackerKink(reco::Muon &aMuon)
void setPropagator(const Propagator *)
use a user configured propagator
reco::TrackRef globalTrack() const
get the combined track
static const unsigned int ME0Muon
ArbitrationType
define arbitration schemes
bool isGoodTrackerMuon(const reco::Muon &muon)
double candEnergy() const
Get energy or pT attached to cand trajectory.
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
int nJets
number of jets in the cone
static const unsigned int BestInChamberByDX
std::string ecalDepositName_
bool checkLinks(const reco::MuonTrackLinks *) const
float timeAtIpOutIn
b) particle is moving from outside in
int nDof
number of muon stations used
bool isCaloCompatibilityValid() const
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< reco::MuonCollection > muonCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > outerTrackCollectionToken_
edm::Handle< RPCRecHitCollection > rpcHitHandle_
std::vector< reco::MuonRPCHitMatch > rpcMatches
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static const unsigned int BestInChamberByDR
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
ME0SegmentRef me0SegmentRef
virtual TrackRef innerTrack() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::Handle< reco::TrackToTrackMap > dytCollectionHandle_
bool isNull() const
Checks for null.
edm::Handle< reco::TrackCollection > outerTrackCollectionHandle_
edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkCollectionToken_
static const unsigned int BestInStationByDXSlope
bool fillGlobalTrackRefits_
static double sectorPhi(const DetId &id)
void setMuonTrack(const MuonTrackType &, const TrackRef &)
float hoVetoEt
ho sum-et in the veto region in r-phi
double depositWithin(double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const
Get deposit.
edm::EDGetTokenT< GEMRecHitCollection > gemHitToken_
reco::CaloMuon makeCaloMuon(const reco::Muon &)
int nTracks
number of tracks in the cone (excluding veto region)
static const unsigned int BestInChamberByDXSlope
void setCaloCompatibility(float input)
static const unsigned int RPCMuon
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
static ICTypeKey toKey(const std::string &s)
std::vector< reco::MuonSegmentMatch > * getSegmentMatches(reco::MuonChamberMatch &chamber, unsigned int muonType) const
get the segment matches of the appropriate type
static const unsigned int TrackerMuon
float emVetoEt
ecal sum-et in the veto region in r-phi
void configure(const edm::ParameterSet &)
bool isQualityValid() const
std::vector< ICTypes::ICTypeKey > inputCollectionTypes_
constexpr uint32_t rawId() const
get the raw id
CSCDetId chamberId() const
static const unsigned int BelongsToTrackByDRSlope
edm::Handle< GEMRecHitCollection > gemHitHandle_
virtual void setInnerTrack(const TrackRef &t)
set reference to Track
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
void setCombinedQuality(const MuonQuality &combinedQuality)
set energy deposition information
std::vector< edm::InputTag > inputCollectionLabels_
static const unsigned int PFMuon
std::vector< MuonChamberMatch > & matches()
get muon matching information
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorJet_
void setCalEnergy(const MuonEnergy &calEnergy)
set energy deposition information
MuonIdProducer(const edm::ParameterSet &)
void arbitrateMuons(reco::MuonCollection *, reco::CaloMuonCollection *)
std::vector< reco::MuonSegmentMatch > segmentMatches
bool fillGlobalTrackQuality_
virtual void setOuterTrack(const TrackRef &t)
set reference to Track
static const unsigned int BelongsToTrackByDR
std::string hcalDepositName_
~MuonIdProducer() override
unsigned int chamberId(const DetId &)
reco::TrackRef getTevRefitTrack(const reco::TrackRef &combinedTrack, const reco::TrackToTrackMap &map)
static const unsigned int BelongsToTrackByDX
void setIsolation(const MuonIsolation &isoR03, const MuonIsolation &isoR05)
virtual void setBestTrack(MuonTrackType muonType)
functor predicate for standard library sort algorithm
static const unsigned int GEMMuon
edm::EDGetTokenT< reco::TrackCollection > outerTrackSecondaryCollectionToken_
edm::Handle< reco::TrackToTrackMap > tpfmsCollectionHandle_
T const * get() const
Returns C++ pointer to the item.
static const unsigned int BestInStationByDX
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
bool storeCrossedHcalRecHits_
edm::Handle< reco::TrackCollection > innerTrackCollectionHandle_
bool isGoodTrack(const reco::Track &track)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
edm::EDGetTokenT< reco::VertexCollection > pvToken_
int triggerSector() const
MuonTrackType
map for Global Muon refitters
double sigmaThresholdToFillCandidateP4WithGlobalFit_
static const unsigned int StandAloneMuon
edm::Handle< reco::TrackCollection > outerTrackSecondaryCollectionHandle_
Log< level::Warning, false > LogWarning
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
void setMatches(const std::vector< MuonChamberMatch > &matches)
set muon matching information
static const unsigned int BestInChamberByDRSlope
bool validateGlobalMuonPair(const reco::MuonTrackLinks &goodMuon, const reco::MuonTrackLinks &badMuon)
bool debugWithTruthMatching_
bool isGoodCaloMuon(const reco::CaloMuon &muon)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool isGlobalMuon() const override
virtual void setGlobalTrack(const TrackRef &t)
set reference to Track
Power< A, B >::type pow(const A &a, const B &b)
float trackerVetoPt
(sum-)pt inside the veto region in r-phi
edm::Handle< reco::MuonCollection > muonCollectionHandle_
std::pair< double, int > depositAndCountWithin(double coneSize, const Vetos &vetos=Vetos(), double threshold=-1e+36, bool skipDepositVeto=false) const
Get deposit.
edm::Handle< edm::ValueMap< reco::MuonQuality > > glbQualHandle_
void beginRun(const edm::Run &, const edm::EventSetup &) override
edm::Handle< reco::TrackToTrackMap > pickyCollectionHandle_
std::unique_ptr< MuonMesh > meshAlgo_
edm::EDGetTokenT< reco::TrackToTrackMap > dytCollectionToken_