6 : config_(pSet.getParameter<
std::
string>(
"pfIsoType"),
7 pSet.getParameter<double>(
"pfPtMin"),
8 pSet.getParameter<double>(
"dZ"),
9 pSet.getParameter<double>(
"dRMin"),
10 pSet.getParameter<double>(
"dRMax"),
11 pSet.getParameter<
bool>(
"pfCandReuse")) {}
17 outL1EGs.reserve(l1EGs.size());
21 std::list<const PuppiObj*> workPFCands;
22 std::list<const PuppiObj*> workPFCandsPV;
23 for (
const auto& l1PFCand : l1PFCands) {
24 workPFCands.emplace_back(&l1PFCand);
25 workPFCandsPV.emplace_back(&l1PFCand);
28 for (
const auto&
l1EG : l1EGs) {
32 if (!workPFCands.empty()) {
38 outL1EG.setHwIso(EGIsoObjEmu::IsoType::PfIso,
iso);
39 outL1EG.setHwIso(EGIsoObjEmu::IsoType::PfIsoPV, isoPV);
41 outL1EG.setHwIso(EGIsoObjEmu::IsoType::PuppiIso,
iso);
42 outL1EG.setHwIso(EGIsoObjEmu::IsoType::PuppiIsoPV, isoPV);
44 outL1EGs.emplace_back(outL1EG);
51 std::list<const PuppiObj*> workPFCands;
52 std::list<const PuppiObj*> workPFCandsPV;
53 for (
const auto& l1PFCand : l1PFCands) {
54 workPFCands.emplace_back(&l1PFCand);
55 workPFCandsPV.emplace_back(&l1PFCand);
58 for (
auto&
l1EG : l1EGs) {
61 if (!workPFCands.empty()) {
67 l1EG.setHwIso(EGIsoObjEmu::IsoType::PfIso,
iso);
68 l1EG.setHwIso(EGIsoObjEmu::IsoType::PfIsoPV, isoPV);
70 l1EG.setHwIso(EGIsoObjEmu::IsoType::PuppiIso,
iso);
71 l1EG.setHwIso(EGIsoObjEmu::IsoType::PuppiIsoPV, isoPV);
79 std::list<const PuppiObj*> workPFCands;
80 for (
const auto& l1PFCand : l1PFCands) {
81 workPFCands.emplace_back(&l1PFCand);
84 for (
auto& l1Ele : l1Eles) {
86 if (!workPFCands.empty()) {
91 l1Ele.setHwIso(EGIsoEleObjEmu::IsoType::PfIso,
iso);
93 l1Ele.setHwIso(EGIsoEleObjEmu::IsoType::PuppiIso,
iso);
101 auto pfIt = workPFCands.cbegin();
102 while (pfIt != workPFCands.cend()) {
104 const auto workPFCand = *pfIt;
106 if (workPFCand->hwId.charged()) {
107 pfCandZ0 = workPFCand->hwZ0();
111 ap_int<z0_t::width + 1>
dz = z0 - pfCandZ0;
116 if (workPFCand->intCharge() == 0 || (workPFCand->intCharge() != 0 &&
dz <
config_.
dZMax_)) {
117 const auto dR2 =
dr2_int(
l1EG.hwEta,
l1EG.hwPhi, workPFCand->hwEta, workPFCand->hwPhi);
119 sumPt += workPFCand->hwPt;
123 pfIt = workPFCands.erase(pfIt);
std::vector< EGIsoEleObjEmu > EGIsoEleObjsEmu
int dr2_int(eta_t eta1, phi_t phi1, eta_t eta2, phi_t phi2)
const L1EGPuppiIsoAlgoConfig config_
std::vector< PuppiObj > PuppiObjs
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
ap_ufixed< 11, 9, AP_TRN, AP_SAT > iso_t
L1EGPuppiIsoAlgo(const L1EGPuppiIsoAlgoConfig &config)
std::vector< EGIsoObjEmu > EGIsoObjsEmu
ap_int< z0_t::width+1 > dZMax_
void run(const EGIsoObjsEmu &l1EGs, const PuppiObjs &l1PFCands, EGIsoObjsEmu &outL1EGs, z0_t z0=0) const
iso_t calcIso(const EGIsoObj &l1EG, std::list< const PuppiObj *> &workPFCands, z0_t z0=0) const