CMS 3D CMS Logo

constants.h
Go to the documentation of this file.
1 
20 #ifndef L1Trigger_DTTriggerPhase2_constants_h
21 #define L1Trigger_DTTriggerPhase2_constants_h
22 #include <cstdint>
23 #include <vector>
24 #include <cmath>
25 
26 // Compiler option to select program mode: PRUEBA_MEZCLADOR, PRUEBA_ANALIZADOR,
27 // or NONE
28 
29 /* Quality of the trayectories:
30  NOPATH => Not valid trayectory
31  LOWQGHOST => 3h (multiple lateralities)
32  LOWQ => 3h
33  HIGHQGHOST => 4h (multiple lateralities)
34  HIGHQ => 4h
35  CLOWQ => 3h + 2h/1h
36  LOWLOWQ => 3h + 3h
37  CHIGHQ => 4h + 2h/1h
38  HIGHLOWQ => 4h + 3h
39  HIGHHIGHQ => 4h + 4h
40 */
41 namespace cmsdt {
42 
43  // enum MP_QUALITY { NOPATH = 0, LOWQGHOST, LOWQ, HIGHQGHOST, HIGHQ, CLOWQ, LOWLOWQ, CHIGHQ, HIGHLOWQ, HIGHHIGHQ };
44  enum MP_QUALITY { NOPATH = 0, LOWQ = 1, CLOWQ = 2, HIGHQ = 3, CHIGHQ = 4, LOWLOWQ = 6, HIGHLOWQ = 7, HIGHHIGHQ = 8 };
45 
46  // Tipos de lateralidad de traza de partícula al pasar por una celda
47  enum LATERAL_CASES { LEFT = 0, RIGHT, NONE };
48 
50 
51  struct metaPrimitive {
52  metaPrimitive(uint32_t id,
53  double t,
54  double pos,
55  double tan,
56  double ph,
57  double phb,
58  double ph_cmssw,
59  double phb_cmssw,
60  double chi,
61  int q,
62  int w1,
63  int t1,
64  int l1,
65  int w2,
66  int t2,
67  int l2,
68  int w3,
69  int t3,
70  int l3,
71  int w4,
72  int t4,
73  int l4,
74  int w5 = 0,
75  int t5 = -1,
76  int l5 = 0,
77  int w6 = 0,
78  int t6 = -1,
79  int l6 = 0,
80  int w7 = 0,
81  int t7 = -1,
82  int l7 = 0,
83  int w8 = 0,
84  int t8 = -1,
85  int l8 = 0,
86  int idx = 0,
87  int rpc = 0)
88  : rawId(id),
89  t0(t),
90  x(pos),
91  tanPhi(tan),
92  phi(ph),
93  phiB(phb),
94  phi_cmssw(ph_cmssw),
95  phiB_cmssw(phb_cmssw),
96  chi2(chi),
97  quality(q),
98  wi1(w1),
99  tdc1(t1),
100  lat1(l1),
101  wi2(w2),
102  tdc2(t2),
103  lat2(l2),
104  wi3(w3),
105  tdc3(t3),
106  lat3(l3),
107  wi4(w4),
108  tdc4(t4),
109  lat4(l4),
110  wi5(w5),
111  tdc5(t5),
112  lat5(l5),
113  wi6(w6),
114  tdc6(t6),
115  lat6(l6),
116  wi7(w7),
117  tdc7(t7),
118  lat7(l7),
119  wi8(w8),
120  tdc8(t8),
121  lat8(l8),
122  index(idx),
123  rpcFlag(rpc) {}
125  : rawId(0),
126  t0(0),
127  x(0),
128  tanPhi(0),
129  phi(0),
130  phiB(0),
131  phi_cmssw(0),
132  phiB_cmssw(0),
133  chi2(0),
134  quality(0),
135  wi1(0),
136  tdc1(0),
137  lat1(0),
138  wi2(0),
139  tdc2(0),
140  lat2(0),
141  wi3(0),
142  tdc3(0),
143  lat3(0),
144  wi4(0),
145  tdc4(0),
146  lat4(0),
147  wi5(0),
148  tdc5(0),
149  lat5(0),
150  wi6(0),
151  tdc6(0),
152  lat6(0),
153  wi7(0),
154  tdc7(0),
155  lat7(0),
156  wi8(0),
157  tdc8(0),
158  lat8(0),
159  index(0),
160  rpcFlag(0) {}
161  uint32_t rawId;
162  double t0;
163  double x;
164  double tanPhi;
165  double phi;
166  double phiB;
167  double phi_cmssw;
168  double phiB_cmssw;
169  double chi2;
170  int quality;
171  int wi1;
172  int tdc1;
173  int lat1;
174  int wi2;
175  int tdc2;
176  int lat2;
177  int wi3;
178  int tdc3;
179  int lat3;
180  int wi4;
181  int tdc4;
182  int lat4;
183  int wi5;
184  int tdc5;
185  int lat5;
186  int wi6;
187  int tdc6;
188  int lat6;
189  int wi7;
190  int tdc7;
191  int lat7;
192  int wi8;
193  int tdc8;
194  int lat8;
195  int index;
196  int rpcFlag = 0;
197  };
198 
200  bool latQValid;
201  int bxValue;
202  };
203 
204  struct LATQ_TYPE {
205  bool valid;
206  int bxValue;
209  };
210 
211  struct bx_sl_vector {
212  int bx;
213  std::vector<cmsdt::metaPrimitive> mps;
214  int sl;
215  };
216 
217  enum algo { Standard = 0, PseudoBayes = 1, HoughTrans = 2 };
218 
219  enum scenario { MC = 0, DATA = 1, SLICE_TEST = 2 };
220 
221  /* En nanosegundos */
223 
224  /* mixer constants */
225  // Hits can be separated up to 9 frames, with 2 BXs per frame
226  // | | | | | | | | | | | | | | | | | |
227  // F1 F2 F3 F4 F5 F6 F7 F8 F9
231 
232  /* laterality provider */
233  constexpr int LAT_TOTAL_BITS = 9; // tdc counts from 0 to 512
236 
240 
244 
245  /* Fitting */
246 
248 
260 
262 
267 
271 
276 
278 
282 
286 
290 
292 
293  // Filtering
302 
303  /* Adimensional */
304  constexpr int MAX_BX_IDX = 3564;
305 
306  // In ns (maximum drift time inside the cell)
307  constexpr float MAXDRIFT = 387;
308  constexpr float MAXDRIFTTDC = 496; // we could make this value depend on the chamber, to be seen
309 
310  // In mm (cell dimmensions)
315  // In mm / ns (velocidad de deriva)
316  constexpr float DRIFT_SPEED = 0.0542;
317  // With 4 bits for the decimal part
318  constexpr int DRIFT_SPEED_X4 = 889; // 55.5 * 2 ** 4
319 
320  // slope conversion 1 LSB = (v_drift) x (1 tdc count) / (1 semicell_h * 16) ~= 0.4e-3
322 
323  // distance between SLs, cm
324  constexpr float VERT_PHI1_PHI3 = 23.5;
325 
326  // inverse of the distance between SLs, FW units
328 
329  // distance between center of the chamber and each SL in mm, 2 bit precision for the decimal part
330  constexpr int CH_CENTER_TO_MID_SL_X2 = 470; // 117.5 * 2 ** 2
331 
332  // max difference in BX to even try to correlate
334 
335  // max number of TPs to store per BX
337 
338  // max number of TPs to correlate and perform the refitting
340 
341  /*
342  This is the maximum value than internal time can take. This is because
343  internal time is cyclical due to the limited size of the time counters and
344  the limited value of the bunch crossing index.
345  It should be, approximately, the LHC's clock frequency multiplied by the
346  maximum BX index, plus an arbitrary amount for taking into account the
347  muon traveling time and muon's signal drift time.
348  */
350 
351  /*
352  * Total BTI number and total channel number must be coordinated. One BTI
353  * works over 10 channels, but 2 consecutive BTI's overlap many of their
354  * channels.
355  */
356  constexpr int TOTAL_BTI = 100; // Should be the same value as NUM_CH_PER_LAYER
357  constexpr int NUM_CH_PER_LAYER = 100; // Should be the same value as TOTAL_BTI
363  constexpr float PHIRES_CONV = 65536. / 0.5; // 17 bits, [-0.5, 0.5]
364  constexpr float PHIBRES_CONV = 4096. / 2.; // 13 bits, [-2, 2]
365  constexpr int CHI2RES_CONV = 1000000;
367  constexpr float ZRES_CONV = 65536. / 1500;
368  constexpr float KRES_CONV = 65536. / 2;
369 
370  /*
371  * Size of pre-mixer buffers for DTPrimitives
372  *
373  * As first approach, this value should be evaluated in order to allow storing
374  * enough elements to avoid saturating its size. It will be dependent on the
375  * noise level, the number of good data injected in the system, as well as on
376  * the processing speed of the final analyzer.
377  */
379 
380  // Number of cells for a analysis block (BTI)
382 
383  /*
384  * Number of entries for the payload inside DTPrimitive.
385  * This value is also used in other code places to manage reading and writing
386  * from/to files
387  */
389 
390  /*
391  * Size of muon primitive
392  */
394  constexpr double PHI_CONV = 0.5235988;
395 
396  constexpr int BX_SHIFT = 20;
397  constexpr float Z_SHIFT_MB4 = -1.8;
398  constexpr float Z_POS_SL = 11.75;
399  constexpr double X_POS_L3 = 0.65;
400  constexpr double X_POS_L4 = 1.95;
401 
402  /*
403  * Analyzer precision constants
404  */
409 
414 
417 
418  // Values to compute drift distances from drift times
420  constexpr int DTDD_MULT = 445;
422 
423  /*
424  * Local to global coordinates transformation
425  */
426 
427  constexpr int X_SIZE = 17;
429  constexpr double PHI_SIZE = 1. / 131072; //pow(2,17) //1 rad range, 17 bits
430  constexpr double PHIB_SIZE = 4. / 8192; //pow(2,13) //4 rad range, 13 bits
431 
437 
443 
445 
446 } // namespace cmsdt
447 
448 #endif
constexpr int COEFF_WIDTH_SL_POSITION
Definition: constants.h:264
constexpr int LAT_P0_3H
Definition: constants.h:241
constexpr int FSEG_SLOPE_DISCARD_LSB
Definition: constants.h:299
constexpr int CH_CENTER_TO_MID_SL_X2
Definition: constants.h:330
constexpr int PHI_LUT_ADDR_WIDTH
Definition: constants.h:432
constexpr int PHI_LUT_A_BITS
Definition: constants.h:435
constexpr int WIDTH_FULL_POS
Definition: constants.h:254
constexpr int COEFF_WIDTH_COR_T0
Definition: constants.h:279
constexpr int PROD_RESIZE_COR_SLOPE
Definition: constants.h:289
constexpr int INCREASED_RES_SLOPE_XHH
Definition: constants.h:413
constexpr int DRIFT_SPEED_X4
Definition: constants.h:318
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
constexpr int CHI2RES_CONV
Definition: constants.h:365
constexpr float PHIBRES_CONV
Definition: constants.h:364
constexpr int PROD_RESIZE_SL2_POSITION
Definition: constants.h:274
constexpr int SIZE_SEEKT_BUFFER
Definition: constants.h:378
constexpr int PROD_RESIZE_SL_SLOPE
Definition: constants.h:275
constexpr int MAX_VALUE_OF_TIME
Definition: constants.h:349
constexpr int LAT_P1_4H
Definition: constants.h:238
constexpr int TOTAL_CHANNELS
Definition: constants.h:361
constexpr int PRECISSION_SL_POSITION
Definition: constants.h:269
LATERAL_CASES
Definition: constants.h:47
constexpr int FSEG_T0_BX_LSB
Definition: constants.h:294
constexpr int PRECISSION_COR_SLOPE
Definition: constants.h:285
constexpr int LAT_P1_3H
Definition: constants.h:242
common ppss p3p6s2 common epss epspn46 common const1 w8
Definition: inclppp.h:1
constexpr int PHI_PHIB_RES_DIFF_BITS
Definition: constants.h:444
constexpr int FSEG_SLOPE_SIZE
Definition: constants.h:300
constexpr int PHIB_B_SHL_BITS
Definition: constants.h:439
constexpr int PROD_RESIZE_COR_POSITION
Definition: constants.h:288
constexpr int VERT_PHI1_PHI3_INV
Definition: constants.h:327
constexpr int WIDTH_COARSED_TIME
Definition: constants.h:252
constexpr int FSEG_POS_SIZE
Definition: constants.h:298
constexpr int PROD_RESIZE_SL_POSITION
Definition: constants.h:273
constexpr int NUM_CELL_COMB
Definition: constants.h:360
constexpr int FSEG_T0_DISCARD_LSB
Definition: constants.h:295
constexpr int DIV_SHR_BITS_POS
Definition: constants.h:406
constexpr int FSEG_T0_SIZE
Definition: constants.h:296
constexpr int LAT_P2_3H
Definition: constants.h:243
constexpr int WIREPOS_WIDTH
Definition: constants.h:257
constexpr int T0_CUT_TOLERANCE
Definition: constants.h:291
scenario
Definition: constants.h:219
constexpr int CELL_LENGTH
Definition: constants.h:313
constexpr int COEFF_WIDTH_COR_SLOPE
Definition: constants.h:281
constexpr int CELL_SEMILENGTH
Definition: constants.h:314
constexpr int LAT_P0_4H
Definition: constants.h:237
constexpr int NUM_CELLS_PER_BLOCK
Definition: constants.h:381
constexpr int WIDTH_FULL_CHI2
Definition: constants.h:256
common ppss p3p6s2 common epss epspn46 common const1 w4
Definition: inclppp.h:1
common ppss p3p6s2 common epss epspn46 common const1 w7
Definition: inclppp.h:1
constexpr int NUM_SUPERLAYERS
Definition: constants.h:362
constexpr int DIV_SHR_BITS_T0
Definition: constants.h:405
constexpr int MAX_BX_FOR_COR
Definition: constants.h:333
constexpr int PATHFINDER_INPUT_HITS_LIMIT
Definition: constants.h:230
constexpr float MAXDRIFTTDC
Definition: constants.h:308
constexpr int INCREASED_RES_SLOPE_POW
Definition: constants.h:416
constexpr int DIV_SHR_BITS_SLOPE
Definition: constants.h:407
constexpr int COEFF_WIDTH_SL_T0
Definition: constants.h:263
constexpr int SLFILT_MAX_SEG1T0_TO_SEG2ARRIVAL
Definition: constants.h:301
constexpr int PHI_B_SHL_BITS
Definition: constants.h:433
constexpr int MAX_BX_IDX
Definition: constants.h:304
constexpr int SL1_CELLS_OFFSET
Definition: constants.h:247
constexpr int MAX_FRAME_DIF
Definition: constants.h:229
constexpr int COEFF_WIDTH_SL_SLOPE
Definition: constants.h:266
constexpr float KRES_CONV
Definition: constants.h:368
constexpr float Z_SHIFT_MB4
Definition: constants.h:397
constexpr int NUM_LATERALITIES
Definition: constants.h:359
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
constexpr int WIDTH_FULL_TIME
Definition: constants.h:251
constexpr int PHIB_LUT_B_BITS
Definition: constants.h:442
constexpr int CELL_HEIGHT
Definition: constants.h:311
constexpr double X_POS_L4
Definition: constants.h:400
constexpr int MAX_PRIM_PER_BX_FOR_COR
Definition: constants.h:336
constexpr int FSEG_POS_DISCARD_LSB
Definition: constants.h:297
constexpr int PRECISSION_COR_T0
Definition: constants.h:283
constexpr int WIDTH_POS_SLOPE_CORR
Definition: constants.h:259
constexpr float ZRES_CONV
Definition: constants.h:367
constexpr int LAT_P2_4H
Definition: constants.h:239
constexpr int TOTAL_BTI
Definition: constants.h:356
constexpr float CELL_SEMIHEIGHT
Definition: constants.h:312
constexpr double PHIB_SIZE
Definition: constants.h:430
constexpr int GENERIC_COEFF_WIDTH
Definition: constants.h:250
constexpr int WIDTH_DIFBX
Definition: constants.h:253
constexpr int PHI_LUT_B_BITS
Definition: constants.h:436
constexpr int WIDTH_FULL_SLOPE
Definition: constants.h:255
constexpr int N_COEFFS
Definition: constants.h:249
constexpr int PHIB_LUT_ADDR_WIDTH
Definition: constants.h:438
constexpr int PHI_MULT_SHR_BITS
Definition: constants.h:434
MP_QUALITY
Definition: constants.h:44
constexpr int BX_SHIFT
Definition: constants.h:396
constexpr double PHI_CONV
Definition: constants.h:394
constexpr float Z_POS_SL
Definition: constants.h:398
constexpr int COEFF_WIDTH_SL2_POSITION
Definition: constants.h:265
constexpr int TIME_TO_TDC_COUNTS
Definition: constants.h:235
constexpr int NUM_CH_PER_LAYER
Definition: constants.h:357
constexpr int PROD_RESIZE_SL_T0
Definition: constants.h:272
constexpr int MAX_PRIM_FOR_COR
Definition: constants.h:339
constexpr int PROD_RESIZE_COR_T0
Definition: constants.h:287
constexpr int NUM_LAYERS_2SL
Definition: constants.h:393
constexpr float VERT_PHI1_PHI3
Definition: constants.h:324
constexpr int TDCTIME_REDUCED_SIZE
Definition: constants.h:366
MP_QUALITY quality
Definition: constants.h:208
constexpr double PHI_SIZE
Definition: constants.h:429
constexpr int LHC_CLK_FREQ
Definition: constants.h:222
constexpr int INCREASED_RES_T0
Definition: constants.h:410
constexpr int XI_COR_WIDTH
Definition: constants.h:277
constexpr float MAXDRIFT
Definition: constants.h:307
common ppss p3p6s2 common epss epspn46 common const1 w6
Definition: inclppp.h:1
constexpr int PHIB_LUT_A_BITS
Definition: constants.h:441
common ppss p3p6s2 common epss epspn46 common const1 w3
Definition: inclppp.h:1
constexpr int DTDD_PREADD
Definition: constants.h:419
constexpr int BX_PER_FRAME
Definition: constants.h:228
constexpr int PRECISSION_COR_POSITION
Definition: constants.h:284
metaPrimitive(uint32_t id, double t, double pos, double tan, double ph, double phb, double ph_cmssw, double phb_cmssw, double chi, int q, int w1, int t1, int l1, int w2, int t2, int l2, int w3, int t3, int l3, int w4, int t4, int l4, int w5=0, int t5=-1, int l5=0, int w6=0, int t6=-1, int l6=0, int w7=0, int t7=-1, int l7=0, int w8=0, int t8=-1, int l8=0, int idx=0, int rpc=0)
Definition: constants.h:52
constexpr int INCREASED_RES_SLOPE
Definition: constants.h:412
constexpr int DTDD_MULT
Definition: constants.h:420
constexpr int COEFF_WIDTH_COR_POSITION
Definition: constants.h:280
constexpr int PRECISSION_SL_T0
Definition: constants.h:268
constexpr int PRECISSION_SL_SLOPE
Definition: constants.h:270
constexpr int XI_SL_WIDTH
Definition: constants.h:261
constexpr int LAT_TOTAL_BITS
Definition: constants.h:233
constexpr int TANPSI_SIZE
Definition: constants.h:428
constexpr int DTDD_SHIFTR_BITS
Definition: constants.h:421
constexpr int INCREASED_RES_POS_POW
Definition: constants.h:415
constexpr int NUM_LAYERS
Definition: constants.h:358
constexpr int WIREPOS_NORM_LSB_IGNORED
Definition: constants.h:258
RPC_QUALITY
Definition: constants.h:49
constexpr float PHIRES_CONV
Definition: constants.h:363
std::vector< cmsdt::metaPrimitive > mps
Definition: constants.h:213
constexpr int PHIB_MULT_SHR_BITS
Definition: constants.h:440
common ppss p3p6s2 common epss epspn46 common const1 w5
Definition: inclppp.h:1
constexpr int X_SIZE
Definition: constants.h:427
constexpr float SLOPE_LSB
Definition: constants.h:321
constexpr int DIV_SHR_BITS_SLOPE_XHH
Definition: constants.h:408
constexpr float DRIFT_SPEED
Definition: constants.h:316
constexpr int PAYLOAD_ENTRIES
Definition: constants.h:388
constexpr double X_POS_L3
Definition: constants.h:399
constexpr int LAT_MSB_BITS
Definition: constants.h:234
constexpr int INCREASED_RES_POS
Definition: constants.h:411