77 currentCouple(nullptr),
80 fSecondMoments(nullptr),
83 singleScatteringMode(false),
85 useSecondMoment(false)
133 else if(tet < CLHEP::pi) {
cosThetaMax = cos(tet); }
170 *
G4lrint(std::log10(emax/emin));
173 for(
size_t i=0; i<numOfCouples; ++i) {
180 delete (*fSecondMoments)[i];
187 for(
size_t j=0; j<n; ++j) {
189 bVector->
PutValue(j, ComputeSecondMoment(p, e)*e*e);
192 (*fSecondMoments)[i] = bVector;
233 G4Exception(
"G4WentzelVIModel::ComputeCrossSectionPerAtom",
"em0011",
271 G4double tlimit = currentMinimalStep;
303 G4double presafety = sp->GetSafety();
331 rlimit = std::min(rlimit,
facsafety*presafety);
339 if(rcut > rlimit) { rlimit = std::min(rlimit, rcut*sqrt(rlimit/rcut)); }
341 tlimit = std::min(tlimit, rlimit);
352 tlimit = std::min(tlimit, geomlimit/
facgeom);
438 tPathLength = geomStepLength*(1.0 + 0.5*tau + tau*tau/3.0);
477 }
else if(
xtsec > 0.0) {
483 }
else if(tau < 0.999999) {
544 prob2 = (z2 - z1)/(1.5*z1 - z2);
555 zzz =
G4Exp(-1.0/z0);
559 prob2 /= (1 + prob2);
624 for (; i<nelm; ++i) {
if(
xsecn[i] >= qsec) {
break; } }
649 if(prob2 > 0.0 && rndmEngine->
flat() < prob2) { isFirst =
false; }
652 if(isFirst) { z = -
G4Log(rndmEngine->
flat()); }
653 else { z = G4RandGamma::shoot(rndmEngine, 2.0, 2.0); }
659 if(cost > 1.0) { cost = 1.0; }
660 else if(cost < -1.0) { cost =-1.0; }
661 sint = sqrt((1.0 - cost)*(1.0 + cost));
662 phi = twopi*rndmEngine->
flat();
670 G4double dx = r*(0.5*vx1 + rms*G4RandGauss::shoot(rndmEngine,0.0,1.0));
671 G4double dy = r*(0.5*vy1 + rms*G4RandGauss::shoot(rndmEngine,0.0,1.0));
676 temp.
set(dx,dy,sqrt(d) - r);
682 temp.
set(vx1,vy1,cost);
687 }
while (0 < nMscSteps);
720 const G4double* theAtomNumDensityVector =
738 for (
G4int i=0; i<nelm; ++i) {
741 G4double density = theAtomNumDensityVector[i];
744 if(costm < cosTheta) {
754 if(nucsec > 0.0) { esec /= nucsec; }
755 xtsec += nucsec*density;
782 const G4double* theAtomNumDensityVector =
790 for (
G4int i=0; i<nelm; ++i) {
793 xs += theAtomNumDensityVector[i]
std::vector< G4Element * > G4ElementVector
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
void set(double x, double y, double z)
Hep3Vector & rotateUz(const Hep3Vector &)
G4double GetLogKineticEnergy() const
G4double GetKineticEnergy() const
static G4EmParameters * Instance()
G4int NumberOfBinsPerDecade() const
const G4Material * GetMaterial() const
G4ProductionCuts * GetProductionCuts() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
G4double GetRadlen() const
const G4double * GetVecNbOfAtomsPerVolume() const
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
G4bool GetFlag(std::size_t i) const
G4double Energy(std::size_t index) const
void PutValue(std::size_t index, G4double theValue)
void FillSecondDerivatives()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4double GetProductionCut(G4int index) const
G4StepPoint * GetPreStepPoint() const
const G4ParticleDefinition * GetParticleDefinition() const
const G4DynamicParticle * GetDynamicParticle() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
const G4Step * GetStep() const
G4double PolarAngleLimit() const
G4double LowEnergyLimit() const
void SetCurrentCouple(const G4MaterialCutsCouple *)
G4double HighEnergyLimit() const
G4double HighEnergyActivationLimit() const
const G4MaterialCutsCouple * CurrentCouple() const
G4PhysicsTable * GetCrossSectionTable()
G4double LowEnergyActivationLimit() const
G4double ComputeGeomLimit(const G4Track &, G4double &presafety, G4double limit)
G4double GetTransportMeanFreePath(const G4ParticleDefinition *part, G4double kinEnergy)
G4ParticleChangeForMSC * GetParticleChangeForMSC(const G4ParticleDefinition *p=nullptr)
G4double GetEnergy(const G4ParticleDefinition *part, G4double range, const G4MaterialCutsCouple *couple)
G4double GetRange(const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4MscStepLimitType steppingAlgorithm
G4double ConvertTrueToGeom(G4double &tLength, G4double &gLength)
G4double ComputeSafety(const G4ThreeVector &position, G4double limit=DBL_MAX)
G4ThreeVector fDisplacement
void InitialiseParameters(const G4ParticleDefinition *)
G4double SetupTarget(G4int Z, G4double cut)
G4double ComputeElectronCrossSection(G4double CosThetaMin, G4double CosThetaMax)
G4double ComputeSecondTransportMoment(G4double CosThetaMax)
void Initialise(const G4ParticleDefinition *, G4double CosThetaLim)
G4double ComputeTransportCrossSectionPerAtom(G4double CosThetaMax)
G4double SetupKinematic(G4double kinEnergy, const G4Material *mat)
G4double ComputeNuclearCrossSection(G4double CosThetaMin, G4double CosThetaMax)
G4ThreeVector & SampleSingleScattering(G4double CosThetaMin, G4double CosThetaMax, G4double elecRatio)
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety) override
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double KineticEnergy, G4double AtomicNumber, G4double AtomicWeight=0., G4double cut=DBL_MAX, G4double emax=DBL_MAX) override
G4double ComputeTransportXSectionPerVolume(G4double cosTheta)
const G4MaterialCutsCouple * currentCouple
virtual G4double ComputeTruePathLengthLimit(const G4Track &track, G4double ¤tMinimalStep) override
G4PhysicsTable * GetSecondMomentTable()
std::vector< G4double > prob
G4bool singleScatteringMode
G4double SecondMoment(const G4ParticleDefinition *, const G4MaterialCutsCouple *, G4double kineticEnergy)
G4int currentMaterialIndex
G4WentzelVIModel(G4bool comb=true, const G4String &nam="WentzelVIUni")
void DefineMaterial(const G4MaterialCutsCouple *)
virtual G4double ComputeTrueStepLength(G4double geomStepLength) override
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) override
G4PhysicsTable * fSecondMoments
std::vector< G4double > xsecn
virtual G4double ComputeGeomPathLength(G4double truePathLength) override
G4ParticleChangeForMSC * fParticleChange
virtual ~G4WentzelVIModel()
const G4ParticleDefinition * particle
const G4DataVector * currentCuts
const G4Material * currentMaterial
void SetupParticle(const G4ParticleDefinition *)
virtual void StartTracking(G4Track *) override
void SetSingleScatteringFactor(G4double)
G4WentzelOKandVIxSection * wokvi