93 secondaryParticle(nullptr),
94 buildLambdaTable(true),
96 theLambdaTable(nullptr),
97 theLambdaTablePrim(nullptr),
98 theDensityFactor(nullptr),
99 theDensityIdx(nullptr),
102 startFromNull(false),
104 currentModel(nullptr),
106 currentParticle(nullptr),
107 currentCouple(nullptr)
219 if(index >= n) {
for(
G4int i=n; i<=index; ++i) {
emModels.push_back(0);} }
254 if(masterProcess && masterProcess !=
this) { isMaster =
false; }
262 if(pname !=
"deuteron" && pname !=
"triton" &&
263 pname !=
"alpha" && pname !=
"He3" &&
264 pname !=
"alpha+" && pname !=
"helium" &&
265 pname !=
"hydrogen") {
272 G4cout <<
"G4VEmProcess::PreparePhysicsTable() for "
357 if(masterProc && masterProc !=
this) { isMaster =
false; }
361 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() for "
363 <<
" and particle " << num
365 <<
" isMaster= " << isMaster
408 num ==
"e+" || num ==
"mu+" ||
409 num ==
"mu-" || num ==
"proton"||
410 num ==
"pi+" || num ==
"pi-" ||
411 num ==
"kaon+" || num ==
"kaon-" ||
412 num ==
"alpha" || num ==
"anti_proton" ||
413 num ==
"GenericIon")))
419 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
421 <<
" and particle " << num
431 G4cout <<
"G4EmProcess::BuildLambdaTable() for process "
455 for(
size_t i=0; i<numOfCouples; ++i) {
465 delete (*theLambdaTable)[i];
478 if(emax <= emin) { emax = 2*emin; }
480 if(bin < 3) { bin = 3; }
489 delete (*theLambdaTablePrim)[i];
494 if(bin < 3) { bin = 3; }
497 bVectorPrim = aVectorPrim;
515 G4cout <<
"Lambda table is built for "
526 G4cout << std::setprecision(6);
535 if(buildLambdaTable) {
538 for(
size_t i=0; i<length; ++i) {
541 G4cout <<
" Lambda table from ";
549 <<
", " <<
G4lrint(nbin/std::log10(emax/emin))
550 <<
" bins per decade, spline: "
557 G4cout <<
" Used Lambda table of "
564 for(
size_t i=0; i<length; ++i) {
567 G4cout <<
" LambdaPrime table from "
578 G4cout <<
" Used LambdaPrime table of "
725 <<
" E(MeV)= " << finalT/
MeV
727 << lx <<
" (postLambda) "
789 for (
G4int i=0; i<num; ++i) {
806 e += 2.0*electron_mass_c2;
859 if(masterProc && masterProc !=
this) {
return yes; }
869 <<
" in the directory <" << directory
872 G4cout <<
"Fail to store Physics Table for "
875 <<
" in the directory <" << directory
885 G4cout <<
"Physics table prim is stored for "
888 <<
" in the directory <" << directory
891 G4cout <<
"Fail to store Physics Table Prim for "
894 <<
" in the directory <" << directory
908 G4cout <<
"G4VEmProcess::RetrievePhysicsTable() for "
915 ||
particle != part) {
return yes; }
926 G4cout <<
"Lambda table for " << particleName
927 <<
" is Retrieved from <"
933 for(
size_t i=0; i<
n; ++i) {
935 (* theLambdaTable)[i]->SetSpline(
true);
941 G4cout <<
"Lambda table for " << particleName <<
" in file <"
942 << filename <<
"> is not exist"
953 G4cout <<
"Lambda table prim for " << particleName
954 <<
" is Retrieved from <"
960 for(
size_t i=0; i<
n; ++i) {
962 (* theLambdaTablePrim)[i]->SetSpline(
true);
968 G4cout <<
"Lambda table prim for " << particleName <<
" in file <"
969 << filename <<
"> is not exist"
996 if(cross < 0.0) { cross = 0.0; }
1041 G4cout <<
"### G4VEmProcess::FindLambdaMax: "
1052 for (i=0; i<
n; ++i) {
1053 pv = (*theLambdaTable)[i];
1059 for (
size_t j=0; j<nb; ++j) {
1072 <<
" Max CS at i= " << i <<
" emax(MeV)= " << emax/
MeV
1073 <<
" lambda= " << smax <<
G4endl;
1078 for (i=0; i<
n; ++i) {
1079 pv = (*theLambdaTable)[i];
1081 G4int j = (*theDensityIdx)[i];
1116 G4cout <<
"### SetCrossSectionBiasingFactor: for "
1119 <<
" biasFactor= " << f <<
" weightFlag= " << flag
1133 G4cout <<
"### ActivateForcedInteraction: for "
1136 <<
" length(mm)= " << length/
mm
1137 <<
" in G4Region <" << r
1138 <<
"> weightFlag= " << flag
1152 if (0.0 <= factor) {
1161 G4cout <<
"### ActivateSecondaryBiasing: for "
1163 <<
" factor= " << factor
1164 <<
" in G4Region <" << region
1165 <<
"> energyLimit(MeV)= " << energyLimit/
MeV
1175 if(5 < n && n < 10000000) {
1221 G4String ss =
"G4VEmProcess::" + tit;
1223 ed <<
"Parameter is out of range: " << val
1224 <<
" it will have no effect!\n" <<
" Process "
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="", G4bool flag=true)
G4double condition(const G4ErrorSymMatrix &m)
G4PhysicsTable * LambdaTable() const
const std::vector< G4double > * theCutsGamma
const G4VProcess * GetMasterProcess() const
std::vector< G4double > theCrossSectionMax
void DefineMaterial(const G4MaterialCutsCouple *couple)
virtual void PrintInfo()=0
G4int GetParentID() const
G4double GetLambda(G4double &kinEnergy, const G4MaterialCutsCouple *couple)
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4int NumberOfBins() const
G4PhysicsTable * LambdaTablePrim() const
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
const std::vector< G4double > * GetDensityFactors()
static void SetPhysicsVector(G4PhysicsTable *physTable, size_t idx, G4PhysicsVector *vec)
G4int WorkerVerbose() const
G4double MaxKinEnergy() const
static G4LossTableManager * Instance()
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="")
G4double GetMaxEnergy() const
G4double ApplySecondaryBiasing(std::vector< G4DynamicParticle * > &, const G4Track &track, G4VEmModel *currentModel, G4ParticleChangeForGamma *pParticleChange, G4double &eloss, G4int coupleIdx, G4double tcut, G4double safety=0.0)
void UpdateEmModel(const G4String &, G4double, G4double)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
std::ostringstream G4ExceptionDescription
G4PhysicsTable * theLambdaTablePrim
G4double GetKineticEnergy() const
G4double HighEnergyLimit() const
G4VEmProcess(const G4String &name, G4ProcessType type=fElectromagnetic)
const G4DynamicParticle * GetDynamicParticle() const
G4VEmModel * currentModel
G4bool SecondaryBiasingRegion(G4int coupleIdx)
G4double ComputeCrossSectionPerAtom(G4double kineticEnergy, G4double Z, G4double A=0., G4double cut=0.0)
G4VEmModel * EmModel(G4int index=1) const
G4VEmModel * GetModel(G4int, G4bool ver=false)
void DeRegister(G4VEnergyLossProcess *p)
G4double MscThetaLimit() const
const G4ThreeVector & GetPosition() const
G4ParticleChangeForGamma fParticleChange
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
G4TrackStatus GetTrackStatus() const
G4bool ForcedInteractionRegion(G4int coupleIdx)
G4EmParameters * theParameters
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
const std::vector< G4double > * theCutsPositron
virtual void InitialiseProcess(const G4ParticleDefinition *)=0
G4double theNumberOfInteractionLengthLeft
const G4MaterialCutsCouple * currentCouple
G4bool GetFlag(size_t idx) const
void SetTouchableHandle(const G4TouchableHandle &apValue)
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *, const G4Region *)
void ResetForcedInteraction()
G4double GetParentWeight() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
size_t GetVectorLength() const
const G4String & GetParticleSubType() const
const G4Material * baseMaterial
G4PhysicsTable * theLambdaTable
void ClearNumberOfInteractionLengthLeft()
void FillLambdaVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4bool startFromNull=true, G4EmTableType t=fRestricted)
G4double minKinEnergyPrim
G4ProcessManager * GetProcessManager() const
void FillSecondDerivatives()
void UpdateEmModel(const G4String &, G4double, G4double)
G4double GetCurrentLambda(G4double kinEnergy)
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
const G4String & GetParticleName() const
void ActivateSecondaryBiasing(const G4String ®ion, G4double factor, G4double energyLimit)
G4LossTableBuilder * GetTableBuilder()
void SetWeight(G4double aValue)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetCreatorModelIndex(G4int idx)
void Initialise(const G4ParticleDefinition &part, const G4String &procName, G4int verbose)
void SetHighEnergyLimit(G4double)
void SetMinKinEnergyPrim(G4double e)
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *)
G4double MeanFreePath(const G4Track &track)
const G4ParticleDefinition * currentParticle
void SetLambdaBinning(G4int nbins)
void ProposeWeight(G4double finalWeight)
void SetSecondaryWeightByProcess(G4bool)
G4double LambdaFactor() const
void SetEmModel(G4VEmModel *, G4int index=1)
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
virtual G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii)
size_t GetTableSize() const
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=0)
const std::vector< G4int > * theDensityIdx
void SetParticle(const G4ParticleDefinition *p)
G4double GetStepLimit(G4int coupleIdx, G4double previousStep)
G4double currentInteractionLength
void PrintInfoProcess(const G4ParticleDefinition &)
std::vector< G4DynamicParticle * > secParticles
virtual G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
const G4ParticleDefinition * GetParticleDefinition() const
G4LossTableManager * lManager
const G4String & GetParticleType() const
void Register(G4VEnergyLossProcess *p)
const G4ParticleDefinition * secondaryParticle
G4double MinKinEnergy() const
std::vector< G4double > theEnergyOfCrossSectionMax
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetGlobalTime() const
const G4ParticleDefinition * particle
virtual void PreparePhysicsTable(const G4ParticleDefinition &)
G4double Energy(size_t index) const
const std::vector< G4double > * theCuts
const G4String & GetProcessName() const
void AddSecondary(G4Track *aSecondary)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
const G4TouchableHandle & GetTouchableHandle() const
G4bool IsActive(G4double kinEnergy)
void DumpModelList(G4int verb)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
static const G4double emax
void SetMasterThread(G4bool val)
G4double G4Log(G4double x)
std::vector< G4VEmModel * > emModels
void ActivateSecondaryBiasing(const G4String ®ion, G4double factor, G4double energyLimit)
static G4ProductionCutsTable * GetProductionCutsTable()
G4PhysicsVector * LambdaPhysicsVector(const G4MaterialCutsCouple *)
static G4Positron * Positron()
static G4GenericIon * GenericIon()
G4int NumberOfModels() const
const G4Material * currentMaterial
void SetMaxKinEnergy(G4double e)
static const G4double factor
const G4ParticleDefinition * theElectron
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=0)
virtual void ProcessDescription(std::ostream &outFile) const
G4double GetProposedKineticEnergy() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void InitialiseBaseMaterials(G4PhysicsTable *table)
void SetNumberOfSecondaries(G4int totSecondaries)
static G4int Register(const G4String &)
G4double GetLocalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
G4EmModelManager * modelManager
const G4double x[NPOINTSGL]
static G4EmParameters * Instance()
G4VParticleChange * pParticleChange
const G4Element * GetCurrentElement() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void ComputeIntegralLambda(G4double kinEnergy)
G4EmBiasingManager * biasManager
G4double GetSafety() const
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
static G4Electron * Electron()
void SetFluoFlag(G4bool val)
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
G4TrackStatus GetTrackStatus() const
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
const std::vector< G4double > * theDensityFactor
G4VAtomDeexcitation * AtomDeexcitation()
size_t currentCoupleIndex
void SetMinKinEnergy(G4double e)
G4double theInitialNumberOfInteractionLength
void ProposeTrackStatus(G4TrackStatus status)
const std::vector< G4double > * theCutsElectron
void InitializeForPostStep(const G4Track &)
virtual void StartTracking(G4Track *)
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii)
G4double CrossSectionPerVolume(G4double kineticEnergy, const G4MaterialCutsCouple *couple)
void PrintWarning(G4String tit, G4double val)
virtual G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false)
G4int GetProcessSubType() const
G4double preStepKinEnergy
void SetPolarAngleLimit(G4double)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
const G4ParticleDefinition * theGamma
void SetVerboseLevel(G4int value)
const G4ParticleDefinition * thePositron
const G4Material * GetMaterial() const
const std::vector< G4int > * GetCoupleIndexes()
const G4Element * GetCurrentElement() const