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 floatEta () const
 
float floatPhi () const
 
float floatPt () 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

glbeta_t hwEta
 
glbphi_t hwPhi
 
pt_t hwPt
 

Static Public Attributes

static const int BITWIDTH = pt_t::width + glbeta_t::width + glbphi_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 24 of file jets.h.

References hwEta, hwPhi, and hwPt.

24  {
25  hwPt = 0;
26  hwEta = 0;
27  hwPhi = 0;
28  }
glbeta_t hwEta
Definition: jets.h:14
pt_t hwPt
Definition: jets.h:13
glbphi_t hwPhi
Definition: jets.h:15

◆ floatEta()

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

Definition at line 34 of file jets.h.

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

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

◆ floatPhi()

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

Definition at line 35 of file jets.h.

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

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

◆ floatPt()

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

Definition at line 33 of file jets.h.

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

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

◆ initFromBits()

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

Definition at line 61 of file jets.h.

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

61  {
62  unsigned int start = 0;
66  }
Definition: start.py:1
glbeta_t hwEta
Definition: jets.h:14
pt_t hwPt
Definition: jets.h:13
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 31 of file jets.h.

References hwEta.

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

◆ intPhi()

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

Definition at line 32 of file jets.h.

References hwPhi.

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

◆ intPt()

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

Definition at line 30 of file jets.h.

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

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

◆ operator<()

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

Definition at line 22 of file jets.h.

References hwPt, and trackingPlots::other.

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

◆ operator==()

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

Definition at line 17 of file jets.h.

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

17  {
18  return hwPt == other.hwPt && hwEta == other.hwEta && hwPhi == other.hwPhi;
19  }
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 21 of file jets.h.

References hwPt, and trackingPlots::other.

21 { 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 47 of file jets.h.

References gpuClustering::pixelStatus::bits, and pack_ap().

47  {
48  std::array<uint64_t, 2> packed;
49  ap_uint<BITWIDTH> bits = this->pack_ap();
50  packed[0] = bits;
51  //packed[1] = bits[slice]; // for when there are more than 64 bits in the word
52  return packed;
53  }
ap_uint< BITWIDTH > pack_ap() const
Definition: jets.h:38
constexpr uint32_t bits
Definition: gpuClustering.h:25

◆ pack_ap()

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

Definition at line 38 of file jets.h.

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

Referenced by pack().

38  {
39  ap_uint<BITWIDTH> ret;
40  unsigned int start = 0;
44  return ret;
45  }
Definition: start.py:1
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
glbphi_t hwPhi
Definition: jets.h:15

◆ toGT()

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

Definition at line 80 of file jets.h.

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

80  {
81  l1gt::Jet j;
82  j.valid = hwPt != 0;
83  j.v3.pt = CTtoGT_pt(hwPt);
84  j.v3.phi = CTtoGT_phi(hwPhi);
85  j.v3.eta = CTtoGT_eta(hwEta);
86  j.z0 = 0;
87  return j;
88  }
l1gt::eta_t CTtoGT_eta(glbeta_t x)
Definition: gt_datatypes.h:264
glbeta_t hwEta
Definition: jets.h:14
pt_t hwPt
Definition: jets.h:13
l1gt::phi_t CTtoGT_phi(glbphi_t x)
Definition: gt_datatypes.h:269
glbphi_t hwPhi
Definition: jets.h:15
l1gt::pt_t CTtoGT_pt(pt_t x)
Definition: gt_datatypes.h:258

◆ unpack() [1/2]

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

Definition at line 68 of file jets.h.

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

Referenced by L1MhtPfProducer::convertEDMToHW().

68  {
69  // just one set while the word has fewer than 64 bits
70  ap_uint<BITWIDTH> bits = src[0];
71  return unpack_ap(bits);
72  }
static Jet unpack_ap(const ap_uint< BITWIDTH > &src)
Definition: jets.h:55
constexpr uint32_t bits
Definition: gpuClustering.h:25

◆ unpack() [2/2]

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

Definition at line 74 of file jets.h.

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

74  {
75  // unpack from single 64b int
76  ap_uint<BITWIDTH> bits = src;
77  return unpack_ap(bits);
78  }
static Jet unpack_ap(const ap_uint< BITWIDTH > &src)
Definition: jets.h:55
constexpr uint32_t bits
Definition: gpuClustering.h:25

◆ unpack_ap()

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

Definition at line 55 of file jets.h.

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

Referenced by unpack().

55  {
56  Jet ret;
57  ret.initFromBits(src);
58  return ret;
59  }
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
static

Definition at line 37 of file jets.h.

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