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
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
296 {
298 }
299
304 void setRevo9DCArrivalTime(int revo9DCArrivalTime)
305 {
306 m_NGeneratedPhotoelectrons = revo9DCArrivalTime;
307 }
308
313 int getRPCHitIndex() const
314 {
315 return static_cast<int>(m_MCTime);
316 }
317
322 void setRPCHitIndex(int rpcHitIndex)
323 {
324 m_MCTime = static_cast<float>(rpcHitIndex);
325 }
326
331 float getEnergyDeposit() const
332 {
333 return m_EnergyDeposit;
334 }
335
340 void setEnergyDeposit(float eDep)
341 {
342 m_EnergyDeposit = eDep;
343 }
344
349 float getNPhotoelectrons() const
350 {
351 return m_NPhotoelectrons;
352 }
353
358 void setNPhotoelectrons(float nPhotoelectrons)
359 {
360 m_NPhotoelectrons = nPhotoelectrons;
361 }
362
368 {
370 }
371
376 void setNGeneratedPhotoelectrons(int nPhotoelectrons)
377 {
378 m_NGeneratedPhotoelectrons = nPhotoelectrons;
379 }
380
385 bool isGood() const
386 {
387 return m_FitStatus == KLM::c_ScintillatorFirmwareSuccessfulFit;
388 }
389
394 int getFitStatus() const
395 {
396 return m_FitStatus;
397 }
398
403 void setFitStatus(int s)
404 {
405 m_FitStatus = s;
406 }
407
412 float getMCTime() const
413 {
414 return m_MCTime;
415 }
416
421 void setMCTime(float time)
422 {
423 m_MCTime = time;
424 }
425
430 float getSiPMMCTime() const
431 {
432 return m_SiPMMCTime;
433 }
434
439 void setSiPMMCTime(float time)
440 {
441 m_SiPMMCTime = time;
442 }
443
444 protected:
445
448
451
454
457
460
463
466
472
474 uint16_t m_Charge;
475
477 uint16_t m_CTime;
478
480 uint16_t m_TDC;
481
483 float m_Time;
484
487
490
495
498
502 float m_MCTime;
503
506
509
510 };
511
513}
@ 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:421
float getSiPMMCTime() const
Get SiPM MC time.
Definition KLMDigit.h:430
uint16_t m_Charge
Charge (integral of ADC signal).
Definition KLMDigit.h:474
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:376
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:494
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:439
KLMDigit()
Constructor.
Definition KLMDigit.cc:17
int getRevo9DCArrivalTime() const
Get Revo9 DC arrival time for RPC hits in ttd clock.
Definition KLMDigit.h:295
uint16_t m_TDC
TDC (time provided by ASIC).
Definition KLMDigit.h:480
void setSection(int section)
Set section number.
Definition KLMDigit.h:99
float m_Time
Time of the hit.
Definition KLMDigit.h:483
bool isGood() const
Whether hit could be used late (if it passed discriminator threshold)
Definition KLMDigit.h:385
float getTime() const
Get hit time.
Definition KLMDigit.h:276
int getNGeneratedPhotoelectrons() const
Get generated number of photoelectrons.
Definition KLMDigit.h:367
float m_SiPMMCTime
MC time at SiPM.
Definition KLMDigit.h:505
~KLMDigit()
Destructor.
Definition KLMDigit.h:54
int m_Section
Number of section.
Definition KLMDigit.h:453
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:447
float m_MCTime
MC time for scintillators.
Definition KLMDigit.h:502
int getStrip() const
Get strip number.
Definition KLMDigit.h:162
ClassDefOverride(Belle2::KLMDigit, 1)
Class version.
float m_EnergyDeposit
Energy deposition.
Definition KLMDigit.h:486
void setEnergyDeposit(float eDep)
Set energy deposit.
Definition KLMDigit.h:340
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:358
int getSector() const
Get sector number.
Definition KLMDigit.h:108
int getFitStatus() const
Get fit status.
Definition KLMDigit.h:394
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:322
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:456
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:471
float getMCTime() const
Get MC time.
Definition KLMDigit.h:412
int m_Plane
Number of plane.
Definition KLMDigit.h:462
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:304
int m_FitStatus
Fit status.
Definition KLMDigit.h:497
float m_NPhotoelectrons
Number of photoelectrons.
Definition KLMDigit.h:489
int m_Layer
Number of layer.
Definition KLMDigit.h:459
int getRPCHitIndex() const
Get hit index for RPCs.
Definition KLMDigit.h:313
int m_Subdetector
ROOT streamer.
Definition KLMDigit.h:450
void setTDC(uint16_t tdc)
Set TDC.
Definition KLMDigit.h:267
float getNPhotoelectrons() const
Get number of photoelectrons.
Definition KLMDigit.h:349
uint16_t getCharge() const
Get charge.
Definition KLMDigit.h:222
float getEnergyDeposit() const
Get energy deposit.
Definition KLMDigit.h:331
void setFitStatus(int s)
Set fit status.
Definition KLMDigit.h:403
uint16_t m_CTime
CTIME (time provided by B2TT).
Definition KLMDigit.h:477
void setCharge(uint16_t charge)
Set charge.
Definition KLMDigit.h:231
int m_Strip
Number of strip.
Definition KLMDigit.h:465
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.