82 fParticleChange =
nullptr;
84 if(p) { SetParticle(p); }
85 else { SetParticle(fElectron); }
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);
202 if(0 > coupleIndex) {
return 0.0; }
206 G4double scaledTkin = kineticEnergy*fRatio;
208 return fChargeSquare*fModelData->
DEDXPerVolume(coupleIndex, scaledTkin, cut);
221 if(0 > coupleIndex)
return 0.0;
225 if(tmax <= cutEnergy)
return 0.0;
227 G4double scaledTkin = kineticEnergy*fRatio;
245 G4int coupleIndex = FindCoupleIndex(matCC);
246 if(0 > coupleIndex) {
return; }
254 if( maxEnergy < tmax) tmax = maxEnergy;
255 if( tmin >= tmax)
return;
258 G4double scaledTkin = kineticEnergy*fRatio;
259 G4double totalEnergy = kineticEnergy + fMass;
260 G4double totalMomentum = sqrt(kineticEnergy*(totalEnergy + fMass));
270 if( deltaTkin <= 0. && fVerbose > 0)
272 G4cout<<
"G4PAIPhotModel::SampleSecondary e- deltaTkin = "<<deltaTkin<<
G4endl;
274 if( deltaTkin <= 0.)
return;
276 if( deltaTkin > tmax) deltaTkin = tmax;
288 kineticEnergy -= deltaTkin;
290 if( kineticEnergy <= 0. )
299 G4ThreeVector dir = totalMomentum*direction - deltaRay->GetMomentum();
300 direction = dir.
unit();
303 vdp->push_back(deltaRay);
312 if( deltaTkin <= 0. )
314 G4cout<<
"G4PAIPhotonModel::SampleSecondary gamma deltaTkin = "<<deltaTkin<<
G4endl;
316 if( deltaTkin <= 0.)
return;
318 if( deltaTkin >= kineticEnergy )
320 deltaTkin = kineticEnergy;
324 G4double sintheta = sqrt((1.+costheta)*(1.-costheta));
328 G4double dirx = sintheta*cos(phi), diry = sintheta*sin(phi), dirz = costheta;
333 if( kineticEnergy > 0.)
335 kineticEnergy -= deltaTkin;
350 vdp->push_back(photonRay);
363 G4int coupleIndex = FindCoupleIndex(matCC);
364 if(0 > coupleIndex) {
return eloss; }
406 G4double etot = kineticEnergy + particleMass;
407 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
409 * electronDensity * q * q;
433 if(p == fElectron) { tmax *= 0.5; }
434 else if(p != fPositron) {
436 G4double gamma= kinEnergy/fMass + 1.0;
438 (1. + 2.0*gamma*ratio + ratio*ratio);
447 fPAIRegionVector.push_back(r);
virtual G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double, G4double, G4double) final
G4double SamplePostStepPhotonTransfer(G4int coupleIndex, G4double scaledTkin) const
virtual ~G4PAIPhotModel()
G4double LowEnergyLimit() const
const G4String & GetName() const
G4ParticleChangeForLoss * GetParticleChangeForLoss()
G4double GetKineticEnergy() const
virtual void DefineForRegion(const G4Region *r) final
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) final
G4double HighEnergyLimit() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) final
static constexpr double twopi_mc2_rcl2
G4PAIPhotData * GetPAIPhotData()
const G4String & GetName() const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) final
G4double GetPlasmonRatio(G4int coupleIndex, G4double scaledTkin) const
static G4MaterialTable * GetMaterialTable()
G4double SampleAlongStepPhotonTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double stepFactor) const
std::vector< G4Material * > G4MaterialTable
G4VEmAngularDistribution * GetAngularDistribution()
void SetMomentumDirection(const G4ThreeVector &aDirection)
G4ParticleDefinition * GetDefinition() const
const std::vector< const G4MaterialCutsCouple * > & GetVectorOfCouples()
virtual G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double, G4double) final
const G4String & GetParticleName() const
void Initialise(const G4MaterialCutsCouple *, G4double cut, G4PAIPhotModel *)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static const G4double reg
static constexpr double twopi
static constexpr double electron_mass_c2
static G4RegionStore * GetInstance()
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) final
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) final
const G4MaterialCutsCouple * CurrentCouple() const
G4GLOB_DLL std::ostream G4cout
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy) final
G4double GetElectronDensity() const
const G4ThreeVector & GetMomentumDirection() const
G4PAIPhotModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="PAI")
G4double DEDXPerVolume(G4int coupleIndex, G4double scaledTkin, G4double cut) const
Hep3Vector & rotateUz(const Hep3Vector &)
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)
void SetKineticEnergy(G4double aEnergy)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4Positron * Positron()
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
G4double SamplePostStepPlasmonTransfer(G4int coupleIndex, G4double scaledTkin) const
void SetAngularDistribution(G4VEmAngularDistribution *)
G4double CrossSectionPerVolume(G4int coupleIndex, G4double scaledTkin, G4double tcut, G4double tmax) const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double SampleAlongStepPlasmonTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double stepFactor) const
static G4Electron * Electron()
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
const G4Material * GetMaterial() const