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 {
25
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
211
216 bool isPhiReadout() const;
217
224 uint16_t getCharge() const
225 {
226 return m_Charge;
227 }
228
233 void setCharge(uint16_t charge)
234 {
235 m_Charge = charge;
236 }
237
242 uint16_t getCTime() const
243 {
244 return m_CTime;
245 }
246
251 void setCTime(uint16_t ctime)
252 {
253 m_CTime = ctime;
254 }
255
260 uint16_t getTDC() const
261 {
262 return m_TDC;
263 }
264
269 void setTDC(uint16_t tdc)
270 {
271 m_TDC = tdc;
272 }
273
278 float getTime() const
279 {
280 return m_Time;
281 }
282
287 void setTime(float time)
288 {
289 m_Time = time;
290 }
291
298 {
300 }
301
306 void setRevo9DCArrivalTime(int revo9DCArrivalTime)
307 {
308 m_NGeneratedPhotoelectrons = revo9DCArrivalTime;
309 }
310
315 int getRPCHitIndex() const
316 {
317 return static_cast<int>(m_MCTime);
318 }
319
324 void setRPCHitIndex(int rpcHitIndex)
325 {
326 m_MCTime = static_cast<float>(rpcHitIndex);
327 }
328
333 float getEnergyDeposit() const
334 {
335 return m_EnergyDeposit;
336 }
337
342 void setEnergyDeposit(float eDep)
343 {
344 m_EnergyDeposit = eDep;
345 }
346
351 float getNPhotoelectrons() const
352 {
353 return m_NPhotoelectrons;
354 }
355
360 void setNPhotoelectrons(float nPhotoelectrons)
361 {
362 m_NPhotoelectrons = nPhotoelectrons;
363 }
364
370 {
372 }
373
378 void setNGeneratedPhotoelectrons(int nPhotoelectrons)
379 {
380 m_NGeneratedPhotoelectrons = nPhotoelectrons;
381 }
382
387 bool isGood() const
388 {
389 return m_FitStatus == KLM::c_ScintillatorFirmwareSuccessfulFit;
390 }
391
396 int getFitStatus() const
397 {
398 return m_FitStatus;
399 }
400
405 void setFitStatus(int s)
406 {
407 m_FitStatus = s;
408 }
409
414 float getMCTime() const
415 {
416 return m_MCTime;
417 }
418
423 void setMCTime(float time)
424 {
425 m_MCTime = time;
426 }
427
432 float getSiPMMCTime() const
433 {
434 return m_SiPMMCTime;
435 }
436
441 void setSiPMMCTime(float time)
442 {
443 m_SiPMMCTime = time;
444 }
445
446 protected:
447
450
453
456
459
462
465
468
474
476 uint16_t m_Charge;
477
479 uint16_t m_CTime;
480
482 uint16_t m_TDC;
483
485 float m_Time;
486
489
492
497
500
504 float m_MCTime;
505
508
511
512 };
513
515}
@ 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
DigitBase()
Constructor.
Definition DigitBase.h:40
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:423
float getSiPMMCTime() const
Get SiPM MC time.
Definition KLMDigit.h:432
uint16_t m_Charge
Charge (integral of ADC signal).
Definition KLMDigit.h:476
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:378
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) for scintillators.
Definition KLMDigit.h:496
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:441
KLMDigit()
Constructor.
Definition KLMDigit.cc:17
int getRevo9DCArrivalTime() const
Get Revo9 DC arrival time for RPC hits in ttd clock.
Definition KLMDigit.h:297
uint16_t m_TDC
TDC (time provided by ASIC).
Definition KLMDigit.h:482
void setSection(int section)
Set section number.
Definition KLMDigit.h:99
float m_Time
Time of the hit.
Definition KLMDigit.h:485
bool isGood() const
Whether hit could be used late (if it passed discriminator threshold)
Definition KLMDigit.h:387
float getTime() const
Get hit time.
Definition KLMDigit.h:278
int getNGeneratedPhotoelectrons() const
Get generated number of photoelectrons.
Definition KLMDigit.h:369
float m_SiPMMCTime
MC time at SiPM.
Definition KLMDigit.h:507
~KLMDigit()
Destructor.
Definition KLMDigit.h:54
int m_Section
Number of section.
Definition KLMDigit.h:455
uint16_t getCTime() const
Get CTIME.
Definition KLMDigit.h:242
uint16_t getTDC() const
Get TDC.
Definition KLMDigit.h:260
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:449
float m_MCTime
MC time for scintillators.
Definition KLMDigit.h:504
int getStrip() const
Get strip number.
Definition KLMDigit.h:162
ClassDefOverride(Belle2::KLMDigit, 1)
Class version.
float m_EnergyDeposit
Energy deposition.
Definition KLMDigit.h:488
void setEnergyDeposit(float eDep)
Set energy deposit.
Definition KLMDigit.h:342
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:251
void setNPhotoelectrons(float nPhotoelectrons)
Set number of photoelectrons.
Definition KLMDigit.h:360
int getSector() const
Get sector number.
Definition KLMDigit.h:108
int getFitStatus() const
Get fit status.
Definition KLMDigit.h:396
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 setRPCHitIndex(int rpcHitIndex)
Set hit index for RPCs.
Definition KLMDigit.h:324
void setTime(float time)
Set hit time.
Definition KLMDigit.h:287
void setSubdetector(int subdetector)
Set subdetector number.
Definition KLMDigit.h:81
int m_Sector
Number of sector.
Definition KLMDigit.h:458
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:473
float getMCTime() const
Get MC time.
Definition KLMDigit.h:414
int m_Plane
Number of plane.
Definition KLMDigit.h:464
void setSector(int sector)
Set sector number.
Definition KLMDigit.h:117
void setRevo9DCArrivalTime(int revo9DCArrivalTime)
Set Revo9 DC arrival time for RPC hits.
Definition KLMDigit.h:306
int m_FitStatus
Fit status.
Definition KLMDigit.h:499
float m_NPhotoelectrons
Number of photoelectrons.
Definition KLMDigit.h:491
int m_Layer
Number of layer.
Definition KLMDigit.h:461
int getRPCHitIndex() const
Get hit index for RPCs.
Definition KLMDigit.h:315
int m_Subdetector
ROOT streamer.
Definition KLMDigit.h:452
void setTDC(uint16_t tdc)
Set TDC.
Definition KLMDigit.h:269
float getNPhotoelectrons() const
Get number of photoelectrons.
Definition KLMDigit.h:351
uint16_t getCharge() const
Get charge.
Definition KLMDigit.h:224
float getEnergyDeposit() const
Get energy deposit.
Definition KLMDigit.h:333
void setFitStatus(int s)
Set fit status.
Definition KLMDigit.h:405
uint16_t m_CTime
CTIME (time provided by B2TT).
Definition KLMDigit.h:479
void setCharge(uint16_t charge)
Set charge.
Definition KLMDigit.h:233
int m_Strip
Number of strip.
Definition KLMDigit.h:467
void setPlane(int plane)
Set plane number.
Definition KLMDigit.h:153
void setLayer(int layer)
Set layer number.
Definition KLMDigit.h:135
KLM simulation hit.
Definition KLMSimHit.h:31
Abstract base class for different kinds of events.