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");
69 if (fillGlobalTrackQuality_)
70 fillTrackerKink_ = iConfig.
getParameter<
bool>(
"fillTrackerKink");
73 iConfig.
getParameter<
double>(
"ptThresholdToFillCandidateP4WithGlobalFit");
75 iConfig.
getParameter<
double>(
"sigmaThresholdToFillCandidateP4WithGlobalFit");
86 theTimingFiller_ = std::make_unique<MuonTimingFiller>(timingParameters, consumesCollector());
89 if (fillShowerDigis_ && fillMatching_) {
91 theShowerDigiFiller_ = std::make_unique<MuonShowerDigiFiller>(showerDigiParameters, consumesCollector());
102 if (fillIsolation_) {
119 if (fillIsolation_ && writeIsoDeposits_) {
136 <<
"Number of input collection labels is different from number of types. "
137 <<
"For each collection label there should be exactly one collection type specified.";
139 throw cms::Exception(
"ConfigurationError") <<
"Number of input collections should be from 1 to 7.";
144 <<
"========================================================================\n"
145 <<
"Debugging mode with truth matching is turned on!!! Make sure you understand what you are doing!\n"
146 <<
"========================================================================\n";
150 if (fillGlobalTrackQuality_) {
152 glbQualToken_ = consumes<edm::ValueMap<reco::MuonQuality> >(glbQualTag);
155 if (fillTrackerKink_) {
164 rpcHitToken_ = consumes<RPCRecHitCollection>(rpcHitTag);
262 LogTrace(
"MuonIdentification") <<
"Creating a muon from a track " << track.
get()->pt()
263 <<
" Pt (GeV), eta: " << track.
get()->eta();
266 LogTrace(
"MuonIdentification") <<
"Muon created from a track ";
268 aMuon.setMuonTrack(type, track);
269 aMuon.setBestTrack(type);
270 aMuon.setTunePBestTrack(type);
273 <<
"Muon created from a track and setMuonBestTrack, setBestTrack and setTunePBestTrack called";
279 LogTrace(
"MuonIdentification") <<
"Creating a CaloMuon from a Muon";
293 LogTrace(
"MuonIdentification") <<
"Creating a muon from a link to tracks object";
300 bool useSigmaSwitch =
false;
308 if (tpfmsRef.
isNull() && pickyRef.isNull() && dytRef.isNull()) {
309 edm::LogWarning(
"MakeMuonWithTEV") <<
"Failed to get TEV refits, fall back to sigma switch.";
310 useSigmaSwitch =
true;
313 useSigmaSwitch =
true;
316 if (useSigmaSwitch) {
329 aMuon =
makeMuon(*chosenTrack.first);
358 const double p = track.
p();
359 const double pt = track.
pt();
361 LogTrace(
"MuonIdentification") <<
"Skipped low momentum track (Pt,P): " << pt <<
", " << track.
p() <<
" GeV";
366 const double eta = track.
eta();
367 const double absEta =
std::abs(eta);
369 LogTrace(
"MuonIdentification") <<
"Skipped track with large pseudo rapidity (Eta: " << track.
eta() <<
" )";
380 const auto subdetId =
id.subdetId();
384 return CSCDetId(
id.rawId()).chamberId().rawId();
394 int numberOfCommonDetIds = 0;
395 const std::vector<reco::MuonChamberMatch>& matches(muon.
matches());
396 for (
const auto&
match : matches) {
397 if (
match.segmentMatches.empty())
400 bool foundCommonDetId =
false;
401 for (
auto hit = track.
extra()->recHitsBegin();
hit != track.
extra()->recHitsEnd(); ++
hit) {
407 foundCommonDetId =
true;
411 if (foundCommonDetId) {
412 ++numberOfCommonDetIds;
416 return numberOfCommonDetIds;
427 const int nHitsGood = goodMuon.
globalTrack()->hitPattern().numberOfValidMuonHits();
428 const int nHitsBad = badMuon.
globalTrack()->hitPattern().numberOfValidMuonHits();
429 if (
std::min(nHitsGood, nHitsBad) > 10) {
430 const double chi2Good = goodMuon.
globalTrack()->normalizedChi2();
431 const double chi2Bad = badMuon.
globalTrack()->normalizedChi2();
432 return (chi2Good <= chi2Bad);
435 return (nHitsGood >= nHitsBad);
439 auto outputMuons = std::make_unique<reco::MuonCollection>();
440 auto caloMuons = std::make_unique<reco::CaloMuonCollection>();
442 init(iEvent, iSetup);
452 outputMuons->push_back(
muon);
459 std::vector<bool> goodmuons(nLink,
true);
462 for (
unsigned int i = 0;
i < nLink - 1; ++
i) {
464 if (iLink.trackerTrack().isNull() || !
checkLinks(&iLink))
466 for (
unsigned int j =
i + 1;
j < nLink; ++
j) {
470 if (iLink.trackerTrack() == jLink.trackerTrack()) {
476 goodmuons[
j] =
false;
478 goodmuons[
i] =
false;
483 for (
unsigned int i = 0;
i < nLink - 1; ++
i) {
487 if (iLink.standAloneTrack().isNull() || !
checkLinks(&iLink))
489 for (
unsigned int j = i + 1;
j < nLink; ++
j) {
495 if (iLink.standAloneTrack() == jLink.standAloneTrack()) {
497 goodmuons[j] =
false;
499 goodmuons[
i] =
false;
504 for (
unsigned int i = 0;
i < nLink; ++
i) {
512 for (
const auto&
muon : *outputMuons) {
513 if (
muon.track() == iLink.trackerTrack() &&
muon.standAloneMuon() == iLink.standAloneTrack() &&
514 muon.combinedMuon() == iLink.globalTrack()) {
520 outputMuons->push_back(
makeMuon(iLink));
528 LogTrace(
"MuonIdentification") <<
"Creating tracker muons";
529 std::vector<TrackDetectorAssociator::Direction> directions1, directions2;
544 bool splitTrack =
false;
547 const auto&
directions = splitTrack ? directions1 : directions2;
551 fillMuonId(iEvent, iSetup, trackerMuon, direction);
576 for (
auto&
muon : *outputMuons) {
594 LogTrace(
"MuonIdentification") <<
"Found a corresponding global muon. Set energy, matches and move on";
599 if (goodTrackerMuon || goodRPCMuon || goodGEMMuon || goodME0Muon) {
600 outputMuons->push_back(trackerMuon);
602 LogTrace(
"MuonIdentification") <<
"track failed minimal number of muon matches requirement";
605 caloMuons->push_back(caloMuon);
614 LogTrace(
"MuonIdentification") <<
"Looking for new muons among stand alone muon tracks";
620 for (
auto&
muon : *outputMuons) {
621 if (!
muon.standAloneMuon().isNull()) {
623 if (
muon.standAloneMuon().get() == &outerTrack) {
636 LogTrace(
"MuonIdentification") <<
"Found associated tracker muon. Set a reference and move on";
645 LogTrace(
"MuonIdentification") <<
"No associated stand alone track is found. Making a muon";
646 outputMuons->push_back(
658 LogTrace(
"MuonIdentification") <<
"Dress up muons if it's necessary";
660 const int nMuons = outputMuons->size();
662 std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
663 std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
664 std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
665 std::vector<reco::IsoDeposit> trackDepColl(nMuons);
666 std::vector<reco::IsoDeposit> ecalDepColl(nMuons);
667 std::vector<reco::IsoDeposit> hcalDepColl(nMuons);
668 std::vector<reco::IsoDeposit> hoDepColl(nMuons);
669 std::vector<reco::IsoDeposit> jetDepColl(nMuons);
672 for (
unsigned int i = 0;
i < outputMuons->size(); ++
i) {
673 auto&
muon = outputMuons->at(
i);
679 if (
muon.isStandAloneMuon()) {
686 LogTrace(
"MuonIdentification") <<
"THIS SHOULD NEVER HAPPEN";
695 LogDebug(
"MuonIdentification") <<
"";
706 iEvent, iSetup,
muon, trackDepColl[
i], ecalDepColl[i], hcalDepColl[i], hoDepColl[i], jetDepColl[i]);
718 muonTime.
nDof = combinedTime.
nDof();
724 muon.setTime(muonTime);
725 muon.setRPCTime(rpcTime);
726 dtTimeColl[
i] = dtTime;
727 cscTimeColl[
i] = cscTime;
728 combinedTimeColl[
i] = combinedTime;
731 LogTrace(
"MuonIdentification") <<
"number of muons produced: " << outputMuons->size();
741 auto oMap = std::make_unique<MapType>();
743 typename MapType::Filler filler(*oMap);
744 filler.insert(refH, vec.begin(), vec.end());
750 fillMap(muonHandle, combinedTimeColl, iEvent,
"combined");
751 fillMap(muonHandle, dtTimeColl, iEvent,
"dt");
752 fillMap(muonHandle, cscTimeColl, iEvent,
"csc");
806 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId";
816 <<
"Failed to fill muon id information for a muon with undefined references to tracks";
820 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fillEnergy = " <<
fillEnergy_;
853 if (
hit->
id() != emMaxId)
860 if (
hit->
id() != hadMaxId)
871 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fill muon match info ";
872 std::vector<reco::MuonChamberMatch> muonChamberMatches;
873 unsigned int nubmerOfMatchesAccordingToTrackAssociator = 0;
874 for (
const auto& chamber : info.
chambers) {
879 const auto& lErr = chamber.tState.localError();
880 const auto& lPos = chamber.tState.localPosition();
881 const auto& lDir = chamber.tState.localDirection();
883 const auto& localError = lErr.positionError();
884 matchedChamber.
x = lPos.x();
885 matchedChamber.
y = lPos.y();
886 matchedChamber.
xErr =
sqrt(localError.xx());
887 matchedChamber.
yErr =
sqrt(localError.yy());
889 matchedChamber.
dXdZ = lDir.z() != 0 ? lDir.x() / lDir.z() : 9999;
890 matchedChamber.
dYdZ = lDir.z() != 0 ? lDir.y() / lDir.z() : 9999;
893 matchedChamber.
dXdZErr = trajectoryCovMatrix(1, 1) > 0 ?
sqrt(trajectoryCovMatrix(1, 1)) : 0;
894 matchedChamber.
dYdZErr = trajectoryCovMatrix(2, 2) > 0 ?
sqrt(trajectoryCovMatrix(2, 2)) : 0;
896 matchedChamber.
edgeX = chamber.localDistanceX;
897 matchedChamber.
edgeY = chamber.localDistanceY;
899 matchedChamber.
id = chamber.id;
907 if (!chamber.segments.empty())
908 ++nubmerOfMatchesAccordingToTrackAssociator;
911 for (
const auto& segment : chamber.segments) {
913 matchedSegment.
x = segment.segmentLocalPosition.x();
914 matchedSegment.
y = segment.segmentLocalPosition.y();
915 matchedSegment.
dXdZ =
916 segment.segmentLocalDirection.z() ? segment.segmentLocalDirection.x() / segment.segmentLocalDirection.z() : 0;
917 matchedSegment.
dYdZ =
918 segment.segmentLocalDirection.z() ? segment.segmentLocalDirection.y() / segment.segmentLocalDirection.z() : 0;
919 matchedSegment.
xErr = segment.segmentLocalErrorXX > 0 ?
sqrt(segment.segmentLocalErrorXX) : 0;
920 matchedSegment.
yErr = segment.segmentLocalErrorYY > 0 ?
sqrt(segment.segmentLocalErrorYY) : 0;
921 matchedSegment.
dXdZErr = segment.segmentLocalErrorDxDz > 0 ?
sqrt(segment.segmentLocalErrorDxDz) : 0;
922 matchedSegment.
dYdZErr = segment.segmentLocalErrorDyDz > 0 ?
sqrt(segment.segmentLocalErrorDyDz) : 0;
923 matchedSegment.
t0 = segment.t0;
924 matchedSegment.
mask = 0;
929 matchedSegment.
hasZed_ = segment.hasZed;
930 matchedSegment.
hasPhi_ = segment.hasPhi;
932 bool matchedX =
false;
933 bool matchedY =
false;
934 LogTrace(
"MuonIdentification") <<
" matching local x, segment x: " << matchedSegment.
x
935 <<
", chamber x: " << matchedChamber.
x <<
", max: " <<
maxAbsDx_;
936 LogTrace(
"MuonIdentification") <<
" matching local y, segment y: " << matchedSegment.
y
937 <<
", chamber y: " << matchedChamber.
y <<
", max: " <<
maxAbsDy_;
938 const double matchedSegChDx =
std::abs(matchedSegment.
x - matchedChamber.
x);
939 const double matchedSegChDy =
std::abs(matchedSegment.
y - matchedChamber.
y);
940 if (matchedSegment.
xErr > 0 && matchedChamber.
xErr > 0)
941 LogTrace(
"MuonIdentification") <<
" xpull: "
944 if (matchedSegment.
yErr > 0 && matchedChamber.
yErr > 0)
945 LogTrace(
"MuonIdentification") <<
" ypull: "
951 else if (matchedSegment.
xErr > 0 && matchedChamber.
xErr > 0) {
953 if (matchedSegChDx * matchedSegChDx <
maxAbsPullX2_ * invMatchedSegChPullX2)
958 else if (matchedSegment.
yErr > 0 && matchedChamber.
yErr > 0) {
960 if (matchedSegChDy * matchedSegChDy <
maxAbsPullY2_ * invMatchedSegChPullY2)
963 if (matchedX && matchedY) {
965 matchedChamber.
me0Matches.push_back(matchedSegment);
967 matchedChamber.
gemMatches.push_back(matchedSegment);
972 muonChamberMatches.push_back(matchedChamber);
976 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fill RPC info";
978 for (
const auto& chamber : info.
chambers) {
981 const auto& lErr = chamber.tState.localError();
982 const auto& lPos = chamber.tState.localPosition();
983 const auto& lDir = chamber.tState.localDirection();
988 matchedChamber.
x = lPos.x();
989 matchedChamber.
y = lPos.y();
993 matchedChamber.
dXdZ = lDir.z() != 0 ? lDir.x() / lDir.z() : 9999;
994 matchedChamber.
dYdZ = lDir.z() != 0 ? lDir.y() / lDir.z() : 9999;
997 matchedChamber.
dXdZErr = trajectoryCovMatrix(1, 1) > 0 ?
sqrt(trajectoryCovMatrix(1, 1)) : 0;
998 matchedChamber.
dYdZErr = trajectoryCovMatrix(2, 2) > 0 ?
sqrt(trajectoryCovMatrix(2, 2)) : 0;
1000 matchedChamber.
edgeX = chamber.localDistanceX;
1001 matchedChamber.
edgeY = chamber.localDistanceY;
1005 matchedChamber.
id = chamber.id;
1010 if (rpcRecHit.rawId() != chamber.id.rawId())
1013 rpcHitMatch.
x = rpcRecHit.localPosition().x();
1014 rpcHitMatch.
mask = 0;
1015 rpcHitMatch.
bx = rpcRecHit.BunchX();
1017 const double absDx =
std::abs(rpcRecHit.localPosition().x() - chamber.tState.localPosition().x());
1018 if (absDx <= 20
or absDx * absDx <= 16 * localError.
xx())
1019 matchedChamber.
rpcMatches.push_back(rpcHitMatch);
1022 muonChamberMatches.push_back(matchedChamber);
1028 LogTrace(
"MuonIdentification") <<
"number of muon chambers: " << aMuon.
matches().size() <<
"\n"
1029 <<
"number of chambers with segments according to the associator requirements: "
1030 << nubmerOfMatchesAccordingToTrackAssociator;
1031 LogTrace(
"MuonIdentification") <<
"number of segment matches with the producer requirements: "
1041 for (reco::MuonCollection::iterator
muon = muons->begin();
muon != muons->end();) {
1042 if (
muon->isTrackerMuon()) {
1048 if ((
muon->type() & (~mask)) == 0) {
1051 caloMuons->push_back(caloMuon);
1055 muon->setType(
muon->type() & (~
reco::Muon::TrackerMuon));
1067 std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> > chamberPairs;
1068 std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> > stationPairs;
1069 std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> >
1073 for (
unsigned int muonIndex1 = 0; muonIndex1 < pOutputMuons->size(); ++muonIndex1) {
1074 auto& muon1 = pOutputMuons->at(muonIndex1);
1076 for (
auto& chamber1 : muon1.matches()) {
1078 std::vector<reco::MuonSegmentMatch>* segmentMatches1 =
getSegmentMatches(chamber1, muonType);
1080 if (segmentMatches1->empty())
1082 chamberPairs.clear();
1084 for (
auto& segment1 : *segmentMatches1) {
1085 chamberPairs.push_back(std::make_pair(&chamber1, &segment1));
1086 if (!segment1.isMask())
1088 arbitrationPairs.clear();
1089 arbitrationPairs.push_back(std::make_pair(&chamber1, &segment1));
1093 if (muon1.type() & muonType) {
1095 for (
unsigned int muonIndex2 = muonIndex1 + 1; muonIndex2 < pOutputMuons->size(); ++muonIndex2) {
1096 auto& muon2 = pOutputMuons->at(muonIndex2);
1098 if (!(muon2.type() & muonType))
1101 for (
auto& chamber2 : muon2.matches()) {
1103 std::vector<reco::MuonSegmentMatch>* segmentMatches2 =
getSegmentMatches(chamber2, muonType);
1104 for (
auto& segment2 : *segmentMatches2) {
1105 if (segment2.isMask())
1110 approxEqual(segment2.dXdZErr, segment1.dXdZErr) &&
1111 approxEqual(segment2.dYdZErr, segment1.dYdZErr)) {
1112 arbitrationPairs.push_back(std::make_pair(&chamber2, &segment2));
1120 if (arbitrationPairs.empty())
1122 if (arbitrationPairs.size() == 1) {
1129 sort(arbitrationPairs.begin(),
1130 arbitrationPairs.end(),
1133 sort(arbitrationPairs.begin(),
1134 arbitrationPairs.end(),
1137 sort(arbitrationPairs.begin(),
1138 arbitrationPairs.end(),
1141 sort(arbitrationPairs.begin(),
1142 arbitrationPairs.end(),
1145 for (
auto& ap : arbitrationPairs) {
1153 CSCDetId(chamber1.id).ring() == 4) {
1154 for (
auto& segment2 : chamber1.segmentMatches) {
1155 if (segment1.cscSegmentRef.isNull() || segment2.cscSegmentRef.isNull())
1157 if (
meshAlgo_->isDuplicateOf(segment1.cscSegmentRef, segment2.cscSegmentRef) &&
1158 (segment2.mask & 0x1e0000) && (segment1.mask & 0x1e0000)) {
1168 if (chamberPairs.empty())
1170 if (chamberPairs.size() == 1) {
1176 sort(chamberPairs.begin(),
1180 sort(chamberPairs.begin(),
1184 sort(chamberPairs.begin(),
1188 sort(chamberPairs.begin(),
1197 for (
int detectorIndex = 1; detectorIndex <= 5;
1200 stationPairs.clear();
1203 for (
auto& chamber : muon1.matches()) {
1204 if (!(chamber.station() ==
stationIndex && chamber.detector() == detectorIndex))
1206 std::vector<reco::MuonSegmentMatch>* segmentMatches =
getSegmentMatches(chamber, muonType);
1207 if (segmentMatches->empty())
1210 for (
auto& segment : *segmentMatches) {
1211 stationPairs.push_back(std::make_pair(&chamber, &segment));
1215 if (stationPairs.empty())
1217 if (stationPairs.size() == 1) {
1223 sort(stationPairs.begin(),
1227 sort(stationPairs.begin(),
1231 sort(stationPairs.begin(),
1235 sort(stationPairs.begin(),
1267 <<
"Failed to compute muon isolation information for a muon with undefined references to tracks";
1273 std::vector<reco::IsoDeposit> caloDeps =
muIsoExtractorCalo_->deposits(iEvent, iSetup, *track);
1276 if (caloDeps.size() != 3) {
1277 LogTrace(
"MuonIdentification") <<
"Failed to fill vector of calorimeter isolation deposits!";
1320 const double energy =
std::sqrt(track.
p() * track.
p() + 0.105658369 * 0.105658369);
1329 if (muonId.
sector() <= 12)
1331 if (muonId.
sector() == 13)
1332 phi = 3 / 6. *
M_PI;
1333 if (muonId.
sector() == 14)
1334 phi = 9 / 6. *
M_PI;
1351 return muon.
innerTrack()->outerPosition().phi();
1383 if (trackBAD || staBAD || glbBAD) {
1384 edm::LogWarning(
"muonIDbadLinks") <<
"Global muon links to constituent tracks are invalid: trkBad " << trackBAD
1385 <<
" standaloneBad " << staBAD <<
" globalBad " << glbBAD
1386 <<
". There should be no such object. Muon is skipped.";
1396 desc.
add<
bool>(
"arbitrateTrackerMuons",
false);
1397 desc.
add<
bool>(
"storeCrossedHcalRecHits",
false);
1398 desc.
add<
bool>(
"fillShowerDigis",
false);
1403 descTrkAsoPar.add<
bool>(
"useGEM",
false);
1404 descTrkAsoPar.add<
bool>(
"useME0",
false);
1405 descTrkAsoPar.setAllowAnything();
std::string hoDepositName_
constexpr double deltaPhi(double phi1, double phi2)
double p() const
momentum vector magnitude
static const unsigned int BelongsToTrackByME1aClean
std::string jetDepositName_
double candEnergy() const
Get energy or pT attached to cand trajectory.
bool isGoodRPCMuon(const reco::Muon &muon)
int numberOfMatchedRPCLayers(ArbitrationType type=RPCHitAndTrackArbitration) const
edm::EDGetTokenT< reco::TrackCollection > innerTrackCollectionToken_
reco::Muon makeMuon(edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::TrackRef &track, TrackType type)
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
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
TrackRef combinedMuon() const override
reference to a stand-alone muon Track
bool isNonnull() const
Checks for non-null.
reco::TrackRef trackerTrack() const
get the tracker's track which match with the stand alone muon tracks
std::vector< reco::MuonSegmentMatch > gemMatches
static bool crossedIP(const reco::Track &track)
float sumPt
sum-pt of tracks
double pt() const final
transverse momentum
void setType(unsigned int type)
static void truthMatchMuon(const edm::Event &iEvent, const GlobalTrackingGeometry &iGeometry, reco::Muon &aMuon)
TrackDetectorAssociator trackAssociator_
CSCSegmentRef cscSegmentRef
std::unique_ptr< MuonKinkFinder > trackerKinkFinder_
const TrackExtraRef & extra() const
reference to "extra" object
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
static const unsigned int Arbitrated
segment mask flags
void fillMuonId(edm::Event &, const edm::EventSetup &, reco::Muon &, TrackDetectorAssociator::Direction direction=TrackDetectorAssociator::InsideOut)
std::vector< const HBHERecHit * > crossedHcalRecHits
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setAllowAnything()
allow any parameter label/value pairs
edm::Handle< reco::MuonTrackLinksCollection > linkCollectionHandle_
edm::EDGetTokenT< RPCRecHitCollection > rpcHitToken_
uint32_t const *__restrict__ Quality * quality
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
bool isGoodGEMMuon(const reco::Muon &muon)
int overlap(const reco::Muon &muon, const reco::Track &track)
reco::TrackRef standAloneTrack() const
get the track built with the muon spectrometer alone
bool fillCaloCompatibility_
std::vector< const EcalRecHit * > ecalRecHits
hits in the cone
std::vector< DetId > crossedEcalIds
std::string trackDepositName_
void fillArbitrationInfo(reco::MuonCollection *, unsigned int muonType=reco::Muon::TrackerMuon)
std::vector< CaloMuon > CaloMuonCollection
collection of Muon objects
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomTokenRun_
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
std::vector< reco::MuonSegmentMatch > * getSegmentMatches(reco::MuonChamberMatch &chamber, unsigned int muonType) const
get the segment matches of the appropriate type
DetId findMaxDeposition(EnergyType)
Find detector elements with highest energy deposition.
void produce(edm::Event &, const edm::EventSetup &) override
float hadVetoEt
hcal sum-et in the veto region in r-phi
float emS9
energy deposited in 3x3 ECAL crystal shape around central crystal
double evaluate(const reco::Muon &)
MuonCaloCompatibility muonCaloCompatibility_
static const unsigned int BestInStationByDRSlope
bool isMatchesValid() const
tuple inputCollectionTypes
edm::EDGetTokenT< reco::TrackToTrackMap > pickyCollectionToken_
static std::string toStr(const ICTypeKey k)
double px() const
x coordinate of momentum vector
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
std::vector< DetId > crossedHcalIds
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
double nXnEnergy(const DetId &, EnergyType, int gridSize=1)
get energy of the NxN shape (N = 2*gridSize + 1) around given detector element
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorTrack_
float towerS9
total energy in 3x3 tower shape
static const unsigned int BestInStationByDR
MuonTime time() const
get DT/CSC combined timing information
std::vector< Muon > MuonCollection
collection of Muon objects
bool isTrackerMuon() const override
std::unique_ptr< MuonTimingFiller > theTimingFiller_
math::XYZPoint trkGlobPosAtHcal
float ecal_time
Calorimeter timing.
float ho
energy deposited in crossed HO towers
virtual void setTunePBestTrack(MuonTrackType muonType)
double depositWithin(double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const
Get deposit.
bool approxEqual(const double a, const double b, const double tol=1E-3) const
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > globalGeomToken_
bool getData(T &iHolder) const
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
DetId hcal_id
DetId of the central HCAL tower with smallest depth.
edm::EDGetTokenT< reco::TrackToTrackMap > tpfmsCollectionToken_
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
std::vector< reco::MuonSegmentMatch > me0Matches
std::unique_ptr< MuonShowerDigiFiller > theShowerDigiFiller_
double ptThresholdToFillCandidateP4WithGlobalFit_
double eta() const
pseudorapidity of momentum vector
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 isCaloCompatibilityValid() const
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
float emS25
energy deposited in 5x5 ECAL crystal shape around central crystal
double p() const
momentum vector magnitude
static const unsigned int ME0Muon
ArbitrationType
define arbitration schemes
bool isGoodTrackerMuon(const reco::Muon &muon)
double pt() const
track transverse momentum
bool checkLinks(const reco::MuonTrackLinks *) const
std::vector< TAMuonChamberMatch > chambers
int nJets
number of jets in the cone
std::vector< const HBHERecHit * > hcalRecHits
static const unsigned int BestInChamberByDX
std::string ecalDepositName_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MuonQuality combinedQuality() const
get energy deposition information
float timeAtIpOutIn
b) particle is moving from outside in
int nDof
number of muon stations used
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< reco::MuonCollection > muonCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > outerTrackCollectionToken_
edm::Handle< RPCRecHitCollection > rpcHitHandle_
float hoS9
energy deposited in 3x3 HO tower shape around central tower
std::vector< reco::MuonRPCHitMatch > rpcMatches
static const unsigned int BestInChamberByDR
T const * get() const
Returns C++ pointer to the item.
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
ME0SegmentRef me0SegmentRef
bool isQualityValid() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::Handle< reco::TrackToTrackMap > dytCollectionHandle_
edm::Handle< reco::TrackCollection > outerTrackCollectionHandle_
edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkCollectionToken_
double crossedEnergy(EnergyType)
energy in detector elements crossed by the track by types
bool isNull() const
Checks for null.
static const unsigned int BestInStationByDXSlope
math::XYZPointF hcal_position
bool fillGlobalTrackRefits_
static double sectorPhi(const DetId &id)
void setMuonTrack(const MuonTrackType &, const TrackRef &)
bool isEnergyValid() const
float hoVetoEt
ho sum-et in the veto region in r-phi
double pz() const
z coordinate of momentum vector
double phiOfMuonInteractionRegion(const reco::Muon &muon) const
MuonEnergy calEnergy() const
get energy deposition information
reco::CaloMuon makeCaloMuon(const reco::Muon &)
int nTracks
number of tracks in the cone (excluding veto region)
static const unsigned int BestInChamberByDXSlope
float emMax
maximal energy of ECAL crystal in the 5x5 shape
void setCaloCompatibility(float input)
static const unsigned int RPCMuon
static ICTypeKey toKey(const std::string &s)
static const unsigned int TrackerMuon
float emVetoEt
ecal sum-et in the veto region in r-phi
void configure(const edm::ParameterSet &)
std::vector< ICTypes::ICTypeKey > inputCollectionTypes_
float hadMax
maximal energy of HCAL tower in the 3x3 shape
static const unsigned int BelongsToTrackByDRSlope
virtual void setInnerTrack(const TrackRef &t)
set reference to Track
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
T getParameter(std::string const &) const
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
int triggerSector() const
MuonIdProducer(const edm::ParameterSet &)
void arbitrateMuons(reco::MuonCollection *, reco::CaloMuonCollection *)
std::vector< reco::MuonSegmentMatch > segmentMatches
bool fillGlobalTrackQuality_
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
DetId ecal_id
DetId of the central ECAL crystal.
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
std::pair< double, int > depositAndCountWithin(double coneSize, const Vetos &vetos=Vetos(), double threshold=-1e+36, bool skipDepositVeto=false) const
Get deposit.
edm::Handle< reco::TrackToTrackMap > tpfmsCollectionHandle_
static const unsigned int BestInStationByDX
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
bool storeCrossedHcalRecHits_
edm::Handle< reco::TrackCollection > innerTrackCollectionHandle_
unsigned int type() const
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
int charge() const
track electric charge
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.
MuonTrackType
map for Global Muon refitters
double sigmaThresholdToFillCandidateP4WithGlobalFit_
static const unsigned int StandAloneMuon
std::vector< HcalMuonRecHit > crossedHadRecHits
Log< level::Warning, false > LogWarning
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
void setMatches(const std::vector< MuonChamberMatch > &matches)
set muon matching information
double phi() const final
momentum azimuthal angle
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
static const unsigned int BestInChamberByDRSlope
float caloCompatibility() const
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
float hadS9
energy deposited in 3x3 HCAL tower shape around central tower
edm::Handle< reco::MuonCollection > muonCollectionHandle_
double py() const
y coordinate of momentum vector
edm::Handle< edm::ValueMap< reco::MuonQuality > > glbQualHandle_
void beginRun(const edm::Run &, const edm::EventSetup &) override
reco::TrackRef globalTrack() const
get the combined track
edm::Handle< reco::TrackToTrackMap > pickyCollectionHandle_
std::unique_ptr< MuonMesh > meshAlgo_
edm::EDGetTokenT< reco::TrackToTrackMap > dytCollectionToken_
bool isStandAloneMuon() const override
double eta() const final
momentum pseudorapidity