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
 
const std::string & name () const override
 
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
 
 ~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.

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

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool exists(std::string const &parameterName) const
checks if a parameter exists
int minNumberOfValidPixelHits_
Definition: MuonTrackCut.cc:15
int minNumberOfValidMuonHits_
Definition: MuonTrackCut.cc:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
int minTrackerLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
reco::Track::TrackQuality trackQuality_
Definition: MuonTrackCut.cc:17
double minValidFraction_
Definition: MuonTrackCut.cc:16
bool doInnerTrack_
Definition: MuonTrackCut.cc:20
int minPixelLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
bool doGlobalTrack_
Definition: MuonTrackCut.cc:20

Member Function Documentation

◆ candidateType()

CandidateType MuonTrackCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 10 of file MuonTrackCut.cc.

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.

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

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 }
int minNumberOfValidPixelHits_
Definition: MuonTrackCut.cc:15
int minNumberOfValidMuonHits_
Definition: MuonTrackCut.cc:18
int minTrackerLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
reco::Track::TrackQuality trackQuality_
Definition: MuonTrackCut.cc:17
double minValidFraction_
Definition: MuonTrackCut.cc:16
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
bool doInnerTrack_
Definition: MuonTrackCut.cc:20
int minPixelLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
bool doGlobalTrack_
Definition: MuonTrackCut.cc:20

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 91 of file MuonTrackCut.cc.

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

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 }
int minNumberOfValidPixelHits_
Definition: MuonTrackCut.cc:15
int minNumberOfValidMuonHits_
Definition: MuonTrackCut.cc:18
int minTrackerLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
reco::Track::TrackQuality trackQuality_
Definition: MuonTrackCut.cc:17
double minValidFraction_
Definition: MuonTrackCut.cc:16
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
bool doInnerTrack_
Definition: MuonTrackCut.cc:20
int minPixelLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
bool doGlobalTrack_
Definition: MuonTrackCut.cc:20

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().