00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // 00030 inline 00031 G4Step* G4ParticleChange::UpdateStepInfo(G4Step* pStep) 00032 { 00033 return G4VParticleChange::UpdateStepInfo(pStep); 00034 } 00035 00036 inline 00037 G4double G4ParticleChange::GetEnergy() const 00038 { 00039 return theEnergyChange; 00040 } 00041 00042 inline 00043 void G4ParticleChange::ProposeEnergy(G4double finalEnergy) 00044 { 00045 theEnergyChange = finalEnergy; 00046 } 00047 00048 inline 00049 G4double G4ParticleChange::GetVelocity() const 00050 { 00051 return theVelocityChange; 00052 } 00053 00054 inline 00055 void G4ParticleChange::ProposeVelocity(G4double finalVelocity) 00056 { 00057 theVelocityChange = finalVelocity; 00058 isVelocityChanged = true; 00059 } 00060 00061 inline 00062 const G4ThreeVector* G4ParticleChange::GetMomentumDirection() const 00063 { 00064 return &theMomentumDirectionChange; 00065 } 00066 00067 inline 00068 void G4ParticleChange::ProposeMomentumDirection( 00069 G4double Px, 00070 G4double Py, 00071 G4double Pz ) 00072 { 00073 theMomentumDirectionChange.setX(Px); 00074 theMomentumDirectionChange.setY(Py); 00075 theMomentumDirectionChange.setZ(Pz); 00076 } 00077 00078 inline 00079 void G4ParticleChange::ProposeMomentumDirection(const G4ThreeVector& P) 00080 { 00081 theMomentumDirectionChange = P; 00082 } 00083 00084 00085 inline 00086 const G4ThreeVector* G4ParticleChange::GetPolarization() const 00087 { 00088 return &thePolarizationChange; 00089 } 00090 00091 inline 00092 void G4ParticleChange::ProposePolarization( const G4ThreeVector& finalPoralization) 00093 { 00094 thePolarizationChange = finalPoralization; 00095 } 00096 00097 inline 00098 void G4ParticleChange::ProposePolarization( 00099 G4double Px, 00100 G4double Py, 00101 G4double Pz ) 00102 { 00103 thePolarizationChange.setX(Px); 00104 thePolarizationChange.setY(Py); 00105 thePolarizationChange.setZ(Pz); 00106 } 00107 00108 inline 00109 const G4ThreeVector* G4ParticleChange::GetPosition() const 00110 { 00111 return &thePositionChange; 00112 } 00113 00114 inline 00115 void G4ParticleChange::ProposePosition(const G4ThreeVector& finalPosition) 00116 { 00117 thePositionChange= finalPosition; 00118 } 00119 00120 inline 00121 void G4ParticleChange::ProposePosition(G4double x,G4double y, G4double z) 00122 { 00123 thePositionChange.setX(x); 00124 thePositionChange.setY(y); 00125 thePositionChange.setZ(z); 00126 } 00127 00128 inline 00129 G4double G4ParticleChange::GetProperTime() const 00130 { 00131 return theProperTimeChange; 00132 } 00133 00134 inline 00135 void G4ParticleChange::ProposeProperTime(G4double tau) 00136 { 00137 theProperTimeChange = tau; 00138 } 00139 00140 inline 00141 G4ThreeVector G4ParticleChange::GetGlobalPosition(const G4ThreeVector& displacement) const 00142 { 00143 return thePositionChange + displacement; 00144 } 00145 00146 inline 00147 void G4ParticleChange::ProposeGlobalTime(G4double t) 00148 { 00149 theTimeChange = (t-theGlobalTime0) + theLocalTime0; 00150 } 00151 00152 inline 00153 G4double G4ParticleChange::GetGlobalTime(G4double timeDelay) const 00154 { 00155 // Convert the time delay to the global time. 00156 return theGlobalTime0 + (theTimeChange-theLocalTime0) + timeDelay; 00157 } 00158 00159 inline 00160 void G4ParticleChange::ProposeLocalTime(G4double t) 00161 { 00162 theTimeChange = t; 00163 } 00164 00165 inline 00166 G4double G4ParticleChange::GetLocalTime(G4double timeDelay) const 00167 { 00168 // Convert the time delay to the local time. 00169 return theTimeChange + timeDelay; 00170 } 00171 00172 inline 00173 G4double G4ParticleChange::GetMass() const 00174 { 00175 return theMassChange; 00176 } 00177 00178 inline 00179 void G4ParticleChange::ProposeMass(G4double t) 00180 { 00181 theMassChange = t; 00182 } 00183 00184 inline 00185 G4double G4ParticleChange::GetCharge() const 00186 { 00187 return theChargeChange; 00188 } 00189 00190 inline 00191 void G4ParticleChange::ProposeCharge(G4double t) 00192 { 00193 theChargeChange = t; 00194 } 00195 00196 00197 inline 00198 G4double G4ParticleChange::GetMagneticMoment() const 00199 { 00200 return theMagneticMomentChange; 00201 } 00202 00203 inline 00204 void G4ParticleChange::ProposeMagneticMoment(G4double finalMagneticMoment) 00205 { 00206 theMagneticMomentChange = finalMagneticMoment; 00207 } 00208 00209 inline 00210 G4ThreeVector G4ParticleChange::CalcMomentum(G4double energy, 00211 G4ThreeVector direction, 00212 G4double mass 00213 ) const 00214 { 00215 G4double tMomentum = std::sqrt(energy*energy + 2*energy*mass); 00216 return direction*tMomentum; 00217 } 00218