2// ********************************************************************
3// * License and Disclaimer *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
26// G4StepPoint inline methods implementation
28// Author: Hisaya Kurashige, 16 February 2000
29// --------------------------------------------------------------------
31inline const G4ThreeVector& G4StepPoint::GetPosition() const
36inline void G4StepPoint::SetPosition(const G4ThreeVector& aValue)
41inline void G4StepPoint::AddPosition(const G4ThreeVector& aValue)
43 fPosition += aValue; // Position where the track locates
46inline G4double G4StepPoint::GetLocalTime() const
51inline void G4StepPoint::SetLocalTime(const G4double aValue)
56inline void G4StepPoint::AddLocalTime(const G4double aValue)
58 fLocalTime += aValue; // Time since the track is created
61inline G4double G4StepPoint::GetGlobalTime() const
66inline void G4StepPoint::SetGlobalTime(const G4double aValue)
71inline void G4StepPoint::AddGlobalTime(const G4double aValue)
73 fGlobalTime += aValue; // Time since the event in which the
74} // track belongs is created
76inline G4double G4StepPoint::GetProperTime() const
81inline void G4StepPoint::SetProperTime(const G4double aValue)
86inline void G4StepPoint::AddProperTime(const G4double aValue)
88 fProperTime += aValue; // Proper time of the particle
91inline const G4ThreeVector& G4StepPoint::GetMomentumDirection() const
93 return fMomentumDirection;
96inline void G4StepPoint::SetMomentumDirection(const G4ThreeVector& aValue)
98 fMomentumDirection = aValue;
101inline void G4StepPoint::AddMomentumDirection(const G4ThreeVector& aValue)
103 fMomentumDirection += aValue; // Direction of momentum (unit vector)
106inline G4ThreeVector G4StepPoint::GetMomentum() const
108 G4double tMomentum = // Total momentum of the track
109 std::sqrt(fKineticEnergy * fKineticEnergy + 2 * fKineticEnergy * fMass);
110 return G4ThreeVector(fMomentumDirection.x() * tMomentum,
111 fMomentumDirection.y() * tMomentum,
112 fMomentumDirection.z() * tMomentum);
115inline G4double G4StepPoint::GetTotalEnergy() const
117 return fKineticEnergy + fMass; // Total energy of the track
120inline G4double G4StepPoint::GetKineticEnergy() const
122 return fKineticEnergy;
125inline void G4StepPoint::SetKineticEnergy(const G4double aValue)
127 fKineticEnergy = aValue;
130inline void G4StepPoint::AddKineticEnergy(const G4double aValue)
132 fKineticEnergy += aValue; // Kinetic Energy of the track
135inline G4double G4StepPoint::GetVelocity() const
140inline void G4StepPoint::SetVelocity(G4double v)
145inline G4double G4StepPoint::GetBeta() const
147 return fVelocity / CLHEP::c_light; // Velocity of the track
148} // in unit of c (light velocity)
150inline G4double G4StepPoint::GetGamma() const
152 return (fMass == 0.) ? DBL_MAX : (fKineticEnergy + fMass) / fMass;
153 // Gamma factor (1/sqrt[1-beta*beta]) of the track
156inline G4VPhysicalVolume* G4StepPoint::GetPhysicalVolume() const
158 return fpTouchable->GetVolume();
161inline const G4VTouchable* G4StepPoint::GetTouchable() const
163 return fpTouchable();
166inline const G4TouchableHandle& G4StepPoint::GetTouchableHandle() const
171inline void G4StepPoint::SetTouchableHandle(const G4TouchableHandle& apValue)
173 fpTouchable = apValue;
176inline G4double G4StepPoint::GetSafety() const
181inline void G4StepPoint::SetSafety(const G4double aValue)
186inline const G4ThreeVector& G4StepPoint::GetPolarization() const
188 return fPolarization;
191inline void G4StepPoint::SetPolarization(const G4ThreeVector& aValue)
193 fPolarization = aValue;
196inline void G4StepPoint::AddPolarization(const G4ThreeVector& aValue)
198 fPolarization += aValue;
201inline G4StepStatus G4StepPoint::GetStepStatus() const
206inline void G4StepPoint::SetStepStatus(const G4StepStatus aValue)
208 fStepStatus = aValue;
211inline const G4VProcess* G4StepPoint::GetProcessDefinedStep() const
213 // If the pointer is 0, this means the Step is defined
214 // by the user defined limit in the current volume.
215 return fpProcessDefinedStep;
218inline void G4StepPoint::SetProcessDefinedStep(const G4VProcess* aValue)
220 fpProcessDefinedStep = aValue;
223inline G4double G4StepPoint::GetMass() const
228inline void G4StepPoint::SetMass(G4double value)
233inline G4double G4StepPoint::GetCharge() const
238inline void G4StepPoint::SetCharge(G4double value)
243inline G4double G4StepPoint::GetMagneticMoment() const
245 return fMagneticMoment;
248inline void G4StepPoint::SetMagneticMoment(G4double value)
250 fMagneticMoment = value;
253inline G4Material* G4StepPoint::GetMaterial() const
258inline void G4StepPoint::SetMaterial(G4Material* material)
260 fpMaterial = material;
263inline const G4MaterialCutsCouple* G4StepPoint::GetMaterialCutsCouple() const
265 return fpMaterialCutsCouple;
268inline void G4StepPoint::SetMaterialCutsCouple(
269 const G4MaterialCutsCouple* materialCutsCouple)
271 fpMaterialCutsCouple = materialCutsCouple;
274inline G4VSensitiveDetector* G4StepPoint::GetSensitiveDetector() const
276 return fpSensitiveDetector;
279inline void G4StepPoint::SetSensitiveDetector(G4VSensitiveDetector* aValue)
281 fpSensitiveDetector = aValue;
284inline void G4StepPoint::SetWeight(G4double aValue)
289inline G4double G4StepPoint::GetWeight() const