CMS 3D CMS Logo

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

#include <jets.h>

Inheritance diagram for l1ct::Jet:
L1SCJetEmu::Jet

Public Member Functions

void clear ()
 
float floatBtagScore () const
 
float floatEta () const
 
float floatPhi () const
 
float floatPt () const
 
float floatZ0 () const
 
void initFromBits (const ap_uint< BITWIDTH > &src)
 
int intEta () const
 
int intPhi () const
 
int intPt () const
 
bool operator< (const Jet &other) const
 
bool operator== (const Jet &other) const
 
bool operator> (const Jet &other) const
 
std::array< uint64_t, 2 > pack () const
 
ap_uint< BITWIDTHpack_ap () const
 
l1gt::Jet toGT () const
 

Static Public Member Functions

static Jet unpack (const std::array< uint64_t, 2 > &src)
 
static Jet unpack (long long unsigned int &src)
 
static Jet unpack_ap (const ap_uint< BITWIDTH > &src)
 

Public Attributes

b_tag_score_t hwBtagScore
 
glbeta_t hwEta
 
glbphi_t hwPhi
 
pt_t hwPt
 
z0_t hwZ0
 

Static Public Attributes

static const int BITWIDTH = pt_t::width + glbeta_t::width + glbphi_t::width + z0_t::width + b_tag_score_t::width
 

Detailed Description

Definition at line 12 of file jets.h.

Member Function Documentation

◆ clear()

void l1ct::Jet::clear ( void  )
inline

Definition at line 26 of file jets.h.

References hwBtagScore, hwEta, hwPhi, hwPt, and hwZ0.

26  {
27  hwPt = 0;
28  hwEta = 0;
29  hwPhi = 0;
30  hwZ0 = 0;
31  hwBtagScore = 0;
32  }
z0_t hwZ0
Definition: jets.h:16
glbeta_t hwEta
Definition: jets.h:14
pt_t hwPt
Definition: jets.h:13
b_tag_score_t hwBtagScore
Definition: jets.h:17
glbphi_t hwPhi
Definition: jets.h:15

◆ floatBtagScore()

float l1ct::Jet::floatBtagScore ( ) const
inline

Definition at line 40 of file jets.h.

References l1ct::Scales::floatBtagScore(), and hwBtagScore.

b_tag_score_t hwBtagScore
Definition: jets.h:17
float floatBtagScore(b_tag_score_t b_tag_score)
Definition: datatypes.h:179

◆ floatEta()

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

Definition at line 38 of file jets.h.

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

38 { return Scales::floatEta(hwEta); }
glbeta_t hwEta
Definition: jets.h:14
float floatEta(eta_t eta)
Definition: datatypes.h:165

◆ floatPhi()

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

Definition at line 39 of file jets.h.

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

39 { return Scales::floatPhi(hwPhi); }
float floatPhi(phi_t phi)
Definition: datatypes.h:166
glbphi_t hwPhi
Definition: jets.h:15

◆ floatPt()

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

Definition at line 37 of file jets.h.

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

37 { return Scales::floatPt(hwPt); }
pt_t hwPt
Definition: jets.h:13
float floatPt(pt_t pt)
Definition: datatypes.h:154

◆ floatZ0()

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

Definition at line 41 of file jets.h.

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

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

◆ initFromBits()

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

Definition at line 69 of file jets.h.

References hwBtagScore, hwEta, hwPhi, hwPt, hwZ0, TrackRefitter_38T_cff::src, and unpack_from_bits().

69  {
70  unsigned int start = 0;
76  }
Definition: start.py:1
z0_t hwZ0
Definition: jets.h:16
glbeta_t hwEta
Definition: jets.h:14
pt_t hwPt
Definition: jets.h:13
b_tag_score_t hwBtagScore
Definition: jets.h:17
glbphi_t hwPhi
Definition: jets.h:15
void unpack_from_bits(const U &u, unsigned int &start, T &data)
Definition: bit_encoding.h:15

◆ intEta()

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

Definition at line 35 of file jets.h.

References hwEta.

35 { return hwEta.to_int(); }
glbeta_t hwEta
Definition: jets.h:14

◆ intPhi()

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

Definition at line 36 of file jets.h.

References hwPhi.

36 { return hwPhi.to_int(); }
glbphi_t hwPhi
Definition: jets.h:15

◆ intPt()

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

Definition at line 34 of file jets.h.

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

34 { return Scales::intPt(hwPt); }
pt_t hwPt
Definition: jets.h:13
int intPt(pt_t pt)
Definition: datatypes.h:157

◆ operator<()

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

Definition at line 24 of file jets.h.

References hwPt, and trackingPlots::other.

24 { return hwPt < other.hwPt; }
pt_t hwPt
Definition: jets.h:13

◆ operator==()

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

Definition at line 19 of file jets.h.

References hwEta, hwPhi, hwPt, and trackingPlots::other.

19  {
20  return hwPt == other.hwPt && hwEta == other.hwEta && hwPhi == other.hwPhi;
21  }
glbeta_t hwEta
Definition: jets.h:14
pt_t hwPt
Definition: jets.h:13
glbphi_t hwPhi
Definition: jets.h:15

◆ operator>()

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

Definition at line 23 of file jets.h.

References hwPt, and trackingPlots::other.

23 { return hwPt > other.hwPt; }
pt_t hwPt
Definition: jets.h:13

◆ pack()

std::array<uint64_t, 2> l1ct::Jet::pack ( ) const
inline

Definition at line 55 of file jets.h.

References ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::bits, and pack_ap().

55  {
56  std::array<uint64_t, 2> packed = {{0, 0}};
57  ap_uint<BITWIDTH> bits = this->pack_ap();
58  packed[0] = bits;
59  //packed[1] = bits[slice]; // for when there are more than 64 bits in the word
60  return packed;
61  }
ap_uint< BITWIDTH > pack_ap() const
Definition: jets.h:44

◆ pack_ap()

ap_uint<BITWIDTH> l1ct::Jet::pack_ap ( ) const
inline

Definition at line 44 of file jets.h.

References hwBtagScore, hwEta, hwPhi, hwPt, hwZ0, pack_into_bits(), and runTheMatrix::ret.

Referenced by pack().

44  {
45  ap_uint<BITWIDTH> ret;
46  unsigned int start = 0;
52  return ret;
53  }
Definition: start.py:1
z0_t hwZ0
Definition: jets.h:16
ret
prodAgent to be discontinued
glbeta_t hwEta
Definition: jets.h:14
pt_t hwPt
Definition: jets.h:13
void pack_into_bits(U &u, unsigned int &start, const T &data)
Definition: bit_encoding.h:8
b_tag_score_t hwBtagScore
Definition: jets.h:17
glbphi_t hwPhi
Definition: jets.h:15

◆ toGT()

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

Definition at line 90 of file jets.h.

References l1ct::CTtoGT_eta(), l1ct::CTtoGT_phi(), l1ct::CTtoGT_pt(), hwBtagScore, hwEta, hwPhi, hwPt, hwZ0, dqmiolumiharvest::j, and ApeEstimator_cff::width.

90  {
91  l1gt::Jet j;
92  j.valid = hwPt != 0;
93  j.v3.pt = CTtoGT_pt(hwPt);
94  j.v3.phi = CTtoGT_phi(hwPhi);
95  j.v3.eta = CTtoGT_eta(hwEta);
96  j.z0(l1ct::z0_t::width - 1, 0) = hwZ0(l1ct::z0_t::width - 1, 0);
97  j.hwBtagScore = hwBtagScore;
98  return j;
99  }
z0_t hwZ0
Definition: jets.h:16
l1gt::eta_t CTtoGT_eta(glbeta_t x)
Definition: gt_datatypes.h:375
glbeta_t hwEta
Definition: jets.h:14
pt_t hwPt
Definition: jets.h:13
b_tag_score_t hwBtagScore
Definition: jets.h:17
l1gt::phi_t CTtoGT_phi(glbphi_t x)
Definition: gt_datatypes.h:380
glbphi_t hwPhi
Definition: jets.h:15
l1gt::pt_t CTtoGT_pt(pt_t x)
Definition: gt_datatypes.h:369

◆ unpack() [1/2]

static Jet l1ct::Jet::unpack ( const std::array< uint64_t, 2 > &  src)
inlinestatic

Definition at line 78 of file jets.h.

References ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::bits, TrackRefitter_38T_cff::src, and unpack_ap().

Referenced by L1MhtPfProducer::convertEDMToHW().

78  {
79  // just one set while the word has fewer than 64 bits
80  ap_uint<BITWIDTH> bits = src[0];
81  return unpack_ap(bits);
82  }
static Jet unpack_ap(const ap_uint< BITWIDTH > &src)
Definition: jets.h:63

◆ unpack() [2/2]

static Jet l1ct::Jet::unpack ( long long unsigned int &  src)
inlinestatic

Definition at line 84 of file jets.h.

References ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::bits, TrackRefitter_38T_cff::src, and unpack_ap().

84  {
85  // unpack from single 64b int
86  ap_uint<BITWIDTH> bits = src;
87  return unpack_ap(bits);
88  }
static Jet unpack_ap(const ap_uint< BITWIDTH > &src)
Definition: jets.h:63

◆ unpack_ap()

static Jet l1ct::Jet::unpack_ap ( const ap_uint< BITWIDTH > &  src)
inlinestatic

Definition at line 63 of file jets.h.

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

Referenced by unpack().

63  {
64  Jet ret;
65  ret.initFromBits(src);
66  return ret;
67  }
ret
prodAgent to be discontinued
Definition: Jet.py:1

Member Data Documentation

◆ BITWIDTH

const int l1ct::Jet::BITWIDTH = pt_t::width + glbeta_t::width + glbphi_t::width + z0_t::width + b_tag_score_t::width
static

Definition at line 43 of file jets.h.

◆ hwBtagScore

b_tag_score_t l1ct::Jet::hwBtagScore

Definition at line 17 of file jets.h.

Referenced by clear(), floatBtagScore(), initFromBits(), pack_ap(), and toGT().

◆ hwEta

glbeta_t l1ct::Jet::hwEta

Definition at line 14 of file jets.h.

Referenced by clear(), floatEta(), initFromBits(), intEta(), operator==(), pack_ap(), and toGT().

◆ hwPhi

glbphi_t l1ct::Jet::hwPhi

Definition at line 15 of file jets.h.

Referenced by clear(), floatPhi(), initFromBits(), intPhi(), operator==(), pack_ap(), and toGT().

◆ hwPt

pt_t l1ct::Jet::hwPt

Definition at line 13 of file jets.h.

Referenced by clear(), floatPt(), initFromBits(), intPt(), operator<(), operator==(), operator>(), pack_ap(), and toGT().

◆ hwZ0

z0_t l1ct::Jet::hwZ0

Definition at line 16 of file jets.h.

Referenced by clear(), floatZ0(), initFromBits(), pack_ap(), and toGT().