CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Residual.cc
Go to the documentation of this file.
3 
4 using namespace std;
5 using namespace trklet;
6 
7 void Residual::init(Settings const& settings,
8  unsigned int layerdisk,
9  int iphiresid,
10  int irzresid,
11  int istubid,
12  double phiresid,
13  double rzresid,
14  double phiresidapprox,
15  double rzresidapprox,
16  const Stub* stubptr) {
17  assert(layerdisk < N_LAYER + N_DISK);
18 
19  if (valid_ && (std::abs(iphiresid) > std::abs(fpgaphiresid_.value())))
20  return;
21 
22  valid_ = true;
23 
24  layerdisk_ = layerdisk;
25 
26  fpgaphiresid_.set(iphiresid, settings.phiresidbits(), false, __LINE__, __FILE__);
27  if (layerdisk < N_LAYER) {
28  fpgarzresid_.set(irzresid, settings.zresidbits(), false, __LINE__, __FILE__);
29  } else {
30  fpgarzresid_.set(irzresid, settings.rresidbits(), false, __LINE__, __FILE__);
31  }
32 
33  int nbitsid = 10;
34  fpgastubid_.set(istubid, nbitsid, true, __LINE__, __FILE__);
35  assert(!fpgaphiresid_.atExtreme());
36 
37  phiresid_ = phiresid;
38  rzresid_ = rzresid;
39 
40  phiresidapprox_ = phiresidapprox;
41  rzresidapprox_ = rzresidapprox;
42 
43  stubptr_ = stubptr;
44 }
constexpr int N_DISK
Definition: Settings.h:22
int init
Definition: HydjetWrapper.h:64
int zresidbits() const
Definition: Settings.h:368
static const uint16_t valid_
Definition: Constants.h:17
assert(be >=bs)
int phiresidbits() const
Definition: Settings.h:367
int rresidbits() const
Definition: Settings.h:369
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
constexpr int N_LAYER
Definition: Settings.h:21