37 muIsoExtractorCalo_(0),muIsoExtractorTrack_(0),muIsoExtractorJet_(0)
40 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: Constructor called";
42 produces<reco::MuonCollection>();
43 produces<reco::CaloMuonCollection>();
44 produces<reco::MuonTimeExtraMap>(
"combined");
45 produces<reco::MuonTimeExtraMap>(
"dt");
46 produces<reco::MuonTimeExtraMap>(
"csc");
67 if (fillGlobalTrackQuality_) fillTrackerKink_ = iConfig.
getParameter<
bool>(
"fillTrackerKink");
84 if (fillCaloCompatibility_){
104 if (fillIsolation_ && writeIsoDeposits_){
119 if (inputCollectionLabels_.size() != inputCollectionTypes.size())
120 throw cms::Exception(
"ConfigurationError") <<
"Number of input collection labels is different from number of types. " <<
121 "For each collection label there should be exactly one collection type specified.";
122 if (inputCollectionLabels_.size()>7 ||inputCollectionLabels_.empty())
123 throw cms::Exception(
"ConfigurationError") <<
"Number of input collections should be from 1 to 7.";
127 <<
"========================================================================\n" 128 <<
"Debugging mode with truth matching is turned on!!! Make sure you understand what you are doing!\n" 129 <<
"========================================================================\n";
130 if (fillGlobalTrackQuality_){
132 glbQualToken_ = consumes<edm::ValueMap<reco::MuonQuality> >(glbQualTag);
135 if (fillTrackerKink_) {
144 rpcHitToken_ = consumes<RPCRecHitCollection>(rpcHitTag);
149 for (
unsigned int i = 0;
i < inputCollectionLabels_.size(); ++
i ) {
265 LogTrace(
"MuonIdentification") <<
"Creating a muon from a track " << track.
get()->pt() <<
266 " Pt (GeV), eta: " << track.
get()->eta();
269 LogTrace(
"MuonIdentification") <<
"Muon created from a track ";
271 aMuon.setMuonTrack(type,track);
272 aMuon.setBestTrack(type);
273 aMuon.setTunePBestTrack(type);
275 LogTrace(
"MuonIdentification") <<
"Muon created from a track and setMuonBestTrack, setBestTrack and setTunePBestTrack called";
283 LogTrace(
"MuonIdentification") <<
"Creating a CaloMuon from a Muon";
297 LogTrace(
"MuonIdentification") <<
"Creating a muon from a link to tracks object";
304 bool useSigmaSwitch =
false;
313 if (tpfmsRef.
isNull() && pickyRef.isNull() && dytRef.isNull()){
314 edm::LogWarning(
"MakeMuonWithTEV")<<
"Failed to get TEV refits, fall back to sigma switch.";
315 useSigmaSwitch =
true;
318 useSigmaSwitch =
true;
327 tpfmsRef, pickyRef, dytRef,
330 aMuon =
makeMuon(*chosenTrack.first);
334 aMuon.setBestTrack(chosenTrack.second);
335 aMuon.setTunePBestTrack(chosenTrack.second);
358 const double p = track.
p();
359 const double pt = track.
pt();
361 LogTrace(
"MuonIdentification") <<
"Skipped low momentum track (Pt,P): " << pt
362 <<
", " << track.
p() <<
" GeV";
367 const double eta = track.
eta();
368 const double absEta =
std::abs(eta);
370 LogTrace(
"MuonIdentification") <<
"Skipped track with large pseudo rapidity (Eta: " << track.
eta() <<
" )";
381 const auto subdetId =
id.subdetId();
397 track.
extra()->recHitsSize()==0 )
return 0;
399 int numberOfCommonDetIds = 0;
400 const std::vector<reco::MuonChamberMatch>&
matches( muon.
matches() );
403 if (
match.segmentMatches.empty() )
continue;
405 bool foundCommonDetId =
false;
406 for (
auto hit = track.
extra()->recHitsBegin();
414 foundCommonDetId =
true;
418 if ( foundCommonDetId ) {
419 ++numberOfCommonDetIds;
423 return numberOfCommonDetIds;
438 const int nHitsGood = goodMuon.
globalTrack()->hitPattern().numberOfValidMuonHits();
439 const int nHitsBad = badMuon.
globalTrack()->hitPattern().numberOfValidMuonHits();
440 if (
std::min(nHitsGood, nHitsBad) > 10 ) {
441 const double chi2Good = goodMuon.
globalTrack()->normalizedChi2();
442 const double chi2Bad = badMuon.
globalTrack()->normalizedChi2();
443 return ( chi2Good <= chi2Bad );
446 return (nHitsGood >= nHitsBad);
452 auto outputMuons = std::make_unique<reco::MuonCollection>();
453 auto caloMuons = std::make_unique<reco::CaloMuonCollection>();
455 init(iEvent, iSetup);
462 outputMuons->push_back(
muon);
469 std::vector<bool> goodmuons(nLink,
true);
472 for (
unsigned int i=0;
i<nLink-1; ++
i ) {
474 if ( iLink.trackerTrack().isNull() || !
checkLinks(&iLink) )
continue;
475 for (
unsigned int j=
i+1;
j<nLink; ++
j ){
478 if ( iLink.trackerTrack() == jLink.trackerTrack() ) {
484 else goodmuons[
i] =
false;
489 for (
unsigned int i=0;
i<nLink-1; ++
i ) {
490 if ( !goodmuons[
i] )
continue;
492 if ( iLink.standAloneTrack().isNull() || !
checkLinks(&iLink))
continue;
493 for (
unsigned int j=i+1;
j<nLink; ++
j ) {
494 if ( !goodmuons[
j] )
continue;
497 if ( iLink.standAloneTrack() == jLink.standAloneTrack() ) {
499 else goodmuons[
i] =
false;
504 for (
unsigned int i=0;
i<nLink; ++
i ) {
505 if ( !goodmuons[
i] )
continue;
510 for (
auto muon : *outputMuons ) {
511 if (
muon.track() == iLink.trackerTrack() &&
512 muon.standAloneMuon() == iLink.standAloneTrack() &&
513 muon.combinedMuon() == iLink.globalTrack() ) {
519 outputMuons->push_back(
makeMuon(iLink) );
527 LogTrace(
"MuonIdentification") <<
"Creating tracker muons";
528 std::vector<TrackDetectorAssociator::Direction> directions1, directions2;
538 bool splitTrack =
false;
541 const auto&
directions = splitTrack ? directions1 : directions2;
545 fillMuonId(iEvent, iSetup, trackerMuon, direction);
566 for (
auto&
muon : *outputMuons )
579 LogTrace(
"MuonIdentification") <<
"Found a corresponding global muon. Set energy, matches and move on";
584 if ( goodTrackerMuon || goodRPCMuon || goodGEMMuon || goodME0Muon){
585 outputMuons->push_back( trackerMuon );
587 LogTrace(
"MuonIdentification") <<
"track failed minimal number of muon matches requirement";
590 caloMuons->push_back( caloMuon );
599 LogTrace(
"MuonIdentification") <<
"Looking for new muons among stand alone muon tracks";
606 for (
auto&
muon : *outputMuons )
608 if ( !
muon.standAloneMuon().isNull() ) {
610 if (
muon.standAloneMuon().get() == &outerTrack ) {
623 LogTrace(
"MuonIdentification") <<
"Found associated tracker muon. Set a reference and move on";
632 LogTrace(
"MuonIdentification") <<
"No associated stand alone track is found. Making a muon";
633 outputMuons->push_back(
makeMuon(iEvent, iSetup,
640 LogTrace(
"MuonIdentification") <<
"Dress up muons if it's necessary";
642 const int nMuons=outputMuons->size();
644 std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
645 std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
646 std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
647 std::vector<reco::IsoDeposit> trackDepColl(nMuons);
648 std::vector<reco::IsoDeposit> ecalDepColl(nMuons);
649 std::vector<reco::IsoDeposit> hcalDepColl(nMuons);
650 std::vector<reco::IsoDeposit> hoDepColl(nMuons);
651 std::vector<reco::IsoDeposit> jetDepColl(nMuons);
654 for (
unsigned int i=0;
i<outputMuons->size(); ++
i )
656 auto&
muon = outputMuons->at(
i);
664 if (
muon.isStandAloneMuon() ) {
671 LogTrace(
"MuonIdentification") <<
"THIS SHOULD NEVER HAPPEN";
690 trackDepColl[
i], ecalDepColl[i], hcalDepColl[i], hoDepColl[i], jetDepColl[i]);
708 muon.setTime(muonTime);
709 muon.setRPCTime(rpcTime);
710 dtTimeColl[
i] = dtTime;
711 cscTimeColl[
i] = cscTime;
712 combinedTimeColl[
i] = combinedTime;
715 LogTrace(
"MuonIdentification") <<
"number of muons produced: " << outputMuons->size();
721 auto oMap = std::make_unique<MapType>();
723 typename MapType::Filler
filler(*oMap);
724 filler.insert(refH, vec.begin(), vec.end());
730 fillMap(muonHandle, combinedTimeColl, iEvent,
"combined");
731 fillMap(muonHandle, dtTimeColl, iEvent,
"dt");
732 fillMap(muonHandle, cscTimeColl, iEvent,
"csc");
782 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId";
788 else throw cms::Exception(
"FatalError") <<
"Failed to fill muon id information for a muon with undefined references to tracks";
793 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fillEnergy = "<<
fillEnergy_;
814 if (
hit->
id() != emMaxId)
continue;
820 if (
hit->
id() != hadMaxId)
continue;
829 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fill muon match info ";
830 std::vector<reco::MuonChamberMatch> muonChamberMatches;
831 unsigned int nubmerOfMatchesAccordingToTrackAssociator = 0;
837 const auto& lErr =
chamber.tState.localError();
838 const auto& lPos =
chamber.tState.localPosition();
839 const auto& lDir =
chamber.tState.localDirection();
841 const auto& localError = lErr.positionError();
842 matchedChamber.
x = lPos.x();
843 matchedChamber.
y = lPos.y();
844 matchedChamber.
xErr =
sqrt( localError.xx() );
845 matchedChamber.
yErr =
sqrt( localError.yy() );
847 matchedChamber.
dXdZ = lDir.z()!=0?lDir.x()/lDir.z():9999;
848 matchedChamber.
dYdZ = lDir.z()!=0?lDir.y()/lDir.z():9999;
851 matchedChamber.
dXdZErr = trajectoryCovMatrix(1,1)>0?
sqrt(trajectoryCovMatrix(1,1)):0;
852 matchedChamber.
dYdZErr = trajectoryCovMatrix(2,2)>0?
sqrt(trajectoryCovMatrix(2,2)):0;
858 if ( !
chamber.segments.empty() ) ++nubmerOfMatchesAccordingToTrackAssociator;
861 for (
const auto& segment :
chamber.segments )
864 matchedSegment.
x = segment.segmentLocalPosition.x();
865 matchedSegment.
y = segment.segmentLocalPosition.y();
866 matchedSegment.
dXdZ = segment.segmentLocalDirection.z()?segment.segmentLocalDirection.x()/segment.segmentLocalDirection.z():0;
867 matchedSegment.
dYdZ = segment.segmentLocalDirection.z()?segment.segmentLocalDirection.y()/segment.segmentLocalDirection.z():0;
868 matchedSegment.
xErr = segment.segmentLocalErrorXX>0?
sqrt(segment.segmentLocalErrorXX):0;
869 matchedSegment.
yErr = segment.segmentLocalErrorYY>0?
sqrt(segment.segmentLocalErrorYY):0;
870 matchedSegment.
dXdZErr = segment.segmentLocalErrorDxDz>0?
sqrt(segment.segmentLocalErrorDxDz):0;
871 matchedSegment.
dYdZErr = segment.segmentLocalErrorDyDz>0?
sqrt(segment.segmentLocalErrorDyDz):0;
872 matchedSegment.
t0 = segment.t0;
873 matchedSegment.
mask = 0;
878 matchedSegment.
hasZed_ = segment.hasZed;
879 matchedSegment.
hasPhi_ = segment.hasPhi;
881 bool matchedX =
false;
882 bool matchedY =
false;
883 LogTrace(
"MuonIdentification") <<
" matching local x, segment x: " << matchedSegment.
x <<
884 ", chamber x: " << matchedChamber.
x <<
", max: " <<
maxAbsDx_;
885 LogTrace(
"MuonIdentification") <<
" matching local y, segment y: " << matchedSegment.
y <<
886 ", chamber y: " << matchedChamber.
y <<
", max: " <<
maxAbsDy_;
887 const double matchedSegChDx =
std::abs(matchedSegment.
x - matchedChamber.
x);
888 const double matchedSegChDy =
std::abs(matchedSegment.
y - matchedChamber.
y);
889 const double matchedSegChPullX = matchedSegChDx/std::hypot(matchedSegment.
xErr, matchedChamber.
xErr);
890 const double matchedSegChPullY = matchedSegChDy/std::hypot(matchedSegment.
yErr, matchedChamber.
yErr);
891 if (matchedSegment.
xErr>0 && matchedChamber.
xErr>0 )
892 LogTrace(
"MuonIdentification") <<
" xpull: " << matchedSegChPullX;
893 if (matchedSegment.
yErr>0 && matchedChamber.
yErr>0 )
894 LogTrace(
"MuonIdentification") <<
" ypull: " << matchedSegChPullY;
896 if (matchedSegChDx <
maxAbsDx_) matchedX =
true;
897 if (matchedSegChDy <
maxAbsDy_) matchedY =
true;
898 if (matchedSegment.
xErr>0 && matchedChamber.
xErr>0 && matchedSegChPullX <
maxAbsPullX_) matchedX =
true;
899 if (matchedSegment.
yErr>0 && matchedChamber.
yErr>0 && matchedSegChPullY <
maxAbsPullY_) matchedY =
true;
900 if (matchedX && matchedY){
902 matchedChamber.
me0Matches.push_back(matchedSegment);
904 matchedChamber.
gemMatches.push_back(matchedSegment);
908 muonChamberMatches.push_back(matchedChamber);
912 LogTrace(
"MuonIdentification") <<
"RecoMuon/MuonIdProducer :: fillMuonId :: fill RPC info";
917 if (
chamber.id.subdetId() != 3 )
continue;
918 const auto& lErr =
chamber.tState.localError();
919 const auto& lPos =
chamber.tState.localPosition();
920 const auto& lDir =
chamber.tState.localDirection();
925 matchedChamber.
x = lPos.x();
926 matchedChamber.
y = lPos.y();
927 matchedChamber.
xErr =
sqrt( localError.
xx() );
928 matchedChamber.
yErr =
sqrt( localError.
yy() );
930 matchedChamber.
dXdZ = lDir.z()!=0?lDir.x()/lDir.z():9999;
931 matchedChamber.
dYdZ = lDir.z()!=0?lDir.y()/lDir.z():9999;
934 matchedChamber.
dXdZErr = trajectoryCovMatrix(1,1)>0?
sqrt(trajectoryCovMatrix(1,1)):0;
935 matchedChamber.
dYdZErr = trajectoryCovMatrix(2,2)>0?
sqrt(trajectoryCovMatrix(2,2)):0;
946 if ( rpcRecHit.rawId() !=
chamber.id.rawId() )
continue;
948 rpcHitMatch.
x = rpcRecHit.localPosition().x();
949 rpcHitMatch.
mask = 0;
950 rpcHitMatch.
bx = rpcRecHit.BunchX();
952 const double absDx =
std::abs(rpcRecHit.localPosition().x()-
chamber.tState.localPosition().x());
953 if( absDx <= 20
or absDx/
sqrt(localError.
xx()) <= 4 ) matchedChamber.
rpcMatches.push_back(rpcHitMatch);
956 muonChamberMatches.push_back(matchedChamber);
962 LogTrace(
"MuonIdentification") <<
"number of muon chambers: " << aMuon.
matches().size() <<
"\n" 963 <<
"number of chambers with segments according to the associator requirements: " <<
964 nubmerOfMatchesAccordingToTrackAssociator;
965 LogTrace(
"MuonIdentification") <<
"number of segment matches with the producer requirements: " <<
976 std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > chamberPairs;
977 std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > stationPairs;
978 std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > arbitrationPairs;
981 for(
unsigned int muonIndex1 = 0; muonIndex1 < pOutputMuons->size(); ++muonIndex1 )
983 auto& muon1 = pOutputMuons->at(muonIndex1);
985 for (
auto& chamber1 : muon1.matches() )
987 if(chamber1.segmentMatches.empty())
continue;
988 chamberPairs.clear();
991 for (
auto& segment1 : chamber1.segmentMatches )
993 chamberPairs.push_back(std::make_pair(&chamber1, &segment1));
994 if(!segment1.isMask())
996 arbitrationPairs.clear();
997 arbitrationPairs.push_back(std::make_pair(&chamber1, &segment1));
1001 if (muon1.isTrackerMuon()) {
1003 for(
unsigned int muonIndex2 = muonIndex1+1; muonIndex2 < pOutputMuons->size(); ++muonIndex2 )
1005 auto& muon2 = pOutputMuons->at(muonIndex2);
1007 if ( !muon2.isTrackerMuon() )
continue;
1009 for (
auto& chamber2 : muon2.matches() )
1012 for (
auto& segment2 : chamber2.segmentMatches )
1014 if(segment2.isMask())
continue;
1021 approxEqual(segment2.dXdZErr, segment1.dXdZErr) &&
1024 arbitrationPairs.push_back(std::make_pair(&chamber2, &segment2));
1032 if(arbitrationPairs.empty())
continue;
1033 if(arbitrationPairs.size()==1) {
1048 for (
auto& ap : arbitrationPairs ) {
1057 for (
auto& segment2 : chamber1.segmentMatches ) {
1058 if( segment1.cscSegmentRef.isNull() || segment2.cscSegmentRef.isNull() )
continue;
1060 (segment2.mask & 0x1e0000) &&
1061 (segment1.mask & 0x1e0000) ) {
1071 if(chamberPairs.empty())
continue;
1072 if(chamberPairs.size()==1) {
1092 for(
int detectorIndex = 1; detectorIndex < 4; ++detectorIndex )
1094 stationPairs.clear();
1097 for (
auto&
chamber : muon1.matches() )
1100 if(
chamber.segmentMatches.empty())
continue;
1102 for (
auto& segment :
chamber.segmentMatches ) {
1103 stationPairs.push_back(std::make_pair(&
chamber, &segment));
1107 if(stationPairs.empty())
continue;
1108 if(stationPairs.size()==1) {
1142 else throw cms::Exception(
"FatalError") <<
"Failed to compute muon isolation information for a muon with undefined references to tracks";
1151 if(caloDeps.size()!=3) {
1152 LogTrace(
"MuonIdentification") <<
"Failed to fill vector of calorimeter isolation deposits!";
1198 const double energy = hypot(track.
p(), 0.105658369);
1208 if ( muonId.
sector() <= 12 )
1210 if ( muonId.
sector() == 13 ) phi = 3/6.*
M_PI;
1211 if ( muonId.
sector() == 14 ) phi = 9/6.*
M_PI;
1225 if ( muon.
matches().empty() ) {
1228 return muon.
innerTrack()->outerPosition().phi();
1260 if (trackBAD || staBAD || glbBAD )
1262 edm::LogWarning(
"muonIDbadLinks") <<
"Global muon links to constituent tracks are invalid: trkBad " 1263 <<trackBAD <<
" standaloneBad "<<staBAD<<
" globalBad "<<glbBAD
1264 <<
". There should be no such object. Muon is skipped.";
1277 descTrkAsoPar.
add<
bool>(
"useGEM",
false);
1278 descTrkAsoPar.
add<
bool>(
"useME0",
false);
std::string hoDepositName_
double p() const
momentum vector magnitude
T getParameter(std::string const &) const
virtual double pt() const final
transverse momentum
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.
bool isNonnull() const
Checks for non-null.
reco::TrackRef trackerTrack() const
get the tracker's track which match with the stand alone muon tracks
void runMesh(std::vector< reco::Muon > *p)
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)
friend struct const_iterator
const_iterator end() const
last iterator over the map (read only)
reco::isodeposit::IsoDepositExtractor * muIsoExtractorCalo_
virtual double eta() const final
momentum pseudorapidity
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 isTrackerMuon() const
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_
const_iterator find(const key_type &k) const
find element with specified reference key
void fillTiming(const reco::Muon &muon, reco::MuonTimeExtra &dtTime, reco::MuonTimeExtra &cscTime, reco::MuonTime &rpcTime, reco::MuonTimeExtra &combinedTime, edm::Event &iEvent, const edm::EventSetup &iSetup)
double phiOfMuonIneteractionRegion(const reco::Muon &muon) const
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
DetId findMaxDeposition(EnergyType)
Find detector elements with highest energy deposition.
virtual void produce(edm::Event &, const edm::EventSetup &) override
float hadVetoEt
hcal sum-et in the veto region in r-phi
virtual TrackRef track() const
reference to a Track
bool isGlobalMuon() const
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
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
static const unsigned int BelongsToTrackByDXSlope
bool isStandAloneMuon() const
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
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
math::XYZPoint trkGlobPosAtHcal
float ecal_time
Calorimeter timing.
float ho
energy deposited in crossed HO towers
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
uint32_t rawId() const
get the raw id
virtual double phi() const final
momentum azimuthal angle
void setCSCGeometry(const CSCGeometry *pg)
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
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)
void fillArbitrationInfo(reco::MuonCollection *)
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
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
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_
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_
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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
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 &)
virtual ~MuonIdProducer()
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
reco::isodeposit::IsoDepositExtractor * muIsoExtractorTrack_
void setCaloCompatibility(float input)
static const unsigned int RPCMuon
static ICTypeKey toKey(const std::string &s)
virtual TrackRef combinedMuon() const
reference to a stand-alone muon Track
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
reco::isodeposit::IsoDepositExtractor * muIsoExtractorJet_
bool isDuplicateOf(const CSCSegmentRef &lhs, const CSCSegmentRef &rhs) const
MuonTimingFiller * theTimingFiller_
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
void setCombinedQuality(const MuonQuality &combinedQuality)
set energy deposition information
std::vector< edm::InputTag > inputCollectionLabels_
std::vector< MuonChamberMatch > & matches()
get muon matching information
void setCalEnergy(const MuonEnergy &calEnergy)
set energy deposition information
int triggerSector() const
MuonIdProducer(const edm::ParameterSet &)
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_
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 &)
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::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
float caloCompatibility() const
bool validateGlobalMuonPair(const reco::MuonTrackLinks &goodMuon, const reco::MuonTrackLinks &badMuon)
T const * product() const
bool debugWithTruthMatching_
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_
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
reco::TrackRef globalTrack() const
get the combined track
edm::Handle< reco::TrackToTrackMap > pickyCollectionHandle_
edm::EDGetTokenT< reco::TrackToTrackMap > dytCollectionToken_
virtual TrackRef standAloneMuon() const
reference to a stand-alone muon Track