CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (uint32_t data0, uint32_t data1)
 Constructor for unpacking. More...
 
 L1GctJetCounts (uint32_t data0, uint32_t data1, int16_t bx)
 
 L1GctJetCounts (const std::vector< unsigned > &counts)
 constructor for emulator More...
 
 L1GctJetCounts (const std::vector< unsigned > &counts, 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 17 of file L1GctJetCounts.h.

Constructor & Destructor Documentation

L1GctJetCounts::L1GctJetCounts ( )

default constructor

Definition at line 17 of file L1GctJetCounts.cc.

17  :
18  m_data0(0),
19  m_data1(0),
20  m_bx(0)
21 {
22 
23 }
uint32_t m_data0
uint32_t m_data1
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 26 of file L1GctJetCounts.cc.

26  :
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(0)
30 {
31 }
uint32_t m_data0
uint32_t m_data1
L1GctJetCounts::L1GctJetCounts ( uint32_t  data0,
uint32_t  data1,
int16_t  bx 
)

Definition at line 34 of file L1GctJetCounts.cc.

34  :
35  m_data0(data0 & 0x7fff7fff), // Mask off bits 15 and 31 for better compression and consistency
36  m_data1(data1 & 0x7fff7fff), // with emulator constructor - these bits are not jet count data!
37  m_bx(bx)
38 {
39 }
uint32_t m_data0
uint32_t m_data1
int16_t bx() const
get bunch-crossing index
L1GctJetCounts::L1GctJetCounts ( const std::vector< unsigned > &  counts)

constructor for emulator

Definition at line 42 of file L1GctJetCounts.cc.

References i, m_data0, m_data1, and MAX_TOTAL_COUNTS.

42  :
43  m_data0(0),
44  m_data1(0),
45  m_bx(0)
46 {
47  // Assumes all required output data has been packed
48  // into 12 5-bit fields
49  if (counts.size() != MAX_TOTAL_COUNTS) { }
50  else {
51  for (unsigned int i=0; i<3; ++i) {
52  m_data0 += (counts[i] << (5*i));
53  m_data0 += (counts[i+3] << (5*i + 16));
54  m_data1 += (counts[i+6] << (5*i));
55  m_data1 += (counts[i+9] << (5*i + 16));
56  }
57  }
58 }
int i
Definition: DBlmapReader.cc:9
static const unsigned MAX_TOTAL_COUNTS
uint32_t m_data0
uint32_t m_data1
L1GctJetCounts::L1GctJetCounts ( const std::vector< unsigned > &  counts,
int16_t  bx 
)

Definition at line 61 of file L1GctJetCounts.cc.

References i, m_data0, m_data1, and MAX_TOTAL_COUNTS.

61  :
62  m_data0(0),
63  m_data1(0),
64  m_bx(bx)
65 {
66  if (counts.size() != MAX_TOTAL_COUNTS) { }
67  else {
68  for (unsigned int i=0; i<3; ++i) {
69  m_data0 += (counts[i] << (5*i));
70  m_data0 += (counts[i+3] << (5*i + 16));
71  m_data1 += (counts[i+6] << (5*i));
72  m_data1 += (counts[i+9] << (5*i + 16));
73  }
74  }
75 }
int i
Definition: DBlmapReader.cc:9
static const unsigned MAX_TOTAL_COUNTS
uint32_t m_data0
uint32_t m_data1
int16_t bx() const
get bunch-crossing index
L1GctJetCounts::~L1GctJetCounts ( )
virtual

destructor

Definition at line 78 of file L1GctJetCounts.cc.

79 {
80 
81 }

Member Function Documentation

int16_t L1GctJetCounts::bx ( ) const
inline

get bunch-crossing index

Definition at line 78 of file L1GctJetCounts.h.

References m_bx.

78 { return m_bx; }
unsigned L1GctJetCounts::count ( unsigned  i) const

get count by index

Definition at line 84 of file L1GctJetCounts.cc.

References m_data0, m_data1, and MAX_TOTAL_COUNTS.

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

85 {
86  if (i<6){ return ((m_data0 >> (i<3 ? (5*i) : ((5*i)+1))) & 0x1f); }
87  else if (i < MAX_TOTAL_COUNTS) { return ((m_data1 >> (i<9 ? ((5*i)-30) : ((5*i)-29))) & 0x1f); }
88  else { return 0; }
89 }
int i
Definition: DBlmapReader.cc:9
static const unsigned MAX_TOTAL_COUNTS
uint32_t m_data0
uint32_t m_data1
unsigned L1GctJetCounts::count00 ( ) const
inline

get individual counts (for use with FWLite)

Definition at line 64 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

64 { return (MAX_TRUE_COUNTS<1 ? 0 : count(0)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count01 ( ) const
inline

Definition at line 65 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

65 { return (MAX_TRUE_COUNTS<2 ? 0 : count(1)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count02 ( ) const
inline

Definition at line 66 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

66 { return (MAX_TRUE_COUNTS<3 ? 0 : count(2)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count03 ( ) const
inline

Definition at line 67 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

67 { return (MAX_TRUE_COUNTS<4 ? 0 : count(3)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count04 ( ) const
inline

Definition at line 68 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

68 { return (MAX_TRUE_COUNTS<5 ? 0 : count(4)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count05 ( ) const
inline

Definition at line 69 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

69 { return (MAX_TRUE_COUNTS<6 ? 0 : count(5)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count06 ( ) const
inline

Definition at line 70 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

70 { return (MAX_TRUE_COUNTS<7 ? 0 : count(6)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count07 ( ) const
inline

Definition at line 71 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

71 { return (MAX_TRUE_COUNTS<8 ? 0 : count(7)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count08 ( ) const
inline

Definition at line 72 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

72 { return (MAX_TRUE_COUNTS<9 ? 0 : count(8)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count09 ( ) const
inline

Definition at line 73 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

73 { return (MAX_TRUE_COUNTS<10 ? 0 : count(9)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count10 ( ) const
inline

Definition at line 74 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

74 { return (MAX_TRUE_COUNTS<11 ? 0 : count(10)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
unsigned L1GctJetCounts::count11 ( ) const
inline

Definition at line 75 of file L1GctJetCounts.h.

References count(), and MAX_TRUE_COUNTS.

75 { return (MAX_TRUE_COUNTS<12 ? 0 : count(11)); }
static const unsigned MAX_TRUE_COUNTS
unsigned count(unsigned i) const
get count by index
bool L1GctJetCounts::empty ( ) const
inline

empty method

Definition at line 52 of file L1GctJetCounts.h.

Referenced by Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().

52 { return false; }
std::string L1GctJetCounts::name ( ) const
inline
int L1GctJetCounts::operator!= ( const L1GctJetCounts c) const
inline

inequality operator

Definition at line 84 of file L1GctJetCounts.h.

References EnergyCorrector::c.

84 { return !(*this == c); }
int L1GctJetCounts::operator== ( const L1GctJetCounts c) const
inline

equality operator

Definition at line 81 of file L1GctJetCounts.h.

References m_data0, m_data1, raw0(), and raw1().

81 { return (m_data0==c.raw0() && m_data1==c.raw1()); }
uint32_t raw1() const
get raw word 1
uint32_t raw0() const
get raw word 0
uint32_t m_data0
uint32_t m_data1
uint32_t L1GctJetCounts::raw0 ( ) const
inline

get raw word 0

Definition at line 55 of file L1GctJetCounts.h.

References m_data0.

Referenced by operator==().

55 { return m_data0; }
uint32_t m_data0
uint32_t L1GctJetCounts::raw1 ( ) const
inline

get raw word 1

Definition at line 58 of file L1GctJetCounts.h.

References m_data1.

Referenced by operator==().

58 { return m_data1; }
uint32_t m_data1

Member Data Documentation

int16_t L1GctJetCounts::m_bx
private

Definition at line 90 of file L1GctJetCounts.h.

Referenced by bx().

uint32_t L1GctJetCounts::m_data0
private

Definition at line 88 of file L1GctJetCounts.h.

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

uint32_t L1GctJetCounts::m_data1
private

Definition at line 89 of file L1GctJetCounts.h.

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

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 24 of file L1GctJetCounts.h.

Referenced by count(), and L1GctJetCounts().

const unsigned L1GctJetCounts::MAX_TRUE_COUNTS =6
static

MAX_TRUE_COUNTS specifies the bandwidth remaining for real jet count information.

Definition at line 25 of file L1GctJetCounts.h.

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