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 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

◆ floatDxy()

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

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

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

◆ 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 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:153

◆ floatEta() [3/3]

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

Definition at line 171 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

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

◆ floatHoe()

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

Definition at line 179 of file datatypes.h.

References electrons_cff::hoe.

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

179 { 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 178 of file datatypes.h.

References MEANZ_OFFSET.

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

178 { return meanz + MEANZ_OFFSET; };
constexpr float MEANZ_OFFSET
Definition: datatypes.h:157

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

References ETAPHI_LSB.

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

◆ floatPhi() [3/3]

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

Definition at line 172 of file datatypes.h.

References ETAPHI_LSB.

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

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

References DiDispStaMuonMonitor_cfi::pt.

163 { return pt.to_float(); }

◆ floatPt() [3/3]

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

Definition at line 164 of file datatypes.h.

References HLT_2023v12_cff::pt2.

164 { return pt2.to_float(); }

◆ floatPuppiW()

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

Definition at line 175 of file datatypes.h.

References PUPPIW_LSB.

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

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

◆ floatSrrTot()

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

Definition at line 177 of file datatypes.h.

References SRRTOT_SCALE.

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

177 { return srrtot.to_float() / SRRTOT_SCALE; };
constexpr unsigned int SRRTOT_SCALE
Definition: datatypes.h:159

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

References DiDispStaMuonMonitor_cfi::pt.

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

◆ makeDPt()

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

Definition at line 183 of file datatypes.h.

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

◆ makeDPtFromFloat()

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

Definition at line 185 of file datatypes.h.

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

◆ makeDR2FromFloatDR()

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

Definition at line 210 of file datatypes.h.

References reco::ceil(), and ETAPHI_LSB.

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

◆ makeEta()

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

Definition at line 203 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

Referenced by L1TCorrelatorLayer1Producer::addDecodedTrack().

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

◆ makeGlbEta()

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

◆ makeGlbEtaRoundEven()

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

Definition at line 205 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

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

◆ makeGlbPhi()

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

Definition at line 207 of file datatypes.h.

References ETAPHI_LSB.

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

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

◆ makeHoe()

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

Definition at line 213 of file datatypes.h.

References HOE_LSB, and trigObjTnPSource_cfi::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

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

◆ makeIso()

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

Definition at line 208 of file datatypes.h.

Referenced by L1TCtL2EgProducer::convertToEmu().

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

◆ makeMeanZ()

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

Definition at line 212 of file datatypes.h.

References MEANZ_OFFSET, and trigObjTnPSource_cfi::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

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

◆ makePhi()

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

◆ makePt()

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

Definition at line 182 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt.

182 { 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 211 of file datatypes.h.

References SRRTOT_LSB, SRRTOT_SCALE, and trigObjTnPSource_cfi::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

211 { return srrtot_t(SRRTOT_LSB * round(var * SRRTOT_SCALE / SRRTOT_LSB)); };
constexpr float SRRTOT_LSB
Definition: datatypes.h:158
ap_ufixed< 10, 1, AP_TRN, AP_SAT > srrtot_t
Definition: datatypes.h:41
constexpr unsigned int SRRTOT_SCALE
Definition: datatypes.h:159

◆ makeZ0()

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

◆ maxAbsEta()

float l1ct::Scales::maxAbsEta ( )
inline

Definition at line 215 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

Referenced by L1TCorrelatorLayer1Producer::initSectorsAndRegions().

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

◆ maxAbsGlbEta()

float l1ct::Scales::maxAbsGlbEta ( )
inline

Definition at line 217 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

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

◆ maxAbsGlbPhi()

float l1ct::Scales::maxAbsGlbPhi ( )
inline

Definition at line 218 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

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

◆ maxAbsPhi()

float l1ct::Scales::maxAbsPhi ( )
inline

Definition at line 216 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

Referenced by L1TCorrelatorLayer1Producer::initSectorsAndRegions().

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

◆ ptToInt() [1/2]

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

Definition at line 188 of file datatypes.h.

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

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

◆ ptToInt() [2/2]

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

Definition at line 195 of file datatypes.h.

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

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

Variable Documentation

◆ DXY_LSB

constexpr float l1ct::Scales::DXY_LSB = 0.05

Definition at line 155 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 355 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 160 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 152 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 157 of file datatypes.h.

Referenced by floatMeanZ(), and makeMeanZ().

◆ PUPPIW_LSB

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

Definition at line 156 of file datatypes.h.

Referenced by floatPuppiW().

◆ SRRTOT_LSB

constexpr float l1ct::Scales::SRRTOT_LSB = 0.0019531250

Definition at line 158 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 154 of file datatypes.h.

Referenced by floatZ0(), and makeZ0().