43 static std::pair<std::vector<L1SCJetEmu::Particle>,
44 std::unordered_map<const l1t::PFCandidate*, edm::Ptr<l1t::PFCandidate>>>
48 std::vector<L1SCJetEmu::Jet> hwJets,
54 nJets(
cfg.getParameter<unsigned>(
"nJets")),
59 produces<l1t::PFJetCollection>();
70 std::vector<edm::Ptr<l1t::PFCandidate>>
particles;
71 for (
unsigned i = 0;
i < (*l1PFCandidates).size();
i++) {
75 std::vector<l1t::PFJet>
jets;
83 newPFJetCollection->swap(
jets);
97 float pt = std::accumulate(
parts.begin(),
parts.end(), 0., sumpt);
100 std::vector<float> pt_deta;
101 pt_deta.resize(
parts.size());
106 float eta = std::accumulate(pt_deta.begin() + 1, pt_deta.end(),
seed.eta());
109 std::vector<float> pt_dphi;
110 pt_dphi.resize(
parts.size());
115 float phi = std::accumulate(pt_dphi.begin() + 1, pt_dphi.end(),
seed.phi());
118 for (
auto it =
parts.begin(); it !=
parts.end(); it++) {
119 jet.addConstituent(*it);
128 return (
i->pt() >
j->pt());
130 std::vector<l1t::PFJet>
jets;
136 std::vector<edm::Ptr<l1t::PFCandidate>> particlesInCone;
139 return reco::deltaR<l1t::PFCandidate, l1t::PFCandidate>(*
seed, *
part) <=
coneSize;
143 work.erase(std::remove_if(
work.begin(),
146 return reco::deltaR<l1t::PFCandidate, l1t::PFCandidate>(*
seed, *
part) <=
coneSize;
156 std::pair<std::vector<L1SCJetEmu::Particle>, std::unordered_map<const l1t::PFCandidate*, edm::Ptr<l1t::PFCandidate>>>
162 std::pair<std::vector<L1SCJetEmu::Particle>, std::unordered_map<const l1t::PFCandidate*, edm::Ptr<l1t::PFCandidate>>>
164 std::vector<l1ct::PuppiObjEmu> hwParticles;
165 std::unordered_map<const l1t::PFCandidate*, edm::Ptr<l1t::PFCandidate>> candidateMap;
170 candidateMap.insert(std::make_pair(edmParticle.get(), edmParticle));
171 hwParticles.push_back(particle);
173 return std::make_pair(hwParticles, candidateMap);
177 std::vector<L1SCJetEmu::Jet> hwJets,
179 std::vector<l1t::PFJet> edmJets;
182 jet.floatPt(),
jet.floatEta(),
jet.floatPhi(), 0.,
jet.intPt(),
jet.intEta(),
jet.intPhi());
184 std::vector<edm::Ptr<l1t::PFCandidate>> constituents;
185 std::for_each(
jet.constituents.begin(),
jet.constituents.end(), [&](
auto constituent) {
186 edmJet.addConstituent(constituentMap[constituent.srcCand]);
189 edmJet.setEncodedJet(
jet.toGT().pack());
190 edmJets.push_back(edmJet);
constexpr double deltaPhi(double phi1, double phi2)
std::vector< l1t::PFJet > processEvent_SW(std::vector< edm::Ptr< l1t::PFCandidate >> &parts) const
l1t::PFJet makeJet_SW(const std::vector< edm::Ptr< l1t::PFCandidate >> &parts) const
~L1SeedConePFJetProducer() override
T get() const
get a component
const l1t::PFCandidate * srcCand
std::vector< l1t::PFJet > PFJetCollection
static std::vector< l1t::PFJet > convertHWToEDM(std::vector< L1SCJetEmu::Jet > hwJets, std::unordered_map< const l1t::PFCandidate *, edm::Ptr< l1t::PFCandidate >> constituentMap)
#define DEFINE_FWK_MODULE(type)
L1SeedConePFJetProducer(const edm::ParameterSet &)
std::vector< Jet > emulateEvent(std::vector< Particle > &parts) const
static std::pair< std::vector< L1SCJetEmu::Particle >, std::unordered_map< const l1t::PFCandidate *, edm::Ptr< l1t::PFCandidate > > > convertEDMToHW(std::vector< edm::Ptr< l1t::PFCandidate >> &edmParticles)
void initFromBits(const ap_uint< BITWIDTH > &src)
std::vector< l1t::PFJet > processEvent_HW(std::vector< edm::Ptr< l1t::PFCandidate >> &parts) const
float coneSize
///////////////// ///
edm::EDGetTokenT< std::vector< l1t::PFCandidate > > l1PFToken
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override