115 for ( std::vector<G4PhysicsTable*>::iterator it =
fAngleBank.begin();
118 if ( (*it) ) (*it)->clearAndDestroy();
139 for( jEl = 0; jEl < numOfEl; ++jEl)
147 G4cout<<
"G4DiffuseElastic::Initialise() the element: "
148 <<(*theElementTable)[jEl]->GetName()<<
G4endl;
197 if (iZ == 1 && iA == 1) theDef =
theProton;
200 else if (iZ == 2 && iA == 3) theDef =
G4He3::He3();
201 else if (iZ == 2 && iA == 4) theDef =
theAlpha;
215 G4double cost = 1 - 0.5*std::fabs(tMand)/ptot2;
217 if( cost >= 1.0 ) cost = 1.0;
218 else if( cost <= -1.0) cost = -1.0;
220 G4double thetaCMS = std::acos(cost);
252 if( z && (kRt > kRtC) )
284 if (iZ == 1 && iA == 1) theDef =
theProton;
287 else if (iZ == 2 && iA == 3) theDef =
G4He3::He3();
288 else if (iZ == 2 && iA == 4) theDef =
theAlpha;
302 G4double cost = 1 - 0.5*std::fabs(tMand)/ptot2;
304 if( cost >= 1.0 ) cost = 1.0;
305 else if( cost <= -1.0) cost = -1.0;
307 G4double thetaCMS = std::acos(cost);
334 if (iZ == 1 && iA == 1) theDef =
theProton;
337 else if (iZ == 2 && iA == 3) theDef =
G4He3::He3();
338 else if (iZ == 2 && iA == 4) theDef =
theAlpha;
352 G4double cost = 1 - 0.5*std::fabs(tMand)/ptot2;
354 if( cost >= 1.0 ) cost = 1.0;
355 else if( cost <= -1.0) cost = -1.0;
357 G4double thetaCMS = std::acos(cost);
377 G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2;
387 diffuse = 0.63*
fermi;
395 diffuse = 0.63*
fermi;
406 diffuse = 0.63*
fermi;
417 bzero2 = bzero*bzero;
421 bonebyarg2 = bonebyarg*bonebyarg;
446 sigma += mode2k2*bone2 + e2dk3t*bzero*bone;
447 sigma += kr2*bonebyarg2;
465 G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2;
478 bzero2 = bzero*bzero;
482 bonebyarg2 = bonebyarg*bonebyarg;
486 diffuse = 0.63*
fermi;
495 diffuse = 0.63*
fermi;
506 diffuse = 0.63*
fermi;
520 G4double sinHalfTheta = std::sin(0.5*theta);
521 G4double sinHalfTheta2 = sinHalfTheta*sinHalfTheta;
547 sigma += mode2k2*bone2;
548 sigma += e2dk3t*bzero*bone;
551 sigma += kr2*bonebyarg2;
569 theta = std::sqrt(alpha);
573 G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2;
586 bzero2 = bzero*bzero;
590 bonebyarg2 = bonebyarg*bonebyarg;
594 diffuse = 0.63*
fermi;
603 diffuse = 0.63*
fermi;
614 diffuse = 0.63*
fermi;
629 G4double sinHalfTheta2 = sinHalfTheta*sinHalfTheta;
654 sigma += mode2k2*bone2;
655 sigma += e2dk3t*bzero*bone;
658 sigma += kr2*bonebyarg2;
715 G4double t = 2*p*p*( 1 - std::cos(theta) );
729 G4double norm, result, theta1, theta2, thetaMax, sum = 0.;
739 if (thetaMax >
pi) thetaMax =
pi;
748 for(i = 1; i <= iMax; i++)
750 theta1 = (i-1)*thetaMax/iMax;
751 theta2 = i*thetaMax/iMax;
756 result = 0.5*(theta1 + theta2);
760 if (i > iMax ) result = 0.5*(theta1 + theta2);
766 if(result < 0.) result = 0.;
767 if(result > thetaMax) result = thetaMax;
783 G4double totElab = std::sqrt(m1*m1+p*p);
798 G4double pCMS2 = momentumCMS*momentumCMS;
799 G4double Tkin = std::sqrt(pCMS2+m1*m1)-m1;
821 G4double Tkin = 12.*std::exp(-elZ/10.) + 1.;
834 G4double t = 2*p*p*( 1 - std::cos(std::sqrt(alpha)) );
849 G4int iMomentum, iAngle;
871 G4double kinE = std::sqrt(momentum*momentum + m1*m1) - m1;
873 for( iMomentum = 0; iMomentum <
fEnergyBin; iMomentum++)
875 if( kinE < fEnergyVector->GetLowEdgeEnergy(iMomentum) )
break;
877 if ( iMomentum >= fEnergyBin ) iMomentum = fEnergyBin-1;
878 if ( iMomentum < 0 ) iMomentum = 0;
882 if (iMomentum == fEnergyBin -1 || iMomentum == 0 )
888 for(iAngle = 0; iAngle <
fAngleBin-1; iAngle++)
890 if( position > (*(*
fAngleTable)(iMomentum))(iAngle) )
break;
892 if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2;
907 for(iAngle = 0; iAngle <
fAngleBin-1; iAngle++)
910 if( position > (*(*
fAngleTable)(iMomentum))(iAngle) )
break;
912 if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2;
929 for(iAngle = 0; iAngle < fAngleBin-1; iAngle++)
932 if( position > (*(*
fAngleTable)(iMomentum))(iAngle) )
break;
934 if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2;
948 randAngle = W1*theta1 + W2*theta2;
956 if(randAngle < 0.) randAngle = 0.;
974 G4cout<<
"G4DiffuseElastic::InitialiseOnFly() the element with Z = "
975 <<Z<<
"; and A = "<<A<<
G4endl;
995 G4double alpha1, alpha2, alphaMax, alphaCoulomb, delta = 0., sum = 0.;
1004 partMom = std::sqrt( kinE*(kinE + 2*m1) );
1015 alphaMax = kRmax*kRmax/kR2;
1024 alphaCoulomb = kRcoul*kRcoul/kR2;
1029 fBeta = a/std::sqrt(1+a*a);
1053 alpha1 = delth*(j-1);
1055 alpha2 = alpha1 + delth;
1058 if( ( alpha1 < alphaCoulomb ) &&
z )
fAddCoulomb =
false;
1065 angleVector->
PutValue( j-1 , alpha1, sum );
1083 G4double x1, x2, y1, y2, randAngle;
1087 randAngle = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle);
1094 iAngle = (*fAngleTable)(iMomentum)->GetVectorLength() - 1;
1096 y1 = (*(*fAngleTable)(iMomentum))(iAngle-1);
1097 y2 = (*(*fAngleTable)(iMomentum))(iAngle);
1099 x1 = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle-1);
1100 x2 = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle);
1102 if ( x1 == x2 ) randAngle = x2;
1105 if ( y1 == y2 ) randAngle = x1 + ( x2 - x1 )*
G4UniformRand();
1108 randAngle = x1 + ( position - y1 )*( x2 - x1 )/( y2 - y1 );
1147 t =
SampleT( theParticle, ptot, A);
1150 if(!(t < 0.0 || t >= 0.0))
1154 G4cout <<
"G4DiffuseElastic:WARNING: A = " << A
1155 <<
" mom(GeV)= " << plab/
GeV
1156 <<
" S-wave will be sampled"
1163 G4cout <<
" t= " << t <<
" tmax= " << tmax
1164 <<
" ptot= " << ptot <<
G4endl;
1177 else if( cost <= -1.0)
1184 sint = std::sqrt((1.0-cost)*(1.0+cost));
1188 G4cout <<
"cos(t)=" << cost <<
" std::sin(t)=" << sint <<
G4endl;
1190 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
1192 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),std::sqrt(ptot*ptot + m1*m1));
1231 G4double cost = std::cos(thetaCMS);
1239 else if( cost <= -1.0)
1246 sint = std::sqrt((1.0-cost)*(1.0+cost));
1250 G4cout <<
"cos(tcms)=" << cost <<
" std::sin(tcms)=" << sint <<
G4endl;
1252 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
1254 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),std::sqrt(ptot*ptot + m1*m1));
1291 G4double cost = std::cos(thetaLab);
1299 else if( cost <= -1.0)
1306 sint = std::sqrt((1.0-cost)*(1.0+cost));
1310 G4cout <<
"cos(tlab)=" << cost <<
" std::sin(tlab)=" << sint <<
G4endl;
1312 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
1314 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),std::sqrt(plab*plab + m1*m1));
1340 G4cout<<
"G4DiffuseElastic::TestAngleTable() init the element with Z = "
1341 <<Z<<
"; and A = "<<A<<
G4endl;
1350 G4double alpha1=0., alpha2=0., alphaMax=0., alphaCoulomb=0.;
1351 G4double deltaL10 = 0., deltaL96 = 0., deltaAG = 0.;
1352 G4double sumL10 = 0.,sumL96 = 0.,sumAG = 0.;
1366 alphaMax = kRmax*kRmax/kR2;
1368 if (alphaMax > 4.) alphaMax = 4.;
1370 alphaCoulomb = kRcoul*kRcoul/kR2;
1375 fBeta = a/std::sqrt(1+a*a);
1391 alpha1 = alphaMax*(j-1)/fAngleBin;
1392 alpha2 = alphaMax*( j )/fAngleBin;
1394 if( ( alpha2 > alphaCoulomb ) &&
z )
fAddCoulomb =
true;
1399 alpha1, alpha2,epsilon);
1409 <<sumL10<<
"\t"<<sumL96<<
"\t"<<sumAG<<
G4endl;
1411 angleVector->
PutValue( j-1 , alpha1, sumL10 );
G4double ThetaCMStoThetaLab(const G4DynamicParticle *aParticle, G4double tmass, G4double thetaCMS)
G4double Legendre10(T &typeT, F f, G4double a, G4double b)
ThreeVector shoot(const G4int Ap, const G4int Af)
G4double IntegralElasticProb(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double A)
G4double CalculateNuclearRad(G4double A)
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4double Legendre96(T &typeT, F f, G4double a, G4double b)
G4double CalculateZommerfeld(G4double beta, G4double Z1, G4double Z2)
void PutValue(size_t binNumber, G4double binValue, G4double dataValue)
G4double lowEnergyLimitHE
G4double BesselJzero(G4double z)
CLHEP::Hep3Vector G4ThreeVector
void InitialiseOnFly(G4double Z, G4double A)
G4double GetInvElasticXsc(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double A, G4double Z)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
std::vector< G4String > fElementNameVector
G4double NeutronTuniform(G4int Z)
G4ParticleDefinition * theProton
G4ParticleDefinition * GetDefinition() const
G4double GetDiffElasticSumProb(G4double theta)
G4double SampleThetaCMS(const G4ParticleDefinition *aParticle, G4double p, G4double A)
G4double GetLowEdgeEnergy(size_t binNumber) const
G4double GetScatteringAngle(G4int iMomentum, G4int iAngle, G4double position)
G4double BesselJone(G4double z)
G4double SampleT(const G4ParticleDefinition *aParticle, G4double p, G4double A)
G4double SampleTableT(const G4ParticleDefinition *aParticle, G4double p, G4double Z, G4double A)
static G4NistManager * Instance()
G4double SampleThetaLab(const G4HadProjectile *aParticle, G4double tmass, G4double A)
G4double GetCoulombElasticXsc(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double Z)
G4double AdaptiveGauss(T &typeT, F f, G4double a, G4double b, G4double e)
G4double GetTotalMomentum() const
const G4ParticleDefinition * thePionPlus
G4double CalculateAm(G4double momentum, G4double n, G4double Z)
const G4ParticleDefinition * thePionMinus
void SetMinEnergy(G4double anEnergy)
G4IonTable * GetIonTable() const
G4GLOB_DLL std::ostream G4cout
static size_t GetNumberOfElements()
const G4ParticleDefinition * GetDefinition() const
virtual ~G4DiffuseElastic()
G4double GetDiffElasticProb(G4double theta)
std::vector< G4PhysicsTable * > fAngleBank
static G4Triton * Triton()
static G4Proton * Proton()
static G4PionPlus * PionPlus()
G4double GetDiffuseElasticXsc(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double A)
G4double lowestEnergyLimit
void TestAngleTable(const G4ParticleDefinition *theParticle, G4double partMom, G4double Z, G4double A)
static G4Neutron * Neutron()
static const G4double A[nN]
const G4LorentzVector & Get4Momentum() const
static G4Deuteron * Deuteron()
G4LorentzVector Get4Momentum() const
G4ParticleDefinition * theAlpha
G4double DampFactor(G4double z)
G4PhysicsLogVector * fEnergyVector
G4double GetPDGMass() const
static G4ParticleTable * GetParticleTable()
G4double lowEnergyRecoilLimit
static G4PionMinus * PionMinus()
G4double GetInvElasticSumXsc(const G4ParticleDefinition *particle, G4double tMand, G4double momentum, G4double A, G4double Z)
G4double GetDiffElasticSumProbA(G4double alpha)
G4double GetAtomicMassAmu(const G4String &symb) const
static const double degree
void insertAt(size_t, G4PhysicsVector *)
void SetMaxEnergy(const G4double anEnergy)
G4double GetDiffuseElasticSumXsc(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double A, G4double Z)
G4double CalculateParticleBeta(const G4ParticleDefinition *particle, G4double momentum)
G4ParticleDefinition * theDeuteron
G4double BesselOneByArg(G4double z)
G4double ThetaLabToThetaCMS(const G4DynamicParticle *aParticle, G4double tmass, G4double thetaLab)
const G4ParticleDefinition * fParticle
G4double SampleTableThetaCMS(const G4ParticleDefinition *aParticle, G4double p, G4double Z, G4double A)
virtual G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
std::vector< G4Element * > G4ElementTable
static G4ElementTable * GetElementTable()
G4double GetPDGCharge() const
static const G4double alpha
std::vector< G4double > fElementNumberVector
G4double GetInvCoulombElasticXsc(const G4ParticleDefinition *particle, G4double tMand, G4double momentum, G4double A, G4double Z)
G4PhysicsTable * fAngleTable
static const double fermi
G4double GetIntegrandFunction(G4double theta)
G4double GetTotalMomentum() const
CLHEP::HepLorentzVector G4LorentzVector
G4ParticleDefinition * theNeutron