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> phic;
33  std::map<int, lut_value> phi1;
34  std::map<int, lut_value> phi3;
35  std::map<int, lut_value> phib;
36 };
37 
39  double perp;
40  double x_phi0;
41 };
42 
44  uint32_t chid;
47 };
48 
49 // ===============================================================================
50 // Class declarations
51 // ===============================================================================
52 
54 public:
57 
58  void generate_luts();
59  std::vector<double> get_global_coordinates(uint32_t, int, int, int);
60 
61 private:
62  std::map<int, lut_value> calc_atan_lut(int, int, double, double, double, int, int, int, int, int);
63  // utilities to go to and from 2 complement
64  int to_two_comp(int val, int size) {
65  if (val >= 0)
66  return val;
67  return std::pow(2, size) + val;
68  }
69 
70  int from_two_comp(int val, int size) { return val - ((2 * val) & (1 << size)); }
71 
72  // attributes
75  std::vector<global_constant> global_constants;
76  std::map<uint32_t, lut_group> luts;
77 };
78 
79 #endif
size
Write out results.
edm::FileInPath global_coords_filename_
std::map< int, lut_value > phi1
std::map< int, lut_value > phic
global_constant_per_sl sl1
std::map< int, lut_value > phi3
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
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