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) {
200  m_overlap_hits.consider_hit_for_overlap(hit_idx, module_id, 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 
228  HoTNode& refLastHoTNode(); // for filling up overlap info
229  const HoTNode& refLastHoTNode() const; // for dump traversal
230 
232 
233  Track exportTrack(bool remove_missing_hits = false) const;
234 
237  m_comb_candidate = nullptr;
238  }
239 
240  private:
243 
244  // using TrackBase::lastHitIdx_ to point into hit-on-track-node vector of CombCandidate
245  short int nMissingHits_ = 0;
246  short int nOverlapHits_ = 0;
247 
248  short int nInsideMinusOneHits_ = 0;
249  short int nTailMinusOneHits_ = 0;
250 
251  short int m_origin_index = -1; // index of origin candidate (used for overlaps in Standard)
252  };
253 
254  inline bool sortByScoreTrackCand(const TrackCand& cand1, const TrackCand& cand2) {
255  return cand1.score() > cand2.score();
256  }
257 
258  inline float getScoreCand(const track_score_func& score_func,
259  const TrackCand& cand1,
260  bool penalizeTailMissHits = false,
261  bool inFindCandidates = false) {
262  int nfoundhits = cand1.nFoundHits();
263  int noverlaphits = cand1.nOverlapHits();
264  int nmisshits = cand1.nInsideMinusOneHits();
265  int ntailmisshits = penalizeTailMissHits ? cand1.nTailMinusOneHits() : 0;
266  float pt = cand1.pT();
267  float chi2 = cand1.chi2();
268  // Do not allow for chi2<0 in score calculation
269  if (chi2 < 0)
270  chi2 = 0.f;
271  return score_func(nfoundhits, ntailmisshits, noverlaphits, nmisshits, chi2, pt, inFindCandidates);
272  }
273 
274  // CombCandidate -- a set of candidates from a given seed.
275 
277  public:
278  using trk_cand_vec_type = std::vector<TrackCand, CcAlloc<TrackCand>>;
280 
282 
284 
285  // Required by std::uninitialized_fill_n when declaring vector<CombCandidate> in EventOfCombCandidates
288  m_state(o.m_state),
293 #ifdef DUMPHITWINDOW
294  m_seed_algo(o.m_seed_algo),
295  m_seed_label(o.m_seed_label),
296 #endif
298  m_hots(o.m_hots) {
299  }
300 
301  // Required for std::swap().
305  m_state(o.m_state),
310 #ifdef DUMPHITWINDOW
311  m_seed_algo(o.m_seed_algo),
312  m_seed_label(o.m_seed_label),
313 #endif
315  m_hots(std::move(o.m_hots)) {
316  // This is not needed as we do EOCC::reset() after EOCCS::resize which
317  // calls Reset here and all CombCands get cleared.
318  // However, if at some point we start using this for other purposes this needs
319  // to be called as well.
320  // for (auto &tc : *this) tc.setCombCandidate(this);
321  }
322 
323  // Required for std::swap when filtering EventOfCombinedCandidates::m_candidates.
324  // We do not call clear() on vectors as this will be done via EoCCs reset.
325  // Probably would be better (clearer) if there was a special function that does
326  // the swap in here or in EoCCs.
328  m_trk_cands = (std::move(o.m_trk_cands));
329  m_best_short_cand = std::move(o.m_best_short_cand);
330  m_state = o.m_state;
331  m_pickup_layer = o.m_pickup_layer;
332  m_lastHitIdx_before_bkwsearch = o.m_lastHitIdx_before_bkwsearch;
333  m_nInsideMinusOneHits_before_bkwsearch = o.m_nInsideMinusOneHits_before_bkwsearch;
334  m_nTailMinusOneHits_before_bkwsearch = o.m_nTailMinusOneHits_before_bkwsearch;
335 #ifdef DUMPHITWINDOW
336  m_seed_algo = o.m_seed_algo;
337  m_seed_label = o.m_seed_label;
338 #endif
339  m_hots_size = o.m_hots_size;
340  m_hots = std::move(o.m_hots);
341 
342  for (auto& tc : m_trk_cands)
343  tc.setCombCandidate(this);
344 
345  return *this;
346  }
347 
348  // std::vector-like interface to access m_trk_cands
349  bool empty() const { return m_trk_cands.empty(); }
350  trk_cand_vec_type::size_type size() const { return m_trk_cands.size(); }
352  TrackCand& operator[](int i) { return m_trk_cands[i]; }
353  const TrackCand& operator[](int i) const { return m_trk_cands[i]; }
354  TrackCand& front() { return m_trk_cands.front(); }
355  const TrackCand& front() const { return m_trk_cands.front(); }
357  void clear() { m_trk_cands.clear(); }
358 
359  void reset(int max_cands_per_seed, int expected_num_hots) {
360  std::vector<TrackCand, CcAlloc<TrackCand>> tmp(m_trk_cands.get_allocator());
361  m_trk_cands.swap(tmp);
362  m_trk_cands.reserve(max_cands_per_seed); // we *must* never exceed this
363 
365 
366  // state and pickup_layer set in importSeed.
367 
368  // expected_num_hots is different for CloneEngine and Std, especially as long as we
369  // instantiate all candidates before purging them.
370  // ce: N_layer * N_cands ~~ 20 * 6 = 120
371  // std: i don't know, maybe double?
372  m_hots.reserve(expected_num_hots);
373  m_hots_size = 0;
374  m_hots.clear();
375 
379  }
380 
381  void importSeed(const Track& seed, const track_score_func& score_func, int region);
382 
383  int addHit(const HitOnTrack& hot, float chi2, int prev_idx) {
384  m_hots.push_back({hot, chi2, prev_idx});
385  return m_hots_size++;
386  }
387 
389  const track_score_func& score_func,
390  bool update_score,
391  bool sort_cands);
392 
393  void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits);
394  void beginBkwSearch();
395  void repackCandPostBkwSearch(int i);
396  // not needed for CombCand::endBkwSearch(), reinit performed in reset() for a new event.
397 
398  // Accessors
399  //-----------
400  int hotsSize() const { return m_hots_size; }
401  const HoTNode& hot_node(int i) const { return m_hots[i]; }
402  HoTNode& hot_node_nc(int i) { return m_hots[i]; }
403  HitOnTrack hot(int i) const { return m_hots[i].m_hot; }
404  // Direct access into array for vectorized code in MkFinder
405  const HoTNode* hotsData() const { return m_hots.data(); }
406 
407  const TrackCand& refBestShortCand() const { return m_best_short_cand; }
408  void setBestShortCand(const TrackCand& tc) { m_best_short_cand = tc; }
409 
410  SeedState_e state() const { return m_state; }
412 
413  int pickupLayer() const { return m_pickup_layer; }
414 
415 #ifdef DUMPHITWINDOW
416  int seed_algo() const { return m_seed_algo; }
417  int seed_label() const { return m_seed_label; }
418 #endif
419 
420  private:
424  int m_pickup_layer : 16;
428 
429 #ifdef DUMPHITWINDOW
430  int m_seed_algo = 0;
431  int m_seed_label = 0;
432 #endif
433  int m_hots_size = 0;
434  std::vector<HoTNode> m_hots;
435  };
436 
437  //==============================================================================
438 
440 
442 
444 
445  inline int TrackCand::getLastFoundHitLyr() const {
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  if (hot_node.m_hot.index < 0) {
452  ch = hot_node.m_prev_idx;
453  } else {
454  ll = hot_node.m_hot.layer;
455  break;
456  }
457  }
458  return ll;
459  }
460 
462  int nh = nTotalHits();
463  int ch = lastHitIdx_;
464  int ll = -1;
465  while (--nh >= 0) {
466  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
467  int tl = hot_node.m_hot.layer;
468  if (hot_node.m_hot.index < 0 || !((0 <= tl && tl <= 3) || (18 <= tl && tl <= 20) || (45 <= tl && tl <= 47))) {
469  ch = hot_node.m_prev_idx;
470  } else if ((0 <= tl && tl <= 3) || (18 <= tl && tl <= 20) || (45 <= tl && tl <= 47)) {
471  ll = hot_node.m_hot.layer;
472  break;
473  }
474  }
475  return ll;
476  }
477 
478  inline int TrackCand::nUniqueLayers() const {
479  int nUL = 0;
480  int prevL = -1;
481  int nh = nTotalHits();
482  int ch = lastHitIdx_;
483 
484  while (--nh >= 0) {
485  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
486  int thisL = hot_node.m_hot.layer;
487  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx) &&
488  thisL != prevL) {
489  ++nUL;
490  prevL = thisL;
491  }
492  ch = hot_node.m_prev_idx;
493  }
494  return nUL;
495  }
496 
497  inline int TrackCand::nHitsByTypeEncoded(const TrackerInfo& trk_inf) const {
498  int prevL = -1;
499  bool prevStereo = false;
500  int nh = nTotalHits();
501  int ch = lastHitIdx_;
502  int pix = 0, stereo = 0, mono = 0, matched = 0;
503  int doubleStereo = -1;
504  while (--nh >= 0) {
505  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
506  int thisL = hot_node.m_hot.layer;
507  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx)) {
508  bool cStereo = trk_inf[thisL].is_stereo();
509  if (trk_inf[thisL].is_pixel())
510  ++pix;
511  else if (cStereo) {
512  ++stereo;
513  if (thisL == prevL)
514  doubleStereo = thisL;
515  } else {
516  //mono if not pixel, nor stereo - can be matched to stereo
517  ++mono;
518  if (prevStereo && thisL == prevL - 1)
519  ++matched;
520  else if (thisL == prevL && thisL == doubleStereo - 1)
521  ++matched; //doubleMatch, the first is counted early on
522  }
523  prevL = thisL;
524  prevStereo = cStereo;
525  }
526  ch = hot_node.m_prev_idx;
527  }
528  return pix + 100 * stereo + 10000 * mono + 1000000 * matched;
529  }
530 
531  inline int TrackCand::nLayersByTypeEncoded(const TrackerInfo& trk_inf) const {
532  int prevL = -1;
533  bool prevStereo = false;
534  int nh = nTotalHits();
535  int ch = lastHitIdx_;
536  int pix = 0, stereo = 0, mono = 0, matched = 0;
537  while (--nh >= 0) {
538  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
539  int thisL = hot_node.m_hot.layer;
540  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx) &&
541  thisL != prevL) {
542  bool cStereo = trk_inf[thisL].is_stereo();
543  if (trk_inf[thisL].is_pixel())
544  ++pix;
545  else if (cStereo)
546  ++stereo;
547  else {
548  //mono if not pixel, nor stereo - can be matched to stereo
549  ++mono;
550  if (prevStereo && thisL == prevL - 1)
551  ++matched;
552  }
553  prevL = thisL;
554  prevStereo = cStereo;
555  }
556  ch = hot_node.m_prev_idx;
557  }
558  return pix + 100 * stereo + 10000 * mono + 1000000 * matched;
559  }
560 
562 
564 
565  //------------------------------------------------------------------------------
566 
567  inline void TrackCand::addHitIdx(int hitIdx, int hitLyr, float chi2) {
568  lastHitIdx_ = m_comb_candidate->addHit({hitIdx, hitLyr}, chi2, lastHitIdx_);
569 
570  if (hitIdx >= 0 || hitIdx == Hit::kHitCCCFilterIdx) {
571  ++nFoundHits_;
572  chi2_ += chi2;
574  nTailMinusOneHits_ = 0;
575  }
576  //Note that for tracks passing through an inactive module (hitIdx = -7), we do not count the -7 hit against the track when scoring.
577  else {
578  ++nMissingHits_;
579  if (hitIdx == Hit::kHitMissIdx)
581  }
582  }
583 
584  //==============================================================================
585 
587  public:
589 
590  void releaseMemory() {
591  { // Get all the destructors called before nuking CcPool.
592  std::vector<CombCandidate> tmp;
593  m_candidates.swap(tmp);
594  }
595  m_capacity = 0;
596  m_size = 0;
597  m_n_seeds_inserted = 0;
598  m_cc_pool.release();
599  }
600 
601  void reset(int new_capacity, int max_cands_per_seed, int expected_num_hots = 128) {
602  m_cc_pool.reset(new_capacity * max_cands_per_seed);
603  if (new_capacity > m_capacity) {
605  std::vector<CombCandidate> tmp(new_capacity, alloc);
606  m_candidates.swap(tmp);
607  m_capacity = new_capacity;
608  }
609  for (int s = 0; s < new_capacity; ++s) {
610  m_candidates[s].reset(max_cands_per_seed, expected_num_hots);
611  }
612  for (int s = new_capacity; s < m_capacity; ++s) {
613  m_candidates[s].reset(0, 0);
614  }
615 
616  m_size = new_capacity;
617  m_n_seeds_inserted = 0;
618  }
619 
620  void resizeAfterFiltering(int n_removed) {
621  assert(n_removed <= m_size);
622  m_size -= n_removed;
623  m_n_seeds_inserted -= n_removed;
624  }
625 
626  void insertSeed(const Track& seed, const track_score_func& score_func, int region, int pos) {
627  assert(pos < m_size);
628 
629  m_candidates[pos].importSeed(seed, score_func, region);
630 
632  }
633 
634  void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits) {
635  for (int i = 0; i < m_size; ++i)
636  m_candidates[i].compactifyHitStorageForBestCand(remove_seed_hits, backward_fit_min_hits);
637  }
638 
639  void beginBkwSearch() {
640  for (int i = 0; i < m_size; ++i)
643  }
644  void endBkwSearch() {
645  // There is no CombCand::endBkwSearch(), setup correctly in CombCand::reset().
646  m_cands_in_backward_rep = false;
647  }
648 
649  // Accessors
650  int size() const { return m_size; }
651 
652  const CombCandidate& operator[](int i) const { return m_candidates[i]; }
654  CombCandidate& cand(int i) { return m_candidates[i]; }
655 
657 
658  // Direct access for vectorized functions in MkBuilder / MkFinder
659  const std::vector<CombCandidate>& refCandidates() const { return m_candidates; }
660  std::vector<CombCandidate>& refCandidates_nc() { return m_candidates; }
661 
662  private:
664 
665  std::vector<CombCandidate> m_candidates;
666 
667  int m_capacity = 0;
668  int m_size = 0;
671  };
672 
673 } // namespace mkfit
674 
675 #endif
size
Write out results.
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:608
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)
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:171
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:346
int nMatchedDecoded(const int &encoded) const
base
Main Program
Definition: newFWLiteAna.py:92
float chi2() const
Definition: Track.h:186
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)
void insertSeed(const Track &seed, const track_score_func &score_func, int region, int pos)
const TrackCand & front() const
short int nFoundHits_
Definition: Track.h:349
const HoTNode * hotsData() const
std::vector< T > m_mem
void setScore(float s)
Definition: Track.h:192
int nLayersByTypeEncoded(const TrackerInfo &trk_inf) const
void setNMissingHits(int n)
CcPool< T > * m_pool
float score() const
Definition: Track.h:187
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:604
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:348
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:118
float score_
Definition: Track.h:347
int getLastHitIdx() const
double a
Definition: hdecay.h:119
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
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
void importSeed(const Track &seed, const track_score_func &score_func, int region)