CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trklet::Stub Class Reference

#include <Stub.h>

Public Member Functions

FPGAWord allStubIndex () const
 
const FPGAWordalpha () const
 
const FPGAWordbend () const
 
const FPGAWorddisk () const
 
FPGAWord iphivmFineBins (int VMbits, int finebits) const
 
bool isBarrel () const
 
bool isPSmodule () const
 
L1TStubl1tstub ()
 
const L1TStubl1tstub () const
 
const FPGAWordlayer () const
 
unsigned int layerdisk () const
 
const FPGAWordnegdisk () const
 
const FPGAWordphi () const
 
double phiapprox (double phimin, double) const
 
const FPGAWordphicorr () const
 
unsigned int phiregionaddress () const
 
std::string phiregionaddressstr () const
 
std::string phiregionstr () const
 
const FPGAWordr () const
 
double rapprox () const
 
void setAllStubIndex (int nstub)
 
void setl1tstub (L1TStub *l1tstub)
 
void setPhiCorr (int phiCorr)
 
std::string str () const
 
std::string strbare () const
 
std::string strinner () const
 
 Stub (Settings const &settings)
 
 Stub (L1TStub &stub, Settings const &settings, Globals &globals)
 
const FPGAWordstubindex () const
 
const FPGAWordz () const
 
double zapprox () const
 
 ~Stub ()=default
 

Private Attributes

FPGAWord alpha_
 
FPGAWord bend_
 
FPGAWord disk_
 
L1TStubl1tstub_
 
FPGAWord layer_
 
unsigned int layerdisk_
 
FPGAWord negdisk_
 
FPGAWord phi_
 
FPGAWord phicorr_
 
FPGAWord r_
 
Settings const & settings_
 
FPGAWord stubindex_
 
FPGAWord z_
 

Detailed Description

Definition at line 18 of file Stub.h.

Constructor & Destructor Documentation

◆ Stub() [1/2]

Stub::Stub ( Settings const &  settings)

Definition at line 15 of file Stub.cc.

15 : settings_(settings) {}
Settings const & settings_
Definition: Stub.h:107

◆ Stub() [2/2]

Stub::Stub ( L1TStub stub,
Settings const &  settings,
Globals globals 
)

Definition at line 17 of file Stub.cc.

References alpha_, cms::cuda::assert(), bend(), bend_, trklet::Settings::bendcut(), trklet::Settings::benddecode(), trklet::Settings::bfield(), trklet::Settings::c(), trklet::L1SimTrack::charge(), trklet::convertHexToBin(), disk(), disk_, trklet::Globals::event(), trklet::L1TStub::isPSmodule(), l1tstub_, layer_, trklet::L1TStub::layerdisk(), layerdisk_, trklet::N_BENDBITS_2S, trklet::N_BENDBITS_PS, trklet::N_LAYER, trklet::Settings::nbitsalpha(), negdisk(), negdisk_, trklet::Settings::nphibitsstub(), trklet::Settings::nrbitsstub(), trklet::SLHCEvent::nsimtracks(), trklet::Settings::nzbitsstub(), trklet::Globals::ofstream(), phi_, phicorr_, trklet::L1SimTrack::pt(), trklet::L1TStub::r(), r_, trklet::rinv(), trklet::FPGAWord::set(), settings_, trklet::SLHCEvent::simtrack(), trklet::Settings::stripPitch(), trklet::L1TStub::stubword(), trklet::L1TStub::tpmatch2(), trklet::L1SimTrack::trackid(), trklet::Settings::writeMonitorData(), trklet::L1TStub::z(), and z_.

17  : settings_(settings) {
18  const string& stubwordhex = stub.stubword();
19 
20  const string stubwordbin = convertHexToBin(stubwordhex);
21 
22  layerdisk_ = stub.layerdisk();
23 
24  int nbendbits = stub.isPSmodule() ? N_BENDBITS_PS : N_BENDBITS_2S;
25 
26  int nalphabits = 0;
27 
28  int nrbits = settings_.nrbitsstub(layerdisk_);
29  int nzbits = settings_.nzbitsstub(layerdisk_);
30  int nphibits = settings_.nphibitsstub(layerdisk_);
31 
32  if (layerdisk_ >= N_LAYER && !stub.isPSmodule()) {
33  nalphabits = settings.nbitsalpha();
34  nrbits = 7;
35  }
36 
37  assert(nbendbits + nalphabits + nrbits + nzbits + nphibits == 36);
38 
39  bitset<32> rbits(stubwordbin.substr(0, nrbits));
40  bitset<32> zbits(stubwordbin.substr(nrbits, nzbits));
41  bitset<32> phibits(stubwordbin.substr(nrbits + nzbits, nphibits));
42  bitset<32> alphabits(stubwordbin.substr(nphibits + nzbits + nrbits, nalphabits));
43  bitset<32> bendbits(stubwordbin.substr(nphibits + nzbits + nrbits + nalphabits, nbendbits));
44 
45  int newbend = bendbits.to_ulong();
46 
47  int newr = rbits.to_ulong();
48  if (layerdisk_ < N_LAYER) {
49  if (newr >= (1 << (nrbits - 1)))
50  newr = newr - (1 << nrbits);
51  }
52 
53  int newz = zbits.to_ulong();
54  if (newz >= (1 << (nzbits - 1)))
55  newz = newz - (1 << nzbits);
56 
57  int newphi = phibits.to_ulong();
58 
59  int newalpha = alphabits.to_ulong();
60  if (newalpha >= (1 << (nalphabits - 1)))
61  newalpha = newalpha - (1 << nalphabits);
62 
63  l1tstub_ = &stub;
64 
65  bend_.set(newbend, nbendbits, true, __LINE__, __FILE__);
66 
67  phi_.set(newphi, nphibits, true, __LINE__, __FILE__);
68  phicorr_.set(newphi, nphibits, true, __LINE__, __FILE__);
69  bool pos = false;
70  if (layerdisk_ >= N_LAYER) {
71  pos = true;
72  int disk = layerdisk_ - N_LAYER + 1;
73  if (stub.z() < 0.0)
74  disk = -disk;
75  disk_.set(disk, 4, false, __LINE__, __FILE__);
76  if (!stub.isPSmodule()) {
77  alpha_.set(newalpha, nalphabits, false, __LINE__, __FILE__);
78  nrbits = 4;
79  }
80  int negdisk = (disk < 0) ? 1 : 0;
81  negdisk_.set(negdisk, 1, true, __LINE__, __FILE__);
82  } else {
83  disk_.set(0, 4, false, __LINE__, __FILE__);
84  layer_.set(layerdisk_, 3, true, __LINE__, __FILE__);
85  }
86  r_.set(newr, nrbits, pos, __LINE__, __FILE__);
87  z_.set(newz, nzbits, false, __LINE__, __FILE__);
88 
89  if (settings.writeMonitorData("StubBend")) {
90  unsigned int nsimtrks = globals.event()->nsimtracks();
91 
92  for (unsigned int isimtrk = 0; isimtrk < nsimtrks; isimtrk++) {
93  const L1SimTrack& simtrk = globals.event()->simtrack(isimtrk);
94  if (stub.tpmatch2(simtrk.trackid())) {
95  double dr = 0.18;
96  double rinv = simtrk.charge() * 0.01 * settings_.c() * settings_.bfield() / simtrk.pt();
97  double pitch = settings_.stripPitch(stub.isPSmodule());
98  double bend = stub.r() * dr * 0.5 * rinv / pitch;
99 
100  globals.ofstream("stubbend.dat") << layerdisk_ << " " << stub.isPSmodule() << " "
101  << simtrk.pt() * simtrk.charge() << " " << bend << " " << newbend << " "
102  << settings.benddecode(newbend, layerdisk_, stub.isPSmodule()) << " "
103  << settings.bendcut(newbend, layerdisk_, stub.isPSmodule()) << endl;
104  }
105  }
106  }
107 }
FPGAWord phi_
Definition: Stub.h:97
FPGAWord alpha_
Definition: Stub.h:98
unsigned int nrbitsstub(unsigned int layerdisk) const
Definition: Settings.h:93
const FPGAWord & negdisk() const
Definition: Stub.h:67
FPGAWord r_
Definition: Stub.h:94
FPGAWord layer_
Definition: Stub.h:92
constexpr unsigned int N_BENDBITS_2S
Definition: Settings.h:34
double z() const
Definition: L1TStub.h:59
const FPGAWord & bend() const
Definition: Stub.h:63
FPGAWord phicorr_
Definition: Stub.h:102
assert(be >=bs)
constexpr unsigned int N_BENDBITS_PS
Definition: Settings.h:33
FPGAWord z_
Definition: Stub.h:95
unsigned int isPSmodule() const
Definition: L1TStub.h:103
const FPGAWord & disk() const
Definition: Stub.h:74
FPGAWord disk_
Definition: Stub.h:93
const L1SimTrack & simtrack(int i) const
Definition: SLHCEvent.h:69
unsigned int nzbitsstub(unsigned int layerdisk) const
Definition: Settings.h:91
unsigned int nphibitsstub(unsigned int layerdisk) const
Definition: Settings.h:92
double pt() const
Definition: L1SimTrack.h:26
FPGAWord bend_
Definition: Stub.h:100
double bfield() const
Definition: Settings.h:277
double stripPitch(bool isPSmodule) const
Definition: Settings.h:284
int layerdisk() const
Definition: L1TStub.h:119
bool tpmatch2(int tp) const
Definition: L1TStub.cc:117
FPGAWord negdisk_
Definition: Stub.h:96
int charge() const
Definition: L1SimTrack.h:34
int trackid() const
Definition: L1SimTrack.h:24
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:66
const std::string & stubword() const
Definition: L1TStub.h:123
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
SLHCEvent *& event()
Definition: Globals.h:36
unsigned int nsimtracks() const
Definition: SLHCEvent.h:67
L1TStub * l1tstub_
Definition: Stub.h:106
double c() const
Definition: Settings.h:224
double r() const
Definition: L1TStub.h:60
std::ofstream & ofstream(std::string fname)
Definition: Globals.cc:44
Settings const & settings_
Definition: Stub.h:107
std::string convertHexToBin(const std::string &stubwordhex)
Definition: Util.h:75
unsigned int layerdisk_
Definition: Stub.h:90
constexpr int N_LAYER
Definition: Settings.h:25

◆ ~Stub()

trklet::Stub::~Stub ( )
default

Member Function Documentation

◆ allStubIndex()

FPGAWord trklet::Stub::allStubIndex ( ) const
inline

Definition at line 53 of file Stub.h.

References stubindex_.

53 { return stubindex_; }
FPGAWord stubindex_
Definition: Stub.h:104

◆ alpha()

const FPGAWord& trklet::Stub::alpha ( void  ) const
inline

Definition at line 70 of file Stub.h.

References alpha_.

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

70 { return alpha_; }
FPGAWord alpha_
Definition: Stub.h:98

◆ bend()

const FPGAWord& trklet::Stub::bend ( ) const
inline

Definition at line 63 of file Stub.h.

References bend_.

Referenced by trklet::Sector::addStub(), trklet::TrackletProcessor::execute(), trklet::VMRouterCM::execute(), trklet::VMRouter::execute(), and Stub().

63 { return bend_; }
FPGAWord bend_
Definition: Stub.h:100

◆ disk()

const FPGAWord& trklet::Stub::disk ( ) const
inline

◆ iphivmFineBins()

FPGAWord Stub::iphivmFineBins ( int  VMbits,
int  finebits 
) const

Definition at line 109 of file Stub.cc.

References trklet::FPGAWord::nbits(), phicorr_, and trklet::FPGAWord::value().

Referenced by trklet::VMRouterCM::execute(), and trklet::VMRouter::execute().

109  {
110  unsigned int finephi = (phicorr_.value() >> (phicorr_.nbits() - VMbits - finebits)) & ((1 << finebits) - 1);
111  return FPGAWord(finephi, finebits, true, __LINE__, __FILE__);
112 }
FPGAWord phicorr_
Definition: Stub.h:102
int value() const
Definition: FPGAWord.h:24
int nbits() const
Definition: FPGAWord.h:25

◆ isBarrel()

bool trklet::Stub::isBarrel ( ) const
inline

◆ isPSmodule()

bool trklet::Stub::isPSmodule ( ) const
inline

◆ l1tstub() [1/2]

L1TStub* trklet::Stub::l1tstub ( )
inline

◆ l1tstub() [2/2]

const L1TStub* trklet::Stub::l1tstub ( ) const
inline

Definition at line 84 of file Stub.h.

References l1tstub_.

84 { return l1tstub_; }
L1TStub * l1tstub_
Definition: Stub.h:106

◆ layer()

const FPGAWord& trklet::Stub::layer ( ) const
inline

◆ layerdisk()

unsigned int Stub::layerdisk ( ) const

◆ negdisk()

const FPGAWord& trklet::Stub::negdisk ( ) const
inline

Definition at line 67 of file Stub.h.

References negdisk_.

Referenced by Stub().

67 { return negdisk_; }
FPGAWord negdisk_
Definition: Stub.h:96

◆ phi()

const FPGAWord& trklet::Stub::phi ( void  ) const
inline

◆ phiapprox()

double Stub::phiapprox ( double  phimin,
double   
) const

◆ phicorr()

const FPGAWord& trklet::Stub::phicorr ( ) const
inline

◆ phiregionaddress()

unsigned int Stub::phiregionaddress ( ) const

Definition at line 114 of file Stub.cc.

References hcalRecHitTable_cff::iphi, layerdisk(), trklet::FPGAWord::nbits(), trklet::Settings::nbitsallstubs(), phicorr_, settings_, stubindex_, and trklet::FPGAWord::value().

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

114  {
116  return (iphi << 7) + stubindex_.value();
117 }
FPGAWord phicorr_
Definition: Stub.h:102
unsigned int nbitsallstubs(unsigned int layerdisk) const
Definition: Settings.h:115
int value() const
Definition: FPGAWord.h:24
unsigned int layerdisk() const
Definition: Stub.cc:193
int nbits() const
Definition: FPGAWord.h:25
Settings const & settings_
Definition: Stub.h:107
FPGAWord stubindex_
Definition: Stub.h:104

◆ phiregionaddressstr()

std::string Stub::phiregionaddressstr ( ) const

Definition at line 119 of file Stub.cc.

References hcalRecHitTable_cff::iphi, layerdisk(), trklet::FPGAWord::nbits(), trklet::Settings::nbitsallstubs(), phicorr_, settings_, trklet::FPGAWord::str(), stubindex_, and trklet::FPGAWord::value().

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

119  {
121  FPGAWord phiregion(iphi, 3, true, __LINE__, __FILE__);
122  return phiregion.str() + stubindex_.str();
123 }
FPGAWord phicorr_
Definition: Stub.h:102
unsigned int nbitsallstubs(unsigned int layerdisk) const
Definition: Settings.h:115
int value() const
Definition: FPGAWord.h:24
unsigned int layerdisk() const
Definition: Stub.cc:193
int nbits() const
Definition: FPGAWord.h:25
Settings const & settings_
Definition: Stub.h:107
std::string str() const
Definition: FPGAWord.cc:54
FPGAWord stubindex_
Definition: Stub.h:104

◆ phiregionstr()

std::string Stub::phiregionstr ( ) const

Definition at line 125 of file Stub.cc.

References hcalRecHitTable_cff::iphi, layerdisk(), trklet::FPGAWord::nbits(), trklet::Settings::nbitsallstubs(), phicorr_, settings_, trklet::FPGAWord::str(), and trklet::FPGAWord::value().

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

125  {
127  FPGAWord phiregion(iphi, 3, true, __LINE__, __FILE__);
128  return phiregion.str();
129 }
FPGAWord phicorr_
Definition: Stub.h:102
unsigned int nbitsallstubs(unsigned int layerdisk) const
Definition: Settings.h:115
int value() const
Definition: FPGAWord.h:24
unsigned int layerdisk() const
Definition: Stub.cc:193
int nbits() const
Definition: FPGAWord.h:25
Settings const & settings_
Definition: Stub.h:107

◆ r()

const FPGAWord& trklet::Stub::r ( ) const
inline

◆ rapprox()

double Stub::rapprox ( ) const

Definition at line 152 of file Stub.cc.

References funct::abs(), disk_, trklet::L1TStub::isPSmodule(), trklet::Settings::kr(), l1tstub_, layer_, trklet::Settings::nrbitsstub(), r_, trklet::Settings::rDSSinner(), trklet::Settings::rDSSouter(), trklet::Settings::rmean(), settings_, and trklet::FPGAWord::value().

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

152  {
153  if (disk_.value() == 0) {
154  int lr = 1 << (8 - settings_.nrbitsstub(layer_.value()));
155  return r_.value() * settings_.kr() * lr + settings_.rmean(layer_.value());
156  }
157  if (!l1tstub_->isPSmodule()) {
158  if (abs(disk_.value()) <= 2)
159  return settings_.rDSSinner(r_.value());
160  else
161  return settings_.rDSSouter(r_.value());
162  }
163  return r_.value() * settings_.kr();
164 }
unsigned int nrbitsstub(unsigned int layerdisk) const
Definition: Settings.h:93
double rDSSinner(unsigned int iBin) const
Definition: Settings.h:183
FPGAWord r_
Definition: Stub.h:94
FPGAWord layer_
Definition: Stub.h:92
unsigned int isPSmodule() const
Definition: L1TStub.h:103
FPGAWord disk_
Definition: Stub.h:93
double rmean(unsigned int iLayer) const
Definition: Settings.h:173
double rDSSouter(unsigned int iBin) const
Definition: Settings.h:186
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int value() const
Definition: FPGAWord.h:24
double kr() const
Definition: Settings.h:344
L1TStub * l1tstub_
Definition: Stub.h:106
Settings const & settings_
Definition: Stub.h:107

◆ setAllStubIndex()

void Stub::setAllStubIndex ( int  nstub)

Definition at line 131 of file Stub.cc.

References trklet::Settings::debugTracklet(), trklet::N_BITSMEMADDRESS, trklet::FPGAWord::set(), settings_, and stubindex_.

Referenced by trklet::VMRouterCM::execute(), and trklet::VMRouter::execute().

131  {
132  if (nstub >= (1 << N_BITSMEMADDRESS)) {
133  if (settings_.debugTracklet())
134  edm::LogPrint("Tracklet") << "Warning too large stubindex!";
135  nstub = (1 << N_BITSMEMADDRESS) - 1;
136  }
137 
139 }
bool debugTracklet() const
Definition: Settings.h:194
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
Settings const & settings_
Definition: Stub.h:107
FPGAWord stubindex_
Definition: Stub.h:104
constexpr unsigned int N_BITSMEMADDRESS
Definition: Settings.h:43

◆ setl1tstub()

void trklet::Stub::setl1tstub ( L1TStub l1tstub)
inline

Definition at line 85 of file Stub.h.

References l1tstub(), and l1tstub_.

Referenced by trklet::DTCLinkMemory::addStub(), and trklet::PurgeDuplicate::getInventedSeedingStub().

85 { l1tstub_ = l1tstub; }
L1TStub * l1tstub()
Definition: Stub.h:83
L1TStub * l1tstub_
Definition: Stub.h:106

◆ setPhiCorr()

void Stub::setPhiCorr ( int  phiCorr)

Definition at line 141 of file Stub.cc.

References trklet::FPGAWord::nbits(), phi_, phicorr_, trklet::FPGAWord::set(), and trklet::FPGAWord::value().

Referenced by trklet::Sector::addStub().

141  {
142  int iphicorr = phi_.value() - phiCorr;
143 
144  if (iphicorr < 0)
145  iphicorr = 0;
146  if (iphicorr >= (1 << phi_.nbits()))
147  iphicorr = (1 << phi_.nbits()) - 1;
148 
149  phicorr_.set(iphicorr, phi_.nbits(), true, __LINE__, __FILE__);
150 }
FPGAWord phi_
Definition: Stub.h:97
FPGAWord phicorr_
Definition: Stub.h:102
int value() const
Definition: FPGAWord.h:24
int nbits() const
Definition: FPGAWord.h:25
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14

◆ str()

std::string trklet::Stub::str ( ) const
inline

Definition at line 28 of file Stub.h.

References alpha_, bend_, isPSmodule(), layer_, phi_, r_, trklet::FPGAWord::str(), trklet::FPGAWord::value(), and z_.

Referenced by strinner().

28  {
29  if (layer_.value() != -1) {
30  return r_.str() + "|" + z_.str() + "|" + phi_.str() + "|" + bend_.str();
31  } else {
32  if (isPSmodule()) {
33  return r_.str() + "|" + z_.str() + "|" + phi_.str() + "|" + bend_.str();
34  } else {
35  return "000" + r_.str() + "|" + z_.str() + "|" + phi_.str() + "|" + alpha_.str() + "|" + bend_.str();
36  }
37  }
38  }
FPGAWord phi_
Definition: Stub.h:97
FPGAWord alpha_
Definition: Stub.h:98
FPGAWord r_
Definition: Stub.h:94
FPGAWord layer_
Definition: Stub.h:92
FPGAWord z_
Definition: Stub.h:95
FPGAWord bend_
Definition: Stub.h:100
int value() const
Definition: FPGAWord.h:24
bool isPSmodule() const
Definition: Stub.h:77
std::string str() const
Definition: FPGAWord.cc:54

◆ strbare()

std::string trklet::Stub::strbare ( ) const
inline

Definition at line 40 of file Stub.h.

References bend_, phi_, r_, trklet::FPGAWord::str(), and z_.

Referenced by trklet::TrackletProcessorDisplaced::execute().

40 { return bend_.str() + r_.str() + z_.str() + phi_.str(); }
FPGAWord phi_
Definition: Stub.h:97
FPGAWord r_
Definition: Stub.h:94
FPGAWord z_
Definition: Stub.h:95
FPGAWord bend_
Definition: Stub.h:100
std::string str() const
Definition: FPGAWord.cc:54

◆ strinner()

std::string trklet::Stub::strinner ( ) const
inline

Definition at line 42 of file Stub.h.

References trklet::FPGAWord::bits(), layer_, trklet::FPGAWord::nbits(), negdisk_, phicorr_, trklet::FPGAWord::str(), str(), stubindex_, and trklet::FPGAWord::value().

42  {
43  unsigned int nbitsfinephi = 8;
44  FPGAWord finephi(
45  phicorr_.bits(phicorr_.nbits() - nbitsfinephi, nbitsfinephi), nbitsfinephi, true, __LINE__, __FILE__);
46  if (layer_.value() == -1) {
47  return str() + "|" + negdisk_.str() + "|" + stubindex_.str() + "|" + finephi.str();
48  } else {
49  return str() + "|" + stubindex_.str() + "|" + finephi.str();
50  }
51  }
FPGAWord layer_
Definition: Stub.h:92
FPGAWord phicorr_
Definition: Stub.h:102
int value() const
Definition: FPGAWord.h:24
FPGAWord negdisk_
Definition: Stub.h:96
std::string str() const
Definition: Stub.h:28
int nbits() const
Definition: FPGAWord.h:25
unsigned int bits(unsigned int lsb, unsigned int nbit) const
Definition: FPGAWord.cc:74
std::string str() const
Definition: FPGAWord.cc:54
FPGAWord stubindex_
Definition: Stub.h:104

◆ stubindex()

const FPGAWord& trklet::Stub::stubindex ( ) const
inline

◆ z()

const FPGAWord& trklet::Stub::z ( ) const
inline

◆ zapprox()

double Stub::zapprox ( ) const

Definition at line 166 of file Stub.cc.

References funct::abs(), disk_, trklet::Settings::kz(), layer_, settings_, Validation_hcalonly_cfi::sign, trklet::FPGAWord::value(), z_, and trklet::Settings::zmean().

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

166  {
167  if (disk_.value() == 0) {
168  int lz = 1;
169  if (layer_.value() >= 3) {
170  lz = 16;
171  }
172  return z_.value() * settings_.kz() * lz;
173  }
174  int sign = 1;
175  if (disk_.value() < 0)
176  sign = -1;
177  if (sign < 0) {
178  //Should understand why this is needed to get agreement with integer calculations
179  return (z_.value() + 1) * settings_.kz() + sign * settings_.zmean(abs(disk_.value()) - 1);
180  } else {
181  return z_.value() * settings_.kz() + sign * settings_.zmean(abs(disk_.value()) - 1);
182  }
183 }
double kz() const
Definition: Settings.h:342
FPGAWord layer_
Definition: Stub.h:92
FPGAWord z_
Definition: Stub.h:95
FPGAWord disk_
Definition: Stub.h:93
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int value() const
Definition: FPGAWord.h:24
double zmean(unsigned int iDisk) const
Definition: Settings.h:176
Settings const & settings_
Definition: Stub.h:107

Member Data Documentation

◆ alpha_

FPGAWord trklet::Stub::alpha_
private

Definition at line 98 of file Stub.h.

Referenced by alpha(), str(), and Stub().

◆ bend_

FPGAWord trklet::Stub::bend_
private

Definition at line 100 of file Stub.h.

Referenced by bend(), str(), strbare(), and Stub().

◆ disk_

FPGAWord trklet::Stub::disk_
private

Definition at line 93 of file Stub.h.

Referenced by disk(), layerdisk(), rapprox(), Stub(), and zapprox().

◆ l1tstub_

L1TStub* trklet::Stub::l1tstub_
private

Definition at line 106 of file Stub.h.

Referenced by l1tstub(), rapprox(), setl1tstub(), and Stub().

◆ layer_

FPGAWord trklet::Stub::layer_
private

Definition at line 92 of file Stub.h.

Referenced by layer(), layerdisk(), phiapprox(), rapprox(), str(), strinner(), Stub(), and zapprox().

◆ layerdisk_

unsigned int trklet::Stub::layerdisk_
private

Definition at line 90 of file Stub.h.

Referenced by isBarrel(), isPSmodule(), and Stub().

◆ negdisk_

FPGAWord trklet::Stub::negdisk_
private

Definition at line 96 of file Stub.h.

Referenced by negdisk(), strinner(), and Stub().

◆ phi_

FPGAWord trklet::Stub::phi_
private

Definition at line 97 of file Stub.h.

Referenced by phi(), phiapprox(), setPhiCorr(), str(), strbare(), and Stub().

◆ phicorr_

FPGAWord trklet::Stub::phicorr_
private

◆ r_

FPGAWord trklet::Stub::r_
private

Definition at line 94 of file Stub.h.

Referenced by isPSmodule(), r(), rapprox(), str(), strbare(), and Stub().

◆ settings_

Settings const& trklet::Stub::settings_
private

◆ stubindex_

FPGAWord trklet::Stub::stubindex_
private

◆ z_

FPGAWord trklet::Stub::z_
private

Definition at line 95 of file Stub.h.

Referenced by str(), strbare(), Stub(), z(), and zapprox().