CMS 3D CMS Logo

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

#include <taus.h>

Inheritance diagram for l1ct::Tau:
l1HPSPFTauEmu::Tau

Public Types

typedef ap_uint< 2 > lepid_t
 
typedef ap_uint< 10 > rawid_t
 
typedef ap_uint< 2 > type_t
 

Public Member Functions

void clear ()
 
float floatAbsIso () const
 
float floatEta () const
 
float floatPhi () const
 
float floatPt () const
 
float floatSeedPt () const
 
float floatSeedZ0 () const
 
pt_t hwAbsIso () const
 
int intCharge () const
 
int intEta () const
 
int intPhi () const
 
int intPt () const
 
int intSeedPt () const
 
int intType () const
 
bool operator< (const Tau &other) const
 
bool operator== (const Tau &other) const
 
bool operator> (const Tau &other) const
 
ap_uint< BITWIDTHpack () const
 
int pdgId () const
 
void setAbsIso (pt10_t absIso)
 
l1gt::Tau toGT () const
 

Static Public Member Functions

static Tau unpack (const ap_uint< BITWIDTH > &src)
 

Public Attributes

bool hwCharge
 
glbeta_t hwEta
 
lepid_t hwIdVsEle
 
lepid_t hwIdVsMu
 
rawid_t hwIsoOrMVA
 
glbphi_t hwPhi
 
pt_t hwPt
 
rawid_t hwRawId
 
pt_t hwSeedPt
 
z0_t hwSeedZ0
 
type_t hwType
 

Static Public Attributes

static const int BITWIDTH
 

Detailed Description

Definition at line 10 of file taus.h.

Member Typedef Documentation

◆ lepid_t

typedef ap_uint<2> l1ct::Tau::lepid_t

Definition at line 13 of file taus.h.

◆ rawid_t

typedef ap_uint<10> l1ct::Tau::rawid_t

Definition at line 12 of file taus.h.

◆ type_t

typedef ap_uint<2> l1ct::Tau::type_t

Definition at line 11 of file taus.h.

Member Function Documentation

◆ clear()

void l1ct::Tau::clear ( void  )
inline

Definition at line 44 of file taus.h.

References hwCharge, hwEta, hwIdVsEle, hwIdVsMu, hwIsoOrMVA, hwPhi, hwPt, hwSeedPt, hwSeedZ0, and hwType.

44  {
45  hwPt = 0;
46  hwEta = 0;
47  hwPhi = 0;
48  hwSeedPt = 0;
49  hwSeedZ0 = 0;
50  hwCharge = false;
51  hwType = 0;
52  hwIsoOrMVA = 0;
53  hwIdVsMu = 0;
54  hwIdVsEle = 0;
55  hwIsoOrMVA = 0;
56  }
type_t hwType
Definition: taus.h:21
rawid_t hwIsoOrMVA
Definition: taus.h:25
bool hwCharge
Definition: taus.h:20
glbphi_t hwPhi
Definition: taus.h:17
lepid_t hwIdVsEle
Definition: taus.h:24
pt_t hwPt
Definition: taus.h:15
z0_t hwSeedZ0
Definition: taus.h:19
pt_t hwSeedPt
Definition: taus.h:18
glbeta_t hwEta
Definition: taus.h:16
lepid_t hwIdVsMu
Definition: taus.h:23

◆ floatAbsIso()

float l1ct::Tau::floatAbsIso ( ) const
inline

Definition at line 71 of file taus.h.

References l1ct::Scales::floatPt(), and hwAbsIso().

71 { return Scales::floatPt(hwAbsIso()); }
pt_t hwAbsIso() const
Definition: taus.h:36
float floatPt(pt_t pt)
Definition: datatypes.h:154

◆ floatEta()

float l1ct::Tau::floatEta ( ) const
inline

Definition at line 63 of file taus.h.

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

63 { return Scales::floatEta(hwEta); }
float floatEta(eta_t eta)
Definition: datatypes.h:165
glbeta_t hwEta
Definition: taus.h:16

◆ floatPhi()

float l1ct::Tau::floatPhi ( ) const
inline

Definition at line 64 of file taus.h.

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

64 { return Scales::floatPhi(hwPhi); }
glbphi_t hwPhi
Definition: taus.h:17
float floatPhi(phi_t phi)
Definition: datatypes.h:166

◆ floatPt()

float l1ct::Tau::floatPt ( ) const
inline

Definition at line 62 of file taus.h.

References l1ct::Scales::floatPt(), and hwPt.

62 { return Scales::floatPt(hwPt); }
float floatPt(pt_t pt)
Definition: datatypes.h:154
pt_t hwPt
Definition: taus.h:15

◆ floatSeedPt()

float l1ct::Tau::floatSeedPt ( ) const
inline

Definition at line 65 of file taus.h.

References l1ct::Scales::floatPt(), and hwSeedPt.

65 { return Scales::floatPt(hwSeedPt); }
float floatPt(pt_t pt)
Definition: datatypes.h:154
pt_t hwSeedPt
Definition: taus.h:18

◆ floatSeedZ0()

float l1ct::Tau::floatSeedZ0 ( ) const
inline

Definition at line 66 of file taus.h.

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

66 { return Scales::floatZ0(hwSeedZ0); }
float floatZ0(z0_t z0)
Definition: datatypes.h:171
z0_t hwSeedZ0
Definition: taus.h:19

◆ hwAbsIso()

pt_t l1ct::Tau::hwAbsIso ( ) const
inline

Definition at line 36 of file taus.h.

References hwRawId, and runTheMatrix::ret.

Referenced by floatAbsIso().

36  {
37  pt10_t ret;
38  ret(9, 0) = hwRawId(9, 0);
39  return ret;
40  }
ret
prodAgent to be discontinued
ap_ufixed< 10, 8, AP_TRN, AP_SAT > pt10_t
Definition: datatypes.h:11
rawid_t hwRawId
Definition: taus.h:22

◆ intCharge()

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

Definition at line 67 of file taus.h.

References hwCharge.

Referenced by pdgId().

67 { return hwCharge ? +1 : -1; }
bool hwCharge
Definition: taus.h:20

◆ intEta()

int l1ct::Tau::intEta ( ) const
inline

Definition at line 59 of file taus.h.

References hwEta.

59 { return hwEta.to_int(); }
glbeta_t hwEta
Definition: taus.h:16

◆ intPhi()

int l1ct::Tau::intPhi ( ) const
inline

Definition at line 60 of file taus.h.

References hwPhi.

60 { return hwPhi.to_int(); }
glbphi_t hwPhi
Definition: taus.h:17

◆ intPt()

int l1ct::Tau::intPt ( ) const
inline

Definition at line 58 of file taus.h.

References hwPt, and l1ct::Scales::intPt().

58 { return Scales::intPt(hwPt); }
pt_t hwPt
Definition: taus.h:15
int intPt(pt_t pt)
Definition: datatypes.h:157

◆ intSeedPt()

int l1ct::Tau::intSeedPt ( ) const
inline

Definition at line 61 of file taus.h.

References hwSeedPt, and l1ct::Scales::intPt().

61 { return Scales::intPt(hwSeedPt); }
int intPt(pt_t pt)
Definition: datatypes.h:157
pt_t hwSeedPt
Definition: taus.h:18

◆ intType()

int l1ct::Tau::intType ( ) const
inline

Definition at line 69 of file taus.h.

References hwType.

69 { return hwType.to_int(); }
type_t hwType
Definition: taus.h:21

◆ operator<()

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

Definition at line 34 of file taus.h.

References hwPt, and trackingPlots::other.

34 { return hwPt < other.hwPt; }
pt_t hwPt
Definition: taus.h:15

◆ operator==()

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

Definition at line 27 of file taus.h.

References hwCharge, hwEta, hwIdVsEle, hwIdVsMu, hwIsoOrMVA, hwPhi, hwPt, hwSeedPt, hwSeedZ0, hwType, and trackingPlots::other.

27  {
28  return hwPt == other.hwPt && hwEta == other.hwEta && hwPhi == other.hwPhi && hwSeedPt == other.hwSeedPt &&
29  hwSeedZ0 == other.hwSeedZ0 && hwCharge == other.hwCharge && hwType == other.hwType &&
30  hwIsoOrMVA == other.hwIsoOrMVA && hwIdVsMu == other.hwIdVsMu && hwIdVsEle == other.hwIdVsEle;
31  }
type_t hwType
Definition: taus.h:21
rawid_t hwIsoOrMVA
Definition: taus.h:25
bool hwCharge
Definition: taus.h:20
glbphi_t hwPhi
Definition: taus.h:17
lepid_t hwIdVsEle
Definition: taus.h:24
pt_t hwPt
Definition: taus.h:15
z0_t hwSeedZ0
Definition: taus.h:19
pt_t hwSeedPt
Definition: taus.h:18
glbeta_t hwEta
Definition: taus.h:16
lepid_t hwIdVsMu
Definition: taus.h:23

◆ operator>()

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

Definition at line 33 of file taus.h.

References hwPt, and trackingPlots::other.

33 { return hwPt > other.hwPt; }
pt_t hwPt
Definition: taus.h:15

◆ pack()

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

Definition at line 75 of file taus.h.

References hwCharge, hwEta, hwIdVsEle, hwIdVsMu, hwIsoOrMVA, hwPhi, hwPt, hwRawId, hwSeedPt, hwSeedZ0, hwType, pack_bool_into_bits(), pack_into_bits(), and runTheMatrix::ret.

75  {
76  ap_uint<BITWIDTH> ret;
77  unsigned int start = 0;
89  return ret;
90  }
Definition: start.py:1
ret
prodAgent to be discontinued
type_t hwType
Definition: taus.h:21
rawid_t hwIsoOrMVA
Definition: taus.h:25
void pack_into_bits(U &u, unsigned int &start, const T &data)
Definition: bit_encoding.h:8
bool hwCharge
Definition: taus.h:20
glbphi_t hwPhi
Definition: taus.h:17
lepid_t hwIdVsEle
Definition: taus.h:24
pt_t hwPt
Definition: taus.h:15
z0_t hwSeedZ0
Definition: taus.h:19
pt_t hwSeedPt
Definition: taus.h:18
glbeta_t hwEta
Definition: taus.h:16
lepid_t hwIdVsMu
Definition: taus.h:23
rawid_t hwRawId
Definition: taus.h:22
void pack_bool_into_bits(U &u, unsigned int &start, bool data)
Definition: bit_encoding.h:22

◆ pdgId()

int l1ct::Tau::pdgId ( ) const
inline

Definition at line 68 of file taus.h.

References intCharge().

Referenced by Particle.Particle::__str__().

68 { return -15 * intCharge(); }
int intCharge() const
Definition: taus.h:67

◆ setAbsIso()

void l1ct::Tau::setAbsIso ( pt10_t  absIso)
inline

Definition at line 42 of file taus.h.

References objects.autophobj::absIso, and hwRawId.

42 { hwRawId(9, 0) = absIso(9, 0); }
rawid_t hwRawId
Definition: taus.h:22

◆ toGT()

l1gt::Tau l1ct::Tau::toGT ( ) const
inline

Definition at line 108 of file taus.h.

References l1ct::CTtoGT_eta(), l1ct::CTtoGT_phi(), l1ct::CTtoGT_pt(), hwCharge, hwEta, hwPhi, hwPt, hwRawId, hwSeedPt, hwSeedZ0, hwType, submitPVValidationJobs::t, and ApeEstimator_cff::width.

Referenced by L1NNTauProducer::makeTau_HW().

108  {
109  l1gt::Tau t;
110  t.valid = hwPt != 0;
111 
112  t.v3.pt = CTtoGT_pt(hwPt);
113  t.v3.phi = CTtoGT_phi(hwPhi);
114  t.v3.eta = CTtoGT_eta(hwEta);
115 
116  t.seed_pt = hwSeedPt;
117  t.seed_z0(l1ct::z0_t::width - 1, 0) = hwSeedZ0(l1ct::z0_t::width - 1, 0);
118  t.charge = !hwCharge;
119 
120  t.type = hwType;
121  t.quality = hwRawId;
122  return t;
123  }
l1gt::eta_t CTtoGT_eta(glbeta_t x)
Definition: gt_datatypes.h:375
type_t hwType
Definition: taus.h:21
bool hwCharge
Definition: taus.h:20
glbphi_t hwPhi
Definition: taus.h:17
pt_t hwPt
Definition: taus.h:15
z0_t hwSeedZ0
Definition: taus.h:19
pt_t hwSeedPt
Definition: taus.h:18
glbeta_t hwEta
Definition: taus.h:16
l1gt::phi_t CTtoGT_phi(glbphi_t x)
Definition: gt_datatypes.h:380
l1gt::pt_t CTtoGT_pt(pt_t x)
Definition: gt_datatypes.h:369
rawid_t hwRawId
Definition: taus.h:22

◆ unpack()

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

Definition at line 92 of file taus.h.

References runTheMatrix::ret, TrackRefitter_38T_cff::src, and unpack_from_bits().

92  {
93  Tau ret;
94  unsigned int start = 0;
95  unpack_from_bits(src, start, ret.hwPt);
96  unpack_from_bits(src, start, ret.hwEta);
97  unpack_from_bits(src, start, ret.hwPhi);
98  unpack_from_bits(src, start, ret.hwSeedPt);
99  unpack_from_bits(src, start, ret.hwSeedZ0);
100  unpack_from_bits(src, start, ret.hwType);
101  unpack_from_bits(src, start, ret.hwRawId);
102  unpack_from_bits(src, start, ret.hwIdVsMu);
103  unpack_from_bits(src, start, ret.hwIdVsEle);
104  unpack_from_bits(src, start, ret.hwIsoOrMVA);
105  return ret;
106  }
Definition: start.py:1
ret
prodAgent to be discontinued
Definition: Tau.py:1
void unpack_from_bits(const U &u, unsigned int &start, T &data)
Definition: bit_encoding.h:15

Member Data Documentation

◆ BITWIDTH

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

Definition at line 73 of file taus.h.

◆ hwCharge

bool l1ct::Tau::hwCharge

Definition at line 20 of file taus.h.

Referenced by clear(), intCharge(), L1NNTauProducer::makeTau_HW(), operator==(), pack(), and toGT().

◆ hwEta

glbeta_t l1ct::Tau::hwEta

Definition at line 16 of file taus.h.

Referenced by clear(), floatEta(), intEta(), L1NNTauProducer::makeTau_HW(), operator==(), pack(), and toGT().

◆ hwIdVsEle

lepid_t l1ct::Tau::hwIdVsEle

Definition at line 24 of file taus.h.

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

◆ hwIdVsMu

lepid_t l1ct::Tau::hwIdVsMu

Definition at line 23 of file taus.h.

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

◆ hwIsoOrMVA

rawid_t l1ct::Tau::hwIsoOrMVA

Definition at line 25 of file taus.h.

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

◆ hwPhi

glbphi_t l1ct::Tau::hwPhi

Definition at line 17 of file taus.h.

Referenced by clear(), floatPhi(), intPhi(), L1NNTauProducer::makeTau_HW(), operator==(), pack(), and toGT().

◆ hwPt

pt_t l1ct::Tau::hwPt

◆ hwRawId

rawid_t l1ct::Tau::hwRawId

Definition at line 22 of file taus.h.

Referenced by hwAbsIso(), L1NNTauProducer::makeTau_HW(), pack(), setAbsIso(), and toGT().

◆ hwSeedPt

pt_t l1ct::Tau::hwSeedPt

Definition at line 18 of file taus.h.

Referenced by clear(), floatSeedPt(), intSeedPt(), L1NNTauProducer::makeTau_HW(), operator==(), pack(), and toGT().

◆ hwSeedZ0

z0_t l1ct::Tau::hwSeedZ0

Definition at line 19 of file taus.h.

Referenced by clear(), floatSeedZ0(), L1NNTauProducer::makeTau_HW(), operator==(), pack(), and toGT().

◆ hwType

type_t l1ct::Tau::hwType

Definition at line 21 of file taus.h.

Referenced by clear(), intType(), L1NNTauProducer::makeTau_HW(), operator==(), pack(), and toGT().