Belle II Software  release-06-02-00
VXDTrueHit.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 #ifndef VXD_DATAOBJECTS_VXDTRUEHIT_H
11 #define VXD_DATAOBJECTS_VXDTRUEHIT_H
12 
13 #include <vxd/dataobjects/VxdID.h>
14 #include <framework/datastore/RelationsObject.h>
15 #include <TVector3.h>
16 #include <algorithm>
17 
18 namespace Belle2 {
36  class VXDTrueHit : public RelationsObject {
37 
38  public:
43  {}
44 
58  VxdID sensorID, float* posEntry, float* posMidPoint, float* posExit,
59  float* momEntry, float* momMidPoint, float* momExit, float energyDep, float globalTime):
60  RelationsObject(), m_sensorID(sensorID), m_energyDep(energyDep), m_globalTime(globalTime)
61  {
62  std::copy_n(posEntry, 3, m_positionEntry);
63  std::copy_n(posMidPoint, 3, m_positionMidPoint);
64  std::copy_n(posExit, 3, m_positionExit);
65  std::copy_n(momEntry, 3, m_momentumEntry);
66  std::copy_n(momMidPoint, 3, m_momentumMidPoint);
67  std::copy_n(momExit, 3, m_momentumExit);
68  }
69 
71  VxdID getSensorID() const { return m_sensorID; }
73  unsigned int getRawSensorID() const {return m_sensorID; }
75  float getU() const { return m_positionMidPoint[0]; }
77  float getV() const { return m_positionMidPoint[1]; }
79  float getW() const { return m_positionMidPoint[2]; }
81  float getEntryU() const { return m_positionEntry[0]; }
83  float getEntryV() const { return m_positionEntry[1]; }
85  float getEntryW() const { return m_positionEntry[2]; }
87  float getExitU() const { return m_positionExit[0]; }
89  float getExitV() const { return m_positionExit[1]; }
91  float getExitW() const { return m_positionExit[2]; }
93  float getEnergyDep() const { return m_energyDep; }
95  float getGlobalTime() const { return m_globalTime; }
97  TVector3 getMomentum() const { return TVector3(m_momentumMidPoint[0], m_momentumMidPoint[1], m_momentumMidPoint[2]); }
99  TVector3 getEntryMomentum() const { return TVector3(m_momentumEntry[0], m_momentumEntry[1], m_momentumEntry[2]);}
101  TVector3 getExitMomentum() const { return TVector3(m_momentumExit[0], m_momentumExit[1], m_momentumExit[2]); }
102 
106  virtual void shiftInTime(float delta) { m_globalTime += delta; }
107 
108  protected:
112  float m_positionEntry[3];
116  float m_positionExit[3];
118  float m_momentumEntry[3];
122  float m_momentumExit[3];
124  float m_energyDep;
127 
128  ClassDef(VXDTrueHit, 6)
129  };
130 
132 } // end namespace Belle2
133 
134 #endif
Defines interface for accessing relations of objects in StoreArray.
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
Class VXDTrueHit - Records of tracks that either enter or leave the sensitive volume.
Definition: VXDTrueHit.h:36
float m_globalTime
time when the midpoint of the track was reached
Definition: VXDTrueHit.h:126
float getV() const
Return local v coordinate of hit.
Definition: VXDTrueHit.h:77
float getGlobalTime() const
Return the time when the track reached its midpoint.
Definition: VXDTrueHit.h:95
float m_positionExit[3]
local coordinates of the end of the track inside the volume
Definition: VXDTrueHit.h:116
float getEntryU() const
Return local u coordinate of hit when entering silicon.
Definition: VXDTrueHit.h:81
float m_energyDep
energy deposited by the track in the sensor volume
Definition: VXDTrueHit.h:124
float getEnergyDep() const
Return energy deposited during traversal of sensor.
Definition: VXDTrueHit.h:93
float m_momentumMidPoint[3]
local momentum of the midpoint of the track inside the volume
Definition: VXDTrueHit.h:120
virtual void shiftInTime(float delta)
Shift the TrueHit in time (for backgorund mixing)
Definition: VXDTrueHit.h:106
float getExitW() const
Return local w coordinate of hit at the endpoint of the track.
Definition: VXDTrueHit.h:91
TVector3 getMomentum() const
Return momentum at the midpoint of the track.
Definition: VXDTrueHit.h:97
float m_positionMidPoint[3]
local coordinates of the midpoint of the track inside the volume
Definition: VXDTrueHit.h:114
VXDTrueHit()
Default constructor for ROOT IO.
Definition: VXDTrueHit.h:40
float m_momentumExit[3]
local momentum of the end of the track inside the volume
Definition: VXDTrueHit.h:122
unsigned int getRawSensorID() const
Return raw Sensor ID.
Definition: VXDTrueHit.h:73
TVector3 getEntryMomentum() const
Return momentum at the start point of the track.
Definition: VXDTrueHit.h:99
float m_momentumEntry[3]
local momentum of the start of the track inside the volume
Definition: VXDTrueHit.h:118
float m_positionEntry[3]
local coordinates of the start of the track inside the volume
Definition: VXDTrueHit.h:112
float getEntryW() const
Return local w coordinate of the start point of the track.
Definition: VXDTrueHit.h:85
VXDTrueHit(VxdID sensorID, float *posEntry, float *posMidPoint, float *posExit, float *momEntry, float *momMidPoint, float *momExit, float energyDep, float globalTime)
Constructor.
Definition: VXDTrueHit.h:57
TVector3 getExitMomentum() const
Return momentum at the endpoint of the track.
Definition: VXDTrueHit.h:101
float getW() const
Return local w coordinate of hit.
Definition: VXDTrueHit.h:79
int m_sensorID
ID of the sensor.
Definition: VXDTrueHit.h:110
VxdID getSensorID() const
Return the Sensor ID.
Definition: VXDTrueHit.h:71
float getU() const
Return local u coordinate of hit.
Definition: VXDTrueHit.h:75
float getExitU() const
Return local u coordinate of hit at the endpoint of the track.
Definition: VXDTrueHit.h:87
float getExitV() const
Return local v coordinate of hit at the endpoint of the track.
Definition: VXDTrueHit.h:89
float getEntryV() const
Return local v coordinate of the start point of the track.
Definition: VXDTrueHit.h:83
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.