76 fParticleChange =
nullptr;
78 if(p) { SetParticle(p); }
79 else { SetParticle(fElectron); }
83 fLowestTcut = 12.5*CLHEP::eV;
90 if(
IsMaster()) {
delete fModelData; fModelData =
nullptr; }
108 fMaterialCutsCoupleVector.clear();
117 size_t numRegions = fPAIRegionVector.size();
120 if(0 == numRegions) {
122 "no G4Regions are registered for the PAI model - World is used");
124 ->GetRegion(
"DefaultRegionForTheWorld",
false));
128 for(
size_t iReg = 0; iReg < numRegions; ++iReg )
130 const G4Region* curReg = fPAIRegionVector[iReg];
133 for(
size_t jMat = 0; jMat < numOfMat; ++jMat)
137 if(
nullptr != cutCouple)
142 << mat->
GetName() <<
"> fCouple= "
143 << cutCouple <<
", idx= " << cutCouple->
GetIndex()
145 <<
", cuts.size() = " << cuts.size() <<
G4endl;
149 size_t n = fMaterialCutsCoupleVector.size();
154 for(
size_t i=0; i<fMaterialCutsCoupleVector.size(); ++i)
156 if(cutCouple == fMaterialCutsCoupleVector[i]) {
164 fMaterialCutsCoupleVector.push_back(cutCouple);
166 fModelData->
Initialise(cutCouple, deltaCutInKinEnergy,
this);
201 if(0 > coupleIndex) {
return 0.0; }
204 G4double scaledTkin = kineticEnergy*fRatio;
218 if(0 > coupleIndex) {
return 0.0; }
221 if(tmax <= cutEnergy) {
return 0.0; }
223 G4double scaledTkin = kineticEnergy*fRatio;
225 scaledTkin, cutEnergy, tmax);
240 G4int coupleIndex = FindCoupleIndex(matCC);
241 if(0 > coupleIndex) {
return; }
249 if( maxEnergy < tmax) tmax = maxEnergy;
250 if( tmin >= tmax)
return;
253 G4double scaledTkin = kineticEnergy*fRatio;
254 G4double totalEnergy = kineticEnergy + fMass;
255 G4double totalMomentum = sqrt(kineticEnergy*(totalEnergy + fMass));
265 if( deltaTkin <= 0. && fVerbose > 0)
267 G4cout<<
"G4PAIPhotModel::SampleSecondary e- deltaTkin = "<<deltaTkin<<
G4endl;
269 if( deltaTkin <= 0.) {
return; }
271 if( deltaTkin > tmax) { deltaTkin = tmax; }
284 kineticEnergy -= deltaTkin;
286 if( kineticEnergy <= 0. )
294 G4ThreeVector dir = totalMomentum*direction - deltaRay->GetMomentum();
295 direction = dir.
unit();
298 vdp->push_back(deltaRay);
307 if( deltaTkin <= 0. )
309 G4cout<<
"G4PAIPhotonModel::SampleSecondary gamma deltaTkin = "<<deltaTkin<<
G4endl;
311 if( deltaTkin <= 0.)
return;
313 if( deltaTkin >= kineticEnergy )
315 deltaTkin = kineticEnergy;
319 G4double sintheta = sqrt((1.+costheta)*(1.-costheta));
323 G4double dirx = sintheta*cos(phi), diry = sintheta*sin(phi), dirz = costheta;
328 if( kineticEnergy > 0.)
330 kineticEnergy -= deltaTkin;
342 photonRay->SetKineticEnergy( deltaTkin );
343 photonRay->SetMomentumDirection(deltaDirection);
345 vdp->push_back(photonRay);
359 G4int coupleIndex = FindCoupleIndex(matCC);
360 if(0 > coupleIndex) {
return eloss; }
375 scaledTkin, step*fChargeSquare);
399 G4double etot = kineticEnergy + particleMass;
400 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
401 G4double siga = (tmax/beta2 - 0.5*tcut) * twopi_mc2_rcl2 * step
402 * electronDensity * q * q;
414 if(p == fElectron) { tmax *= 0.5; }
415 else if(p != fPositron) {
416 G4double ratio= electron_mass_c2/fMass;
417 G4double gamma= kinEnergy/fMass + 1.0;
418 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
419 (1. + 2.0*gamma*ratio + ratio*ratio);
428 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
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ThreeVector & GetMomentumDirection() const
G4double GetCharge() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
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 CrossSectionPerVolume(G4int coupleIndex, G4double scaledTkin, G4double tcut, G4double tmax) const
G4double SamplePostStepPlasmonTransfer(G4int coupleIndex, G4double scaledTkin) const
G4double SampleAlongStepPlasmonTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double stepFactor) const
G4double DEDXPerVolume(G4int coupleIndex, G4double scaledTkin, G4double cut) const
G4double GetPlasmonRatio(G4int coupleIndex, G4double scaledTkin) const
G4double SamplePostStepPhotonTransfer(G4int coupleIndex, G4double scaledTkin) const
void Initialise(const G4MaterialCutsCouple *, G4double cut, G4PAIPhotModel *)
G4double SampleAlongStepPhotonTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double stepFactor) const
G4double MinEnergyCut(const G4ParticleDefinition *, const G4MaterialCutsCouple *couple) final
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) final
G4PAIPhotData * GetPAIPhotData()
const std::vector< const G4MaterialCutsCouple * > & GetVectorOfCouples()
void DefineForRegion(const G4Region *r) final
void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) final
G4PAIPhotModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="PAI")
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) final
void Initialise(const G4ParticleDefinition *, const G4DataVector &) final
G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double, const G4double, const G4double, const G4double) final
G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy) final
G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) final
G4double Dispersion(const G4Material *, const G4DynamicParticle *, const G4double, const G4double, const 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()
void ProposeLocalEnergyDeposit(G4double anEnergyPart)