149 if(
nullptr == ptr) {
return; }
159 if(
nullptr == ptr) {
return; }
161 for(
auto & em :
emModels) {
if(em == ptr) {
return; } }
184 if(
pname !=
"deuteron" &&
pname !=
"triton" &&
187 pname !=
"hydrogen") {
195 G4cout <<
"G4VEmProcess::PreparePhysicsTable() for "
254 if(
nullptr == mod) {
continue; }
298 G4cout <<
"### G4VEmProcess::PreparePhysicsTable() done for "
316 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() for "
318 <<
" and particle " << num
364 num ==
"e+" || num ==
"mu+" ||
365 num ==
"mu-" || num ==
"proton"||
366 num ==
"pi+" || num ==
"pi-" ||
367 num ==
"kaon+" || num ==
"kaon-" ||
368 num ==
"alpha" || num ==
"anti_proton" ||
369 num ==
"GenericIon"|| num ==
"alpha++" ||
370 num ==
"alpha+" || num ==
"helium" ||
377 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
379 <<
" and particle " << num
390 G4cout <<
"G4EmProcess::BuildLambdaTable() for process "
410 scale =
G4Log(scale);
414 for(
size_t i=0; i<numOfCouples; ++i) {
424 delete (*theLambdaTable)[i];
439 if(bin < 3) { bin = 3; }
447 delete (*theLambdaTablePrim)[i];
452 if(bin < 3) { bin = 3; }
455 bVectorPrim = aVectorPrim;
469 G4cout <<
"Lambda table is built for "
481 out << std::setprecision(6);
487 if(
applyCuts) { out <<
" applyCuts:1 "; }
494 for(
size_t i=0; i<length; ++i) {
497 out <<
" Lambda table from ";
506 <<
" bins/decade, spline: "
512 out <<
" Used Lambda table of "
519 for(
size_t i=0; i<length; ++i) {
522 out <<
" LambdaPrime table from "
532 out <<
" Used LambdaPrime table of "
542 out << (*theLambdaTable) <<
G4endl;
715 <<
" E(MeV)= " << finalT/
MeV
716 <<
" preLambda= " << lg <<
" < " << lx <<
" (postLambda) "
734 G4cout <<
"G4VEmProcess::PostStepDoIt: Sample secondary; E= "
779 for (
G4int i=0; i<num; ++i) {
874 G4cout <<
"Fail to store Physics Table for "
877 <<
" in the directory <" << directory
888 G4cout <<
"Physics table prim is stored for "
891 <<
" in the directory <" << directory
895 G4cout <<
"Fail to store Physics Table Prim for "
898 <<
" in the directory <" << directory
912 G4cout <<
"G4VEmProcess::RetrievePhysicsTable() for "
919 ||
particle != part) {
return yes; }
931 G4cout <<
"Lambda table for " << particleName
932 <<
" is Retrieved from <"
938 if(
nullptr != v) { v->FillSecondDerivatives(); }
944 G4cout <<
"Lambda table for " << particleName <<
" in file <"
945 << filename <<
"> is not exist"
954 filename,ascii,
true);
957 G4cout <<
"Lambda table prim for " << particleName
958 <<
" is Retrieved from <"
963 if(
nullptr != v) { v->FillSecondDerivatives(); }
967 G4cout <<
"Lambda table prim for " << particleName <<
" in file <"
968 << filename <<
"> is not exist"
1004 return (0.0 < xs) ? 1.0/xs :
DBL_MAX;
1024 G4cout <<
"### G4VEmProcess::FindLambdaMax: "
1028 std::vector<G4double>* ptr =
nullptr;
1034 ptr =
new std::vector<G4double>;
1041 for(
size_t i=0; i<
n; ++i) {
1047 if(nbin < 4) { nbin = 4; }
1052 for(
G4int j=0; j<=nbin; ++j) {
1066 G4cout <<
" " << i <<
". Epeak(GeV)=" << em/
GeV
1067 <<
" SigmaMax(1/mm)=" <<
sm
1068 <<
" Emin(GeV)=" << emin/
GeV <<
" Emax(GeV)=" <<
emax/
GeV
1084 if(
nullptr == ptr) {
1117 G4cout <<
"### SetCrossSectionBiasingFactor: for "
1120 <<
" biasFactor= " << f <<
" weightFlag= " << flag
1134 G4cout <<
"### ActivateForcedInteraction: for "
1137 <<
" length(mm)= " << length/
mm
1138 <<
" in G4Region <" << r
1139 <<
"> weightFlag= " << flag
1153 if (0.0 <= factor) {
1162 G4cout <<
"### ActivateSecondaryBiasing: for "
1164 <<
" factor= " << factor
1165 <<
" in G4Region <" << region
1166 <<
"> energyLimit(MeV)= " << energyLimit/
MeV
1176 if(5 <
n &&
n < 10000000) {
1245 G4String ss =
"G4VEmProcess::" + tit;
1247 ed <<
"Parameter is out of range: " << val
1248 <<
" it will have no effect!\n" <<
" Process "
static const G4double e1[44]
static const G4double emax
G4double condition(const G4ErrorSymMatrix &m)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
static constexpr double mm
static constexpr double keV
static constexpr double eV
static constexpr double GeV
static constexpr double MeV
static constexpr double TeV
G4GLOB_DLL std::ostream G4cout
G4double GetLogKineticEnergy() const
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
G4bool ForcedInteractionRegion(G4int coupleIdx)
G4double ApplySecondaryBiasing(std::vector< G4DynamicParticle * > &, const G4Track &track, G4VEmModel *currentModel, G4ParticleChangeForGamma *pParticleChange, G4double &eloss, G4int coupleIdx, G4double tcut, G4double safety=0.0)
void ActivateSecondaryBiasing(const G4String ®ion, G4double factor, G4double energyLimit)
void ResetForcedInteraction()
void Initialise(const G4ParticleDefinition &part, const G4String &procName, G4int verbose)
G4double GetWeight(G4int i)
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="")
G4bool SecondaryBiasingRegion(G4int coupleIdx)
G4double GetStepLimit(G4int coupleIdx, G4double previousStep)
G4PhysicsTable * MakeTable(size_t idx)
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fm, const G4Region *r)
void DumpModelList(std::ostream &out, G4int verb)
G4int NumberOfModels() const
void SetFluoFlag(G4bool val)
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double, G4int verb)
void FillLambdaVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4bool startFromNull=true, G4EmTableType t=fRestricted)
G4VEmModel * GetModel(G4int idx, G4bool ver=false)
G4bool IsPrintLocked() const
static G4EmParameters * Instance()
G4int NumberOfBins() const
G4double MinKinEnergy() const
G4int NumberOfBinsPerDecade() const
G4double MscThetaLimit() const
void DefineRegParamForEM(G4VEmProcess *) const
G4int WorkerVerbose() const
G4double MaxKinEnergy() const
G4double LambdaFactor() const
static G4GenericIon * GenericIon()
G4bool GetBaseMaterialFlag()
const std::vector< G4double > * GetDensityFactors() const
const std::vector< G4int > * GetCoupleIndexes() const
void InitialiseBaseMaterials(const G4PhysicsTable *table=nullptr)
G4bool GetFlag(size_t idx)
static G4LossTableManager * Instance()
G4LossTableBuilder * GetTableBuilder()
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
void DeRegister(G4VEnergyLossProcess *p)
void Register(G4VEnergyLossProcess *p)
G4VAtomDeexcitation * AtomDeexcitation()
const G4Material * GetMaterial() const
const G4String & GetName() const
void InitializeForPostStep(const G4Track &)
G4double GetProposedKineticEnergy() const
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleType() const
G4double GetPDGMass() const
const G4String & GetParticleName() const
const G4String & GetParticleSubType() const
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii, G4bool spline)
static void SetPhysicsVector(G4PhysicsTable *physTable, std::size_t idx, G4PhysicsVector *vec)
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
std::size_t length() const
G4double GetMaxEnergy() const
G4double Energy(const std::size_t index) const
std::size_t GetVectorLength() const
void FillSecondDerivatives(const G4SplineType=G4SplineType::Base, const G4double dir1=0.0, const G4double dir2=0.0)
static G4Positron * Positron()
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
const std::vector< G4double > * GetEnergyCutsVector(std::size_t pcIdx) const
static G4ProductionCutsTable * GetProductionCutsTable()
G4double GetSafety() const
G4StepPoint * GetPostStepPoint() const
G4TrackStatus GetTrackStatus() const
const G4ParticleDefinition * GetParticleDefinition() const
void SetWeight(G4double aValue)
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetGlobalTime() const
const G4DynamicParticle * GetDynamicParticle() const
const G4TouchableHandle & GetTouchableHandle() const
G4double GetKineticEnergy() const
void SetCreatorModelID(const G4int id)
G4int GetParentID() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
virtual void FillNumberOfSecondaries(G4int &numberOfTriplets, G4int &numberOfRecoil)
void SetPolarAngleLimit(G4double)
void SetHighEnergyLimit(G4double)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void SetMasterThread(G4bool val)
G4double LowEnergyLimit() const
const G4Element * GetCurrentElement() const
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
G4double HighEnergyLimit() const
G4bool IsActive(G4double kinEnergy) const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
void SetUseBaseMaterials(G4bool val)
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
const std::vector< G4double > * theCutsElectron
void DefineMaterial(const G4MaterialCutsCouple *couple)
G4double RecalculateLambda(G4double kinEnergy, const G4MaterialCutsCouple *couple)
void ComputeIntegralLambda(G4double kinEnergy, G4double logKinEnergy)
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
G4double MeanFreePath(const G4Track &track)
G4PhysicsVector * LambdaPhysicsVector(const G4MaterialCutsCouple *)
void CurrentSetup(const G4MaterialCutsCouple *, G4double energy)
G4double CrossSectionPerVolume(G4double kineticEnergy, const G4MaterialCutsCouple *couple, G4double logKinEnergy=DBL_MAX)
virtual void StreamProcessInfo(std::ostream &) const
G4VEmProcess(const G4String &name, G4ProcessType type=fElectromagnetic)
G4LossTableManager * lManager
G4VEmModel * SelectModel(G4double kinEnergy, size_t)
G4EmBiasingManager * biasManager
const G4ParticleDefinition * secondaryParticle
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4double preStepLogKinEnergy
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *)
const std::vector< G4double > * theCutsGamma
G4double ComputeCrossSectionPerAtom(G4double kineticEnergy, G4double Z, G4double A=0., G4double cut=0.0)
G4VEmModel * currentModel
void SetEnergyOfCrossSectionMax(std::vector< G4double > *)
G4PhysicsTable * LambdaTable() const
std::vector< G4double > * theEnergyOfCrossSectionMax
void SetMinKinEnergy(G4double e)
const G4ParticleDefinition * currentParticle
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
std::vector< G4VEmModel * > emModels
void StartTracking(G4Track *) override
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=nullptr)
void SetEmModel(G4VEmModel *, G4int index=0)
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
virtual void InitialiseProcess(const G4ParticleDefinition *)=0
void StreamInfo(std::ostream &outFile, const G4ParticleDefinition &, G4bool rst=false) const
void SetLambdaBinning(G4int nbins)
const std::vector< G4double > * theDensityFactor
void PrintWarning(G4String tit, G4double val)
G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
std::vector< G4double > * EnergyOfCrossSectionMax() const
G4bool UseBaseMaterial() const
G4CrossSectionType fXSType
void ProcessDescription(std::ostream &outFile) const override
G4double GetCurrentLambda(G4double kinEnergy)
G4PhysicsTable * theLambdaTablePrim
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
virtual G4VEmProcess * GetEmProcess(const G4String &name)
G4double MaxKinEnergy() const
const G4ParticleDefinition * thePositron
std::vector< G4DynamicParticle * > secParticles
std::vector< G4double > * FindLambdaMax()
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="", G4bool flag=true)
const G4ParticleDefinition * theElectron
G4EmParameters * theParameters
const G4MaterialCutsCouple * currentCouple
const G4ParticleDefinition * theGamma
G4double minKinEnergyPrim
G4PhysicsTable * LambdaTablePrim() const
G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
void ActivateSecondaryBiasing(const G4String ®ion, G4double factor, G4double energyLimit)
G4double preStepKinEnergy
G4double PolarAngleLimit() const
const G4VEmProcess * masterProc
const std::vector< G4double > * theCuts
size_t currentCoupleIndex
G4double GetLambda(G4double kinEnergy, const G4MaterialCutsCouple *couple)
G4ParticleChangeForGamma fParticleChange
G4PhysicsTable * theLambdaTable
const std::vector< G4int > * theDensityIdx
const std::vector< G4double > * theCutsPositron
void SetParticle(const G4ParticleDefinition *p)
const G4ParticleDefinition * particle
void SetMinKinEnergyPrim(G4double e)
void PreparePhysicsTable(const G4ParticleDefinition &) override
void SetMaxKinEnergy(G4double e)
G4EmModelManager * modelManager
G4EmDataHandler * theData
const G4Element * GetCurrentElement() const
G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4double GetParentWeight() const
void ProposeTrackStatus(G4TrackStatus status)
void SetSecondaryWeightByProcess(G4bool)
void ProposeWeight(G4double finalWeight)
G4double GetLocalEnergyDeposit() const
void AddSecondary(G4Track *aSecondary)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetNumberOfSecondaries(G4int totSecondaries)
G4TrackStatus GetTrackStatus() const
G4double currentInteractionLength
G4double theInitialNumberOfInteractionLength
void SetVerboseLevel(G4int value)
const G4VProcess * GetMasterProcess() const
G4double theNumberOfInteractionLengthLeft
G4VParticleChange * pParticleChange
G4int GetProcessSubType() const
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
const G4String & GetProcessName() const
static constexpr double TeV
static constexpr double keV
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
const char * name(G4int ptype)