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)
 
- 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/4]

mkfit::Track::Track ( )
inline

Definition at line 377 of file Track.h.

377 {}

◆ Track() [2/4]

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/4]

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:432
double f[11][100]
void addHitIdx(int hitIdx, int hitLyr, float chi2)
Definition: Track.h:451
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/4]

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

Member Function Documentation

◆ addHitIdx() [1/2]

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

Definition at line 451 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().

451  {
452  hitsOnTrk_.push_back({hitIdx, hitLyr});
453  ++lastHitIdx_;
454  if (hitIdx >= 0 || hitIdx == -9) {
455  ++nFoundHits_;
456  chi2_ += chi2;
457  }
458  }
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:593
short int lastHitIdx_
Definition: Track.h:357

◆ addHitIdx() [2/2]

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

Definition at line 460 of file Track.h.

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

Referenced by addHitIdx().

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

◆ beginHitsOnTrack()

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

Definition at line 508 of file Track.h.

References hitsOnTrk_.

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

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

◆ beginHitsOnTrack_nc()

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

Definition at line 511 of file Track.h.

References hitsOnTrk_.

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

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

◆ countAndSetNFoundHits()

void mkfit::Track::countAndSetNFoundHits ( )
inline

Definition at line 517 of file Track.h.

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

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

◆ endHitsOnTrack()

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

Definition at line 509 of file Track.h.

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

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

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

◆ foundLayers()

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

Definition at line 582 of file Track.h.

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

582  {
583  std::vector<int> layers;
584  for (int ihit = 0; ihit <= lastHitIdx_; ++ihit) {
585  if (hitsOnTrk_[ihit].index >= 0 || hitsOnTrk_[ihit].index == -9) {
586  layers.push_back(hitsOnTrk_[ihit].layer);
587  }
588  }
589  return layers;
590  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:593
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 507 of file Track.h.

References hitsOnTrk_.

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

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

◆ getLastFoundHitIdx()

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

Definition at line 482 of file Track.h.

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

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

◆ getLastFoundHitLyr()

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

Definition at line 486 of file Track.h.

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

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

◆ getLastFoundHitOnTrack()

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

Definition at line 478 of file Track.h.

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

Referenced by getLastFoundMCHitID().

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

◆ getLastFoundHitPos()

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

Definition at line 471 of file Track.h.

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

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

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

◆ getLastFoundMCHitID()

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

Definition at line 491 of file Track.h.

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

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

◆ getLastHitIdx()

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

Definition at line 468 of file Track.h.

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

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

◆ getLastHitLyr()

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

Definition at line 469 of file Track.h.

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

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

◆ getLastHitOnTrack()

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

Definition at line 467 of file Track.h.

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

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

◆ getMCHitIDFromLayer()

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

Definition at line 496 of file Track.h.

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

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

◆ hitsVector()

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

Definition at line 397 of file Track.h.

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

397  {
398  HitVec hitsVec;
399  for (int ihit = 0; ihit < Config::nMaxTrkHits; ++ihit) {
400  const HitOnTrack& hot = hitsOnTrk_[ihit];
401  if (hot.index >= 0) {
402  hitsVec.push_back(globalHitVec[hot.layer][hot.index]);
403  }
404  }
405  return hitsVec;
406  }
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:593
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 421 of file Track.h.

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

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

◆ mcHitIDsVec()

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

Definition at line 408 of file Track.h.

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

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

◆ nFoundHits()

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

◆ nInsideMinusOneHits()

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

Definition at line 531 of file Track.h.

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

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

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

◆ nOverlapHits()

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

Definition at line 528 of file Track.h.

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

Referenced by mkfit::getScoreCand().

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

◆ nTailMinusOneHits()

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

Definition at line 543 of file Track.h.

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

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

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

◆ nTotalHits()

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

◆ nUniqueLayers()

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

Definition at line 554 of file Track.h.

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

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

◆ reserveHits()

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

Definition at line 432 of file Track.h.

References hitsOnTrk_, and nHits.

Referenced by Track().

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

◆ resetHits()

void mkfit::Track::resetHits ( )
inline

Definition at line 434 of file Track.h.

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

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

◆ resizeHits()

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

Definition at line 441 of file Track.h.

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

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

441  {
442  hitsOnTrk_.resize(nHits);
443  lastHitIdx_ = nHits - 1;
445  }
int nFoundHits() const
Definition: Track.h:525
short int nFoundHits_
Definition: Track.h:358
std::vector< HitOnTrack > hitsOnTrk_
Definition: Track.h:593
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:593
short int lastHitIdx_
Definition: Track.h:357

◆ setHitIdx()

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

Definition at line 513 of file Track.h.

References hitsOnTrk_.

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

◆ setHitIdxAtPos()

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

Definition at line 447 of file Track.h.

References hitsOnTrk_.

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

◆ setHitIdxLyr()

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

Definition at line 515 of file Track.h.

References hitsOnTrk_.

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

◆ 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:593
short int lastHitIdx_
Definition: Track.h:357

Member Data Documentation

◆ hitsOnTrk_

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