Belle II Software  release-08-01-10
FANGSSimHit.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 #ifndef FANGSSIMHIT_H
10 #define FANGSSIMHIT_H
11 
12 #include <simulation/dataobjects/SimHitBase.h>
13 #include <stdint.h>
14 
15 #include <TVector3.h>
16 #include <algorithm>
17 
18 namespace Belle2 {
28  class FANGSSimHit : public SimHitBase {
29  public:
32  m_PDG(0), m_time(0), m_energyDep(0), m_length(0)
33  {
34  std::fill_n(m_momEntry, 3, 0.0);
35  std::fill_n(m_posEntry, 3, 0.0);
36  std::fill_n(m_localposEntry, 3, 0.0);
37  std::fill_n(m_posExit, 3, 0.0);
38  }
39 
53  FANGSSimHit(int trkID, int ladder, int sensor, int pdg, float time, float energyDep,
54  float length, const float* posEntry, const float* localposEntry,
55  const float* posExit, const float* momEntry):
56  SimHitBase(), m_trkID(trkID), m_ladder(ladder), m_sensor(sensor), m_PDG(pdg),
57  m_time(time), m_energyDep(energyDep), m_length(length)
58  {
59  std::copy_n(momEntry, 3, m_momEntry);
60  std::copy_n(posEntry, 3, m_posEntry);
61  std::copy_n(localposEntry, 3, m_localposEntry);
62  std::copy_n(posExit, 3, m_posExit);
63  }
64 
66  int gettrkID() const { return m_trkID; }
68  int getLadder() const { return m_ladder; }
70  int getSensor() const { return m_sensor; }
72  int getPDG() const { return m_PDG; }
74  float getTime() const { return m_time; }
76  float getEnergyDep() const { return m_energyDep; }
78  TVector3 getPosEntry() const { return TVector3(m_posEntry[0], m_posEntry[1], m_posEntry[2]); }
80  TVector3 getLocalPosEntry() const { return TVector3(m_localposEntry[0], m_localposEntry[1], m_localposEntry[2]); }
82  TVector3 getPosExit() const { return TVector3(m_posExit[0], m_posExit[1], m_posExit[2]); }
84  TVector3 getMomEntry() const { return TVector3(m_momEntry[0], m_momEntry[1], m_momEntry[2]); }
86  const float* getPosEntryArray() const { return m_posEntry; }
88  const float* getPosExitArray() const { return m_posExit; }
90  const float* getMomEntryArray() const { return m_momEntry; }
91 
92  private:
94  int m_trkID;
96  uint8_t m_ladder;
98  uint8_t m_sensor;
100  int m_PDG;
102  float m_time;
104  float m_energyDep;
106  float m_posEntry[3];
108  float m_localposEntry[3];
110  float m_posExit[3];
112  float m_momEntry[3];
114  float m_length;
115 
116 
117 
119  };
120 
122 } // end namespace Belle2
123 
124 #endif
Class FANGSSimHit - Geant4 simulated hit for the FANGS detector.
Definition: FANGSSimHit.h:28
float m_posEntry[3]
entry position, global coordinates
Definition: FANGSSimHit.h:106
float m_time
global time
Definition: FANGSSimHit.h:102
TVector3 getMomEntry() const
Return the track momentum.
Definition: FANGSSimHit.h:84
uint8_t m_sensor
Sensor id.
Definition: FANGSSimHit.h:98
int m_trkID
Track ID number.
Definition: FANGSSimHit.h:94
float m_energyDep
Deposited energy in GeV.
Definition: FANGSSimHit.h:104
FANGSSimHit(int trkID, int ladder, int sensor, int pdg, float time, float energyDep, float length, const float *posEntry, const float *localposEntry, const float *posExit, const float *momEntry)
Standard constructor.
Definition: FANGSSimHit.h:53
int m_PDG
PDG number of the track.
Definition: FANGSSimHit.h:100
float getTime() const
Return the global time.
Definition: FANGSSimHit.h:74
float getEnergyDep() const
Return the energy deposition in electrons.
Definition: FANGSSimHit.h:76
const float * getPosExitArray() const
Return track position as float array.
Definition: FANGSSimHit.h:88
const float * getPosEntryArray() const
Return track position as float array.
Definition: FANGSSimHit.h:86
int getLadder() const
Return the Ladder number (starting at 1, increasing with phi)
Definition: FANGSSimHit.h:68
const float * getMomEntryArray() const
Return track momentum as float array.
Definition: FANGSSimHit.h:90
TVector3 getPosExit() const
Return the exit track position.
Definition: FANGSSimHit.h:82
int getSensor() const
Return the Sensor number (starting at 1, increasing with decreasing z)
Definition: FANGSSimHit.h:70
int getPDG() const
Return the PDG number of the track.
Definition: FANGSSimHit.h:72
float m_localposEntry[3]
entry position, local coordinates
Definition: FANGSSimHit.h:108
FANGSSimHit()
default constructor for ROOT
Definition: FANGSSimHit.h:31
float m_momEntry[3]
momentum at entry, global coordinates
Definition: FANGSSimHit.h:112
float m_length
track length
Definition: FANGSSimHit.h:114
TVector3 getPosEntry() const
Return the entry track position.
Definition: FANGSSimHit.h:78
float m_posExit[3]
exit position, global coordinates
Definition: FANGSSimHit.h:110
int gettrkID() const
Return track ID.
Definition: FANGSSimHit.h:66
uint8_t m_ladder
Ladder id.
Definition: FANGSSimHit.h:96
TVector3 getLocalPosEntry() const
Return the local entry track position.
Definition: FANGSSimHit.h:80
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
Class SimHitBase - A common base for subdetector SimHits.
Definition: SimHitBase.h:28
Abstract base class for different kinds of events.