1 #ifndef L1Trigger_Phase2L1ParticleFlow_TAUNNIDHW_H_ 2 #define L1Trigger_Phase2L1ParticleFlow_TAUNNIDHW_H_ 27 typedef ap_ufixed<16, 14>
pt_t;
36 typedef ap_ufixed<16, 14>
pt_t;
59 constexpr
int pow2(
int x) {
return x == 0 ? 1 : 2 *
pow2(
x - 1); }
61 template <
class data_T,
int N>
69 x(
x.width - 2,
x.width - NB - 1) =
i;
73 template <
class data_T,
int N>
79 ap_uint<NB> y =
x(
x.width - 2,
x.width - NB - 1);
80 return (
unsigned)y(NB - 1, 0);
83 template <
class data_T,
class table_T,
int N>
86 for (
unsigned i = 0;
i <
N;
i++) {
87 float x = real_val_from_idx<data_T, N>(
i);
88 table_T inv_x = 1 /
x;
93 template <
class in_t,
class table_t,
int N>
96 init_invert_table<in_t, table_t, N>(inv_table);
100 for (
int b = 0;
b <
in.width;
b++) {
105 in_t in_shifted =
in << (
in.width - msb - 1);
107 int idx = idx_from_real_val<in_t, N>(in_shifted);
108 table_t inv_in = inv_table[
idx];
110 table_t
out = inv_in << (
in.width - msb - 1);
137 bool ret = (deta * deta + dphi * dphi) < cone2;
detaphi_t deltaPhi(l1t::PFCandidate a, l1t::PFCandidate b)
result_t compute(const l1t::PFCandidate &iSeed, std::vector< l1t::PFCandidate > &iParts)
static constexpr int N_table_inv_pt
static const etaphi_t FIDUCIAL_ETA_PHI
static constexpr float etaphi_base
ret
prodAgent to be discontinued
ap_ufixed< 18, -2 > inv_pt_t
ap_fixed< 12, 6 > detaphi_t
static const detaphi_t HALFPI
constexpr int pow2(int x)
float real_val_from_idx(unsigned i)
static const detaphi_t RCONE
ap_fixed< 22, 16 > pt_etaphi_t
unique_ptr< etaphi_t[]> fPhi_
unique_ptr< etaphi_t[]> fEta_
constexpr int ceillog2(int x)
unsigned idx_from_real_val(data_T x)
ap_fixed< 18, 9 > detaphi2_t
std::vector< input_t > NNvectorVar_
void init_invert_table(table_T table_out[N])
table_t invert_with_shift(in_t in, bool debug=false)
static const detaphi_t TWOPI
ap_fixed< 10, 4 > etaphi_t
constexpr int INTPHI_TWOPI
ap_fixed< 16, 8 > result_t
bool inCone(l1t::PFCandidate seed, l1t::PFCandidate part, detaphi_t cone2)
void initialize(const std::string &iName, int iNParticles)
ap_fixed< 10, 4 > etaphi_t
static const detaphi_t R2CONE
constexpr int floorlog2(int x)