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  "rs",
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  "iter1LargeD0",
33  "iter2LargeD0",
34  "iter3LargeD0",
35  "iter4LargeD0",
36  "iter5LargeD0",
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 {
80  algoMask_.set(algorithm_);
81  index idx = 0;
82  for (index i = 0; i < dimension; ++i) {
83  for (index j = 0; j <= i; ++j) {
84  covariance_[idx++] = 0;
85  }
86  }
87 }
88 
89 TrackBase::TrackBase(double chi2, double ndof, const Point &vertex, const Vector &momentum,
91  TrackQuality quality, signed char nloops):
92  chi2_(chi2),
93  vertex_(vertex),
94  momentum_(momentum),
95  ndof_(ndof),
96  charge_(charge),
97  algorithm_(algorithm),
98  originalAlgorithm_(algorithm),
99  quality_(0),
100  nLoops_(nloops)
101 {
102  algoMask_.set(algorithm_);
103 
104  index idx = 0;
105  for (index i = 0; i < dimension; ++i) {
106  for (index j = 0; j <= i; ++j) {
107  covariance_[idx++] = cov(i, j);
108  }
109  }
110  setQuality(quality);
111 }
112 
114 {
115  ;
116 }
117 
119 {
120  return fillCovariance(v, covariance_);
121 }
122 
124 {
126  int index = std::find(qualityNames, qualityNames + size, name) - qualityNames;
127  if (index == size) {
128  return undefQuality; // better this or throw() ?
129  }
130 
131  // cast
132  return TrackQuality(index);
133 }
134 
136 {
138  int index = std::find(algoNames, algoNames + size, name) - algoNames;
139  if (index == size) {
140  return undefAlgorithm; // better this or throw() ?
141  }
142 
143  // cast
144  return TrackAlgorithm(index);
145 }
int i
Definition: DBlmapReader.cc:9
void setQuality(const TrackQuality)
Definition: TrackBase.h:486
unsigned int index
index type
Definition: TrackBase.h:95
TrackBase()
default constructor
Definition: TrackBase.cc:69
TrackQuality
track quality
Definition: TrackBase.h:149
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:162
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:398
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:123
virtual ~TrackBase()
virtual destructor
Definition: TrackBase.cc:113
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
This class analyses the reconstruction quality for a given track.
Definition: TrackQuality.h:28
static const std::string algoNames[]
Definition: TrackBase.h:146
float covariance_[covarianceSize]
perigee 5x5 covariance matrix
Definition: TrackBase.h:386
CovarianceMatrix & fill(CovarianceMatrix &v) const
fill SMatrix
Definition: TrackBase.cc:118
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:135
uint8_t algorithm_
track algorithm
Definition: TrackBase.h:407
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