CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MuonTrackCut Class Reference
Inheritance diagram for MuonTrackCut:
CutApplicatorBase candidate_functions::CandidateCut

Public Member Functions

CandidateType candidateType () const final
 
 MuonTrackCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::MuonPtr &) const final
 
double value (const reco::CandidatePtr &) const final
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) const
 
 CutApplicatorBase ()
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
virtual const std::string & name () const
 
virtual result_type operator() (const argument_type &) const final
 
virtual result_type operator() (const reco::GsfElectronPtr &) const
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const reco::PhotonPtr &) const
 
virtual result_type operator() (const pat::PhotonPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) const
 
CutApplicatorBaseoperator= (const CutApplicatorBase &)=delete
 
virtual ~CutApplicatorBase ()
 Destructor. More...
 
- Public Member Functions inherited from candidate_functions::CandidateCut
 CandidateCut ()
 
virtual ~CandidateCut ()
 

Private Attributes

bool doGlobalTrack_
 
bool doInnerTrack_
 
int minNumberOfValidMuonHits_
 
int minNumberOfValidPixelHits_
 
int minPixelLayersWithMeasurement_
 
int minTrackerLayersWithMeasurement_
 
double minValidFraction_
 
reco::Track::TrackQuality trackQuality_
 

Additional Inherited Members

- Public Types inherited from CutApplicatorBase
enum  CandidateType {
  NONE, ELECTRON, MUON, PHOTON,
  TAU, PATELECTRON, PATMUON, PATPHOTON,
  PATTAU
}
 

Detailed Description

Definition at line 5 of file MuonTrackCut.cc.

Constructor & Destructor Documentation

MuonTrackCut::MuonTrackCut ( const edm::ParameterSet c)

Definition at line 28 of file MuonTrackCut.cc.

References doGlobalTrack_, doInnerTrack_, edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), minNumberOfValidMuonHits_, minNumberOfValidPixelHits_, minPixelLayersWithMeasurement_, minTrackerLayersWithMeasurement_, minValidFraction_, reco::TrackBase::qualityByName(), AlCaHLTBitMon_QueryRunRegistry::string, and trackQuality_.

28  :
36  doInnerTrack_(false), doGlobalTrack_(false)
37 {
38 
39  if ( c.existsAs<edm::ParameterSet>("innerTrack") )
40  {
41  doInnerTrack_ = true;
42 
43  const edm::ParameterSet cc = c.getParameter<edm::ParameterSet>("innerTrack");
44  if ( cc.exists("minTrackerLayersWithMeasurement") ) minTrackerLayersWithMeasurement_ = cc.getParameter<int>("minTrackerLayersWithMeasurement");
45  if ( cc.exists("minPixelLayersWithMeasurement") ) minPixelLayersWithMeasurement_ = cc.getParameter<int>("minPixelLayersWithMeasurement");
46  if ( cc.exists("minNumberOfValidPixelHits") ) minNumberOfValidPixelHits_ = cc.getParameter<int>("minNumberOfValidPixelHits");
47  if ( cc.exists("minValidFraction") ) minValidFraction_ = cc.getParameter<double>("minValidFraction");
48  const std::string trackQualityStr = cc.exists("trackQuality") ? cc.getParameter<std::string>("trackQuality") : "";
49  trackQuality_ = reco::Track::qualityByName(trackQualityStr);
50  }
51  if ( c.existsAs<edm::ParameterSet>("globalTrack") )
52  {
53  doGlobalTrack_ = true;
54 
55  const edm::ParameterSet cc = c.getParameter<edm::ParameterSet>("globalTrack");
56  //if ( cc.exists("maxNormalizedChi2") ) maxNormalizedChi2_ = cc.getParameter<double>("maxNormalizedChi2");
57  if ( cc.exists("minNumberOfValidMuonHits") ) minNumberOfValidMuonHits_ = cc.getParameter<int>("minNumberOfValidMuonHits");
58  }
59 
60 }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
bool exists(std::string const &parameterName) const
checks if a parameter exists
int minNumberOfValidPixelHits_
Definition: MuonTrackCut.cc:16
int minNumberOfValidMuonHits_
Definition: MuonTrackCut.cc:19
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
int minTrackerLayersWithMeasurement_
Definition: MuonTrackCut.cc:16
reco::Track::TrackQuality trackQuality_
Definition: MuonTrackCut.cc:18
double minValidFraction_
Definition: MuonTrackCut.cc:17
bool doInnerTrack_
Definition: MuonTrackCut.cc:21
int minPixelLayersWithMeasurement_
Definition: MuonTrackCut.cc:16
bool doGlobalTrack_
Definition: MuonTrackCut.cc:21

Member Function Documentation

CandidateType MuonTrackCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 11 of file MuonTrackCut.cc.

References CutApplicatorBase::MUON, and value().

CutApplicatorBase::result_type MuonTrackCut::operator() ( const reco::MuonPtr muon) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 63 of file MuonTrackCut.cc.

References doGlobalTrack_, doInnerTrack_, reco::Muon::globalTrack(), reco::Muon::innerTrack(), edm::Ref< C, T, F >::isNull(), minNumberOfValidMuonHits_, minNumberOfValidPixelHits_, minPixelLayersWithMeasurement_, minTrackerLayersWithMeasurement_, minValidFraction_, lumiQTWidget::t, trackQuality_, and reco::TrackBase::undefQuality.

64 {
65  if ( doInnerTrack_ )
66  {
67  const reco::TrackRef t = muon->innerTrack();
68  if ( t.isNull() ) return false;
69  const auto& h = t->hitPattern();
70  if ( trackQuality_ != reco::Track::undefQuality and !t->quality(trackQuality_) ) return false;
71  if ( h.trackerLayersWithMeasurement() < minTrackerLayersWithMeasurement_ ) return false;
72  if ( h.pixelLayersWithMeasurement() < minPixelLayersWithMeasurement_ ) return false;
73  if ( h.numberOfValidPixelHits() < minNumberOfValidPixelHits_ ) return false;
74  if ( t->validFraction() <= minValidFraction_ ) return false;
75  }
76  if ( doGlobalTrack_ )
77  {
78  const reco::TrackRef t = muon->globalTrack();
79  if ( t.isNull() ) return false;
80  const auto& h = t->hitPattern();
81  if ( h.numberOfValidMuonHits() < minNumberOfValidMuonHits_ ) return false;
82  // if ( t->normalizedChi2() > maxNormalizedChi2_ ) return false; Not used for
83  }
84 
85  return true;
86 }
virtual TrackRef innerTrack() const
Definition: Muon.h:48
int minNumberOfValidPixelHits_
Definition: MuonTrackCut.cc:16
bool isNull() const
Checks for null.
Definition: Ref.h:250
int minNumberOfValidMuonHits_
Definition: MuonTrackCut.cc:19
int minTrackerLayersWithMeasurement_
Definition: MuonTrackCut.cc:16
reco::Track::TrackQuality trackQuality_
Definition: MuonTrackCut.cc:18
double minValidFraction_
Definition: MuonTrackCut.cc:17
bool doInnerTrack_
Definition: MuonTrackCut.cc:21
int minPixelLayersWithMeasurement_
Definition: MuonTrackCut.cc:16
bool doGlobalTrack_
Definition: MuonTrackCut.cc:21
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:54
double MuonTrackCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 88 of file MuonTrackCut.cc.

References doGlobalTrack_, doInnerTrack_, reco::Muon::globalTrack(), reco::Muon::innerTrack(), edm::Ref< C, T, F >::isNull(), minNumberOfValidMuonHits_, minNumberOfValidPixelHits_, minPixelLayersWithMeasurement_, minTrackerLayersWithMeasurement_, minValidFraction_, metsig::muon, lumiQTWidget::t, trackQuality_, and reco::TrackBase::undefQuality.

Referenced by candidateType().

89 {
90  const reco::MuonPtr muon(cand);
91  if ( doInnerTrack_ )
92  {
93  const reco::TrackRef t = muon->innerTrack();
94  if ( t.isNull() ) return 0;
95  const auto& h = t->hitPattern();
96  if ( trackQuality_ != reco::Track::undefQuality and !t->quality(trackQuality_) ) return t->quality(trackQuality_);
97  if ( h.trackerLayersWithMeasurement() < minTrackerLayersWithMeasurement_ ) return h.trackerLayersWithMeasurement();
98  if ( h.pixelLayersWithMeasurement() < minPixelLayersWithMeasurement_ ) return h.pixelLayersWithMeasurement();
99  if ( h.numberOfValidPixelHits() < minNumberOfValidPixelHits_ ) return h.numberOfValidPixelHits();
100  if ( t->validFraction() <= minValidFraction_ ) return t->validFraction();
101 
102  return t->validFraction();
103  }
104  if ( doGlobalTrack_ )
105  {
106  const reco::TrackRef t = muon->globalTrack();
107  if ( t.isNull() ) return 0;
108  const auto& h = t->hitPattern();
109  if ( h.numberOfValidMuonHits() < minNumberOfValidMuonHits_ ) return h.numberOfValidMuonHits();
110  // if ( t->normalizedChi2() > maxNormalizedChi2_ ) return false; Not used for
111 
112  return h.numberOfValidMuonHits();
113  }
114 
115  return 0;
116 }
int minNumberOfValidPixelHits_
Definition: MuonTrackCut.cc:16
bool isNull() const
Checks for null.
Definition: Ref.h:250
int minNumberOfValidMuonHits_
Definition: MuonTrackCut.cc:19
int minTrackerLayersWithMeasurement_
Definition: MuonTrackCut.cc:16
reco::Track::TrackQuality trackQuality_
Definition: MuonTrackCut.cc:18
double minValidFraction_
Definition: MuonTrackCut.cc:17
bool doInnerTrack_
Definition: MuonTrackCut.cc:21
int minPixelLayersWithMeasurement_
Definition: MuonTrackCut.cc:16
bool doGlobalTrack_
Definition: MuonTrackCut.cc:21

Member Data Documentation

bool MuonTrackCut::doGlobalTrack_
private

Definition at line 21 of file MuonTrackCut.cc.

Referenced by MuonTrackCut(), operator()(), and value().

bool MuonTrackCut::doInnerTrack_
private

Definition at line 21 of file MuonTrackCut.cc.

Referenced by MuonTrackCut(), operator()(), and value().

int MuonTrackCut::minNumberOfValidMuonHits_
private

Definition at line 19 of file MuonTrackCut.cc.

Referenced by MuonTrackCut(), operator()(), and value().

int MuonTrackCut::minNumberOfValidPixelHits_
private

Definition at line 16 of file MuonTrackCut.cc.

Referenced by MuonTrackCut(), operator()(), and value().

int MuonTrackCut::minPixelLayersWithMeasurement_
private

Definition at line 16 of file MuonTrackCut.cc.

Referenced by MuonTrackCut(), operator()(), and value().

int MuonTrackCut::minTrackerLayersWithMeasurement_
private

Definition at line 16 of file MuonTrackCut.cc.

Referenced by MuonTrackCut(), operator()(), and value().

double MuonTrackCut::minValidFraction_
private

Definition at line 17 of file MuonTrackCut.cc.

Referenced by MuonTrackCut(), operator()(), and value().

reco::Track::TrackQuality MuonTrackCut::trackQuality_
private

Definition at line 18 of file MuonTrackCut.cc.

Referenced by MuonTrackCut(), operator()(), and value().