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();
151 if(
nullptr != cutCouple) {
154 << mat->
GetName() <<
"> CoupleIndex= "
157 <<
" cutsize= " << cuts.size() <<
G4endl;
162 for(std::size_t i=0; i<n; ++i) {
164 if(cutCouple == fMaterialCutsCoupleVector[i]) {
173 fMaterialCutsCoupleVector.push_back(cutCouple);
189 fMaterialCutsCoupleVector =
210 if(0 > coupleIndex) {
return 0.0; }
213 G4double scaledTkin = kineticEnergy*fRatio;
227 if(0 > coupleIndex) {
return 0.0; }
230 if(tmax <= cutEnergy) {
return 0.0; }
232 G4double scaledTkin = kineticEnergy*fRatio;
234 scaledTkin, cutEnergy, tmax);
249 G4int coupleIndex = FindCoupleIndex(matCC);
252 if(0 > coupleIndex) {
return; }
258 if(maxEnergy < tmax) { tmax = maxEnergy; }
259 if(tmin >= tmax) {
return; }
262 G4double scaledTkin = kineticEnergy*fRatio;
263 G4double totalEnergy = kineticEnergy + fMass;
264 G4double totalMomentum = sqrt(kineticEnergy*(totalEnergy+fMass));
272 if( !(deltaTkin <= 0.) && !(deltaTkin > 0)) {
273 G4cout<<
"G4PAIModel::SampleSecondaries; deltaKIn = "<<deltaTkin/keV
274 <<
" keV "<<
" Escaled(MeV)= " << scaledTkin <<
G4endl;
277 if( deltaTkin <= 0.) {
return; }
279 if( deltaTkin > tmax) { deltaTkin = tmax; }
292 kineticEnergy -= deltaTkin;
293 G4ThreeVector dir = totalMomentum*direction - deltaRay->GetMomentum();
294 direction = dir.
unit();
298 vdp->push_back(deltaRay);
310 G4int coupleIndex = FindCoupleIndex(matCC);
311 if(0 > coupleIndex) {
return eloss; }
350 G4double etot = kineticEnergy + particleMass;
351 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
352 G4double siga = (tmax/beta2 - 0.5*tcut) * twopi_mc2_rcl2 * step
353 * electronDensity * q * q;
365 if(p == fElectron) { tmax *= 0.5; }
366 else if(p != fPositron) {
367 G4double ratio= electron_mass_c2/fMass;
368 G4double gamma= kinEnergy/fMass + 1.0;
369 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
370 (1. + 2.0*gamma*ratio + ratio*ratio);
379 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 std::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()