Belle II Software development
CDCChannelData.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
11namespace Belle2 {
17 namespace CDC {
18
19
27 public:
28
30 m_adc(0), m_tdc(0), m_tdc2(0), m_f2ndHit(false) {}
31
32
37 inline CDCChannelData(int board, int ch, int len, int tot,
38 int adc, int tdc, int tdc2)
39 {
40 m_board = board;
41 m_channel = ch;
42 m_length = len;
43 m_tot = tot;
44 m_adc = adc;
45 m_tdc = tdc;
46 m_tdc2 = tdc2;
47 m_f2ndHit = true;
48 }
49
53 inline CDCChannelData(int board, int ch, int len, int tot,
54 int adc, int tdc)
55 {
56 m_board = board;
57 m_channel = ch;
58 m_length = len;
59 m_tot = tot;
60 m_adc = adc;
61 m_tdc = tdc;
62 m_tdc2 = 0;
63 m_f2ndHit = false;
64 }
65
69 inline void setTDC2ndHit(int tdc)
70 {
71 m_length += 2;
72 m_tdc2 = tdc;
73 m_f2ndHit = true;
74 }
78 inline unsigned short getChannel() const
79 {
80 return m_channel;
81 }
82
86 inline unsigned short getBoard() const
87 {
88 return m_board;
89 }
90
91
95 inline unsigned short getTDCCount() const
96 {
97 return m_tdc;
98 }
99
103 inline unsigned short getTDCCount2ndHit() const
104 {
105 return m_tdc2;
106 }
107
111 inline unsigned short getADCCount() const
112 {
113 return m_adc;
114 }
115
120 inline bool is2ndHit() const
121 {
122 return m_f2ndHit;
123 }
124
128 inline unsigned short getDataLength() const
129 {
130 return m_length;
131 }
132
136 inline unsigned short getTOT() const
137 {
138 return m_tot;
139 }
140
141 private:
142
146 unsigned short m_board;
147
151 unsigned short m_channel;
152
156 unsigned short m_length;
157
161 unsigned short m_tot;
162
166 unsigned short m_adc;
167
171 unsigned short m_tdc;
172
176 unsigned short m_tdc2;
177
182 };
183
184
185 } //end CDC namespace;
187} // end namespace Belle2
unsigned short m_length
Data length.
unsigned short getChannel() const
Get the channel ID.
CDCChannelData(int board, int ch, int len, int tot, int adc, int tdc)
Constructor of the class fo the "1 hit" event.
unsigned short m_tdc2
TDC count of 2nd hit.
bool is2ndHit() const
Get the flag of 2nd hit.
unsigned short m_tdc
TDC count.
unsigned short m_adc
FADC count.
void setTDC2ndHit(int tdc)
Set 2nd hit timing.
unsigned short m_channel
Channel ID (0-47).
unsigned short getTDCCount2ndHit() const
Get the 2nd TDC.
unsigned short getTDCCount() const
Get the TDC.
unsigned short getBoard() const
Get the board ID.
unsigned short getDataLength() const
Get data length.
unsigned short getADCCount() const
Get the ADC.
bool m_f2ndHit
Flag for 2nd hit.
unsigned short getTOT() const
Get time over threshold.
unsigned short m_tot
Time over threshold.
unsigned short m_board
Board ID (0-300).
CDCChannelData(int board, int ch, int len, int tot, int adc, int tdc, int tdc2)
Constructor of the class fo the "2 hits" event.
Abstract base class for different kinds of events.