CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
l1ct::L2EgEncoderEmulator Struct Reference

#include <l2egencoder_ref.h>

Public Member Functions

std::vector< ap_uint< 64 > > encodeLayer2EgObjs (const std::vector< EGIsoObjEmu > &photons, const std::vector< EGIsoEleObjEmu > &electrons) const
 
template<class T >
std::vector< ap_uint< 64 > > encodeLayer2EgObjs_trivial (const std::vector< T > &egs, int n) const
 
 L2EgEncoderEmulator (unsigned int nTKELE_OUT, unsigned int nTKPHO_OUT)
 
 L2EgEncoderEmulator (const edm::ParameterSet &iConfig)
 
void toFirmware (const std::vector< ap_uint< 64 >> &encoded_in, ap_uint< 64 > encoded_fw[]) const
 

Private Member Functions

template<class T >
ap_uint< 96 > encodeLayer2 (const T &egiso) const
 
template<class T >
std::vector< ap_uint< 96 > > encodeLayer2 (const std::vector< T > &egisos) const
 
template<class T >
ap_uint< 96 > encodeLayer2_trivial (const T &egiso) const
 
template<class T >
std::vector< ap_uint< 96 > > encodeLayer2_trivial (const std::vector< T > &egisos) const
 
void encodeLayer2To64bits (const std::vector< ap_uint< 96 >> &packed96, std::vector< ap_uint< 64 >> &packed64) const
 

Private Attributes

unsigned int nEncodedWords_
 
unsigned int nTkEleOut_
 
unsigned int nTkPhoOut_
 

Detailed Description

Definition at line 14 of file l2egencoder_ref.h.

Constructor & Destructor Documentation

◆ L2EgEncoderEmulator() [1/2]

l1ct::L2EgEncoderEmulator::L2EgEncoderEmulator ( unsigned int  nTKELE_OUT,
unsigned int  nTKPHO_OUT 
)
inline

Definition at line 15 of file l2egencoder_ref.h.

References cms::cuda::assert(), nTkEleOut_, and nTkPhoOut_.

◆ L2EgEncoderEmulator() [2/2]

l1ct::L2EgEncoderEmulator::L2EgEncoderEmulator ( const edm::ParameterSet iConfig)

Member Function Documentation

◆ encodeLayer2() [1/2]

template<class T >
ap_uint<96> l1ct::L2EgEncoderEmulator::encodeLayer2 ( const T egiso) const
inlineprivate

Definition at line 53 of file l2egencoder_ref.h.

Referenced by encodeLayer2(), and encodeLayer2EgObjs().

53  {
54  return egiso.toGT().pack();
55  }

◆ encodeLayer2() [2/2]

template<class T >
std::vector<ap_uint<96> > l1ct::L2EgEncoderEmulator::encodeLayer2 ( const std::vector< T > &  egisos) const
inlineprivate

Definition at line 58 of file l2egencoder_ref.h.

References encodeLayer2(), and runTheMatrix::ret.

58  {
59  std::vector<ap_uint<96>> ret;
60  ret.reserve(egisos.size());
61  for (const auto& egiso : egisos) {
62  ret.push_back(encodeLayer2(egiso));
63  }
64  return ret;
65  }
ret
prodAgent to be discontinued
ap_uint< 96 > encodeLayer2(const T &egiso) const

◆ encodeLayer2_trivial() [1/2]

template<class T >
ap_uint<96> l1ct::L2EgEncoderEmulator::encodeLayer2_trivial ( const T egiso) const
inlineprivate

Definition at line 68 of file l2egencoder_ref.h.

References runTheMatrix::ret.

Referenced by encodeLayer2_trivial().

68  {
69  ap_uint<96> ret = 0;
70  ret(T::BITWIDTH - 1, 0) = egiso.pack();
71  return ret;
72  }
ret
prodAgent to be discontinued

◆ encodeLayer2_trivial() [2/2]

template<class T >
std::vector<ap_uint<96> > l1ct::L2EgEncoderEmulator::encodeLayer2_trivial ( const std::vector< T > &  egisos) const
inlineprivate

Definition at line 75 of file l2egencoder_ref.h.

References encodeLayer2_trivial(), and runTheMatrix::ret.

75  {
76  std::vector<ap_uint<96>> ret;
77  for (const auto& egiso : egisos) {
78  ret.push_back(encodeLayer2_trivial(egiso));
79  }
80  return ret;
81  }
ret
prodAgent to be discontinued
ap_uint< 96 > encodeLayer2_trivial(const T &egiso) const

◆ encodeLayer2EgObjs()

std::vector<ap_uint<64> > l1ct::L2EgEncoderEmulator::encodeLayer2EgObjs ( const std::vector< EGIsoObjEmu > &  photons,
const std::vector< EGIsoEleObjEmu > &  electrons 
) const
inline

Definition at line 25 of file l2egencoder_ref.h.

References pwdgSkimBPark_cfi::electrons, encodeLayer2(), encodeLayer2To64bits(), nTkEleOut_, nTkPhoOut_, BPHMonitor_cfi::photons, and runTheMatrix::ret.

Referenced by L1TCtL2EgProducer::produce().

26  {
27  std::vector<ap_uint<64>> ret;
28 
29  auto encoded_photons = encodeLayer2(photons);
30  encoded_photons.resize(nTkPhoOut_, {0});
31  auto encoded_eles = encodeLayer2(electrons);
32  encoded_eles.resize(nTkEleOut_, {0});
33  //
34  encodeLayer2To64bits(encoded_eles, ret);
35  encodeLayer2To64bits(encoded_photons, ret);
36  return ret;
37  }
ret
prodAgent to be discontinued
void encodeLayer2To64bits(const std::vector< ap_uint< 96 >> &packed96, std::vector< ap_uint< 64 >> &packed64) const
ap_uint< 96 > encodeLayer2(const T &egiso) const

◆ encodeLayer2EgObjs_trivial()

template<class T >
std::vector<ap_uint<64> > l1ct::L2EgEncoderEmulator::encodeLayer2EgObjs_trivial ( const std::vector< T > &  egs,
int  n 
) const
inline

Definition at line 40 of file l2egencoder_ref.h.

References encodeLayer2To64bits(), create_idmaps::n, and runTheMatrix::ret.

40  {
41  std::vector<ap_uint<64>> ret;
42 
43  auto encoded_egs = encodeLayer2_trivial<T>(egs);
44  encoded_egs.resize(n, {0});
45  //
46  encodeLayer2To64bits(encoded_egs, ret);
47 
48  return ret;
49  }
ret
prodAgent to be discontinued
void encodeLayer2To64bits(const std::vector< ap_uint< 96 >> &packed96, std::vector< ap_uint< 64 >> &packed64) const

◆ encodeLayer2To64bits()

void l1ct::L2EgEncoderEmulator::encodeLayer2To64bits ( const std::vector< ap_uint< 96 >> &  packed96,
std::vector< ap_uint< 64 >> &  packed64 
) const
inlineprivate

Definition at line 83 of file l2egencoder_ref.h.

References mps_fire::i.

Referenced by encodeLayer2EgObjs(), and encodeLayer2EgObjs_trivial().

83  {
84  for (unsigned int i = 0; i < packed96.size(); i += 2) {
85  packed64.push_back(packed96[i](63, 0));
86  packed64.push_back((ap_uint<32>(packed96[i + 1](95, 64)), ap_uint<32>(packed96[i](95, 64))));
87  packed64.push_back(packed96[i + 1](63, 0));
88  }
89  }

◆ toFirmware()

void l1ct::L2EgEncoderEmulator::toFirmware ( const std::vector< ap_uint< 64 >> &  encoded_in,
ap_uint< 64 >  encoded_fw[] 
) const

Member Data Documentation

◆ nEncodedWords_

unsigned int l1ct::L2EgEncoderEmulator::nEncodedWords_
private

Definition at line 93 of file l2egencoder_ref.h.

◆ nTkEleOut_

unsigned int l1ct::L2EgEncoderEmulator::nTkEleOut_
private

Definition at line 91 of file l2egencoder_ref.h.

Referenced by encodeLayer2EgObjs(), and L2EgEncoderEmulator().

◆ nTkPhoOut_

unsigned int l1ct::L2EgEncoderEmulator::nTkPhoOut_
private

Definition at line 92 of file l2egencoder_ref.h.

Referenced by encodeLayer2EgObjs(), and L2EgEncoderEmulator().