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.

12 { valid_ = false; }

References valid_.

◆ ~Projection()

trklet::Projection::~Projection ( )
default

Member Function Documentation

◆ fpgafinephivm()

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

Definition at line 74 of file Projection.h.

74  {
75  assert(valid_);
76  return fpgafinephivm_;
77  };

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

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

◆ fpgafinerzvm()

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

Definition at line 69 of file Projection.h.

69  {
70  assert(valid_);
71  return fpgafinerzvm_;
72  };

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

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

◆ 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.

59  {
60  assert(valid_);
61  return fpgarzbin1projvm_;
62  };

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

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

◆ fpgarzbin2projvm()

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

Definition at line 64 of file Projection.h.

64  {
65  assert(valid_);
66  return fpgarzbin2projvm_;
67  };

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

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

◆ fpgarzproj()

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

◆ fpgarzprojder()

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

Definition at line 54 of file Projection.h.

54  {
55  assert(valid_);
56  return fpgarzprojder_;
57  };

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

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

◆ getBendIndex()

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

Definition at line 121 of file Projection.h.

121 { return fpgabendindex_; }

References fpgabendindex_.

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

◆ 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.

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 }

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(), hltrates_dqm_sourceclient-live_cfg::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().

◆ layerdisk()

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

Definition at line 34 of file Projection.h.

34  {
35  assert(valid_);
36  return layerdisk_;
37  };

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

◆ phiproj()

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

Definition at line 79 of file Projection.h.

79  {
80  assert(valid_);
81  return phiproj_;
82  };

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

◆ phiprojapprox()

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

Definition at line 99 of file Projection.h.

99  {
100  assert(valid_);
101  return phiprojapprox_;
102  };

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

◆ phiprojder()

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

Definition at line 89 of file Projection.h.

89  {
90  assert(valid_);
91  return phiprojder_;
92  };

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

◆ phiprojderapprox()

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

Definition at line 109 of file Projection.h.

109  {
110  assert(valid_);
111  return phiprojderapprox_;
112  };

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

◆ rzproj()

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

Definition at line 84 of file Projection.h.

84  {
85  assert(valid_);
86  return rzproj_;
87  };

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

◆ rzprojapprox()

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

Definition at line 104 of file Projection.h.

104  {
105  assert(valid_);
106  return rzprojapprox_;
107  };

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

◆ rzprojder()

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

Definition at line 94 of file Projection.h.

94  {
95  assert(valid_);
96  return rzprojder_;
97  };

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

◆ rzprojderapprox()

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

Definition at line 114 of file Projection.h.

114  {
115  assert(valid_);
116  return rzprojderapprox_;
117  };

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

◆ setBendIndex()

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

Definition at line 119 of file Projection.h.

119 { fpgabendindex_.set(bendindex, 5, true, __LINE__, __FILE__); }

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

◆ valid()

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

Definition at line 32 of file Projection.h.

32 { return valid_; }

References valid_.

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

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
trklet::N_PSLAYER
constexpr unsigned int N_PSLAYER
Definition: Settings.h:23
change_name.diff
diff
Definition: change_name.py:13
trklet::Projection::phiprojderapprox
double phiprojderapprox() const
Definition: Projection.h:109
trklet::Projection::fpgafinerzvm_
FPGAWord fpgafinerzvm_
Definition: Projection.h:135
trklet::Projection::rzprojderapprox_
double rzprojderapprox_
Definition: Projection.h:146
cms::cuda::assert
assert(be >=bs)
trklet::Projection::fpgafinephivm_
FPGAWord fpgafinephivm_
Definition: Projection.h:136
trklet::FPGAWord::set
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
trklet::N_DISK
constexpr int N_DISK
Definition: Settings.h:22
trklet::FPGAWord::nbits
int nbits() const
Definition: FPGAWord.h:25
trklet::Projection::phiproj_
double phiproj_
Definition: Projection.h:138
trklet::Projection::rzprojapprox_
double rzprojapprox_
Definition: Projection.h:144
trklet::Projection::phiprojapprox
double phiprojapprox() const
Definition: Projection.h:99
trklet::Projection::rzprojapprox
double rzprojapprox() const
Definition: Projection.h:104
trklet::NFINEPHIBITS
constexpr unsigned int NFINEPHIBITS
Definition: Settings.h:34
trklet::Projection::fpgabendindex_
FPGAWord fpgabendindex_
Definition: Projection.h:149
trklet::Projection::fpgarzbin1projvm_
FPGAWord fpgarzbin1projvm_
Definition: Projection.h:133
trklet::Projection::valid_
bool valid_
Definition: Projection.h:124
trklet::N_LAYER
constexpr int N_LAYER
Definition: Settings.h:21
trklet::Projection::phiproj
double phiproj() const
Definition: Projection.h:79
trklet::Projection::rzproj_
double rzproj_
Definition: Projection.h:139
trklet::Projection::layerdisk
unsigned int layerdisk() const
Definition: Projection.h:34
trklet::Projection::phiprojderapprox_
double phiprojderapprox_
Definition: Projection.h:145
trklet::Projection::phiprojder_
double phiprojder_
Definition: Projection.h:140
trklet::Projection::rzprojder_
double rzprojder_
Definition: Projection.h:141
trklet::Projection::phiprojder
double phiprojder() const
Definition: Projection.h:89
trklet::FPGAWord::value
int value() const
Definition: FPGAWord.h:24
trklet::Projection::fpgarzbin2projvm_
FPGAWord fpgarzbin2projvm_
Definition: Projection.h:134
trklet::Projection::fpgaphiprojder_
FPGAWord fpgaphiprojder_
Definition: Projection.h:130
trklet::Projection::fpgarzprojder_
FPGAWord fpgarzprojder_
Definition: Projection.h:131
trklet::NFINERZBITS
constexpr unsigned int NFINERZBITS
Definition: Settings.h:33
trklet::Projection::fpgaphiproj_
FPGAWord fpgaphiproj_
Definition: Projection.h:128
trklet::Projection::rzprojder
double rzprojder() const
Definition: Projection.h:94
trklet::Projection::rzprojderapprox
double rzprojderapprox() const
Definition: Projection.h:114
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
trklet::Projection::fpgarzproj_
FPGAWord fpgarzproj_
Definition: Projection.h:129
trklet::Projection::layerdisk_
unsigned int layerdisk_
Definition: Projection.h:126
trklet::Projection::phiprojapprox_
double phiprojapprox_
Definition: Projection.h:143
trklet::Projection::rzproj
double rzproj() const
Definition: Projection.h:84