CMS 3D CMS Logo

DigitalStub.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTMTT_DigitalStub_h
2 #define L1Trigger_TrackFindingTMTT_DigitalStub_h
3 
5 #include <cmath>
6 #include <string>
7 
8 //=== Digtizes stubs for input to GP, HT & KF
9 
10 namespace tmtt {
11 
12  class Settings;
13 
14  class DigitalStub {
15  public:
16  //--- Hybrid tracking: simplified digitization for KF.
17 
18  DigitalStub(const Settings* settings, double r, double phi, double z, unsigned int iPhiSec);
19 
20  //--- TMTT tracking:
21  // Initialize stub with floating point stub coords, range of HT m-bin values consistent with bend,
22  // bend and phi sector.
23  DigitalStub(const Settings* settings,
24  double phi_orig,
25  double r_orig,
26  double z_orig,
27  unsigned int mbin_min_orig,
28  unsigned int mbin_max_orig,
29  double bend_orig,
30  unsigned int iPhiSec);
31 
32  // Redo phi digitisation assigning stub to a different phi sector;
33  // (Return arg indicates if any work done).
34  bool changePhiSec(unsigned int iPhiSec);
35 
36  //--- Original floating point stub data before digitization.
37  double r_orig() const { return r_orig_; }
38  double rt_orig() const { return rt_orig_; } // r with respect to reference radius
39  double phi_orig() const { return phi_orig_; }
40  double phiS_orig() const { return phiS_orig_; } // with respect to centre of sector
41  double phiN_orig() const { return phiN_orig_; } // with respect to centre of nonant
42  double z_orig() const { return z_orig_; }
43  unsigned int mbin_min_orig() const { return mbin_min_orig_; }
44  unsigned int mbin_max_orig() const { return mbin_max_orig_; }
45  double bend_orig() const { return bend_orig_; }
46 
47  //--- Digitised stub data
48 
49  int iDigi_PhiN() const { return iDigi_PhiN_; }
50  int iDigi_Bend() const { return iDigi_Bend_; }
51  int iDigi_PhiS() const { return iDigi_PhiS_; }
52  int mbin_min() const { return mbin_min_; }
53  int mbin_max() const { return mbin_max_; }
54  int iDigi_Rt() const { return iDigi_Rt_; }
55  unsigned int iDigi_R() const { return iDigi_R_; }
56  int iDigi_Z() const { return iDigi_Z_; }
57 
58  //--- floating point stub data following digitisation & undigitisation again
59  // "GP" indicates valid variable for input to GP etc. If no such name, always valid.
60  double phiN() const { return phiN_; }
61  double phi_GP() const { return phi_GP_; }
62  double bend() const { return bend_; }
63  double phiS() const { return phiS_; }
64  double phi_HT_TF() const { return phi_HT_TF_; }
65  double rt_GP_HT() const { return rt_GP_HT_; }
66  double r_GP_HT() const { return r_GP_HT_; }
67  double r_SF_TF() const { return r_SF_TF_; }
68  double rt_SF_TF() const { return rt_SF_TF_; }
69  double z() const { return z_; }
70 
71  //--- Utility: return phi nonant number corresponding to given phi sector number.
72 
73  unsigned int iNonant(unsigned int iPhiSec) const { return floor(iPhiSec * numPhiNonants_ / numPhiSectors_); }
74 
75  private:
76  // Set cfg params.
77  void setCfgParams(const Settings* settings);
78 
79  // Digitize stub
80  void digitize(unsigned int iPhiSec);
81 
82  // Undigitize stub again
83  void undigitize(unsigned int iPhiSec);
84 
85  // Check that stub coords. & bend angle are within assumed digitization range.
86  void checkInRange() const;
87 
88  // Check that digitisation followed by undigitisation doesn't change significantly the stub coordinates.
89  void checkAccuracy() const;
90 
91  private:
92  //--- Configuration
93 
94  // Digitization configuration
96  unsigned int phiSectorBits_;
97  unsigned int phiSBits_;
98  double phiSRange_;
99  unsigned int rtBits_;
100  double rtRange_;
101  unsigned int zBits_;
102  double zRange_;
103  unsigned int phiNBits_;
104  double phiNRange_;
105  unsigned int bendBits_;
106  double bendRange_;
107 
108  // Digitization multipliers
109  double phiSMult_;
110  double rtMult_;
111  double zMult_;
112  double phiNMult_;
113  double bendMult_;
114 
115  // Number of phi sectors and phi nonants.
116  unsigned int numPhiSectors_;
117  unsigned int numPhiNonants_;
118  // Phi sector and phi nonant width (radians)
121  // Centre of phi sector 0.
123  // Centre of this phi sector & nonant.
126  // Radius from beamline with respect to which stub r coord. is measured.
128  // Number of q/Pt bins in Hough transform array.
129  unsigned int nbinsPt_;
130  // Min. of HT m-bin array in firmware.
132 
133  // Used to check if new digitisation requests were already done.
134  unsigned int iPhiSec_done_;
135 
136  //--- Original floating point stub data before digitization.
137  double r_orig_;
138  double rt_orig_;
139  double phi_orig_;
140  double phiS_orig_;
141  double phiN_orig_;
142  double z_orig_;
143  unsigned int mbin_min_orig_;
144  unsigned int mbin_max_orig_;
145  double bend_orig_;
146 
147  //--- Digitised stub data
148 
155  unsigned int iDigi_R_;
156  int iDigi_Z_;
157 
158  //--- floating point stub data following digitisation & undigitisation again
159  double phiN_;
160  double phi_GP_;
161  double bend_;
162  double phiS_;
163  double phi_HT_TF_;
164  double rt_GP_HT_;
165  double r_GP_HT_;
166  double r_SF_TF_;
167  double rt_SF_TF_;
168  double z_;
169  };
170 
171 } // namespace tmtt
172 #endif
tmtt::DigitalStub::r_orig_
double r_orig_
Definition: DigitalStub.h:137
tmtt::DigitalStub::mbin_max_orig_
unsigned int mbin_max_orig_
Definition: DigitalStub.h:144
tmtt::DigitalStub::phiSMult_
double phiSMult_
Definition: DigitalStub.h:109
tmtt::DigitalStub::phi_HT_TF_
double phi_HT_TF_
Definition: DigitalStub.h:163
tmtt::DigitalStub::r_orig
double r_orig() const
Definition: DigitalStub.h:37
tmtt::DigitalStub::iDigi_Bend_
int iDigi_Bend_
Definition: DigitalStub.h:150
tmtt::DigitalStub::phiN_
double phiN_
Definition: DigitalStub.h:159
tmtt::DigitalStub::bendMult_
double bendMult_
Definition: DigitalStub.h:113
tmtt::DigitalStub::phiNRange_
double phiNRange_
Definition: DigitalStub.h:104
tmtt::DigitalStub::numPhiSectors_
unsigned int numPhiSectors_
Definition: DigitalStub.h:116
tmtt::DigitalStub::phiNMult_
double phiNMult_
Definition: DigitalStub.h:112
tmtt::DigitalStub::bend_
double bend_
Definition: DigitalStub.h:161
tmtt::DigitalStub::iDigi_Bend
int iDigi_Bend() const
Definition: DigitalStub.h:50
tmtt::DigitalStub::phi_GP_
double phi_GP_
Definition: DigitalStub.h:160
tmtt::DigitalStub::phiSBits_
unsigned int phiSBits_
Definition: DigitalStub.h:97
tmtt::DigitalStub::zBits_
unsigned int zBits_
Definition: DigitalStub.h:101
tmtt::DigitalStub::iDigi_Z_
int iDigi_Z_
Definition: DigitalStub.h:156
tmtt::DigitalStub::checkInRange
void checkInRange() const
Definition: DigitalStub.cc:215
tmtt::DigitalStub::phiCentreSec0_
double phiCentreSec0_
Definition: DigitalStub.h:122
tmtt::DigitalStub::rt_GP_HT_
double rt_GP_HT_
Definition: DigitalStub.h:164
tmtt::DigitalStub::iDigi_PhiN_
int iDigi_PhiN_
Definition: DigitalStub.h:149
tmtt::DigitalStub::mbin_min_orig
unsigned int mbin_min_orig() const
Definition: DigitalStub.h:43
tmtt::DigitalStub::r_SF_TF_
double r_SF_TF_
Definition: DigitalStub.h:166
tmtt::DigitalStub::DigitalStub
DigitalStub(const Settings *settings, double r, double phi, double z, unsigned int iPhiSec)
Definition: DigitalStub.cc:15
tmtt::DigitalStub::iDigi_R
unsigned int iDigi_R() const
Definition: DigitalStub.h:55
tmtt::DigitalStub::phiSectorCentre_
double phiSectorCentre_
Definition: DigitalStub.h:124
tmtt::DigitalStub::rt_orig_
double rt_orig_
Definition: DigitalStub.h:138
tmtt::DigitalStub::r_SF_TF
double r_SF_TF() const
Definition: DigitalStub.h:67
tmtt::DigitalStub::rt_orig
double rt_orig() const
Definition: DigitalStub.h:38
tmtt::DigitalStub::iPhiSec_done_
unsigned int iPhiSec_done_
Definition: DigitalStub.h:134
tmtt::DigitalStub::iDigi_Rt
int iDigi_Rt() const
Definition: DigitalStub.h:54
tmtt::DigitalStub::numPhiNonants_
unsigned int numPhiNonants_
Definition: DigitalStub.h:117
tmtt::DigitalStub::iDigi_Rt_
int iDigi_Rt_
Definition: DigitalStub.h:154
tmtt::DigitalStub::iDigi_PhiS_
int iDigi_PhiS_
Definition: DigitalStub.h:151
tmtt::DigitalStub::phi_GP
double phi_GP() const
Definition: DigitalStub.h:61
tmtt::DigitalStub::iDigi_PhiN
int iDigi_PhiN() const
Definition: DigitalStub.h:49
tmtt::DigitalStub::rtBits_
unsigned int rtBits_
Definition: DigitalStub.h:99
tmtt::DigitalStub::z_orig
double z_orig() const
Definition: DigitalStub.h:42
tmtt::DigitalStub::iNonant
unsigned int iNonant(unsigned int iPhiSec) const
Definition: DigitalStub.h:73
tmtt::DigitalStub::r_GP_HT_
double r_GP_HT_
Definition: DigitalStub.h:165
tmtt::DigitalStub::iDigi_PhiS
int iDigi_PhiS() const
Definition: DigitalStub.h:51
tmtt::DigitalStub::digitize
void digitize(unsigned int iPhiSec)
Definition: DigitalStub.cc:167
tmtt::DigitalStub::mbin_min_orig_
unsigned int mbin_min_orig_
Definition: DigitalStub.h:143
tmtt::DigitalStub::setCfgParams
void setCfgParams(const Settings *settings)
Definition: DigitalStub.cc:123
tmtt::DigitalStub::iDigi_R_
unsigned int iDigi_R_
Definition: DigitalStub.h:155
tmtt::DigitalStub::z
double z() const
Definition: DigitalStub.h:69
tmtt::DigitalStub::bendRange_
double bendRange_
Definition: DigitalStub.h:106
tmtt::DigitalStub::phiSectorWidth_
double phiSectorWidth_
Definition: DigitalStub.h:119
tmtt::DigitalStub::phiSRange_
double phiSRange_
Definition: DigitalStub.h:98
tmtt::Settings
Definition: Settings.h:17
tmtt::DigitalStub::phiS_
double phiS_
Definition: DigitalStub.h:162
tmtt::DigitalStub::mbin_max_
int mbin_max_
Definition: DigitalStub.h:153
tmtt::DigitalStub::zMult_
double zMult_
Definition: DigitalStub.h:111
tmtt::DigitalStub::phi_orig
double phi_orig() const
Definition: DigitalStub.h:39
tmtt::DigitalStub::phiN_orig_
double phiN_orig_
Definition: DigitalStub.h:141
tmtt::DigitalStub::checkAccuracy
void checkAccuracy() const
Definition: DigitalStub.cc:236
tmtt::DigitalStub::iDigi_Z
int iDigi_Z() const
Definition: DigitalStub.h:56
tmtt::DigitalStub::phiS
double phiS() const
Definition: DigitalStub.h:63
tmtt::DigitalStub
Definition: DigitalStub.h:14
tmtt::DigitalStub::phi_orig_
double phi_orig_
Definition: DigitalStub.h:139
tmtt::DigitalStub::phi_HT_TF
double phi_HT_TF() const
Definition: DigitalStub.h:64
tmtt::DigitalStub::iFirmwareType_
int iFirmwareType_
Definition: DigitalStub.h:95
tmtt::DigitalStub::r_GP_HT
double r_GP_HT() const
Definition: DigitalStub.h:66
tmtt::DigitalStub::bendBits_
unsigned int bendBits_
Definition: DigitalStub.h:105
alignCSCRings.r
r
Definition: alignCSCRings.py:93
tmtt::DigitalStub::bend_orig_
double bend_orig_
Definition: DigitalStub.h:145
tmtt::DigitalStub::z_orig_
double z_orig_
Definition: DigitalStub.h:142
tmtt::DigitalStub::mbin_min_
int mbin_min_
Definition: DigitalStub.h:152
tmtt::DigitalStub::bend_orig
double bend_orig() const
Definition: DigitalStub.h:45
tmtt::DigitalStub::phiS_orig
double phiS_orig() const
Definition: DigitalStub.h:40
tmtt::DigitalStub::mbin_max_orig
unsigned int mbin_max_orig() const
Definition: DigitalStub.h:44
tmtt::DigitalStub::mbin_min
int mbin_min() const
Definition: DigitalStub.h:52
tmtt::DigitalStub::undigitize
void undigitize(unsigned int iPhiSec)
Definition: DigitalStub.cc:191
tmtt::DigitalStub::rtRange_
double rtRange_
Definition: DigitalStub.h:100
tmtt::DigitalStub::nbinsPt_
unsigned int nbinsPt_
Definition: DigitalStub.h:129
tmtt::DigitalStub::phiS_orig_
double phiS_orig_
Definition: DigitalStub.h:140
tmtt::DigitalStub::bend
double bend() const
Definition: DigitalStub.h:62
tmtt::DigitalStub::mbin_max
int mbin_max() const
Definition: DigitalStub.h:53
tmtt::DigitalStub::rtMult_
double rtMult_
Definition: DigitalStub.h:110
Exception.h
tmtt::DigitalStub::phiSectorBits_
unsigned int phiSectorBits_
Definition: DigitalStub.h:96
tmtt::DigitalStub::phiN
double phiN() const
Definition: DigitalStub.h:60
tmtt::DigitalStub::zRange_
double zRange_
Definition: DigitalStub.h:102
tmtt::DigitalStub::changePhiSec
bool changePhiSec(unsigned int iPhiSec)
Definition: DigitalStub.cc:97
tmtt::DigitalStub::rt_SF_TF
double rt_SF_TF() const
Definition: DigitalStub.h:68
tmtt::DigitalStub::phiNBits_
unsigned int phiNBits_
Definition: DigitalStub.h:103
tmtt::DigitalStub::z_
double z_
Definition: DigitalStub.h:168
tmtt::DigitalStub::chosenRofPhi_
double chosenRofPhi_
Definition: DigitalStub.h:127
tmtt::DigitalStub::phiNonantCentre_
double phiNonantCentre_
Definition: DigitalStub.h:125
tmtt
=== This is the base class for the linearised chi-squared track fit algorithms.
Definition: ChiSquaredFit4.h:6
tmtt::DigitalStub::rt_SF_TF_
double rt_SF_TF_
Definition: DigitalStub.h:167
tmtt::DigitalStub::rt_GP_HT
double rt_GP_HT() const
Definition: DigitalStub.h:65
tmtt::DigitalStub::phiN_orig
double phiN_orig() const
Definition: DigitalStub.h:41
tmtt::DigitalStub::phiNonantWidth_
double phiNonantWidth_
Definition: DigitalStub.h:120
tmtt::DigitalStub::min_array_mbin_
int min_array_mbin_
Definition: DigitalStub.h:131