59 const G4int nPerDecade = 10;
69 }
else if(tmax > highestTkin) {
80 <<
" Tlowest(keV)= " << lowestTkin/
keV
93 for(
size_t i=0; i<
n; ++i) {
135 if (Tmax < Tmin + deltaLow ) { Tmax = Tmin + deltaLow; }
144 for(
G4int k = 0; k <
n; ++k) {
158 for(
G4int k = kmin; k <
n; ++k)
166 transferVector->
PutValue(k, t, t*tr);
176 if(ionloss < 0.0) ionloss = 0.0;
178 dEdxMeanVector->
PutValue(i,ionloss);
180 PAItransferTable->
insertAt(i,transferVector);
181 PAIdEdxTable->
insertAt(i,dEdxVector);
254 cross1 = (*table)(iPlace)->Value(tmax)/tmax;
256 cross2 = (*table)(iPlace)->Value(tcut)/tcut;
258 cross = (cross2-cross1);
261 cross2 = (*table)(iPlace+1)->Value(tcut)/tcut
262 - (*table)(iPlace+1)->Value(tmax)/tmax;
310 meanN11 = (*v1)[0]/
e1;
312 meanNumber = (meanN11 - meanN12)*stepFactor;
325 meanN21 = (*v2)[0]/
e1;
330 W1 = (E2 - scaledTkin)*W;
331 W2 = (scaledTkin - E1)*W;
333 meanNumber += (meanN21 - meanN22)*stepFactor*W2;
337 if(meanNumber < 0.0) {
return loss; }
342 if(0 == numOfCollisions) {
return loss; }
345 for(
G4int i=0; i< numOfCollisions; ++i) {
347 position = meanN12 + (meanN11 - meanN12)*rand;
351 position = meanN22 + (meanN21 - meanN22)*rand;
359 if(loss > kinEnergy) {
break; }
363 if(loss > kinEnergy) { loss = kinEnergy; }
364 else if(loss < 0.) { loss = 0.; }
396 if(
emax < emin) {
return transfer; }
418 dNdx1 = v2->
Value(emin)/emin;
433 position = dNdx2 + (dNdx1 - dNdx2)*rand;
463 G4double x1(0.0), x2(0.0), y1(0.0), y2(0.0), energyTransfer;
466 for(iTransfer=1; iTransfer<=iTransferMax; ++iTransfer) {
467 x2 = v->
Energy(iTransfer);
468 y2 = (*v)[iTransfer]/x2;
470 if(iTransfer == iTransferMax) {
return v->
GetMaxEnergy(); }
473 x1 = v->
Energy(iTransfer-1);
474 y1 = (*v)[iTransfer-1]/x1;
486 const G4int nbins = 5;
489 for(
G4int i=1; i<=nbins; ++i) {
491 y2 = v->
Value(x2)/x2;
501 energyTransfer = (y2 - y1)*x1*x2/(
position*(x1 - x2) - y1*x1 + y2*x2);
507 return energyTransfer;
static const G4double e1[44]
static const G4double e2[44]
static const G4double emax
G4long G4Poisson(G4double mean)
static constexpr double keV
static constexpr double eV
static constexpr double GeV
static constexpr double TeV
G4GLOB_DLL std::ostream G4cout
const G4Material * GetMaterial() const
G4double DEDXPerVolume(G4int coupleIndex, G4double scaledTkin, G4double cut) const
G4double fLowestKineticEnergy
std::vector< G4PhysicsTable * > fPAIxscBank
void Initialise(const G4MaterialCutsCouple *, G4PAIModel *)
std::vector< G4PhysicsTable * > fPAIdEdxBank
G4double SamplePostStepTransfer(G4int coupleIndex, G4double scaledTkin, G4double tmin, G4double tmax) const
G4double fHighestKineticEnergy
std::vector< G4PhysicsLogVector * > fdEdxTable
G4double GetEnergyTransfer(G4int coupleIndex, size_t iPlace, G4double position) const
G4PAIySection fPAIySection
G4PhysicsLogVector * fParticleEnergyVector
G4PAIModelData(G4double tmin, G4double tmax, G4int verbose)
G4double SampleAlongStepTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double tmax, G4double stepFactor) const
G4double CrossSectionPerVolume(G4int coupleIndex, G4double scaledTkin, G4double tcut, G4double tmax) const
G4double ComputeMaxEnergy(G4double scaledEnergy)
G4double GetSplineEnergy(G4int i) const
G4double GetIntegralPAIdEdx(G4int i) const
G4double GetMeanEnergyLoss() const
G4double GetIntegralPAIySection(G4int i) const
G4int GetSplineSize() const
void Initialize(const G4Material *material, G4double maxEnergyTransfer, G4double betaGammaSq, G4SandiaTable *)
void PutValue(const std::size_t index, const G4double e, const G4double value)
void insertAt(std::size_t, G4PhysicsVector *)
void PutValue(const std::size_t index, const G4double value)
G4double GetMaxEnergy() const
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
std::size_t FindBin(const G4double energy, std::size_t idx) const
void Initialize(const G4Material *)
G4double GetSandiaMatTablePAI(G4int, G4int) const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments