CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
reco::TrackSelector Class Reference

#include <TrackSelector.h>

Public Member Functions

bool operator() (const reco::Track &track, const reco::btag::TrackIPData &ipData, const reco::Jet &jet, const GlobalPoint &pv) const
 
bool operator() (const reco::CandidatePtr &track, const reco::btag::TrackIPData &ipData, const reco::Jet &jet, const GlobalPoint &pv) const
 
bool operator() (const reco::TrackRef &track, const reco::btag::TrackIPData &ipData, const reco::Jet &jet, const GlobalPoint &pv) const
 
 TrackSelector (const edm::ParameterSet &params)
 
 ~TrackSelector ()
 

Private Member Functions

bool trackSelection (const reco::Track &track, const reco::btag::TrackIPData &ipData, const reco::Jet &jet, const GlobalPoint &pv) const
 

Private Attributes

double maxDecayLen
 
double maxDistToAxis
 
double maxJetDeltaR
 
double maxNormChi2
 
unsigned int minPixelHits
 
double minPt
 
unsigned int minTotalHits
 
reco::TrackBase::TrackQuality quality
 
bool selectQuality
 
double sip2dSigMax
 
double sip2dSigMin
 
double sip2dValMax
 
double sip2dValMin
 
double sip3dSigMax
 
double sip3dSigMin
 
double sip3dValMax
 
double sip3dValMin
 
bool useVariableJTA_
 
reco::btag::variableJTAParameters varJTApars
 

Detailed Description

Definition at line 14 of file TrackSelector.h.

Constructor & Destructor Documentation

◆ TrackSelector()

TrackSelector::TrackSelector ( const edm::ParameterSet params)

Definition at line 11 of file TrackSelector.cc.

References submitPVValidationJobs::params, quality, reco::TrackBase::qualityByName(), HLT_2022v15_cff::qualityClass, selectQuality, AlCaHLTBitMon_QueryRunRegistry::string, reco::TrackBase::undefQuality, useVariableJTA_, and varJTApars.

12  : minPixelHits(params.getParameter<unsigned int>("pixelHitsMin")),
13  minTotalHits(params.getParameter<unsigned int>("totalHitsMin")),
14  minPt(params.getParameter<double>("ptMin")),
15  maxNormChi2(params.getParameter<double>("normChi2Max")),
16  maxJetDeltaR(params.getParameter<double>("jetDeltaRMax")),
17  maxDistToAxis(params.getParameter<double>("maxDistToAxis")),
18  maxDecayLen(params.getParameter<double>("maxDecayLen")),
19  sip2dValMin(params.getParameter<double>("sip2dValMin")),
20  sip2dValMax(params.getParameter<double>("sip2dValMax")),
21  sip2dSigMin(params.getParameter<double>("sip2dSigMin")),
22  sip2dSigMax(params.getParameter<double>("sip2dSigMax")),
23  sip3dValMin(params.getParameter<double>("sip3dValMin")),
24  sip3dValMax(params.getParameter<double>("sip3dValMax")),
25  sip3dSigMin(params.getParameter<double>("sip3dSigMin")),
26  sip3dSigMax(params.getParameter<double>("sip3dSigMax")),
27  useVariableJTA_(params.existsAs<bool>("useVariableJTA") ? params.getParameter<bool>("useVariableJTA") : false) {
28  std::string qualityClass = params.getParameter<std::string>("qualityClass");
29  if (qualityClass == "any" || qualityClass == "Any" || qualityClass == "ANY" || qualityClass.empty()) {
30  selectQuality = false;
32  } else {
33  selectQuality = true;
35  }
36  if (useVariableJTA_) {
37  varJTApars = {params.getParameter<double>("a_dR"),
38  params.getParameter<double>("b_dR"),
39  params.getParameter<double>("a_pT"),
40  params.getParameter<double>("b_pT"),
41  params.getParameter<double>("min_pT"),
42  params.getParameter<double>("max_pT"),
43  params.getParameter<double>("min_pT_dRcut"),
44  params.getParameter<double>("max_pT_dRcut"),
45  params.getParameter<double>("max_pT_trackPTcut")};
46  }
47 }
reco::TrackBase::TrackQuality quality
Definition: TrackSelector.h:43
reco::btag::variableJTAParameters varJTApars
Definition: TrackSelector.h:60
unsigned int minPixelHits
Definition: TrackSelector.h:44
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
unsigned int minTotalHits
Definition: TrackSelector.h:45

◆ ~TrackSelector()

reco::TrackSelector::~TrackSelector ( )
inline

Definition at line 17 of file TrackSelector.h.

17 {}

Member Function Documentation

◆ operator()() [1/3]

bool TrackSelector::operator() ( const reco::Track track,
const reco::btag::TrackIPData ipData,
const reco::Jet jet,
const GlobalPoint pv 
) const

Definition at line 49 of file TrackSelector.cc.

References reco::deltaR(), reco::deltaR2(), metsig::jet, maxJetDeltaR, minPt, reco::IPTagInfo< Container, Base >::passVariableJTA(), HLT_2022v15_cff::track, trackSelection(), useVariableJTA_, and varJTApars.

52  {
53  bool jtaPassed = false;
54  if (useVariableJTA_) {
56  varJTApars, jet.pt(), track.pt(), reco::deltaR(jet.momentum(), track.momentum()));
57  } else
58  jtaPassed = true;
59 
60  return track.pt() >= minPt && reco::deltaR2(jet.momentum(), track.momentum()) < maxJetDeltaR * maxJetDeltaR &&
61  jtaPassed && trackSelection(track, ipData, jet, pv);
62 }
reco::btag::variableJTAParameters varJTApars
Definition: TrackSelector.h:60
static bool passVariableJTA(const btag::variableJTAParameters &params, double jetpt, double trackpt, double jettrackdr)
Definition: IPTagInfo.h:295
bool trackSelection(const reco::Track &track, const reco::btag::TrackIPData &ipData, const reco::Jet &jet, const GlobalPoint &pv) const
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16

◆ operator()() [2/3]

bool TrackSelector::operator() ( const reco::CandidatePtr track,
const reco::btag::TrackIPData ipData,
const reco::Jet jet,
const GlobalPoint pv 
) const

Definition at line 64 of file TrackSelector.cc.

References reco::deltaR(), reco::deltaR2(), metsig::jet, maxJetDeltaR, minPt, reco::IPTagInfo< Container, Base >::passVariableJTA(), MetAnalyzer::pv(), reco::btag::toTrack(), HLT_2022v15_cff::track, trackSelection(), useVariableJTA_, and varJTApars.

67  {
68  bool jtaPassed = false;
69  if (useVariableJTA_) {
71  varJTApars, jet.pt(), track->pt(), reco::deltaR(jet.momentum(), track->momentum()));
72  } else
73  jtaPassed = true;
74 
75  return track->pt() >= minPt && reco::deltaR2(jet.momentum(), track->momentum()) < maxJetDeltaR * maxJetDeltaR &&
76  jtaPassed && trackSelection(*reco::btag::toTrack(track), ipData, jet, pv);
77 }
const reco::Track * toTrack(const reco::TrackBaseRef &t)
Definition: IPTagInfo.h:24
reco::btag::variableJTAParameters varJTApars
Definition: TrackSelector.h:60
static bool passVariableJTA(const btag::variableJTAParameters &params, double jetpt, double trackpt, double jettrackdr)
Definition: IPTagInfo.h:295
bool trackSelection(const reco::Track &track, const reco::btag::TrackIPData &ipData, const reco::Jet &jet, const GlobalPoint &pv) const
def pv(vc)
Definition: MetAnalyzer.py:7
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16

◆ operator()() [3/3]

bool reco::TrackSelector::operator() ( const reco::TrackRef track,
const reco::btag::TrackIPData ipData,
const reco::Jet jet,
const GlobalPoint pv 
) const
inline

Definition at line 29 of file TrackSelector.h.

References metsig::jet, MetAnalyzer::pv(), and HLT_2022v15_cff::track.

32  {
33  return (*this)(*track, ipData, jet, pv);
34  }
def pv(vc)
Definition: MetAnalyzer.py:7

◆ trackSelection()

bool TrackSelector::trackSelection ( const reco::Track track,
const reco::btag::TrackIPData ipData,
const reco::Jet jet,
const GlobalPoint pv 
) const
private

Definition at line 79 of file TrackSelector.cc.

References funct::abs(), reco::btag::TrackIPData::closestToJetAxis, reco::btag::TrackIPData::distanceToJetAxis, createfilelist::int, reco::btag::TrackIPData::ip2d, reco::btag::TrackIPData::ip3d, maxDecayLen, maxDistToAxis, maxNormChi2, minPixelHits, minTotalHits, quality, selectQuality, Measurement1D::significance(), sip2dSigMax, sip2dSigMin, sip2dValMax, sip2dValMin, sip3dSigMax, sip3dSigMin, sip3dValMax, sip3dValMin, HLT_2022v15_cff::track, and Measurement1D::value().

Referenced by operator()().

82  {
83  return (!selectQuality || track.quality(quality)) &&
84  (minPixelHits <= 0 || track.hitPattern().numberOfValidPixelHits() >= (int)minPixelHits) &&
85  (minTotalHits <= 0 || track.hitPattern().numberOfValidHits() >= (int)minTotalHits) &&
86  track.normalizedChi2() < maxNormChi2 && std::abs(ipData.distanceToJetAxis.value()) <= maxDistToAxis &&
87  (ipData.closestToJetAxis - pv).mag() <= maxDecayLen && ipData.ip2d.value() >= sip2dValMin &&
88  ipData.ip2d.value() <= sip2dValMax && ipData.ip2d.significance() >= sip2dSigMin &&
89  ipData.ip2d.significance() <= sip2dSigMax && ipData.ip3d.value() >= sip3dValMin &&
90  ipData.ip3d.value() <= sip3dValMax && ipData.ip3d.significance() >= sip3dSigMin &&
91  ipData.ip3d.significance() <= sip3dSigMax;
92 }
Measurement1D ip2d
Definition: IPTagInfo.h:31
reco::TrackBase::TrackQuality quality
Definition: TrackSelector.h:43
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int minPixelHits
Definition: TrackSelector.h:44
Measurement1D ip3d
Definition: IPTagInfo.h:32
GlobalPoint closestToJetAxis
Definition: IPTagInfo.h:29
Measurement1D distanceToJetAxis
Definition: IPTagInfo.h:33
double value() const
Definition: Measurement1D.h:25
double significance() const
Definition: Measurement1D.h:29
unsigned int minTotalHits
Definition: TrackSelector.h:45

Member Data Documentation

◆ maxDecayLen

double reco::TrackSelector::maxDecayLen
private

Definition at line 50 of file TrackSelector.h.

Referenced by trackSelection().

◆ maxDistToAxis

double reco::TrackSelector::maxDistToAxis
private

Definition at line 49 of file TrackSelector.h.

Referenced by trackSelection().

◆ maxJetDeltaR

double reco::TrackSelector::maxJetDeltaR
private

Definition at line 48 of file TrackSelector.h.

Referenced by operator()().

◆ maxNormChi2

double reco::TrackSelector::maxNormChi2
private

Definition at line 47 of file TrackSelector.h.

Referenced by trackSelection().

◆ minPixelHits

unsigned int reco::TrackSelector::minPixelHits
private

Definition at line 44 of file TrackSelector.h.

Referenced by trackSelection().

◆ minPt

double reco::TrackSelector::minPt
private

Definition at line 46 of file TrackSelector.h.

Referenced by operator()().

◆ minTotalHits

unsigned int reco::TrackSelector::minTotalHits
private

Definition at line 45 of file TrackSelector.h.

Referenced by trackSelection().

◆ quality

reco::TrackBase::TrackQuality reco::TrackSelector::quality
private

Definition at line 43 of file TrackSelector.h.

Referenced by trackSelection(), and TrackSelector().

◆ selectQuality

bool reco::TrackSelector::selectQuality
private

Definition at line 42 of file TrackSelector.h.

Referenced by trackSelection(), and TrackSelector().

◆ sip2dSigMax

double reco::TrackSelector::sip2dSigMax
private

Definition at line 54 of file TrackSelector.h.

Referenced by trackSelection().

◆ sip2dSigMin

double reco::TrackSelector::sip2dSigMin
private

Definition at line 53 of file TrackSelector.h.

Referenced by trackSelection().

◆ sip2dValMax

double reco::TrackSelector::sip2dValMax
private

Definition at line 52 of file TrackSelector.h.

Referenced by trackSelection().

◆ sip2dValMin

double reco::TrackSelector::sip2dValMin
private

Definition at line 51 of file TrackSelector.h.

Referenced by trackSelection().

◆ sip3dSigMax

double reco::TrackSelector::sip3dSigMax
private

Definition at line 58 of file TrackSelector.h.

Referenced by trackSelection().

◆ sip3dSigMin

double reco::TrackSelector::sip3dSigMin
private

Definition at line 57 of file TrackSelector.h.

Referenced by trackSelection().

◆ sip3dValMax

double reco::TrackSelector::sip3dValMax
private

Definition at line 56 of file TrackSelector.h.

Referenced by trackSelection().

◆ sip3dValMin

double reco::TrackSelector::sip3dValMin
private

Definition at line 55 of file TrackSelector.h.

Referenced by trackSelection().

◆ useVariableJTA_

bool reco::TrackSelector::useVariableJTA_
private

Definition at line 59 of file TrackSelector.h.

Referenced by operator()(), and TrackSelector().

◆ varJTApars

reco::btag::variableJTAParameters reco::TrackSelector::varJTApars
private

Definition at line 60 of file TrackSelector.h.

Referenced by operator()(), and TrackSelector().