Changeset 961 for trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticBrennerZaider.cc
- Timestamp:
- Apr 6, 2009, 12:21:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticBrennerZaider.cc
r819 r961 24 24 // ******************************************************************** 25 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 26 // $Id: G4FinalStateElasticBrennerZaider.cc,v 1.8 2008/12/05 11:58:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #include "G4FinalStateElasticBrennerZaider.hh" 53 #include "G4Track.hh"54 #include "G4Step.hh"55 #include "G4DynamicParticle.hh"56 #include "Randomize.hh"57 30 58 #include "G4ParticleTypes.hh" 59 #include "G4ParticleDefinition.hh" 60 #include "G4Electron.hh" 61 #include "G4SystemOfUnits.hh" 62 #include "G4ParticleMomentum.hh" 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4FinalStateElasticBrennerZaider::G4FinalStateElasticBrennerZaider() 65 34 { 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; 35 lowEnergyLimit = 8.23 * eV; // SI : i/o of 7.4 * eV; 36 highEnergyLimit = 200 * eV; 71 37 72 38 betaCoeff.push_back(7.51525); … … 100 66 } 101 67 68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 102 69 103 70 G4FinalStateElasticBrennerZaider::~G4FinalStateElasticBrennerZaider() 104 { 105 // empty 106 // G4DynamicParticle objects produced are owned by client 107 } 108 71 {} 72 73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 109 74 110 75 const G4FinalStateProduct& G4FinalStateElasticBrennerZaider::GenerateFinalState(const G4Track& track, const G4Step& /* step */) 111 76 { 112 // Clear previous secondaries, energy deposit and particle kill status113 77 product.Clear(); 114 78 115 // Kinetic energy of primary particle116 79 G4double k = track.GetDynamicParticle()->GetKineticEnergy(); 80 81 if ( k>= lowEnergyLimit && k<=highEnergyLimit ) 82 { 83 G4double cosTheta = RandomizeCosTheta(k); 84 85 G4double phi = 2. * pi * G4UniformRand(); 117 86 118 // Assume material = water; H2O number of electrons119 // ---- MGP ---- To be generalized later120 // const G4int z = 10;87 G4ThreeVector zVers = track.GetDynamicParticle()->GetMomentumDirection(); 88 G4ThreeVector xVers = zVers.orthogonal(); 89 G4ThreeVector yVers = zVers.cross(xVers); 121 90 122 G4double cosTheta = RandomizeCosTheta(k); 91 G4double xDir = std::sqrt(1. - cosTheta*cosTheta); 92 G4double yDir = xDir; 93 xDir *= std::cos(phi); 94 yDir *= std::sin(phi); 95 96 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers)); 97 98 product.ModifyPrimaryParticle(zPrimeVers,k); 99 } 100 101 if (k<lowEnergyLimit) 102 { 103 product.KillPrimaryParticle(); 104 } 123 105 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 106 return product; 152 107 } 108 109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 153 110 154 111 G4double G4FinalStateElasticBrennerZaider::RandomizeCosTheta(G4double k) … … 158 115 // d Omega (1 + 2 gamma(K) - cos(theta))^2 (1 + 2 delta(K) + cos(theta))^2 159 116 // 160 // Maximum is < 1/(4 gamma(K)^2) + beta(K)/( 4 delta(K)^2)117 // Maximum is < 1/(4 gamma(K)^2) + beta(K)/((2+2delta(K))^2) 161 118 // 162 119 // Phys. Med. Biol. 29 N.4 (1983) 443-447 163 120 164 121 // gamma(K), beta(K) and delta(K) are polynomials with coefficients for energy measured in eV 122 165 123 k /= eV; 166 124 167 125 G4double beta = std::exp(CalculatePolynomial(k,betaCoeff)); 168 126 G4double delta = std::exp(CalculatePolynomial(k,deltaCoeff)); 127 G4double gamma; 169 128 170 G4double gamma;171 129 if (k > 100.) 172 { 173 gamma = CalculatePolynomial(k, gamma100_200Coeff); // Only in this case it is not the exponent of the polynomial 174 } 130 { 131 gamma = CalculatePolynomial(k, gamma100_200Coeff); 132 // Only in this case it is not the exponent of the polynomial 133 } 175 134 else 176 { 135 { 136 if (k>10) 137 { 138 gamma = std::exp(CalculatePolynomial(k, gamma10_100Coeff)); 139 } 140 else 141 { 142 gamma = std::exp(CalculatePolynomial(k, gamma035_10Coeff)); 143 } 144 } 177 145 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)); 146 G4double oneOverMax = 1. / (1./(4.*gamma*gamma) + beta/( (2.+2.*delta)*(2.+2.*delta) )); 191 147 192 148 G4double cosTheta = 0.; … … 196 152 197 153 do 198 154 { 199 155 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 } 156 leftDenominator = (1. + 2.*gamma - cosTheta); 157 rightDenominator = (1. + 2.*delta + cosTheta); 158 if ( (leftDenominator * rightDenominator) != 0. ) 159 { 160 fCosTheta = oneOverMax * (1./(leftDenominator*leftDenominator) + beta/(rightDenominator*rightDenominator)); 161 } 162 } 204 163 while (fCosTheta < G4UniformRand()); 205 164 206 // G4cout << "cosTheta = " << cosTheta << G4endl;207 208 165 return cosTheta; 209 166 } 167 168 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 210 169 211 170 G4double G4FinalStateElasticBrennerZaider::CalculatePolynomial(G4double k, std::vector<G4double>& vec)
Note: See TracChangeset
for help on using the changeset viewer.