44 static std::vector<l1t::PFTau>
convertHWToEDM(std::vector<l1HPSPFTauEmu::Tau> hwTaus);
50 : nTaus_(
cfg.getParameter<
int>(
"nTaus")),
51 HW_(
cfg.getParameter<
bool>(
"HW")),
52 fUseJets_(
cfg.getParameter<
bool>(
"useJets")),
53 debug_(
cfg.getParameter<
bool>(
"debug")),
54 tokenL1PFCands_(consumes(
cfg.getParameter<
edm::
InputTag>(
"srcL1PFCands"))),
55 tokenL1PFJets_(consumes(
cfg.getParameter<
edm::
InputTag>(
"srcL1PFJets"))),
62 desc.add<
int>(
"nTaus", 16);
63 desc.add<
bool>(
"HW",
true);
64 desc.add<
bool>(
"useJets",
false);
65 desc.add<
bool>(
"debug",
false);
67 edm::InputTag(
"l1tPhase1JetCalibrator9x9trimmed",
"Phase1L1TJetFromPfCandidates"));
68 descriptions.
add(
"l1tHPSPFTauProducer",
desc);
78 std::vector<edm::Ptr<l1t::PFCandidate>>
particles;
79 for (
unsigned i = 0;
i < (*l1PFCandidates).size();
i++) {
84 std::vector<edm::Ptr<reco::CaloJet>>
jets;
85 for (
unsigned int i = 0;
i < (*l1PFJets).size();
i++) {
90 std::vector<l1t::PFTau>
taus;
119 std::vector<Particle> hwJets;
126 hwJets.push_back(jPart);
135 std::vector<Particle> hwParticles;
142 hwPart.
pID = edmParticle->id();
143 if (edmParticle->z0()) {
146 hwParticles.push_back(hwPart);
153 std::vector<l1t::PFTau> edmTaus;
156 float tauArray[80] = {0};
157 std::for_each(hwTaus.begin(), hwTaus.end(), [&](
Tau tau) {
172 edmTaus.push_back(pTau);
void set_encodedTau(l1gt::PackedTau encodedTau)
edm::EDGetTokenT< std::vector< reco::CaloJet > > tokenL1PFJets_
pt_t makePtFromFloat(float pt)
std::vector< Tau > emulateEvent(std::vector< Particle > &parts, std::vector< Particle > &jets, bool jEnable)
std::array< uint64_t, 2 > PackedTau
L1HPSPFTauProducer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
~L1HPSPFTauProducer() override
std::vector< l1t::PFTau > processEvent_HW(std::vector< edm::Ptr< l1t::PFCandidate >> &parts, std::vector< edm::Ptr< reco::CaloJet >> &jets) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static std::vector< l1HPSPFTauEmu::Particle > convertEDMToHW(std::vector< edm::Ptr< l1t::PFCandidate >> &edmParticles)
edm::EDPutTokenT< l1t::PFTauCollection > tauToken_
edm::EDGetTokenT< l1t::PFCandidateCollection > tokenL1PFCands_
static std::vector< l1t::PFTau > convertHWToEDM(std::vector< l1HPSPFTauEmu::Tau > hwTaus)
static std::vector< l1HPSPFTauEmu::Particle > convertJetsToHW(std::vector< edm::Ptr< reco::CaloJet >> &edmJets)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
constexpr float etaphi_base
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.