CMS 3D CMS Logo

L1TCtL2EgProducer.cc
Go to the documentation of this file.
7 
13 
18 
21 
22 #include <iostream>
23 #include <vector>
24 
25 using namespace l1ct;
26 
28 public:
29  explicit L1TCtL2EgProducer(const edm::ParameterSet &);
30  ~L1TCtL2EgProducer() override;
31 
32 private:
33  ap_uint<64> encodeLayer1(const EGIsoObjEmu &egiso) const;
34  ap_uint<128> encodeLayer1(const EGIsoEleObjEmu &egiso) const;
35 
36  std::vector<ap_uint<64>> encodeLayer1(const std::vector<EGIsoObjEmu> &photons) const;
37  std::vector<ap_uint<64>> encodeLayer1(const std::vector<EGIsoEleObjEmu> &electrons) const;
38 
39  void encodeLayer1EgObjs(unsigned int nObj,
40  std::vector<ap_uint<64>> &data,
41  const std::vector<EGIsoObjEmu> &photons,
42  const std::vector<EGIsoEleObjEmu> &electrons) const;
43 
44  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
45 
46  void endJob() override;
47 
49  typedef std::vector<std::pair<edm::Ptr<l1t::L1Candidate>, edm::Ptr<L1TTTrackType>>> ConstituentPtrVector;
50 
51  void convertToEmu(const l1t::TkElectron &tkele,
52  ConstituentPtrVector &constituentsPtrs,
53  l1ct::OutputBoard &boarOut) const;
54  void convertToEmu(const l1t::TkEm &tkele, ConstituentPtrVector &constituentsPtrs, l1ct::OutputBoard &boarOut) const;
55  void convertToPuppi(const l1t::PFCandidateCollection &l1PFCands, l1ct::PuppiObjs &puppiObjs) const;
56 
57  template <class T>
59  public:
60  typedef std::vector<std::pair<edm::EDGetTokenT<T>, std::vector<int>>> InputTokenAndRegions;
61  PFInstanceInputs(L1TCtL2EgProducer *prod, const std::vector<edm::ParameterSet> &confs) {
62  for (const auto &conf : confs) {
63  const auto &producer_tag = conf.getParameter<edm::InputTag>("pfProducer");
64  tokensAndRegions_.push_back(std::make_pair(
65  prod->consumes<T>(edm::InputTag(producer_tag.label(), producer_tag.instance(), producer_tag.process())),
66  conf.getParameter<std::vector<int>>("regions")));
67  }
68  }
69 
70  const InputTokenAndRegions &tokensAndRegions() const { return tokensAndRegions_; }
71 
72  private:
74  };
75 
76  class PatternWriter {
77  public:
79  : region2link_(5),
80  dataWriter_(nullptr),
81  nEvPerFile_(conf.getParameter<uint32_t>("eventsPerFile")),
82  enventIndex_(0) {
83  unsigned int nFramesPerBX = conf.getParameter<uint32_t>("nFramesPerBX");
84 
85  std::map<l1t::demo::LinkId, std::pair<l1t::demo::ChannelSpec, std::vector<size_t>>> channelSpecs;
86 
87  for (const auto &channelConf : conf.getParameter<std::vector<edm::ParameterSet>>("channels")) {
88  unsigned int inTMUX = channelConf.getParameter<uint32_t>("TMUX");
89  unsigned int eventGap =
90  inTMUX * nFramesPerBX - channelConf.getParameter<uint32_t>("nWords"); // assuming 96bit (= 3/2 word)
91  // words = TMUX*9-2*3/2*words
92 
93  std::vector<uint32_t> chns = channelConf.getParameter<std::vector<uint32_t>>("channels");
94 
95  std::string interface = channelConf.getParameter<std::string>("interface");
96  unsigned int chId = channelConf.getParameter<uint32_t>("id");
97  l1t::demo::LinkId linkId{interface, size_t(chId)};
98  channelSpecs[linkId] = std::make_pair(l1t::demo::ChannelSpec{inTMUX, eventGap},
99  std::vector<size_t>(std::begin(chns), std::end(chns)));
100 
101  // NOTE: this could be parametrized from CFG
102  if (inTMUX == 6) {
103  if (interface == "eglayer1Barrel" || interface == "eglayer1Endcap") {
104  // Layer1 TMUX=6 => each one of the regions is mapped to a link
105  // with the same ID
106  // # of words = 16 (pho) + 2*16 (ele) = 48
107  // no filling words needed
108  region2link_[chId] = RegionLinkMetadata{linkId, 0};
109  }
110  } else if (inTMUX == 18) {
111  if (interface == "eglayer1Barrel") {
112  // Layer1 TMUX=18 => 3 regions are mapped to the same link
113  // one every 6 BX x 9 words = 54 words
114  // # of data words = 16 (pho) + 2*16 (ele) = 48
115  // # we fill with 54-48 = 6 empty words
116  region2link_[0] = RegionLinkMetadata{linkId, 6};
117  region2link_[1] = RegionLinkMetadata{linkId, 6};
118  region2link_[2] = RegionLinkMetadata{linkId, 0};
119  } else if (interface == "eglayer1Endcap") {
120  // Layer1 TMUX=18 => 2 endcap regions are mapped to the same link
121  // one every 9 BX x 9 words = 81 words
122  // # of data words = 16 (pho) + 2*16 (ele) = 48
123  // # we fill with 81-48 = 33 empty words
124  region2link_[3] = RegionLinkMetadata{linkId, 33};
125  region2link_[4] = RegionLinkMetadata{linkId, 0};
126  }
127  }
128  }
129 
130  dataWriter_ = std::make_unique<l1t::demo::BoardDataWriter>(
132  conf.getParameter<std::string>("outputFilename"),
133  conf.getParameter<std::string>("outputFileExtension"),
134  nFramesPerBX,
135  conf.getParameter<uint32_t>("TMUX"),
136  conf.getParameter<uint32_t>("maxLinesPerFile"),
137  channelSpecs);
138  }
139 
142  unsigned int nTrailingWords;
143  };
144 
145  void addEvent(const l1t::demo::EventData &eventData) {
146  dataWriter_->addEvent(eventData);
147  enventIndex_++;
148  if (enventIndex_ % nEvPerFile_ == 0)
149  dataWriter_->flush();
150  }
151 
152  void flush() { dataWriter_->flush(); }
153 
154  const RegionLinkMetadata &region2Link(unsigned int region) const {
155  assert(region < region2link_.size());
156  return region2link_.at(region);
157  }
158 
159  private:
160  std::vector<RegionLinkMetadata> region2link_;
161 
162  std::unique_ptr<l1t::demo::BoardDataWriter> dataWriter_;
163  uint32_t nEvPerFile_;
164  uint32_t enventIndex_;
165  };
166 
167  template <class TT, class T>
170  ConstituentPtrVector &constituentsPtrs,
171  std::unique_ptr<TT> &out) const {
173  for (const auto &tokenAndRegions : instance.tokensAndRegions()) {
174  iEvent.getByToken(tokenAndRegions.first, handle);
175  populate(out, handle, tokenAndRegions.second, constituentsPtrs);
176  }
177  }
178 
179  template <class TT, class T>
180  void populate(std::unique_ptr<T> &out,
181  const edm::Handle<TT> &in,
182  const std::vector<int> &regions,
183  ConstituentPtrVector &constituentsPtrs) const {
184  assert(regions.size() == in->nRegions());
185  for (unsigned int iBoard = 0, nBoard = in->nRegions(); iBoard < nBoard; ++iBoard) {
186  auto region = in->region(iBoard);
187  int regionID = regions[iBoard];
188  if (regionID < 0)
189  continue;
190  // std::cout << "Board eta: " << in->eta(iBoard) << " phi: " << in->phi(iBoard) << " link: " << regionID << std::endl;
191  for (const auto &obj : region) {
192  convertToEmu(obj, constituentsPtrs, out->at(regionID));
193  }
194  }
195  }
196 
199  const std::vector<int> &regions,
200  ConstituentPtrVector &constituentsPtrs) const {
201  for (int bx = in->getFirstBX(); bx <= in->getLastBX(); bx++) {
202  for (auto egee_itr = in->begin(bx); egee_itr != in->end(bx); egee_itr++) {
203  out->push_back(bx, *egee_itr);
204  }
205  }
206  }
207 
208  template <class Tout, class Tin>
210  const ConstituentPtrVector &constituentsPtrs,
211  const std::string &label,
212  const std::vector<Tin> emulated) const {
213  auto egobjs = std::make_unique<Tout>();
214  for (const auto &emu : emulated) {
215  if (emu.hwPt == 0)
216  continue;
217  auto obj = convertFromEmu(emu, constituentsPtrs);
218  egobjs->push_back(obj);
219  }
220  iEvent.put(std::move(egobjs), label);
221  }
222 
223  l1t::TkEm convertFromEmu(const l1ct::EGIsoObjEmu &emu, const ConstituentPtrVector &constituentsPtrs) const;
224  l1t::TkElectron convertFromEmu(const l1ct::EGIsoEleObjEmu &emu, const ConstituentPtrVector &constituentsPtrs) const;
225 
237  bool doInPtrn_;
239  std::unique_ptr<PatternWriter> inPtrnWrt_;
240  std::unique_ptr<PatternWriter> outPtrnWrt_;
241 };
242 
244  : tkEGInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkEgs")),
245  tkEmInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkEms")),
246  tkEleInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkElectrons")),
247  tkEGInstanceLabel_(conf.getParameter<std::string>("egStaInstanceLabel")),
248  tkEmInstanceLabel_(conf.getParameter<std::string>("tkEmInstanceLabel")),
249  tkEleInstanceLabel_(conf.getParameter<std::string>("tkEleInstanceLabel")),
250  l2egsorter(conf.getParameter<edm::ParameterSet>("sorter")),
251  l2encoder(conf.getParameter<edm::ParameterSet>("encoder")),
252  pfObjsToken_(consumes<std::vector<l1t::PFCandidate>>(conf.getParameter<edm::InputTag>("l1PFObjects"))),
253  l2EgPuppiIsoAlgo_(conf.getParameter<edm::ParameterSet>("puppiIsoParametersTkEm")),
254  l2ElePuppiIsoAlgo_(conf.getParameter<edm::ParameterSet>("puppiIsoParametersTkEle")),
255  doInPtrn_(conf.getParameter<bool>("writeInPattern")),
256  doOutPtrn_(conf.getParameter<bool>("writeOutPattern")),
257  inPtrnWrt_(nullptr),
258  outPtrnWrt_(nullptr) {
259  produces<BXVector<l1t::EGamma>>(tkEGInstanceLabel_);
260  produces<l1t::TkEmCollection>(tkEmInstanceLabel_);
261  produces<l1t::TkElectronCollection>(tkEleInstanceLabel_);
262 
263  if (doInPtrn_) {
264  inPtrnWrt_ = std::make_unique<PatternWriter>(conf.getParameter<edm::ParameterSet>("inPatternFile"));
265  }
266  if (doOutPtrn_) {
267  outPtrnWrt_ = std::make_unique<PatternWriter>(conf.getParameter<edm::ParameterSet>("outPatternFile"));
268  }
269 }
270 
272 
273 ap_uint<64> L1TCtL2EgProducer::encodeLayer1(const EGIsoObjEmu &egiso) const {
274  ap_uint<64> ret = 0;
275  ret(EGIsoObjEmu::BITWIDTH, 0) = egiso.pack();
276  return ret;
277 }
278 
279 ap_uint<128> L1TCtL2EgProducer::encodeLayer1(const EGIsoEleObjEmu &egiso) const {
280  ap_uint<128> ret = 0;
281  ret(EGIsoEleObjEmu::BITWIDTH, 0) = egiso.pack();
282  return ret;
283 }
284 
285 std::vector<ap_uint<64>> L1TCtL2EgProducer::encodeLayer1(const std::vector<EGIsoObjEmu> &photons) const {
286  std::vector<ap_uint<64>> ret;
287  ret.reserve(photons.size());
288  for (const auto &phot : photons) {
289  ret.push_back(encodeLayer1(phot));
290  }
291  return ret;
292 }
293 
294 std::vector<ap_uint<64>> L1TCtL2EgProducer::encodeLayer1(const std::vector<EGIsoEleObjEmu> &electrons) const {
295  std::vector<ap_uint<64>> ret;
296  ret.reserve(2 * electrons.size());
297  for (const auto &ele : electrons) {
298  auto eleword = encodeLayer1(ele);
299  ret.push_back(eleword(63, 0));
300  ret.push_back(eleword(127, 64));
301  }
302  return ret;
303 }
304 
306  std::vector<ap_uint<64>> &data,
307  const std::vector<EGIsoObjEmu> &photons,
308  const std::vector<EGIsoEleObjEmu> &electrons) const {
309  auto encoded_photons = encodeLayer1(photons);
310  encoded_photons.resize(nObj, {0});
311  auto encoded_eles = encodeLayer1(electrons);
312  encoded_eles.resize(2 * nObj, {0});
313 
314  std::copy(encoded_photons.begin(), encoded_photons.end(), std::back_inserter(data));
315  std::copy(encoded_eles.begin(), encoded_eles.end(), std::back_inserter(data));
316 }
317 
319  ConstituentPtrVector constituents;
320 
321  auto outEgs = std::make_unique<BXVector<l1t::EGamma>>();
322  merge(tkEGInputs_, iEvent, constituents, outEgs);
323  iEvent.put(std::move(outEgs), tkEGInstanceLabel_);
324 
325  auto regions = std::make_unique<std::vector<l1ct::OutputBoard>>(l2egsorter.nInputRegions());
326 
327  merge(tkEleInputs_, iEvent, constituents, regions);
328  merge(tkEmInputs_, iEvent, constituents, regions);
329 
330  if (doInPtrn_) {
331  std::map<unsigned int, l1t::demo::LinkId> regio2link;
332 
333  l1t::demo::EventData inData;
334  for (unsigned int ireg = 0; ireg < regions->size(); ireg++) {
335  const auto &linkData = inPtrnWrt_->region2Link(ireg);
336  std::vector<ap_uint<64>> data;
337 
338  if (inData.has(linkData.linkId))
339  data = inData.at(linkData.linkId);
340  encodeLayer1EgObjs(l2egsorter.nInputObjPerRegion(), data, (*regions)[ireg].egphoton, (*regions)[ireg].egelectron);
341  data.resize(data.size() + linkData.nTrailingWords, {0});
342  inData.add(linkData.linkId, data);
343  }
344  inPtrnWrt_->addEvent(inData);
345  }
346 
347  std::vector<EGIsoObjEmu> out_photons_emu;
348  std::vector<EGIsoEleObjEmu> out_eles_emu;
349  l2egsorter.run(*regions, out_photons_emu, out_eles_emu);
350 
351  // PUPPI isolation
352  auto &pfObjs = iEvent.get(pfObjsToken_);
353  l1ct::PuppiObjs puppiObjs;
354  convertToPuppi(pfObjs, puppiObjs);
355  l2EgPuppiIsoAlgo_.run(out_photons_emu, puppiObjs);
356  l2ElePuppiIsoAlgo_.run(out_eles_emu, puppiObjs);
357 
358  if (doOutPtrn_) {
359  l1t::demo::EventData outData;
360  outData.add({"eglayer2", 0}, l2encoder.encodeLayer2EgObjs(out_photons_emu, out_eles_emu));
361  outPtrnWrt_->addEvent(outData);
362  }
363 
364  putEgObjects<l1t::TkEmCollection>(iEvent, constituents, tkEmInstanceLabel_, out_photons_emu);
365  putEgObjects<l1t::TkElectronCollection>(iEvent, constituents, tkEleInstanceLabel_, out_eles_emu);
366 }
367 
369  // Writing pending events to file before exiting
370  if (doOutPtrn_)
371  outPtrnWrt_->flush();
372  if (doInPtrn_)
373  inPtrnWrt_->flush();
374 }
375 
377  ConstituentPtrVector &constituentsPtrs,
378  l1ct::OutputBoard &boarOut) const {
379  EGIsoEleObjEmu emu;
380  emu.initFromBits(tkele.egBinaryWord<EGIsoEleObj::BITWIDTH>());
381  emu.srcCluster = nullptr;
382  emu.srcTrack = nullptr;
383 
384  constituentsPtrs.push_back(std::make_pair(tkele.egCaloPtr(), tkele.trkPtr()));
385  emu.src_idx = constituentsPtrs.size() - 1;
386 
387  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
388  emu.setHwIso(EGIsoEleObjEmu::IsoType::TkIso, l1ct::Scales::makeIso(tkele.trkIsol() * tkele.pt()));
389  emu.setHwIso(EGIsoEleObjEmu::IsoType::PfIso, l1ct::Scales::makeIso(tkele.pfIsol() * tkele.pt()));
390  emu.setHwIso(EGIsoEleObjEmu::IsoType::PuppiIso, l1ct::Scales::makeIso(tkele.puppiIsol() * tkele.pt()));
391  // std::cout << "[convertToEmu] TkEle pt: " << emu.hwPt << " eta: " << emu.hwEta << " phi: " << emu.hwPhi << " staidx: " << emu.src_idx << std::endl;
392  boarOut.egelectron.push_back(emu);
393 }
394 
396  ConstituentPtrVector &constituentsPtrs,
397  l1ct::OutputBoard &boarOut) const {
398  EGIsoObjEmu emu;
399  emu.initFromBits(tkem.egBinaryWord<EGIsoObj::BITWIDTH>());
400  emu.srcCluster = nullptr;
401  constituentsPtrs.push_back(std::make_pair(tkem.egCaloPtr(), edm::Ptr<L1TTTrackType>()));
402  emu.src_idx = constituentsPtrs.size() - 1;
403  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
404  emu.setHwIso(EGIsoObjEmu::IsoType::TkIso, l1ct::Scales::makeIso(tkem.trkIsol() * tkem.pt()));
405  emu.setHwIso(EGIsoObjEmu::IsoType::PfIso, l1ct::Scales::makeIso(tkem.pfIsol() * tkem.pt()));
406  emu.setHwIso(EGIsoObjEmu::IsoType::PuppiIso, l1ct::Scales::makeIso(tkem.puppiIsol() * tkem.pt()));
407  emu.setHwIso(EGIsoObjEmu::IsoType::TkIsoPV, l1ct::Scales::makeIso(tkem.trkIsolPV() * tkem.pt()));
408  emu.setHwIso(EGIsoObjEmu::IsoType::PfIsoPV, l1ct::Scales::makeIso(tkem.pfIsolPV() * tkem.pt()));
409  // std::cout << "[convertToEmu] TkEM pt: " << emu.hwPt << " eta: " << emu.hwEta << " phi: " << emu.hwPhi << " staidx: " << emu.src_idx << std::endl;
410  boarOut.egphoton.push_back(emu);
411 }
412 
414  for (const auto &l1PFCand : l1PFCands) {
416  obj.initFromBits(l1PFCand.encodedPuppi64());
417  puppiObjs.emplace_back(obj);
418  }
419 }
420 
422  const ConstituentPtrVector &constituentsPtrs) const {
423  // std::cout << "[convertFromEmu] TkEm pt: " << egiso.hwPt << " eta: " << egiso.hwEta << " phi: " << egiso.hwPhi << " staidx: " << egiso.src_idx << std::endl;
424  // NOTE: the TkEM object is created with the accuracy as in GT object (not the Correlator internal one)!
425  const auto gteg = egiso.toGT();
427  l1gt::Scales::floatPt(gteg.v3.pt), l1gt::Scales::floatEta(gteg.v3.eta), l1gt::Scales::floatPhi(gteg.v3.phi), 0.);
428  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
430  constituentsPtrs[egiso.src_idx].first,
431  egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::TkIso),
432  egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::TkIsoPV));
433  tkem.setHwQual(gteg.qualityFlags);
434  tkem.setPFIsol(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PfIso));
435  tkem.setPFIsolPV(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PfIsoPV));
436  tkem.setPuppiIsol(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PuppiIso));
437  tkem.setEgBinaryWord(gteg.pack(), l1t::TkEm::HWEncoding::GT);
438  return tkem;
439 }
440 
442  const ConstituentPtrVector &constituentsPtrs) const {
443  // std::cout << "[convertFromEmu] TkEle pt: " << egele.hwPt << " eta: " << egele.hwEta << " phi: " << egele.hwPhi << " staidx: " << egele.src_idx << std::endl;
444  // NOTE: the TkElectron object is created with the accuracy as in GT object (not the Correlator internal one)!
445  const auto gteg = egele.toGT();
447  l1gt::Scales::floatPt(gteg.v3.pt), l1gt::Scales::floatEta(gteg.v3.eta), l1gt::Scales::floatPhi(gteg.v3.phi), 0.);
448  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
450  constituentsPtrs[egele.src_idx].first,
451  constituentsPtrs[egele.src_idx].second,
452  egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::TkIso));
453  tkele.setHwQual(gteg.qualityFlags);
454  tkele.setPFIsol(egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::PfIso));
455  tkele.setPuppiIsol(egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::PuppiIso));
456  tkele.setEgBinaryWord(gteg.pack(), l1t::TkElectron::HWEncoding::GT);
457  tkele.setIdScore(egele.floatIDScore());
458  tkele.setCharge(egele.intCharge());
459  tkele.setTrkzVtx(l1gt::Scales::floatZ0(gteg.z0));
460  return tkele;
461 }
462 
std::unique_ptr< l1t::demo::BoardDataWriter > dataWriter_
l1t::TkEm convertFromEmu(const l1ct::EGIsoObjEmu &emu, const ConstituentPtrVector &constituentsPtrs) const
std::vector< ap_uint< 64 > > encodeLayer2EgObjs(const std::vector< EGIsoObjEmu > &photons, const std::vector< EGIsoEleObjEmu > &electrons) const
std::string tkEGInstanceLabel_
float floatPhi(phi_t phi)
Definition: gt_datatypes.h:49
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
float trkIsolPV() const
Definition: TkEm.h:38
void convertToPuppi(const l1t::PFCandidateCollection &l1PFCands, l1ct::PuppiObjs &puppiObjs) const
l1gt::Electron toGT() const
Definition: egamma.h:163
PFInstanceInputs(L1TCtL2EgProducer *prod, const std::vector< edm::ParameterSet > &confs)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
Definition: LinkId.h:10
std::vector< std::pair< edm::Ptr< l1t::L1Candidate >, edm::Ptr< L1TTTrackType > > > ConstituentPtrVector
float floatEta(eta_t eta)
Definition: gt_datatypes.h:48
void setHwIso(IsoType type, iso_t value)
double pt() const final
transverse momentum
float trkIsol() const
Definition: TkEm.h:37
const l1t::PFTrack * srcTrack
static PFTauRenderPlugin instance
ret
prodAgent to be discontinued
std::vector< l1t::PFCandidate > PFCandidateCollection
Definition: PFCandidate.h:86
PatternWriter(const edm::ParameterSet &conf)
ap_uint< BITWIDTH > pack() const
Definition: egamma.h:45
void endJob() override
std::vector< PuppiObj > PuppiObjs
std::unique_ptr< PatternWriter > outPtrnWrt_
void setHwQual(int qual)
Definition: L1Candidate.h:31
void convertToEmu(const l1t::TkElectron &tkele, ConstituentPtrVector &constituentsPtrs, l1ct::OutputBoard &boarOut) const
FileFormat parseFileFormat(const std::string &)
Definition: utilities.cc:73
delete x;
Definition: CaloConfig.h:22
std::vector< EGIsoEleObjEmu > egelectron
const l1t::PFCluster * srcCluster
void add(const LinkId &, const std::vector< ap_uint< 64 >> &)
Definition: EventData.cc:14
float floatIDScore() const
Definition: egamma.h:124
iso_t makeIso(float iso)
Definition: datatypes.h:207
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
assert(be >=bs)
int intCharge() const
Definition: egamma.h:118
edm::EDGetTokenT< std::vector< l1t::PFCandidate > > pfObjsToken_
float floatRelIso(IsoType type) const
void populate(std::unique_ptr< BXVector< l1t::EGamma >> &out, const edm::Handle< BXVector< l1t::EGamma >> &in, const std::vector< int > &regions, ConstituentPtrVector &constituentsPtrs) const
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
float floatRelIso(IsoType type) const
char const * label
void run(const std::vector< l1ct::OutputBoard > &in, std::vector< EGIsoObjEmu > &out_photons, std::vector< EGIsoEleObjEmu > &out_eles) const
PFInstanceInputs< l1t::TkElectronRegionalOutput > tkEleInputs_
int iEvent
Definition: GenABIO.cc:224
Definition: TkEm.h:23
~L1TCtL2EgProducer() override
unsigned int nInputRegions() const
const std::vector< ap_uint< 64 > > & at(const LinkId &) const
Definition: EventData.cc:21
ap_uint< 64 > encodeLayer1(const EGIsoObjEmu &egiso) const
void populate(std::unique_ptr< T > &out, const edm::Handle< TT > &in, const std::vector< int > &regions, ConstituentPtrVector &constituentsPtrs) const
ap_uint< N > egBinaryWord() const
Definition: TkEm.h:70
void setHwIso(IsoType type, iso_t value)
void encodeLayer1EgObjs(unsigned int nObj, std::vector< ap_uint< 64 >> &data, const std::vector< EGIsoObjEmu > &photons, const std::vector< EGIsoEleObjEmu > &electrons) const
ap_uint< BITWIDTH > pack() const
Definition: egamma.h:128
void initFromBits(const ap_uint< BITWIDTH > &src)
Definition: egamma.h:149
std::vector< std::pair< edm::EDGetTokenT< T >, std::vector< int > > > InputTokenAndRegions
unsigned int nInputObjPerRegion() const
float floatPt(pt_t pt)
Definition: gt_datatypes.h:47
PFInstanceInputs< l1t::TkEmRegionalOutput > tkEmInputs_
l1gt::Photon toGT() const
Definition: egamma.h:70
const edm::Ptr< L1Candidate > & egCaloPtr() const
Definition: TkEm.h:35
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
float pfIsolPV() const
Definition: TkEm.h:40
l1ct::L2EgSorterEmulator l2egsorter
std::string tkEleInstanceLabel_
void merge(const PFInstanceInputs< T > &instance, edm::Event &iEvent, ConstituentPtrVector &constituentsPtrs, std::unique_ptr< TT > &out) const
const InputTokenAndRegions & tokensAndRegions() const
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
std::unique_ptr< PatternWriter > inPtrnWrt_
void initFromBits(const ap_uint< BITWIDTH > &src)
Definition: egamma.h:61
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
float floatZ0(z0_t z0)
Definition: gt_datatypes.h:50
std::vector< EGIsoObjEmu > egphoton
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
l1ct::L1EGPuppiIsoAlgo l2ElePuppiIsoAlgo_
const edm::Ptr< L1TTTrackType > & trkPtr() const
Definition: TkElectron.h:39
const l1t::PFCluster * srcCluster
L1TCtL2EgProducer(const edm::ParameterSet &)
l1ct::L2EgEncoderEmulator l2encoder
std::vector< RegionLinkMetadata > region2link_
PFInstanceInputs< BXVector< l1t::EGamma > > tkEGInputs_
long double T
float pfIsol() const
Definition: TkEm.h:39
void run(const EGIsoObjsEmu &l1EGs, const PuppiObjs &l1PFCands, EGIsoObjsEmu &outL1EGs, z0_t z0=0) const
Class representing information phase-2 ATCA I/O data corresponding to a single event, with logical channel IDs (essentially string-uint pairs, e.g. tracks-0 to tracks-17).
Definition: EventData.h:28
void putEgObjects(edm::Event &iEvent, const ConstituentPtrVector &constituentsPtrs, const std::string &label, const std::vector< Tin > emulated) const
void addEvent(const l1t::demo::EventData &eventData)
def move(src, dest)
Definition: eostools.py:511
const RegionLinkMetadata & region2Link(unsigned int region) const
bool has(const LinkId &) const
Definition: EventData.cc:23
l1ct::L1EGPuppiIsoAlgo l2EgPuppiIsoAlgo_
float puppiIsol() const
Definition: TkEm.h:41
Definition: datatypes.h:8
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
std::string tkEmInstanceLabel_