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
10  "undefAlgorithm",
11  "ctf",
12  "duplicateMerge",
13  "cosmics",
14  "initialStep",
15  "lowPtTripletStep",
16  "pixelPairStep",
17  "detachedTripletStep",
18  "mixedTripletStep",
19  "pixelLessStep",
20  "tobTecStep",
21  "jetCoreRegionalStep",
22  "conversionStep",
23  "muonSeededStepInOut",
24  "muonSeededStepOutIn",
25  "outInEcalSeededConv",
26  "inOutEcalSeededConv",
27  "nuclInter",
28  "standAloneMuon",
29  "globalMuon",
30  "cosmicStandAloneMuon",
31  "cosmicGlobalMuon",
32  "highPtTripletStep",
33  "lowPtQuadStep",
34  "detachedQuadStep",
35  "reservedForUpgrades1",
36  "reservedForUpgrades2",
37  "bTagGhostTracks",
38  "beamhalo" ,
39  "gsf",
40  "hltPixel",
41  "hltIter0",
42  "hltIter1",
43  "hltIter2",
44  "hltIter3",
45  "hltIter4",
46  "hltIterX",
47  "hiRegitMuInitialStep",
48  "hiRegitMuLowPtTripletStep",
49  "hiRegitMuPixelPairStep",
50  "hiRegitMuDetachedTripletStep",
51  "hiRegitMuMixedTripletStep",
52  "hiRegitMuPixelLessStep",
53  "hiRegitMuTobTecStep",
54  "hiRegitMuMuonSeededStepInOut",
55  "hiRegitMuMuonSeededStepOutIn"
56 };
57 
59  "loose",
60  "tight",
61  "highPurity",
62  "confirmed",
63  "goodIterative",
64  "looseSetWithPV",
65  "highPuritySetWithPV",
66  "discarded"
67 };
68 
70  chi2_(0),
71  vertex_(0, 0, 0),
72  momentum_(0, 0, 0),
73  ndof_(0),
74  charge_(0),
75  algorithm_(undefAlgorithm),
76  originalAlgorithm_(undefAlgorithm),
77  quality_(0),
78  nLoops_(0),
79  stopReason_(0)
80 {
81  algoMask_.set(algorithm_);
82  index idx = 0;
83  for (index i = 0; i < dimension; ++i) {
84  for (index j = 0; j <= i; ++j) {
85  covariance_[idx++] = 0;
86  }
87  }
88 }
89 
90 TrackBase::TrackBase(double chi2, double ndof, const Point &vertex, const Vector &momentum,
92  TrackQuality quality, signed char nloops, uint8_t stopReason):
93  chi2_(chi2),
94  vertex_(vertex),
95  momentum_(momentum),
96  ndof_(ndof),
97  charge_(charge),
98  algorithm_(algorithm),
99  originalAlgorithm_(algorithm),
100  quality_(0),
101  nLoops_(nloops),
102  stopReason_(stopReason)
103 {
104  algoMask_.set(algorithm_);
105 
106  index idx = 0;
107  for (index i = 0; i < dimension; ++i) {
108  for (index j = 0; j <= i; ++j) {
109  covariance_[idx++] = cov(i, j);
110  }
111  }
112  setQuality(quality);
113 }
114 
116 {
117  ;
118 }
119 
121 {
122  return fillCovariance(v, covariance_);
123 }
124 
126 {
128  int index = std::find(qualityNames, qualityNames + size, name) - qualityNames;
129  if (index == size) {
130  return undefQuality; // better this or throw() ?
131  }
132 
133  // cast
134  return TrackQuality(index);
135 }
136 
138 {
140  int index = std::find(algoNames, algoNames + size, name) - algoNames;
141  if (index == size) {
142  return undefAlgorithm; // better this or throw() ?
143  }
144 
145  // cast
146  return TrackAlgorithm(index);
147 }
size
Write out results.
uint8_t stopReason_
Stop Reason.
Definition: TrackBase.h:441
float chi2_
chi-squared
Definition: TrackBase.h:410
int i
Definition: DBlmapReader.cc:9
void setQuality(const TrackQuality)
Definition: TrackBase.h:518
unsigned int index
index type
Definition: TrackBase.h:95
uint8_t quality_
track quality
Definition: TrackBase.h:435
uint8_t originalAlgorithm_
track algorithm
Definition: TrackBase.h:431
TrackBase()
default constructor
Definition: TrackBase.cc:69
TrackQuality
track quality
Definition: TrackBase.h:151
char charge_
electric charge
Definition: TrackBase.h:425
Point vertex_
innermost (reference) point on track
Definition: TrackBase.h:413
uint8_t stopReason() const
Definition: TrackBase.h:399
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:670
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
signed char nLoops_
number of loops made during the building of the trajectory of a looper particle
Definition: TrackBase.h:438
TrackAlgorithm
track algorithm
Definition: TrackBase.h:99
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:682
static const std::string qualityNames[]
Definition: TrackBase.h:164
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:544
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:419
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:550
PerigeeCovarianceMatrix & fillCovariance(PerigeeCovarianceMatrix &v, const float *data)
int j
Definition: DBlmapReader.cc:9
math::XYZPoint Point
point in the space
Definition: TrackBase.h:83
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
virtual ~TrackBase()
virtual destructor
Definition: TrackBase.cc:115
This class analyses the reconstruction quality for a given track.
Definition: TrackQuality.h:28
float ndof_
number of degrees of freedom
Definition: TrackBase.h:422
static const std::string algoNames[]
Definition: TrackBase.h:148
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
fixed size matrix
float covariance_[covarianceSize]
perigee 5x5 covariance matrix
Definition: TrackBase.h:407
CovarianceMatrix & fill(CovarianceMatrix &v) const
fill SMatrix
Definition: TrackBase.cc:120
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:137
Vector momentum_
momentum vector at innermost point
Definition: TrackBase.h:416
int charge() const
track electric charge
Definition: TrackBase.h:562
uint8_t algorithm_
track algorithm
Definition: TrackBase.h:428
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:80
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:77