1 #ifndef L1Trigger_Phase2L1ParticleFlow_TAUNNIDHW_H_ 2 #define L1Trigger_Phase2L1ParticleFlow_TAUNNIDHW_H_ 13 typedef ap_ufixed<16, 14>
pt_t;
28 typedef ap_ufixed<14, 12, AP_TRN, AP_SAT>
pt_t;
53 template <
class data_T,
int N>
61 x(
x.width - 2,
x.width - NB - 1) =
i;
65 template <
class data_T,
int N>
71 ap_uint<NB> y =
x(
x.width - 2,
x.width - NB - 1);
72 return (
unsigned)y(NB - 1, 0);
75 template <
class data_T,
class table_T,
int N>
78 for (
unsigned i = 0;
i <
N;
i++) {
79 float x = real_val_from_idx<data_T, N>(
i);
80 table_T inv_x = 1 /
x;
85 template <
class in_t,
class table_t,
int N>
88 init_invert_table<in_t, table_t, N>(inv_table);
92 for (
int b = 0;
b <
in.width;
b++) {
97 in_t in_shifted =
in << (
in.width - msb - 1);
99 int idx = idx_from_real_val<in_t, N>(in_shifted);
100 table_t inv_in = inv_table[
idx];
102 table_t
out = inv_in << (
in.width - msb - 1);
129 bool ret = (deta * deta + dphi * dphi) < cone2;
detaphi_t deltaPhi(l1t::PFCandidate a, l1t::PFCandidate b)
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< 16, 6 > result_t
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_
ap_fixed< 16, 10 > input_t
void init_invert_table(table_T table_out[N])
table_t invert_with_shift(in_t in, bool debug=false)
Tau_NN_Result EvaluateNN()
ap_ufixed< 14, 12, AP_TRN, AP_SAT > pt_t
static const detaphi_t TWOPI
ap_fixed< 10, 4 > etaphi_t
constexpr int INTPHI_TWOPI
bool inCone(l1t::PFCandidate seed, l1t::PFCandidate part, detaphi_t cone2)
Tau_NN_Result compute(const l1t::PFCandidate &iSeed, std::vector< l1t::PFCandidate > &iParts)
result_t nn_pt_correction
void initialize(const std::string &iName, int iNParticles)
ap_fixed< 10, 4 > etaphi_t
static const detaphi_t R2CONE
constexpr int floorlog2(int x)