60 const G4int nPerDecade = 10;
73 else if(tmax > highestTkin)
99 for(
size_t i=0; i<
n; ++i)
134 for (jMatCC = 0; jMatCC < numOfCouples; jMatCC++ )
138 if( jMatCC == numOfCouples && jMatCC > 0 ) jMatCC--;
142 G4double deltaCutInKineticEnergyNow = (*deltaCutInKineticEnergy)[jMatCC];
143 G4double photonCutInKineticEnergyNow = (*photonCutInKineticEnergy)[jMatCC];
145 G4cout<<
"G4PAIPhotData::Initialise: "<<
"cut = "<<cut/
keV<<
" keV; cutEl = "
146 <<deltaCutInKineticEnergyNow/
keV<<
" keV; cutPh = "
147 <<photonCutInKineticEnergyNow/
keV<<
" keV"<<
G4endl;
195 if ( Tmax < Tmin + deltaLow ) Tmax = Tmin + deltaLow;
210 for(
G4int k = 0; k <
n; k++ )
227 if(ionloss < 0.0) ionloss = 0.0;
229 dEdxMeanVector->
PutValue(i,ionloss);
231 G4double dNdxCut = transferVector->
Value(deltaCutInKineticEnergyNow)/deltaCutInKineticEnergyNow;
232 G4double dNdxCutPhoton = photonVector->
Value(photonCutInKineticEnergyNow)/photonCutInKineticEnergyNow;
233 G4double dNdxCutPlasmon = plasmonVector->
Value(deltaCutInKineticEnergyNow)/deltaCutInKineticEnergyNow;
238 if(dNdxCut < 0.0) { dNdxCut = 0.0; }
239 if(dNdxCutPhoton < 0.0) { dNdxCutPhoton = 0.0; }
240 if(dNdxCutPlasmon < 0.0) { dNdxCutPlasmon = 0.0; }
242 dNdxCutVector->
PutValue(i, dNdxCut);
243 dNdxCutPhotonVector->
PutValue(i, dNdxCutPhoton);
244 dNdxCutPlasmonVector->
PutValue(i, dNdxCutPlasmon);
246 dEdxCutVector->
PutValue(i, dEdxCut);
248 PAItransferTable->
insertAt(i,transferVector);
249 PAIphotonTable->
insertAt(i,photonVector);
250 PAIplasmonTable->
insertAt(i,plasmonVector);
251 PAIdEdxTable->
insertAt(i,dEdxVector);
300 if( dEdx < 0.) { dEdx = 0.; }
311 G4double cross, xscEl, xscEl2, xscPh, xscPh2;
332 cross = xscPh + xscEl;
354 W1 = (E2 - scaledTkin)*W;
355 W2 = (scaledTkin - E1)*W;
360 cross = xscEl + xscPh;
362 if( cross < 0.0) cross = 0.0;
372 G4double cross, xscEl, xscEl2, xscPh, xscPh2, plRatio;
390 cross = xscPh + xscEl;
412 W1 = (E2 - scaledTkin)*W;
413 W2 = (scaledTkin - E1)*W;
418 cross = xscEl + xscPh;
426 plRatio = xscEl/cross;
428 if( plRatio > 1. || plRatio < 0.) plRatio = 2.0;
456 dNdxCut1 = (*vcut)[iPlace];
460 G4double meanN1 = ((*v1)[0]/
e1 - dNdxCut1)*stepFactor;
473 dNdxCut2 = (*vcut)[iPlace+1];
476 G4double meanN2 = ((*v2)[0]/
e2 - dNdxCut2)*stepFactor;
481 W1 = (E2 - scaledTkin)*W;
482 W2 = (scaledTkin - E1)*W;
483 meanNumber = W1*meanN1 + W2*meanN2;
488 if( meanNumber <= 0.0)
return 0.0;
494 if( 0 == numOfCollisions)
return 0.0;
496 for(
G4int i=0; i< numOfCollisions; ++i)
499 position = dNdxCut1 + ((*v1)[0]/
e1 - dNdxCut1)*rand;
506 position = dNdxCut2 + ((*v2)[0]/
e2 - dNdxCut2)*rand;
508 omega = omega*W1 + omega2*W2;
513 if( loss > kinEnergy) {
break; }
519 if ( loss > kinEnergy) loss = kinEnergy;
520 else if( loss < 0.) loss = 0.;
548 dNdxCut1 = (*vcut)[iPlace];
552 G4double meanN1 = ((*v1)[0]/
e1 - dNdxCut1)*stepFactor;
565 dNdxCut2 = (*vcut)[iPlace+1];
568 G4double meanN2 = ((*v2)[0]/
e2 - dNdxCut2)*stepFactor;
573 W1 = (E2 - scaledTkin)*W;
574 W2 = (scaledTkin - E1)*W;
575 meanNumber = W1*meanN1 + W2*meanN2;
580 if( meanNumber <= 0.0)
return 0.0;
586 if( 0 == numOfCollisions)
return 0.0;
588 for(
G4int i=0; i< numOfCollisions; ++i)
591 position = dNdxCut1 + ((*v1)[0]/
e1 - dNdxCut1)*rand;
598 position = dNdxCut2 + ((*v2)[0]/
e2 - dNdxCut2)*rand;
600 omega = omega*W1 + omega2*W2;
605 if( loss > kinEnergy) {
break; }
611 if ( loss > kinEnergy) loss = kinEnergy;
612 else if( loss < 0.) loss = 0.;
640 dNdxCut1 = (*vcut)[iPlace];
644 G4double meanN1 = ((*v1)[0]/
e1 - dNdxCut1)*stepFactor;
657 dNdxCut2 = (*vcut)[iPlace+1];
660 G4double meanN2 = ((*v2)[0]/
e2 - dNdxCut2)*stepFactor;
665 W1 = (E2 - scaledTkin)*W;
666 W2 = (scaledTkin - E1)*W;
667 meanNumber = W1*meanN1 + W2*meanN2;
672 if( meanNumber <= 0.0)
return 0.0;
678 if( 0 == numOfCollisions)
return 0.0;
680 for(
G4int i=0; i< numOfCollisions; ++i)
683 position = dNdxCut1 + ((*v1)[0]/
e1 - dNdxCut1)*rand;
690 position = dNdxCut2 + ((*v2)[0]/
e2 - dNdxCut2)*rand;
692 omega = omega*W1 + omega2*W2;
697 if( loss > kinEnergy) {
break; }
703 if ( loss > kinEnergy) loss = kinEnergy;
704 else if( loss < 0.) loss = 0.;
734 else if( scaledTkin <= fParticleEnergyVector->Energy(0) )
743 dNdxCut1 = (*cutv)[iPlace];
744 dNdxCut2 = (*cutv)[iPlace+1];
749 W1 = (E2 - scaledTkin)*W;
750 W2 = (scaledTkin - E1)*W;
761 transfer = tr1*W1 + tr2*W2;
764 if(transfer < 0.0 ) { transfer = 0.0; }
791 else if( scaledTkin <= fParticleEnergyVector->Energy(0) )
800 dNdxCut1 = (*cutv)[iPlace];
801 dNdxCut2 = (*cutv)[iPlace+1];
806 W1 = (E2 - scaledTkin)*W;
807 W2 = (scaledTkin - E1)*W;
819 transfer = tr1*W1 + tr2*W2;
822 if(transfer < 0.0 ) { transfer = 0.0; }
848 else if( scaledTkin <= fParticleEnergyVector->Energy(0) )
857 dNdxCut1 = (*cutv)[iPlace];
858 dNdxCut2 = (*cutv)[iPlace+1];
863 W1 = (E2 - scaledTkin)*W;
864 W2 = (scaledTkin - E1)*W;
875 transfer = tr1*W1 + tr2*W2;
879 if(transfer < 0.0 ) transfer = 0.0;
899 G4double x1(0.0), x2(0.0), y1(0.0), y2(0.0), energyTransfer;
901 for(iTransfer=1; iTransfer<=iTransferMax; ++iTransfer) {
902 x2 = v->
Energy(iTransfer);
903 y2 = (*v)[iTransfer]/x2;
907 x1 = v->
Energy(iTransfer-1);
908 y1 = (*v)[iTransfer-1]/x1;
918 const G4int nbins = 5;
921 for(
G4int i=1; i<=nbins; ++i) {
923 y2 = v->
Value(x2)/x2;
929 energyTransfer = (y2 - y1)*x1*x2/(
position*(x1 - x2) - y1*x1 + y2*x2);
935 return energyTransfer;
950 G4double x1(0.0), x2(0.0), y1(0.0), y2(0.0), energyTransfer;
952 for(iTransfer=1; iTransfer<=iTransferMax; ++iTransfer)
954 x2 = v->
Energy(iTransfer);
955 y2 = (*v)[iTransfer]/x2;
958 x1 = v->
Energy(iTransfer-1);
959 y1 = (*v)[iTransfer-1]/x1;
976 const G4int nbins = 5;
980 for(
G4int i=1; i<=nbins; ++i)
983 y2 = v->
Value(x2)/x2;
989 energyTransfer = (y2 - y1)*x1*x2/(
position*(x1 - x2) - y1*x1 + y2*x2);
996 return energyTransfer;
1012 G4double x1(0.0), x2(0.0), y1(0.0), y2(0.0), energyTransfer;
1014 for(iTransfer = 1; iTransfer <= iTransferMax; ++iTransfer)
1016 x2 = v->
Energy(iTransfer);
1017 y2 = (*v)[iTransfer]/x2;
1020 x1 = v->
Energy(iTransfer-1);
1021 y1 = (*v)[iTransfer-1]/x1;
1026 energyTransfer = x1;
1038 const G4int nbins = 5;
1042 for(
G4int i = 1; i <= nbins; ++i )
1045 y2 = v->
Value(x2)/x2;
1053 energyTransfer = (y2 - y1)*x1*x2/(
position*(x1 - x2) - y1*x1 + y2*x2);
1060 return energyTransfer;
static const G4double e1[44]
static const G4double e2[44]
G4long G4Poisson(G4double mean)
static constexpr double keV
static constexpr double eV
static constexpr double GeV
static constexpr double MeV
static constexpr double TeV
G4GLOB_DLL std::ostream G4cout
const G4Material * GetMaterial() const
G4double CrossSectionPerVolume(G4int coupleIndex, G4double scaledTkin, G4double tcut, G4double tmax) const
G4double SamplePostStepPlasmonTransfer(G4int coupleIndex, G4double scaledTkin) const
G4PhysicsLogVector * fParticleEnergyVector
G4double SampleAlongStepPlasmonTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double stepFactor) const
std::vector< G4PhysicsLogVector * > fdNdxCutPlasmonTable
std::vector< G4PhysicsLogVector * > fdNdxCutTable
std::vector< G4PhysicsLogVector * > fdNdxCutPhotonTable
std::vector< G4PhysicsTable * > fPAIxscBank
G4double DEDXPerVolume(G4int coupleIndex, G4double scaledTkin, G4double cut) const
G4double GetPlasmonRatio(G4int coupleIndex, G4double scaledTkin) const
std::vector< G4PhysicsLogVector * > fdEdxCutTable
std::vector< G4PhysicsLogVector * > fdEdxTable
G4double SamplePostStepTransfer(G4int coupleIndex, G4double scaledTkin) const
G4double fHighestKineticEnergy
G4double SampleAlongStepTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double stepFactor) const
G4double SamplePostStepPhotonTransfer(G4int coupleIndex, G4double scaledTkin) const
G4double GetEnergyPlasmonTransfer(G4int coupleIndex, size_t iPlace, G4double position) const
G4double fLowestKineticEnergy
G4double GetEnergyTransfer(G4int coupleIndex, size_t iPlace, G4double position) const
std::vector< G4PhysicsTable * > fPAIphotonBank
G4PAIxSection fPAIxSection
std::vector< G4PhysicsTable * > fPAIdEdxBank
std::vector< G4PhysicsTable * > fPAIplasmonBank
G4PAIPhotData(G4double tmin, G4double tmax, G4int verbose)
void Initialise(const G4MaterialCutsCouple *, G4double cut, G4PAIPhotModel *)
G4double SampleAlongStepPhotonTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double stepFactor) const
G4double GetEnergyPhotonTransfer(G4int coupleIndex, size_t iPlace, G4double position) const
G4double ComputeMaxEnergy(G4double scaledEnergy)
G4double GetIntegralCerenkov(G4int i) const
G4int GetSplineSize() const
G4double GetIntegralPAIdEdx(G4int i) const
G4double GetIntegralPlasmon(G4int i) const
G4double GetSplineEnergy(G4int i) const
G4double GetIntegralPAIxSection(G4int i) const
G4double GetMeanEnergyLoss() 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
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
const std::vector< G4double > * GetEnergyCutsVector(std::size_t pcIdx) const
static G4ProductionCutsTable * GetProductionCutsTable()
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