Belle II Software  release-05-02-19
KLMDigit.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2020 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Kirill Chilikin *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 /* KLM headers. */
14 #include <klm/dataobjects/eklm/EKLMSimHit.h>
15 #include <klm/dataobjects/bklm/BKLMElementNumbers.h>
16 #include <klm/dataobjects/bklm/BKLMSimHit.h>
17 #include <klm/dataobjects/KLMElementNumbers.h>
18 #include <klm/dataobjects/KLMScintillatorFirmwareFitResult.h>
19 
20 /* Belle 2 headers. */
21 #include <framework/dataobjects/DigitBase.h>
22 
23 namespace Belle2 {
32  class KLMDigit : public DigitBase {
33 
34  public:
35 
39  KLMDigit();
40 
45  explicit KLMDigit(const EKLMSimHit* simHit);
46 
52  KLMDigit(const BKLMSimHit* simHit, int strip);
53 
58  explicit KLMDigit(const BKLMSimHit* simHit);
59 
63  virtual ~KLMDigit()
64  {
65  }
66 
70  unsigned int getUniqueChannelID() const override;
71 
75  EAppendStatus addBGDigit(const DigitBase* bg) override;
76 
81  int getSubdetector() const
82  {
83  return m_Subdetector;
84  }
85 
90  void setSubdetector(int subdetector)
91  {
92  m_Subdetector = subdetector;
93  }
94 
99  int getSection() const
100  {
101  return m_Section;
102  }
103 
108  void setSection(int section)
109  {
110  m_Section = section;
111  }
112 
117  int getSector() const
118  {
119  return m_Sector;
120  }
121 
126  void setSector(int sector)
127  {
128  m_Sector = sector;
129  }
130 
135  int getLayer() const
136  {
137  return m_Layer;
138  }
139 
144  void setLayer(int layer)
145  {
146  m_Layer = layer;
147  }
148 
153  int getPlane() const
154  {
155  return m_Plane;
156  }
157 
162  void setPlane(int plane)
163  {
164  m_Plane = plane;
165  }
166 
171  int getStrip() const
172  {
173  return m_Strip;
174  }
175 
180  void setStrip(int strip)
181  {
182  m_Strip = strip;
183  }
184 
189  int getLastStrip() const
190  {
191  return m_LastStrip;
192  }
193 
198  void setLastStrip(int lastStrip)
199  {
200  m_LastStrip = lastStrip;
201  }
202 
206  bool isMultiStrip() const
207  {
208  return (m_LastStrip != 0);
209  }
210 
215  bool inRPC() const
216  {
219  }
220 
225  bool isPhiReadout() const;
226 
231  uint16_t getCharge() const
232  {
233  return m_Charge;
234  }
235 
240  void setCharge(uint16_t charge)
241  {
242  m_Charge = charge;
243  }
244 
249  uint16_t getCTime() const
250  {
251  return m_CTime;
252  }
253 
258  void setCTime(uint16_t ctime)
259  {
260  m_CTime = ctime;
261  }
262 
267  uint16_t getTDC() const
268  {
269  return m_TDC;
270  }
271 
276  void setTDC(uint16_t tdc)
277  {
278  m_TDC = tdc;
279  }
280 
285  float getTime() const
286  {
287  return m_Time;
288  }
289 
294  void setTime(float time)
295  {
296  m_Time = time;
297  }
298 
303  float getEnergyDeposit() const
304  {
305  return m_EnergyDeposit;
306  }
307 
312  void setEnergyDeposit(float eDep)
313  {
314  m_EnergyDeposit = eDep;
315  }
316 
321  float getNPhotoelectrons() const
322  {
323  return m_NPhotoelectrons;
324  }
325 
330  void setNPhotoelectrons(float nPhotoelectrons)
331  {
332  m_NPhotoelectrons = nPhotoelectrons;
333  }
334 
339  int getNGeneratedPhotoelectrons() const
340  {
342  }
343 
348  void setNGeneratedPhotoelectrons(int nPhotoelectrons)
349  {
350  m_NGeneratedPhotoelectrons = nPhotoelectrons;
351  }
352 
357  bool isGood() const
358  {
359  return m_FitStatus == KLM::c_ScintillatorFirmwareSuccessfulFit;
360  }
361 
366  int getFitStatus() const
367  {
368  return m_FitStatus;
369  }
370 
375  void setFitStatus(int s)
376  {
377  m_FitStatus = s;
378  }
379 
384  float getMCTime() const
385  {
386  return m_MCTime;
387  }
388 
393  void setMCTime(float time)
394  {
395  m_MCTime = time;
396  }
397 
402  float getSiPMMCTime() const
403  {
404  return m_SiPMMCTime;
405  }
406 
411  void setSiPMMCTime(float time)
412  {
413  m_SiPMMCTime = time;
414  }
415 
416  protected:
417 
420 
422  int m_Subdetector;
423 
425  int m_Section;
426 
428  int m_Sector;
429 
431  int m_Layer;
432 
434  int m_Plane;
435 
437  int m_Strip;
438 
443  int m_LastStrip;
444 
446  uint16_t m_Charge;
447 
449  uint16_t m_CTime;
450 
452  uint16_t m_TDC;
453 
455  float m_Time;
456 
458  float m_EnergyDeposit;
459 
461  float m_NPhotoelectrons;
462 
465 
467  int m_FitStatus;
468 
470  float m_MCTime;
471 
473  float m_SiPMMCTime;
474 
477 
478  };
479 
481 }
Belle2::KLMDigit::m_FitStatus
int m_FitStatus
Fit status.
Definition: KLMDigit.h:475
Belle2::EvtPDLUtil::charge
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:46
Belle2::KLMDigit::getSubdetector
int getSubdetector() const
Get subdetector number.
Definition: KLMDigit.h:89
Belle2::DigitBase::EAppendStatus
EAppendStatus
Enum for return state of addBGDigit function.
Definition: DigitBase.h:42
Belle2::KLMDigit::m_SiPMMCTime
float m_SiPMMCTime
MC time at SiPM.
Definition: KLMDigit.h:481
Belle2::KLMDigit::getPlane
int getPlane() const
Get plane number.
Definition: KLMDigit.h:161
Belle2::KLMDigit::setMCTime
void setMCTime(float time)
Set MC time.
Definition: KLMDigit.h:401
Belle2::KLMDigit::inRPC
bool inRPC() const
Determine whether the hit is in RPC or scintillator.
Definition: KLMDigit.h:223
Belle2::KLMDigit::ClassDefOverride
ClassDefOverride(Belle2::KLMDigit, 1)
Class version.
Belle2::KLMDigit::setSiPMMCTime
void setSiPMMCTime(float time)
Set SiPM MC time.
Definition: KLMDigit.h:419
Belle2::KLMDigit::getCTime
uint16_t getCTime() const
Get CTIME.
Definition: KLMDigit.h:257
Belle2::KLMDigit::m_Charge
uint16_t m_Charge
Charge (integral of ADC signal).
Definition: KLMDigit.h:454
Belle2::KLMDigit::setSubdetector
void setSubdetector(int subdetector)
Set subdetector number.
Definition: KLMDigit.h:98
Belle2::KLMDigit::setNGeneratedPhotoelectrons
void setNGeneratedPhotoelectrons(int nPhotoelectrons)
Set generated number of photoelectrons.
Definition: KLMDigit.h:356
Belle2::KLMDigit::getNPhotoelectrons
float getNPhotoelectrons() const
Get number of photoelectrons.
Definition: KLMDigit.h:329
Belle2::KLMDigit::setCharge
void setCharge(uint16_t charge)
Set charge.
Definition: KLMDigit.h:248
Belle2::KLMDigit::m_ElementNumbers
const KLMElementNumbers * m_ElementNumbers
Element numbers.
Definition: KLMDigit.h:427
Belle2::KLMDigit::setStrip
void setStrip(int strip)
Set strip number.
Definition: KLMDigit.h:188
Belle2::KLMDigit::m_NGeneratedPhotoelectrons
int m_NGeneratedPhotoelectrons
Generated number of photoelectrons (MC only).
Definition: KLMDigit.h:472
Belle2::KLMDigit::m_Section
int m_Section
Number of section.
Definition: KLMDigit.h:433
Belle2::KLMDigit::m_Time
float m_Time
Time of the hit.
Definition: KLMDigit.h:463
Belle2::KLMDigit::getSection
int getSection() const
Get section number.
Definition: KLMDigit.h:107
Belle2::KLMDigit::getSector
int getSector() const
Get sector number.
Definition: KLMDigit.h:125
Belle2::KLMDigit::getTime
float getTime() const
Get hit time.
Definition: KLMDigit.h:293
Belle2::KLMDigit::getLayer
int getLayer() const
Get layer number.
Definition: KLMDigit.h:143
Belle2::KLMDigit::getMCTime
float getMCTime() const
Get MC time.
Definition: KLMDigit.h:392
Belle2::KLMDigit::getCharge
uint16_t getCharge() const
Get charge.
Definition: KLMDigit.h:239
Belle2::KLMDigit::m_Plane
int m_Plane
Number of plane.
Definition: KLMDigit.h:442
Belle2::KLMDigit::m_CTime
uint16_t m_CTime
CTIME (time provided by B2TT).
Definition: KLMDigit.h:457
Belle2::KLMDigit::getTDC
uint16_t getTDC() const
Get TDC.
Definition: KLMDigit.h:275
Belle2::KLMDigit
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:40
Belle2::KLMDigit::setPlane
void setPlane(int plane)
Set plane number.
Definition: KLMDigit.h:170
Belle2::KLMDigit::setTime
void setTime(float time)
Set hit time.
Definition: KLMDigit.h:302
Belle2::KLMDigit::isPhiReadout
bool isPhiReadout() const
Whether BKLM digit is in phi or z plane.
Definition: KLMDigit.cc:134
Belle2::KLMDigit::getNGeneratedPhotoelectrons
int getNGeneratedPhotoelectrons() const
Get generated number of photoelectrons.
Definition: KLMDigit.h:347
Belle2::KLMDigit::m_MCTime
float m_MCTime
MC time.
Definition: KLMDigit.h:478
Belle2::EKLMSimHit
Class EKLMSimHit stores information on particular Geant step; using information from TrackID and Pare...
Definition: EKLMSimHit.h:41
Belle2::KLMDigit::getFitStatus
int getFitStatus() const
Get fit status.
Definition: KLMDigit.h:374
Belle2::KLMDigit::m_TDC
uint16_t m_TDC
TDC (time provided by ASIC).
Definition: KLMDigit.h:460
Belle2::KLMDigit::setTDC
void setTDC(uint16_t tdc)
Set TDC.
Definition: KLMDigit.h:284
Belle2::KLMDigit::m_Subdetector
int m_Subdetector
ROOT streamer.
Definition: KLMDigit.h:430
Belle2::KLMDigit::setEnergyDeposit
void setEnergyDeposit(float eDep)
Set EnergyDeposit.
Definition: KLMDigit.h:320
Belle2::KLMDigit::m_Strip
int m_Strip
Number of strip.
Definition: KLMDigit.h:445
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::KLMDigit::setSector
void setSector(int sector)
Set sector number.
Definition: KLMDigit.h:134
Belle2::KLMDigit::getSiPMMCTime
float getSiPMMCTime() const
Get SiPM MC time.
Definition: KLMDigit.h:410
Belle2::KLMDigit::isMultiStrip
bool isMultiStrip() const
Determine whether this digit is a multi-strip one or not.
Definition: KLMDigit.h:214
Belle2::KLMDigit::isGood
bool isGood() const
Whether hit could be used late (if it passed discriminator threshold)
Definition: KLMDigit.h:365
Belle2::KLMDigit::getEnergyDeposit
float getEnergyDeposit() const
Get energy deposit.
Definition: KLMDigit.h:311
Belle2::KLMDigit::getLastStrip
int getLastStrip() const
Get last strip number (for multi-strip digits).
Definition: KLMDigit.h:197
Belle2::KLMElementNumbers::c_BKLM
@ c_BKLM
BKLM.
Definition: KLMElementNumbers.h:47
Belle2::KLMDigit::m_Layer
int m_Layer
Number of layer.
Definition: KLMDigit.h:439
Belle2::KLMDigit::m_NPhotoelectrons
float m_NPhotoelectrons
Number of photoelectrons.
Definition: KLMDigit.h:469
Belle2::KLMDigit::addBGDigit
EAppendStatus addBGDigit(const DigitBase *bg) override
The pile-up method.
Definition: KLMDigit.cc:113
Belle2::KLMDigit::setLastStrip
void setLastStrip(int lastStrip)
Set last strip number (for multi-strip digits).
Definition: KLMDigit.h:206
Belle2::KLMDigit::setNPhotoelectrons
void setNPhotoelectrons(float nPhotoelectrons)
Set number of photoelectrons.
Definition: KLMDigit.h:338
Belle2::KLMDigit::setFitStatus
void setFitStatus(int s)
Set fit status.
Definition: KLMDigit.h:383
Belle2::KLMDigit::m_EnergyDeposit
float m_EnergyDeposit
Energy deposition.
Definition: KLMDigit.h:466
Belle2::KLMDigit::getUniqueChannelID
unsigned int getUniqueChannelID() const override
Get unique channel identifier.
Definition: KLMDigit.cc:107
Belle2::KLMDigit::~KLMDigit
virtual ~KLMDigit()
Destructor.
Definition: KLMDigit.h:71
Belle2::KLMDigit::getStrip
int getStrip() const
Get strip number.
Definition: KLMDigit.h:179
Belle2::BKLMSimHit
Store one simulation hit as a ROOT object.
Definition: BKLMSimHit.h:35
Belle2::KLMElementNumbers
KLM element numbers.
Definition: KLMElementNumbers.h:37
Belle2::BKLMElementNumbers::c_FirstRPCLayer
@ c_FirstRPCLayer
First RPC layer.
Definition: BKLMElementNumbers.h:71
Belle2::KLMDigit::m_LastStrip
int m_LastStrip
Number of last strip (for multi-strip digits).
Definition: KLMDigit.h:451
Belle2::KLMDigit::setLayer
void setLayer(int layer)
Set layer number.
Definition: KLMDigit.h:152
Belle2::KLMDigit::KLMDigit
KLMDigit()
Constructor.
Definition: KLMDigit.cc:19
Belle2::DigitBase
A common base for subdetector Digits.
Definition: DigitBase.h:36
Belle2::KLMDigit::setSection
void setSection(int section)
Set section number.
Definition: KLMDigit.h:116
Belle2::KLMDigit::setCTime
void setCTime(uint16_t ctime)
Set CTIME.
Definition: KLMDigit.h:266
Belle2::KLMDigit::m_Sector
int m_Sector
Number of sector.
Definition: KLMDigit.h:436