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 // 29 // ------------------------------------------- << 28 // 30 << 29 inline 31 inline const G4ThreeVector& G4StepPoint::GetPo << 30 const G4ThreeVector& G4StepPoint::GetPosition() const 32 { << 31 { return fPosition; } 33 return fPosition; << 32 34 } << 33 inline 35 << 34 void G4StepPoint::SetPosition(const G4ThreeVector& aValue) 36 inline void G4StepPoint::SetPosition(const G4T << 35 { fPosition = aValue; } 37 { << 36 38 fPosition = aValue; << 37 inline 39 } << 38 void G4StepPoint::AddPosition(const G4ThreeVector& aValue) 40 << 39 { fPosition += aValue; } // Position where the track locates 41 inline void G4StepPoint::AddPosition(const G4T << 40 42 { << 41 inline 43 fPosition += aValue; // Position where the << 42 G4double G4StepPoint::GetLocalTime() const 44 } << 43 { return fLocalTime; } 45 << 44 46 inline G4double G4StepPoint::GetLocalTime() co << 45 inline 47 { << 46 void G4StepPoint::SetLocalTime(const G4double aValue) 48 return fLocalTime; << 47 { fLocalTime = aValue; } 49 } << 48 50 << 49 inline 51 inline void G4StepPoint::SetLocalTime(const G4 << 50 void G4StepPoint::AddLocalTime(const G4double aValue) 52 { << 51 { fLocalTime += aValue; } // Time since the track is created. 53 fLocalTime = aValue; << 52 54 } << 53 inline 55 << 54 G4double G4StepPoint::GetGlobalTime() const 56 inline void G4StepPoint::AddLocalTime(const G4 << 55 { return fGlobalTime; } 57 { << 56 58 fLocalTime += aValue; // Time since the tra << 57 inline 59 } << 58 void G4StepPoint::SetGlobalTime(const G4double aValue) 60 << 59 { fGlobalTime = aValue; } 61 inline G4double G4StepPoint::GetGlobalTime() c << 60 62 { << 61 inline 63 return fGlobalTime; << 62 void G4StepPoint::AddGlobalTime(const G4double aValue) 64 } << 63 { fGlobalTime += aValue; } 65 << 64 // Time since the event in which the track belongs is created. 66 inline void G4StepPoint::SetGlobalTime(const G << 65 67 { << 66 inline 68 fGlobalTime = aValue; << 67 G4double G4StepPoint::GetProperTime() const 69 } << 68 { return fProperTime; } 70 << 69 71 inline void G4StepPoint::AddGlobalTime(const G << 70 inline 72 { << 71 void G4StepPoint::SetProperTime(const G4double aValue) 73 fGlobalTime += aValue; // Time since the ev << 72 { fProperTime = aValue; } 74 } // track belongs is << 73 75 << 74 inline 76 inline G4double G4StepPoint::GetProperTime() c << 75 void G4StepPoint::AddProperTime(const G4double aValue) 77 { << 76 { fProperTime += aValue; } // Proper time of the particle. 78 return fProperTime; << 77 79 } << 78 inline 80 << 79 const G4ThreeVector& G4StepPoint::GetMomentumDirection() const 81 inline void G4StepPoint::SetProperTime(const G << 80 { return fMomentumDirection; } 82 { << 81 83 fProperTime = aValue; << 82 inline 84 } << 83 void G4StepPoint::SetMomentumDirection(const G4ThreeVector& aValue) 85 << 84 { fMomentumDirection = aValue; } 86 inline void G4StepPoint::AddProperTime(const G << 85 87 { << 86 inline 88 fProperTime += aValue; // Proper time of th << 87 void G4StepPoint::AddMomentumDirection(const G4ThreeVector& aValue) 89 } << 88 { fMomentumDirection += aValue;} // Direction of momentum (should be an unit vector) 90 << 89 91 inline const G4ThreeVector& G4StepPoint::GetMo << 90 inline 92 { << 91 G4ThreeVector G4StepPoint::GetMomentum() const 93 return fMomentumDirection; << 92 { 94 } << 93 G4double tMomentum = std::sqrt(fKineticEnergy*fKineticEnergy + 95 << 94 2*fKineticEnergy*fMass); 96 inline void G4StepPoint::SetMomentumDirection( << 95 return G4ThreeVector(fMomentumDirection.x()*tMomentum, 97 { << 96 fMomentumDirection.y()*tMomentum, 98 fMomentumDirection = aValue; << 97 fMomentumDirection.z()*tMomentum); 99 } << 98 } 100 << 99 // Total momentum of the track 101 inline void G4StepPoint::AddMomentumDirection( << 100 102 { << 101 inline 103 fMomentumDirection += aValue; // Direction << 102 G4double G4StepPoint::GetTotalEnergy() const 104 } << 103 { return fKineticEnergy + fMass; } // Total energy of the track 105 << 104 106 inline G4ThreeVector G4StepPoint::GetMomentum( << 105 inline 107 { << 106 G4double G4StepPoint::GetKineticEnergy() const 108 G4double tMomentum = // Total mome << 107 { return fKineticEnergy; } 109 std::sqrt(fKineticEnergy * fKineticEnergy << 108 110 return G4ThreeVector(fMomentumDirection.x() << 109 inline 111 fMomentumDirection.y() << 110 void G4StepPoint::SetKineticEnergy(const G4double aValue) 112 fMomentumDirection.z() << 111 { fKineticEnergy = aValue; } 113 } << 112 114 << 113 inline 115 inline G4double G4StepPoint::GetTotalEnergy() << 114 void G4StepPoint::AddKineticEnergy(const G4double aValue) 116 { << 115 { fKineticEnergy += aValue; }// Kinetic Energy of the track 117 return fKineticEnergy + fMass; // Total ene << 116 118 } << 117 inline 119 << 118 G4double G4StepPoint::GetVelocity() const 120 inline G4double G4StepPoint::GetKineticEnergy( << 119 { return fVelocity; } 121 { << 120 122 return fKineticEnergy; << 121 inline 123 } << 122 void G4StepPoint::SetVelocity(G4double v) 124 << 123 { fVelocity = v; } 125 inline void G4StepPoint::SetKineticEnergy(cons << 124 126 { << 125 inline 127 fKineticEnergy = aValue; << 126 G4double G4StepPoint::GetBeta() const 128 } << 127 { return fVelocity/CLHEP::c_light; } 129 << 128 // Velocity of the track in unit of c(light velocity) 130 inline void G4StepPoint::AddKineticEnergy(cons << 129 131 { << 130 inline 132 fKineticEnergy += aValue; // Kinetic Energy << 131 G4double G4StepPoint::GetGamma() const 133 } << 132 { return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; } 134 << 133 // Gamma factor (1/sqrt[1-beta*beta]) of the track 135 inline G4double G4StepPoint::GetVelocity() con << 134 136 { << 135 inline 137 return fVelocity; << 136 G4VPhysicalVolume* G4StepPoint::GetPhysicalVolume() const 138 } << 137 { return fpTouchable->GetVolume(); } 139 << 138 140 inline void G4StepPoint::SetVelocity(G4double << 139 inline 141 { << 140 const G4VTouchable* G4StepPoint::GetTouchable() const 142 fVelocity = v; << 141 { return fpTouchable(); } 143 } << 142 144 << 143 inline 145 inline G4double G4StepPoint::GetBeta() const << 144 const G4TouchableHandle& G4StepPoint::GetTouchableHandle() const 146 { << 145 { return fpTouchable; } 147 return fVelocity / CLHEP::c_light; // Veloc << 146 148 } // in u << 147 inline 149 << 148 void G4StepPoint::SetTouchableHandle(const G4TouchableHandle& apValue) 150 inline G4double G4StepPoint::GetGamma() const << 149 { fpTouchable = apValue; } 151 { << 150 152 return (fMass == 0.) ? DBL_MAX : (fKineticEn << 151 inline 153 // Gamma factor (1/sqrt[1-beta*beta]) of t << 152 G4double G4StepPoint::GetSafety() const 154 } << 153 { return fSafety; } 155 << 154 156 inline G4VPhysicalVolume* G4StepPoint::GetPhys << 155 inline 157 { << 156 void G4StepPoint::SetSafety(const G4double aValue) 158 return fpTouchable->GetVolume(); << 157 { fSafety = aValue; } 159 } << 158 160 << 159 inline 161 inline const G4VTouchable* G4StepPoint::GetTou << 160 const G4ThreeVector& G4StepPoint::GetPolarization() const 162 { << 161 { return fPolarization; } 163 return fpTouchable(); << 162 164 } << 163 inline 165 << 164 void G4StepPoint::SetPolarization(const G4ThreeVector& aValue) 166 inline const G4TouchableHandle& G4StepPoint::G << 165 { fPolarization = aValue; } 167 { << 166 168 return fpTouchable; << 167 inline 169 } << 168 void G4StepPoint::AddPolarization(const G4ThreeVector& aValue) 170 << 169 { fPolarization += aValue; } 171 inline void G4StepPoint::SetTouchableHandle(co << 170 172 { << 171 inline 173 fpTouchable = apValue; << 172 G4StepStatus G4StepPoint::GetStepStatus() const 174 } << 173 { return fStepStatus; } 175 << 174 176 inline G4double G4StepPoint::GetSafety() const << 175 inline 177 { << 176 void G4StepPoint::SetStepStatus(const G4StepStatus aValue) 178 return fSafety; << 177 { fStepStatus = aValue; } 179 } << 178 180 << 179 inline 181 inline void G4StepPoint::SetSafety(const G4dou << 180 const G4VProcess* G4StepPoint::GetProcessDefinedStep() const 182 { << 181 { return fpProcessDefinedStep; } 183 fSafety = aValue; << 182 // If the pointer is 0, this means the Step is defined 184 } << 183 // by the user defined limit in the current volume. 185 << 184 186 inline const G4ThreeVector& G4StepPoint::GetPo << 185 inline 187 { << 186 void G4StepPoint::SetProcessDefinedStep(const G4VProcess* aValue) 188 return fPolarization; << 187 { fpProcessDefinedStep = aValue; } 189 } << 188 190 << 189 inline 191 inline void G4StepPoint::SetPolarization(const << 190 G4double G4StepPoint::GetMass() const 192 { << 191 { return fMass; } 193 fPolarization = aValue; << 192 194 } << 193 inline 195 << 194 void G4StepPoint::SetMass(G4double value) 196 inline void G4StepPoint::AddPolarization(const << 195 { fMass = value; } 197 { << 196 198 fPolarization += aValue; << 197 inline 199 } << 198 G4double G4StepPoint::GetCharge() const 200 << 199 { return fCharge; } 201 inline G4StepStatus G4StepPoint::GetStepStatus << 200 202 { << 201 inline 203 return fStepStatus; << 202 void G4StepPoint::SetCharge(G4double value) 204 } << 203 { fCharge = value; } 205 << 204 206 inline void G4StepPoint::SetStepStatus(const G << 205 inline 207 { << 206 G4double G4StepPoint::GetMagneticMoment() const 208 fStepStatus = aValue; << 207 { return fMagneticMoment; } 209 } << 208 210 << 209 inline 211 inline const G4VProcess* G4StepPoint::GetProce << 210 void G4StepPoint::SetMagneticMoment(G4double value) 212 { << 211 { fMagneticMoment = value; } 213 // If the pointer is 0, this means the Step << 212 214 // by the user defined limit in the current << 213 inline 215 return fpProcessDefinedStep; << 214 G4Material* G4StepPoint::GetMaterial() const 216 } << 215 { return fpMaterial; } 217 << 216 218 inline void G4StepPoint::SetProcessDefinedStep << 217 inline 219 { << 218 void G4StepPoint::SetMaterial(G4Material* material) 220 fpProcessDefinedStep = aValue; << 219 {fpMaterial = material; } 221 } << 220 222 << 221 inline 223 inline G4double G4StepPoint::GetMass() const << 222 const G4MaterialCutsCouple* G4StepPoint::GetMaterialCutsCouple() const 224 { << 223 { return fpMaterialCutsCouple; } 225 return fMass; << 224 226 } << 225 inline 227 << 226 void G4StepPoint::SetMaterialCutsCouple(const G4MaterialCutsCouple* materialCutsCouple) 228 inline void G4StepPoint::SetMass(G4double valu << 227 { fpMaterialCutsCouple = materialCutsCouple; } 229 { << 228 230 fMass = value; << 229 inline 231 } << 230 G4VSensitiveDetector* G4StepPoint::GetSensitiveDetector() const 232 << 231 { return fpSensitiveDetector; } 233 inline G4double G4StepPoint::GetCharge() const << 232 234 { << 233 inline 235 return fCharge; << 234 void G4StepPoint::SetSensitiveDetector(G4VSensitiveDetector* aValue) 236 } << 235 { fpSensitiveDetector = aValue; } 237 << 236 238 inline void G4StepPoint::SetCharge(G4double va << 237 inline 239 { << 238 void G4StepPoint::SetWeight(G4double aValue) 240 fCharge = value; << 239 { fWeight = aValue; } 241 } << 240 242 << 241 inline 243 inline G4double G4StepPoint::GetMagneticMoment << 242 G4double G4StepPoint::GetWeight() const 244 { << 243 { return fWeight; } 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 244