File indexing completed on 2024-04-06 12:21:29
0001 #include "DataFormats/L1TCorrelator/interface/TkElectron.h"
0002 #include "DataFormats/L1TCorrelator/interface/TkElectronFwd.h"
0003 #include "DataFormats/L1TCorrelator/interface/TkEm.h"
0004 #include "DataFormats/L1TCorrelator/interface/TkEmFwd.h"
0005 #include "DataFormats/L1Trigger/interface/EGamma.h"
0006 #include "DataFormats/L1TParticleFlow/interface/PFCandidate.h"
0007
0008 #include "FWCore/Framework/interface/Event.h"
0009 #include "FWCore/Framework/interface/global/EDProducer.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 #include "FWCore/Utilities/interface/InputTag.h"
0012 #include "FWCore/Utilities/interface/transform.h"
0013
0014 #include "DataFormats/L1TParticleFlow/interface/layer1_emulator.h"
0015 #include "L1Trigger/Phase2L1ParticleFlow/interface/egamma/l2egsorter_ref.h"
0016 #include "L1Trigger/Phase2L1ParticleFlow/interface/egamma/l2egencoder_ref.h"
0017 #include "L1Trigger/Phase2L1ParticleFlow/interface/egamma/L1EGPuppiIsoAlgo.h"
0018
0019 #include "L1Trigger/DemonstratorTools/interface/BoardDataWriter.h"
0020 #include "L1Trigger/DemonstratorTools/interface/utilities.h"
0021
0022 #include <iostream>
0023 #include <vector>
0024
0025 using namespace l1ct;
0026
0027 class L1TCtL2EgProducer : public edm::global::EDProducer<> {
0028 public:
0029 explicit L1TCtL2EgProducer(const edm::ParameterSet &);
0030 ~L1TCtL2EgProducer() override;
0031
0032 private:
0033 ap_uint<64> encodeLayer1(const EGIsoObjEmu &egiso) const;
0034 ap_uint<128> encodeLayer1(const EGIsoEleObjEmu &egiso) const;
0035
0036 std::vector<ap_uint<64>> encodeLayer1(const std::vector<EGIsoObjEmu> &photons) const;
0037 std::vector<ap_uint<64>> encodeLayer1(const std::vector<EGIsoEleObjEmu> &electrons) const;
0038
0039 void encodeLayer1EgObjs(unsigned int nObj,
0040 std::vector<ap_uint<64>> &data,
0041 const std::vector<EGIsoObjEmu> &photons,
0042 const std::vector<EGIsoEleObjEmu> &electrons) const;
0043
0044 void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
0045
0046 void endJob() override;
0047
0048 typedef TTTrack<Ref_Phase2TrackerDigi_> L1TTTrackType;
0049 typedef std::vector<std::pair<edm::Ptr<l1t::L1Candidate>, edm::Ptr<L1TTTrackType>>> ConstituentPtrVector;
0050
0051 void convertToEmu(const l1t::TkElectron &tkele,
0052 ConstituentPtrVector &constituentsPtrs,
0053 l1ct::OutputBoard &boarOut) const;
0054 void convertToEmu(const l1t::TkEm &tkele, ConstituentPtrVector &constituentsPtrs, l1ct::OutputBoard &boarOut) const;
0055 void convertToPuppi(const l1t::PFCandidateCollection &l1PFCands, l1ct::PuppiObjs &puppiObjs) const;
0056
0057 template <class T>
0058 class PFInstanceInputs {
0059 public:
0060 typedef std::vector<std::pair<edm::EDGetTokenT<T>, std::vector<int>>> InputTokenAndRegions;
0061 PFInstanceInputs(L1TCtL2EgProducer *prod, const std::vector<edm::ParameterSet> &confs) {
0062 for (const auto &conf : confs) {
0063 const auto &producer_tag = conf.getParameter<edm::InputTag>("pfProducer");
0064 tokensAndRegions_.push_back(std::make_pair(
0065 prod->consumes<T>(edm::InputTag(producer_tag.label(), producer_tag.instance(), producer_tag.process())),
0066 conf.getParameter<std::vector<int>>("regions")));
0067 }
0068 }
0069
0070 const InputTokenAndRegions &tokensAndRegions() const { return tokensAndRegions_; }
0071
0072 private:
0073 InputTokenAndRegions tokensAndRegions_;
0074 };
0075
0076 class PatternWriter {
0077 public:
0078 PatternWriter(const edm::ParameterSet &conf)
0079 : region2link_(5),
0080 dataWriter_(nullptr),
0081 nEvPerFile_(conf.getParameter<uint32_t>("eventsPerFile")),
0082 enventIndex_(0) {
0083 unsigned int nFramesPerBX = conf.getParameter<uint32_t>("nFramesPerBX");
0084
0085 std::map<l1t::demo::LinkId, std::pair<l1t::demo::ChannelSpec, std::vector<size_t>>> channelSpecs;
0086
0087 for (const auto &channelConf : conf.getParameter<std::vector<edm::ParameterSet>>("channels")) {
0088 unsigned int inTMUX = channelConf.getParameter<uint32_t>("TMUX");
0089 unsigned int eventGap =
0090 inTMUX * nFramesPerBX - channelConf.getParameter<uint32_t>("nWords");
0091
0092
0093 std::vector<uint32_t> chns = channelConf.getParameter<std::vector<uint32_t>>("channels");
0094
0095 std::string interface = channelConf.getParameter<std::string>("interface");
0096 unsigned int chId = channelConf.getParameter<uint32_t>("id");
0097 l1t::demo::LinkId linkId{interface, size_t(chId)};
0098 channelSpecs[linkId] = std::make_pair(l1t::demo::ChannelSpec{inTMUX, eventGap},
0099 std::vector<size_t>(std::begin(chns), std::end(chns)));
0100
0101
0102 if (inTMUX == 6) {
0103 if (interface == "eglayer1Barrel" || interface == "eglayer1Endcap") {
0104
0105
0106
0107
0108 region2link_[chId] = RegionLinkMetadata{linkId, 0};
0109 }
0110 } else if (inTMUX == 18) {
0111 if (interface == "eglayer1Barrel") {
0112
0113
0114
0115
0116 region2link_[0] = RegionLinkMetadata{linkId, 6};
0117 region2link_[1] = RegionLinkMetadata{linkId, 6};
0118 region2link_[2] = RegionLinkMetadata{linkId, 0};
0119 } else if (interface == "eglayer1Endcap") {
0120
0121
0122
0123
0124 region2link_[3] = RegionLinkMetadata{linkId, 33};
0125 region2link_[4] = RegionLinkMetadata{linkId, 0};
0126 }
0127 }
0128 }
0129
0130 dataWriter_ = std::make_unique<l1t::demo::BoardDataWriter>(
0131 l1t::demo::parseFileFormat(conf.getParameter<std::string>("format")),
0132 conf.getParameter<std::string>("outputFilename"),
0133 conf.getParameter<std::string>("outputFileExtension"),
0134 nFramesPerBX,
0135 conf.getParameter<uint32_t>("TMUX"),
0136 conf.getParameter<uint32_t>("maxLinesPerFile"),
0137 channelSpecs);
0138 }
0139
0140 struct RegionLinkMetadata {
0141 l1t::demo::LinkId linkId;
0142 unsigned int nTrailingWords;
0143 };
0144
0145 void addEvent(const l1t::demo::EventData &eventData) {
0146 dataWriter_->addEvent(eventData);
0147 enventIndex_++;
0148 if (enventIndex_ % nEvPerFile_ == 0)
0149 dataWriter_->flush();
0150 }
0151
0152 void flush() { dataWriter_->flush(); }
0153
0154 const RegionLinkMetadata ®ion2Link(unsigned int region) const {
0155 assert(region < region2link_.size());
0156 return region2link_.at(region);
0157 }
0158
0159 private:
0160 std::vector<RegionLinkMetadata> region2link_;
0161
0162 std::unique_ptr<l1t::demo::BoardDataWriter> dataWriter_;
0163 uint32_t nEvPerFile_;
0164 uint32_t enventIndex_;
0165 };
0166
0167 template <class TT, class T>
0168 void merge(const PFInstanceInputs<T> &instance,
0169 edm::Event &iEvent,
0170 ConstituentPtrVector &constituentsPtrs,
0171 std::unique_ptr<TT> &out) const {
0172 edm::Handle<T> handle;
0173 for (const auto &tokenAndRegions : instance.tokensAndRegions()) {
0174 iEvent.getByToken(tokenAndRegions.first, handle);
0175 populate(out, handle, tokenAndRegions.second, constituentsPtrs);
0176 }
0177 }
0178
0179 template <class TT, class T>
0180 void populate(std::unique_ptr<T> &out,
0181 const edm::Handle<TT> &in,
0182 const std::vector<int> ®ions,
0183 ConstituentPtrVector &constituentsPtrs) const {
0184 assert(regions.size() == in->nRegions());
0185 for (unsigned int iBoard = 0, nBoard = in->nRegions(); iBoard < nBoard; ++iBoard) {
0186 auto region = in->region(iBoard);
0187 int regionID = regions[iBoard];
0188 if (regionID < 0)
0189 continue;
0190
0191 for (const auto &obj : region) {
0192 convertToEmu(obj, constituentsPtrs, out->at(regionID));
0193 }
0194 }
0195 }
0196
0197 void populate(std::unique_ptr<BXVector<l1t::EGamma>> &out,
0198 const edm::Handle<BXVector<l1t::EGamma>> &in,
0199 const std::vector<int> ®ions,
0200 ConstituentPtrVector &constituentsPtrs) const {
0201 for (int bx = in->getFirstBX(); bx <= in->getLastBX(); bx++) {
0202 for (auto egee_itr = in->begin(bx); egee_itr != in->end(bx); egee_itr++) {
0203 out->push_back(bx, *egee_itr);
0204 }
0205 }
0206 }
0207
0208 template <class Tout, class Tin>
0209 void putEgObjects(edm::Event &iEvent,
0210 const ConstituentPtrVector &constituentsPtrs,
0211 const std::string &label,
0212 const std::vector<Tin> emulated) const {
0213 auto egobjs = std::make_unique<Tout>();
0214 for (const auto &emu : emulated) {
0215 if (emu.hwPt == 0)
0216 continue;
0217 auto obj = convertFromEmu(emu, constituentsPtrs);
0218 egobjs->push_back(obj);
0219 }
0220 iEvent.put(std::move(egobjs), label);
0221 }
0222
0223 l1t::TkEm convertFromEmu(const l1ct::EGIsoObjEmu &emu, const ConstituentPtrVector &constituentsPtrs) const;
0224 l1t::TkElectron convertFromEmu(const l1ct::EGIsoEleObjEmu &emu, const ConstituentPtrVector &constituentsPtrs) const;
0225
0226 PFInstanceInputs<BXVector<l1t::EGamma>> tkEGInputs_;
0227 PFInstanceInputs<l1t::TkEmRegionalOutput> tkEmInputs_;
0228 PFInstanceInputs<l1t::TkElectronRegionalOutput> tkEleInputs_;
0229 std::string tkEGInstanceLabel_;
0230 std::string tkEmInstanceLabel_;
0231 std::string tkEleInstanceLabel_;
0232 l1ct::L2EgSorterEmulator l2egsorter;
0233 l1ct::L2EgEncoderEmulator l2encoder;
0234 edm::EDGetTokenT<std::vector<l1t::PFCandidate>> pfObjsToken_;
0235 l1ct::L1EGPuppiIsoAlgo l2EgPuppiIsoAlgo_;
0236 l1ct::L1EGPuppiIsoAlgo l2ElePuppiIsoAlgo_;
0237 bool doInPtrn_;
0238 bool doOutPtrn_;
0239 std::unique_ptr<PatternWriter> inPtrnWrt_;
0240 std::unique_ptr<PatternWriter> outPtrnWrt_;
0241 };
0242
0243 L1TCtL2EgProducer::L1TCtL2EgProducer(const edm::ParameterSet &conf)
0244 : tkEGInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkEgs")),
0245 tkEmInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkEms")),
0246 tkEleInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkElectrons")),
0247 tkEGInstanceLabel_(conf.getParameter<std::string>("egStaInstanceLabel")),
0248 tkEmInstanceLabel_(conf.getParameter<std::string>("tkEmInstanceLabel")),
0249 tkEleInstanceLabel_(conf.getParameter<std::string>("tkEleInstanceLabel")),
0250 l2egsorter(conf.getParameter<edm::ParameterSet>("sorter")),
0251 l2encoder(conf.getParameter<edm::ParameterSet>("encoder")),
0252 pfObjsToken_(consumes<std::vector<l1t::PFCandidate>>(conf.getParameter<edm::InputTag>("l1PFObjects"))),
0253 l2EgPuppiIsoAlgo_(conf.getParameter<edm::ParameterSet>("puppiIsoParametersTkEm")),
0254 l2ElePuppiIsoAlgo_(conf.getParameter<edm::ParameterSet>("puppiIsoParametersTkEle")),
0255 doInPtrn_(conf.getParameter<bool>("writeInPattern")),
0256 doOutPtrn_(conf.getParameter<bool>("writeOutPattern")),
0257 inPtrnWrt_(nullptr),
0258 outPtrnWrt_(nullptr) {
0259 produces<BXVector<l1t::EGamma>>(tkEGInstanceLabel_);
0260 produces<l1t::TkEmCollection>(tkEmInstanceLabel_);
0261 produces<l1t::TkElectronCollection>(tkEleInstanceLabel_);
0262
0263 if (doInPtrn_) {
0264 inPtrnWrt_ = std::make_unique<PatternWriter>(conf.getParameter<edm::ParameterSet>("inPatternFile"));
0265 }
0266 if (doOutPtrn_) {
0267 outPtrnWrt_ = std::make_unique<PatternWriter>(conf.getParameter<edm::ParameterSet>("outPatternFile"));
0268 }
0269 }
0270
0271 L1TCtL2EgProducer::~L1TCtL2EgProducer() {}
0272
0273 ap_uint<64> L1TCtL2EgProducer::encodeLayer1(const EGIsoObjEmu &egiso) const {
0274 ap_uint<64> ret = 0;
0275 ret(EGIsoObjEmu::BITWIDTH, 0) = egiso.pack();
0276 return ret;
0277 }
0278
0279 ap_uint<128> L1TCtL2EgProducer::encodeLayer1(const EGIsoEleObjEmu &egiso) const {
0280 ap_uint<128> ret = 0;
0281 ret(EGIsoEleObjEmu::BITWIDTH, 0) = egiso.pack();
0282 return ret;
0283 }
0284
0285 std::vector<ap_uint<64>> L1TCtL2EgProducer::encodeLayer1(const std::vector<EGIsoObjEmu> &photons) const {
0286 std::vector<ap_uint<64>> ret;
0287 ret.reserve(photons.size());
0288 for (const auto &phot : photons) {
0289 ret.push_back(encodeLayer1(phot));
0290 }
0291 return ret;
0292 }
0293
0294 std::vector<ap_uint<64>> L1TCtL2EgProducer::encodeLayer1(const std::vector<EGIsoEleObjEmu> &electrons) const {
0295 std::vector<ap_uint<64>> ret;
0296 ret.reserve(2 * electrons.size());
0297 for (const auto &ele : electrons) {
0298 auto eleword = encodeLayer1(ele);
0299 ret.push_back(eleword(63, 0));
0300 ret.push_back(eleword(127, 64));
0301 }
0302 return ret;
0303 }
0304
0305 void L1TCtL2EgProducer::encodeLayer1EgObjs(unsigned int nObj,
0306 std::vector<ap_uint<64>> &data,
0307 const std::vector<EGIsoObjEmu> &photons,
0308 const std::vector<EGIsoEleObjEmu> &electrons) const {
0309 auto encoded_photons = encodeLayer1(photons);
0310 encoded_photons.resize(nObj, {0});
0311 auto encoded_eles = encodeLayer1(electrons);
0312 encoded_eles.resize(2 * nObj, {0});
0313
0314 std::copy(encoded_photons.begin(), encoded_photons.end(), std::back_inserter(data));
0315 std::copy(encoded_eles.begin(), encoded_eles.end(), std::back_inserter(data));
0316 }
0317
0318 void L1TCtL2EgProducer::produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &) const {
0319 ConstituentPtrVector constituents;
0320
0321 auto outEgs = std::make_unique<BXVector<l1t::EGamma>>();
0322 merge(tkEGInputs_, iEvent, constituents, outEgs);
0323 iEvent.put(std::move(outEgs), tkEGInstanceLabel_);
0324
0325 auto regions = std::make_unique<std::vector<l1ct::OutputBoard>>(l2egsorter.nInputRegions());
0326
0327 merge(tkEleInputs_, iEvent, constituents, regions);
0328 merge(tkEmInputs_, iEvent, constituents, regions);
0329
0330 if (doInPtrn_) {
0331 std::map<unsigned int, l1t::demo::LinkId> regio2link;
0332
0333 l1t::demo::EventData inData;
0334 for (unsigned int ireg = 0; ireg < regions->size(); ireg++) {
0335 const auto &linkData = inPtrnWrt_->region2Link(ireg);
0336 std::vector<ap_uint<64>> data;
0337
0338 if (inData.has(linkData.linkId))
0339 data = inData.at(linkData.linkId);
0340 encodeLayer1EgObjs(l2egsorter.nInputObjPerRegion(), data, (*regions)[ireg].egphoton, (*regions)[ireg].egelectron);
0341 data.resize(data.size() + linkData.nTrailingWords, {0});
0342 inData.add(linkData.linkId, data);
0343 }
0344 inPtrnWrt_->addEvent(inData);
0345 }
0346
0347 std::vector<EGIsoObjEmu> out_photons_emu;
0348 std::vector<EGIsoEleObjEmu> out_eles_emu;
0349 l2egsorter.run(*regions, out_photons_emu, out_eles_emu);
0350
0351
0352 auto &pfObjs = iEvent.get(pfObjsToken_);
0353 l1ct::PuppiObjs puppiObjs;
0354 convertToPuppi(pfObjs, puppiObjs);
0355 l2EgPuppiIsoAlgo_.run(out_photons_emu, puppiObjs);
0356 l2ElePuppiIsoAlgo_.run(out_eles_emu, puppiObjs);
0357
0358 if (doOutPtrn_) {
0359 l1t::demo::EventData outData;
0360 outData.add({"eglayer2", 0}, l2encoder.encodeLayer2EgObjs(out_photons_emu, out_eles_emu));
0361 outPtrnWrt_->addEvent(outData);
0362 }
0363
0364 putEgObjects<l1t::TkEmCollection>(iEvent, constituents, tkEmInstanceLabel_, out_photons_emu);
0365 putEgObjects<l1t::TkElectronCollection>(iEvent, constituents, tkEleInstanceLabel_, out_eles_emu);
0366 }
0367
0368 void L1TCtL2EgProducer::endJob() {
0369
0370 if (doOutPtrn_)
0371 outPtrnWrt_->flush();
0372 if (doInPtrn_)
0373 inPtrnWrt_->flush();
0374 }
0375
0376 void L1TCtL2EgProducer::convertToEmu(const l1t::TkElectron &tkele,
0377 ConstituentPtrVector &constituentsPtrs,
0378 l1ct::OutputBoard &boarOut) const {
0379 EGIsoEleObjEmu emu;
0380 emu.initFromBits(tkele.egBinaryWord<EGIsoEleObj::BITWIDTH>());
0381 emu.srcCluster = nullptr;
0382 emu.srcTrack = nullptr;
0383
0384 constituentsPtrs.push_back(std::make_pair(tkele.egCaloPtr(), tkele.trkPtr()));
0385 emu.src_idx = constituentsPtrs.size() - 1;
0386
0387
0388 emu.setHwIso(EGIsoEleObjEmu::IsoType::TkIso, l1ct::Scales::makeIso(tkele.trkIsol() * tkele.pt()));
0389 emu.setHwIso(EGIsoEleObjEmu::IsoType::PfIso, l1ct::Scales::makeIso(tkele.pfIsol() * tkele.pt()));
0390 emu.setHwIso(EGIsoEleObjEmu::IsoType::PuppiIso, l1ct::Scales::makeIso(tkele.puppiIsol() * tkele.pt()));
0391
0392 boarOut.egelectron.push_back(emu);
0393 }
0394
0395 void L1TCtL2EgProducer::convertToEmu(const l1t::TkEm &tkem,
0396 ConstituentPtrVector &constituentsPtrs,
0397 l1ct::OutputBoard &boarOut) const {
0398 EGIsoObjEmu emu;
0399 emu.initFromBits(tkem.egBinaryWord<EGIsoObj::BITWIDTH>());
0400 emu.srcCluster = nullptr;
0401 constituentsPtrs.push_back(std::make_pair(tkem.egCaloPtr(), edm::Ptr<L1TTTrackType>()));
0402 emu.src_idx = constituentsPtrs.size() - 1;
0403
0404 emu.setHwIso(EGIsoObjEmu::IsoType::TkIso, l1ct::Scales::makeIso(tkem.trkIsol() * tkem.pt()));
0405 emu.setHwIso(EGIsoObjEmu::IsoType::PfIso, l1ct::Scales::makeIso(tkem.pfIsol() * tkem.pt()));
0406 emu.setHwIso(EGIsoObjEmu::IsoType::PuppiIso, l1ct::Scales::makeIso(tkem.puppiIsol() * tkem.pt()));
0407 emu.setHwIso(EGIsoObjEmu::IsoType::TkIsoPV, l1ct::Scales::makeIso(tkem.trkIsolPV() * tkem.pt()));
0408 emu.setHwIso(EGIsoObjEmu::IsoType::PfIsoPV, l1ct::Scales::makeIso(tkem.pfIsolPV() * tkem.pt()));
0409
0410 boarOut.egphoton.push_back(emu);
0411 }
0412
0413 void L1TCtL2EgProducer::convertToPuppi(const l1t::PFCandidateCollection &l1PFCands, l1ct::PuppiObjs &puppiObjs) const {
0414 for (const auto &l1PFCand : l1PFCands) {
0415 l1ct::PuppiObj obj;
0416 obj.initFromBits(l1PFCand.encodedPuppi64());
0417 puppiObjs.emplace_back(obj);
0418 }
0419 }
0420
0421 l1t::TkEm L1TCtL2EgProducer::convertFromEmu(const l1ct::EGIsoObjEmu &egiso,
0422 const ConstituentPtrVector &constituentsPtrs) const {
0423
0424
0425 const auto gteg = egiso.toGT();
0426 reco::Candidate::PolarLorentzVector mom(
0427 l1gt::Scales::floatPt(gteg.v3.pt), l1gt::Scales::floatEta(gteg.v3.eta), l1gt::Scales::floatPhi(gteg.v3.phi), 0.);
0428
0429 l1t::TkEm tkem(reco::Candidate::LorentzVector(mom),
0430 constituentsPtrs[egiso.src_idx].first,
0431 egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::TkIso),
0432 egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::TkIsoPV));
0433 tkem.setHwQual(gteg.qualityFlags);
0434 tkem.setPFIsol(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PfIso));
0435 tkem.setPFIsolPV(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PfIsoPV));
0436 tkem.setPuppiIsol(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PuppiIso));
0437 tkem.setEgBinaryWord(gteg.pack(), l1t::TkEm::HWEncoding::GT);
0438 return tkem;
0439 }
0440
0441 l1t::TkElectron L1TCtL2EgProducer::convertFromEmu(const l1ct::EGIsoEleObjEmu &egele,
0442 const ConstituentPtrVector &constituentsPtrs) const {
0443
0444
0445 const auto gteg = egele.toGT();
0446 reco::Candidate::PolarLorentzVector mom(
0447 l1gt::Scales::floatPt(gteg.v3.pt), l1gt::Scales::floatEta(gteg.v3.eta), l1gt::Scales::floatPhi(gteg.v3.phi), 0.);
0448
0449 l1t::TkElectron tkele(reco::Candidate::LorentzVector(mom),
0450 constituentsPtrs[egele.src_idx].first,
0451 constituentsPtrs[egele.src_idx].second,
0452 egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::TkIso));
0453 tkele.setHwQual(gteg.qualityFlags);
0454 tkele.setPFIsol(egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::PfIso));
0455 tkele.setPuppiIsol(egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::PuppiIso));
0456 tkele.setEgBinaryWord(gteg.pack(), l1t::TkElectron::HWEncoding::GT);
0457 tkele.setIdScore(egele.floatIDScore());
0458 tkele.setCharge(egele.intCharge());
0459 tkele.setTrkzVtx(l1gt::Scales::floatZ0(gteg.z0));
0460 return tkele;
0461 }
0462
0463 #include "FWCore/Framework/interface/MakerMacros.h"
0464 DEFINE_FWK_MODULE(L1TCtL2EgProducer);