83 lowEnergyRecoilLimit = 100.*keV;
84 lowEnergyLimitQ = 0.0*GeV;
85 lowEnergyLimitHE = 0.0*GeV;
86 lowestEnergyLimit = 0.0*keV;
87 plabLowLimit = 20.0*MeV;
97 fEnergyAngleVector = 0;
119 delete fEnergyVector;
135 for( jEl = 0; jEl < numOfEl; ++jEl)
137 fAtomicNumber = (*theElementTable)[jEl]->GetZ();
143 G4cout<<
"G4DiffuseElasticV2::Initialise() the element: "
144 <<(*theElementTable)[jEl]->GetName()<<
G4endl;
146 fElementNumberVector.push_back(fAtomicNumber);
147 fElementNameVector.push_back((*theElementTable)[jEl]->GetName());
151 fEnergyAngleVectorBank.push_back(fEnergyAngleVector);
152 fEnergySumVectorBank.push_back(fEnergySumVector);
167 G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2;
175 G4double kr = fWaveVector*fNuclearRadius;
180 bzero2 = bzero*bzero;
184 bonebyarg2 = bonebyarg*bonebyarg;
186 if ( fParticle == theProton )
188 diffuse = 0.63*fermi;
190 delta = 0.1*fermi*fermi;
194 else if ( fParticle == theNeutron )
196 diffuse = 0.63*fermi;
198 delta = 0.1*fermi*fermi;
204 diffuse = 0.63*fermi;
206 delta = 0.1*fermi*fermi;
213 G4double kgamma = lambda*(1.-
G4Exp(-fWaveVector*gamma/lambda));
217 G4double sinHalfTheta = std::sin(0.5*theta);
218 G4double sinHalfTheta2 = sinHalfTheta*sinHalfTheta;
220 kgamma += 0.5*fZommerfeld/kr/(sinHalfTheta2+fAm);
229 G4double pikdt = lambda*(1. -
G4Exp( -pi*fWaveVector*diffuse*theta/lambda ) );
234 G4double mode2k2 = ( e1*e1 + e2*e2 )*fWaveVector*fWaveVector;
235 G4double e2dk3t = -2.*e2*delta*fWaveVector*fWaveVector*fWaveVector*theta;
240 sigma += mode2k2*bone2;
241 sigma += e2dk3t*bzero*bone;
244 sigma += kr2*bonebyarg2;
276 fParticle = aParticle;
278 G4double totElab = std::sqrt(m1*m1+p*p);
290 if( aParticle == theNeutron)
293 G4double pCMS2 = momentumCMS*momentumCMS;
294 G4double Tkin = std::sqrt(pCMS2+m1*m1)-m1;
328 G4double t = 2*p*p*( 1 - std::cos(alpha) );
344 unsigned long iAngle = 0;
348 for(iElement = 0; iElement < fElementNumberVector.size(); iElement++)
350 if( std::fabs(Z - fElementNumberVector[iElement]) < 0.5)
break;
353 if ( iElement == fElementNumberVector.size() )
358 fEnergyAngleVector = fEnergyAngleVectorBank[iElement];
359 fEnergySumVector = fEnergySumVectorBank[iElement];
362 G4double kinE = std::sqrt(momentum*momentum + m1*m1) - m1;
364 iMomentum = fEnergyVector->
FindBin(kinE,1000) + 1;
368 for(iAngle = 0; iAngle < fAngleBin; iAngle++)
370 if (
position > (*(*fEnergySumVector)[iMomentum])[iAngle])
break;
374 if (iMomentum == fEnergyBin -1 || iMomentum == 0 )
382 E2 = fEnergyVector->
Energy(iMomentum);
388 E1 = fEnergyVector->
Energy(iMomentum);
394 randAngle = W1*theta1 + W2*theta2;
399 if(randAngle < 0.) randAngle = 0.;
417 G4cout<<
"G4DiffuseElasticV2::InitialiseOnFly() the element with Z = "
420 fElementNumberVector.push_back(fAtomicNumber);
424 fEnergyAngleVectorBank.push_back(fEnergyAngleVector);
425 fEnergySumVectorBank.push_back(fEnergySumVector);
439 G4double alpha1, alpha2, alphaMax, alphaCoulomb, delta = 0., sum = 0.;
443 fEnergyAngleVector =
new std::vector<std::vector<double>*>;
444 fEnergySumVector =
new std::vector<std::vector<double>*>;
446 for( i = 0; i < fEnergyBin; i++)
448 kinE = fEnergyVector->
Energy(i);
449 partMom = std::sqrt( kinE*(kinE + 2*m1) );
451 fWaveVector = partMom/hbarc;
453 G4double kR = fWaveVector*fNuclearRadius;
459 if ( alphaMax >= CLHEP::pi ) alphaMax = CLHEP::pi;
461 alphaCoulomb = kRcoul/kR;
466 fBeta = a/std::sqrt(1+a*a);
468 fAm =
CalculateAm( partMom, fZommerfeld, fAtomicNumber);
472 std::vector<double>* angleVector =
new std::vector<double>(fAngleBin);
473 std::vector<double>* sumVector =
new std::vector<double>(fAngleBin);
476 G4double delth = alphaMax/fAngleBin;
480 for(j = fAngleBin-1; j >= 0; j--)
483 alpha2 = alpha1 + delth;
485 if( fAddCoulomb && ( alpha2 < alphaCoulomb)) fAddCoulomb =
false;
491 (*angleVector)[j] = alpha1;
492 (*sumVector)[j] = sum;
495 fEnergyAngleVector->push_back(angleVector);
496 fEnergySumVector->push_back(sumVector);
509 G4double x1, x2, y1, y2, randAngle = 0;
513 randAngle = (*(*fEnergyAngleVector)[iMomentum])[iAngle];
517 if ( iAngle >= (*fEnergyAngleVector)[iMomentum]->size() )
519 iAngle = (*fEnergyAngleVector)[iMomentum]->size() - 1;
522 y1 = (*(*fEnergySumVector)[iMomentum])[iAngle-1];
523 y2 = (*(*fEnergySumVector)[iMomentum])[iAngle];
525 x1 = (*(*fEnergyAngleVector)[iMomentum])[iAngle-1];
526 x2 = (*(*fEnergyAngleVector)[iMomentum])[iAngle];
528 if ( x1 == x2 ) randAngle = x2;
531 if ( y1 == y2 ) randAngle = x1 + ( x2 - x1 )*
G4UniformRand();
534 randAngle = x1 + (
position - y1 )*( x2 - x1 )/( y2 - y1 );
578 else if( cost <= -1.0)
585 sint = std::sqrt((1.0-cost)*(1.0+cost));
589 G4cout <<
"cos(tcms)=" << cost <<
" std::sin(tcms)=" << sint <<
G4endl;
591 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
632 else if( cost <= -1.0)
639 sint = std::sqrt((1.0-cost)*(1.0+cost));
643 G4cout <<
"cos(tlab)=" << cost <<
" std::sin(tlab)=" << sint <<
G4endl;
645 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
double A(double temperature)
std::vector< G4Element * > G4ElementTable
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4GLOB_DLL std::ostream G4cout
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
G4double BesselJzero(G4double z)
G4double SampleTableT(const G4ParticleDefinition *aParticle, G4double p, G4double Z, G4double A)
G4double CalculateNuclearRad(G4double A)
G4double SampleTableThetaCMS(const G4ParticleDefinition *aParticle, G4double p, G4double Z, G4double A)
G4double BesselJone(G4double z)
G4double CalculateZommerfeld(G4double beta, G4double Z1, G4double Z2)
G4double GetScatteringAngle(G4int iMomentum, unsigned long iAngle, G4double position)
G4double DampFactor(G4double z)
G4double CalculateAm(G4double momentum, G4double n, G4double Z)
virtual ~G4DiffuseElasticV2()
G4double GetIntegrandFunction(G4double theta)
G4double ThetaLabToThetaCMS(const G4DynamicParticle *aParticle, G4double tmass, G4double thetaLab)
G4double BesselOneByArg(G4double z)
virtual G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
void InitialiseOnFly(G4double Z, G4double A)
G4double NeutronTuniform(G4int Z)
G4double ThetaCMStoThetaLab(const G4DynamicParticle *aParticle, G4double tmass, G4double thetaCMS)
G4double GetDiffElasticSumProbA(G4double alpha)
G4ParticleDefinition * GetDefinition() const
G4LorentzVector Get4Momentum() const
G4double GetTotalMomentum() const
static G4ElementTable * GetElementTable()
static size_t GetNumberOfElements()
void SetMinEnergy(G4double anEnergy)
void SetMaxEnergy(const G4double anEnergy)
G4double GetMaxEnergy() const
static G4HadronicParameters * Instance()
static G4Neutron * Neutron()
static G4NistManager * Instance()
G4double GetAtomicMassAmu(const G4String &symb) const
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4double GetPDGMass() const
G4double GetPDGCharge() const
G4double Energy(std::size_t index) const
std::size_t FindBin(const G4double energy, const std::size_t idx) const
static G4Proton * Proton()