CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
tmtt::SimpleLR4 Class Reference

#include <SimpleLR4.h>

Inheritance diagram for tmtt::SimpleLR4:
tmtt::TrackFitGeneric

Public Member Functions

L1fittedTrack fit (const L1track3D &l1track3D) override
 
 SimpleLR4 (const Settings *settings)
 
 ~SimpleLR4 () override=default
 
- Public Member Functions inherited from tmtt::TrackFitGeneric
 TrackFitGeneric (const Settings *settings, const std::string &fitterName="")
 
virtual ~TrackFitGeneric ()=default
 

Protected Attributes

float chi2cut_
 
float chi2Mult_
 
float chosenRofPhi_
 
bool debug_
 
float denominatorMult_
 
bool digitize_
 
unsigned int dividerBitsChi2_
 
unsigned int dividerBitsHelix_
 
unsigned int dividerBitsHelixZ_
 
float invPtToDPhi_
 
unsigned int minStubLayersRed_
 
float numeratorLambdaMult_
 
float numeratorPhiMult_
 
float numeratorPtMult_
 
float numeratorZ0Mult_
 
float phiMult_
 
float phiNonantWidth_
 
float phiSectorCentre_
 
float phiSectorWidth_
 
float phiTMult_
 
float qOverPtMult_
 
float resMult_
 
float rTMult_
 
unsigned int shiftingBitsDenRPhi_
 
unsigned int shiftingBitsDenRZ_
 
unsigned int shiftingBitsLambda_
 
unsigned int shiftingBitsPhi_
 
unsigned int shiftingBitsPt_
 
unsigned int shiftingBitsz0_
 
float tanLambdaMult_
 
float z0Mult_
 
float zMult_
 
- Protected Attributes inherited from tmtt::TrackFitGeneric
const std::string fitterName_
 
const Settingssettings_
 

Detailed Description

Definition at line 20 of file SimpleLR4.h.

Constructor & Destructor Documentation

◆ SimpleLR4()

tmtt::SimpleLR4::SimpleLR4 ( const Settings settings)

Definition at line 21 of file SimpleLR4.cc.

21  : TrackFitGeneric(settings) {
22  // Initialize digitization parameters
25  zMult_ = pow(2., settings_->zBits()) / settings_->zRange();
28 
32 
39 
49 
52 
55  if (digitize_)
57 
58  debug_ = false; // Enable debug printout.
59  };

References chi2cut_, chi2Mult_, tmtt::Settings::chosenRofPhi(), chosenRofPhi_, debug_, denominatorMult_, digitize_, tmtt::Settings::digitizeSLR(), tmtt::Settings::dividerBitsHelix(), dividerBitsHelix_, tmtt::Settings::dividerBitsHelixZ(), dividerBitsHelixZ_, tmtt::Settings::enableDigitize(), dqmMemoryStats::float, M_PI, numeratorLambdaMult_, numeratorPhiMult_, numeratorPtMult_, numeratorZ0Mult_, tmtt::Settings::numPhiNonants(), tmtt::Settings::numPhiSectors(), phiMult_, phiNonantWidth_, tmtt::Settings::phiSBits(), phiSectorWidth_, tmtt::Settings::phiSRange(), phiTMult_, funct::pow(), qOverPtMult_, resMult_, tmtt::Settings::rtBits(), rTMult_, tmtt::Settings::rtRange(), tmtt::TrackFitGeneric::settings_, tmtt::Settings::ShiftingBitsDenRPhi(), shiftingBitsDenRPhi_, tmtt::Settings::ShiftingBitsDenRZ(), shiftingBitsDenRZ_, tmtt::Settings::ShiftingBitsLambda(), shiftingBitsLambda_, tmtt::Settings::ShiftingBitsPhi(), shiftingBitsPhi_, tmtt::Settings::ShiftingBitsPt(), shiftingBitsPt_, tmtt::Settings::ShiftingBitsZ0(), shiftingBitsz0_, tmtt::Settings::slr_chi2cut(), tmtt::Settings::slr_chisquaredBits(), tmtt::Settings::slr_chisquaredRange(), tmtt::Settings::slr_oneOver2rBits(), tmtt::Settings::slr_oneOver2rRange(), tmtt::Settings::slr_phi0Bits(), tmtt::Settings::slr_phi0Range(), tmtt::Settings::slr_tanlambdaBits(), tmtt::Settings::slr_tanlambdaRange(), tmtt::Settings::slr_z0Bits(), tmtt::Settings::slr_z0Range(), tanLambdaMult_, z0Mult_, tmtt::Settings::zBits(), zMult_, and tmtt::Settings::zRange().

◆ ~SimpleLR4()

tmtt::SimpleLR4::~SimpleLR4 ( )
overridedefault

Member Function Documentation

◆ fit()

L1fittedTrack tmtt::SimpleLR4::fit ( const L1track3D l1track3D)
overridevirtual

Reimplemented from tmtt::TrackFitGeneric.

Definition at line 65 of file SimpleLR4.cc.

65  {
66  if (debug_)
67  PrintL1trk() << "=============== FITTING SimpleLR TRACK ====================";
68 
70  settings_,
71  l1track3D.iPhiSec(),
72  l1track3D.iEtaReg(),
73  std::abs(l1track3D.qOverPt()),
74  l1track3D.eta());
75 
77 
78  double phiCentreSec0 = -0.5 * phiNonantWidth_ + 0.5 * phiSectorWidth_;
79  phiSectorCentre_ = phiSectorWidth_ * double(l1track3D.iPhiSec()) - phiCentreSec0;
80 
81  if (digitize_)
83 
84  // Inizialise track fit parameters
85  double qOverPt = 0.;
86  double phiT = 0.;
87  double phi0 = 0.;
88  double z0 = 0.;
89  double zT = 0.;
90  double tanLambda = 0.;
91 
92  // Inizialise Sums
93  double SumRPhi = 0.;
94  double SumR = 0.;
95  double SumPhi = 0.;
96  double SumR2 = 0.;
97  double SumRZ = 0.;
98  double SumZ = 0.;
99 
100  unsigned int numStubs = 0;
101  // Calc helix parameters on Rphi Plane (STEP 1)
102  // This loop calculates the sums needed to calculate the numerators and the denominator to compute the helix parameters in the R-Phi plane (q/pT, phiT)
103  for (Stub* stub : l1track3D.stubs()) {
104  numStubs++;
105 
106  if (digitize_) {
107  const DigitalStub* digiStub = stub->digitalStub();
108 
109  SumRPhi = SumRPhi + digiStub->rt_SF_TF() * digiStub->phiS();
110  SumR = SumR + digiStub->rt_SF_TF();
111  SumPhi = SumPhi + digiStub->phiS();
112  SumR2 = SumR2 + digiStub->rt_SF_TF() * digiStub->rt_SF_TF();
113  if (debug_)
114  PrintL1trk() << "Input stub (digi): phiS " << digiStub->iDigi_PhiS() << " rT " << digiStub->iDigi_Rt()
115  << " z " << digiStub->iDigi_Z();
116  } else {
117  float phi = 0;
118  if (l1track3D.iPhiSec() == 0 and stub->phi() > 0) {
119  phi = stub->phi() - 2 * M_PI;
120  } else if (l1track3D.iPhiSec() == settings_->numPhiSectors() and stub->phi() < 0) {
121  phi = stub->phi() + 2 * M_PI;
122  } else {
123  phi = stub->phi();
124  }
125  SumRPhi = SumRPhi + stub->r() * phi;
126  SumR = SumR + stub->r();
127  SumPhi = SumPhi + phi;
128  SumR2 = SumR2 + stub->r() * stub->r();
129  if (debug_)
130  PrintL1trk() << "InputStub (float): phi " << phi << " r " << stub->r() << " z " << stub->z();
131  }
132  }
133 
134  double numeratorPt, digiNumeratorPt;
135  double denominator, digiDenominator;
136  double numeratorPhi, digiNumeratorPhi;
137  double reciprocal, digiReciprocal;
138  double numeratorZ0;
139  double numeratorLambda;
140 
141  digiNumeratorPt = (numStubs * SumRPhi - SumR * SumPhi);
142  digiDenominator = (numStubs * SumR2 - SumR * SumR);
143  digiNumeratorPhi = (SumR2 * SumPhi - SumR * SumRPhi);
144 
145  if (!digitize_) {
146  qOverPt = (numStubs * SumRPhi - SumR * SumPhi) / (numStubs * SumR2 - SumR * SumR);
147  phi0 = (SumR2 * SumPhi - SumR * SumRPhi) / (numStubs * SumR2 - SumR * SumR);
148  } else {
149  digiNumeratorPt /= pow(2., shiftingBitsPt_);
150  digiNumeratorPt = floor(digiNumeratorPt * numeratorPtMult_);
151  numeratorPt = digiNumeratorPt / numeratorPtMult_;
152 
153  digiNumeratorPhi /= pow(2., shiftingBitsPhi_);
154  digiNumeratorPhi = floor(digiNumeratorPhi * numeratorPhiMult_);
155  numeratorPhi = digiNumeratorPhi / numeratorPhiMult_;
156 
157  digiDenominator /= pow(2., shiftingBitsDenRPhi_);
158  digiDenominator = (floor(digiDenominator * denominatorMult_) + 0.5);
159  denominator = digiDenominator / denominatorMult_;
160  digiReciprocal = (pow(2., dividerBitsHelix_) - 1) / (denominator); // To be moved
161  digiReciprocal = floor(digiReciprocal / denominatorMult_);
162  reciprocal = digiReciprocal * denominatorMult_;
163 
164  qOverPt = numeratorPt * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_);
165  phiT = numeratorPhi * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_);
166 
167  qOverPt = floor(qOverPt * qOverPtMult_) / (qOverPtMult_);
168  phiT = floor(phiT * phiTMult_) / phiTMult_;
169  }
170 
171  if (debug_) {
172  if (digitize_) {
173  PrintL1trk() << setw(10) << "Input helix (digi): qOverPt = " << qOverPt << " (" << floor(qOverPt * qOverPtMult_)
174  << "), phiT = " << phiT << " (" << floor(phiT * phiTMult_) << ") ";
175  } else {
176  PrintL1trk() << "Input Helix (float): qOverPt = " << qOverPt << " phi0 " << phi0;
177  }
178  }
179 
180  // ================== RESIDUAL CALCULATION ON RPHI ========================
181  std::vector<std::pair<Stub*, double> > vRes;
182  unsigned int psStubs = 0;
183  for (Stub* stub : l1track3D.stubs()) {
184  if (stub->psModule())
185  psStubs++;
186  double ResPhi;
187 
188  if (digitize_) {
189  const DigitalStub* digiStub = stub->digitalStub();
190 
191  ResPhi =
192  digiStub->iDigi_PhiS() * pow(2., shiftingBitsDenRPhi_ - shiftingBitsPt_) -
193  floor(phiT * phiTMult_) *
195  floor(qOverPt * qOverPtMult_) * digiStub->iDigi_Rt();
196 
197  ResPhi = floor(ResPhi) / resMult_;
198  }
199 
200  else {
201  ResPhi = reco::deltaPhi(stub->phi(), phi0 + qOverPt * stub->r());
202  }
203 
204  double Res = std::abs(ResPhi);
205 
206  std::pair<Stub*, double> ResStubPair(stub, Res);
207  vRes.push_back(ResStubPair);
208  if (debug_) {
209  if (stub->assocTP() != nullptr)
210  PrintL1trk() << " Stub rphi residual " << Res << " TP " << stub->assocTP()->index();
211  else
212  PrintL1trk() << " Stub rphi residual " << Res << " TP nullptr";
213  }
214  }
215 
216  double largestResidual = 9999.;
217  // Find largest residuals
218  while (vRes.size() > minStubLayersRed_ and largestResidual > settings_->ResidualCut()) {
219  std::vector<std::pair<Stub*, double> >::iterator maxResIt = max_element(vRes.begin(), vRes.end(), pair_compare);
220  largestResidual = (*maxResIt).second;
221  if (debug_)
222  PrintL1trk() << "Largest Residual " << largestResidual;
223 
224  if (largestResidual > settings_->ResidualCut()) {
225  if ((*maxResIt).first->psModule()) {
226  if (psStubs > 2) {
227  if (debug_)
228  PrintL1trk() << "removing PS residual " << (*maxResIt).second;
229  vRes.erase(maxResIt);
230  psStubs--;
231  } else {
232  if (debug_)
233  PrintL1trk() << "residual " << (*maxResIt).second << " set to -1. ";
234  (*maxResIt).second = -1.;
235  }
236  } else {
237  vRes.erase(maxResIt);
238  if (debug_)
239  PrintL1trk() << "removing residual " << (*maxResIt).second;
240  }
241  }
242  }
243 
244  std::vector<Stub*> fitStubs;
245  for (std::pair<Stub*, double> ResStubPair : vRes) {
246  fitStubs.push_back(ResStubPair.first);
247  }
248 
249  phiT = 0.;
250  zT = 0.;
251 
252  SumRPhi = 0.;
253  SumR = 0.;
254  SumPhi = 0.;
255  SumR2 = 0.;
256  SumRZ = 0.;
257  SumZ = 0.;
258  double SumR_ps = 0.;
259  double SumR2_ps = 0.;
260 
261  numStubs = 0;
262  psStubs = 0;
263 
264  for (const Stub* stub : fitStubs) {
265  if (stub->psModule())
266  psStubs++;
267 
268  numStubs++;
269  if (digitize_) {
270  const DigitalStub* digiStub = stub->digitalStub();
271  SumRPhi += digiStub->rt_SF_TF() * digiStub->phiS();
272  SumR += digiStub->rt_SF_TF();
273  SumPhi += digiStub->phiS();
274  SumR2 += digiStub->rt_SF_TF() * digiStub->rt_SF_TF();
275  if (stub->psModule()) {
276  SumRZ += digiStub->rt_SF_TF() * digiStub->z();
277  SumZ += digiStub->z();
278  SumR_ps += digiStub->rt_SF_TF();
279  SumR2_ps += digiStub->rt_SF_TF() * digiStub->rt_SF_TF();
280  }
281  if (debug_) {
282  PrintL1trk() << "phiS " << digiStub->iDigi_PhiS() << " rT " << digiStub->iDigi_Rt() << " z "
283  << digiStub->iDigi_Z();
284  }
285  } else {
286  float phi = 0;
287  if (l1track3D.iPhiSec() == 0 and stub->phi() > 0) {
288  phi = stub->phi() - 2 * M_PI;
289  } else if (l1track3D.iPhiSec() == settings_->numPhiSectors() and stub->phi() < 0) {
290  phi = stub->phi() + 2 * M_PI;
291  } else {
292  phi = stub->phi();
293  }
294 
295  SumRPhi += stub->r() * phi;
296  SumR += stub->r();
297  SumPhi += phi;
298  SumR2 += stub->r() * stub->r();
299  if (stub->psModule()) {
300  SumRZ += stub->r() * stub->z();
301  SumZ += stub->z();
302  SumR_ps += stub->r();
303  SumR2_ps += stub->r() * stub->r();
304  }
305  if (debug_)
306  PrintL1trk() << "phi " << phi << " r " << stub->r() << " z " << stub->z();
307  }
308  }
309 
310  numeratorZ0 = (SumR2_ps * SumZ - SumR_ps * SumRZ);
311  numeratorLambda = (psStubs * SumRZ - SumR_ps * SumZ);
312  numeratorPt = (numStubs * SumRPhi - SumR * SumPhi);
313  denominator = (numStubs * SumR2 - SumR * SumR);
314  double denominatorZ = (psStubs * SumR2_ps - SumR_ps * SumR_ps);
315  numeratorPhi = (SumR2 * SumPhi - SumR * SumRPhi);
316  double reciprocalZ;
317  if (!digitize_) {
318  z0 = numeratorZ0 / denominatorZ;
319  tanLambda = numeratorLambda / denominatorZ;
320  qOverPt = (numStubs * SumRPhi - SumR * SumPhi) / (numStubs * SumR2 - SumR * SumR);
321  phi0 = (SumR2 * SumPhi - SumR * SumRPhi) / (numStubs * SumR2 - SumR * SumR);
322  } else {
323  numeratorPt /= pow(2., shiftingBitsPt_);
324  numeratorPt = floor(numeratorPt * numeratorPtMult_) / numeratorPtMult_;
325 
326  numeratorPhi /= pow(2., shiftingBitsPhi_);
327  numeratorPhi = floor(numeratorPhi * numeratorPhiMult_) / numeratorPhiMult_;
328 
329  numeratorLambda /= pow(2., shiftingBitsLambda_);
330  numeratorLambda = floor(numeratorLambda * numeratorLambdaMult_) / numeratorLambdaMult_;
331 
332  numeratorZ0 /= pow(2., shiftingBitsz0_);
333  numeratorZ0 = floor(numeratorZ0 * numeratorZ0Mult_) / numeratorZ0Mult_;
334 
337  reciprocal = (pow(2., dividerBitsHelix_) - 1) / (denominator);
338  reciprocal = floor(reciprocal / denominatorMult_) * denominatorMult_;
339 
340  denominatorZ /= pow(2., shiftingBitsDenRZ_);
341  denominatorZ = (floor(denominatorZ * denominatorMult_) + 0.5) / denominatorMult_;
342  reciprocalZ = (pow(2., dividerBitsHelixZ_) - 1) / (denominatorZ);
343  reciprocalZ = floor(reciprocalZ / denominatorMult_) * denominatorMult_;
344 
345  qOverPt = numeratorPt * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_);
346  phiT = numeratorPhi * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_);
347 
348  tanLambda =
349  numeratorLambda * reciprocalZ / pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsLambda_);
350  zT = numeratorZ0 * reciprocalZ / pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsz0_);
351 
352  phi0 = phiSectorCentre_ + phiT - qOverPt * settings_->chosenRofPhi();
353  z0 = zT - tanLambda * settings_->chosenRofPhi();
354 
355  qOverPt = floor(qOverPt * qOverPtMult_) / qOverPtMult_;
356  phiT = floor(phiT * phiTMult_) / phiTMult_;
357  }
358 
359  if (debug_ and digitize_) {
360  PrintL1trk() << "HT mbin " << int(l1track3D.cellLocationHT().first) - 16 << " cbin "
361  << int(l1track3D.cellLocationHT().second) - 32 << " iPhi " << l1track3D.iPhiSec() << " iEta "
362  << l1track3D.iEtaReg();
363  PrintL1trk() << "Second Helix variables: numeratorPt = " << numeratorPt << ", numeratorPhi = " << numeratorPhi
364  << ", numeratorZ0 = " << numeratorZ0 << " numeratorLambda = " << numeratorLambda
365  << " denominator = " << denominator << " reciprocal = " << reciprocal
366  << " denominatorZ = " << denominatorZ << " reciprocalZ = " << reciprocalZ;
367  PrintL1trk() << setw(10) << "Final Helix parameters: qOverPt = " << qOverPt << " ("
368  << floor(qOverPt * qOverPtMult_) << "), phiT = " << phiT << " (" << floor(phiT * phiTMult_)
369  << "), zT = " << zT << " (" << floor(zT * z0Mult_) << "), tanLambda = " << tanLambda << " ("
370  << floor(tanLambda * tanLambdaMult_) << ")"
371  << " z0 " << z0;
372  } else if (debug_) {
373  PrintL1trk() << setw(10) << "Final Helix parameters: qOverPt = " << qOverPt << ", phi0 = " << phi0
374  << ", z0 = " << z0 << ", tanLambda = " << tanLambda;
375  }
376 
377  double chi2_phi = 0.;
378  double chi2_z = 0.;
379 
380  for (const Stub* stub : fitStubs) {
381  double ResPhi = 0.;
382  double ResZ = 0.;
383  if (digitize_) {
384  const DigitalStub* digiStub = stub->digitalStub();
385  ResPhi = digiStub->phiS() - phiT - qOverPt * digiStub->rt_SF_TF();
386  ResZ = digiStub->z() - zT - tanLambda * digiStub->rt_SF_TF();
387  } else {
388  ResPhi = reco::deltaPhi(stub->phi(), phi0 + qOverPt * stub->r());
389  ResZ = stub->z() - z0 - tanLambda * stub->r();
390  }
391 
392  double RPhiSigma = 0.0002;
393  float RZSigma = stub->sigmaZ() + std::abs(tanLambda) * stub->sigmaR();
394 
395  if (not stub->barrel())
396  RPhiSigma = 0.0004;
397 
398  if (digitize_) {
399  RPhiSigma = floor(RPhiSigma * phiMult_) / phiMult_;
400  }
401 
402  ResPhi /= RPhiSigma;
403  ResZ /= RZSigma;
404 
405  chi2_phi += std::abs(ResPhi * ResPhi);
406  chi2_z += std::abs(ResZ * ResZ);
407  if (debug_) {
408  PrintL1trk() << "Stub ResPhi " << ResPhi * RPhiSigma << " ResSigma " << RPhiSigma << " Res " << ResPhi
409  << " chi2 " << chi2_phi;
410  PrintL1trk() << "Stub ResZ " << ResZ * RZSigma << " ResSigma " << RZSigma << " Res " << ResZ << " chi2 "
411  << chi2_z;
412  }
413  }
414  qOverPt /= invPtToDPhi_;
415 
416  bool accepted = false;
417 
418  //double chi2 = chi2_phi; // Ignore r-z residuals due to poor 2S resolution?
419  double chi2 = chi2_phi + chi2_z;
420  if (digitize_)
421  chi2 = floor(chi2 * chi2Mult_) / chi2Mult_;
422 
423  constexpr unsigned int nHelixPar = 4;
424  float dof = 2 * fitStubs.size() - nHelixPar;
425  float chi2dof = chi2 / dof;
426  if (chi2 < chi2cut_)
427  accepted = true;
428 
429  if (debug_)
430  PrintL1trk() << "qOverPt " << qOverPt << " phiT " << phiT;
431 
432  // This condition can only happen if cfg param TrackFitCheat = True.
433  if (fitStubs.size() < minStubLayersRed_)
434  accepted = false;
435 
436  // Kinematic cuts -- NOT YET IN FIRMWARE!!!
437  constexpr float tolerance = 0.1;
438  if (std::abs(qOverPt) > 1. / (settings_->houghMinPt() - tolerance))
439  accepted = false;
440  if (std::abs(z0) > 20.)
441  accepted = false;
442 
443  if (accepted) {
444  // Create the L1fittedTrack object
445  const unsigned int hitPattern = 0; // FIX: Needs setting
446  L1fittedTrack fitTrk(
447  settings_, &l1track3D, fitStubs, hitPattern, qOverPt, 0., phi0, z0, tanLambda, chi2_phi, chi2_z, nHelixPar);
448 
449  if (settings_->enableDigitize())
450  fitTrk.digitizeTrack("SimpleLR4");
451 
452  if (debug_ and digitize_) {
453  PrintL1trk() << "Digitized parameters ";
454  PrintL1trk() << "HT mbin " << int(l1track3D.cellLocationHT().first) - 16 << " cbin "
455  << int(l1track3D.cellLocationHT().second) - 32 << " iPhi " << l1track3D.iPhiSec() << " iEta "
456  << l1track3D.iEtaReg();
457  PrintL1trk() << setw(10) << "First Helix parameters: qOverPt = " << fitTrk.qOverPt() << " oneOver2r "
458  << fitTrk.digitaltrack()->oneOver2r() << " ("
459  << floor(fitTrk.digitaltrack()->oneOver2r() * qOverPtMult_)
460  << "), phi0 = " << fitTrk.digitaltrack()->phi0() << " (" << fitTrk.digitaltrack()->iDigi_phi0rel()
461  << "), zT = " << zT << " (" << floor(zT * z0Mult_) << "), tanLambda = " << tanLambda << " ("
462  << floor(tanLambda * tanLambdaMult_) << ")";
463  }
464 
465  if (debug_) {
466  PrintL1trk() << "FitTrack helix parameters " << int(fitTrk.cellLocationFit().first) - 16 << ", "
467  << int(fitTrk.cellLocationFit().second) - 32 << " HT parameters "
468  << int(fitTrk.cellLocationHT().first) - 16 << ", " << int(fitTrk.cellLocationHT().second) - 32;
469 
470  if (fitTrk.matchedTP() != nullptr) {
471  PrintL1trk() << "True track: chi2/ndf " << chi2dof;
472  PrintL1trk() << "TP qOverPt " << fitTrk.matchedTP()->qOverPt() << " phi0 " << fitTrk.matchedTP()->phi0();
473  if (!accepted)
474  PrintL1trk() << "Track rejected " << chi2 << " chi2/ndof " << chi2dof;
475  } else {
476  PrintL1trk() << "Fake track!!! " << chi2 << " chi2/ndof " << chi2dof;
477  }
478  PrintL1trk() << "layers in track " << fitTrk.numLayers();
479  }
480 
481  return fitTrk;
482 
483  } else {
484  L1fittedTrack rejectedTrk;
485  return rejectedTrk;
486  }
487  }

References funct::abs(), cms::dd::accepted(), tmtt::L1fittedTrack::cellLocationFit(), tmtt::L1track3D::cellLocationHT(), tmtt::L1fittedTrack::cellLocationHT(), hltPixelTracks_cff::chi2, chi2cut_, chi2Mult_, tmtt::Settings::chosenRofPhi(), debug_, reco::deltaPhi(), HLTTauDQMOffline_cfi::denominator, denominatorMult_, tmtt::L1fittedTrack::digitaltrack(), digitize_, tmtt::L1fittedTrack::digitizeTrack(), dividerBitsHelix_, dividerBitsHelixZ_, tmtt::Settings::enableDigitize(), tmtt::L1track3D::eta(), tmtt::Utility::FIT, tmtt::Settings::houghMinPt(), tmtt::DigitalTrack::iDigi_phi0rel(), tmtt::DigitalStub::iDigi_PhiS(), tmtt::DigitalStub::iDigi_Rt(), tmtt::DigitalStub::iDigi_Z(), tmtt::L1track3D::iEtaReg(), createfilelist::int, tmtt::Settings::invPtToDphi(), invPtToDPhi_, tmtt::L1track3D::iPhiSec(), M_PI, tmtt::L1fittedTrack::matchedTP(), minStubLayersRed_, numeratorLambdaMult_, numeratorPhiMult_, numeratorPtMult_, numeratorZ0Mult_, tmtt::Utility::numLayerCut(), tmtt::L1fittedTrack::numLayers(), tmtt::Settings::numPhiSectors(), tmtt::DigitalTrack::oneOver2r(), tmtt::pair_compare(), tmtt::DigitalTrack::phi0(), tmtt::TP::phi0(), phiMult_, phiNonantWidth_, tmtt::DigitalStub::phiS(), tmtt::Settings::phiSBits(), phiSectorCentre_, phiSectorWidth_, phiTMult_, funct::pow(), tmtt::TP::qOverPt(), tmtt::L1track3D::qOverPt(), tmtt::L1fittedTrack::qOverPt(), qOverPtMult_, tmtt::Settings::ResidualCut(), resMult_, tmtt::DigitalStub::rt_SF_TF(), tmtt::TrackFitGeneric::settings_, shiftingBitsDenRPhi_, shiftingBitsDenRZ_, shiftingBitsLambda_, shiftingBitsPhi_, shiftingBitsPt_, shiftingBitsz0_, tmtt::Settings::slr_phi0Bits(), tmtt::L1track3D::stubs(), tanLambdaMult_, tolerance, PixelMapPlotter::vRes, tmtt::DigitalStub::z(), HLTMuonOfflineAnalyzer_cfi::z0, and z0Mult_.

Referenced by trackingPlots.Iteration::modules().

Member Data Documentation

◆ chi2cut_

float tmtt::SimpleLR4::chi2cut_
protected

Definition at line 47 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ chi2Mult_

float tmtt::SimpleLR4::chi2Mult_
protected

Definition at line 45 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ chosenRofPhi_

float tmtt::SimpleLR4::chosenRofPhi_
protected

Definition at line 49 of file SimpleLR4.h.

Referenced by SimpleLR4().

◆ debug_

bool tmtt::SimpleLR4::debug_
protected

Definition at line 63 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ denominatorMult_

float tmtt::SimpleLR4::denominatorMult_
protected

Definition at line 44 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ digitize_

bool tmtt::SimpleLR4::digitize_
protected

Definition at line 61 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ dividerBitsChi2_

unsigned int tmtt::SimpleLR4::dividerBitsChi2_
protected

Definition at line 54 of file SimpleLR4.h.

◆ dividerBitsHelix_

unsigned int tmtt::SimpleLR4::dividerBitsHelix_
protected

Definition at line 52 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ dividerBitsHelixZ_

unsigned int tmtt::SimpleLR4::dividerBitsHelixZ_
protected

Definition at line 53 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ invPtToDPhi_

float tmtt::SimpleLR4::invPtToDPhi_
protected

Definition at line 48 of file SimpleLR4.h.

Referenced by fit().

◆ minStubLayersRed_

unsigned int tmtt::SimpleLR4::minStubLayersRed_
protected

Definition at line 50 of file SimpleLR4.h.

Referenced by fit().

◆ numeratorLambdaMult_

float tmtt::SimpleLR4::numeratorLambdaMult_
protected

Definition at line 42 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ numeratorPhiMult_

float tmtt::SimpleLR4::numeratorPhiMult_
protected

Definition at line 43 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ numeratorPtMult_

float tmtt::SimpleLR4::numeratorPtMult_
protected

Definition at line 40 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ numeratorZ0Mult_

float tmtt::SimpleLR4::numeratorZ0Mult_
protected

Definition at line 41 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ phiMult_

float tmtt::SimpleLR4::phiMult_
protected

Definition at line 33 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ phiNonantWidth_

float tmtt::SimpleLR4::phiNonantWidth_
protected

Definition at line 31 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ phiSectorCentre_

float tmtt::SimpleLR4::phiSectorCentre_
protected

Definition at line 30 of file SimpleLR4.h.

Referenced by fit().

◆ phiSectorWidth_

float tmtt::SimpleLR4::phiSectorWidth_
protected

Definition at line 29 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ phiTMult_

float tmtt::SimpleLR4::phiTMult_
protected

Definition at line 37 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ qOverPtMult_

float tmtt::SimpleLR4::qOverPtMult_
protected

Definition at line 36 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ resMult_

float tmtt::SimpleLR4::resMult_
protected

Definition at line 46 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ rTMult_

float tmtt::SimpleLR4::rTMult_
protected

Definition at line 34 of file SimpleLR4.h.

Referenced by SimpleLR4().

◆ shiftingBitsDenRPhi_

unsigned int tmtt::SimpleLR4::shiftingBitsDenRPhi_
protected

Definition at line 56 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ shiftingBitsDenRZ_

unsigned int tmtt::SimpleLR4::shiftingBitsDenRZ_
protected

Definition at line 57 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ shiftingBitsLambda_

unsigned int tmtt::SimpleLR4::shiftingBitsLambda_
protected

Definition at line 60 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ shiftingBitsPhi_

unsigned int tmtt::SimpleLR4::shiftingBitsPhi_
protected

Definition at line 55 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ shiftingBitsPt_

unsigned int tmtt::SimpleLR4::shiftingBitsPt_
protected

Definition at line 58 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ shiftingBitsz0_

unsigned int tmtt::SimpleLR4::shiftingBitsz0_
protected

Definition at line 59 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ tanLambdaMult_

float tmtt::SimpleLR4::tanLambdaMult_
protected

Definition at line 39 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ z0Mult_

float tmtt::SimpleLR4::z0Mult_
protected

Definition at line 38 of file SimpleLR4.h.

Referenced by fit(), and SimpleLR4().

◆ zMult_

float tmtt::SimpleLR4::zMult_
protected

Definition at line 35 of file SimpleLR4.h.

Referenced by SimpleLR4().

tmtt::SimpleLR4::shiftingBitsPhi_
unsigned int shiftingBitsPhi_
Definition: SimpleLR4.h:55
tmtt::Settings::invPtToDphi
double invPtToDphi() const
Definition: Settings.h:395
tmtt::Settings::houghMinPt
double houghMinPt() const
Definition: Settings.h:135
DOFs::dof
dof
Definition: AlignPCLThresholdsWriter.cc:37
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
tmtt::Settings::numPhiNonants
unsigned int numPhiNonants() const
Definition: Settings.h:109
tmtt::Settings::slr_phi0Range
double slr_phi0Range() const
Definition: Settings.h:354
tmtt::SimpleLR4::numeratorPhiMult_
float numeratorPhiMult_
Definition: SimpleLR4.h:43
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
tmtt::SimpleLR4::tanLambdaMult_
float tanLambdaMult_
Definition: SimpleLR4.h:39
tmtt::SimpleLR4::qOverPtMult_
float qOverPtMult_
Definition: SimpleLR4.h:36
tmtt::Settings::enableDigitize
bool enableDigitize() const
Definition: Settings.h:80
tmtt::Settings::slr_z0Bits
unsigned int slr_z0Bits() const
Definition: Settings.h:355
tmtt::SimpleLR4::shiftingBitsDenRZ_
unsigned int shiftingBitsDenRZ_
Definition: SimpleLR4.h:57
tmtt::SimpleLR4::numeratorLambdaMult_
float numeratorLambdaMult_
Definition: SimpleLR4.h:42
PixelMapPlotter.vRes
vRes
Definition: PixelMapPlotter.py:31
tmtt::SimpleLR4::resMult_
float resMult_
Definition: SimpleLR4.h:46
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
tmtt::SimpleLR4::minStubLayersRed_
unsigned int minStubLayersRed_
Definition: SimpleLR4.h:50
tmtt::Settings::dividerBitsHelixZ
unsigned int dividerBitsHelixZ() const
Definition: Settings.h:275
tmtt::Settings::chosenRofPhi
double chosenRofPhi() const
Definition: Settings.h:112
tmtt::Settings::ShiftingBitsPt
unsigned int ShiftingBitsPt() const
Number of bits to reduce the qOverPt parameter numerator calculation weight.
Definition: Settings.h:282
tmtt::Settings::ShiftingBitsDenRZ
unsigned int ShiftingBitsDenRZ() const
Number of bits to reduce the RZ helix parameter denominator calculation weight.
Definition: Settings.h:280
tmtt::Settings::phiSRange
double phiSRange() const
Definition: Settings.h:84
tmtt::SimpleLR4::numeratorZ0Mult_
float numeratorZ0Mult_
Definition: SimpleLR4.h:41
tmtt::Utility::FIT
Definition: Utility.h:28
tmtt::TrackFitGeneric::settings_
const Settings * settings_
Definition: TrackFitGeneric.h:31
tmtt::Settings::slr_oneOver2rRange
double slr_oneOver2rRange() const
Definition: Settings.h:350
tmtt::Settings::slr_tanlambdaBits
unsigned int slr_tanlambdaBits() const
Definition: Settings.h:357
tmtt::SimpleLR4::shiftingBitsLambda_
unsigned int shiftingBitsLambda_
Definition: SimpleLR4.h:60
cms::dd::accepted
bool accepted(std::vector< std::regex > const &, std::string_view)
tmtt::SimpleLR4::phiTMult_
float phiTMult_
Definition: SimpleLR4.h:37
tmtt::Settings::slr_chisquaredRange
double slr_chisquaredRange() const
Definition: Settings.h:360
tmtt::SimpleLR4::invPtToDPhi_
float invPtToDPhi_
Definition: SimpleLR4.h:48
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
tmtt::Settings::zBits
unsigned int zBits() const
Definition: Settings.h:87
tmtt::Settings::ShiftingBitsLambda
unsigned int ShiftingBitsLambda() const
Number of bits to reduce the tanLambda parameter calculation weight.
Definition: Settings.h:286
tmtt::SimpleLR4::denominatorMult_
float denominatorMult_
Definition: SimpleLR4.h:44
tmtt::SimpleLR4::chosenRofPhi_
float chosenRofPhi_
Definition: SimpleLR4.h:49
tmtt::Settings::ShiftingBitsZ0
unsigned int ShiftingBitsZ0() const
Number of bits to reduce the tanLambda parameter calculation weight.
Definition: Settings.h:288
tmtt::SimpleLR4::phiMult_
float phiMult_
Definition: SimpleLR4.h:33
tmtt::SimpleLR4::dividerBitsHelix_
unsigned int dividerBitsHelix_
Definition: SimpleLR4.h:52
tmtt::SimpleLR4::phiNonantWidth_
float phiNonantWidth_
Definition: SimpleLR4.h:31
tmtt::SimpleLR4::rTMult_
float rTMult_
Definition: SimpleLR4.h:34
PVValHelper::phi
Definition: PVValidationHelpers.h:68
tmtt::SimpleLR4::z0Mult_
float z0Mult_
Definition: SimpleLR4.h:38
tmtt::Settings::slr_chisquaredBits
unsigned int slr_chisquaredBits() const
Definition: Settings.h:359
tmtt::Utility::numLayerCut
unsigned int numLayerCut(Utility::AlgoStep algo, const Settings *settings, unsigned int iPhiSec, unsigned int iEtaReg, float invPt, float eta=0.)
Definition: Utility.cc:141
createfilelist.int
int
Definition: createfilelist.py:10
tmtt::SimpleLR4::dividerBitsHelixZ_
unsigned int dividerBitsHelixZ_
Definition: SimpleLR4.h:53
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:27
tmtt::SimpleLR4::zMult_
float zMult_
Definition: SimpleLR4.h:35
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
tmtt::Settings::phiSBits
unsigned int phiSBits() const
Definition: Settings.h:83
tmtt::Settings::dividerBitsHelix
unsigned int dividerBitsHelix() const
Number of bits to be used in hardware to compute the division needed to calculate the helix parameter...
Definition: Settings.h:274
tmtt::Settings::numPhiSectors
unsigned int numPhiSectors() const
Definition: Settings.h:110
tmtt::Settings::zRange
double zRange() const
Definition: Settings.h:88
tmtt::Settings::rtRange
double rtRange() const
Definition: Settings.h:86
tmtt::SimpleLR4::numeratorPtMult_
float numeratorPtMult_
Definition: SimpleLR4.h:40
tmtt::SimpleLR4::shiftingBitsPt_
unsigned int shiftingBitsPt_
Definition: SimpleLR4.h:58
tmtt::SimpleLR4::debug_
bool debug_
Definition: SimpleLR4.h:63
tmtt::SimpleLR4::shiftingBitsDenRPhi_
unsigned int shiftingBitsDenRPhi_
Definition: SimpleLR4.h:56
HLTTauDQMOffline_cfi.denominator
denominator
Definition: HLTTauDQMOffline_cfi.py:195
tmtt::pair_compare
static bool pair_compare(std::pair< const Stub *, float > a, std::pair< const Stub *, float > b)
Definition: SimpleLR4.cc:61
tmtt::SimpleLR4::chi2Mult_
float chi2Mult_
Definition: SimpleLR4.h:45
tmtt::Settings::slr_z0Range
double slr_z0Range() const
Definition: Settings.h:356
tmtt::SimpleLR4::chi2cut_
float chi2cut_
Definition: SimpleLR4.h:47
tmtt::Settings::ResidualCut
double ResidualCut() const
Cut on RPhi Residual (radians)
Definition: Settings.h:292
tmtt::SimpleLR4::phiSectorWidth_
float phiSectorWidth_
Definition: SimpleLR4.h:29
tmtt::Settings::slr_phi0Bits
unsigned int slr_phi0Bits() const
Definition: Settings.h:353
tmtt::Settings::ShiftingBitsPhi
unsigned int ShiftingBitsPhi() const
Number of bits to reduce the PhiT parameter numerator calculation weight.
Definition: Settings.h:284
tmtt::Settings::rtBits
unsigned int rtBits() const
Definition: Settings.h:85
tmtt::Settings::digitizeSLR
bool digitizeSLR() const
Definition: Settings.h:272
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
tmtt::SimpleLR4::digitize_
bool digitize_
Definition: SimpleLR4.h:61
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tmtt::TrackFitGeneric::TrackFitGeneric
TrackFitGeneric(const Settings *settings, const std::string &fitterName="")
Definition: TrackFitGeneric.h:21
tmtt::Settings::slr_chi2cut
double slr_chi2cut() const
ChiSquare Cut.
Definition: Settings.h:290
tmtt::Settings::slr_oneOver2rBits
unsigned int slr_oneOver2rBits() const
Definition: Settings.h:349
tmtt::Settings::ShiftingBitsDenRPhi
unsigned int ShiftingBitsDenRPhi() const
Number of bits to reduce the RPhi helix parameter denominator calculation weight.
Definition: Settings.h:277
tmtt::Settings::slr_tanlambdaRange
double slr_tanlambdaRange() const
Definition: Settings.h:358
tmtt::SimpleLR4::shiftingBitsz0_
unsigned int shiftingBitsz0_
Definition: SimpleLR4.h:59
tmtt::SimpleLR4::phiSectorCentre_
float phiSectorCentre_
Definition: SimpleLR4.h:30