CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
trklet::Projection Class Reference

#include <Projection.h>

Public Member Functions

const FPGAWordfpgafinephivm () const
 
const FPGAWordfpgafinerzvm () const
 
const FPGAWordfpgaphiproj () const
 
const FPGAWordfpgaphiprojder () const
 
const FPGAWordfpgarzbin1projvm () const
 
const FPGAWordfpgarzbin2projvm () const
 
const FPGAWordfpgarzproj () const
 
const FPGAWordfpgarzprojder () const
 
const FPGAWordgetBendIndex () const
 
void init (Settings const &settings, unsigned int layerdisk, int iphiproj, int irzproj, int iphider, int irzder, double phiproj, double rzproj, double phiprojder, double rzprojder, double phiprojapprox, double rzprojapprox, double phiprojderapprox, double rzprojderapprox, bool isPSseed)
 
unsigned int layerdisk () const
 
double phiproj () const
 
double phiprojapprox () const
 
double phiprojder () const
 
double phiprojderapprox () const
 
 Projection ()
 
double rzproj () const
 
double rzprojapprox () const
 
double rzprojder () const
 
double rzprojderapprox () const
 
void setBendIndex (int bendindex)
 
bool valid () const
 
 ~Projection ()=default
 

Protected Attributes

FPGAWord fpgabendindex_
 
FPGAWord fpgafinephivm_
 
FPGAWord fpgafinerzvm_
 
FPGAWord fpgaphiproj_
 
FPGAWord fpgaphiprojder_
 
FPGAWord fpgarzbin1projvm_
 
FPGAWord fpgarzbin2projvm_
 
FPGAWord fpgarzproj_
 
FPGAWord fpgarzprojder_
 
unsigned int layerdisk_
 
double phiproj_
 
double phiprojapprox_
 
double phiprojder_
 
double phiprojderapprox_
 
double rzproj_
 
double rzprojapprox_
 
double rzprojder_
 
double rzprojderapprox_
 
bool valid_
 

Detailed Description

Definition at line 10 of file Projection.h.

Constructor & Destructor Documentation

◆ Projection()

trklet::Projection::Projection ( )
inline

Definition at line 12 of file Projection.h.

References valid_.

12 { valid_ = false; }

◆ ~Projection()

trklet::Projection::~Projection ( )
default

Member Function Documentation

◆ fpgafinephivm()

const FPGAWord& trklet::Projection::fpgafinephivm ( ) const
inline

Definition at line 74 of file Projection.h.

References cms::cuda::assert(), fpgafinephivm_, and valid_.

Referenced by trklet::Tracklet::vmstrdisk(), and trklet::Tracklet::vmstrlayer().

74  {
75  assert(valid_);
76  return fpgafinephivm_;
77  };
FPGAWord fpgafinephivm_
Definition: Projection.h:136
assert(be >=bs)

◆ fpgafinerzvm()

const FPGAWord& trklet::Projection::fpgafinerzvm ( ) const
inline

Definition at line 69 of file Projection.h.

References cms::cuda::assert(), fpgafinerzvm_, and valid_.

Referenced by trklet::Tracklet::vmstrdisk(), and trklet::Tracklet::vmstrlayer().

69  {
70  assert(valid_);
71  return fpgafinerzvm_;
72  };
FPGAWord fpgafinerzvm_
Definition: Projection.h:135
assert(be >=bs)

◆ fpgaphiproj()

const FPGAWord& trklet::Projection::fpgaphiproj ( ) const
inline

◆ fpgaphiprojder()

const FPGAWord& trklet::Projection::fpgaphiprojder ( ) const
inline

◆ fpgarzbin1projvm()

const FPGAWord& trklet::Projection::fpgarzbin1projvm ( ) const
inline

Definition at line 59 of file Projection.h.

References cms::cuda::assert(), fpgarzbin1projvm_, and valid_.

Referenced by trklet::Tracklet::vmstrdisk(), and trklet::Tracklet::vmstrlayer().

59  {
60  assert(valid_);
61  return fpgarzbin1projvm_;
62  };
assert(be >=bs)
FPGAWord fpgarzbin1projvm_
Definition: Projection.h:133

◆ fpgarzbin2projvm()

const FPGAWord& trklet::Projection::fpgarzbin2projvm ( ) const
inline

Definition at line 64 of file Projection.h.

References cms::cuda::assert(), fpgarzbin2projvm_, and valid_.

Referenced by trklet::Tracklet::vmstrdisk(), and trklet::Tracklet::vmstrlayer().

64  {
65  assert(valid_);
66  return fpgarzbin2projvm_;
67  };
assert(be >=bs)
FPGAWord fpgarzbin2projvm_
Definition: Projection.h:134

◆ fpgarzproj()

const FPGAWord& trklet::Projection::fpgarzproj ( ) const
inline

◆ fpgarzprojder()

const FPGAWord& trklet::Projection::fpgarzprojder ( ) const
inline

Definition at line 54 of file Projection.h.

References cms::cuda::assert(), fpgarzprojder_, and valid_.

Referenced by trklet::Tracklet::trackletprojstr(), and trklet::Tracklet::trackletprojstrD().

54  {
55  assert(valid_);
56  return fpgarzprojder_;
57  };
assert(be >=bs)
FPGAWord fpgarzprojder_
Definition: Projection.h:131

◆ getBendIndex()

const FPGAWord& trklet::Projection::getBendIndex ( ) const
inline

Definition at line 121 of file Projection.h.

References fpgabendindex_.

Referenced by trklet::Tracklet::vmstrdisk().

121 { return fpgabendindex_; }
FPGAWord fpgabendindex_
Definition: Projection.h:149

◆ init()

void Projection::init ( Settings const &  settings,
unsigned int  layerdisk,
int  iphiproj,
int  irzproj,
int  iphider,
int  irzder,
double  phiproj,
double  rzproj,
double  phiprojder,
double  rzprojder,
double  phiprojapprox,
double  rzprojapprox,
double  phiprojderapprox,
double  rzprojderapprox,
bool  isPSseed 
)

Definition at line 11 of file Projection.cc.

References cms::cuda::assert(), change_name::diff, trklet::Settings::krprojshiftdisk(), trklet::Settings::MEBins(), trklet::Settings::MEBinsBits(), trklet::N_DISK, trklet::N_LAYER, trklet::N_PSLAYER, trklet::Settings::nbitsallstubs(), trklet::Settings::nbitsphiprojderL123(), trklet::Settings::nbitsphiprojderL456(), trklet::Settings::nbitsvmme(), trklet::Settings::nbitszprojderL123(), trklet::Settings::nbitszprojderL456(), trklet::NFINEPHIBITS, trklet::NFINERZBITS, trklet::Settings::nphibitsstub(), trklet::Settings::nrbitsprojderdisk(), trklet::Settings::nrbitsstub(), trklet::Settings::nzbitsstub(), HLT_IsoTrack_cff::offset, trklet::Settings::rmaxdisk(), trklet::Settings::rmindiskvm(), and sistrip::valid_.

Referenced by trklet::TrackletCalculatorBase::barrelSeeding(), trklet::TrackletCalculatorDisplaced::DDLSeeding(), trklet::TrackletCalculatorBase::diskSeeding(), trklet::TrackletCalculatorDisplaced::LLDSeeding(), trklet::TrackletCalculatorDisplaced::LLLSeeding(), and trklet::TrackletCalculatorBase::overlapSeeding().

25  {
27 
28  valid_ = true;
29 
30  fpgaphiproj_.set(iphiproj, settings.nphibitsstub(layerdisk), true, __LINE__, __FILE__);
31 
32  if (layerdisk < N_LAYER) {
33  fpgarzproj_.set(irzproj, settings.nzbitsstub(layerdisk), false, __LINE__, __FILE__);
34  } else {
35  fpgarzproj_.set(irzproj, settings.nrbitsstub(layerdisk), false, __LINE__, __FILE__);
36  }
37 
38  if (layerdisk < N_LAYER) {
39  if (layerdisk < N_PSLAYER) {
40  fpgaphiprojder_.set(iphider, settings.nbitsphiprojderL123(), false, __LINE__, __FILE__);
41  fpgarzprojder_.set(irzder, settings.nbitszprojderL123(), false, __LINE__, __FILE__);
42  } else {
43  fpgaphiprojder_.set(iphider, settings.nbitsphiprojderL456(), false, __LINE__, __FILE__);
44  fpgarzprojder_.set(irzder, settings.nbitszprojderL456(), false, __LINE__, __FILE__);
45  }
46  } else {
47  fpgaphiprojder_.set(iphider, settings.nbitsphiprojderL123(), false, __LINE__, __FILE__);
48  fpgarzprojder_.set(irzder, settings.nrbitsprojderdisk(), false, __LINE__, __FILE__);
49  }
50 
51  if (layerdisk < N_LAYER) {
56  int offset = isPSseed ? 1 : 4;
57 
58  int ztemp = fpgarzproj_.value() >> (fpgarzproj_.nbits() - settings.MEBinsBits() - NFINERZBITS);
59  unsigned int zbin1 = (1 << (settings.MEBinsBits() - 1)) + ((ztemp - offset) >> NFINERZBITS);
60  unsigned int zbin2 = (1 << (settings.MEBinsBits() - 1)) + ((ztemp + offset) >> NFINERZBITS);
61 
62  if (zbin1 >= settings.MEBins()) {
63  zbin1 = 0; //note that zbin1 is unsigned
64  }
65  if (zbin2 >= settings.MEBins()) {
66  zbin2 = settings.MEBins() - 1;
67  }
68 
69  assert(zbin1 <= zbin2);
70  assert(zbin2 - zbin1 <= 1);
71 
72  fpgarzbin1projvm_.set(zbin1, settings.MEBinsBits(), true, __LINE__, __FILE__); // first z bin
73 
74  int nextbin = zbin1 != zbin2;
75  fpgarzbin2projvm_.set(nextbin, 1, true, __LINE__, __FILE__); // need to check adjacent z bin?
76 
77  //fine vm z bits. Use 4 bits for fine position. starting at zbin 1
78  int finez = ((1 << (settings.MEBinsBits() + NFINERZBITS - 1)) + ztemp) - (zbin1 << NFINERZBITS);
79 
80  fpgafinerzvm_.set(finez, NFINERZBITS + 1, true, __LINE__, __FILE__); // fine z postions starting at zbin1
81 
82  } else {
83  //TODO the -3 and +3 should be evaluated and efficiency for matching hits checked.
84  //This code should be migrated in the ProjectionRouter
85  double roffset = 3.0;
86  int rbin1 = 8.0 * (irzproj * settings.krprojshiftdisk() - roffset - settings.rmindiskvm()) /
87  (settings.rmaxdisk() - settings.rmindiskvm());
88  int rbin2 = 8.0 * (irzproj * settings.krprojshiftdisk() + roffset - settings.rmindiskvm()) /
89  (settings.rmaxdisk() - settings.rmindiskvm());
90 
91  if (rbin1 < 0) {
92  rbin1 = 0;
93  }
94  rbin2 = clamp(rbin2, 0, 7);
95 
96  assert(rbin1 <= rbin2);
97  assert(rbin2 - rbin1 <= 1);
98 
99  int finer = 64 *
100  ((irzproj * settings.krprojshiftdisk() - settings.rmindiskvm()) -
101  rbin1 * (settings.rmaxdisk() - settings.rmindiskvm()) / 8.0) /
102  (settings.rmaxdisk() - settings.rmindiskvm());
103 
104  finer = clamp(finer, 0, 15);
105 
106  int diff = rbin1 != rbin2;
107  if (irzder < 0)
108  rbin1 += 8;
109 
110  fpgarzbin1projvm_.set(rbin1, 4, true, __LINE__, __FILE__); // first r bin
111  fpgarzbin2projvm_.set(diff, 1, true, __LINE__, __FILE__); // need to check adjacent r bin
112 
113  fpgafinerzvm_.set(finer, 4, true, __LINE__, __FILE__); // fine r postions starting at rbin1
114  }
115 
116  //fine phi bits
117  int projfinephi =
118  (fpgaphiproj_.value() >>
119  (fpgaphiproj_.nbits() - (settings.nbitsallstubs(layerdisk) + settings.nbitsvmme(layerdisk) + NFINEPHIBITS))) &
120  ((1 << NFINEPHIBITS) - 1);
121  fpgafinephivm_.set(projfinephi, NFINEPHIBITS, true, __LINE__, __FILE__); // fine phi postions
122 
123  phiproj_ = phiproj;
124  rzproj_ = rzproj;
127 
132 }
double rzprojder() const
Definition: Projection.h:94
constexpr int N_DISK
Definition: Settings.h:26
double phiprojderapprox() const
Definition: Projection.h:109
double phiprojapprox() const
Definition: Projection.h:99
FPGAWord fpgafinephivm_
Definition: Projection.h:136
double rzproj() const
Definition: Projection.h:84
double rzprojderapprox_
Definition: Projection.h:146
FPGAWord fpgafinerzvm_
Definition: Projection.h:135
assert(be >=bs)
double phiproj() const
Definition: Projection.h:79
FPGAWord fpgarzbin1projvm_
Definition: Projection.h:133
double rzprojapprox() const
Definition: Projection.h:104
unsigned int layerdisk() const
Definition: Projection.h:34
FPGAWord fpgarzprojder_
Definition: Projection.h:131
int value() const
Definition: FPGAWord.h:24
constexpr unsigned int NFINERZBITS
Definition: Settings.h:37
double phiprojder() const
Definition: Projection.h:89
constexpr unsigned int N_PSLAYER
Definition: Settings.h:27
double phiprojderapprox_
Definition: Projection.h:145
int nbits() const
Definition: FPGAWord.h:25
FPGAWord fpgarzproj_
Definition: Projection.h:129
constexpr unsigned int NFINEPHIBITS
Definition: Settings.h:38
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
FPGAWord fpgaphiprojder_
Definition: Projection.h:130
FPGAWord fpgaphiproj_
Definition: Projection.h:128
double rzprojderapprox() const
Definition: Projection.h:114
FPGAWord fpgarzbin2projvm_
Definition: Projection.h:134
constexpr int N_LAYER
Definition: Settings.h:25

◆ layerdisk()

unsigned int trklet::Projection::layerdisk ( ) const
inline

Definition at line 34 of file Projection.h.

References cms::cuda::assert(), layerdisk_, and valid_.

34  {
35  assert(valid_);
36  return layerdisk_;
37  };
assert(be >=bs)
unsigned int layerdisk_
Definition: Projection.h:126

◆ phiproj()

double trklet::Projection::phiproj ( ) const
inline

Definition at line 79 of file Projection.h.

References cms::cuda::assert(), phiproj_, and valid_.

79  {
80  assert(valid_);
81  return phiproj_;
82  };
assert(be >=bs)

◆ phiprojapprox()

double trklet::Projection::phiprojapprox ( ) const
inline

Definition at line 99 of file Projection.h.

References cms::cuda::assert(), phiprojapprox_, and valid_.

99  {
100  assert(valid_);
101  return phiprojapprox_;
102  };
assert(be >=bs)

◆ phiprojder()

double trklet::Projection::phiprojder ( ) const
inline

Definition at line 89 of file Projection.h.

References cms::cuda::assert(), phiprojder_, and valid_.

89  {
90  assert(valid_);
91  return phiprojder_;
92  };
assert(be >=bs)

◆ phiprojderapprox()

double trklet::Projection::phiprojderapprox ( ) const
inline

Definition at line 109 of file Projection.h.

References cms::cuda::assert(), phiprojderapprox_, and valid_.

109  {
110  assert(valid_);
111  return phiprojderapprox_;
112  };
assert(be >=bs)
double phiprojderapprox_
Definition: Projection.h:145

◆ rzproj()

double trklet::Projection::rzproj ( ) const
inline

Definition at line 84 of file Projection.h.

References cms::cuda::assert(), rzproj_, and valid_.

84  {
85  assert(valid_);
86  return rzproj_;
87  };
assert(be >=bs)

◆ rzprojapprox()

double trklet::Projection::rzprojapprox ( ) const
inline

Definition at line 104 of file Projection.h.

References cms::cuda::assert(), rzprojapprox_, and valid_.

104  {
105  assert(valid_);
106  return rzprojapprox_;
107  };
assert(be >=bs)

◆ rzprojder()

double trklet::Projection::rzprojder ( ) const
inline

Definition at line 94 of file Projection.h.

References cms::cuda::assert(), rzprojder_, and valid_.

94  {
95  assert(valid_);
96  return rzprojder_;
97  };
assert(be >=bs)

◆ rzprojderapprox()

double trklet::Projection::rzprojderapprox ( ) const
inline

Definition at line 114 of file Projection.h.

References cms::cuda::assert(), rzprojderapprox_, and valid_.

114  {
115  assert(valid_);
116  return rzprojderapprox_;
117  };
double rzprojderapprox_
Definition: Projection.h:146
assert(be >=bs)

◆ setBendIndex()

void trklet::Projection::setBendIndex ( int  bendindex)
inline

Definition at line 119 of file Projection.h.

References fpgabendindex_, and trklet::FPGAWord::set().

119 { fpgabendindex_.set(bendindex, 5, true, __LINE__, __FILE__); }
FPGAWord fpgabendindex_
Definition: Projection.h:149
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14

◆ valid()

bool trklet::Projection::valid ( ) const
inline

Definition at line 32 of file Projection.h.

References valid_.

Referenced by trklet::Tracklet::validProj().

32 { return valid_; }

Member Data Documentation

◆ fpgabendindex_

FPGAWord trklet::Projection::fpgabendindex_
protected

Definition at line 149 of file Projection.h.

Referenced by getBendIndex(), and setBendIndex().

◆ fpgafinephivm_

FPGAWord trklet::Projection::fpgafinephivm_
protected

Definition at line 136 of file Projection.h.

Referenced by fpgafinephivm().

◆ fpgafinerzvm_

FPGAWord trklet::Projection::fpgafinerzvm_
protected

Definition at line 135 of file Projection.h.

Referenced by fpgafinerzvm().

◆ fpgaphiproj_

FPGAWord trklet::Projection::fpgaphiproj_
protected

Definition at line 128 of file Projection.h.

Referenced by fpgaphiproj().

◆ fpgaphiprojder_

FPGAWord trklet::Projection::fpgaphiprojder_
protected

Definition at line 130 of file Projection.h.

Referenced by fpgaphiprojder().

◆ fpgarzbin1projvm_

FPGAWord trklet::Projection::fpgarzbin1projvm_
protected

Definition at line 133 of file Projection.h.

Referenced by fpgarzbin1projvm().

◆ fpgarzbin2projvm_

FPGAWord trklet::Projection::fpgarzbin2projvm_
protected

Definition at line 134 of file Projection.h.

Referenced by fpgarzbin2projvm().

◆ fpgarzproj_

FPGAWord trklet::Projection::fpgarzproj_
protected

Definition at line 129 of file Projection.h.

Referenced by fpgarzproj().

◆ fpgarzprojder_

FPGAWord trklet::Projection::fpgarzprojder_
protected

Definition at line 131 of file Projection.h.

Referenced by fpgarzprojder().

◆ layerdisk_

unsigned int trklet::Projection::layerdisk_
protected

Definition at line 126 of file Projection.h.

Referenced by layerdisk().

◆ phiproj_

double trklet::Projection::phiproj_
protected

Definition at line 138 of file Projection.h.

Referenced by phiproj().

◆ phiprojapprox_

double trklet::Projection::phiprojapprox_
protected

Definition at line 143 of file Projection.h.

Referenced by phiprojapprox().

◆ phiprojder_

double trklet::Projection::phiprojder_
protected

Definition at line 140 of file Projection.h.

Referenced by phiprojder().

◆ phiprojderapprox_

double trklet::Projection::phiprojderapprox_
protected

Definition at line 145 of file Projection.h.

Referenced by phiprojderapprox().

◆ rzproj_

double trklet::Projection::rzproj_
protected

Definition at line 139 of file Projection.h.

Referenced by rzproj().

◆ rzprojapprox_

double trklet::Projection::rzprojapprox_
protected

Definition at line 144 of file Projection.h.

Referenced by rzprojapprox().

◆ rzprojder_

double trklet::Projection::rzprojder_
protected

Definition at line 141 of file Projection.h.

Referenced by rzprojder().

◆ rzprojderapprox_

double trklet::Projection::rzprojderapprox_
protected

Definition at line 146 of file Projection.h.

Referenced by rzprojderapprox().

◆ valid_

bool trklet::Projection::valid_
protected