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 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 173 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().

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

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

References PVValHelper::eta, and ETAPHI_LSB.

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

◆ floatEta() [3/3]

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

Definition at line 170 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

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

◆ floatHoe()

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

Definition at line 178 of file datatypes.h.

References electrons_cff::hoe.

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

178 { return hoe.to_float(); };

◆ floatIso()

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

◆ floatMeanZ()

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

Definition at line 177 of file datatypes.h.

References MEANZ_OFFSET.

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

177 { return meanz + MEANZ_OFFSET; };
constexpr float MEANZ_OFFSET
Definition: datatypes.h:156

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

References ETAPHI_LSB.

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

◆ floatPhi() [3/3]

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

Definition at line 171 of file datatypes.h.

References ETAPHI_LSB.

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

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

References DiDispStaMuonMonitor_cfi::pt.

162 { return pt.to_float(); }

◆ floatPt() [3/3]

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

Definition at line 163 of file datatypes.h.

References HLT_2023v12_cff::pt2.

163 { return pt2.to_float(); }

◆ floatPuppiW()

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

Definition at line 174 of file datatypes.h.

References PUPPIW_LSB.

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

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

◆ floatSrrTot()

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

Definition at line 176 of file datatypes.h.

References SRRTOT_SCALE.

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

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

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

References DiDispStaMuonMonitor_cfi::pt.

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

◆ makeDPt()

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

Definition at line 181 of file datatypes.h.

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

◆ makeDPtFromFloat()

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

Definition at line 183 of file datatypes.h.

183 { 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 208 of file datatypes.h.

References reco::ceil(), and ETAPHI_LSB.

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

◆ makeEta()

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

Definition at line 201 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

Referenced by L1TCorrelatorLayer1Producer::addDecodedTrack().

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

◆ makeGlbEta()

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

◆ makeGlbEtaRoundEven()

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

Definition at line 203 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

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

◆ makeGlbPhi()

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

Definition at line 205 of file datatypes.h.

References ETAPHI_LSB.

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

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

◆ makeHoe()

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

Definition at line 211 of file datatypes.h.

References HOE_LSB, and trigObjTnPSource_cfi::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

211 { return hoe_t(HOE_LSB * round(var / HOE_LSB)); };
constexpr float HOE_LSB
Definition: datatypes.h:159
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 206 of file datatypes.h.

Referenced by L1TCtL2EgProducer::convertToEmu().

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

◆ makeMeanZ()

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

Definition at line 210 of file datatypes.h.

References MEANZ_OFFSET, and trigObjTnPSource_cfi::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

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

◆ makePhi()

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

◆ makePt()

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

Definition at line 180 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt.

180 { 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 209 of file datatypes.h.

References SRRTOT_LSB, SRRTOT_SCALE, and trigObjTnPSource_cfi::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

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

◆ makeZ0()

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

◆ maxAbsEta()

float l1ct::Scales::maxAbsEta ( )
inline

Definition at line 213 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

Referenced by L1TCorrelatorLayer1Producer::initSectorsAndRegions().

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

◆ maxAbsGlbEta()

float l1ct::Scales::maxAbsGlbEta ( )
inline

Definition at line 215 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

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

◆ maxAbsGlbPhi()

float l1ct::Scales::maxAbsGlbPhi ( )
inline

Definition at line 216 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

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

◆ maxAbsPhi()

float l1ct::Scales::maxAbsPhi ( )
inline

Definition at line 214 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

Referenced by L1TCorrelatorLayer1Producer::initSectorsAndRegions().

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

◆ ptToInt() [1/2]

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

Definition at line 186 of file datatypes.h.

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

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

◆ ptToInt() [2/2]

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

Definition at line 193 of file datatypes.h.

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

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

Variable Documentation

◆ DXY_LSB

constexpr float l1ct::Scales::DXY_LSB = 0.05

Definition at line 154 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 352 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 159 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 151 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 156 of file datatypes.h.

Referenced by floatMeanZ(), and makeMeanZ().

◆ PUPPIW_LSB

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

Definition at line 155 of file datatypes.h.

Referenced by floatPuppiW().

◆ SRRTOT_LSB

constexpr float l1ct::Scales::SRRTOT_LSB = 0.0019531250

Definition at line 157 of file datatypes.h.

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

◆ SRRTOT_SCALE

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

◆ Z0_LSB

constexpr float l1ct::Scales::Z0_LSB = 0.05

Definition at line 153 of file datatypes.h.

Referenced by floatZ0(), and makeZ0().