39 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: Constructor called";
41 produces<reco::MuonCollection>();
42 produces<reco::CaloMuonCollection>();
43 produces<reco::MuonTimeExtraMap>(
"combined");
44 produces<reco::MuonTimeExtraMap>(
"dt");
45 produces<reco::MuonTimeExtraMap>(
"csc");
69 if (fillGlobalTrackQuality_) fillTrackerKink_ = iConfig.
getParameter<
bool>(
"fillTrackerKink");
83 theTimingFiller_ = std::make_unique<MuonTimingFiller>(timingParameters,consumesCollector());
86 if (fillShowerDigis_ && fillMatching_)
89 theShowerDigiFiller_ = std::make_unique<MuonShowerDigiFiller>(showerDigiParameters,consumesCollector());
92 if (fillCaloCompatibility_){
112 if (fillIsolation_ && writeIsoDeposits_){
127 if (inputCollectionLabels_.size() != inputCollectionTypes.size())
128 throw cms::Exception(
"ConfigurationError") <<
"Number of input collection labels is different from number of types. " <<
129 "For each collection label there should be exactly one collection type specified.";
130 if (inputCollectionLabels_.size()>7 ||inputCollectionLabels_.empty())
131 throw cms::Exception(
"ConfigurationError") <<
"Number of input collections should be from 1 to 7.";
135 <<
"========================================================================\n" 136 <<
"Debugging mode with truth matching is turned on!!! Make sure you understand what you are doing!\n" 137 <<
"========================================================================\n";
138 if (fillGlobalTrackQuality_){
140 glbQualToken_ = consumes<edm::ValueMap<reco::MuonQuality> >(glbQualTag);
143 if (fillTrackerKink_) {
152 rpcHitToken_ = consumes<RPCRecHitCollection>(rpcHitTag);
157 for (
unsigned int i = 0;
i < inputCollectionLabels_.size(); ++
i ) {
268 LogTrace(
"MuonIdentification") <<
"Creating a muon from a track " << track.
get()->pt() <<
269 " Pt (GeV), eta: " << track.
get()->eta();
272 LogTrace(
"MuonIdentification") <<
"Muon created from a track ";
274 aMuon.setMuonTrack(type,track);
275 aMuon.setBestTrack(type);
276 aMuon.setTunePBestTrack(type);
278 LogTrace(
"MuonIdentification") <<
"Muon created from a track and setMuonBestTrack, setBestTrack and setTunePBestTrack called";
286 LogTrace(
"MuonIdentification") <<
"Creating a CaloMuon from a Muon";
300 LogTrace(
"MuonIdentification") <<
"Creating a muon from a link to tracks object";
307 bool useSigmaSwitch =
false;
316 if (tpfmsRef.
isNull() && pickyRef.isNull() && dytRef.isNull()){
317 edm::LogWarning(
"MakeMuonWithTEV")<<
"Failed to get TEV refits, fall back to sigma switch.";
318 useSigmaSwitch =
true;
321 useSigmaSwitch =
true;
330 tpfmsRef, pickyRef, dytRef,
333 aMuon =
makeMuon(*chosenTrack.first);
337 aMuon.setBestTrack(chosenTrack.second);
338 aMuon.setTunePBestTrack(chosenTrack.second);
361 const double p = track.
p();
362 const double pt = track.
pt();
364 LogTrace(
"MuonIdentification") <<
"Skipped low momentum track (Pt,P): " << pt
365 <<
", " << track.
p() <<
" GeV";
370 const double eta = track.
eta();
371 const double absEta =
std::abs(eta);
373 LogTrace(
"MuonIdentification") <<
"Skipped track with large pseudo rapidity (Eta: " << track.
eta() <<
" )";
384 const auto subdetId =
id.subdetId();
400 track.
extra()->recHitsSize()==0 )
return 0;
402 int numberOfCommonDetIds = 0;
403 const std::vector<reco::MuonChamberMatch>&
matches( muon.
matches() );
406 if (
match.segmentMatches.empty() )
continue;
408 bool foundCommonDetId =
false;
409 for (
auto hit = track.
extra()->recHitsBegin();
417 foundCommonDetId =
true;
421 if ( foundCommonDetId ) {
422 ++numberOfCommonDetIds;
426 return numberOfCommonDetIds;
443 const int nHitsGood = goodMuon.
globalTrack()->hitPattern().numberOfValidMuonHits();
444 const int nHitsBad = badMuon.
globalTrack()->hitPattern().numberOfValidMuonHits();
445 if (
std::min(nHitsGood, nHitsBad) > 10 ) {
446 const double chi2Good = goodMuon.
globalTrack()->normalizedChi2();
447 const double chi2Bad = badMuon.
globalTrack()->normalizedChi2();
448 return ( chi2Good <= chi2Bad );
451 return (nHitsGood >= nHitsBad);
457 auto outputMuons = std::make_unique<reco::MuonCollection>();
458 auto caloMuons = std::make_unique<reco::CaloMuonCollection>();
460 init(iEvent, iSetup);
470 outputMuons->push_back(
muon);
477 std::vector<bool> goodmuons(nLink,
true);
480 for (
unsigned int i=0;
i<nLink-1; ++
i ) {
482 if ( iLink.trackerTrack().isNull() || !
checkLinks(&iLink) )
continue;
483 for (
unsigned int j=
i+1; j<nLink; ++j ){
486 if ( iLink.trackerTrack() == jLink.trackerTrack() ) {
492 else goodmuons[
i] =
false;
497 for (
unsigned int i=0;
i<nLink-1; ++
i ) {
498 if ( !goodmuons[
i] )
continue;
500 if ( iLink.standAloneTrack().isNull() || !
checkLinks(&iLink))
continue;
501 for (
unsigned int j=i+1; j<nLink; ++j ) {
502 if ( !goodmuons[j] )
continue;
505 if ( iLink.standAloneTrack() == jLink.standAloneTrack() ) {
507 else goodmuons[
i] =
false;
512 for (
unsigned int i=0;
i<nLink; ++
i ) {
513 if ( !goodmuons[
i] )
continue;
518 for (
auto muon : *outputMuons ) {
519 if (
muon.track() == iLink.trackerTrack() &&
520 muon.standAloneMuon() == iLink.standAloneTrack() &&
521 muon.combinedMuon() == iLink.globalTrack() ) {
527 outputMuons->push_back(
makeMuon(iLink) );
535 LogTrace(
"MuonIdentification") <<
"Creating tracker muons";
536 std::vector<TrackDetectorAssociator::Direction> directions1, directions2;
546 bool splitTrack =
false;
549 const auto&
directions = splitTrack ? directions1 : directions2;
553 fillMuonId(iEvent, iSetup, trackerMuon, direction);
574 for (
auto&
muon : *outputMuons )
587 LogTrace(
"MuonIdentification") <<
"Found a corresponding global muon. Set energy, matches and move on";
592 if ( goodTrackerMuon || goodRPCMuon || goodGEMMuon || goodME0Muon){
593 outputMuons->push_back( trackerMuon );
595 LogTrace(
"MuonIdentification") <<
"track failed minimal number of muon matches requirement";
606 LogTrace(
"MuonIdentification") <<
"Looking for new muons among stand alone muon tracks";
613 for (
auto&
muon : *outputMuons )
615 if ( !
muon.standAloneMuon().isNull() ) {
617 if (
muon.standAloneMuon().get() == &outerTrack ) {
630 LogTrace(
"MuonIdentification") <<
"Found associated tracker muon. Set a reference and move on";
639 LogTrace(
"MuonIdentification") <<
"No associated stand alone track is found. Making a muon";
640 outputMuons->push_back(
makeMuon(iEvent, iSetup,
652 LogTrace(
"MuonIdentification") <<
"Dress up muons if it's necessary";
654 const int nMuons=outputMuons->size();
656 std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
657 std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
658 std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
659 std::vector<reco::IsoDeposit> trackDepColl(nMuons);
660 std::vector<reco::IsoDeposit> ecalDepColl(nMuons);
661 std::vector<reco::IsoDeposit> hcalDepColl(nMuons);
662 std::vector<reco::IsoDeposit> hoDepColl(nMuons);
663 std::vector<reco::IsoDeposit> jetDepColl(nMuons);
666 for (
unsigned int i=0;
i<outputMuons->size(); ++
i )
668 auto&
muon = outputMuons->at(
i);
676 if (
muon.isStandAloneMuon() ) {
683 LogTrace(
"MuonIdentification") <<
"THIS SHOULD NEVER HAPPEN";
702 trackDepColl[
i], ecalDepColl[i], hcalDepColl[i], hoDepColl[i], jetDepColl[i]);
720 muon.setTime(muonTime);
721 muon.setRPCTime(rpcTime);
722 dtTimeColl[
i] = dtTime;
723 cscTimeColl[
i] = cscTime;
724 combinedTimeColl[
i] = combinedTime;
727 LogTrace(
"MuonIdentification") <<
"number of muons produced: " << outputMuons->size();
737 auto oMap = std::make_unique<MapType>();
739 typename MapType::Filler
filler(*oMap);
740 filler.insert(refH, vec.begin(), vec.end());
746 fillMap(muonHandle, combinedTimeColl, iEvent,
"combined");
747 fillMap(muonHandle, dtTimeColl, iEvent,
"dt");
748 fillMap(muonHandle, cscTimeColl, iEvent,
"csc");
804 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId";
810 else throw cms::Exception(
"FatalError") <<
"Failed to fill muon id information for a muon with undefined references to tracks";
815 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fillEnergy = "<<
fillEnergy_;
847 if (
hit->
id() != emMaxId)
continue;
853 if (
hit->
id() != hadMaxId)
continue;
862 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fill muon match info ";
863 std::vector<reco::MuonChamberMatch> muonChamberMatches;
864 unsigned int nubmerOfMatchesAccordingToTrackAssociator = 0;
870 const auto& lErr =
chamber.tState.localError();
871 const auto& lPos =
chamber.tState.localPosition();
872 const auto& lDir =
chamber.tState.localDirection();
874 const auto& localError = lErr.positionError();
875 matchedChamber.
x = lPos.x();
876 matchedChamber.
y = lPos.y();
877 matchedChamber.
xErr =
sqrt( localError.xx() );
878 matchedChamber.
yErr =
sqrt( localError.yy() );
880 matchedChamber.
dXdZ = lDir.z()!=0?lDir.x()/lDir.z():9999;
881 matchedChamber.
dYdZ = lDir.z()!=0?lDir.y()/lDir.z():9999;
884 matchedChamber.
dXdZErr = trajectoryCovMatrix(1,1)>0?
sqrt(trajectoryCovMatrix(1,1)):0;
885 matchedChamber.
dYdZErr = trajectoryCovMatrix(2,2)>0?
sqrt(trajectoryCovMatrix(2,2)):0;
899 if ( !
chamber.segments.empty() ) ++nubmerOfMatchesAccordingToTrackAssociator;
902 for (
const auto& segment :
chamber.segments )
905 matchedSegment.
x = segment.segmentLocalPosition.x();
906 matchedSegment.
y = segment.segmentLocalPosition.y();
907 matchedSegment.
dXdZ = segment.segmentLocalDirection.z()?segment.segmentLocalDirection.x()/segment.segmentLocalDirection.z():0;
908 matchedSegment.
dYdZ = segment.segmentLocalDirection.z()?segment.segmentLocalDirection.y()/segment.segmentLocalDirection.z():0;
909 matchedSegment.
xErr = segment.segmentLocalErrorXX>0?
sqrt(segment.segmentLocalErrorXX):0;
910 matchedSegment.
yErr = segment.segmentLocalErrorYY>0?
sqrt(segment.segmentLocalErrorYY):0;
911 matchedSegment.
dXdZErr = segment.segmentLocalErrorDxDz>0?
sqrt(segment.segmentLocalErrorDxDz):0;
912 matchedSegment.
dYdZErr = segment.segmentLocalErrorDyDz>0?
sqrt(segment.segmentLocalErrorDyDz):0;
913 matchedSegment.
t0 = segment.t0;
914 matchedSegment.
mask = 0;
919 matchedSegment.
hasZed_ = segment.hasZed;
920 matchedSegment.
hasPhi_ = segment.hasPhi;
922 bool matchedX =
false;
923 bool matchedY =
false;
924 LogTrace(
"MuonIdentification") <<
" matching local x, segment x: " << matchedSegment.
x <<
925 ", chamber x: " << matchedChamber.
x <<
", max: " <<
maxAbsDx_;
926 LogTrace(
"MuonIdentification") <<
" matching local y, segment y: " << matchedSegment.
y <<
927 ", chamber y: " << matchedChamber.
y <<
", max: " <<
maxAbsDy_;
928 const double matchedSegChDx =
std::abs(matchedSegment.
x - matchedChamber.
x);
929 const double matchedSegChDy =
std::abs(matchedSegment.
y - matchedChamber.
y);
930 const double matchedSegChPullX = matchedSegChDx/std::hypot(matchedSegment.
xErr, matchedChamber.
xErr);
931 const double matchedSegChPullY = matchedSegChDy/std::hypot(matchedSegment.
yErr, matchedChamber.
yErr);
932 if (matchedSegment.
xErr>0 && matchedChamber.
xErr>0 )
933 LogTrace(
"MuonIdentification") <<
" xpull: " << matchedSegChPullX;
934 if (matchedSegment.
yErr>0 && matchedChamber.
yErr>0 )
935 LogTrace(
"MuonIdentification") <<
" ypull: " << matchedSegChPullY;
937 if (matchedSegChDx <
maxAbsDx_) matchedX =
true;
938 if (matchedSegChDy <
maxAbsDy_) matchedY =
true;
939 if (matchedSegment.
xErr>0 && matchedChamber.
xErr>0 && matchedSegChPullX <
maxAbsPullX_) matchedX =
true;
940 if (matchedSegment.
yErr>0 && matchedChamber.
yErr>0 && matchedSegChPullY <
maxAbsPullY_) matchedY =
true;
941 if (matchedX && matchedY){
943 matchedChamber.
me0Matches.push_back(matchedSegment);
945 matchedChamber.
gemMatches.push_back(matchedSegment);
949 muonChamberMatches.push_back(matchedChamber);
953 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fill RPC info";
958 if (
chamber.id.subdetId() != 3 )
continue;
959 const auto& lErr =
chamber.tState.localError();
960 const auto& lPos =
chamber.tState.localPosition();
961 const auto& lDir =
chamber.tState.localDirection();
966 matchedChamber.
x = lPos.x();
967 matchedChamber.
y = lPos.y();
968 matchedChamber.
xErr =
sqrt( localError.
xx() );
969 matchedChamber.
yErr =
sqrt( localError.
yy() );
971 matchedChamber.
dXdZ = lDir.z()!=0?lDir.x()/lDir.z():9999;
972 matchedChamber.
dYdZ = lDir.z()!=0?lDir.y()/lDir.z():9999;
975 matchedChamber.
dXdZErr = trajectoryCovMatrix(1,1)>0?
sqrt(trajectoryCovMatrix(1,1)):0;
976 matchedChamber.
dYdZErr = trajectoryCovMatrix(2,2)>0?
sqrt(trajectoryCovMatrix(2,2)):0;
989 if ( rpcRecHit.rawId() !=
chamber.id.rawId() )
continue;
991 rpcHitMatch.
x = rpcRecHit.localPosition().x();
992 rpcHitMatch.
mask = 0;
993 rpcHitMatch.
bx = rpcRecHit.BunchX();
995 const double absDx =
std::abs(rpcRecHit.localPosition().x()-
chamber.tState.localPosition().x());
996 if( absDx <= 20
or absDx/
sqrt(localError.
xx()) <= 4 ) matchedChamber.
rpcMatches.push_back(rpcHitMatch);
999 muonChamberMatches.push_back(matchedChamber);
1005 LogTrace(
"MuonIdentification") <<
"number of muon chambers: " << aMuon.
matches().size() <<
"\n" 1006 <<
"number of chambers with segments according to the associator requirements: " <<
1007 nubmerOfMatchesAccordingToTrackAssociator;
1008 LogTrace(
"MuonIdentification") <<
"number of segment matches with the producer requirements: " <<
1019 for (reco::MuonCollection::iterator
muon=muons->begin();
muon!=muons->end();){
1020 if (
muon->isTrackerMuon()){
1026 if ((
muon->type() & (~mask))==0){
1032 muon->setType(
muon->type()&(~
reco::Muon::TrackerMuon));
1045 std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > chamberPairs;
1046 std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > stationPairs;
1047 std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > arbitrationPairs;
1050 for(
unsigned int muonIndex1 = 0; muonIndex1 < pOutputMuons->size(); ++muonIndex1 )
1052 auto& muon1 = pOutputMuons->at(muonIndex1);
1054 for (
auto& chamber1 : muon1.matches() )
1057 std::vector<reco::MuonSegmentMatch> * segmentMatches1 =
getSegmentMatches(chamber1, muonType);
1059 if(segmentMatches1->empty())
continue;
1060 chamberPairs.clear();
1062 for (
auto& segment1 : *segmentMatches1 )
1064 chamberPairs.push_back(std::make_pair(&chamber1, &segment1));
1065 if(!segment1.isMask())
1067 arbitrationPairs.clear();
1068 arbitrationPairs.push_back(std::make_pair(&chamber1, &segment1));
1072 if (muon1.type() & muonType) {
1074 for(
unsigned int muonIndex2 = muonIndex1+1; muonIndex2 < pOutputMuons->size(); ++muonIndex2 )
1076 auto& muon2 = pOutputMuons->at(muonIndex2);
1078 if ( !(muon2.type() & muonType) )
continue;
1080 for (
auto& chamber2 : muon2.matches() )
1083 std::vector<reco::MuonSegmentMatch> * segmentMatches2 =
getSegmentMatches(chamber2, muonType);
1084 for (
auto& segment2 : *segmentMatches2 )
1086 if(segment2.isMask())
continue;
1093 approxEqual(segment2.dXdZErr, segment1.dXdZErr) &&
1096 arbitrationPairs.push_back(std::make_pair(&chamber2, &segment2));
1104 if(arbitrationPairs.empty())
continue;
1105 if(arbitrationPairs.size()==1) {
1120 for (
auto& ap : arbitrationPairs ) {
1129 for (
auto& segment2 : chamber1.segmentMatches ) {
1130 if( segment1.cscSegmentRef.isNull() || segment2.cscSegmentRef.isNull() )
continue;
1131 if(
meshAlgo_->isDuplicateOf(segment1.cscSegmentRef,segment2.cscSegmentRef) &&
1132 (segment2.mask & 0x1e0000) &&
1133 (segment1.mask & 0x1e0000) ) {
1143 if(chamberPairs.empty())
continue;
1144 if(chamberPairs.size()==1) {
1164 for(
int detectorIndex = 1; detectorIndex <= 5; ++detectorIndex )
1166 stationPairs.clear();
1169 for (
auto&
chamber : muon1.matches() )
1173 if (segmentMatches->empty())
continue;
1175 for (
auto& segment : *segmentMatches ) {
1176 stationPairs.push_back(std::make_pair(&
chamber, &segment));
1180 if(stationPairs.empty())
continue;
1181 if(stationPairs.size()==1) {
1215 else throw cms::Exception(
"FatalError") <<
"Failed to compute muon isolation information for a muon with undefined references to tracks";
1221 std::vector<reco::IsoDeposit> caloDeps =
muIsoExtractorCalo_->deposits(iEvent, iSetup, *track);
1224 if(caloDeps.size()!=3) {
1225 LogTrace(
"MuonIdentification") <<
"Failed to fill vector of calorimeter isolation deposits!";
1271 const double energy = hypot(track.
p(), 0.105658369);
1281 if ( muonId.
sector() <= 12 )
1283 if ( muonId.
sector() == 13 ) phi = 3/6.*
M_PI;
1284 if ( muonId.
sector() == 14 ) phi = 9/6.*
M_PI;
1298 if ( muon.
matches().empty() ) {
1301 return muon.
innerTrack()->outerPosition().phi();
1333 if (trackBAD || staBAD || glbBAD )
1335 edm::LogWarning(
"muonIDbadLinks") <<
"Global muon links to constituent tracks are invalid: trkBad " 1336 <<trackBAD <<
" standaloneBad "<<staBAD<<
" globalBad "<<glbBAD
1337 <<
". There should be no such object. Muon is skipped.";
1347 desc.
add<
bool>(
"arbitrateTrackerMuons",
false);
1348 desc.
add<
bool>(
"storeCrossedHcalRecHits",
false);
1349 desc.
add<
bool>(
"fillShowerDigis",
false);
1354 descTrkAsoPar.add<
bool>(
"useGEM",
false);
1355 descTrkAsoPar.add<
bool>(
"useME0",
false);
1356 descTrkAsoPar.setAllowAnything();
std::string hoDepositName_
double p() const
momentum vector magnitude
T getParameter(std::string const &) const
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_
static void truthMatchMuon(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::Muon &aMuon)
DTRecSegment4DRef dtSegmentRef
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
TrackRef track() const override
reference to a 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
double eta() const final
momentum pseudorapidity
bool isStandAloneMuon() const override
std::vector< reco::MuonSegmentMatch > gemMatches
static bool crossedIP(const reco::Track &track)
float sumPt
sum-pt of tracks
void setType(unsigned int type)
TrackDetectorAssociator trackAssociator_
CSCSegmentRef cscSegmentRef
std::unique_ptr< MuonKinkFinder > trackerKinkFinder_
const TrackExtraRef & extra() const
reference to "extra" object
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
const_iterator end() const
last iterator over the map (read only)
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_
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)
const_iterator find(const key_type &k) const
find element with specified reference key
constexpr uint32_t rawId() const
get the raw id
double phiOfMuonIneteractionRegion(const reco::Muon &muon) const
std::vector< CaloMuon > CaloMuonCollection
collection of Muon objects
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 &)
double pt() const final
transverse momentum
MuonCaloCompatibility muonCaloCompatibility_
static const unsigned int BestInStationByDRSlope
bool isMatchesValid() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
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)
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
std::unique_ptr< MuonTimingFiller > theTimingFiller_
math::XYZPoint trkGlobPosAtHcal
float ecal_time
Calorimeter timing.
float ho
energy deposited in crossed HO towers
bool isTrackerMuon() const override
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
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorCalo_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void init(edm::Event &, const edm::EventSetup &)
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
bool isGlobalMuon() const override
static const unsigned int ME0Muon
ArbitrationType
define arbitration schemes
bool isGoodTrackerMuon(const reco::Muon &muon)
double pt() const
track transverse momentum
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
bool checkLinks(const reco::MuonTrackLinks *) const
Cos< T >::type cos(const T &t)
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)
CSCDetId chamberId() const
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.
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)
bool isEnergyValid() const
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
float hoVetoEt
ho sum-et in the veto region in r-phi
double pz() const
z coordinate of momentum vector
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 &)
size_type size() const
map size
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
TrackRef combinedMuon() const override
reference to a stand-alone muon Track
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.
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)
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
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
void setMatches(const std::vector< MuonChamberMatch > &matches)
set muon matching information
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
static const unsigned int BestInChamberByDRSlope
double phi() const final
momentum azimuthal angle
float caloCompatibility() const
bool validateGlobalMuonPair(const reco::MuonTrackLinks &goodMuon, const reco::MuonTrackLinks &badMuon)
T const * product() const
bool debugWithTruthMatching_
bool isGoodCaloMuon(const reco::CaloMuon &muon)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
float trackerVetoPt
(sum-)pt inside the veto region in r-phi
float hadS9
energy deposited in 3x3 HCAL tower shape around central tower
T get(const Candidate &c)
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_