CMS 3D CMS Logo

Functions | Variables
l1ct::Scales Namespace Reference

Functions

float floatDxy (dxy_t dxy)
 
float floatEta (eta_t eta)
 
float floatEta (tkdeta_t eta)
 
float floatEta (glbeta_t eta)
 
float floatIso (iso_t iso)
 
float floatPhi (phi_t phi)
 
float floatPhi (tkdphi_t phi)
 
float floatPhi (glbphi_t phi)
 
float floatPt (pt_t pt)
 
float floatPt (dpt_t pt)
 
float floatPt (pt2_t pt2)
 
float floatPuppiW (puppiWgt_t puppiw)
 
float floatZ0 (z0_t z0)
 
int intPt (pt_t pt)
 
int intPt (dpt_t pt)
 
dpt_t makeDPt (int dpt)
 
dpt_t makeDPtFromFloat (float dpt)
 
int makeDR2FromFloatDR (float dr)
 
eta_t makeEta (float eta)
 
glbeta_t makeGlbEta (float eta)
 
glbeta_t makeGlbEtaRoundEven (float eta)
 
glbphi_t makeGlbPhi (float phi)
 
iso_t makeIso (float iso)
 
phi_t makePhi (float phi)
 
pt_t makePt (int pt)
 
pt_t makePtFromFloat (float pt)
 
z0_t makeZ0 (float z0)
 
float maxAbsEta ()
 
float maxAbsGlbEta ()
 
float maxAbsGlbPhi ()
 
float maxAbsPhi ()
 
ap_uint< pt_t::width > ptToInt (pt_t pt)
 
ap_int< dpt_t::width > ptToInt (dpt_t pt)
 

Variables

constexpr float DXY_LSB = 0.05
 
const etaphi_sf_t ETAPHI_CTtoGT_SCALE = (Scales::ETAPHI_LSB / l1gt::Scales::ETAPHI_LSB)
 
constexpr float ETAPHI_LSB = M_PI / INTPHI_PI
 
constexpr int INTPHI_PI = 720
 
constexpr int INTPHI_TWOPI = 2 * INTPHI_PI
 
constexpr float INTPT_LSB = 0.25
 
constexpr float PUPPIW_LSB = 1.0 / 256
 
constexpr float Z0_LSB = 0.05
 

Function Documentation

◆ floatDxy()

float l1ct::Scales::floatDxy ( dxy_t  dxy)
inline

Definition at line 164 of file datatypes.h.

References PVValHelper::dxy, and DXY_LSB.

Referenced by l1ct::PFChargedObj::floatDxy(), l1ct::PuppiObj::floatDxy(), l1ct::TkObj::floatDxy(), and l1ct::MuObj::floatDxy().

164 { return dxy.to_float() * DXY_LSB; }
constexpr float DXY_LSB
Definition: datatypes.h:150

◆ floatEta() [1/3]

float l1ct::Scales::floatEta ( eta_t  eta)
inline

◆ floatEta() [2/3]

float l1ct::Scales::floatEta ( tkdeta_t  eta)
inline

Definition at line 159 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

159 { return eta.to_float() * ETAPHI_LSB; }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ floatEta() [3/3]

float l1ct::Scales::floatEta ( glbeta_t  eta)
inline

Definition at line 161 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

161 { return eta.to_float() * ETAPHI_LSB; }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ floatIso()

float l1ct::Scales::floatIso ( iso_t  iso)
inline

◆ floatPhi() [1/3]

float l1ct::Scales::floatPhi ( phi_t  phi)
inline

◆ floatPhi() [2/3]

float l1ct::Scales::floatPhi ( tkdphi_t  phi)
inline

Definition at line 160 of file datatypes.h.

References ETAPHI_LSB.

160 { return phi.to_float() * ETAPHI_LSB; }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ floatPhi() [3/3]

float l1ct::Scales::floatPhi ( glbphi_t  phi)
inline

Definition at line 162 of file datatypes.h.

References ETAPHI_LSB.

162 { return phi.to_float() * ETAPHI_LSB; }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ floatPt() [1/3]

float l1ct::Scales::floatPt ( pt_t  pt)
inline

◆ floatPt() [2/3]

float l1ct::Scales::floatPt ( dpt_t  pt)
inline

Definition at line 153 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt.

153 { return pt.to_float(); }

◆ floatPt() [3/3]

float l1ct::Scales::floatPt ( pt2_t  pt2)
inline

Definition at line 154 of file datatypes.h.

References HLT_2023v12_cff::pt2.

154 { return pt2.to_float(); }

◆ floatPuppiW()

float l1ct::Scales::floatPuppiW ( puppiWgt_t  puppiw)
inline

Definition at line 165 of file datatypes.h.

References PUPPIW_LSB.

Referenced by l1ct::PuppiObj::floatPuppiW().

165 { return puppiw.to_float() * PUPPIW_LSB; }
constexpr float PUPPIW_LSB
Definition: datatypes.h:151

◆ floatZ0()

float l1ct::Scales::floatZ0 ( z0_t  z0)
inline

◆ intPt() [1/2]

int l1ct::Scales::intPt ( pt_t  pt)
inline

◆ intPt() [2/2]

int l1ct::Scales::intPt ( dpt_t  pt)
inline

Definition at line 156 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt.

156 { return (ap_fixed<18, 16>(pt) << 2).to_int(); }

◆ makeDPt()

dpt_t l1ct::Scales::makeDPt ( int  dpt)
inline

Definition at line 169 of file datatypes.h.

169 { return ap_fixed<18, 16>(dpt) >> 2; }

◆ makeDPtFromFloat()

dpt_t l1ct::Scales::makeDPtFromFloat ( float  dpt)
inline

Definition at line 171 of file datatypes.h.

171 { return dpt_t(dpt); }
ap_fixed< 16, 14, AP_TRN, AP_SAT > dpt_t
Definition: datatypes.h:23

◆ makeDR2FromFloatDR()

int l1ct::Scales::makeDR2FromFloatDR ( float  dr)
inline

Definition at line 196 of file datatypes.h.

References reco::ceil(), and ETAPHI_LSB.

196 { return ceil(dr * dr / ETAPHI_LSB / ETAPHI_LSB); }
constexpr int32_t ceil(float num)
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ makeEta()

eta_t l1ct::Scales::makeEta ( float  eta)
inline

Definition at line 189 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

Referenced by L1TCorrelatorLayer1Producer::addDecodedTrack().

189 { return round(eta / ETAPHI_LSB); }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ makeGlbEta()

glbeta_t l1ct::Scales::makeGlbEta ( float  eta)
inline

◆ makeGlbEtaRoundEven()

glbeta_t l1ct::Scales::makeGlbEtaRoundEven ( float  eta)
inline

Definition at line 191 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

191 { return 2 * std::round(eta / ETAPHI_LSB / 2); }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ makeGlbPhi()

glbphi_t l1ct::Scales::makeGlbPhi ( float  phi)
inline

Definition at line 193 of file datatypes.h.

References ETAPHI_LSB.

Referenced by L1TCorrelatorLayer1Producer::addDecodedMuon().

193 { return round(phi / ETAPHI_LSB); }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ makeIso()

iso_t l1ct::Scales::makeIso ( float  iso)
inline

Definition at line 194 of file datatypes.h.

Referenced by L1TCtL2EgProducer::convertToEmu().

194 { return iso_t(0.25 * round(iso * 4)); }
ap_ufixed< 11, 9, AP_TRN, AP_SAT > iso_t
Definition: datatypes.h:43

◆ makePhi()

phi_t l1ct::Scales::makePhi ( float  phi)
inline

◆ makePt()

pt_t l1ct::Scales::makePt ( int  pt)
inline

Definition at line 168 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt.

168 { return ap_ufixed<16, 14>(pt) >> 2; }

◆ makePtFromFloat()

pt_t l1ct::Scales::makePtFromFloat ( float  pt)
inline

◆ makeZ0()

z0_t l1ct::Scales::makeZ0 ( float  z0)
inline

◆ maxAbsEta()

float l1ct::Scales::maxAbsEta ( )
inline

Definition at line 198 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

Referenced by L1TCorrelatorLayer1Producer::initSectorsAndRegions().

198 { return ((1 << (eta_t::width - 1)) - 1) * ETAPHI_LSB; }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ maxAbsGlbEta()

float l1ct::Scales::maxAbsGlbEta ( )
inline

Definition at line 200 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

200 { return ((1 << (glbeta_t::width - 1)) - 1) * ETAPHI_LSB; }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ maxAbsGlbPhi()

float l1ct::Scales::maxAbsGlbPhi ( )
inline

Definition at line 201 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

201 { return ((1 << (glbphi_t::width - 1)) - 1) * ETAPHI_LSB; }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ maxAbsPhi()

float l1ct::Scales::maxAbsPhi ( )
inline

Definition at line 199 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

Referenced by L1TCorrelatorLayer1Producer::initSectorsAndRegions().

199 { return ((1 << (phi_t::width - 1)) - 1) * ETAPHI_LSB; }
constexpr float ETAPHI_LSB
Definition: datatypes.h:148

◆ ptToInt() [1/2]

ap_uint<pt_t::width> l1ct::Scales::ptToInt ( pt_t  pt)
inline

Definition at line 174 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt, runTheMatrix::ret, and ApeEstimator_cff::width.

174  {
175  // note: this can be synthethized, e.g. when pT is used as intex in a LUT
176  ap_uint<pt_t::width> ret = 0;
177  ret(pt_t::width - 1, 0) = pt(pt_t::width - 1, 0);
178  return ret;
179  }
ret
prodAgent to be discontinued

◆ ptToInt() [2/2]

ap_int<dpt_t::width> l1ct::Scales::ptToInt ( dpt_t  pt)
inline

Definition at line 181 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt, runTheMatrix::ret, and ApeEstimator_cff::width.

181  {
182  // note: this can be synthethized, e.g. when pT is used as intex in a LUT
183  ap_uint<dpt_t::width> ret = 0;
184  ret(dpt_t::width - 1, 0) = pt(dpt_t::width - 1, 0);
185  return ret;
186  }
ret
prodAgent to be discontinued

Variable Documentation

◆ DXY_LSB

constexpr float l1ct::Scales::DXY_LSB = 0.05

Definition at line 150 of file datatypes.h.

Referenced by floatDxy().

◆ ETAPHI_CTtoGT_SCALE

const etaphi_sf_t l1ct::Scales::ETAPHI_CTtoGT_SCALE = (Scales::ETAPHI_LSB / l1gt::Scales::ETAPHI_LSB)

Definition at line 255 of file gt_datatypes.h.

Referenced by l1ct::CTtoGT_eta(), and l1ct::CTtoGT_phi().

◆ ETAPHI_LSB

constexpr float l1ct::Scales::ETAPHI_LSB = M_PI / INTPHI_PI

◆ INTPHI_PI

constexpr int l1ct::Scales::INTPHI_PI = 720

◆ INTPHI_TWOPI

constexpr int l1ct::Scales::INTPHI_TWOPI = 2 * INTPHI_PI

◆ INTPT_LSB

constexpr float l1ct::Scales::INTPT_LSB = 0.25

Definition at line 147 of file datatypes.h.

Referenced by l1ct::PFAlgoEmulatorBase::best_match_with_pt_ref().

◆ PUPPIW_LSB

constexpr float l1ct::Scales::PUPPIW_LSB = 1.0 / 256

Definition at line 151 of file datatypes.h.

Referenced by floatPuppiW().

◆ Z0_LSB

constexpr float l1ct::Scales::Z0_LSB = 0.05

Definition at line 149 of file datatypes.h.

Referenced by floatZ0(), and makeZ0().