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