36 #include <boost/regex.hpp>
55 muIsoExtractorCalo_(0),muIsoExtractorTrack_(0),muIsoExtractorJet_(0)
57 produces<reco::MuonCollection>();
58 produces<reco::CaloMuonCollection>();
59 produces<reco::MuonTimeExtraMap>(
"combined");
60 produces<reco::MuonTimeExtraMap>(
"dt");
61 produces<reco::MuonTimeExtraMap>(
"csc");
82 if (fillGlobalTrackQuality_) fillTrackerKink_ = iConfig.
getParameter<
bool>(
"fillTrackerKink");
99 if (fillCaloCompatibility_){
119 if (fillIsolation_ && writeIsoDeposits_){
135 throw cms::Exception(
"ConfigurationError") <<
"Number of input collection labels is different from number of types. " <<
136 "For each collection label there should be exactly one collection type specified.";
138 throw cms::Exception(
"ConfigurationError") <<
"Number of input collections should be from 1 to 7.";
142 <<
"========================================================================\n"
143 <<
"Debugging mode with truth matching is turned on!!! Make sure you understand what you are doing!\n"
144 <<
"========================================================================\n";
145 if (fillGlobalTrackQuality_){
149 if (fillTrackerKink_) {
158 rpcHitToken_ = consumes<RPCRecHitCollection>(rpcHitTag);
164 if ( inputCollectionTypes_[
i] ==
"inner tracks" ) {
168 if ( inputCollectionTypes_[
i] ==
"outer tracks" ) {
172 if ( inputCollectionTypes_[
i] ==
"links" ) {
176 if ( inputCollectionTypes_[
i] ==
"muons" ) {
180 if ( fillGlobalTrackRefits_ && inputCollectionTypes_[
i] ==
"tev firstHit" ) {
185 if ( fillGlobalTrackRefits_ && inputCollectionTypes_[
i] ==
"tev picky" ) {
190 if ( fillGlobalTrackRefits_ && inputCollectionTypes_[
i] ==
"tev dyt" ) {
194 throw cms::Exception(
"FatalError") <<
"Unknown input collection type: " << inputCollectionTypes_[
i];
289 LogTrace(
"MuonIdentification") <<
"Creating a muon from a track " << track.
get()->pt() <<
290 " Pt (GeV), eta: " << track.
get()->eta();
294 aMuon.setBestTrack(type);
295 aMuon.setTunePBestTrack(type);
314 LogTrace(
"MuonIdentification") <<
"Creating a muon from a link to tracks object";
321 bool useSigmaSwitch =
false;
330 if (tpfmsRef.
isNull() && pickyRef.isNull() && dytRef.isNull()){
331 edm::LogWarning(
"MakeMuonWithTEV")<<
"Failed to get TEV refits, fall back to sigma switch.";
332 useSigmaSwitch =
true;
335 useSigmaSwitch =
true;
344 tpfmsRef, pickyRef, dytRef,
347 aMuon =
makeMuon(*chosenTrack.first);
376 LogTrace(
"MuonIdentification") <<
"Skipped low momentum track (Pt,P): " << track.
pt() <<
377 ", " << track.
p() <<
" GeV";
383 LogTrace(
"MuonIdentification") <<
"Skipped track with large pseudo rapidity (Eta: " << track.
eta() <<
" )";
391 switch (
id.det() ) {
393 switch (
id.subdetId() ) {
397 return detId.
rawId();
418 int numberOfCommonDetIds = 0;
421 track.
extra()->recHitsSize()==0 )
return numberOfCommonDetIds;
422 const std::vector<reco::MuonChamberMatch>& matches( muon.
matches() );
423 for ( std::vector<reco::MuonChamberMatch>::const_iterator
match = matches.begin();
426 if (
match->segmentMatches.empty() )
continue;
427 bool foundCommonDetId =
false;
429 for (
auto hit = track.
extra()->recHitsBegin();
437 foundCommonDetId =
true;
441 if ( foundCommonDetId ) {
442 numberOfCommonDetIds++;
446 return numberOfCommonDetIds;
462 badMuon.
globalTrack()->hitPattern().numberOfValidMuonHits()) > 10 ){
469 if ( goodMuon.
globalTrack()->hitPattern().numberOfValidMuonHits() <
470 badMuon.
globalTrack()->hitPattern().numberOfValidMuonHits() )
return false;
480 init(iEvent, iSetup);
506 outputMuons->push_back(*
muon);
511 if ( goodmuons.size()>1 ){
526 goodmuons[
j] =
false;
528 goodmuons[
i] =
false;
534 if ( !goodmuons[
i] )
continue;
537 if ( !goodmuons[
j] )
continue;
544 goodmuons[
j] =
false;
546 goodmuons[
i] =
false;
552 if ( !goodmuons[
i] )
continue;
557 for ( reco::MuonCollection::const_iterator
muon = outputMuons->begin();
558 muon != outputMuons->end(); ++
muon )
564 outputMuons->push_back(
makeMuon( *links ) );
572 LogTrace(
"MuonIdentification") <<
"Creating tracker muons";
577 bool splitTrack =
false;
580 std::vector<TrackDetectorAssociator::Direction>
directions;
587 for ( std::vector<TrackDetectorAssociator::Direction>::const_iterator direction = directions.begin();
588 direction != directions.end(); ++direction )
592 fillMuonId(iEvent, iSetup, trackerMuon, *direction);
608 for ( reco::MuonCollection::iterator
muon = outputMuons->begin();
609 muon != outputMuons->end(); ++
muon )
621 LogTrace(
"MuonIdentification") <<
"Found a corresponding global muon. Set energy, matches and move on";
626 if ( goodTrackerMuon || goodRPCMuon ){
627 outputMuons->push_back( trackerMuon );
629 LogTrace(
"MuonIdentification") <<
"track failed minimal number of muon matches requirement";
632 caloMuons->push_back( caloMuon );
641 LogTrace(
"MuonIdentification") <<
"Looking for new muons among stand alone muon tracks";
646 for ( reco::MuonCollection::iterator
muon = outputMuons->begin();
647 muon != outputMuons->end(); ++
muon )
649 if ( !
muon->standAloneMuon().isNull() ) {
664 LogTrace(
"MuonIdentification") <<
"Found associated tracker muon. Set a reference and move on";
673 LogTrace(
"MuonIdentification") <<
"No associated stand alone track is found. Making a muon";
674 outputMuons->push_back(
makeMuon(iEvent, iSetup,
681 LogTrace(
"MuonIdentification") <<
"Dress up muons if it's necessary";
683 int nMuons=outputMuons->size();
685 std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
686 std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
687 std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
688 std::vector<reco::IsoDeposit> trackDepColl(nMuons);
689 std::vector<reco::IsoDeposit> ecalDepColl(nMuons);
690 std::vector<reco::IsoDeposit> hcalDepColl(nMuons);
691 std::vector<reco::IsoDeposit> hoDepColl(nMuons);
692 std::vector<reco::IsoDeposit> jetDepColl(nMuons);
696 for ( reco::MuonCollection::iterator
muon = outputMuons->begin();
muon != outputMuons->end(); ++
muon )
704 if (
muon->isStandAloneMuon() ) {
710 LogTrace(
"MuonIdentification") <<
"THIS SHOULD NEVER HAPPEN";
728 trackDepColl[i], ecalDepColl[i], hcalDepColl[i], hoDepColl[i], jetDepColl[i]);
744 muon->setTime( muonTime);
745 dtTimeColl[
i] = dtTime;
746 cscTimeColl[
i] = cscTime;
747 combinedTimeColl[
i] = combinedTime;
753 LogTrace(
"MuonIdentification") <<
"number of muons produced: " << outputMuons->size();
757 filler.
insert(muonHandle, combinedTimeColl.begin(), combinedTimeColl.end());
759 fillerDT.
insert(muonHandle, dtTimeColl.begin(), dtTimeColl.end());
761 fillerCSC.
insert(muonHandle, cscTimeColl.begin(), cscTimeColl.end());
764 iEvent.
put(muonTimeMap,
"combined");
765 iEvent.
put(muonTimeMapDT,
"dt");
766 iEvent.
put(muonTimeMapCSC,
"csc");
769 trackDepFiller.
insert(muonHandle, trackDepColl.begin(), trackDepColl.end());
770 trackDepFiller.
fill();
772 ecalDepFiller.
insert(muonHandle, ecalDepColl.begin(), ecalDepColl.end());
773 ecalDepFiller.
fill();
775 hcalDepFiller.
insert(muonHandle, hcalDepColl.begin(), hcalDepColl.end());
776 hcalDepFiller.
fill();
778 hoDepFiller.
insert(muonHandle, hoDepColl.begin(), hoDepColl.end());
781 jetDepFiller.
insert(muonHandle, jetDepColl.begin(), jetDepColl.end());
786 iEvent.
put(caloMuons);
794 muon.
pt()<5 && fabs(muon.
eta())<1.5 &&
803 muon.
pt()<5 && fabs(muon.
eta())<1.5 &&
821 throw cms::Exception(
"FatalError") <<
"Failed to fill muon id information for a muon with undefined references to tracks";
843 for(std::vector<const EcalRecHit*>::const_iterator
hit=info.
ecalRecHits.begin();
845 if ((*hit)->id() != emMaxId)
continue;
846 muonEnergy.
emMax = (*hit)->energy();
850 for(std::vector<const HBHERecHit*>::const_iterator
hit=info.
hcalRecHits.begin();
852 if ((*hit)->id() != hadMaxId)
continue;
853 muonEnergy.
hadMax = (*hit)->energy();
864 std::vector<reco::MuonChamberMatch> muonChamberMatches;
865 unsigned int nubmerOfMatchesAccordingToTrackAssociator = 0;
866 for( std::vector<TAMuonChamberMatch>::const_iterator chamber=info.
chambers.begin();
867 chamber!=info.
chambers.end(); chamber++ )
869 if (chamber->id.subdetId() == 3 && rpcRecHits.
isValid() )
continue;
872 LocalError localError = chamber->tState.localError().positionError();
873 matchedChamber.
x = chamber->tState.localPosition().x();
874 matchedChamber.
y = chamber->tState.localPosition().y();
875 matchedChamber.
xErr =
sqrt( localError.
xx() );
876 matchedChamber.
yErr =
sqrt( localError.
yy() );
878 matchedChamber.
dXdZ = chamber->tState.localDirection().z()!=0?chamber->tState.localDirection().x()/chamber->tState.localDirection().z():9999;
879 matchedChamber.
dYdZ = chamber->tState.localDirection().z()!=0?chamber->tState.localDirection().y()/chamber->tState.localDirection().z():9999;
882 matchedChamber.
dXdZErr = trajectoryCovMatrix(1,1)>0?
sqrt(trajectoryCovMatrix(1,1)):0;
883 matchedChamber.
dYdZErr = trajectoryCovMatrix(2,2)>0?
sqrt(trajectoryCovMatrix(2,2)):0;
885 matchedChamber.
edgeX = chamber->localDistanceX;
886 matchedChamber.
edgeY = chamber->localDistanceY;
888 matchedChamber.
id = chamber->id;
889 if ( ! chamber->segments.empty() ) ++nubmerOfMatchesAccordingToTrackAssociator;
892 for( std::vector<TAMuonSegmentMatch>::const_iterator segment = chamber->segments.begin();
893 segment != chamber->segments.end(); segment++ )
896 matchedSegment.
x = segment->segmentLocalPosition.x();
897 matchedSegment.
y = segment->segmentLocalPosition.y();
898 matchedSegment.
dXdZ = segment->segmentLocalDirection.z()?segment->segmentLocalDirection.x()/segment->segmentLocalDirection.z():0;
899 matchedSegment.
dYdZ = segment->segmentLocalDirection.z()?segment->segmentLocalDirection.y()/segment->segmentLocalDirection.z():0;
900 matchedSegment.
xErr = segment->segmentLocalErrorXX>0?
sqrt(segment->segmentLocalErrorXX):0;
901 matchedSegment.
yErr = segment->segmentLocalErrorYY>0?
sqrt(segment->segmentLocalErrorYY):0;
902 matchedSegment.
dXdZErr = segment->segmentLocalErrorDxDz>0?
sqrt(segment->segmentLocalErrorDxDz):0;
903 matchedSegment.
dYdZErr = segment->segmentLocalErrorDyDz>0?
sqrt(segment->segmentLocalErrorDyDz):0;
904 matchedSegment.
t0 = segment->t0;
905 matchedSegment.
mask = 0;
908 matchedSegment.
hasZed_ = segment->hasZed;
909 matchedSegment.
hasPhi_ = segment->hasPhi;
911 bool matchedX =
false;
912 bool matchedY =
false;
913 LogTrace(
"MuonIdentification") <<
" matching local x, segment x: " << matchedSegment.
x <<
914 ", chamber x: " << matchedChamber.
x <<
", max: " <<
maxAbsDx_;
915 LogTrace(
"MuonIdentification") <<
" matching local y, segment y: " << matchedSegment.
y <<
916 ", chamber y: " << matchedChamber.
y <<
", max: " <<
maxAbsDy_;
917 if (matchedSegment.
xErr>0 && matchedChamber.
xErr>0 )
918 LogTrace(
"MuonIdentification") <<
" xpull: " <<
919 fabs(matchedSegment.
x - matchedChamber.
x)/
sqrt(
pow(matchedSegment.
xErr,2) +
pow(matchedChamber.
xErr,2));
920 if (matchedSegment.
yErr>0 && matchedChamber.
yErr>0 )
921 LogTrace(
"MuonIdentification") <<
" ypull: " <<
922 fabs(matchedSegment.
y - matchedChamber.
y)/
sqrt(
pow(matchedSegment.
yErr,2) +
pow(matchedChamber.
yErr,2));
924 if (fabs(matchedSegment.
x - matchedChamber.
x) <
maxAbsDx_) matchedX =
true;
925 if (fabs(matchedSegment.
y - matchedChamber.
y) <
maxAbsDy_) matchedY =
true;
926 if (matchedSegment.
xErr>0 && matchedChamber.
xErr>0 &&
928 if (matchedSegment.
yErr>0 && matchedChamber.
yErr>0 &&
930 if (matchedX && matchedY) matchedChamber.
segmentMatches.push_back(matchedSegment);
932 muonChamberMatches.push_back(matchedChamber);
939 for( std::vector<TAMuonChamberMatch>::const_iterator chamber=info.
chambers.begin();
940 chamber!=info.
chambers.end(); chamber++ )
943 if ( chamber->id.subdetId() != 3 )
continue;
947 LocalError localError = chamber->tState.localError().positionError();
948 matchedChamber.
x = chamber->tState.localPosition().x();
949 matchedChamber.
y = chamber->tState.localPosition().y();
950 matchedChamber.
xErr =
sqrt( localError.
xx() );
951 matchedChamber.
yErr =
sqrt( localError.
yy() );
953 matchedChamber.
dXdZ = chamber->tState.localDirection().z()!=0?chamber->tState.localDirection().x()/chamber->tState.localDirection().z():9999;
954 matchedChamber.
dYdZ = chamber->tState.localDirection().z()!=0?chamber->tState.localDirection().y()/chamber->tState.localDirection().z():9999;
957 matchedChamber.
dXdZErr = trajectoryCovMatrix(1,1)>0?
sqrt(trajectoryCovMatrix(1,1)):0;
958 matchedChamber.
dYdZErr = trajectoryCovMatrix(2,2)>0?
sqrt(trajectoryCovMatrix(2,2)):0;
960 matchedChamber.
edgeX = chamber->localDistanceX;
961 matchedChamber.
edgeY = chamber->localDistanceY;
963 matchedChamber.
id = chamber->id;
966 rpcRecHit != rpcRecHits->end(); ++rpcRecHit )
970 if ( rpcRecHit->rawId() != chamber->id.rawId() )
continue;
972 rpcHitMatch.
x = rpcRecHit->localPosition().x();
973 rpcHitMatch.
mask = 0;
974 rpcHitMatch.
bx = rpcRecHit->BunchX();
976 const double AbsDx = fabs(rpcRecHit->localPosition().x()-chamber->tState.localPosition().x());
977 if( AbsDx <= 20
or AbsDx/
sqrt(localError.
xx()) <= 4 ) matchedChamber.
rpcMatches.push_back(rpcHitMatch);
980 muonChamberMatches.push_back(matchedChamber);
986 LogTrace(
"MuonIdentification") <<
"number of muon chambers: " << aMuon.
matches().size() <<
"\n"
987 <<
"number of chambers with segments according to the associator requirements: " <<
988 nubmerOfMatchesAccordingToTrackAssociator;
989 LogTrace(
"MuonIdentification") <<
"number of segment matches with the producer requirements: " <<
1000 std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > chamberPairs;
1001 std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > stationPairs;
1002 std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > arbitrationPairs;
1005 for(
unsigned int muonIndex1 = 0; muonIndex1 < pOutputMuons->size(); ++muonIndex1 )
1008 for( std::vector<reco::MuonChamberMatch>::iterator chamberIter1 = pOutputMuons->at(muonIndex1).matches().begin();
1009 chamberIter1 != pOutputMuons->at(muonIndex1).matches().end(); ++chamberIter1 )
1011 if(chamberIter1->segmentMatches.empty())
continue;
1012 chamberPairs.clear();
1015 for( std::vector<reco::MuonSegmentMatch>::iterator segmentIter1 = chamberIter1->segmentMatches.begin();
1016 segmentIter1 != chamberIter1->segmentMatches.end(); ++segmentIter1 )
1018 chamberPairs.push_back(std::make_pair(&(*chamberIter1), &(*segmentIter1)));
1019 if(!segmentIter1->isMask())
1021 arbitrationPairs.clear();
1022 arbitrationPairs.push_back(std::make_pair(&(*chamberIter1), &(*segmentIter1)));
1028 if (pOutputMuons->at(muonIndex1).isTrackerMuon()) {
1030 for(
unsigned int muonIndex2 = muonIndex1+1; muonIndex2 < pOutputMuons->size(); ++muonIndex2 )
1033 if (! pOutputMuons->at(muonIndex2).isTrackerMuon())
continue;
1035 for( std::vector<reco::MuonChamberMatch>::iterator chamberIter2 = pOutputMuons->at(muonIndex2).matches().begin();
1036 chamberIter2 != pOutputMuons->at(muonIndex2).matches().end(); ++chamberIter2 )
1039 for( std::vector<reco::MuonSegmentMatch>::iterator segmentIter2 = chamberIter2->segmentMatches.begin();
1040 segmentIter2 != chamberIter2->segmentMatches.end(); ++segmentIter2 )
1042 if(segmentIter2->isMask())
continue;
1043 if(fabs(segmentIter2->x - segmentIter1->x ) < 1E-3 &&
1044 fabs(segmentIter2->y - segmentIter1->y ) < 1E-3 &&
1045 fabs(segmentIter2->dXdZ - segmentIter1->dXdZ ) < 1E-3 &&
1046 fabs(segmentIter2->dYdZ - segmentIter1->dYdZ ) < 1E-3 &&
1047 fabs(segmentIter2->xErr - segmentIter1->xErr ) < 1E-3 &&
1048 fabs(segmentIter2->yErr - segmentIter1->yErr ) < 1E-3 &&
1049 fabs(segmentIter2->dXdZErr - segmentIter1->dXdZErr) < 1E-3 &&
1050 fabs(segmentIter2->dYdZErr - segmentIter1->dYdZErr) < 1E-3)
1051 arbitrationPairs.push_back(std::make_pair(&(*chamberIter2), &(*segmentIter2)));
1058 if(arbitrationPairs.empty())
continue;
1059 if(arbitrationPairs.size()==1) {
1074 for(
unsigned int it = 0; it < arbitrationPairs.size(); ++it )
1082 if(cscid.
ring() == 4)
1083 for( std::vector<reco::MuonSegmentMatch>::iterator segmentIter2 = chamberIter1->segmentMatches.begin();
1084 segmentIter2 != chamberIter1->segmentMatches.end(); ++segmentIter2 ) {
1085 if( segmentIter1->cscSegmentRef.isNonnull() && segmentIter2->cscSegmentRef.isNonnull() )
1087 (segmentIter2->mask & 0x1e0000) &&
1088 (segmentIter1->mask & 0x1e0000) )
1097 if(chamberPairs.empty())
continue;
1098 if(chamberPairs.size()==1) {
1117 for(
int detectorIndex = 1; detectorIndex < 4; ++detectorIndex )
1119 stationPairs.clear();
1122 for( std::vector<reco::MuonChamberMatch>::iterator chamberIter = pOutputMuons->at(muonIndex1).matches().begin();
1123 chamberIter != pOutputMuons->at(muonIndex1).matches().end(); ++chamberIter )
1125 if(!(chamberIter->station()==
stationIndex && chamberIter->detector()==detectorIndex))
continue;
1126 if(chamberIter->segmentMatches.empty())
continue;
1128 for( std::vector<reco::MuonSegmentMatch>::iterator segmentIter = chamberIter->segmentMatches.begin();
1129 segmentIter != chamberIter->segmentMatches.end(); ++segmentIter )
1130 stationPairs.push_back(std::make_pair(&(*chamberIter), &(*segmentIter)));
1133 if(stationPairs.empty())
continue;
1134 if(stationPairs.size()==1) {
1173 throw cms::Exception(
"FatalError") <<
"Failed to compute muon isolation information for a muon with undefined references to tracks";
1181 if(caloDeps.size()!=3) {
1182 LogTrace(
"MuonIdentification") <<
"Failed to fill vector of calorimeter isolation deposits!";
1226 double energy =
sqrt(track.
p() * track.
p() + 0.011163691);
1239 if ( muonId.
sector() <= 12 )
1241 if ( muonId.
sector() == 13 ) phi = 3/6.*
M_PI;
1242 if ( muonId.
sector() == 14 ) phi = 9/6.*
M_PI;
1256 if ( muon.
matches().empty() ){
1259 return muon.
innerTrack()->outerPosition().phi();
1294 if (trackBAD || staBAD || glbBAD )
1296 edm::LogWarning(
"muonIDbadLinks") <<
"Global muon links to constituent tracks are invalid: trkBad "
1297 <<trackBAD <<
" standaloneBad "<<staBAD<<
" globalBad "<<glbBAD
1298 <<
". There should be no such object. Muon is skipped.";
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)
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
reco::TrackRef trackerTrack() const
get the tracker's track which match with the stand alone muon tracks
void runMesh(std::vector< reco::Muon > *p)
static bool crossedIP(const reco::Track &track)
float sumPt
sum-pt of tracks
void setType(unsigned int type)
TrackDetectorAssociator trackAssociator_
CSCSegmentRef cscSegmentRef
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)
friend struct const_iterator
reco::isodeposit::IsoDepositExtractor * muIsoExtractorCalo_
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::Handle< reco::MuonTrackLinksCollection > linkCollectionHandle_
edm::EDGetTokenT< RPCRecHitCollection > rpcHitToken_
bool isTrackerMuon() const
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_
bool muonId(HWW &, unsigned int index, SelectionType type)
void insert(const H &h, I begin, I end)
double phiOfMuonIneteractionRegion(const reco::Muon &muon) const
std::vector< CaloMuon > CaloMuonCollection
collection of Muon objects
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
std::vector< std::string > inputCollectionTypes_
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_
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
std::auto_ptr< MuonKinkFinder > trackerKinkFinder_
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
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
MuonTime time() const
get 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
virtual void setTunePBestTrack(MuonTrackType muonType)
double depositWithin(double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const
Get deposit.
uint32_t rawId() const
get the raw id
void setCSCGeometry(const CSCGeometry *pg)
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 ...
double ptThresholdToFillCandidateP4WithGlobalFit_
double eta() const
pseudorapidity of momentum vector
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
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
bool isGoodTrackerMuon(const reco::Muon &muon)
double pt() const
track transverse momentum
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
CSCDetId chamberId() const
edm::EDGetTokenT< reco::MuonCollection > muonCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > outerTrackCollectionToken_
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.
bool isQualityValid() const
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
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
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 &)
reco::isodeposit::IsoDepositExtractor * muIsoExtractorJet_
bool isDuplicateOf(const CSCSegmentRef &lhs, const CSCSegmentRef &rhs) const
MuonTimingFiller * theTimingFiller_
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
T const * product() const
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.
virtual void setOuterTrack(const TrackRef &t)
set reference to Track
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)
virtual void setBestTrack(MuonTrackType muonType)
functor predicate for standard library sort algorithm
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
void fillTiming(const reco::Muon &muon, reco::MuonTimeExtra &dtTime, reco::MuonTimeExtra &cscTime, reco::MuonTimeExtra &combinedTime, edm::Event &iEvent, const edm::EventSetup &iSetup)
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
virtual double phi() const
momentum azimuthal angle
static const unsigned int BestInChamberByDRSlope
float caloCompatibility() const
bool validateGlobalMuonPair(const reco::MuonTrackLinks &goodMuon, const reco::MuonTrackLinks &badMuon)
bool debugWithTruthMatching_
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
T get(const Candidate &c)
edm::InputTag globalTrackQualityInputTag_
edm::Handle< reco::MuonCollection > muonCollectionHandle_
double py() const
y coordinate of momentum vector
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