CMS 3D CMS Logo

L1track2D.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTMTT_L1track2D_h
2 #define L1Trigger_TrackFindingTMTT_L1track2D_h
3 
10 
11 #include <vector>
12 #include <utility>
13 
14 //=== L1 track cand found in 2 dimensions.
15 //=== Gives access to all stubs on track and to its 2D helix parameters.
16 //=== Also calculates & gives access to associated truth particle (Tracking Particle) if any.
17 
18 namespace tmtt {
19 
20  class L1track2D : public L1trackBase {
21  public:
22  // Give stubs on track, its cell location inside HT array, its 2D helix parameters.
23  L1track2D(const Settings* settings,
24  const std::vector<Stub*>& stubs,
25  std::pair<unsigned int, unsigned int> cellLocationHT,
26  std::pair<float, float> helix2D,
27  unsigned int iPhiSec,
28  unsigned int iEtaReg,
29  unsigned int optoLinkID,
30  bool mergedHTcell)
31  : L1trackBase(),
32  settings_(settings),
33  stubs_(stubs),
34  stubsConst_(stubs_.begin(), stubs_.end()),
38  estZ0_(0.),
39  estTanLambda_(0.),
44  nLayers_ = Utility::countLayers(settings, stubs_); // Count tracker layers these stubs are in
46  stubs_,
48  matchedStubs_); // Find associated truth particle & calculate info about match.
49  }
50 
51  ~L1track2D() override = default;
52 
53  //--- Get information about the reconstructed track.
54 
55  // Get stubs on track candidate.
56  const std::vector<const Stub*>& stubsConst() const override { return stubsConst_; }
57  const std::vector<Stub*>& stubs() const override { return stubs_; }
58  // Get number of stubs on track candidate.
59  unsigned int numStubs() const override { return stubs_.size(); }
60  // Get number of tracker layers these stubs are in.
61  unsigned int numLayers() const override { return nLayers_; }
62  // Get cell location of track candidate in Hough Transform array in units of bin number.
63  std::pair<unsigned int, unsigned int> cellLocationHT() const override { return cellLocationHT_; }
64  // The two conventionally agreed track helix parameters relevant in this 2D plane.
65  // i.e. (q/Pt, phi0).
66  std::pair<float, float> helix2D() const { return helix2D_; }
67 
68  //--- User-friendlier access to the helix parameters obtained from track location inside HT array.
69 
70  float qOverPt() const override { return helix2D_.first; }
71  float phi0() const override { return helix2D_.second; }
72 
73  //--- In the case of tracks found by the r-phi HT, a rough estimate of the (z0, tan_lambda) may be provided by any r-z
74  //--- track filter run after the r-phi HT. These two functions give std::set/get access to these.
75  //--- The "get" function returns a boolean indicating if an estimate exists (i.e. "set" has been called).
76 
77  void setTrkEstZ0andTanLam(float estZ0, float estTanLambda) {
78  estZ0_ = estZ0;
79  estTanLambda_ = estTanLambda;
80  estValid_ = true;
81  }
82 
83  bool trkEstZ0andTanLam(float& estZ0, float& estTanLambda) const {
84  estZ0 = estZ0_;
85  estTanLambda = estTanLambda_;
86  return estValid_;
87  }
88 
89  //--- Get phi sector and eta region used by track finding code that this track is in.
90  unsigned int iPhiSec() const override { return iPhiSec_; }
91  unsigned int iEtaReg() const override { return iEtaReg_; }
92 
93  //--- Opto-link ID used to send this track from HT to Track Fitter. Both read & write functions.
94  unsigned int optoLinkID() const override { return optoLinkID_; }
95  void setOptoLinkID(unsigned int linkID) { optoLinkID_ = linkID; }
96 
97  //--- Was this track produced from a marged HT cell (e.g. 2x2)?
98  bool mergedHTcell() const { return mergedHTcell_; }
99 
100  //--- Get information about its association (if any) to a truth Tracking Particle.
101 
102  // Get matching tracking particle (=nullptr if none).
103  const TP* matchedTP() const override { return matchedTP_; }
104  // Get the matched stubs.
105  const std::vector<const Stub*>& matchedStubs() const override { return matchedStubs_; }
106  // Get number of matched stubs.
107  unsigned int numMatchedStubs() const override { return matchedStubs_.size(); }
108  // Get number of tracker layers with matched stubs.
109  unsigned int numMatchedLayers() const override { return nMatchedLayers_; }
110 
111  private:
112  //--- Configuration parameters
114 
115  //--- Information about the reconstructed track from Hough transform.
116  std::vector<Stub*> stubs_;
117  std::vector<const Stub*> stubsConst_;
118  unsigned int nLayers_;
119  std::pair<unsigned int, unsigned int> cellLocationHT_;
120  std::pair<float, float> helix2D_;
121 
122  //--- Rough estimate of r-z track parameters from r-z filter, which may be present in case of r-phi Hough transform
123  bool estValid_;
124  float estZ0_;
126 
127  unsigned int iPhiSec_;
128  unsigned int iEtaReg_;
129  unsigned int optoLinkID_;
130 
132 
133  //--- Information about its association (if any) to a truth Tracking Particle.
134  const TP* matchedTP_;
135  std::vector<const Stub*> matchedStubs_;
136  unsigned int nMatchedLayers_;
137  };
138 
139 } // namespace tmtt
140 
141 #endif
tmtt::L1track2D::helix2D
std::pair< float, float > helix2D() const
Definition: L1track2D.h:66
tmtt::L1track2D::mergedHTcell
bool mergedHTcell() const
Definition: L1track2D.h:98
tmtt::L1track2D::numStubs
unsigned int numStubs() const override
Definition: L1track2D.h:59
tmtt::L1track2D::optoLinkID_
unsigned int optoLinkID_
Definition: L1track2D.h:129
funct::false
false
Definition: Factorize.h:29
tmtt::Utility::countLayers
unsigned int countLayers(const Settings *settings, const std::vector< const Stub * > &stubs, bool disableReducedLayerID=false, bool onlyPS=false)
Definition: Utility.cc:25
tmtt::L1track2D::iPhiSec_
unsigned int iPhiSec_
Definition: L1track2D.h:127
tmtt::L1track2D::setOptoLinkID
void setOptoLinkID(unsigned int linkID)
Definition: L1track2D.h:95
tmtt::L1track2D::matchedTP
const TP * matchedTP() const override
Definition: L1track2D.h:103
Stub.h
tmtt::L1track2D::estTanLambda_
float estTanLambda_
Definition: L1track2D.h:125
tmtt::L1track2D::L1track2D
L1track2D(const Settings *settings, const std::vector< Stub * > &stubs, std::pair< unsigned int, unsigned int > cellLocationHT, std::pair< float, float > helix2D, unsigned int iPhiSec, unsigned int iEtaReg, unsigned int optoLinkID, bool mergedHTcell)
Definition: L1track2D.h:23
tmtt::L1track2D::stubs_
std::vector< Stub * > stubs_
Definition: L1track2D.h:116
tmtt::L1track2D::optoLinkID
unsigned int optoLinkID() const override
Definition: L1track2D.h:94
tmtt::TP
Definition: TP.h:23
tmtt::L1track2D::matchedStubs_
std::vector< const Stub * > matchedStubs_
Definition: L1track2D.h:135
tmtt::L1track2D::numLayers
unsigned int numLayers() const override
Definition: L1track2D.h:61
Utility.h
tmtt::L1track2D::cellLocationHT
std::pair< unsigned int, unsigned int > cellLocationHT() const override
Definition: L1track2D.h:63
tmtt::L1track2D::setTrkEstZ0andTanLam
void setTrkEstZ0andTanLam(float estZ0, float estTanLambda)
Definition: L1track2D.h:77
tmtt::L1track2D::stubsConst
const std::vector< const Stub * > & stubsConst() const override
Definition: L1track2D.h:56
tmtt::L1track2D
Definition: L1track2D.h:20
tmtt::L1track2D::estZ0_
float estZ0_
Definition: L1track2D.h:124
mps_fire.end
end
Definition: mps_fire.py:242
tmtt::L1track2D::estValid_
bool estValid_
Definition: L1track2D.h:123
tmtt::L1track2D::matchedStubs
const std::vector< const Stub * > & matchedStubs() const override
Definition: L1track2D.h:105
tmtt::L1track2D::iEtaReg
unsigned int iEtaReg() const override
Definition: L1track2D.h:91
TP.h
tmtt::L1track2D::helix2D_
std::pair< float, float > helix2D_
Definition: L1track2D.h:120
tmtt::L1track2D::mergedHTcell_
bool mergedHTcell_
Definition: L1track2D.h:131
tmtt::L1trackBase
Definition: L1trackBase.h:17
tmtt::Settings
Definition: Settings.h:17
tmtt::L1track2D::iEtaReg_
unsigned int iEtaReg_
Definition: L1track2D.h:128
tmtt::L1track2D::numMatchedStubs
unsigned int numMatchedStubs() const override
Definition: L1track2D.h:107
tmtt::L1track2D::nLayers_
unsigned int nLayers_
Definition: L1track2D.h:118
tmtt::L1track2D::settings_
const Settings * settings_
Definition: L1track2D.h:113
tmtt::L1track2D::iPhiSec
unsigned int iPhiSec() const override
Definition: L1track2D.h:90
tmtt::L1track2D::numMatchedLayers
unsigned int numMatchedLayers() const override
Definition: L1track2D.h:109
Settings.h
tmtt::Utility::matchingTP
const TP * matchingTP(const Settings *settings, const std::vector< const Stub * > &vstubs, unsigned int &nMatchedLayersBest, std::vector< const Stub * > &matchedStubsBest)
Definition: Utility.cc:63
tmtt::L1track2D::cellLocationHT_
std::pair< unsigned int, unsigned int > cellLocationHT_
Definition: L1track2D.h:119
tmtt::L1track2D::phi0
float phi0() const override
Definition: L1track2D.h:71
Exception.h
tmtt::L1track2D::~L1track2D
~L1track2D() override=default
L1trackBase.h
tmtt::L1track2D::matchedTP_
const TP * matchedTP_
Definition: L1track2D.h:134
tmtt::L1track2D::nMatchedLayers_
unsigned int nMatchedLayers_
Definition: L1track2D.h:136
tmtt
=== This is the base class for the linearised chi-squared track fit algorithms.
Definition: Array2D.h:16
tmtt::L1track2D::stubs
const std::vector< Stub * > & stubs() const override
Definition: L1track2D.h:57
tmtt::L1track2D::stubsConst_
std::vector< const Stub * > stubsConst_
Definition: L1track2D.h:117
tmtt::L1track2D::trkEstZ0andTanLam
bool trkEstZ0andTanLam(float &estZ0, float &estTanLambda) const
Definition: L1track2D.h:83
tmtt::L1track2D::qOverPt
float qOverPt() const override
Definition: L1track2D.h:70