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 
48  typedef std::vector<std::pair<edm::Ptr<l1t::L1Candidate>, edm::Ptr<L1TTTrackType>>> ConstituentPtrVector;
49 
50  void convertToEmu(const l1t::TkElectron &tkele,
51  ConstituentPtrVector &constituentsPtrs,
52  l1ct::OutputBoard &boarOut) const;
53  void convertToEmu(const l1t::TkEm &tkele, ConstituentPtrVector &constituentsPtrs, l1ct::OutputBoard &boarOut) const;
54  void convertToPuppi(const l1t::PFCandidateCollection &l1PFCands, l1ct::PuppiObjs &puppiObjs) const;
55 
56  template <class T>
58  public:
59  typedef std::vector<std::pair<edm::EDGetTokenT<T>, std::vector<int>>> InputTokenAndChannels;
60  PFInstanceInputs(L1TCtL2EgProducer *prod, const std::vector<edm::ParameterSet> &confs) {
61  for (const auto &conf : confs) {
62  const auto &producer_tag = conf.getParameter<edm::InputTag>("pfProducer");
63  tokensAndChannels_.push_back(std::make_pair(
64  prod->consumes<T>(edm::InputTag(producer_tag.label(), producer_tag.instance(), producer_tag.process())),
65  conf.getParameter<std::vector<int>>("channels")));
66  }
67  }
68 
69  const InputTokenAndChannels &tokensAndChannels() const { return tokensAndChannels_; }
70 
71  private:
73  };
74 
75  class PatternWriter {
76  public:
77  PatternWriter(const edm::ParameterSet &conf) : dataWriter_(nullptr) {
78  unsigned int nFramesPerBX = conf.getParameter<uint32_t>("nFramesPerBX");
79 
80  std::map<l1t::demo::LinkId, std::pair<l1t::demo::ChannelSpec, std::vector<size_t>>> channelSpecs;
81 
82  for (const auto &channelConf : conf.getParameter<std::vector<edm::ParameterSet>>("channels")) {
83  unsigned int inTMUX = channelConf.getParameter<uint32_t>("TMUX");
84  unsigned int eventGap =
85  inTMUX * nFramesPerBX - channelConf.getParameter<uint32_t>("nWords"); // assuming 96bit (= 3/2 word)
86  // words = TMUX*9-2*3/2*words
87  std::vector<uint32_t> chns = channelConf.getParameter<std::vector<uint32_t>>("channels");
88  channelSpecs[l1t::demo::LinkId{channelConf.getParameter<std::string>("interface"),
89  channelConf.getParameter<uint32_t>("id")}] =
90  std::make_pair(l1t::demo::ChannelSpec{inTMUX, eventGap},
91  std::vector<size_t>(std::begin(chns), std::end(chns)));
92  }
93 
94  dataWriter_ = std::make_unique<l1t::demo::BoardDataWriter>(
96  conf.getParameter<std::string>("outputFilename"),
97  conf.getParameter<std::string>("outputFileExtension"),
99  conf.getParameter<uint32_t>("TMUX"),
100  conf.getParameter<uint32_t>("maxLinesPerFile"),
101  channelSpecs);
102  }
103 
104  void addEvent(const l1t::demo::EventData &eventData) { dataWriter_->addEvent(eventData); }
105 
106  void flush() { dataWriter_->flush(); }
107 
108  private:
109  std::unique_ptr<l1t::demo::BoardDataWriter> dataWriter_;
110  };
111 
112  template <class TT, class T>
115  ConstituentPtrVector &constituentsPtrs,
116  std::unique_ptr<TT> &out) const {
118  for (const auto &tokenAndChannel : instance.tokensAndChannels()) {
119  iEvent.getByToken(tokenAndChannel.first, handle);
120  populate(out, handle, tokenAndChannel.second, constituentsPtrs);
121  }
122  }
123 
124  template <class TT, class T>
125  void populate(std::unique_ptr<T> &out,
126  const edm::Handle<TT> &in,
127  const std::vector<int> &links,
128  ConstituentPtrVector &constituentsPtrs) const {
129  assert(links.size() == in->nRegions());
130  for (unsigned int iBoard = 0, nBoard = in->nRegions(); iBoard < nBoard; ++iBoard) {
131  auto region = in->region(iBoard);
132  int linkID = links[iBoard];
133  if (linkID < 0)
134  continue;
135  // std::cout << "Board eta: " << in->eta(iBoard) << " phi: " << in->phi(iBoard) << " link: " << linkID << std::endl;
136  for (const auto &obj : region) {
137  convertToEmu(obj, constituentsPtrs, out->at(linkID));
138  }
139  }
140  }
141 
144  const std::vector<int> &links,
145  ConstituentPtrVector &constituentsPtrs) const {
146  for (int bx = in->getFirstBX(); bx <= in->getLastBX(); bx++) {
147  for (auto egee_itr = in->begin(bx); egee_itr != in->end(bx); egee_itr++) {
148  out->push_back(bx, *egee_itr);
149  }
150  }
151  }
152 
153  template <class Tout, class Tin>
155  const ConstituentPtrVector &constituentsPtrs,
156  const std::string &label,
157  const std::vector<Tin> emulated) const {
158  auto egobjs = std::make_unique<Tout>();
159  for (const auto &emu : emulated) {
160  if (emu.hwPt == 0)
161  continue;
162  auto obj = convertFromEmu(emu, constituentsPtrs);
163  egobjs->push_back(obj);
164  }
165  iEvent.put(std::move(egobjs), label);
166  }
167 
168  l1t::TkEm convertFromEmu(const l1ct::EGIsoObjEmu &emu, const ConstituentPtrVector &constituentsPtrs) const;
169  l1t::TkElectron convertFromEmu(const l1ct::EGIsoEleObjEmu &emu, const ConstituentPtrVector &constituentsPtrs) const;
170 
182  bool doInPtrn_;
184  std::unique_ptr<PatternWriter> inPtrnWrt_;
185  std::unique_ptr<PatternWriter> outPtrnWrt_;
186 };
187 
189  : tkEGInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkEgs")),
190  tkEmInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkEms")),
191  tkEleInputs_(this, conf.getParameter<std::vector<edm::ParameterSet>>("tkElectrons")),
192  tkEGInstanceLabel_(conf.getParameter<std::string>("egStaInstanceLabel")),
193  tkEmInstanceLabel_(conf.getParameter<std::string>("tkEmInstanceLabel")),
194  tkEleInstanceLabel_(conf.getParameter<std::string>("tkEleInstanceLabel")),
195  l2egsorter(conf.getParameter<edm::ParameterSet>("sorter")),
196  l2encoder(conf.getParameter<edm::ParameterSet>("encoder")),
197  pfObjsToken_(consumes<std::vector<l1t::PFCandidate>>(conf.getParameter<edm::InputTag>("l1PFObjects"))),
198  l2EgPuppiIsoAlgo_(conf.getParameter<edm::ParameterSet>("puppiIsoParametersTkEm")),
199  l2ElePuppiIsoAlgo_(conf.getParameter<edm::ParameterSet>("puppiIsoParametersTkEle")),
200  doInPtrn_(conf.getParameter<bool>("writeInPattern")),
201  doOutPtrn_(conf.getParameter<bool>("writeOutPattern")),
202  inPtrnWrt_(nullptr),
203  outPtrnWrt_(nullptr) {
204  produces<BXVector<l1t::EGamma>>(tkEGInstanceLabel_);
205  produces<l1t::TkEmCollection>(tkEmInstanceLabel_);
206  produces<l1t::TkElectronCollection>(tkEleInstanceLabel_);
207 
208  if (doInPtrn_) {
209  inPtrnWrt_ = std::make_unique<PatternWriter>(conf.getParameter<edm::ParameterSet>("inPatternFile"));
210  }
211  if (doOutPtrn_) {
212  outPtrnWrt_ = std::make_unique<PatternWriter>(conf.getParameter<edm::ParameterSet>("outPatternFile"));
213  }
214 }
215 
217 
218 ap_uint<64> L1TCtL2EgProducer::encodeLayer1(const EGIsoObjEmu &egiso) const {
219  ap_uint<64> ret = 0;
220  ret(EGIsoObjEmu::BITWIDTH, 0) = egiso.pack();
221  return ret;
222 }
223 
224 ap_uint<128> L1TCtL2EgProducer::encodeLayer1(const EGIsoEleObjEmu &egiso) const {
225  ap_uint<128> ret = 0;
226  ret(EGIsoEleObjEmu::BITWIDTH, 0) = egiso.pack();
227  return ret;
228 }
229 
230 std::vector<ap_uint<64>> L1TCtL2EgProducer::encodeLayer1(const std::vector<EGIsoObjEmu> &photons) const {
231  std::vector<ap_uint<64>> ret;
232  ret.reserve(photons.size());
233  for (const auto &phot : photons) {
234  ret.push_back(encodeLayer1(phot));
235  }
236  return ret;
237 }
238 
239 std::vector<ap_uint<64>> L1TCtL2EgProducer::encodeLayer1(const std::vector<EGIsoEleObjEmu> &electrons) const {
240  std::vector<ap_uint<64>> ret;
241  ret.reserve(2 * electrons.size());
242  for (const auto &ele : electrons) {
243  auto eleword = encodeLayer1(ele);
244  ret.push_back(eleword(63, 0));
245  ret.push_back(eleword(127, 64));
246  }
247  return ret;
248 }
249 
250 std::vector<ap_uint<64>> L1TCtL2EgProducer::encodeLayer1EgObjs(unsigned int nObj,
251  const std::vector<EGIsoObjEmu> &photons,
252  const std::vector<EGIsoEleObjEmu> &electrons) const {
253  std::vector<ap_uint<64>> ret;
254  auto encoded_photons = encodeLayer1(photons);
255  encoded_photons.resize(nObj, {0});
256  auto encoded_eles = encodeLayer1(electrons);
257  encoded_eles.resize(2 * nObj, {0});
258 
259  std::copy(encoded_photons.begin(), encoded_photons.end(), std::back_inserter(ret));
260  std::copy(encoded_eles.begin(), encoded_eles.end(), std::back_inserter(ret));
261 
262  return ret;
263 }
264 
266  ConstituentPtrVector constituents;
267 
268  auto outEgs = std::make_unique<BXVector<l1t::EGamma>>();
269  merge(tkEGInputs_, iEvent, constituents, outEgs);
270  iEvent.put(std::move(outEgs), tkEGInstanceLabel_);
271 
272  auto boards = std::make_unique<std::vector<l1ct::OutputBoard>>(l2egsorter.nInputBoards());
273 
274  merge(tkEleInputs_, iEvent, constituents, boards);
275  merge(tkEmInputs_, iEvent, constituents, boards);
276 
277  if (doInPtrn_) {
278  l1t::demo::EventData inData;
279  for (unsigned int ibrd = 0; ibrd < boards->size(); ibrd++) {
280  inData.add(
281  {"eglayer1", ibrd},
282  encodeLayer1EgObjs(l2egsorter.nInputObjPerBoard(), (*boards)[ibrd].egphoton, (*boards)[ibrd].egelectron));
283  }
284  inPtrnWrt_->addEvent(inData);
285  }
286 
287  std::vector<EGIsoObjEmu> out_photons_emu;
288  std::vector<EGIsoEleObjEmu> out_eles_emu;
289  l2egsorter.run(*boards, out_photons_emu, out_eles_emu);
290 
291  // PUPPI isolation
292  auto &pfObjs = iEvent.get(pfObjsToken_);
293  l1ct::PuppiObjs puppiObjs;
294  convertToPuppi(pfObjs, puppiObjs);
295  l2EgPuppiIsoAlgo_.run(out_photons_emu, puppiObjs);
296  l2ElePuppiIsoAlgo_.run(out_eles_emu, puppiObjs);
297 
298  if (doOutPtrn_) {
299  l1t::demo::EventData outData;
300  outData.add({"eglayer2", 0}, l2encoder.encodeLayer2EgObjs(out_photons_emu, out_eles_emu));
301  outPtrnWrt_->addEvent(outData);
302  }
303 
304  putEgObjects<l1t::TkEmCollection>(iEvent, constituents, tkEmInstanceLabel_, out_photons_emu);
305  putEgObjects<l1t::TkElectronCollection>(iEvent, constituents, tkEleInstanceLabel_, out_eles_emu);
306 }
307 
309  // Writing pending events to file before exiting
310  if (doOutPtrn_)
311  outPtrnWrt_->flush();
312  if (doInPtrn_)
313  inPtrnWrt_->flush();
314 }
315 
317  ConstituentPtrVector &constituentsPtrs,
318  l1ct::OutputBoard &boarOut) const {
319  EGIsoEleObjEmu emu;
320  emu.initFromBits(tkele.egBinaryWord<EGIsoEleObj::BITWIDTH>());
321  emu.srcCluster = nullptr;
322  emu.srcTrack = nullptr;
323 
324  constituentsPtrs.push_back(std::make_pair(tkele.egCaloPtr(), tkele.trkPtr()));
325  emu.src_idx = constituentsPtrs.size() - 1;
326 
327  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
328  emu.setHwIso(EGIsoEleObjEmu::IsoType::TkIso, l1ct::Scales::makeIso(tkele.trkIsol() * tkele.pt()));
329  emu.setHwIso(EGIsoEleObjEmu::IsoType::PfIso, l1ct::Scales::makeIso(tkele.pfIsol() * tkele.pt()));
330  emu.setHwIso(EGIsoEleObjEmu::IsoType::PuppiIso, l1ct::Scales::makeIso(tkele.puppiIsol() * tkele.pt()));
331  // std::cout << "[convertToEmu] TkEle pt: " << emu.hwPt << " eta: " << emu.hwEta << " phi: " << emu.hwPhi << " staidx: " << emu.src_idx << std::endl;
332  boarOut.egelectron.push_back(emu);
333 }
334 
336  ConstituentPtrVector &constituentsPtrs,
337  l1ct::OutputBoard &boarOut) const {
338  EGIsoObjEmu emu;
339  emu.initFromBits(tkem.egBinaryWord<EGIsoObj::BITWIDTH>());
340  emu.srcCluster = nullptr;
341  constituentsPtrs.push_back(std::make_pair(tkem.egCaloPtr(), edm::Ptr<L1TTTrackType>()));
342  emu.src_idx = constituentsPtrs.size() - 1;
343  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
344  emu.setHwIso(EGIsoObjEmu::IsoType::TkIso, l1ct::Scales::makeIso(tkem.trkIsol() * tkem.pt()));
345  emu.setHwIso(EGIsoObjEmu::IsoType::PfIso, l1ct::Scales::makeIso(tkem.pfIsol() * tkem.pt()));
346  emu.setHwIso(EGIsoObjEmu::IsoType::PuppiIso, l1ct::Scales::makeIso(tkem.puppiIsol() * tkem.pt()));
347  emu.setHwIso(EGIsoObjEmu::IsoType::TkIsoPV, l1ct::Scales::makeIso(tkem.trkIsolPV() * tkem.pt()));
348  emu.setHwIso(EGIsoObjEmu::IsoType::PfIsoPV, l1ct::Scales::makeIso(tkem.pfIsolPV() * tkem.pt()));
349  // std::cout << "[convertToEmu] TkEM pt: " << emu.hwPt << " eta: " << emu.hwEta << " phi: " << emu.hwPhi << " staidx: " << emu.src_idx << std::endl;
350  boarOut.egphoton.push_back(emu);
351 }
352 
354  for (const auto &l1PFCand : l1PFCands) {
356  obj.initFromBits(l1PFCand.encodedPuppi64());
357  puppiObjs.emplace_back(obj);
358  }
359 }
360 
362  const ConstituentPtrVector &constituentsPtrs) const {
363  // std::cout << "[convertFromEmu] TkEm pt: " << egiso.hwPt << " eta: " << egiso.hwEta << " phi: " << egiso.hwPhi << " staidx: " << egiso.src_idx << std::endl;
364  // NOTE: the TkEM object is created with the accuracy as in GT object (not the Correlator internal one)!
365  const auto gteg = egiso.toGT();
367  l1gt::Scales::floatPt(gteg.v3.pt), l1gt::Scales::floatEta(gteg.v3.eta), l1gt::Scales::floatPhi(gteg.v3.phi), 0.);
368  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
370  constituentsPtrs[egiso.src_idx].first,
371  egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::TkIso),
372  egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::TkIsoPV));
373  tkem.setHwQual(gteg.quality);
374  tkem.setPFIsol(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PfIso));
375  tkem.setPFIsolPV(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PfIsoPV));
376  tkem.setPuppiIsol(egiso.floatRelIso(l1ct::EGIsoObjEmu::IsoType::PuppiIso));
377  tkem.setEgBinaryWord(gteg.pack(), l1t::TkEm::HWEncoding::GT);
378  return tkem;
379 }
380 
382  const ConstituentPtrVector &constituentsPtrs) const {
383  // std::cout << "[convertFromEmu] TkEle pt: " << egele.hwPt << " eta: " << egele.hwEta << " phi: " << egele.hwPhi << " staidx: " << egele.src_idx << std::endl;
384  // NOTE: the TkElectron object is created with the accuracy as in GT object (not the Correlator internal one)!
385  const auto gteg = egele.toGT();
387  l1gt::Scales::floatPt(gteg.v3.pt), l1gt::Scales::floatEta(gteg.v3.eta), l1gt::Scales::floatPhi(gteg.v3.phi), 0.);
388  // NOTE: The emulator and FW data-format stores absolute iso while the CMSSW object stores relative iso
390  constituentsPtrs[egele.src_idx].first,
391  constituentsPtrs[egele.src_idx].second,
392  egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::TkIso));
393  tkele.setHwQual(gteg.quality);
394  tkele.setPFIsol(egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::PfIso));
395  tkele.setPuppiIsol(egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::PuppiIso));
396  tkele.setEgBinaryWord(gteg.pack(), l1t::TkElectron::HWEncoding::GT);
397  tkele.setIdScore(egele.floatIDScore());
398  tkele.setCharge(egele.intCharge());
399  return tkele;
400 }
401 
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:48
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:47
void setHwIso(IsoType type, iso_t value)
double pt() const final
transverse momentum
InputTokenAndChannels tokensAndChannels_
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:205
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
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
ap_uint< 64 > encodeLayer1(const EGIsoObjEmu &egiso) const
void populate(std::unique_ptr< T > &out, const edm::Handle< TT > &in, const std::vector< int > &links, ConstituentPtrVector &constituentsPtrs) const
ap_uint< N > egBinaryWord() const
Definition: TkEm.h:70
void setHwIso(IsoType type, iso_t value)
ap_uint< BITWIDTH > pack() const
Definition: egamma.h:128
void initFromBits(const ap_uint< BITWIDTH > &src)
Definition: egamma.h:149
unsigned int nInputBoards() const
float floatPt(pt_t pt)
Definition: gt_datatypes.h:46
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
void populate(std::unique_ptr< BXVector< l1t::EGamma >> &out, const edm::Handle< BXVector< l1t::EGamma >> &in, const std::vector< int > &links, ConstituentPtrVector &constituentsPtrs) const
std::vector< std::pair< edm::EDGetTokenT< T >, std::vector< int > > > InputTokenAndChannels
float pfIsolPV() const
Definition: TkEm.h:40
l1ct::L2EgSorterEmulator l2egsorter
unsigned int nInputObjPerBoard() const
std::string tkEleInstanceLabel_
void merge(const PFInstanceInputs< T > &instance, edm::Event &iEvent, ConstituentPtrVector &constituentsPtrs, std::unique_ptr< TT > &out) 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_
const edm::Ptr< L1TTTrackType > & trkPtr() const
Definition: TkElectron.h:39
const l1t::PFCluster * srcCluster
L1TCtL2EgProducer(const edm::ParameterSet &)
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
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 InputTokenAndChannels & tokensAndChannels() const
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_