CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

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.

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

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  }
const Settings * settings_
Definition: Make3Dtracks.h:80
std::unique_ptr< TrkRZfilter > rzFilter_
Definition: Make3Dtracks.h:90
unsigned int iPhiSec_
Definition: Make3Dtracks.h:81
unsigned int iEtaReg_
Definition: Make3Dtracks.h:82

Member Function Documentation

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

Definition at line 113 of file Make3Dtracks.cc.

References tmtt::TP::index(), vecTracks3D_rzFiltered_, and vecTracks3D_unfiltered_.

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  }
std::list< L1track3D > vecTracks3D_rzFiltered_
Definition: Make3Dtracks.h:93
std::list< L1track3D > vecTracks3D_unfiltered_
Definition: Make3Dtracks.h:94
void tmtt::Make3Dtracks::makeRZfilteredTrks ( const std::list< L1track2D > &  vecTracksRphi)
private

Definition at line 92 of file Make3Dtracks.cc.

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

Referenced by run().

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  }
const Settings * settings_
Definition: Make3Dtracks.h:80
std::unique_ptr< TrkRZfilter > rzFilter_
Definition: Make3Dtracks.h:90
std::list< L1track3D > vecTracks3D_rzFiltered_
Definition: Make3Dtracks.h:93
bool trackFitCheat() const
Definition: Settings.h:255
void tmtt::Make3Dtracks::makeUnfilteredTrks ( const std::list< L1track2D > &  vecTracksRphi)
private

Definition at line 41 of file Make3Dtracks.cc.

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

Referenced by run().

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  }
bool enableDigitize() const
Definition: Settings.h:80
const Settings * settings_
Definition: Make3Dtracks.h:80
double kf_oneOver2rRange() const
Definition: Settings.h:366
double invPtToInvR() const
Definition: Settings.h:395
double kf_phi0Range() const
Definition: Settings.h:370
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
unsigned int iPhiSec_
Definition: Make3Dtracks.h:81
unsigned int iEtaReg_
Definition: Make3Dtracks.h:82
std::list< L1track3D > vecTracks3D_unfiltered_
Definition: Make3Dtracks.h:94
bool trackFitCheat() const
Definition: Settings.h:255
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
bool tmtt::Make3Dtracks::ranRZfilter ( ) const
inline

Definition at line 64 of file Make3Dtracks.h.

References runRZfilter_.

64 { return runRZfilter_; } // Was r-z filter required/run?
void tmtt::Make3Dtracks::run ( const std::list< L1track2D > &  vecTracksRphi)
inline

Definition at line 38 of file Make3Dtracks.h.

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

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

38  {
39  this->makeUnfilteredTrks(vecTracksRphi);
40  if (runRZfilter_)
41  this->makeRZfilteredTrks(vecTracksRphi);
42  }
void makeUnfilteredTrks(const std::list< L1track2D > &vecTracksRphi)
Definition: Make3Dtracks.cc:41
void makeRZfilteredTrks(const std::list< L1track2D > &vecTracksRphi)
Definition: Make3Dtracks.cc:92
const TrkRZfilter* tmtt::Make3Dtracks::rzFilter ( ) const
inline

Definition at line 66 of file Make3Dtracks.h.

References rzFilter_.

66 { return rzFilter_.get(); }
std::unique_ptr< TrkRZfilter > rzFilter_
Definition: Make3Dtracks.h:90
const std::list<L1track3D>& tmtt::Make3Dtracks::trackCands3D ( bool  rzFiltered) const
inline

Definition at line 49 of file Make3Dtracks.h.

References vecTracks3D_rzFiltered_, and vecTracks3D_unfiltered_.

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

49  {
50  if (rzFiltered) {
52  } else {
54  }
55  }
std::list< L1track3D > vecTracks3D_rzFiltered_
Definition: Make3Dtracks.h:93
std::list< L1track3D > vecTracks3D_unfiltered_
Definition: Make3Dtracks.h:94

Member Data Documentation

float tmtt::Make3Dtracks::etaMaxSector_
private

Definition at line 84 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), and makeUnfilteredTrks().

float tmtt::Make3Dtracks::etaMinSector_
private

Definition at line 83 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), and makeUnfilteredTrks().

unsigned int tmtt::Make3Dtracks::iEtaReg_
private

Definition at line 82 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), and makeUnfilteredTrks().

unsigned int tmtt::Make3Dtracks::iPhiSec_
private

Definition at line 81 of file Make3Dtracks.h.

Referenced by Make3Dtracks(), and makeUnfilteredTrks().

float tmtt::Make3Dtracks::phiCentreSector_
private

Definition at line 85 of file Make3Dtracks.h.

Referenced by Make3Dtracks().

bool tmtt::Make3Dtracks::runRZfilter_
private

Definition at line 87 of file Make3Dtracks.h.

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

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

Definition at line 90 of file Make3Dtracks.h.

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

const Settings* tmtt::Make3Dtracks::settings_
private

Definition at line 80 of file Make3Dtracks.h.

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

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

Definition at line 93 of file Make3Dtracks.h.

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

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

Definition at line 94 of file Make3Dtracks.h.

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