CMS 3D CMS Logo

GlobalCoordsObtainer.h
Go to the documentation of this file.
1 #ifndef L1Trigger_DTTriggerPhase2_GlobalCoordsObtainer_h
2 #define L1Trigger_DTTriggerPhase2_GlobalCoordsObtainer_h
3 
13 
15 
17 
18 #include <cmath>
19 #include <fstream>
20 #include <iostream>
21 
22 // ===============================================================================
23 // Previous definitions and declarations
24 // ===============================================================================
25 
26 struct lut_value {
27  long int a;
28  long int b;
29 };
30 
31 struct lut_group {
32  std::map<int, lut_value> phi;
33  std::map<int, lut_value> phib;
34 };
35 
37  double perp;
38  double x_phi0;
39 };
40 
42  uint32_t chid;
45 };
46 
47 // ===============================================================================
48 // Class declarations
49 // ===============================================================================
50 
52 public:
55 
56  void generate_luts();
57  std::vector<double> get_global_coordinates(uint32_t, int, int, int);
58 
60  int maxdriftinfo_[5][4][14];
61  int max_drift_tdc = -1;
62 
63 private:
64  std::map<int, lut_value> calc_atan_lut(int, int, double, double, double, int, int, int, int, int);
65  // utilities to go to and from 2 complement
66  int to_two_comp(int val, int size) {
67  if (val >= 0)
68  return val;
69  return std::pow(2, size) + val;
70  }
71 
72  int from_two_comp(int val, int size) { return val - ((2 * val) & (1 << size)); }
73 
74  // attributes
77  std::vector<global_constant> global_constants;
78  std::map<uint32_t, lut_group> luts;
79 };
80 
81 #endif
size
Write out results.
edm::FileInPath global_coords_filename_
global_constant_per_sl sl1
edm::FileInPath maxdrift_filename_
int to_two_comp(int val, int size)
std::vector< global_constant > global_constants
std::vector< double > get_global_coordinates(uint32_t, int, int, int)
std::map< int, lut_value > phib
std::map< uint32_t, lut_group > luts
std::map< int, lut_value > phi
GlobalCoordsObtainer(const edm::ParameterSet &pset)
global_constant_per_sl sl3
int from_two_comp(int val, int size)
std::map< int, lut_value > calc_atan_lut(int, int, double, double, double, int, int, int, int, int)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29