86 minKinEnergy = 0.1*CLHEP::keV;
87 maxKinEnergy = 100.0*CLHEP::TeV;
90 invLambdaFactor = 1.0/lambdaFactor;
128 if(
nullptr == ptr) {
return; }
130 modelManager->
AddEmModel(order, ptr, fm, region);
138 if(
nullptr == ptr) {
return; }
139 if(!emModels.empty()) {
140 for(
auto & em : emModels) {
if(em == ptr) {
return; } }
142 emModels.push_back(ptr);
155 if(pname !=
"deuteron" && pname !=
"triton" &&
156 pname !=
"alpha" && pname !=
"alpha+" &&
157 pname !=
"helium" && pname !=
"hydrogen") {
163 if(particle != &part) {
return; }
182 if(!actMinKinEnergy) { minKinEnergy = theParameters->
MinKinEnergy(); }
183 if(!actMaxKinEnergy) { maxKinEnergy = theParameters->
MaxKinEnergy(); }
187 invLambdaFactor = 1.0/lambdaFactor;
197 if(buildLambdaTable) {
202 if(minKinEnergyPrim < maxKinEnergy) {
203 theLambdaTablePrim = theData->
MakeTable(1);
210 currentModel = modelManager->
GetModel(0);
222 modelManager, maxKinEnergy,
231 if(
nullptr == masterProc) {
237 G4bool toBuild = (buildLambdaTable || minKinEnergyPrim < maxKinEnergy);
251 if(actBinning) { nbin = std::max(nbin, nLambdaBins); }
252 scale = nbin/
G4Log(scale);
256 bld, theLambdaTable, theLambdaTablePrim,
257 minKinEnergy, minKinEnergyPrim,
259 startFromNull, splineFlag);
268 out << std::setprecision(6);
273 if(fXSType !=
fEmNoIntegral) { out <<
" XStype:" << fXSType; }
274 if(applyCuts) { out <<
" applyCuts:1 "; }
276 if(biasFactor != 1.0) { out <<
" BiasingFactor= " << biasFactor; }
277 out <<
" BuildTable=" << buildLambdaTable <<
G4endl;
278 if(buildLambdaTable) {
279 if(particle == &part) {
280 for(
auto & v : *theLambdaTable) {
282 out <<
" Lambda table from ";
286 if(emin > minKinEnergy) { out <<
"threshold "; }
290 <<
", " <<
G4lrint(nbin/std::log10(emax/emin))
291 <<
" bins/decade, spline: "
297 out <<
" Used Lambda table of "
301 if(minKinEnergyPrim < maxKinEnergy) {
302 if(particle == &part) {
303 for(
auto & v : *theLambdaTablePrim) {
305 out <<
" LambdaPrime table from "
309 <<
" in " << v->GetVectorLength()-1
315 out <<
" Used LambdaPrime table of "
323 out <<
" LambdaTable address= " << theLambdaTable <<
G4endl;
324 if(theLambdaTable && particle == &part) {
325 out << (*theLambdaTable) <<
G4endl;
339 if(isIon) { massRatio = proton_mass_c2/currentParticle->
GetPDGMass(); }
370 if(!currentModel->
IsActive(scaledEnergy)) {
446 const G4double e1 = std::max(epeak, e*lambdaFactor);
481 const G4double scaledEnergy = finalT*massRatio;
489 const G4double lx = std::max(GetCurrentLambda(finalT, logFinalT), 0.0);
495 <<
" < " << lx <<
" (postLambda) " <<
G4endl;
508 weight /= biasFactor;
514 G4cout <<
"G4VEmProcess::PostStepDoIt: Sample secondary; E= "
559 for (
G4int i=0; i<num; ++i) {
569 }
else if (p == theElectron) {
572 }
else if (p == thePositron) {
576 e += 2.0*electron_mass_c2;
643 if(!
isTheMaster || part != particle) {
return true; }
648 directory,
"LambdaPrim",
661 if(!
isTheMaster || part != particle) {
return true; }
663 if(buildLambdaTable) {
668 if(yes && minKinEnergyPrim < maxKinEnergy) {
682 return GetCurrentLambda(kinEnergy,
G4Log(kinEnergy));
702 return (currentModel) ?
714 nLambdaBins, splineFlag);
722 return (
nullptr != currentModel) ?
730 return (
nullptr != currentModel) ?
738 return (
nullptr != currentModel) ?
750 G4cout <<
"### SetCrossSectionBiasingFactor: for "
753 <<
" biasFactor= " << f <<
" weightFlag= " << flag
767 G4cout <<
"### ActivateForcedInteraction: for "
770 <<
" length(mm)= " << length/mm
771 <<
" in G4Region <" << r
772 <<
"> weightFlag= " << flag
795 G4cout <<
"### ActivateSecondaryBiasing: for "
797 <<
" factor= " << factor
798 <<
" in G4Region <" << region
799 <<
"> energyLimit(MeV)= " << energyLimit/MeV
809 if(5 < n && n < 10000000) {
814 PrintWarning(
"SetLambdaBinning", e);
822 if(1.e-3*eV < e && e < maxKinEnergy) {
824 /
G4Log(maxKinEnergy/minKinEnergy));
826 actMinKinEnergy =
true;
827 }
else { PrintWarning(
"SetMinKinEnergy", e); }
834 if(minKinEnergy < e && e < 1.e+6*TeV) {
836 /
G4Log(maxKinEnergy/minKinEnergy));
838 actMaxKinEnergy =
true;
839 }
else { PrintWarning(
"SetMaxKinEnergy", e); }
847 e <= theParameters->
MaxKinEnergy()) { minKinEnergyPrim = e; }
848 else { PrintWarning(
"SetMinKinEnergyPrim", e); }
869 G4String ss =
"G4VEmProcess::" + tit;
871 ed <<
"Parameter is out of range: " << val
872 <<
" it will have no effect!\n" <<
" Process "
883 if(
nullptr != particle) {
G4double condition(const G4ErrorSymMatrix &m)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Log(G4double x)
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
G4VEmModel * GetModel(G4int idx, G4bool ver=false) const
void SetFluoFlag(G4bool val)
G4bool IsPrintLocked() const
static G4EmParameters * Instance()
G4int NumberOfBins() const
G4double MinKinEnergy() const
G4int NumberOfBinsPerDecade() const
G4double MscThetaLimit() const
void DefineRegParamForEM(G4VEmProcess *) const
G4double MaxKinEnergy() const
G4double LambdaFactor() const
static void BuildEmProcess(G4VEmProcess *proc, const G4VEmProcess *masterProc, const G4ParticleDefinition *firstPart, const G4ParticleDefinition *part, const G4int nModels, const G4int verb, const G4bool master, const G4bool isLocked, const G4bool toBuild, G4bool &baseMat)
static G4bool RetrieveTable(G4VProcess *ptr, const G4ParticleDefinition *part, G4PhysicsTable *aTable, const G4String &dir, const G4String &tname, const G4int verb, const G4bool ascii, const G4bool spline)
static const G4DataVector * PrepareEmProcess(G4VEmProcess *proc, const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4EmModelManager *modelManager, const G4double &maxKinEnergy, G4int &secID, G4int &tripletID, G4int &mainSec, const G4int &verb, const G4bool &master)
static G4bool StoreTable(G4VProcess *, const G4ParticleDefinition *, G4PhysicsTable *, const G4String &dir, const G4String &tname, G4int verb, G4bool ascii)
static void BuildLambdaTable(G4VEmProcess *proc, const G4ParticleDefinition *part, G4EmModelManager *modelManager, G4LossTableBuilder *bld, G4PhysicsTable *theLambdaTable, G4PhysicsTable *theLambdaTablePrim, const G4double minKinEnergy, const G4double minKinEnergyPrim, const G4double maxKinEnergy, const G4double scale, const G4int verbose, const G4bool startFromNull, const G4bool splineFlag)
static G4GenericIon * GenericIon()
G4bool GetBaseMaterialFlag()
const std::vector< G4double > * GetDensityFactors() const
const std::vector< G4int > * GetCoupleIndexes() const
void InitialiseBaseMaterials(const G4PhysicsTable *table=nullptr)
static G4LossTableManager * Instance()
G4LossTableBuilder * GetTableBuilder()
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
void DeRegister(G4VEnergyLossProcess *p)
void Register(G4VEnergyLossProcess *p)
G4VAtomDeexcitation * AtomDeexcitation()
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 G4Positron * Positron()
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) 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)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4double LowEnergyLimit() const
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
G4double HighEnergyLimit() const
const G4Isotope * GetCurrentIsotope(const G4Element *elm=nullptr) 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
const G4Element * GetCurrentElement(const G4Material *mat=nullptr) const
void DefineMaterial(const G4MaterialCutsCouple *couple)
G4double MeanFreePath(const G4Track &track)
G4PhysicsVector * LambdaPhysicsVector(const G4MaterialCutsCouple *)
void CurrentSetup(const G4MaterialCutsCouple *, G4double energy)
virtual void StreamProcessInfo(std::ostream &) const
G4VEmProcess(const G4String &name, G4ProcessType type=fElectromagnetic)
G4VEmModel * SelectModel(G4double kinEnergy, size_t)
G4EmBiasingManager * biasManager
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4double preStepLogKinEnergy
G4double ComputeCrossSectionPerAtom(G4double kineticEnergy, G4double Z, G4double A=0., G4double cut=0.0)
std::vector< G4double > * theEnergyOfCrossSectionMax
void SetMinKinEnergy(G4double e)
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
void StartTracking(G4Track *) override
G4double GetCrossSection(const G4double kinEnergy, const G4MaterialCutsCouple *couple) 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)
G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
void ProcessDescription(std::ostream &outFile) const override
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
const G4Element * GetTargetElement() const
virtual G4VEmProcess * GetEmProcess(const G4String &name)
G4double MaxKinEnergy() const
const G4Isotope * GetTargetIsotope() const
std::vector< G4DynamicParticle * > secParticles
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="", G4bool flag=true)
const G4MaterialCutsCouple * currentCouple
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
size_t currentCoupleIndex
G4ParticleChangeForGamma fParticleChange
void SetParticle(const G4ParticleDefinition *p)
void SetMinKinEnergyPrim(G4double e)
void PreparePhysicsTable(const G4ParticleDefinition &) override
void SetMaxKinEnergy(G4double e)
const G4Material * currentMaterial
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 & GetProcessName() const