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