CMS 3D CMS Logo

HcalUHTRData.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 #ifndef HcalUHTRData_H
3 #define HcalUHTRData_H
4 
5 #include <cstdint>
6 
16 class HcalUHTRData {
17 public:
18  static const int FIBERS_PER_UHTR = 24;
19  static const int CHANNELS_PER_FIBER_HF = 4;
20  static const int CHANNELS_PER_FIBER_HBHE = 6;
21  static const int CHANNELS_PER_FIBER_MAX = 8;
22 
23  HcalUHTRData();
25  if (m_ownData != nullptr)
26  delete[] m_ownData;
27  }
28  HcalUHTRData(int version_to_create);
29  HcalUHTRData(const uint64_t* data, int length_words);
30  HcalUHTRData(const HcalUHTRData&);
31 
33 
35  inline int getFormatVersion() const { return m_formatVersion; }
36 
38  inline const unsigned short* getRawData16() const { return m_raw16; }
39 
41  inline const int getRawLengthBytes() const { return m_rawLength64 * sizeof(uint64_t); }
42 
44  public:
45  const_iterator(const uint16_t* ptr, const uint16_t* limit = nullptr);
46 
47  bool isHeader() const { return ((*m_ptr) & 0x8000) != 0; }
48  int flavor() const { return ((*m_ptr) >> 12) & 0x7; }
49  int errFlags() const;
50  bool dataValid() const;
51  int capid0() const { return ((*m_ptr) >> 8) & 0x3; }
52  int channelid() const { return ((*m_ptr)) & 0xFF; }
53  int technicalDataType() const;
54 
55  uint16_t value() const { return *m_ptr; }
56 
57  uint8_t adc() const;
58  uint8_t le_tdc() const;
59  uint8_t te_tdc() const;
60  bool soi() const;
61  uint8_t capid() const;
62  bool ok() const;
63 
64  uint16_t operator*() const { return *m_ptr; }
65 
68 
69  bool operator==(const const_iterator& i) { return m_ptr == i.m_ptr; }
70  bool operator!=(const const_iterator& i) { return m_ptr != i.m_ptr; }
71  const uint16_t* raw() const { return m_ptr; }
72 
73  private:
74  void determineMode();
75  const uint16_t *m_ptr, *m_limit;
76  const uint16_t *m_header_ptr, *m_0th_data_ptr;
79  int m_flavor;
81  };
82 
83  const_iterator begin() const;
84  const_iterator end() const;
85 
87  inline uint32_t l1ANumber() const { return uint32_t(m_raw64[0] >> 32) & 0xFFFFFF; }
89  inline uint32_t bunchNumber() const { return uint32_t(m_raw64[0] >> 20) & 0xFFF; }
91  inline uint32_t orbitNumber() const { return uint32_t(m_raw64[1] >> 16) & 0xFFFF; }
93  int getEventType() const { return uint32_t(m_raw64[1] >> 40) & 0xF; }
95  inline uint32_t boardId() const { return uint32_t(m_raw64[1]) & 0xFFFF; }
97  inline uint32_t crateId() const { return uint32_t(m_raw64[1]) & 0xFF; }
99  inline uint32_t slot() const { return uint32_t(m_raw64[1] >> 8) & 0xF; }
101  inline uint32_t presamples() const { return uint32_t(m_raw64[1] >> 12) & 0xF; }
102 
104  bool wasMarkAndPassZS(int fiber, int fiberchan) const;
106  bool wasMarkAndPassZSTP(int slb, int slbchan) const;
107 
109  unsigned int getFirmwareRevision() const { return uint32_t(m_raw64[1] >> 48) & 0xFFFF; }
111  int getFirmwareFlavor() const { return uint32_t(m_raw64[1] >> 32) & 0xFF; }
112 
113 protected:
117  const uint16_t* m_raw16;
119 };
120 
121 #endif
HcalUHTRData::const_iterator::m_0th_data_ptr
const uint16_t * m_0th_data_ptr
Definition: HcalUHTRData.h:76
HcalUHTRData::CHANNELS_PER_FIBER_MAX
static const int CHANNELS_PER_FIBER_MAX
Definition: HcalUHTRData.h:21
mps_fire.i
i
Definition: mps_fire.py:355
HcalUHTRData::m_raw64
const uint64_t * m_raw64
Definition: HcalUHTRData.h:116
HcalUHTRData::const_iterator::te_tdc
uint8_t te_tdc() const
Definition: HcalUHTRData.cc:104
HcalUHTRData::m_rawLength64
int m_rawLength64
Definition: HcalUHTRData.h:115
HcalUHTRData::const_iterator::raw
const uint16_t * raw() const
Definition: HcalUHTRData.h:71
HcalUHTRData::m_ownData
uint64_t * m_ownData
Definition: HcalUHTRData.h:118
HcalUHTRData::const_iterator::determineMode
void determineMode()
Definition: HcalUHTRData.cc:40
HcalUHTRData::const_iterator::dataValid
bool dataValid() const
Definition: HcalUHTRData.cc:63
HcalUHTRData::const_iterator::const_iterator
const_iterator(const uint16_t *ptr, const uint16_t *limit=nullptr)
Definition: HcalUHTRData.cc:6
HcalUHTRData::m_raw16
const uint16_t * m_raw16
Definition: HcalUHTRData.h:117
HcalUHTRData::l1ANumber
uint32_t l1ANumber() const
Get the HTR event number.
Definition: HcalUHTRData.h:87
HcalUHTRData::const_iterator::capid
uint8_t capid() const
Definition: HcalUHTRData.cc:111
HcalUHTRData::presamples
uint32_t presamples() const
Get the presamples.
Definition: HcalUHTRData.h:101
HcalUHTRData::const_iterator::capid0
int capid0() const
Definition: HcalUHTRData.h:51
HcalUHTRData::const_iterator::isHeader
bool isHeader() const
Definition: HcalUHTRData.h:47
slb
static int slb(const HcalTriggerPrimitiveSample &theSample)
Definition: CastorUnpacker.cc:71
HcalUHTRData::getRawData16
const unsigned short * getRawData16() const
Get a pointer to the raw data.
Definition: HcalUHTRData.h:38
HcalUHTRData::const_iterator::operator++
const_iterator & operator++()
Definition: HcalUHTRData.cc:12
HcalUHTRData::const_iterator::m_limit
const uint16_t * m_limit
Definition: HcalUHTRData.h:75
HcalUHTRData::orbitNumber
uint32_t orbitNumber() const
Get the HTR orbit number.
Definition: HcalUHTRData.h:91
HcalUHTRData::slot
uint32_t slot() const
Get the board slot.
Definition: HcalUHTRData.h:99
HcalUHTRData::boardId
uint32_t boardId() const
Get the raw board id.
Definition: HcalUHTRData.h:95
HcalUHTRData::const_iterator::value
uint16_t value() const
Definition: HcalUHTRData.h:55
HcalUHTRData::crateId
uint32_t crateId() const
Get the board crate.
Definition: HcalUHTRData.h:97
HcalUHTRData::const_iterator::m_ptr
const uint16_t * m_ptr
Definition: HcalUHTRData.h:75
HcalUHTRData::~HcalUHTRData
~HcalUHTRData()
Definition: HcalUHTRData.h:24
HcalUHTRData::getFirmwareRevision
unsigned int getFirmwareRevision() const
Get the HTR firmware version.
Definition: HcalUHTRData.h:109
HcalUHTRData::const_iterator::operator!=
bool operator!=(const const_iterator &i)
Definition: HcalUHTRData.h:70
HcalUHTRData::const_iterator::operator==
bool operator==(const const_iterator &i)
Definition: HcalUHTRData.h:69
HcalUHTRData::const_iterator::channelid
int channelid() const
Definition: HcalUHTRData.h:52
HcalUHTRData
Definition: HcalUHTRData.h:16
HcalUHTRData::getRawLengthBytes
const int getRawLengthBytes() const
Get the length of the raw data.
Definition: HcalUHTRData.h:41
HcalUHTRData::end
const_iterator end() const
Definition: HcalUHTRData.cc:141
HcalUHTRData::CHANNELS_PER_FIBER_HF
static const int CHANNELS_PER_FIBER_HF
Definition: HcalUHTRData.h:19
HcalUHTRData::const_iterator::adc
uint8_t adc() const
Definition: HcalUHTRData.cc:77
HcalUHTRData::HcalUHTRData
HcalUHTRData()
Definition: HcalUHTRData.cc:146
HcalUHTRData::begin
const_iterator begin() const
Definition: HcalUHTRData.cc:136
HcalUHTRData::const_iterator::operator*
uint16_t operator*() const
Definition: HcalUHTRData.h:64
HcalUHTRData::const_iterator::soi
bool soi() const
Definition: HcalUHTRData.cc:95
HcalUHTRData::CHANNELS_PER_FIBER_HBHE
static const int CHANNELS_PER_FIBER_HBHE
Definition: HcalUHTRData.h:20
HcalUHTRData::wasMarkAndPassZSTP
bool wasMarkAndPassZSTP(int slb, int slbchan) const
Was this channel passed as part of Mark&Pass ZS?
HcalUHTRData::const_iterator
Definition: HcalUHTRData.h:43
HcalUHTRData::const_iterator::flavor
int flavor() const
Definition: HcalUHTRData.h:48
HcalUHTRData::getFormatVersion
int getFormatVersion() const
Get the version number of this event.
Definition: HcalUHTRData.h:35
HcalUHTRData::bunchNumber
uint32_t bunchNumber() const
Get the HTR bunch number.
Definition: HcalUHTRData.h:89
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
HcalUHTRData::getFirmwareFlavor
int getFirmwareFlavor() const
Get the HTR firmware flavor.
Definition: HcalUHTRData.h:111
HcalUHTRData::FIBERS_PER_UHTR
static const int FIBERS_PER_UHTR
Definition: HcalUHTRData.h:18
HcalUHTRData::getEventType
int getEventType() const
Get the event type.
Definition: HcalUHTRData.h:93
HcalUHTRData::const_iterator::errFlags
int errFlags() const
Definition: HcalUHTRData.cc:56
HcalUHTRData::operator=
HcalUHTRData & operator=(const HcalUHTRData &)
Definition: HcalUHTRData.cc:173
HcalUHTRData::const_iterator::m_microstep
int m_microstep
Definition: HcalUHTRData.h:77
HcalUHTRData::const_iterator::m_technicalDataType
int m_technicalDataType
Definition: HcalUHTRData.h:80
HcalUHTRData::const_iterator::ok
bool ok() const
Definition: HcalUHTRData.cc:126
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
HcalUHTRData::wasMarkAndPassZS
bool wasMarkAndPassZS(int fiber, int fiberchan) const
Was this channel passed as part of Mark&Pass ZS?
HcalUHTRData::const_iterator::m_stepclass
int m_stepclass
Definition: HcalUHTRData.h:78
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
HcalUHTRData::m_formatVersion
int m_formatVersion
Definition: HcalUHTRData.h:114
HcalUHTRData::const_iterator::technicalDataType
int technicalDataType() const
Definition: HcalUHTRData.cc:70
HcalUHTRData::const_iterator::m_flavor
int m_flavor
Definition: HcalUHTRData.h:79
HcalUHTRData::const_iterator::le_tdc
uint8_t le_tdc() const
Definition: HcalUHTRData.cc:86
HcalUHTRData::const_iterator::m_header_ptr
const uint16_t * m_header_ptr
Definition: HcalUHTRData.h:76