#include <GlobalCoordsObtainer.h>
|
std::map< int, lut_value > | calc_atan_lut (int, int, double, double, double, int, int, int, int, int) |
|
int | from_two_comp (int val, int size) |
|
int | to_two_comp (int val, int size) |
|
Definition at line 53 of file GlobalCoordsObtainer.h.
◆ GlobalCoordsObtainer()
◆ ~GlobalCoordsObtainer()
GlobalCoordsObtainer::~GlobalCoordsObtainer |
( |
| ) |
|
◆ calc_atan_lut()
std::map< int, lut_value > GlobalCoordsObtainer::calc_atan_lut |
( |
int |
msb_num, |
|
|
int |
lsb_num, |
|
|
double |
in_res, |
|
|
double |
abscissa_0, |
|
|
double |
out_res, |
|
|
int |
a_extra_bits, |
|
|
int |
b_extra_bits, |
|
|
int |
a_size, |
|
|
int |
b_size, |
|
|
int |
sgn |
|
) |
| |
|
private |
Definition at line 96 of file GlobalCoordsObtainer.cc.
References a, b, cms::cuda::bs, createfilelist::int, funct::pow(), FWPFMaths::sgn(), jetsAK4_CHS_cff::sort, mathSSE::sqrt(), RandomServiceHelper::t1, RandomServiceHelper::t2, testProducerWithPsetDescEmpty_cfi::y1, and testProducerWithPsetDescEmpty_cfi::y2.
120 long int a_min = -
std::pow(2, (a_size - 1));
121 long int a_max =
std::pow(2, (a_size - 1)) - 1;
122 long int b_min = -
std::pow(2, (b_size - 1));
123 long int b_max =
std::pow(2, (b_size - 1)) - 1;
125 std::map<int, lut_value> lut;
127 for (
long int x_msb = -(
long int)
std::pow(2, msb_num - 1); x_msb < (
long int)
std::pow(2, msb_num - 1); x_msb++) {
128 int x1 = ((x_msb) << lsb_num);
129 int x2 = ((x_msb + 1) << lsb_num) - 1;
131 double t1 =
x1 * in_res - abscissa_0;
132 double t2 =
x2 * in_res - abscissa_0;
134 double phi1 =
sgn * atan(
t1);
135 double phi2 =
sgn * atan(
t2);
137 double y1 = phi1 / out_res;
138 double y2 = phi2 / out_res;
152 double t_max_err =
sqrt(
sgn * in_res / out_res /
a - 1);
157 double x_max_err = (t_max_err + abscissa_0) / in_res;
158 double phi_max_err =
sgn * atan(t_max_err);
159 double y_max_err = phi_max_err / out_res;
166 double b = (
y1 + y_max_err -
a * (x_max_err -
x1)) / 2;
173 long int a_int = (
long int)(round(
a * (
pow(2, a_extra_bits))));
174 long int b_int = (
long int)(round(
b * (
pow(2, b_extra_bits))));
177 std::vector<long int> as = {a_min, a_int, a_max};
178 std::vector<long int>
bs = {b_min, b_int, b_max};
192 lut[
index] = {a_int, b_int};
int to_two_comp(int val, int size)
Power< A, B >::type pow(const A &a, const B &b)
◆ from_two_comp()
int GlobalCoordsObtainer::from_two_comp |
( |
int |
val, |
|
|
int |
size |
|
) |
| |
|
inlineprivate |
◆ generate_luts()
void GlobalCoordsObtainer::generate_luts |
( |
| ) |
|
Definition at line 43 of file GlobalCoordsObtainer.cc.
References IntegrityClient_cfi::ChId, global_constant::chid, global_constant_per_sl::perp, funct::pow(), FWPFMaths::sgn(), global_constant::sl1, global_constant::sl3, and global_constant_per_sl::x_phi0.
48 if (
ChId.wheel() > 0 || (
ChId.wheel() == 0 &&
ChId.sector() % 4 > 1)) {
90 auto phib =
calc_atan_lut(9, 6, 1. / 4096, 0., 4. /
std::pow(2, 13), 10, 3, 10, 16,
sgn);
global_constant_per_sl sl1
std::vector< global_constant > global_constants
std::map< uint32_t, lut_group > luts
global_constant_per_sl sl3
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)
◆ get_global_coordinates()
std::vector< double > GlobalCoordsObtainer::get_global_coordinates |
( |
uint32_t |
chid, |
|
|
int |
sl, |
|
|
int |
x, |
|
|
int |
tanpsi |
|
) |
| |
Definition at line 197 of file GlobalCoordsObtainer.cc.
References createfilelist::int, cmsdt::PHI_B_SHL_BITS, cmsdt::PHI_LUT_ADDR_WIDTH, cmsdt::PHI_MULT_SHR_BITS, cmsdt::PHI_PHIB_RES_DIFF_BITS, cmsdt::PHI_SIZE, cmsdt::PHIB_B_SHL_BITS, cmsdt::PHIB_LUT_ADDR_WIDTH, cmsdt::PHIB_MULT_SHR_BITS, cmsdt::PHIB_SIZE, funct::pow(), cmsdt::TANPSI_SIZE, trackerHitRTTI::vector, x, and cmsdt::X_SIZE.
201 auto phi_lut = &
luts[chid].phic;
203 phi_lut = &
luts[chid].phi1;
204 }
else if (sl == 3) {
205 phi_lut = &
luts[chid].phi3;
208 auto phib_lut = &
luts[chid].phib;
242 auto phi_lut_a = phi_lut_q.a;
243 auto phi_lut_b = phi_lut_q.b;
244 auto phib_lut_a = phib_lut_q.a;
245 auto phib_lut_b = phib_lut_q.b;
250 int phi_uncut = (phi_lut_b <<
PHI_B_SHL_BITS) + x_lsb * phi_lut_a;
251 int psi_uncut = (phib_lut_b <<
PHIB_B_SHL_BITS) + tanpsi_lsb * phib_lut_a;
constexpr int PHI_LUT_ADDR_WIDTH
constexpr int PHI_PHIB_RES_DIFF_BITS
constexpr int PHIB_B_SHL_BITS
int to_two_comp(int val, int size)
constexpr int PHI_B_SHL_BITS
std::map< uint32_t, lut_group > luts
constexpr int PHIB_LUT_ADDR_WIDTH
constexpr int PHI_MULT_SHR_BITS
constexpr int TANPSI_SIZE
int from_two_comp(int val, int size)
constexpr int PHIB_MULT_SHR_BITS
Power< A, B >::type pow(const A &a, const B &b)
◆ to_two_comp()
int GlobalCoordsObtainer::to_two_comp |
( |
int |
val, |
|
|
int |
size |
|
) |
| |
|
inlineprivate |
◆ cmssw_for_global_
bool GlobalCoordsObtainer::cmssw_for_global_ |
|
private |
◆ global_constants
◆ global_coords_filename_
◆ luts
std::map<uint32_t, lut_group> GlobalCoordsObtainer::luts |
|
private |