CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
l1ct::EGIsoEleObj Struct Reference

#include <egamma.h>

Inheritance diagram for l1ct::EGIsoEleObj:
l1ct::EGIsoObj l1ct::EGIsoEleObjEmu

Public Member Functions

void clear ()
 
float floatDEta () const
 
float floatDPhi () const
 
float floatIDScore () const
 
float floatVtxEta () const
 
float floatVtxPhi () const
 
float floatZ0 () const
 
glbeta_t hwVtxEta () const
 
glbphi_t hwVtxPhi () const
 
void initFromBits (const ap_uint< BITWIDTH > &src)
 
int intCharge () const
 
bool operator< (const EGIsoEleObj &other) const
 
bool operator== (const EGIsoEleObj &other) const
 
bool operator> (const EGIsoEleObj &other) const
 
ap_uint< BITWIDTHpack () const
 
l1gt::Electron toGT () const
 
- Public Member Functions inherited from l1ct::EGIsoObj
void clear ()
 
float floatEta () const
 
float floatIso () const
 
float floatPhi () const
 
float floatPt () const
 
void initFromBits (const ap_uint< BITWIDTH > &src)
 
int intEta () const
 
int intIso () const
 
int intPhi () const
 
int intPt () const
 
int intQual () const
 
bool operator< (const EGIsoObj &other) const
 
bool operator== (const EGIsoObj &other) const
 
bool operator> (const EGIsoObj &other) const
 
ap_uint< BITWIDTHpack () const
 
l1gt::Photon toGT () const
 

Static Public Member Functions

static EGIsoEleObj unpack (const ap_uint< BITWIDTH > &src)
 
- Static Public Member Functions inherited from l1ct::EGIsoObj
static EGIsoObj unpack (const ap_uint< BITWIDTH > &src)
 

Public Attributes

bool hwCharge
 
tkdeta_t hwDEta
 
tkdphi_t hwDPhi
 
id_score_t hwIDScore
 
z0_t hwZ0
 
- Public Attributes inherited from l1ct::EGIsoObj
glbeta_t hwEta
 
iso_t hwIso
 
glbphi_t hwPhi
 
pt_t hwPt
 
egquality_t hwQual
 

Static Public Attributes

static const int BITWIDTH
 
- Static Public Attributes inherited from l1ct::EGIsoObj
static const int BITWIDTH = pt_t::width + glbeta_t::width + glbphi_t::width + egquality_t::width + iso_t::width
 

Detailed Description

Definition at line 84 of file egamma.h.

Member Function Documentation

◆ clear()

void l1ct::EGIsoEleObj::clear ( void  )
inline

Definition at line 105 of file egamma.h.

References hwCharge, hwDEta, hwDPhi, l1ct::EGIsoObj::hwEta, hwIDScore, l1ct::EGIsoObj::hwIso, l1ct::EGIsoObj::hwPhi, l1ct::EGIsoObj::hwPt, l1ct::EGIsoObj::hwQual, and hwZ0.

Referenced by l1ct::EGIsoEleObjEmu::clear(), l1ct::L2EgSorterEmulator::toFirmware(), and l1ct::PFTkEGSorterBarrelEmulator::toFirmware_ele().

105  {
106  hwPt = 0;
107  hwEta = 0;
108  hwPhi = 0;
109  hwQual = 0;
110  hwIso = 0;
111  hwDEta = 0;
112  hwDPhi = 0;
113  hwZ0 = 0;
114  hwIDScore = 0;
115  hwCharge = false;
116  }
tkdeta_t hwDEta
Definition: egamma.h:88
pt_t hwPt
Definition: egamma.h:11
glbeta_t hwEta
Definition: egamma.h:12
tkdphi_t hwDPhi
Definition: egamma.h:89
egquality_t hwQual
Definition: egamma.h:14
glbphi_t hwPhi
Definition: egamma.h:13
id_score_t hwIDScore
Definition: egamma.h:90
iso_t hwIso
Definition: egamma.h:15

◆ floatDEta()

float l1ct::EGIsoEleObj::floatDEta ( ) const
inline

Definition at line 119 of file egamma.h.

References l1ct::Scales::floatEta(), and hwDEta.

119 { return Scales::floatEta(hwDEta); }
tkdeta_t hwDEta
Definition: egamma.h:88
float floatEta(eta_t eta)
Definition: datatypes.h:165

◆ floatDPhi()

float l1ct::EGIsoEleObj::floatDPhi ( ) const
inline

Definition at line 120 of file egamma.h.

References l1ct::Scales::floatPhi(), and hwDPhi.

120 { return Scales::floatPhi(hwDPhi); }
tkdphi_t hwDPhi
Definition: egamma.h:89
float floatPhi(phi_t phi)
Definition: datatypes.h:166

◆ floatIDScore()

float l1ct::EGIsoEleObj::floatIDScore ( ) const
inline

Definition at line 124 of file egamma.h.

References l1ct::Scales::floatIDScore(), and hwIDScore.

Referenced by L1TCtL2EgProducer::convertFromEmu().

124 { return Scales::floatIDScore(hwIDScore); }
float floatIDScore(id_score_t score)
Definition: datatypes.h:178
id_score_t hwIDScore
Definition: egamma.h:90

◆ floatVtxEta()

float l1ct::EGIsoEleObj::floatVtxEta ( ) const
inline

Definition at line 121 of file egamma.h.

References l1ct::Scales::floatEta(), and hwVtxEta().

121 { return Scales::floatEta(hwVtxEta()); }
float floatEta(eta_t eta)
Definition: datatypes.h:165
glbeta_t hwVtxEta() const
Definition: egamma.h:94

◆ floatVtxPhi()

float l1ct::EGIsoEleObj::floatVtxPhi ( ) const
inline

Definition at line 122 of file egamma.h.

References l1ct::Scales::floatPhi(), and hwVtxPhi().

122 { return Scales::floatPhi(hwVtxPhi()); }
glbphi_t hwVtxPhi() const
Definition: egamma.h:93
float floatPhi(phi_t phi)
Definition: datatypes.h:166

◆ floatZ0()

float l1ct::EGIsoEleObj::floatZ0 ( ) const
inline

Definition at line 123 of file egamma.h.

References l1ct::Scales::floatZ0(), and hwZ0.

123 { return Scales::floatZ0(hwZ0); }
float floatZ0(z0_t z0)
Definition: datatypes.h:171

◆ hwVtxEta()

glbeta_t l1ct::EGIsoEleObj::hwVtxEta ( ) const
inline

Definition at line 94 of file egamma.h.

References hwDEta, and l1ct::EGIsoObj::hwEta.

Referenced by l1ct::PFTkEGAlgoEmulator::deltaR2(), floatVtxEta(), and toGT().

94 { return hwEta + hwDEta; }
tkdeta_t hwDEta
Definition: egamma.h:88
glbeta_t hwEta
Definition: egamma.h:12

◆ hwVtxPhi()

glbphi_t l1ct::EGIsoEleObj::hwVtxPhi ( ) const
inline

Definition at line 93 of file egamma.h.

References hwCharge, hwDPhi, and l1ct::EGIsoObj::hwPhi.

Referenced by l1ct::PFTkEGAlgoEmulator::deltaR2(), floatVtxPhi(), and toGT().

93 { return hwCharge ? hwPhi + hwDPhi : hwPhi - hwDPhi; }
tkdphi_t hwDPhi
Definition: egamma.h:89
glbphi_t hwPhi
Definition: egamma.h:13

◆ initFromBits()

void l1ct::EGIsoEleObj::initFromBits ( const ap_uint< BITWIDTH > &  src)
inline

Definition at line 149 of file egamma.h.

References hwCharge, hwDEta, hwDPhi, l1ct::EGIsoObj::hwEta, hwIDScore, l1ct::EGIsoObj::hwIso, l1ct::EGIsoObj::hwPhi, l1ct::EGIsoObj::hwPt, l1ct::EGIsoObj::hwQual, hwZ0, TrackRefitter_38T_cff::src, unpack_bool_from_bits(), and unpack_from_bits().

Referenced by L1TCtL2EgProducer::convertToEmu().

149  {
150  unsigned int start = 0;
161  }
Definition: start.py:1
tkdeta_t hwDEta
Definition: egamma.h:88
pt_t hwPt
Definition: egamma.h:11
void unpack_bool_from_bits(const U &u, unsigned int &start, bool &data)
Definition: bit_encoding.h:27
glbeta_t hwEta
Definition: egamma.h:12
tkdphi_t hwDPhi
Definition: egamma.h:89
egquality_t hwQual
Definition: egamma.h:14
void unpack_from_bits(const U &u, unsigned int &start, T &data)
Definition: bit_encoding.h:15
glbphi_t hwPhi
Definition: egamma.h:13
id_score_t hwIDScore
Definition: egamma.h:90
iso_t hwIso
Definition: egamma.h:15

◆ intCharge()

int l1ct::EGIsoEleObj::intCharge ( ) const
inline

Definition at line 118 of file egamma.h.

References hwCharge.

Referenced by L1TCtL2EgProducer::convertFromEmu().

118 { return hwCharge ? +1 : -1; }

◆ operator<()

bool l1ct::EGIsoEleObj::operator< ( const EGIsoEleObj other) const
inline

Definition at line 103 of file egamma.h.

References l1ct::EGIsoObj::hwPt, and trackingPlots::other.

103 { return hwPt < other.hwPt; }
pt_t hwPt
Definition: egamma.h:11

◆ operator==()

bool l1ct::EGIsoEleObj::operator== ( const EGIsoEleObj other) const
inline

Definition at line 96 of file egamma.h.

References hwCharge, hwDEta, hwDPhi, l1ct::EGIsoObj::hwEta, hwIDScore, l1ct::EGIsoObj::hwIso, l1ct::EGIsoObj::hwPhi, l1ct::EGIsoObj::hwPt, l1ct::EGIsoObj::hwQual, hwZ0, and trackingPlots::other.

96  {
97  return hwPt == other.hwPt && hwEta == other.hwEta && hwPhi == other.hwPhi && hwQual == other.hwQual &&
98  hwIso == other.hwIso && hwDEta == other.hwDEta && hwDPhi == other.hwDPhi && hwZ0 == other.hwZ0 &&
99  hwIDScore == other.hwIDScore && hwCharge == other.hwCharge;
100  }
tkdeta_t hwDEta
Definition: egamma.h:88
pt_t hwPt
Definition: egamma.h:11
glbeta_t hwEta
Definition: egamma.h:12
tkdphi_t hwDPhi
Definition: egamma.h:89
egquality_t hwQual
Definition: egamma.h:14
glbphi_t hwPhi
Definition: egamma.h:13
id_score_t hwIDScore
Definition: egamma.h:90
iso_t hwIso
Definition: egamma.h:15

◆ operator>()

bool l1ct::EGIsoEleObj::operator> ( const EGIsoEleObj other) const
inline

Definition at line 102 of file egamma.h.

References l1ct::EGIsoObj::hwPt, and trackingPlots::other.

102 { return hwPt > other.hwPt; }
pt_t hwPt
Definition: egamma.h:11

◆ pack()

ap_uint<BITWIDTH> l1ct::EGIsoEleObj::pack ( ) const
inline

Definition at line 128 of file egamma.h.

References hwCharge, hwDEta, hwDPhi, l1ct::EGIsoObj::hwEta, hwIDScore, l1ct::EGIsoObj::hwIso, l1ct::EGIsoObj::hwPhi, l1ct::EGIsoObj::hwPt, l1ct::EGIsoObj::hwQual, hwZ0, pack_bool_into_bits(), pack_into_bits(), and runTheMatrix::ret.

Referenced by L1TCtL2EgProducer::encodeLayer1().

128  {
129  ap_uint<BITWIDTH> ret;
130  unsigned int start = 0;
141  return ret;
142  }
Definition: start.py:1
tkdeta_t hwDEta
Definition: egamma.h:88
ret
prodAgent to be discontinued
pt_t hwPt
Definition: egamma.h:11
void pack_into_bits(U &u, unsigned int &start, const T &data)
Definition: bit_encoding.h:8
glbeta_t hwEta
Definition: egamma.h:12
tkdphi_t hwDPhi
Definition: egamma.h:89
egquality_t hwQual
Definition: egamma.h:14
glbphi_t hwPhi
Definition: egamma.h:13
id_score_t hwIDScore
Definition: egamma.h:90
iso_t hwIso
Definition: egamma.h:15
void pack_bool_into_bits(U &u, unsigned int &start, bool data)
Definition: bit_encoding.h:22

◆ toGT()

l1gt::Electron l1ct::EGIsoEleObj::toGT ( ) const
inline

Definition at line 163 of file egamma.h.

References l1gt::Electron::charge, l1ct::CTtoGT_eta(), l1ct::CTtoGT_phi(), l1ct::CTtoGT_pt(), l1gt::ThreeVector::eta, hwCharge, l1ct::EGIsoObj::hwIso, l1ct::EGIsoObj::hwPt, l1ct::EGIsoObj::hwQual, hwVtxEta(), hwVtxPhi(), hwZ0, l1gt::Electron::isolationPT, l1gt::ThreeVector::phi, l1gt::ThreeVector::pt, l1gt::Electron::qualityFlags, l1gt::Electron::v3, l1gt::Electron::valid, ApeEstimator_cff::width, and l1gt::Electron::z0.

Referenced by L1TCtL2EgProducer::convertFromEmu().

163  {
164  l1gt::Electron ele;
165  ele.valid = hwPt != 0;
166  ele.v3.pt = CTtoGT_pt(hwPt);
167  ele.v3.phi = CTtoGT_phi(hwVtxPhi());
168  ele.v3.eta = CTtoGT_eta(hwVtxEta());
169  ele.qualityFlags = hwQual;
170  // NOTE: GT: 0 = positive, 1 = negative, CT: 0 = negative, 1 = positive
171  ele.charge = (!hwCharge) & ele.valid;
172  ele.z0(l1ct::z0_t::width - 1, 0) = hwZ0(l1ct::z0_t::width - 1, 0);
173  ele.isolationPT = hwIso;
174  return ele;
175  }
glbphi_t hwVtxPhi() const
Definition: egamma.h:93
l1gt::eta_t CTtoGT_eta(glbeta_t x)
Definition: gt_datatypes.h:375
pt_t hwPt
Definition: egamma.h:11
egquality_t qualityFlags
Definition: gt_datatypes.h:264
glbeta_t hwVtxEta() const
Definition: egamma.h:94
ThreeVector v3
Definition: gt_datatypes.h:263
l1gt::phi_t CTtoGT_phi(glbphi_t x)
Definition: gt_datatypes.h:380
egquality_t hwQual
Definition: egamma.h:14
ap_uint< 1 > charge
Definition: gt_datatypes.h:265
l1gt::pt_t CTtoGT_pt(pt_t x)
Definition: gt_datatypes.h:369
iso_t hwIso
Definition: egamma.h:15

◆ unpack()

static EGIsoEleObj l1ct::EGIsoEleObj::unpack ( const ap_uint< BITWIDTH > &  src)
inlinestatic

Definition at line 143 of file egamma.h.

References runTheMatrix::ret, and TrackRefitter_38T_cff::src.

143  {
144  EGIsoEleObj ret;
145  ret.initFromBits(src);
146  return ret;
147  }
ret
prodAgent to be discontinued

Member Data Documentation

◆ BITWIDTH

const int l1ct::EGIsoEleObj::BITWIDTH
static
Initial value:

Definition at line 126 of file egamma.h.

◆ hwCharge

bool l1ct::EGIsoEleObj::hwCharge

Definition at line 91 of file egamma.h.

Referenced by clear(), hwVtxPhi(), initFromBits(), intCharge(), operator==(), pack(), and toGT().

◆ hwDEta

tkdeta_t l1ct::EGIsoEleObj::hwDEta

Definition at line 88 of file egamma.h.

Referenced by clear(), floatDEta(), hwVtxEta(), initFromBits(), operator==(), and pack().

◆ hwDPhi

tkdphi_t l1ct::EGIsoEleObj::hwDPhi

Definition at line 89 of file egamma.h.

Referenced by clear(), floatDPhi(), hwVtxPhi(), initFromBits(), operator==(), and pack().

◆ hwIDScore

id_score_t l1ct::EGIsoEleObj::hwIDScore

Definition at line 90 of file egamma.h.

Referenced by clear(), floatIDScore(), initFromBits(), operator==(), and pack().

◆ hwZ0

z0_t l1ct::EGIsoEleObj::hwZ0