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.3 2001/02/17 11:25:10 kurasige Exp $ >> 9 // GEANT4 tag $Name: geant4-03-01 $ 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 return fVelocity; 98 fMomentumDirection = aValue; << 81 } 99 } << 82 inline void G4StepPoint::SetVelocity(G4double v) 100 << 83 { 101 inline void G4StepPoint::AddMomentumDirection( << 84 fVelocity = v; 102 { << 85 } 103 fMomentumDirection += aValue; // Direction << 86 104 } << 87 105 << 88 inline G4double G4StepPoint::GetBeta() const 106 inline G4ThreeVector G4StepPoint::GetMomentum( << 89 { 107 { << 90 return fVelocity/c_light; 108 G4double tMomentum = // Total mome << 91 } 109 std::sqrt(fKineticEnergy * fKineticEnergy << 92 110 return G4ThreeVector(fMomentumDirection.x() << 93 // Velocity of the track in unit of c(light velocity) 111 fMomentumDirection.y() << 94 112 fMomentumDirection.z() << 95 inline G4double G4StepPoint::GetGamma() const 113 } << 96 { return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; } 114 << 97 // Gamma factor (1/sqrt[1-beta*beta]) of the track 115 inline G4double G4StepPoint::GetTotalEnergy() << 98 116 { << 99 inline G4VPhysicalVolume* G4StepPoint::GetPhysicalVolume() const 117 return fKineticEnergy + fMass; // Total ene << 100 { return fpTouchable->GetVolume(); } 118 } << 101 119 << 102 inline const G4VTouchable* G4StepPoint::GetTouchable() const 120 inline G4double G4StepPoint::GetKineticEnergy( << 103 { return fpTouchable; } 121 { << 104 inline void G4StepPoint::SetTouchable(const G4VTouchable* apValue) 122 return fKineticEnergy; << 105 { fpTouchable = apValue; } 123 } << 106 124 << 107 inline G4double G4StepPoint::GetSafety() const 125 inline void G4StepPoint::SetKineticEnergy(cons << 108 { return fSafety; } 126 { << 109 inline void G4StepPoint::SetSafety(const G4double aValue) 127 fKineticEnergy = aValue; << 110 { fSafety = aValue; } 128 } << 111 129 << 112 inline const G4ThreeVector& G4StepPoint::GetPolarization() const 130 inline void G4StepPoint::AddKineticEnergy(cons << 113 { return fPolarization; } 131 { << 114 inline void G4StepPoint::SetPolarization(const G4ThreeVector& aValue) 132 fKineticEnergy += aValue; // Kinetic Energy << 115 { fPolarization = aValue; } 133 } << 116 inline void G4StepPoint::AddPolarization(const G4ThreeVector& aValue) 134 << 117 { fPolarization += aValue; } 135 inline G4double G4StepPoint::GetVelocity() con << 118 136 { << 119 inline G4StepStatus G4StepPoint::GetStepStatus() const 137 return fVelocity; << 120 { return fStepStatus; } 138 } << 121 inline void G4StepPoint::SetStepStatus(const G4StepStatus aValue) 139 << 122 { fStepStatus = aValue; } 140 inline void G4StepPoint::SetVelocity(G4double << 123 141 { << 124 inline const G4VProcess* G4StepPoint::GetProcessDefinedStep() const 142 fVelocity = v; << 125 { return fpProcessDefinedStep; } 143 } << 126 // If the pointer is 0, this means the Step is defined 144 << 127 // by the user defined limit in the current volume. 145 inline G4double G4StepPoint::GetBeta() const << 128 inline void G4StepPoint::SetProcessDefinedStep(G4VProcess* aValue) 146 { << 129 { fpProcessDefinedStep = aValue; } 147 return fVelocity / CLHEP::c_light; // Veloc << 130 148 } // in u << 131 inline G4double G4StepPoint::GetMass() const 149 << 132 { return fMass; } 150 inline G4double G4StepPoint::GetGamma() const << 133 inline void G4StepPoint::SetMass(G4double value) 151 { << 134 { fMass = value; } 152 return (fMass == 0.) ? DBL_MAX : (fKineticEn << 135 153 // Gamma factor (1/sqrt[1-beta*beta]) of t << 136 inline G4double G4StepPoint::GetCharge() const 154 } << 137 { return fCharge; } 155 << 138 inline void G4StepPoint::SetCharge(G4double value) 156 inline G4VPhysicalVolume* G4StepPoint::GetPhys << 139 { fCharge = value; } 157 { << 140 158 return fpTouchable->GetVolume(); << 141 inline G4Material* G4StepPoint::GetMaterial() const 159 } << 142 { return fpMaterial; } 160 << 143 inline void G4StepPoint::SetMaterial(G4Material* material) 161 inline const G4VTouchable* G4StepPoint::GetTou << 144 {fpMaterial = material; } 162 { << 145 163 return fpTouchable(); << 146 inline void G4StepPoint::SetWeight(G4double aValue) 164 } << 147 { fWeight = aValue; } 165 << 148 inline G4double G4StepPoint::GetWeight() const 166 inline const G4TouchableHandle& G4StepPoint::G << 149 { return fWeight; } 167 { << 168 return fpTouchable; << 169 } << 170 << 171 inline void G4StepPoint::SetTouchableHandle(co << 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 150