Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 // $Id$ 26 // 27 // 27 // 28 // 28 // Physics model class G4DiffuseElastic 29 // Physics model class G4DiffuseElastic 29 // 30 // 30 // 31 // 31 // G4 Model: optical diffuse elastic scatterin 32 // G4 Model: optical diffuse elastic scattering with 4-momentum balance 32 // 33 // 33 // 24-May-07 V. Grichine 34 // 24-May-07 V. Grichine 34 // 35 // 35 // 21.10.15 V. Grichine << 36 // Bug fixed in BuildAngleTable, i << 37 // angle bins at high energies > 5 << 38 // << 39 36 40 #include "G4DiffuseElastic.hh" 37 #include "G4DiffuseElastic.hh" 41 #include "G4ParticleTable.hh" 38 #include "G4ParticleTable.hh" 42 #include "G4ParticleDefinition.hh" 39 #include "G4ParticleDefinition.hh" 43 #include "G4IonTable.hh" 40 #include "G4IonTable.hh" 44 #include "G4NucleiProperties.hh" 41 #include "G4NucleiProperties.hh" 45 42 46 #include "Randomize.hh" 43 #include "Randomize.hh" 47 #include "G4Integrator.hh" 44 #include "G4Integrator.hh" 48 #include "globals.hh" 45 #include "globals.hh" 49 #include "G4PhysicalConstants.hh" 46 #include "G4PhysicalConstants.hh" 50 #include "G4SystemOfUnits.hh" 47 #include "G4SystemOfUnits.hh" 51 48 52 #include "G4Proton.hh" 49 #include "G4Proton.hh" 53 #include "G4Neutron.hh" 50 #include "G4Neutron.hh" 54 #include "G4Deuteron.hh" 51 #include "G4Deuteron.hh" 55 #include "G4Alpha.hh" 52 #include "G4Alpha.hh" 56 #include "G4PionPlus.hh" 53 #include "G4PionPlus.hh" 57 #include "G4PionMinus.hh" 54 #include "G4PionMinus.hh" 58 55 59 #include "G4Element.hh" 56 #include "G4Element.hh" 60 #include "G4ElementTable.hh" 57 #include "G4ElementTable.hh" 61 #include "G4NistManager.hh" << 62 #include "G4PhysicsTable.hh" 58 #include "G4PhysicsTable.hh" 63 #include "G4PhysicsLogVector.hh" 59 #include "G4PhysicsLogVector.hh" 64 #include "G4PhysicsFreeVector.hh" 60 #include "G4PhysicsFreeVector.hh" 65 61 66 #include "G4Exp.hh" << 67 << 68 #include "G4HadronicParameters.hh" << 69 << 70 ////////////////////////////////////////////// 62 ///////////////////////////////////////////////////////////////////////// 71 // 63 // 72 // Test Constructor. Just to check xsc 64 // Test Constructor. Just to check xsc 73 65 74 66 75 G4DiffuseElastic::G4DiffuseElastic() 67 G4DiffuseElastic::G4DiffuseElastic() 76 : G4HadronElastic("DiffuseElastic"), fPartic 68 : G4HadronElastic("DiffuseElastic"), fParticle(0) 77 { 69 { 78 SetMinEnergy( 0.01*MeV ); << 70 SetMinEnergy( 0.01*GeV ); 79 SetMaxEnergy( G4HadronicParameters::Instance << 71 SetMaxEnergy( 1.*TeV ); 80 << 72 verboseLevel = 0; 81 verboseLevel = 0; << 82 lowEnergyRecoilLimit = 100.*keV; 73 lowEnergyRecoilLimit = 100.*keV; 83 lowEnergyLimitQ = 0.0*GeV; << 74 lowEnergyLimitQ = 0.0*GeV; 84 lowEnergyLimitHE = 0.0*GeV; << 75 lowEnergyLimitHE = 0.0*GeV; 85 lowestEnergyLimit = 0.0*keV; << 76 lowestEnergyLimit= 0.0*keV; 86 plabLowLimit = 20.0*MeV; << 77 plabLowLimit = 20.0*MeV; 87 << 78 88 theProton = G4Proton::Proton(); << 79 theProton = G4Proton::Proton(); 89 theNeutron = G4Neutron::Neutron(); << 80 theNeutron = G4Neutron::Neutron(); 90 theDeuteron = G4Deuteron::Deuteron(); << 81 theDeuteron = G4Deuteron::Deuteron(); 91 theAlpha = G4Alpha::Alpha(); << 82 theAlpha = G4Alpha::Alpha(); 92 thePionPlus = G4PionPlus::PionPlus(); << 83 thePionPlus = G4PionPlus::PionPlus(); 93 thePionMinus = G4PionMinus::PionMinus(); << 84 thePionMinus= G4PionMinus::PionMinus(); 94 85 95 fEnergyBin = 300; // Increased from the ori << 86 fEnergyBin = 200; 96 fAngleBin = 200; 87 fAngleBin = 200; 97 88 98 fEnergyVector = new G4PhysicsLogVector( the 89 fEnergyVector = new G4PhysicsLogVector( theMinEnergy, theMaxEnergy, fEnergyBin ); 99 << 100 fAngleTable = 0; 90 fAngleTable = 0; 101 91 102 fParticle = 0; << 92 fParticle = 0; 103 fWaveVector = 0.; << 93 fWaveVector = 0.; 104 fAtomicWeight = 0.; << 94 fAtomicWeight = 0.; 105 fAtomicNumber = 0.; << 95 fAtomicNumber = 0.; 106 fNuclearRadius = 0.; 96 fNuclearRadius = 0.; 107 fBeta = 0.; << 97 fBeta = 0.; 108 fZommerfeld = 0.; << 98 fZommerfeld = 0.; 109 fAm = 0.; 99 fAm = 0.; 110 fAddCoulomb = false; 100 fAddCoulomb = false; 111 } 101 } 112 102 113 ////////////////////////////////////////////// 103 ////////////////////////////////////////////////////////////////////////////// 114 // 104 // 115 // Destructor 105 // Destructor 116 106 117 G4DiffuseElastic::~G4DiffuseElastic() 107 G4DiffuseElastic::~G4DiffuseElastic() 118 { 108 { 119 if ( fEnergyVector ) << 109 if(fEnergyVector) delete fEnergyVector; 120 { << 121 delete fEnergyVector; << 122 fEnergyVector = 0; << 123 } << 124 for ( std::vector<G4PhysicsTable*>::iterator << 125 it != fAngleBank.end(); ++it ) << 126 { << 127 if ( (*it) ) (*it)->clearAndDestroy(); << 128 110 129 delete *it; << 111 if( fAngleTable ) 130 *it = 0; << 112 { >> 113 fAngleTable->clearAndDestroy(); >> 114 delete fAngleTable ; 131 } 115 } 132 fAngleTable = 0; << 133 } 116 } 134 117 135 ////////////////////////////////////////////// 118 ////////////////////////////////////////////////////////////////////////////// 136 // 119 // 137 // Initialisation for given particle using ele 120 // Initialisation for given particle using element table of application 138 121 139 void G4DiffuseElastic::Initialise() 122 void G4DiffuseElastic::Initialise() 140 { 123 { 141 124 142 // fEnergyVector = new G4PhysicsLogVector( t 125 // fEnergyVector = new G4PhysicsLogVector( theMinEnergy, theMaxEnergy, fEnergyBin ); 143 126 144 const G4ElementTable* theElementTable = G4El 127 const G4ElementTable* theElementTable = G4Element::GetElementTable(); 145 128 146 std::size_t jEl, numOfEl = G4Element::GetNum << 129 size_t jEl, numOfEl = G4Element::GetNumberOfElements(); 147 130 148 for( jEl = 0; jEl < numOfEl; ++jEl) // appli << 131 for(jEl = 0 ; jEl < numOfEl; ++jEl) // application element loop 149 { 132 { 150 fAtomicNumber = (*theElementTable)[jEl]->G 133 fAtomicNumber = (*theElementTable)[jEl]->GetZ(); // atomic number 151 fAtomicWeight = G4NistManager::Instance()- << 134 fAtomicWeight = (*theElementTable)[jEl]->GetN(); // number of nucleons 152 fNuclearRadius = CalculateNuclearRad(fAtom 135 fNuclearRadius = CalculateNuclearRad(fAtomicWeight); 153 136 154 if( verboseLevel > 0 ) << 137 if(verboseLevel > 0) 155 { 138 { 156 G4cout<<"G4DiffuseElastic::Initialise() 139 G4cout<<"G4DiffuseElastic::Initialise() the element: " 157 <<(*theElementTable)[jEl]->GetName()<<G4 140 <<(*theElementTable)[jEl]->GetName()<<G4endl; 158 } 141 } 159 fElementNumberVector.push_back(fAtomicNumb 142 fElementNumberVector.push_back(fAtomicNumber); 160 fElementNameVector.push_back((*theElementT 143 fElementNameVector.push_back((*theElementTable)[jEl]->GetName()); 161 144 162 BuildAngleTable(); 145 BuildAngleTable(); 163 fAngleBank.push_back(fAngleTable); 146 fAngleBank.push_back(fAngleTable); 164 } 147 } 165 return; 148 return; 166 } 149 } 167 150 168 ////////////////////////////////////////////// 151 //////////////////////////////////////////////////////////////////////////// 169 // 152 // 170 // return differential elastic cross section d 153 // return differential elastic cross section d(sigma)/d(omega) 171 154 172 G4double 155 G4double 173 G4DiffuseElastic::GetDiffuseElasticXsc( const 156 G4DiffuseElastic::GetDiffuseElasticXsc( const G4ParticleDefinition* particle, 174 G4doub 157 G4double theta, 175 G4double momentum, 158 G4double momentum, 176 G4doub 159 G4double A ) 177 { 160 { 178 fParticle = particle; 161 fParticle = particle; 179 fWaveVector = momentum/hbarc; 162 fWaveVector = momentum/hbarc; 180 fAtomicWeight = A; 163 fAtomicWeight = A; 181 fAddCoulomb = false; 164 fAddCoulomb = false; 182 fNuclearRadius = CalculateNuclearRad(A); 165 fNuclearRadius = CalculateNuclearRad(A); 183 166 184 G4double sigma = fNuclearRadius*fNuclearRadi 167 G4double sigma = fNuclearRadius*fNuclearRadius*GetDiffElasticProb(theta); 185 168 186 return sigma; 169 return sigma; 187 } 170 } 188 171 189 ////////////////////////////////////////////// 172 //////////////////////////////////////////////////////////////////////////// 190 // 173 // 191 // return invariant differential elastic cross 174 // return invariant differential elastic cross section d(sigma)/d(tMand) 192 175 193 G4double 176 G4double 194 G4DiffuseElastic::GetInvElasticXsc( const G4Pa 177 G4DiffuseElastic::GetInvElasticXsc( const G4ParticleDefinition* particle, 195 G4doub 178 G4double tMand, 196 G4double plab, 179 G4double plab, 197 G4doub 180 G4double A, G4double Z ) 198 { 181 { 199 G4double m1 = particle->GetPDGMass(); 182 G4double m1 = particle->GetPDGMass(); 200 G4LorentzVector lv1(0.,0.,plab,std::sqrt(pla 183 G4LorentzVector lv1(0.,0.,plab,std::sqrt(plab*plab+m1*m1)); 201 184 202 G4int iZ = static_cast<G4int>(Z+0.5); 185 G4int iZ = static_cast<G4int>(Z+0.5); 203 G4int iA = static_cast<G4int>(A+0.5); 186 G4int iA = static_cast<G4int>(A+0.5); 204 G4ParticleDefinition * theDef = 0; 187 G4ParticleDefinition * theDef = 0; 205 188 206 if (iZ == 1 && iA == 1) theDef = thePro 189 if (iZ == 1 && iA == 1) theDef = theProton; 207 else if (iZ == 1 && iA == 2) theDef = theDeu 190 else if (iZ == 1 && iA == 2) theDef = theDeuteron; 208 else if (iZ == 1 && iA == 3) theDef = G4Trit 191 else if (iZ == 1 && iA == 3) theDef = G4Triton::Triton(); 209 else if (iZ == 2 && iA == 3) theDef = G4He3: 192 else if (iZ == 2 && iA == 3) theDef = G4He3::He3(); 210 else if (iZ == 2 && iA == 4) theDef = theAlp 193 else if (iZ == 2 && iA == 4) theDef = theAlpha; 211 else theDef = G4ParticleTable::GetParticleTa << 194 else theDef = G4ParticleTable::GetParticleTable()->FindIon(iZ,iA,0,iZ); 212 195 213 G4double tmass = theDef->GetPDGMass(); 196 G4double tmass = theDef->GetPDGMass(); 214 197 215 G4LorentzVector lv(0.0,0.0,0.0,tmass); 198 G4LorentzVector lv(0.0,0.0,0.0,tmass); 216 lv += lv1; 199 lv += lv1; 217 200 218 G4ThreeVector bst = lv.boostVector(); 201 G4ThreeVector bst = lv.boostVector(); 219 lv1.boost(-bst); 202 lv1.boost(-bst); 220 203 221 G4ThreeVector p1 = lv1.vect(); 204 G4ThreeVector p1 = lv1.vect(); 222 G4double ptot = p1.mag(); 205 G4double ptot = p1.mag(); 223 G4double ptot2 = ptot*ptot; 206 G4double ptot2 = ptot*ptot; 224 G4double cost = 1 - 0.5*std::fabs(tMand)/pto 207 G4double cost = 1 - 0.5*std::fabs(tMand)/ptot2; 225 208 226 if( cost >= 1.0 ) cost = 1.0; 209 if( cost >= 1.0 ) cost = 1.0; 227 else if( cost <= -1.0) cost = -1.0; 210 else if( cost <= -1.0) cost = -1.0; 228 211 229 G4double thetaCMS = std::acos(cost); 212 G4double thetaCMS = std::acos(cost); 230 213 231 G4double sigma = GetDiffuseElasticXsc( parti 214 G4double sigma = GetDiffuseElasticXsc( particle, thetaCMS, ptot, A); 232 215 233 sigma *= pi/ptot2; 216 sigma *= pi/ptot2; 234 217 235 return sigma; 218 return sigma; 236 } 219 } 237 220 238 ////////////////////////////////////////////// 221 //////////////////////////////////////////////////////////////////////////// 239 // 222 // 240 // return differential elastic cross section d 223 // return differential elastic cross section d(sigma)/d(omega) with Coulomb 241 // correction 224 // correction 242 225 243 G4double 226 G4double 244 G4DiffuseElastic::GetDiffuseElasticSumXsc( con 227 G4DiffuseElastic::GetDiffuseElasticSumXsc( const G4ParticleDefinition* particle, 245 G4doub 228 G4double theta, 246 G4double momentum, 229 G4double momentum, 247 G4doub 230 G4double A, G4double Z ) 248 { 231 { 249 fParticle = particle; 232 fParticle = particle; 250 fWaveVector = momentum/hbarc; 233 fWaveVector = momentum/hbarc; 251 fAtomicWeight = A; 234 fAtomicWeight = A; 252 fAtomicNumber = Z; 235 fAtomicNumber = Z; 253 fNuclearRadius = CalculateNuclearRad(A); 236 fNuclearRadius = CalculateNuclearRad(A); 254 fAddCoulomb = false; 237 fAddCoulomb = false; 255 238 256 G4double z = particle->GetPDGCharge(); 239 G4double z = particle->GetPDGCharge(); 257 240 258 G4double kRt = fWaveVector*fNuclearRadius* 241 G4double kRt = fWaveVector*fNuclearRadius*theta; 259 G4double kRtC = 1.9; 242 G4double kRtC = 1.9; 260 243 261 if( z && (kRt > kRtC) ) 244 if( z && (kRt > kRtC) ) 262 { 245 { 263 fAddCoulomb = true; 246 fAddCoulomb = true; 264 fBeta = CalculateParticleBeta( parti 247 fBeta = CalculateParticleBeta( particle, momentum); 265 fZommerfeld = CalculateZommerfeld( fBeta, 248 fZommerfeld = CalculateZommerfeld( fBeta, z, fAtomicNumber); 266 fAm = CalculateAm( momentum, fZomm 249 fAm = CalculateAm( momentum, fZommerfeld, fAtomicNumber); 267 } 250 } 268 G4double sigma = fNuclearRadius*fNuclearRadi 251 G4double sigma = fNuclearRadius*fNuclearRadius*GetDiffElasticSumProb(theta); 269 252 270 return sigma; 253 return sigma; 271 } 254 } 272 255 273 ////////////////////////////////////////////// 256 //////////////////////////////////////////////////////////////////////////// 274 // 257 // 275 // return invariant differential elastic cross 258 // return invariant differential elastic cross section d(sigma)/d(tMand) with Coulomb 276 // correction 259 // correction 277 260 278 G4double 261 G4double 279 G4DiffuseElastic::GetInvElasticSumXsc( const G 262 G4DiffuseElastic::GetInvElasticSumXsc( const G4ParticleDefinition* particle, 280 G4doub 263 G4double tMand, 281 G4double plab, 264 G4double plab, 282 G4doub 265 G4double A, G4double Z ) 283 { 266 { 284 G4double m1 = particle->GetPDGMass(); 267 G4double m1 = particle->GetPDGMass(); 285 268 286 G4LorentzVector lv1(0.,0.,plab,std::sqrt(pla 269 G4LorentzVector lv1(0.,0.,plab,std::sqrt(plab*plab+m1*m1)); 287 270 288 G4int iZ = static_cast<G4int>(Z+0.5); 271 G4int iZ = static_cast<G4int>(Z+0.5); 289 G4int iA = static_cast<G4int>(A+0.5); 272 G4int iA = static_cast<G4int>(A+0.5); 290 273 291 G4ParticleDefinition* theDef = 0; 274 G4ParticleDefinition* theDef = 0; 292 275 293 if (iZ == 1 && iA == 1) theDef = thePro 276 if (iZ == 1 && iA == 1) theDef = theProton; 294 else if (iZ == 1 && iA == 2) theDef = theDeu 277 else if (iZ == 1 && iA == 2) theDef = theDeuteron; 295 else if (iZ == 1 && iA == 3) theDef = G4Trit 278 else if (iZ == 1 && iA == 3) theDef = G4Triton::Triton(); 296 else if (iZ == 2 && iA == 3) theDef = G4He3: 279 else if (iZ == 2 && iA == 3) theDef = G4He3::He3(); 297 else if (iZ == 2 && iA == 4) theDef = theAlp 280 else if (iZ == 2 && iA == 4) theDef = theAlpha; 298 else theDef = G4ParticleTable::GetParticleTa << 281 else theDef = G4ParticleTable::GetParticleTable()->FindIon(iZ,iA,0,iZ); 299 282 300 G4double tmass = theDef->GetPDGMass(); 283 G4double tmass = theDef->GetPDGMass(); 301 284 302 G4LorentzVector lv(0.0,0.0,0.0,tmass); 285 G4LorentzVector lv(0.0,0.0,0.0,tmass); 303 lv += lv1; 286 lv += lv1; 304 287 305 G4ThreeVector bst = lv.boostVector(); 288 G4ThreeVector bst = lv.boostVector(); 306 lv1.boost(-bst); 289 lv1.boost(-bst); 307 290 308 G4ThreeVector p1 = lv1.vect(); 291 G4ThreeVector p1 = lv1.vect(); 309 G4double ptot = p1.mag(); 292 G4double ptot = p1.mag(); 310 G4double ptot2 = ptot*ptot; 293 G4double ptot2 = ptot*ptot; 311 G4double cost = 1 - 0.5*std::fabs(tMand)/ 294 G4double cost = 1 - 0.5*std::fabs(tMand)/ptot2; 312 295 313 if( cost >= 1.0 ) cost = 1.0; 296 if( cost >= 1.0 ) cost = 1.0; 314 else if( cost <= -1.0) cost = -1.0; 297 else if( cost <= -1.0) cost = -1.0; 315 298 316 G4double thetaCMS = std::acos(cost); 299 G4double thetaCMS = std::acos(cost); 317 300 318 G4double sigma = GetDiffuseElasticSumXsc( pa 301 G4double sigma = GetDiffuseElasticSumXsc( particle, thetaCMS, ptot, A, Z ); 319 302 320 sigma *= pi/ptot2; 303 sigma *= pi/ptot2; 321 304 322 return sigma; 305 return sigma; 323 } 306 } 324 307 325 ////////////////////////////////////////////// 308 //////////////////////////////////////////////////////////////////////////// 326 // 309 // 327 // return invariant differential elastic cross 310 // return invariant differential elastic cross section d(sigma)/d(tMand) with Coulomb 328 // correction 311 // correction 329 312 330 G4double 313 G4double 331 G4DiffuseElastic::GetInvCoulombElasticXsc( con 314 G4DiffuseElastic::GetInvCoulombElasticXsc( const G4ParticleDefinition* particle, 332 G4doub 315 G4double tMand, 333 G4double plab, 316 G4double plab, 334 G4doub 317 G4double A, G4double Z ) 335 { 318 { 336 G4double m1 = particle->GetPDGMass(); 319 G4double m1 = particle->GetPDGMass(); 337 G4LorentzVector lv1(0.,0.,plab,std::sqrt(pla 320 G4LorentzVector lv1(0.,0.,plab,std::sqrt(plab*plab+m1*m1)); 338 321 339 G4int iZ = static_cast<G4int>(Z+0.5); 322 G4int iZ = static_cast<G4int>(Z+0.5); 340 G4int iA = static_cast<G4int>(A+0.5); 323 G4int iA = static_cast<G4int>(A+0.5); 341 G4ParticleDefinition * theDef = 0; 324 G4ParticleDefinition * theDef = 0; 342 325 343 if (iZ == 1 && iA == 1) theDef = thePro 326 if (iZ == 1 && iA == 1) theDef = theProton; 344 else if (iZ == 1 && iA == 2) theDef = theDeu 327 else if (iZ == 1 && iA == 2) theDef = theDeuteron; 345 else if (iZ == 1 && iA == 3) theDef = G4Trit 328 else if (iZ == 1 && iA == 3) theDef = G4Triton::Triton(); 346 else if (iZ == 2 && iA == 3) theDef = G4He3: 329 else if (iZ == 2 && iA == 3) theDef = G4He3::He3(); 347 else if (iZ == 2 && iA == 4) theDef = theAlp 330 else if (iZ == 2 && iA == 4) theDef = theAlpha; 348 else theDef = G4ParticleTable::GetParticleTa << 331 else theDef = G4ParticleTable::GetParticleTable()->FindIon(iZ,iA,0,iZ); 349 332 350 G4double tmass = theDef->GetPDGMass(); 333 G4double tmass = theDef->GetPDGMass(); 351 334 352 G4LorentzVector lv(0.0,0.0,0.0,tmass); 335 G4LorentzVector lv(0.0,0.0,0.0,tmass); 353 lv += lv1; 336 lv += lv1; 354 337 355 G4ThreeVector bst = lv.boostVector(); 338 G4ThreeVector bst = lv.boostVector(); 356 lv1.boost(-bst); 339 lv1.boost(-bst); 357 340 358 G4ThreeVector p1 = lv1.vect(); 341 G4ThreeVector p1 = lv1.vect(); 359 G4double ptot = p1.mag(); 342 G4double ptot = p1.mag(); 360 G4double ptot2 = ptot*ptot; 343 G4double ptot2 = ptot*ptot; 361 G4double cost = 1 - 0.5*std::fabs(tMand)/pto 344 G4double cost = 1 - 0.5*std::fabs(tMand)/ptot2; 362 345 363 if( cost >= 1.0 ) cost = 1.0; 346 if( cost >= 1.0 ) cost = 1.0; 364 else if( cost <= -1.0) cost = -1.0; 347 else if( cost <= -1.0) cost = -1.0; 365 348 366 G4double thetaCMS = std::acos(cost); 349 G4double thetaCMS = std::acos(cost); 367 350 368 G4double sigma = GetCoulombElasticXsc( parti 351 G4double sigma = GetCoulombElasticXsc( particle, thetaCMS, ptot, Z ); 369 352 370 sigma *= pi/ptot2; 353 sigma *= pi/ptot2; 371 354 372 return sigma; 355 return sigma; 373 } 356 } 374 357 375 ////////////////////////////////////////////// 358 //////////////////////////////////////////////////////////////////////////// 376 // 359 // 377 // return differential elastic probability d(p 360 // return differential elastic probability d(probability)/d(omega) 378 361 379 G4double 362 G4double 380 G4DiffuseElastic::GetDiffElasticProb( // G4Par 363 G4DiffuseElastic::GetDiffElasticProb( // G4ParticleDefinition* particle, 381 G4doub 364 G4double theta 382 // G4double momentum, 365 // G4double momentum, 383 // G4double A 366 // G4double A 384 ) 367 ) 385 { 368 { 386 G4double sigma, bzero, bzero2, bonebyarg, bo 369 G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2; 387 G4double delta, diffuse, gamma; 370 G4double delta, diffuse, gamma; 388 G4double e1, e2, bone, bone2; 371 G4double e1, e2, bone, bone2; 389 372 390 // G4double wavek = momentum/hbarc; // wave 373 // G4double wavek = momentum/hbarc; // wave vector 391 // G4double r0 = 1.08*fermi; 374 // G4double r0 = 1.08*fermi; 392 // G4double rad = r0*G4Pow::GetInstance()- << 375 // G4double rad = r0*std::pow(A, 1./3.); >> 376 >> 377 G4double kr = fWaveVector*fNuclearRadius; // wavek*rad; >> 378 G4double kr2 = kr*kr; >> 379 G4double krt = kr*theta; >> 380 >> 381 bzero = BesselJzero(krt); >> 382 bzero2 = bzero*bzero; >> 383 bone = BesselJone(krt); >> 384 bone2 = bone*bone; >> 385 bonebyarg = BesselOneByArg(krt); >> 386 bonebyarg2 = bonebyarg*bonebyarg; 393 387 394 if (fParticle == theProton) 388 if (fParticle == theProton) 395 { 389 { 396 diffuse = 0.63*fermi; 390 diffuse = 0.63*fermi; 397 gamma = 0.3*fermi; 391 gamma = 0.3*fermi; 398 delta = 0.1*fermi*fermi; 392 delta = 0.1*fermi*fermi; 399 e1 = 0.3*fermi; 393 e1 = 0.3*fermi; 400 e2 = 0.35*fermi; 394 e2 = 0.35*fermi; 401 } 395 } 402 else if (fParticle == theNeutron) << 403 { << 404 diffuse = 0.63*fermi; // 1.63*fermi; // << 405 G4double k0 = 1*GeV/hbarc; << 406 diffuse *= k0/fWaveVector; << 407 << 408 gamma = 0.3*fermi; << 409 delta = 0.1*fermi*fermi; << 410 e1 = 0.3*fermi; << 411 e2 = 0.35*fermi; << 412 } << 413 else // as proton, if were not defined 396 else // as proton, if were not defined 414 { 397 { 415 diffuse = 0.63*fermi; 398 diffuse = 0.63*fermi; 416 gamma = 0.3*fermi; 399 gamma = 0.3*fermi; 417 delta = 0.1*fermi*fermi; 400 delta = 0.1*fermi*fermi; 418 e1 = 0.3*fermi; 401 e1 = 0.3*fermi; 419 e2 = 0.35*fermi; 402 e2 = 0.35*fermi; 420 } 403 } 421 G4double kr = fWaveVector*fNuclearRadius; << 422 G4double kr2 = kr*kr; << 423 G4double krt = kr*theta; << 424 << 425 bzero = BesselJzero(krt); << 426 bzero2 = bzero*bzero; << 427 bone = BesselJone(krt); << 428 bone2 = bone*bone; << 429 bonebyarg = BesselOneByArg(krt); << 430 bonebyarg2 = bonebyarg*bonebyarg; << 431 << 432 G4double lambda = 15.; // 15 ok 404 G4double lambda = 15.; // 15 ok 433 405 434 // G4double kgamma = fWaveVector*gamma; 406 // G4double kgamma = fWaveVector*gamma; // wavek*delta; 435 407 436 G4double kgamma = lambda*(1.-G4Exp(-fWave << 408 G4double kgamma = lambda*(1.-std::exp(-fWaveVector*gamma/lambda)); // wavek*delta; 437 G4double kgamma2 = kgamma*kgamma; 409 G4double kgamma2 = kgamma*kgamma; 438 410 439 // G4double dk2t = delta*fWaveVector*fWaveV 411 // G4double dk2t = delta*fWaveVector*fWaveVector*theta; // delta*wavek*wavek*theta; 440 // G4double dk2t2 = dk2t*dk2t; 412 // G4double dk2t2 = dk2t*dk2t; 441 // G4double pikdt = pi*fWaveVector*diffuse*t 413 // G4double pikdt = pi*fWaveVector*diffuse*theta;// pi*wavek*diffuse*theta; 442 414 443 G4double pikdt = lambda*(1.-G4Exp(-pi*fWa << 415 G4double pikdt = lambda*(1.-std::exp(-pi*fWaveVector*diffuse*theta/lambda)); // wavek*delta; 444 416 445 damp = DampFactor(pikdt); 417 damp = DampFactor(pikdt); 446 damp2 = damp*damp; 418 damp2 = damp*damp; 447 419 448 G4double mode2k2 = (e1*e1+e2*e2)*fWaveVector 420 G4double mode2k2 = (e1*e1+e2*e2)*fWaveVector*fWaveVector; 449 G4double e2dk3t = -2.*e2*delta*fWaveVector* 421 G4double e2dk3t = -2.*e2*delta*fWaveVector*fWaveVector*fWaveVector*theta; 450 422 451 423 452 sigma = kgamma2; 424 sigma = kgamma2; 453 // sigma += dk2t2; 425 // sigma += dk2t2; 454 sigma *= bzero2; 426 sigma *= bzero2; 455 sigma += mode2k2*bone2 + e2dk3t*bzero*bone; 427 sigma += mode2k2*bone2 + e2dk3t*bzero*bone; 456 sigma += kr2*bonebyarg2; 428 sigma += kr2*bonebyarg2; 457 sigma *= damp2; // *rad*rad; 429 sigma *= damp2; // *rad*rad; 458 430 459 return sigma; 431 return sigma; 460 } 432 } 461 433 462 ////////////////////////////////////////////// 434 //////////////////////////////////////////////////////////////////////////// 463 // 435 // 464 // return differential elastic probability d(p 436 // return differential elastic probability d(probability)/d(omega) with 465 // Coulomb correction 437 // Coulomb correction 466 438 467 G4double 439 G4double 468 G4DiffuseElastic::GetDiffElasticSumProb( // G4 440 G4DiffuseElastic::GetDiffElasticSumProb( // G4ParticleDefinition* particle, 469 G4doub 441 G4double theta 470 // G4double momentum, 442 // G4double momentum, 471 // G4double A 443 // G4double A 472 ) 444 ) 473 { 445 { 474 G4double sigma, bzero, bzero2, bonebyarg, bo 446 G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2; 475 G4double delta, diffuse, gamma; 447 G4double delta, diffuse, gamma; 476 G4double e1, e2, bone, bone2; 448 G4double e1, e2, bone, bone2; 477 449 478 // G4double wavek = momentum/hbarc; // wave 450 // G4double wavek = momentum/hbarc; // wave vector 479 // G4double r0 = 1.08*fermi; 451 // G4double r0 = 1.08*fermi; 480 // G4double rad = r0*G4Pow::GetInstance()- << 452 // G4double rad = r0*std::pow(A, 1./3.); 481 453 482 G4double kr = fWaveVector*fNuclearRadius; 454 G4double kr = fWaveVector*fNuclearRadius; // wavek*rad; 483 G4double kr2 = kr*kr; 455 G4double kr2 = kr*kr; 484 G4double krt = kr*theta; 456 G4double krt = kr*theta; 485 457 486 bzero = BesselJzero(krt); 458 bzero = BesselJzero(krt); 487 bzero2 = bzero*bzero; 459 bzero2 = bzero*bzero; 488 bone = BesselJone(krt); 460 bone = BesselJone(krt); 489 bone2 = bone*bone; 461 bone2 = bone*bone; 490 bonebyarg = BesselOneByArg(krt); 462 bonebyarg = BesselOneByArg(krt); 491 bonebyarg2 = bonebyarg*bonebyarg; 463 bonebyarg2 = bonebyarg*bonebyarg; 492 464 493 if (fParticle == theProton) 465 if (fParticle == theProton) 494 { 466 { 495 diffuse = 0.63*fermi; 467 diffuse = 0.63*fermi; 496 // diffuse = 0.6*fermi; 468 // diffuse = 0.6*fermi; 497 gamma = 0.3*fermi; 469 gamma = 0.3*fermi; 498 delta = 0.1*fermi*fermi; 470 delta = 0.1*fermi*fermi; 499 e1 = 0.3*fermi; 471 e1 = 0.3*fermi; 500 e2 = 0.35*fermi; 472 e2 = 0.35*fermi; 501 } 473 } 502 else if (fParticle == theNeutron) << 503 { << 504 diffuse = 0.63*fermi; << 505 // diffuse = 0.6*fermi; << 506 G4double k0 = 1*GeV/hbarc; << 507 diffuse *= k0/fWaveVector; << 508 gamma = 0.3*fermi; << 509 delta = 0.1*fermi*fermi; << 510 e1 = 0.3*fermi; << 511 e2 = 0.35*fermi; << 512 } << 513 else // as proton, if were not defined 474 else // as proton, if were not defined 514 { 475 { 515 diffuse = 0.63*fermi; 476 diffuse = 0.63*fermi; 516 gamma = 0.3*fermi; 477 gamma = 0.3*fermi; 517 delta = 0.1*fermi*fermi; 478 delta = 0.1*fermi*fermi; 518 e1 = 0.3*fermi; 479 e1 = 0.3*fermi; 519 e2 = 0.35*fermi; 480 e2 = 0.35*fermi; 520 } 481 } 521 G4double lambda = 15.; // 15 ok 482 G4double lambda = 15.; // 15 ok 522 // G4double kgamma = fWaveVector*gamma; 483 // G4double kgamma = fWaveVector*gamma; // wavek*delta; 523 G4double kgamma = lambda*(1.-G4Exp(-fWave << 484 G4double kgamma = lambda*(1.-std::exp(-fWaveVector*gamma/lambda)); // wavek*delta; 524 485 525 // G4cout<<"kgamma = "<<kgamma<<G4endl; 486 // G4cout<<"kgamma = "<<kgamma<<G4endl; 526 487 527 if(fAddCoulomb) // add Coulomb correction 488 if(fAddCoulomb) // add Coulomb correction 528 { 489 { 529 G4double sinHalfTheta = std::sin(0.5*thet 490 G4double sinHalfTheta = std::sin(0.5*theta); 530 G4double sinHalfTheta2 = sinHalfTheta*sinH 491 G4double sinHalfTheta2 = sinHalfTheta*sinHalfTheta; 531 492 532 kgamma += 0.5*fZommerfeld/kr/(sinHalfTheta 493 kgamma += 0.5*fZommerfeld/kr/(sinHalfTheta2+fAm); // correction at J0() 533 // kgamma += 0.65*fZommerfeld/kr/(sinHalfThe 494 // kgamma += 0.65*fZommerfeld/kr/(sinHalfTheta2+fAm); // correction at J0() 534 } 495 } 535 496 536 G4double kgamma2 = kgamma*kgamma; 497 G4double kgamma2 = kgamma*kgamma; 537 498 538 // G4double dk2t = delta*fWaveVector*fWaveV 499 // G4double dk2t = delta*fWaveVector*fWaveVector*theta; // delta*wavek*wavek*theta; 539 // G4cout<<"dk2t = "<<dk2t<<G4endl; 500 // G4cout<<"dk2t = "<<dk2t<<G4endl; 540 // G4double dk2t2 = dk2t*dk2t; 501 // G4double dk2t2 = dk2t*dk2t; 541 // G4double pikdt = pi*fWaveVector*diffuse*t 502 // G4double pikdt = pi*fWaveVector*diffuse*theta;// pi*wavek*diffuse*theta; 542 503 543 G4double pikdt = lambda*(1.-G4Exp(-pi*fWa << 504 G4double pikdt = lambda*(1.-std::exp(-pi*fWaveVector*diffuse*theta/lambda)); // wavek*delta; 544 505 545 // G4cout<<"pikdt = "<<pikdt<<G4endl; 506 // G4cout<<"pikdt = "<<pikdt<<G4endl; 546 507 547 damp = DampFactor(pikdt); 508 damp = DampFactor(pikdt); 548 damp2 = damp*damp; 509 damp2 = damp*damp; 549 510 550 G4double mode2k2 = (e1*e1+e2*e2)*fWaveVector 511 G4double mode2k2 = (e1*e1+e2*e2)*fWaveVector*fWaveVector; 551 G4double e2dk3t = -2.*e2*delta*fWaveVector* 512 G4double e2dk3t = -2.*e2*delta*fWaveVector*fWaveVector*fWaveVector*theta; 552 513 553 sigma = kgamma2; 514 sigma = kgamma2; 554 // sigma += dk2t2; 515 // sigma += dk2t2; 555 sigma *= bzero2; 516 sigma *= bzero2; 556 sigma += mode2k2*bone2; 517 sigma += mode2k2*bone2; 557 sigma += e2dk3t*bzero*bone; 518 sigma += e2dk3t*bzero*bone; 558 519 559 // sigma += kr2*(1 + 8.*fZommerfeld*fZommerf 520 // sigma += kr2*(1 + 8.*fZommerfeld*fZommerfeld/kr2)*bonebyarg2; // correction at J1()/() 560 sigma += kr2*bonebyarg2; // correction at J 521 sigma += kr2*bonebyarg2; // correction at J1()/() 561 522 562 sigma *= damp2; // *rad*rad; 523 sigma *= damp2; // *rad*rad; 563 524 564 return sigma; 525 return sigma; 565 } 526 } 566 527 567 528 568 ////////////////////////////////////////////// 529 //////////////////////////////////////////////////////////////////////////// 569 // 530 // 570 // return differential elastic probability d(p 531 // return differential elastic probability d(probability)/d(t) with 571 // Coulomb correction. It is called from Build << 532 // Coulomb correction 572 533 573 G4double 534 G4double 574 G4DiffuseElastic::GetDiffElasticSumProbA( G4do 535 G4DiffuseElastic::GetDiffElasticSumProbA( G4double alpha ) 575 { 536 { 576 G4double theta; 537 G4double theta; 577 538 578 theta = std::sqrt(alpha); 539 theta = std::sqrt(alpha); 579 540 580 // theta = std::acos( 1 - alpha/2. ); 541 // theta = std::acos( 1 - alpha/2. ); 581 542 582 G4double sigma, bzero, bzero2, bonebyarg, bo 543 G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2; 583 G4double delta, diffuse, gamma; 544 G4double delta, diffuse, gamma; 584 G4double e1, e2, bone, bone2; 545 G4double e1, e2, bone, bone2; 585 546 586 // G4double wavek = momentum/hbarc; // wave 547 // G4double wavek = momentum/hbarc; // wave vector 587 // G4double r0 = 1.08*fermi; 548 // G4double r0 = 1.08*fermi; 588 // G4double rad = r0*G4Pow::GetInstance()- << 549 // G4double rad = r0*std::pow(A, 1./3.); 589 550 590 G4double kr = fWaveVector*fNuclearRadius; 551 G4double kr = fWaveVector*fNuclearRadius; // wavek*rad; 591 G4double kr2 = kr*kr; 552 G4double kr2 = kr*kr; 592 G4double krt = kr*theta; 553 G4double krt = kr*theta; 593 554 594 bzero = BesselJzero(krt); 555 bzero = BesselJzero(krt); 595 bzero2 = bzero*bzero; 556 bzero2 = bzero*bzero; 596 bone = BesselJone(krt); 557 bone = BesselJone(krt); 597 bone2 = bone*bone; 558 bone2 = bone*bone; 598 bonebyarg = BesselOneByArg(krt); 559 bonebyarg = BesselOneByArg(krt); 599 bonebyarg2 = bonebyarg*bonebyarg; 560 bonebyarg2 = bonebyarg*bonebyarg; 600 561 601 if ( fParticle == theProton ) << 562 if (fParticle == theProton) 602 { << 603 diffuse = 0.63*fermi; << 604 // diffuse = 0.6*fermi; << 605 gamma = 0.3*fermi; << 606 delta = 0.1*fermi*fermi; << 607 e1 = 0.3*fermi; << 608 e2 = 0.35*fermi; << 609 } << 610 else if ( fParticle == theNeutron ) << 611 { 563 { 612 diffuse = 0.63*fermi; 564 diffuse = 0.63*fermi; 613 // diffuse = 0.6*fermi; 565 // diffuse = 0.6*fermi; 614 // G4double k0 = 0.8*GeV/hbarc; << 615 // diffuse *= k0/fWaveVector; << 616 gamma = 0.3*fermi; 566 gamma = 0.3*fermi; 617 delta = 0.1*fermi*fermi; 567 delta = 0.1*fermi*fermi; 618 e1 = 0.3*fermi; 568 e1 = 0.3*fermi; 619 e2 = 0.35*fermi; 569 e2 = 0.35*fermi; 620 } 570 } 621 else // as proton, if were not defined 571 else // as proton, if were not defined 622 { 572 { 623 diffuse = 0.63*fermi; 573 diffuse = 0.63*fermi; 624 gamma = 0.3*fermi; 574 gamma = 0.3*fermi; 625 delta = 0.1*fermi*fermi; 575 delta = 0.1*fermi*fermi; 626 e1 = 0.3*fermi; 576 e1 = 0.3*fermi; 627 e2 = 0.35*fermi; 577 e2 = 0.35*fermi; 628 } 578 } 629 G4double lambda = 15.; // 15 ok 579 G4double lambda = 15.; // 15 ok 630 // G4double kgamma = fWaveVector*gamma; 580 // G4double kgamma = fWaveVector*gamma; // wavek*delta; 631 G4double kgamma = lambda*(1.-G4Exp(-fWave << 581 G4double kgamma = lambda*(1.-std::exp(-fWaveVector*gamma/lambda)); // wavek*delta; 632 582 633 // G4cout<<"kgamma = "<<kgamma<<G4endl; 583 // G4cout<<"kgamma = "<<kgamma<<G4endl; 634 584 635 if( fAddCoulomb ) // add Coulomb correction << 585 if(fAddCoulomb) // add Coulomb correction 636 { 586 { 637 G4double sinHalfTheta = theta*0.5; // std 587 G4double sinHalfTheta = theta*0.5; // std::sin(0.5*theta); 638 G4double sinHalfTheta2 = sinHalfTheta*sinH 588 G4double sinHalfTheta2 = sinHalfTheta*sinHalfTheta; 639 589 640 kgamma += 0.5*fZommerfeld/kr/(sinHalfTheta 590 kgamma += 0.5*fZommerfeld/kr/(sinHalfTheta2+fAm); // correction at J0() 641 // kgamma += 0.65*fZommerfeld/kr/(sinHalfThe 591 // kgamma += 0.65*fZommerfeld/kr/(sinHalfTheta2+fAm); // correction at J0() 642 } 592 } >> 593 643 G4double kgamma2 = kgamma*kgamma; 594 G4double kgamma2 = kgamma*kgamma; 644 595 645 // G4double dk2t = delta*fWaveVector*fWaveV 596 // G4double dk2t = delta*fWaveVector*fWaveVector*theta; // delta*wavek*wavek*theta; 646 // G4cout<<"dk2t = "<<dk2t<<G4endl; 597 // G4cout<<"dk2t = "<<dk2t<<G4endl; 647 // G4double dk2t2 = dk2t*dk2t; 598 // G4double dk2t2 = dk2t*dk2t; 648 // G4double pikdt = pi*fWaveVector*diffuse*t 599 // G4double pikdt = pi*fWaveVector*diffuse*theta;// pi*wavek*diffuse*theta; 649 600 650 G4double pikdt = lambda*(1. - G4Exp( -pi* << 601 G4double pikdt = lambda*(1.-std::exp(-pi*fWaveVector*diffuse*theta/lambda)); // wavek*delta; 651 602 652 // G4cout<<"pikdt = "<<pikdt<<G4endl; 603 // G4cout<<"pikdt = "<<pikdt<<G4endl; 653 604 654 damp = DampFactor( pikdt ); << 605 damp = DampFactor(pikdt); 655 damp2 = damp*damp; 606 damp2 = damp*damp; 656 607 657 G4double mode2k2 = ( e1*e1 + e2*e2 )*fWaveVe << 608 G4double mode2k2 = (e1*e1+e2*e2)*fWaveVector*fWaveVector; 658 G4double e2dk3t = -2.*e2*delta*fWaveVector* 609 G4double e2dk3t = -2.*e2*delta*fWaveVector*fWaveVector*fWaveVector*theta; 659 610 660 sigma = kgamma2; 611 sigma = kgamma2; 661 // sigma += dk2t2; 612 // sigma += dk2t2; 662 sigma *= bzero2; 613 sigma *= bzero2; 663 sigma += mode2k2*bone2; 614 sigma += mode2k2*bone2; 664 sigma += e2dk3t*bzero*bone; 615 sigma += e2dk3t*bzero*bone; 665 616 666 // sigma += kr2*(1 + 8.*fZommerfeld*fZommerf 617 // sigma += kr2*(1 + 8.*fZommerfeld*fZommerfeld/kr2)*bonebyarg2; // correction at J1()/() 667 sigma += kr2*bonebyarg2; // correction at J 618 sigma += kr2*bonebyarg2; // correction at J1()/() 668 619 669 sigma *= damp2; // *rad*rad; 620 sigma *= damp2; // *rad*rad; 670 621 671 return sigma; 622 return sigma; 672 } 623 } 673 624 674 625 675 ////////////////////////////////////////////// 626 //////////////////////////////////////////////////////////////////////////// 676 // 627 // 677 // return differential elastic probability 2*p 628 // return differential elastic probability 2*pi*sin(theta)*d(probability)/d(omega) 678 629 679 G4double 630 G4double 680 G4DiffuseElastic::GetIntegrandFunction( G4doub 631 G4DiffuseElastic::GetIntegrandFunction( G4double alpha ) 681 { 632 { 682 G4double result; 633 G4double result; 683 634 684 result = GetDiffElasticSumProbA(alpha); 635 result = GetDiffElasticSumProbA(alpha); 685 636 686 // result *= 2*pi*std::sin(theta); 637 // result *= 2*pi*std::sin(theta); 687 638 688 return result; 639 return result; 689 } 640 } 690 641 691 ////////////////////////////////////////////// 642 //////////////////////////////////////////////////////////////////////////// 692 // 643 // 693 // return integral elastic cross section d(sig 644 // return integral elastic cross section d(sigma)/d(omega) integrated 0 - theta 694 645 695 G4double 646 G4double 696 G4DiffuseElastic::IntegralElasticProb( const 647 G4DiffuseElastic::IntegralElasticProb( const G4ParticleDefinition* particle, 697 G4doub 648 G4double theta, 698 G4double momentum, 649 G4double momentum, 699 G4doub 650 G4double A ) 700 { 651 { 701 G4double result; 652 G4double result; 702 fParticle = particle; 653 fParticle = particle; 703 fWaveVector = momentum/hbarc; 654 fWaveVector = momentum/hbarc; 704 fAtomicWeight = A; 655 fAtomicWeight = A; 705 656 706 fNuclearRadius = CalculateNuclearRad(A); 657 fNuclearRadius = CalculateNuclearRad(A); 707 658 708 659 709 G4Integrator<G4DiffuseElastic,G4double(G4Dif 660 G4Integrator<G4DiffuseElastic,G4double(G4DiffuseElastic::*)(G4double)> integral; 710 661 711 // result = integral.Legendre10(this,&G4Diff 662 // result = integral.Legendre10(this,&G4DiffuseElastic::GetIntegrandFunction, 0., theta ); 712 result = integral.Legendre96(this,&G4Diffuse 663 result = integral.Legendre96(this,&G4DiffuseElastic::GetIntegrandFunction, 0., theta ); 713 664 714 return result; 665 return result; 715 } 666 } 716 667 717 ////////////////////////////////////////////// 668 //////////////////////////////////////////////////////////////////////////// 718 // 669 // 719 // Return inv momentum transfer -t > 0 670 // Return inv momentum transfer -t > 0 720 671 721 G4double G4DiffuseElastic::SampleT( const G4Pa 672 G4double G4DiffuseElastic::SampleT( const G4ParticleDefinition* aParticle, G4double p, G4double A) 722 { 673 { 723 G4double theta = SampleThetaCMS( aParticle, 674 G4double theta = SampleThetaCMS( aParticle, p, A); // sample theta in cms 724 G4double t = 2*p*p*( 1 - std::cos(theta) 675 G4double t = 2*p*p*( 1 - std::cos(theta) ); // -t !!! 725 return t; 676 return t; 726 } 677 } 727 678 728 ////////////////////////////////////////////// 679 //////////////////////////////////////////////////////////////////////////// 729 // 680 // 730 // Return scattering angle sampled in cms 681 // Return scattering angle sampled in cms 731 682 732 683 733 G4double 684 G4double 734 G4DiffuseElastic::SampleThetaCMS(const G4Parti 685 G4DiffuseElastic::SampleThetaCMS(const G4ParticleDefinition* particle, 735 G4doubl 686 G4double momentum, G4double A) 736 { 687 { 737 G4int i, iMax = 100; 688 G4int i, iMax = 100; 738 G4double norm, theta1, theta2, thetaMax; << 689 G4double norm, result, theta1, theta2, thetaMax, sum = 0.; 739 G4double result = 0., sum = 0.; << 740 690 741 fParticle = particle; 691 fParticle = particle; 742 fWaveVector = momentum/hbarc; 692 fWaveVector = momentum/hbarc; 743 fAtomicWeight = A; 693 fAtomicWeight = A; 744 694 745 fNuclearRadius = CalculateNuclearRad(A); 695 fNuclearRadius = CalculateNuclearRad(A); 746 696 747 thetaMax = 10.174/fWaveVector/fNuclearRadius 697 thetaMax = 10.174/fWaveVector/fNuclearRadius; 748 698 749 if (thetaMax > pi) thetaMax = pi; 699 if (thetaMax > pi) thetaMax = pi; 750 700 751 G4Integrator<G4DiffuseElastic,G4double(G4Dif 701 G4Integrator<G4DiffuseElastic,G4double(G4DiffuseElastic::*)(G4double)> integral; 752 702 753 // result = integral.Legendre10(this,&G4Diff 703 // result = integral.Legendre10(this,&G4DiffuseElastic::GetIntegrandFunction, 0., theta ); 754 norm = integral.Legendre96(this,&G4DiffuseEl 704 norm = integral.Legendre96(this,&G4DiffuseElastic::GetIntegrandFunction, 0., thetaMax ); 755 705 756 norm *= G4UniformRand(); 706 norm *= G4UniformRand(); 757 707 758 for(i = 1; i <= iMax; i++) 708 for(i = 1; i <= iMax; i++) 759 { 709 { 760 theta1 = (i-1)*thetaMax/iMax; 710 theta1 = (i-1)*thetaMax/iMax; 761 theta2 = i*thetaMax/iMax; 711 theta2 = i*thetaMax/iMax; 762 sum += integral.Legendre10(this,&G4Diffu 712 sum += integral.Legendre10(this,&G4DiffuseElastic::GetIntegrandFunction, theta1, theta2); 763 713 764 if ( sum >= norm ) 714 if ( sum >= norm ) 765 { 715 { 766 result = 0.5*(theta1 + theta2); 716 result = 0.5*(theta1 + theta2); 767 break; 717 break; 768 } 718 } 769 } 719 } 770 if (i > iMax ) result = 0.5*(theta1 + theta2 720 if (i > iMax ) result = 0.5*(theta1 + theta2); 771 721 772 G4double sigma = pi*thetaMax/iMax; 722 G4double sigma = pi*thetaMax/iMax; 773 723 774 result += G4RandGauss::shoot(0.,sigma); 724 result += G4RandGauss::shoot(0.,sigma); 775 725 776 if(result < 0.) result = 0.; 726 if(result < 0.) result = 0.; 777 if(result > thetaMax) result = thetaMax; 727 if(result > thetaMax) result = thetaMax; 778 728 779 return result; 729 return result; 780 } 730 } 781 731 782 ////////////////////////////////////////////// 732 ///////////////////////////////////////////////////////////////////////////// 783 ///////////////////// Table preparation and r 733 ///////////////////// Table preparation and reading //////////////////////// 784 ////////////////////////////////////////////// 734 //////////////////////////////////////////////////////////////////////////// 785 // 735 // 786 // Return inv momentum transfer -t > 0 from in 736 // Return inv momentum transfer -t > 0 from initialisation table 787 737 788 G4double G4DiffuseElastic::SampleInvariantT( c 738 G4double G4DiffuseElastic::SampleInvariantT( const G4ParticleDefinition* aParticle, G4double p, 789 739 G4int Z, G4int A) 790 { 740 { 791 fParticle = aParticle; 741 fParticle = aParticle; 792 G4double m1 = fParticle->GetPDGMass(), t; << 742 G4double m1 = fParticle->GetPDGMass(); 793 G4double totElab = std::sqrt(m1*m1+p*p); 743 G4double totElab = std::sqrt(m1*m1+p*p); 794 G4double mass2 = G4NucleiProperties::GetNucl 744 G4double mass2 = G4NucleiProperties::GetNuclearMass(A, Z); 795 G4LorentzVector lv1(p,0.0,0.0,totElab); 745 G4LorentzVector lv1(p,0.0,0.0,totElab); 796 G4LorentzVector lv(0.0,0.0,0.0,mass2); 746 G4LorentzVector lv(0.0,0.0,0.0,mass2); 797 lv += lv1; 747 lv += lv1; 798 748 799 G4ThreeVector bst = lv.boostVector(); 749 G4ThreeVector bst = lv.boostVector(); 800 lv1.boost(-bst); 750 lv1.boost(-bst); 801 751 802 G4ThreeVector p1 = lv1.vect(); 752 G4ThreeVector p1 = lv1.vect(); 803 G4double momentumCMS = p1.mag(); 753 G4double momentumCMS = p1.mag(); 804 << 805 if( aParticle == theNeutron) << 806 { << 807 G4double Tmax = NeutronTuniform( Z ); << 808 G4double pCMS2 = momentumCMS*momentumCMS; << 809 G4double Tkin = std::sqrt(pCMS2+m1*m1)-m1; << 810 << 811 if( Tkin <= Tmax ) << 812 { << 813 t = 4.*pCMS2*G4UniformRand(); << 814 // G4cout<<Tkin<<", "<<Tmax<<", "<<std:: << 815 return t; << 816 } << 817 } << 818 << 819 t = SampleTableT( aParticle, momentumCMS, G << 820 754 >> 755 G4double t = SampleTableT( aParticle, momentumCMS, G4double(Z), G4double(A) ); // sample theta2 in cms 821 return t; 756 return t; 822 } 757 } 823 758 824 ////////////////////////////////////////////// << 825 << 826 G4double G4DiffuseElastic::NeutronTuniform(G4i << 827 { << 828 G4double elZ = G4double(Z); << 829 elZ -= 1.; << 830 // G4double Tkin = 20.*G4Exp(-elZ/10.) + 1.; << 831 G4double Tkin = 12.*G4Exp(-elZ/10.) + 1.; << 832 return Tkin; << 833 } << 834 << 835 << 836 ////////////////////////////////////////////// 759 //////////////////////////////////////////////////////////////////////////// 837 // 760 // 838 // Return inv momentum transfer -t > 0 from in 761 // Return inv momentum transfer -t > 0 from initialisation table 839 762 840 G4double G4DiffuseElastic::SampleTableT( const 763 G4double G4DiffuseElastic::SampleTableT( const G4ParticleDefinition* aParticle, G4double p, 841 764 G4double Z, G4double A) 842 { 765 { 843 G4double alpha = SampleTableThetaCMS( aParti 766 G4double alpha = SampleTableThetaCMS( aParticle, p, Z, A); // sample theta2 in cms 844 G4double t = 2*p*p*( 1 - std::cos(std::s << 767 // G4double t = 2*p*p*( 1 - std::cos(std::sqrt(alpha)) ); // -t !!! 845 // G4double t = p*p*alpha; / << 768 G4double t = p*p*alpha; // -t !!! 846 return t; 769 return t; 847 } 770 } 848 771 849 ////////////////////////////////////////////// 772 //////////////////////////////////////////////////////////////////////////// 850 // 773 // 851 // Return scattering angle2 sampled in cms acc 774 // Return scattering angle2 sampled in cms according to precalculated table. 852 775 853 776 854 G4double 777 G4double 855 G4DiffuseElastic::SampleTableThetaCMS(const G4 778 G4DiffuseElastic::SampleTableThetaCMS(const G4ParticleDefinition* particle, 856 G4doubl 779 G4double momentum, G4double Z, G4double A) 857 { 780 { 858 std::size_t iElement; << 781 size_t iElement; 859 G4int iMomentum, iAngle; 782 G4int iMomentum, iAngle; 860 G4double randAngle, position, theta1, theta2 783 G4double randAngle, position, theta1, theta2, E1, E2, W1, W2, W; 861 G4double m1 = particle->GetPDGMass(); 784 G4double m1 = particle->GetPDGMass(); 862 785 863 for(iElement = 0; iElement < fElementNumberV 786 for(iElement = 0; iElement < fElementNumberVector.size(); iElement++) 864 { 787 { 865 if( std::fabs(Z - fElementNumberVector[iEl 788 if( std::fabs(Z - fElementNumberVector[iElement]) < 0.5) break; 866 } 789 } 867 if ( iElement == fElementNumberVector.size() 790 if ( iElement == fElementNumberVector.size() ) 868 { 791 { 869 InitialiseOnFly(Z,A); // table preparation 792 InitialiseOnFly(Z,A); // table preparation, if needed 870 793 871 // iElement--; 794 // iElement--; 872 795 873 // G4cout << "G4DiffuseElastic: Element wi 796 // G4cout << "G4DiffuseElastic: Element with atomic number " << Z 874 // << " is not found, return zero angle" < 797 // << " is not found, return zero angle" << G4endl; 875 // return 0.; // no table for this element 798 // return 0.; // no table for this element 876 } 799 } 877 // G4cout<<"iElement = "<<iElement<<G4endl; 800 // G4cout<<"iElement = "<<iElement<<G4endl; 878 801 879 fAngleTable = fAngleBank[iElement]; 802 fAngleTable = fAngleBank[iElement]; 880 803 881 G4double kinE = std::sqrt(momentum*momentum 804 G4double kinE = std::sqrt(momentum*momentum + m1*m1) - m1; 882 805 883 for( iMomentum = 0; iMomentum < fEnergyBin; 806 for( iMomentum = 0; iMomentum < fEnergyBin; iMomentum++) 884 { 807 { 885 if( kinE < fEnergyVector->GetLowEdgeEnergy 808 if( kinE < fEnergyVector->GetLowEdgeEnergy(iMomentum) ) break; 886 } 809 } 887 if ( iMomentum >= fEnergyBin ) iMomentum = f 810 if ( iMomentum >= fEnergyBin ) iMomentum = fEnergyBin-1; // kinE is more then theMaxEnergy 888 if ( iMomentum < 0 ) iMomentum = 0 811 if ( iMomentum < 0 ) iMomentum = 0; // against negative index, kinE < theMinEnergy 889 812 890 // G4cout<<"iMomentum = "<<iMomentum<<G4endl 813 // G4cout<<"iMomentum = "<<iMomentum<<G4endl; 891 814 892 if (iMomentum == fEnergyBin -1 || iMomentum 815 if (iMomentum == fEnergyBin -1 || iMomentum == 0 ) // the table edges 893 { 816 { 894 position = (*(*fAngleTable)(iMomentum))(fA 817 position = (*(*fAngleTable)(iMomentum))(fAngleBin-2)*G4UniformRand(); 895 818 896 // G4cout<<"position = "<<position<<G4endl 819 // G4cout<<"position = "<<position<<G4endl; 897 820 898 for(iAngle = 0; iAngle < fAngleBin-1; iAng 821 for(iAngle = 0; iAngle < fAngleBin-1; iAngle++) 899 { 822 { 900 if( position > (*(*fAngleTable)(iMomentu << 823 if( position < (*(*fAngleTable)(iMomentum))(iAngle) ) break; 901 } 824 } 902 if (iAngle >= fAngleBin-1) iAngle = fAngle 825 if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2; 903 826 904 // G4cout<<"iAngle = "<<iAngle<<G4endl; 827 // G4cout<<"iAngle = "<<iAngle<<G4endl; 905 828 906 randAngle = GetScatteringAngle(iMomentum, 829 randAngle = GetScatteringAngle(iMomentum, iAngle, position); 907 830 908 // G4cout<<"randAngle = "<<randAngle<<G4en 831 // G4cout<<"randAngle = "<<randAngle<<G4endl; 909 } 832 } 910 else // kinE inside between energy table ed 833 else // kinE inside between energy table edges 911 { 834 { 912 // position = (*(*fAngleTable)(iMomentum)) 835 // position = (*(*fAngleTable)(iMomentum))(fAngleBin-2)*G4UniformRand(); 913 position = (*(*fAngleTable)(iMomentum))(0) 836 position = (*(*fAngleTable)(iMomentum))(0)*G4UniformRand(); 914 837 915 // G4cout<<"position = "<<position<<G4endl 838 // G4cout<<"position = "<<position<<G4endl; 916 839 917 for(iAngle = 0; iAngle < fAngleBin-1; iAng 840 for(iAngle = 0; iAngle < fAngleBin-1; iAngle++) 918 { 841 { 919 // if( position < (*(*fAngleTable)(iMome 842 // if( position < (*(*fAngleTable)(iMomentum))(iAngle) ) break; 920 if( position > (*(*fAngleTable)(iMomentu 843 if( position > (*(*fAngleTable)(iMomentum))(iAngle) ) break; 921 } 844 } 922 if (iAngle >= fAngleBin-1) iAngle = fAngle 845 if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2; 923 846 924 // G4cout<<"iAngle = "<<iAngle<<G4endl; 847 // G4cout<<"iAngle = "<<iAngle<<G4endl; 925 848 926 theta2 = GetScatteringAngle(iMomentum, iA 849 theta2 = GetScatteringAngle(iMomentum, iAngle, position); 927 850 928 // G4cout<<"theta2 = "<<theta2<<G4endl; 851 // G4cout<<"theta2 = "<<theta2<<G4endl; 929 E2 = fEnergyVector->GetLowEdgeEnergy(iMome 852 E2 = fEnergyVector->GetLowEdgeEnergy(iMomentum); 930 853 931 // G4cout<<"E2 = "<<E2<<G4endl; 854 // G4cout<<"E2 = "<<E2<<G4endl; 932 855 933 iMomentum--; 856 iMomentum--; 934 857 935 // position = (*(*fAngleTable)(iMomentum)) 858 // position = (*(*fAngleTable)(iMomentum))(fAngleBin-2)*G4UniformRand(); 936 859 937 // G4cout<<"position = "<<position<<G4endl 860 // G4cout<<"position = "<<position<<G4endl; 938 861 939 for(iAngle = 0; iAngle < fAngleBin-1; iAng 862 for(iAngle = 0; iAngle < fAngleBin-1; iAngle++) 940 { 863 { 941 // if( position < (*(*fAngleTable)(iMome 864 // if( position < (*(*fAngleTable)(iMomentum))(iAngle) ) break; 942 if( position > (*(*fAngleTable)(iMomentu 865 if( position > (*(*fAngleTable)(iMomentum))(iAngle) ) break; 943 } 866 } 944 if (iAngle >= fAngleBin-1) iAngle = fAngle 867 if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2; 945 868 946 theta1 = GetScatteringAngle(iMomentum, iA 869 theta1 = GetScatteringAngle(iMomentum, iAngle, position); 947 870 948 // G4cout<<"theta1 = "<<theta1<<G4endl; 871 // G4cout<<"theta1 = "<<theta1<<G4endl; 949 872 950 E1 = fEnergyVector->GetLowEdgeEnergy(iMome 873 E1 = fEnergyVector->GetLowEdgeEnergy(iMomentum); 951 874 952 // G4cout<<"E1 = "<<E1<<G4endl; 875 // G4cout<<"E1 = "<<E1<<G4endl; 953 876 954 W = 1.0/(E2 - E1); 877 W = 1.0/(E2 - E1); 955 W1 = (E2 - kinE)*W; 878 W1 = (E2 - kinE)*W; 956 W2 = (kinE - E1)*W; 879 W2 = (kinE - E1)*W; 957 880 958 randAngle = W1*theta1 + W2*theta2; 881 randAngle = W1*theta1 + W2*theta2; 959 882 960 // randAngle = theta2; 883 // randAngle = theta2; 961 // G4cout<<"randAngle = "<<randAngle<<G4en 884 // G4cout<<"randAngle = "<<randAngle<<G4endl; 962 } 885 } 963 // G4double angle = randAngle; 886 // G4double angle = randAngle; 964 // if (randAngle > 0.) randAngle /= 2*pi*std 887 // if (randAngle > 0.) randAngle /= 2*pi*std::sin(angle); 965 888 966 if(randAngle < 0.) randAngle = 0.; << 967 << 968 return randAngle; 889 return randAngle; 969 } 890 } 970 891 971 ////////////////////////////////////////////// 892 ////////////////////////////////////////////////////////////////////////////// 972 // 893 // 973 // Initialisation for given particle on fly us 894 // Initialisation for given particle on fly using new element number 974 895 975 void G4DiffuseElastic::InitialiseOnFly(G4doubl 896 void G4DiffuseElastic::InitialiseOnFly(G4double Z, G4double A) 976 { 897 { 977 fAtomicNumber = Z; // atomic number 898 fAtomicNumber = Z; // atomic number 978 fAtomicWeight = G4NistManager::Instance()-> << 899 fAtomicWeight = A; // number of nucleons 979 900 980 fNuclearRadius = CalculateNuclearRad(fAtomic 901 fNuclearRadius = CalculateNuclearRad(fAtomicWeight); 981 << 902 982 if( verboseLevel > 0 ) 903 if( verboseLevel > 0 ) 983 { 904 { 984 G4cout<<"G4DiffuseElastic::InitialiseOnFly << 905 G4cout<<"G4DiffuseElastic::Initialise() the element with Z = " 985 <<Z<<"; and A = "<<A<<G4endl; 906 <<Z<<"; and A = "<<A<<G4endl; 986 } 907 } 987 fElementNumberVector.push_back(fAtomicNumber 908 fElementNumberVector.push_back(fAtomicNumber); 988 909 989 BuildAngleTable(); 910 BuildAngleTable(); 990 911 991 fAngleBank.push_back(fAngleTable); 912 fAngleBank.push_back(fAngleTable); 992 913 993 return; 914 return; 994 } 915 } 995 916 996 ////////////////////////////////////////////// 917 /////////////////////////////////////////////////////////////////////////////// 997 // 918 // 998 // Build for given particle and element table 919 // Build for given particle and element table of momentum, angle probability. 999 // For the moment in lab system. 920 // For the moment in lab system. 1000 921 1001 void G4DiffuseElastic::BuildAngleTable() 922 void G4DiffuseElastic::BuildAngleTable() 1002 { 923 { 1003 G4int i, j; 924 G4int i, j; 1004 G4double partMom, kinE, a = 0., z = fPartic 925 G4double partMom, kinE, a = 0., z = fParticle->GetPDGCharge(), m1 = fParticle->GetPDGMass(); 1005 G4double alpha1, alpha2, alphaMax, alphaCou 926 G4double alpha1, alpha2, alphaMax, alphaCoulomb, delta = 0., sum = 0.; 1006 927 1007 G4Integrator<G4DiffuseElastic,G4double(G4Di 928 G4Integrator<G4DiffuseElastic,G4double(G4DiffuseElastic::*)(G4double)> integral; 1008 929 1009 fAngleTable = new G4PhysicsTable( fEnergyBi << 930 fAngleTable = new G4PhysicsTable(fEnergyBin); 1010 931 1011 for( i = 0; i < fEnergyBin; i++) 932 for( i = 0; i < fEnergyBin; i++) 1012 { 933 { 1013 kinE = fEnergyVector->GetLowEdgeEn 934 kinE = fEnergyVector->GetLowEdgeEnergy(i); 1014 partMom = std::sqrt( kinE*(kinE + 2*m 935 partMom = std::sqrt( kinE*(kinE + 2*m1) ); 1015 936 1016 fWaveVector = partMom/hbarc; 937 fWaveVector = partMom/hbarc; 1017 938 1018 G4double kR = fWaveVector*fNuclearRad 939 G4double kR = fWaveVector*fNuclearRadius; 1019 G4double kR2 = kR*kR; 940 G4double kR2 = kR*kR; 1020 G4double kRmax = 18.6; // 10.6; 10.6, 18 941 G4double kRmax = 18.6; // 10.6; 10.6, 18, 10.174; ~ 3 maxima of J1 or 15., 25. 1021 G4double kRcoul = 1.9; // 1.2; 1.4, 2.5; 942 G4double kRcoul = 1.9; // 1.2; 1.4, 2.5; // on the first slope of J1 1022 // G4double kRlim = 1.2; 943 // G4double kRlim = 1.2; 1023 // G4double kRlim2 = kRlim*kRlim/kR2; 944 // G4double kRlim2 = kRlim*kRlim/kR2; 1024 945 1025 alphaMax = kRmax*kRmax/kR2; 946 alphaMax = kRmax*kRmax/kR2; 1026 947 1027 << 948 if (alphaMax > 4.) alphaMax = 4.; // vmg05-02-09: was pi2 1028 // if (alphaMax > 4.) alphaMax = 4.; // << 1029 // if ( alphaMax > 4. || alphaMax < 1. ) << 1030 << 1031 // if ( alphaMax > 4. || alphaMax < 1. ) << 1032 << 1033 // G4cout<<"alphaMax = "<<alphaMax<<", "; << 1034 << 1035 if ( alphaMax >= CLHEP::pi*CLHEP::pi ) al << 1036 949 1037 alphaCoulomb = kRcoul*kRcoul/kR2; 950 alphaCoulomb = kRcoul*kRcoul/kR2; 1038 951 1039 if( z ) 952 if( z ) 1040 { 953 { 1041 a = partMom/m1; // be 954 a = partMom/m1; // beta*gamma for m1 1042 fBeta = a/std::sqrt(1+a*a); 955 fBeta = a/std::sqrt(1+a*a); 1043 fZommerfeld = CalculateZommerfeld( fBet 956 fZommerfeld = CalculateZommerfeld( fBeta, z, fAtomicNumber); 1044 fAm = CalculateAm( partMom, fZo 957 fAm = CalculateAm( partMom, fZommerfeld, fAtomicNumber); 1045 } 958 } 1046 G4PhysicsFreeVector* angleVector = new G4 959 G4PhysicsFreeVector* angleVector = new G4PhysicsFreeVector(fAngleBin-1); 1047 960 1048 // G4PhysicsLogVector* angleBins = new G 961 // G4PhysicsLogVector* angleBins = new G4PhysicsLogVector( 0.001*alphaMax, alphaMax, fAngleBin ); 1049 962 1050 G4double delth = alphaMax/fAngleBin; 963 G4double delth = alphaMax/fAngleBin; 1051 964 1052 sum = 0.; 965 sum = 0.; 1053 966 1054 // fAddCoulomb = false; 967 // fAddCoulomb = false; 1055 fAddCoulomb = true; 968 fAddCoulomb = true; 1056 969 1057 // for(j = 1; j < fAngleBin; j++) 970 // for(j = 1; j < fAngleBin; j++) 1058 for(j = fAngleBin-1; j >= 1; j--) 971 for(j = fAngleBin-1; j >= 1; j--) 1059 { 972 { 1060 // alpha1 = angleBins->GetLowEdgeEnergy 973 // alpha1 = angleBins->GetLowEdgeEnergy(j-1); 1061 // alpha2 = angleBins->GetLowEdgeEnergy 974 // alpha2 = angleBins->GetLowEdgeEnergy(j); 1062 975 1063 // alpha1 = alphaMax*(j-1)/fAngleBin; 976 // alpha1 = alphaMax*(j-1)/fAngleBin; 1064 // alpha2 = alphaMax*( j )/fAngleBin; 977 // alpha2 = alphaMax*( j )/fAngleBin; 1065 978 1066 alpha1 = delth*(j-1); 979 alpha1 = delth*(j-1); 1067 // if(alpha1 < kRlim2) alpha1 = kRlim2; 980 // if(alpha1 < kRlim2) alpha1 = kRlim2; 1068 alpha2 = alpha1 + delth; 981 alpha2 = alpha1 + delth; 1069 982 1070 // if( ( alpha2 > alphaCoulomb ) && z ) 983 // if( ( alpha2 > alphaCoulomb ) && z ) fAddCoulomb = true; 1071 if( ( alpha1 < alphaCoulomb ) && z ) fA 984 if( ( alpha1 < alphaCoulomb ) && z ) fAddCoulomb = false; 1072 985 1073 delta = integral.Legendre10(this, &G4Di 986 delta = integral.Legendre10(this, &G4DiffuseElastic::GetIntegrandFunction, alpha1, alpha2); 1074 // delta = integral.Legendre96(this, &G 987 // delta = integral.Legendre96(this, &G4DiffuseElastic::GetIntegrandFunction, alpha1, alpha2); 1075 988 1076 sum += delta; 989 sum += delta; 1077 990 1078 angleVector->PutValue( j-1 , alpha1, su 991 angleVector->PutValue( j-1 , alpha1, sum ); // alpha2 1079 // G4cout<<"j-1 = "<<j-1<<"; alpha << 992 // G4cout<<"j-1 = "<<j-1<<"; alpha2 = "<<alpha2<<"; sum = "<<sum<<G4endl; 1080 } 993 } 1081 fAngleTable->insertAt(i, angleVector); << 994 fAngleTable->insertAt(i,angleVector); 1082 995 1083 // delete[] angleVector; 996 // delete[] angleVector; 1084 // delete[] angleBins; 997 // delete[] angleBins; 1085 } 998 } 1086 return; 999 return; 1087 } 1000 } 1088 1001 1089 ///////////////////////////////////////////// 1002 ///////////////////////////////////////////////////////////////////////////////// 1090 // 1003 // 1091 // 1004 // 1092 1005 1093 G4double 1006 G4double 1094 G4DiffuseElastic:: GetScatteringAngle( G4int 1007 G4DiffuseElastic:: GetScatteringAngle( G4int iMomentum, G4int iAngle, G4double position ) 1095 { 1008 { 1096 G4double x1, x2, y1, y2, randAngle; 1009 G4double x1, x2, y1, y2, randAngle; 1097 1010 1098 if( iAngle == 0 ) 1011 if( iAngle == 0 ) 1099 { 1012 { 1100 randAngle = (*fAngleTable)(iMomentum)->Ge 1013 randAngle = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle); 1101 // iAngle++; 1014 // iAngle++; 1102 } 1015 } 1103 else 1016 else 1104 { 1017 { 1105 if ( iAngle >= G4int((*fAngleTable)(iMome 1018 if ( iAngle >= G4int((*fAngleTable)(iMomentum)->GetVectorLength()) ) 1106 { 1019 { 1107 iAngle = G4int((*fAngleTable)(iMomentum << 1020 iAngle = (*fAngleTable)(iMomentum)->GetVectorLength() - 1; 1108 } 1021 } 1109 y1 = (*(*fAngleTable)(iMomentum))(iAngle- 1022 y1 = (*(*fAngleTable)(iMomentum))(iAngle-1); 1110 y2 = (*(*fAngleTable)(iMomentum))(iAngle) 1023 y2 = (*(*fAngleTable)(iMomentum))(iAngle); 1111 1024 1112 x1 = (*fAngleTable)(iMomentum)->GetLowEdg 1025 x1 = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle-1); 1113 x2 = (*fAngleTable)(iMomentum)->GetLowEdg 1026 x2 = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle); 1114 1027 1115 if ( x1 == x2 ) randAngle = x2; 1028 if ( x1 == x2 ) randAngle = x2; 1116 else 1029 else 1117 { 1030 { 1118 if ( y1 == y2 ) randAngle = x1 + ( x2 - 1031 if ( y1 == y2 ) randAngle = x1 + ( x2 - x1 )*G4UniformRand(); 1119 else 1032 else 1120 { 1033 { 1121 randAngle = x1 + ( position - y1 )*( 1034 randAngle = x1 + ( position - y1 )*( x2 - x1 )/( y2 - y1 ); 1122 } 1035 } 1123 } 1036 } 1124 } 1037 } 1125 return randAngle; 1038 return randAngle; 1126 } 1039 } 1127 1040 1128 1041 1129 1042 1130 ///////////////////////////////////////////// 1043 //////////////////////////////////////////////////////////////////////////// 1131 // 1044 // 1132 // Return scattering angle sampled in lab sys 1045 // Return scattering angle sampled in lab system (target at rest) 1133 1046 1134 1047 1135 1048 1136 G4double 1049 G4double 1137 G4DiffuseElastic::SampleThetaLab( const G4Had 1050 G4DiffuseElastic::SampleThetaLab( const G4HadProjectile* aParticle, 1138 G4dou 1051 G4double tmass, G4double A) 1139 { 1052 { 1140 const G4ParticleDefinition* theParticle = a 1053 const G4ParticleDefinition* theParticle = aParticle->GetDefinition(); 1141 G4double m1 = theParticle->GetPDGMass(); 1054 G4double m1 = theParticle->GetPDGMass(); 1142 G4double plab = aParticle->GetTotalMomentum 1055 G4double plab = aParticle->GetTotalMomentum(); 1143 G4LorentzVector lv1 = aParticle->Get4Moment 1056 G4LorentzVector lv1 = aParticle->Get4Momentum(); 1144 G4LorentzVector lv(0.0,0.0,0.0,tmass); 1057 G4LorentzVector lv(0.0,0.0,0.0,tmass); 1145 lv += lv1; 1058 lv += lv1; 1146 1059 1147 G4ThreeVector bst = lv.boostVector(); 1060 G4ThreeVector bst = lv.boostVector(); 1148 lv1.boost(-bst); 1061 lv1.boost(-bst); 1149 1062 1150 G4ThreeVector p1 = lv1.vect(); 1063 G4ThreeVector p1 = lv1.vect(); 1151 G4double ptot = p1.mag(); 1064 G4double ptot = p1.mag(); 1152 G4double tmax = 4.0*ptot*ptot; 1065 G4double tmax = 4.0*ptot*ptot; 1153 G4double t = 0.0; 1066 G4double t = 0.0; 1154 1067 1155 1068 1156 // 1069 // 1157 // Sample t 1070 // Sample t 1158 // 1071 // 1159 1072 1160 t = SampleT( theParticle, ptot, A); 1073 t = SampleT( theParticle, ptot, A); 1161 1074 1162 // NaN finder 1075 // NaN finder 1163 if(!(t < 0.0 || t >= 0.0)) 1076 if(!(t < 0.0 || t >= 0.0)) 1164 { 1077 { 1165 if (verboseLevel > 0) 1078 if (verboseLevel > 0) 1166 { 1079 { 1167 G4cout << "G4DiffuseElastic:WARNING: A 1080 G4cout << "G4DiffuseElastic:WARNING: A = " << A 1168 << " mom(GeV)= " << plab/GeV 1081 << " mom(GeV)= " << plab/GeV 1169 << " S-wave will be sampled" 1082 << " S-wave will be sampled" 1170 << G4endl; 1083 << G4endl; 1171 } 1084 } 1172 t = G4UniformRand()*tmax; 1085 t = G4UniformRand()*tmax; 1173 } 1086 } 1174 if(verboseLevel>1) 1087 if(verboseLevel>1) 1175 { 1088 { 1176 G4cout <<" t= " << t << " tmax= " << tmax 1089 G4cout <<" t= " << t << " tmax= " << tmax 1177 << " ptot= " << ptot << G4endl; 1090 << " ptot= " << ptot << G4endl; 1178 } 1091 } 1179 // Sampling of angles in CM system 1092 // Sampling of angles in CM system 1180 1093 1181 G4double phi = G4UniformRand()*twopi; 1094 G4double phi = G4UniformRand()*twopi; 1182 G4double cost = 1. - 2.0*t/tmax; 1095 G4double cost = 1. - 2.0*t/tmax; 1183 G4double sint; 1096 G4double sint; 1184 1097 1185 if( cost >= 1.0 ) 1098 if( cost >= 1.0 ) 1186 { 1099 { 1187 cost = 1.0; 1100 cost = 1.0; 1188 sint = 0.0; 1101 sint = 0.0; 1189 } 1102 } 1190 else if( cost <= -1.0) 1103 else if( cost <= -1.0) 1191 { 1104 { 1192 cost = -1.0; 1105 cost = -1.0; 1193 sint = 0.0; 1106 sint = 0.0; 1194 } 1107 } 1195 else 1108 else 1196 { 1109 { 1197 sint = std::sqrt((1.0-cost)*(1.0+cost)); 1110 sint = std::sqrt((1.0-cost)*(1.0+cost)); 1198 } 1111 } 1199 if (verboseLevel>1) 1112 if (verboseLevel>1) 1200 { 1113 { 1201 G4cout << "cos(t)=" << cost << " std::sin 1114 G4cout << "cos(t)=" << cost << " std::sin(t)=" << sint << G4endl; 1202 } 1115 } 1203 G4ThreeVector v1(sint*std::cos(phi),sint*st 1116 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost); 1204 v1 *= ptot; 1117 v1 *= ptot; 1205 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),s 1118 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),std::sqrt(ptot*ptot + m1*m1)); 1206 1119 1207 nlv1.boost(bst); 1120 nlv1.boost(bst); 1208 1121 1209 G4ThreeVector np1 = nlv1.vect(); 1122 G4ThreeVector np1 = nlv1.vect(); 1210 1123 1211 // G4double theta = std::acos( np1.z()/np 1124 // G4double theta = std::acos( np1.z()/np1.mag() ); // degree; 1212 1125 1213 G4double theta = np1.theta(); 1126 G4double theta = np1.theta(); 1214 1127 1215 return theta; 1128 return theta; 1216 } 1129 } 1217 1130 1218 ///////////////////////////////////////////// 1131 //////////////////////////////////////////////////////////////////////////// 1219 // 1132 // 1220 // Return scattering angle in lab system (tar 1133 // Return scattering angle in lab system (target at rest) knowing theta in CMS 1221 1134 1222 1135 1223 1136 1224 G4double 1137 G4double 1225 G4DiffuseElastic::ThetaCMStoThetaLab( const G 1138 G4DiffuseElastic::ThetaCMStoThetaLab( const G4DynamicParticle* aParticle, 1226 G4dou 1139 G4double tmass, G4double thetaCMS) 1227 { 1140 { 1228 const G4ParticleDefinition* theParticle = a 1141 const G4ParticleDefinition* theParticle = aParticle->GetDefinition(); 1229 G4double m1 = theParticle->GetPDGMass(); 1142 G4double m1 = theParticle->GetPDGMass(); 1230 // G4double plab = aParticle->GetTotalMomen 1143 // G4double plab = aParticle->GetTotalMomentum(); 1231 G4LorentzVector lv1 = aParticle->Get4Moment 1144 G4LorentzVector lv1 = aParticle->Get4Momentum(); 1232 G4LorentzVector lv(0.0,0.0,0.0,tmass); 1145 G4LorentzVector lv(0.0,0.0,0.0,tmass); 1233 1146 1234 lv += lv1; 1147 lv += lv1; 1235 1148 1236 G4ThreeVector bst = lv.boostVector(); 1149 G4ThreeVector bst = lv.boostVector(); 1237 1150 1238 lv1.boost(-bst); 1151 lv1.boost(-bst); 1239 1152 1240 G4ThreeVector p1 = lv1.vect(); 1153 G4ThreeVector p1 = lv1.vect(); 1241 G4double ptot = p1.mag(); 1154 G4double ptot = p1.mag(); 1242 1155 1243 G4double phi = G4UniformRand()*twopi; 1156 G4double phi = G4UniformRand()*twopi; 1244 G4double cost = std::cos(thetaCMS); 1157 G4double cost = std::cos(thetaCMS); 1245 G4double sint; 1158 G4double sint; 1246 1159 1247 if( cost >= 1.0 ) 1160 if( cost >= 1.0 ) 1248 { 1161 { 1249 cost = 1.0; 1162 cost = 1.0; 1250 sint = 0.0; 1163 sint = 0.0; 1251 } 1164 } 1252 else if( cost <= -1.0) 1165 else if( cost <= -1.0) 1253 { 1166 { 1254 cost = -1.0; 1167 cost = -1.0; 1255 sint = 0.0; 1168 sint = 0.0; 1256 } 1169 } 1257 else 1170 else 1258 { 1171 { 1259 sint = std::sqrt((1.0-cost)*(1.0+cost)); 1172 sint = std::sqrt((1.0-cost)*(1.0+cost)); 1260 } 1173 } 1261 if (verboseLevel>1) 1174 if (verboseLevel>1) 1262 { 1175 { 1263 G4cout << "cos(tcms)=" << cost << " std:: 1176 G4cout << "cos(tcms)=" << cost << " std::sin(tcms)=" << sint << G4endl; 1264 } 1177 } 1265 G4ThreeVector v1(sint*std::cos(phi),sint*st 1178 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost); 1266 v1 *= ptot; 1179 v1 *= ptot; 1267 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),s 1180 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),std::sqrt(ptot*ptot + m1*m1)); 1268 1181 1269 nlv1.boost(bst); 1182 nlv1.boost(bst); 1270 1183 1271 G4ThreeVector np1 = nlv1.vect(); 1184 G4ThreeVector np1 = nlv1.vect(); 1272 1185 1273 1186 1274 G4double thetaLab = np1.theta(); 1187 G4double thetaLab = np1.theta(); 1275 1188 1276 return thetaLab; 1189 return thetaLab; 1277 } 1190 } 1278 ///////////////////////////////////////////// 1191 //////////////////////////////////////////////////////////////////////////// 1279 // 1192 // 1280 // Return scattering angle in CMS system (tar 1193 // Return scattering angle in CMS system (target at rest) knowing theta in Lab 1281 1194 1282 1195 1283 1196 1284 G4double 1197 G4double 1285 G4DiffuseElastic::ThetaLabToThetaCMS( const G 1198 G4DiffuseElastic::ThetaLabToThetaCMS( const G4DynamicParticle* aParticle, 1286 G4dou 1199 G4double tmass, G4double thetaLab) 1287 { 1200 { 1288 const G4ParticleDefinition* theParticle = a 1201 const G4ParticleDefinition* theParticle = aParticle->GetDefinition(); 1289 G4double m1 = theParticle->GetPDGMass(); 1202 G4double m1 = theParticle->GetPDGMass(); 1290 G4double plab = aParticle->GetTotalMomentum 1203 G4double plab = aParticle->GetTotalMomentum(); 1291 G4LorentzVector lv1 = aParticle->Get4Moment 1204 G4LorentzVector lv1 = aParticle->Get4Momentum(); 1292 G4LorentzVector lv(0.0,0.0,0.0,tmass); 1205 G4LorentzVector lv(0.0,0.0,0.0,tmass); 1293 1206 1294 lv += lv1; 1207 lv += lv1; 1295 1208 1296 G4ThreeVector bst = lv.boostVector(); 1209 G4ThreeVector bst = lv.boostVector(); 1297 1210 1298 // lv1.boost(-bst); 1211 // lv1.boost(-bst); 1299 1212 1300 // G4ThreeVector p1 = lv1.vect(); 1213 // G4ThreeVector p1 = lv1.vect(); 1301 // G4double ptot = p1.mag(); 1214 // G4double ptot = p1.mag(); 1302 1215 1303 G4double phi = G4UniformRand()*twopi; 1216 G4double phi = G4UniformRand()*twopi; 1304 G4double cost = std::cos(thetaLab); 1217 G4double cost = std::cos(thetaLab); 1305 G4double sint; 1218 G4double sint; 1306 1219 1307 if( cost >= 1.0 ) 1220 if( cost >= 1.0 ) 1308 { 1221 { 1309 cost = 1.0; 1222 cost = 1.0; 1310 sint = 0.0; 1223 sint = 0.0; 1311 } 1224 } 1312 else if( cost <= -1.0) 1225 else if( cost <= -1.0) 1313 { 1226 { 1314 cost = -1.0; 1227 cost = -1.0; 1315 sint = 0.0; 1228 sint = 0.0; 1316 } 1229 } 1317 else 1230 else 1318 { 1231 { 1319 sint = std::sqrt((1.0-cost)*(1.0+cost)); 1232 sint = std::sqrt((1.0-cost)*(1.0+cost)); 1320 } 1233 } 1321 if (verboseLevel>1) 1234 if (verboseLevel>1) 1322 { 1235 { 1323 G4cout << "cos(tlab)=" << cost << " std:: 1236 G4cout << "cos(tlab)=" << cost << " std::sin(tlab)=" << sint << G4endl; 1324 } 1237 } 1325 G4ThreeVector v1(sint*std::cos(phi),sint*st 1238 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost); 1326 v1 *= plab; 1239 v1 *= plab; 1327 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),s 1240 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),std::sqrt(plab*plab + m1*m1)); 1328 1241 1329 nlv1.boost(-bst); 1242 nlv1.boost(-bst); 1330 1243 1331 G4ThreeVector np1 = nlv1.vect(); 1244 G4ThreeVector np1 = nlv1.vect(); 1332 1245 1333 1246 1334 G4double thetaCMS = np1.theta(); 1247 G4double thetaCMS = np1.theta(); 1335 1248 1336 return thetaCMS; 1249 return thetaCMS; 1337 } 1250 } 1338 1251 1339 ///////////////////////////////////////////// 1252 /////////////////////////////////////////////////////////////////////////////// 1340 // 1253 // 1341 // Test for given particle and element table 1254 // Test for given particle and element table of momentum, angle probability. 1342 // For the moment in lab system. 1255 // For the moment in lab system. 1343 1256 1344 void G4DiffuseElastic::TestAngleTable(const G 1257 void G4DiffuseElastic::TestAngleTable(const G4ParticleDefinition* theParticle, G4double partMom, 1345 G 1258 G4double Z, G4double A) 1346 { 1259 { 1347 fAtomicNumber = Z; // atomic number 1260 fAtomicNumber = Z; // atomic number 1348 fAtomicWeight = A; // number of nucleo 1261 fAtomicWeight = A; // number of nucleons 1349 fNuclearRadius = CalculateNuclearRad(fAtomi 1262 fNuclearRadius = CalculateNuclearRad(fAtomicWeight); 1350 1263 1351 1264 1352 1265 1353 G4cout<<"G4DiffuseElastic::TestAngleTable() 1266 G4cout<<"G4DiffuseElastic::TestAngleTable() init the element with Z = " 1354 <<Z<<"; and A = "<<A<<G4endl; 1267 <<Z<<"; and A = "<<A<<G4endl; 1355 1268 1356 fElementNumberVector.push_back(fAtomicNumbe 1269 fElementNumberVector.push_back(fAtomicNumber); 1357 1270 1358 1271 1359 1272 1360 1273 1361 G4int i=0, j; 1274 G4int i=0, j; 1362 G4double a = 0., z = theParticle->GetPDGCha 1275 G4double a = 0., z = theParticle->GetPDGCharge(), m1 = fParticle->GetPDGMass(); 1363 G4double alpha1=0., alpha2=0., alphaMax=0., 1276 G4double alpha1=0., alpha2=0., alphaMax=0., alphaCoulomb=0.; 1364 G4double deltaL10 = 0., deltaL96 = 0., delt 1277 G4double deltaL10 = 0., deltaL96 = 0., deltaAG = 0.; 1365 G4double sumL10 = 0.,sumL96 = 0.,sumAG = 0. 1278 G4double sumL10 = 0.,sumL96 = 0.,sumAG = 0.; 1366 G4double epsilon = 0.001; 1279 G4double epsilon = 0.001; 1367 1280 1368 G4Integrator<G4DiffuseElastic,G4double(G4Di 1281 G4Integrator<G4DiffuseElastic,G4double(G4DiffuseElastic::*)(G4double)> integral; 1369 1282 1370 fAngleTable = new G4PhysicsTable(fEnergyBin 1283 fAngleTable = new G4PhysicsTable(fEnergyBin); 1371 1284 1372 fWaveVector = partMom/hbarc; 1285 fWaveVector = partMom/hbarc; 1373 1286 1374 G4double kR = fWaveVector*fNuclearRadiu 1287 G4double kR = fWaveVector*fNuclearRadius; 1375 G4double kR2 = kR*kR; 1288 G4double kR2 = kR*kR; 1376 G4double kRmax = 10.6; // 10.6, 18, 10.174 1289 G4double kRmax = 10.6; // 10.6, 18, 10.174; ~ 3 maxima of J1 or 15., 25. 1377 G4double kRcoul = 1.2; // 1.4, 2.5; // on t 1290 G4double kRcoul = 1.2; // 1.4, 2.5; // on the first slope of J1 1378 1291 1379 alphaMax = kRmax*kRmax/kR2; 1292 alphaMax = kRmax*kRmax/kR2; 1380 1293 1381 if (alphaMax > 4.) alphaMax = 4.; // vmg05 1294 if (alphaMax > 4.) alphaMax = 4.; // vmg05-02-09: was pi2 1382 1295 1383 alphaCoulomb = kRcoul*kRcoul/kR2; 1296 alphaCoulomb = kRcoul*kRcoul/kR2; 1384 1297 1385 if( z ) 1298 if( z ) 1386 { 1299 { 1387 a = partMom/m1; // beta*gamma 1300 a = partMom/m1; // beta*gamma for m1 1388 fBeta = a/std::sqrt(1+a*a); 1301 fBeta = a/std::sqrt(1+a*a); 1389 fZommerfeld = CalculateZommerfeld( fBet 1302 fZommerfeld = CalculateZommerfeld( fBeta, z, fAtomicNumber); 1390 fAm = CalculateAm( partMom, fZo 1303 fAm = CalculateAm( partMom, fZommerfeld, fAtomicNumber); 1391 } 1304 } 1392 G4PhysicsFreeVector* angleVector = new G4Ph 1305 G4PhysicsFreeVector* angleVector = new G4PhysicsFreeVector(fAngleBin-1); 1393 1306 1394 // G4PhysicsLogVector* angleBins = new G4P 1307 // G4PhysicsLogVector* angleBins = new G4PhysicsLogVector( 0.001*alphaMax, alphaMax, fAngleBin ); 1395 1308 1396 1309 1397 fAddCoulomb = false; 1310 fAddCoulomb = false; 1398 1311 1399 for(j = 1; j < fAngleBin; j++) 1312 for(j = 1; j < fAngleBin; j++) 1400 { 1313 { 1401 // alpha1 = angleBins->GetLowEdgeEnergy 1314 // alpha1 = angleBins->GetLowEdgeEnergy(j-1); 1402 // alpha2 = angleBins->GetLowEdgeEnergy 1315 // alpha2 = angleBins->GetLowEdgeEnergy(j); 1403 1316 1404 alpha1 = alphaMax*(j-1)/fAngleBin; 1317 alpha1 = alphaMax*(j-1)/fAngleBin; 1405 alpha2 = alphaMax*( j )/fAngleBin; 1318 alpha2 = alphaMax*( j )/fAngleBin; 1406 1319 1407 if( ( alpha2 > alphaCoulomb ) && z ) fAdd 1320 if( ( alpha2 > alphaCoulomb ) && z ) fAddCoulomb = true; 1408 1321 1409 deltaL10 = integral.Legendre10(this, &G4D 1322 deltaL10 = integral.Legendre10(this, &G4DiffuseElastic::GetIntegrandFunction, alpha1, alpha2); 1410 deltaL96 = integral.Legendre96(this, &G4D 1323 deltaL96 = integral.Legendre96(this, &G4DiffuseElastic::GetIntegrandFunction, alpha1, alpha2); 1411 deltaAG = integral.AdaptiveGauss(this, & 1324 deltaAG = integral.AdaptiveGauss(this, &G4DiffuseElastic::GetIntegrandFunction, 1412 alpha1 1325 alpha1, alpha2,epsilon); 1413 1326 1414 // G4cout<<alpha1<<"\t"<<std::sqrt(alph 1327 // G4cout<<alpha1<<"\t"<<std::sqrt(alpha1)/degree<<"\t" 1415 // <<deltaL10<<"\t"<<deltaL96<<"\t" 1328 // <<deltaL10<<"\t"<<deltaL96<<"\t"<<deltaAG<<G4endl; 1416 1329 1417 sumL10 += deltaL10; 1330 sumL10 += deltaL10; 1418 sumL96 += deltaL96; 1331 sumL96 += deltaL96; 1419 sumAG += deltaAG; 1332 sumAG += deltaAG; 1420 1333 1421 G4cout<<alpha1<<"\t"<<std::sqrt(alpha1)/d 1334 G4cout<<alpha1<<"\t"<<std::sqrt(alpha1)/degree<<"\t" 1422 <<sumL10<<"\t"<<sumL96<<"\t"<<sum 1335 <<sumL10<<"\t"<<sumL96<<"\t"<<sumAG<<G4endl; 1423 1336 1424 angleVector->PutValue( j-1 , alpha1, sumL 1337 angleVector->PutValue( j-1 , alpha1, sumL10 ); // alpha2 1425 } 1338 } 1426 fAngleTable->insertAt(i,angleVector); 1339 fAngleTable->insertAt(i,angleVector); 1427 fAngleBank.push_back(fAngleTable); 1340 fAngleBank.push_back(fAngleTable); 1428 1341 1429 /* 1342 /* 1430 // Integral over all angle range - Bad accu 1343 // Integral over all angle range - Bad accuracy !!! 1431 1344 1432 sumL10 = integral.Legendre10(this, &G4Diffu 1345 sumL10 = integral.Legendre10(this, &G4DiffuseElastic::GetIntegrandFunction, 0., alpha2); 1433 sumL96 = integral.Legendre96(this, &G4Diffu 1346 sumL96 = integral.Legendre96(this, &G4DiffuseElastic::GetIntegrandFunction, 0., alpha2); 1434 sumAG = integral.AdaptiveGauss(this, &G4Di 1347 sumAG = integral.AdaptiveGauss(this, &G4DiffuseElastic::GetIntegrandFunction, 1435 0., al 1348 0., alpha2,epsilon); 1436 G4cout<<G4endl; 1349 G4cout<<G4endl; 1437 G4cout<<alpha2<<"\t"<<std::sqrt(alpha2)/deg 1350 G4cout<<alpha2<<"\t"<<std::sqrt(alpha2)/degree<<"\t" 1438 <<sumL10<<"\t"<<sumL96<<"\t"<<sum 1351 <<sumL10<<"\t"<<sumL96<<"\t"<<sumAG<<G4endl; 1439 */ 1352 */ 1440 return; 1353 return; 1441 } 1354 } 1442 1355 1443 // 1356 // 1444 // 1357 // 1445 ///////////////////////////////////////////// 1358 ///////////////////////////////////////////////////////////////////////////////// 1446 1359