Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard muon selectors #20612

Merged
merged 32 commits into from Oct 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b9c86bc
Added bitmap and needed methods and types for standard muon selectors
drkovalskyi Sep 19, 2017
e317148
Added muon MVA value as well as some jet-related variables widely use…
drkovalskyi Sep 19, 2017
4886664
Added a function to set selector flags for selections based on reco::…
drkovalskyi Sep 19, 2017
8bf0616
Compute standard muon selector flags in RECO
drkovalskyi Sep 19, 2017
ec7e863
Integrated Muon MVA and added calculation of MiniIsolation and MVA wo…
drkovalskyi Sep 19, 2017
1832ba3
Added bitmap and needed methods and types for standard muon selectors
drkovalskyi Sep 19, 2017
ba73ec9
Added muon MVA value as well as some jet-related variables widely use…
drkovalskyi Sep 19, 2017
0c5ab4a
Added a function to set selector flags for selections based on reco::…
drkovalskyi Sep 19, 2017
dd8206b
Compute standard muon selector flags in RECO
drkovalskyi Sep 19, 2017
04cfab4
Integrated Muon MVA and added calculation of MiniIsolation and MVA wo…
drkovalskyi Sep 19, 2017
ba190d9
updated checksum and version
drkovalskyi Sep 19, 2017
e8d20f7
updated checksum
drkovalskyi Sep 21, 2017
bf7f6b5
wrong header file
drkovalskyi Sep 21, 2017
738fd09
protection
drkovalskyi Sep 21, 2017
42f4170
disable muon mva unless we are producing miniaod
drkovalskyi Sep 21, 2017
718dc74
style improvements
drkovalskyi Sep 21, 2017
9dd45cf
removed unnecesary protection
drkovalskyi Sep 21, 2017
8689825
renamed define statement to follow the convention
drkovalskyi Sep 21, 2017
7fbd779
removed commented out code
drkovalskyi Sep 21, 2017
a26e056
use plain float type
drkovalskyi Sep 21, 2017
a8dcb6f
made primary vertex collection configurable
drkovalskyi Sep 22, 2017
59ad7ca
changed the primary vertex collection
drkovalskyi Sep 22, 2017
57e47ad
added TrackerHighPtMuon
drkovalskyi Sep 22, 2017
30998ea
added hip mitigation
drkovalskyi Sep 28, 2017
f5af074
hip mitigation for Run2016BCDEF
drkovalskyi Sep 28, 2017
9cfcfb7
cleanup
drkovalskyi Sep 29, 2017
7902379
cleanup
drkovalskyi Sep 29, 2017
75d3480
extract timing for tracker-only muons
drkovalskyi Sep 30, 2017
f4cb782
cleanup
drkovalskyi Sep 30, 2017
9cc9137
reverted changes
drkovalskyi Oct 1, 2017
79958f0
cleanup
drkovalskyi Oct 1, 2017
0dce48d
resolved conflict
drkovalskyi Oct 6, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 53 additions & 13 deletions DataFormats/MuonReco/interface/Muon.h
Expand Up @@ -30,7 +30,7 @@ namespace reco {
/// constructor from values
Muon( Charge, const LorentzVector &, const Point & = Point( 0, 0, 0 ) );
/// create a clone
Muon * clone() const;
Muon * clone() const override;



Expand All @@ -46,20 +46,20 @@ namespace reco {
/// reference to Track reconstructed in the tracker only
using reco::RecoCandidate::track;
virtual TrackRef innerTrack() const { return innerTrack_; }
virtual TrackRef track() const { return innerTrack(); }
TrackRef track() const override { return innerTrack(); }
/// reference to Track reconstructed in the muon detector only
virtual TrackRef outerTrack() const { return outerTrack_; }
virtual TrackRef standAloneMuon() const { return outerTrack(); }
TrackRef standAloneMuon() const override { return outerTrack(); }
/// reference to Track reconstructed in both tracked and muon detector
virtual TrackRef globalTrack() const { return globalTrack_; }
virtual TrackRef combinedMuon() const { return globalTrack(); }
TrackRef combinedMuon() const override { return globalTrack(); }

virtual TrackRef tpfmsTrack() const { return muonTrackFromMap(TPFMS);}
virtual TrackRef pickyTrack() const { return muonTrackFromMap(Picky);}
virtual TrackRef dytTrack() const { return muonTrackFromMap(DYT);}

virtual const Track * bestTrack() const {return muonTrack(bestTrackType_).get();}
virtual TrackBaseRef bestTrackRef() const {return reco::TrackBaseRef(muonTrack(bestTrackType_));}
const Track * bestTrack() const override {return muonTrack(bestTrackType_).get();}
TrackBaseRef bestTrackRef() const override {return reco::TrackBaseRef(muonTrack(bestTrackType_));}
virtual TrackRef muonBestTrack() const {return muonTrack(bestTrackType_);}
virtual MuonTrackType muonBestTrackType() const {return bestTrackType_;}
virtual TrackRef tunePMuonBestTrack() const {return muonTrack(bestTunePTrackType_);}
Expand Down Expand Up @@ -182,6 +182,45 @@ namespace reco {
enum ArbitrationType { NoArbitration, SegmentArbitration, SegmentAndTrackArbitration, SegmentAndTrackArbitrationCleaned,
RPCHitAndTrackArbitration, GEMSegmentAndTrackArbitration, ME0SegmentAndTrackArbitration };

///
/// ====================== STANDARD SELECTORS ===========================
///
enum Selector {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDSelector may be more descriptive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not ID. It's any selector including isolation.

CutBasedIdLoose = 1UL<< 0,
CutBasedIdMedium = 1UL<< 1,
CutBasedIdMediumPrompt = 1UL<< 2, // medium with IP cuts
CutBasedIdTight = 1UL<< 3,
CutBasedIdGlobalHighPt = 1UL<< 4, // high pt muon for Z',W' (better momentum resolution)
CutBasedIdTrkHighPt = 1UL<< 5, // high pt muon for boosted Z (better efficiency)
PFIsoVeryLoose = 1UL<< 6, // reliso<0.40
PFIsoLoose = 1UL<< 7, // reliso<0.25
PFIsoMedium = 1UL<< 8, // reliso<0.20
PFIsoTight = 1UL<< 9, // reliso<0.15
PFIsoVeryTight = 1UL<<10, // reliso<0.10
TkIsoLoose = 1UL<<11, // reliso<0.10
TkIsoTight = 1UL<<12, // reliso<0.05
SoftCutBasedId = 1UL<<13,
SoftMvaId = 1UL<<14,
MvaLoose = 1UL<<15,
MvaMedium = 1UL<<16,
MvaTight = 1UL<<17,
MiniIsoLoose = 1UL<<18, // reliso<0.40
MiniIsoMedium = 1UL<<19, // reliso<0.20
MiniIsoTight = 1UL<<20, // reliso<0.10
MiniIsoVeryTight = 1UL<<21 // reliso<0.05

};

bool passed( unsigned int selection ) const { return (selectors_ & selection)==selection; }
unsigned int selectors() const { return selectors_; }
void setSelectors( unsigned int selectors ){ selectors_ = selectors; }
void setSelector(Selector selector, bool passed){
if (passed)
selectors_ |= selector;
else
selectors_ &= ~selector;
}

///
/// ====================== USEFUL METHODs ===========================
///
Expand Down Expand Up @@ -221,19 +260,19 @@ namespace reco {
void setType( unsigned int type ) { type_ = type; }
unsigned int type() const { return type_; }
// override of method in base class reco::Candidate
bool isMuon() const { return true; }
bool isGlobalMuon() const { return type_ & GlobalMuon; }
bool isTrackerMuon() const { return type_ & TrackerMuon; }
bool isStandAloneMuon() const { return type_ & StandAloneMuon; }
bool isCaloMuon() const { return type_ & CaloMuon; }
bool isMuon() const override { return true; }
bool isGlobalMuon() const override { return type_ & GlobalMuon; }
bool isTrackerMuon() const override { return type_ & TrackerMuon; }
bool isStandAloneMuon() const override { return type_ & StandAloneMuon; }
bool isCaloMuon() const override { return type_ & CaloMuon; }
bool isPFMuon() const {return type_ & PFMuon;} //fix me ! Has to go to type
bool isRPCMuon() const {return type_ & RPCMuon;}
bool isGEMMuon() const {return type_ & GEMMuon;}
bool isME0Muon() const {return type_ & ME0Muon;}

private:
/// check overlap with another candidate
virtual bool overlap( const Candidate & ) const;
bool overlap( const Candidate & ) const override;
/// reference to Track reconstructed in the tracker only
TrackRef innerTrack_;
/// reference to Track reconstructed in the muon detector only
Expand Down Expand Up @@ -288,7 +327,8 @@ namespace reco {
/// get pointers to best segment and corresponding chamber in vector of chambers
std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> pair( const std::vector<const MuonChamberMatch*> &,
ArbitrationType type = SegmentAndTrackArbitration ) const;

/// selector bitmap
unsigned int selectors_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it safe to commit to 32 bits now, considering that 22 are already taken?
uint64_t could save from some headache in not so distant future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32 is good enough. We need to resist a temptation to introduce any minor modification as a separate selector. If that's done I don't think we will reach the limit any time soon. In other words it's good to have some limits to avoid id proliferation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, OK.
It's not obvious what happens with phase-2 specific IDs.
It's almost zero effort now to leave more room.

public:
/// get number of segments
int numberOfSegments( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
Expand Down
8 changes: 6 additions & 2 deletions DataFormats/MuonReco/interface/MuonSelectors.h
Expand Up @@ -87,9 +87,10 @@ namespace muon {

bool isTightMuon(const reco::Muon&, const reco::Vertex&);
bool isLooseMuon(const reco::Muon&);
bool isMediumMuon(const reco::Muon&);
bool isSoftMuon(const reco::Muon&, const reco::Vertex&);
bool isMediumMuon(const reco::Muon&, bool run2016_hip_mitigation=false);
bool isSoftMuon(const reco::Muon&, const reco::Vertex&, bool run2016_hip_mitigation=false);
bool isHighPtMuon(const reco::Muon&, const reco::Vertex&);
bool isTrackerHighPtMuon(const reco::Muon&, const reco::Vertex&);

// determine if station was crossed well withing active volume
unsigned int RequiredStationMask( const reco::Muon& muon,
Expand All @@ -116,5 +117,8 @@ namespace muon {
int sharedSegments( const reco::Muon& muon1, const reco::Muon& muon2,
unsigned int segmentArbitrationMask = reco::MuonSegmentMatch::BestInChamberByDR ) ;

void setCutBasedSelectorFlags(reco::Muon& muon,
const reco::Vertex* vertex=nullptr,
bool run2016_hip_mitigation=false);
}
#endif