Skip to content

Commit

Permalink
Merge CMSSW_10_6_X into CMSSW_10_6_DEVEL_X.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed Apr 4, 2019
2 parents f46d9e9 + 742de4d commit 9a214dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 32 deletions.
16 changes: 9 additions & 7 deletions DataFormats/MuonReco/interface/Muon.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ namespace reco {
/// number of chambers CSC or DT matches only (MuonChamberMatches include RPC rolls)
int numberOfChambersCSCorDT() const;
/// get number of chambers with matched segments
int numberOfMatches( unsigned int type = SegmentAndTrackArbitration ) const;
int numberOfMatches( ArbitrationType type = SegmentAndTrackArbitration ) const;
/// get number of stations with matched segments
/// just adds the bits returned by stationMask
int numberOfMatchedStations( ArbitrationType type = SegmentAndTrackArbitration ) const;
Expand All @@ -251,7 +251,7 @@ namespace reco {
/// get bit map of stations with matched segments
/// bits 0-1-2-3 = DT stations 1-2-3-4
/// bits 4-5-6-7 = CSC stations 1-2-3-4
unsigned int stationMask( unsigned int type = SegmentAndTrackArbitration ) const;
unsigned int stationMask( ArbitrationType type = SegmentAndTrackArbitration ) const;
/// get bit map of stations with tracks within
/// given distance (in cm) of chamber edges
/// bit assignments are same as above
Expand All @@ -272,8 +272,10 @@ namespace reco {
static const unsigned int GEMMuon = 1<<7;
static const unsigned int ME0Muon = 1<<8;

void setType( unsigned int type ) { type_ = type; }
unsigned int type() const { return type_; }
void setType( unsigned int type ) { type_ = type; }
unsigned int type() const { return type_; }


// override of method in base class reco::Candidate
bool isMuon() const override { return true; }
bool isGlobalMuon() const override { return type_ & GlobalMuon; }
Expand Down Expand Up @@ -331,7 +333,7 @@ namespace reco {

/// muon type mask
unsigned int type_;

//PF muon p4
reco::Candidate::LorentzVector pfP4_;

Expand All @@ -341,12 +343,12 @@ namespace reco {
const std::vector<const MuonChamberMatch*> chambers( int station, int muonSubdetId ) const;
/// get pointers to best segment and corresponding chamber in vector of chambers
std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> pair( const std::vector<const MuonChamberMatch*> &,
unsigned int type = SegmentAndTrackArbitration ) const;
ArbitrationType type = SegmentAndTrackArbitration ) const;
/// selector bitmap
unsigned int selectors_;
public:
/// get number of segments
int numberOfSegments( int station, int muonSubdetId, unsigned int type = SegmentAndTrackArbitration ) const;
int numberOfSegments( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
/// get deltas between (best) segment and track
/// If no chamber or no segment returns 999999
float dX ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
Expand Down
29 changes: 4 additions & 25 deletions DataFormats/MuonReco/src/Muon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ int Muon::numberOfChambersCSCorDT() const
return total;
}

int Muon::numberOfMatches( unsigned int type ) const
int Muon::numberOfMatches( ArbitrationType type ) const
{
int matches(0);
for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
Expand Down Expand Up @@ -109,11 +109,6 @@ int Muon::numberOfMatches( unsigned int type ) const
matches++;
break;
}
if(type > 1<<7)
if(segmentMatch->isMask(type)) {
matches++;
break;
}
}
}

Expand Down Expand Up @@ -152,7 +147,7 @@ unsigned int Muon::expectedNnumberOfMatchedStations( float minDistanceFromEdge )
return n;
}

unsigned int Muon::stationMask( unsigned int type ) const
unsigned int Muon::stationMask( ArbitrationType type ) const
{
unsigned int totMask(0);
unsigned int curMask(0);
Expand Down Expand Up @@ -218,14 +213,6 @@ unsigned int Muon::stationMask( unsigned int type ) const
totMask += curMask;
break;
}
if(type > 1<<7)
if(segmentMatch->isMask(type)) {
curMask = 1<<( (chamberMatch->station()-1)+4*(chamberMatch->detector()-1) );
// do not double count
if(!(totMask & curMask))
totMask += curMask;
break;
}
}
}

Expand Down Expand Up @@ -347,7 +334,7 @@ unsigned int Muon::stationGapMaskPull( float sigmaCut ) const
return totMask;
}

int Muon::numberOfSegments( int station, int muonSubdetId, unsigned int type ) const
int Muon::numberOfSegments( int station, int muonSubdetId, ArbitrationType type ) const
{
int segments(0);
for( std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
Expand Down Expand Up @@ -382,11 +369,6 @@ int Muon::numberOfSegments( int station, int muonSubdetId, unsigned int type ) c
segments++;
break;
}
if(type > 1<<7)
if(segmentMatch->isMask(type)) {
segments++;
break;
}
}
}

Expand All @@ -404,7 +386,7 @@ const std::vector<const MuonChamberMatch*> Muon::chambers( int station, int muon
}

std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> Muon::pair( const std::vector<const MuonChamberMatch*> &chambers,
unsigned int type ) const
ArbitrationType type ) const
{
MuonChamberMatch* m = nullptr;
MuonSegmentMatch* s = nullptr;
Expand Down Expand Up @@ -433,9 +415,6 @@ std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> Muon::pair( const std
segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning))
return std::make_pair(*chamberMatch, &(*segmentMatch));
if(type > 1<<7)
if(segmentMatch->isMask(type))
return std::make_pair(*chamberMatch, &(*segmentMatch));
}
}

Expand Down

0 comments on commit 9a214dc

Please sign in to comment.