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) );
342 std::size_t iElement;
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 =
G4int(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);
438 G4double alpha1,
alpha2, alphaMax, alphaCoulomb, delta = 0., sum = 0.;
442 fEnergyAngleVector =
new std::vector<std::vector<G4double>*>;
443 fEnergySumVector =
new std::vector<std::vector<G4double>*>;
445 for(
G4int i = 0; i < fEnergyBin; ++i)
447 kinE = fEnergyVector->
Energy(i);
448 partMom = std::sqrt( kinE*(kinE + 2*m1) );
450 fWaveVector = partMom/hbarc;
452 G4double kR = fWaveVector*fNuclearRadius;
458 if ( alphaMax >= CLHEP::pi ) alphaMax = CLHEP::pi;
460 alphaCoulomb = kRcoul/kR;
465 fBeta = a/std::sqrt(1+a*a);
467 fAm =
CalculateAm( partMom, fZommerfeld, fAtomicNumber);
471 std::vector<G4double>* angleVector =
new std::vector<G4double>(fAngleBin);
472 std::vector<G4double>* sumVector =
new std::vector<G4double>(fAngleBin);
475 G4double delth = alphaMax/fAngleBin;
479 for(
G4int j = (
G4int)fAngleBin-1; j >= 0; --j)
484 if( fAddCoulomb && (
alpha2 < alphaCoulomb)) fAddCoulomb =
false;
490 (*angleVector)[j] = alpha1;
491 (*sumVector)[j] = sum;
494 fEnergyAngleVector->push_back(angleVector);
495 fEnergySumVector->push_back(sumVector);
508 G4double x1, x2, y1, y2, randAngle = 0;
512 randAngle = (*(*fEnergyAngleVector)[iMomentum])[iAngle];
516 if ( iAngle >= (*fEnergyAngleVector)[iMomentum]->size() )
518 iAngle = (*fEnergyAngleVector)[iMomentum]->size() - 1;
521 y1 = (*(*fEnergySumVector)[iMomentum])[iAngle-1];
522 y2 = (*(*fEnergySumVector)[iMomentum])[iAngle];
524 x1 = (*(*fEnergyAngleVector)[iMomentum])[iAngle-1];
525 x2 = (*(*fEnergyAngleVector)[iMomentum])[iAngle];
527 if ( x1 == x2 ) randAngle = x2;
530 if ( y1 == y2 ) randAngle = x1 + ( x2 - x1 )*
G4UniformRand();
533 randAngle = x1 + (
position - y1 )*( x2 - x1 )/( y2 - y1 );
577 else if( cost <= -1.0)
584 sint = std::sqrt((1.0-cost)*(1.0+cost));
588 G4cout <<
"cos(tcms)=" << cost <<
" std::sin(tcms)=" << sint <<
G4endl;
590 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
631 else if( cost <= -1.0)
638 sint = std::sqrt((1.0-cost)*(1.0+cost));
642 G4cout <<
"cos(tlab)=" << cost <<
" std::sin(tlab)=" << sint <<
G4endl;
644 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
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(const std::size_t index) const
std::size_t FindBin(const G4double energy, std::size_t idx) const
static G4Proton * Proton()