CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
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),
295  m_hots(o.m_hots) {}
296 
297  // Required for std::swap().
301  m_state(o.m_state),
308  m_hots(std::move(o.m_hots)) {
309  // This is not needed as we do EOCC::reset() after EOCCS::resize which
310  // calls Reset here and all CombCands get cleared.
311  // However, if at some point we start using this for other purposes this needs
312  // to be called as well.
313  // for (auto &tc : *this) tc.setCombCandidate(this);
314  }
315 
316  // Required for std::swap when filtering EventOfCombinedCandidates::m_candidates.
317  // We do not call clear() on vectors as this will be done via EoCCs reset.
318  // Probably would be better (clearer) if there was a special function that does
319  // the swap in here or in EoCCs.
321  m_trk_cands = (std::move(o.m_trk_cands));
322  m_best_short_cand = std::move(o.m_best_short_cand);
323  m_state = o.m_state;
324  m_pickup_layer = o.m_pickup_layer;
325  m_lastHitIdx_before_bkwsearch = o.m_lastHitIdx_before_bkwsearch;
326  m_nInsideMinusOneHits_before_bkwsearch = o.m_nInsideMinusOneHits_before_bkwsearch;
327  m_nTailMinusOneHits_before_bkwsearch = o.m_nTailMinusOneHits_before_bkwsearch;
328  m_seed_origin_index = o.m_seed_origin_index;
329  m_hots_size = o.m_hots_size;
330  m_hots = std::move(o.m_hots);
331 
332  for (auto& tc : m_trk_cands)
333  tc.setCombCandidate(this);
334 
335  return *this;
336  }
337 
338  // std::vector-like interface to access m_trk_cands
339  bool empty() const { return m_trk_cands.empty(); }
340  trk_cand_vec_type::size_type size() const { return m_trk_cands.size(); }
342  TrackCand& operator[](int i) { return m_trk_cands[i]; }
343  const TrackCand& operator[](int i) const { return m_trk_cands[i]; }
344  TrackCand& front() { return m_trk_cands.front(); }
345  const TrackCand& front() const { return m_trk_cands.front(); }
347  void clear() { m_trk_cands.clear(); }
348 
349  void reset(int max_cands_per_seed, int expected_num_hots) {
350  std::vector<TrackCand, CcAlloc<TrackCand>> tmp(m_trk_cands.get_allocator());
351  m_trk_cands.swap(tmp);
352  m_trk_cands.reserve(max_cands_per_seed); // we *must* never exceed this
353 
355 
356  // state and pickup_layer set in importSeed.
357 
358  // expected_num_hots is different for CloneEngine and Std, especially as long as we
359  // instantiate all candidates before purging them.
360  // ce: N_layer * N_cands ~~ 20 * 6 = 120
361  // std: i don't know, maybe double?
362  m_hots.reserve(expected_num_hots);
363  m_hots_size = 0;
364  m_hots.clear();
365 
369  }
370 
371  void importSeed(const Track& seed, int seed_idx, const track_score_func& score_func, int region);
372 
373  int addHit(const HitOnTrack& hot, float chi2, int prev_idx) {
374  m_hots.push_back({hot, chi2, prev_idx});
375  return m_hots_size++;
376  }
377 
379  const track_score_func& score_func,
380  bool update_score,
381  bool sort_cands);
382 
383  void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits);
384  void beginBkwSearch();
385  void repackCandPostBkwSearch(int i);
386  // not needed for CombCand::endBkwSearch(), reinit performed in reset() for a new event.
387 
388  // Accessors
389  //-----------
390  int hotsSize() const { return m_hots_size; }
391  const HoTNode& hot_node(int i) const { return m_hots[i]; }
392  HoTNode& hot_node_nc(int i) { return m_hots[i]; }
393  HitOnTrack hot(int i) const { return m_hots[i].m_hot; }
394  // Direct access into array for vectorized code in MkFinder
395  const HoTNode* hotsData() const { return m_hots.data(); }
396 
397  const TrackCand& refBestShortCand() const { return m_best_short_cand; }
398  void setBestShortCand(const TrackCand& tc) { m_best_short_cand = tc; }
399 
400  SeedState_e state() const { return m_state; }
402 
403  int pickupLayer() const { return m_pickup_layer; }
404 
405  int seed_origin_index() const { return m_seed_origin_index; }
406 
407  private:
411  int m_pickup_layer : 16;
415  int m_seed_origin_index = -1; // seed index in the passed-in seed vector
416  int m_hots_size = 0;
417  std::vector<HoTNode> m_hots;
418  };
419 
420  //==============================================================================
421 
423 
425 
427 
428  inline int TrackCand::getLastFoundHitLyr() const {
429  int nh = nTotalHits();
430  int ch = lastHitIdx_;
431  int ll = -1;
432  while (--nh >= 0) {
433  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
434  if (hot_node.m_hot.index < 0) {
435  ch = hot_node.m_prev_idx;
436  } else {
437  ll = hot_node.m_hot.layer;
438  break;
439  }
440  }
441  return ll;
442  }
443 
445  int nh = nTotalHits();
446  int ch = lastHitIdx_;
447  int ll = -1;
448  while (--nh >= 0) {
449  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
450  int tl = hot_node.m_hot.layer;
451  if (hot_node.m_hot.index < 0 || !((0 <= tl && tl <= 3) || (18 <= tl && tl <= 20) || (45 <= tl && tl <= 47))) {
452  ch = hot_node.m_prev_idx;
453  } else if ((0 <= tl && tl <= 3) || (18 <= tl && tl <= 20) || (45 <= tl && tl <= 47)) {
454  ll = hot_node.m_hot.layer;
455  break;
456  }
457  }
458  return ll;
459  }
460 
461  inline int TrackCand::nUniqueLayers() const {
462  int nUL = 0;
463  int prevL = -1;
464  int nh = nTotalHits();
465  int ch = lastHitIdx_;
466 
467  while (--nh >= 0) {
468  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
469  int thisL = hot_node.m_hot.layer;
470  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx) &&
471  thisL != prevL) {
472  ++nUL;
473  prevL = thisL;
474  }
475  ch = hot_node.m_prev_idx;
476  }
477  return nUL;
478  }
479 
480  inline int TrackCand::nHitsByTypeEncoded(const TrackerInfo& trk_inf) const {
481  int prevL = -1;
482  bool prevStereo = false;
483  int nh = nTotalHits();
484  int ch = lastHitIdx_;
485  int pix = 0, stereo = 0, mono = 0, matched = 0;
486  int doubleStereo = -1;
487  while (--nh >= 0) {
488  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
489  int thisL = hot_node.m_hot.layer;
490  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx)) {
491  bool cStereo = trk_inf[thisL].is_stereo();
492  if (trk_inf[thisL].is_pixel())
493  ++pix;
494  else if (cStereo) {
495  ++stereo;
496  if (thisL == prevL)
497  doubleStereo = thisL;
498  } else {
499  //mono if not pixel, nor stereo - can be matched to stereo
500  ++mono;
501  if (prevStereo && thisL == prevL - 1)
502  ++matched;
503  else if (thisL == prevL && thisL == doubleStereo - 1)
504  ++matched; //doubleMatch, the first is counted early on
505  }
506  prevL = thisL;
507  prevStereo = cStereo;
508  }
509  ch = hot_node.m_prev_idx;
510  }
511  return pix + 100 * stereo + 10000 * mono + 1000000 * matched;
512  }
513 
514  inline int TrackCand::nLayersByTypeEncoded(const TrackerInfo& trk_inf) const {
515  int prevL = -1;
516  bool prevStereo = false;
517  int nh = nTotalHits();
518  int ch = lastHitIdx_;
519  int pix = 0, stereo = 0, mono = 0, matched = 0;
520  while (--nh >= 0) {
521  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
522  int thisL = hot_node.m_hot.layer;
523  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx) &&
524  thisL != prevL) {
525  bool cStereo = trk_inf[thisL].is_stereo();
526  if (trk_inf[thisL].is_pixel())
527  ++pix;
528  else if (cStereo)
529  ++stereo;
530  else {
531  //mono if not pixel, nor stereo - can be matched to stereo
532  ++mono;
533  if (prevStereo && thisL == prevL - 1)
534  ++matched;
535  }
536  prevL = thisL;
537  prevStereo = cStereo;
538  }
539  ch = hot_node.m_prev_idx;
540  }
541  return pix + 100 * stereo + 10000 * mono + 1000000 * matched;
542  }
543 
545 
547 
548  //------------------------------------------------------------------------------
549 
550  inline void TrackCand::addHitIdx(int hitIdx, int hitLyr, float chi2) {
551  lastHitIdx_ = m_comb_candidate->addHit({hitIdx, hitLyr}, chi2, lastHitIdx_);
552 
553  if (hitIdx >= 0 || hitIdx == Hit::kHitCCCFilterIdx) {
554  ++nFoundHits_;
555  chi2_ += chi2;
557  nTailMinusOneHits_ = 0;
558  }
559  //Note that for tracks passing through an inactive module (hitIdx = -7), we do not count the -7 hit against the track when scoring.
560  else {
561  ++nMissingHits_;
562  if (hitIdx == Hit::kHitMissIdx)
564  }
565  }
566 
567  //==============================================================================
568 
570  public:
572 
573  void releaseMemory() {
574  { // Get all the destructors called before nuking CcPool.
575  std::vector<CombCandidate> tmp;
576  m_candidates.swap(tmp);
577  }
578  m_capacity = 0;
579  m_size = 0;
580  m_n_seeds_inserted = 0;
581  m_cc_pool.release();
582  }
583 
584  void reset(int new_capacity, int max_cands_per_seed, int expected_num_hots = 128) {
585  m_cc_pool.reset(new_capacity * max_cands_per_seed);
586  if (new_capacity > m_capacity) {
588  std::vector<CombCandidate> tmp(new_capacity, alloc);
589  m_candidates.swap(tmp);
590  m_capacity = new_capacity;
591  }
592  for (int s = 0; s < new_capacity; ++s) {
593  m_candidates[s].reset(max_cands_per_seed, expected_num_hots);
594  }
595  for (int s = new_capacity; s < m_capacity; ++s) {
596  m_candidates[s].reset(0, 0);
597  }
598 
599  m_size = new_capacity;
600  m_n_seeds_inserted = 0;
601  }
602 
603  void resizeAfterFiltering(int n_removed) {
604  assert(n_removed <= m_size);
605  m_size -= n_removed;
606  m_n_seeds_inserted -= n_removed;
607  }
608 
609  void insertSeed(const Track& seed, int seed_idx, const track_score_func& score_func, int region, int pos) {
610  assert(pos < m_size);
611 
612  m_candidates[pos].importSeed(seed, seed_idx, score_func, region);
613 
615  }
616 
617  void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits) {
618  for (int i = 0; i < m_size; ++i)
619  m_candidates[i].compactifyHitStorageForBestCand(remove_seed_hits, backward_fit_min_hits);
620  }
621 
622  void beginBkwSearch() {
623  for (int i = 0; i < m_size; ++i)
626  }
627  void endBkwSearch() {
628  // There is no CombCand::endBkwSearch(), setup correctly in CombCand::reset().
629  m_cands_in_backward_rep = false;
630  }
631 
632  // Accessors
633  int size() const { return m_size; }
634 
635  const CombCandidate& operator[](int i) const { return m_candidates[i]; }
637  CombCandidate& cand(int i) { return m_candidates[i]; }
638 
640 
641  // Direct access for vectorized functions in MkBuilder / MkFinder
642  const std::vector<CombCandidate>& refCandidates() const { return m_candidates; }
643  std::vector<CombCandidate>& refCandidates_nc() { return m_candidates; }
644 
645  private:
647 
648  std::vector<CombCandidate> m_candidates;
649 
650  int m_capacity = 0;
651  int m_size = 0;
654  };
655 
656 } // namespace mkfit
657 
658 #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:617
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:171
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:355
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)
const TrackCand & front() const
short int nFoundHits_
Definition: Track.h:358
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:613
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:357
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:356
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