CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1CaloEmCand.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 
5 using std::dec;
6 using std::endl;
7 using std::hex;
8 using std::ostream;
9 
10 // default constructor
11 L1CaloEmCand::L1CaloEmCand() : m_data(0), m_rctCrate(0), m_iso(false), m_index(0), m_bx(0) {}
12 
13 // construct from raw data (for use in unpacking)
14 // last bool argument is a hack to distinguish this constructor from the next one!
15 L1CaloEmCand::L1CaloEmCand(uint16_t data, unsigned crate, bool iso)
16  : m_data(data), m_rctCrate(crate), m_iso(iso), m_index(0), m_bx(0) {}
17 
18 // construct from raw data (for use in unpacking)
19 // last bool argument is a hack to distinguish this constructor from the next one!
20 L1CaloEmCand::L1CaloEmCand(uint16_t data, unsigned crate, bool iso, uint16_t index, int16_t bx, bool dummy)
21  : m_data(data), m_rctCrate(crate), m_iso(iso), m_index(index), m_bx(bx) {}
22 
23 // construct from content (for use in emulator)
24 L1CaloEmCand::L1CaloEmCand(unsigned rank, unsigned region, unsigned card, unsigned crate, bool iso)
25  : m_data(0), // over-ridden below
26  m_rctCrate(crate),
27  m_iso(iso),
28  m_index(0),
29  m_bx(0)
30 
31 {
32  m_data = (rank & 0x3f) + ((region & 0x1) << 6) + ((card & 0x7) << 7);
33 }
34 
35 // construct from content (for use in emulator)
37  unsigned rank, unsigned region, unsigned card, unsigned crate, bool iso, uint16_t index, int16_t bx)
38  : m_data(0), // over-ridden below
39  m_rctCrate(crate),
40  m_iso(iso),
41  m_index(index),
42  m_bx(bx) {
43  m_data = (rank & 0x3f) + ((region & 0x1) << 6) + ((card & 0x7) << 7);
44 }
45 
46 // destructor
48 
49 void L1CaloEmCand::setBx(int16_t bx) { m_bx = bx; }
50 
51 // pretty print
52 ostream& operator<<(ostream& s, const L1CaloEmCand& cand) {
53  s << "L1CaloEmCand : ";
54  s << "rank=" << cand.rank();
55  s << ", region=" << cand.rctRegion() << ", card=" << cand.rctCard() << ", crate=" << cand.rctCrate();
56  s << ", iso=" << cand.isolated();
57  s << ", index=" << cand.index() << ", BX=" << cand.bx();
58  return s;
59 }
m_index(idict.size(), 1)
void setBx(int16_t bx)
set BX
Definition: L1CaloEmCand.cc:49
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:17
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
L1CaloEmCand()
default constructor (for vector initialisation etc.)
Definition: L1CaloEmCand.cc:11
~L1CaloEmCand()
destructor
Definition: L1CaloEmCand.cc:47
unsigned rctCrate() const
get RCT crate
Definition: L1CaloEmCand.h:51
bool isolated() const
which stream did this come from
Definition: L1CaloEmCand.h:54
int16_t bx() const
get bunch-crossing index
Definition: L1CaloEmCand.h:60
int16_t m_bx
Definition: L1CaloEmCand.h:90
unsigned rank() const
get rank bits
Definition: L1CaloEmCand.h:42
unsigned rctCard() const
get RCT receiver card
Definition: L1CaloEmCand.h:45
uint16_t m_data
Definition: L1CaloEmCand.h:83
unsigned index() const
get index on cable
Definition: L1CaloEmCand.h:57
unsigned rctRegion() const
get RCT region ID
Definition: L1CaloEmCand.h:48
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79