85 fParticleChange =
nullptr;
87 if(p) { SetParticle(p); }
88 else { SetParticle(fElectron); }
92 fLowestTcut = 12.5*CLHEP::eV;
99 if(
IsMaster()) {
delete fModelData; }
116 fMaterialCutsCoupleVector.clear();
128 std::size_t numRegions = fPAIRegionVector.size();
131 if(0 == numRegions) {
133 "no G4Regions are registered for the PAI model - World is used");
135 ->GetRegion(
"DefaultRegionForTheWorld",
false));
140 G4cout <<
"G4PAIModel is defined for " << numRegions <<
" regions "
141 <<
"; number of materials " << numOfMat <<
G4endl;
143 for(std::size_t iReg = 0; iReg<numRegions; ++iReg) {
144 const G4Region* curReg = fPAIRegionVector[iReg];
147 for(std::size_t jMat = 0; jMat<numOfMat; ++jMat) {
150 std::size_t n = fMaterialCutsCoupleVector.size();
158 if(
nullptr != cutCouple) {
161 << mat->
GetName() <<
"> CoupleIndex= "
164 <<
" cutsize= " << cuts.size() <<
G4endl;
169 for(std::size_t i=0; i<n; ++i) {
171 if(cutCouple == fMaterialCutsCoupleVector[i]) {
180 fMaterialCutsCoupleVector.push_back(cutCouple);
197 fMaterialCutsCoupleVector =
223 if(0 > coupleIndex) {
return 0.0; }
227 G4double scaledTkin = kineticEnergy*fRatio;
229 return fChargeSquare*fModelData->
DEDXPerVolume(coupleIndex, scaledTkin,
247 if(0 > coupleIndex) {
return 0.0; }
250 if(tmax <= cutEnergy) {
return 0.0; }
252 G4double scaledTkin = kineticEnergy*fRatio;
271 G4int coupleIndex = FindCoupleIndex(matCC);
274 if(0 > coupleIndex) {
return; }
280 if(maxEnergy < tmax) { tmax = maxEnergy; }
281 if(tmin >= tmax) {
return; }
284 G4double scaledTkin = kineticEnergy*fRatio;
285 G4double totalEnergy = kineticEnergy + fMass;
286 G4double totalMomentum = sqrt(kineticEnergy*(totalEnergy+fMass));
294 if( !(deltaTkin <= 0.) && !(deltaTkin > 0)) {
295 G4cout<<
"G4PAIModel::SampleSecondaries; deltaKIn = "<<deltaTkin/keV
296 <<
" keV "<<
" Escaled(MeV)= " << scaledTkin <<
G4endl;
299 if( deltaTkin <= 0.) {
return; }
301 if( deltaTkin > tmax) { deltaTkin = tmax; }
314 kineticEnergy -= deltaTkin;
315 G4ThreeVector dir = totalMomentum*direction - deltaRay->GetMomentum();
316 direction = dir.
unit();
320 vdp->push_back(deltaRay);
332 G4int coupleIndex = FindCoupleIndex(matCC);
333 if(0 > coupleIndex) {
return eloss; }
372 G4double etot = kineticEnergy + particleMass;
373 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
374 G4double siga = (tmax/beta2 - 0.5*tcut) * twopi_mc2_rcl2 * step
375 * electronDensity * q * q;
387 if(p == fElectron) { tmax *= 0.5; }
388 else if(p != fPositron) {
389 G4double ratio= electron_mass_c2/fMass;
390 G4double gamma= kinEnergy/fMass + 1.0;
391 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
392 (1. + 2.0*gamma*ratio + ratio*ratio);
401 fPAIRegionVector.push_back(r);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::vector< G4Material * > G4MaterialTable
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
G4double GetCharge() const
G4double GetLogKineticEnergy() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
const G4Material * GetMaterial() const
static size_t GetNumberOfMaterials()
G4double GetElectronDensity() const
static G4MaterialTable * GetMaterialTable()
const G4String & GetName() const
G4double DEDXPerVolume(G4int coupleIndex, G4double scaledTkin, G4double cut) const
void Initialise(const G4MaterialCutsCouple *, G4PAIModel *)
G4double SamplePostStepTransfer(G4int coupleIndex, G4double scaledTkin, G4double tmin, G4double tmax) const
G4double SampleAlongStepTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double tmax, G4double stepFactor) const
G4double CrossSectionPerVolume(G4int coupleIndex, G4double scaledTkin, G4double tcut, G4double tmax) const
void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) final
G4PAIModelData * GetPAIModelData()
const std::vector< const G4MaterialCutsCouple * > & GetVectorOfCouples()
G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) final
void DefineForRegion(const G4Region *r) final
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) final
G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double, const G4double, const G4double, const G4double) final
void Initialise(const G4ParticleDefinition *, const G4DataVector &) final
G4double Dispersion(const G4Material *, const G4DynamicParticle *, const G4double, const G4double, const G4double) final
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) final
G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy) final
G4double MinEnergyCut(const G4ParticleDefinition *, const G4MaterialCutsCouple *couple) final
G4PAIModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="PAI")
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
const G4String & GetParticleName() const
static G4Positron * Positron()
static G4RegionStore * GetInstance()
G4MaterialCutsCouple * FindCouple(G4Material *mat)
const G4String & GetName() const
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
G4VEmAngularDistribution * GetAngularDistribution()
G4double LowEnergyLimit() const
std::vector< G4EmElementSelector * > * GetElementSelectors()
G4double HighEnergyLimit() const
void SetAngularDistribution(G4VEmAngularDistribution *)
const G4MaterialCutsCouple * CurrentCouple() const
const G4Element * SelectTargetAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double logKineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
G4ParticleChangeForLoss * GetParticleChangeForLoss()