Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4StepPoint inline methods implementation << 27 // 26 // 28 // Author: Hisaya Kurashige, 16 February 2000 << 27 // $Id: G4StepPoint.icc,v 1.11 2006/06/29 21:14:41 gunter Exp $ 29 // ------------------------------------------- << 28 // GEANT4 tag $Name: geant4-08-01 $ 30 << 29 // 31 inline const G4ThreeVector& G4StepPoint::GetPo << 30 // 32 { << 31 inline const G4ThreeVector& G4StepPoint::GetPosition() const 33 return fPosition; << 32 { return fPosition; } 34 } << 33 inline void G4StepPoint::SetPosition(const G4ThreeVector& aValue) 35 << 34 { fPosition = aValue; } 36 inline void G4StepPoint::SetPosition(const G4T << 35 inline void G4StepPoint::AddPosition(const G4ThreeVector& aValue) 37 { << 36 { fPosition += aValue; } 38 fPosition = aValue; << 37 // Position where the track locates 39 } << 38 40 << 39 inline G4double G4StepPoint::GetLocalTime() const 41 inline void G4StepPoint::AddPosition(const G4T << 40 { return fLocalTime; } 42 { << 41 inline void G4StepPoint::SetLocalTime(const G4double aValue) 43 fPosition += aValue; // Position where the << 42 { fLocalTime = aValue; } 44 } << 43 inline void G4StepPoint::AddLocalTime(const G4double aValue) 45 << 44 { fLocalTime += aValue; } 46 inline G4double G4StepPoint::GetLocalTime() co << 45 // Time since the track is created. 47 { << 46 48 return fLocalTime; << 47 inline G4double G4StepPoint::GetGlobalTime() const 49 } << 48 { return fGlobalTime; } 50 << 49 inline void G4StepPoint::SetGlobalTime(const G4double aValue) 51 inline void G4StepPoint::SetLocalTime(const G4 << 50 { fGlobalTime = aValue; } 52 { << 51 inline void G4StepPoint::AddGlobalTime(const G4double aValue) 53 fLocalTime = aValue; << 52 { fGlobalTime += aValue; } 54 } << 53 // Time since the event in which the track belongs is created. 55 << 54 56 inline void G4StepPoint::AddLocalTime(const G4 << 55 inline G4double G4StepPoint::GetProperTime() const 57 { << 56 { return fProperTime; } 58 fLocalTime += aValue; // Time since the tra << 57 inline void G4StepPoint::SetProperTime(const G4double aValue) 59 } << 58 { fProperTime = aValue; } 60 << 59 inline void G4StepPoint::AddProperTime(const G4double aValue) 61 inline G4double G4StepPoint::GetGlobalTime() c << 60 { fProperTime += aValue; } 62 { << 61 // Proper time of the particle. 63 return fGlobalTime; << 62 64 } << 63 inline const G4ThreeVector& G4StepPoint::GetMomentumDirection() const 65 << 64 { return fMomentumDirection; } 66 inline void G4StepPoint::SetGlobalTime(const G << 65 inline void G4StepPoint::SetMomentumDirection(const G4ThreeVector& aValue) 67 { << 66 { fMomentumDirection = aValue; 68 fGlobalTime = aValue; << 67 } 69 } << 68 inline void G4StepPoint::AddMomentumDirection(const G4ThreeVector& aValue) 70 << 69 { fMomentumDirection += aValue; 71 inline void G4StepPoint::AddGlobalTime(const G << 70 } 72 { << 71 // Direction of momentum (should be an unit vector) 73 fGlobalTime += aValue; // Time since the ev << 72 74 } // track belongs is << 73 inline G4ThreeVector G4StepPoint::GetMomentum() const 75 << 74 { 76 inline G4double G4StepPoint::GetProperTime() c << 75 G4double tMomentum = std::sqrt(fKineticEnergy*fKineticEnergy + 77 { << 76 2*fKineticEnergy*fMass); 78 return fProperTime; << 77 return G4ThreeVector(fMomentumDirection.x()*tMomentum, 79 } << 78 fMomentumDirection.y()*tMomentum, 80 << 79 fMomentumDirection.z()*tMomentum); 81 inline void G4StepPoint::SetProperTime(const G << 80 } 82 { << 81 // Total momentum of the track 83 fProperTime = aValue; << 82 84 } << 83 inline G4double G4StepPoint::GetTotalEnergy() const 85 << 84 { 86 inline void G4StepPoint::AddProperTime(const G << 85 return fKineticEnergy + fMass; 87 { << 86 } 88 fProperTime += aValue; // Proper time of th << 87 // Total energy of the track 89 } << 88 90 << 89 inline G4double G4StepPoint::GetKineticEnergy() const 91 inline const G4ThreeVector& G4StepPoint::GetMo << 90 { return fKineticEnergy; } 92 { << 91 inline void G4StepPoint::SetKineticEnergy(const G4double aValue) 93 return fMomentumDirection; << 92 { fKineticEnergy = aValue; } 94 } << 93 inline void G4StepPoint::AddKineticEnergy(const G4double aValue) 95 << 94 { fKineticEnergy += aValue; } 96 inline void G4StepPoint::SetMomentumDirection( << 95 // Kinetic Energy of the track 97 { << 96 98 fMomentumDirection = aValue; << 97 inline G4double G4StepPoint::GetVelocity() const 99 } << 98 { 100 << 99 return fVelocity; 101 inline void G4StepPoint::AddMomentumDirection( << 100 } 102 { << 101 inline void G4StepPoint::SetVelocity(G4double v) 103 fMomentumDirection += aValue; // Direction << 102 { 104 } << 103 fVelocity = v; 105 << 104 } 106 inline G4ThreeVector G4StepPoint::GetMomentum( << 105 107 { << 106 108 G4double tMomentum = // Total mome << 107 inline G4double G4StepPoint::GetBeta() const 109 std::sqrt(fKineticEnergy * fKineticEnergy << 108 { 110 return G4ThreeVector(fMomentumDirection.x() << 109 return fVelocity/c_light; 111 fMomentumDirection.y() << 110 } 112 fMomentumDirection.z() << 111 113 } << 112 // Velocity of the track in unit of c(light velocity) 114 << 113 115 inline G4double G4StepPoint::GetTotalEnergy() << 114 inline G4double G4StepPoint::GetGamma() const 116 { << 115 { return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; } 117 return fKineticEnergy + fMass; // Total ene << 116 // Gamma factor (1/sqrt[1-beta*beta]) of the track 118 } << 117 119 << 118 inline G4VPhysicalVolume* G4StepPoint::GetPhysicalVolume() const 120 inline G4double G4StepPoint::GetKineticEnergy( << 119 { return fpTouchable->GetVolume(); } 121 { << 120 122 return fKineticEnergy; << 121 inline const G4VTouchable* G4StepPoint::GetTouchable() const 123 } << 122 { return fpTouchable(); } 124 << 123 inline const G4TouchableHandle& G4StepPoint::GetTouchableHandle() const 125 inline void G4StepPoint::SetKineticEnergy(cons << 124 { return fpTouchable; } 126 { << 125 inline void G4StepPoint::SetTouchableHandle(const G4TouchableHandle& apValue) 127 fKineticEnergy = aValue; << 126 { fpTouchable = apValue; } 128 } << 127 129 << 128 inline G4double G4StepPoint::GetSafety() const 130 inline void G4StepPoint::AddKineticEnergy(cons << 129 { return fSafety; } 131 { << 130 inline void G4StepPoint::SetSafety(const G4double aValue) 132 fKineticEnergy += aValue; // Kinetic Energy << 131 { fSafety = aValue; } 133 } << 132 134 << 133 inline const G4ThreeVector& G4StepPoint::GetPolarization() const 135 inline G4double G4StepPoint::GetVelocity() con << 134 { return fPolarization; } 136 { << 135 inline void G4StepPoint::SetPolarization(const G4ThreeVector& aValue) 137 return fVelocity; << 136 { fPolarization = aValue; } 138 } << 137 inline void G4StepPoint::AddPolarization(const G4ThreeVector& aValue) 139 << 138 { fPolarization += aValue; } 140 inline void G4StepPoint::SetVelocity(G4double << 139 141 { << 140 inline G4StepStatus G4StepPoint::GetStepStatus() const 142 fVelocity = v; << 141 { return fStepStatus; } 143 } << 142 inline void G4StepPoint::SetStepStatus(const G4StepStatus aValue) 144 << 143 { fStepStatus = aValue; } 145 inline G4double G4StepPoint::GetBeta() const << 144 146 { << 145 inline const G4VProcess* G4StepPoint::GetProcessDefinedStep() const 147 return fVelocity / CLHEP::c_light; // Veloc << 146 { return fpProcessDefinedStep; } 148 } // in u << 147 // If the pointer is 0, this means the Step is defined 149 << 148 // by the user defined limit in the current volume. 150 inline G4double G4StepPoint::GetGamma() const << 149 inline void G4StepPoint::SetProcessDefinedStep(G4VProcess* aValue) 151 { << 150 { fpProcessDefinedStep = aValue; } 152 return (fMass == 0.) ? DBL_MAX : (fKineticEn << 151 153 // Gamma factor (1/sqrt[1-beta*beta]) of t << 152 inline G4double G4StepPoint::GetMass() const 154 } << 153 { return fMass; } 155 << 154 inline void G4StepPoint::SetMass(G4double value) 156 inline G4VPhysicalVolume* G4StepPoint::GetPhys << 155 { fMass = value; } 157 { << 156 158 return fpTouchable->GetVolume(); << 157 inline G4double G4StepPoint::GetCharge() const 159 } << 158 { return fCharge; } 160 << 159 inline void G4StepPoint::SetCharge(G4double value) 161 inline const G4VTouchable* G4StepPoint::GetTou << 160 { fCharge = value; } 162 { << 161 163 return fpTouchable(); << 162 inline G4Material* G4StepPoint::GetMaterial() const 164 } << 163 { return fpMaterial; } 165 << 164 inline void G4StepPoint::SetMaterial(G4Material* material) 166 inline const G4TouchableHandle& G4StepPoint::G << 165 {fpMaterial = material; } 167 { << 166 168 return fpTouchable; << 167 inline 169 } << 168 const G4MaterialCutsCouple* G4StepPoint::GetMaterialCutsCouple() const 170 << 169 { return fpMaterialCutsCouple; } 171 inline void G4StepPoint::SetTouchableHandle(co << 170 inline 172 { << 171 void G4StepPoint::SetMaterialCutsCouple(const G4MaterialCutsCouple* materialCutsCouple) 173 fpTouchable = apValue; << 172 {fpMaterialCutsCouple = materialCutsCouple; } 174 } << 173 175 << 174 inline G4VSensitiveDetector* G4StepPoint::GetSensitiveDetector() const 176 inline G4double G4StepPoint::GetSafety() const << 175 { return fpSensitiveDetector; } 177 { << 176 inline void G4StepPoint::SetSensitiveDetector(G4VSensitiveDetector* aValue) 178 return fSafety; << 177 { fpSensitiveDetector = aValue; } 179 } << 178 180 << 179 inline void G4StepPoint::SetWeight(G4double aValue) 181 inline void G4StepPoint::SetSafety(const G4dou << 180 { fWeight = aValue; } 182 { << 181 inline G4double G4StepPoint::GetWeight() const 183 fSafety = aValue; << 182 { return fWeight; } 184 } << 185 << 186 inline const G4ThreeVector& G4StepPoint::GetPo << 187 { << 188 return fPolarization; << 189 } << 190 << 191 inline void G4StepPoint::SetPolarization(const << 192 { << 193 fPolarization = aValue; << 194 } << 195 << 196 inline void G4StepPoint::AddPolarization(const << 197 { << 198 fPolarization += aValue; << 199 } << 200 << 201 inline G4StepStatus G4StepPoint::GetStepStatus << 202 { << 203 return fStepStatus; << 204 } << 205 << 206 inline void G4StepPoint::SetStepStatus(const G << 207 { << 208 fStepStatus = aValue; << 209 } << 210 << 211 inline const G4VProcess* G4StepPoint::GetProce << 212 { << 213 // If the pointer is 0, this means the Step << 214 // by the user defined limit in the current << 215 return fpProcessDefinedStep; << 216 } << 217 << 218 inline void G4StepPoint::SetProcessDefinedStep << 219 { << 220 fpProcessDefinedStep = aValue; << 221 } << 222 << 223 inline G4double G4StepPoint::GetMass() const << 224 { << 225 return fMass; << 226 } << 227 << 228 inline void G4StepPoint::SetMass(G4double valu << 229 { << 230 fMass = value; << 231 } << 232 << 233 inline G4double G4StepPoint::GetCharge() const << 234 { << 235 return fCharge; << 236 } << 237 << 238 inline void G4StepPoint::SetCharge(G4double va << 239 { << 240 fCharge = value; << 241 } << 242 << 243 inline G4double G4StepPoint::GetMagneticMoment << 244 { << 245 return fMagneticMoment; << 246 } << 247 << 248 inline void G4StepPoint::SetMagneticMoment(G4d << 249 { << 250 fMagneticMoment = value; << 251 } << 252 << 253 inline G4Material* G4StepPoint::GetMaterial() << 254 { << 255 return fpMaterial; << 256 } << 257 << 258 inline void G4StepPoint::SetMaterial(G4Materia << 259 { << 260 fpMaterial = material; << 261 } << 262 << 263 inline const G4MaterialCutsCouple* G4StepPoint << 264 { << 265 return fpMaterialCutsCouple; << 266 } << 267 << 268 inline void G4StepPoint::SetMaterialCutsCouple << 269 const G4MaterialCutsCouple* materialCutsCoup << 270 { << 271 fpMaterialCutsCouple = materialCutsCouple; << 272 } << 273 << 274 inline G4VSensitiveDetector* G4StepPoint::GetS << 275 { << 276 return fpSensitiveDetector; << 277 } << 278 << 279 inline void G4StepPoint::SetSensitiveDetector( << 280 { << 281 fpSensitiveDetector = aValue; << 282 } << 283 << 284 inline void G4StepPoint::SetWeight(G4double aV << 285 { << 286 fWeight = aValue; << 287 } << 288 << 289 inline G4double G4StepPoint::GetWeight() const << 290 { << 291 return fWeight; << 292 } << 293 183