CMS 3D CMS Logo

L1MuKBMTrack.cc
Go to the documentation of this file.
2 
4  reco::LeafCandidate(-1,reco::LeafCandidate::PolarLorentzVector(0.1,0.0,0.0,0.105))
5 {
6 }
7 
9 
10 }
11 
13  reco::LeafCandidate(-1,reco::LeafCandidate::PolarLorentzVector(0.1,0.0,0.0,0.105)),
14  covariance_(std::vector<double>(6,0.0)),
15  curvVertex_(0),
16  phiVertex_(0),
17  dxy_(0),
18  curvMuon_(0),
19  phiMuon_(0),
20  phiBMuon_(0),
21  curv_(0),
22  phi_(phi),
23  phiB_(phiB),
24  coarseEta_(0),
25  approxChi2_(0),
27  hitPattern_(0),
28  step_(seed->stNum()),
29  sector_(seed->scNum()),
30  wheel_(seed->whNum()),
31  quality_(seed->quality()),
33  bx_(seed->bxNum()),
34  rank_(seed->bxNum()),
35  ptUnconstrained_(0.0)
36 {
37  stubs_.push_back(seed);
38  residuals_.push_back(0);
39  residuals_.push_back(0);
40  residuals_.push_back(0);
41 
42 }
43 
44 
46  return curvMuon_;
47 }
49  return phiMuon_;
50 }
52  return phiBMuon_;
53 }
54 
56  return curvVertex_;
57 }
58 
60  return phiVertex_;
61 }
62 
63 int L1MuKBMTrack::dxy() const{
64  return dxy_;
65 }
66 
68  return curv_;
69 }
70 
72  return phi_;
73 }
74 
76  return phiB_;
77 }
78 
80  return coarseEta_;
81 }
82 
84  return approxChi2_;
85 }
87  return trackCompatibility_;
88 }
89 
91  return hitPattern_;
92 }
93 
94 int L1MuKBMTrack::step() const{
95  return step_;
96 }
98  return sector_;
99 }
101  return wheel_;
102 }
103 
105  return quality_;
106 }
107 
109  return ptUnconstrained_;
110 }
111 
113  return fineEta_;
114 }
115 
117  return hasFineEta_;
118 }
119 
120 int L1MuKBMTrack::bx() const{
121  return bx_;
122 }
123 
124 int L1MuKBMTrack::rank() const{
125  return rank_;
126 }
127 
128 
129 
131  return stubs_;
132 }
133 
135  return residuals_[i];
136 }
137 
138 
139 
140 void L1MuKBMTrack::setCoordinates(int step,int curv,int phi,int phiB) {
141  step_=step;
142  curv_ = curv;
143  phiB_=phiB;
144  phi_=phi;
145 
146 }
147 
149  curvVertex_ = curv;
150  phiVertex_ = phi;
151  dxy_ = dxy;
152 }
153 
154 void L1MuKBMTrack::setCoordinatesAtMuon(int curv,int phi,int phiB) {
155  curvMuon_ = curv;
156  phiMuon_ = phi;
157  phiBMuon_ = phiB;
158 }
159 
160 
162  coarseEta_ = eta;
163 }
164 
167 }
168 
170  approxChi2_ = chi;
171 }
173  trackCompatibility_ = chi;
174 }
175 
176 void L1MuKBMTrack::setPtEtaPhi(double pt ,double eta, double phi) {
177  PolarLorentzVector v(pt,eta,phi,0.105);
178  setP4(v);
179 }
182 }
183 
185  if (stub->quality()<quality_)
186  quality_ = stub->quality();
187  stubs_.push_back(stub);
188 
189 
190 }
191 
193  fineEta_ = eta;
194  hasFineEta_=true;
195 }
196 
198  rank_ = rank;
199 }
200 
201 
202 void L1MuKBMTrack::setKalmanGain(unsigned int step,unsigned int K,float a1, float a2,float a3,float a4,float a5,float a6) {
203  switch(step) {
204  case 3:
205  kalmanGain3_.push_back(K);
206  kalmanGain3_.push_back(a1);
207  kalmanGain3_.push_back(a2);
208  kalmanGain3_.push_back(a3);
209  kalmanGain3_.push_back(a4);
210  kalmanGain3_.push_back(a5);
211  kalmanGain3_.push_back(a6);
212  break;
213  case 2:
214  kalmanGain2_.push_back(K);
215  kalmanGain2_.push_back(a1);
216  kalmanGain2_.push_back(a2);
217  kalmanGain2_.push_back(a3);
218  kalmanGain2_.push_back(a4);
219  kalmanGain2_.push_back(a5);
220  kalmanGain2_.push_back(a6);
221  break;
222  case 1:
223  kalmanGain1_.push_back(K);
224  kalmanGain1_.push_back(a1);
225  kalmanGain1_.push_back(a2);
226  kalmanGain1_.push_back(a3);
227  kalmanGain1_.push_back(a4);
228  kalmanGain1_.push_back(a5);
229  kalmanGain1_.push_back(a6);
230  break;
231  case 0:
232  kalmanGain0_.push_back(K);
233  kalmanGain0_.push_back(a1);
234  kalmanGain0_.push_back(a2);
235  kalmanGain0_.push_back(a3);
236  break;
237 
238  default:
239  printf("Critical ERROR on setting the Klamn gain\n");
240  }
241 }
242 
243 
245  residuals_[i]=val;
246 }
247 
248 
249 const std::vector<float>& L1MuKBMTrack::kalmanGain(unsigned int step) const{
250  switch(step) {
251  case 3:
252  return kalmanGain3_;
253  case 2:
254  return kalmanGain2_;
255  case 1:
256  return kalmanGain1_;
257  case 0:
258  return kalmanGain0_;
259  }
260  return kalmanGain0_;
261 }
262 
263 const std::vector<double>& L1MuKBMTrack::covariance() const {
264  return covariance_;
265 }
266 
267 
268 
270 
271  for (const auto& s1 : stubs_) {
272  for (const auto& s2 : other.stubs()) {
273  if (s1->scNum()== s2->scNum() &&
274  s1->whNum()==s2->whNum() &&
275  s1->stNum()==s2->stNum() &&
276  s1->tag()==s2->tag())
277  return true;
278  }
279  }
280  return false;
281 }
282 
283 
284 
286  covariance_[0] = c(0,0);
287  covariance_[1] = c(0,1);
288  covariance_[2] = c(1,1);
289  covariance_[3] = c(0,2);
290  covariance_[4] = c(1,2);
291  covariance_[5] = c(2,2);
292 }
293 
float ptUnconstrained_
Definition: L1MuKBMTrack.h:208
int fineEta() const
double eta() const final
momentum pseudorapidity
void setCoordinatesAtVertex(int, int, int)
int residual(uint) const
int trackCompatibility_
Definition: L1MuKBMTrack.h:178
int step() const
Definition: L1MuKBMTrack.cc:94
int bendingAngle() const
Definition: L1MuKBMTrack.cc:75
float ptUnconstrained() const
int coarseEta() const
Definition: L1MuKBMTrack.cc:79
std::vector< float > kalmanGain0_
Definition: L1MuKBMTrack.h:211
void setTrackCompatibility(int)
std::vector< float > kalmanGain1_
Definition: L1MuKBMTrack.h:212
double pt() const final
transverse momentum
void setCoordinatesAtMuon(int, int, int)
int phiAtVertex() const
Definition: L1MuKBMTrack.cc:59
void setPtUnconstrained(float)
std::vector< float > kalmanGain3_
Definition: L1MuKBMTrack.h:214
void setHitPattern(int)
void setRank(int)
std::vector< edm::Ref< L1MuKBMTCombinedStubCollection > > L1MuKBMTCombinedStubRefVector
void setPtEtaPhi(double, double, double)
int phiBAtMuon() const
Definition: L1MuKBMTrack.cc:51
std::vector< int > residuals_
Definition: L1MuKBMTrack.h:217
int curvatureAtMuon() const
Definition: L1MuKBMTrack.cc:45
bool hasFineEta() const
void setCoordinates(int, int, int, int)
const std::vector< float > & kalmanGain(unsigned int) const
int approxChi2() const
Definition: L1MuKBMTrack.cc:83
int trackCompatibility() const
Definition: L1MuKBMTrack.cc:86
void setCovariance(const CovarianceMatrix &)
void setCoarseEta(int)
void setFineEta(int)
const L1MuKBMTCombinedStubRefVector & stubs() const
std::vector< float > kalmanGain2_
Definition: L1MuKBMTrack.h:213
int curvature() const
Definition: L1MuKBMTrack.cc:67
int phiAtMuon() const
Definition: L1MuKBMTrack.cc:48
int wheel() const
const std::vector< double > & covariance() const
int dxy() const
Definition: L1MuKBMTrack.cc:63
def uint(string)
int curvatureAtVertex() const
Definition: L1MuKBMTrack.cc:55
int bx() const
fixed size matrix
void setKalmanGain(unsigned int step, unsigned int K, float a1, float a2, float a3, float a4=0, float a5=0, float a6=0)
std::vector< double > covariance_
Definition: L1MuKBMTrack.h:154
int sector() const
Definition: L1MuKBMTrack.cc:97
L1MuKBMTCombinedStubRefVector stubs_
Definition: L1MuKBMTrack.h:156
void addStub(const L1MuKBMTCombinedStubRef &)
step
Definition: StallMonitor.cc:94
int hitPattern() const
Definition: L1MuKBMTrack.cc:90
void setResidual(uint, int)
int rank() const
int quality() const
double phi() const final
momentum azimuthal angle
int positionAngle() const
Definition: L1MuKBMTrack.cc:71
void setP4(const LorentzVector &p4) final
set 4-momentum
~L1MuKBMTrack() override
Definition: L1MuKBMTrack.cc:8
void setApproxChi2(int)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39
bool overlapTrack(const L1MuKBMTrack &) const