CMS 3D CMS Logo

TrackStructures.h
Go to the documentation of this file.
1 #ifndef RecoTracker_MkFitCore_interface_TrackStructures_h
2 #define RecoTracker_MkFitCore_interface_TrackStructures_h
3 
8 
9 #include <algorithm>
10 #include <array>
11 
12 namespace mkfit {
13 
14  class IterationParams;
15 
16  //==============================================================================
17  // TrackCand, CombinedCandidate and EventOfCombinedCandidates
18  //==============================================================================
19 
20  struct HoTNode {
22  float m_chi2;
24  };
25 
26  struct HitMatch {
27  int m_hit_idx = -1;
28  int m_module_id = -1;
29  float m_chi2 = 1e9;
30 
31  void reset() {
32  m_hit_idx = -1;
33  m_module_id = -1;
34  m_chi2 = 1e9;
35  }
36  };
37 
38  struct HitMatchPair {
39  HitMatch M[2];
40 
41  void reset() {
42  M[0].reset();
43  M[1].reset();
44  }
45 
46  void consider_hit_for_overlap(int hit_idx, int module_id, float chi2) {
47  if (module_id == M[0].m_module_id) {
48  if (chi2 < M[0].m_chi2) {
49  M[0].m_chi2 = chi2;
50  M[0].m_hit_idx = hit_idx;
51  }
52  } else if (module_id == M[1].m_module_id) {
53  if (chi2 < M[1].m_chi2) {
54  M[1].m_chi2 = chi2;
55  M[1].m_hit_idx = hit_idx;
56  }
57  } else {
58  if (M[0].m_chi2 > M[1].m_chi2) {
59  if (chi2 < M[0].m_chi2) {
60  M[0] = {hit_idx, module_id, chi2};
61  }
62  } else {
63  if (chi2 < M[1].m_chi2) {
64  M[1] = {hit_idx, module_id, chi2};
65  }
66  }
67  }
68  }
69 
70  HitMatch* find_overlap(int hit_idx, int module_id) {
71  if (module_id == M[0].m_module_id) {
72  if (M[1].m_hit_idx >= 0)
73  return &M[1];
74  } else if (module_id == M[1].m_module_id) {
75  if (M[0].m_hit_idx >= 0)
76  return &M[0];
77  } else {
78  if (M[0].m_chi2 <= M[1].m_chi2) {
79  if (M[0].m_hit_idx >= 0)
80  return &M[0];
81  } else {
82  if (M[1].m_hit_idx >= 0)
83  return &M[1];
84  }
85  }
86 
87  return nullptr;
88  }
89  };
90 
91  // CcPool - CombCandidate Pool and Allocator
92 
93  template <class T>
94  class CcPool {
95  public:
96  void reset(std::size_t size) {
97  if (size > m_mem.size())
98  m_mem.resize(size);
99  m_pos = 0;
100  m_size = size;
101  }
102 
103  void release() {
104  std::vector<T> tmp;
105  m_mem.swap(tmp);
106  m_pos = 0;
107  m_size = 0;
108  }
109 
110  CcPool(std::size_t size = 0) {
111  if (size)
112  reset(size);
113  }
114 
115  T* allocate(std::size_t n) {
116  if (m_pos + n > m_size)
117  throw std::bad_alloc();
118  T* ret = &m_mem[m_pos];
119  m_pos += n;
120  return ret;
121  }
122 
123  void deallocate(T* p, std::size_t n) noexcept {
124  // we do not care, implied deallocation of the whole pool on reset().
125  }
126 
127  private:
128  std::vector<T> m_mem;
129  std::size_t m_pos = 0;
130  std::size_t m_size = 0;
131  };
132 
133  template <class T>
134  class CcAlloc {
135  public:
136  typedef T value_type;
137 
139 
140  const void* pool_id() const { return m_pool; }
141 
142  T* allocate(std::size_t n) { return m_pool->allocate(n); }
143 
144  void deallocate(T* p, std::size_t n) noexcept { m_pool->deallocate(p, n); }
145 
146  private:
148  };
149 
150  template <class T, class U>
151  bool operator==(const CcAlloc<T>& a, const CcAlloc<U>& b) {
152  return a.pool_id() == b.pool_id();
153  }
154 
155  //------------------------------------------------------------------------------
156 
157  class CombCandidate;
158 
159  class TrackCand : public TrackBase {
160  public:
161  TrackCand() = default;
162 
163  explicit TrackCand(const TrackBase& base, CombCandidate* ccand) : TrackBase(base), m_comb_candidate(ccand) {
164  // Reset hit counters -- caller has to initialize hits.
165  lastHitIdx_ = -1;
166  nFoundHits_ = 0;
167  }
168 
169  // CombCandidate is used as a hit-container for a set of TrackCands originating from
170  // the same seed and track building functions need this access to be able to add hits
171  // into this holder class.
172  // Access is guaranteed to be thread safe as seed ranges pointing into CombCandidate
173  // vector is assigned to threads doing track-finding and final processing is only done
174  // when all worker threads have finished.
177 
178  int lastCcIndex() const { return lastHitIdx_; }
179  int nFoundHits() const { return nFoundHits_; }
180  int nMissingHits() const { return nMissingHits_; }
181  int nOverlapHits() const { return nOverlapHits_; }
182  int nTotalHits() const { return nFoundHits_ + nMissingHits_; }
183 
184  void setLastCcIndex(int i) { lastHitIdx_ = i; }
185  void setNFoundHits(int n) { nFoundHits_ = n; }
186  void setNMissingHits(int n) { nMissingHits_ = n; }
187  void setNOverlapHits(int n) { nOverlapHits_ = n; }
188 
190  int nTailMinusOneHits() const { return nTailMinusOneHits_; }
191 
194 
195  int originIndex() const { return m_origin_index; }
196  void setOriginIndex(int oi) { m_origin_index = oi; }
197 
199  void considerHitForOverlap(int hit_idx, int module_id, float chi2) {
201  }
202  HitMatch* findOverlap(int hit_idx, int module_id) { return m_overlap_hits.find_overlap(hit_idx, module_id); }
203 
204  // Inlines after definition of CombCandidate
205 
207  int getLastHitIdx() const;
208  int getLastHitLyr() const;
209 
210  // For additional filter
211  int getLastFoundPixelHitLyr() const;
212  int getLastFoundHitLyr() const;
213  int nUniqueLayers() const;
214 
215  int nLayersByTypeEncoded(const TrackerInfo& trk_inf) const;
216  int nHitsByTypeEncoded(const TrackerInfo& trk_inf) const;
217 
218  int nPixelDecoded(const int& encoded) const { return encoded % 100; }
219  int nStereoDecoded(const int& encoded) const { return (encoded / 100) % 100; }
220  int nMonoDecoded(const int& encoded) const { return (encoded / 10000) % 100; }
221  int nMatchedDecoded(const int& encoded) const { return encoded / 1000000; }
222  int nTotMatchDecoded(const int& encoded) const {
223  return encoded % 100 + (encoded / 100) % 100 + (encoded / 10000) % 100 - encoded / 1000000;
224  }
225 
226  void addHitIdx(int hitIdx, int hitLyr, float chi2);
227  bool popOverlap();
228 
229  HoTNode& refLastHoTNode(); // for filling up overlap info
230  const HoTNode& refLastHoTNode() const; // for dump traversal
231 
233 
234  Track exportTrack(bool remove_missing_hits = false) const;
235 
238  m_comb_candidate = nullptr;
239  }
240 
241  private:
244 
245  // using TrackBase::lastHitIdx_ to point into hit-on-track-node vector of CombCandidate
246  short int nMissingHits_ = 0;
247  short int nOverlapHits_ = 0;
248 
249  short int nInsideMinusOneHits_ = 0;
250  short int nTailMinusOneHits_ = 0;
251 
252  short int m_origin_index = -1; // index of origin candidate (used for overlaps in Standard)
253  };
254 
255  inline bool sortByScoreTrackCand(const TrackCand& cand1, const TrackCand& cand2) {
256  return cand1.score() > cand2.score();
257  }
258 
259  inline float getScoreCand(const track_score_func& score_func,
260  const TrackCand& cand1,
261  bool penalizeTailMissHits = false,
262  bool inFindCandidates = false) {
263  int nfoundhits = cand1.nFoundHits();
264  int noverlaphits = cand1.nOverlapHits();
265  int nmisshits = cand1.nInsideMinusOneHits();
266  int ntailmisshits = penalizeTailMissHits ? cand1.nTailMinusOneHits() : 0;
267  float pt = cand1.pT();
268  float chi2 = cand1.chi2();
269  // Do not allow for chi2<0 in score calculation
270  if (chi2 < 0)
271  chi2 = 0.f;
272  return score_func(nfoundhits, ntailmisshits, noverlaphits, nmisshits, chi2, pt, inFindCandidates);
273  }
274 
275  // CombCandidate -- a set of candidates from a given seed.
276 
278  public:
279  using trk_cand_vec_type = std::vector<TrackCand, CcAlloc<TrackCand>>;
281 
283 
285 
286  // Required by std::uninitialized_fill_n when declaring vector<CombCandidate> in EventOfCombCandidates
289  m_state(o.m_state),
296  m_hots(o.m_hots) {}
297 
298  // Required for std::swap().
302  m_state(o.m_state),
309  m_hots(std::move(o.m_hots)) {
310  // This is not needed as we do EOCC::reset() after EOCCS::resize which
311  // calls Reset here and all CombCands get cleared.
312  // However, if at some point we start using this for other purposes this needs
313  // to be called as well.
314  // for (auto &tc : *this) tc.setCombCandidate(this);
315  }
316 
317  // Required for std::swap when filtering EventOfCombinedCandidates::m_candidates.
318  // We do not call clear() on vectors as this will be done via EoCCs reset.
319  // Probably would be better (clearer) if there was a special function that does
320  // the swap in here or in EoCCs.
322  m_trk_cands = (std::move(o.m_trk_cands));
323  m_best_short_cand = std::move(o.m_best_short_cand);
324  m_state = o.m_state;
325  m_pickup_layer = o.m_pickup_layer;
326  m_lastHitIdx_before_bkwsearch = o.m_lastHitIdx_before_bkwsearch;
327  m_nInsideMinusOneHits_before_bkwsearch = o.m_nInsideMinusOneHits_before_bkwsearch;
328  m_nTailMinusOneHits_before_bkwsearch = o.m_nTailMinusOneHits_before_bkwsearch;
329  m_seed_origin_index = o.m_seed_origin_index;
330  m_hots_size = o.m_hots_size;
331  m_hots = std::move(o.m_hots);
332 
333  for (auto& tc : m_trk_cands)
334  tc.setCombCandidate(this);
335 
336  return *this;
337  }
338 
339  // std::vector-like interface to access m_trk_cands
340  bool empty() const { return m_trk_cands.empty(); }
341  trk_cand_vec_type::size_type size() const { return m_trk_cands.size(); }
343  TrackCand& operator[](int i) { return m_trk_cands[i]; }
344  const TrackCand& operator[](int i) const { return m_trk_cands[i]; }
345  TrackCand& front() { return m_trk_cands.front(); }
346  const TrackCand& front() const { return m_trk_cands.front(); }
348  void clear() { m_trk_cands.clear(); }
349 
350  void reset(int max_cands_per_seed, int expected_num_hots) {
351  std::vector<TrackCand, CcAlloc<TrackCand>> tmp(m_trk_cands.get_allocator());
352  m_trk_cands.swap(tmp);
353  m_trk_cands.reserve(max_cands_per_seed); // we *must* never exceed this
354 
356 
357  // state and pickup_layer set in importSeed.
358 
359  // expected_num_hots is different for CloneEngine and Std, especially as long as we
360  // instantiate all candidates before purging them.
361  // ce: N_layer * N_cands ~~ 20 * 6 = 120
362  // std: i don't know, maybe double?
363  m_hots.reserve(expected_num_hots);
364  m_hots_size = 0;
365  m_hots.clear();
366 
370  }
371 
372  void importSeed(const Track& seed, int seed_idx, const track_score_func& score_func, int region);
373 
374  int addHit(const HitOnTrack& hot, float chi2, int prev_idx) {
375  m_hots.push_back({hot, chi2, prev_idx});
376  return m_hots_size++;
377  }
378 
380  const track_score_func& score_func,
381  bool update_score,
382  bool sort_cands);
383 
384  void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits);
385  void beginBkwSearch();
386  void repackCandPostBkwSearch(int i);
387  // not needed for CombCand::endBkwSearch(), reinit performed in reset() for a new event.
388 
389  // Accessors
390  //-----------
391  int hotsSize() const { return m_hots_size; }
392  const HoTNode& hot_node(int i) const { return m_hots[i]; }
393  HoTNode& hot_node_nc(int i) { return m_hots[i]; }
394  HitOnTrack hot(int i) const { return m_hots[i].m_hot; }
395  // Direct access into array for vectorized code in MkFinder
396  const HoTNode* hotsData() const { return m_hots.data(); }
397 
398  const TrackCand& refBestShortCand() const { return m_best_short_cand; }
399  void setBestShortCand(const TrackCand& tc) { m_best_short_cand = tc; }
400 
401  SeedState_e state() const { return m_state; }
403 
404  int pickupLayer() const { return m_pickup_layer; }
405 
406  int seed_origin_index() const { return m_seed_origin_index; }
407 
408  private:
412  int m_pickup_layer : 16;
416  int m_seed_origin_index = -1; // seed index in the passed-in seed vector
417  int m_hots_size = 0;
418  std::vector<HoTNode> m_hots;
419  };
420 
421  //==============================================================================
422 
424 
426 
428 
429  inline int TrackCand::getLastFoundHitLyr() const {
430  int nh = nTotalHits();
431  int ch = lastHitIdx_;
432  int ll = -1;
433  while (--nh >= 0) {
434  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
435  if (hot_node.m_hot.index < 0) {
436  ch = hot_node.m_prev_idx;
437  } else {
438  ll = hot_node.m_hot.layer;
439  break;
440  }
441  }
442  return ll;
443  }
444 
446  int nh = nTotalHits();
447  int ch = lastHitIdx_;
448  int ll = -1;
449  while (--nh >= 0) {
450  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
451  int tl = hot_node.m_hot.layer;
452  if (hot_node.m_hot.index < 0 || !((0 <= tl && tl <= 3) || (18 <= tl && tl <= 20) || (45 <= tl && tl <= 47))) {
453  ch = hot_node.m_prev_idx;
454  } else if ((0 <= tl && tl <= 3) || (18 <= tl && tl <= 20) || (45 <= tl && tl <= 47)) {
455  ll = hot_node.m_hot.layer;
456  break;
457  }
458  }
459  return ll;
460  }
461 
462  inline int TrackCand::nUniqueLayers() const {
463  int nUL = 0;
464  int prevL = -1;
465  int nh = nTotalHits();
466  int ch = lastHitIdx_;
467 
468  while (--nh >= 0) {
469  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
470  int thisL = hot_node.m_hot.layer;
471  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx) &&
472  thisL != prevL) {
473  ++nUL;
474  prevL = thisL;
475  }
476  ch = hot_node.m_prev_idx;
477  }
478  return nUL;
479  }
480 
481  inline int TrackCand::nHitsByTypeEncoded(const TrackerInfo& trk_inf) const {
482  int prevL = -1;
483  bool prevStereo = false;
484  int nh = nTotalHits();
485  int ch = lastHitIdx_;
486  int pix = 0, stereo = 0, mono = 0, matched = 0;
487  int doubleStereo = -1;
488  while (--nh >= 0) {
489  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
490  int thisL = hot_node.m_hot.layer;
491  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx)) {
492  bool cStereo = trk_inf[thisL].is_stereo();
493  if (trk_inf[thisL].is_pixel())
494  ++pix;
495  else if (cStereo) {
496  ++stereo;
497  if (thisL == prevL)
498  doubleStereo = thisL;
499  } else {
500  //mono if not pixel, nor stereo - can be matched to stereo
501  ++mono;
502  if (prevStereo && thisL == prevL - 1)
503  ++matched;
504  else if (thisL == prevL && thisL == doubleStereo - 1)
505  ++matched; //doubleMatch, the first is counted early on
506  }
507  prevL = thisL;
508  prevStereo = cStereo;
509  }
510  ch = hot_node.m_prev_idx;
511  }
512  return pix + 100 * stereo + 10000 * mono + 1000000 * matched;
513  }
514 
515  inline int TrackCand::nLayersByTypeEncoded(const TrackerInfo& trk_inf) const {
516  int prevL = -1;
517  bool prevStereo = false;
518  int nh = nTotalHits();
519  int ch = lastHitIdx_;
520  int pix = 0, stereo = 0, mono = 0, matched = 0;
521  while (--nh >= 0) {
522  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
523  int thisL = hot_node.m_hot.layer;
524  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx) &&
525  thisL != prevL) {
526  bool cStereo = trk_inf[thisL].is_stereo();
527  if (trk_inf[thisL].is_pixel())
528  ++pix;
529  else if (cStereo)
530  ++stereo;
531  else {
532  //mono if not pixel, nor stereo - can be matched to stereo
533  ++mono;
534  if (prevStereo && thisL == prevL - 1)
535  ++matched;
536  }
537  prevL = thisL;
538  prevStereo = cStereo;
539  }
540  ch = hot_node.m_prev_idx;
541  }
542  return pix + 100 * stereo + 10000 * mono + 1000000 * matched;
543  }
544 
546 
548 
549  //------------------------------------------------------------------------------
550 
551  inline void TrackCand::addHitIdx(int hitIdx, int hitLyr, float chi2) {
552  lastHitIdx_ = m_comb_candidate->addHit({hitIdx, hitLyr}, chi2, lastHitIdx_);
553 
554  if (hitIdx >= 0 || hitIdx == Hit::kHitCCCFilterIdx) {
555  ++nFoundHits_;
556  chi2_ += chi2;
558  nTailMinusOneHits_ = 0;
559  }
560  //Note that for tracks passing through an inactive module (hitIdx = -7), we do not count the -7 hit against the track when scoring.
561  else {
562  ++nMissingHits_;
563  if (hitIdx == Hit::kHitMissIdx)
565  }
566  }
567 
568  inline bool TrackCand::popOverlap() {
569  auto popHitIdx = getLastHitIdx();
570  auto popHitLyr = getLastHitLyr();
571  auto popPrev = refLastHoTNode().m_prev_idx;
572  auto popChi2 = refLastHoTNode().m_chi2;
573  // sanity checks first, then just shift lastHitIdx_ to popPrev
574  if (lastHitIdx_ == 0 || popHitIdx < 0)
575  return false;
576  auto prevHitLyr = m_comb_candidate->hot(popPrev).layer;
577  auto prevHitIdx = m_comb_candidate->hot(popPrev).index;
578  if (popHitLyr != prevHitLyr || prevHitIdx < 0)
579  return false;
580  lastHitIdx_ = popPrev;
581 
582  --nFoundHits_;
583  chi2_ -= popChi2;
584  --nOverlapHits_;
585  return true;
586  }
587  //==============================================================================
588 
590  public:
592 
593  void releaseMemory() {
594  { // Get all the destructors called before nuking CcPool.
595  std::vector<CombCandidate> tmp;
596  m_candidates.swap(tmp);
597  }
598  m_capacity = 0;
599  m_size = 0;
600  m_n_seeds_inserted = 0;
601  m_cc_pool.release();
602  }
603 
604  void reset(int new_capacity, int max_cands_per_seed, int expected_num_hots = 128) {
605  m_cc_pool.reset(new_capacity * max_cands_per_seed);
606  if (new_capacity > m_capacity) {
608  std::vector<CombCandidate> tmp(new_capacity, alloc);
609  m_candidates.swap(tmp);
610  m_capacity = new_capacity;
611  }
612  for (int s = 0; s < new_capacity; ++s) {
613  m_candidates[s].reset(max_cands_per_seed, expected_num_hots);
614  }
615  for (int s = new_capacity; s < m_capacity; ++s) {
616  m_candidates[s].reset(0, 0);
617  }
618 
619  m_size = new_capacity;
620  m_n_seeds_inserted = 0;
621  }
622 
623  void resizeAfterFiltering(int n_removed) {
624  assert(n_removed <= m_size);
625  m_size -= n_removed;
626  m_n_seeds_inserted -= n_removed;
627  }
628 
629  void insertSeed(const Track& seed, int seed_idx, const track_score_func& score_func, int region, int pos) {
630  assert(pos < m_size);
631 
632  m_candidates[pos].importSeed(seed, seed_idx, score_func, region);
633 
635  }
636 
637  void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits) {
638  for (int i = 0; i < m_size; ++i)
639  m_candidates[i].compactifyHitStorageForBestCand(remove_seed_hits, backward_fit_min_hits);
640  }
641 
642  void beginBkwSearch() {
643  for (int i = 0; i < m_size; ++i)
646  }
647  void endBkwSearch() {
648  // There is no CombCand::endBkwSearch(), setup correctly in CombCand::reset().
649  m_cands_in_backward_rep = false;
650  }
651 
652  // Accessors
653  int size() const { return m_size; }
654 
655  const CombCandidate& operator[](int i) const { return m_candidates[i]; }
657  CombCandidate& cand(int i) { return m_candidates[i]; }
658 
660 
661  // Direct access for vectorized functions in MkBuilder / MkFinder
662  const std::vector<CombCandidate>& refCandidates() const { return m_candidates; }
663  std::vector<CombCandidate>& refCandidates_nc() { return m_candidates; }
664 
665  private:
667 
668  std::vector<CombCandidate> m_candidates;
669 
670  int m_capacity = 0;
671  int m_size = 0;
674  };
675 
676 } // namespace mkfit
677 
678 #endif
int nInsideMinusOneHits() const
void setOriginIndex(int oi)
float getScoreCand(const track_score_func &score_func, const Track &cand1, bool penalizeTailMissHits=false, bool inFindCandidates=false)
Definition: Track.h:601
void addHitIdx(int hitIdx, int hitLyr, float chi2)
T * allocate(std::size_t n)
void reset(std::size_t size)
void deallocate(T *p, std::size_t n) noexcept
void mergeCandsAndBestShortOne(const IterationParams &params, const track_score_func &score_func, bool update_score, bool sort_cands)
int nOverlapHits() const
std::vector< CombCandidate > m_candidates
HitMatchPair m_overlap_hits
HitOnTrack getLastHitOnTrack() const
std::vector< TrackCand, CcAlloc< TrackCand > > trk_cand_vec_type
void reset(int max_cands_per_seed, int expected_num_hots)
bool operator==(const CcAlloc< T > &a, const CcAlloc< U > &b)
Track exportTrack(bool remove_missing_hits=false) const
void setNOverlapHits(int n)
int nMissingHits() const
int nHitsByTypeEncoded(const TrackerInfo &trk_inf) const
void resizeAfterFiltering(int n_removed)
void consider_hit_for_overlap(int hit_idx, int module_id, float chi2)
CombCandidate * m_comb_candidate
const HoTNode & hot_node(int i) const
CombCandidate & operator=(CombCandidate &&o)
void insertSeed(const Track &seed, int seed_idx, const track_score_func &score_func, int region, int pos)
TrackCand(const TrackBase &base, CombCandidate *ccand)
HitMatch * findOverlap(int hit_idx, int module_id)
short int m_nInsideMinusOneHits_before_bkwsearch
float pT() const
Definition: Track.h:157
auto module_id(edm::ModuleCallingContext const &mcc)
ret
prodAgent to be discontinued
const CombCandidate & operator[](int i) const
void resize(trk_cand_vec_type::size_type count)
std::size_t m_pos
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
int nTailMinusOneHits() const
float chi2_
Definition: Track.h:341
int nMatchedDecoded(const int &encoded) const
float chi2() const
Definition: Track.h:172
void setLastCcIndex(int i)
void setNInsideMinusOneHits(int n)
void setState(SeedState_e ss)
TrackCand()=default
HitMatch * find_overlap(int hit_idx, int module_id)
void setNFoundHits(int n)
short int nOverlapHits_
CombCandidate(const CombCandidate &o)
short int m_nTailMinusOneHits_before_bkwsearch
trk_cand_vec_type::reference emplace_back(TrackCand &tc)
short int nTailMinusOneHits_
int nTotMatchDecoded(const int &encoded) const
CombCandidate(const allocator_type &alloc)
TrackCand & operator[](int i)
assert(be >=bs)
CcPool< TrackCand > m_cc_pool
uint16_t size_type
const TrackCand & operator[](int i) const
void setNTailMinusOneHits(int n)
std::function< track_score_cf > track_score_func
Definition: FunctionTypes.h:40
HoTNode & refLastHoTNode()
void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits)
const TrackCand & front() const
short int nFoundHits_
Definition: Track.h:344
const HoTNode * hotsData() const
std::vector< T > m_mem
void setScore(float s)
Definition: Track.h:178
int nLayersByTypeEncoded(const TrackerInfo &trk_inf) const
void setNMissingHits(int n)
CcPool< T > * m_pool
float score() const
Definition: Track.h:173
void reset(int new_capacity, int max_cands_per_seed, int expected_num_hots=128)
CombCandidate & cand(int i)
CombCandidate & operator[](int i)
void considerHitForOverlap(int hit_idx, int module_id, float chi2)
CombCandidate * combCandidate() const
float getScoreWorstPossible()
Definition: Track.h:597
int getLastFoundHitLyr() const
uint32_t nh
int nUniqueLayers() const
void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits)
int lastCcIndex() const
trk_cand_vec_type::size_type size() const
int nTotalHits() const
short int lastHitIdx_
Definition: Track.h:343
void repackCandPostBkwSearch(int i)
short int m_origin_index
const std::vector< CombCandidate > & refCandidates() const
HoTNode & hot_node_nc(int i)
bool sortByScoreTrackCand(const TrackCand &cand1, const TrackCand &cand2)
int nStereoDecoded(const int &encoded) const
std::vector< CombCandidate > & refCandidates_nc()
short int m_lastHitIdx_before_bkwsearch
void setCombCandidate(CombCandidate *cc)
void deallocate(T *p, std::size_t n) noexcept
static constexpr int kHitCCCFilterIdx
Definition: Hit.h:198
const void * pool_id() const
trk_cand_vec_type m_trk_cands
double b
Definition: hdecay.h:120
float score_
Definition: Track.h:342
int getLastHitIdx() const
int seed_origin_index() const
double a
Definition: hdecay.h:121
int addHit(const HitOnTrack &hot, float chi2, int prev_idx)
int getLastHitLyr() const
HitOnTrack hot(int i) const
short int nMissingHits_
CcAlloc(CcPool< T > *p)
const TrackCand & refBestShortCand() const
void importSeed(const Track &seed, int seed_idx, const track_score_func &score_func, int region)
CombCandidate(CombCandidate &&o)
T * allocate(std::size_t n)
static constexpr int kHitMissIdx
Definition: Hit.h:193
int originIndex() const
short int nInsideMinusOneHits_
CcPool(std::size_t size=0)
int nFoundHits() const
tmp
align.sh
Definition: createJobs.py:716
int getLastFoundPixelHitLyr() const
long double T
HitOnTrack m_hot
SeedState_e state() const
int nPixelDecoded(const int &encoded) const
void setBestShortCand(const TrackCand &tc)
std::size_t m_size
def move(src, dest)
Definition: eostools.py:511
int nMonoDecoded(const int &encoded) const
std::vector< HoTNode > m_hots