CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
double phiNonantCentre_
Definition: DigitalStub.h:125
double phiN() const
Definition: DigitalStub.h:60
double r_orig() const
Definition: DigitalStub.h:37
unsigned int nbinsPt_
Definition: DigitalStub.h:129
int iDigi_PhiN() const
Definition: DigitalStub.h:49
unsigned int phiSBits_
Definition: DigitalStub.h:97
unsigned int rtBits_
Definition: DigitalStub.h:99
unsigned int iNonant(unsigned int iPhiSec) const
Definition: DigitalStub.h:73
void digitize(unsigned int iPhiSec)
Definition: DigitalStub.cc:167
unsigned int mbin_max_orig() const
Definition: DigitalStub.h:44
double phiN_orig() const
Definition: DigitalStub.h:41
double rt_SF_TF() const
Definition: DigitalStub.h:68
unsigned int zBits_
Definition: DigitalStub.h:101
double phi_GP() const
Definition: DigitalStub.h:61
double phi_orig() const
Definition: DigitalStub.h:39
void setCfgParams(const Settings *settings)
Definition: DigitalStub.cc:123
unsigned int mbin_min_orig_
Definition: DigitalStub.h:143
double phiSectorCentre_
Definition: DigitalStub.h:124
double phiSectorWidth_
Definition: DigitalStub.h:119
unsigned int iPhiSec_done_
Definition: DigitalStub.h:134
int mbin_max() const
Definition: DigitalStub.h:53
int iDigi_PhiS() const
Definition: DigitalStub.h:51
double bend_orig() const
Definition: DigitalStub.h:45
int iDigi_Bend() const
Definition: DigitalStub.h:50
unsigned int numPhiNonants_
Definition: DigitalStub.h:117
DigitalStub(const Settings *settings, double r, double phi, double z, unsigned int iPhiSec)
Definition: DigitalStub.cc:15
double r_SF_TF() const
Definition: DigitalStub.h:67
unsigned int bendBits_
Definition: DigitalStub.h:105
int iDigi_Z() const
Definition: DigitalStub.h:56
double z_orig() const
Definition: DigitalStub.h:42
void undigitize(unsigned int iPhiSec)
Definition: DigitalStub.cc:191
int iDigi_Rt() const
Definition: DigitalStub.h:54
unsigned int iDigi_R() const
Definition: DigitalStub.h:55
unsigned int mbin_max_orig_
Definition: DigitalStub.h:144
unsigned int phiSectorBits_
Definition: DigitalStub.h:96
double rt_orig() const
Definition: DigitalStub.h:38
double bend() const
Definition: DigitalStub.h:62
double phiS_orig() const
Definition: DigitalStub.h:40
int mbin_min() const
Definition: DigitalStub.h:52
unsigned int phiNBits_
Definition: DigitalStub.h:103
unsigned int mbin_min_orig() const
Definition: DigitalStub.h:43
unsigned int iDigi_R_
Definition: DigitalStub.h:155
double r_GP_HT() const
Definition: DigitalStub.h:66
void checkAccuracy() const
Definition: DigitalStub.cc:236
unsigned int numPhiSectors_
Definition: DigitalStub.h:116
double phiNonantWidth_
Definition: DigitalStub.h:120
double phiS() const
Definition: DigitalStub.h:63
double z() const
Definition: DigitalStub.h:69
double rt_GP_HT() const
Definition: DigitalStub.h:65
double phi_HT_TF() const
Definition: DigitalStub.h:64
void checkInRange() const
Definition: DigitalStub.cc:215
bool changePhiSec(unsigned int iPhiSec)
Definition: DigitalStub.cc:97