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  "iter0",
15  "iter1",
16  "iter2",
17  "iter3",
18  "iter4",
19  "iter5",
20  "iter6",
21  "iter7",
22  "iter8",
23  "iter9",
24  "iter10",
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 };
41 
43  "loose",
44  "tight",
45  "highPurity",
46  "confirmed",
47  "goodIterative",
48  "looseSetWithPV",
49  "highPuritySetWithPV"
50 };
51 
53  chi2_(0),
54  vertex_(0, 0, 0),
55  momentum_(0, 0, 0),
56  ndof_(0),
57  charge_(0),
58  algorithm_(undefAlgorithm),
59  quality_(0),
60  nLoops_(0)
61 {
62  index idx = 0;
63  for (index i = 0; i < dimension; ++i) {
64  for (index j = 0; j <= i; ++j) {
65  covariance_[idx++] = 0;
66  }
67  }
68 }
69 
70 TrackBase::TrackBase(double chi2, double ndof, const Point &vertex, const Vector &momentum,
71  int charge, const CovarianceMatrix &cov, TrackAlgorithm algorithm,
72  TrackQuality quality, signed char nloops):
73  chi2_(chi2),
74  vertex_(vertex),
75  momentum_(momentum),
76  ndof_(ndof),
77  charge_(charge),
78  algorithm_(algorithm),
79  quality_(0),
80  nLoops_(nloops)
81 {
82  index idx = 0;
83  for (index i = 0; i < dimension; ++i) {
84  for (index j = 0; j <= i; ++j) {
85  covariance_[idx++] = cov(i, j);
86  }
87  }
88  setQuality(quality);
89 }
90 
92 {
93  ;
94 }
95 
96 
98 {
99  return fillCovariance(v, covariance_);
100 }
101 
103 {
105  int index = std::find(qualityNames, qualityNames + size, name) - qualityNames;
106  if (index == size) {
107  return undefQuality; // better this or throw() ?
108  }
109 
110  // cast
111  return TrackQuality(index);
112 }
113 
115 {
117  int index = std::find(algoNames, algoNames + size, name) - algoNames;
118  if (index == size) {
119  return undefAlgorithm; // better this or throw() ?
120  }
121 
122  // cast
123  return TrackAlgorithm(index);
124 }
int i
Definition: DBlmapReader.cc:9
< trclass="colgroup">< tdclass="colgroup"colspan=5 > Ecal cluster collections</td ></tr >< tr >< td >< ahref="classreco_1_1BasicCluster.html"> reco::BasicCluster</a ></td >< td >< ahref="DataFormats_EgammaReco.html"> reco::BasicClusterCollection</a ></td >< td >< ahref="#"> hybridSuperClusters</a ></td >< tdclass="description"> Basic clusters reconstructed with hybrid algorithm(barrel only)</td >< td >S.Rahatlou</td ></tr >< tr >< td >< a href
unsigned int index
index type
Definition: TrackBase.h:94
TrackBase()
default constructor
Definition: TrackBase.cc:52
TrackQuality
track quality
Definition: TrackBase.h:113
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:493
static const std::string qualityNames[]
Definition: TrackBase.h:125
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:102
virtual ~TrackBase()
virtual destructor
Definition: TrackBase.cc:91
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:110
float covariance_[covarianceSize]
perigee 5x5 covariance matrix
Definition: TrackBase.h:336
CovarianceMatrix & fill(CovarianceMatrix &v) const
fill SMatrix
Definition: TrackBase.cc:97
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:114
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