1 #ifndef L1Trigger_Phase2L1ParticleFlow_HTMHT_h 2 #define L1Trigger_Phase2L1ParticleFlow_HTMHT_h 38 c.pt = this->pt +
b.pt;
39 c.px = this->px +
b.px;
40 c.py = this->py +
b.py;
49 template <
class data_T,
class table_T,
int N>
51 for (
int i = 0;
i <
N;
i++) {
52 float x =
i * (
M_PI / 180.) / 2.;
57 template <
class in_t,
class table_t,
int N>
60 init_sinphi_table<in_t, table_t, N>(sin_table);
67 ap_fixed<12, 3> phi = atan2(y.to_double(),
x.to_double());
69 ap_fixed<12, 3> phi = hls::atan2(y,
x);
72 return phi * etaphiscale;
81 init_sinphi_table<etaphi_t, cossin_t, N_TABLE>(sin_table);
92 phi = (phi > 0) ? phi : (ap_int<10>)-phi;
94 sinphi = sin_table[phi];
97 cosphi = sin_table[phi + 90 * 2];
100 v_pxpy.
py =
jet.hwPt * sinphi;
101 v_pxpy.
px =
jet.hwPt * cosphi;
110 std::vector<P2L1HTMHTEmu::PtPxPy> ptpxpy;
111 ptpxpy.resize(
jets.size());
120 ht.hwSumPt = hthxhy.pt;
121 #ifdef CMSSW_GIT_HASH 123 sqrt(((hthxhy.px * hthxhy.px) + (hthxhy.py * hthxhy.py)).to_double());
125 ht.hwPt =
hls::sqrt(((hthxhy.px * hthxhy.px) + (hthxhy.py * hthxhy.py)));
PtPxPy operator+(const PtPxPy &b) const
l1ct::Sum htmht(std::vector< l1ct::Jet > jets)
Sin< T >::type sin(const T &t)
etaphi_t phi_cordic(pxy_t y, pxy_t x)
const ap_fixed< 12, -4 > scale_degToRad
ap_fixed< 9, 2 > cossin_t
ap_ufixed< 14, 12, AP_TRN, AP_SAT > pt_t
void init_sinphi_table(table_T table_out[N])
static constexpr int N_TABLE
PtPxPy mht_compute(l1ct::Jet jet)
ap_fixed< 12, 3 > radians_t
table_t sine_with_conversion(etaphi_t hwPhi)