|
|
Go to the documentation of this file. 1 #ifndef L1Trigger_Phase2L1ParticleFlow_PFALGO_COMMON_REF_H
2 #define L1Trigger_Phase2L1ParticleFlow_PFALGO_COMMON_REF_H
4 #include "../firmware/data.h"
5 #include "../firmware/pfalgo_common.h"
9 inline int sqr(
const T &
t) {
13 template <
typename CO_t>
29 unsigned int nSelCalo,
30 unsigned int dR2Max_Tk_Mu,
31 unsigned int dR2Max_Tk_Calo,
32 unsigned int tk_MaxInvPt_Loose,
33 unsigned int tk_MaxInvPt_Tight)
55 template <
typename CO_t>
60 int dptscale = (dR2MAX << 8) / std::max<int>(1,
sqr(
track.hwPtErr));
61 int drmin = 0, ibest = -1;
62 for (
int ic = 0; ic < nCAL; ++ic) {
63 if (
calo[ic].hwPt <= caloPtMin)
68 dr += ((
sqr(std::max<int>(
track.hwPt -
calo[ic].hwPt, 0)) * dptscale) >> 8);
69 if (ibest == -1 ||
dr < drmin) {
77 template <
typename T,
typename TV>
79 for (
int iout = 0; iout < nOut; ++iout) {
82 for (
int it = 0; it < nIn; ++it) {
83 for (
int iout = 0; iout < nOut; ++iout) {
84 if (
in[it].hwPt >=
out[iout].hwPt) {
85 for (
int i2 = nOut - 1;
i2 > iout; --
i2) {
unsigned int dR2MAX_TK_MU
void pfalgo_mu_ref(const pfalgo_config &cfg, const TkObj track[], const MuObj mu[], bool isMu[], PFChargedObj outmu[], bool debug)
void ptsort_ref(int nIn, int nOut, const T in[], T out[])
pfalgo_config(unsigned int nTrack, unsigned int nCalo, unsigned int nMu, unsigned int nSelCalo, unsigned int dR2Max_Tk_Mu, unsigned int dR2Max_Tk_Calo, unsigned int tk_MaxInvPt_Loose, unsigned int tk_MaxInvPt_Tight)
unsigned int dR2MAX_TK_CALO
int dr2_int(etaphi_t eta1, etaphi_t phi1, etaphi_t eta2, etaphi_t phi2)
unsigned int tk_MAXINVPT_LOOSE
int best_match_with_pt_ref(int nCAL, int dR2MAX, const CO_t calo[], const TkObj &track)
unsigned int tk_MAXINVPT_TIGHT