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

Member Enumeration Documentation

◆ ProdType

Enumerator
NotSet 
Signal 
InTimePU 
OutOfTimePU 

Definition at line 271 of file Track.h.

271 { 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 286 of file Track.h.

286  {
287  undefAlgorithm = 0,
288  ctf = 1,
289  duplicateMerge = 2,
290  cosmics = 3,
291  initialStep = 4,
292  lowPtTripletStep = 5,
293  pixelPairStep = 6,
295  mixedTripletStep = 8,
296  pixelLessStep = 9,
297  tobTecStep = 10,
298  jetCoreRegionalStep = 11,
299  conversionStep = 12,
300  muonSeededStepInOut = 13,
301  muonSeededStepOutIn = 14,
302  outInEcalSeededConv = 15,
303  inOutEcalSeededConv = 16,
304  nuclInter = 17,
305  standAloneMuon = 18,
306  globalMuon = 19,
308  cosmicGlobalMuon = 21,
309  // Phase1
310  highPtTripletStep = 22,
311  lowPtQuadStep = 23,
312  detachedQuadStep = 24,
313  reservedForUpgrades1 = 25,
314  reservedForUpgrades2 = 26,
315  bTagGhostTracks = 27,
316  beamhalo = 28,
317  gsf = 29,
318  // HLT algo name
319  hltPixel = 30,
320  // steps used by PF
321  hltIter0 = 31,
322  hltIter1 = 32,
323  hltIter2 = 33,
324  hltIter3 = 34,
325  hltIter4 = 35,
326  // steps used by all other objects @HLT
327  hltIterX = 36,
328  // steps used by HI muon regional iterative tracking
335  hiRegitMuTobTecStep = 43,
338  algoSize = 46
339  };
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 136 of file Track.h.

136 {}

◆ TrackBase() [2/3]

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

Definition at line 138 of file Track.h.

138 : state_(state), chi2_(chi2), label_(label) {}
TrackState state_
Definition: Track.h:354
float chi2_
Definition: Track.h:355
float chi2() const
Definition: Track.h:186
int label() const
Definition: Track.h:188
const TrackState & state() const
Definition: Track.h:143

◆ TrackBase() [3/3]

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

Definition at line 140 of file Track.h.

int charge() const
Definition: Track.h:185
TrackState state_
Definition: Track.h:354
float chi2_
Definition: Track.h:355
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

◆ algoint()

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

Definition at line 341 of file Track.h.

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

341 { return status_.algorithm; }
unsigned int algorithm
Definition: Track.h:234
Status status_
Definition: Track.h:359

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

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

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

342 { return TrackAlgorithm(status_.algorithm); }
unsigned int algorithm
Definition: Track.h:234
Status status_
Definition: Track.h:359
TrackAlgorithm
track algorithm; copy from TrackBase.h to keep in standalone builds
Definition: Track.h:286

◆ 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:417
int charge() const
Definition: Track.h:185
float pT() const
Definition: Track.h:171
float y() const
Definition: Track.h:161
constexpr float Bfield
Definition: Config.h:53
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:160

◆ 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:417
int charge() const
Definition: Track.h:185
float pT() const
Definition: Track.h:171
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float py() const
Definition: Track.h:169
float y() const
Definition: Track.h:161
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr float Bfield
Definition: Config.h:53
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:168
float x() const
Definition: Track.h:160
float momPhi() const
Definition: Track.h:174

◆ emomEta()

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

Definition at line 181 of file Track.h.

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

181 { return state_.emomEta(); }
TrackState state_
Definition: Track.h:354
float emomEta() const
Definition: Track.h:113

◆ emomPhi()

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

Definition at line 180 of file Track.h.

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

180 { return state_.emomPhi(); }
TrackState state_
Definition: Track.h:354
float emomPhi() const
Definition: Track.h:110

◆ epT()

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

Definition at line 179 of file Track.h.

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

179 { return state_.epT(); }
float epT() const
Definition: Track.h:112
TrackState state_
Definition: Track.h:354

◆ errArray()

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

Definition at line 150 of file Track.h.

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

150 { return state_.errors.Array(); }
TrackState state_
Definition: Track.h:354
SMatrixSym66 errors
Definition: Track.h:63

◆ errors()

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

◆ errors_nc()

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

Definition at line 154 of file Track.h.

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

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

154 { return state_.errors; }
TrackState state_
Definition: Track.h:354
SMatrixSym66 errors
Definition: Track.h:63

◆ getDuplicateValue()

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

◆ getEtaRegion()

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

Definition at line 277 of file Track.h.

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

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

277 { return status_.eta_region; }
Status status_
Definition: Track.h:359
unsigned int eta_region
Definition: Track.h:243

◆ getNSeedHits()

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

◆ getStatus()

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

Definition at line 262 of file Track.h.

References status_.

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

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

◆ 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:354
SMatrixSym66 errors
Definition: Track.h:63
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:354
float pT() const
Definition: Track.h:171
int label() const
Definition: Track.h:188
SMatrixSym66 errors
Definition: Track.h:63
constexpr Matriplex::idx_t LL
Definition: Matrix.h:45
constexpr bool isFinite(float x)

◆ invpT()

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

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

172 { return state_.invpT(); }
TrackState state_
Definition: Track.h:354
float invpT() const
Definition: Track.h:99

◆ isFindable()

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

◆ isNotFindable()

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

Definition at line 266 of file Track.h.

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

266 { return status_.not_findable; }
Status status_
Definition: Track.h:359

◆ 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:417
int charge() const
Definition: Track.h:185
float pT() const
Definition: Track.h:171
float py() const
Definition: Track.h:169
float y() const
Definition: Track.h:161
constexpr float Bfield
Definition: Config.h:53
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:168
float x() const
Definition: Track.h:160

◆ momentum()

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

Definition at line 158 of file Track.h.

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

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

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

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

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

153 { return state_.parameters; }
TrackState state_
Definition: Track.h:354
SVector6 parameters
Definition: Track.h:62

◆ posArray()

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

Definition at line 149 of file Track.h.

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

149 { return state_.parameters.Array(); }
TrackState state_
Definition: Track.h:354
SVector6 parameters
Definition: Track.h:62

◆ posEta()

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

Definition at line 166 of file Track.h.

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

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

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

◆ position()

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

Definition at line 157 of file Track.h.

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

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

◆ posPhi()

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

Definition at line 165 of file Track.h.

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

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

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

◆ posR()

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

Definition at line 163 of file Track.h.

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

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

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

◆ posRsq()

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

Definition at line 164 of file Track.h.

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

164 { return state_.posRsq(); }
TrackState state_
Definition: Track.h:354
float posRsq() const
Definition: Track.h:72

◆ prodType()

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

◆ pT()

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

◆ px()

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

Definition at line 168 of file Track.h.

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

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

168 { return state_.px(); }
TrackState state_
Definition: Track.h:354
float px() const
Definition: Track.h:103

◆ py()

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

Definition at line 169 of file Track.h.

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

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

169 { return state_.py(); }
TrackState state_
Definition: Track.h:354
float py() const
Definition: Track.h:104

◆ pz()

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

Definition at line 170 of file Track.h.

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

Referenced by zAtR().

170 { return state_.pz(); }
TrackState state_
Definition: Track.h:354
float pz() const
Definition: Track.h:105

◆ 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:417
int charge() const
Definition: Track.h:185
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float invpT() const
Definition: Track.h:172
float theta() const
Definition: Track.h:176
float py() const
Definition: Track.h:169
float y() const
Definition: Track.h:161
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr float Bfield
Definition: Config.h:53
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:162
float px() const
Definition: Track.h:168
float x() const
Definition: Track.h:160

◆ score()

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

◆ setAlgoint()

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

Definition at line 344 of file Track.h.

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

344 { status_.algorithm = algo; }
unsigned int algorithm
Definition: Track.h:234
Status status_
Definition: Track.h:359

◆ setAlgorithm()

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

Definition at line 343 of file Track.h.

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

343 { status_.algorithm = static_cast<unsigned int>(algo); }
unsigned int algorithm
Definition: Track.h:234
Status status_
Definition: Track.h:359

◆ setCharge()

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

Definition at line 190 of file Track.h.

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

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

190 { state_.charge = chg; }
TrackState state_
Definition: Track.h:354
const float chg[109]
Definition: CoreSimTrack.cc:5
short charge
Definition: Track.h:64

◆ setChi2()

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

Definition at line 191 of file Track.h.

References chi2(), and chi2_.

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

191 { chi2_ = chi2; }
float chi2_
Definition: Track.h:355
float chi2() const
Definition: Track.h:186

◆ setDuplicateValue()

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

Definition at line 269 of file Track.h.

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

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

◆ setEtaRegion()

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

Definition at line 278 of file Track.h.

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

278 { status_.eta_region = r; }
Status status_
Definition: Track.h:359
unsigned int eta_region
Definition: Track.h:243

◆ setLabel()

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

Definition at line 193 of file Track.h.

References label_.

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

193 { label_ = lbl; }

◆ setNotFindable()

void mkfit::TrackBase::setNotFindable ( )
inline

Definition at line 267 of file Track.h.

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

267 { status_.not_findable = true; }
Status status_
Definition: Track.h:359

◆ setNSeedHits()

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

◆ setProdType()

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

Definition at line 273 of file Track.h.

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

273 { status_.prod_type = static_cast<unsigned int>(ptyp); }
unsigned int prod_type
Definition: Track.h:226
Status status_
Definition: Track.h:359

◆ setScore()

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

◆ setState()

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

Definition at line 144 of file Track.h.

References state_.

144 { state_ = newState; }
TrackState state_
Definition: Track.h:354

◆ setStatus()

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

Definition at line 263 of file Track.h.

References alignCSCRings::s, and status_.

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

263 { status_ = s; }
Status status_
Definition: Track.h:359

◆ state()

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

Definition at line 143 of file Track.h.

References state_.

Referenced by mkfit::print().

143 { return state_; }
TrackState state_
Definition: Track.h:354

◆ state_nc()

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

Definition at line 155 of file Track.h.

References state_.

155 { return state_; }
TrackState state_
Definition: Track.h:354

◆ 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:185
float pT() const
Definition: Track.h:171
float squashPhiGeneral(float phi)
Definition: Hit.h:22
float y() const
Definition: Track.h:161
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:160
float momPhi() const
Definition: Track.h:174

◆ theta()

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

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

176 { return state_.theta(); }
TrackState state_
Definition: Track.h:354
float theta() const
Definition: Track.h:101

◆ 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, HltBtagPostValidation_cff::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:417
int charge() const
Definition: Track.h:185
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float invpT() const
Definition: Track.h:172
float py() const
Definition: Track.h:169
float y() const
Definition: Track.h:161
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr float Bfield
Definition: Config.h:53
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:162
float px() const
Definition: Track.h:168
float pz() const
Definition: Track.h:170
float x() const
Definition: Track.h:160
constexpr int Niter
Definition: Config.h:49

Member Data Documentation

◆ chi2_

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

Definition at line 355 of file Track.h.

Referenced by mkfit::TrackCand::addHitIdx(), mkfit::Track::addHitIdx(), chi2(), and setChi2().

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

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

◆ state_

TrackState mkfit::TrackBase::state_
protected

◆ status_

Status mkfit::TrackBase::status_
protected