CMS 3D CMS Logo

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

#include <Make3Dtracks.h>

Public Member Functions

std::vector< const L1track3D * > assocTrackCands3D (const TP &tp, bool rzFiltered) const
 
 Make3Dtracks (const Settings *settings, unsigned int iPhiSec, unsigned int iEtaReg, float etaMinSector, float etaMaxSector, float phiCentreSector)
 
bool ranRZfilter () const
 
void run (const std::list< L1track2D > &vecTracksRphi)
 
const TrkRZfilterrzFilter () const
 
const std::list< L1track3D > & trackCands3D (bool rzFiltered) const
 

Private Member Functions

void makeRZfilteredTrks (const std::list< L1track2D > &vecTracksRphi)
 
void makeUnfilteredTrks (const std::list< L1track2D > &vecTracksRphi)
 

Private Attributes

float etaMaxSector_
 
float etaMinSector_
 
unsigned int iEtaReg_
 
unsigned int iPhiSec_
 
float phiCentreSector_
 
bool runRZfilter_
 
std::unique_ptr< TrkRZfilterrzFilter_
 
const Settingssettings_
 
std::list< L1track3DvecTracks3D_rzFiltered_
 
std::list< L1track3DvecTracks3D_unfiltered_
 

Detailed Description

Definition at line 25 of file Make3Dtracks.h.

Constructor & Destructor Documentation

◆ Make3Dtracks()

tmtt::Make3Dtracks::Make3Dtracks ( const Settings settings,
unsigned int  iPhiSec,
unsigned int  iEtaReg,
float  etaMinSector,
float  etaMaxSector,
float  phiCentreSector 
)

Definition at line 16 of file Make3Dtracks.cc.

22  : // Store config params & arguments.
23  settings_(settings),
24  iPhiSec_(iPhiSec), // Sector number
25  iEtaReg_(iEtaReg),
26  etaMinSector_(etaMinSector), // Range of eta sector
27  etaMaxSector_(etaMaxSector), // Range of eta sector
28  phiCentreSector_(phiCentreSector), // Centre of phi sector
29 
30  // Note if any fitters require an r-z track filter to be run.
31  runRZfilter_(not settings->useRZfilter().empty()) {
32  // Initialize any track filters (e.g. r-z) run after the r-phi Hough transform.
33  if (runRZfilter_)
34  rzFilter_ =
35  std::make_unique<TrkRZfilter>(settings_, iPhiSec_, iEtaReg_, etaMinSector_, etaMaxSector_, phiCentreSector_);
36  }

References etaMaxSector_, etaMinSector_, iEtaReg_, iPhiSec_, phiCentreSector_, runRZfilter_, rzFilter_, and settings_.

Member Function Documentation

◆ assocTrackCands3D()

vector< const L1track3D * > tmtt::Make3Dtracks::assocTrackCands3D ( const TP tp,
bool  rzFiltered 
) const

Definition at line 113 of file Make3Dtracks.cc.

113  {
114  const list<L1track3D>& allTracks3D = (rzFiltered) ? vecTracks3D_rzFiltered_ : vecTracks3D_unfiltered_;
115 
116  vector<const L1track3D*> assocRecoTrk;
117 
118  // Loop over track candidates, looking for those associated to given TP.
119  for (const L1track3D& trk : allTracks3D) {
120  if (trk.matchedTP() != nullptr) {
121  if (trk.matchedTP()->index() == tp.index())
122  assocRecoTrk.push_back(&trk);
123  }
124  }
125 
126  return assocRecoTrk;
127  }

References cmsswSequenceInfo::tp, vecTracks3D_rzFiltered_, and vecTracks3D_unfiltered_.

◆ makeRZfilteredTrks()

void tmtt::Make3Dtracks::makeRZfilteredTrks ( const std::list< L1track2D > &  vecTracksRphi)
private

Definition at line 92 of file Make3Dtracks.cc.

92  {
93  vecTracks3D_rzFiltered_ = rzFilter_->filterTracks(vecTracksRphi);
94 
95  // Optionally use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks
96  // before doing fit (for debugging).
97  if (settings_->trackFitCheat()) {
98  list<L1track3D> vecTracks3D_tmp;
99  for (const L1track3D& trk : vecTracks3D_rzFiltered_) {
100  L1track3D trk_tmp = trk;
101  bool cheat_keep = trk_tmp.cheat();
102  if (cheat_keep)
103  vecTracks3D_tmp.push_back(trk_tmp);
104  }
105  vecTracks3D_rzFiltered_ = vecTracks3D_tmp;
106  }
107  }

References tmtt::L1track3D::cheat(), rzFilter_, settings_, tmtt::Settings::trackFitCheat(), and vecTracks3D_rzFiltered_.

Referenced by run().

◆ makeUnfilteredTrks()

void tmtt::Make3Dtracks::makeUnfilteredTrks ( const std::list< L1track2D > &  vecTracksRphi)
private

Definition at line 41 of file Make3Dtracks.cc.

41  {
43 
44  for (const L1track2D& trkRphi : vecTracksRphi) {
45  const vector<Stub*>& stubsOnTrkRphi = trkRphi.stubs(); // stubs assigned to track
46 
47  float qOverPt = trkRphi.helix2D().first;
48  float phi0 = trkRphi.helix2D().second;
49 
50  if (settings_->enableDigitize()) {
51  // Centre of HT bin lies on boundary of two fitted track digi bins, so nudge slightly +ve (like FW)
52  // to remove ambiguity.
53  const float small = 0.1;
54  const unsigned int nHelixBits = 18; // Bits used internally in KF HLS to represent helix params.
55  qOverPt += (2. / settings_->invPtToInvR()) * small * settings_->kf_oneOver2rRange() / pow(2., nHelixBits);
56  phi0 += small * settings_->kf_phi0Range() / pow(2., nHelixBits);
57  }
58  pair<float, float> helixRphi(qOverPt, phi0);
59 
60  // Estimate r-z track helix parameters from centre of eta sector.
61  float z0 = 0.;
62  float tan_lambda = 0.5 * (1 / tan(2 * atan(exp(-etaMinSector_))) + 1 / tan(2 * atan(exp(-etaMaxSector_))));
63 
64  pair<float, float> helixRz(z0, tan_lambda);
65 
66  // Create 3D track, by adding r-z helix params to 2D track
67  L1track3D trk3D(settings_,
68  stubsOnTrkRphi,
69  trkRphi.cellLocationHT(),
70  helixRphi,
71  helixRz,
72  iPhiSec_,
73  iEtaReg_,
74  trkRphi.optoLinkID(),
75  trkRphi.mergedHTcell());
76 
77  // Optionally use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks
78  // before doing fit (for debugging).
79  bool cheat_keep = true;
80  if (settings_->trackFitCheat())
81  cheat_keep = trk3D.cheat();
82 
83  // Add to list of stored 3D tracks.
84  if (cheat_keep)
85  vecTracks3D_unfiltered_.push_back(trk3D);
86  }
87  }

References tmtt::L1track3D::cheat(), tmtt::Settings::enableDigitize(), etaMaxSector_, etaMinSector_, JetChargeProducer_cfi::exp, iEtaReg_, tmtt::Settings::invPtToInvR(), iPhiSec_, tmtt::Settings::kf_oneOver2rRange(), tmtt::Settings::kf_phi0Range(), funct::pow(), settings_, funct::tan(), tmtt::Settings::trackFitCheat(), vecTracks3D_unfiltered_, and HLTMuonOfflineAnalyzer_cfi::z0.

Referenced by run().

◆ ranRZfilter()

bool tmtt::Make3Dtracks::ranRZfilter ( ) const
inline

Definition at line 64 of file Make3Dtracks.h.

64 { return runRZfilter_; } // Was r-z filter required/run?

References runRZfilter_.

◆ run()

void tmtt::Make3Dtracks::run ( const std::list< L1track2D > &  vecTracksRphi)
inline

Definition at line 38 of file Make3Dtracks.h.

38  {
39  this->makeUnfilteredTrks(vecTracksRphi);
40  if (runRZfilter_)
41  this->makeRZfilteredTrks(vecTracksRphi);
42  }

References makeRZfilteredTrks(), makeUnfilteredTrks(), and runRZfilter_.

Referenced by tmtt::TMTrackProducer::produce().

◆ rzFilter()

const TrkRZfilter* tmtt::Make3Dtracks::rzFilter ( ) const
inline

Definition at line 66 of file Make3Dtracks.h.

66 { return rzFilter_.get(); }

References rzFilter_.

◆ trackCands3D()

const std::list<L1track3D>& tmtt::Make3Dtracks::trackCands3D ( bool  rzFiltered) const
inline

Definition at line 49 of file Make3Dtracks.h.

49  {
50  if (rzFiltered) {
52  } else {
54  }
55  }

References vecTracks3D_rzFiltered_, and vecTracks3D_unfiltered_.

Referenced by tmtt::TMTrackProducer::produce().

Member Data Documentation

◆ etaMaxSector_

float tmtt::Make3Dtracks::etaMaxSector_
private

Definition at line 84 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), and makeUnfilteredTrks().

◆ etaMinSector_

float tmtt::Make3Dtracks::etaMinSector_
private

Definition at line 83 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), and makeUnfilteredTrks().

◆ iEtaReg_

unsigned int tmtt::Make3Dtracks::iEtaReg_
private

Definition at line 82 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), and makeUnfilteredTrks().

◆ iPhiSec_

unsigned int tmtt::Make3Dtracks::iPhiSec_
private

Definition at line 81 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), and makeUnfilteredTrks().

◆ phiCentreSector_

float tmtt::Make3Dtracks::phiCentreSector_
private

Definition at line 85 of file Make3Dtracks.h.

Referenced by Make3Dtracks().

◆ runRZfilter_

bool tmtt::Make3Dtracks::runRZfilter_
private

Definition at line 87 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), ranRZfilter(), and run().

◆ rzFilter_

std::unique_ptr<TrkRZfilter> tmtt::Make3Dtracks::rzFilter_
private

Definition at line 90 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), makeRZfilteredTrks(), and rzFilter().

◆ settings_

const Settings* tmtt::Make3Dtracks::settings_
private

Definition at line 80 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), makeRZfilteredTrks(), and makeUnfilteredTrks().

◆ vecTracks3D_rzFiltered_

std::list<L1track3D> tmtt::Make3Dtracks::vecTracks3D_rzFiltered_
private

Definition at line 93 of file Make3Dtracks.h.

Referenced by assocTrackCands3D(), makeRZfilteredTrks(), and trackCands3D().

◆ vecTracks3D_unfiltered_

std::list<L1track3D> tmtt::Make3Dtracks::vecTracks3D_unfiltered_
private

Definition at line 94 of file Make3Dtracks.h.

Referenced by assocTrackCands3D(), makeUnfilteredTrks(), and trackCands3D().

tmtt::Make3Dtracks::iPhiSec_
unsigned int iPhiSec_
Definition: Make3Dtracks.h:81
tmtt::Settings::kf_oneOver2rRange
double kf_oneOver2rRange() const
Definition: Settings.h:364
tmtt::Make3Dtracks::etaMaxSector_
float etaMaxSector_
Definition: Make3Dtracks.h:84
tmtt::Settings::enableDigitize
bool enableDigitize() const
Definition: Settings.h:80
tmtt::Settings::trackFitCheat
bool trackFitCheat() const
Definition: Settings.h:255
tmtt::Make3Dtracks::rzFilter_
std::unique_ptr< TrkRZfilter > rzFilter_
Definition: Make3Dtracks.h:90
tmtt::Make3Dtracks::makeUnfilteredTrks
void makeUnfilteredTrks(const std::list< L1track2D > &vecTracksRphi)
Definition: Make3Dtracks.cc:41
tmtt::Make3Dtracks::runRZfilter_
bool runRZfilter_
Definition: Make3Dtracks.h:87
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
tmtt::Make3Dtracks::makeRZfilteredTrks
void makeRZfilteredTrks(const std::list< L1track2D > &vecTracksRphi)
Definition: Make3Dtracks.cc:92
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
tmtt::Make3Dtracks::vecTracks3D_rzFiltered_
std::list< L1track3D > vecTracks3D_rzFiltered_
Definition: Make3Dtracks.h:93
tmtt::Make3Dtracks::phiCentreSector_
float phiCentreSector_
Definition: Make3Dtracks.h:85
tmtt::Make3Dtracks::settings_
const Settings * settings_
Definition: Make3Dtracks.h:80
tmtt::Settings::kf_phi0Range
double kf_phi0Range() const
Definition: Settings.h:368
tmtt::Make3Dtracks::iEtaReg_
unsigned int iEtaReg_
Definition: Make3Dtracks.h:82
tmtt::Make3Dtracks::vecTracks3D_unfiltered_
std::list< L1track3D > vecTracks3D_unfiltered_
Definition: Make3Dtracks.h:94
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
tmtt::Make3Dtracks::etaMinSector_
float etaMinSector_
Definition: Make3Dtracks.h:83
tmtt::Settings::invPtToInvR
double invPtToInvR() const
Definition: Settings.h:393