86 fParticleChange =
nullptr;
88 if(p) { SetParticle(p); }
89 else { SetParticle(fElectron); }
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 =
215 if(0 > coupleIndex) {
return 0.0; }
219 G4double scaledTkin = kineticEnergy*fRatio;
221 return fChargeSquare*fModelData->
DEDXPerVolume(coupleIndex, scaledTkin,
239 if(0 > coupleIndex) {
return 0.0; }
242 if(tmax <= cutEnergy) {
return 0.0; }
244 G4double scaledTkin = kineticEnergy*fRatio;
263 G4int coupleIndex = FindCoupleIndex(matCC);
266 if(0 > coupleIndex) {
return; }
272 if(maxEnergy < tmax) { tmax = maxEnergy; }
273 if(tmin >= tmax) {
return; }
276 G4double scaledTkin = kineticEnergy*fRatio;
277 G4double totalEnergy = kineticEnergy + fMass;
278 G4double totalMomentum = sqrt(kineticEnergy*(totalEnergy+fMass));
286 if( !(deltaTkin <= 0.) && !(deltaTkin > 0)) {
287 G4cout<<
"G4PAIModel::SampleSecondaries; deltaKIn = "<<deltaTkin/
keV
288 <<
" keV "<<
" Escaled(MeV)= " << scaledTkin <<
G4endl;
291 if( deltaTkin <= 0.) {
return; }
293 if( deltaTkin > tmax) { deltaTkin = tmax; }
304 kineticEnergy -= deltaTkin;
305 G4ThreeVector dir = totalMomentum*direction - deltaRay->GetMomentum();
306 direction = dir.
unit();
310 vdp->push_back(deltaRay);
320 G4int coupleIndex = FindCoupleIndex(matCC);
321 if(0 > coupleIndex) {
return eloss; }
359 G4double etot = kineticEnergy + particleMass;
360 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
362 * electronDensity * q * q;
374 if(p == fElectron) { tmax *= 0.5; }
375 else if(p != fPositron) {
377 G4double gamma= kinEnergy/fMass + 1.0;
379 (1. + 2.0*gamma*ratio + ratio*ratio);
388 fPAIRegionVector.push_back(r);
const std::vector< const G4MaterialCutsCouple * > & GetVectorOfCouples()
G4double LowEnergyLimit() const
G4PAIModelData * GetPAIModelData()
G4PAIModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="PAI")
const G4String & GetName() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) final
G4ParticleChangeForLoss * GetParticleChangeForLoss()
G4double GetKineticEnergy() const
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) final
G4double HighEnergyLimit() const
static constexpr double twopi_mc2_rcl2
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy) final
const G4String & GetName() const
static G4MaterialTable * GetMaterialTable()
std::vector< G4Material * > G4MaterialTable
G4VEmAngularDistribution * GetAngularDistribution()
G4ParticleDefinition * GetDefinition() const
virtual G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double, G4double) final
const G4String & GetParticleName() const
static const G4double reg
static constexpr double electron_mass_c2
G4double SampleAlongStepTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double tmax, G4double stepFactor) const
static G4RegionStore * GetInstance()
virtual G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double, G4double, G4double) final
G4double DEDXPerVolume(G4int coupleIndex, G4double scaledTkin, G4double cut) const
const G4MaterialCutsCouple * CurrentCouple() const
G4GLOB_DLL std::ostream G4cout
G4double GetElectronDensity() const
const G4ThreeVector & GetMomentumDirection() const
virtual void DefineForRegion(const G4Region *r) final
G4double GetCharge() const
static constexpr double eplus
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4MaterialCutsCouple * FindCouple(G4Material *mat)
std::vector< G4EmElementSelector * > * GetElementSelectors()
static size_t GetNumberOfMaterials()
void SetProposedMomentumDirection(const G4ThreeVector &dir)
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) final
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) final
G4double CrossSectionPerVolume(G4int coupleIndex, G4double scaledTkin, G4double tcut, G4double tmax) const
static G4Positron * Positron()
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) final
void SetAngularDistribution(G4VEmAngularDistribution *)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
static G4Electron * Electron()
G4double SamplePostStepTransfer(G4int coupleIndex, G4double scaledTkin, G4double tmin, G4double tmax) const
void Initialise(const G4MaterialCutsCouple *, G4PAIModel *)
static constexpr double keV
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
const G4Material * GetMaterial() const