49 std::pair<std::vector<L1SCJetEmu::Particle>, std::unordered_map<const l1t::PFCandidate*, edm::Ptr<l1t::PFCandidate>>>
53 std::vector<L1SCJetEmu::Jet> hwJets,
59 nJets(
cfg.getParameter<unsigned>(
"nJets")),
65 produces<l1t::PFJetCollection>();
80 std::vector<edm::Ptr<l1t::PFCandidate>>
particles;
81 for (
unsigned i = 0;
i < (*l1PFCandidates).size();
i++) {
85 std::vector<l1t::PFJet>
jets;
93 newPFJetCollection->swap(
jets);
107 float pt = std::accumulate(
parts.begin(),
parts.end(), 0., sumpt);
110 std::vector<float> pt_deta;
111 pt_deta.resize(
parts.size());
116 float eta = std::accumulate(pt_deta.begin() + 1, pt_deta.end(),
seed.eta());
119 std::vector<float> pt_dphi;
120 pt_dphi.resize(
parts.size());
125 float phi = std::accumulate(pt_dphi.begin() + 1, pt_dphi.end(),
seed.phi());
128 for (
auto it =
parts.begin(); it !=
parts.end(); it++) {
129 jet.addConstituent(*it);
142 return (
i->pt() >
j->pt());
144 std::vector<l1t::PFJet>
jets;
150 std::vector<edm::Ptr<l1t::PFCandidate>> particlesInCone;
153 return reco::deltaR<l1t::PFCandidate, l1t::PFCandidate>(*
seed, *
part) <=
coneSize;
157 work.erase(std::remove_if(
work.begin(),
160 return reco::deltaR<l1t::PFCandidate, l1t::PFCandidate>(*
seed, *
part) <=
coneSize;
170 std::pair<std::vector<L1SCJetEmu::Particle>, std::unordered_map<const l1t::PFCandidate*, edm::Ptr<l1t::PFCandidate>>>
176 std::pair<std::vector<L1SCJetEmu::Particle>, std::unordered_map<const l1t::PFCandidate*, edm::Ptr<l1t::PFCandidate>>>
178 std::vector<l1ct::PuppiObjEmu> hwParticles;
179 std::unordered_map<const l1t::PFCandidate*, edm::Ptr<l1t::PFCandidate>> candidateMap;
184 candidateMap.insert(std::make_pair(edmParticle.get(), edmParticle));
185 hwParticles.push_back(particle);
187 return std::make_pair(hwParticles, candidateMap);
191 std::vector<L1SCJetEmu::Jet> hwJets,
193 std::vector<l1t::PFJet> edmJets;
197 jet.hwPt = correctedPt;
210 std::vector<edm::Ptr<l1t::PFCandidate>> constituents;
211 std::for_each(
jet.constituents.begin(),
jet.constituents.end(), [&](
auto constituent) {
214 edmJets.push_back(edmJet);
222 desc.add<uint32_t>(
"nJets", 16);
223 desc.add<
double>(
"coneSize", 0.4);
224 desc.add<
bool>(
"HW",
false);
225 desc.add<
bool>(
"debug",
false);
226 desc.add<
bool>(
"doCorrections",
false);
constexpr double deltaPhi(double phi1, double phi2)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
float floatPhi(phi_t phi)
float floatEta(eta_t eta)
std::vector< l1t::PFJet > processEvent_SW(std::vector< edm::Ptr< l1t::PFCandidate >> &parts) const
l1tpf::corrector corrector
float correctedPt(float et, float emEt, float eta) const
l1t::PFJet makeJet_SW(const std::vector< edm::Ptr< l1t::PFCandidate >> &parts) const
static void fillDescriptions(edm::ConfigurationDescriptions &description)
~L1SeedConePFJetProducer() override
void setEncodedJet(const HWEncoding encoding, const PackedJet jet)
T get() const
get a component
const l1t::PFCandidate * srcCand
std::vector< l1t::PFJet > PFJetCollection
std::pair< std::vector< L1SCJetEmu::Particle >, std::unordered_map< const l1t::PFCandidate *, edm::Ptr< l1t::PFCandidate > > > convertEDMToHW(std::vector< edm::Ptr< l1t::PFCandidate >> &edmParticles) const
#define DEFINE_FWK_MODULE(type)
L1SeedConePFJetProducer(const edm::ParameterSet &)
std::vector< Jet > emulateEvent(std::vector< Particle > &parts) const
void addConstituent(const edm::Ptr< l1t::PFCandidate > &cand)
adds a candidate to this cluster; note that this only records the information, it's up to you to also...
void initFromBits(const ap_uint< BITWIDTH > &src)
std::vector< l1t::PFJet > processEvent_HW(std::vector< edm::Ptr< l1t::PFCandidate >> &parts) const
const float coneSize
///////////////// ///
std::vector< l1t::PFJet > convertHWToEDM(std::vector< L1SCJetEmu::Jet > hwJets, std::unordered_map< const l1t::PFCandidate *, edm::Ptr< l1t::PFCandidate >> constituentMap) const
edm::EDGetTokenT< std::vector< l1t::PFCandidate > > l1PFToken
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override