119 for ( std::vector<G4PhysicsTable*>::iterator it =
fAngleBank.begin();
122 if ( (*it) ) (*it)->clearAndDestroy();
143 for( jEl = 0; jEl < numOfEl; ++jEl)
151 G4cout<<
"G4DiffuseElastic::Initialise() the element: "
152 <<(*theElementTable)[jEl]->GetName()<<
G4endl;
201 if (iZ == 1 && iA == 1) theDef =
theProton;
204 else if (iZ == 2 && iA == 3) theDef =
G4He3::He3();
205 else if (iZ == 2 && iA == 4) theDef =
theAlpha;
219 G4double cost = 1 - 0.5*std::fabs(tMand)/ptot2;
221 if( cost >= 1.0 ) cost = 1.0;
222 else if( cost <= -1.0) cost = -1.0;
224 G4double thetaCMS = std::acos(cost);
256 if( z && (kRt > kRtC) )
288 if (iZ == 1 && iA == 1) theDef =
theProton;
291 else if (iZ == 2 && iA == 3) theDef =
G4He3::He3();
292 else if (iZ == 2 && iA == 4) theDef =
theAlpha;
306 G4double cost = 1 - 0.5*std::fabs(tMand)/ptot2;
308 if( cost >= 1.0 ) cost = 1.0;
309 else if( cost <= -1.0) cost = -1.0;
311 G4double thetaCMS = std::acos(cost);
338 if (iZ == 1 && iA == 1) theDef =
theProton;
341 else if (iZ == 2 && iA == 3) theDef =
G4He3::He3();
342 else if (iZ == 2 && iA == 4) theDef =
theAlpha;
356 G4double cost = 1 - 0.5*std::fabs(tMand)/ptot2;
358 if( cost >= 1.0 ) cost = 1.0;
359 else if( cost <= -1.0) cost = -1.0;
361 G4double thetaCMS = std::acos(cost);
381 G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2;
391 diffuse = 0.63*
fermi;
399 diffuse = 0.63*
fermi;
410 diffuse = 0.63*
fermi;
421 bzero2 = bzero*bzero;
425 bonebyarg2 = bonebyarg*bonebyarg;
450 sigma += mode2k2*bone2 + e2dk3t*bzero*bone;
451 sigma += kr2*bonebyarg2;
469 G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2;
482 bzero2 = bzero*bzero;
486 bonebyarg2 = bonebyarg*bonebyarg;
490 diffuse = 0.63*
fermi;
499 diffuse = 0.63*
fermi;
510 diffuse = 0.63*
fermi;
524 G4double sinHalfTheta = std::sin(0.5*theta);
525 G4double sinHalfTheta2 = sinHalfTheta*sinHalfTheta;
551 sigma += mode2k2*bone2;
552 sigma += e2dk3t*bzero*bone;
555 sigma += kr2*bonebyarg2;
573 theta = std::sqrt(alpha);
577 G4double sigma, bzero, bzero2, bonebyarg, bonebyarg2, damp, damp2;
590 bzero2 = bzero*bzero;
594 bonebyarg2 = bonebyarg*bonebyarg;
598 diffuse = 0.63*
fermi;
607 diffuse = 0.63*
fermi;
618 diffuse = 0.63*
fermi;
633 G4double sinHalfTheta2 = sinHalfTheta*sinHalfTheta;
658 sigma += mode2k2*bone2;
659 sigma += e2dk3t*bzero*bone;
662 sigma += kr2*bonebyarg2;
719 G4double t = 2*p*p*( 1 - std::cos(theta) );
733 G4double norm, result, theta1, theta2, thetaMax, sum = 0.;
743 if (thetaMax >
pi) thetaMax =
pi;
752 for(i = 1; i <= iMax; i++)
754 theta1 = (i-1)*thetaMax/iMax;
755 theta2 = i*thetaMax/iMax;
760 result = 0.5*(theta1 + theta2);
764 if (i > iMax ) result = 0.5*(theta1 + theta2);
770 if(result < 0.) result = 0.;
771 if(result > thetaMax) result = thetaMax;
787 G4double totElab = std::sqrt(m1*m1+p*p);
802 G4double pCMS2 = momentumCMS*momentumCMS;
803 G4double Tkin = std::sqrt(pCMS2+m1*m1)-m1;
825 G4double Tkin = 12.*std::exp(-elZ/10.) + 1.;
838 G4double t = 2*p*p*( 1 - std::cos(std::sqrt(alpha)) );
853 G4int iMomentum, iAngle;
875 G4double kinE = std::sqrt(momentum*momentum + m1*m1) - m1;
877 for( iMomentum = 0; iMomentum <
fEnergyBin; iMomentum++)
879 if( kinE < fEnergyVector->GetLowEdgeEnergy(iMomentum) )
break;
881 if ( iMomentum >= fEnergyBin ) iMomentum = fEnergyBin-1;
882 if ( iMomentum < 0 ) iMomentum = 0;
886 if (iMomentum == fEnergyBin -1 || iMomentum == 0 )
892 for(iAngle = 0; iAngle <
fAngleBin-1; iAngle++)
894 if( position > (*(*
fAngleTable)(iMomentum))(iAngle) )
break;
896 if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2;
911 for(iAngle = 0; iAngle <
fAngleBin-1; iAngle++)
914 if( position > (*(*
fAngleTable)(iMomentum))(iAngle) )
break;
916 if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2;
933 for(iAngle = 0; iAngle < fAngleBin-1; iAngle++)
936 if( position > (*(*
fAngleTable)(iMomentum))(iAngle) )
break;
938 if (iAngle >= fAngleBin-1) iAngle = fAngleBin-2;
952 randAngle = W1*theta1 + W2*theta2;
960 if(randAngle < 0.) randAngle = 0.;
978 G4cout<<
"G4DiffuseElastic::InitialiseOnFly() the element with Z = "
979 <<Z<<
"; and A = "<<A<<
G4endl;
999 G4double alpha1, alpha2, alphaMax, alphaCoulomb, delta = 0., sum = 0.;
1008 partMom = std::sqrt( kinE*(kinE + 2*m1) );
1019 alphaMax = kRmax*kRmax/kR2;
1031 alphaCoulomb = kRcoul*kRcoul/kR2;
1036 fBeta = a/std::sqrt(1+a*a);
1060 alpha1 = delth*(j-1);
1062 alpha2 = alpha1 + delth;
1065 if( ( alpha1 < alphaCoulomb ) &&
z )
fAddCoulomb =
false;
1072 angleVector->
PutValue( j-1 , alpha1, sum );
1090 G4double x1, x2, y1, y2, randAngle;
1094 randAngle = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle);
1101 iAngle = (*fAngleTable)(iMomentum)->GetVectorLength() - 1;
1103 y1 = (*(*fAngleTable)(iMomentum))(iAngle-1);
1104 y2 = (*(*fAngleTable)(iMomentum))(iAngle);
1106 x1 = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle-1);
1107 x2 = (*fAngleTable)(iMomentum)->GetLowEdgeEnergy(iAngle);
1109 if ( x1 == x2 ) randAngle = x2;
1112 if ( y1 == y2 ) randAngle = x1 + ( x2 - x1 )*
G4UniformRand();
1115 randAngle = x1 + ( position - y1 )*( x2 - x1 )/( y2 - y1 );
1154 t =
SampleT( theParticle, ptot, A);
1157 if(!(t < 0.0 || t >= 0.0))
1161 G4cout <<
"G4DiffuseElastic:WARNING: A = " << A
1162 <<
" mom(GeV)= " << plab/
GeV
1163 <<
" S-wave will be sampled"
1170 G4cout <<
" t= " << t <<
" tmax= " << tmax
1171 <<
" ptot= " << ptot <<
G4endl;
1184 else if( cost <= -1.0)
1191 sint = std::sqrt((1.0-cost)*(1.0+cost));
1195 G4cout <<
"cos(t)=" << cost <<
" std::sin(t)=" << sint <<
G4endl;
1197 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
1199 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),std::sqrt(ptot*ptot + m1*m1));
1238 G4double cost = std::cos(thetaCMS);
1246 else if( cost <= -1.0)
1253 sint = std::sqrt((1.0-cost)*(1.0+cost));
1257 G4cout <<
"cos(tcms)=" << cost <<
" std::sin(tcms)=" << sint <<
G4endl;
1259 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
1261 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),std::sqrt(ptot*ptot + m1*m1));
1298 G4double cost = std::cos(thetaLab);
1306 else if( cost <= -1.0)
1313 sint = std::sqrt((1.0-cost)*(1.0+cost));
1317 G4cout <<
"cos(tlab)=" << cost <<
" std::sin(tlab)=" << sint <<
G4endl;
1319 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
1321 G4LorentzVector nlv1(v1.x(),v1.y(),v1.z(),std::sqrt(plab*plab + m1*m1));
1347 G4cout<<
"G4DiffuseElastic::TestAngleTable() init the element with Z = "
1348 <<Z<<
"; and A = "<<A<<
G4endl;
1357 G4double alpha1=0., alpha2=0., alphaMax=0., alphaCoulomb=0.;
1358 G4double deltaL10 = 0., deltaL96 = 0., deltaAG = 0.;
1359 G4double sumL10 = 0.,sumL96 = 0.,sumAG = 0.;
1373 alphaMax = kRmax*kRmax/kR2;
1375 if (alphaMax > 4.) alphaMax = 4.;
1377 alphaCoulomb = kRcoul*kRcoul/kR2;
1382 fBeta = a/std::sqrt(1+a*a);
1398 alpha1 = alphaMax*(j-1)/fAngleBin;
1399 alpha2 = alphaMax*( j )/fAngleBin;
1401 if( ( alpha2 > alphaCoulomb ) &&
z )
fAddCoulomb =
true;
1406 alpha1, alpha2,epsilon);
1416 <<sumL10<<
"\t"<<sumL96<<
"\t"<<sumAG<<
G4endl;
1418 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