CMS 3D CMS Logo

Functions | Variables
l1ct::Scales Namespace Reference

Functions

float floatBtagScore (b_tag_score_t b_tag_score)
 
float floatDxy (dxy_t dxy)
 
float floatEta (eta_t eta)
 
float floatEta (tkdeta_t eta)
 
float floatEta (glbeta_t eta)
 
float floatHoe (hoe_t hoe)
 
float floatIDScore (id_score_t score)
 
float floatIso (iso_t iso)
 
float floatMeanZ (meanz_t meanz)
 
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 floatSrrTot (srrtot_t srrtot)
 
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)
 
hoe_t makeHoe (float var)
 
iso_t makeIso (float iso)
 
meanz_t makeMeanZ (float var)
 
phi_t makePhi (float phi)
 
pt_t makePt (int pt)
 
pt_t makePtFromFloat (float pt)
 
srrtot_t makeSrrTot (float var)
 
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 float HOE_LSB = 0.031250000
 
constexpr int INTPHI_PI = 720
 
constexpr int INTPHI_TWOPI = 2 * INTPHI_PI
 
constexpr float INTPT_LSB = 0.25
 
constexpr float MEANZ_OFFSET = 320.
 
constexpr float PUPPIW_LSB = 1.0 / 256
 
constexpr float SRRTOT_LSB = 0.0019531250
 
constexpr unsigned int SRRTOT_SCALE = 64
 
constexpr float Z0_LSB = 0.05
 

Function Documentation

◆ floatBtagScore()

float l1ct::Scales::floatBtagScore ( b_tag_score_t  b_tag_score)
inline

Definition at line 179 of file datatypes.h.

Referenced by l1ct::Jet::floatBtagScore().

179 { return b_tag_score.to_float(); }

◆ floatDxy()

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

Definition at line 172 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().

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

◆ 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 167 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

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

◆ floatEta() [3/3]

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

Definition at line 169 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

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

◆ floatHoe()

float l1ct::Scales::floatHoe ( hoe_t  hoe)
inline

Definition at line 177 of file datatypes.h.

References electrons_cff::hoe.

Referenced by l1ct::HadCaloObj::floatHoe(), and l1ct::EmCaloObj::floatHoe().

177 { return hoe.to_float(); };

◆ floatIDScore()

float l1ct::Scales::floatIDScore ( id_score_t  score)
inline

◆ floatIso()

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

◆ floatMeanZ()

float l1ct::Scales::floatMeanZ ( meanz_t  meanz)
inline

Definition at line 176 of file datatypes.h.

References MEANZ_OFFSET.

Referenced by l1ct::HadCaloObj::floatMeanZ(), and l1ct::EmCaloObj::floatMeanZ().

176 { return meanz + MEANZ_OFFSET; };
constexpr float MEANZ_OFFSET
Definition: datatypes.h:149

◆ 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 168 of file datatypes.h.

References ETAPHI_LSB.

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

◆ floatPhi() [3/3]

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

Definition at line 170 of file datatypes.h.

References ETAPHI_LSB.

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

◆ 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 155 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt.

155 { return pt.to_float(); }

◆ floatPt() [3/3]

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

Definition at line 156 of file datatypes.h.

References HLT_2024v14_cff::pt2.

156 { return pt2.to_float(); }

◆ floatPuppiW()

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

Definition at line 173 of file datatypes.h.

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

173 { return puppiw.to_float(); }

◆ floatSrrTot()

float l1ct::Scales::floatSrrTot ( srrtot_t  srrtot)
inline

Definition at line 175 of file datatypes.h.

References SRRTOT_SCALE.

Referenced by l1ct::HadCaloObj::floatSrrTot(), and l1ct::EmCaloObj::floatSrrTot().

175 { return srrtot.to_float() / SRRTOT_SCALE; };
constexpr unsigned int SRRTOT_SCALE
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 161 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt, and jetsAK4_CHS_cff::rawPt.

161  {
162  ap_int<dpt_t::width> rawPt = pt.range();
163  return rawPt.to_int();
164  }

◆ makeDPt()

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

Definition at line 182 of file datatypes.h.

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

◆ makeDPtFromFloat()

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

Definition at line 184 of file datatypes.h.

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

◆ makeDR2FromFloatDR()

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

Definition at line 209 of file datatypes.h.

References reco::ceil(), and ETAPHI_LSB.

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

◆ makeEta()

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

Definition at line 202 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

Referenced by L1TCorrelatorLayer1Producer::addDecodedTrack().

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

◆ makeGlbEta()

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

◆ makeGlbEtaRoundEven()

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

Definition at line 204 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

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

◆ makeGlbPhi()

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

Definition at line 206 of file datatypes.h.

References ETAPHI_LSB.

Referenced by L1TCorrelatorLayer1Producer::addDecodedMuon(), and L1NNTauProducer::makeTau_HW().

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

◆ makeHoe()

hoe_t l1ct::Scales::makeHoe ( float  var)
inline

Definition at line 212 of file datatypes.h.

References HOE_LSB, and ALCARECOEcalPhiSym_cff::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

212 { return hoe_t(HOE_LSB * round(var / HOE_LSB)); };
constexpr float HOE_LSB
Definition: datatypes.h:152
ap_ufixed< 10, 5, AP_TRN, AP_SAT > hoe_t
Definition: datatypes.h:34

◆ makeIso()

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

Definition at line 207 of file datatypes.h.

References genparticles_cff::iso.

Referenced by L1TCtL2EgProducer::convertToEmu().

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

◆ makeMeanZ()

meanz_t l1ct::Scales::makeMeanZ ( float  var)
inline

Definition at line 211 of file datatypes.h.

References MEANZ_OFFSET, and ALCARECOEcalPhiSym_cff::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

211 { return round(var - MEANZ_OFFSET); };
constexpr float MEANZ_OFFSET
Definition: datatypes.h:149

◆ makePhi()

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

◆ makePt()

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

Definition at line 181 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt.

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

◆ makePtFromFloat()

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

◆ makeSrrTot()

srrtot_t l1ct::Scales::makeSrrTot ( float  var)
inline

Definition at line 210 of file datatypes.h.

References SRRTOT_LSB, SRRTOT_SCALE, and ALCARECOEcalPhiSym_cff::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

210 { return srrtot_t(SRRTOT_LSB * round(var * SRRTOT_SCALE / SRRTOT_LSB)); };
constexpr float SRRTOT_LSB
Definition: datatypes.h:150
ap_ufixed< 10, 1, AP_TRN, AP_SAT > srrtot_t
Definition: datatypes.h:32
constexpr unsigned int SRRTOT_SCALE
Definition: datatypes.h:151

◆ makeZ0()

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

◆ maxAbsEta()

float l1ct::Scales::maxAbsEta ( )
inline

Definition at line 214 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

Referenced by L1TCorrelatorLayer1Producer::initSectorsAndRegions().

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

◆ maxAbsGlbEta()

float l1ct::Scales::maxAbsGlbEta ( )
inline

Definition at line 216 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

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

◆ maxAbsGlbPhi()

float l1ct::Scales::maxAbsGlbPhi ( )
inline

Definition at line 217 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

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

◆ maxAbsPhi()

float l1ct::Scales::maxAbsPhi ( )
inline

Definition at line 215 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

Referenced by L1TCorrelatorLayer1Producer::initSectorsAndRegions().

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

◆ ptToInt() [1/2]

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

Definition at line 187 of file datatypes.h.

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

187  {
188  // note: this can be synthethized, e.g. when pT is used as intex in a LUT
189  ap_uint<pt_t::width> ret = 0;
190  ret(pt_t::width - 1, 0) = pt(pt_t::width - 1, 0);
191  return ret;
192  }
ret
prodAgent to be discontinued

◆ ptToInt() [2/2]

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

Definition at line 194 of file datatypes.h.

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

194  {
195  // note: this can be synthethized, e.g. when pT is used as intex in a LUT
196  ap_uint<dpt_t::width> ret = 0;
197  ret(dpt_t::width - 1, 0) = pt(dpt_t::width - 1, 0);
198  return ret;
199  }
ret
prodAgent to be discontinued

Variable Documentation

◆ DXY_LSB

constexpr float l1ct::Scales::DXY_LSB = 0.05

Definition at line 147 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 366 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

◆ HOE_LSB

constexpr float l1ct::Scales::HOE_LSB = 0.031250000

Definition at line 152 of file datatypes.h.

Referenced by makeHoe().

◆ 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 144 of file datatypes.h.

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

◆ MEANZ_OFFSET

constexpr float l1ct::Scales::MEANZ_OFFSET = 320.

Definition at line 149 of file datatypes.h.

Referenced by floatMeanZ(), and makeMeanZ().

◆ PUPPIW_LSB

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

Definition at line 148 of file datatypes.h.

◆ SRRTOT_LSB

constexpr float l1ct::Scales::SRRTOT_LSB = 0.0019531250

Definition at line 150 of file datatypes.h.

Referenced by makeSrrTot(), and L1TCorrelatorLayer1Producer::rawHgcalClusterEncode().

◆ SRRTOT_SCALE

constexpr unsigned int l1ct::Scales::SRRTOT_SCALE = 64

◆ Z0_LSB

constexpr float l1ct::Scales::Z0_LSB = 0.05

Definition at line 146 of file datatypes.h.

Referenced by floatZ0(), and makeZ0().