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 TrackCand& cand1, bool penalizeTailMissHits = false, bool inFindCandidates = false) {
259  int nfoundhits = cand1.nFoundHits();
260  int noverlaphits = cand1.nOverlapHits();
261  int nmisshits = cand1.nInsideMinusOneHits();
262  int ntailmisshits = penalizeTailMissHits ? cand1.nTailMinusOneHits() : 0;
263  float pt = cand1.pT();
264  float chi2 = cand1.chi2();
265  // Do not allow for chi2<0 in score calculation
266  if (chi2 < 0)
267  chi2 = 0.f;
268  return getScoreCalc(nfoundhits, ntailmisshits, noverlaphits, nmisshits, chi2, pt, inFindCandidates);
269  }
270 
271  // CombCandidate -- a set of candidates from a given seed.
272 
274  public:
275  using trk_cand_vec_type = std::vector<TrackCand, CcAlloc<TrackCand>>;
277 
279 
281 
282  // Required by std::uninitialized_fill_n when declaring vector<CombCandidate> in EventOfCombCandidates
285  m_state(o.m_state),
290 #ifdef DUMPHITWINDOW
291  m_seed_algo(o.m_seed_algo),
292  m_seed_label(o.m_seed_label),
293 #endif
295  m_hots(o.m_hots) {
296  }
297 
298  // Required for std::swap().
302  m_state(o.m_state),
307 #ifdef DUMPHITWINDOW
308  m_seed_algo(o.m_seed_algo),
309  m_seed_label(o.m_seed_label),
310 #endif
312  m_hots(std::move(o.m_hots)) {
313  // This is not needed as we do EOCC::reset() after EOCCS::resize which
314  // calls Reset here and all CombCands get cleared.
315  // However, if at some point we start using this for other purposes this needs
316  // to be called as well.
317  // for (auto &tc : *this) tc.setCombCandidate(this);
318  }
319 
320  // Required for std::swap when filtering EventOfCombinedCandidates::m_candidates.
321  // We do not call clear() on vectors as this will be done via EoCCs reset.
322  // Probably would be better (clearer) if there was a special function that does
323  // the swap in here or in EoCCs.
325  m_trk_cands = (std::move(o.m_trk_cands));
326  m_best_short_cand = std::move(o.m_best_short_cand);
327  m_state = o.m_state;
328  m_pickup_layer = o.m_pickup_layer;
329  m_lastHitIdx_before_bkwsearch = o.m_lastHitIdx_before_bkwsearch;
330  m_nInsideMinusOneHits_before_bkwsearch = o.m_nInsideMinusOneHits_before_bkwsearch;
331  m_nTailMinusOneHits_before_bkwsearch = o.m_nTailMinusOneHits_before_bkwsearch;
332 #ifdef DUMPHITWINDOW
333  m_seed_algo = o.m_seed_algo;
334  m_seed_label = o.m_seed_label;
335 #endif
336  m_hots_size = o.m_hots_size;
337  m_hots = std::move(o.m_hots);
338 
339  for (auto& tc : m_trk_cands)
340  tc.setCombCandidate(this);
341 
342  return *this;
343  }
344 
345  // std::vector-like interface to access m_trk_cands
346  bool empty() const { return m_trk_cands.empty(); }
347  trk_cand_vec_type::size_type size() const { return m_trk_cands.size(); }
349  TrackCand& operator[](int i) { return m_trk_cands[i]; }
350  const TrackCand& operator[](int i) const { return m_trk_cands[i]; }
351  TrackCand& front() { return m_trk_cands.front(); }
352  const TrackCand& front() const { return m_trk_cands.front(); }
354  void clear() { m_trk_cands.clear(); }
355 
356  void reset(int max_cands_per_seed, int expected_num_hots) {
357  std::vector<TrackCand, CcAlloc<TrackCand>> tmp(m_trk_cands.get_allocator());
358  m_trk_cands.swap(tmp);
359  m_trk_cands.reserve(max_cands_per_seed); // we *must* never exceed this
360 
362 
363  // state and pickup_layer set in importSeed.
364 
365  // expected_num_hots is different for CloneEngine and Std, especially as long as we
366  // instantiate all candidates before purging them.
367  // ce: N_layer * N_cands ~~ 20 * 6 = 120
368  // std: i don't know, maybe double?
369  m_hots.reserve(expected_num_hots);
370  m_hots_size = 0;
371  m_hots.clear();
372  }
373 
374  void importSeed(const Track& seed, int region);
375 
376  int addHit(const HitOnTrack& hot, float chi2, int prev_idx) {
377  m_hots.push_back({hot, chi2, prev_idx});
378  return m_hots_size++;
379  }
380 
381  void mergeCandsAndBestShortOne(const IterationParams& params, bool update_score, bool sort_cands);
382 
383  void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits);
384  void beginBkwSearch();
385  void endBkwSearch();
386 
387  // Accessors
388  //-----------
389  int hotsSize() const { return m_hots_size; }
390  const HoTNode& hot_node(int i) const { return m_hots[i]; }
391  HoTNode& hot_node_nc(int i) { return m_hots[i]; }
392  HitOnTrack hot(int i) const { return m_hots[i].m_hot; }
393  // Direct access into array for vectorized code in MkFinder
394  const HoTNode* hotsData() const { return m_hots.data(); }
395 
396  const TrackCand& refBestShortCand() const { return m_best_short_cand; }
397  void setBestShortCand(const TrackCand& tc) { m_best_short_cand = tc; }
398 
399  SeedState_e state() const { return m_state; }
401 
402  int pickupLayer() const { return m_pickup_layer; }
403 
404 #ifdef DUMPHITWINDOW
405  int seed_algo() const { return m_seed_algo; }
406  int seed_label() const { return m_seed_label; }
407 #endif
408 
409  private:
413  int m_pickup_layer : 16;
417 
418 #ifdef DUMPHITWINDOW
419  int m_seed_algo = 0;
420  int m_seed_label = 0;
421 #endif
422  int m_hots_size = 0;
423  std::vector<HoTNode> m_hots;
424  };
425 
426  //==============================================================================
427 
429 
431 
433 
434  inline int TrackCand::getLastFoundHitLyr() const {
435  int nh = nTotalHits();
436  int ch = lastHitIdx_;
437  int ll = -1;
438  while (--nh >= 0) {
439  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
440  if (hot_node.m_hot.index < 0) {
441  ch = hot_node.m_prev_idx;
442  } else {
443  ll = hot_node.m_hot.layer;
444  break;
445  }
446  }
447  return ll;
448  }
449 
451  int nh = nTotalHits();
452  int ch = lastHitIdx_;
453  int ll = -1;
454  while (--nh >= 0) {
455  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
456  int tl = hot_node.m_hot.layer;
457  if (hot_node.m_hot.index < 0 || !((0 <= tl && tl <= 3) || (18 <= tl && tl <= 20) || (45 <= tl && tl <= 47))) {
458  ch = hot_node.m_prev_idx;
459  } else if ((0 <= tl && tl <= 3) || (18 <= tl && tl <= 20) || (45 <= tl && tl <= 47)) {
460  ll = hot_node.m_hot.layer;
461  break;
462  }
463  }
464  return ll;
465  }
466 
467  inline int TrackCand::nUniqueLayers() const {
468  int nUL = 0;
469  int prevL = -1;
470  int nh = nTotalHits();
471  int ch = lastHitIdx_;
472 
473  while (--nh >= 0) {
474  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
475  int thisL = hot_node.m_hot.layer;
476  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx) &&
477  thisL != prevL) {
478  ++nUL;
479  prevL = thisL;
480  }
481  ch = hot_node.m_prev_idx;
482  }
483  return nUL;
484  }
485 
486  inline int TrackCand::nHitsByTypeEncoded(const TrackerInfo& trk_inf) const {
487  int prevL = -1;
488  bool prevStereo = false;
489  int nh = nTotalHits();
490  int ch = lastHitIdx_;
491  int pix = 0, stereo = 0, mono = 0, matched = 0;
492  int doubleStereo = -1;
493  while (--nh >= 0) {
494  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
495  int thisL = hot_node.m_hot.layer;
496  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx)) {
497  if (trk_inf[thisL].is_pixel())
498  ++pix;
499  else if (trk_inf[thisL].is_stereo()) {
500  ++stereo;
501  if (thisL == prevL)
502  doubleStereo = thisL;
503  } else {
504  //mono if not pixel, nor stereo - can be matched to stereo
505  ++mono;
506  if (prevStereo && thisL == prevL - 1)
507  ++matched;
508  else if (thisL == prevL && thisL == doubleStereo - 1)
509  ++matched; //doubleMatch, the first is counted early on
510  }
511  prevL = thisL;
512  prevStereo = stereo;
513  }
514  ch = hot_node.m_prev_idx;
515  }
516  return pix + 100 * stereo + 10000 * mono + 1000000 * matched;
517  }
518 
519  inline int TrackCand::nLayersByTypeEncoded(const TrackerInfo& trk_inf) const {
520  int prevL = -1;
521  bool prevStereo = false;
522  int nh = nTotalHits();
523  int ch = lastHitIdx_;
524  int pix = 0, stereo = 0, mono = 0, matched = 0;
525  while (--nh >= 0) {
526  const HoTNode& hot_node = m_comb_candidate->hot_node(ch);
527  int thisL = hot_node.m_hot.layer;
528  if (thisL >= 0 && (hot_node.m_hot.index >= 0 || hot_node.m_hot.index == Hit::kHitCCCFilterIdx) &&
529  thisL != prevL) {
530  if (trk_inf[thisL].is_pixel())
531  ++pix;
532  else if (trk_inf[thisL].is_stereo())
533  ++stereo;
534  else {
535  //mono if not pixel, nor stereo - can be matched to stereo
536  ++mono;
537  if (prevStereo && thisL == prevL - 1)
538  ++matched;
539  }
540  prevL = thisL;
541  prevStereo = stereo;
542  }
543  ch = hot_node.m_prev_idx;
544  }
545  return pix + 100 * stereo + 10000 * mono + 1000000 * matched;
546  }
547 
549 
551 
552  //------------------------------------------------------------------------------
553 
554  inline void TrackCand::addHitIdx(int hitIdx, int hitLyr, float chi2) {
555  lastHitIdx_ = m_comb_candidate->addHit({hitIdx, hitLyr}, chi2, lastHitIdx_);
556 
557  if (hitIdx >= 0 || hitIdx == Hit::kHitCCCFilterIdx) {
558  ++nFoundHits_;
559  chi2_ += chi2;
561  nTailMinusOneHits_ = 0;
562  }
563  //Note that for tracks passing through an inactive module (hitIdx = -7), we do not count the -7 hit against the track when scoring.
564  else {
565  ++nMissingHits_;
566  if (hitIdx == Hit::kHitMissIdx)
568  }
569  }
570 
571  //==============================================================================
572 
574  public:
576 
577  void releaseMemory() {
578  { // Get all the destructors called before nuking CcPool.
579  std::vector<CombCandidate> tmp;
580  m_candidates.swap(tmp);
581  }
582  m_capacity = 0;
583  m_size = 0;
584  m_n_seeds_inserted = 0;
585  m_cc_pool.release();
586  }
587 
588  void reset(int new_capacity, int max_cands_per_seed, int expected_num_hots = 128) {
589  m_cc_pool.reset(new_capacity * max_cands_per_seed);
590  if (new_capacity > m_capacity) {
592  std::vector<CombCandidate> tmp(new_capacity, alloc);
593  m_candidates.swap(tmp);
594  m_capacity = new_capacity;
595  }
596  for (int s = 0; s < new_capacity; ++s) {
597  m_candidates[s].reset(max_cands_per_seed, expected_num_hots);
598  }
599  for (int s = new_capacity; s < m_capacity; ++s) {
600  m_candidates[s].reset(0, 0);
601  }
602 
603  m_size = new_capacity;
604  m_n_seeds_inserted = 0;
605  }
606 
607  void resizeAfterFiltering(int n_removed) {
608  assert(n_removed <= m_size);
609  m_size -= n_removed;
610  m_n_seeds_inserted -= n_removed;
611  }
612 
613  void insertSeed(const Track& seed, int region, int pos) {
614  assert(pos < m_size);
615 
616  m_candidates[pos].importSeed(seed, region);
617 
619  }
620 
621  void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits) {
622  for (int i = 0; i < m_size; ++i)
623  m_candidates[i].compactifyHitStorageForBestCand(remove_seed_hits, backward_fit_min_hits);
624  }
625 
626  void beginBkwSearch() {
627  for (int i = 0; i < m_size; ++i)
629  }
630  void endBkwSearch() {
631  for (int i = 0; i < m_size; ++i)
633  }
634 
635  // Accessors
636  int size() const { return m_size; }
637 
638  const CombCandidate& operator[](int i) const { return m_candidates[i]; }
640  CombCandidate& cand(int i) { return m_candidates[i]; }
641 
642  // Direct access for vectorized functions in MkBuilder / MkFinder
643  const std::vector<CombCandidate>& refCandidates() const { return m_candidates; }
644  std::vector<CombCandidate>& refCandidates_nc() { return m_candidates; }
645 
646  private:
648 
649  std::vector<CombCandidate> m_candidates;
650 
651  int m_capacity = 0;
652  int m_size = 0;
654  };
655 
656 } // namespace mkfit
657 
658 #endif
size
Write out results.
int nInsideMinusOneHits() const
void setOriginIndex(int oi)
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
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)
void mergeCandsAndBestShortOne(const IterationParams &params, bool update_score, bool sort_cands)
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:169
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
int nTailMinusOneHits() const
float chi2_
Definition: Track.h:344
int nMatchedDecoded(const int &encoded) const
base
Main Program
Definition: newFWLiteAna.py:92
float chi2() const
Definition: Track.h:184
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_
float getScoreCalc(const int nfoundhits, const int ntailholes, const int noverlaphits, const int nmisshits, const float chi2, const float pt, const bool inFindCandidates=false)
Definition: Track.h:606
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)
HoTNode & refLastHoTNode()
void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits)
const TrackCand & front() const
short int nFoundHits_
Definition: Track.h:347
const HoTNode * hotsData() const
std::vector< T > m_mem
void setScore(float s)
Definition: Track.h:190
int nLayersByTypeEncoded(const TrackerInfo &trk_inf) const
void setNMissingHits(int n)
CcPool< T > * m_pool
float score() const
Definition: Track.h:185
float getScoreCand(const Track &cand1, bool penalizeTailMissHits=false, bool inFindCandidates=false)
Definition: Track.h:630
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)
void insertSeed(const Track &seed, int region, int pos)
CombCandidate * combCandidate() const
float getScoreWorstPossible()
Definition: Track.h:602
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:346
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:345
int getLastHitIdx() const
void importSeed(const Track &seed, int region)
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