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 
14 
16 
18 
19 #include <cmath>
20 #include <fstream>
21 #include <iostream>
22 
23 // ===============================================================================
24 // Previous definitions and declarations
25 // ===============================================================================
26 
27 struct lut_value {
28  long int a;
29  long int b;
30 };
31 
32 struct lut_group {
33  std::map<int, lut_value> phic;
34  std::map<int, lut_value> phi1;
35  std::map<int, lut_value> phi3;
36  std::map<int, lut_value> phib;
37 };
38 
40  double perp;
41  double x_phi0;
42 };
43 
45  uint32_t chid;
48 };
49 
50 // ===============================================================================
51 // Class declarations
52 // ===============================================================================
53 
55 public:
58 
59  void generate_luts();
60  std::vector<double> get_global_coordinates(uint32_t, int, int, int);
61 
62 private:
63  std::map<int, lut_value> calc_atan_lut(int, int, double, double, double, int, int, int, int, int);
64  // utilities to go to and from 2 complement
65  int to_two_comp(int val, int size) {
66  if (val >= 0)
67  return val;
68  return std::pow(2, size) + val;
69  }
70 
71  int from_two_comp(int val, int size) { return val - ((2 * val) & (1 << size)); }
72 
73  // attributes
76  std::vector<global_constant> global_constants;
77  std::map<uint32_t, lut_group> luts;
78 };
79 
80 #endif
lut_group
Definition: GlobalCoordsObtainer.h:32
lut_value::a
long int a
Definition: GlobalCoordsObtainer.h:28
MessageLogger.h
ESHandle.h
GlobalCoordsObtainer::GlobalCoordsObtainer
GlobalCoordsObtainer(const edm::ParameterSet &pset)
Definition: GlobalCoordsObtainer.cc:9
GlobalCoordsObtainer::global_coords_filename_
edm::FileInPath global_coords_filename_
Definition: GlobalCoordsObtainer.h:75
global_constant_per_sl::perp
double perp
Definition: GlobalCoordsObtainer.h:40
global_constant_per_sl
Definition: GlobalCoordsObtainer.h:39
GlobalCoordsObtainer::global_constants
std::vector< global_constant > global_constants
Definition: GlobalCoordsObtainer.h:76
GlobalCoordsObtainer::generate_luts
void generate_luts()
Definition: GlobalCoordsObtainer.cc:43
global_constant::chid
uint32_t chid
Definition: GlobalCoordsObtainer.h:45
GlobalCoordsObtainer::get_global_coordinates
std::vector< double > get_global_coordinates(uint32_t, int, int, int)
Definition: GlobalCoordsObtainer.cc:197
ESGetToken.h
lut_group::phi3
std::map< int, lut_value > phi3
Definition: GlobalCoordsObtainer.h:35
edm::FileInPath
Definition: FileInPath.h:64
GlobalCoordsObtainer
Definition: GlobalCoordsObtainer.h:54
constants.h
global_constant::sl1
global_constant_per_sl sl1
Definition: GlobalCoordsObtainer.h:46
GlobalCoordsObtainer::cmssw_for_global_
bool cmssw_for_global_
Definition: GlobalCoordsObtainer.h:74
Run.h
lut_group::phic
std::map< int, lut_value > phic
Definition: GlobalCoordsObtainer.h:33
DTChamberId.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
GlobalCoordsObtainer::~GlobalCoordsObtainer
~GlobalCoordsObtainer()
Definition: GlobalCoordsObtainer.cc:41
GlobalCoordsObtainer::to_two_comp
int to_two_comp(int val, int size)
Definition: GlobalCoordsObtainer.h:65
GlobalCoordsObtainer::calc_atan_lut
std::map< int, lut_value > calc_atan_lut(int, int, double, double, double, int, int, int, int, int)
Definition: GlobalCoordsObtainer.cc:96
FrameworkfwdMostUsed.h
lut_group::phib
std::map< int, lut_value > phib
Definition: GlobalCoordsObtainer.h:36
lut_value::b
long int b
Definition: GlobalCoordsObtainer.h:29
heppy_batch.val
val
Definition: heppy_batch.py:351
Frameworkfwd.h
global_constant
Definition: GlobalCoordsObtainer.h:44
global_constant::sl3
global_constant_per_sl sl3
Definition: GlobalCoordsObtainer.h:47
GlobalCoordsObtainer::luts
std::map< uint32_t, lut_group > luts
Definition: GlobalCoordsObtainer.h:77
EventSetup.h
GlobalCoordsObtainer::from_two_comp
int from_two_comp(int val, int size)
Definition: GlobalCoordsObtainer.h:71
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
ConsumesCollector.h
ParameterSet.h
global_constant_per_sl::x_phi0
double x_phi0
Definition: GlobalCoordsObtainer.h:41
lut_value
Definition: GlobalCoordsObtainer.h:27
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
lut_group::phi1
std::map< int, lut_value > phi1
Definition: GlobalCoordsObtainer.h:34