Geant4 Cross Reference |
>> 1 // This code implementation is the intellectual property of >> 2 // the GEANT4 collaboration. 1 // 3 // 2 // ******************************************* << 4 // By copying, distributing or modifying the Program (or any work 3 // * License and Disclaimer << 5 // based on the Program) you indicate your acceptance of this statement, 4 // * << 6 // and all its terms. 5 // * The Geant4 software is copyright of th << 6 // * the Geant4 Collaboration. It is provided << 7 // * conditions of the Geant4 Software License << 8 // * LICENSE and available at http://cern.ch/ << 9 // * include a list of copyright holders. << 10 // * << 11 // * Neither the authors of this software syst << 12 // * institutes,nor the agencies providing fin << 13 // * work make any representation or warran << 14 // * regarding this software system or assum << 15 // * use. Please see the license in the file << 16 // * for the full disclaimer and the limitatio << 17 // * << 18 // * This code implementation is the result << 19 // * technical work of the GEANT4 collaboratio << 20 // * By using, copying, modifying or distri << 21 // * any work based on the software) you ag << 22 // * use in resulting scientific publicati << 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* << 25 // 7 // 26 // G4StepPoint inline methods implementation << 8 // $Id: G4StepPoint.icc,v 1.2 2000/06/01 02:28:57 kurasige Exp $ >> 9 // GEANT4 tag $Name: geant4-03-00 $ 27 // 10 // 28 // Author: Hisaya Kurashige, 16 February 2000 << 11 // 29 // ------------------------------------------- << 12 inline const G4ThreeVector& G4StepPoint::GetPosition() const 30 << 13 { return fPosition; } 31 inline const G4ThreeVector& G4StepPoint::GetPo << 14 inline void G4StepPoint::SetPosition(const G4ThreeVector& aValue) 32 { << 15 { fPosition = aValue; } 33 return fPosition; << 16 inline void G4StepPoint::AddPosition(const G4ThreeVector& aValue) 34 } << 17 { fPosition += aValue; } 35 << 18 // Position where the track locates 36 inline void G4StepPoint::SetPosition(const G4T << 19 37 { << 20 inline G4double G4StepPoint::GetLocalTime() const 38 fPosition = aValue; << 21 { return fLocalTime; } 39 } << 22 inline void G4StepPoint::SetLocalTime(const G4double aValue) 40 << 23 { fLocalTime = aValue; } 41 inline void G4StepPoint::AddPosition(const G4T << 24 inline void G4StepPoint::AddLocalTime(const G4double aValue) 42 { << 25 { fLocalTime += aValue; } 43 fPosition += aValue; // Position where the << 26 // Time since the track is created. 44 } << 27 45 << 28 inline G4double G4StepPoint::GetGlobalTime() const 46 inline G4double G4StepPoint::GetLocalTime() co << 29 { return fGlobalTime; } 47 { << 30 inline void G4StepPoint::SetGlobalTime(const G4double aValue) 48 return fLocalTime; << 31 { fGlobalTime = aValue; } 49 } << 32 inline void G4StepPoint::AddGlobalTime(const G4double aValue) 50 << 33 { fGlobalTime += aValue; } 51 inline void G4StepPoint::SetLocalTime(const G4 << 34 // Time since the event in which the track belongs is created. 52 { << 35 53 fLocalTime = aValue; << 36 inline G4double G4StepPoint::GetProperTime() const 54 } << 37 { return fProperTime; } 55 << 38 inline void G4StepPoint::SetProperTime(const G4double aValue) 56 inline void G4StepPoint::AddLocalTime(const G4 << 39 { fProperTime = aValue; } 57 { << 40 inline void G4StepPoint::AddProperTime(const G4double aValue) 58 fLocalTime += aValue; // Time since the tra << 41 { fProperTime += aValue; } 59 } << 42 // Proper time of the particle. 60 << 43 61 inline G4double G4StepPoint::GetGlobalTime() c << 44 inline const G4ThreeVector& G4StepPoint::GetMomentumDirection() const 62 { << 45 { return fMomentumDirection; } 63 return fGlobalTime; << 46 inline void G4StepPoint::SetMomentumDirection(const G4ThreeVector& aValue) 64 } << 47 { fMomentumDirection = aValue; 65 << 48 } 66 inline void G4StepPoint::SetGlobalTime(const G << 49 inline void G4StepPoint::AddMomentumDirection(const G4ThreeVector& aValue) 67 { << 50 { fMomentumDirection += aValue; 68 fGlobalTime = aValue; << 51 } 69 } << 52 // Direction of momentum (should be an unit vector) 70 << 53 71 inline void G4StepPoint::AddGlobalTime(const G << 54 inline G4ThreeVector G4StepPoint::GetMomentum() const 72 { << 55 { 73 fGlobalTime += aValue; // Time since the ev << 56 G4double tMomentum = sqrt(fKineticEnergy*fKineticEnergy + 74 } // track belongs is << 57 2*fKineticEnergy*fMass); 75 << 58 return G4ThreeVector(fMomentumDirection.x()*tMomentum, 76 inline G4double G4StepPoint::GetProperTime() c << 59 fMomentumDirection.y()*tMomentum, 77 { << 60 fMomentumDirection.z()*tMomentum); 78 return fProperTime; << 61 } 79 } << 62 // Total momentum of the track 80 << 63 81 inline void G4StepPoint::SetProperTime(const G << 64 inline G4double G4StepPoint::GetTotalEnergy() const 82 { << 65 { 83 fProperTime = aValue; << 66 return fKineticEnergy + fMass; 84 } << 67 } 85 << 68 // Total energy of the track 86 inline void G4StepPoint::AddProperTime(const G << 69 87 { << 70 inline G4double G4StepPoint::GetKineticEnergy() const 88 fProperTime += aValue; // Proper time of th << 71 { return fKineticEnergy; } 89 } << 72 inline void G4StepPoint::SetKineticEnergy(const G4double aValue) 90 << 73 { fKineticEnergy = aValue; } 91 inline const G4ThreeVector& G4StepPoint::GetMo << 74 inline void G4StepPoint::AddKineticEnergy(const G4double aValue) 92 { << 75 { fKineticEnergy += aValue; } 93 return fMomentumDirection; << 76 // Kinetic Energy of the track 94 } << 77 95 << 78 inline G4double G4StepPoint::GetVelocity() const 96 inline void G4StepPoint::SetMomentumDirection( << 79 { 97 { << 80 if(fMass==0.){ 98 fMomentumDirection = aValue; << 81 return c_light; 99 } << 82 } 100 << 83 else{ 101 inline void G4StepPoint::AddMomentumDirection( << 84 G4double tMomentum = sqrt(fKineticEnergy*fKineticEnergy + 102 { << 85 2.0*fKineticEnergy*fMass); 103 fMomentumDirection += aValue; // Direction << 86 G4double tTotalEnergy = fKineticEnergy + fMass; 104 } << 87 return tMomentum/tTotalEnergy*c_light; 105 << 88 } 106 inline G4ThreeVector G4StepPoint::GetMomentum( << 89 } 107 { << 90 // This velocity is the velocity as if in vacuum. 108 G4double tMomentum = // Total mome << 91 // (So it is not corrected for the refraction index 109 std::sqrt(fKineticEnergy * fKineticEnergy << 92 // in the case of photons - optical or X-rays.) 110 return G4ThreeVector(fMomentumDirection.x() << 93 // In order to get the velocity in the material, use 111 fMomentumDirection.y() << 94 // GetVelocity of G4Track. 112 fMomentumDirection.z() << 95 // 113 } << 96 114 << 97 inline G4double G4StepPoint::GetBeta() const 115 inline G4double G4StepPoint::GetTotalEnergy() << 98 { return (fMass==0.) ? 116 { << 99 1.0 : 117 return fKineticEnergy + fMass; // Total ene << 100 sqrt(fKineticEnergy*fKineticEnergy + 2.0*fKineticEnergy*fMass) 118 } << 101 /(fKineticEnergy+fMass); } 119 << 102 // Velocity of the track in unit of c(light velocity) 120 inline G4double G4StepPoint::GetKineticEnergy( << 103 121 { << 104 inline G4double G4StepPoint::GetGamma() const 122 return fKineticEnergy; << 105 { return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; } 123 } << 106 // Gamma factor (1/sqrt[1-beta*beta]) of the track 124 << 107 125 inline void G4StepPoint::SetKineticEnergy(cons << 108 inline G4VPhysicalVolume* G4StepPoint::GetPhysicalVolume() const 126 { << 109 { return fpTouchable->GetVolume(); } 127 fKineticEnergy = aValue; << 110 128 } << 111 inline const G4VTouchable* G4StepPoint::GetTouchable() const 129 << 112 { return fpTouchable; } 130 inline void G4StepPoint::AddKineticEnergy(cons << 113 inline void G4StepPoint::SetTouchable(const G4VTouchable* apValue) 131 { << 114 { fpTouchable = apValue; } 132 fKineticEnergy += aValue; // Kinetic Energy << 115 133 } << 116 inline G4double G4StepPoint::GetSafety() const 134 << 117 { return fSafety; } 135 inline G4double G4StepPoint::GetVelocity() con << 118 inline void G4StepPoint::SetSafety(const G4double aValue) 136 { << 119 { fSafety = aValue; } 137 return fVelocity; << 120 138 } << 121 inline const G4ThreeVector& G4StepPoint::GetPolarization() const 139 << 122 { return fPolarization; } 140 inline void G4StepPoint::SetVelocity(G4double << 123 inline void G4StepPoint::SetPolarization(const G4ThreeVector& aValue) 141 { << 124 { fPolarization = aValue; } 142 fVelocity = v; << 125 inline void G4StepPoint::AddPolarization(const G4ThreeVector& aValue) 143 } << 126 { fPolarization += aValue; } 144 << 127 145 inline G4double G4StepPoint::GetBeta() const << 128 inline G4StepStatus G4StepPoint::GetStepStatus() const 146 { << 129 { return fStepStatus; } 147 return fVelocity / CLHEP::c_light; // Veloc << 130 inline void G4StepPoint::SetStepStatus(const G4StepStatus aValue) 148 } // in u << 131 { fStepStatus = aValue; } 149 << 132 150 inline G4double G4StepPoint::GetGamma() const << 133 inline const G4VProcess* G4StepPoint::GetProcessDefinedStep() const 151 { << 134 { return fpProcessDefinedStep; } 152 return (fMass == 0.) ? DBL_MAX : (fKineticEn << 135 // If the pointer is 0, this means the Step is defined 153 // Gamma factor (1/sqrt[1-beta*beta]) of t << 136 // by the user defined limit in the current volume. 154 } << 137 inline void G4StepPoint::SetProcessDefinedStep(G4VProcess* aValue) 155 << 138 { fpProcessDefinedStep = aValue; } 156 inline G4VPhysicalVolume* G4StepPoint::GetPhys << 139 157 { << 140 inline G4double G4StepPoint::GetMass() const 158 return fpTouchable->GetVolume(); << 141 { return fMass; } 159 } << 142 inline void G4StepPoint::SetMass(G4double value) 160 << 143 { fMass = value; } 161 inline const G4VTouchable* G4StepPoint::GetTou << 144 162 { << 145 inline G4double G4StepPoint::GetCharge() const 163 return fpTouchable(); << 146 { return fCharge; } 164 } << 147 inline void G4StepPoint::SetCharge(G4double value) 165 << 148 { fCharge = value; } 166 inline const G4TouchableHandle& G4StepPoint::G << 149 167 { << 150 inline G4Material* G4StepPoint::GetMaterial() const 168 return fpTouchable; << 151 { return fpMaterial; } 169 } << 152 inline void G4StepPoint::SetMaterial(G4Material* material) 170 << 153 {fpMaterial = material; } 171 inline void G4StepPoint::SetTouchableHandle(co << 154 172 { << 155 inline void G4StepPoint::SetWeight(G4double aValue) 173 fpTouchable = apValue; << 156 { fWeight = aValue; } 174 } << 157 inline G4double G4StepPoint::GetWeight() const 175 << 158 { return fWeight; } 176 inline G4double G4StepPoint::GetSafety() const << 177 { << 178 return fSafety; << 179 } << 180 << 181 inline void G4StepPoint::SetSafety(const G4dou << 182 { << 183 fSafety = aValue; << 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 159