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  std::vector<ap_uint<64>> encodeLayer1EgObjs(unsigned int nObj,
40  const std::vector<EGIsoObjEmu> &photons,
41  const std::vector<EGIsoEleObjEmu> &electrons) const;
42 
43  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
44 
45  void endJob() override;
46 
47  struct RefRemapper {
49 
51  std::map<edm::Ref<BXVector<l1t::EGamma>>, edm::Ref<BXVector<l1t::EGamma>>> old2newRefMap;
52  std::vector<std::pair<edm::Ref<l1t::EGammaBxCollection>, edm::Ptr<L1TTTrackType>>> origRefAndPtr;
53  };
54 
55  void convertToEmu(const l1t::TkElectron &tkele, RefRemapper &refRemapper, l1ct::OutputBoard &boarOut) const;
56  void convertToEmu(const l1t::TkEm &tkele, RefRemapper &refRemapper, l1ct::OutputBoard &boarOut) const;
57  void convertToPuppi(const l1t::PFCandidateCollection &l1PFCands, l1ct::PuppiObjs &puppiObjs) const;
58 
59  template <class T>
61  public:
62  typedef std::vector<std::pair<edm::EDGetTokenT<T>, std::vector<int>>> InputTokenAndChannels;
63  PFInstanceInputs(L1TCtL2EgProducer *prod, const std::vector<edm::ParameterSet> &confs) {
64  for (const auto &conf : confs) {
65  const auto &producer_tag = conf.getParameter<edm::InputTag>("pfProducer");
66  tokensAndChannels_.push_back(std::make_pair(
67  prod->consumes<T>(edm::InputTag(producer_tag.label(), producer_tag.instance(), producer_tag.process())),
68  conf.getParameter<std::vector<int>>("channels")));
69  }
70  }
71 
72  const InputTokenAndChannels &tokensAndChannels() const { return tokensAndChannels_; }
73 
74  private:
76  };
77 
78  class PatternWriter {
79  public:
80  PatternWriter(const edm::ParameterSet &conf) : dataWriter_(nullptr) {
81  unsigned int nFramesPerBX = conf.getParameter<uint32_t>("nFramesPerBX");
82 
83  std::map<l1t::demo::LinkId, std::pair<l1t::demo::ChannelSpec, std::vector<size_t>>> channelSpecs;
84 
85  for (const auto &channelConf : conf.getParameter<std::vector<edm::ParameterSet>>("channels")) {
86  unsigned int inTMUX = channelConf.getParameter<uint32_t>("TMUX");
87  unsigned int eventGap =
88  inTMUX * nFramesPerBX - channelConf.getParameter<uint32_t>("nWords"); // assuming 96bit (= 3/2 word)
89  // words = TMUX*9-2*3/2*words
90  std::vector<uint32_t> chns = channelConf.getParameter<std::vector<uint32_t>>("channels");
91  channelSpecs[l1t::demo::LinkId{channelConf.getParameter<std::string>("interface"),
92  channelConf.getParameter<uint32_t>("id")}] =
93  std::make_pair(l1t::demo::ChannelSpec{inTMUX, eventGap},
94  std::vector<size_t>(std::begin(chns), std::end(chns)));
95  }
96 
97  dataWriter_ = std::make_unique<l1t::demo::BoardDataWriter>(
99  conf.getParameter<std::string>("outputFilename"),
100  conf.getParameter<std::string>("outputFileExtension"),
101  nFramesPerBX,
102  conf.getParameter<uint32_t>("TMUX"),
103  conf.getParameter<uint32_t>("maxLinesPerFile"),
104  channelSpecs);
105  }
106 
107  void addEvent(const l1t::demo::EventData &eventData) { dataWriter_->addEvent(eventData); }
108 
109  void flush() { dataWriter_->flush(); }
110 
111  private:
112  std::unique_ptr<l1t::demo::BoardDataWriter> dataWriter_;
113  };
114 
115  template <class TT, class T>
118  RefRemapper &refRemapper,
119  std::unique_ptr<TT> &out) const {
121  for (const auto &tokenAndChannel : instance.tokensAndChannels()) {
122  iEvent.getByToken(tokenAndChannel.first, handle);
123  populate(out, handle, tokenAndChannel.second, refRemapper);
124  }
125  remapRefs(iEvent, out, refRemapper);
126  }
127 
128  template <class TT>
129  void remapRefs(edm::Event &iEvent, std::unique_ptr<TT> &out, RefRemapper &refRemapper) const {}
130 
132  edm::RefProd<BXVector<l1t::EGamma>> ref_egs = iEvent.getRefBeforePut<BXVector<l1t::EGamma>>(tkEGInstanceLabel_);
133  edm::Ref<BXVector<l1t::EGamma>>::key_type idx = 0;
134  for (std::size_t ix = 0; ix < out->size(); ix++) {
135  refRemapper.old2newRefMap[refRemapper.oldRefs[ix]] = edm::Ref<BXVector<l1t::EGamma>>(ref_egs, idx++);
136  }
137  }
138 
139  template <class TT, class T>
140  void populate(std::unique_ptr<T> &out,
141  const edm::Handle<TT> &in,
142  const std::vector<int> &links,
143  RefRemapper &refRemapper) const {
144  assert(links.size() == in->nRegions());
145  for (unsigned int iBoard = 0, nBoard = in->nRegions(); iBoard < nBoard; ++iBoard) {
146  auto region = in->region(iBoard);
147  int linkID = links[iBoard];
148  if (linkID < 0)
149  continue;
150  // std::cout << "Board eta: " << in->eta(iBoard) << " phi: " << in->phi(iBoard) << " link: " << linkID << std::endl;
151  for (const auto &obj : region) {
152  convertToEmu(obj, refRemapper, out->at(linkID));
153  }
154  }
155  }
156 
159  const std::vector<int> &links,
160  RefRemapper &refRemapper) const {
161  edm::Ref<BXVector<l1t::EGamma>>::key_type idx = 0;
162  for (int bx = in->getFirstBX(); bx <= in->getLastBX(); bx++) {
163  for (auto egee_itr = in->begin(bx); egee_itr != in->end(bx); egee_itr++) {
164  out->push_back(bx, *egee_itr);
165  // this to ensure that the old ref and the new object have the same
166  // index in the BXVector collection so that we can still match them no
167  // matter which BX we will insert next
169  }
170  }
171  }
172 
173  template <class Tout, class Tin>
175  const RefRemapper &refRemapper,
176  const std::string &label,
177  const std::vector<Tin> emulated) const {
178  auto egobjs = std::make_unique<Tout>();
179  for (const auto &emu : emulated) {
180  if (emu.hwPt == 0)
181  continue;
182  auto obj = convertFromEmu(emu, refRemapper);
183  egobjs->push_back(obj);
184  }
185  iEvent.put(std::move(egobjs), label);
186  }
187 
188  l1t::TkEm convertFromEmu(const l1ct::EGIsoObjEmu &emu, const RefRemapper &refRemapper) const;
189  l1t::TkElectron convertFromEmu(const l1ct::EGIsoEleObjEmu &emu, const RefRemapper &refRemapper) const;
190 
202  bool doInPtrn_;
204  std::unique_ptr<PatternWriter> inPtrnWrt_;
205  std::unique_ptr<PatternWriter> outPtrnWrt_;
206 };
207 
209  : tkEGInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkEgs")),
210  tkEmInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkEms")),
211  tkEleInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkElectrons")),
212  tkEGInstanceLabel_(conf.getParameter<std::string>("egStaInstanceLabel")),
213  tkEmInstanceLabel_(conf.getParameter<std::string>("tkEmInstanceLabel")),
214  tkEleInstanceLabel_(conf.getParameter<std::string>("tkEleInstanceLabel")),
215  l2egsorter(conf.getParameter<edm::ParameterSet>("sorter")),
216  l2encoder(conf.getParameter<edm::ParameterSet>("encoder")),
217  pfObjsToken_(consumes<std::vector<l1t::PFCandidate>>(conf.getParameter<edm::InputTag>("l1PFObjects"))),
218  l2EgPuppiIsoAlgo_(conf.getParameter<edm::ParameterSet>("puppiIsoParametersTkEm")),
219  l2ElePuppiIsoAlgo_(conf.getParameter<edm::ParameterSet>("puppiIsoParametersTkEle")),
220  doInPtrn_(conf.getParameter<bool>("writeInPattern")),
221  doOutPtrn_(conf.getParameter<bool>("writeOutPattern")),
222  inPtrnWrt_(nullptr),
223  outPtrnWrt_(nullptr) {
224  produces<BXVector<l1t::EGamma>>(tkEGInstanceLabel_);
225  produces<l1t::TkEmCollection>(tkEmInstanceLabel_);
226  produces<l1t::TkElectronCollection>(tkEleInstanceLabel_);
227 
228  if (doInPtrn_) {
229  inPtrnWrt_ = std::make_unique<PatternWriter>(conf.getParameter<edm::ParameterSet>("inPatternFile"));
230  }
231  if (doOutPtrn_) {
232  outPtrnWrt_ = std::make_unique<PatternWriter>(conf.getParameter<edm::ParameterSet>("outPatternFile"));
233  }
234 }
235 
237 
238 ap_uint<64> L1TCtL2EgProducer::encodeLayer1(const EGIsoObjEmu &egiso) const {
239  ap_uint<64> ret = 0;
240  ret(EGIsoObjEmu::BITWIDTH, 0) = egiso.pack();
241  return ret;
242 }
243 
244 ap_uint<128> L1TCtL2EgProducer::encodeLayer1(const EGIsoEleObjEmu &egiso) const {
245  ap_uint<128> ret = 0;
246  ret(EGIsoEleObjEmu::BITWIDTH, 0) = egiso.pack();
247  return ret;
248 }
249 
250 std::vector<ap_uint<64>> L1TCtL2EgProducer::encodeLayer1(const std::vector<EGIsoObjEmu> &photons) const {
251  std::vector<ap_uint<64>> ret;
252  ret.reserve(photons.size());
253  for (const auto &phot : photons) {
254  ret.push_back(encodeLayer1(phot));
255  }
256  return ret;
257 }
258 
259 std::vector<ap_uint<64>> L1TCtL2EgProducer::encodeLayer1(const std::vector<EGIsoEleObjEmu> &electrons) const {
260  std::vector<ap_uint<64>> ret;
261  ret.reserve(2 * electrons.size());
262  for (const auto &ele : electrons) {
263  auto eleword = encodeLayer1(ele);
264  ret.push_back(eleword(63, 0));
265  ret.push_back(eleword(127, 64));
266  }
267  return ret;
268 }
269 
270 std::vector<ap_uint<64>> L1TCtL2EgProducer::encodeLayer1EgObjs(unsigned int nObj,
271  const std::vector<EGIsoObjEmu> &photons,
272  const std::vector<EGIsoEleObjEmu> &electrons) const {
273  std::vector<ap_uint<64>> ret;
274  auto encoded_photons = encodeLayer1(photons);
275  encoded_photons.resize(nObj, {0});
276  auto encoded_eles = encodeLayer1(electrons);
277  encoded_eles.resize(2 * nObj, {0});
278 
279  std::copy(encoded_photons.begin(), encoded_photons.end(), std::back_inserter(ret));
280  std::copy(encoded_eles.begin(), encoded_eles.end(), std::back_inserter(ret));
281 
282  return ret;
283 }
284 
286  RefRemapper refmapper;
287 
288  auto outEgs = std::make_unique<BXVector<l1t::EGamma>>();
289  merge(tkEGInputs_, iEvent, refmapper, outEgs);
290  iEvent.put(std::move(outEgs), tkEGInstanceLabel_);
291 
292  auto boards = std::make_unique<std::vector<l1ct::OutputBoard>>(l2egsorter.nInputBoards());
293 
294  merge(tkEleInputs_, iEvent, refmapper, boards);
295  merge(tkEmInputs_, iEvent, refmapper, boards);
296 
297  if (doInPtrn_) {
298  l1t::demo::EventData inData;
299  for (unsigned int ibrd = 0; ibrd < boards->size(); ibrd++) {
300  inData.add(
301  {"eglayer1", ibrd},
302  encodeLayer1EgObjs(l2egsorter.nInputObjPerBoard(), (*boards)[ibrd].egphoton, (*boards)[ibrd].egelectron));
303  }
304  inPtrnWrt_->addEvent(inData);
305  }
306 
307  std::vector<EGIsoObjEmu> out_photons_emu;
308  std::vector<EGIsoEleObjEmu> out_eles_emu;
309  l2egsorter.run(*boards, out_photons_emu, out_eles_emu);
310 
311  // PUPPI isolation
312  auto &pfObjs = iEvent.get(pfObjsToken_);
313  l1ct::PuppiObjs puppiObjs;
314  convertToPuppi(pfObjs, puppiObjs);
315  l2EgPuppiIsoAlgo_.run(out_photons_emu, puppiObjs);
316  l2ElePuppiIsoAlgo_.run(out_eles_emu, puppiObjs);
317 
318  if (doOutPtrn_) {
319  l1t::demo::EventData outData;
320  outData.add({"eglayer2", 0}, l2encoder.encodeLayer2EgObjs(out_photons_emu, out_eles_emu));
321  outPtrnWrt_->addEvent(outData);
322  }
323 
324  putEgObjects<l1t::TkEmCollection>(iEvent, refmapper, tkEmInstanceLabel_, out_photons_emu);
325  putEgObjects<l1t::TkElectronCollection>(iEvent, refmapper, tkEleInstanceLabel_, out_eles_emu);
326 }
327 
329  // Writing pending events to file before exiting
330  if (doOutPtrn_)
331  outPtrnWrt_->flush();
332  if (doInPtrn_)
333  inPtrnWrt_->flush();
334 }
335 
337  RefRemapper &refRemapper,
338  l1ct::OutputBoard &boarOut) const {
339  EGIsoEleObjEmu emu;
340  emu.initFromBits(tkele.egBinaryWord<EGIsoEleObj::BITWIDTH>());
341  emu.srcCluster = nullptr;
342  emu.srcTrack = nullptr;
343  auto refEg = tkele.EGRef();
344  const auto newref = refRemapper.old2newRefMap.find(refEg);
345  if (newref != refRemapper.old2newRefMap.end()) {
346  refEg = newref->second;
347  }
348  refRemapper.origRefAndPtr.push_back(std::make_pair(refEg, tkele.trkPtr()));
349  emu.sta_idx = refRemapper.origRefAndPtr.size() - 1;
350  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
351  emu.setHwIso(EGIsoEleObjEmu::IsoType::TkIso, l1ct::Scales::makeIso(tkele.trkIsol() * tkele.pt()));
352  emu.setHwIso(EGIsoEleObjEmu::IsoType::PfIso, l1ct::Scales::makeIso(tkele.pfIsol() * tkele.pt()));
353  emu.setHwIso(EGIsoEleObjEmu::IsoType::PuppiIso, l1ct::Scales::makeIso(tkele.puppiIsol() * tkele.pt()));
354  // std::cout << "[convertToEmu] TkEle pt: " << emu.hwPt << " eta: " << emu.hwEta << " phi: " << emu.hwPhi << " staidx: " << emu.sta_idx << std::endl;
355  // FIXME: this is temporary while waiting to move the BDT score to the FW object
356  emu.idScore = tkele.idScore();
357  boarOut.egelectron.push_back(emu);
358 }
359 
361  RefRemapper &refRemapper,
362  l1ct::OutputBoard &boarOut) const {
363  EGIsoObjEmu emu;
364  emu.initFromBits(tkem.egBinaryWord<EGIsoObj::BITWIDTH>());
365  emu.srcCluster = nullptr;
366  auto refEg = tkem.EGRef();
367  const auto newref = refRemapper.old2newRefMap.find(refEg);
368  if (newref != refRemapper.old2newRefMap.end()) {
369  refEg = newref->second;
370  }
371  refRemapper.origRefAndPtr.push_back(std::make_pair(refEg, edm::Ptr<RefRemapper::L1TTTrackType>(nullptr, 0)));
372  emu.sta_idx = refRemapper.origRefAndPtr.size() - 1;
373  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
374  emu.setHwIso(EGIsoObjEmu::IsoType::TkIso, l1ct::Scales::makeIso(tkem.trkIsol() * tkem.pt()));
375  emu.setHwIso(EGIsoObjEmu::IsoType::PfIso, l1ct::Scales::makeIso(tkem.pfIsol() * tkem.pt()));
376  emu.setHwIso(EGIsoObjEmu::IsoType::PuppiIso, l1ct::Scales::makeIso(tkem.puppiIsol() * tkem.pt()));
377  emu.setHwIso(EGIsoObjEmu::IsoType::TkIsoPV, l1ct::Scales::makeIso(tkem.trkIsolPV() * tkem.pt()));
378  emu.setHwIso(EGIsoObjEmu::IsoType::PfIsoPV, l1ct::Scales::makeIso(tkem.pfIsolPV() * tkem.pt()));
379  // std::cout << "[convertToEmu] TkEM pt: " << emu.hwPt << " eta: " << emu.hwEta << " phi: " << emu.hwPhi << " staidx: " << emu.sta_idx << std::endl;
380  boarOut.egphoton.push_back(emu);
381 }
382 
384  for (const auto &l1PFCand : l1PFCands) {
386  obj.initFromBits(l1PFCand.encodedPuppi64());
387  puppiObjs.emplace_back(obj);
388  }
389 }
390 
392  // std::cout << "[convertFromEmu] TkEm pt: " << egiso.hwPt << " eta: " << egiso.hwEta << " phi: " << egiso.hwPhi << " staidx: " << egiso.sta_idx << std::endl;
393  // NOTE: the TkEM object is created with the accuracy as in GT object (not the Correlator internal one)!
394  const auto gteg = egiso.toGT();
396  l1gt::Scales::floatPt(gteg.v3.pt), l1gt::Scales::floatEta(gteg.v3.eta), l1gt::Scales::floatPhi(gteg.v3.phi), 0.);
397  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
399  refRemapper.origRefAndPtr[egiso.sta_idx].first,
400  egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::TkIso),
401  egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::TkIsoPV));
402  tkem.setHwQual(gteg.quality);
403  tkem.setPFIsol(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PfIso));
404  tkem.setPFIsolPV(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PfIsoPV));
405  tkem.setPuppiIsol(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PuppiIso));
406  tkem.setEgBinaryWord(gteg.pack());
407  return tkem;
408 }
409 
411  const RefRemapper &refRemapper) const {
412  // std::cout << "[convertFromEmu] TkEle pt: " << egele.hwPt << " eta: " << egele.hwEta << " phi: " << egele.hwPhi << " staidx: " << egele.sta_idx << std::endl;
413  // NOTE: the TkElectron object is created with the accuracy as in GT object (not the Correlator internal one)!
414  const auto gteg = egele.toGT();
416  l1gt::Scales::floatPt(gteg.v3.pt), l1gt::Scales::floatEta(gteg.v3.eta), l1gt::Scales::floatPhi(gteg.v3.phi), 0.);
417  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
419  refRemapper.origRefAndPtr[egele.sta_idx].first,
420  refRemapper.origRefAndPtr[egele.sta_idx].second,
421  egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::TkIso));
422  tkele.setHwQual(gteg.quality);
423  tkele.setPFIsol(egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::PfIso));
424  tkele.setPuppiIsol(egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::PuppiIso));
425  tkele.setEgBinaryWord(gteg.pack());
426  tkele.setIdScore(egele.idScore);
427  return tkele;
428 }
429 
std::unique_ptr< l1t::demo::BoardDataWriter > dataWriter_
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:46
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
float trkIsolPV() const
Definition: TkEm.h:42
void convertToPuppi(const l1t::PFCandidateCollection &l1PFCands, l1ct::PuppiObjs &puppiObjs) const
l1gt::Electron toGT() const
Definition: egamma.h:157
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
float floatEta(eta_t eta)
Definition: gt_datatypes.h:45
void setHwIso(IsoType type, iso_t value)
double pt() const final
transverse momentum
BXVector< edm::Ref< BXVector< l1t::EGamma > > > oldRefs
InputTokenAndChannels tokensAndChannels_
float trkIsol() const
Definition: TkEm.h:41
void merge(const PFInstanceInputs< T > &instance, edm::Event &iEvent, RefRemapper &refRemapper, std::unique_ptr< TT > &out) const
void remapRefs(edm::Event &iEvent, std::unique_ptr< BXVector< l1t::EGamma >> &out, RefRemapper &refRemapper) const
const l1t::PFTrack * srcTrack
static PFTauRenderPlugin instance
ret
prodAgent to be discontinued
std::vector< l1t::PFCandidate > PFCandidateCollection
Definition: PFCandidate.h:86
void remapRefs(edm::Event &iEvent, std::unique_ptr< TT > &out, RefRemapper &refRemapper) const
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
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
iso_t makeIso(float iso)
Definition: datatypes.h:206
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
assert(be >=bs)
const edm::Ref< EGammaBxCollection > & EGRef() const
Definition: TkEm.h:33
edm::EDGetTokenT< std::vector< l1t::PFCandidate > > pfObjsToken_
float floatRelIso(IsoType type) const
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:20
~L1TCtL2EgProducer() override
ap_uint< 64 > encodeLayer1(const EGIsoObjEmu &egiso) const
ap_uint< N > egBinaryWord() const
Definition: TkEm.h:66
void setHwIso(IsoType type, iso_t value)
void putEgObjects(edm::Event &iEvent, const RefRemapper &refRemapper, const std::string &label, const std::vector< Tin > emulated) const
ap_uint< BITWIDTH > pack() const
Definition: egamma.h:124
void initFromBits(const ap_uint< BITWIDTH > &src)
Definition: egamma.h:144
unsigned int nInputBoards() const
float floatPt(pt_t pt)
Definition: gt_datatypes.h:44
PFInstanceInputs< l1t::TkEmRegionalOutput > tkEmInputs_
l1gt::Photon toGT() const
Definition: egamma.h:70
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< std::pair< edm::EDGetTokenT< T >, std::vector< int > > > InputTokenAndChannels
float pfIsolPV() const
Definition: TkEm.h:44
l1ct::L2EgSorterEmulator l2egsorter
void populate(std::unique_ptr< T > &out, const edm::Handle< TT > &in, const std::vector< int > &links, RefRemapper &refRemapper) const
unsigned int nInputObjPerBoard() const
std::string tkEleInstanceLabel_
void populate(std::unique_ptr< BXVector< l1t::EGamma >> &out, const edm::Handle< BXVector< l1t::EGamma >> &in, const std::vector< int > &links, RefRemapper &refRemapper) 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
std::vector< EGIsoObjEmu > egphoton
HLT enums.
l1ct::L1EGPuppiIsoAlgo l2ElePuppiIsoAlgo_
l1t::TkEm convertFromEmu(const l1ct::EGIsoObjEmu &emu, const RefRemapper &refRemapper) const
const edm::Ptr< L1TTTrackType > & trkPtr() const
Definition: TkElectron.h:38
const l1t::PFCluster * srcCluster
float idScore() const
Definition: TkElectron.h:42
L1TCtL2EgProducer(const edm::ParameterSet &)
std::map< edm::Ref< BXVector< l1t::EGamma > >, edm::Ref< BXVector< l1t::EGamma > > > old2newRefMap
l1ct::L2EgEncoderEmulator l2encoder
std::vector< ap_uint< 64 > > encodeLayer1EgObjs(unsigned int nObj, const std::vector< EGIsoObjEmu > &photons, const std::vector< EGIsoEleObjEmu > &electrons) const
PFInstanceInputs< BXVector< l1t::EGamma > > tkEGInputs_
long double T
std::vector< std::pair< edm::Ref< l1t::EGammaBxCollection >, edm::Ptr< L1TTTrackType > > > origRefAndPtr
float pfIsol() const
Definition: TkEm.h:43
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 addEvent(const l1t::demo::EventData &eventData)
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
def move(src, dest)
Definition: eostools.py:511
const InputTokenAndChannels & tokensAndChannels() const
void push_back(int bx, T object)
void convertToEmu(const l1t::TkElectron &tkele, RefRemapper &refRemapper, l1ct::OutputBoard &boarOut) const
l1ct::L1EGPuppiIsoAlgo l2EgPuppiIsoAlgo_
float puppiIsol() const
Definition: TkEm.h:45
Definition: datatypes.h:17
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
std::string tkEmInstanceLabel_