[826] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4ParticleChange.icc,v 1.14 2007/03/11 07:19:06 kurasige Exp $ |
---|
[850] | 28 | // GEANT4 tag $Name: HEAD $ |
---|
[826] | 29 | // |
---|
| 30 | // |
---|
| 31 | inline |
---|
| 32 | G4Step* G4ParticleChange::UpdateStepInfo(G4Step* pStep) |
---|
| 33 | { |
---|
| 34 | return G4VParticleChange::UpdateStepInfo(pStep); |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | inline |
---|
| 38 | G4double G4ParticleChange::GetEnergy() const |
---|
| 39 | { |
---|
| 40 | return theEnergyChange; |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | inline |
---|
| 44 | void G4ParticleChange::ProposeEnergy(G4double finalEnergy) |
---|
| 45 | { |
---|
| 46 | theEnergyChange = finalEnergy; |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | inline |
---|
| 50 | const G4ThreeVector* G4ParticleChange::GetMomentumDirection() const |
---|
| 51 | { |
---|
| 52 | return &theMomentumDirectionChange; |
---|
| 53 | } |
---|
| 54 | |
---|
| 55 | inline |
---|
| 56 | void G4ParticleChange::ProposeMomentumDirection( |
---|
| 57 | G4double Px, |
---|
| 58 | G4double Py, |
---|
| 59 | G4double Pz ) |
---|
| 60 | { |
---|
| 61 | theMomentumDirectionChange.setX(Px); |
---|
| 62 | theMomentumDirectionChange.setY(Py); |
---|
| 63 | theMomentumDirectionChange.setZ(Pz); |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | inline |
---|
| 67 | void G4ParticleChange::ProposeMomentumDirection(const G4ThreeVector& P) |
---|
| 68 | { |
---|
| 69 | theMomentumDirectionChange = P; |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | inline |
---|
| 74 | const G4ThreeVector* G4ParticleChange::GetPolarization() const |
---|
| 75 | { |
---|
| 76 | return &thePolarizationChange; |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | inline |
---|
| 80 | void G4ParticleChange::ProposePolarization( const G4ThreeVector& finalPoralization) |
---|
| 81 | { |
---|
| 82 | thePolarizationChange = finalPoralization; |
---|
| 83 | } |
---|
| 84 | |
---|
| 85 | inline |
---|
| 86 | void G4ParticleChange::ProposePolarization( |
---|
| 87 | G4double Px, |
---|
| 88 | G4double Py, |
---|
| 89 | G4double Pz ) |
---|
| 90 | { |
---|
| 91 | thePolarizationChange.setX(Px); |
---|
| 92 | thePolarizationChange.setY(Py); |
---|
| 93 | thePolarizationChange.setZ(Pz); |
---|
| 94 | } |
---|
| 95 | |
---|
| 96 | inline |
---|
| 97 | const G4ThreeVector* G4ParticleChange::GetPosition() const |
---|
| 98 | { |
---|
| 99 | return &thePositionChange; |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | inline |
---|
| 103 | void G4ParticleChange::ProposePosition(const G4ThreeVector& finalPosition) |
---|
| 104 | { |
---|
| 105 | thePositionChange= finalPosition; |
---|
| 106 | } |
---|
| 107 | |
---|
| 108 | inline |
---|
| 109 | void G4ParticleChange::ProposePosition(G4double x,G4double y, G4double z) |
---|
| 110 | { |
---|
| 111 | thePositionChange.setX(x); |
---|
| 112 | thePositionChange.setY(y); |
---|
| 113 | thePositionChange.setZ(z); |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | inline |
---|
| 117 | G4double G4ParticleChange::GetProperTime() const |
---|
| 118 | { |
---|
| 119 | return theProperTimeChange; |
---|
| 120 | } |
---|
| 121 | |
---|
| 122 | inline |
---|
| 123 | void G4ParticleChange::ProposeProperTime(G4double tau) |
---|
| 124 | { |
---|
| 125 | theProperTimeChange = tau; |
---|
| 126 | } |
---|
| 127 | |
---|
| 128 | inline |
---|
| 129 | G4ThreeVector G4ParticleChange::GetGlobalPosition(const G4ThreeVector& displacement) const |
---|
| 130 | { |
---|
| 131 | return thePositionChange + displacement; |
---|
| 132 | } |
---|
| 133 | |
---|
| 134 | |
---|
| 135 | inline |
---|
| 136 | G4double G4ParticleChange::GetGlobalTime(G4double timeDelay) const |
---|
| 137 | { |
---|
| 138 | // Convert the time delay to the global time. |
---|
| 139 | return theTimeChange + timeDelay; |
---|
| 140 | } |
---|
| 141 | |
---|
| 142 | inline |
---|
| 143 | G4double G4ParticleChange::GetGlobalTime() const |
---|
| 144 | { |
---|
| 145 | return theTimeChange; |
---|
| 146 | } |
---|
| 147 | |
---|
| 148 | inline |
---|
| 149 | void G4ParticleChange::ProposeGlobalTime(G4double t) |
---|
| 150 | { |
---|
| 151 | theTimeChange = t; |
---|
| 152 | } |
---|
| 153 | |
---|
| 154 | inline |
---|
| 155 | G4double G4ParticleChange::GetMass() const |
---|
| 156 | { |
---|
| 157 | return theMassChange; |
---|
| 158 | } |
---|
| 159 | |
---|
| 160 | inline |
---|
| 161 | void G4ParticleChange::ProposeMass(G4double t) |
---|
| 162 | { |
---|
| 163 | theMassChange = t; |
---|
| 164 | } |
---|
| 165 | |
---|
| 166 | inline |
---|
| 167 | G4double G4ParticleChange::GetCharge() const |
---|
| 168 | { |
---|
| 169 | return theChargeChange; |
---|
| 170 | } |
---|
| 171 | |
---|
| 172 | inline |
---|
| 173 | void G4ParticleChange::ProposeCharge(G4double t) |
---|
| 174 | { |
---|
| 175 | theChargeChange = t; |
---|
| 176 | } |
---|
| 177 | |
---|
| 178 | |
---|
| 179 | inline |
---|
| 180 | G4double G4ParticleChange::GetMagneticMoment() const |
---|
| 181 | { |
---|
| 182 | return theMagneticMomentChange; |
---|
| 183 | } |
---|
| 184 | |
---|
| 185 | inline |
---|
| 186 | void G4ParticleChange::ProposeMagneticMoment(G4double finalMagneticMoment) |
---|
| 187 | { |
---|
| 188 | theMagneticMomentChange = finalMagneticMoment; |
---|
| 189 | } |
---|
| 190 | |
---|
| 191 | inline |
---|
| 192 | G4double G4ParticleChange::GetWeight() const |
---|
| 193 | { |
---|
| 194 | return G4VParticleChange::GetParentWeight(); |
---|
| 195 | } |
---|
| 196 | |
---|
| 197 | inline |
---|
| 198 | void G4ParticleChange::ProposeWeight(G4double w) |
---|
| 199 | { |
---|
| 200 | G4VParticleChange::ProposeParentWeight(w); |
---|
| 201 | } |
---|
| 202 | |
---|
| 203 | inline |
---|
| 204 | G4ThreeVector G4ParticleChange::CalcMomentum(G4double energy, |
---|
| 205 | G4ThreeVector direction, |
---|
| 206 | G4double mass |
---|
| 207 | ) const |
---|
| 208 | { |
---|
| 209 | G4double tMomentum = std::sqrt(energy*energy + 2*energy*mass); |
---|
| 210 | return direction*tMomentum; |
---|
| 211 | } |
---|
| 212 | |
---|