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

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

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

References PVValHelper::eta, and ETAPHI_LSB.

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

◆ floatEta() [3/3]

float l1ct::Scales::floatEta ( glbeta_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:144

◆ floatHoe()

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

Definition at line 176 of file datatypes.h.

References electrons_cff::hoe.

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

176 { 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 175 of file datatypes.h.

References MEANZ_OFFSET.

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

175 { return meanz + MEANZ_OFFSET; };
constexpr float MEANZ_OFFSET
Definition: datatypes.h:148

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

References ETAPHI_LSB.

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

◆ floatPhi() [3/3]

float l1ct::Scales::floatPhi ( glbphi_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:144

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

References DiDispStaMuonMonitor_cfi::pt.

154 { return pt.to_float(); }

◆ floatPt() [3/3]

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

Definition at line 155 of file datatypes.h.

References HLT_2024v13_cff::pt2.

155 { return pt2.to_float(); }

◆ floatPuppiW()

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

Definition at line 172 of file datatypes.h.

References PUPPIW_LSB.

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

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

◆ floatSrrTot()

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

Definition at line 174 of file datatypes.h.

References SRRTOT_SCALE.

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

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

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

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

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

◆ makeDPt()

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

Definition at line 180 of file datatypes.h.

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

◆ makeDPtFromFloat()

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

Definition at line 182 of file datatypes.h.

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

References reco::ceil(), and ETAPHI_LSB.

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

◆ makeEta()

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

Definition at line 200 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

Referenced by L1TCorrelatorLayer1Producer::addDecodedTrack().

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

◆ makeGlbEta()

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

◆ makeGlbEtaRoundEven()

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

Definition at line 202 of file datatypes.h.

References PVValHelper::eta, and ETAPHI_LSB.

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

◆ makeGlbPhi()

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

Definition at line 204 of file datatypes.h.

References ETAPHI_LSB.

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

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

◆ makeHoe()

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

Definition at line 210 of file datatypes.h.

References HOE_LSB, and trigObjTnPSource_cfi::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

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

References genparticles_cff::iso.

Referenced by L1TCtL2EgProducer::convertToEmu().

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

◆ makeMeanZ()

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

Definition at line 209 of file datatypes.h.

References MEANZ_OFFSET, and trigObjTnPSource_cfi::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

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

◆ makePhi()

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

◆ makePt()

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

Definition at line 179 of file datatypes.h.

References DiDispStaMuonMonitor_cfi::pt.

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

References SRRTOT_LSB, SRRTOT_SCALE, and trigObjTnPSource_cfi::var.

Referenced by L1TCorrelatorLayer1Producer::addDecodedHadCalo().

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

◆ makeZ0()

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

◆ maxAbsEta()

float l1ct::Scales::maxAbsEta ( )
inline

Definition at line 212 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

Referenced by L1TCorrelatorLayer1Producer::initSectorsAndRegions().

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

◆ maxAbsGlbEta()

float l1ct::Scales::maxAbsGlbEta ( )
inline

Definition at line 214 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

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

◆ maxAbsGlbPhi()

float l1ct::Scales::maxAbsGlbPhi ( )
inline

Definition at line 215 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

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

◆ maxAbsPhi()

float l1ct::Scales::maxAbsPhi ( )
inline

Definition at line 213 of file datatypes.h.

References ETAPHI_LSB, and ApeEstimator_cff::width.

Referenced by L1TCorrelatorLayer1Producer::initSectorsAndRegions().

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

◆ ptToInt() [1/2]

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

Definition at line 185 of file datatypes.h.

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

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

◆ ptToInt() [2/2]

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

Definition at line 192 of file datatypes.h.

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

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

Variable Documentation

◆ DXY_LSB

constexpr float l1ct::Scales::DXY_LSB = 0.05

Definition at line 146 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 362 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 151 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 143 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 148 of file datatypes.h.

Referenced by floatMeanZ(), and makeMeanZ().

◆ PUPPIW_LSB

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

Definition at line 147 of file datatypes.h.

Referenced by floatPuppiW().

◆ SRRTOT_LSB

constexpr float l1ct::Scales::SRRTOT_LSB = 0.0019531250

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

Referenced by floatZ0(), and makeZ0().