Belle II Software  release-06-01-15
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/eklm/EKLMSimHit.h>
13 #include <klm/dataobjects/bklm/BKLMElementNumbers.h>
14 #include <klm/dataobjects/bklm/BKLMSimHit.h>
15 #include <klm/dataobjects/KLMElementNumbers.h>
16 #include <klm/dataobjects/KLMScintillatorFirmwareFitResult.h>
17 
18 /* Belle 2 headers. */
19 #include <framework/dataobjects/DigitBase.h>
20 
21 namespace Belle2 {
30  class KLMDigit : public DigitBase {
31 
32  public:
33 
37  KLMDigit();
38 
43  explicit KLMDigit(const EKLMSimHit* simHit);
44 
50  KLMDigit(const BKLMSimHit* simHit, int strip);
51 
56  explicit KLMDigit(const BKLMSimHit* simHit);
57 
62  {
63  }
64 
68  unsigned int getUniqueChannelID() const override;
69 
73  EAppendStatus addBGDigit(const DigitBase* bg) override;
74 
79  int getSubdetector() const
80  {
81  return m_Subdetector;
82  }
83 
88  void setSubdetector(int subdetector)
89  {
90  m_Subdetector = subdetector;
91  }
92 
97  int getSection() const
98  {
99  return m_Section;
100  }
101 
106  void setSection(int section)
107  {
108  m_Section = section;
109  }
110 
115  int getSector() const
116  {
117  return m_Sector;
118  }
119 
124  void setSector(int sector)
125  {
126  m_Sector = sector;
127  }
128 
133  int getLayer() const
134  {
135  return m_Layer;
136  }
137 
142  void setLayer(int layer)
143  {
144  m_Layer = layer;
145  }
146 
151  int getPlane() const
152  {
153  return m_Plane;
154  }
155 
160  void setPlane(int plane)
161  {
162  m_Plane = plane;
163  }
164 
169  int getStrip() const
170  {
171  return m_Strip;
172  }
173 
178  void setStrip(int strip)
179  {
180  m_Strip = strip;
181  }
182 
187  int getLastStrip() const
188  {
189  return m_LastStrip;
190  }
191 
196  void setLastStrip(int lastStrip)
197  {
198  m_LastStrip = lastStrip;
199  }
200 
204  bool isMultiStrip() const
205  {
206  return (m_LastStrip != 0);
207  }
208 
213  bool inRPC() const
214  {
217  }
218 
223  bool isPhiReadout() const;
224 
229  uint16_t getCharge() const
230  {
231  return m_Charge;
232  }
233 
238  void setCharge(uint16_t charge)
239  {
240  m_Charge = charge;
241  }
242 
247  uint16_t getCTime() const
248  {
249  return m_CTime;
250  }
251 
256  void setCTime(uint16_t ctime)
257  {
258  m_CTime = ctime;
259  }
260 
265  uint16_t getTDC() const
266  {
267  return m_TDC;
268  }
269 
274  void setTDC(uint16_t tdc)
275  {
276  m_TDC = tdc;
277  }
278 
283  float getTime() const
284  {
285  return m_Time;
286  }
287 
292  void setTime(float time)
293  {
294  m_Time = time;
295  }
296 
301  float getEnergyDeposit() const
302  {
303  return m_EnergyDeposit;
304  }
305 
310  void setEnergyDeposit(float eDep)
311  {
312  m_EnergyDeposit = eDep;
313  }
314 
319  float getNPhotoelectrons() const
320  {
321  return m_NPhotoelectrons;
322  }
323 
328  void setNPhotoelectrons(float nPhotoelectrons)
329  {
330  m_NPhotoelectrons = nPhotoelectrons;
331  }
332 
338  {
340  }
341 
346  void setNGeneratedPhotoelectrons(int nPhotoelectrons)
347  {
348  m_NGeneratedPhotoelectrons = nPhotoelectrons;
349  }
350 
355  bool isGood() const
356  {
357  return m_FitStatus == KLM::c_ScintillatorFirmwareSuccessfulFit;
358  }
359 
364  int getFitStatus() const
365  {
366  return m_FitStatus;
367  }
368 
373  void setFitStatus(int s)
374  {
375  m_FitStatus = s;
376  }
377 
382  float getMCTime() const
383  {
384  return m_MCTime;
385  }
386 
391  void setMCTime(float time)
392  {
393  m_MCTime = time;
394  }
395 
400  float getSiPMMCTime() const
401  {
402  return m_SiPMMCTime;
403  }
404 
409  void setSiPMMCTime(float time)
410  {
411  m_SiPMMCTime = time;
412  }
413 
414  protected:
415 
418 
421 
424 
426  int m_Sector;
427 
429  int m_Layer;
430 
432  int m_Plane;
433 
435  int m_Strip;
436 
442 
444  uint16_t m_Charge;
445 
447  uint16_t m_CTime;
448 
450  uint16_t m_TDC;
451 
453  float m_Time;
454 
457 
460 
463 
466 
468  float m_MCTime;
469 
472 
475 
476  };
477 
479 }
@ c_FirstRPCLayer
First RPC layer.
Store one simulation hit as a ROOT object.
Definition: BKLMSimHit.h:25
A common base for subdetector Digits.
Definition: DigitBase.h:26
EAppendStatus
Enum for return state of addBGDigit function.
Definition: DigitBase.h:32
Class EKLMSimHit stores information on particular Geant step; using information from TrackID and Pare...
Definition: EKLMSimHit.h:32
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:30
void setMCTime(float time)
Set MC time.
Definition: KLMDigit.h:391
float getSiPMMCTime() const
Get SiPM MC time.
Definition: KLMDigit.h:400
uint16_t m_Charge
Charge (integral of ADC signal).
Definition: KLMDigit.h:444
bool inRPC() const
Determine whether the hit is in RPC or scintillator.
Definition: KLMDigit.h:213
void setNGeneratedPhotoelectrons(int nPhotoelectrons)
Set generated number of photoelectrons.
Definition: KLMDigit.h:346
int getSubdetector() const
Get subdetector number.
Definition: KLMDigit.h:79
EAppendStatus addBGDigit(const DigitBase *bg) override
The pile-up method.
Definition: KLMDigit.cc:111
int m_NGeneratedPhotoelectrons
Generated number of photoelectrons (MC only).
Definition: KLMDigit.h:462
int getLayer() const
Get layer number.
Definition: KLMDigit.h:133
void setLastStrip(int lastStrip)
Set last strip number (for multi-strip digits).
Definition: KLMDigit.h:196
void setSiPMMCTime(float time)
Set SiPM MC time.
Definition: KLMDigit.h:409
KLMDigit()
Constructor.
Definition: KLMDigit.cc:17
uint16_t m_TDC
TDC (time provided by ASIC).
Definition: KLMDigit.h:450
void setSection(int section)
Set section number.
Definition: KLMDigit.h:106
float m_Time
Time of the hit.
Definition: KLMDigit.h:453
bool isGood() const
Whether hit could be used late (if it passed discriminator threshold)
Definition: KLMDigit.h:355
float getTime() const
Get hit time.
Definition: KLMDigit.h:283
int getNGeneratedPhotoelectrons() const
Get generated number of photoelectrons.
Definition: KLMDigit.h:337
float m_SiPMMCTime
MC time at SiPM.
Definition: KLMDigit.h:471
~KLMDigit()
Destructor.
Definition: KLMDigit.h:61
int m_Section
Number of section.
Definition: KLMDigit.h:423
uint16_t getCTime() const
Get CTIME.
Definition: KLMDigit.h:247
uint16_t getTDC() const
Get TDC.
Definition: KLMDigit.h:265
int getSection() const
Get section number.
Definition: KLMDigit.h:97
int getPlane() const
Get plane number.
Definition: KLMDigit.h:151
const KLMElementNumbers * m_ElementNumbers
Element numbers.
Definition: KLMDigit.h:417
float m_MCTime
MC time.
Definition: KLMDigit.h:468
int getStrip() const
Get strip number.
Definition: KLMDigit.h:169
ClassDefOverride(Belle2::KLMDigit, 1)
Class version.
float m_EnergyDeposit
Energy deposition.
Definition: KLMDigit.h:456
void setEnergyDeposit(float eDep)
Set EnergyDeposit.
Definition: KLMDigit.h:310
bool isMultiStrip() const
Determine whether this digit is a multi-strip one or not.
Definition: KLMDigit.h:204
void setCTime(uint16_t ctime)
Set CTIME.
Definition: KLMDigit.h:256
void setNPhotoelectrons(float nPhotoelectrons)
Set number of photoelectrons.
Definition: KLMDigit.h:328
int getSector() const
Get sector number.
Definition: KLMDigit.h:115
int getFitStatus() const
Get fit status.
Definition: KLMDigit.h:364
bool isPhiReadout() const
Whether BKLM digit is in phi or z plane.
Definition: KLMDigit.cc:132
unsigned int getUniqueChannelID() const override
Get unique channel identifier.
Definition: KLMDigit.cc:105
void setStrip(int strip)
Set strip number.
Definition: KLMDigit.h:178
void setTime(float time)
Set hit time.
Definition: KLMDigit.h:292
void setSubdetector(int subdetector)
Set subdetector number.
Definition: KLMDigit.h:88
int m_Sector
Number of sector.
Definition: KLMDigit.h:426
int getLastStrip() const
Get last strip number (for multi-strip digits).
Definition: KLMDigit.h:187
int m_LastStrip
Number of last strip (for multi-strip digits).
Definition: KLMDigit.h:441
float getMCTime() const
Get MC time.
Definition: KLMDigit.h:382
int m_Plane
Number of plane.
Definition: KLMDigit.h:432
void setSector(int sector)
Set sector number.
Definition: KLMDigit.h:124
int m_FitStatus
Fit status.
Definition: KLMDigit.h:465
float m_NPhotoelectrons
Number of photoelectrons.
Definition: KLMDigit.h:459
int m_Layer
Number of layer.
Definition: KLMDigit.h:429
int m_Subdetector
ROOT streamer.
Definition: KLMDigit.h:420
void setTDC(uint16_t tdc)
Set TDC.
Definition: KLMDigit.h:274
float getNPhotoelectrons() const
Get number of photoelectrons.
Definition: KLMDigit.h:319
uint16_t getCharge() const
Get charge.
Definition: KLMDigit.h:229
float getEnergyDeposit() const
Get energy deposit.
Definition: KLMDigit.h:301
void setFitStatus(int s)
Set fit status.
Definition: KLMDigit.h:373
uint16_t m_CTime
CTIME (time provided by B2TT).
Definition: KLMDigit.h:447
void setCharge(uint16_t charge)
Set charge.
Definition: KLMDigit.h:238
int m_Strip
Number of strip.
Definition: KLMDigit.h:435
void setPlane(int plane)
Set plane number.
Definition: KLMDigit.h:160
void setLayer(int layer)
Set layer number.
Definition: KLMDigit.h:142
KLM element numbers.
Abstract base class for different kinds of events.