CMS 3D CMS Logo

L1GctInternEmCand.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 
6 
7 using std::dec;
8 using std::hex;
9 using std::ostream;
10 using std::string;
11 
12 // default constructor
13 L1GctInternEmCand::L1GctInternEmCand() : m_data(0), m_captureBlock(0), m_captureIndex(0), m_iso(false), m_bx(0) {}
14 
15 // construct from raw data (for use in unpacking)
16 L1GctInternEmCand::L1GctInternEmCand(uint16_t data, bool iso, unsigned block, unsigned index, int16_t bx)
17  : m_data(data), m_captureBlock(block & 0xfff), m_captureIndex(index & 0xff), m_iso(iso), m_bx(bx) {}
18 
19 // construct from eta/phi etc
21  unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi, bool iso, unsigned block, unsigned index, int16_t bx)
22  : m_data(0), // Over-ridden in construct()
23  m_captureBlock(block & 0xfff),
24  m_captureIndex(index & 0xff),
25  m_iso(iso),
26  m_bx(bx) {
27  construct(rank, eta, etaSgn, phi);
28 }
29 
30 // destructor
32 
33 // name of candidate type
34 string L1GctInternEmCand::name() const { return (isolated() ? "iso EM" : "non iso EM"); }
35 
36 // was a candidate found
37 bool L1GctInternEmCand::empty() const { return (rank() == 0); }
38 
39 // pretty print
40 ostream& operator<<(ostream& s, const L1GctInternEmCand& cand) {
41  s << "L1GctInternEmCand : ";
42  s << "rank=" << cand.rank();
43  s << ", etaSign=" << cand.etaSign() << ", eta=" << (cand.etaIndex() & 0xf) << ", phi=" << cand.phiIndex();
44  s << ", iso=" << cand.isolated();
45  s << " cap block=" << hex << cand.capBlock();
46  s << ", index=" << dec << cand.capIndex() << ", BX=" << cand.bx();
47  return s;
48 }
49 
50 // return region object
52  // get global eta
53  unsigned eta = (etaSign() == 1 ? 10 - (etaIndex() & 0xf) : 11 + (etaIndex() & 0xf));
54  return L1CaloRegionDetId(eta, phiIndex());
55 }
56 
57 // construct from rank, eta, phi
58 void L1GctInternEmCand::construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi) {
59  m_data = (rank & 0x3f) + ((eta & 0xf) << 6) + ((etaSgn & 0x1) << 10) + ((phi & 0x1f) << 11);
60 }
L1GctInternEmCand::regionId
L1CaloRegionDetId regionId() const
region associated with the candidate
Definition: L1GctInternEmCand.cc:51
funct::false
false
Definition: Factorize.h:29
L1GctInternEmCand::~L1GctInternEmCand
virtual ~L1GctInternEmCand()
destructor (virtual to prevent compiler warnings)
Definition: L1GctInternEmCand.cc:31
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1GctInternEmCand::name
std::string name() const
name of object
Definition: L1GctInternEmCand.cc:34
L1CaloRegionDetId
Definition: L1CaloRegionDetId.h:18
PVValHelper::eta
Definition: PVValidationHelpers.h:70
L1GctInternEmCand::isolated
bool isolated() const
which stream did this come from
Definition: L1GctInternEmCand.h:58
L1GctInternEmCand
Definition: L1GctInternEmCand.h:18
L1GctInternEmCand::construct
void construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi)
Definition: L1GctInternEmCand.cc:58
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1CaloRegionDetId.h
PVValHelper::phi
Definition: PVValidationHelpers.h:69
L1GctInternEmCand::rank
unsigned rank() const
get rank bits
Definition: L1GctInternEmCand.h:46
cand
Definition: decayParser.h:32
L1GctInternEmCand::empty
bool empty() const
was an object really found?
Definition: L1GctInternEmCand.cc:37
groupFilesInBlocks.block
block
Definition: groupFilesInBlocks.py:150
L1GctInternEmCand::phiIndex
unsigned phiIndex() const
get phi index (0-17)
Definition: L1GctInternEmCand.h:55
L1GctInternEmCand::etaSign
unsigned etaSign() const
get eta sign (1 for -ve Z, 0 for +ve Z)
Definition: L1GctInternEmCand.h:52
DDAxes::phi
L1GctInternEmCand::etaIndex
unsigned etaIndex() const
get eta index - Barrel 1:4, Endcap 5:7, HF 8:11
Definition: L1GctInternEmCand.h:49
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1GctInternEmCand::L1GctInternEmCand
L1GctInternEmCand()
default constructor (for vector initialisation etc.)
Definition: L1GctInternEmCand.cc:13
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
L1GctInternEmCand.h
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
L1GctInternEmCand::m_data
uint16_t m_data
Definition: L1GctInternEmCand.h:84
operator<<
ostream & operator<<(ostream &s, const L1GctInternEmCand &cand)
Definition: L1GctInternEmCand.cc:40