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 };
48 
50  "loose",
51  "tight",
52  "highPurity",
53  "confirmed",
54  "goodIterative",
55  "looseSetWithPV",
56  "highPuritySetWithPV"
57 };
58 
60  chi2_(0),
61  vertex_(0, 0, 0),
62  momentum_(0, 0, 0),
63  ndof_(0),
64  charge_(0),
65  algorithm_(undefAlgorithm),
66  quality_(0),
67  nLoops_(0)
68 {
69  index idx = 0;
70  for (index i = 0; i < dimension; ++i) {
71  for (index j = 0; j <= i; ++j) {
72  covariance_[idx++] = 0;
73  }
74  }
75 }
76 
77 TrackBase::TrackBase(double chi2, double ndof, const Point &vertex, const Vector &momentum,
78  int charge, const CovarianceMatrix &cov, TrackAlgorithm algorithm,
79  TrackQuality quality, signed char nloops):
80  chi2_(chi2),
81  vertex_(vertex),
82  momentum_(momentum),
83  ndof_(ndof),
84  charge_(charge),
85  algorithm_(algorithm),
86  quality_(0),
87  nLoops_(nloops)
88 {
89  index idx = 0;
90  for (index i = 0; i < dimension; ++i) {
91  for (index j = 0; j <= i; ++j) {
92  covariance_[idx++] = cov(i, j);
93  }
94  }
95  setQuality(quality);
96 }
97 
99 {
100  ;
101 }
102 
104 {
105  return fillCovariance(v, covariance_);
106 }
107 
109 {
111  int index = std::find(qualityNames, qualityNames + size, name) - qualityNames;
112  if (index == size) {
113  return undefQuality; // better this or throw() ?
114  }
115 
116  // cast
117  return TrackQuality(index);
118 }
119 
121 {
123  int index = std::find(algoNames, algoNames + size, name) - algoNames;
124  if (index == size) {
125  return undefAlgorithm; // better this or throw() ?
126  }
127 
128  // cast
129  return TrackAlgorithm(index);
130 }
int i
Definition: DBlmapReader.cc:9
unsigned int index
index type
Definition: TrackBase.h:94
TrackBase()
default constructor
Definition: TrackBase.cc:59
TrackQuality
track quality
Definition: TrackBase.h:133
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:97
void setQuality(const TrackQuality, bool set=true)
Definition: TrackBase.h:565
static const std::string qualityNames[]
Definition: TrackBase.h:145
PerigeeCovarianceMatrix & fillCovariance(PerigeeCovarianceMatrix &v, const float *data)
int j
Definition: DBlmapReader.cc:9
math::XYZPoint Point
point in the space
Definition: TrackBase.h:82
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:108
virtual ~TrackBase()
virtual destructor
Definition: TrackBase.cc:98
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:130
float covariance_[covarianceSize]
perigee 5x5 covariance matrix
Definition: TrackBase.h:356
CovarianceMatrix & fill(CovarianceMatrix &v) const
fill SMatrix
Definition: TrackBase.cc:103
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:120
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:79
tuple size
Write out results.
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:76