Belle II Software development
KLMDigit.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/* KLM headers. */
12#include <klm/dataobjects/bklm/BKLMElementNumbers.h>
13#include <klm/dataobjects/KLMElementNumbers.h>
14#include <klm/dataobjects/KLMScintillatorFirmwareFitResult.h>
15#include <klm/dataobjects/KLMSimHit.h>
16
17/* Basf2 headers. */
18#include <framework/dataobjects/DigitBase.h>
19
20namespace Belle2 {
29 class KLMDigit : public DigitBase {
30
31 public:
32
36 KLMDigit();
37
42 explicit KLMDigit(const KLMSimHit* simHit);
43
49 KLMDigit(const KLMSimHit* simHit, int strip);
50
55 {
56 }
57
61 unsigned int getUniqueChannelID() const override;
62
66 EAppendStatus addBGDigit(const DigitBase* bg) override;
67
72 int getSubdetector() const
73 {
74 return m_Subdetector;
75 }
76
81 void setSubdetector(int subdetector)
82 {
83 m_Subdetector = subdetector;
84 }
85
90 int getSection() const
91 {
92 return m_Section;
93 }
94
99 void setSection(int section)
100 {
101 m_Section = section;
102 }
103
108 int getSector() const
109 {
110 return m_Sector;
111 }
112
117 void setSector(int sector)
118 {
119 m_Sector = sector;
120 }
121
126 int getLayer() const
127 {
128 return m_Layer;
129 }
130
135 void setLayer(int layer)
136 {
137 m_Layer = layer;
138 }
139
144 int getPlane() const
145 {
146 return m_Plane;
147 }
148
153 void setPlane(int plane)
154 {
155 m_Plane = plane;
156 }
157
162 int getStrip() const
163 {
164 return m_Strip;
165 }
166
171 void setStrip(int strip)
172 {
173 m_Strip = strip;
174 }
175
180 int getLastStrip() const
181 {
182 return m_LastStrip;
183 }
184
189 void setLastStrip(int lastStrip)
190 {
191 m_LastStrip = lastStrip;
192 }
193
197 bool isMultiStrip() const
198 {
199 return (m_LastStrip != 0);
200 }
201
206 bool inRPC() const
207 {
210 }
211
216 bool isPhiReadout() const;
217
222 uint16_t getCharge() const
223 {
224 return m_Charge;
225 }
226
231 void setCharge(uint16_t charge)
232 {
233 m_Charge = charge;
234 }
235
240 uint16_t getCTime() const
241 {
242 return m_CTime;
243 }
244
249 void setCTime(uint16_t ctime)
250 {
251 m_CTime = ctime;
252 }
253
258 uint16_t getTDC() const
259 {
260 return m_TDC;
261 }
262
267 void setTDC(uint16_t tdc)
268 {
269 m_TDC = tdc;
270 }
271
276 float getTime() const
277 {
278 return m_Time;
279 }
280
285 void setTime(float time)
286 {
287 m_Time = time;
288 }
289
294 float getEnergyDeposit() const
295 {
296 return m_EnergyDeposit;
297 }
298
303 void setEnergyDeposit(float eDep)
304 {
305 m_EnergyDeposit = eDep;
306 }
307
312 float getNPhotoelectrons() const
313 {
314 return m_NPhotoelectrons;
315 }
316
321 void setNPhotoelectrons(float nPhotoelectrons)
322 {
323 m_NPhotoelectrons = nPhotoelectrons;
324 }
325
331 {
333 }
334
339 void setNGeneratedPhotoelectrons(int nPhotoelectrons)
340 {
341 m_NGeneratedPhotoelectrons = nPhotoelectrons;
342 }
343
348 bool isGood() const
349 {
350 return m_FitStatus == KLM::c_ScintillatorFirmwareSuccessfulFit;
351 }
352
357 int getFitStatus() const
358 {
359 return m_FitStatus;
360 }
361
366 void setFitStatus(int s)
367 {
368 m_FitStatus = s;
369 }
370
375 float getMCTime() const
376 {
377 return m_MCTime;
378 }
379
384 void setMCTime(float time)
385 {
386 m_MCTime = time;
387 }
388
393 float getSiPMMCTime() const
394 {
395 return m_SiPMMCTime;
396 }
397
402 void setSiPMMCTime(float time)
403 {
404 m_SiPMMCTime = time;
405 }
406
407 protected:
408
411
414
417
420
423
426
429
435
437 uint16_t m_Charge;
438
440 uint16_t m_CTime;
441
443 uint16_t m_TDC;
444
446 float m_Time;
447
450
453
456
459
461 float m_MCTime;
462
465
468
469 };
470
472}
@ c_FirstRPCLayer
First RPC layer.
A common base for subdetector Digits.
Definition: DigitBase.h:26
EAppendStatus
Enum for return state of addBGDigit function.
Definition: DigitBase.h:32
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:29
void setMCTime(float time)
Set MC time.
Definition: KLMDigit.h:384
float getSiPMMCTime() const
Get SiPM MC time.
Definition: KLMDigit.h:393
uint16_t m_Charge
Charge (integral of ADC signal).
Definition: KLMDigit.h:437
bool inRPC() const
Determine whether the hit is in RPC or scintillator.
Definition: KLMDigit.h:206
void setNGeneratedPhotoelectrons(int nPhotoelectrons)
Set generated number of photoelectrons.
Definition: KLMDigit.h:339
int getSubdetector() const
Get subdetector number.
Definition: KLMDigit.h:72
EAppendStatus addBGDigit(const DigitBase *bg) override
The pile-up method.
Definition: KLMDigit.cc:89
int m_NGeneratedPhotoelectrons
Generated number of photoelectrons (MC only).
Definition: KLMDigit.h:455
int getLayer() const
Get layer number.
Definition: KLMDigit.h:126
void setLastStrip(int lastStrip)
Set last strip number (for multi-strip digits).
Definition: KLMDigit.h:189
void setSiPMMCTime(float time)
Set SiPM MC time.
Definition: KLMDigit.h:402
KLMDigit()
Constructor.
Definition: KLMDigit.cc:17
uint16_t m_TDC
TDC (time provided by ASIC).
Definition: KLMDigit.h:443
void setSection(int section)
Set section number.
Definition: KLMDigit.h:99
float m_Time
Time of the hit.
Definition: KLMDigit.h:446
bool isGood() const
Whether hit could be used late (if it passed discriminator threshold)
Definition: KLMDigit.h:348
float getTime() const
Get hit time.
Definition: KLMDigit.h:276
int getNGeneratedPhotoelectrons() const
Get generated number of photoelectrons.
Definition: KLMDigit.h:330
float m_SiPMMCTime
MC time at SiPM.
Definition: KLMDigit.h:464
~KLMDigit()
Destructor.
Definition: KLMDigit.h:54
int m_Section
Number of section.
Definition: KLMDigit.h:416
uint16_t getCTime() const
Get CTIME.
Definition: KLMDigit.h:240
uint16_t getTDC() const
Get TDC.
Definition: KLMDigit.h:258
int getSection() const
Get section number.
Definition: KLMDigit.h:90
int getPlane() const
Get plane number.
Definition: KLMDigit.h:144
const KLMElementNumbers * m_ElementNumbers
Element numbers.
Definition: KLMDigit.h:410
float m_MCTime
MC time.
Definition: KLMDigit.h:461
int getStrip() const
Get strip number.
Definition: KLMDigit.h:162
ClassDefOverride(Belle2::KLMDigit, 1)
Class version.
float m_EnergyDeposit
Energy deposition.
Definition: KLMDigit.h:449
void setEnergyDeposit(float eDep)
Set energy deposit.
Definition: KLMDigit.h:303
bool isMultiStrip() const
Determine whether this digit is a multi-strip one or not.
Definition: KLMDigit.h:197
void setCTime(uint16_t ctime)
Set CTIME.
Definition: KLMDigit.h:249
void setNPhotoelectrons(float nPhotoelectrons)
Set number of photoelectrons.
Definition: KLMDigit.h:321
int getSector() const
Get sector number.
Definition: KLMDigit.h:108
int getFitStatus() const
Get fit status.
Definition: KLMDigit.h:357
bool isPhiReadout() const
Whether BKLM digit is in phi or z plane.
Definition: KLMDigit.cc:110
unsigned int getUniqueChannelID() const override
Get unique channel identifier.
Definition: KLMDigit.cc:83
void setStrip(int strip)
Set strip number.
Definition: KLMDigit.h:171
void setTime(float time)
Set hit time.
Definition: KLMDigit.h:285
void setSubdetector(int subdetector)
Set subdetector number.
Definition: KLMDigit.h:81
int m_Sector
Number of sector.
Definition: KLMDigit.h:419
int getLastStrip() const
Get last strip number (for multi-strip digits).
Definition: KLMDigit.h:180
int m_LastStrip
Number of last strip (for multi-strip digits).
Definition: KLMDigit.h:434
float getMCTime() const
Get MC time.
Definition: KLMDigit.h:375
int m_Plane
Number of plane.
Definition: KLMDigit.h:425
void setSector(int sector)
Set sector number.
Definition: KLMDigit.h:117
int m_FitStatus
Fit status.
Definition: KLMDigit.h:458
float m_NPhotoelectrons
Number of photoelectrons.
Definition: KLMDigit.h:452
int m_Layer
Number of layer.
Definition: KLMDigit.h:422
int m_Subdetector
ROOT streamer.
Definition: KLMDigit.h:413
void setTDC(uint16_t tdc)
Set TDC.
Definition: KLMDigit.h:267
float getNPhotoelectrons() const
Get number of photoelectrons.
Definition: KLMDigit.h:312
uint16_t getCharge() const
Get charge.
Definition: KLMDigit.h:222
float getEnergyDeposit() const
Get energy deposit.
Definition: KLMDigit.h:294
void setFitStatus(int s)
Set fit status.
Definition: KLMDigit.h:366
uint16_t m_CTime
CTIME (time provided by B2TT).
Definition: KLMDigit.h:440
void setCharge(uint16_t charge)
Set charge.
Definition: KLMDigit.h:231
int m_Strip
Number of strip.
Definition: KLMDigit.h:428
void setPlane(int plane)
Set plane number.
Definition: KLMDigit.h:153
void setLayer(int layer)
Set layer number.
Definition: KLMDigit.h:135
KLM element numbers.
KLM simulation hit.
Definition: KLMSimHit.h:31
Abstract base class for different kinds of events.