CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

trklet::Projection::Projection ( )
inline

Definition at line 12 of file Projection.h.

References valid_.

12 { valid_ = false; }
trklet::Projection::~Projection ( )
default

Member Function Documentation

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::MatchEngine::execute(), trklet::Tracklet::vmstrdisk(), and trklet::Tracklet::vmstrlayer().

74  {
75  assert(valid_);
76  return fpgafinephivm_;
77  };
FPGAWord fpgafinephivm_
Definition: Projection.h:136
assert(be >=bs)
const FPGAWord& trklet::Projection::fpgafinerzvm ( ) const
inline
const FPGAWord& trklet::Projection::fpgaphiproj ( ) const
inline
const FPGAWord& trklet::Projection::fpgaphiprojder ( ) const
inline
const FPGAWord& trklet::Projection::fpgarzbin1projvm ( ) const
inline
const FPGAWord& trklet::Projection::fpgarzbin2projvm ( ) const
inline
const FPGAWord& trklet::Projection::fpgarzproj ( ) const
inline
const FPGAWord& trklet::Projection::fpgarzprojder ( ) const
inline
const FPGAWord& trklet::Projection::getBendIndex ( ) const
inline

Definition at line 121 of file Projection.h.

References fpgabendindex_.

Referenced by trklet::MatchEngine::execute(), and trklet::Tracklet::vmstrdisk().

121 { return fpgabendindex_; }
FPGAWord fpgabendindex_
Definition: Projection.h:149
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(), 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().

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 }
constexpr int N_DISK
Definition: Settings.h:22
double rzproj() const
Definition: Projection.h:84
int nbits() const
Definition: FPGAWord.h:25
FPGAWord fpgafinephivm_
Definition: Projection.h:136
unsigned int layerdisk() const
Definition: Projection.h:34
double rzprojderapprox_
Definition: Projection.h:146
FPGAWord fpgafinerzvm_
Definition: Projection.h:135
assert(be >=bs)
FPGAWord fpgarzbin1projvm_
Definition: Projection.h:133
int value() const
Definition: FPGAWord.h:24
FPGAWord fpgarzprojder_
Definition: Projection.h:131
constexpr unsigned int NFINERZBITS
Definition: Settings.h:33
constexpr unsigned int N_PSLAYER
Definition: Settings.h:23
double phiprojderapprox_
Definition: Projection.h:145
FPGAWord fpgarzproj_
Definition: Projection.h:129
constexpr unsigned int NFINEPHIBITS
Definition: Settings.h:34
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
double phiprojderapprox() const
Definition: Projection.h:109
FPGAWord fpgaphiprojder_
Definition: Projection.h:130
double rzprojapprox() const
Definition: Projection.h:104
FPGAWord fpgaphiproj_
Definition: Projection.h:128
double phiproj() const
Definition: Projection.h:79
double rzprojderapprox() const
Definition: Projection.h:114
FPGAWord fpgarzbin2projvm_
Definition: Projection.h:134
double phiprojapprox() const
Definition: Projection.h:99
double phiprojder() const
Definition: Projection.h:89
constexpr int N_LAYER
Definition: Settings.h:21
double rzprojder() const
Definition: Projection.h:94
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
double trklet::Projection::phiproj ( ) const
inline

Definition at line 79 of file Projection.h.

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

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

79  {
80  assert(valid_);
81  return phiproj_;
82  };
assert(be >=bs)
double trklet::Projection::phiprojapprox ( ) const
inline

Definition at line 99 of file Projection.h.

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

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

99  {
100  assert(valid_);
101  return phiprojapprox_;
102  };
assert(be >=bs)
double trklet::Projection::phiprojder ( ) const
inline

Definition at line 89 of file Projection.h.

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

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

89  {
90  assert(valid_);
91  return phiprojder_;
92  };
assert(be >=bs)
double trklet::Projection::phiprojderapprox ( ) const
inline

Definition at line 109 of file Projection.h.

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

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

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

Definition at line 84 of file Projection.h.

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

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

84  {
85  assert(valid_);
86  return rzproj_;
87  };
assert(be >=bs)
double trklet::Projection::rzprojapprox ( ) const
inline

Definition at line 104 of file Projection.h.

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

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

104  {
105  assert(valid_);
106  return rzprojapprox_;
107  };
assert(be >=bs)
double trklet::Projection::rzprojder ( ) const
inline

Definition at line 94 of file Projection.h.

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

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

94  {
95  assert(valid_);
96  return rzprojder_;
97  };
assert(be >=bs)
double trklet::Projection::rzprojderapprox ( ) const
inline

Definition at line 114 of file Projection.h.

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

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

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

Definition at line 119 of file Projection.h.

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

Referenced by trklet::ProjectionRouter::execute(), and trklet::MatchProcessor::execute().

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

FPGAWord trklet::Projection::fpgabendindex_
protected

Definition at line 149 of file Projection.h.

Referenced by getBendIndex(), and setBendIndex().

FPGAWord trklet::Projection::fpgafinephivm_
protected

Definition at line 136 of file Projection.h.

Referenced by fpgafinephivm().

FPGAWord trklet::Projection::fpgafinerzvm_
protected

Definition at line 135 of file Projection.h.

Referenced by fpgafinerzvm().

FPGAWord trklet::Projection::fpgaphiproj_
protected

Definition at line 128 of file Projection.h.

Referenced by fpgaphiproj().

FPGAWord trklet::Projection::fpgaphiprojder_
protected

Definition at line 130 of file Projection.h.

Referenced by fpgaphiprojder().

FPGAWord trklet::Projection::fpgarzbin1projvm_
protected

Definition at line 133 of file Projection.h.

Referenced by fpgarzbin1projvm().

FPGAWord trklet::Projection::fpgarzbin2projvm_
protected

Definition at line 134 of file Projection.h.

Referenced by fpgarzbin2projvm().

FPGAWord trklet::Projection::fpgarzproj_
protected

Definition at line 129 of file Projection.h.

Referenced by fpgarzproj().

FPGAWord trklet::Projection::fpgarzprojder_
protected

Definition at line 131 of file Projection.h.

Referenced by fpgarzprojder().

unsigned int trklet::Projection::layerdisk_
protected

Definition at line 126 of file Projection.h.

Referenced by layerdisk().

double trklet::Projection::phiproj_
protected

Definition at line 138 of file Projection.h.

Referenced by phiproj().

double trklet::Projection::phiprojapprox_
protected

Definition at line 143 of file Projection.h.

Referenced by phiprojapprox().

double trklet::Projection::phiprojder_
protected

Definition at line 140 of file Projection.h.

Referenced by phiprojder().

double trklet::Projection::phiprojderapprox_
protected

Definition at line 145 of file Projection.h.

Referenced by phiprojderapprox().

double trklet::Projection::rzproj_
protected

Definition at line 139 of file Projection.h.

Referenced by rzproj().

double trklet::Projection::rzprojapprox_
protected

Definition at line 144 of file Projection.h.

Referenced by rzprojapprox().

double trklet::Projection::rzprojder_
protected

Definition at line 141 of file Projection.h.

Referenced by rzprojder().

double trklet::Projection::rzprojderapprox_
protected

Definition at line 146 of file Projection.h.

Referenced by rzprojderapprox().

bool trklet::Projection::valid_
protected