Belle II Software development
KLMDigitRaw.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11/* Basf2 headers. */
12#include <framework/datastore/RelationsObject.h>
13
14/* KLM headers. */
15#include <klm/rawdata/RawData.h>
16
17/* C++ headers. */
18#include <cstdint>
19
20namespace Belle2 {
30
31 public:
32
37 m_Copper(0),
38 m_Slot(0),
39 m_word1(0),
40 m_word2(0),
41 m_word3(0),
42 m_word4(0)
43 {
44 }
45
49 KLMDigitRaw(int copper, int slot, uint16_t word1, uint16_t word2,
50 uint16_t word3, uint16_t word4):
51 m_Copper(copper),
52 m_Slot(slot),
53 m_word1(word1),
54 m_word2(word2),
55 m_word3(word3),
56 m_word4(word4)
57 {
58 }
59
63 int getCopper() const
64 {
65 return m_Copper;
66 }
67
71 int getSlot() const
72 {
73 return m_Slot;
74 }
75
79 uint16_t getWord1() const
80 {
81 return m_word1;
82 }
83
87 uint16_t getWord2() const
88 {
89 return m_word2;
90 }
91
95 uint16_t getWord3() const
96 {
97 return m_word3;
98 }
99
103 uint16_t getWord4() const
104 {
105 return m_word4;
106 }
107
111 uint16_t getChannel() const
112 {
114 }
115
119 uint16_t getAxis() const
120 {
122 }
123
127 uint16_t getLane() const
128 {
130 }
131
135 uint16_t getFlag() const
136 {
137 return m_word1 >> 13;
138 }
139
143 uint16_t getCtime() const
144 {
146 }
147
151 uint16_t getTdc()
152 {
154 }
155
159 uint16_t getTriggerBits()
160 {
162 }
163
167 uint16_t getCharge()
168 {
170 }
171
175 uint16_t getUnusedBits()
176 {
177 return m_word4 >> 12;
178 }
179
180 private:
181
184
187
189 uint16_t m_word1;
190
192 uint16_t m_word2;
193
195 uint16_t m_word3;
196
198 uint16_t m_word4;
199
202
203 };
204
206}
Class to store the raw words from the unpacker, digit-by-digit.
Definition: KLMDigitRaw.h:29
int getSlot() const
Get slot number.
Definition: KLMDigitRaw.h:71
int getCopper() const
Get copper identifier.
Definition: KLMDigitRaw.h:63
int m_Copper
Copper identifier.
Definition: KLMDigitRaw.h:183
uint16_t getTdc()
Get TDC.
Definition: KLMDigitRaw.h:151
KLMDigitRaw()
Default constructor.
Definition: KLMDigitRaw.h:36
uint16_t getTriggerBits()
Get trigger bits.
Definition: KLMDigitRaw.h:159
uint16_t m_word3
Third (of four) raw-data words (contains lane number).
Definition: KLMDigitRaw.h:195
uint16_t getWord1() const
Get the first (of four) raw words.
Definition: KLMDigitRaw.h:79
uint16_t getFlag() const
Get the status flag.
Definition: KLMDigitRaw.h:135
uint16_t getWord3() const
Get the third (of four) raw words.
Definition: KLMDigitRaw.h:95
KLMDigitRaw(int copper, int slot, uint16_t word1, uint16_t word2, uint16_t word3, uint16_t word4)
Explicit constructor.
Definition: KLMDigitRaw.h:49
uint16_t getUnusedBits()
Get unused bits from the fourth word.
Definition: KLMDigitRaw.h:175
uint16_t getWord2() const
Get the second (of four) raw words.
Definition: KLMDigitRaw.h:87
int m_Slot
Slot number.
Definition: KLMDigitRaw.h:186
uint16_t m_word2
Second (of four) raw-data words (contains view/axis/plane).
Definition: KLMDigitRaw.h:192
uint16_t getChannel() const
Get the channel number.
Definition: KLMDigitRaw.h:111
uint16_t getWord4() const
Get the fourth (of four) raw words.
Definition: KLMDigitRaw.h:103
ClassDef(KLMDigitRaw, 2)
Class version.
uint16_t getLane() const
Get the lane number.
Definition: KLMDigitRaw.h:127
uint16_t getCharge()
Get charge.
Definition: KLMDigitRaw.h:167
uint16_t m_word4
Fourth (of four) raw-data words (contains status flag).
Definition: KLMDigitRaw.h:198
uint16_t getCtime() const
Get CTIME.
Definition: KLMDigitRaw.h:143
uint16_t m_word1
First (of four) raw-data words (contains channel number).
Definition: KLMDigitRaw.h:189
uint16_t getAxis() const
Get the view (= axis = plane) number.
Definition: KLMDigitRaw.h:119
static uint16_t unpackTDC(uint16_t raw)
Unpack TDC.
Definition: RawData.h:217
static uint16_t unpackChannel(uint16_t raw)
Unpack channel.
Definition: RawData.h:190
static uint16_t unpackCharge(uint16_t raw)
Unpack charge.
Definition: RawData.h:225
static uint16_t unpackCTime(uint16_t raw)
Unpack CTIME.
Definition: RawData.h:199
static uint16_t unpackLane(uint16_t raw)
Unpack lane.
Definition: RawData.h:172
static uint16_t unpackTriggerBits(uint16_t raw)
Unpack trigger bits.
Definition: RawData.h:208
static uint16_t unpackAxis(uint16_t raw)
Unpack axis.
Definition: RawData.h:181
Defines interface for accessing relations of objects in StoreArray.
Abstract base class for different kinds of events.