81 fParticleChange =
nullptr;
83 if(p) { SetParticle(p); }
84 else { SetParticle(fElectron); }
88 fLowestTcut = 12.5*CLHEP::eV;
96 if(
IsMaster()) {
delete fModelData; fModelData =
nullptr; }
117 fMaterialCutsCoupleVector.clear();
126 size_t numRegions = fPAIRegionVector.size();
129 if(0 == numRegions) {
131 "no G4Regions are registered for the PAI model - World is used");
133 ->GetRegion(
"DefaultRegionForTheWorld",
false));
137 for(
size_t iReg = 0; iReg < numRegions; ++iReg )
139 const G4Region* curReg = fPAIRegionVector[iReg];
142 for(
size_t jMat = 0; jMat < numOfMat; ++jMat)
152 << mat->
GetName() <<
"> fCouple= "
153 << cutCouple <<
", idx= " << cutCouple->
GetIndex()
155 <<
", cuts.size() = " << cuts.size() <<
G4endl;
159 size_t n = fMaterialCutsCoupleVector.size();
164 for(
size_t i=0; i<fMaterialCutsCoupleVector.size(); ++i)
166 if(cutCouple == fMaterialCutsCoupleVector[i]) {
174 fMaterialCutsCoupleVector.push_back(cutCouple);
176 fModelData->
Initialise(cutCouple, deltaCutInKinEnergy,
this);
210 if(0 > coupleIndex) {
return 0.0; }
214 G4double scaledTkin = kineticEnergy*fRatio;
216 return fChargeSquare*fModelData->
DEDXPerVolume(coupleIndex, scaledTkin, cut);
229 if(0 > coupleIndex)
return 0.0;
233 if(tmax <= cutEnergy)
return 0.0;
235 G4double scaledTkin = kineticEnergy*fRatio;
253 G4int coupleIndex = FindCoupleIndex(matCC);
254 if(0 > coupleIndex) {
return; }
262 if( maxEnergy < tmax) tmax = maxEnergy;
263 if( tmin >= tmax)
return;
266 G4double scaledTkin = kineticEnergy*fRatio;
267 G4double totalEnergy = kineticEnergy + fMass;
268 G4double totalMomentum = sqrt(kineticEnergy*(totalEnergy + fMass));
278 if( deltaTkin <= 0. && fVerbose > 0)
280 G4cout<<
"G4PAIPhotModel::SampleSecondary e- deltaTkin = "<<deltaTkin<<
G4endl;
282 if( deltaTkin <= 0.)
return;
284 if( deltaTkin > tmax) deltaTkin = tmax;
297 kineticEnergy -= deltaTkin;
299 if( kineticEnergy <= 0. )
308 G4ThreeVector dir = totalMomentum*direction - deltaRay->GetMomentum();
309 direction = dir.
unit();
312 vdp->push_back(deltaRay);
321 if( deltaTkin <= 0. )
323 G4cout<<
"G4PAIPhotonModel::SampleSecondary gamma deltaTkin = "<<deltaTkin<<
G4endl;
325 if( deltaTkin <= 0.)
return;
327 if( deltaTkin >= kineticEnergy )
329 deltaTkin = kineticEnergy;
333 G4double sintheta = sqrt((1.+costheta)*(1.-costheta));
337 G4double dirx = sintheta*cos(phi), diry = sintheta*sin(phi), dirz = costheta;
342 if( kineticEnergy > 0.)
344 kineticEnergy -= deltaTkin;
356 photonRay->SetKineticEnergy( deltaTkin );
357 photonRay->SetMomentumDirection(deltaDirection);
359 vdp->push_back(photonRay);
373 G4int coupleIndex = FindCoupleIndex(matCC);
374 if(0 > coupleIndex) {
return eloss; }
417 G4double etot = kineticEnergy + particleMass;
418 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
419 G4double siga = (tmax/beta2 - 0.5*tcut) * twopi_mc2_rcl2 * step
420 * electronDensity * q * q;
432 if(p == fElectron) { tmax *= 0.5; }
433 else if(p != fPositron) {
434 G4double ratio= electron_mass_c2/fMass;
435 G4double gamma= kinEnergy/fMass + 1.0;
436 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
437 (1. + 2.0*gamma*ratio + ratio*ratio);
446 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 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)