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 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 "
142 G4cout <<
" total number of materials " << numOfMat <<
G4endl;
144 for(
size_t iReg = 0; iReg<numRegions; ++iReg) {
145 const G4Region* curReg = fPAIRegionVector[iReg];
148 for(
size_t jMat = 0; jMat<numOfMat; ++jMat) {
151 size_t n = fMaterialCutsCoupleVector.size();
162 << mat->
GetName() <<
"> CoupleIndex= "
165 <<
" cutsize= " << cuts.size() <<
G4endl;
170 for(
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;
316 direction = dir.
unit();
320 vdp->push_back(deltaRay);
330 G4int coupleIndex = FindCoupleIndex(matCC);
331 if(0 > coupleIndex) {
return eloss; }
369 G4double etot = kineticEnergy + particleMass;
370 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
371 G4double siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * step
372 * electronDensity * q * q;
384 if(p == fElectron) { tmax *= 0.5; }
385 else if(p != fPositron) {
386 G4double ratio= electron_mass_c2/fMass;
387 G4double gamma= kinEnergy/fMass + 1.0;
388 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
389 (1. + 2.0*gamma*ratio + ratio*ratio);
398 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
G4ThreeVector GetMomentum() 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
G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double, G4double) final
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
void Initialise(const G4ParticleDefinition *, const G4DataVector &) 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")
G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double, G4double, G4double) final
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()