CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Attributes
L1GctJetCounts Class Reference

#include <L1GctJetCounts.h>

Public Member Functions

int16_t bx () const
 get bunch-crossing index More...
 
unsigned count (unsigned i) const
 get count by index More...
 
unsigned count00 () const
 get individual counts (for use with FWLite) More...
 
unsigned count01 () const
 
unsigned count02 () const
 
unsigned count03 () const
 
unsigned count04 () const
 
unsigned count05 () const
 
unsigned count06 () const
 
unsigned count07 () const
 
unsigned count08 () const
 
unsigned count09 () const
 
unsigned count10 () const
 
unsigned count11 () const
 
bool empty () const
 empty method More...
 
 L1GctJetCounts ()
 default constructor More...
 
 L1GctJetCounts (const std::vector< unsigned > &counts)
 constructor for emulator More...
 
 L1GctJetCounts (const std::vector< unsigned > &counts, int16_t bx)
 
 L1GctJetCounts (uint32_t data0, uint32_t data1)
 Constructor for unpacking. More...
 
 L1GctJetCounts (uint32_t data0, uint32_t data1, int16_t bx)
 
std::string name () const
 name method More...
 
int operator!= (const L1GctJetCounts &c) const
 inequality operator More...
 
int operator== (const L1GctJetCounts &c) const
 equality operator More...
 
uint32_t raw0 () const
 get raw word 0 More...
 
uint32_t raw1 () const
 get raw word 1 More...
 
virtual ~L1GctJetCounts ()
 destructor More...
 

Static Public Attributes

static const unsigned MAX_TOTAL_COUNTS = 12
 
static const unsigned MAX_TRUE_COUNTS = 6
 

Private Attributes

int16_t m_bx
 
uint32_t m_data0
 
uint32_t m_data1
 

Detailed Description

Author
: Jim Brooke

Class to store the GCT jet count output

Definition at line 16 of file L1GctJetCounts.h.

Constructor & Destructor Documentation

◆ L1GctJetCounts() [1/5]

L1GctJetCounts::L1GctJetCounts ( )

default constructor

Definition at line 17 of file L1GctJetCounts.cc.

17 : m_data0(0), m_data1(0), m_bx(0) {}

◆ L1GctJetCounts() [2/5]

L1GctJetCounts::L1GctJetCounts ( uint32_t  data0,
uint32_t  data1 
)

Constructor for unpacking.

Expects three 5-bit jet counts in bits 14:0, and then three more 5-bit jet counts in bits 30:16 for both of the arguments; this is because in the raw format bit 31 is a BC0 flag, and bit 15 is always 1. Thus, jet count 0 should be in bits 4:0 of the data0 argument.

Definition at line 20 of file L1GctJetCounts.cc.

21  : m_data0(data0 & 0x7fff7fff), // Mask off bits 15 and 31 for better compression and consistency
22  m_data1(data1 & 0x7fff7fff), // with emulator constructor - these bits are not jet count data!
23  m_bx(0) {}

◆ L1GctJetCounts() [3/5]

L1GctJetCounts::L1GctJetCounts ( uint32_t  data0,
uint32_t  data1,
int16_t  bx 
)

Definition at line 26 of file L1GctJetCounts.cc.

27  : m_data0(data0 & 0x7fff7fff), // Mask off bits 15 and 31 for better compression and consistency
28  m_data1(data1 & 0x7fff7fff), // with emulator constructor - these bits are not jet count data!
29  m_bx(bx) {}

◆ L1GctJetCounts() [4/5]

L1GctJetCounts::L1GctJetCounts ( const std::vector< unsigned > &  counts)

constructor for emulator

Definition at line 32 of file L1GctJetCounts.cc.

32  : m_data0(0), m_data1(0), m_bx(0) {
33  // Assumes all required output data has been packed
34  // into 12 5-bit fields
35  if (counts.size() != MAX_TOTAL_COUNTS) {
36  } else {
37  for (unsigned int i = 0; i < 3; ++i) {
38  m_data0 += (counts[i] << (5 * i));
39  m_data0 += (counts[i + 3] << (5 * i + 16));
40  m_data1 += (counts[i + 6] << (5 * i));
41  m_data1 += (counts[i + 9] << (5 * i + 16));
42  }
43  }
44 }

References dqmiodumpmetadata::counts, mps_fire::i, m_data0, m_data1, and MAX_TOTAL_COUNTS.

◆ L1GctJetCounts() [5/5]

L1GctJetCounts::L1GctJetCounts ( const std::vector< unsigned > &  counts,
int16_t  bx 
)

Definition at line 47 of file L1GctJetCounts.cc.

47  : m_data0(0), m_data1(0), m_bx(bx) {
48  if (counts.size() != MAX_TOTAL_COUNTS) {
49  } else {
50  for (unsigned int i = 0; i < 3; ++i) {
51  m_data0 += (counts[i] << (5 * i));
52  m_data0 += (counts[i + 3] << (5 * i + 16));
53  m_data1 += (counts[i + 6] << (5 * i));
54  m_data1 += (counts[i + 9] << (5 * i + 16));
55  }
56  }
57 }

References dqmiodumpmetadata::counts, mps_fire::i, m_data0, m_data1, and MAX_TOTAL_COUNTS.

◆ ~L1GctJetCounts()

L1GctJetCounts::~L1GctJetCounts ( )
virtual

destructor

Definition at line 60 of file L1GctJetCounts.cc.

60 {}

Member Function Documentation

◆ bx()

int16_t L1GctJetCounts::bx ( ) const
inline

get bunch-crossing index

Definition at line 75 of file L1GctJetCounts.h.

75 { return m_bx; }

References m_bx.

◆ count()

unsigned L1GctJetCounts::count ( unsigned  i) const

get count by index

Definition at line 63 of file L1GctJetCounts.cc.

63  {
64  if (i < 6) {
65  return ((m_data0 >> (i < 3 ? (5 * i) : ((5 * i) + 1))) & 0x1f);
66  } else if (i < MAX_TOTAL_COUNTS) {
67  return ((m_data1 >> (i < 9 ? ((5 * i) - 30) : ((5 * i) - 29))) & 0x1f);
68  } else {
69  return 0;
70  }
71 }

References mps_fire::i, m_data0, m_data1, and MAX_TOTAL_COUNTS.

Referenced by count00(), count01(), count02(), count03(), count04(), count05(), count06(), count07(), count08(), count09(), count10(), count11(), L1GtJetCountsCondition::evaluateCondition(), and L1GlobalTriggerPSB::fillPsbBlock().

◆ count00()

unsigned L1GctJetCounts::count00 ( ) const
inline

get individual counts (for use with FWLite)

Definition at line 61 of file L1GctJetCounts.h.

61 { return (MAX_TRUE_COUNTS < 1 ? 0 : count(0)); }

References count(), and MAX_TRUE_COUNTS.

◆ count01()

unsigned L1GctJetCounts::count01 ( ) const
inline

Definition at line 62 of file L1GctJetCounts.h.

62 { return (MAX_TRUE_COUNTS < 2 ? 0 : count(1)); }

References count(), and MAX_TRUE_COUNTS.

◆ count02()

unsigned L1GctJetCounts::count02 ( ) const
inline

Definition at line 63 of file L1GctJetCounts.h.

63 { return (MAX_TRUE_COUNTS < 3 ? 0 : count(2)); }

References count(), and MAX_TRUE_COUNTS.

◆ count03()

unsigned L1GctJetCounts::count03 ( ) const
inline

Definition at line 64 of file L1GctJetCounts.h.

64 { return (MAX_TRUE_COUNTS < 4 ? 0 : count(3)); }

References count(), and MAX_TRUE_COUNTS.

◆ count04()

unsigned L1GctJetCounts::count04 ( ) const
inline

Definition at line 65 of file L1GctJetCounts.h.

65 { return (MAX_TRUE_COUNTS < 5 ? 0 : count(4)); }

References count(), and MAX_TRUE_COUNTS.

◆ count05()

unsigned L1GctJetCounts::count05 ( ) const
inline

Definition at line 66 of file L1GctJetCounts.h.

66 { return (MAX_TRUE_COUNTS < 6 ? 0 : count(5)); }

References count(), and MAX_TRUE_COUNTS.

◆ count06()

unsigned L1GctJetCounts::count06 ( ) const
inline

Definition at line 67 of file L1GctJetCounts.h.

67 { return (MAX_TRUE_COUNTS < 7 ? 0 : count(6)); }

References count(), and MAX_TRUE_COUNTS.

◆ count07()

unsigned L1GctJetCounts::count07 ( ) const
inline

Definition at line 68 of file L1GctJetCounts.h.

68 { return (MAX_TRUE_COUNTS < 8 ? 0 : count(7)); }

References count(), and MAX_TRUE_COUNTS.

◆ count08()

unsigned L1GctJetCounts::count08 ( ) const
inline

Definition at line 69 of file L1GctJetCounts.h.

69 { return (MAX_TRUE_COUNTS < 9 ? 0 : count(8)); }

References count(), and MAX_TRUE_COUNTS.

◆ count09()

unsigned L1GctJetCounts::count09 ( ) const
inline

Definition at line 70 of file L1GctJetCounts.h.

70 { return (MAX_TRUE_COUNTS < 10 ? 0 : count(9)); }

References count(), and MAX_TRUE_COUNTS.

◆ count10()

unsigned L1GctJetCounts::count10 ( ) const
inline

Definition at line 71 of file L1GctJetCounts.h.

71 { return (MAX_TRUE_COUNTS < 11 ? 0 : count(10)); }

References count(), and MAX_TRUE_COUNTS.

◆ count11()

unsigned L1GctJetCounts::count11 ( ) const
inline

Definition at line 72 of file L1GctJetCounts.h.

72 { return (MAX_TRUE_COUNTS < 12 ? 0 : count(11)); }

References count(), and MAX_TRUE_COUNTS.

◆ empty()

bool L1GctJetCounts::empty ( ) const
inline

empty method

Definition at line 49 of file L1GctJetCounts.h.

49 { return false; }

◆ name()

std::string L1GctJetCounts::name ( ) const
inline

name method

Definition at line 46 of file L1GctJetCounts.h.

46 { return "JetCounts"; }

Referenced by config.CFG::__str__(), validation.Sample::digest(), and VIDSelectorBase.VIDSelectorBase::initialize().

◆ operator!=()

int L1GctJetCounts::operator!= ( const L1GctJetCounts c) const
inline

inequality operator

Definition at line 81 of file L1GctJetCounts.h.

81 { return !(*this == c); }

References c.

◆ operator==()

int L1GctJetCounts::operator== ( const L1GctJetCounts c) const
inline

equality operator

Definition at line 78 of file L1GctJetCounts.h.

78 { return (m_data0 == c.raw0() && m_data1 == c.raw1()); }

References c, m_data0, and m_data1.

◆ raw0()

uint32_t L1GctJetCounts::raw0 ( ) const
inline

get raw word 0

Definition at line 52 of file L1GctJetCounts.h.

52 { return m_data0; }

References m_data0.

◆ raw1()

uint32_t L1GctJetCounts::raw1 ( ) const
inline

get raw word 1

Definition at line 55 of file L1GctJetCounts.h.

55 { return m_data1; }

References m_data1.

Member Data Documentation

◆ m_bx

int16_t L1GctJetCounts::m_bx
private

Definition at line 86 of file L1GctJetCounts.h.

Referenced by bx().

◆ m_data0

uint32_t L1GctJetCounts::m_data0
private

Definition at line 84 of file L1GctJetCounts.h.

Referenced by count(), L1GctJetCounts(), operator==(), and raw0().

◆ m_data1

uint32_t L1GctJetCounts::m_data1
private

Definition at line 85 of file L1GctJetCounts.h.

Referenced by count(), L1GctJetCounts(), operator==(), and raw1().

◆ MAX_TOTAL_COUNTS

const unsigned L1GctJetCounts::MAX_TOTAL_COUNTS = 12
static

static maximum number of jet counts This can be up to 12 but we use some of the available bandwidth for other information.

Definition at line 21 of file L1GctJetCounts.h.

Referenced by count(), and L1GctJetCounts().

◆ MAX_TRUE_COUNTS

const unsigned L1GctJetCounts::MAX_TRUE_COUNTS = 6
static

MAX_TRUE_COUNTS specifies the bandwidth remaining for real jet count information.

Definition at line 22 of file L1GctJetCounts.h.

Referenced by count00(), count01(), count02(), count03(), count04(), count05(), count06(), count07(), count08(), count09(), count10(), and count11().

mps_fire.i
i
Definition: mps_fire.py:428
L1GctJetCounts::MAX_TRUE_COUNTS
static const unsigned MAX_TRUE_COUNTS
Definition: L1GctJetCounts.h:22
L1GctJetCounts::m_data1
uint32_t m_data1
Definition: L1GctJetCounts.h:85
L1GctJetCounts::bx
int16_t bx() const
get bunch-crossing index
Definition: L1GctJetCounts.h:75
L1GctJetCounts::m_bx
int16_t m_bx
Definition: L1GctJetCounts.h:86
L1GctJetCounts::count
unsigned count(unsigned i) const
get count by index
Definition: L1GctJetCounts.cc:63
dqmiodumpmetadata.counts
counts
Definition: dqmiodumpmetadata.py:25
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
L1GctJetCounts::m_data0
uint32_t m_data0
Definition: L1GctJetCounts.h:84
L1GctJetCounts::MAX_TOTAL_COUNTS
static const unsigned MAX_TOTAL_COUNTS
Definition: L1GctJetCounts.h:21