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