CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DigitalTrack.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTMTT_DigitalTrack_h
2 #define L1Trigger_TrackFindingTMTT_DigitalTrack_h
3 
5 #include <cmath>
6 #include <string>
7 #include <set>
8 
9 namespace tmtt {
10 
11  class Settings;
12  class L1fittedTrack;
13 
14  //====================================================================================================
20  //====================================================================================================
21 
22  class DigitalTrack {
23  public:
24  // Digitize track
25  DigitalTrack(const Settings* settings, const std::string& fitterName, const L1fittedTrack* fitTrk);
26 
27  //--- The functions below return variables post-digitization.
28 
29  // half inverse curvature of track.
30  int iDigi_oneOver2r() const { return iDigi_oneOver2r_; }
31  int iDigi_d0() const { return iDigi_d0_; }
32  // measured relative to centre of sector
33  int iDigi_phi0rel() const { return iDigi_phi0rel_; }
34  int iDigi_z0() const { return iDigi_z0_; }
35  int iDigi_tanLambda() const { return iDigi_tanLambda_; }
36  unsigned int iDigi_chisquaredRphi() const { return iDigi_chisquaredRphi_; }
37  unsigned int iDigi_chisquaredRz() const { return iDigi_chisquaredRz_; }
38 
39  // Digits corresponding to track params with post-fit beam-spot constraint.
40  int iDigi_oneOver2r_bcon() const { return iDigi_oneOver2r_bcon_; } // half inverse curvature of track.
41  int iDigi_phi0rel_bcon() const { return iDigi_phi0rel_bcon_; } // measured relative to centre of sector
42  unsigned int iDigi_chisquaredRphi_bcon() const { return iDigi_chisquaredRphi_bcon_; }
43 
44  // Floating point track params derived from digitized info (so with degraded resolution).
45  float qOverPt() const { return qOverPt_; }
46  float oneOver2r() const { return oneOver2r_; } // half inverse curvature of track.
47  float d0() const { return d0_; }
48  float phi0() const { return phi0_; }
49  float phi0rel() const { return phi0rel_; } // measured relative to centre of sector
50  float z0() const { return z0_; }
51  float tanLambda() const { return tanLambda_; }
52  float chisquaredRphi() const { return chisquaredRphi_; }
53  float chisquaredRz() const { return chisquaredRz_; }
54 
55  // Floating point track params derived from digitized track params with post-fit beam-spot constraint.
56  float qOverPt_bcon() const { return qOverPt_bcon_; }
57  float oneOver2r_bcon() const { return oneOver2r_bcon_; } // half inverse curvature of track.
58  float phi0_bcon() const { return phi0_bcon_; }
59  float phi0rel_bcon() const { return phi0rel_bcon_; } // measured relative to centre of sector
60  float chisquaredRphi_bcon() const { return chisquaredRphi_bcon_; }
61 
62  unsigned int iPhiSec() const { return iPhiSec_; }
63  unsigned int iEtaReg() const { return iEtaReg_; }
64  int mBinhelix() const { return mBinhelix_; }
65  int cBinhelix() const { return cBinhelix_; }
66  unsigned int nlayers() const { return nlayers_; }
67  int mBinHT() const { return mBin_; }
68  int cBinHT() const { return cBin_; }
69  bool accepted() const { return accepted_; }
70  unsigned int hitPattern() const { return hitPattern_; }
71 
72  //--- The functions below give access to the original variables prior to digitization.
73  //%%% Those common to GP & HT input.
74  float orig_qOverPt() const { return qOverPt_orig_; }
75  float orig_oneOver2r() const { return oneOver2r_orig_; } // half inverse curvature of track.
76  float orig_d0() const { return d0_orig_; }
77  float orig_phi0() const { return phi0_orig_; }
78  float orig_phi0rel() const { return phi0rel_orig_; } // measured relative to centre of sector
79  float orig_z0() const { return z0_orig_; }
80  float orig_tanLambda() const { return tanLambda_orig_; }
81  float orig_chisquaredRphi() const { return chisquaredRphi_orig_; }
82  float orig_chisquaredRz() const { return chisquaredRz_orig_; }
83 
84  float tp_pt() const { return tp_pt_; }
85  float tp_eta() const { return tp_eta_; }
86  float tp_d0() const { return tp_d0_; }
87  float tp_phi0() const { return tp_phi0_; }
88  float tp_tanLambda() const { return tp_tanLambda_; }
89  float tp_z0() const { return tp_z0_; }
90  float tp_qoverpt() const { return tp_qoverpt_; }
91  int tp_index() const { return tp_index_; }
92  float tp_useForAlgEff() const { return tp_useForAlgEff_; }
93  float tp_useForEff() const { return tp_useForEff_; }
94  float tp_pdgId() const { return tp_pdgId_; }
95 
96  //--- Utility: return phi nonant number corresponding to given phi sector number.
97  unsigned int iGetNonant(unsigned int iPhiSec) const { return floor(iPhiSec * numPhiNonants_ / numPhiSectors_); }
98 
99  private:
100  // Load digitisation configuration parameters for the specific track fitter being used here.
101  void loadDigiCfg(const std::string& fitterName);
102 
103  // Digitize track
104  void makeDigitalTrack();
105 
106  // Check that stub coords. are within assumed digitization range.
107  void checkInRange() const;
108 
109  // Check that digitisation followed by undigitisation doesn't change significantly the track params.
110  void checkAccuracy() const;
111 
112  private:
113  // Configuration params
115 
116  // Number of phi sectors and phi nonants.
117  unsigned int numPhiSectors_;
118  unsigned int numPhiNonants_;
123  unsigned int nbinsPt_;
125 
126  // Digitization configuration
128  unsigned int oneOver2rBits_;
130  unsigned int d0Bits_;
131  float d0Range_;
132  unsigned int phi0Bits_;
133  float phi0Range_;
134  unsigned int z0Bits_;
135  float z0Range_;
136  unsigned int tanLambdaBits_;
138  unsigned int chisquaredBits_;
140 
142  double d0Mult_;
143  double phi0Mult_;
144  double z0Mult_;
147 
148  // Fitted track
149 
151  unsigned int nHelixParams_;
152 
153  // Integer data after digitization (which doesn't degrade its resolution, but can recast it in a different form).
154  unsigned int nlayers_;
155  unsigned int iPhiSec_;
156  unsigned int iEtaReg_;
157  int mBin_;
158  int cBin_;
161  unsigned int hitPattern_;
164  bool accepted_;
165 
166  //--- Original floating point stub coords before digitization.
167 
170  float d0_orig_;
171  float phi0_orig_;
174  float z0_orig_;
177 
183 
184  //--- Digits corresponding to track params.
185 
191  unsigned int iDigi_chisquaredRphi_;
192  unsigned int iDigi_chisquaredRz_;
193 
197 
198  //--- Floating point track coords derived from digitized info (so with degraded resolution).
199 
200  float qOverPt_;
201  float oneOver2r_;
202  float d0_;
203  float phi0_;
204  float phi0rel_;
205  float z0_;
206  float tanLambda_;
209 
212  float phi0_bcon_;
215 
216  // Truth
217  float tp_qoverpt_;
218  float tp_pt_;
219  float tp_eta_;
220  float tp_d0_;
221  float tp_phi0_;
223  float tp_z0_;
228  };
229 
230 } // namespace tmtt
231 #endif
unsigned int phi0Bits_
Definition: DigitalTrack.h:132
float phi0rel() const
Definition: DigitalTrack.h:49
int mBinhelix() const
Definition: DigitalTrack.h:64
float phi0() const
Definition: DigitalTrack.h:48
float qOverPt_bcon() const
Definition: DigitalTrack.h:56
float orig_chisquaredRz() const
Definition: DigitalTrack.h:82
unsigned int iDigi_chisquaredRz() const
Definition: DigitalTrack.h:37
int iDigi_d0() const
Definition: DigitalTrack.h:31
float d0() const
Definition: DigitalTrack.h:47
float orig_phi0() const
Definition: DigitalTrack.h:77
unsigned int tanLambdaBits_
Definition: DigitalTrack.h:136
float orig_d0() const
Definition: DigitalTrack.h:76
float orig_chisquaredRphi() const
Definition: DigitalTrack.h:81
float chisquaredRphi_bcon_orig_
Definition: DigitalTrack.h:182
unsigned int iDigi_chisquaredRphi() const
Definition: DigitalTrack.h:36
float tp_z0() const
Definition: DigitalTrack.h:89
unsigned int z0Bits_
Definition: DigitalTrack.h:134
unsigned int iPhiSec_
Definition: DigitalTrack.h:155
unsigned int iDigi_chisquaredRphi_bcon_
Definition: DigitalTrack.h:196
float orig_phi0rel() const
Definition: DigitalTrack.h:78
unsigned int nlayers() const
Definition: DigitalTrack.h:66
int iDigi_phi0rel() const
Definition: DigitalTrack.h:33
unsigned int hitPattern() const
Definition: DigitalTrack.h:70
unsigned int nbinsPt_
Definition: DigitalTrack.h:123
unsigned int oneOver2rBits_
Definition: DigitalTrack.h:128
float orig_tanLambda() const
Definition: DigitalTrack.h:80
int iDigi_phi0rel_bcon() const
Definition: DigitalTrack.h:41
float tp_pdgId() const
Definition: DigitalTrack.h:94
unsigned int numPhiNonants_
Definition: DigitalTrack.h:118
unsigned int iDigi_chisquaredRphi_
Definition: DigitalTrack.h:191
int iDigi_oneOver2r_bcon() const
Definition: DigitalTrack.h:40
int tp_index() const
Definition: DigitalTrack.h:91
unsigned int numPhiSectors_
Definition: DigitalTrack.h:117
float qOverPt() const
Definition: DigitalTrack.h:45
DigitalTrack(const Settings *settings, const std::string &fitterName, const L1fittedTrack *fitTrk)
Definition: DigitalTrack.cc:14
unsigned int iEtaReg() const
Definition: DigitalTrack.h:63
unsigned int d0Bits_
Definition: DigitalTrack.h:130
float phi0_bcon() const
Definition: DigitalTrack.h:58
unsigned int chisquaredBits_
Definition: DigitalTrack.h:138
float oneOver2r_bcon() const
Definition: DigitalTrack.h:57
unsigned int iPhiSec() const
Definition: DigitalTrack.h:62
unsigned int nHelixParams_
Definition: DigitalTrack.h:151
unsigned int iGetNonant(unsigned int iPhiSec) const
Definition: DigitalTrack.h:97
float tp_eta() const
Definition: DigitalTrack.h:85
unsigned int iEtaReg_
Definition: DigitalTrack.h:156
float z0() const
Definition: DigitalTrack.h:50
std::string fitterName_
Definition: DigitalTrack.h:150
void checkAccuracy() const
float tanLambda() const
Definition: DigitalTrack.h:51
float tp_phi0() const
Definition: DigitalTrack.h:87
int mBinHT() const
Definition: DigitalTrack.h:67
int cBinHT() const
Definition: DigitalTrack.h:68
void checkInRange() const
int cBinhelix() const
Definition: DigitalTrack.h:65
bool accepted() const
Definition: DigitalTrack.h:69
float orig_qOverPt() const
Definition: DigitalTrack.h:74
const Settings * settings_
Definition: DigitalTrack.h:114
float chisquaredRphi_bcon() const
Definition: DigitalTrack.h:60
float tp_d0() const
Definition: DigitalTrack.h:86
float oneOver2r() const
Definition: DigitalTrack.h:46
float tp_pt() const
Definition: DigitalTrack.h:84
unsigned int nlayers_
Definition: DigitalTrack.h:154
float tp_useForEff() const
Definition: DigitalTrack.h:93
float tp_useForAlgEff() const
Definition: DigitalTrack.h:92
int iDigi_z0() const
Definition: DigitalTrack.h:34
void loadDigiCfg(const std::string &fitterName)
Definition: DigitalTrack.cc:99
float orig_z0() const
Definition: DigitalTrack.h:79
unsigned int hitPattern_
Definition: DigitalTrack.h:161
int iDigi_tanLambda() const
Definition: DigitalTrack.h:35
float chisquaredRz() const
Definition: DigitalTrack.h:53
float tp_tanLambda() const
Definition: DigitalTrack.h:88
float chisquaredRphi() const
Definition: DigitalTrack.h:52
float tp_qoverpt() const
Definition: DigitalTrack.h:90
float phi0rel_bcon() const
Definition: DigitalTrack.h:59
unsigned int iDigi_chisquaredRz_
Definition: DigitalTrack.h:192
int iDigi_oneOver2r() const
Definition: DigitalTrack.h:30
unsigned int iDigi_chisquaredRphi_bcon() const
Definition: DigitalTrack.h:42
float orig_oneOver2r() const
Definition: DigitalTrack.h:75