CMS 3D CMS Logo

TrackBase.cc
Go to the documentation of this file.
1 #include "Rtypes.h"
4 #include <algorithm>
5 
6 using namespace reco;
7 
8 // To be kept in synch with the enumerator definitions in TrackBase.h file
9 std::string const TrackBase::algoNames[] = {"undefAlgorithm",
10  "ctf",
11  "duplicateMerge",
12  "cosmics",
13  "initialStep",
14  "lowPtTripletStep",
15  "pixelPairStep",
16  "detachedTripletStep",
17  "mixedTripletStep",
18  "pixelLessStep",
19  "tobTecStep",
20  "jetCoreRegionalStep",
21  "conversionStep",
22  "muonSeededStepInOut",
23  "muonSeededStepOutIn",
24  "outInEcalSeededConv",
25  "inOutEcalSeededConv",
26  "nuclInter",
27  "standAloneMuon",
28  "globalMuon",
29  "cosmicStandAloneMuon",
30  "cosmicGlobalMuon",
31  "highPtTripletStep",
32  "lowPtQuadStep",
33  "detachedQuadStep",
34  "reservedForUpgrades1",
35  "reservedForUpgrades2",
36  "bTagGhostTracks",
37  "beamhalo",
38  "gsf",
39  "hltPixel",
40  "hltIter0",
41  "hltIter1",
42  "hltIter2",
43  "hltIter3",
44  "hltIter4",
45  "hltIterX",
46  "hiRegitMuInitialStep",
47  "hiRegitMuLowPtTripletStep",
48  "hiRegitMuPixelPairStep",
49  "hiRegitMuDetachedTripletStep",
50  "hiRegitMuMixedTripletStep",
51  "hiRegitMuPixelLessStep",
52  "hiRegitMuTobTecStep",
53  "hiRegitMuMuonSeededStepInOut",
54  "hiRegitMuMuonSeededStepOutIn"};
55 
57  "loose", "tight", "highPurity", "confirmed", "goodIterative", "looseSetWithPV", "highPuritySetWithPV", "discarded"};
58 
60  : covt0t0_(-1.f),
61  covbetabeta_(-1.f),
62  chi2_(0),
63  vertex_(0, 0, 0),
64  t0_(0),
65  momentum_(0, 0, 0),
66  beta_(0),
67  ndof_(0),
68  charge_(0),
69  algorithm_(undefAlgorithm),
70  originalAlgorithm_(undefAlgorithm),
71  quality_(0),
72  nLoops_(0),
73  stopReason_(0) {
74  algoMask_.set(algorithm_);
75  index idx = 0;
76  for (index i = 0; i < dimension; ++i) {
77  for (index j = 0; j <= i; ++j) {
78  covariance_[idx++] = 0;
79  }
80  }
81 }
82 
84  double ndof,
85  const Point &vertex,
86  const Vector &momentum,
87  int charge,
88  const CovarianceMatrix &cov,
91  signed char nloops,
92  uint8_t stopReason,
93  float t0,
94  float beta,
95  float covt0t0,
96  float covbetabeta)
97  : covt0t0_(covt0t0),
98  covbetabeta_(covbetabeta),
99  chi2_(chi2),
100  vertex_(vertex),
101  t0_(t0),
102  momentum_(momentum),
103  beta_(beta),
104  ndof_(ndof),
105  charge_(charge),
106  algorithm_(algorithm),
107  originalAlgorithm_(algorithm),
108  quality_(0),
109  nLoops_(nloops),
110  stopReason_(stopReason) {
111  algoMask_.set(algorithm_);
112 
113  index idx = 0;
114  for (index i = 0; i < dimension; ++i) {
115  for (index j = 0; j <= i; ++j) {
116  covariance_[idx++] = cov(i, j);
117  }
118  }
120 }
121 
123 
125 
129  if (index == size) {
130  return undefQuality; // better this or throw() ?
131  }
132 
133  // cast
134  return TrackQuality(index);
135 }
136 
140  if (index == size) {
141  return undefAlgorithm; // better this or throw() ?
142  }
143 
144  // cast
145  return TrackAlgorithm(index);
146 }
147 
148 double TrackBase::dxyError(Point const &vtx, math::Error<3>::type const &vertexCov) const {
149  // Gradient of TrackBase::dxy(const Point &myBeamSpot) with respect to track parameters. Using unrolled expressions to avoid calling for higher dimension matrices
150  // ( 0, 0, x_vert * cos(phi) + y_vert * sin(phi), 1, 0 )
151  // Gradient with respect to point parameters
152  // ( sin(phi), -cos(phi))
153  // Propagate covariance assuming cross-terms of the covariance between track and vertex parameters are 0
154  return std::sqrt((vtx.x() * px() + vtx.y() * py()) * (vtx.x() * px() + vtx.y() * py()) / (pt() * pt()) *
156  2 * (vtx.x() * px() + vtx.y() * py()) / pt() * covariance(i_phi, i_dxy) + covariance(i_dxy, i_dxy) +
157  py() * py() / (pt() * pt()) * vertexCov(0, 0) - 2 * py() * px() / (pt() * pt()) * vertexCov(0, 1) +
158  px() * px() / (pt() * pt()) * vertexCov(1, 1));
159 }
reco::TrackBase::setQuality
void setQuality(const TrackQuality)
Definition: TrackBase.h:564
reco::TrackBase::fill
CovarianceMatrix & fill(CovarianceMatrix &v) const
fill SMatrix
Definition: TrackBase.cc:124
reco::TrackBase::index
unsigned int index
index type
Definition: TrackBase.h:86
reco::TrackBase::algorithm_
uint8_t algorithm_
track algorithm
Definition: TrackBase.h:487
mps_fire.i
i
Definition: mps_fire.py:428
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
reco::TrackBase::i_phi
Definition: TrackBase.h:83
TrackBase.h
zMuMuMuonUserData.beta
beta
Definition: zMuMuMuonUserData.py:10
reco::TrackBase::undefQuality
Definition: TrackBase.h:151
reco::TrackBase::TrackAlgorithm
TrackAlgorithm
track algorithm
Definition: TrackBase.h:89
reco::TrackBase::TrackBase
TrackBase()
default constructor
Definition: TrackBase.cc:59
reco::TrackBase::i_dxy
Definition: TrackBase.h:83
reco::TrackBase::TrackQuality
TrackQuality
track quality
Definition: TrackBase.h:150
reco::TrackBase::px
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:640
CovarianceMatrix
Definition: CovarianceMatrix.h:27
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
findQualityFiles.v
v
Definition: findQualityFiles.py:179
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
reco::TrackBase::dxyError
double dxyError() const
error on dxy
Definition: TrackBase.h:769
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
ndof
Definition: HIMultiTrackSelector.h:49
reco::TrackBase::pt
double pt() const
track transverse momentum
Definition: TrackBase.h:637
reco::TrackBase::dimension
Definition: TrackBase.h:65
reco::TrackBase::py
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:643
FrontierCondition_GT_autoExpress_cfi.t0
t0
Definition: FrontierCondition_GT_autoExpress_cfi.py:148
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::fillCovariance
PerigeeCovarianceMatrix & fillCovariance(PerigeeCovarianceMatrix &v, const float *data)
Definition: fillCovariance.cc:5
reco::TrackBase::covariance
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
TrackQuality
This class analyses the reconstruction quality for a given track.
Definition: TrackQuality.h:28
ntupleEnum.undefAlgorithm
undefAlgorithm
Definition: ntupleEnum.py:27
reco::TrackBase::qualitySize
Definition: TrackBase.h:160
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
reco::TrackBase::algoMask_
std::bitset< algoSize > algoMask_
algo mask, bit set for the algo where it was reconstructed + each algo a track was found overlapping ...
Definition: TrackBase.h:478
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
reco::TrackBase::~TrackBase
virtual ~TrackBase()
virtual destructor
Definition: TrackBase.cc:122
qcdUeDQM_cfi.algorithm
algorithm
Definition: qcdUeDQM_cfi.py:32
reco::TrackBase::undefAlgorithm
Definition: TrackBase.h:90
reco::TrackBase::covariance_
float covariance_[covarianceSize]
perigee 5x5 covariance matrix
Definition: TrackBase.h:456
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
reco::TrackBase::qualityNames
static const std::string qualityNames[]
Definition: TrackBase.h:163
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
reco::TrackBase::algoSize
Definition: TrackBase.h:141
math::Error::type
ErrorD< N >::type type
Definition: Error.h:32
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
fillCovariance.h
reco::TrackBase::algoByName
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:137
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
reco::TrackBase::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:74
reco::TrackBase::algoNames
static const std::string algoNames[]
Definition: TrackBase.h:147
reco::TrackBase::quality
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
reco::TrackBase::Vector
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443