source: trunk/source/track/include/G4StepPoint.icc@ 1340

Last change on this file since 1340 was 1337, checked in by garnier, 15 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 8.2 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
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. *
10// * *
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. *
17// * *
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// ********************************************************************
25//
26//
27// $Id: G4StepPoint.icc,v 1.14 2008/10/24 08:22:20 kurasige Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-01 $
29//
30//
31
32 inline G4StepPoint & G4StepPoint::operator=(const G4StepPoint &right)
33 {
34 if (this != &right) {
35 fPosition = right.fPosition;
36 fGlobalTime = right.fGlobalTime;
37 fLocalTime = right.fLocalTime;
38 fProperTime = right.fProperTime;
39 fMomentumDirection = right.fMomentumDirection;
40 fKineticEnergy = right.fKineticEnergy;
41 fpTouchable = right.fpTouchable;
42 fpMaterial = right.fpMaterial;
43 fpMaterialCutsCouple = right.fpMaterialCutsCouple;
44 fpSensitiveDetector = right.fpSensitiveDetector;
45 fSafety = right.fSafety;
46 fPolarization = right.fPolarization;
47 fStepStatus = right.fStepStatus;
48 fpProcessDefinedStep = right.fpProcessDefinedStep;
49 fMass = right.fMass;
50 fCharge = right.fCharge;
51 fWeight = right.fWeight;
52 fVelocity = right.fVelocity;
53 }
54 return *this;
55 }
56
57 inline const G4ThreeVector& G4StepPoint::GetPosition() const
58 { return fPosition; }
59 inline void G4StepPoint::SetPosition(const G4ThreeVector& aValue)
60 { fPosition = aValue; }
61 inline void G4StepPoint::AddPosition(const G4ThreeVector& aValue)
62 { fPosition += aValue; }
63 // Position where the track locates
64
65 inline G4double G4StepPoint::GetLocalTime() const
66 { return fLocalTime; }
67 inline void G4StepPoint::SetLocalTime(const G4double aValue)
68 { fLocalTime = aValue; }
69 inline void G4StepPoint::AddLocalTime(const G4double aValue)
70 { fLocalTime += aValue; }
71 // Time since the track is created.
72
73 inline G4double G4StepPoint::GetGlobalTime() const
74 { return fGlobalTime; }
75 inline void G4StepPoint::SetGlobalTime(const G4double aValue)
76 { fGlobalTime = aValue; }
77 inline void G4StepPoint::AddGlobalTime(const G4double aValue)
78 { fGlobalTime += aValue; }
79 // Time since the event in which the track belongs is created.
80
81 inline G4double G4StepPoint::GetProperTime() const
82 { return fProperTime; }
83 inline void G4StepPoint::SetProperTime(const G4double aValue)
84 { fProperTime = aValue; }
85 inline void G4StepPoint::AddProperTime(const G4double aValue)
86 { fProperTime += aValue; }
87 // Proper time of the particle.
88
89 inline const G4ThreeVector& G4StepPoint::GetMomentumDirection() const
90 { return fMomentumDirection; }
91 inline void G4StepPoint::SetMomentumDirection(const G4ThreeVector& aValue)
92 { fMomentumDirection = aValue;
93 }
94 inline void G4StepPoint::AddMomentumDirection(const G4ThreeVector& aValue)
95 { fMomentumDirection += aValue;
96 }
97 // Direction of momentum (should be an unit vector)
98
99 inline G4ThreeVector G4StepPoint::GetMomentum() const
100 {
101 G4double tMomentum = std::sqrt(fKineticEnergy*fKineticEnergy +
102 2*fKineticEnergy*fMass);
103 return G4ThreeVector(fMomentumDirection.x()*tMomentum,
104 fMomentumDirection.y()*tMomentum,
105 fMomentumDirection.z()*tMomentum);
106 }
107 // Total momentum of the track
108
109 inline G4double G4StepPoint::GetTotalEnergy() const
110 {
111 return fKineticEnergy + fMass;
112 }
113 // Total energy of the track
114
115 inline G4double G4StepPoint::GetKineticEnergy() const
116 { return fKineticEnergy; }
117 inline void G4StepPoint::SetKineticEnergy(const G4double aValue)
118 { fKineticEnergy = aValue; }
119 inline void G4StepPoint::AddKineticEnergy(const G4double aValue)
120 { fKineticEnergy += aValue; }
121 // Kinetic Energy of the track
122
123 inline G4double G4StepPoint::GetVelocity() const
124 {
125 return fVelocity;
126 }
127 inline void G4StepPoint::SetVelocity(G4double v)
128 {
129 fVelocity = v;
130 }
131
132
133 inline G4double G4StepPoint::GetBeta() const
134 {
135 return fVelocity/c_light;
136 }
137
138 // Velocity of the track in unit of c(light velocity)
139
140 inline G4double G4StepPoint::GetGamma() const
141 { return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; }
142 // Gamma factor (1/sqrt[1-beta*beta]) of the track
143
144 inline G4VPhysicalVolume* G4StepPoint::GetPhysicalVolume() const
145 { return fpTouchable->GetVolume(); }
146
147 inline const G4VTouchable* G4StepPoint::GetTouchable() const
148 { return fpTouchable(); }
149 inline const G4TouchableHandle& G4StepPoint::GetTouchableHandle() const
150 { return fpTouchable; }
151 inline void G4StepPoint::SetTouchableHandle(const G4TouchableHandle& apValue)
152 { fpTouchable = apValue; }
153
154 inline G4double G4StepPoint::GetSafety() const
155 { return fSafety; }
156 inline void G4StepPoint::SetSafety(const G4double aValue)
157 { fSafety = aValue; }
158
159 inline const G4ThreeVector& G4StepPoint::GetPolarization() const
160 { return fPolarization; }
161 inline void G4StepPoint::SetPolarization(const G4ThreeVector& aValue)
162 { fPolarization = aValue; }
163 inline void G4StepPoint::AddPolarization(const G4ThreeVector& aValue)
164 { fPolarization += aValue; }
165
166 inline G4StepStatus G4StepPoint::GetStepStatus() const
167 { return fStepStatus; }
168 inline void G4StepPoint::SetStepStatus(const G4StepStatus aValue)
169 { fStepStatus = aValue; }
170
171 inline const G4VProcess* G4StepPoint::GetProcessDefinedStep() const
172 { return fpProcessDefinedStep; }
173 // If the pointer is 0, this means the Step is defined
174 // by the user defined limit in the current volume.
175 inline void G4StepPoint::SetProcessDefinedStep(const G4VProcess* aValue)
176 { fpProcessDefinedStep = aValue; }
177
178 inline G4double G4StepPoint::GetMass() const
179 { return fMass; }
180 inline void G4StepPoint::SetMass(G4double value)
181 { fMass = value; }
182
183 inline G4double G4StepPoint::GetCharge() const
184 { return fCharge; }
185 inline void G4StepPoint::SetCharge(G4double value)
186 { fCharge = value; }
187
188 inline G4double G4StepPoint::GetMagneticMoment() const
189 {
190 return fMagneticMoment;
191 }
192 inline void G4StepPoint::SetMagneticMoment(G4double value)
193 {
194 fMagneticMoment = value;
195 }
196
197 inline G4Material* G4StepPoint::GetMaterial() const
198 { return fpMaterial; }
199 inline void G4StepPoint::SetMaterial(G4Material* material)
200 {fpMaterial = material; }
201
202 inline
203 const G4MaterialCutsCouple* G4StepPoint::GetMaterialCutsCouple() const
204 { return fpMaterialCutsCouple; }
205 inline
206 void G4StepPoint::SetMaterialCutsCouple(const G4MaterialCutsCouple* materialCutsCouple)
207 {fpMaterialCutsCouple = materialCutsCouple; }
208
209 inline G4VSensitiveDetector* G4StepPoint::GetSensitiveDetector() const
210 { return fpSensitiveDetector; }
211 inline void G4StepPoint::SetSensitiveDetector(G4VSensitiveDetector* aValue)
212 { fpSensitiveDetector = aValue; }
213
214 inline void G4StepPoint::SetWeight(G4double aValue)
215 { fWeight = aValue; }
216 inline G4double G4StepPoint::GetWeight() const
217 { return fWeight; }
Note: See TracBrowser for help on using the repository browser.