CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
mkfit::TrackCand Class Reference

#include <TrackStructures.h>

Inheritance diagram for mkfit::TrackCand:
mkfit::TrackBase

Public Member Functions

void addHitIdx (int hitIdx, int hitLyr, float chi2)
 
CombCandidatecombCandidate () const
 
void considerHitForOverlap (int hit_idx, int module_id, float chi2)
 
Track exportTrack (bool remove_missing_hits=false) const
 
HitMatchfindOverlap (int hit_idx, int module_id)
 
int getLastFoundHitLyr () const
 
int getLastFoundPixelHitLyr () const
 
int getLastHitIdx () const
 
int getLastHitLyr () const
 
HitOnTrack getLastHitOnTrack () const
 
void incOverlapCount ()
 
int lastCcIndex () const
 
int nFoundHits () const
 
int nHitsByTypeEncoded (const TrackerInfo &trk_inf) const
 
int nInsideMinusOneHits () const
 
int nLayersByTypeEncoded (const TrackerInfo &trk_inf) const
 
int nMatchedDecoded (const int &encoded) const
 
int nMissingHits () const
 
int nMonoDecoded (const int &encoded) const
 
int nOverlapHits () const
 
int nPixelDecoded (const int &encoded) const
 
int nStereoDecoded (const int &encoded) const
 
int nTailMinusOneHits () const
 
int nTotalHits () const
 
int nTotMatchDecoded (const int &encoded) const
 
int nUniqueLayers () const
 
int originIndex () const
 
bool popOverlap ()
 
HoTNoderefLastHoTNode ()
 
const HoTNoderefLastHoTNode () const
 
void resetOverlaps ()
 
void resetShortTrack ()
 
void setCombCandidate (CombCandidate *cc)
 
void setLastCcIndex (int i)
 
void setNFoundHits (int n)
 
void setNInsideMinusOneHits (int n)
 
void setNMissingHits (int n)
 
void setNOverlapHits (int n)
 
void setNTailMinusOneHits (int n)
 
void setOriginIndex (int oi)
 
 TrackCand ()=default
 
 TrackCand (const TrackBase &base, CombCandidate *ccand)
 
- Public Member Functions inherited from mkfit::TrackBase
int algoint () const
 
TrackAlgorithm algorithm () const
 
bool canReachRadius (float R) const
 
int charge () const
 
float chi2 () const
 
float d0BeamSpot (const float x_bs, const float y_bs, bool linearize=false) const
 
float emomEta () const
 
float emomPhi () const
 
float epT () const
 
const float * errArray () const
 
const SMatrixSym66errors () const
 
SMatrixSym66errors_nc ()
 
bool getDuplicateValue () const
 
int getEtaRegion () const
 
int getNSeedHits () const
 
Status getStatus () const
 
bool hasNanNSillyValues () const
 
bool hasSillyValues (bool dump, bool fix, const char *pref="")
 
float invpT () const
 
bool isFindable () const
 
bool isNotFindable () const
 
int label () const
 
float maxReachRadius () const
 
SVector3 momentum () const
 
float momEta () const
 
float momPhi () const
 
float p () const
 
const SVector6parameters () const
 
SVector6parameters_nc ()
 
const float * posArray () const
 
float posEta () const
 
SVector3 position () const
 
float posPhi () const
 
float posR () const
 
float posRsq () const
 
ProdType prodType () const
 
float pT () const
 
float px () const
 
float py () const
 
float pz () const
 
float rAtZ (float Z) const
 
float score () const
 
void setAlgoint (int algo)
 
void setAlgorithm (TrackAlgorithm algo)
 
void setCharge (int chg)
 
void setChi2 (float chi2)
 
void setDuplicateValue (bool d)
 
void setEtaRegion (int r)
 
void setLabel (int lbl)
 
void setNotFindable ()
 
void setNSeedHits (int n)
 
void setProdType (ProdType ptyp)
 
void setScore (float s)
 
void setState (const TrackState &newState)
 
void setStatus (Status s)
 
const TrackStatestate () const
 
TrackStatestate_nc ()
 
float swimPhiToR (const float x, const float y) const
 
float theta () const
 
 TrackBase ()
 
 TrackBase (const TrackState &state, float chi2, int label)
 
 TrackBase (int charge, const SVector3 &position, const SVector3 &momentum, const SMatrixSym66 &errors, float chi2)
 
float x () const
 
float y () const
 
float z () const
 
float zAtR (float R, float *r_reached=nullptr) const
 

Private Attributes

CombCandidatem_comb_candidate = nullptr
 
short int m_origin_index = -1
 
HitMatchPair m_overlap_hits
 
short int nInsideMinusOneHits_ = 0
 
short int nMissingHits_ = 0
 
short int nOverlapHits_ = 0
 
short int nTailMinusOneHits_ = 0
 

Additional Inherited Members

- Public Types inherited from mkfit::TrackBase
enum  ProdType { ProdType::NotSet = 0, ProdType::Signal = 1, ProdType::InTimePU = 2, ProdType::OutOfTimePU = 3 }
 
enum  TrackAlgorithm {
  TrackAlgorithm::undefAlgorithm = 0, TrackAlgorithm::ctf = 1, TrackAlgorithm::duplicateMerge = 2, TrackAlgorithm::cosmics = 3,
  TrackAlgorithm::initialStep = 4, TrackAlgorithm::lowPtTripletStep = 5, TrackAlgorithm::pixelPairStep = 6, TrackAlgorithm::detachedTripletStep = 7,
  TrackAlgorithm::mixedTripletStep = 8, TrackAlgorithm::pixelLessStep = 9, TrackAlgorithm::tobTecStep = 10, TrackAlgorithm::jetCoreRegionalStep = 11,
  TrackAlgorithm::conversionStep = 12, TrackAlgorithm::muonSeededStepInOut = 13, TrackAlgorithm::muonSeededStepOutIn = 14, TrackAlgorithm::outInEcalSeededConv = 15,
  TrackAlgorithm::inOutEcalSeededConv = 16, TrackAlgorithm::nuclInter = 17, TrackAlgorithm::standAloneMuon = 18, TrackAlgorithm::globalMuon = 19,
  TrackAlgorithm::cosmicStandAloneMuon = 20, TrackAlgorithm::cosmicGlobalMuon = 21, TrackAlgorithm::highPtTripletStep = 22, TrackAlgorithm::lowPtQuadStep = 23,
  TrackAlgorithm::detachedQuadStep = 24, TrackAlgorithm::reservedForUpgrades1 = 25, TrackAlgorithm::reservedForUpgrades2 = 26, TrackAlgorithm::bTagGhostTracks = 27,
  TrackAlgorithm::beamhalo = 28, TrackAlgorithm::gsf = 29, TrackAlgorithm::hltPixel = 30, TrackAlgorithm::hltIter0 = 31,
  TrackAlgorithm::hltIter1 = 32, TrackAlgorithm::hltIter2 = 33, TrackAlgorithm::hltIter3 = 34, TrackAlgorithm::hltIter4 = 35,
  TrackAlgorithm::hltIterX = 36, TrackAlgorithm::hiRegitMuInitialStep = 37, TrackAlgorithm::hiRegitMuLowPtTripletStep = 38, TrackAlgorithm::hiRegitMuPixelPairStep = 39,
  TrackAlgorithm::hiRegitMuDetachedTripletStep = 40, TrackAlgorithm::hiRegitMuMixedTripletStep = 41, TrackAlgorithm::hiRegitMuPixelLessStep = 42, TrackAlgorithm::hiRegitMuTobTecStep = 43,
  TrackAlgorithm::hiRegitMuMuonSeededStepInOut = 44, TrackAlgorithm::hiRegitMuMuonSeededStepOutIn = 45, TrackAlgorithm::algoSize = 46
}
 track algorithm; copy from TrackBase.h to keep in standalone builds More...
 
- Static Public Member Functions inherited from mkfit::TrackBase
static const char * algoint_to_cstr (int algo)
 
- Protected Attributes inherited from mkfit::TrackBase
float chi2_ = 0.
 
int label_ = -1
 
short int lastHitIdx_ = -1
 
short int nFoundHits_ = 0
 
float score_ = 0.
 
TrackState state_
 
Status status_
 

Detailed Description

Definition at line 159 of file TrackStructures.h.

Constructor & Destructor Documentation

◆ TrackCand() [1/2]

mkfit::TrackCand::TrackCand ( )
default

◆ TrackCand() [2/2]

mkfit::TrackCand::TrackCand ( const TrackBase base,
CombCandidate ccand 
)
inlineexplicit

Definition at line 163 of file TrackStructures.h.

References mkfit::TrackBase::lastHitIdx_, and mkfit::TrackBase::nFoundHits_.

163  : TrackBase(base), m_comb_candidate(ccand) {
164  // Reset hit counters -- caller has to initialize hits.
165  lastHitIdx_ = -1;
166  nFoundHits_ = 0;
167  }
CombCandidate * m_comb_candidate
short int nFoundHits_
Definition: Track.h:344
short int lastHitIdx_
Definition: Track.h:343

Member Function Documentation

◆ addHitIdx()

void mkfit::TrackCand::addHitIdx ( int  hitIdx,
int  hitLyr,
float  chi2 
)
inline

Definition at line 551 of file TrackStructures.h.

References mkfit::CombCandidate::addHit(), mkfit::TrackBase::chi2(), mkfit::TrackBase::chi2_, mkfit::Hit::kHitCCCFilterIdx, mkfit::Hit::kHitMissIdx, mkfit::TrackBase::lastHitIdx_, m_comb_candidate, mkfit::TrackBase::nFoundHits_, nInsideMinusOneHits_, nMissingHits_, and nTailMinusOneHits_.

Referenced by mkfit::CombCandidate::compactifyHitStorageForBestCand(), mkfit::MkBuilder::find_tracks_in_layers(), mkfit::MkFinder::findCandidates(), mkfit::MkBuilder::findTracksStandard(), and mkfit::CandCloner::processSeedRange().

551  {
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  }
CombCandidate * m_comb_candidate
float chi2_
Definition: Track.h:341
float chi2() const
Definition: Track.h:172
short int nTailMinusOneHits_
short int nFoundHits_
Definition: Track.h:344
short int lastHitIdx_
Definition: Track.h:343
static constexpr int kHitCCCFilterIdx
Definition: Hit.h:198
int addHit(const HitOnTrack &hot, float chi2, int prev_idx)
short int nMissingHits_
static constexpr int kHitMissIdx
Definition: Hit.h:193
short int nInsideMinusOneHits_

◆ combCandidate()

CombCandidate* mkfit::TrackCand::combCandidate ( ) const
inline

◆ considerHitForOverlap()

void mkfit::TrackCand::considerHitForOverlap ( int  hit_idx,
int  module_id,
float  chi2 
)
inline

Definition at line 199 of file TrackStructures.h.

References mkfit::TrackBase::chi2(), mkfit::HitMatchPair::consider_hit_for_overlap(), m_overlap_hits, and edm::service::monitor_file_utilities::module_id().

199  {
201  }
HitMatchPair m_overlap_hits
void consider_hit_for_overlap(int hit_idx, int module_id, float chi2)
auto module_id(edm::ModuleCallingContext const &mcc)
float chi2() const
Definition: Track.h:172

◆ exportTrack()

Track mkfit::TrackCand::exportTrack ( bool  remove_missing_hits = false) const

Definition at line 14 of file TrackStructures.cc.

References dprintf, mkfit::TrackBase::getNSeedHits(), mkfit::CombCandidate::hot_node(), mkfit::HitOnTrack::index, mkfit::TrackBase::label(), mkfit::TrackBase::lastHitIdx_, mkfit::HitOnTrack::layer, m_comb_candidate, mkfit::HoTNode::m_hot, mkfit::HoTNode::m_prev_idx, nFoundHits(), cms::cuda::nh, nOverlapHits(), nOverlapHits_, nTotalHits(), and mkfit::TrackBase::prodType().

Referenced by mkfit::MkBuilder::export_best_comb_cands().

14  {
15  dprintf("TrackCand::exportTrack label=%5d, total_hits=%2d, overlaps=%2d -- n_seed_hits=%d,prod_type=%d\n",
16  label(),
17  nTotalHits(),
19  getNSeedHits(),
20  (int)prodType());
21 
22  Track res(*this);
23  res.resizeHits(remove_missing_hits ? nFoundHits() : nTotalHits(), nFoundHits());
24  res.setNOverlapHits(nOverlapHits());
25 
26  int nh = nTotalHits();
27  int ch = lastHitIdx_;
28  int good_hits_pos = nFoundHits();
29  while (--nh >= 0) {
30  const HoTNode &hot_node = m_comb_candidate->hot_node(ch);
31  if (remove_missing_hits) {
32  if (hot_node.m_hot.index >= 0)
33  res.setHitIdxAtPos(--good_hits_pos, hot_node.m_hot);
34  } else {
35  res.setHitIdxAtPos(nh, hot_node.m_hot);
36  }
37  dprintf(" nh=%2d, ch=%d, idx=%d lyr=%d prev_idx=%d\n",
38  nh,
39  ch,
40  hot_node.m_hot.index,
41  hot_node.m_hot.layer,
42  hot_node.m_prev_idx);
43  ch = hot_node.m_prev_idx;
44  }
45 
46  return res;
47  }
int nOverlapHits() const
CombCandidate * m_comb_candidate
const HoTNode & hot_node(int i) const
ProdType prodType() const
Definition: Track.h:258
int label() const
Definition: Track.h:174
short int nOverlapHits_
Definition: Electron.h:6
int getNSeedHits() const
Definition: Track.h:261
uint32_t nh
int nTotalHits() const
short int lastHitIdx_
Definition: Track.h:343
int nFoundHits() const
#define dprintf(...)
Definition: Debug.h:98

◆ findOverlap()

HitMatch* mkfit::TrackCand::findOverlap ( int  hit_idx,
int  module_id 
)
inline

Definition at line 202 of file TrackStructures.h.

References mkfit::HitMatchPair::find_overlap(), m_overlap_hits, and edm::service::monitor_file_utilities::module_id().

202 { return m_overlap_hits.find_overlap(hit_idx, module_id); }
HitMatchPair m_overlap_hits
auto module_id(edm::ModuleCallingContext const &mcc)
HitMatch * find_overlap(int hit_idx, int module_id)

◆ getLastFoundHitLyr()

int mkfit::TrackCand::getLastFoundHitLyr ( ) const
inline

Definition at line 429 of file TrackStructures.h.

References mkfit::CombCandidate::hot_node(), mkfit::HitOnTrack::index, mkfit::TrackBase::lastHitIdx_, mkfit::HitOnTrack::layer, m_comb_candidate, mkfit::HoTNode::m_hot, mkfit::HoTNode::m_prev_idx, cms::cuda::nh, and nTotalHits().

429  {
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  }
CombCandidate * m_comb_candidate
const HoTNode & hot_node(int i) const
uint32_t nh
int nTotalHits() const
short int lastHitIdx_
Definition: Track.h:343

◆ getLastFoundPixelHitLyr()

int mkfit::TrackCand::getLastFoundPixelHitLyr ( ) const
inline

Definition at line 445 of file TrackStructures.h.

References mkfit::CombCandidate::hot_node(), mkfit::HitOnTrack::index, mkfit::TrackBase::lastHitIdx_, mkfit::HitOnTrack::layer, m_comb_candidate, mkfit::HoTNode::m_hot, mkfit::HoTNode::m_prev_idx, cms::cuda::nh, and nTotalHits().

445  {
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  }
CombCandidate * m_comb_candidate
const HoTNode & hot_node(int i) const
uint32_t nh
int nTotalHits() const
short int lastHitIdx_
Definition: Track.h:343
HitOnTrack m_hot

◆ getLastHitIdx()

int mkfit::TrackCand::getLastHitIdx ( ) const
inline

◆ getLastHitLyr()

int mkfit::TrackCand::getLastHitLyr ( ) const
inline

◆ getLastHitOnTrack()

HitOnTrack mkfit::TrackCand::getLastHitOnTrack ( ) const
inline

Definition at line 423 of file TrackStructures.h.

References mkfit::CombCandidate::hot(), mkfit::TrackBase::lastHitIdx_, and m_comb_candidate.

423 { return m_comb_candidate->hot(lastHitIdx_); }
CombCandidate * m_comb_candidate
short int lastHitIdx_
Definition: Track.h:343
HitOnTrack hot(int i) const

◆ incOverlapCount()

void mkfit::TrackCand::incOverlapCount ( )
inline

◆ lastCcIndex()

int mkfit::TrackCand::lastCcIndex ( ) const
inline

◆ nFoundHits()

int mkfit::TrackCand::nFoundHits ( ) const
inline

◆ nHitsByTypeEncoded()

int mkfit::TrackCand::nHitsByTypeEncoded ( const TrackerInfo trk_inf) const
inline

Definition at line 481 of file TrackStructures.h.

References mkfit::CombCandidate::hot_node(), mkfit::HitOnTrack::index, mkfit::Hit::kHitCCCFilterIdx, mkfit::TrackBase::lastHitIdx_, mkfit::HitOnTrack::layer, m_comb_candidate, mkfit::HoTNode::m_hot, mkfit::HoTNode::m_prev_idx, muonTagProbeFilters_cff::matched, cms::cuda::nh, and nTotalHits().

481  {
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  }
CombCandidate * m_comb_candidate
const HoTNode & hot_node(int i) const
uint32_t nh
int nTotalHits() const
short int lastHitIdx_
Definition: Track.h:343
static constexpr int kHitCCCFilterIdx
Definition: Hit.h:198
HitOnTrack m_hot

◆ nInsideMinusOneHits()

int mkfit::TrackCand::nInsideMinusOneHits ( ) const
inline

◆ nLayersByTypeEncoded()

int mkfit::TrackCand::nLayersByTypeEncoded ( const TrackerInfo trk_inf) const
inline

Definition at line 515 of file TrackStructures.h.

References mkfit::CombCandidate::hot_node(), mkfit::HitOnTrack::index, mkfit::Hit::kHitCCCFilterIdx, mkfit::TrackBase::lastHitIdx_, mkfit::HitOnTrack::layer, m_comb_candidate, mkfit::HoTNode::m_hot, mkfit::HoTNode::m_prev_idx, muonTagProbeFilters_cff::matched, cms::cuda::nh, and nTotalHits().

515  {
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  }
CombCandidate * m_comb_candidate
const HoTNode & hot_node(int i) const
uint32_t nh
int nTotalHits() const
short int lastHitIdx_
Definition: Track.h:343
static constexpr int kHitCCCFilterIdx
Definition: Hit.h:198
HitOnTrack m_hot

◆ nMatchedDecoded()

int mkfit::TrackCand::nMatchedDecoded ( const int &  encoded) const
inline

Definition at line 221 of file TrackStructures.h.

221 { return encoded / 1000000; }

◆ nMissingHits()

int mkfit::TrackCand::nMissingHits ( ) const
inline

Definition at line 180 of file TrackStructures.h.

References nMissingHits_.

Referenced by mkfit::MkFinder::copy_in().

180 { return nMissingHits_; }
short int nMissingHits_

◆ nMonoDecoded()

int mkfit::TrackCand::nMonoDecoded ( const int &  encoded) const
inline

Definition at line 220 of file TrackStructures.h.

220 { return (encoded / 10000) % 100; }

◆ nOverlapHits()

int mkfit::TrackCand::nOverlapHits ( ) const
inline

Definition at line 181 of file TrackStructures.h.

References nOverlapHits_.

Referenced by mkfit::MkFinder::copy_in(), exportTrack(), and mkfit::getScoreCand().

181 { return nOverlapHits_; }
short int nOverlapHits_

◆ nPixelDecoded()

int mkfit::TrackCand::nPixelDecoded ( const int &  encoded) const
inline

Definition at line 218 of file TrackStructures.h.

218 { return encoded % 100; }

◆ nStereoDecoded()

int mkfit::TrackCand::nStereoDecoded ( const int &  encoded) const
inline

Definition at line 219 of file TrackStructures.h.

219 { return (encoded / 100) % 100; }

◆ nTailMinusOneHits()

int mkfit::TrackCand::nTailMinusOneHits ( ) const
inline

◆ nTotalHits()

int mkfit::TrackCand::nTotalHits ( ) const
inline

◆ nTotMatchDecoded()

int mkfit::TrackCand::nTotMatchDecoded ( const int &  encoded) const
inline

Definition at line 222 of file TrackStructures.h.

222  {
223  return encoded % 100 + (encoded / 100) % 100 + (encoded / 10000) % 100 - encoded / 1000000;
224  }

◆ nUniqueLayers()

int mkfit::TrackCand::nUniqueLayers ( ) const
inline

Definition at line 462 of file TrackStructures.h.

References mkfit::CombCandidate::hot_node(), mkfit::HitOnTrack::index, mkfit::Hit::kHitCCCFilterIdx, mkfit::TrackBase::lastHitIdx_, mkfit::HitOnTrack::layer, m_comb_candidate, mkfit::HoTNode::m_hot, mkfit::HoTNode::m_prev_idx, cms::cuda::nh, and nTotalHits().

462  {
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  }
CombCandidate * m_comb_candidate
const HoTNode & hot_node(int i) const
uint32_t nh
int nTotalHits() const
short int lastHitIdx_
Definition: Track.h:343
static constexpr int kHitCCCFilterIdx
Definition: Hit.h:198
HitOnTrack m_hot

◆ originIndex()

int mkfit::TrackCand::originIndex ( ) const
inline

Definition at line 195 of file TrackStructures.h.

References m_origin_index.

Referenced by mkfit::MkBuilder::findTracksStandard().

195 { return m_origin_index; }
short int m_origin_index

◆ popOverlap()

bool mkfit::TrackCand::popOverlap ( )
inline

Definition at line 568 of file TrackStructures.h.

References mkfit::TrackBase::chi2_, getLastHitIdx(), getLastHitLyr(), mkfit::CombCandidate::hot(), mkfit::HitOnTrack::index, mkfit::TrackBase::lastHitIdx_, mkfit::HitOnTrack::layer, mkfit::HoTNode::m_chi2, m_comb_candidate, mkfit::HoTNode::m_prev_idx, mkfit::TrackBase::nFoundHits_, nOverlapHits_, and refLastHoTNode().

Referenced by mkfit::MkBuilder::find_tracks_in_layers().

568  {
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  }
CombCandidate * m_comb_candidate
float chi2_
Definition: Track.h:341
short int nOverlapHits_
HoTNode & refLastHoTNode()
short int nFoundHits_
Definition: Track.h:344
short int lastHitIdx_
Definition: Track.h:343
int getLastHitIdx() const
int getLastHitLyr() const
HitOnTrack hot(int i) const

◆ refLastHoTNode() [1/2]

HoTNode & mkfit::TrackCand::refLastHoTNode ( )
inline

Definition at line 545 of file TrackStructures.h.

References mkfit::CombCandidate::hot_node_nc(), mkfit::TrackBase::lastHitIdx_, and m_comb_candidate.

Referenced by popOverlap().

CombCandidate * m_comb_candidate
short int lastHitIdx_
Definition: Track.h:343
HoTNode & hot_node_nc(int i)

◆ refLastHoTNode() [2/2]

const HoTNode & mkfit::TrackCand::refLastHoTNode ( ) const
inline

Definition at line 547 of file TrackStructures.h.

References mkfit::CombCandidate::hot_node(), mkfit::TrackBase::lastHitIdx_, and m_comb_candidate.

CombCandidate * m_comb_candidate
const HoTNode & hot_node(int i) const
short int lastHitIdx_
Definition: Track.h:343

◆ resetOverlaps()

void mkfit::TrackCand::resetOverlaps ( )
inline

Definition at line 198 of file TrackStructures.h.

References m_overlap_hits, and mkfit::HitMatchPair::reset().

198 { m_overlap_hits.reset(); }
HitMatchPair m_overlap_hits

◆ resetShortTrack()

void mkfit::TrackCand::resetShortTrack ( )
inline

Definition at line 236 of file TrackStructures.h.

References mkfit::getScoreWorstPossible(), m_comb_candidate, and mkfit::TrackBase::score_.

Referenced by mkfit::CombCandidate::mergeCandsAndBestShortOne().

236  {
238  m_comb_candidate = nullptr;
239  }
CombCandidate * m_comb_candidate
float getScoreWorstPossible()
Definition: Track.h:597
float score_
Definition: Track.h:342

◆ setCombCandidate()

void mkfit::TrackCand::setCombCandidate ( CombCandidate cc)
inline

Definition at line 176 of file TrackStructures.h.

References gpuPixelDoublets::cc, and m_comb_candidate.

Referenced by mkfit::MkFinder::copy_out().

176 { m_comb_candidate = cc; }
CombCandidate * m_comb_candidate
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49

◆ setLastCcIndex()

void mkfit::TrackCand::setLastCcIndex ( int  i)
inline

◆ setNFoundHits()

void mkfit::TrackCand::setNFoundHits ( int  n)
inline

◆ setNInsideMinusOneHits()

void mkfit::TrackCand::setNInsideMinusOneHits ( int  n)
inline

◆ setNMissingHits()

void mkfit::TrackCand::setNMissingHits ( int  n)
inline

◆ setNOverlapHits()

void mkfit::TrackCand::setNOverlapHits ( int  n)
inline

Definition at line 187 of file TrackStructures.h.

References dqmiodumpmetadata::n, and nOverlapHits_.

Referenced by mkfit::MkFinder::copy_out().

◆ setNTailMinusOneHits()

void mkfit::TrackCand::setNTailMinusOneHits ( int  n)
inline

◆ setOriginIndex()

void mkfit::TrackCand::setOriginIndex ( int  oi)
inline

Definition at line 196 of file TrackStructures.h.

References m_origin_index.

Referenced by mkfit::MkFinder::findCandidates().

196 { m_origin_index = oi; }
short int m_origin_index

Member Data Documentation

◆ m_comb_candidate

CombCandidate* mkfit::TrackCand::m_comb_candidate = nullptr
private

◆ m_origin_index

short int mkfit::TrackCand::m_origin_index = -1
private

Definition at line 252 of file TrackStructures.h.

Referenced by originIndex(), and setOriginIndex().

◆ m_overlap_hits

HitMatchPair mkfit::TrackCand::m_overlap_hits
private

Definition at line 243 of file TrackStructures.h.

Referenced by considerHitForOverlap(), findOverlap(), and resetOverlaps().

◆ nInsideMinusOneHits_

short int mkfit::TrackCand::nInsideMinusOneHits_ = 0
private

Definition at line 249 of file TrackStructures.h.

Referenced by addHitIdx(), nInsideMinusOneHits(), and setNInsideMinusOneHits().

◆ nMissingHits_

short int mkfit::TrackCand::nMissingHits_ = 0
private

Definition at line 246 of file TrackStructures.h.

Referenced by addHitIdx(), nMissingHits(), nTotalHits(), and setNMissingHits().

◆ nOverlapHits_

short int mkfit::TrackCand::nOverlapHits_ = 0
private

◆ nTailMinusOneHits_

short int mkfit::TrackCand::nTailMinusOneHits_ = 0
private

Definition at line 250 of file TrackStructures.h.

Referenced by addHitIdx(), nTailMinusOneHits(), and setNTailMinusOneHits().