CMS 3D CMS Logo

Classes | Typedefs | Functions | Variables
l1tmetemu Namespace Reference

Classes

struct  EtMiss
 

Typedefs

typedef ap_ufixed< kAtanLUTSize, kAtanLUTMagSize, AP_RND_CONV, AP_SAT > atan_lut_fixed_t
 
typedef ap_ufixed< kCosLUTSize, kCosLUTMagSize, AP_RND_CONV, AP_SAT > cos_lut_fixed_t
 
typedef ap_fixed< kMETSize+kEtExtra, kMETMagSize+kEtExtra, AP_RND_CONV, AP_SAT > Et_t
 
typedef ap_int< TTTrack_TrackWord::TrackBitWidths::kPhiSize+kGlobalPhiExtraglobal_phi_t
 
typedef ap_fixed< kMETPhiSize+kEtExtra, 4, AP_RND_CONV, AP_SAT > metphi_fixed_t
 
typedef ap_ufixed< kMETSize, kMETMagSize, AP_RND_CONV, AP_SAT > METWord_t
 
typedef ap_int< kMETPhiSizeMETWordphi_t
 
typedef ap_ufixed< kMETPhiSize+kEtExtra+7, kMETPhiSize - 2, AP_RND_CONV, AP_SAT > pi_bins_fixed_t
 

Functions

std::vector< cos_lut_fixed_tgenerateCosLUT (unsigned int size)
 
std::vector< global_phi_tgeneratePhiSliceLUT (unsigned int N)
 
global_phi_t localToGlobalPhi (TTTrack_TrackWord::phi_t local_phi, global_phi_t sector_shift)
 
template<typename T >
void printLUT (std::vector< T > lut, std::string module="", std::string name="")
 

Variables

const unsigned int kAtanLUTMagSize {2}
 
const unsigned int kAtanLUTSize {64}
 
const double kBinsInPi = 1.0 / kStepMETwordPhi
 
const unsigned int kCosLUTMagSize {1}
 
const unsigned int kCosLUTSize {10}
 
const unsigned int kEtExtra {4}
 
const unsigned int kGlobalPhiExtra {4}
 
const unsigned int kInternalPtWidth {14}
 
const double kMaxCosLUTPhi {M_PI / 2}
 
const double kMaxMET = 1 << kMETMagSize
 
const double kMaxMETPhi {2 * M_PI}
 
const unsigned int kMETMagSize {11}
 
const unsigned int kMETPhiSize {13}
 
const unsigned int kMETSize {16}
 
const unsigned int kNQuadrants {4}
 
const unsigned int kNSector {9}
 
const unsigned int kPtMagSize {9}
 
const double kStepMETwordEt = kMaxMET / (1 << kMETSize)
 
const double kStepMETwordPhi = kMaxMETPhi / (1 << kMETPhiSize)
 

Typedef Documentation

◆ atan_lut_fixed_t

typedef ap_ufixed<kAtanLUTSize, kAtanLUTMagSize, AP_RND_CONV, AP_SAT> l1tmetemu::atan_lut_fixed_t

Definition at line 38 of file L1TkEtMissEmuAlgo.h.

◆ cos_lut_fixed_t

typedef ap_ufixed<kCosLUTSize, kCosLUTMagSize, AP_RND_CONV, AP_SAT> l1tmetemu::cos_lut_fixed_t

Definition at line 37 of file L1TkEtMissEmuAlgo.h.

◆ Et_t

typedef ap_fixed<kMETSize + kEtExtra, kMETMagSize + kEtExtra, AP_RND_CONV, AP_SAT> l1tmetemu::Et_t

Definition at line 39 of file L1TkEtMissEmuAlgo.h.

◆ global_phi_t

typedef ap_int<TTTrack_TrackWord::TrackBitWidths::kPhiSize + kGlobalPhiExtra> l1tmetemu::global_phi_t

Definition at line 36 of file L1TkEtMissEmuAlgo.h.

◆ metphi_fixed_t

typedef ap_fixed<kMETPhiSize + kEtExtra, 4, AP_RND_CONV, AP_SAT> l1tmetemu::metphi_fixed_t

Definition at line 40 of file L1TkEtMissEmuAlgo.h.

◆ METWord_t

typedef ap_ufixed<kMETSize, kMETMagSize, AP_RND_CONV, AP_SAT> l1tmetemu::METWord_t

Definition at line 34 of file L1TkEtMissEmuAlgo.h.

◆ METWordphi_t

Definition at line 35 of file L1TkEtMissEmuAlgo.h.

◆ pi_bins_fixed_t

typedef ap_ufixed<kMETPhiSize + kEtExtra + 7, kMETPhiSize - 2, AP_RND_CONV, AP_SAT> l1tmetemu::pi_bins_fixed_t

Definition at line 41 of file L1TkEtMissEmuAlgo.h.

Function Documentation

◆ generateCosLUT()

std::vector< cos_lut_fixed_t > l1tmetemu::generateCosLUT ( unsigned int  size)

Definition at line 6 of file L1TkEtMissEmuAlgo.cc.

References funct::cos(), findQualityFiles::size, and TTTrack_TrackWord::stepPhi0.

Referenced by L1TrackerEtMissEmulatorProducer::L1TrackerEtMissEmulatorProducer().

6  { // Fill cosine LUT with integer values
7  float phi = 0;
8  std::vector<cos_lut_fixed_t> cosLUT;
9  for (unsigned int LUT_idx = 0; LUT_idx < size; LUT_idx++) {
10  cosLUT.push_back((cos_lut_fixed_t)(cos(phi)));
12  //std::cout << LUT_idx << "," << (cos_lut_fixed_t)(cos(phi)) << std::endl;
13  }
14  cosLUT.push_back((cos_lut_fixed_t)(0)); //Prevent overflow in last bin
15  return cosLUT;
16  }
size
Write out results.
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
ap_ufixed< kCosLUTSize, kCosLUTMagSize, AP_RND_CONV, AP_SAT > cos_lut_fixed_t
static constexpr double stepPhi0

◆ generatePhiSliceLUT()

std::vector< global_phi_t > l1tmetemu::generatePhiSliceLUT ( unsigned int  N)

Definition at line 40 of file L1TkEtMissEmuAlgo.cc.

References M_PI, N, submitPVResolutionJobs::q, and TTTrack_TrackWord::stepPhi0.

Referenced by L1TrackerEtMissEmulatorProducer::L1TrackerEtMissEmulatorProducer().

40  {
41  float sliceCentre = 0.0;
42  std::vector<global_phi_t> phiLUT;
43  for (unsigned int q = 0; q <= N; q++) {
44  phiLUT.push_back((global_phi_t)(sliceCentre / TTTrack_TrackWord::stepPhi0));
45  sliceCentre += 2 * M_PI / N;
46  }
47  return phiLUT;
48  }
ap_int< TTTrack_TrackWord::TrackBitWidths::kPhiSize+kGlobalPhiExtra > global_phi_t
#define M_PI
#define N
Definition: blowfish.cc:9
static constexpr double stepPhi0

◆ localToGlobalPhi()

global_phi_t l1tmetemu::localToGlobalPhi ( TTTrack_TrackWord::phi_t  local_phi,
global_phi_t  sector_shift 
)

Definition at line 18 of file L1TkEtMissEmuAlgo.cc.

References M_PI, MonitorTrackSTAMuons_cfi::PhiMax, MonitorTrackSTAMuons_cfi::PhiMin, and TTTrack_TrackWord::stepPhi0.

Referenced by L1TrackerEtMissEmulatorProducer::produce().

18  {
19  global_phi_t PhiMin = 0;
21 
22  // The initial word comes in as a uint; the correct bits, but not automatically using 2s compliment format.
23  global_phi_t globalPhi = local_phi;
24 
25  // Once the word is in a larger, signed container, shift it down so that the negative numbers are automatically represented in 2s compliment.
26  if (local_phi >= (1 << (TTTrack_TrackWord::TrackBitWidths::kPhiSize - 1)))
27  globalPhi -= (1 << TTTrack_TrackWord::TrackBitWidths::kPhiSize);
28 
29  globalPhi += sector_shift;
30 
31  if (globalPhi < PhiMin) {
32  globalPhi = globalPhi + PhiMax;
33  } else if (globalPhi > PhiMax) {
34  globalPhi = globalPhi - PhiMax;
35  }
36 
37  return globalPhi;
38  }
ap_int< TTTrack_TrackWord::TrackBitWidths::kPhiSize+kGlobalPhiExtra > global_phi_t
#define M_PI
static constexpr double stepPhi0

◆ printLUT()

template<typename T >
void l1tmetemu::printLUT ( std::vector< T lut,
std::string  module = "",
std::string  name = "" 
)

Definition at line 71 of file L1TkEtMissEmuAlgo.h.

References mps_fire::i, dqm-mbProfile::log, callgraph::module, and Skims_PA_cff::name.

Referenced by L1TMuonGlobalParamsViewer::analyze(), and L1TrackerEtMissEmulatorProducer::L1TrackerEtMissEmulatorProducer().

71  {
73  log << "The " << name << "[" << lut.size() << "] values are ... \n" << std::setprecision(30);
74  for (unsigned int i = 0; i < lut.size(); i++) {
75  log << "\t" << i << "\t" << lut[i] << "\n";
76  }
77  }

Variable Documentation

◆ kAtanLUTMagSize

const unsigned int l1tmetemu::kAtanLUTMagSize {2}

Definition at line 32 of file L1TkEtMissEmuAlgo.h.

◆ kAtanLUTSize

const unsigned int l1tmetemu::kAtanLUTSize {64}

Definition at line 31 of file L1TkEtMissEmuAlgo.h.

◆ kBinsInPi

const double l1tmetemu::kBinsInPi = 1.0 / kStepMETwordPhi

Definition at line 49 of file L1TkEtMissEmuAlgo.h.

Referenced by Cordic::toPolar().

◆ kCosLUTMagSize

const unsigned int l1tmetemu::kCosLUTMagSize {1}

Definition at line 30 of file L1TkEtMissEmuAlgo.h.

◆ kCosLUTSize

const unsigned int l1tmetemu::kCosLUTSize {10}

Definition at line 29 of file L1TkEtMissEmuAlgo.h.

◆ kEtExtra

const unsigned int l1tmetemu::kEtExtra {4}

Definition at line 27 of file L1TkEtMissEmuAlgo.h.

◆ kGlobalPhiExtra

const unsigned int l1tmetemu::kGlobalPhiExtra {4}

Definition at line 28 of file L1TkEtMissEmuAlgo.h.

◆ kInternalPtWidth

const unsigned int l1tmetemu::kInternalPtWidth {14}

Definition at line 22 of file L1TkEtMissEmuAlgo.h.

◆ kMaxCosLUTPhi

const double l1tmetemu::kMaxCosLUTPhi {M_PI / 2}

◆ kMaxMET

const double l1tmetemu::kMaxMET = 1 << kMETMagSize

Definition at line 44 of file L1TkEtMissEmuAlgo.h.

◆ kMaxMETPhi

const double l1tmetemu::kMaxMETPhi {2 * M_PI}

Definition at line 45 of file L1TkEtMissEmuAlgo.h.

◆ kMETMagSize

const unsigned int l1tmetemu::kMETMagSize {11}

Definition at line 25 of file L1TkEtMissEmuAlgo.h.

◆ kMETPhiSize

const unsigned int l1tmetemu::kMETPhiSize {13}

◆ kMETSize

const unsigned int l1tmetemu::kMETSize {16}

◆ kNQuadrants

const unsigned int l1tmetemu::kNQuadrants {4}

◆ kNSector

const unsigned int l1tmetemu::kNSector {9}

◆ kPtMagSize

const unsigned int l1tmetemu::kPtMagSize {9}

◆ kStepMETwordEt

const double l1tmetemu::kStepMETwordEt = kMaxMET / (1 << kMETSize)

Definition at line 47 of file L1TkEtMissEmuAlgo.h.

Referenced by L1TrackerEtMissEmulatorProducer::produce().

◆ kStepMETwordPhi

const double l1tmetemu::kStepMETwordPhi = kMaxMETPhi / (1 << kMETPhiSize)