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 // ********************************************************************
27 // $Id: G4StepPoint.icc 68795 2013-04-05 13:24:46Z gcosmo $
31 const G4ThreeVector& G4StepPoint::GetPosition() const
35 void G4StepPoint::SetPosition(const G4ThreeVector& aValue)
36 { fPosition = aValue; }
39 void G4StepPoint::AddPosition(const G4ThreeVector& aValue)
40 { fPosition += aValue; } // Position where the track locates
43 G4double G4StepPoint::GetLocalTime() const
44 { return fLocalTime; }
47 void G4StepPoint::SetLocalTime(const G4double aValue)
48 { fLocalTime = aValue; }
51 void G4StepPoint::AddLocalTime(const G4double aValue)
52 { fLocalTime += aValue; } // Time since the track is created.
55 G4double G4StepPoint::GetGlobalTime() const
56 { return fGlobalTime; }
59 void G4StepPoint::SetGlobalTime(const G4double aValue)
60 { fGlobalTime = aValue; }
63 void G4StepPoint::AddGlobalTime(const G4double aValue)
64 { fGlobalTime += aValue; }
65 // Time since the event in which the track belongs is created.
68 G4double G4StepPoint::GetProperTime() const
69 { return fProperTime; }
72 void G4StepPoint::SetProperTime(const G4double aValue)
73 { fProperTime = aValue; }
76 void G4StepPoint::AddProperTime(const G4double aValue)
77 { fProperTime += aValue; } // Proper time of the particle.
80 const G4ThreeVector& G4StepPoint::GetMomentumDirection() const
81 { return fMomentumDirection; }
84 void G4StepPoint::SetMomentumDirection(const G4ThreeVector& aValue)
85 { fMomentumDirection = aValue; }
88 void G4StepPoint::AddMomentumDirection(const G4ThreeVector& aValue)
89 { fMomentumDirection += aValue;} // Direction of momentum (should be an unit vector)
92 G4ThreeVector G4StepPoint::GetMomentum() const
94 G4double tMomentum = std::sqrt(fKineticEnergy*fKineticEnergy +
95 2*fKineticEnergy*fMass);
96 return G4ThreeVector(fMomentumDirection.x()*tMomentum,
97 fMomentumDirection.y()*tMomentum,
98 fMomentumDirection.z()*tMomentum);
100 // Total momentum of the track
103 G4double G4StepPoint::GetTotalEnergy() const
104 { return fKineticEnergy + fMass; } // Total energy of the track
107 G4double G4StepPoint::GetKineticEnergy() const
108 { return fKineticEnergy; }
111 void G4StepPoint::SetKineticEnergy(const G4double aValue)
112 { fKineticEnergy = aValue; }
115 void G4StepPoint::AddKineticEnergy(const G4double aValue)
116 { fKineticEnergy += aValue; }// Kinetic Energy of the track
119 G4double G4StepPoint::GetVelocity() const
120 { return fVelocity; }
123 void G4StepPoint::SetVelocity(G4double v)
127 G4double G4StepPoint::GetBeta() const
128 { return fVelocity/CLHEP::c_light; }
129 // Velocity of the track in unit of c(light velocity)
132 G4double G4StepPoint::GetGamma() const
133 { return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; }
134 // Gamma factor (1/sqrt[1-beta*beta]) of the track
137 G4VPhysicalVolume* G4StepPoint::GetPhysicalVolume() const
138 { return fpTouchable->GetVolume(); }
141 const G4VTouchable* G4StepPoint::GetTouchable() const
142 { return fpTouchable(); }
145 const G4TouchableHandle& G4StepPoint::GetTouchableHandle() const
146 { return fpTouchable; }
149 void G4StepPoint::SetTouchableHandle(const G4TouchableHandle& apValue)
150 { fpTouchable = apValue; }
153 G4double G4StepPoint::GetSafety() const
157 void G4StepPoint::SetSafety(const G4double aValue)
158 { fSafety = aValue; }
161 const G4ThreeVector& G4StepPoint::GetPolarization() const
162 { return fPolarization; }
165 void G4StepPoint::SetPolarization(const G4ThreeVector& aValue)
166 { fPolarization = aValue; }
169 void G4StepPoint::AddPolarization(const G4ThreeVector& aValue)
170 { fPolarization += aValue; }
173 G4StepStatus G4StepPoint::GetStepStatus() const
174 { return fStepStatus; }
177 void G4StepPoint::SetStepStatus(const G4StepStatus aValue)
178 { fStepStatus = aValue; }
181 const G4VProcess* G4StepPoint::GetProcessDefinedStep() const
182 { return fpProcessDefinedStep; }
183 // If the pointer is 0, this means the Step is defined
184 // by the user defined limit in the current volume.
187 void G4StepPoint::SetProcessDefinedStep(const G4VProcess* aValue)
188 { fpProcessDefinedStep = aValue; }
191 G4double G4StepPoint::GetMass() const
195 void G4StepPoint::SetMass(G4double value)
199 G4double G4StepPoint::GetCharge() const
203 void G4StepPoint::SetCharge(G4double value)
207 G4double G4StepPoint::GetMagneticMoment() const
208 { return fMagneticMoment; }
211 void G4StepPoint::SetMagneticMoment(G4double value)
212 { fMagneticMoment = value; }
215 G4Material* G4StepPoint::GetMaterial() const
216 { return fpMaterial; }
219 void G4StepPoint::SetMaterial(G4Material* material)
220 {fpMaterial = material; }
223 const G4MaterialCutsCouple* G4StepPoint::GetMaterialCutsCouple() const
224 { return fpMaterialCutsCouple; }
227 void G4StepPoint::SetMaterialCutsCouple(const G4MaterialCutsCouple* materialCutsCouple)
228 { fpMaterialCutsCouple = materialCutsCouple; }
231 G4VSensitiveDetector* G4StepPoint::GetSensitiveDetector() const
232 { return fpSensitiveDetector; }
235 void G4StepPoint::SetSensitiveDetector(G4VSensitiveDetector* aValue)
236 { fpSensitiveDetector = aValue; }
239 void G4StepPoint::SetWeight(G4double aValue)
240 { fWeight = aValue; }
243 G4double G4StepPoint::GetWeight() const