CMS 3D CMS Logo

DRin.cc
Go to the documentation of this file.
2 
3 #include <vector>
4 #include <deque>
5 #include <numeric>
6 #include <algorithm>
7 
8 using namespace std;
9 using namespace edm;
10 using namespace tt;
11 using namespace trackerTFP;
12 
13 namespace trklet {
14 
15  DRin::DRin(const ParameterSet& iConfig,
16  const Setup* setup,
17  const DataFormats* dataFormats,
18  const LayerEncoding* layerEncoding,
19  const ChannelAssignment* channelAssignment,
20  const Settings* settings,
21  int region)
22  : enableTruncation_(iConfig.getParameter<bool>("EnableTruncation")),
23  useTTStubResiduals_(iConfig.getParameter<bool>("UseTTStubResiduals")),
24  setup_(setup),
25  dataFormats_(dataFormats),
26  layerEncoding_(layerEncoding),
27  channelAssignment_(channelAssignment),
28  settings_(settings),
29  region_(region),
30  input_(channelAssignment_->numChannelsTrack()),
31  // unified tracklet digitisation granularity
32  baseUinv2R_(.5 * settings_->kphi1() / settings_->kr() * pow(2, settings_->rinv_shift())),
33  baseUphiT_(settings_->kphi1() * pow(2, settings_->phi0_shift())),
34  baseUcot_(settings_->kz() / settings_->kr() * pow(2, settings_->t_shift())),
35  baseUzT_(settings_->kz() * pow(2, settings_->z0_shift())),
36  baseUr_(settings_->kr()),
37  baseUphi_(settings_->kphi1()),
38  baseUz_(settings_->kz()),
39  // KF input format digitisation granularity (identical to TMTT)
40  baseLinv2R_(dataFormats->base(Variable::inv2R, Process::kfin)),
41  baseLphiT_(dataFormats->base(Variable::phiT, Process::kfin)),
42  baseLcot_(dataFormats->base(Variable::cot, Process::kfin)),
43  baseLzT_(dataFormats->base(Variable::zT, Process::kfin)),
44  baseLr_(dataFormats->base(Variable::r, Process::kfin)),
45  baseLphi_(dataFormats->base(Variable::phi, Process::kfin)),
46  baseLz_(dataFormats->base(Variable::z, Process::kfin)),
47  // Finer granularity (by powers of 2) than the TMTT one. Used to transform from Tracklet to TMTT base.
48  baseHinv2R_(baseLinv2R_ * pow(2, floor(log2(baseUinv2R_ / baseLinv2R_)))),
49  baseHphiT_(baseLphiT_ * pow(2, floor(log2(baseUphiT_ / baseLphiT_)))),
50  baseHcot_(baseLcot_ * pow(2, floor(log2(baseUcot_ / baseLcot_)))),
51  baseHzT_(baseLzT_ * pow(2, floor(log2(baseUzT_ / baseLzT_)))),
52  baseHr_(baseLr_ * pow(2, floor(log2(baseUr_ / baseLr_)))),
53  baseHphi_(baseLphi_ * pow(2, floor(log2(baseUphi_ / baseLphi_)))),
54  baseHz_(baseLz_ * pow(2, floor(log2(baseUz_ / baseLz_)))) {
55  // calculate digitisation granularity used for inverted cot(theta)
56  const int baseShiftInvCot = ceil(log2(setup_->outerRadius() / setup_->hybridRangeR())) - setup_->widthDSPbu();
57  baseInvCot_ = pow(2, baseShiftInvCot);
58  }
59 
60  // read in and organize input tracks and stubs
61  void DRin::consume(const StreamsTrack& streamsTrack, const StreamsStub& streamsStub) {
62  static const double maxCot = sinh(setup_->maxEta()) + setup_->beamWindowZ() / setup_->chosenRofZ();
63  static const int unusedMSBcot = floor(log2(baseUcot_ * pow(2, settings_->nbitst()) / (2. * maxCot)));
64  static const double baseCot =
65  baseUcot_ * pow(2, settings_->nbitst() - unusedMSBcot - 1 - setup_->widthAddrBRAM18());
66  const int offsetTrack = region_ * channelAssignment_->numChannelsTrack();
67  // count tracks and stubs to reserve container
68  int nTracks(0);
69  int nStubs(0);
70  for (int channel = 0; channel < channelAssignment_->numChannelsTrack(); channel++) {
71  const int channelTrack = offsetTrack + channel;
72  const int offsetStub = channelAssignment_->offsetStub(channelTrack);
73  const StreamTrack& streamTrack = streamsTrack[channelTrack];
74  input_[channel].reserve(streamTrack.size());
75  for (int frame = 0; frame < (int)streamTrack.size(); frame++) {
76  if (streamTrack[frame].first.isNull())
77  continue;
78  nTracks++;
79  for (int layer = 0; layer < channelAssignment_->numProjectionLayers(channel); layer++)
80  if (streamsStub[offsetStub + layer][frame].first.isNonnull())
81  nStubs++;
82  }
83  }
84  stubs_.reserve(nStubs + nTracks * channelAssignment_->numSeedingLayers());
85  tracks_.reserve(nTracks);
86  // store tracks and stubs
87  for (int channel = 0; channel < channelAssignment_->numChannelsTrack(); channel++) {
88  const int channelTrack = offsetTrack + channel;
89  const int offsetStub = channelAssignment_->offsetStub(channelTrack);
90  const StreamTrack& streamTrack = streamsTrack[channelTrack];
91  vector<Track*>& input = input_[channel];
92  for (int frame = 0; frame < (int)streamTrack.size(); frame++) {
93  const TTTrackRef& ttTrackRef = streamTrack[frame].first;
94  if (ttTrackRef.isNull()) {
95  input.push_back(nullptr);
96  continue;
97  }
98  //convert track parameter
99  const double r2Inv = digi(-ttTrackRef->rInv() / 2., baseUinv2R_);
100  const double phi0U =
101  digi(tt::deltaPhi(ttTrackRef->phi() - region_ * setup_->baseRegion() + setup_->hybridRangePhi() / 2.),
102  baseUphiT_);
103  const double phi0S = digi(phi0U - setup_->hybridRangePhi() / 2., baseUphiT_);
104  const double cot = digi(ttTrackRef->tanL(), baseUcot_);
105  const double z0 = digi(ttTrackRef->z0(), baseUzT_);
106  const double phiT = digi(phi0S + r2Inv * digi(dataFormats_->chosenRofPhi(), baseUr_), baseUphiT_);
107  const double zT = digi(z0 + cot * digi(setup_->chosenRofZ(), baseUr_), baseUzT_);
108  // kill tracks outside of fiducial range
109  if (abs(phiT) > setup_->baseRegion() / 2. || abs(zT) > setup_->hybridMaxCot() * setup_->chosenRofZ() ||
110  abs(z0) > setup_->beamWindowZ()) {
111  input.push_back(nullptr);
112  continue;
113  }
114  // convert stubs
115  vector<Stub*> stubs;
117  for (int layer = 0; layer < channelAssignment_->numProjectionLayers(channel); layer++) {
118  const FrameStub& frameStub = streamsStub[offsetStub + layer][frame];
119  const TTStubRef& ttStubRef = frameStub.first;
120  if (ttStubRef.isNull())
121  continue;
122  const int layerId = channelAssignment_->layerId(channel, layer);
123  // parse residuals from tt::Frame and take r and layerId from tt::TTStubRef
124  const bool barrel = setup_->barrel(ttStubRef);
125  const int layerIdTracklet = setup_->trackletLayerId(ttStubRef);
126  const double basePhi = barrel ? settings_->kphi1() : settings_->kphi(layerIdTracklet);
127  const double baseRZ = barrel ? settings_->kz(layerIdTracklet) : settings_->kz();
128  const int widthRZ = barrel ? settings_->zresidbits() : settings_->rresidbits();
129  TTBV hw(frameStub.second);
130  const TTBV hwRZ(hw, widthRZ, 0, true);
131  hw >>= widthRZ;
132  const TTBV hwPhi(hw, settings_->phiresidbits(), 0, true);
133  hw >>= settings_->phiresidbits();
134  const int indexLayerId = setup_->indexLayerId(ttStubRef);
135  const SensorModule::Type type = setup_->type(ttStubRef);
136  const int widthR = setup_->tbWidthR(type);
137  const double baseR = setup_->hybridBaseR(type);
138  const TTBV hwR(hw, widthR, 0, barrel);
139  hw >>= widthR;
140  double r = hwR.val(baseR) + (barrel ? setup_->hybridLayerR(indexLayerId) : 0.);
141  if (type == SensorModule::Disk2S)
142  r = setup_->disk2SR(indexLayerId, r);
143  r = digi(r - dataFormats_->chosenRofPhi(), baseUr_);
144  double phi = hwPhi.val(basePhi);
145  if (basePhi > baseUphi_)
146  phi += baseUphi_ / 2.;
147  const double z = digi(hwRZ.val(baseRZ) * (barrel ? 1. : -cot), baseUz_);
148  const TTBV hwStubId(hw, channelAssignment_->widthSeedStubId(), 0, false);
149  const int stubId = hwStubId.val();
150  // determine module type
151  bool psTilt;
152  if (barrel) {
153  const double posZ = (r + digi(dataFormats_->chosenRofPhi(), baseUr_)) * cot + z0 + z;
154  const int indexLayerId = setup_->indexLayerId(ttStubRef);
155  const double limit = setup_->tiltedLayerLimitZ(indexLayerId);
156  psTilt = abs(posZ) < limit;
157  } else
158  psTilt = setup_->psModule(ttStubRef);
159  if (useTTStubResiduals_) {
160  const GlobalPoint gp = setup_->stubPos(ttStubRef);
161  const double ttR = r;
162  const double ttZ = gp.z() - (z0 + (ttR + dataFormats_->chosenRofPhi()) * cot);
163  stubs_.emplace_back(ttStubRef, layerId, layerIdTracklet, false, stubId, ttR, phi, ttZ, psTilt);
164  } else
165  stubs_.emplace_back(ttStubRef, layerId, layerIdTracklet, false, stubId, r, phi, z, psTilt);
166  stubs.push_back(&stubs_.back());
167  }
168  // create fake seed stubs, since TrackBuilder doesn't output these stubs, required by the KF.
169  for (int seedingLayer = 0; seedingLayer < channelAssignment_->numSeedingLayers(); seedingLayer++) {
170  const int channelStub = channelAssignment_->numProjectionLayers(channel) + seedingLayer;
171  const FrameStub& frameStub = streamsStub[offsetStub + channelStub][frame];
172  const TTStubRef& ttStubRef = frameStub.first;
173  if (ttStubRef.isNull())
174  continue;
175  const int layerId = channelAssignment_->layerId(channel, channelStub);
176  const int layerIdTracklet = setup_->trackletLayerId(ttStubRef);
177  const int stubId = TTBV(frameStub.second).val(channelAssignment_->widthSeedStubId());
178  const bool barrel = setup_->barrel(ttStubRef);
179  double r;
180  if (barrel)
182  else {
183  r = (z0 +
185  digi(1. / digi(abs(cot), baseCot), baseInvCot_);
187  }
188  static constexpr double phi = 0.;
189  static constexpr double z = 0.;
190  // determine module type
191  bool psTilt;
192  if (barrel) {
193  const double posZ =
194  digi(digi(setup_->hybridLayerR(layerId - setup_->offsetLayerId()), baseUr_) * cot + z0, baseUz_);
195  const int indexLayerId = setup_->indexLayerId(ttStubRef);
196  const double limit = digi(setup_->tiltedLayerLimitZ(indexLayerId), baseUz_);
197  psTilt = abs(posZ) < limit;
198  } else
199  psTilt = true;
200  const GlobalPoint gp = setup_->stubPos(ttStubRef);
201  const double ttR = gp.perp() - dataFormats_->chosenRofPhi();
202  const double ttZ = gp.z() - (z0 + (ttR + dataFormats_->chosenRofPhi()) * cot);
204  stubs_.emplace_back(ttStubRef, layerId, layerIdTracklet, true, stubId, ttR, phi, ttZ, psTilt);
205  else
206  stubs_.emplace_back(ttStubRef, layerId, layerIdTracklet, true, stubId, r, phi, z, psTilt);
207  stubs.push_back(&stubs_.back());
208  }
209  const bool valid = frame < setup_->numFrames() ? true : enableTruncation_;
210  tracks_.emplace_back(ttTrackRef, valid, r2Inv, phiT, cot, zT, stubs);
211  input.push_back(&tracks_.back());
212  }
213  }
214  }
215 
216  // fill output products
217  void DRin::produce(StreamsStub& accpetedStubs,
218  StreamsTrack& acceptedTracks,
219  StreamsStub& lostStubs,
221  // base transform into high precision TMTT format
222  for (Track& track : tracks_) {
223  track.inv2R_ = redigi(track.inv2R_, baseUinv2R_, baseHinv2R_, setup_->widthDSPbu());
224  track.phiT_ = redigi(track.phiT_, baseUphiT_, baseHphiT_, setup_->widthDSPbu());
227  for (Stub* stub : track.stubs_) {
228  stub->r_ = redigi(stub->r_, baseUr_, baseHr_, setup_->widthDSPbu());
229  stub->phi_ = redigi(stub->phi_, baseUphi_, baseHphi_, setup_->widthDSPbu());
230  stub->z_ = redigi(stub->z_, baseUz_, baseHz_, setup_->widthDSPbu());
231  }
232  }
233  // find sector
234  for (Track& track : tracks_) {
235  const int sectorPhi = track.phiT_ < 0. ? 0 : 1;
236  track.phiT_ -= (sectorPhi - .5) * setup_->baseSector();
237  int sectorEta(-1);
238  for (; sectorEta < setup_->numSectorsEta(); sectorEta++)
239  if (track.zT_ < digi(setup_->chosenRofZ() * sinh(setup_->boundarieEta(sectorEta + 1)), baseHzT_))
240  break;
241  if (sectorEta >= setup_->numSectorsEta() || sectorEta <= -1) {
242  track.valid_ = false;
243  continue;
244  }
245  track.cot_ = track.cot_ - digi(setup_->sectorCot(sectorEta), baseHcot_);
247  track.sector_ = sectorPhi * setup_->numSectorsEta() + sectorEta;
248  }
249  // base transform into TMTT format
250  for (Track& track : tracks_) {
251  if (!track.valid_)
252  continue;
253  // store track parameter shifts
254  const double dinv2R = digi(track.inv2R_ - digi(track.inv2R_, baseLinv2R_), baseHinv2R_);
255  const double dphiT = digi(track.phiT_ - digi(track.phiT_, baseLphiT_), baseHphiT_);
256  const double dcot = digi(track.cot_ - digi(track.cot_, baseLcot_), baseHcot_);
257  const double dzT = digi(track.zT_ - digi(track.zT_, baseLzT_), baseHzT_);
258  // shift track parameter;
259  track.inv2R_ = digi(track.inv2R_, baseLinv2R_);
260  track.phiT_ = digi(track.phiT_, baseLphiT_);
261  track.cot_ = digi(track.cot_, baseLcot_);
262  track.zT_ = digi(track.zT_, baseLzT_);
263  // range checks
264  if (!dataFormats_->format(Variable::inv2R, Process::kfin).inRange(track.inv2R_, true))
265  track.valid_ = false;
266  if (!dataFormats_->format(Variable::phiT, Process::kfin).inRange(track.phiT_, true))
267  track.valid_ = false;
268  if (!dataFormats_->format(Variable::cot, Process::kfin).inRange(track.cot_, true))
269  track.valid_ = false;
270  if (!dataFormats_->format(Variable::zT, Process::kfin).inRange(track.zT_, true))
271  track.valid_ = false;
272  if (!track.valid_)
273  continue;
274  // adjust stub residuals by track parameter shifts
275  for (Stub* stub : track.stubs_) {
276  const double dphi = digi(dphiT + stub->r_ * dinv2R, baseHphi_);
277  const double r = stub->r_ + digi(dataFormats_->chosenRofPhi() - setup_->chosenRofZ(), baseHr_);
278  const double dz = digi(dzT + r * dcot, baseHz_);
279  stub->phi_ = digi(stub->phi_ + dphi, baseLphi_);
280  stub->z_ = digi(stub->z_ + dz, baseLz_);
281  // range checks
282  if (!dataFormats_->format(Variable::phi, Process::kfin).inRange(stub->phi_))
283  stub->valid_ = false;
284  if (!dataFormats_->format(Variable::z, Process::kfin).inRange(stub->z_))
285  stub->valid_ = false;
286  }
287  }
288  // encode layer id
289  for (Track& track : tracks_) {
290  if (!track.valid_)
291  continue;
292  const int sectorEta = track.sector_ % setup_->numSectorsEta();
293  const int zT = dataFormats_->format(Variable::zT, Process::kfin).toUnsigned(track.zT_);
294  const int cot = dataFormats_->format(Variable::cot, Process::kfin).toUnsigned(track.cot_);
295  for (Stub* stub : track.stubs_) {
296  if (!stub->valid_)
297  continue;
298  // store encoded layerId
300  // kill stubs from layers which can't be crossed by track
301  if (stub->layerKF_ == -1)
302  stub->valid_ = false;
303  }
305  // kill multiple stubs from same kf layer
306  for (Stub* stub : track.stubs_) {
307  if (!stub->valid_)
308  continue;
309  if (hitPattern[stub->layerKF_])
310  stub->valid_ = false;
311  else
312  hitPattern.set(stub->layerKF_);
313  }
314  // lookup maybe layers
316  }
317  // kill tracks with not enough layer
318  for (Track& track : tracks_) {
319  if (!track.valid_)
320  continue;
321  TTBV hits(0, setup_->numLayers());
322  for (const Stub* stub : track.stubs_)
323  if (stub->valid_)
324  hits.set(stub->layerKF_);
325  if (hits.count() < setup_->kfMinLayers())
326  track.valid_ = false;
327  }
328  // store helper
329  auto frameTrack = [this](Track* track) {
330  const TTBV sectorPhi(
331  dataFormats_->format(Variable::sectorPhi, Process::kfin).ttBV(track->sector_ / setup_->numSectorsEta()));
332  const TTBV sectorEta(
333  dataFormats_->format(Variable::sectorEta, Process::kfin).ttBV(track->sector_ % setup_->numSectorsEta()));
334  const TTBV inv2R(dataFormats_->format(Variable::inv2R, Process::kfin).ttBV(track->inv2R_));
335  const TTBV phiT(dataFormats_->format(Variable::phiT, Process::kfin).ttBV(track->phiT_));
336  const TTBV cot(dataFormats_->format(Variable::cot, Process::kfin).ttBV(track->cot_));
337  const TTBV zT(dataFormats_->format(Variable::zT, Process::kfin).ttBV(track->zT_));
338  return FrameTrack(
339  track->ttTrackRef_,
340  Frame("1" + sectorPhi.str() + sectorEta.str() + inv2R.str() + phiT.str() + zT.str() + cot.str()));
341  };
342  auto frameStub = [this](Track* track, int layer) {
343  auto equal = [layer](Stub* stub) { return stub->valid_ && stub->layerKF_ == layer; };
344  const auto it = find_if(track->stubs_.begin(), track->stubs_.end(), equal);
345  if (it == track->stubs_.end() || !(*it)->valid_)
346  return FrameStub();
347  Stub* stub = *it;
348  const TTBV layerId(stub->layerDet_, channelAssignment_->widthLayerId());
349  const TTBV stubId(stub->stubId_, channelAssignment_->widthSeedStubId(), true);
350  const TTBV r(dataFormats_->format(Variable::r, Process::kfin).ttBV(stub->r_));
351  const TTBV phi(dataFormats_->format(Variable::phi, Process::kfin).ttBV(stub->phi_));
352  const TTBV z(dataFormats_->format(Variable::z, Process::kfin).ttBV(stub->z_));
353  return FrameStub(
354  stub->ttStubRef_,
355  Frame("1" + to_string(stub->psTilt_) + layerId.str() + stubId.str() + r.str() + phi.str() + z.str()));
356  };
357  // route tracks into pt bins and store result
358  const int offsetTrack = region_ * channelAssignment_->numNodesDR();
359  for (int nodeDR = 0; nodeDR < channelAssignment_->numNodesDR(); nodeDR++) {
360  deque<Track*> accepted;
361  deque<Track*> lost;
362  vector<deque<Track*>> stacks(channelAssignment_->numChannelsTrack());
363  vector<deque<Track*>> inputs(channelAssignment_->numChannelsTrack());
364  for (int channel = 0; channel < channelAssignment_->numChannelsTrack(); channel++) {
365  for (Track* track : input_[channel]) {
366  const bool match = track && channelAssignment_->nodeDR(track->ttTrackRef_) == nodeDR;
367  if (match && !track->valid_)
368  lost.push_back(track);
369  inputs[channel].push_back(match && track->valid_ ? track : nullptr);
370  }
371  }
372  // remove all gaps between end and last track
373  for (deque<Track*>& input : inputs)
374  for (auto it = input.end(); it != input.begin();)
375  it = (*--it) ? input.begin() : input.erase(it);
376  // clock accurate firmware emulation, each while trip describes one clock tick, one stub in and one stub out per tick
377  while (!all_of(inputs.begin(), inputs.end(), [](const deque<Track*>& tracks) { return tracks.empty(); }) or
378  !all_of(stacks.begin(), stacks.end(), [](const deque<Track*>& tracks) { return tracks.empty(); })) {
379  // fill input fifos
380  for (int channel = 0; channel < channelAssignment_->numChannelsTrack(); channel++) {
381  deque<Track*>& stack = stacks[channel];
382  Track* track = pop_front(inputs[channel]);
383  if (track) {
384  if (enableTruncation_ && (int)stack.size() == channelAssignment_->depthMemory() - 1)
385  lost.push_back(pop_front(stack));
386  stack.push_back(track);
387  }
388  }
389  // merge input fifos to one stream, prioritizing higher input channel over lower channel
390  bool nothingToRoute(true);
391  for (int channel = channelAssignment_->numChannelsTrack() - 1; channel >= 0; channel--) {
392  Track* track = pop_front(stacks[channel]);
393  if (track) {
394  nothingToRoute = false;
395  accepted.push_back(track);
396  break;
397  }
398  }
399  if (nothingToRoute)
400  accepted.push_back(nullptr);
401  }
402  // truncate if desired
403  if (enableTruncation_ && (int)accepted.size() > setup_->numFrames()) {
404  const auto limit = next(accepted.begin(), setup_->numFrames());
405  copy_if(limit, accepted.end(), back_inserter(lost), [](const Track* track) { return track; });
406  accepted.erase(limit, accepted.end());
407  }
408  // remove all gaps between end and last track
409  for (auto it = accepted.end(); it != accepted.begin();)
410  it = (*--it) ? accepted.begin() : accepted.erase(it);
411  // fill products StreamsStub& accpetedStubs, StreamsTrack& acceptedTracks, StreamsStub& lostStubs, StreamsTrack& lostTracks
412  const int channelTrack = offsetTrack + nodeDR;
413  const int offsetStub = channelTrack * setup_->numLayers();
414  // fill lost tracks and stubs without gaps
415  lostTracks[channelTrack].reserve(lost.size());
416  for (int layer = 0; layer < setup_->numLayers(); layer++)
417  lostStubs[offsetStub + layer].reserve(lost.size());
418  for (Track* track : lost) {
419  lostTracks[channelTrack].emplace_back(frameTrack(track));
420  for (int layer = 0; layer < setup_->numLayers(); layer++)
421  lostStubs[offsetStub + layer].emplace_back(frameStub(track, layer));
422  }
423  // fill accepted tracks and stubs with gaps
424  acceptedTracks[channelTrack].reserve(accepted.size());
425  for (int layer = 0; layer < setup_->numLayers(); layer++)
426  accpetedStubs[offsetStub + layer].reserve(accepted.size());
427  for (Track* track : accepted) {
428  if (!track) { // fill gap
429  acceptedTracks[channelTrack].emplace_back(FrameTrack());
430  for (int layer = 0; layer < setup_->numLayers(); layer++)
431  accpetedStubs[offsetStub + layer].emplace_back(FrameStub());
432  continue;
433  }
434  acceptedTracks[channelTrack].emplace_back(frameTrack(track));
435  for (int layer = 0; layer < setup_->numLayers(); layer++)
436  accpetedStubs[offsetStub + layer].emplace_back(frameStub(track, layer));
437  }
438  }
439  }
440 
441  // remove and return first element of deque, returns nullptr if empty
442  template <class T>
443  T* DRin::pop_front(deque<T*>& ts) const {
444  T* t = nullptr;
445  if (!ts.empty()) {
446  t = ts.front();
447  ts.pop_front();
448  }
449  return t;
450  }
451 
452  // basetransformation of val from baseLow into baseHigh using widthMultiplier bit multiplication
453  double DRin::redigi(double val, double baseLow, double baseHigh, int widthMultiplier) const {
454  const double base = pow(2, 1 - widthMultiplier);
455  const double transform = digi(baseLow / baseHigh, base);
456  return (floor(val * transform / baseLow) + .5) * baseHigh;
457  }
458 
459 } // namespace trklet
double hybridDiskZ(int layerId) const
Definition: Setup.h:298
bool inRange(double d, bool digi=false) const
Definition: DataFormats.h:106
double baseHphi_
Definition: DRin.h:161
const tt::Setup * setup_
Definition: DRin.h:122
constexpr int32_t ceil(float num)
double kz() const
Definition: Settings.h:342
double baseInvCot_
Definition: DRin.h:164
std::bitset< TTBV::S_ > Frame
Definition: TTTypes.h:58
double redigi(double val, double baseLow, double baseHigh, int widthMultiplier) const
Definition: DRin.cc:453
double hybridLayerR(int layerId) const
Definition: Setup.h:296
double hybridRangePhi() const
Definition: Setup.h:300
double hybridMaxCot() const
Definition: Setup.h:292
std::vector< StreamTrack > StreamsTrack
Definition: TTTypes.h:67
double baseUz_
Definition: DRin.h:146
double baseLz_
Definition: DRin.h:154
double kphi1() const
Definition: Settings.h:339
std::vector< Stub > stubs_
Definition: DRin.h:136
double chosenRofZ() const
Definition: Setup.h:417
bool enableTruncation_
Definition: DRin.h:118
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
std::pair< TTStubRef, Frame > FrameStub
Definition: TTTypes.h:60
TTBV ttBV(int i) const
Definition: DataFormats.h:78
double baseHr_
Definition: DRin.h:160
const trackerTFP::LayerEncoding * layerEncoding_
Definition: DRin.h:126
Class to process and provide run-time constants used by Track Trigger emulators.
Definition: Setup.h:44
std::vector< StreamStub > StreamsStub
Definition: TTTypes.h:66
TTStubRef ttStubRef_
Definition: DRin.h:66
int tbWidthR(SensorModule::Type type) const
Definition: Setup.h:308
double boundarieEta(int eta) const
Definition: Setup.h:421
int nodeDR(const TTTrackRef &ttTrackRef) const
int numFrames() const
Definition: Setup.h:153
int widthDSPbu() const
Definition: Setup.h:141
double baseLcot_
Definition: DRin.h:150
Class to assign tracklet tracks and stubs to output channel based on their Pt or seed type as well as...
SensorModule::Type type(const TTStubRef &ttStubRef) const
Definition: Setup.cc:329
TTBV maybePattern(int binEta, int binZT, int binCot) const
int kfMinLayers() const
Definition: Setup.h:493
double hybridBaseR(SensorModule::Type type) const
Definition: Setup.h:282
std::vector< FrameTrack > StreamTrack
Definition: TTTypes.h:64
static std::string to_string(const XMLCh *ch)
bool equal(const T &first, const T &second)
Definition: Equal.h:32
int offsetStub(int channelTrack) const
int rresidbits() const
Definition: Settings.h:409
static std::string const input
Definition: EdmProvDump.cc:50
bool psTilt_
Definition: DRin.h:84
double chosenRofPhi() const
Definition: DataFormats.h:508
double tiltedLayerLimitZ(int layer) const
Definition: Setup.h:165
double r_
Definition: DRin.h:78
double baseUphiT_
Definition: DRin.h:141
std::pair< TTTrackRef, Frame > FrameTrack
Definition: TTTypes.h:62
double baseHz_
Definition: DRin.h:162
int nbitst() const
Definition: Settings.h:376
double baseHzT_
Definition: DRin.h:159
int numSectorsEta() const
Definition: Setup.h:415
Definition: TTTypes.h:54
double beamWindowZ() const
Definition: Setup.h:180
bool useTTStubResiduals_
Definition: DRin.h:120
GlobalPoint stubPos(const TTStubRef &ttStubRef) const
Definition: Setup.cc:824
void consume(const tt::StreamsTrack &streamsTrack, const tt::StreamsStub &streamsStub)
Definition: DRin.cc:61
const int region_
Definition: DRin.h:132
double baseSector() const
Definition: Setup.h:424
double maxEta() const
Definition: Setup.h:211
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
stack
Definition: svgfig.py:559
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double z_
Definition: DRin.h:82
double baseLphiT_
Definition: DRin.h:149
double digi(double val, double base) const
Definition: DRin.h:41
double hybridRangeR() const
Definition: Setup.h:302
bool isNull() const
Checks for null.
Definition: Ref.h:229
const trackerTFP::DataFormats * dataFormats_
Definition: DRin.h:124
double outerRadius() const
Definition: Setup.h:241
int numLayers() const
Definition: Setup.h:215
const Settings * settings_
Definition: DRin.h:130
std::vector< Track > tracks_
Definition: DRin.h:134
int offsetLayerDisks() const
Definition: Setup.h:371
int offsetLayerId() const
Definition: Setup.h:373
double baseHinv2R_
Definition: DRin.h:156
int numProjectionLayers(int seedType) const
int widthAddrBRAM18() const
Definition: Setup.h:151
bool psModule(int dtcId) const
Definition: Setup.cc:322
int val() const
Definition: TTBV.h:259
double baseLphi_
Definition: DRin.h:153
double baseUinv2R_
Definition: DRin.h:140
double baseUzT_
Definition: DRin.h:143
void produce(tt::StreamsStub &accpetedStubs, tt::StreamsTrack &acceptedTracks, tt::StreamsStub &lostStubs, tt::StreamsTrack &lostTracks)
Definition: DRin.cc:217
int toUnsigned(int i) const
Definition: DataFormats.h:102
int trackletLayerId(const TTStubRef &ttStubRef) const
Definition: Setup.cc:518
double disk2SR(int layerId, int r) const
Definition: Setup.h:306
int zresidbits() const
Definition: Settings.h:408
HLT enums.
int phiresidbits() const
Definition: Settings.h:407
Class to encode layer ids for Kalman Filter Layers consitent with rough r-z track parameters are coun...
Definition: LayerEncoding.h:19
const ChannelAssignment * channelAssignment_
Definition: DRin.h:128
T * pop_front(std::deque< T *> &ts) const
Definition: DRin.cc:443
double baseUphi_
Definition: DRin.h:145
double baseUr_
Definition: DRin.h:144
double deltaPhi(double lhs, double rhs=0.)
Definition: Setup.h:37
const int layerIdKF(int binEta, int binZT, int binCot, int layerId) const
bool layerId(int seedType, const TTStubRef &ttStubRef, int &layerId) const
int indexLayerId(const TTStubRef &ttStubRef) const
Definition: Setup.cc:523
double baseHphiT_
Definition: DRin.h:157
std::vector< std::vector< Track * > > input_
Definition: DRin.h:138
Class to calculate and provide dataformats used by Track Trigger emulator.
Definition: DataFormats.h:216
double baseRegion() const
Definition: Setup.h:184
double sectorCot(int eta) const
Definition: Setup.h:432
double baseHcot_
Definition: DRin.h:158
double kphi() const
Definition: Settings.h:338
double phi_
Definition: DRin.h:80
long double T
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
bool barrel(const TTStubRef &ttStubRef) const
Definition: Setup.cc:528
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
double baseLinv2R_
Definition: DRin.h:148
double baseUcot_
Definition: DRin.h:142
double baseLzT_
Definition: DRin.h:151
const DataFormat & format(Variable v, Process p) const
Definition: DataFormats.h:506
unsigned transform(const HcalDetId &id, unsigned transformCode)