CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
int i
Definition: DBlmapReader.cc:9
void setQuality(const TrackQuality)
Definition: TrackBase.h:518
unsigned int index
index type
Definition: TrackBase.h:95
TrackBase()
default constructor
Definition: TrackBase.cc:69
TrackQuality
track quality
Definition: TrackBase.h:151
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
TrackAlgorithm
track algorithm
Definition: TrackBase.h:99
static const std::string qualityNames[]
Definition: TrackBase.h:164
tuple quality
[pTError/pT]*max(1,normChi2) &lt;= ptErrorCut
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
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
static const std::string algoNames[]
Definition: TrackBase.h:148
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
uint8_t algorithm_
track algorithm
Definition: TrackBase.h:428
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:80
tuple size
Write out results.
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:77