[819] | 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: G4FinalStateElasticBrennerZaider.cc,v 1.1 2007/10/12 23:11:41 pia Exp $ |
---|
| 28 | // GEANT4 tag $Name: $ |
---|
| 29 | // |
---|
| 30 | // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) |
---|
| 31 | // |
---|
| 32 | // Reference: TNS Geant4-DNA paper |
---|
| 33 | // Reference for implementation model: NIM. 155, pp. 145-156, 1978 |
---|
| 34 | |
---|
| 35 | // History: |
---|
| 36 | // ----------- |
---|
| 37 | // Date Name Modification |
---|
| 38 | // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper |
---|
| 39 | // |
---|
| 40 | // ------------------------------------------------------------------- |
---|
| 41 | |
---|
| 42 | // Class description: |
---|
| 43 | // Reference: TNS Geant4-DNA paper |
---|
| 44 | // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: |
---|
| 45 | // design foundation and implementation of the first set of models, |
---|
| 46 | // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. |
---|
| 47 | // Further documentation available from http://www.ge.infn.it/geant4/dna |
---|
| 48 | |
---|
| 49 | // ------------------------------------------------------------------- |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | #include "G4FinalStateElasticBrennerZaider.hh" |
---|
| 53 | #include "G4Track.hh" |
---|
| 54 | #include "G4Step.hh" |
---|
| 55 | #include "G4DynamicParticle.hh" |
---|
| 56 | #include "Randomize.hh" |
---|
| 57 | |
---|
| 58 | #include "G4ParticleTypes.hh" |
---|
| 59 | #include "G4ParticleDefinition.hh" |
---|
| 60 | #include "G4Electron.hh" |
---|
| 61 | #include "G4SystemOfUnits.hh" |
---|
| 62 | #include "G4ParticleMomentum.hh" |
---|
| 63 | |
---|
| 64 | G4FinalStateElasticBrennerZaider::G4FinalStateElasticBrennerZaider() |
---|
| 65 | { |
---|
| 66 | // These data members will be used in the next implementation iteration, |
---|
| 67 | // when the enriched PhysicsModel policy is implemented |
---|
| 68 | name = "FinalStateElasticBrennerZaider"; |
---|
| 69 | lowEnergyLimit = 7.4 * eV; |
---|
| 70 | highEnergyLimit = 10 * MeV; |
---|
| 71 | |
---|
| 72 | betaCoeff.push_back(7.51525); |
---|
| 73 | betaCoeff.push_back(-0.41912); |
---|
| 74 | betaCoeff.push_back(7.2017E-3); |
---|
| 75 | betaCoeff.push_back(-4.646E-5); |
---|
| 76 | betaCoeff.push_back(1.02897E-7); |
---|
| 77 | |
---|
| 78 | deltaCoeff.push_back(2.9612); |
---|
| 79 | deltaCoeff.push_back(-0.26376); |
---|
| 80 | deltaCoeff.push_back(4.307E-3); |
---|
| 81 | deltaCoeff.push_back(-2.6895E-5); |
---|
| 82 | deltaCoeff.push_back(5.83505E-8); |
---|
| 83 | |
---|
| 84 | gamma035_10Coeff.push_back(-1.7013); |
---|
| 85 | gamma035_10Coeff.push_back(-1.48284); |
---|
| 86 | gamma035_10Coeff.push_back(0.6331); |
---|
| 87 | gamma035_10Coeff.push_back(-0.10911); |
---|
| 88 | gamma035_10Coeff.push_back(8.358E-3); |
---|
| 89 | gamma035_10Coeff.push_back(-2.388E-4); |
---|
| 90 | |
---|
| 91 | gamma10_100Coeff.push_back(-3.32517); |
---|
| 92 | gamma10_100Coeff.push_back(0.10996); |
---|
| 93 | gamma10_100Coeff.push_back(-4.5255E-3); |
---|
| 94 | gamma10_100Coeff.push_back(5.8372E-5); |
---|
| 95 | gamma10_100Coeff.push_back(-2.4659E-7); |
---|
| 96 | |
---|
| 97 | gamma100_200Coeff.push_back(2.4775E-2); |
---|
| 98 | gamma100_200Coeff.push_back(-2.96264E-5); |
---|
| 99 | gamma100_200Coeff.push_back(-1.20655E-7); |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | G4FinalStateElasticBrennerZaider::~G4FinalStateElasticBrennerZaider() |
---|
| 104 | { |
---|
| 105 | // empty |
---|
| 106 | // G4DynamicParticle objects produced are owned by client |
---|
| 107 | } |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | const G4FinalStateProduct& G4FinalStateElasticBrennerZaider::GenerateFinalState(const G4Track& track, const G4Step& /* step */) |
---|
| 111 | { |
---|
| 112 | // Clear previous secondaries, energy deposit and particle kill status |
---|
| 113 | product.Clear(); |
---|
| 114 | |
---|
| 115 | // Kinetic energy of primary particle |
---|
| 116 | G4double k = track.GetDynamicParticle()->GetKineticEnergy(); |
---|
| 117 | |
---|
| 118 | // Assume material = water; H2O number of electrons |
---|
| 119 | // ---- MGP ---- To be generalized later |
---|
| 120 | // const G4int z = 10; |
---|
| 121 | |
---|
| 122 | G4double cosTheta = RandomizeCosTheta(k); |
---|
| 123 | |
---|
| 124 | G4double phi = 2. * pi * G4UniformRand(); |
---|
| 125 | |
---|
| 126 | // G4cout << "cosTheta in GenerateFinalState = " << cosTheta << ", phi = " << phi << G4endl; |
---|
| 127 | |
---|
| 128 | G4ThreeVector zVers = track.GetDynamicParticle()->GetMomentumDirection(); |
---|
| 129 | G4ThreeVector xVers = zVers.orthogonal(); |
---|
| 130 | G4ThreeVector yVers = zVers.cross(xVers); |
---|
| 131 | |
---|
| 132 | G4double xDir = std::sqrt(1. - cosTheta*cosTheta); |
---|
| 133 | G4double yDir = xDir; |
---|
| 134 | xDir *= std::cos(phi); |
---|
| 135 | yDir *= std::sin(phi); |
---|
| 136 | |
---|
| 137 | // G4cout << "xDir, yDir = " << xDir <<", " << yDir << G4endl; |
---|
| 138 | |
---|
| 139 | // G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers).unit()); |
---|
| 140 | G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers)); |
---|
| 141 | |
---|
| 142 | // G4cout << "zPrimeVers = (" << zPrimeVers.x() << ", "<< zPrimeVers.y() << ", "<< zPrimeVers.z() << ") " << G4endl; |
---|
| 143 | |
---|
| 144 | // product.ModifyPrimaryParticle(zPrimeVers.x(),zPrimeVers.y(),zPrimeVers.z(),k); |
---|
| 145 | product.ModifyPrimaryParticle(zPrimeVers,k); |
---|
| 146 | |
---|
| 147 | // this->aParticleChange.ProposeEnergy(k); |
---|
| 148 | // this->aParticleChange.ProposeMomentumDirection(zPrimeVers); |
---|
| 149 | // this->aParticleChange.SetNumberOfSecondaries(0); |
---|
| 150 | |
---|
| 151 | return product; |
---|
| 152 | } |
---|
| 153 | |
---|
| 154 | G4double G4FinalStateElasticBrennerZaider::RandomizeCosTheta(G4double k) |
---|
| 155 | { |
---|
| 156 | // d sigma_el 1 beta(K) |
---|
| 157 | // ------------ (K) ~ --------------------------------- + --------------------------------- |
---|
| 158 | // d Omega (1 + 2 gamma(K) - cos(theta))^2 (1 + 2 delta(K) + cos(theta))^2 |
---|
| 159 | // |
---|
| 160 | // Maximum is < 1/(4 gamma(K)^2) + beta(K)/(4 delta(K)^2) |
---|
| 161 | // |
---|
| 162 | // Phys. Med. Biol. 29 N.4 (1983) 443-447 |
---|
| 163 | |
---|
| 164 | // gamma(K), beta(K) and delta(K) are polynomials with coefficients for energy measured in eV |
---|
| 165 | k /= eV; |
---|
| 166 | |
---|
| 167 | G4double beta = std::exp(CalculatePolynomial(k,betaCoeff)); |
---|
| 168 | G4double delta = std::exp(CalculatePolynomial(k,deltaCoeff)); |
---|
| 169 | |
---|
| 170 | G4double gamma; |
---|
| 171 | if (k > 100.) |
---|
| 172 | { |
---|
| 173 | gamma = CalculatePolynomial(k, gamma100_200Coeff); // Only in this case it is not the exponent of the polynomial |
---|
| 174 | } |
---|
| 175 | else |
---|
| 176 | { |
---|
| 177 | |
---|
| 178 | if (k>10) |
---|
| 179 | { |
---|
| 180 | gamma = std::exp(CalculatePolynomial(k, gamma10_100Coeff)); |
---|
| 181 | } |
---|
| 182 | else |
---|
| 183 | { |
---|
| 184 | gamma = std::exp(CalculatePolynomial(k, gamma035_10Coeff)); |
---|
| 185 | } |
---|
| 186 | } |
---|
| 187 | |
---|
| 188 | // G4cout << "beta = " << beta << ", gamma = " << gamma << ", delta = " << delta << G4endl; |
---|
| 189 | |
---|
| 190 | G4double oneOverMax = 1. / (1./(4.*gamma*gamma) + beta/(4.*delta*delta)); |
---|
| 191 | |
---|
| 192 | G4double cosTheta = 0.; |
---|
| 193 | G4double leftDenominator = 0.; |
---|
| 194 | G4double rightDenominator = 0.; |
---|
| 195 | G4double fCosTheta = 0.; |
---|
| 196 | |
---|
| 197 | do |
---|
| 198 | { |
---|
| 199 | cosTheta = 2. * G4UniformRand() - 1.; |
---|
| 200 | leftDenominator = (1 + 2.*gamma - cosTheta); |
---|
| 201 | rightDenominator = (1 + 2.*delta + cosTheta); |
---|
| 202 | fCosTheta = oneOverMax * (1./(leftDenominator*leftDenominator) + beta/(rightDenominator*rightDenominator)); |
---|
| 203 | } |
---|
| 204 | while (fCosTheta < G4UniformRand()); |
---|
| 205 | |
---|
| 206 | // G4cout << "cosTheta = " << cosTheta << G4endl; |
---|
| 207 | |
---|
| 208 | return cosTheta; |
---|
| 209 | } |
---|
| 210 | |
---|
| 211 | G4double G4FinalStateElasticBrennerZaider::CalculatePolynomial(G4double k, std::vector<G4double>& vec) |
---|
| 212 | { |
---|
| 213 | // Sum_{i=0}^{size-1} vector_i k^i |
---|
| 214 | // |
---|
| 215 | // Phys. Med. Biol. 29 N.4 (1983) 443-447 |
---|
| 216 | |
---|
| 217 | G4double result = 0.; |
---|
| 218 | size_t size = vec.size(); |
---|
| 219 | |
---|
| 220 | while (size>0) |
---|
| 221 | { |
---|
| 222 | size--; |
---|
| 223 | |
---|
| 224 | result *= k; |
---|
| 225 | result += vec[size]; |
---|
| 226 | } |
---|
| 227 | |
---|
| 228 | return result; |
---|
| 229 | } |
---|
| 230 | |
---|