CMS 3D CMS Logo

ProjectionRouterBendTable.cc
Go to the documentation of this file.
5 
6 using namespace trklet;
7 
9  Globals* globals,
10  unsigned int nrbits,
11  unsigned int nphiderbits) {
12  for (unsigned int idisk = 0; idisk < N_DISK; idisk++) {
13  unsigned int nsignbins = 2;
14  unsigned int nrbins = 1 << (nrbits);
15  unsigned int nphiderbins = 1 << (nphiderbits);
16 
17  for (unsigned int isignbin = 0; isignbin < nsignbins; isignbin++) {
18  for (unsigned int irbin = 0; irbin < nrbins; irbin++) {
19  int ir = irbin;
20  if (ir > (1 << (nrbits - 1)))
21  ir -= (1 << nrbits);
22  ir = ir << (settings.nrbitsstub(N_LAYER) - nrbits);
23  for (unsigned int iphiderbin = 0; iphiderbin < nphiderbins; iphiderbin++) {
24  int iphider = iphiderbin;
25  if (iphider > (1 << (nphiderbits - 1)))
26  iphider -= (1 << nphiderbits);
27  iphider = iphider << (settings.nbitsphiprojderL123() - nphiderbits);
28 
29  double rproj = ir * settings.krprojshiftdisk();
30  double phider = iphider * globals->ITC_L1L2()->der_phiD_final.K();
31  double t = settings.zmean(idisk) / rproj;
32 
33  if (isignbin)
34  t = -t;
35 
36  double rinv = -phider * (2.0 * t);
37 
38  double stripPitch = (rproj < settings.rcrit()) ? settings.stripPitch(true) : settings.stripPitch(false);
39  double bendproj = 0.5 * bend(rproj, rinv, stripPitch);
40 
41  int ibendproj = 2.0 * bendproj + 15.5;
42  if (ibendproj < 0)
43  ibendproj = 0;
44  if (ibendproj > 31)
45  ibendproj = 31;
46 
47  bendtable_[idisk].push_back(ibendproj);
48  }
49  }
50  }
51  }
52 }
53 
54 int ProjectionRouterBendTable::bendLoookup(int diskindex, int bendindex) { return bendtable_[diskindex][bendindex]; }
trklet::ProjectionRouterBendTable::bendtable_
std::vector< int > bendtable_[N_DISK]
Definition: ProjectionRouterBendTable.h:27
Util.h
trklet::Settings::krprojshiftdisk
double krprojshiftdisk() const
Definition: Settings.h:341
trklet::Settings
Definition: Settings.h:26
trklet::N_DISK
constexpr int N_DISK
Definition: Settings.h:20
ProjectionRouterBendTable.h
trklet::Globals
Definition: Globals.h:32
trklet::Settings::nrbitsstub
unsigned int nrbitsstub(unsigned int layerdisk) const
Definition: Settings.h:66
trklet::N_LAYER
constexpr int N_LAYER
Definition: Settings.h:19
trklet::Settings::zmean
double zmean(unsigned int iDisk) const
Definition: Settings.h:131
trklet::IMATH_TrackletCalculator::der_phiD_final
VarAdjustK der_phiD_final
Definition: IMATH_TrackletCalculator.h:339
trklet::ProjectionRouterBendTable::init
void init(Settings const &settings, Globals *globals, unsigned int nrbits, unsigned int nphiderbits)
Definition: ProjectionRouterBendTable.cc:8
trklet::rinv
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:167
trklet::VarBase::K
double K() const
Definition: imath.h:246
trklet::Globals::ITC_L1L2
IMATH_TrackletCalculator * ITC_L1L2()
Definition: Globals.h:52
Globals.h
trklet
Definition: AllProjectionsMemory.h:9
trklet::ProjectionRouterBendTable::bendLoookup
int bendLoookup(int diskindex, int bendindex)
Definition: ProjectionRouterBendTable.cc:54
trklet::Settings::stripPitch
double stripPitch(bool isPSmodule) const
Definition: Settings.h:219
IMATH_TrackletCalculator.h
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:160
trklet::Settings::rcrit
double rcrit() const
Definition: Settings.h:236
trklet::Settings::nbitsphiprojderL123
unsigned int nbitsphiprojderL123() const
Definition: Settings.h:69
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644