CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
reco::TrackSelector Class Reference

#include <TrackSelector.h>

Public Member Functions

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

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::TrackIPTagInfo::variableJTAParameters varJTApars
 

Detailed Description

Definition at line 13 of file TrackSelector.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file TrackSelector.cc.

References edm::ParameterSet::getParameter(), quality, reco::TrackBase::qualityByName(), selectQuality, AlCaHLTBitMon_QueryRunRegistry::string, reco::TrackBase::undefQuality, useVariableJTA_, and varJTApars.

16  :
17  minPixelHits(params.getParameter<unsigned int>("pixelHitsMin")),
18  minTotalHits(params.getParameter<unsigned int>("totalHitsMin")),
19  minPt(params.getParameter<double>("ptMin")),
20  maxNormChi2(params.getParameter<double>("normChi2Max")),
21  maxJetDeltaR(params.getParameter<double>("jetDeltaRMax")),
22  maxDistToAxis(params.getParameter<double>("maxDistToAxis")),
23  maxDecayLen(params.getParameter<double>("maxDecayLen")),
24  sip2dValMin(params.getParameter<double>("sip2dValMin")),
25  sip2dValMax(params.getParameter<double>("sip2dValMax")),
26  sip2dSigMin(params.getParameter<double>("sip2dSigMin")),
27  sip2dSigMax(params.getParameter<double>("sip2dSigMax")),
28  sip3dValMin(params.getParameter<double>("sip3dValMin")),
29  sip3dValMax(params.getParameter<double>("sip3dValMax")),
30  sip3dSigMin(params.getParameter<double>("sip3dSigMin")),
31  sip3dSigMax(params.getParameter<double>("sip3dSigMax")),
32  useVariableJTA_(params.existsAs<bool>("useVariableJTA") ? params.getParameter<bool>("useVariableJTA") : false)
33 {
34  std::string qualityClass =
35  params.getParameter<std::string>("qualityClass");
36  if (qualityClass == "any" || qualityClass == "Any" ||
37  qualityClass == "ANY" || qualityClass == "") {
38  selectQuality = false;
40  } else {
41  selectQuality = true;
43  }
44  if (useVariableJTA_){
45  varJTApars = {
46  params.getParameter<double>("a_dR"),
47  params.getParameter<double>("b_dR"),
48  params.getParameter<double>("a_pT"),
49  params.getParameter<double>("b_pT"),
50  params.getParameter<double>("min_pT"),
51  params.getParameter<double>("max_pT"),
52  params.getParameter<double>("min_pT_dRcut"),
53  params.getParameter<double>("max_pT_dRcut"),
54  params.getParameter<double>("max_pT_trackPTcut") };
55  }
56 }
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:187
reco::TrackBase::TrackQuality quality
Definition: TrackSelector.h:25
unsigned int minPixelHits
Definition: TrackSelector.h:26
reco::TrackIPTagInfo::variableJTAParameters varJTApars
Definition: TrackSelector.h:42
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
unsigned int minTotalHits
Definition: TrackSelector.h:27
reco::TrackSelector::~TrackSelector ( )
inline

Definition at line 16 of file TrackSelector.h.

16 {}

Member Function Documentation

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

Definition at line 59 of file TrackSelector.cc.

References abs, reco::TrackIPTagInfo::TrackIPData::closestToJetAxis, reco::TrackIPTagInfo::TrackIPData::distanceToJetAxis, reco::TrackBase::hitPattern(), reco::TrackIPTagInfo::TrackIPData::ip2d, reco::TrackIPTagInfo::TrackIPData::ip3d, maxDecayLen, maxDistToAxis, maxJetDeltaR, maxNormChi2, minPixelHits, minPt, minTotalHits, reco::LeafCandidate::momentum(), reco::TrackBase::momentum(), reco::TrackBase::normalizedChi2(), reco::HitPattern::numberOfValidHits(), reco::HitPattern::numberOfValidPixelHits(), reco::TrackIPTagInfo::passVariableJTA(), reco::TrackBase::pt(), reco::LeafCandidate::pt(), quality, reco::TrackBase::quality(), selectQuality, Measurement1D::significance(), sip2dSigMax, sip2dSigMin, sip2dValMax, sip2dValMin, sip3dSigMax, sip3dSigMin, sip3dValMax, sip3dValMin, useVariableJTA_, Measurement1D::value(), and varJTApars.

63 {
64 
65 
66  bool jtaPassed = false;
67  if (useVariableJTA_) {
69  jet.pt(),track.pt(),
70  VectorUtil::DeltaR(jet.momentum(),track.momentum()));
71  }
72  else jtaPassed = true;
73 
74  return (!selectQuality || track.quality(quality)) &&
75  (minPixelHits <= 0 ||
76  track.hitPattern().numberOfValidPixelHits() >= (int)minPixelHits) &&
77  (minTotalHits <= 0 ||
78  track.hitPattern().numberOfValidHits() >= (int)minTotalHits) &&
79  track.pt() >= minPt &&
80  track.normalizedChi2() < maxNormChi2 &&
81  VectorUtil::DeltaR(jet.momentum(),
82  track.momentum()) < maxJetDeltaR &&
83  jtaPassed &&
85  (ipData.closestToJetAxis - pv).mag() <= maxDecayLen &&
86  ipData.ip2d.value() >= sip2dValMin &&
87  ipData.ip2d.value() <= sip2dValMax &&
88  ipData.ip2d.significance() >= sip2dSigMin &&
89  ipData.ip2d.significance() <= sip2dSigMax &&
90  ipData.ip3d.value() >= sip3dValMin &&
91  ipData.ip3d.value() <= sip3dValMax &&
92  ipData.ip3d.significance() >= sip3dSigMin &&
93  ipData.ip3d.significance() <= sip3dSigMax;
94 }
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:150
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:111
int numberOfValidHits() const
Definition: HitPattern.h:570
#define abs(x)
Definition: mlp_lapack.h:159
reco::TrackBase::TrackQuality quality
Definition: TrackSelector.h:25
double pt() const
track transverse momentum
Definition: TrackBase.h:131
static bool passVariableJTA(const variableJTAParameters &params, double jetpt, double trackpt, double jettrackdr)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:223
unsigned int minPixelHits
Definition: TrackSelector.h:26
reco::TrackIPTagInfo::variableJTAParameters varJTApars
Definition: TrackSelector.h:42
double significance() const
Definition: Measurement1D.h:32
virtual Vector momentum() const GCC11_FINAL
spatial momentum vector
double value() const
Definition: Measurement1D.h:28
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:377
int numberOfValidPixelHits() const
Definition: HitPattern.h:582
virtual float pt() const GCC11_FINAL
transverse momentum
unsigned int minTotalHits
Definition: TrackSelector.h:27

Member Data Documentation

double reco::TrackSelector::maxDecayLen
private

Definition at line 32 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::maxDistToAxis
private

Definition at line 31 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::maxJetDeltaR
private

Definition at line 30 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::maxNormChi2
private

Definition at line 29 of file TrackSelector.h.

Referenced by operator()().

unsigned int reco::TrackSelector::minPixelHits
private

Definition at line 26 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::minPt
private

Definition at line 28 of file TrackSelector.h.

Referenced by operator()().

unsigned int reco::TrackSelector::minTotalHits
private

Definition at line 27 of file TrackSelector.h.

Referenced by operator()().

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

Definition at line 25 of file TrackSelector.h.

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

bool reco::TrackSelector::selectQuality
private

Definition at line 24 of file TrackSelector.h.

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

double reco::TrackSelector::sip2dSigMax
private

Definition at line 36 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::sip2dSigMin
private

Definition at line 35 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::sip2dValMax
private

Definition at line 34 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::sip2dValMin
private

Definition at line 33 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::sip3dSigMax
private

Definition at line 40 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::sip3dSigMin
private

Definition at line 39 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::sip3dValMax
private

Definition at line 38 of file TrackSelector.h.

Referenced by operator()().

double reco::TrackSelector::sip3dValMin
private

Definition at line 37 of file TrackSelector.h.

Referenced by operator()().

bool reco::TrackSelector::useVariableJTA_
private

Definition at line 41 of file TrackSelector.h.

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

reco::TrackIPTagInfo::variableJTAParameters reco::TrackSelector::varJTApars
private

Definition at line 42 of file TrackSelector.h.

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