Belle II Software  release-08-01-10
KLMSimHit.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 
15 /* Basf2 headers. */
16 #include <simulation/dataobjects/SimHitBase.h>
17 
18 /* ROOT headers. */
19 #include <Math/Vector4D.h>
20 #include <TVector3.h>
21 
22 namespace Belle2 {
31  class KLMSimHit : public SimHitBase {
32 
33  public:
34 
39  {
40  }
41 
46  {
47  }
48 
53  int getPDG() const
54  {
55  return m_PDG;
56  }
57 
62  void setPDG(int pdg)
63  {
64  m_PDG = pdg;
65  }
66 
71  int getTrackID() const
72  {
73  return m_trackID;
74  }
75 
80  void setTrackID(int track)
81  {
82  m_trackID = track;
83  }
84 
89  int getParentTrackID() const
90  {
91  return m_parentTrackID;
92  }
93 
98  void setParentTrackID(int track)
99  {
100  m_parentTrackID = track;
101  }
102 
107  int getVolumeID() const
108  {
109  return m_volid;
110  }
111 
116  int getSubdetector() const
117  {
118  return m_Subdetector;
119  }
120 
125  void setSubdetector(int subdetector)
126  {
127  m_Subdetector = subdetector;
128  }
129 
134  int getSection() const
135  {
136  return m_Section;
137  }
138 
143  void setSection(int Section)
144  {
145  m_Section = Section;
146  }
147 
152  int getLayer() const
153  {
154  return m_Layer;
155  }
156 
161  void setLayer(int layer)
162  {
163  m_Layer = layer;
164  }
165 
170  int getSector() const
171  {
172  return m_Sector;
173  }
174 
179  void setSector(int sector)
180  {
181  m_Sector = sector;
182  }
183 
188  int getPlane() const
189  {
190  return m_Plane;
191  }
192 
196  bool isPhiReadout() const
197  {
199  }
200 
205  void setPlane(int plane)
206  {
207  m_Plane = plane;
208  }
209 
214  int getStrip() const
215  {
216  return m_Strip;
217  }
218 
223  void setStrip(int strip)
224  {
225  m_Strip = strip;
226  }
227 
232  int getLastStrip() const
233  {
234  return m_LastStrip;
235  }
236 
241  void setLastStrip(int lastStrip)
242  {
243  m_LastStrip = lastStrip;
244  }
245 
250  bool inRPC() const
251  {
254  }
255 
260  float getEnergyDeposit() const
261  {
262  return m_EDep;
263  }
264 
269  void setEnergyDeposit(float eDep)
270  {
271  m_EDep = eDep;
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 
296  float getPropagationTime() const
297  {
298  return m_PropagationTime;
299  }
300 
305  void setPropagationTime(float propagationTime)
306  {
307  m_PropagationTime = propagationTime;
308  }
309 
316  void setLocalPosition(float x, float y, float z)
317  {
318  m_localX = x;
319  m_localY = y;
320  m_localZ = z;
321  }
322 
327  float getLocalPositionX() const
328  {
329  return m_localX;
330  }
331 
336  float getLocalPositionY() const
337  {
338  return m_localY;
339  }
340 
345  float getLocalPositionZ() const
346  {
347  return m_localZ;
348  }
349 
354  TVector3 getLocalPosition() const
355  {
356  return TVector3(m_localX, m_localY, m_localZ);
357  }
358 
365  void setPosition(float x, float y, float z)
366  {
367  m_globalX = x;
368  m_globalY = y;
369  m_globalZ = z;
370  }
371 
376  void setPosition(const TVector3& pos)
377  {
378  m_globalX = pos.X();
379  m_globalY = pos.Y();
380  m_globalZ = pos.Z();
381  }
382 
387  float getPositionX() const
388  {
389  return m_globalX;
390  }
391 
396  float getPositionY() const
397  {
398  return m_globalY;
399  }
400 
405  float getPositionZ() const
406  {
407  return m_globalZ;
408  }
409 
414  TVector3 getPosition() const
415  {
416  return TVector3(m_globalX, m_globalY, m_globalZ);
417  }
418 
423  void setMomentum(const ROOT::Math::PxPyPzEVector& p)
424  {
425  m_e = p.E();
426  m_pX = p.Px();
427  m_pY = p.Py();
428  m_pZ = p.Pz();
429  }
430 
435  ROOT::Math::PxPyPzEVector getMomentum() const
436  {
437  return ROOT::Math::PxPyPzEVector(m_pX, m_pY, m_pZ, m_e);
438  }
439 
444  void setVolumeID(int id)
445  {
446  m_volid = id;
447  }
448 
453  float getGlobalTime() const override
454  {
455  return getTime();
456  }
457 
462  void shiftInTime(float delta) override
463  {
464  setTime(getTime() + delta);
465  }
466 
467  private:
468 
470  int m_PDG = -1;
471 
473  int m_trackID = -1;
474 
476  int m_parentTrackID = -1;
477 
479  int m_volid = -1;
480 
482  int m_Subdetector = 0;
483 
485  int m_Section = 0;
486 
488  int m_Layer = 0;
489 
491  int m_Sector = 0;
492 
494  int m_Plane = 0;
495 
497  int m_Strip = 0;
498 
501 
503  float m_Time = -1;
504 
506  float m_EDep = -1;
507 
509  float m_PropagationTime = 0;
510 
512  float m_localX = 0;
513 
515  float m_localY = 0;
516 
518  float m_localZ = 0;
519 
521  float m_globalX;
522 
524  float m_globalY;
525 
527  float m_globalZ;
528 
530  float m_e = 0;
531 
533  float m_pX = 0;
534 
536  float m_pY = 0;
537 
539  float m_pZ = 0;
540 
543 
544  };
545 
547 }
@ c_FirstRPCLayer
First RPC layer.
KLM simulation hit.
Definition: KLMSimHit.h:31
bool inRPC() const
Determine whether the hit is in RPC or scintillator.
Definition: KLMSimHit.h:250
void setParentTrackID(int track)
Set ID of parent track.
Definition: KLMSimHit.h:98
void setPropagationTime(float propagationTime)
Set signal propagation time.
Definition: KLMSimHit.h:305
int m_parentTrackID
Parent track ID.
Definition: KLMSimHit.h:476
int getSubdetector() const
Get subdetector number.
Definition: KLMSimHit.h:116
int getLayer() const
Get layer number.
Definition: KLMSimHit.h:152
void setLastStrip(int lastStrip)
Set last strip number.
Definition: KLMSimHit.h:241
float m_Time
Time of the hit.
Definition: KLMSimHit.h:503
int m_PDG
PDG code of the (leading) particle.
Definition: KLMSimHit.h:470
float getTime() const
Get hit time.
Definition: KLMSimHit.h:278
int m_trackID
Track ID.
Definition: KLMSimHit.h:473
float m_globalX
Global position X coordinate.
Definition: KLMSimHit.h:521
float m_localZ
Local position Z coordinate.
Definition: KLMSimHit.h:518
float getGlobalTime() const override
Get hit time (implementation of base class function)
Definition: KLMSimHit.h:453
int m_Section
Number of section.
Definition: KLMSimHit.h:485
TVector3 getLocalPosition() const
Get ihit local position.
Definition: KLMSimHit.h:354
int getSection() const
Get section number.
Definition: KLMSimHit.h:134
float getPositionZ() const
Get hit global position z coordinate.
Definition: KLMSimHit.h:405
~KLMSimHit()
Destructor.
Definition: KLMSimHit.h:45
int getPlane() const
Get plane number.
Definition: KLMSimHit.h:188
float m_e
Energy.
Definition: KLMSimHit.h:530
float getPropagationTime() const
Get signal propagation time.
Definition: KLMSimHit.h:296
KLMSimHit()
Constructor.
Definition: KLMSimHit.h:38
int getStrip() const
Get strip number.
Definition: KLMSimHit.h:214
float m_globalZ
Global position Z coordinate.
Definition: KLMSimHit.h:527
float m_localX
Local position X coordinate.
Definition: KLMSimHit.h:512
float getLocalPositionZ() const
Get hit local position z coordinate.
Definition: KLMSimHit.h:345
void setEnergyDeposit(float eDep)
Set EnergyDeposit.
Definition: KLMSimHit.h:269
float m_pZ
Momentum Z component.
Definition: KLMSimHit.h:539
void setSection(int Section)
Set section number.
Definition: KLMSimHit.h:143
ClassDefOverride(Belle2::KLMSimHit, 1)
Class version.
float m_pX
Momentum X component.
Definition: KLMSimHit.h:533
int getSector() const
Get sector number.
Definition: KLMSimHit.h:170
float getPositionX() const
Get hit global position x coordinate.
Definition: KLMSimHit.h:387
bool isPhiReadout() const
Check whether the hit is from phi plane.
Definition: KLMSimHit.h:196
void setStrip(int strip)
Set strip number.
Definition: KLMSimHit.h:223
float m_EDep
Energy deposition.
Definition: KLMSimHit.h:506
void setTrackID(int track)
Set track ID.
Definition: KLMSimHit.h:80
float getLocalPositionY() const
Get hit local position y coordinate.
Definition: KLMSimHit.h:336
int getTrackID() const
Get track ID.
Definition: KLMSimHit.h:71
void setPosition(const TVector3 &pos)
Set hit global position.
Definition: KLMSimHit.h:376
void setTime(float time)
Set hit time.
Definition: KLMSimHit.h:287
void setSubdetector(int subdetector)
Set subdetector number.
Definition: KLMSimHit.h:125
int m_Sector
Number of sector.
Definition: KLMSimHit.h:491
float m_pY
Momentum Y component.
Definition: KLMSimHit.h:536
int getLastStrip() const
Get last strip number.
Definition: KLMSimHit.h:232
float getLocalPositionX() const
Get hit local position x coordinate.
Definition: KLMSimHit.h:327
int m_LastStrip
Number of last strip (for BKLM RPC hits).
Definition: KLMSimHit.h:500
void setPDG(int pdg)
Set the lund code of the (leading) particle.
Definition: KLMSimHit.h:62
int getParentTrackID() const
Get ID of parent track.
Definition: KLMSimHit.h:89
int getPDG() const
Get the lund code of the (leading) particle.
Definition: KLMSimHit.h:53
TVector3 getPosition() const
Get hit global position.
Definition: KLMSimHit.h:414
int m_Plane
Number of plane.
Definition: KLMSimHit.h:494
void setSector(int sector)
Set sector number.
Definition: KLMSimHit.h:179
void setVolumeID(int id)
Set volume identifier.
Definition: KLMSimHit.h:444
float m_PropagationTime
Time of propagation (ns) from hit to sensor.
Definition: KLMSimHit.h:509
int m_Layer
Number of layer.
Definition: KLMSimHit.h:488
void setLocalPosition(float x, float y, float z)
Set hit local position.
Definition: KLMSimHit.h:316
float getPositionY() const
Get hit global position y coordinate.
Definition: KLMSimHit.h:396
int m_Subdetector
Number of subdetector.
Definition: KLMSimHit.h:482
void setMomentum(const ROOT::Math::PxPyPzEVector &p)
Set momentum.
Definition: KLMSimHit.h:423
void shiftInTime(float delta) override
Shift SimHit in time (implementation of base class function)
Definition: KLMSimHit.h:462
float m_localY
Local position Y coordinate.
Definition: KLMSimHit.h:515
float getEnergyDeposit() const
Get energy deposit.
Definition: KLMSimHit.h:260
ROOT::Math::PxPyPzEVector getMomentum() const
Get momentum.
Definition: KLMSimHit.h:435
int m_volid
Volume identifier.
Definition: KLMSimHit.h:479
int m_Strip
Number of strip.
Definition: KLMSimHit.h:497
void setPlane(int plane)
Set plane number.
Definition: KLMSimHit.h:205
void setLayer(int layer)
Set layer number.
Definition: KLMSimHit.h:161
float m_globalY
Global position Y coordinate.
Definition: KLMSimHit.h:524
int getVolumeID() const
Get volume identifier.
Definition: KLMSimHit.h:107
void setPosition(float x, float y, float z)
Set hit global position.
Definition: KLMSimHit.h:365
Class SimHitBase - A common base for subdetector SimHits.
Definition: SimHitBase.h:28
Abstract base class for different kinds of events.