CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HitStructures.cc
Go to the documentation of this file.
2 
4 #include "Matriplex/Memory.h"
6 
7 #include "Debug.h"
8 
9 namespace mkfit {
10 
12 #ifdef COPY_SORTED_HITS
13  free_hits();
14 #endif
15  operator delete[](m_hit_ranks);
16  }
17 
18 #ifdef COPY_SORTED_HITS
19  void LayerOfHits::alloc_hits(int size) {
20  m_hits = (Hit *)Matriplex::aligned_alloc64(sizeof(Hit) * size);
21  m_capacity = size;
22  for (int ihit = 0; ihit < m_capacity; ihit++) {
23  m_hits[ihit] = Hit();
24  }
25  }
26 
27  void LayerOfHits::free_hits() { std::free(m_hits); }
28 #endif
29 
30  void LayerOfHits::setup_bins(float qmin, float qmax, float dq) {
31  // Define layer with min/max and number of bins along q.
32 
33  if (dq < 0) {
34  m_nq = (int)-dq;
35  m_qmin = qmin;
36  m_qmax = qmax;
37  } else {
38  float extent = qmax - qmin;
39  m_nq = std::ceil(extent / dq);
40  float extra = 0.5f * (m_nq * dq - extent);
41  m_qmin = qmin - extra;
42  m_qmax = qmax + extra;
43  }
44  m_fq = m_nq / (qmax - qmin); // used in e.g. qbin = (q_hit - m_qmin) * m_fq;
45 
46  m_phi_bin_infos.resize(m_nq);
47  m_phi_bin_deads.resize(m_nq);
48  }
49 
51  // Note, LayerInfo::q_bin( ==> > 0 - bin width, < 0 - number of bins
52 
53  assert(m_layer_info == nullptr && "setupLayer() already called.");
54 
55  m_layer_info = &li;
56 
58 
59  if (m_is_barrel)
60  setup_bins(li.zmin(), li.zmax(), li.q_bin());
61  else
62  setup_bins(li.rin(), li.rout(), li.q_bin());
63  }
64 
65  //==============================================================================
66 
67  void LayerOfHits::suckInHits(const HitVec &hitv) {
68  assert(m_nq > 0 && "setupLayer() was not called.");
69 
70  m_n_hits = hitv.size();
71  m_ext_hits = &hitv;
72 
73 #ifdef COPY_SORTED_HITS
74  if (m_capacity < m_n_hits) {
75  free_hits();
76  alloc_hits(m_n_hits);
77  }
78 #endif
79 
81  m_hit_phis.resize(m_n_hits);
82  m_hit_qs.resize(m_n_hits);
83  m_hit_infos.resize(m_n_hits);
84  }
85  m_qphifines.resize(m_n_hits);
86 
87  for (int i = 0; i < m_n_hits; ++i) {
88  const Hit &h = hitv[i];
89 
90  HitInfo hi = {h.phi(), m_is_barrel ? h.z() : h.r()};
91 
92  m_qphifines[i] = phiBinFine(hi.phi) + (qBinChecked(hi.q) << 16);
93 
95  m_hit_infos[i] = hi;
96  }
97  }
98 
99  operator delete[](m_hit_ranks);
100  {
101  RadixSort sort;
102  sort.Sort(&m_qphifines[0], m_n_hits, RADIX_UNSIGNED);
103  m_hit_ranks = sort.RelinquishRanks();
104  }
105 
106  int curr_qphi = -1;
107  empty_q_bins(0, m_nq, 0);
108 
109  for (int i = 0; i < m_n_hits; ++i) {
110  int j = m_hit_ranks[i];
111 
112 #ifdef COPY_SORTED_HITS
113  memcpy(&m_hits[i], &hitv[j], sizeof(Hit));
114 #endif
115 
116  if (Config::usePhiQArrays) {
117  m_hit_phis[i] = m_hit_infos[j].phi;
118  m_hit_qs[i] = m_hit_infos[j].q;
119  }
120 
121  // Combined q-phi bin with fine part masked off
122  const int jqphi = m_qphifines[j] & m_phi_fine_xmask;
123 
124  const int phi_bin = (jqphi & m_phi_mask_fine) >> m_phi_bits_shift;
125  const int q_bin = jqphi >> 16;
126 
127  // Fill the bin info
128  if (jqphi != curr_qphi) {
129  m_phi_bin_infos[q_bin][phi_bin] = {i, i};
130  curr_qphi = jqphi;
131  }
132 
133  m_phi_bin_infos[q_bin][phi_bin].second++;
134  }
135  }
136 
137  //==============================================================================
138 
139  void LayerOfHits::suckInDeads(const DeadVec &deadv) {
140  assert(m_nq > 0 && "setupLayer() was not called.");
141 
143 
144  for (const auto &d : deadv) {
145  int q_bin_1 = qBinChecked(d.q1);
146  int q_bin_2 = qBinChecked(d.q2) + 1;
147  int phi_bin_1 = phiBin(d.phi1);
148  int phi_bin_2 = phiBin(d.phi2) + 1;
149  for (int q_bin = q_bin_1; q_bin < q_bin_2; q_bin++) {
150  if (phi_bin_1 > phi_bin_2) {
151  for (int pb = phi_bin_1; pb < Config::m_nphi; pb++) {
152  m_phi_bin_deads[q_bin][pb] = true;
153  }
154  for (int pb = 0; pb < phi_bin_2; pb++) {
155  m_phi_bin_deads[q_bin][pb] = true;
156  }
157  } else {
158  for (int pb = phi_bin_1; pb < phi_bin_2; pb++) {
159  m_phi_bin_deads[q_bin][pb] = true;
160  }
161  }
162  }
163  }
164  }
165 
167  assert(m_nq > 0 && "setupLayer() was not called.");
168 
169  m_ext_hits = &hitv;
170 
171  m_n_hits = 0;
172  m_hit_infos.clear();
173  m_qphifines.clear();
174  m_ext_idcs.clear();
177  }
178 
179  void LayerOfHits::registerHit(int idx) {
180  const Hit &h = (*m_ext_hits)[idx];
181 
182  m_ext_idcs.push_back(idx);
185 
186  HitInfo hi = {h.phi(), m_is_barrel ? h.z() : h.r()};
187 
188  m_qphifines.push_back(phiBinFine(hi.phi) + (qBinChecked(hi.q) << 16));
189 
190  if (Config::usePhiQArrays) {
191  m_hit_infos.emplace_back(hi);
192  }
193  }
194 
195  void LayerOfHits::endRegistrationOfHits(bool build_original_to_internal_map) {
196  m_n_hits = m_ext_idcs.size();
197  if (m_n_hits == 0)
198  return;
199 
200  // radix
201  operator delete[](m_hit_ranks);
202  {
203  RadixSort sort;
205  m_hit_ranks = sort.RelinquishRanks();
206  }
207 
208  // copy q/phi
209 
210 #ifdef COPY_SORTED_HITS
211  if (m_capacity < m_n_hits) {
212  free_hits();
213  alloc_hits(m_n_hits);
214  }
215 #endif
216 
217  if (Config::usePhiQArrays) {
218  m_hit_phis.resize(m_n_hits);
219  m_hit_qs.resize(m_n_hits);
220  }
221 
222  int curr_qphi = -1;
223  empty_q_bins(0, m_nq, 0);
224 
225  for (int i = 0; i < m_n_hits; ++i) {
226  int j = m_hit_ranks[i]; // index in intermediate
227  int k = m_ext_idcs[j]; // index in external hit_vec
228 
229 #ifdef COPY_SORTED_HITS
230  memcpy(&m_hits[i], &hitv[k], sizeof(Hit));
231 #endif
232 
233  if (Config::usePhiQArrays) {
234  m_hit_phis[i] = m_hit_infos[j].phi;
235  m_hit_qs[i] = m_hit_infos[j].q;
236  }
237 
238  // Combined q-phi bin with fine part masked off
239  const int jqphi = m_qphifines[j] & m_phi_fine_xmask;
240 
241  const int phi_bin = (jqphi & m_phi_mask_fine) >> m_phi_bits_shift;
242  const int q_bin = jqphi >> 16;
243 
244  // Fill the bin info
245  if (jqphi != curr_qphi) {
246  m_phi_bin_infos[q_bin][phi_bin] = {i, i};
247  curr_qphi = jqphi;
248  }
249 
250  m_phi_bin_infos[q_bin][phi_bin].second++;
251 
252  // m_hit_ranks[i] will never be used again - use it to point to external/original index.
253  m_hit_ranks[i] = k;
254  }
255 
256  if (build_original_to_internal_map) {
257  if (m_max_ext_idx - m_min_ext_idx + 1 > 8 * m_n_hits) {
258  // If this happens we might:
259  // a) Use external indices for everything. -- *** We are now. ***
260  // b) Build these maps for seeding layers only.
261  // c) Have a flag in hit-on-track that tells us if the hit index has been remapped,
262  // essentially, if it is a seed hit. This might be smart anyway.
263  // One could use index < -256 or something similar.
264 
265  printf(
266  "LayerOfHits::endRegistrationOfHits() original_to_internal index map vector is largish: m_n_hits=%d, "
267  "map_vector_size=%d\n",
268  m_n_hits,
270  }
271 
272  m_ext_idcs.resize(m_max_ext_idx - m_min_ext_idx + 1);
273  for (int i = 0; i < m_n_hits; ++i) {
275  }
276  }
277 
278  // We can release m_hit_infos and m_qphifines -- and realloc on next BeginInput.
279  // m_qphifines could still be used as pre-selection in selectHitIndices().
280  }
281 
282  //==============================================================================
283 
284  /*
285  // Example code for looping over a given (q, phi) 2D range.
286  // A significantly more complex implementation of this can be found in MkFinder::selectHitIndices().
287  void LayerOfHits::selectHitIndices(float q, float phi, float dq, float dphi, std::vector<int>& idcs, bool isForSeeding, bool dump)
288  {
289  // Sanitizes q, dq and dphi. phi is expected to be in -pi, pi.
290 
291  // Make sure how phi bins work beyond -pi, +pi.
292  // for (float p = -8; p <= 8; p += 0.05)
293  // {
294  // int pb = phiBin(p);
295  // printf("%5.2f %4d %4d\n", p, pb, pb & m_phi_mask);
296  // }
297 
298  if ( ! isForSeeding) // seeding has set cuts for dq and dphi
299  {
300  // XXXX MT: min search windows not enforced here.
301  dq = std::min(std::abs(dq), max_dq());
302  dphi = std::min(std::abs(dphi), max_dphi());
303  }
304 
305  int qb1 = qBinChecked(q - dq);
306  int qb2 = qBinChecked(q + dq) + 1;
307  int pb1 = phiBin(phi - dphi);
308  int pb2 = phiBin(phi + dphi) + 1;
309 
310  // int extra = 2;
311  // qb1 -= 2; if (qb < 0) qb = 0;
312  // qb2 += 2; if (qb >= m_nq) qb = m_nq;
313 
314  if (dump)
315  printf("LayerOfHits::SelectHitIndices %6.3f %6.3f %6.4f %7.5f %3d %3d %4d %4d\n",
316  q, phi, dq, dphi, qb1, qb2, pb1, pb2);
317 
318  // This should be input argument, well ... it will be Matriplex op, or sth. // KPM -- it is now! used for seeding
319  for (int qi = qb1; qi < qb2; ++qi)
320  {
321  for (int pi = pb1; pi < pb2; ++pi)
322  {
323  int pb = pi & m_phi_mask;
324 
325  for (uint16_t hi = m_phi_bin_infos[qi][pb].first; hi < m_phi_bin_infos[qi][pb].second; ++hi)
326  {
327  // Here could enforce some furhter selection on hits
328  if (Config::usePhiQArrays)
329  {
330  float ddq = std::abs(q - m_hit_qs[hi]);
331  float ddphi = std::abs(phi - m_hit_phis[hi]);
332  if (ddphi > Const::PI) ddphi = Const::TwoPI - ddphi;
333 
334  if (dump)
335  printf(" SHI %3d %4d %4d %5d %6.3f %6.3f %6.4f %7.5f %s\n",
336  qi, pi, pb, hi,
337  m_hit_qs[hi], m_hit_phis[hi], ddq, ddphi,
338  (ddq < dq && ddphi < dphi) ? "PASS" : "FAIL");
339 
340  if (ddq < dq && ddphi < dphi)
341  {
342  idcs.push_back(hi);
343  }
344  }
345  else // do not use phi-q arrays
346  {
347  idcs.push_back(hi);
348  }
349  }
350  }
351  }
352  }
353  */
354 
356  for (int qb = 0; qb < m_nq; ++qb) {
357  printf("%c bin %d\n", is_barrel() ? 'Z' : 'R', qb);
358  for (int pb = 0; pb < Config::m_nphi; ++pb) {
359  if (pb % 8 == 0)
360  printf(" Phi %4d: ", pb);
361  printf("%5d,%4d %s",
362  m_phi_bin_infos[qb][pb].first,
363  m_phi_bin_infos[qb][pb].second,
364  ((pb + 1) % 8 == 0) ? "\n" : "");
365  }
366  }
367  }
368 
369  //==============================================================================
370  // EventOfHits
371  //==============================================================================
372 
374  : m_layers_of_hits(trk_inf.n_layers()), m_n_layers(trk_inf.n_layers()) {
375  for (int ii = 0; ii < trk_inf.n_layers(); ++ii) {
376  const LayerInfo &li = trk_inf.layer(ii);
377  m_layers_of_hits[li.layer_id()].setupLayer(li);
378  }
379  }
380 
381  //==============================================================================
382  // TrackCand
383  //==============================================================================
384 
385  Track TrackCand::exportTrack(bool remove_missing_hits) const {
386  dprintf("TrackCand::exportTrack label=%5d, total_hits=%2d, overlaps=%2d -- n_seed_hits=%d,prod_type=%d\n",
387  label(),
388  nTotalHits(),
390  getNSeedHits(),
391  (int)prodType());
392 
393  Track res(*this);
394  res.resizeHits(remove_missing_hits ? nFoundHits() : nTotalHits(), nFoundHits());
396 
397  int nh = nTotalHits();
398  int ch = lastHitIdx_;
399  int good_hits_pos = nFoundHits();
400  while (--nh >= 0) {
401  const HoTNode &hot_node = m_comb_candidate->hot_node(ch);
402  if (remove_missing_hits) {
403  if (hot_node.m_hot.index >= 0)
404  res.setHitIdxAtPos(--good_hits_pos, hot_node.m_hot);
405  } else {
406  res.setHitIdxAtPos(nh, hot_node.m_hot);
407  }
408  dprintf(" nh=%2d, ch=%d, idx=%d lyr=%d prev_idx=%d\n",
409  nh,
410  ch,
411  hot_node.m_hot.index,
412  hot_node.m_hot.layer,
413  hot_node.m_prev_idx);
414  ch = hot_node.m_prev_idx;
415  }
416 
417  return res;
418  }
419 
420  //==============================================================================
421  // CombCandidate
422  //==============================================================================
423 
425  m_trk_cands.emplace_back(TrackCand(seed, this));
426 
428  m_pickup_layer = seed.getLastHitLyr();
429 #ifdef DUMPHITWINDOW
430  m_seed_algo = seed.algoint();
431  m_seed_label = seed.label();
432 #endif
433 
434  TrackCand &cand = m_trk_cands.back();
435  cand.setNSeedHits(seed.nTotalHits());
436  cand.setEtaRegion(region);
437 
438  dprintf("Importing pt=%f eta=%f, lastCcIndex=%d\n", cand.pT(), cand.momEta(), cand.lastCcIndex());
439 
440  for (const HitOnTrack *hp = seed.beginHitsOnTrack(); hp != seed.endHitsOnTrack(); ++hp) {
441  dprintf(" hit idx=%d lyr=%d\n", hp->index, hp->layer);
442  cand.addHitIdx(hp->index, hp->layer, 0.0f);
443  }
444 
445  cand.setScore(getScoreCand(cand));
446  }
447 
448  void CombCandidate::mergeCandsAndBestShortOne(const IterationParams &params, bool update_score, bool sort_cands) {
449  TrackCand *best_short = m_best_short_cand.combCandidate() ? &m_best_short_cand : nullptr;
450 
451  if (!empty()) {
452  if (update_score) {
453  for (auto &c : m_trk_cands)
454  c.setScore(getScoreCand(c));
455  if (best_short)
456  best_short->setScore(getScoreCand(*best_short));
457  }
458  if (sort_cands) {
459  std::sort(m_trk_cands.begin(), m_trk_cands.end(), sortByScoreTrackCand);
460  }
461 
462  if (best_short && best_short->score() > m_trk_cands.back().score()) {
463  auto ci = m_trk_cands.begin();
464  while (ci->score() > best_short->score())
465  ++ci;
466 
467  if ((int)m_trk_cands.size() >= params.maxCandsPerSeed)
468  m_trk_cands.pop_back();
469 
470  // To print out what has been replaced -- remove when done with short track handling.
471 #ifdef DEBUG
472  if (ci == m_trk_cands.begin()) {
473  printf("FindTracksStd -- Replacing best cand (%f) with short one (%f) in final sorting\n",
474  m_trk_cands.front().score(),
475  best_short->score());
476  }
477 #endif
478 
479  m_trk_cands.insert(ci, *best_short);
480  }
481 
482  } else if (best_short) {
483  m_trk_cands.push_back(*best_short);
484  }
485 
486  if (best_short)
487  best_short->resetShortTrack();
488 
489  // assert(capacity() == (size_t)Config::maxCandsPerSeed);
490  }
491 
492  void CombCandidate::compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits) {
493  // The best candidate is assumed to be in position 0 (after mergeCandsAndBestShortOne
494  // mergeCandsAndBestShortOne has been called).
495  // Other cands are dropped, their hits are dropped as well.
496  // Seed hits are dropped if remove_seed_hits is true.
497 
498  /* The following considerations are related to the following implementation:
499  minNrOfHitsForRebuild (checked against "nHits - nseed") has a default at 5, except
500  1 in initialStep
501  4 in tobTec and pixelLess
502  https://github.com/cms-sw/cmssw/blob/master/RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilder.cc#L1015
503 
504  NOTE: some of those can be matched hits !!!
505 
506  the hit splitting is triggered here: https://github.com/cms-sw/cmssw/blob/master/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc#L468
507  after the rebuild has already happened: https://github.com/cms-sw/cmssw/blob/master/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc#L313
508  */
509 
510  assert(!m_trk_cands.empty());
511  m_trk_cands.resize(1);
512  TrackCand &tc = m_trk_cands[0];
513 
514  // Do NOT remove any seed hits if fewer than backward_fit_min_hits hits are available.
515  if (remove_seed_hits && tc.nFoundHits() <= backward_fit_min_hits) {
516  remove_seed_hits = false;
517  }
518 
519  // Stash HoTNodes at the end of m_hots.
520  int stash_end = m_hots.size();
521  int stash_pos = stash_end;
522 
523  int idx = tc.lastCcIndex();
524 
525  if (remove_seed_hits) {
526  // Skip invalid hits that would now be at the head of the candidate.
527  // Make sure to subtract / recount number of hits:
528  // as this is rather involved, just call addHitIdx() repeatedly so counts
529  // of holes get updated correctly.
530  // Though one should not care super much ... it's only relevant for relative scores
531  // and here we are trimming everything down to a single candidate.
532 
533  int n_hits_to_pick = std::max(tc.nFoundHits() - tc.getNSeedHits(), backward_fit_min_hits);
534  while (n_hits_to_pick > 0) {
535  m_hots[--stash_pos] = m_hots[idx];
536  if (m_hots[idx].m_hot.index >= 0)
537  --n_hits_to_pick;
538  idx = m_hots[idx].m_prev_idx;
539  }
540 
541  m_hots_size = 0;
542  m_hots.clear();
543  tc.setLastCcIndex(-1);
544  tc.setNFoundHits(0);
545  tc.setNMissingHits(0);
547  tc.setNTailMinusOneHits(0);
548  while (stash_pos != stash_end && m_hots[stash_pos].m_hot.index < 0)
549  ++stash_pos;
550  while (stash_pos != stash_end) {
551  HoTNode &hn = m_hots[stash_pos];
552  tc.addHitIdx(hn.m_hot.index, hn.m_hot.layer, hn.m_chi2);
553  ++stash_pos;
554  }
555  } else {
556  while (idx != -1) {
557  m_hots[--stash_pos] = m_hots[idx];
558  idx = m_hots[idx].m_prev_idx;
559  }
560 
561  // If we are not removing seed_hits, track is good as it is,
562  // just fixup m_hots and t.lastCcIndex.
563  int pos = 0;
564  while (stash_pos != stash_end) {
565  m_hots[pos].m_hot = m_hots[stash_pos].m_hot;
566  m_hots[pos].m_chi2 = m_hots[stash_pos].m_chi2;
567  m_hots[pos].m_prev_idx = pos - 1;
568  ++pos;
569  ++stash_pos;
570  }
571  m_hots.resize(pos);
572  m_hots_size = pos;
573  tc.setLastCcIndex(pos - 1);
574  }
575  }
576 
578  // Assumes compactifyHitStorageForBestCand() has already been called.
579  //
580  // This is to be called before backward-search to start with a single
581  // input candidate for backward combinatorial search.
582  //
583  // m_state and m_pickup_layer are also set.
584 
585  TrackCand &tc = m_trk_cands[0];
586 
587  m_state = Dormant;
588  m_pickup_layer = m_hots[0].m_hot.layer;
592  tc.setLastCcIndex(0);
594  tc.setNTailMinusOneHits(0);
595  }
596 
598  // mergeCandsAndBestShortOne() has already been called (from MkBuilder::FindXxx()).
599  // We have to fixup the best candidate.
600 
601  TrackCand &tc = m_trk_cands[0];
602 
603  int curr_idx = tc.lastCcIndex();
604  if (curr_idx != 0) {
605  int last_idx = -1, prev_idx;
606  do {
607  prev_idx = m_hots[curr_idx].m_prev_idx;
608 
609  m_hots[curr_idx].m_prev_idx = last_idx;
610 
611  last_idx = curr_idx;
612  curr_idx = prev_idx;
613  } while (prev_idx != -1);
614  }
615 
622  }
623 
624 } // end namespace mkfit
static constexpr int m_nphi
Definition: Config.h:81
void endRegistrationOfHits(bool build_original_to_internal_map)
constexpr int32_t ceil(float num)
void addHitIdx(int hitIdx, int hitLyr, float chi2)
int nTailMinusOneHits() const
const edm::EventSetup & c
int phiBinFine(float phi) const
Definition: HitStructures.h:77
const HoTNode & hot_node(int i) const
int qBinChecked(float q) const
Definition: HitStructures.h:74
void mergeCandsAndBestShortOne(const IterationParams &params, bool update_score, bool sort_cands)
const LayerInfo & layer(int l) const
Definition: TrackerInfo.h:146
int getNSeedHits() const
Definition: Track.h:264
CombCandidate * m_comb_candidate
Track exportTrack(bool remove_missing_hits=false) const
std::vector< float > m_hit_phis
udword * RelinquishRanks()
TrackCand m_best_short_cand
float score() const
Definition: Track.h:185
short int m_nInsideMinusOneHits_before_bkwsearch
int nFoundHits() const
static constexpr int m_phi_mask_fine
float r() const
Definition: Hit.h:157
void setLastCcIndex(int i)
const HitVec * m_ext_hits
void setNInsideMinusOneHits(int n)
void setNFoundHits(int n)
short int nOverlapHits_
short int m_nTailMinusOneHits_before_bkwsearch
vecvecPhiBinDead_t m_phi_bin_deads
void resizeHits(int nHits, int nFoundHits)
Definition: Track.h:432
int ii
Definition: cuy.py:589
RadixSort & Sort(const udword *input, udword nb, RadixHint hint=RADIX_SIGNED)
assert(be >=bs)
int nInsideMinusOneHits() const
void setNTailMinusOneHits(int n)
void setNSeedHits(int n)
Definition: Track.h:265
float zmin() const
Definition: TrackerInfo.h:45
bool empty() const
U second(std::pair< T, U > const &p)
constexpr bool usePhiQArrays
Definition: Config.h:104
tuple d
Definition: ztail.py:151
int algoint() const
Definition: Track.h:330
void setScore(float s)
Definition: Track.h:190
void setNMissingHits(int n)
int nTotalHits() const
float z() const
Definition: Hit.h:163
int layer_id() const
Definition: TrackerInfo.h:40
void setup_bins(float qmin, float qmax, float dq)
static constexpr int m_phi_fine_xmask
float rin() const
Definition: TrackerInfo.h:42
unsigned int * m_hit_ranks
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
void suckInDeads(const DeadVec &deadv)
void setEtaRegion(int r)
Definition: Track.h:267
const HitOnTrack * beginHitsOnTrack() const
Definition: Track.h:499
int phiBin(float phi) const
Definition: HitStructures.h:78
ProdType prodType() const
Definition: Track.h:261
uint32_t nh
bool is_barrel() const
Definition: TrackerInfo.h:52
void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits)
SeedingHitSet::ConstRecHitPointer Hit
CombCandidate * combCandidate() const
float pT() const
Definition: Track.h:169
std::vector< Hit > HitVec
float rout() const
Definition: TrackerInfo.h:43
int nOverlapHits() const
int lastCcIndex() const
short int lastHitIdx_
Definition: Track.h:346
float momEta() const
Definition: Track.h:173
void setupLayer(const LayerInfo &li)
float getScoreCand(const TrackCand &cand1, bool penalizeTailMissHits=false, bool inFindCandidates=false)
static constexpr int m_phi_bits_shift
bool sortByScoreTrackCand(const TrackCand &cand1, const TrackCand &cand2)
void empty_q_bins_dead(int q_bin_1, int q_bin_2)
short int m_lastHitIdx_before_bkwsearch
std::vector< DeadRegion > DeadVec
Definition: Hit.h:266
trk_cand_vec_type m_trk_cands
std::vector< float > m_hit_qs
int getLastHitLyr() const
Definition: Track.h:460
void suckInHits(const HitVec &hitv)
void beginRegistrationOfHits(const HitVec &hitv)
void importSeed(const Track &seed, int region)
EventOfHits(const TrackerInfo &trk_inf)
int label() const
Definition: Track.h:186
bool is_barrel() const
void * aligned_alloc64(std::size_t size)
Definition: Memory.h:13
vecvecPhiBinInfo_t m_phi_bin_infos
int n_layers() const
Definition: TrackerInfo.h:145
float q_bin() const
Definition: TrackerInfo.h:49
Input values are unsigned.
void registerHit(int idx)
void setNOverlapHits(int n)
Definition: Track.h:520
const LayerInfo * m_layer_info
float zmax() const
Definition: TrackerInfo.h:46
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
int nTotalHits() const
Definition: Track.h:517
const HitOnTrack * endHitsOnTrack() const
Definition: Track.h:500
void setHitIdxAtPos(int pos, const HitOnTrack &hot)
Definition: Track.h:438
HitOnTrack m_hot
std::vector< int > m_ext_idcs
std::vector< LayerOfHits > m_layers_of_hits
std::vector< HitInfo > m_hit_infos
tuple size
Write out results.
void empty_q_bins(int q_bin_1, int q_bin_2, uint16_t hit_count)
#define dprintf(...)
Definition: Debug.h:93
std::vector< uint32_t > m_qphifines
float phi() const
Definition: Hit.h:167
std::vector< HoTNode > m_hots