Belle II Software development
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 <Math/Vector3D.h>
16#include <algorithm>
17
18namespace 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 ROOT::Math::XYZVector getPosEntry() const { return ROOT::Math::XYZVector(m_posEntry[0], m_posEntry[1], m_posEntry[2]); }
80 ROOT::Math::XYZVector getLocalPosEntry() const { return ROOT::Math::XYZVector(m_localposEntry[0], m_localposEntry[1], m_localposEntry[2]); }
82 ROOT::Math::XYZVector getPosExit() const { return ROOT::Math::XYZVector(m_posExit[0], m_posExit[1], m_posExit[2]); }
84 ROOT::Math::XYZVector getMomEntry() const { return ROOT::Math::XYZVector(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:
96 uint8_t m_ladder;
98 uint8_t m_sensor;
100 int m_PDG;
102 float m_time;
106 float m_posEntry[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
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
ROOT::Math::XYZVector getPosEntry() const
Return the entry track position.
Definition: FANGSSimHit.h:78
const float * getPosExitArray() const
Return track position as float array.
Definition: FANGSSimHit.h:88
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
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
ROOT::Math::XYZVector 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
const float * getPosEntryArray() const
Return track position as float array.
Definition: FANGSSimHit.h:86
float m_localposEntry[3]
entry position, local coordinates
Definition: FANGSSimHit.h:108
ROOT::Math::XYZVector getMomEntry() const
Return the track momentum.
Definition: FANGSSimHit.h:84
FANGSSimHit()
default constructor for ROOT
Definition: FANGSSimHit.h:31
ROOT::Math::XYZVector getLocalPosEntry() const
Return the local entry track position.
Definition: FANGSSimHit.h:80
float m_momEntry[3]
momentum at entry, global coordinates
Definition: FANGSSimHit.h:112
float m_length
track length
Definition: FANGSSimHit.h:114
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
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.