93 secondaryParticle(nullptr),
94 buildLambdaTable(true),
96 theLambdaTable(nullptr),
97 theLambdaTablePrim(nullptr),
98 theDensityFactor(nullptr),
99 theDensityIdx(nullptr),
102 startFromNull(false),
105 currentCouple(nullptr),
106 currentModel(nullptr),
108 currentParticle(nullptr)
225 for(
auto & em :
emModels) {
if(em == ptr) {
return; } }
226 emModels.push_back(ptr);
284 if(pname !=
"deuteron" && pname !=
"triton" &&
285 pname !=
"alpha" && pname !=
"He3" &&
286 pname !=
"alpha+" && pname !=
"helium" &&
287 pname !=
"hydrogen") {
295 G4cout <<
"G4VEmProcess::PreparePhysicsTable() for "
388 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() for "
390 <<
" and particle " << num
392 <<
" isMaster= " << isMaster
435 num ==
"e+" || num ==
"mu+" ||
436 num ==
"mu-" || num ==
"proton"||
437 num ==
"pi+" || num ==
"pi-" ||
438 num ==
"kaon+" || num ==
"kaon-" ||
439 num ==
"alpha" || num ==
"anti_proton" ||
440 num ==
"GenericIon"|| num ==
"alpha++" ||
441 num ==
"alpha+" || num ==
"helium" ||
448 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
450 <<
" and particle " << num
460 G4cout <<
"G4EmProcess::BuildLambdaTable() for process "
480 scale =
G4Log(scale);
484 for(
size_t i=0; i<numOfCouples; ++i) {
494 delete (*theLambdaTable)[i];
507 if(emax <= emin) { emax = 2*emin; }
509 if(bin < 3) { bin = 3; }
518 delete (*theLambdaTablePrim)[i];
523 if(bin < 3) { bin = 3; }
526 bVectorPrim = aVectorPrim;
544 G4cout <<
"Lambda table is built for "
555 out << std::setprecision(6);
557 if (endOfLine !=
G4String(
"<br>\n")) {
561 if(
integral) { out <<
" integral: 1 "; }
562 if(
applyCuts) { out <<
", applyCuts: 1 "; }
567 if(buildLambdaTable) {
570 for(
size_t i=0; i<length; ++i) {
573 out <<
" Lambda table from ";
581 <<
", " <<
G4lrint(nbin/std::log10(emax/emin))
582 <<
" bins per decade, spline: "
589 out <<
" Used Lambda table of "
596 for(
size_t i=0; i<length; ++i) {
599 out <<
" LambdaPrime table from "
610 out <<
" Used LambdaPrime table of "
620 out << (*theLambdaTable) << endOfLine;
756 <<
" E(MeV)= " << finalT/
MeV
758 << lx <<
" (postLambda) "
821 for (
G4int i=0; i<num; ++i) {
894 if(masterProc && masterProc !=
this) {
return yes; }
904 <<
" in the directory <" << directory
907 G4cout <<
"Fail to store Physics Table for "
910 <<
" in the directory <" << directory
920 G4cout <<
"Physics table prim is stored for "
923 <<
" in the directory <" << directory
926 G4cout <<
"Fail to store Physics Table Prim for "
929 <<
" in the directory <" << directory
943 G4cout <<
"G4VEmProcess::RetrievePhysicsTable() for "
950 ||
particle != part) {
return yes; }
961 G4cout <<
"Lambda table for " << particleName
962 <<
" is Retrieved from <"
968 for(
size_t i=0; i<
n; ++i) {
970 (* theLambdaTable)[i]->SetSpline(
true);
976 G4cout <<
"Lambda table for " << particleName <<
" in file <"
977 << filename <<
"> is not exist"
988 G4cout <<
"Lambda table prim for " << particleName
989 <<
" is Retrieved from <"
995 for(
size_t i=0; i<
n; ++i) {
997 (* theLambdaTablePrim)[i]->SetSpline(
true);
1003 G4cout <<
"Lambda table prim for " << particleName <<
" in file <"
1004 << filename <<
"> is not exist"
1031 if(cross < 0.0) { cross = 0.0; }
1076 G4cout <<
"### G4VEmProcess::FindLambdaMax: "
1087 for (i=0; i<
n; ++i) {
1088 pv = (*theLambdaTable)[i];
1094 for (
size_t j=0; j<nb; ++j) {
1107 <<
" Max CS at i= " << i <<
" emax(MeV)= " << emax/
MeV
1108 <<
" lambda= " << smax <<
G4endl;
1113 for (i=0; i<
n; ++i) {
1114 pv = (*theLambdaTable)[i];
1116 G4int j = (*theDensityIdx)[i];
1151 G4cout <<
"### SetCrossSectionBiasingFactor: for "
1154 <<
" biasFactor= " << f <<
" weightFlag= " << flag
1168 G4cout <<
"### ActivateForcedInteraction: for "
1171 <<
" length(mm)= " << length/
mm
1172 <<
" in G4Region <" << r
1173 <<
"> weightFlag= " << flag
1187 if (0.0 <= factor) {
1196 G4cout <<
"### ActivateSecondaryBiasing: for "
1198 <<
" factor= " << factor
1199 <<
" in G4Region <" << region
1200 <<
"> energyLimit(MeV)= " << energyLimit/
MeV
1210 if(5 < n && n < 10000000) {
1258 ed <<
"Parameter is out of range: " << val
1259 <<
" it will have no effect!\n" <<
" Process "
virtual void PreparePhysicsTable(const G4ParticleDefinition &) override
static G4GenericIon * GenericIon()
G4double Energy(size_t index) const
void ResetForcedInteraction()
static void SetPhysicsVector(G4PhysicsTable *physTable, size_t idx, G4PhysicsVector *vec)
G4double GetKineticEnergy() const
void AddSecondary(G4Track *aSecondary)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4bool IsActive(G4double kinEnergy)
G4int NumberOfBinsPerDecade() const
std::ostringstream G4ExceptionDescription
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
G4VAtomDeexcitation * AtomDeexcitation()
void ActivateSecondaryBiasing(const G4String ®ion, G4double factor, G4double energyLimit)
static constexpr double MeV
void SetMaxKinEnergy(G4double e)
void SetWeight(G4double aValue)
void SetHighEnergyLimit(G4double)
G4double preStepKinEnergy
G4VEmModel * GetRegionModel(G4int idx, size_t couple_index) const
void SetMinKinEnergy(G4double e)
void StreamInfo(std::ostream &outFile, const G4ParticleDefinition &, G4String endOfLine=G4String("\n")) const
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
static constexpr double keV
const G4Element * GetCurrentElement() const
void ComputeIntegralLambda(G4double kinEnergy)
std::vector< G4double > theCrossSectionMax
static constexpr double mm
void DefineRegParamForEM(G4VEmProcess *) const
void ProposeWeight(G4double finalWeight)
void SetCreatorModelIndex(G4int idx)
const std::vector< G4int > * GetCoupleIndexes()
const G4String & GetParticleSubType() const
G4PhysicsTable * theLambdaTablePrim
const G4VProcess * GetMasterProcess() const
G4VEmProcess(const G4String &name, G4ProcessType type=fElectromagnetic)
G4double MaxKinEnergy() const
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
const G4String & GetParticleName() const
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="")
const G4String & GetParticleType() const
G4VEmModel * EmModel(size_t index=0) const
const G4TouchableHandle & GetTouchableHandle() const
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="", G4bool flag=true)
virtual void InitialiseProcess(const G4ParticleDefinition *)=0
void DefineMaterial(const G4MaterialCutsCouple *couple)
void SetSecondaryWeightByProcess(G4bool)
G4bool GetFlag(size_t idx) const
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
G4double ApplySecondaryBiasing(std::vector< G4DynamicParticle * > &, const G4Track &track, G4VEmModel *currentModel, G4ParticleChangeForGamma *pParticleChange, G4double &eloss, G4int coupleIdx, G4double tcut, G4double safety=0.0)
static const G4double emax
const G4ParticleDefinition * GetParticleDefinition() const
G4double condition(const G4ErrorSymMatrix &m)
G4bool ForcedInteractionRegion(G4int coupleIdx)
const G4ParticleDefinition * thePositron
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *)
void SetMasterThread(G4bool val)
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
G4bool SecondaryBiasingRegion(G4int coupleIdx)
const G4Material * baseMaterial
G4VEmModel * GetRegionModel(G4int idx, size_t index_couple)
G4VEmModel * GetModel(G4int idx, G4bool ver=false)
void PrintWarning(G4String tit, G4double val)
G4double GetPDGMass() const
void DumpModelList(std::ostream &out, G4int verb)
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
const G4ParticleDefinition * currentParticle
G4double G4Log(G4double x)
void Initialise(const G4ParticleDefinition &part, const G4String &procName, G4int verbose)
void ActivateSecondaryBiasing(const G4String ®ion, G4double factor, G4double energyLimit)
void SetParticle(const G4ParticleDefinition *p)
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
const std::vector< G4int > * theDensityIdx
G4double currentInteractionLength
const std::vector< G4double > * theCutsPositron
static constexpr double proton_mass_c2
G4double GetLocalEnergyDeposit() const
void SetVerboseLevel(G4int value)
std::vector< G4VEmModel * > emModels
static constexpr double TeV
G4int NumberOfModels() const
G4PhysicsTable * LambdaTablePrim() const
void Register(G4VEnergyLossProcess *p)
G4int GetNumberOfModels() const
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *, const G4Region *)
G4double GetStepLimit(G4int coupleIdx, G4double previousStep)
virtual void ProcessDescription(std::ostream &outFile) const override
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4VParticleChange * pParticleChange
void SetEmModel(G4VEmModel *, G4int index=0)
G4PhysicsTable * LambdaTable() const
G4ParticleChangeForGamma fParticleChange
static constexpr double electron_mass_c2
const G4ParticleDefinition * theElectron
G4VEmModel * currentModel
void InitialiseBaseMaterials(G4PhysicsTable *table)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4double GetGlobalTime() const
const std::vector< G4double > * GetDensityFactors()
const G4ParticleDefinition * secondaryParticle
void FillSecondDerivatives()
G4int WorkerVerbose() const
G4double ComputeCrossSectionPerAtom(G4double kineticEnergy, G4double Z, G4double A=0., G4double cut=0.0)
double A(double temperature)
G4double GetLambda(G4double &kinEnergy, const G4MaterialCutsCouple *couple)
void SetTouchableHandle(const G4TouchableHandle &apValue)
std::vector< G4DynamicParticle * > secParticles
const G4String & GetProcessName() const
const G4ThreeVector & GetPosition() const
G4double LambdaFactor() const
void SetPolarAngleLimit(G4double)
void DeRegister(G4VEnergyLossProcess *p)
void UpdateEmModel(const G4String &model_name, G4double emin, G4double emax)
static G4Positron * Positron()
static constexpr double eV
G4EmBiasingManager * biasManager
virtual void StartTracking(G4Track *) override
G4EmParameters * theParameters
G4StepPoint * GetPostStepPoint() const
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
const std::vector< G4double > * theCutsGamma
virtual G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
static G4Electron * Electron()
size_t GetTableSize() const
void SetLambdaBinning(G4int nbins)
G4LossTableBuilder * GetTableBuilder()
G4double MinKinEnergy() const
void InitializeForPostStep(const G4Track &)
std::vector< G4double > theEnergyOfCrossSectionMax
void SetMinKinEnergyPrim(G4double e)
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double theInitialNumberOfInteractionLength
G4PhysicsTable * theLambdaTable
G4int NumberOfRegionModels(size_t index_couple) const
static G4ProductionCutsTable * GetProductionCutsTable()
G4double GetProposedKineticEnergy() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
virtual G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
virtual G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4double GetMaxEnergy() const
G4double MscThetaLimit() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
G4double minKinEnergyPrim
const std::vector< G4double > * theCutsElectron
G4double GetCurrentLambda(G4double kinEnergy)
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessManager * GetProcessManager() const
const std::vector< G4double > * theDensityFactor
G4PhysicsVector * LambdaPhysicsVector(const G4MaterialCutsCouple *)
G4double GetSafety() const
G4TrackStatus GetTrackStatus() const
void FillLambdaVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4bool startFromNull=true, G4EmTableType t=fRestricted)
G4double GetKineticEnergy() const
G4int GetNumberOfRegionModels(size_t couple_index) const
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * particle
void ClearNumberOfInteractionLengthLeft()
static G4LossTableManager * Instance()
void UpdateEmModel(const G4String &, G4double, G4double)
const std::vector< G4double > * theCuts
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=nullptr)
const G4Element * GetCurrentElement() const
virtual void BuildPhysicsTable(const G4ParticleDefinition &) override
const G4Material * GetMaterial() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
G4EmModelManager * modelManager
const G4ParticleDefinition * GetParticleDefinition() const
G4double theNumberOfInteractionLengthLeft
G4LossTableManager * lManager
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4TrackStatus GetTrackStatus() const
size_t currentCoupleIndex
G4int NumberOfBins() const
G4double HighEnergyLimit() const
void ProposeTrackStatus(G4TrackStatus status)
const G4MaterialCutsCouple * currentCouple
static constexpr double GeV
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
const G4DynamicParticle * GetDynamicParticle() const
const G4ParticleDefinition * theGamma
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
void SetFluoFlag(G4bool val)
const G4Material * currentMaterial
static G4EmParameters * Instance()
G4double CrossSectionPerVolume(G4double kineticEnergy, const G4MaterialCutsCouple *couple)
size_t GetVectorLength() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double MeanFreePath(const G4Track &track)
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii)
G4double GetParentWeight() const
G4int GetParentID() const
virtual void StreamProcessInfo(std::ostream &, G4String) const
G4int GetProcessSubType() const
void SetNumberOfSecondaries(G4int totSecondaries)
static G4int Register(const G4String &)