1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#ifndef L1GCTETHAD_H
#define L1GCTETHAD_H
#include <ostream>
#include <cstdint>
/*! \file L1GctEtHad.h
* \Header file for the GCT energy sum output
*
* \author: Jim Brooke
*
*/
/// \class L1GctEtHad
/// \brief Persistable copy of total Ht measured at Level-1
class L1GctEtHad {
public:
enum numberOfBits {
kEtHadNBits = 12,
kEtHadOFlowBit = 1 << kEtHadNBits,
kEtHadMaxValue = kEtHadOFlowBit - 1,
kRawCtorMask = kEtHadOFlowBit | kEtHadMaxValue
};
L1GctEtHad();
L1GctEtHad(uint16_t rawData);
L1GctEtHad(uint16_t rawData, int16_t bx);
L1GctEtHad(unsigned et, bool oflow);
L1GctEtHad(unsigned et, bool oflow, int16_t bx);
virtual ~L1GctEtHad();
/// name method
std::string name() const { return "EtHad"; }
/// empty method (= false; hadronic Et is always calculated)
bool empty() const { return false; }
/// get the data
uint16_t raw() const { return m_data; }
/// get the Et
unsigned et() const { return m_data & kEtHadMaxValue; }
/// get the overflow
bool overFlow() const { return (m_data & kEtHadOFlowBit) != 0; }
/// get bunch-crossing index
int16_t bx() const { return m_bx; }
/// equality operator
int operator==(const L1GctEtHad& e) const { return m_data == e.raw(); }
/// inequality operator
int operator!=(const L1GctEtHad& e) const { return m_data != e.raw(); }
private:
uint16_t m_data;
int16_t m_bx;
};
/// Pretty-print operator for L1GctEtHad
std::ostream& operator<<(std::ostream& s, const L1GctEtHad& c);
#endif
|