CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
tmtt::L1fittedTrack Class Reference

#include <L1fittedTrack.h>

Inheritance diagram for tmtt::L1fittedTrack:
tmtt::L1trackBase

Public Member Functions

bool accepted () const
 
std::pair< unsigned int, unsigned int > cellLocationFit () const
 
std::pair< unsigned int, unsigned int > cellLocationHT () const override
 
float charge () const
 
float charge_bcon () const
 
float chi2 () const
 
float chi2_bcon () const
 
float chi2dof () const
 
float chi2dof_bcon () const
 
float chi2rphi () const
 
float chi2rphi_bcon () const
 
float chi2rz () const
 
bool consistentHTcell () const
 
bool consistentSector () const
 
float d0 () const
 
float d0_bcon () const
 
const DigitalTrackdigitaltrack () const
 
void digitizeTrack (const std::string &fitterName)
 
bool done_bcon () const
 
float eta () const
 
unsigned int hitPattern () const
 
unsigned int iEtaReg () const override
 
void infoCHI2 () const
 
void infoKF (unsigned int &nSkippedLayers, unsigned int &numUpdateCalls) const
 
void infoLR (int &numIterations, std::string &lostMatchingState, std::unordered_map< std::string, int > &stateCalls) const
 
float invPt () const
 
float invPt_bcon () const
 
unsigned int iPhiSec () const override
 
 L1fittedTrack (const Settings *settings, const L1track3D *l1track3D, const std::vector< Stub *> &stubs, unsigned int hitPattern, float qOverPt, float d0, float phi0, float z0, float tanLambda, float chi2rphi, float chi2rz, unsigned int nHelixParam, bool accepted=true)
 
 L1fittedTrack ()
 
const L1track3Dl1track3D () const
 
const std::vector< const Stub * > & matchedStubs () const override
 
const TPmatchedTP () const override
 
float nHelixParam () const
 
unsigned int numDOF () const
 
unsigned int numDOF_bcon () const
 
unsigned int numDOFrphi () const
 
unsigned int numDOFrphi_bcon () const
 
unsigned int numDOFrz () const
 
unsigned int numKilledMatchedStubs () const
 
unsigned int numKilledStubs () const
 
unsigned int numLayers () const override
 
unsigned int numMatchedLayers () const override
 
unsigned int numMatchedStubs () const override
 
unsigned int numStubs () const override
 
unsigned int optoLinkID () const override
 
float phi0 () const override
 
float phi0_bcon () const
 
float phiAtChosenR (bool beamConstraint) const
 
float pt () const
 
float pt_bcon () const
 
float purity () const
 
float qOverPt () const override
 
float qOverPt_bcon () const
 
KFTrackletTrack returnKFTrackletTrack ()
 
void setBeamConstr (float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon, bool accepted)
 
void setConsistentHTcell ()
 
void setInfoCHI2 ()
 
void setInfoKF (unsigned int nSkippedLayers, unsigned int numUpdateCalls)
 
void setInfoLR (int numIterations, std::string lostMatchingState, std::unordered_map< std::string, int > stateCalls)
 
const std::vector< Stub * > & stubs () const override
 
const std::vector< const Stub * > & stubsConst () const override
 
float tanLambda () const
 
float theta () const
 
float z0 () const
 
float zAtChosenR () const
 
 ~L1fittedTrack () override=default
 
- Public Member Functions inherited from tmtt::L1trackBase
 L1trackBase ()
 
virtual ~L1trackBase ()=default
 

Private Attributes

bool accepted_
 
float chi2rphi_
 
float chi2rphi_bcon_
 
float chi2rz_
 
bool consistentCell_
 
float d0_
 
float d0_bcon_
 
std::shared_ptr< DigitalTrackdigitalTrack_
 
bool done_bcon_
 
unsigned int hitPattern_
 
std::shared_ptr< HTrphihtRphiTmp_
 
unsigned int iEtaReg_
 
unsigned int iPhiSec_
 
const L1track3Dl1track3D_
 
std::string lostMatchingState_
 
std::vector< const Stub * > matchedStubs_
 
const TPmatchedTP_
 
unsigned int nHelixParam_
 
unsigned int nLayers_
 
unsigned int nMatchedLayers_
 
unsigned int nSkippedLayers_
 
int numIterations_
 
unsigned int numUpdateCalls_
 
unsigned int optoLinkID_
 
float phi0_
 
float phi0_bcon_
 
float qOverPt_
 
float qOverPt_bcon_
 
std::shared_ptr< SectorsecTmp_
 
const Settingssettings_
 
std::unordered_map< std::string, int > stateCalls_
 
std::vector< Stub * > stubs_
 
std::vector< const Stub * > stubsConst_
 
float tanLambda_
 
float z0_
 

Static Private Attributes

static const std::vector< Stub * > noStubs_
 

Detailed Description

Definition at line 30 of file L1fittedTrack.h.

Constructor & Destructor Documentation

◆ L1fittedTrack() [1/2]

tmtt::L1fittedTrack::L1fittedTrack ( const Settings settings,
const L1track3D l1track3D,
const std::vector< Stub *> &  stubs,
unsigned int  hitPattern,
float  qOverPt,
float  d0,
float  phi0,
float  z0,
float  tanLambda,
float  chi2rphi,
float  chi2rz,
unsigned int  nHelixParam,
bool  accepted = true 
)
inline

Definition at line 37 of file L1fittedTrack.h.

References consistentCell_, tmtt::Utility::countLayers(), d0_, d0_bcon_, htRphiTmp_, tmtt::Settings::hybrid(), tmtt::L1track3D::iEtaReg(), iEtaReg_, tmtt::L1track3D::iPhiSec(), iPhiSec_, l1track3D(), matchedStubs_, matchedTP_, tmtt::Utility::matchingTP(), nHelixParam(), nLayers_, nMatchedLayers_, tmtt::L1track3D::optoLinkID(), optoLinkID_, secTmp_, setConsistentHTcell(), and stubs_.

50  : L1trackBase(),
51  settings_(settings),
53  stubs_(stubs),
54  stubsConst_(stubs_.begin(), stubs_.end()),
57  d0_(d0),
58  phi0_(phi0),
59  z0_(z0),
62  chi2rz_(chi2rz),
63  done_bcon_(false),
65  d0_bcon_(d0),
69  nSkippedLayers_(0),
70  numUpdateCalls_(0),
71  numIterations_(0),
73  if (l1track3D != nullptr) {
77  } else { // Rejected track
78  iPhiSec_ = 0;
79  iEtaReg_ = 0;
80  optoLinkID_ = 0;
81  }
82  if (settings != nullptr) {
83  // Count tracker layers these stubs are in
85  // Find associated truth particle & calculate info about match.
87  } else { // Rejected track
88  nLayers_ = 0;
89  matchedTP_ = nullptr;
90  }
91  // Set d0 = 0 for 4 param fit, in case fitter didn't do it.
92  if (nHelixParam == 4) {
93  d0_ = 0.;
94  d0_bcon_ = 0.;
95  }
96  if (settings != nullptr && not settings->hybrid()) {
97  //Sector class used to check if fitted track trajectory is in expected sector.
98  secTmp_ = std::make_shared<Sector>(settings, iPhiSec_, iEtaReg_);
99  // HT class used to identify HT cell that corresponds to fitted helix parameters.
100  htRphiTmp_ = std::make_shared<HTrphi>(
101  settings, iPhiSec_, iEtaReg_, secTmp_->etaMin(), secTmp_->etaMax(), secTmp_->phiCentre());
102  this->setConsistentHTcell();
103  } else {
104  consistentCell_ = false;
105  }
106  }
unsigned int iEtaReg() const override
Definition: L1track3D.h:175
float d0() const
unsigned int iPhiSec_
std::shared_ptr< HTrphi > htRphiTmp_
unsigned int nSkippedLayers_
const L1track3D * l1track3D() const
float tanLambda() const
unsigned int iEtaReg_
unsigned int iPhiSec() const override
Definition: L1track3D.h:174
float chi2rphi() const
unsigned int numUpdateCalls_
std::shared_ptr< Sector > secTmp_
float qOverPt() const override
const TP * matchingTP(const Settings *settings, const std::vector< const Stub *> &vstubs, unsigned int &nMatchedLayersBest, std::vector< const Stub *> &matchedStubsBest)
Definition: Utility.cc:63
float phi0() const override
std::vector< Stub * > stubs_
float nHelixParam() const
unsigned int nLayers_
unsigned int nMatchedLayers_
unsigned int hitPattern_
float chi2rz() const
const std::vector< Stub * > & stubs() const override
const L1track3D * l1track3D_
std::vector< const Stub * > matchedStubs_
bool accepted() const
unsigned int optoLinkID() const override
Definition: L1track3D.h:178
unsigned int nHelixParam_
unsigned int optoLinkID_
unsigned int hitPattern() const
unsigned int countLayers(const Settings *settings, const std::vector< const Stub *> &stubs, bool disableReducedLayerID=false, bool onlyPS=false)
Definition: Utility.cc:25
std::vector< const Stub * > stubsConst_
const Settings * settings_
float z0() const

◆ L1fittedTrack() [2/2]

tmtt::L1fittedTrack::L1fittedTrack ( )
inline

Definition at line 109 of file L1fittedTrack.h.

109 : L1fittedTrack(nullptr, nullptr, noStubs_, 0, 0., 0., 0., 0., 0., 0., 0., 0, false) {}
static const std::vector< Stub * > noStubs_

◆ ~L1fittedTrack()

tmtt::L1fittedTrack::~L1fittedTrack ( )
overridedefault

Member Function Documentation

◆ accepted()

bool tmtt::L1fittedTrack::accepted ( ) const
inline

◆ cellLocationFit()

std::pair<unsigned int, unsigned int> tmtt::L1fittedTrack::cellLocationFit ( ) const
inline

Definition at line 195 of file L1fittedTrack.h.

References htRphiTmp_.

Referenced by tmtt::SimpleLR4::fit(), and setConsistentHTcell().

195 { return htRphiTmp_->cell(this); }
std::shared_ptr< HTrphi > htRphiTmp_

◆ cellLocationHT()

std::pair<unsigned int, unsigned int> tmtt::L1fittedTrack::cellLocationHT ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 197 of file L1fittedTrack.h.

References tmtt::L1track3D::cellLocationHT(), and l1track3D_.

Referenced by tmtt::SimpleLR4::fit(), and setConsistentHTcell().

197 { return l1track3D_->cellLocationHT(); }
std::pair< unsigned int, unsigned int > cellLocationHT() const override
Definition: L1track3D.h:101
const L1track3D * l1track3D_

◆ charge()

float tmtt::L1fittedTrack::charge ( void  ) const
inline

Definition at line 229 of file L1fittedTrack.h.

References qOverPt_.

229 { return (qOverPt_ > 0 ? 1 : -1); }

◆ charge_bcon()

float tmtt::L1fittedTrack::charge_bcon ( ) const
inline

Definition at line 248 of file L1fittedTrack.h.

References qOverPt_bcon_.

248 { return (qOverPt_bcon_ > 0 ? 1 : -1); }

◆ chi2()

float tmtt::L1fittedTrack::chi2 ( void  ) const
inline

Definition at line 284 of file L1fittedTrack.h.

References chi2rphi_, and chi2rz_.

Referenced by chi2dof().

284 { return chi2rphi_ + chi2rz_; }

◆ chi2_bcon()

float tmtt::L1fittedTrack::chi2_bcon ( ) const
inline

Definition at line 292 of file L1fittedTrack.h.

References chi2rphi_bcon_, and chi2rz_.

Referenced by chi2dof_bcon().

◆ chi2dof()

float tmtt::L1fittedTrack::chi2dof ( ) const
inline

Definition at line 285 of file L1fittedTrack.h.

References chi2(), and numDOF().

285 { return (this->chi2()) / this->numDOF(); }
unsigned int numDOF() const
float chi2() const

◆ chi2dof_bcon()

float tmtt::L1fittedTrack::chi2dof_bcon ( ) const
inline

Definition at line 293 of file L1fittedTrack.h.

References chi2_bcon(), and numDOF_bcon().

293 { return (this->chi2_bcon()) / this->numDOF_bcon(); }
unsigned int numDOF_bcon() const
float chi2_bcon() const

◆ chi2rphi()

float tmtt::L1fittedTrack::chi2rphi ( ) const
inline

Definition at line 282 of file L1fittedTrack.h.

References chi2rphi_.

Referenced by tmtt::ConverterToTTTrack::makeTTTrack(), and returnKFTrackletTrack().

282 { return chi2rphi_; }

◆ chi2rphi_bcon()

float tmtt::L1fittedTrack::chi2rphi_bcon ( ) const
inline

Definition at line 291 of file L1fittedTrack.h.

References chi2rphi_bcon_.

Referenced by returnKFTrackletTrack(), and setBeamConstr().

291 { return chi2rphi_bcon_; }

◆ chi2rz()

float tmtt::L1fittedTrack::chi2rz ( ) const
inline

Definition at line 283 of file L1fittedTrack.h.

References chi2rz_.

Referenced by tmtt::ConverterToTTTrack::makeTTTrack(), and returnKFTrackletTrack().

283 { return chi2rz_; }

◆ consistentHTcell()

bool tmtt::L1fittedTrack::consistentHTcell ( ) const
inline

Definition at line 309 of file L1fittedTrack.h.

References consistentCell_.

309 { return consistentCell_; }

◆ consistentSector()

bool tmtt::L1fittedTrack::consistentSector ( ) const
inline

Definition at line 335 of file L1fittedTrack.h.

References funct::abs(), reco::deltaPhi(), done_bcon_, tmtt::Settings::hybrid(), iPhiSec(), M_PI, tmtt::Settings::numPhiSectors(), phiAtChosenR(), secTmp_, settings_, and zAtChosenR().

335  {
336  if (settings_->hybrid()) {
337  float phiCentre = 2. * M_PI * iPhiSec() / settings_->numPhiSectors();
338  float sectorHalfWidth = M_PI / settings_->numPhiSectors();
339  bool insidePhi = (std::abs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), phiCentre)) < sectorHalfWidth);
340  return insidePhi;
341  } else {
342  bool insidePhi = (std::abs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), secTmp_->phiCentre())) <
343  secTmp_->sectorHalfWidth());
344  bool insideEta =
345  (this->zAtChosenR() > secTmp_->zAtChosenR_Min() && this->zAtChosenR() < secTmp_->zAtChosenR_Max());
346  return (insidePhi && insideEta);
347  }
348  }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
float zAtChosenR() const
std::shared_ptr< Sector > secTmp_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
float phiAtChosenR(bool beamConstraint) const
unsigned int iPhiSec() const override
bool hybrid() const
Definition: Settings.h:409
unsigned int numPhiSectors() const
Definition: Settings.h:110
const Settings * settings_

◆ d0()

float tmtt::L1fittedTrack::d0 ( ) const
inline

Definition at line 236 of file L1fittedTrack.h.

References d0_.

Referenced by tmtt::ConverterToTTTrack::makeTTTrack(), and returnKFTrackletTrack().

236 { return d0_; }

◆ d0_bcon()

float tmtt::L1fittedTrack::d0_bcon ( ) const
inline

Definition at line 256 of file L1fittedTrack.h.

References d0_bcon_.

Referenced by returnKFTrackletTrack().

256 { return d0_bcon_; }

◆ digitaltrack()

const DigitalTrack* tmtt::L1fittedTrack::digitaltrack ( ) const
inline

Definition at line 354 of file L1fittedTrack.h.

References digitalTrack_.

Referenced by tmtt::SimpleLR4::fit().

354 { return digitalTrack_.get(); }
std::shared_ptr< DigitalTrack > digitalTrack_

◆ digitizeTrack()

void tmtt::L1fittedTrack::digitizeTrack ( const std::string &  fitterName)

Definition at line 12 of file L1fittedTrack.cc.

Referenced by tmtt::SimpleLR4::fit(), and tmtt::TMTrackProducer::produce().

12  {
13  if (settings_->enableDigitize()) {
14  if (not digitalTrack_) {
15  // Create & run digitizer.
16  digitalTrack_ = std::make_shared<DigitalTrack>(settings_, fitterName, this);
17 
18  // Convert digitized track params back to floating point with degraded resolution.
19  qOverPt_ = digitalTrack_->qOverPt();
20  if (nHelixParam_ == 5)
21  d0_ = digitalTrack_->d0();
22  phi0_ = digitalTrack_->phi0();
23  z0_ = digitalTrack_->z0();
24  tanLambda_ = digitalTrack_->tanLambda();
25  chi2rphi_ = digitalTrack_->chisquaredRphi();
26  chi2rz_ = digitalTrack_->chisquaredRz();
27 
28  // Ditto for beam-spot constrained values.
29  if (nHelixParam_ == 5) {
30  qOverPt_bcon_ = digitalTrack_->qOverPt_bcon();
31  phi0_bcon_ = digitalTrack_->phi0_bcon();
32  chi2rphi_bcon_ = digitalTrack_->chisquaredRphi_bcon();
33  }
34 
35  // Recalculate consistency flag using updated helix params.
36  this->setConsistentHTcell();
37  }
38  }
39  }
bool enableDigitize() const
Definition: Settings.h:80
std::shared_ptr< DigitalTrack > digitalTrack_
unsigned int nHelixParam_
const Settings * settings_

◆ done_bcon()

bool tmtt::L1fittedTrack::done_bcon ( ) const
inline

Definition at line 246 of file L1fittedTrack.h.

References done_bcon_.

Referenced by tmtt::HTrphi::cell(), and returnKFTrackletTrack().

246 { return done_bcon_; } // Was beam-spot constraint aplied?

◆ eta()

float tmtt::L1fittedTrack::eta ( void  ) const
inline

Definition at line 241 of file L1fittedTrack.h.

References CrabHelper::log, funct::tan(), and theta().

Referenced by Particle.Particle::__str__(), datamodel.Object::DeltaR(), Jet.Jet::jetID(), datamodel.Object::p4(), and Jet.Jet::puJetId().

241 { return -log(tan(0.5 * this->theta())); }
float theta() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22

◆ hitPattern()

unsigned int tmtt::L1fittedTrack::hitPattern ( ) const
inline

Definition at line 190 of file L1fittedTrack.h.

References hitPattern_.

Referenced by tmtt::ConverterToTTTrack::makeTTTrack(), and returnKFTrackletTrack().

190 { return hitPattern_; }
unsigned int hitPattern_

◆ iEtaReg()

unsigned int tmtt::L1fittedTrack::iEtaReg ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 297 of file L1fittedTrack.h.

References iEtaReg_.

Referenced by returnKFTrackletTrack().

297 { return iEtaReg_; }
unsigned int iEtaReg_

◆ infoCHI2()

void tmtt::L1fittedTrack::infoCHI2 ( ) const
inline

Definition at line 147 of file L1fittedTrack.h.

147 {}

◆ infoKF()

void tmtt::L1fittedTrack::infoKF ( unsigned int &  nSkippedLayers,
unsigned int &  numUpdateCalls 
) const
inline

Definition at line 136 of file L1fittedTrack.h.

References nSkippedLayers_, and numUpdateCalls_.

136  {
137  nSkippedLayers = nSkippedLayers_;
138  numUpdateCalls = numUpdateCalls_;
139  }
unsigned int nSkippedLayers_
unsigned int numUpdateCalls_

◆ infoLR()

void tmtt::L1fittedTrack::infoLR ( int &  numIterations,
std::string &  lostMatchingState,
std::unordered_map< std::string, int > &  stateCalls 
) const
inline

Definition at line 140 of file L1fittedTrack.h.

References lostMatchingState_, numIterations_, and stateCalls_.

142  {
143  numIterations = numIterations_;
144  lostMatchingState = lostMatchingState_;
145  stateCalls = stateCalls_;
146  }
std::unordered_map< std::string, int > stateCalls_
std::string lostMatchingState_

◆ invPt()

float tmtt::L1fittedTrack::invPt ( ) const
inline

Definition at line 230 of file L1fittedTrack.h.

References funct::abs(), and qOverPt_.

Referenced by pt().

230 { return std::abs(qOverPt_); }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ invPt_bcon()

float tmtt::L1fittedTrack::invPt_bcon ( ) const
inline

Definition at line 249 of file L1fittedTrack.h.

References funct::abs(), and qOverPt_bcon_.

Referenced by pt_bcon().

249 { return std::abs(qOverPt_bcon_); }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ iPhiSec()

unsigned int tmtt::L1fittedTrack::iPhiSec ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 296 of file L1fittedTrack.h.

References iPhiSec_.

Referenced by consistentSector(), and returnKFTrackletTrack().

296 { return iPhiSec_; }
unsigned int iPhiSec_

◆ l1track3D()

const L1track3D* tmtt::L1fittedTrack::l1track3D ( ) const
inline

Definition at line 178 of file L1fittedTrack.h.

References l1track3D_.

Referenced by L1fittedTrack(), and returnKFTrackletTrack().

178 { return l1track3D_; }
const L1track3D * l1track3D_

◆ matchedStubs()

const std::vector<const Stub*>& tmtt::L1fittedTrack::matchedStubs ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 205 of file L1fittedTrack.h.

References matchedStubs_.

205 { return matchedStubs_; }
std::vector< const Stub * > matchedStubs_

◆ matchedTP()

const TP* tmtt::L1fittedTrack::matchedTP ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 203 of file L1fittedTrack.h.

References matchedTP_.

Referenced by tmtt::DigitalTrack::DigitalTrack(), and tmtt::SimpleLR4::fit().

203 { return matchedTP_; }

◆ nHelixParam()

float tmtt::L1fittedTrack::nHelixParam ( ) const
inline

Definition at line 276 of file L1fittedTrack.h.

References nHelixParam_.

Referenced by L1fittedTrack(), tmtt::ConverterToTTTrack::makeTTTrack(), and returnKFTrackletTrack().

276 { return nHelixParam_; }
unsigned int nHelixParam_

◆ numDOF()

unsigned int tmtt::L1fittedTrack::numDOF ( ) const
inline

Definition at line 279 of file L1fittedTrack.h.

References nHelixParam_, and numStubs().

Referenced by chi2dof(), and numDOF_bcon().

279 { return 2 * this->numStubs() - nHelixParam_; }
unsigned int nHelixParam_
unsigned int numStubs() const override

◆ numDOF_bcon()

unsigned int tmtt::L1fittedTrack::numDOF_bcon ( ) const
inline

Definition at line 289 of file L1fittedTrack.h.

References numDOF().

Referenced by chi2dof_bcon().

289 { return (this->numDOF() - 1); }
unsigned int numDOF() const

◆ numDOFrphi()

unsigned int tmtt::L1fittedTrack::numDOFrphi ( ) const
inline

Definition at line 280 of file L1fittedTrack.h.

References nHelixParam_, and numStubs().

Referenced by numDOFrphi_bcon().

280 { return this->numStubs() - (nHelixParam_ - 2); }
unsigned int nHelixParam_
unsigned int numStubs() const override

◆ numDOFrphi_bcon()

unsigned int tmtt::L1fittedTrack::numDOFrphi_bcon ( ) const
inline

Definition at line 290 of file L1fittedTrack.h.

References numDOFrphi().

290 { return (this->numDOFrphi() - 1); }
unsigned int numDOFrphi() const

◆ numDOFrz()

unsigned int tmtt::L1fittedTrack::numDOFrz ( ) const
inline

Definition at line 281 of file L1fittedTrack.h.

References numStubs().

281 { return this->numStubs() - 2; }
unsigned int numStubs() const override

◆ numKilledMatchedStubs()

unsigned int tmtt::L1fittedTrack::numKilledMatchedStubs ( ) const
inline

Definition at line 213 of file L1fittedTrack.h.

References l1track3D_, tmtt::L1track3D::matchedTP(), tmtt::L1track3D::numMatchedStubs(), alignCSCRings::s, stubs_, and cmsswSequenceInfo::tp.

213  {
214  unsigned int nStubCount = l1track3D_->numMatchedStubs();
215  if (nStubCount > 0) { // Original HT track candidate did match a truth particle
216  const TP* tp = l1track3D_->matchedTP();
217  for (const Stub* s : stubs_) {
218  std::set<const TP*> assTPs = s->assocTPs();
219  if (assTPs.find(tp) != assTPs.end())
220  nStubCount--; // We found a stub matched to original truth particle that survived fit.
221  }
222  }
223  return nStubCount;
224  }
unsigned int numMatchedStubs() const override
Definition: L1track3D.h:190
const TP * matchedTP() const override
Definition: L1track3D.h:186
std::vector< Stub * > stubs_
const L1track3D * l1track3D_

◆ numKilledStubs()

unsigned int tmtt::L1fittedTrack::numKilledStubs ( ) const
inline

Definition at line 188 of file L1fittedTrack.h.

References l1track3D_, tmtt::L1track3D::numStubs(), and numStubs().

188 { return l1track3D_->numStubs() - this->numStubs(); }
const L1track3D * l1track3D_
unsigned int numStubs() const override
Definition: L1track3D.h:97
unsigned int numStubs() const override

◆ numLayers()

unsigned int tmtt::L1fittedTrack::numLayers ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 186 of file L1fittedTrack.h.

References nLayers_.

Referenced by tmtt::SimpleLR4::fit().

186 { return nLayers_; }
unsigned int nLayers_

◆ numMatchedLayers()

unsigned int tmtt::L1fittedTrack::numMatchedLayers ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 209 of file L1fittedTrack.h.

References nMatchedLayers_.

209 { return nMatchedLayers_; }
unsigned int nMatchedLayers_

◆ numMatchedStubs()

unsigned int tmtt::L1fittedTrack::numMatchedStubs ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 207 of file L1fittedTrack.h.

References matchedStubs_.

Referenced by purity().

207 { return matchedStubs_.size(); }
std::vector< const Stub * > matchedStubs_

◆ numStubs()

unsigned int tmtt::L1fittedTrack::numStubs ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 184 of file L1fittedTrack.h.

References stubs_.

Referenced by numDOF(), numDOFrphi(), numDOFrz(), numKilledStubs(), and purity().

184 { return stubs_.size(); }
std::vector< Stub * > stubs_

◆ optoLinkID()

unsigned int tmtt::L1fittedTrack::optoLinkID ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 300 of file L1fittedTrack.h.

References optoLinkID_.

300 { return optoLinkID_; }
unsigned int optoLinkID_

◆ phi0()

float tmtt::L1fittedTrack::phi0 ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 237 of file L1fittedTrack.h.

References phi0_.

Referenced by tmtt::DigitalTrack::DigitalTrack(), and returnKFTrackletTrack().

237 { return phi0_; }

◆ phi0_bcon()

float tmtt::L1fittedTrack::phi0_bcon ( ) const
inline

Definition at line 255 of file L1fittedTrack.h.

References phi0_bcon_.

Referenced by tmtt::DigitalTrack::DigitalTrack(), returnKFTrackletTrack(), and setBeamConstr().

255 { return phi0_bcon_; }

◆ phiAtChosenR()

float tmtt::L1fittedTrack::phiAtChosenR ( bool  beamConstraint) const
inline

Definition at line 260 of file L1fittedTrack.h.

References tmtt::Settings::chosenRofPhi(), d0_, d0_bcon_, reco::deltaPhi(), tmtt::Settings::invPtToDphi(), phi0_, phi0_bcon_, qOverPt_, qOverPt_bcon_, and settings_.

Referenced by tmtt::HTrphi::cell(), and consistentSector().

260  {
261  if (beamConstraint) {
264  0.);
265  } else {
267  d0_ / (settings_->chosenRofPhi()),
268  0.);
269  }
270  }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
double invPtToDphi() const
Definition: Settings.h:397
double chosenRofPhi() const
Definition: Settings.h:112
const Settings * settings_

◆ pt()

float tmtt::L1fittedTrack::pt ( ) const
inline

◆ pt_bcon()

float tmtt::L1fittedTrack::pt_bcon ( ) const
inline

Definition at line 251 of file L1fittedTrack.h.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), and invPt_bcon().

251  {
252  constexpr float small = 1.0e-6;
253  return 1. / (small + this->invPt_bcon());
254  }
float invPt_bcon() const

◆ purity()

float tmtt::L1fittedTrack::purity ( ) const
inline

Definition at line 211 of file L1fittedTrack.h.

References ALCARECOEcalPhiSym_cff::float, numMatchedStubs(), and numStubs().

211 { return numMatchedStubs() / float(numStubs()); }
unsigned int numMatchedStubs() const override
unsigned int numStubs() const override

◆ qOverPt()

float tmtt::L1fittedTrack::qOverPt ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 228 of file L1fittedTrack.h.

References qOverPt_.

Referenced by tmtt::HTrphi::cell(), tmtt::SimpleLR4::fit(), and returnKFTrackletTrack().

228 { return qOverPt_; }

◆ qOverPt_bcon()

float tmtt::L1fittedTrack::qOverPt_bcon ( ) const
inline

Definition at line 247 of file L1fittedTrack.h.

References qOverPt_bcon_.

Referenced by tmtt::HTrphi::cell(), returnKFTrackletTrack(), and setBeamConstr().

247 { return qOverPt_bcon_; }

◆ returnKFTrackletTrack()

KFTrackletTrack tmtt::L1fittedTrack::returnKFTrackletTrack ( )
inline

Definition at line 151 of file L1fittedTrack.h.

References accepted(), chi2rphi(), chi2rphi_bcon(), chi2rz(), d0(), d0_bcon(), done_bcon(), hitPattern(), iEtaReg(), iPhiSec(), l1track3D(), nHelixParam(), phi0(), phi0_bcon(), qOverPt(), qOverPt_bcon(), stubsConst(), tanLambda(), and z0().

151  {
152  KFTrackletTrack trk_(l1track3D(),
153  stubsConst(),
154  hitPattern(),
155  qOverPt(),
156  d0(),
157  phi0(),
158  z0(),
159  tanLambda(),
160  chi2rphi(),
161  chi2rz(),
162  nHelixParam(),
163  iPhiSec(),
164  iEtaReg(),
165  accepted(),
166  done_bcon(),
167  qOverPt_bcon(),
168  d0_bcon(),
169  phi0_bcon(),
170  chi2rphi_bcon());
171  return trk_;
172  }
bool done_bcon() const
unsigned int iEtaReg() const override
float d0() const
const L1track3D * l1track3D() const
float qOverPt_bcon() const
float tanLambda() const
float chi2rphi() const
float phi0_bcon() const
float qOverPt() const override
float phi0() const override
float chi2rphi_bcon() const
float nHelixParam() const
const std::vector< const Stub * > & stubsConst() const override
float chi2rz() const
unsigned int iPhiSec() const override
bool accepted() const
unsigned int hitPattern() const
float d0_bcon() const
float z0() const

◆ setBeamConstr()

void tmtt::L1fittedTrack::setBeamConstr ( float  qOverPt_bcon,
float  phi0_bcon,
float  chi2rphi_bcon,
bool  accepted 
)
inline

◆ setConsistentHTcell()

void tmtt::L1fittedTrack::setConsistentHTcell ( )
inline

Definition at line 312 of file L1fittedTrack.h.

References cellLocationFit(), cellLocationHT(), consistentCell_, l1track3D_, and tmtt::L1track3D::mergedHTcell().

Referenced by L1fittedTrack().

312  {
313  // Use helix params with beam-spot constaint if done in case of 5 param fit.
314 
315  std::pair<unsigned int, unsigned int> htCell = this->cellLocationHT();
316  bool consistent = (htCell == this->cellLocationFit());
317 
318  if (l1track3D_->mergedHTcell()) {
319  // If this is a merged cell, check other elements of merged cell.
320  std::pair<unsigned int, unsigned int> htCell10(htCell.first + 1, htCell.second);
321  std::pair<unsigned int, unsigned int> htCell01(htCell.first, htCell.second + 1);
322  std::pair<unsigned int, unsigned int> htCell11(htCell.first + 1, htCell.second + 1);
323  if (htCell10 == this->cellLocationFit())
324  consistent = true;
325  if (htCell01 == this->cellLocationFit())
326  consistent = true;
327  if (htCell11 == this->cellLocationFit())
328  consistent = true;
329  }
330 
331  consistentCell_ = consistent;
332  }
std::pair< unsigned int, unsigned int > cellLocationHT() const override
bool mergedHTcell() const
Definition: L1track3D.h:181
std::pair< unsigned int, unsigned int > cellLocationFit() const
const L1track3D * l1track3D_

◆ setInfoCHI2()

void tmtt::L1fittedTrack::setInfoCHI2 ( )
inline

Definition at line 134 of file L1fittedTrack.h.

134 {}

◆ setInfoKF()

void tmtt::L1fittedTrack::setInfoKF ( unsigned int  nSkippedLayers,
unsigned int  numUpdateCalls 
)
inline

Definition at line 125 of file L1fittedTrack.h.

References nSkippedLayers_, and numUpdateCalls_.

Referenced by tmtt::KFbase::fit().

125  {
126  nSkippedLayers_ = nSkippedLayers;
127  numUpdateCalls_ = numUpdateCalls;
128  }
unsigned int nSkippedLayers_
unsigned int numUpdateCalls_

◆ setInfoLR()

void tmtt::L1fittedTrack::setInfoLR ( int  numIterations,
std::string  lostMatchingState,
std::unordered_map< std::string, int >  stateCalls 
)
inline

Definition at line 129 of file L1fittedTrack.h.

References lostMatchingState_, numIterations_, and stateCalls_.

129  {
130  numIterations_ = numIterations;
131  lostMatchingState_ = lostMatchingState;
132  stateCalls_ = stateCalls;
133  }
std::unordered_map< std::string, int > stateCalls_
std::string lostMatchingState_

◆ stubs()

const std::vector<Stub*>& tmtt::L1fittedTrack::stubs ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 182 of file L1fittedTrack.h.

References stubs_.

182 { return stubs_; }
std::vector< Stub * > stubs_

◆ stubsConst()

const std::vector<const Stub*>& tmtt::L1fittedTrack::stubsConst ( ) const
inlineoverridevirtual

Implements tmtt::L1trackBase.

Definition at line 181 of file L1fittedTrack.h.

References stubsConst_.

Referenced by returnKFTrackletTrack().

181 { return stubsConst_; }
std::vector< const Stub * > stubsConst_

◆ tanLambda()

float tmtt::L1fittedTrack::tanLambda ( ) const
inline

Definition at line 239 of file L1fittedTrack.h.

References tanLambda_.

Referenced by tmtt::ConverterToTTTrack::makeTTTrack(), and returnKFTrackletTrack().

239 { return tanLambda_; }

◆ theta()

float tmtt::L1fittedTrack::theta ( void  ) const
inline

Definition at line 240 of file L1fittedTrack.h.

References tanLambda_.

Referenced by eta(), and Tau.Tau::zImpact().

240 { return atan2(1., tanLambda_); } // Use atan2 to ensure 0 < theta < pi.

◆ z0()

float tmtt::L1fittedTrack::z0 ( ) const
inline

Definition at line 238 of file L1fittedTrack.h.

References z0_.

Referenced by tmtt::ConverterToTTTrack::makeTTTrack(), and returnKFTrackletTrack().

238 { return z0_; }

◆ zAtChosenR()

float tmtt::L1fittedTrack::zAtChosenR ( ) const
inline

Definition at line 271 of file L1fittedTrack.h.

References tmtt::Settings::chosenRofZ(), settings_, tanLambda_, and z0_.

Referenced by consistentSector().

271  {
272  return (z0_ + (settings_->chosenRofZ()) * tanLambda_);
273  } // neglects transverse impact parameter & track curvature.
double chosenRofZ() const
Definition: Settings.h:127
const Settings * settings_

Member Data Documentation

◆ accepted_

bool tmtt::L1fittedTrack::accepted_
private

Definition at line 421 of file L1fittedTrack.h.

Referenced by accepted(), and setBeamConstr().

◆ chi2rphi_

float tmtt::L1fittedTrack::chi2rphi_
private

Definition at line 377 of file L1fittedTrack.h.

Referenced by chi2(), and chi2rphi().

◆ chi2rphi_bcon_

float tmtt::L1fittedTrack::chi2rphi_bcon_
private

Definition at line 385 of file L1fittedTrack.h.

Referenced by chi2_bcon(), chi2rphi_bcon(), and setBeamConstr().

◆ chi2rz_

float tmtt::L1fittedTrack::chi2rz_
private

Definition at line 378 of file L1fittedTrack.h.

Referenced by chi2(), chi2_bcon(), and chi2rz().

◆ consistentCell_

bool tmtt::L1fittedTrack::consistentCell_
private

Definition at line 418 of file L1fittedTrack.h.

Referenced by consistentHTcell(), L1fittedTrack(), and setConsistentHTcell().

◆ d0_

float tmtt::L1fittedTrack::d0_
private

Definition at line 373 of file L1fittedTrack.h.

Referenced by d0(), L1fittedTrack(), and phiAtChosenR().

◆ d0_bcon_

float tmtt::L1fittedTrack::d0_bcon_
private

Definition at line 383 of file L1fittedTrack.h.

Referenced by d0_bcon(), L1fittedTrack(), phiAtChosenR(), and setBeamConstr().

◆ digitalTrack_

std::shared_ptr<DigitalTrack> tmtt::L1fittedTrack::digitalTrack_
private

Definition at line 414 of file L1fittedTrack.h.

Referenced by digitaltrack().

◆ done_bcon_

bool tmtt::L1fittedTrack::done_bcon_
private

Definition at line 381 of file L1fittedTrack.h.

Referenced by consistentSector(), done_bcon(), and setBeamConstr().

◆ hitPattern_

unsigned int tmtt::L1fittedTrack::hitPattern_
private

Definition at line 369 of file L1fittedTrack.h.

Referenced by hitPattern().

◆ htRphiTmp_

std::shared_ptr<HTrphi> tmtt::L1fittedTrack::htRphiTmp_
private

Definition at line 404 of file L1fittedTrack.h.

Referenced by cellLocationFit(), and L1fittedTrack().

◆ iEtaReg_

unsigned int tmtt::L1fittedTrack::iEtaReg_
private

Definition at line 392 of file L1fittedTrack.h.

Referenced by iEtaReg(), and L1fittedTrack().

◆ iPhiSec_

unsigned int tmtt::L1fittedTrack::iPhiSec_
private

Definition at line 391 of file L1fittedTrack.h.

Referenced by iPhiSec(), and L1fittedTrack().

◆ l1track3D_

const L1track3D* tmtt::L1fittedTrack::l1track3D_
private

◆ lostMatchingState_

std::string tmtt::L1fittedTrack::lostMatchingState_
private

Definition at line 411 of file L1fittedTrack.h.

Referenced by infoLR(), and setInfoLR().

◆ matchedStubs_

std::vector<const Stub*> tmtt::L1fittedTrack::matchedStubs_
private

Definition at line 398 of file L1fittedTrack.h.

Referenced by L1fittedTrack(), matchedStubs(), and numMatchedStubs().

◆ matchedTP_

const TP* tmtt::L1fittedTrack::matchedTP_
private

Definition at line 397 of file L1fittedTrack.h.

Referenced by L1fittedTrack(), and matchedTP().

◆ nHelixParam_

unsigned int tmtt::L1fittedTrack::nHelixParam_
private

Definition at line 388 of file L1fittedTrack.h.

Referenced by nHelixParam(), numDOF(), and numDOFrphi().

◆ nLayers_

unsigned int tmtt::L1fittedTrack::nLayers_
private

Definition at line 366 of file L1fittedTrack.h.

Referenced by L1fittedTrack(), and numLayers().

◆ nMatchedLayers_

unsigned int tmtt::L1fittedTrack::nMatchedLayers_
private

Definition at line 399 of file L1fittedTrack.h.

Referenced by L1fittedTrack(), and numMatchedLayers().

◆ noStubs_

const std::vector< Stub * > tmtt::L1fittedTrack::noStubs_
staticprivate

Definition at line 416 of file L1fittedTrack.h.

◆ nSkippedLayers_

unsigned int tmtt::L1fittedTrack::nSkippedLayers_
private

Definition at line 407 of file L1fittedTrack.h.

Referenced by infoKF(), and setInfoKF().

◆ numIterations_

int tmtt::L1fittedTrack::numIterations_
private

Definition at line 410 of file L1fittedTrack.h.

Referenced by infoLR(), and setInfoLR().

◆ numUpdateCalls_

unsigned int tmtt::L1fittedTrack::numUpdateCalls_
private

Definition at line 408 of file L1fittedTrack.h.

Referenced by infoKF(), and setInfoKF().

◆ optoLinkID_

unsigned int tmtt::L1fittedTrack::optoLinkID_
private

Definition at line 394 of file L1fittedTrack.h.

Referenced by L1fittedTrack(), and optoLinkID().

◆ phi0_

float tmtt::L1fittedTrack::phi0_
private

Definition at line 374 of file L1fittedTrack.h.

Referenced by phi0(), and phiAtChosenR().

◆ phi0_bcon_

float tmtt::L1fittedTrack::phi0_bcon_
private

Definition at line 384 of file L1fittedTrack.h.

Referenced by phi0_bcon(), phiAtChosenR(), and setBeamConstr().

◆ qOverPt_

float tmtt::L1fittedTrack::qOverPt_
private

Definition at line 372 of file L1fittedTrack.h.

Referenced by charge(), invPt(), phiAtChosenR(), and qOverPt().

◆ qOverPt_bcon_

float tmtt::L1fittedTrack::qOverPt_bcon_
private

Definition at line 382 of file L1fittedTrack.h.

Referenced by charge_bcon(), invPt_bcon(), phiAtChosenR(), qOverPt_bcon(), and setBeamConstr().

◆ secTmp_

std::shared_ptr<Sector> tmtt::L1fittedTrack::secTmp_
private

Definition at line 402 of file L1fittedTrack.h.

Referenced by consistentSector(), and L1fittedTrack().

◆ settings_

const Settings* tmtt::L1fittedTrack::settings_
private

Definition at line 358 of file L1fittedTrack.h.

Referenced by consistentSector(), phiAtChosenR(), and zAtChosenR().

◆ stateCalls_

std::unordered_map<std::string, int> tmtt::L1fittedTrack::stateCalls_
private

Definition at line 412 of file L1fittedTrack.h.

Referenced by infoLR(), and setInfoLR().

◆ stubs_

std::vector<Stub*> tmtt::L1fittedTrack::stubs_
private

Definition at line 364 of file L1fittedTrack.h.

Referenced by L1fittedTrack(), numKilledMatchedStubs(), numStubs(), and stubs().

◆ stubsConst_

std::vector<const Stub*> tmtt::L1fittedTrack::stubsConst_
private

Definition at line 365 of file L1fittedTrack.h.

Referenced by stubsConst().

◆ tanLambda_

float tmtt::L1fittedTrack::tanLambda_
private

Definition at line 376 of file L1fittedTrack.h.

Referenced by tanLambda(), theta(), and zAtChosenR().

◆ z0_

float tmtt::L1fittedTrack::z0_
private

Definition at line 375 of file L1fittedTrack.h.

Referenced by z0(), and zAtChosenR().