1 #ifndef PFALGO_COMMON_REF_H 2 #define PFALGO_COMMON_REF_H 22 unsigned int dR2Max_Tk_Mu,
23 unsigned int dR2Max_Tk_Calo,
24 pt_t tk_MaxInvPt_Loose,
25 pt_t tk_MaxInvPt_Tight)
39 unsigned int nbins,
const float absetas[],
const float scales[],
const float offs[],
bool verbose =
false);
67 template <
typename COV>
70 template <
typename TV>
85 template <
typename COV>
89 const pt_t& trackCaloPtErr)
const {
90 pt_t caloPtMin =
track.hwPt - 2 * trackCaloPtErr;
95 int dr2min = 0, ibest = -1;
96 for (
int ic = 0, nCAL =
calo.size(); ic < nCAL; ++ic) {
103 dr2 +=
int((dpt * dpt) * dptscale);
104 if (ibest == -1 || dr2 < dr2min) {
112 template <
typename TV>
115 for (
int iout = 0; iout <
nOut; ++iout) {
118 for (
int it = 0; it <
nIn; ++it) {
119 for (
int iout = 0; iout <
nOut; ++iout) {
unsigned int dR2MAX_TK_MU_
unsigned int dR2MAX_TK_CALO_
void setDebug(bool debug=true)
int dr2_int(eta_t eta1, phi_t phi1, eta_t eta2, phi_t phi2)
virtual void mergeNeutrals(OutputRegion &out) const =0
moves all objects from out.pfphoton to the beginning of out.pfneutral
constexpr float INTPT_LSB
virtual ~PFAlgoEmulatorBase()
PFAlgoEmulatorBase(unsigned int nTrack, unsigned int nCalo, unsigned int nMu, unsigned int nSelCalo, unsigned int dR2Max_Tk_Mu, unsigned int dR2Max_Tk_Calo, pt_t tk_MaxInvPt_Loose, pt_t tk_MaxInvPt_Tight)
void loadPtErrBins(unsigned int nbins, const float absetas[], const float scales[], const float offs[], bool verbose=false)
void ptsort_ref(int nIn, int nOut, const TV &in, TV &out) const
ap_fixed< 10, 6 > ptErrOffs_t
ap_ufixed< 9, 1 > ptErrScale_t
std::vector< ptErrBin > ptErrBins_
virtual void run(const PFInputRegion &in, OutputRegion &out) const =0
ap_ufixed< 14, 12, AP_TRN, AP_SAT > pt_t
int best_match_with_pt_ref(int dR2MAX, const COV &calo, const TkObjEmu &track, const pt_t &trackCaloPtErr) const
pt_t ptErr_ref(const PFRegionEmu ®ion, const TkObjEmu &track) const
void pfalgo_mu_ref(const PFInputRegion &in, OutputRegion &out, std::vector< int > &iMu) const
ap_ufixed< 17, 17 - 4, AP_TRN, AP_SAT > ptscale_t
void fillPFCand(const TkObjEmu &track, PFChargedObjEmu &pf, bool isMu, bool isEle) const