CMS 3D CMS Logo

Namespaces | Classes | Typedefs | Functions
l1ct Namespace Reference

Namespaces

 multififo_regionizer
 
 Scales
 
 tdr_regionizer
 

Classes

class  BufferedFoldedMultififoRegionizerEmulator
 
class  DeregionizerEmulator
 
class  DeregionizerInput
 
struct  DetectorSector
 
struct  EGInputSelectorEmuConfig
 
class  EGInputSelectorEmulator
 
struct  EGIsoEleObj
 
struct  EGIsoEleObjEmu
 
struct  EGIsoObj
 
struct  EGIsoObjEmu
 
struct  EGObjEmu
 
struct  EmCaloObj
 
struct  EmCaloObjEmu
 
struct  Event
 
class  FoldedMultififoRegionizerEmulator
 
class  GMTMuonDecoderEmulator
 
struct  HadCaloObj
 
struct  HadCaloObjEmu
 
class  HgcalClusterDecoderEmulator
 
struct  Jet
 
class  L1EGPuppiIsoAlgo
 
struct  L1EGPuppiIsoAlgoConfig
 
struct  L2EgEncoderEmulator
 
class  L2EgSorterEmulator
 
class  LinPuppiEmulator
 
class  MiddleBufferMultififoRegionizerEmulator
 
class  MultififoRegionizerEmulator
 
struct  MuObj
 
struct  MuObjEmu
 
struct  OutputBoard
 
struct  OutputRegion
 
struct  ParticleID
 
class  PFAlgo2HGCEmulator
 
class  PFAlgo3Emulator
 
class  PFAlgoDummyEmulator
 
class  PFAlgoEmulatorBase
 
struct  PFChargedObj
 
struct  PFChargedObjEmu
 
struct  PFCommonObj
 
struct  PFInputRegion
 
struct  PFNeutralObj
 
struct  PFNeutralObjEmu
 
struct  PFRegion
 
struct  PFRegionEmu
 
struct  PFTkEGAlgoEmuConfig
 
class  PFTkEGAlgoEmulator
 
class  PFTkEGSorterBarrelEmulator
 
class  PFTkEGSorterEmulator
 
struct  PuppiObj
 
struct  PuppiObjEmu
 
struct  PVObj
 
struct  PVObjEmu
 
struct  RawInputs
 
struct  RegionizerDecodedInputs
 
class  RegionizerEmulator
 
struct  Sum
 
struct  Tau
 
class  TDRRegionizerEmulator
 
struct  TkObj
 
struct  TkObjEmu
 
class  TrackInputEmulator
 

Typedefs

typedef ap_fixed< 16, 14, AP_TRN, AP_SAT > dpt_t
 
typedef ap_int< 8 > dxy_t
 
typedef std::vector< EGIsoEleObjEmuEGIsoEleObjsEmu
 
typedef std::vector< EGIsoObjEmuEGIsoObjsEmu
 
typedef ap_uint< 4 > egquality_t
 
typedef ap_uint< 10 > em2calo_dr_t
 
typedef ap_uint< 6 > emid_t
 
typedef ap_int< 10 > eta_t
 
typedef ap_fixed< 18, 5, AP_RND_CONV, AP_SAT > etaphi_sf_t
 
typedef ap_int< 12 > glbeta_t
 
typedef ap_int< 11 > glbphi_t
 
typedef ap_ufixed< 10, 5, AP_TRN, AP_SAT > hoe_t
 
typedef ap_fixed< 10, 1, AP_RND_CONV, AP_SAT > id_score_t
 
typedef ap_ufixed< 11, 9, AP_TRN, AP_SAT > iso_t
 
typedef ap_uint< 8 > meanz_t
 
typedef ap_int< 10 > phi_t
 
typedef ap_ufixed< 10, 8, AP_TRN, AP_SAT > pt10_t
 
typedef ap_ufixed< 28, 24, AP_TRN, AP_SAT > pt2_t
 
typedef ap_ufixed< 14, 12, AP_TRN, AP_SAT > pt_t
 
typedef ap_fixed< 10, 6 > ptErrOffs_t
 
typedef ap_ufixed< 9, 1 > ptErrScale_t
 
typedef ap_ufixed< 17, 17 - 4, AP_TRN, AP_SAT > ptscale_t
 
typedef std::vector< PuppiObjPuppiObjs
 
typedef ap_uint< 9 > puppiWgt_t
 
typedef ap_uint< 4 > redChi2Bin_t
 
typedef ap_ufixed< 10, 1, AP_TRN, AP_SAT > srrtot_t
 
typedef ap_uint< 3 > stub_t
 
typedef ap_uint< 13 > tk2calo_dq_t
 
typedef ap_uint< 14 > tk2calo_dr_t
 
typedef ap_uint< 14 > tk2em_dr_t
 
typedef ap_int< 6 > tkdeta_t
 
typedef ap_uint< 7 > tkdphi_t
 
typedef ap_uint< 3 > tkquality_t
 
typedef ap_int< 5 > vtx_t
 
typedef ap_int< 10 > z0_t
 

Functions

constexpr int ceillog2 (int x)
 
void clear (Sum &c)
 
void clear (EGIsoObj &c)
 
void clear (HadCaloObj &c)
 
void clear (Jet &c)
 
void clear (PFChargedObj &c)
 
void clear (Tau &c)
 
void clear (PFNeutralObj &c)
 
void clear (EmCaloObj &c)
 
void clear (EGIsoEleObj &c)
 
void clear (PuppiObj &c)
 
void clear (TkObj &c)
 
void clear (MuObj &c)
 
void clear (PVObj &c)
 
l1gt::eta_t CTtoGT_eta (glbeta_t x)
 
l1gt::phi_t CTtoGT_phi (glbphi_t x)
 
l1gt::pt_t CTtoGT_pt (pt_t x)
 
int dr2_int (eta_t eta1, phi_t phi1, eta_t eta2, phi_t phi2)
 
template<class data_T , int N>
unsigned idx_from_real_val (data_T x)
 
template<class data_T , class table_T , int N>
void init_invert_table (table_T table_out[N])
 
template<class in_t , class table_t , int N>
table_t invert_with_shift (in_t in)
 
template<typename T >
bool readAP (std::fstream &from, T &to)
 
template<typename T >
bool readMany (std::fstream &from, std::vector< T > &objs)
 
template<int NB>
bool readMany (std::fstream &from, std::vector< ap_uint< NB >> &objs)
 
template<typename T >
bool readObj (std::fstream &from, T &obj)
 
template<typename T >
bool readVar (std::fstream &from, T &to)
 
template<class data_T , int N>
float real_val_from_idx (unsigned i)
 
template<typename T1 , typename T2 >
void toFirmware (const std::vector< T1 > &in, unsigned int NMAX, T2 out[])
 
template<typename T >
bool writeAP (const T &src, std::fstream &to)
 
template<typename T >
bool writeMany (const std::vector< T > &objs, std::fstream &to)
 
template<int NB>
bool writeMany (const std::vector< ap_uint< NB >> &objs, std::fstream &to)
 
template<typename T >
bool writeObj (const T &obj, std::fstream &to)
 
template<typename T >
bool writeVar (const T &src, std::fstream &to)
 

Typedef Documentation

◆ dpt_t

typedef ap_fixed<16, 14, AP_TRN, AP_SAT> l1ct::dpt_t

Definition at line 12 of file datatypes.h.

◆ dxy_t

typedef ap_int<8> l1ct::dxy_t

Definition at line 22 of file datatypes.h.

◆ EGIsoEleObjsEmu

typedef std::vector<EGIsoEleObjEmu> l1ct::EGIsoEleObjsEmu

Definition at line 42 of file L1EGPuppiIsoAlgo.h.

◆ EGIsoObjsEmu

typedef std::vector<EGIsoObjEmu> l1ct::EGIsoObjsEmu

Definition at line 41 of file L1EGPuppiIsoAlgo.h.

◆ egquality_t

typedef ap_uint<4> l1ct::egquality_t

Definition at line 30 of file datatypes.h.

◆ em2calo_dr_t

typedef ap_uint<10> l1ct::em2calo_dr_t

Definition at line 28 of file datatypes.h.

◆ emid_t

typedef ap_uint<6> l1ct::emid_t

Definition at line 25 of file datatypes.h.

◆ eta_t

typedef ap_int<10> l1ct::eta_t

Definition at line 14 of file datatypes.h.

◆ etaphi_sf_t

typedef ap_fixed<18, 5, AP_RND_CONV, AP_SAT> l1ct::etaphi_sf_t

Definition at line 359 of file gt_datatypes.h.

◆ glbeta_t

typedef ap_int<12> l1ct::glbeta_t

Definition at line 18 of file datatypes.h.

◆ glbphi_t

typedef ap_int<11> l1ct::glbphi_t

Definition at line 19 of file datatypes.h.

◆ hoe_t

typedef ap_ufixed<10, 5, AP_TRN, AP_SAT> l1ct::hoe_t

Definition at line 34 of file datatypes.h.

◆ id_score_t

typedef ap_fixed<10, 1, AP_RND_CONV, AP_SAT> l1ct::id_score_t

Definition at line 36 of file datatypes.h.

◆ iso_t

typedef ap_ufixed<11, 9, AP_TRN, AP_SAT> l1ct::iso_t

Definition at line 39 of file datatypes.h.

◆ meanz_t

typedef ap_uint<8> l1ct::meanz_t

Definition at line 33 of file datatypes.h.

◆ phi_t

typedef ap_int<10> l1ct::phi_t

Definition at line 15 of file datatypes.h.

◆ pt10_t

typedef ap_ufixed<10, 8, AP_TRN, AP_SAT> l1ct::pt10_t

Definition at line 11 of file datatypes.h.

◆ pt2_t

typedef ap_ufixed<28, 24, AP_TRN, AP_SAT> l1ct::pt2_t

Definition at line 13 of file datatypes.h.

◆ pt_t

typedef ap_ufixed<14, 12, AP_TRN, AP_SAT> l1ct::pt_t

Definition at line 10 of file datatypes.h.

◆ ptErrOffs_t

typedef ap_fixed<10, 6> l1ct::ptErrOffs_t

Definition at line 10 of file pfalgo_types.h.

◆ ptErrScale_t

typedef ap_ufixed<9, 1> l1ct::ptErrScale_t

Definition at line 9 of file pfalgo_types.h.

◆ ptscale_t

typedef ap_ufixed<17, 17 - 4, AP_TRN, AP_SAT> l1ct::ptscale_t

Definition at line 8 of file pfalgo_types.h.

◆ PuppiObjs

typedef std::vector<PuppiObj> l1ct::PuppiObjs

Definition at line 43 of file L1EGPuppiIsoAlgo.h.

◆ puppiWgt_t

typedef ap_uint<9> l1ct::puppiWgt_t

Definition at line 24 of file datatypes.h.

◆ redChi2Bin_t

typedef ap_uint<4> l1ct::redChi2Bin_t

Definition at line 35 of file datatypes.h.

◆ srrtot_t

typedef ap_ufixed<10, 1, AP_TRN, AP_SAT> l1ct::srrtot_t

Definition at line 32 of file datatypes.h.

◆ stub_t

typedef ap_uint<3> l1ct::stub_t

Definition at line 31 of file datatypes.h.

◆ tk2calo_dq_t

typedef ap_uint<13> l1ct::tk2calo_dq_t

Definition at line 29 of file datatypes.h.

◆ tk2calo_dr_t

typedef ap_uint<14> l1ct::tk2calo_dr_t

Definition at line 27 of file datatypes.h.

◆ tk2em_dr_t

typedef ap_uint<14> l1ct::tk2em_dr_t

Definition at line 26 of file datatypes.h.

◆ tkdeta_t

typedef ap_int<6> l1ct::tkdeta_t

Definition at line 16 of file datatypes.h.

◆ tkdphi_t

typedef ap_uint<7> l1ct::tkdphi_t

Definition at line 17 of file datatypes.h.

◆ tkquality_t

typedef ap_uint<3> l1ct::tkquality_t

Definition at line 23 of file datatypes.h.

◆ vtx_t

typedef ap_int<5> l1ct::vtx_t

Definition at line 20 of file datatypes.h.

◆ z0_t

typedef ap_int<10> l1ct::z0_t

Definition at line 21 of file datatypes.h.

Function Documentation

◆ ceillog2()

constexpr int l1ct::ceillog2 ( int  x)

Definition at line 6 of file inversion.h.

References x.

Referenced by idx_from_real_val(), and real_val_from_idx().

6 { return (x <= 2) ? 1 : 1 + ceillog2((x + 1) / 2); }
constexpr int ceillog2(int x)
Definition: inversion.h:6
float x

◆ clear() [1/13]

void l1ct::clear ( Sum c)
inline

Definition at line 60 of file sums.h.

References HltBtagPostValidation_cff::c.

◆ clear() [2/13]

void l1ct::clear ( EGIsoObj c)
inline

Definition at line 82 of file egamma.h.

References HltBtagPostValidation_cff::c.

Referenced by core.autovars.NTupleObjectType::addSubObjects(), ALPAKA_ACCELERATOR_NAMESPACE::AlpakaService::AlpakaService(), DTTFFEDReader::analyse(), IsoTrig::analyze(), IsoTrig::clearChgIsolnTreeVectors(), npstat::BoxND< unsigned >::copyFrom(), CSCALCTPreTriggerDigi::CSCALCTPreTriggerDigi(), DTTracoTrig::DTTracoTrig(), L1GtHfRingEtSumsCondition::evaluateCondition(), L1GtBptxCondition::evaluateCondition(), L1GtCastorCondition::evaluateCondition(), L1GtExternalCondition::evaluateCondition(), L1GtHfBitCountsCondition::evaluateCondition(), L1GtJetCountsCondition::evaluateCondition(), L1GtEnergySumCondition::evaluateCondition(), L1GtMuonCondition::evaluateCondition(), l1t::EnergySumCondition::evaluateCondition(), l1t::EnergySumZdcCondition::evaluateCondition(), l1t::ExternalCondition::evaluateCondition(), l1t::CorrCondition::evaluateCondition(), L1GtCorrelationCondition::evaluateCondition(), l1t::CorrThreeBodyCondition::evaluateCondition(), l1t::CorrWithOverlapRemovalCondition::evaluateCondition(), FEConfigBadStripInfo::FEConfigBadStripInfo(), FEConfigBadTTInfo::FEConfigBadTTInfo(), FEConfigBadXTInfo::FEConfigBadXTInfo(), FEConfigCokeDat::FEConfigCokeDat(), FEConfigCokeInfo::FEConfigCokeInfo(), FEConfigFgrInfo::FEConfigFgrInfo(), FEConfigLinInfo::FEConfigLinInfo(), FEConfigLUTInfo::FEConfigLUTInfo(), FEConfigMainInfo::FEConfigMainInfo(), FEConfigOddWeightInfo::FEConfigOddWeightInfo(), FEConfigPedInfo::FEConfigPedInfo(), FEConfigSlidingInfo::FEConfigSlidingInfo(), FEConfigSpikeInfo::FEConfigSpikeInfo(), FEConfigTimingInfo::FEConfigTimingInfo(), FEConfigWeightInfo::FEConfigWeightInfo(), Pythia8HepMC3Hadronizer::initializeForExternalPartons(), Pythia8Hadronizer::initializeForExternalPartons(), Pythia8HepMC3Hadronizer::initializeForInternalPartons(), Pythia8Hadronizer::initializeForInternalPartons(), HcalGeomParameters::loadGeometry(), CSCStubMatcher::match(), CSCDigiMatcher::match(), GEMDigiMatcher::match(), ODBadTTInfo::ODBadTTInfo(), ODBadXTInfo::ODBadXTInfo(), ODCCSConfig::ODCCSConfig(), ODCond2ConfInfo::ODCond2ConfInfo(), ODDCCConfig::ODDCCConfig(), ODDCUConfig::ODDCUConfig(), ODEcalCycle::ODEcalCycle(), ODFEDAQConfig::ODFEDAQConfig(), ODFEDelaysInfo::ODFEDelaysInfo(), ODFEPedestalOffsetInfo::ODFEPedestalOffsetInfo(), ODFEWeightsInfo::ODFEWeightsInfo(), ODGolBiasCurrentInfo::ODGolBiasCurrentInfo(), ODJBH4Config::ODJBH4Config(), ODLaserConfig::ODLaserConfig(), ODLTCConfig::ODLTCConfig(), ODLTSConfig::ODLTSConfig(), ODScanConfig::ODScanConfig(), ODSRPConfig::ODSRPConfig(), ODTCCConfig::ODTCCConfig(), ODTCCEEConfig::ODTCCEEConfig(), ODTowersToByPassInfo::ODTowersToByPassInfo(), ODTTCciConfig::ODTTCciConfig(), ODTTCFConfig::ODTTCFConfig(), ODVfeToRejectInfo::ODVfeToRejectInfo(), FFTJetProducer::produce(), EcalFEtoDigi::readInput(), l1tVertexFinder::RecoVertex< T >::RecoVertex(), SequenceTypes._ModuleSequenceType::remove(), SequenceTypes._TaskBase::remove(), SequenceTypes._ModuleSequenceType::replace(), SequenceTypes._TaskBase::replace(), DTTracoLUTs::reset(), HoughGrouping::resetAttributes(), DQMImplNet< DQMNet::Object >::sendObjectListToPeer(), CaloRecHit::setFlagField(), toFirmware(), RPCCosmicSeedrecHitFinder::unsetInput(), SimG4HcalValidation::update(), MultiVertexFitter::vertices(), ALPAKA_ACCELERATOR_NAMESPACE::AlpakaService::~AlpakaService(), edm::CosMuoGenProducer::~CosMuoGenProducer(), CSCLayerInfo< TYPE >::~CSCLayerInfo(), DTTracoLUTs::~DTTracoLUTs(), and LinTrackCache::~LinTrackCache().

◆ clear() [3/13]

void l1ct::clear ( HadCaloObj c)
inline

Definition at line 87 of file layer1_objs.h.

References HltBtagPostValidation_cff::c.

◆ clear() [4/13]

void l1ct::clear ( Jet c)
inline

Definition at line 91 of file jets.h.

References HltBtagPostValidation_cff::c.

◆ clear() [5/13]

void l1ct::clear ( PFChargedObj c)
inline

Definition at line 110 of file pf.h.

References HltBtagPostValidation_cff::c.

◆ clear() [6/13]

void l1ct::clear ( Tau c)
inline

Definition at line 126 of file taus.h.

References HltBtagPostValidation_cff::c.

◆ clear() [7/13]

void l1ct::clear ( PFNeutralObj c)
inline

Definition at line 159 of file pf.h.

References HltBtagPostValidation_cff::c.

◆ clear() [8/13]

void l1ct::clear ( EmCaloObj c)
inline

Definition at line 163 of file layer1_objs.h.

References HltBtagPostValidation_cff::c.

◆ clear() [9/13]

void l1ct::clear ( EGIsoEleObj c)
inline

Definition at line 178 of file egamma.h.

References HltBtagPostValidation_cff::c.

◆ clear() [10/13]

void l1ct::clear ( PuppiObj c)
inline

Definition at line 185 of file puppi.h.

References HltBtagPostValidation_cff::c.

◆ clear() [11/13]

void l1ct::clear ( TkObj c)
inline

Definition at line 273 of file layer1_objs.h.

References HltBtagPostValidation_cff::c.

◆ clear() [12/13]

void l1ct::clear ( MuObj c)
inline

Definition at line 356 of file layer1_objs.h.

References HltBtagPostValidation_cff::c.

◆ clear() [13/13]

void l1ct::clear ( PVObj c)
inline

Definition at line 381 of file layer1_objs.h.

References HltBtagPostValidation_cff::c.

◆ CTtoGT_eta()

l1gt::eta_t l1ct::CTtoGT_eta ( glbeta_t  x)
inline

Definition at line 371 of file gt_datatypes.h.

References l1ct::Scales::ETAPHI_CTtoGT_SCALE, and x.

Referenced by l1ct::EGIsoObj::toGT(), l1ct::Jet::toGT(), l1ct::Tau::toGT(), and l1ct::EGIsoEleObj::toGT().

371  {
372  // rescale the eta into the GT coordinates
374  }
const etaphi_sf_t ETAPHI_CTtoGT_SCALE
Definition: gt_datatypes.h:362
float x

◆ CTtoGT_phi()

l1gt::phi_t l1ct::CTtoGT_phi ( glbphi_t  x)
inline

Definition at line 376 of file gt_datatypes.h.

References l1ct::Scales::ETAPHI_CTtoGT_SCALE, and x.

Referenced by l1ct::Sum::toGT(), l1ct::EGIsoObj::toGT(), l1ct::Jet::toGT(), l1ct::Tau::toGT(), and l1ct::EGIsoEleObj::toGT().

376  {
377  // rescale the phi into the GT coordinates
379  }
const etaphi_sf_t ETAPHI_CTtoGT_SCALE
Definition: gt_datatypes.h:362
float x

◆ CTtoGT_pt()

l1gt::pt_t l1ct::CTtoGT_pt ( pt_t  x)
inline

Definition at line 365 of file gt_datatypes.h.

References x.

Referenced by l1ct::Sum::toGT(), l1ct::EGIsoObj::toGT(), l1ct::Jet::toGT(), l1ct::Tau::toGT(), and l1ct::EGIsoEleObj::toGT().

365  {
366  // the CT & GT pT are both ap_fixed with different power-of-2 LSBs
367  // -> conversion is just a cast
368  return (l1gt::pt_t)x;
369  }
ap_ufixed< 16, 11, AP_RND_CONV, AP_SAT > pt_t
Definition: gt_datatypes.h:24
float x

◆ dr2_int()

int l1ct::dr2_int ( eta_t  eta1,
phi_t  phi1,
eta_t  eta2,
phi_t  phi2 
)
inline

Definition at line 218 of file datatypes.h.

References HLT_2024v12_cff::eta1, and HLT_2024v12_cff::eta2.

Referenced by l1ct::PFAlgoEmulatorBase::best_match_with_pt_ref(), l1ct::L1EGPuppiIsoAlgo::calcIso(), and l1ct::PFTkEGAlgoEmulator::deltaR2().

218  {
219  ap_int<eta_t::width + 1> deta = (eta1 - eta2);
220  ap_int<phi_t::width + 1> dphi = (phi1 - phi2);
221  return deta * deta + dphi * dphi;
222  }

◆ idx_from_real_val()

template<class data_T , int N>
unsigned l1ct::idx_from_real_val ( data_T  x)
inline

Definition at line 21 of file inversion.h.

References ceillog2(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), N, and x.

21  {
22  // Slice the top N bits to get an index into the table
23  static constexpr int NB = ceillog2(N); // number of address bits for table
24  // Slice the top-1 NB bits of the value
25  // the MSB of '1' is implicit, so only slice below that
26  ap_uint<NB> y = x(x.width - 2, x.width - NB - 1);
27  return (unsigned)y(NB - 1, 0);
28  }
constexpr int ceillog2(int x)
Definition: inversion.h:6
#define N
Definition: blowfish.cc:9
float x

◆ init_invert_table()

template<class data_T , class table_T , int N>
void l1ct::init_invert_table ( table_T  table_out[N])

Definition at line 31 of file inversion.h.

References mps_fire::i, N, and x.

31  {
32  // The template data_T is the data type used to address the table
33  for (unsigned i = 0; i < N; i++) {
34  float x = real_val_from_idx<data_T, N>(i);
35  table_T inv_x = 1 / x;
36  table_out[i] = inv_x;
37  }
38  }
#define N
Definition: blowfish.cc:9
float x

◆ invert_with_shift()

template<class in_t , class table_t , int N>
table_t l1ct::invert_with_shift ( in_t  in)

Definition at line 41 of file inversion.h.

References b, heavyIonCSV_trainingSettings::idx, recoMuon::in, N, and MillePedeFileConverter_cfg::out.

41  {
42  table_t inv_table[N];
43  init_invert_table<in_t, table_t, N>(inv_table);
44 
45  // find the first '1' in the denominator
46  int msb = 0;
47  for (int b = 0; b < in.width; b++) {
48  // #pragma HLS unroll
49  if (in[b])
50  msb = b;
51  }
52  // shift up the denominator such that the left-most bit (msb) is '1'
53  in_t in_shifted = in << (in.width - msb - 1);
54  // lookup the inverse of the shifted input
55  int idx = idx_from_real_val<in_t, N>(in_shifted);
56  table_t inv_in = inv_table[idx];
57  // shift the output back
58  table_t out = inv_in << (in.width - msb - 1);
59  return out;
60  }
#define N
Definition: blowfish.cc:9
double b
Definition: hdecay.h:120

◆ readAP()

template<typename T >
bool l1ct::readAP ( std::fstream &  from,
T to 
)

Definition at line 34 of file emulator_io.h.

References mps_fire::i, SiStripPI::min, dqmiodumpmetadata::n, readVar(), and ApeEstimator_cff::width.

Referenced by readMany(), and readObj().

34  {
35  uint32_t w32;
36  for (unsigned int i = 0, n = T::width; i < n; i += 32) {
37  if (!readVar(from, w32))
38  return false;
39  ap_uint<32> word = w32;
40  to(std::min(i + 31, n - 1), i) = word(std::min(31u, n - i - 1), 0);
41  }
42  return true;
43  }
bool readVar(std::fstream &from, T &to)
Definition: emulator_io.h:17
uint64_t word

◆ readMany() [1/2]

template<typename T >
bool l1ct::readMany ( std::fstream &  from,
std::vector< T > &  objs 
)

Definition at line 80 of file emulator_io.h.

References mps_fire::i, contentValuesFiles::number, HLTEGTnPMonitor_cfi::objs, fileinputsource_cfi::read, and readVar().

80  {
81  uint32_t number = 0;
82  readVar(from, number);
83  objs.resize(number);
84  for (uint32_t i = 0; i < number; ++i)
85  objs[i].read(from);
86  return from.good();
87  }
bool readVar(std::fstream &from, T &to)
Definition: emulator_io.h:17

◆ readMany() [2/2]

template<int NB>
bool l1ct::readMany ( std::fstream &  from,
std::vector< ap_uint< NB >> &  objs 
)

Definition at line 90 of file emulator_io.h.

References mps_fire::i, contentValuesFiles::number, HLTEGTnPMonitor_cfi::objs, readAP(), and readVar().

90  {
91  uint32_t number = 0;
92  readVar(from, number);
93  objs.resize(number);
94  for (uint32_t i = 0; i < number; ++i)
95  readAP(from, objs[i]);
96  return from.good();
97  }
bool readVar(std::fstream &from, T &to)
Definition: emulator_io.h:17
bool readAP(std::fstream &from, T &to)
Definition: emulator_io.h:34

◆ readObj()

template<typename T >
bool l1ct::readObj ( std::fstream &  from,
T obj 
)

Definition at line 51 of file emulator_io.h.

References getGTfromDQMFile::obj, readAP(), and beamSpotPI::unpack().

51  {
52  ap_uint<T::BITWIDTH> packed;
53  if (!readAP(from, packed))
54  return false;
55  obj = T::unpack(packed);
56  return true;
57  }
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
bool readAP(std::fstream &from, T &to)
Definition: emulator_io.h:34

◆ readVar()

template<typename T >
bool l1ct::readVar ( std::fstream &  from,
T to 
)
inline

Definition at line 17 of file emulator_io.h.

Referenced by readAP(), and readMany().

17  {
18  from.read(reinterpret_cast<char *>(&to), sizeof(T));
19  return from.good();
20  }
long double T

◆ real_val_from_idx()

template<class data_T , int N>
float l1ct::real_val_from_idx ( unsigned  i)
inline

Definition at line 9 of file inversion.h.

References ceillog2(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), mps_fire::i, N, and x.

9  {
10  // Treat the index as the top N bits
11  static constexpr int NB = ceillog2(N); // number of address bits for table
12  data_T x(0);
13  // The MSB of 1 is implicit in the table
14  x[x.width - 1] = 1;
15  // So we can use the next NB bits for real data
16  x(x.width - 2, x.width - NB - 1) = i;
17  return (float)x;
18  }
constexpr int ceillog2(int x)
Definition: inversion.h:6
#define N
Definition: blowfish.cc:9
float x

◆ toFirmware()

template<typename T1 , typename T2 >
void l1ct::toFirmware ( const std::vector< T1 > &  in,
unsigned int  NMAX,
T2  out[] 
)

Definition at line 374 of file layer1_emulator.h.

References clear(), mps_fire::i, recoMuon::in, dqmiodumpmetadata::n, and MillePedeFileConverter_cfg::out.

374  {
375  unsigned int n = std::min<unsigned>(in.size(), NMAX);
376  for (unsigned int i = 0; i < n; ++i)
377  out[i] = in[i];
378  for (unsigned int i = n; i < NMAX; ++i)
379  out[i].clear();
380  }
void clear(EGIsoObj &c)
Definition: egamma.h:82

◆ writeAP()

template<typename T >
bool l1ct::writeAP ( const T src,
std::fstream &  to 
)

Definition at line 23 of file emulator_io.h.

References mps_fire::i, SiStripPI::min, dqmiodumpmetadata::n, TrackRefitter_38T_cff::src, ApeEstimator_cff::width, and writeVar().

Referenced by writeMany(), and writeObj().

23  {
24  for (unsigned int i = 0, n = T::width; i < n; i += 32) {
25  ap_uint<32> word = src(std::min(i + 31, n - 1), i);
26  uint32_t w32 = word.to_uint();
27  if (!writeVar(w32, to))
28  return false;
29  }
30  return true;
31  }
uint64_t word
bool writeVar(const T &src, std::fstream &to)
Definition: emulator_io.h:11

◆ writeMany() [1/2]

template<typename T >
bool l1ct::writeMany ( const std::vector< T > &  objs,
std::fstream &  to 
)

Definition at line 60 of file emulator_io.h.

References mps_fire::i, contentValuesFiles::number, HLTEGTnPMonitor_cfi::objs, and writeVar().

60  {
61  uint32_t number = objs.size();
62  writeVar(number, to);
63  for (uint32_t i = 0; i < number; ++i) {
64  objs[i].write(to);
65  }
66  return to.good();
67  }
bool writeVar(const T &src, std::fstream &to)
Definition: emulator_io.h:11

◆ writeMany() [2/2]

template<int NB>
bool l1ct::writeMany ( const std::vector< ap_uint< NB >> &  objs,
std::fstream &  to 
)

Definition at line 70 of file emulator_io.h.

References mps_fire::i, contentValuesFiles::number, HLTEGTnPMonitor_cfi::objs, writeAP(), and writeVar().

70  {
71  uint32_t number = objs.size();
72  writeVar(number, to);
73  for (uint32_t i = 0; i < number; ++i) {
74  writeAP(objs[i], to);
75  }
76  return to.good();
77  }
bool writeAP(const T &src, std::fstream &to)
Definition: emulator_io.h:23
bool writeVar(const T &src, std::fstream &to)
Definition: emulator_io.h:11

◆ writeObj()

template<typename T >
bool l1ct::writeObj ( const T obj,
std::fstream &  to 
)

Definition at line 46 of file emulator_io.h.

References getGTfromDQMFile::obj, and writeAP().

46  {
47  return writeAP(obj.pack(), to);
48  }
bool writeAP(const T &src, std::fstream &to)
Definition: emulator_io.h:23

◆ writeVar()

template<typename T >
bool l1ct::writeVar ( const T src,
std::fstream &  to 
)
inline

Definition at line 11 of file emulator_io.h.

References TrackRefitter_38T_cff::src.

Referenced by writeAP(), and writeMany().

11  {
12  to.write(reinterpret_cast<const char *>(&src), sizeof(T));
13  return to.good();
14  }
long double T