1 #ifndef PFTKEGALGO_REF_H 2 #define PFTKEGALGO_REF_H 43 ap_int<z0_t::width + 1>
dZ;
60 unsigned int nTrack_in,
61 unsigned int nEmCalo_in,
72 const std::vector<double> &
dEtaValues = {0.015, 0.01},
73 const std::vector<double> &
dPhiValues = {0.07, 0.07},
136 void link_emCalo2emCalo(
const std::vector<EmCaloObjEmu> &emcalo, std::vector<int> &emCalo2emCalo)
const;
139 const std::vector<EmCaloObjEmu> &emcalo,
140 const std::vector<TkObjEmu> &
track,
141 std::vector<int> &emCalo2tk)
const;
144 float deltaPhi(
float phi1,
float phi2)
const;
147 const std::vector<EmCaloObjEmu> &emcalo,
148 std::vector<EmCaloObjEmu> &emcalo_sel)
const;
151 const std::vector<EmCaloObjEmu> &emcalo,
152 const std::vector<TkObjEmu> &
track,
153 const std::vector<int> &emCalo2emCalo,
154 const std::vector<int> &emCalo2tk,
155 std::vector<EGObjEmu> &egstas,
156 std::vector<EGIsoObjEmu> &egobjs,
157 std::vector<EGIsoEleObjEmu> &egeleobjs)
const;
160 std::vector<EGIsoObjEmu> &egobjs,
161 std::vector<EGIsoEleObjEmu> &egeleobjs,
162 const std::vector<EmCaloObjEmu> &emcalo,
163 const std::vector<TkObjEmu> &
track,
165 const unsigned int hwQual,
168 const std::vector<unsigned int> &
components = {})
const;
171 const EmCaloObjEmu &
calo,
172 const unsigned int hwQual,
174 const std::vector<unsigned int> &
components)
const;
176 EGIsoObjEmu &
addEGIsoToPF(std::vector<EGIsoObjEmu> &egobjs,
177 const EmCaloObjEmu &
calo,
178 const unsigned int hwQual,
179 const pt_t ptCorr)
const;
182 const EmCaloObjEmu &
calo,
183 const TkObjEmu &
track,
184 const unsigned int hwQual,
185 const pt_t ptCorr)
const;
188 template <
typename T>
191 for (
int iout = 0; iout <
nOut; ++iout) {
194 for (
int it = 0; it <
nIn; ++it) {
195 for (
int iout = 0; iout <
nOut; ++iout) {
196 if (
in[it].hwPt >=
out[iout].hwPt) {
207 template <
typename T>
210 return dr2_int(charged.hwVtxEta(), charged.hwVtxPhi(), egphoton.
hwEta, egphoton.
hwPhi);
213 template <
typename T>
227 template <
typename T>
229 ap_int<z0_t::width + 1>
delta = charged.hwZ0 - z0;
235 template <
typename T>
237 ap_int<z0_t::width + 1>
delta = charged.hwZ0 - egele.
hwZ0;
243 template <
typename TCH,
typename TEG>
246 const std::vector<TCH> &
objects,
247 unsigned int nMaxObj,
251 for (
unsigned int itk = 0; itk < std::min<unsigned>(
objects.size(), nMaxObj); ++itk) {
268 template <
typename TEG>
271 const std::vector<PFNeutralObjEmu> &
objects,
272 unsigned int nMaxObj,
276 for (
unsigned int itk = 0; itk < std::min<unsigned>(
objects.size(), nMaxObj); ++itk) {
293 const std::vector<TkObjEmu> &
objects,
297 const std::vector<TkObjEmu> &
objects,
301 const std::vector<PFChargedObjEmu> &charged,
302 const std::vector<PFNeutralObjEmu> &neutrals,
306 const std::vector<PFChargedObjEmu> &charged,
307 const std::vector<PFNeutralObjEmu> &neutrals,
void sel_emCalo(unsigned int nmax_sel, const std::vector< EmCaloObjEmu > &emcalo, std::vector< EmCaloObjEmu > &emcalo_sel) const
virtual ~PFTkEGAlgoEmulator()
void link_emCalo2tk(const PFRegionEmu &r, const std::vector< EmCaloObjEmu > &emcalo, const std::vector< TkObjEmu > &track, std::vector< int > &emCalo2tk) const
PFTkEGAlgoEmuConfig(const edm::ParameterSet &iConfig)
void setDebug(int verbose)
int deltaR2(const T &charged, const EGIsoEleObjEmu &egele) const
int dr2_int(eta_t eta1, phi_t phi1, eta_t eta2, phi_t phi2)
float deltaPhi(float phi1, float phi2) const
IsoParameters tkIsoParams_tkEle
void compute_sumPt(iso_t &sumPt, iso_t &sumPtPV, const std::vector< PFNeutralObjEmu > &objects, unsigned int nMaxObj, const TEG &egobj, const PFTkEGAlgoEmuConfig::IsoParameters ¶ms, z0_t z0) const
ap_int< z0_t::width+1 > deltaZ0(const T &charged, const EGIsoObjEmu &egphoton, z0_t z0) const
bool writeBeforeBremRecovery
IsoParameters(float tkQualityPtMin, float dZ, float dRMin, float dRMax)
pt_t makePtFromFloat(float pt)
IsoParameters tkIsoParams_tkEm
IsoParameters(const edm::ParameterSet &)
EGObjEmu & addEGStaToPF(std::vector< EGObjEmu > &egobjs, const EmCaloObjEmu &calo, const unsigned int hwQual, const pt_t ptCorr, const std::vector< unsigned int > &components) const
void runIso(const PFInputRegion &in, const std::vector< l1ct::PVObjEmu > &pvs, OutputRegion &out) const
int makeDR2FromFloatDR(float dr)
ap_ufixed< 11, 9, AP_TRN, AP_SAT > iso_t
void toFirmware(const PFInputRegion &in, PFRegion ®ion, EmCaloObj calo[], TkObj track[]) const
PFTkEGAlgoEmulator(const PFTkEGAlgoEmuConfig &config)
void eg_algo(const PFRegionEmu ®ion, const std::vector< EmCaloObjEmu > &emcalo, const std::vector< TkObjEmu > &track, const std::vector< int > &emCalo2emCalo, const std::vector< int > &emCalo2tk, std::vector< EGObjEmu > &egstas, std::vector< EGIsoObjEmu > &egobjs, std::vector< EGIsoEleObjEmu > &egeleobjs) const
ap_int< z0_t::width+1 > deltaZ0(const T &charged, const EGIsoEleObjEmu &egele, z0_t z0) const
EGIsoEleObjEmu & addEGIsoEleToPF(std::vector< EGIsoEleObjEmu > &egobjs, const EmCaloObjEmu &calo, const TkObjEmu &track, const unsigned int hwQual, const pt_t ptCorr) const
IsoParameters pfIsoParams_tkEm
void run(const PFInputRegion &in, OutputRegion &out) const
std::vector< double > dEtaValues
int deltaR2(const PFNeutralObjEmu &neutral, const EGIsoObjEmu &egphoton) const
void compute_isolation(std::vector< EGIsoObjEmu > &egobjs, const std::vector< TkObjEmu > &objects, const PFTkEGAlgoEmuConfig::IsoParameters ¶ms, z0_t z0) const
EGIsoObjEmu & addEGIsoToPF(std::vector< EGIsoObjEmu > &egobjs, const EmCaloObjEmu &calo, const unsigned int hwQual, const pt_t ptCorr) const
int deltaR2(const PFNeutralObjEmu &neutral, const EGIsoEleObjEmu &egele) const
ap_ufixed< 14, 12, AP_TRN, AP_SAT > pt_t
PFTkEGAlgoEmuConfig(unsigned int nTrack, unsigned int nTrack_in, unsigned int nEmCalo_in, unsigned int nEmOut, bool filterHwQuality, bool doBremRecovery, bool writeBeforeBremRecovery=false, int caloHwQual=4, bool doEndcapHwQual=false, float emClusterPtMin=2., float dEtaMaxBrem=0.02, float dPhiMaxBrem=0.1, const std::vector< double > &absEtaBoundaries={0.0, 1.5}, const std::vector< double > &dEtaValues={0.015, 0.01}, const std::vector< double > &dPhiValues={0.07, 0.07}, float trkQualityPtMin=10., bool writeEgSta=false, const IsoParameters &tkIsoParams_tkEle={2., 0.6, 0.03, 0.2}, const IsoParameters &tkIsoParams_tkEm={2., 0.6, 0.07, 0.3}, const IsoParameters &pfIsoParams_tkEle={1., 0.6, 0.03, 0.2}, const IsoParameters &pfIsoParams_tkEm={1., 0.6, 0.07, 0.3}, bool doTkIso=true, bool doPfIso=false, EGIsoEleObjEmu::IsoType hwIsoTypeTkEle=EGIsoEleObjEmu::IsoType::TkIso, EGIsoObjEmu::IsoType hwIsoTypeTkEm=EGIsoObjEmu::IsoType::TkIsoPV, int debug=0)
ap_int< z0_t::width+1 > dZ
int deltaR2(const T &charged, const EGIsoObjEmu &egphoton) const
void addEgObjsToPF(std::vector< EGObjEmu > &egstas, std::vector< EGIsoObjEmu > &egobjs, std::vector< EGIsoEleObjEmu > &egeleobjs, const std::vector< EmCaloObjEmu > &emcalo, const std::vector< TkObjEmu > &track, const int calo_idx, const unsigned int hwQual, const pt_t ptCorr, const int tk_idx, const std::vector< unsigned int > &components={}) const
EGIsoEleObjEmu::IsoType hwIsoTypeTkEle
IsoParameters pfIsoParams_tkEle
std::vector< double > dPhiValues
void link_emCalo2emCalo(const std::vector< EmCaloObjEmu > &emcalo, std::vector< int > &emCalo2emCalo) const
std::vector< double > absEtaBoundaries
void ptsort_ref(int nIn, int nOut, const std::vector< T > &in, std::vector< T > &out) const
EGIsoObjEmu::IsoType hwIsoTypeTkEm
void compute_sumPt(iso_t &sumPt, iso_t &sumPtPV, const std::vector< TCH > &objects, unsigned int nMaxObj, const TEG &egobj, const PFTkEGAlgoEmuConfig::IsoParameters ¶ms, z0_t z0) const
unsigned int nEMCALO_EGIN