CMS 3D CMS Logo

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

#include <Track.h>

Inheritance diagram for mkfit::Track:
mkfit::TrackBase

Public Member Functions

void addHitIdx (int hitIdx, int hitLyr, float chi2)
 
void addHitIdx (const HitOnTrack &hot, float chi2)
 
const HitOnTrackbeginHitsOnTrack () const
 
HitOnTrackbeginHitsOnTrack_nc ()
 
void countAndSetNFoundHits ()
 
const HitOnTrackendHitsOnTrack () const
 
std::vector< int > foundLayers () const
 
int getHitIdx (int posHitIdx) const
 
int getHitLyr (int posHitIdx) const
 
HitOnTrack getHitOnTrack (int posHitIdx) const
 
const HitOnTrackgetHitsOnTrackArray () const
 
int getLastFoundHitIdx () const
 
int getLastFoundHitLyr () const
 
HitOnTrack getLastFoundHitOnTrack () const
 
int getLastFoundHitPos () const
 
int getLastFoundMCHitID (const std::vector< HitVec > &globalHitVec) const
 
int getLastHitIdx () const
 
int getLastHitLyr () const
 
HitOnTrack getLastHitOnTrack () const
 
int getMCHitIDFromLayer (const std::vector< HitVec > &globalHitVec, int layer) const
 
HitVec hitsVector (const std::vector< HitVec > &globalHitVec) const
 
int mcHitIDofFirstHit (const std::vector< HitVec > &globalHitVec, const MCHitInfoVec &globalMCHitInfo) const
 
void mcHitIDsVec (const std::vector< HitVec > &globalHitVec, const MCHitInfoVec &globalMCHitInfo, std::vector< int > &mcHitIDs) const
 
int nFoundHits () const
 
int nInsideMinusOneHits () const
 
int nOverlapHits () const
 
int nTailMinusOneHits () const
 
int nTotalHits () const
 
int nUniqueLayers () const
 
void reserveHits (int nHits)
 
void resetHits ()
 
void resizeHits (int nHits, int nFoundHits)
 
void resizeHitsForInput ()
 
void setHitIdx (int posHitIdx, int newIdx)
 
void setHitIdxAtPos (int pos, const HitOnTrack &hot)
 
void setHitIdxLyr (int posHitIdx, int newIdx, int newLyr)
 
void setNOverlapHits (int n)
 
void sortHitsByLayer ()
 
 Track ()
 
 Track (const TrackBase &base)
 
 Track (const TrackState &state, float chi2, int label, int nHits, const HitOnTrack *hits)
 
 Track (int charge, const SVector3 &position, const SVector3 &momentum, const SMatrixSym66 &errors, float chi2)
 
 Track (const Track &t)
 
- 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

std::vector< HitOnTrackhitsOnTrk_
 

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 375 of file Track.h.

Constructor & Destructor Documentation

◆ Track() [1/5]

mkfit::Track::Track ( )
inline

Definition at line 377 of file Track.h.

377 {}

◆ Track() [2/5]

mkfit::Track::Track ( const TrackBase base)
inlineexplicit

Definition at line 379 of file Track.h.

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

379  : TrackBase(base) {
380  // Reset hit counters -- caller has to initialize hits.
381  lastHitIdx_ = -1;
382  nFoundHits_ = 0;
383  }
base
Main Program
Definition: newFWLiteAna.py:92
short int nFoundHits_
Definition: Track.h:358
short int lastHitIdx_
Definition: Track.h:357

◆ Track() [3/5]

mkfit::Track::Track ( const TrackState state,
float  chi2,
int  label,
int  nHits,
const HitOnTrack hits 
)
inline

Definition at line 385 of file Track.h.

References addHitIdx(), f, h, hfClusterShapes_cfi::hits, nHits, and reserveHits().

386  : TrackBase(state, chi2, label) {
388  for (int h = 0; h < nHits; ++h) {
389  addHitIdx(hits[h].index, hits[h].layer, 0.0f);
390  }
391  }
float chi2() const
Definition: Track.h:186
int label() const
Definition: Track.h:188
void reserveHits(int nHits)
Definition: Track.h:434
double f[11][100]
void addHitIdx(int hitIdx, int hitLyr, float chi2)
Definition: Track.h:453
const TrackState & state() const
Definition: Track.h:143
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ Track() [4/5]

mkfit::Track::Track ( int  charge,
const SVector3 position,
const SVector3 momentum,
const SMatrixSym66 errors,
float  chi2 
)
inline

Definition at line 393 of file Track.h.

int charge() const
Definition: Track.h:185
float chi2() const
Definition: Track.h:186
SVector3 momentum() const
Definition: Track.h:158
SVector3 position() const
Definition: Track.h:157
Definition: errors.py:1

◆ Track() [5/5]

mkfit::Track::Track ( const Track t)
inline

Definition at line 396 of file Track.h.

396 : TrackBase(t), hitsOnTrk_(t.hitsOnTrk_) {}
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

Member Function Documentation

◆ addHitIdx() [1/2]

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

Definition at line 453 of file Track.h.

References mkfit::TrackBase::chi2(), mkfit::TrackBase::chi2_, hitsOnTrk_, mkfit::TrackBase::lastHitIdx_, and mkfit::TrackBase::nFoundHits_.

Referenced by mkfit::StdSeq::clean_cms_seedtracks_iter(), and Track().

453  {
454  hitsOnTrk_.push_back({hitIdx, hitLyr});
455  ++lastHitIdx_;
456  if (hitIdx >= 0 || hitIdx == -9) {
457  ++nFoundHits_;
458  chi2_ += chi2;
459  }
460  }
float chi2_
Definition: Track.h:355
float chi2() const
Definition: Track.h:186
short int nFoundHits_
Definition: Track.h:358
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ addHitIdx() [2/2]

void mkfit::Track::addHitIdx ( const HitOnTrack hot,
float  chi2 
)
inline

Definition at line 462 of file Track.h.

References addHitIdx(), mkfit::TrackBase::chi2(), mkfit::HitOnTrack::index, and mkfit::HitOnTrack::layer.

Referenced by addHitIdx().

462 { addHitIdx(hot.index, hot.layer, chi2); }
float chi2() const
Definition: Track.h:186
void addHitIdx(int hitIdx, int hitLyr, float chi2)
Definition: Track.h:453

◆ beginHitsOnTrack()

const HitOnTrack* mkfit::Track::beginHitsOnTrack ( ) const
inline

Definition at line 510 of file Track.h.

References hitsOnTrk_.

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

510 { return hitsOnTrk_.data(); }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

◆ beginHitsOnTrack_nc()

HitOnTrack* mkfit::Track::beginHitsOnTrack_nc ( )
inline

Definition at line 513 of file Track.h.

References hitsOnTrk_.

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

513 { return hitsOnTrk_.data(); }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

◆ countAndSetNFoundHits()

void mkfit::Track::countAndSetNFoundHits ( )
inline

Definition at line 519 of file Track.h.

References hitsOnTrk_, mps_fire::i, mkfit::TrackBase::lastHitIdx_, and mkfit::TrackBase::nFoundHits_.

519  {
520  nFoundHits_ = 0;
521  for (int i = 0; i <= lastHitIdx_; i++) {
522  if (hitsOnTrk_[i].index >= 0 || hitsOnTrk_[i].index == -9)
523  nFoundHits_++;
524  }
525  }
short int nFoundHits_
Definition: Track.h:358
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ endHitsOnTrack()

const HitOnTrack* mkfit::Track::endHitsOnTrack ( ) const
inline

Definition at line 511 of file Track.h.

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

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

511 { return hitsOnTrk_.data() + (lastHitIdx_ + 1); }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ foundLayers()

std::vector<int> mkfit::Track::foundLayers ( ) const
inline

Definition at line 584 of file Track.h.

References hitsOnTrk_, mkfit::TrackBase::lastHitIdx_, and hgcalTBTopologyTester_cfi::layers.

584  {
585  std::vector<int> layers;
586  for (int ihit = 0; ihit <= lastHitIdx_; ++ihit) {
587  if (hitsOnTrk_[ihit].index >= 0 || hitsOnTrk_[ihit].index == -9) {
588  layers.push_back(hitsOnTrk_[ihit].layer);
589  }
590  }
591  return layers;
592  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ getHitIdx()

int mkfit::Track::getHitIdx ( int  posHitIdx) const
inline

◆ getHitLyr()

int mkfit::Track::getHitLyr ( int  posHitIdx) const
inline

◆ getHitOnTrack()

HitOnTrack mkfit::Track::getHitOnTrack ( int  posHitIdx) const
inline

◆ getHitsOnTrackArray()

const HitOnTrack* mkfit::Track::getHitsOnTrackArray ( ) const
inline

Definition at line 509 of file Track.h.

References hitsOnTrk_.

Referenced by mkfit::MkFinder::bkFitInputTracks(), and mkfit::MkFitter::inputTracksForFit().

509 { return hitsOnTrk_.data(); }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

◆ getLastFoundHitIdx()

int mkfit::Track::getLastFoundHitIdx ( ) const
inline

Definition at line 484 of file Track.h.

References getLastFoundHitPos(), hitsOnTrk_, and mkfit::TrackBase::p().

484  {
485  int p = getLastFoundHitPos();
486  return p >= 0 ? hitsOnTrk_[p].index : -1;
487  }
float p() const
Definition: Track.h:173
int getLastFoundHitPos() const
Definition: Track.h:473
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

◆ getLastFoundHitLyr()

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

Definition at line 488 of file Track.h.

References getLastFoundHitPos(), hitsOnTrk_, and mkfit::TrackBase::p().

488  {
489  int p = getLastFoundHitPos();
490  return p >= 0 ? hitsOnTrk_[p].layer : -1;
491  }
float p() const
Definition: Track.h:173
int getLastFoundHitPos() const
Definition: Track.h:473
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

◆ getLastFoundHitOnTrack()

HitOnTrack mkfit::Track::getLastFoundHitOnTrack ( ) const
inline

Definition at line 480 of file Track.h.

References getLastFoundHitPos(), hitsOnTrk_, and mkfit::TrackBase::p().

Referenced by getLastFoundMCHitID().

480  {
481  int p = getLastFoundHitPos();
482  return p >= 0 ? hitsOnTrk_[p] : HitOnTrack(-1, -1);
483  }
float p() const
Definition: Track.h:173
int getLastFoundHitPos() const
Definition: Track.h:473
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

◆ getLastFoundHitPos()

int mkfit::Track::getLastFoundHitPos ( ) const
inline

Definition at line 473 of file Track.h.

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

Referenced by getLastFoundHitIdx(), getLastFoundHitLyr(), and getLastFoundHitOnTrack().

473  {
474  int hi = lastHitIdx_;
475  while (hi >= 0 && hitsOnTrk_[hi].index < 0)
476  --hi;
477  return hi;
478  }
Definition: EPCuts.h:4
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ getLastFoundMCHitID()

int mkfit::Track::getLastFoundMCHitID ( const std::vector< HitVec > &  globalHitVec) const
inline

Definition at line 493 of file Track.h.

References getLastFoundHitOnTrack(), mkfit::HitOnTrack::index, and mkfit::HitOnTrack::layer.

493  {
494  HitOnTrack hot = getLastFoundHitOnTrack();
495  return globalHitVec[hot.layer][hot.index].mcHitID();
496  }
HitOnTrack getLastFoundHitOnTrack() const
Definition: Track.h:480

◆ getLastHitIdx()

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

Definition at line 470 of file Track.h.

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

470 { return hitsOnTrk_[lastHitIdx_].index; }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ getLastHitLyr()

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

Definition at line 471 of file Track.h.

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

471 { return hitsOnTrk_[lastHitIdx_].layer; }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ getLastHitOnTrack()

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

Definition at line 469 of file Track.h.

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

469 { return hitsOnTrk_[lastHitIdx_]; }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ getMCHitIDFromLayer()

int mkfit::Track::getMCHitIDFromLayer ( const std::vector< HitVec > &  globalHitVec,
int  layer 
) const
inline

Definition at line 498 of file Track.h.

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

498  {
499  int mcHitID = -1;
500  for (int ihit = 0; ihit <= lastHitIdx_; ++ihit) {
501  if (hitsOnTrk_[ihit].layer == layer) {
502  mcHitID = globalHitVec[hitsOnTrk_[ihit].layer][hitsOnTrk_[ihit].index].mcHitID();
503  break;
504  }
505  }
506  return mcHitID;
507  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ hitsVector()

HitVec mkfit::Track::hitsVector ( const std::vector< HitVec > &  globalHitVec) const
inline

Definition at line 399 of file Track.h.

References hitsOnTrk_, mkfit::HitOnTrack::index, mkfit::HitOnTrack::layer, and mkfit::Config::nMaxTrkHits.

399  {
400  HitVec hitsVec;
401  for (int ihit = 0; ihit < Config::nMaxTrkHits; ++ihit) {
402  const HitOnTrack& hot = hitsOnTrk_[ihit];
403  if (hot.index >= 0) {
404  hitsVec.push_back(globalHitVec[hot.layer][hot.index]);
405  }
406  }
407  return hitsVec;
408  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
std::vector< Hit > HitVec
constexpr int nMaxTrkHits
Definition: Config.h:42

◆ mcHitIDofFirstHit()

int mkfit::Track::mcHitIDofFirstHit ( const std::vector< HitVec > &  globalHitVec,
const MCHitInfoVec globalMCHitInfo 
) const
inline

Definition at line 423 of file Track.h.

References hitsOnTrk_, mkfit::HitOnTrack::index, and mkfit::HitOnTrack::layer.

423  {
424  const HitOnTrack& hot = hitsOnTrk_[0];
425  if ((hot.index >= 0) && (static_cast<size_t>(hot.index) < globalHitVec[hot.layer].size())) {
426  return globalHitVec[hot.layer][hot.index].mcTrackID(globalMCHitInfo);
427  } else {
428  return hot.index;
429  }
430  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

◆ mcHitIDsVec()

void mkfit::Track::mcHitIDsVec ( const std::vector< HitVec > &  globalHitVec,
const MCHitInfoVec globalMCHitInfo,
std::vector< int > &  mcHitIDs 
) const
inline

Definition at line 410 of file Track.h.

References hitsOnTrk_, mkfit::HitOnTrack::index, mkfit::TrackBase::lastHitIdx_, and mkfit::HitOnTrack::layer.

412  {
413  for (int ihit = 0; ihit <= lastHitIdx_; ++ihit) {
414  const HitOnTrack& hot = hitsOnTrk_[ihit];
415  if ((hot.index >= 0) && (static_cast<size_t>(hot.index) < globalHitVec[hot.layer].size())) {
416  mcHitIDs.push_back(globalHitVec[hot.layer][hot.index].mcTrackID(globalMCHitInfo));
417  } else {
418  mcHitIDs.push_back(hot.index);
419  }
420  }
421  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ nFoundHits()

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

◆ nInsideMinusOneHits()

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

Definition at line 533 of file Track.h.

References hitsOnTrk_, mps_fire::i, mkfit::TrackBase::lastHitIdx_, and dqmiodumpmetadata::n.

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

533  {
534  int n = 0;
535  bool insideValid = false;
536  for (int i = lastHitIdx_; i >= 0; --i) {
537  if (hitsOnTrk_[i].index >= 0)
538  insideValid = true;
539  if (insideValid && hitsOnTrk_[i].index == -1)
540  ++n;
541  }
542  return n;
543  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ nOverlapHits()

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

Definition at line 530 of file Track.h.

References mkfit::TrackBase::Status::n_overlaps, and mkfit::TrackBase::status_.

Referenced by mkfit::getScoreCand().

530 { return status_.n_overlaps; }
Status status_
Definition: Track.h:359

◆ nTailMinusOneHits()

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

Definition at line 545 of file Track.h.

References hitsOnTrk_, mps_fire::i, mkfit::TrackBase::lastHitIdx_, and dqmiodumpmetadata::n.

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

545  {
546  int n = 0;
547  for (int i = lastHitIdx_; i >= 0; --i) {
548  if (hitsOnTrk_[i].index >= 0)
549  return n;
550  if (hitsOnTrk_[i].index == -1)
551  ++n;
552  }
553  return n;
554  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ nTotalHits()

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

◆ nUniqueLayers()

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

Definition at line 556 of file Track.h.

References hitsOnTrk_, heavyIonCSV_trainingSettings::idx, mkfit::TrackBase::lastHitIdx_, and jetUpdater_cfi::sort.

556  {
557  // make local copy in vector: sort it in place
558  std::vector<HitOnTrack> tmp_hitsOnTrk(hitsOnTrk_.begin(), hitsOnTrk_.end());
559  std::sort(tmp_hitsOnTrk.begin(), tmp_hitsOnTrk.end(), [](const auto& h1, const auto& h2) {
560  return h1.layer < h2.layer;
561  });
562 
563  // local counters
564  auto lyr_cnt = 0;
565  auto prev_lyr = -1;
566 
567  // loop over copy of hitsOnTrk
568  for (auto ihit = 0; ihit <= lastHitIdx_; ++ihit) {
569  const auto& hot = tmp_hitsOnTrk[ihit];
570  const auto lyr = hot.layer;
571  const auto idx = hot.index;
572  if (lyr >= 0 && (idx >= 0 || idx == -9) && lyr != prev_lyr) {
573  ++lyr_cnt;
574  prev_lyr = lyr;
575  }
576  }
577  return lyr_cnt;
578  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ reserveHits()

void mkfit::Track::reserveHits ( int  nHits)
inline

Definition at line 434 of file Track.h.

References hitsOnTrk_, and nHits.

Referenced by Track().

434 { hitsOnTrk_.reserve(nHits); }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits

◆ resetHits()

void mkfit::Track::resetHits ( )
inline

Definition at line 436 of file Track.h.

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

436  {
437  lastHitIdx_ = -1;
438  nFoundHits_ = 0;
439  hitsOnTrk_.clear();
440  }
short int nFoundHits_
Definition: Track.h:358
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ resizeHits()

void mkfit::Track::resizeHits ( int  nHits,
int  nFoundHits 
)
inline

Definition at line 443 of file Track.h.

References hitsOnTrk_, mkfit::TrackBase::lastHitIdx_, nFoundHits(), mkfit::TrackBase::nFoundHits_, and nHits.

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

443  {
444  hitsOnTrk_.resize(nHits);
445  lastHitIdx_ = nHits - 1;
447  }
int nFoundHits() const
Definition: Track.h:527
short int nFoundHits_
Definition: Track.h:358
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits

◆ resizeHitsForInput()

void mkfit::Track::resizeHitsForInput ( )

Definition at line 389 of file Track.cc.

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

389  {
390  bzero(&hitsOnTrk_, sizeof(hitsOnTrk_));
391  hitsOnTrk_.resize(lastHitIdx_ + 1);
392  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

◆ setHitIdx()

void mkfit::Track::setHitIdx ( int  posHitIdx,
int  newIdx 
)
inline

Definition at line 515 of file Track.h.

References hitsOnTrk_.

515 { hitsOnTrk_[posHitIdx].index = newIdx; }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

◆ setHitIdxAtPos()

void mkfit::Track::setHitIdxAtPos ( int  pos,
const HitOnTrack hot 
)
inline

Definition at line 449 of file Track.h.

References hitsOnTrk_.

449 { hitsOnTrk_[pos] = hot; }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

◆ setHitIdxLyr()

void mkfit::Track::setHitIdxLyr ( int  posHitIdx,
int  newIdx,
int  newLyr 
)
inline

Definition at line 517 of file Track.h.

References hitsOnTrk_.

517 { hitsOnTrk_[posHitIdx] = {newIdx, newLyr}; }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595

◆ setNOverlapHits()

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

◆ sortHitsByLayer()

void mkfit::Track::sortHitsByLayer ( )

Definition at line 394 of file Track.cc.

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

Referenced by mkfit::StdSeq::clean_cms_seedtracks_iter().

394  {
395  std::stable_sort(&hitsOnTrk_[0], &hitsOnTrk_[lastHitIdx_ + 1], [](const auto& h1, const auto& h2) {
396  return h1.layer < h2.layer;
397  });
398  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:595
short int lastHitIdx_
Definition: Track.h:357

Member Data Documentation

◆ hitsOnTrk_

std::vector<HitOnTrack> mkfit::Track::hitsOnTrk_
private