CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
mkfit::TrackBase Class Reference

#include <Track.h>

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

Classes

struct  Status
 

Public Types

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...
 

Public Member Functions

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
 

Static Public Member Functions

static const char * algoint_to_cstr (int algo)
 

Protected Attributes

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

Member Enumeration Documentation

◆ ProdType

Enumerator
NotSet 
Signal 
InTimePU 
OutOfTimePU 

Definition at line 257 of file Track.h.

257 { NotSet = 0, Signal = 1, InTimePU = 2, OutOfTimePU = 3 };

◆ TrackAlgorithm

track algorithm; copy from TrackBase.h to keep in standalone builds

Enumerator
undefAlgorithm 
ctf 
duplicateMerge 
cosmics 
initialStep 
lowPtTripletStep 
pixelPairStep 
detachedTripletStep 
mixedTripletStep 
pixelLessStep 
tobTecStep 
jetCoreRegionalStep 
conversionStep 
muonSeededStepInOut 
muonSeededStepOutIn 
outInEcalSeededConv 
inOutEcalSeededConv 
nuclInter 
standAloneMuon 
globalMuon 
cosmicStandAloneMuon 
cosmicGlobalMuon 
highPtTripletStep 
lowPtQuadStep 
detachedQuadStep 
reservedForUpgrades1 
reservedForUpgrades2 
bTagGhostTracks 
beamhalo 
gsf 
hltPixel 
hltIter0 
hltIter1 
hltIter2 
hltIter3 
hltIter4 
hltIterX 
hiRegitMuInitialStep 
hiRegitMuLowPtTripletStep 
hiRegitMuPixelPairStep 
hiRegitMuDetachedTripletStep 
hiRegitMuMixedTripletStep 
hiRegitMuPixelLessStep 
hiRegitMuTobTecStep 
hiRegitMuMuonSeededStepInOut 
hiRegitMuMuonSeededStepOutIn 
algoSize 

Definition at line 272 of file Track.h.

272  {
273  undefAlgorithm = 0,
274  ctf = 1,
275  duplicateMerge = 2,
276  cosmics = 3,
277  initialStep = 4,
278  lowPtTripletStep = 5,
279  pixelPairStep = 6,
281  mixedTripletStep = 8,
282  pixelLessStep = 9,
283  tobTecStep = 10,
284  jetCoreRegionalStep = 11,
285  conversionStep = 12,
286  muonSeededStepInOut = 13,
287  muonSeededStepOutIn = 14,
288  outInEcalSeededConv = 15,
289  inOutEcalSeededConv = 16,
290  nuclInter = 17,
291  standAloneMuon = 18,
292  globalMuon = 19,
294  cosmicGlobalMuon = 21,
295  // Phase1
296  highPtTripletStep = 22,
297  lowPtQuadStep = 23,
298  detachedQuadStep = 24,
299  reservedForUpgrades1 = 25,
300  reservedForUpgrades2 = 26,
301  bTagGhostTracks = 27,
302  beamhalo = 28,
303  gsf = 29,
304  // HLT algo name
305  hltPixel = 30,
306  // steps used by PF
307  hltIter0 = 31,
308  hltIter1 = 32,
309  hltIter2 = 33,
310  hltIter3 = 34,
311  hltIter4 = 35,
312  // steps used by all other objects @HLT
313  hltIterX = 36,
314  // steps used by HI muon regional iterative tracking
321  hiRegitMuTobTecStep = 43,
324  algoSize = 46
325  };
hiRegitMuMuonSeededStepInOut
Definition: ntupleEnum.py:67
hiRegitMuDetachedTripletStep
Definition: ntupleEnum.py:63
hiRegitMuPixelPairStep
Definition: ntupleEnum.py:62
cosmicStandAloneMuon
Definition: ntupleEnum.py:41
hiRegitMuPixelLessStep
Definition: ntupleEnum.py:65
hiRegitMuLowPtTripletStep
Definition: ntupleEnum.py:61
hiRegitMuMuonSeededStepOutIn
Definition: ntupleEnum.py:68
muonSeededStepInOut
Definition: ntupleEnum.py:37
hiRegitMuInitialStep
Definition: ntupleEnum.py:60
outInEcalSeededConv
Definition: ntupleEnum.py:39
hiRegitMuTobTecStep
Definition: ntupleEnum.py:66
hiRegitMuMixedTripletStep
Definition: ntupleEnum.py:64
inOutEcalSeededConv
Definition: ntupleEnum.py:39
muonSeededStepOutIn
Definition: ntupleEnum.py:38

Constructor & Destructor Documentation

◆ TrackBase() [1/3]

mkfit::TrackBase::TrackBase ( )
inline

Definition at line 122 of file Track.h.

122 {}

◆ TrackBase() [2/3]

mkfit::TrackBase::TrackBase ( const TrackState state,
float  chi2,
int  label 
)
inline

Definition at line 124 of file Track.h.

124 : state_(state), chi2_(chi2), label_(label) {}
TrackState state_
Definition: Track.h:340
float chi2_
Definition: Track.h:341
float chi2() const
Definition: Track.h:172
int label() const
Definition: Track.h:174
const TrackState & state() const
Definition: Track.h:129

◆ TrackBase() [3/3]

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

Definition at line 126 of file Track.h.

int charge() const
Definition: Track.h:171
TrackState state_
Definition: Track.h:340
float chi2_
Definition: Track.h:341
float chi2() const
Definition: Track.h:172
SVector3 momentum() const
Definition: Track.h:144
SVector3 position() const
Definition: Track.h:143
Definition: errors.py:1

Member Function Documentation

◆ algoint()

int mkfit::TrackBase::algoint ( ) const
inline

Definition at line 327 of file Track.h.

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

327 { return status_.algorithm; }
unsigned int algorithm
Definition: Track.h:220
Status status_
Definition: Track.h:345

◆ algoint_to_cstr()

const char * mkfit::TrackBase::algoint_to_cstr ( int  algo)
static

Definition at line 331 of file Track.cc.

References algoSize, and names.

Referenced by mkfit::Shell::Compare(), mkfit::Shell::FillByLabelMaps_CkfBase(), mkfit::Shell::PrintIterations(), mkfit::ConfigJson::save_Iterations(), and mkfit::Shell::Status().

331  {
332  static const char* const names[] = {"undefAlgorithm",
333  "ctf",
334  "duplicateMerge",
335  "cosmics",
336  "initialStep",
337  "lowPtTripletStep",
338  "pixelPairStep",
339  "detachedTripletStep",
340  "mixedTripletStep",
341  "pixelLessStep",
342  "tobTecStep",
343  "jetCoreRegionalStep",
344  "conversionStep",
345  "muonSeededStepInOut",
346  "muonSeededStepOutIn",
347  "outInEcalSeededConv",
348  "inOutEcalSeededConv",
349  "nuclInter",
350  "standAloneMuon",
351  "globalMuon",
352  "cosmicStandAloneMuon",
353  "cosmicGlobalMuon",
354  "highPtTripletStep",
355  "lowPtQuadStep",
356  "detachedQuadStep",
357  "reservedForUpgrades1",
358  "reservedForUpgrades2",
359  "bTagGhostTracks",
360  "beamhalo",
361  "gsf",
362  "hltPixel",
363  "hltIter0",
364  "hltIter1",
365  "hltIter2",
366  "hltIter3",
367  "hltIter4",
368  "hltIterX",
369  "hiRegitMuInitialStep",
370  "hiRegitMuLowPtTripletStep",
371  "hiRegitMuPixelPairStep",
372  "hiRegitMuDetachedTripletStep",
373  "hiRegitMuMixedTripletStep",
374  "hiRegitMuPixelLessStep",
375  "hiRegitMuTobTecStep",
376  "hiRegitMuMuonSeededStepInOut",
377  "hiRegitMuMuonSeededStepOutIn",
378  "algoSize"};
379 
380  if (algo < 0 || algo >= (int)TrackAlgorithm::algoSize)
381  return names[0];
382  return names[algo];
383  }
const std::string names[nVars_]

◆ algorithm()

TrackAlgorithm mkfit::TrackBase::algorithm ( ) const
inline

Definition at line 328 of file Track.h.

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

Referenced by mkfit::Event::select_tracks_iter().

328 { return TrackAlgorithm(status_.algorithm); }
unsigned int algorithm
Definition: Track.h:220
Status status_
Definition: Track.h:345
TrackAlgorithm
track algorithm; copy from TrackBase.h to keep in standalone builds
Definition: Track.h:272

◆ canReachRadius()

bool mkfit::TrackBase::canReachRadius ( float  R) const

Definition at line 213 of file Track.cc.

References funct::abs(), mkfit::Config::Bfield, charge(), f, Matriplex::hypot(), dqmdumpme::k, pT(), dttmaxenums::R, mkfit::Const::sol, x(), and y().

213  {
214  const float k = ((charge() < 0) ? 100.0f : -100.0f) / (Const::sol * Config::Bfield);
215  const float ooc = 2.0f * k * pT();
216  return std::abs(ooc) > R - std::hypot(x(), y());
217  }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
int charge() const
Definition: Track.h:171
float pT() const
Definition: Track.h:157
float y() const
Definition: Track.h:147
constexpr float Bfield
Definition: Config.h:55
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
constexpr float sol
Definition: Config.h:13
float x() const
Definition: Track.h:146

◆ charge()

int mkfit::TrackBase::charge ( void  ) const
inline

◆ chi2()

float mkfit::TrackBase::chi2 ( void  ) const
inline

◆ d0BeamSpot()

float mkfit::TrackBase::d0BeamSpot ( const float  x_bs,
const float  y_bs,
bool  linearize = false 
) const

Definition at line 191 of file Track.cc.

References funct::abs(), mkfit::Config::Bfield, charge(), funct::cos(), f, Matriplex::hypot(), dqmdumpme::k, momPhi(), pT(), px(), py(), funct::sin(), mkfit::Const::sol, x(), and y().

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

191  {
192  if (linearize) {
193  return std::abs(std::cos(momPhi()) * (y() - y_bs) - std::sin(momPhi()) * (x() - x_bs));
194  } else {
195  const float k = ((charge() < 0) ? 100.0f : -100.0f) / (Const::sol * Config::Bfield);
196  const float abs_ooc_half = std::abs(k * pT());
197  // center of helix in x,y plane
198  const float x_center = x() - k * py();
199  const float y_center = y() + k * px();
200  return std::hypot(x_center - x_bs, y_center - y_bs) - abs_ooc_half;
201  }
202  }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
int charge() const
Definition: Track.h:171
float pT() const
Definition: Track.h:157
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float py() const
Definition: Track.h:155
float y() const
Definition: Track.h:147
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr float Bfield
Definition: Config.h:55
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
constexpr float sol
Definition: Config.h:13
float px() const
Definition: Track.h:154
float x() const
Definition: Track.h:146
float momPhi() const
Definition: Track.h:160

◆ emomEta()

float mkfit::TrackBase::emomEta ( ) const
inline

Definition at line 167 of file Track.h.

References mkfit::TrackState::emomEta(), and state_.

167 { return state_.emomEta(); }
TrackState state_
Definition: Track.h:340
float emomEta() const
Definition: Track.h:99

◆ emomPhi()

float mkfit::TrackBase::emomPhi ( ) const
inline

Definition at line 166 of file Track.h.

References mkfit::TrackState::emomPhi(), and state_.

166 { return state_.emomPhi(); }
TrackState state_
Definition: Track.h:340
float emomPhi() const
Definition: Track.h:96

◆ epT()

float mkfit::TrackBase::epT ( ) const
inline

Definition at line 165 of file Track.h.

References mkfit::TrackState::epT(), and state_.

165 { return state_.epT(); }
float epT() const
Definition: Track.h:98
TrackState state_
Definition: Track.h:340

◆ errArray()

const float* mkfit::TrackBase::errArray ( ) const
inline

Definition at line 136 of file Track.h.

References mkfit::TrackState::errors, and state_.

136 { return state_.errors.Array(); }
TrackState state_
Definition: Track.h:340
SMatrixSym66 errors
Definition: Track.h:49

◆ errors()

const SMatrixSym66& mkfit::TrackBase::errors ( void  ) const
inline

◆ errors_nc()

SMatrixSym66& mkfit::TrackBase::errors_nc ( )
inline

Definition at line 140 of file Track.h.

References mkfit::TrackState::errors, and state_.

Referenced by mkfit::MkFinder::bkFitOutputTracks(), and mkfit::MkFinder::copy_out().

140 { return state_.errors; }
TrackState state_
Definition: Track.h:340
SMatrixSym66 errors
Definition: Track.h:49

◆ getDuplicateValue()

bool mkfit::TrackBase::getDuplicateValue ( ) const
inline

◆ getEtaRegion()

int mkfit::TrackBase::getEtaRegion ( ) const
inline

Definition at line 263 of file Track.h.

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

Referenced by mkfit::Shell::CheckMkFitLayerPlanVsReferenceHits().

263 { return status_.eta_region; }
Status status_
Definition: Track.h:345
unsigned int eta_region
Definition: Track.h:229

◆ getNSeedHits()

int mkfit::TrackBase::getNSeedHits ( ) const
inline

◆ getStatus()

Status mkfit::TrackBase::getStatus ( ) const
inline

Definition at line 248 of file Track.h.

References status_.

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

248 { return status_; }
Status status_
Definition: Track.h:345

◆ hasNanNSillyValues()

bool mkfit::TrackBase::hasNanNSillyValues ( ) const

Definition at line 177 of file Track.cc.

References mkfit::TrackState::errors, mps_fire::i, mkfit::isFinite(), dqmiolumiharvest::j, mkfit::LL, and state_.

177  {
178  bool is_silly = false;
179  for (int i = 0; i < LL; ++i) {
180  for (int j = 0; j <= i; ++j) {
181  if ((i == j && state_.errors.At(i, j) < 0) || !isFinite(state_.errors.At(i, j))) {
182  is_silly = true;
183  return is_silly;
184  }
185  }
186  }
187  return is_silly;
188  }
TrackState state_
Definition: Track.h:340
SMatrixSym66 errors
Definition: Track.h:49
constexpr Matriplex::idx_t LL
Definition: Matrix.h:45
constexpr bool isFinite(float x)

◆ hasSillyValues()

bool mkfit::TrackBase::hasSillyValues ( bool  dump,
bool  fix,
const char *  pref = "" 
)

Definition at line 155 of file Track.cc.

References GCP_Ntuples_cfg::dump, mkfit::TrackState::errors, mps_fire::i, mkfit::isFinite(), dqmiolumiharvest::j, label(), mkfit::LL, pT(), and state_.

155  {
156  bool is_silly = false;
157  for (int i = 0; i < LL; ++i) {
158  for (int j = 0; j <= i; ++j) {
159  if ((i == j && state_.errors.At(i, j) < 0) || !isFinite(state_.errors.At(i, j))) {
160  if (!is_silly) {
161  is_silly = true;
162  if (dump)
163  printf("%s (label=%d, pT=%f):", pref, label(), pT());
164  }
165  if (dump)
166  printf(" (%d,%d)=%e", i, j, state_.errors.At(i, j));
167  if (fix)
168  state_.errors.At(i, j) = 0.00001;
169  }
170  }
171  }
172  if (is_silly && dump)
173  printf("\n");
174  return is_silly;
175  }
TrackState state_
Definition: Track.h:340
float pT() const
Definition: Track.h:157
int label() const
Definition: Track.h:174
SMatrixSym66 errors
Definition: Track.h:49
constexpr Matriplex::idx_t LL
Definition: Matrix.h:45
constexpr bool isFinite(float x)

◆ invpT()

float mkfit::TrackBase::invpT ( ) const
inline

Definition at line 158 of file Track.h.

References mkfit::TrackState::invpT(), and state_.

Referenced by mkfit::Event::clean_cms_seedtracks(), mkfit::StdSeq::clean_cms_seedtracks_iter(), rAtZ(), and zAtR().

158 { return state_.invpT(); }
TrackState state_
Definition: Track.h:340
float invpT() const
Definition: Track.h:85

◆ isFindable()

bool mkfit::TrackBase::isFindable ( ) const
inline

◆ isNotFindable()

bool mkfit::TrackBase::isNotFindable ( ) const
inline

Definition at line 252 of file Track.h.

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

252 { return status_.not_findable; }
Status status_
Definition: Track.h:345

◆ label()

int mkfit::TrackBase::label ( ) const
inline

◆ maxReachRadius()

float mkfit::TrackBase::maxReachRadius ( ) const

Definition at line 219 of file Track.cc.

References funct::abs(), mkfit::Config::Bfield, charge(), f, Matriplex::hypot(), dqmdumpme::k, pT(), px(), py(), mkfit::Const::sol, x(), and y().

219  {
220  const float k = ((charge() < 0) ? 100.0f : -100.0f) / (Const::sol * Config::Bfield);
221  const float abs_ooc_half = std::abs(k * pT());
222  // center of helix in x,y plane
223  const float x_center = x() - k * py();
224  const float y_center = y() + k * px();
225  return std::hypot(x_center, y_center) + abs_ooc_half;
226  }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
int charge() const
Definition: Track.h:171
float pT() const
Definition: Track.h:157
float py() const
Definition: Track.h:155
float y() const
Definition: Track.h:147
constexpr float Bfield
Definition: Config.h:55
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
constexpr float sol
Definition: Config.h:13
float px() const
Definition: Track.h:154
float x() const
Definition: Track.h:146

◆ momentum()

SVector3 mkfit::TrackBase::momentum ( ) const
inline

Definition at line 144 of file Track.h.

References mkfit::TrackState::parameters, and state_.

TrackState state_
Definition: Track.h:340
ROOT::Math::SVector< float, 3 > SVector3
Definition: MatrixSTypes.h:14
SVector6 parameters
Definition: Track.h:48

◆ momEta()

float mkfit::TrackBase::momEta ( ) const
inline

◆ momPhi()

float mkfit::TrackBase::momPhi ( ) const
inline

◆ p()

float mkfit::TrackBase::p ( ) const
inline

◆ parameters()

const SVector6& mkfit::TrackBase::parameters ( void  ) const
inline

◆ parameters_nc()

SVector6& mkfit::TrackBase::parameters_nc ( )
inline

Definition at line 139 of file Track.h.

References mkfit::TrackState::parameters, and state_.

Referenced by mkfit::MkFinder::bkFitOutputTracks(), and mkfit::MkFinder::copy_out().

139 { return state_.parameters; }
TrackState state_
Definition: Track.h:340
SVector6 parameters
Definition: Track.h:48

◆ posArray()

const float* mkfit::TrackBase::posArray ( ) const
inline

Definition at line 135 of file Track.h.

References mkfit::TrackState::parameters, and state_.

135 { return state_.parameters.Array(); }
TrackState state_
Definition: Track.h:340
SVector6 parameters
Definition: Track.h:48

◆ posEta()

float mkfit::TrackBase::posEta ( ) const
inline

Definition at line 152 of file Track.h.

References mkfit::getEta(), mkfit::TrackState::parameters, and state_.

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

152 { return getEta(state_.parameters[0], state_.parameters[1], state_.parameters[2]); }
TrackState state_
Definition: Track.h:340
float getEta(float r, float z)
Definition: Hit.h:38
SVector6 parameters
Definition: Track.h:48

◆ position()

SVector3 mkfit::TrackBase::position ( ) const
inline

Definition at line 143 of file Track.h.

References mkfit::TrackState::parameters, and state_.

TrackState state_
Definition: Track.h:340
ROOT::Math::SVector< float, 3 > SVector3
Definition: MatrixSTypes.h:14
SVector6 parameters
Definition: Track.h:48

◆ posPhi()

float mkfit::TrackBase::posPhi ( ) const
inline

Definition at line 151 of file Track.h.

References mkfit::getPhi(), mkfit::TrackState::parameters, and state_.

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

151 { return getPhi(state_.parameters[0], state_.parameters[1]); }
TrackState state_
Definition: Track.h:340
SVector6 parameters
Definition: Track.h:48
float getPhi(float x, float y)
Definition: Hit.h:34

◆ posR()

float mkfit::TrackBase::posR ( ) const
inline

Definition at line 149 of file Track.h.

References mkfit::getHypot(), mkfit::TrackState::parameters, and state_.

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

149 { return getHypot(state_.parameters[0], state_.parameters[1]); }
TrackState state_
Definition: Track.h:340
float getHypot(float x, float y)
Definition: Hit.h:47
SVector6 parameters
Definition: Track.h:48

◆ posRsq()

float mkfit::TrackBase::posRsq ( ) const
inline

Definition at line 150 of file Track.h.

References mkfit::TrackState::posRsq(), and state_.

150 { return state_.posRsq(); }
TrackState state_
Definition: Track.h:340
float posRsq() const
Definition: Track.h:58

◆ prodType()

ProdType mkfit::TrackBase::prodType ( ) const
inline

◆ pT()

float mkfit::TrackBase::pT ( ) const
inline

◆ px()

float mkfit::TrackBase::px ( ) const
inline

Definition at line 154 of file Track.h.

References mkfit::TrackState::px(), and state_.

Referenced by d0BeamSpot(), maxReachRadius(), rAtZ(), and zAtR().

154 { return state_.px(); }
TrackState state_
Definition: Track.h:340
float px() const
Definition: Track.h:89

◆ py()

float mkfit::TrackBase::py ( ) const
inline

Definition at line 155 of file Track.h.

References mkfit::TrackState::py(), and state_.

Referenced by d0BeamSpot(), maxReachRadius(), rAtZ(), and zAtR().

155 { return state_.py(); }
TrackState state_
Definition: Track.h:340
float py() const
Definition: Track.h:90

◆ pz()

float mkfit::TrackBase::pz ( ) const
inline

Definition at line 156 of file Track.h.

References mkfit::TrackState::pz(), and state_.

Referenced by zAtR().

156 { return state_.pz(); }
TrackState state_
Definition: Track.h:340
float pz() const
Definition: Track.h:91

◆ rAtZ()

float mkfit::TrackBase::rAtZ ( float  Z) const

Definition at line 305 of file Track.cc.

References simBeamSpotPI::alpha, mkfit::Config::Bfield, charge(), funct::cos(), PVValHelper::dz, f, Matriplex::hypot(), invpT(), dqmdumpme::k, px(), py(), funct::sin(), mkfit::Const::sol, funct::tan(), theta(), x(), y(), beamSpotPI::Z, and z().

305  {
306  float xc = x();
307  float yc = y();
308  float pxc = px();
309  float pyc = py();
310 
311  const float ipt = invpT();
312  const float kinv = ((charge() < 0) ? 0.01f : -0.01f) * Const::sol * Config::Bfield;
313  const float k = 1.0f / kinv;
314 
315  const float dz = Z - z();
316  const float alpha = dz * ipt * kinv * std::tan(theta());
317 
318  const float cosa = std::cos(alpha);
319  const float sina = std::sin(alpha);
320 
321  xc += k * (pxc * sina - pyc * (1.0f - cosa));
322  yc += k * (pyc * sina + pxc * (1.0f - cosa));
323 
324  // const float pxo = pxc;//copy before overwriting
325  // pxc = pxc * cosa - pyc * sina;
326  // pyc = pyc * cosa + pxo * sina;
327 
328  return std::hypot(xc, yc);
329  }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
int charge() const
Definition: Track.h:171
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float invpT() const
Definition: Track.h:158
float theta() const
Definition: Track.h:162
float py() const
Definition: Track.h:155
float y() const
Definition: Track.h:147
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr float Bfield
Definition: Config.h:55
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double f[11][100]
constexpr float sol
Definition: Config.h:13
float z() const
Definition: Track.h:148
float px() const
Definition: Track.h:154
float x() const
Definition: Track.h:146

◆ score()

float mkfit::TrackBase::score ( ) const
inline

◆ setAlgoint()

void mkfit::TrackBase::setAlgoint ( int  algo)
inline

Definition at line 330 of file Track.h.

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

330 { status_.algorithm = algo; }
unsigned int algorithm
Definition: Track.h:220
Status status_
Definition: Track.h:345

◆ setAlgorithm()

void mkfit::TrackBase::setAlgorithm ( TrackAlgorithm  algo)
inline

Definition at line 329 of file Track.h.

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

329 { status_.algorithm = static_cast<unsigned int>(algo); }
unsigned int algorithm
Definition: Track.h:220
Status status_
Definition: Track.h:345

◆ setCharge()

void mkfit::TrackBase::setCharge ( int  chg)
inline

Definition at line 176 of file Track.h.

References mkfit::TrackState::charge, chg, and state_.

Referenced by mkfit::MkFinder::copy_out(), and mkfit::MkFinder::findCandidates().

176 { state_.charge = chg; }
TrackState state_
Definition: Track.h:340
const float chg[109]
Definition: CoreSimTrack.cc:5
short charge
Definition: Track.h:50

◆ setChi2()

void mkfit::TrackBase::setChi2 ( float  chi2)
inline

Definition at line 177 of file Track.h.

References chi2(), and chi2_.

Referenced by mkfit::MkFinder::bkFitOutputTracks(), and mkfit::MkFinder::copy_out().

177 { chi2_ = chi2; }
float chi2_
Definition: Track.h:341
float chi2() const
Definition: Track.h:172

◆ setDuplicateValue()

void mkfit::TrackBase::setDuplicateValue ( bool  d)
inline

Definition at line 255 of file Track.h.

References ztail::d, mkfit::TrackBase::Status::duplicate, and status_.

255 { status_.duplicate = d; }
Status status_
Definition: Track.h:345
d
Definition: ztail.py:151

◆ setEtaRegion()

void mkfit::TrackBase::setEtaRegion ( int  r)
inline

Definition at line 264 of file Track.h.

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

264 { status_.eta_region = r; }
Status status_
Definition: Track.h:345
unsigned int eta_region
Definition: Track.h:229

◆ setLabel()

void mkfit::TrackBase::setLabel ( int  lbl)
inline

Definition at line 179 of file Track.h.

References label_.

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

179 { label_ = lbl; }

◆ setNotFindable()

void mkfit::TrackBase::setNotFindable ( )
inline

Definition at line 253 of file Track.h.

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

253 { status_.not_findable = true; }
Status status_
Definition: Track.h:345

◆ setNSeedHits()

void mkfit::TrackBase::setNSeedHits ( int  n)
inline

◆ setProdType()

void mkfit::TrackBase::setProdType ( ProdType  ptyp)
inline

Definition at line 259 of file Track.h.

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

259 { status_.prod_type = static_cast<unsigned int>(ptyp); }
unsigned int prod_type
Definition: Track.h:212
Status status_
Definition: Track.h:345

◆ setScore()

void mkfit::TrackBase::setScore ( float  s)
inline

◆ setState()

void mkfit::TrackBase::setState ( const TrackState newState)
inline

Definition at line 130 of file Track.h.

References state_.

130 { state_ = newState; }
TrackState state_
Definition: Track.h:340

◆ setStatus()

void mkfit::TrackBase::setStatus ( Status  s)
inline

Definition at line 249 of file Track.h.

References alignCSCRings::s, and status_.

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

249 { status_ = s; }
Status status_
Definition: Track.h:345

◆ state()

const TrackState& mkfit::TrackBase::state ( ) const
inline

Definition at line 129 of file Track.h.

References state_.

Referenced by mkfit::print().

129 { return state_; }
TrackState state_
Definition: Track.h:340

◆ state_nc()

TrackState& mkfit::TrackBase::state_nc ( )
inline

Definition at line 141 of file Track.h.

References state_.

141 { return state_; }
TrackState state_
Definition: Track.h:340

◆ swimPhiToR()

float mkfit::TrackBase::swimPhiToR ( const float  x,
const float  y 
) const

Definition at line 203 of file Track.cc.

References funct::abs(), charge(), HGC3DClusterGenMatchSelector_cfi::dR, mkfit::getHypot(), momPhi(), mkfit::Const::PI, pT(), mkfit::squashPhiGeneral(), findQualityFiles::v, x(), and y().

203  {
204  const float dR = getHypot(x() - x0, y() - y0);
205  // XXX-ASSUMPTION-ERROR can not always reach R, should see what callers expect.
206  // For now return PI to signal apex on the ohter side of the helix.
207  const float v = dR / 176.f / pT() * charge();
208  const float dPhi = std::abs(v) <= 1.0f ? 2.f * std::asin(v) : Const::PI;
209  ;
210  return squashPhiGeneral(momPhi() - dPhi);
211  }
int charge() const
Definition: Track.h:171
float pT() const
Definition: Track.h:157
float squashPhiGeneral(float phi)
Definition: Hit.h:22
float y() const
Definition: Track.h:147
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float getHypot(float x, float y)
Definition: Hit.h:47
float x() const
Definition: Track.h:146
float momPhi() const
Definition: Track.h:160

◆ theta()

float mkfit::TrackBase::theta ( void  ) const
inline

Definition at line 162 of file Track.h.

References state_, and mkfit::TrackState::theta().

Referenced by mkfit::Event::clean_cms_seedtracks(), mkfit::StdSeq::clean_cms_seedtracks_iter(), rAtZ(), and Tau.Tau::zImpact().

162 { return state_.theta(); }
TrackState state_
Definition: Track.h:340
float theta() const
Definition: Track.h:87

◆ x()

float mkfit::TrackBase::x ( ) const
inline

◆ y()

float mkfit::TrackBase::y ( ) const
inline

◆ z()

float mkfit::TrackBase::z ( ) const
inline

◆ zAtR()

float mkfit::TrackBase::zAtR ( float  R,
float *  r_reached = nullptr 
) const

Definition at line 228 of file Track.cc.

References mkfit::Config::Bfield, DummyCfis::c, charge(), funct::cos(), f, Matriplex::hypot(), mps_fire::i, l1ctLayer2EG_cff::id, invpT(), dqmdumpme::k, mkfit::Config::Niter, px(), py(), pz(), dttmaxenums::R, funct::sin(), mkfit::Const::sol, x(), y(), and z().

228  {
229  float xc = x();
230  float yc = y();
231  float pxc = px();
232  float pyc = py();
233 
234  const float ipt = invpT();
235  const float kinv = ((charge() < 0) ? 0.01f : -0.01f) * Const::sol * Config::Bfield;
236  const float k = 1.0f / kinv;
237 
238  const float c = 0.5f * kinv * ipt;
239  const float ooc = 1.0f / c; // 2 * radius of curvature
240  const float lambda = pz() * ipt;
241 
242  //printf("Track::zAtR to R=%f: k=%e, ipt=%e, c=%e, ooc=%e -- can hit = %f (if > 1 can)\n",
243  // R, k, ipt, c, ooc, ooc / (R - std::hypot(xc,yc)));
244 
245  float D = 0;
246 
247  for (int i = 0; i < Config::Niter; ++i) {
248  // compute tangental and ideal distance for the current iteration.
249  // 3-rd order asin for symmetric incidence (shortest arc lenght).
250  float r0 = std::hypot(xc, yc);
251  float td = (R - r0) * c;
252  float id = ooc * td * (1.0f + 0.16666666f * td * td);
253  // This would be for line approximation:
254  // float id = R - r0;
255  D += id;
256 
257  //printf("%-3d r0=%f R-r0=%f td=%f id=%f id_line=%f delta_id=%g\n",
258  // i, r0, R-r0, td, id, R - r0, id - (R-r0));
259 
260  float cosa = std::cos(id * ipt * kinv);
261  float sina = std::sin(id * ipt * kinv);
262 
263  //update parameters
264  xc += k * (pxc * sina - pyc * (1.0f - cosa));
265  yc += k * (pyc * sina + pxc * (1.0f - cosa));
266 
267  const float pxo = pxc; //copy before overwriting
268  pxc = pxc * cosa - pyc * sina;
269  pyc = pyc * cosa + pxo * sina;
270  }
271 
272  if (r_reached)
273  *r_reached = std::hypot(xc, yc);
274 
275  return z() + lambda * D;
276 
277  // ----------------------------------------------------------------
278  // Exact solution from Avery's notes ... loses precision somewhere
279  // {
280  // const float a = kinv;
281  // float pT = S.pT();
282 
283  // float ax2y2 = a*(x*x + y*y);
284  // float T = std::sqrt(pT*pT - 2.0f*a*(x*py - y*px) + a*ax2y2);
285  // float D0 = (T - pT) / a;
286  // float D = (-2.0f * (x*py - y*px) + a * (x*x + y*y)) / (T + pT);
287 
288  // float B = c * std::sqrt((R*R - D*D) / (1.0f + 2.0f*c*D));
289  // float s1 = std::asin(B) / c;
290  // float s2 = (Const::PI - std::asin(B)) / c;
291 
292  // printf("pt %f, invpT %f\n", pT, S.invpT());
293  // printf("lambda %f, a %f, c %f, T %f, D0 %f, D %f, B %f, s1 %f, s2 %f\n",
294  // lambda, a, c, T, D0, D, B, s1, s2);
295  // printf("%f = %f / %f\n", (R*R - D*D) / (1.0f + 2.0f*c*D), (R*R - D*D), (1.0f + 2.0f*c*D));
296 
297  // z1 = S.z() + lambda * s1;
298  // z2 = S.z() + lambda * s2;
299 
300  // printf("z1=%f z2=%f\n", z1, z2);
301  // }
302  // ----------------------------------------------------------------
303  }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
int charge() const
Definition: Track.h:171
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float invpT() const
Definition: Track.h:158
float py() const
Definition: Track.h:155
float y() const
Definition: Track.h:147
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr float Bfield
Definition: Config.h:55
double f[11][100]
constexpr float sol
Definition: Config.h:13
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
float z() const
Definition: Track.h:148
float px() const
Definition: Track.h:154
float pz() const
Definition: Track.h:156
float x() const
Definition: Track.h:146
constexpr int Niter
Definition: Config.h:49

Member Data Documentation

◆ chi2_

float mkfit::TrackBase::chi2_ = 0.
protected

◆ label_

int mkfit::TrackBase::label_ = -1
protected

◆ lastHitIdx_

short int mkfit::TrackBase::lastHitIdx_ = -1
protected

◆ nFoundHits_

short int mkfit::TrackBase::nFoundHits_ = 0
protected

◆ score_

float mkfit::TrackBase::score_ = 0.
protected

Definition at line 342 of file Track.h.

Referenced by mkfit::TrackCand::resetShortTrack(), score(), and setScore().

◆ state_

TrackState mkfit::TrackBase::state_
protected

◆ status_

Status mkfit::TrackBase::status_
protected