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 CutApplicatorBase &)=delete
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
const std::string & name () const override
 
result_type operator() (const argument_type &) const final
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const pat::PhotonPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) const
 
virtual result_type operator() (const reco::GsfElectronPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const reco::PhotonPtr &) const
 
CutApplicatorBaseoperator= (const CutApplicatorBase &)=delete
 
 ~CutApplicatorBase () override
 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
}
 
- Public Types inherited from candidate_functions::CandidateCut
using argument_type = reco::CandidatePtr
 
using result_type = bool
 

Detailed Description

Definition at line 5 of file MuonTrackCut.cc.

Constructor & Destructor Documentation

◆ MuonTrackCut()

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

Definition at line 25 of file MuonTrackCut.cc.

33  doInnerTrack_(false),
34  doGlobalTrack_(false) {
35  if (c.existsAs<edm::ParameterSet>("innerTrack")) {
36  doInnerTrack_ = true;
37 
38  const edm::ParameterSet cc = c.getParameter<edm::ParameterSet>("innerTrack");
39  if (cc.exists("minTrackerLayersWithMeasurement"))
40  minTrackerLayersWithMeasurement_ = cc.getParameter<int>("minTrackerLayersWithMeasurement");
41  if (cc.exists("minPixelLayersWithMeasurement"))
42  minPixelLayersWithMeasurement_ = cc.getParameter<int>("minPixelLayersWithMeasurement");
43  if (cc.exists("minNumberOfValidPixelHits"))
44  minNumberOfValidPixelHits_ = cc.getParameter<int>("minNumberOfValidPixelHits");
45  if (cc.exists("minValidFraction"))
46  minValidFraction_ = cc.getParameter<double>("minValidFraction");
47  const std::string trackQualityStr = cc.exists("trackQuality") ? cc.getParameter<std::string>("trackQuality") : "";
48  trackQuality_ = reco::Track::qualityByName(trackQualityStr);
49  }
50  if (c.existsAs<edm::ParameterSet>("globalTrack")) {
51  doGlobalTrack_ = true;
52 
53  const edm::ParameterSet cc = c.getParameter<edm::ParameterSet>("globalTrack");
54  //if ( cc.exists("maxNormalizedChi2") ) maxNormalizedChi2_ = cc.getParameter<double>("maxNormalizedChi2");
55  if (cc.exists("minNumberOfValidMuonHits"))
56  minNumberOfValidMuonHits_ = cc.getParameter<int>("minNumberOfValidMuonHits");
57  }
58 }

References HltBtagPostValidation_cff::c, doGlobalTrack_, doInnerTrack_, minNumberOfValidMuonHits_, minNumberOfValidPixelHits_, minPixelLayersWithMeasurement_, minTrackerLayersWithMeasurement_, minValidFraction_, reco::TrackBase::qualityByName(), AlCaHLTBitMon_QueryRunRegistry::string, and trackQuality_.

Member Function Documentation

◆ candidateType()

CandidateType MuonTrackCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 10 of file MuonTrackCut.cc.

10 { return MUON; }

References CutApplicatorBase::MUON.

◆ operator()()

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

Reimplemented from CutApplicatorBase.

Definition at line 61 of file MuonTrackCut.cc.

61  {
62  if (doInnerTrack_) {
63  const reco::TrackRef t = muon->innerTrack();
64  if (t.isNull())
65  return false;
66  const auto& h = t->hitPattern();
68  return false;
69  if (h.trackerLayersWithMeasurement() < minTrackerLayersWithMeasurement_)
70  return false;
71  if (h.pixelLayersWithMeasurement() < minPixelLayersWithMeasurement_)
72  return false;
73  if (h.numberOfValidPixelHits() < minNumberOfValidPixelHits_)
74  return false;
75  if (t->validFraction() <= minValidFraction_)
76  return false;
77  }
78  if (doGlobalTrack_) {
79  const reco::TrackRef t = muon->globalTrack();
80  if (t.isNull())
81  return false;
82  const auto& h = t->hitPattern();
83  if (h.numberOfValidMuonHits() < minNumberOfValidMuonHits_)
84  return false;
85  // if ( t->normalizedChi2() > maxNormalizedChi2_ ) return false; Not used for
86  }
87 
88  return true;
89 }

References doGlobalTrack_, doInnerTrack_, minNumberOfValidMuonHits_, minNumberOfValidPixelHits_, minPixelLayersWithMeasurement_, minTrackerLayersWithMeasurement_, minValidFraction_, submitPVValidationJobs::t, trackQuality_, and reco::TrackBase::undefQuality.

◆ value()

double MuonTrackCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 91 of file MuonTrackCut.cc.

91  {
92  const reco::MuonPtr muon(cand);
93  if (doInnerTrack_) {
94  const reco::TrackRef t = muon->innerTrack();
95  if (t.isNull())
96  return 0;
97  const auto& h = t->hitPattern();
99  return t->quality(trackQuality_);
100  if (h.trackerLayersWithMeasurement() < minTrackerLayersWithMeasurement_)
101  return h.trackerLayersWithMeasurement();
102  if (h.pixelLayersWithMeasurement() < minPixelLayersWithMeasurement_)
103  return h.pixelLayersWithMeasurement();
104  if (h.numberOfValidPixelHits() < minNumberOfValidPixelHits_)
105  return h.numberOfValidPixelHits();
106  if (t->validFraction() <= minValidFraction_)
107  return t->validFraction();
108 
109  return t->validFraction();
110  }
111  if (doGlobalTrack_) {
112  const reco::TrackRef t = muon->globalTrack();
113  if (t.isNull())
114  return 0;
115  const auto& h = t->hitPattern();
116  if (h.numberOfValidMuonHits() < minNumberOfValidMuonHits_)
117  return h.numberOfValidMuonHits();
118  // if ( t->normalizedChi2() > maxNormalizedChi2_ ) return false; Not used for
119 
120  return h.numberOfValidMuonHits();
121  }
122 
123  return 0;
124 }

References doGlobalTrack_, doInnerTrack_, minNumberOfValidMuonHits_, minNumberOfValidPixelHits_, minPixelLayersWithMeasurement_, minTrackerLayersWithMeasurement_, minValidFraction_, HLT_FULL_cff::muon, submitPVValidationJobs::t, trackQuality_, and reco::TrackBase::undefQuality.

Member Data Documentation

◆ doGlobalTrack_

bool MuonTrackCut::doGlobalTrack_
private

Definition at line 20 of file MuonTrackCut.cc.

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

◆ doInnerTrack_

bool MuonTrackCut::doInnerTrack_
private

Definition at line 20 of file MuonTrackCut.cc.

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

◆ minNumberOfValidMuonHits_

int MuonTrackCut::minNumberOfValidMuonHits_
private

Definition at line 18 of file MuonTrackCut.cc.

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

◆ minNumberOfValidPixelHits_

int MuonTrackCut::minNumberOfValidPixelHits_
private

Definition at line 15 of file MuonTrackCut.cc.

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

◆ minPixelLayersWithMeasurement_

int MuonTrackCut::minPixelLayersWithMeasurement_
private

Definition at line 15 of file MuonTrackCut.cc.

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

◆ minTrackerLayersWithMeasurement_

int MuonTrackCut::minTrackerLayersWithMeasurement_
private

Definition at line 15 of file MuonTrackCut.cc.

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

◆ minValidFraction_

double MuonTrackCut::minValidFraction_
private

Definition at line 16 of file MuonTrackCut.cc.

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

◆ trackQuality_

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

Definition at line 17 of file MuonTrackCut.cc.

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

MuonTrackCut::minNumberOfValidMuonHits_
int minNumberOfValidMuonHits_
Definition: MuonTrackCut.cc:18
MuonTrackCut::trackQuality_
reco::Track::TrackQuality trackQuality_
Definition: MuonTrackCut.cc:17
muon
Definition: MuonCocktails.h:17
CutApplicatorBase::CutApplicatorBase
CutApplicatorBase()
Definition: CutApplicatorBase.h:49
reco::TrackBase::undefQuality
Definition: TrackBase.h:151
edm::Ref< TrackCollection >
MuonTrackCut::minValidFraction_
double minValidFraction_
Definition: MuonTrackCut.cc:16
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11776
h
MuonTrackCut::minPixelLayersWithMeasurement_
int minPixelLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
CutApplicatorBase::MUON
Definition: CutApplicatorBase.h:47
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
MuonTrackCut::doGlobalTrack_
bool doGlobalTrack_
Definition: MuonTrackCut.cc:20
cand
Definition: decayParser.h:32
MuonTrackCut::doInnerTrack_
bool doInnerTrack_
Definition: MuonTrackCut.cc:20
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
cc
edm::Ptr< reco::Muon >
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
MuonTrackCut::minNumberOfValidPixelHits_
int minNumberOfValidPixelHits_
Definition: MuonTrackCut.cc:15
MuonTrackCut::minTrackerLayersWithMeasurement_
int minTrackerLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644