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  "discarded"
58 };
59 
61  chi2_(0),
62  vertex_(0, 0, 0),
63  momentum_(0, 0, 0),
64  ndof_(0),
65  charge_(0),
66  algorithm_(undefAlgorithm),
67  originalAlgorithm_(undefAlgorithm),
68  quality_(0),
69  nLoops_(0)
70 {
71  algoMask_.set(algorithm_);
72  index idx = 0;
73  for (index i = 0; i < dimension; ++i) {
74  for (index j = 0; j <= i; ++j) {
75  covariance_[idx++] = 0;
76  }
77  }
78 }
79 
80 TrackBase::TrackBase(double chi2, double ndof, const Point &vertex, const Vector &momentum,
82  TrackQuality quality, signed char nloops):
83  chi2_(chi2),
84  vertex_(vertex),
85  momentum_(momentum),
86  ndof_(ndof),
87  charge_(charge),
88  algorithm_(algorithm),
89  originalAlgorithm_(algorithm),
90  quality_(0),
91  nLoops_(nloops)
92 {
93  algoMask_.set(algorithm_);
94 
95  index idx = 0;
96  for (index i = 0; i < dimension; ++i) {
97  for (index j = 0; j <= i; ++j) {
98  covariance_[idx++] = cov(i, j);
99  }
100  }
101  setQuality(quality);
102 }
103 
105 {
106  ;
107 }
108 
110 {
111  return fillCovariance(v, covariance_);
112 }
113 
115 {
117  int index = std::find(qualityNames, qualityNames + size, name) - qualityNames;
118  if (index == size) {
119  return undefQuality; // better this or throw() ?
120  }
121 
122  // cast
123  return TrackQuality(index);
124 }
125 
127 {
129  int index = std::find(algoNames, algoNames + size, name) - algoNames;
130  if (index == size) {
131  return undefAlgorithm; // better this or throw() ?
132  }
133 
134  // cast
135  return TrackAlgorithm(index);
136 }
int i
Definition: DBlmapReader.cc:9
void setQuality(const TrackQuality)
Definition: TrackBase.h:476
unsigned int index
index type
Definition: TrackBase.h:95
TrackBase()
default constructor
Definition: TrackBase.cc:60
TrackQuality
track quality
Definition: TrackBase.h:139
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:152
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:388
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:114
virtual ~TrackBase()
virtual destructor
Definition: TrackBase.cc:104
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:136
float covariance_[covarianceSize]
perigee 5x5 covariance matrix
Definition: TrackBase.h:376
CovarianceMatrix & fill(CovarianceMatrix &v) const
fill SMatrix
Definition: TrackBase.cc:109
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:126
uint8_t algorithm_
track algorithm
Definition: TrackBase.h:397
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