66 #ifndef G4VEmProcess_h
67 #define G4VEmProcess_h 1
152 G4bool ascii =
false)
override;
220 size_t& idxRegion)
const;
313 void BuildLambdaTable();
317 void FindLambdaMax();
323 inline void ComputeIntegralLambda(
G4double kinEnergy);
352 std::vector<G4VEmModel*> emModels;
353 G4int numberOfModels;
358 std::vector<G4double> theEnergyOfCrossSectionMax;
359 std::vector<G4double> theCrossSectionMax;
362 size_t idxLambdaPrim;
364 const std::vector<G4double>* theCuts;
365 const std::vector<G4double>* theCutsGamma;
366 const std::vector<G4double>* theCutsElectron;
367 const std::vector<G4double>* theCutsPositron;
368 const std::vector<G4double>* theDensityFactor;
369 const std::vector<G4int>* theDensityIdx;
396 std::vector<G4DynamicParticle*> secParticles;
407 size_t currentCoupleIndex;
408 size_t basedCoupleIndex;
417 G4int mainSecondaries;
428 return currentCoupleIndex;
435 return (*theCutsGamma)[currentCoupleIndex];
442 return (*theCutsElectron)[currentCoupleIndex];
449 if(couple != currentCouple) {
450 currentCouple = couple;
453 currentCoupleIndex = couple->
GetIndex();
454 basedCoupleIndex = (*theDensityIdx)[currentCoupleIndex];
455 fFactor = biasFactor*(*theDensityFactor)[currentCoupleIndex];
456 if(!baseMaterial) { baseMaterial = currentMaterial; }
458 idxLambda = idxLambdaPrim = 0;
467 if(1 < numberOfModels) {
468 currentModel = modelManager->
SelectModel(kinEnergy, index);
478 size_t& idxRegion)
const
480 return modelManager->
SelectModel(kinEnergy, idxRegion);
487 return ((*theLambdaTable)[basedCoupleIndex])->Value(e, idxLambda);
494 return ((*theLambdaTablePrim)[basedCoupleIndex])->Value(e, idxLambdaPrim)/e;
502 baseMaterial,currentParticle, e,(*theCuts)[currentCoupleIndex]);
510 if(e >= minKinEnergyPrim) { x = GetLambdaFromTablePrim(e); }
511 else if(theLambdaTable) { x = GetLambdaFromTable(e); }
512 else { x = ComputeCurrentLambda(e); }
522 DefineMaterial(couple);
524 return GetCurrentLambda(kinEnergy);
532 DefineMaterial(couple);
534 return fFactor*ComputeCurrentLambda(e);
539 inline void G4VEmProcess::ComputeIntegralLambda(
G4double e)
541 mfpKinEnergy = theEnergyOfCrossSectionMax[currentCoupleIndex];
542 if (e <= mfpKinEnergy) {
543 preStepLambda = GetCurrentLambda(e);
547 if(e1 > mfpKinEnergy) {
548 preStepLambda = GetCurrentLambda(e);
549 G4double preStepLambda1 = GetCurrentLambda(e1);
550 if(preStepLambda1 > preStepLambda) {
552 preStepLambda = preStepLambda1;
555 preStepLambda = fFactor*theCrossSectionMax[currentCoupleIndex];
601 return theLambdaTable;
608 return theLambdaTablePrim;
622 return secondaryParticle;
643 buildLambdaTable = val;
665 secondaryParticle =
p;
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="", G4bool flag=true)
G4double condition(const G4ErrorSymMatrix &m)
G4PhysicsTable * LambdaTable() const
virtual void PrintInfo()=0
G4double GetLambda(G4double &kinEnergy, const G4MaterialCutsCouple *couple)
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
virtual void StartTracking(G4Track *) override
G4PhysicsTable * LambdaTablePrim() const
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
virtual void BuildPhysicsTable(const G4ParticleDefinition &) override
G4int GetNumberOfRegionModels(size_t couple_index) const
G4int GetNumberOfModels() const
G4VEmProcess(const G4String &name, G4ProcessType type=fElectromagnetic)
void SetBuildTableFlag(G4bool val)
G4double ComputeCrossSectionPerAtom(G4double kineticEnergy, G4double Z, G4double A=0., G4double cut=0.0)
G4VEmModel * EmModel(G4int index=1) const
G4double MscThetaLimit() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
G4ParticleChangeForGamma fParticleChange
G4double GetElectronEnergyCut()
virtual G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
void SetSplineFlag(G4bool val)
const G4VEmModel * GetCurrentModel() const
virtual void InitialiseProcess(const G4ParticleDefinition *)=0
G4double MaxKinEnergy() const
const G4ParticleDefinition * SecondaryParticle() const
const G4ParticleDefinition * Particle() const
void SetStartFromNullFlag(G4bool val)
virtual G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
void UpdateEmModel(const G4String &, G4double, G4double)
void ActivateSecondaryBiasing(const G4String ®ion, G4double factor, G4double energyLimit)
G4int LambdaBinning() const
virtual G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
virtual void PreparePhysicsTable(const G4ParticleDefinition &) override
void SetMinKinEnergyPrim(G4double e)
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *)
G4double MeanFreePath(const G4Track &track)
void SetLambdaBinning(G4int nbins)
void SetEmModel(G4VEmModel *, G4int index=1)
size_t CurrentMaterialCutsCoupleIndex() const
double A(double temperature)
G4VEmModel * GetRegionModel(G4int idx, size_t couple_index) const
G4double PolarAngleLimit() const
G4double GetGammaEnergyCut()
void SetParticle(const G4ParticleDefinition *p)
G4ParticleChangeForGamma * GetParticleChange()
const G4Element * GetTargetElement() const
void SetIntegral(G4bool val)
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=nullptr)
G4PhysicsVector * LambdaPhysicsVector(const G4MaterialCutsCouple *)
G4VEmModel * SelectModelForMaterial(G4double kinEnergy, size_t &idxRegion) const
const G4Isotope * GetTargetIsotope() const
void SetMaxKinEnergy(G4double e)
G4double CrossSectionBiasingFactor() const
virtual void ProcessDescription(std::ostream &outFile) const
void SetCurrentCouple(const G4MaterialCutsCouple *)
void SetSecondaryParticle(const G4ParticleDefinition *p)
G4bool IsIntegral() const
const G4Element * GetCurrentElement() const
virtual G4bool IsApplicable(const G4ParticleDefinition &p) override=0
const G4Material * GetBaseMaterial() const
G4VEmModel * SelectModel(G4double &energy, size_t &index)
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
void SetMinKinEnergy(G4double e)
G4double MinKinEnergy() const
G4double CrossSectionPerVolume(G4double kineticEnergy, const G4MaterialCutsCouple *couple)
const G4Material * GetMaterial() const
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
const G4Isotope * GetCurrentIsotope() const
const G4Element * GetCurrentElement() const
G4double RecalculateLambda(G4double kinEnergy, const G4MaterialCutsCouple *couple)