Belle II Software  release-05-02-19
KLMDigitRaw.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Giacomo De Pietro *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 /* Belle 2 headers. */
14 #include <framework/datastore/RelationsObject.h>
15 
16 /* KLM headers. */
17 #include <klm/rawdata/RawData.h>
18 
19 /* C++ headers. */
20 #include <cstdint>
21 
22 namespace Belle2 {
31  class KLMDigitRaw : public RelationsObject {
32 
33  public:
34 
38  KLMDigitRaw():
40  m_Slot(0),
41  m_word1(0),
42  m_word2(0),
43  m_word3(0),
44  m_word4(0)
45  {
46  }
47 
51  KLMDigitRaw(int copper, int slot, uint16_t word1, uint16_t word2,
52  uint16_t word3, uint16_t word4):
53  m_Copper(copper),
54  m_Slot(slot),
55  m_word1(word1),
56  m_word2(word2),
57  m_word3(word3),
58  m_word4(word4)
59  {
60  }
61 
65  int getCopper() const
66  {
67  return m_Copper;
68  }
69 
73  int getSlot() const
74  {
75  return m_Slot;
76  }
77 
81  uint16_t getWord1() const
82  {
83  return m_word1;
84  }
85 
89  uint16_t getWord2() const
90  {
91  return m_word2;
92  }
93 
97  uint16_t getWord3() const
98  {
99  return m_word3;
100  }
101 
105  uint16_t getWord4() const
106  {
107  return m_word4;
108  }
109 
113  uint16_t getChannel() const
114  {
116  }
117 
121  uint16_t getAxis() const
122  {
124  }
125 
129  uint16_t getLane() const
130  {
132  }
133 
137  uint16_t getFlag() const
138  {
139  return m_word1 >> 13;
140  }
141 
145  uint16_t getCtime() const
146  {
148  }
149 
153  uint16_t getTdc()
154  {
156  }
157 
161  uint16_t getTriggerBits()
162  {
164  }
165 
169  uint16_t getCharge()
170  {
172  }
173 
177  uint16_t getUnusedBits()
178  {
179  return m_word4 >> 12;
180  }
181 
182  private:
183 
185  int m_Copper;
186 
188  int m_Slot;
189 
191  uint16_t m_word1;
192 
194  uint16_t m_word2;
195 
197  uint16_t m_word3;
198 
200  uint16_t m_word4;
201 
203  ClassDef(KLMDigitRaw, 2);
204 
205  };
206 
208 }
Belle2::KLM::RawData::unpackTriggerBits
static uint16_t unpackTriggerBits(uint16_t raw)
Unpack trigger bits.
Definition: RawData.h:190
Belle2::KLMDigitRaw::getChannel
uint16_t getChannel() const
Get the channel number.
Definition: KLMDigitRaw.h:121
Belle2::KLMDigitRaw::getCopper
int getCopper() const
Get copper identifier.
Definition: KLMDigitRaw.h:73
Belle2::KLMDigitRaw::m_word3
uint16_t m_word3
Third (of four) raw-data words (contains lane number).
Definition: KLMDigitRaw.h:205
Belle2::KLMDigitRaw::getTriggerBits
uint16_t getTriggerBits()
Get trigger bits.
Definition: KLMDigitRaw.h:169
Belle2::KLMDigitRaw::m_word2
uint16_t m_word2
Second (of four) raw-data words (contains view/axis/plane).
Definition: KLMDigitRaw.h:202
Belle2::KLMDigitRaw::getCharge
uint16_t getCharge()
Get charge.
Definition: KLMDigitRaw.h:177
Belle2::KLM::RawData::unpackLane
static uint16_t unpackLane(uint16_t raw)
Unpack lane.
Definition: RawData.h:154
Belle2::KLMDigitRaw::getWord1
uint16_t getWord1() const
Get the first (of four) raw words.
Definition: KLMDigitRaw.h:89
Belle2::KLMDigitRaw::getLane
uint16_t getLane() const
Get the lane number.
Definition: KLMDigitRaw.h:137
Belle2::KLMDigitRaw::getTdc
uint16_t getTdc()
Get TDC.
Definition: KLMDigitRaw.h:161
Belle2::KLM::RawData::unpackTDC
static uint16_t unpackTDC(uint16_t raw)
Unpack TDC.
Definition: RawData.h:199
Belle2::KLMDigitRaw::getWord4
uint16_t getWord4() const
Get the fourth (of four) raw words.
Definition: KLMDigitRaw.h:113
Belle2::KLMDigitRaw::getAxis
uint16_t getAxis() const
Get the view (= axis = plane) number.
Definition: KLMDigitRaw.h:129
Belle2::KLMDigitRaw::m_word4
uint16_t m_word4
Fourth (of four) raw-data words (contains status flag).
Definition: KLMDigitRaw.h:208
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::KLMDigitRaw::ClassDef
ClassDef(KLMDigitRaw, 2)
Class version.
Belle2::KLM::RawData::unpackChannel
static uint16_t unpackChannel(uint16_t raw)
Unpack channel.
Definition: RawData.h:172
Belle2::KLMDigitRaw::getWord2
uint16_t getWord2() const
Get the second (of four) raw words.
Definition: KLMDigitRaw.h:97
Belle2::KLMDigitRaw
Class to store the raw words from the unpacker, digit-by-digit.
Definition: KLMDigitRaw.h:39
Belle2::KLMDigitRaw::getUnusedBits
uint16_t getUnusedBits()
Get unused bits from the fourth word.
Definition: KLMDigitRaw.h:185
Belle2::KLMDigitRaw::getSlot
int getSlot() const
Get slot number.
Definition: KLMDigitRaw.h:81
Belle2::KLM::RawData::unpackCTime
static uint16_t unpackCTime(uint16_t raw)
Unpack CTIME.
Definition: RawData.h:181
Belle2::KLMDigitRaw::getFlag
uint16_t getFlag() const
Get the status flag.
Definition: KLMDigitRaw.h:145
Belle2::KLMDigitRaw::getCtime
uint16_t getCtime() const
Get CTIME.
Definition: KLMDigitRaw.h:153
Belle2::KLMDigitRaw::KLMDigitRaw
KLMDigitRaw()
Default constructor.
Definition: KLMDigitRaw.h:46
Belle2::KLM::RawData::unpackCharge
static uint16_t unpackCharge(uint16_t raw)
Unpack charge.
Definition: RawData.h:207
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::KLMDigitRaw::m_Copper
int m_Copper
Copper identifier.
Definition: KLMDigitRaw.h:193
Belle2::KLM::RawData::unpackAxis
static uint16_t unpackAxis(uint16_t raw)
Unpack axis.
Definition: RawData.h:163
Belle2::KLMDigitRaw::m_Slot
int m_Slot
Slot number.
Definition: KLMDigitRaw.h:196
Belle2::KLMDigitRaw::m_word1
uint16_t m_word1
First (of four) raw-data words (contains channel number).
Definition: KLMDigitRaw.h:199
Belle2::KLMDigitRaw::getWord3
uint16_t getWord3() const
Get the third (of four) raw words.
Definition: KLMDigitRaw.h:105