CMS 3D CMS Logo

L1MuKBMTrack.cc
Go to the documentation of this file.
2 
3 L1MuKBMTrack::L1MuKBMTrack() : reco::LeafCandidate(-1, reco::LeafCandidate::PolarLorentzVector(0.1, 0.0, 0.0, 0.105)) {}
4 
6 
8  : reco::LeafCandidate(-1, reco::LeafCandidate::PolarLorentzVector(0.1, 0.0, 0.0, 0.105)),
9  covariance_(std::vector<double>(6, 0.0)),
10  curvVertex_(0),
11  phiVertex_(0),
12  dxy_(0),
13  curvMuon_(0),
14  phiMuon_(0),
15  phiBMuon_(0),
16  curv_(0),
17  phi_(phi),
18  phiB_(phiB),
19  coarseEta_(0),
20  approxChi2_(0),
22  hitPattern_(0),
23  step_(seed->stNum()),
24  sector_(seed->scNum()),
25  wheel_(seed->whNum()),
26  quality_(seed->quality()),
28  bx_(seed->bxNum()),
29  rank_(seed->bxNum()),
30  ptUnconstrained_(0.0) {
31  stubs_.push_back(seed);
32  residuals_.push_back(0);
33  residuals_.push_back(0);
34  residuals_.push_back(0);
35 }
36 
38 int L1MuKBMTrack::phiAtMuon() const { return phiMuon_; }
39 int L1MuKBMTrack::phiBAtMuon() const { return phiBMuon_; }
40 
42 
43 int L1MuKBMTrack::phiAtVertex() const { return phiVertex_; }
44 
45 int L1MuKBMTrack::dxy() const { return dxy_; }
46 
47 int L1MuKBMTrack::curvature() const { return curv_; }
48 
49 int L1MuKBMTrack::positionAngle() const { return phi_; }
50 
51 int L1MuKBMTrack::bendingAngle() const { return phiB_; }
52 
53 int L1MuKBMTrack::coarseEta() const { return coarseEta_; }
54 
55 int L1MuKBMTrack::approxChi2() const { return approxChi2_; }
57 
58 int L1MuKBMTrack::hitPattern() const { return hitPattern_; }
59 
60 int L1MuKBMTrack::step() const { return step_; }
61 int L1MuKBMTrack::sector() const { return sector_; }
62 int L1MuKBMTrack::wheel() const { return wheel_; }
63 
64 int L1MuKBMTrack::quality() const { return quality_; }
65 
67 
68 int L1MuKBMTrack::fineEta() const { return fineEta_; }
69 
70 bool L1MuKBMTrack::hasFineEta() const { return hasFineEta_; }
71 
72 int L1MuKBMTrack::bx() const { return bx_; }
73 
74 int L1MuKBMTrack::rank() const { return rank_; }
75 
77 
78 int L1MuKBMTrack::residual(uint i) const { return residuals_[i]; }
79 
80 void L1MuKBMTrack::setCoordinates(int step, int curv, int phi, int phiB) {
81  step_ = step;
82  curv_ = curv;
83  phiB_ = phiB;
84  phi_ = phi;
85 }
86 
87 void L1MuKBMTrack::setCoordinatesAtVertex(int curv, int phi, int dxy) {
88  curvVertex_ = curv;
89  phiVertex_ = phi;
90  dxy_ = dxy;
91 }
92 
93 void L1MuKBMTrack::setCoordinatesAtMuon(int curv, int phi, int phiB) {
94  curvMuon_ = curv;
95  phiMuon_ = phi;
96  phiBMuon_ = phiB;
97 }
98 
100 
102 
103 void L1MuKBMTrack::setApproxChi2(int chi) { approxChi2_ = chi; }
105 
106 void L1MuKBMTrack::setPtEtaPhi(double pt, double eta, double phi) {
107  PolarLorentzVector v(pt, eta, phi, 0.105);
108  setP4(v);
109 }
111 
113  if (stub->quality() < quality_)
114  quality_ = stub->quality();
115  stubs_.push_back(stub);
116 }
117 
119  fineEta_ = eta;
120  hasFineEta_ = true;
121 }
122 
124 
126  unsigned int step, unsigned int K, float a1, float a2, float a3, float a4, float a5, float a6) {
127  switch (step) {
128  case 3:
129  kalmanGain3_.push_back(K);
130  kalmanGain3_.push_back(a1);
131  kalmanGain3_.push_back(a2);
132  kalmanGain3_.push_back(a3);
133  kalmanGain3_.push_back(a4);
134  kalmanGain3_.push_back(a5);
135  kalmanGain3_.push_back(a6);
136  break;
137  case 2:
138  kalmanGain2_.push_back(K);
139  kalmanGain2_.push_back(a1);
140  kalmanGain2_.push_back(a2);
141  kalmanGain2_.push_back(a3);
142  kalmanGain2_.push_back(a4);
143  kalmanGain2_.push_back(a5);
144  kalmanGain2_.push_back(a6);
145  break;
146  case 1:
147  kalmanGain1_.push_back(K);
148  kalmanGain1_.push_back(a1);
149  kalmanGain1_.push_back(a2);
150  kalmanGain1_.push_back(a3);
151  kalmanGain1_.push_back(a4);
152  kalmanGain1_.push_back(a5);
153  kalmanGain1_.push_back(a6);
154  break;
155  case 0:
156  kalmanGain0_.push_back(K);
157  kalmanGain0_.push_back(a1);
158  kalmanGain0_.push_back(a2);
159  kalmanGain0_.push_back(a3);
160  break;
161 
162  default:
163  printf("Critical ERROR on setting the Klamn gain\n");
164  }
165 }
166 
168 
169 const std::vector<float>& L1MuKBMTrack::kalmanGain(unsigned int step) const {
170  switch (step) {
171  case 3:
172  return kalmanGain3_;
173  case 2:
174  return kalmanGain2_;
175  case 1:
176  return kalmanGain1_;
177  case 0:
178  return kalmanGain0_;
179  }
180  return kalmanGain0_;
181 }
182 
183 const std::vector<double>& L1MuKBMTrack::covariance() const { return covariance_; }
184 
186  for (const auto& s1 : stubs_) {
187  for (const auto& s2 : other.stubs()) {
188  if (s1->scNum() == s2->scNum() && s1->whNum() == s2->whNum() && s1->stNum() == s2->stNum() &&
189  s1->tag() == s2->tag())
190  return true;
191  }
192  }
193  return false;
194 }
195 
197  covariance_[0] = c(0, 0);
198  covariance_[1] = c(0, 1);
199  covariance_[2] = c(1, 1);
200  covariance_[3] = c(0, 2);
201  covariance_[4] = c(1, 2);
202  covariance_[5] = c(2, 2);
203 }
float ptUnconstrained_
Definition: L1MuKBMTrack.h:197
int fineEta() const
Definition: L1MuKBMTrack.cc:68
double eta() const final
momentum pseudorapidity
void setCoordinatesAtVertex(int, int, int)
Definition: L1MuKBMTrack.cc:87
int residual(uint) const
Definition: L1MuKBMTrack.cc:78
int trackCompatibility_
Definition: L1MuKBMTrack.h:168
int step() const
Definition: L1MuKBMTrack.cc:60
int bendingAngle() const
Definition: L1MuKBMTrack.cc:51
float ptUnconstrained() const
Definition: L1MuKBMTrack.cc:66
int coarseEta() const
Definition: L1MuKBMTrack.cc:53
std::vector< float > kalmanGain0_
Definition: L1MuKBMTrack.h:200
void setTrackCompatibility(int)
std::vector< float > kalmanGain1_
Definition: L1MuKBMTrack.h:201
double pt() const final
transverse momentum
void setCoordinatesAtMuon(int, int, int)
Definition: L1MuKBMTrack.cc:93
int phiAtVertex() const
Definition: L1MuKBMTrack.cc:43
void setPtUnconstrained(float)
std::vector< edm::Ref< L1MuKBMTCombinedStubCollection > > L1MuKBMTCombinedStubRefVector
std::vector< float > kalmanGain3_
Definition: L1MuKBMTrack.h:203
void setHitPattern(int)
void setRank(int)
void setPtEtaPhi(double, double, double)
int phiBAtMuon() const
Definition: L1MuKBMTrack.cc:39
std::vector< int > residuals_
Definition: L1MuKBMTrack.h:205
int curvatureAtMuon() const
Definition: L1MuKBMTrack.cc:37
bool hasFineEta() const
Definition: L1MuKBMTrack.cc:70
void setCoordinates(int, int, int, int)
Definition: L1MuKBMTrack.cc:80
const std::vector< float > & kalmanGain(unsigned int) const
int approxChi2() const
Definition: L1MuKBMTrack.cc:55
int trackCompatibility() const
Definition: L1MuKBMTrack.cc:56
void setCovariance(const CovarianceMatrix &)
void setCoarseEta(int)
Definition: L1MuKBMTrack.cc:99
void setFineEta(int)
const L1MuKBMTCombinedStubRefVector & stubs() const
Definition: L1MuKBMTrack.cc:76
std::vector< float > kalmanGain2_
Definition: L1MuKBMTrack.h:202
int curvature() const
Definition: L1MuKBMTrack.cc:47
int phiAtMuon() const
Definition: L1MuKBMTrack.cc:38
int wheel() const
Definition: L1MuKBMTrack.cc:62
const std::vector< double > & covariance() const
int dxy() const
Definition: L1MuKBMTrack.cc:45
int curvatureAtVertex() const
Definition: L1MuKBMTrack.cc:41
int bx() const
Definition: L1MuKBMTrack.cc:72
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:145
int sector() const
Definition: L1MuKBMTrack.cc:61
L1MuKBMTCombinedStubRefVector stubs_
Definition: L1MuKBMTrack.h:147
void addStub(const L1MuKBMTCombinedStubRef &)
step
Definition: StallMonitor.cc:94
int hitPattern() const
Definition: L1MuKBMTrack.cc:58
void setResidual(uint, int)
int rank() const
Definition: L1MuKBMTrack.cc:74
int quality() const
Definition: L1MuKBMTrack.cc:64
double phi() const final
momentum azimuthal angle
int positionAngle() const
Definition: L1MuKBMTrack.cc:49
void setP4(const LorentzVector &p4) final
set 4-momentum
~L1MuKBMTrack() override
Definition: L1MuKBMTrack.cc:5
void setApproxChi2(int)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39
bool overlapTrack(const L1MuKBMTrack &) const