191 for(
auto const & v : *
fXSpeaks) {
delete v; }
220 if(
nullptr == ptr) {
return; }
230 if(
nullptr == ptr) {
return; }
233 for(
auto & em : *
emModels) {
if(em == ptr) {
return; } }
257 G4cout <<
"G4VEnergyLossProcess::PreparePhysicsTable for "
269 if(
pname !=
"deuteron" &&
pname !=
"triton" &&
280 size_t n = v->
size();
281 for(
size_t j=0; j<
n; ++j) {
282 if((*v)[j] ==
this) {
296 G4cout <<
"### G4VEnergyLossProcess::PreparePhysicsTable()"
297 <<
" interrupted for "
388 fXSpeaks =
new std::vector<G4TwoPeaksXS*>;
442 if((*
scoffRegions)[0]->GetName() ==
"DefaultRegionForTheWorld") {
450 G4cout <<
"G4VEnergyLossProcess::PrepearPhysicsTable() is done "
452 <<
" isIon= " <<
isIon;
460 G4cout <<
" SubCut secondary production is ON for regions: " <<
G4endl;
462 const G4Region* r = (*scoffRegions)[i];
466 G4cout <<
" SubCut secondary production is ON for all regions" <<
G4endl;
476 G4cout <<
"### G4VEnergyLossProcess::BuildPhysicsTable() for "
541 num ==
"e+" || num ==
"mu+" ||
542 num ==
"mu-" || num ==
"proton"||
543 num ==
"pi+" || num ==
"pi-" ||
544 num ==
"kaon+" || num ==
"kaon-" ||
545 num ==
"alpha" || num ==
"anti_proton" ||
546 num ==
"GenericIon"|| num ==
"alpha+" )))
563 G4cout <<
"### G4VEnergyLossProcess::BuildPhysicsTable() done for "
576 G4cout <<
"G4VEnergyLossProcess::BuildDEDXTable() of type " << tType
592 G4cout <<
"G4VEnergyLossProcess::BuildDEDXTable WARNING: wrong type "
602 G4cout << numOfCouples <<
" materials"
604 <<
" maxKinEnergy= " <<
emax
606 <<
" EmTableType= " << tType
607 <<
" table= " << table <<
" " <<
this
610 if(
nullptr == table) {
return table; }
616 for(
size_t i=0; i<numOfCouples; ++i) {
619 G4cout <<
"G4VEnergyLossProcess::BuildDEDXVector Idx= " << i
620 <<
" flagTable= " << table->
GetFlag(i)
628 if(
nullptr != (*table)[i]) {
delete (*table)[i]; }
629 if(
nullptr != bVector) {
645 G4cout <<
"G4VEnergyLossProcess::BuildDEDXTable(): table is built for "
664 G4cout <<
"G4VEnergyLossProcess::BuildLambdaTable WARNING: wrong type "
669 G4cout <<
"G4VEnergyLossProcess::BuildLambdaTable() of type "
670 << tType <<
" for process "
673 <<
" EmTableType= " << tType
674 <<
" table= " << table
677 if(
nullptr == table) {
return table; }
688 for(
size_t i=0; i<numOfCouples; ++i) {
720 G4cout <<
"Lambda table is built for "
734 out << std::setprecision(6);
739 <<
" dE/dx and range tables from "
743 <<
" Lambda tables from threshold to "
746 <<
" bins/decade, spline: " <<
spline
759 out <<
" CSDA range table up"
770 out << (*theDEDXTable) <<
G4endl;
771 out <<
"non restricted DEDXTable address= "
774 out << (*theDEDXunRestrictedTable) <<
G4endl;
778 out << (*theCSDARangeTable) <<
G4endl;
783 out << (*theRangeTableForLoss) <<
G4endl;
788 out << (*theInverseRangeTable) <<
G4endl;
792 out << (*theLambdaTable) <<
G4endl;
807 if (
reg == r) {
return; }
822 if(r ==
reg) {
return true; }
977 G4cout <<
"G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength ";
985 <<
"InteractionLength= " << x/
cm <<
"[cm] " <<
G4endl;
1174 tcut, tmax, length, eloss);
1203 if(eloss >= esecfluo) {
1274 for(
G4int i=0; i<
n; ++i) {
1396 for (
G4int i=0; i<num; ++i) {
1407 }
else if(i < num0 + n1) {
1493 G4cout <<
"G4VEnergyLossProcess::RetrievePhysicsTable() for "
1522 "InverseRange",fpi))
1540 if (
nullptr != aTable) {
1562 G4bool isRetrieved =
false;
1564 if(
nullptr != aTable) {
1569 for(
auto & v : *aTable) {
1570 if(
nullptr != v) { v->FillSecondDerivatives(); }
1575 <<
" is Retrieved from <" << filename <<
">"
1581 if(mandatory && !isRetrieved) {
1585 << filename <<
"> is not Retrieved"
1642 return (0.0 < cs) ? 1.0/cs :
DBL_MAX;
1724 G4cout <<
"### Set CSDA Range table " << p
1736 G4cout <<
"### Set Range table " << p
1748 G4cout <<
"### Set SecondaryRange table " << p
1760 G4cout <<
"### Set InverseRange table " << p
1771 G4cout <<
"### Set Lambda table " << p
1788 G4double e, ss, xs, ee, e1peak, xs1peak, e1deep, e2peak, e2deep, xs2peak;
1791 for (
size_t i=0; i<
n; ++i) {
1793 ee = xs = xs1peak = xs2peak = 0.0;
1794 e1peak = e1deep = e2peak = e2deep =
DBL_MAX;
1797 for (
size_t j=0; j<nb; ++j) {
1856 <<
" index= " << i <<
" data:\n" <<
" E1peak=" << e1peak
1857 <<
" xs1= " << xs1peak <<
" E1deep=" << e1deep
1858 <<
" E2peak=" << e2peak <<
" xs2=" << xs2peak
1859 <<
" E2deep=" << e2deep <<
G4endl;
1863 for (
size_t i=0; i<
n; ++i) {
1865 if (
nullptr == pv) {
1866 G4int j = (*theDensityIdx)[i];
1905 G4cout <<
"### SetCrossSectionBiasingFactor: for "
1907 <<
" biasFactor= " << f <<
" weightFlag= " << flag
1921 G4cout <<
"### ActivateForcedInteraction: for "
1923 <<
" length(mm)= " << length/
mm
1924 <<
" in G4Region <" << region
1925 <<
"> weightFlag= " << flag
1939 if (0.0 <= factor) {
1947 G4cout <<
"### ActivateSecondaryBiasing: for "
1949 <<
" factor= " << factor
1950 <<
" in G4Region <" << region
1951 <<
"> energyLimit(MeV)= " << energyLimit/
MeV
1969 if(0.0 < val && val < 1.0) {
1979 if(0.0 < v1 && 0.0 < v2) {
2000 if(2 <
n &&
n < 1000000000) {
2034 G4String ss =
"G4VEnergyLossProcess::" + tit;
2036 ed <<
"Parameter is out of range: " << val
2037 <<
" it will have no effect!\n" <<
" Process "
static const G4double e1[44]
static const G4double emax
static const G4double reg
G4double condition(const G4ErrorSymMatrix &m)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
@ NotCandidateForSelection
G4double G4Log(G4double x)
static constexpr double mm
static constexpr double keV
static constexpr double GeV
static constexpr double MeV
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
G4double GetLogKineticEnergy() 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)
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fm, const G4Region *r)
void DumpModelList(std::ostream &out, G4int verb)
G4int NumberOfModels() const
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double, G4int verb)
void FillLambdaVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4bool startFromNull=true, G4EmTableType t=fRestricted)
void FillDEDXVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4EmTableType t=fRestricted)
G4VEmModel * GetModel(G4int idx, G4bool ver=false)
G4bool IsPrintLocked() const
void DefineRegParamForLoss(G4VEnergyLossProcess *) const
void FillStepFunction(const G4ParticleDefinition *, G4VEnergyLossProcess *) const
static G4EmParameters * Instance()
G4int NumberOfBins() const
G4double MinKinEnergy() const
G4int NumberOfBinsPerDecade() const
G4bool BuildCSDARange() const
G4bool LossFluctuation() const
G4bool UseCutAsFinalRange() const
G4int WorkerVerbose() const
G4double MaxKinEnergy() const
G4double MaxEnergyForCSDARange() const
G4bool UseAngularGeneratorForIonisation() const
G4double LinearLossLimit() const
G4double LowestMuHadEnergy() const
G4double LambdaFactor() const
G4double LowestElectronEnergy() const
G4Region * GetRegion() const
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()
void LocalPhysicsTables(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
G4LossTableBuilder * GetTableBuilder()
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
void BuildPhysicsTable(const G4ParticleDefinition *aParticle)
G4VSubCutProducer * SubCutProducer()
void DeRegister(G4VEnergyLossProcess *p)
void Register(G4VEnergyLossProcess *p)
G4VAtomDeexcitation * AtomDeexcitation()
void RegisterExtraParticle(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
const G4Material * GetMaterial() const
G4ProductionCuts * GetProductionCuts() const
const G4String & GetName() const
void InitializeForPostStep(const G4Track &)
void InitializeForAlongStep(const G4Track &)
G4double GetProposedKineticEnergy() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedCharge(G4double theCharge)
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleType() const
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii, G4bool spline)
static void SetPhysicsVector(G4PhysicsTable *physTable, std::size_t idx, G4PhysicsVector *vec)
G4bool GetFlag(std::size_t i) const
G4bool ExistPhysicsTable(const G4String &fileName) const
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
std::size_t length() 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 * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4double GetProductionCut(G4int index) const
const G4String & GetName() const
G4double GetSafety() const
G4double GetStepLength() const
G4StepPoint * GetPostStepPoint() const
const G4ParticleDefinition * GetParticleDefinition() const
G4VPhysicalVolume * GetVolume() const
void SetWeight(G4double aValue)
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetGlobalTime() const
G4Material * GetMaterial() const
G4ParticleDefinition * GetDefinition() const
const G4DynamicParticle * GetDynamicParticle() const
const G4TouchableHandle & GetTouchableHandle() const
G4double GetKineticEnergy() const
void SetCreatorModelID(const G4int id)
G4int GetParentID() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
static G4TransportationManager * GetTransportationManager()
G4SafetyHelper * GetSafetyHelper() const
void AlongStepDeexcitation(std::vector< G4Track * > &tracks, const G4Step &step, G4double &eLoss, G4int coupleIndex)
G4bool IsPIXEActive() const
virtual G4double Dispersion(const G4Material *, const G4DynamicParticle *, const G4double tcut, const G4double tmax, const G4double length)=0
virtual G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double tcut, const G4double tmax, const G4double length, const G4double meanLoss)=0
virtual void FillNumberOfSecondaries(G4int &numberOfTriplets, G4int &numberOfRecoil)
void SetHighEnergyLimit(G4double)
void SetMasterThread(G4bool val)
G4VEmFluctuationModel * GetModelOfFluctuations()
virtual G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
const G4Element * GetCurrentElement() const
void SetAngularGeneratorFlag(G4bool)
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
G4double HighEnergyLimit() const
G4bool IsActive(G4double kinEnergy) const
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double &length, G4double &eloss)
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)
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
virtual G4double ChargeSquareRatio(const G4Track &)
G4double GetDEDXForScaledEnergy(G4double scaledKinE)
G4double ScaledKinEnergyForLoss(G4double range)
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=nullptr, const G4Region *region=nullptr)
G4CrossSectionType fXSType
G4PhysicsTable * RangeTableForLoss() const
const G4ParticleDefinition * theGamma
G4bool UseBaseMaterial() const
G4double GetContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety) override
void SetMaxKinEnergy(G4double e)
G4bool lossFluctuationFlag
G4ParticleChangeForLoss fParticleChange
void PreparePhysicsTable(const G4ParticleDefinition &) override
G4PhysicsTable * theDEDXTable
G4PhysicsTable * InverseRangeTable() const
G4double MeanFreePath(const G4Track &track)
const G4DataVector * theCuts
G4double preStepLogScaledEnergy
G4PhysicsTable * CSDARangeTable() const
G4PhysicsTable * theIonisationTable
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition *, const G4ParticleDefinition *)=0
void SelectModel(G4double kinEnergy)
void SetRangeTableForLoss(G4PhysicsTable *p)
const G4ParticleDefinition * baseParticle
G4PhysicsTable * theInverseRangeTable
G4PhysicsVector * LambdaPhysicsVector(const G4MaterialCutsCouple *, G4double cut)
void ProcessDescription(std::ostream &outFile) const override
const G4ParticleDefinition * thePositron
G4double GetScaledRangeForScaledEnergy(G4double scaledKinE)
G4PhysicsTable * BuildDEDXTable(G4EmTableType tType=fRestricted)
G4VEmModel * GetModelByIndex(size_t idx=0, G4bool ver=false) const
const G4MaterialCutsCouple * currentCouple
const G4ParticleDefinition * theGenericIon
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *, G4double cut)
G4double preStepScaledEnergy
void ActivateSecondaryBiasing(const G4String ®ion, G4double factor, G4double energyLimit)
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
const G4Element * GetCurrentElement() const
void SetDEDXBinning(G4int nbins)
void SetStepFunction(G4double v1, G4double v2)
G4VSubCutProducer * subcutProducer
void SetEmModel(G4VEmModel *, G4int index=0)
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
const G4Material * currentMaterial
G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
void FillSecondariesAlongStep(G4double weight)
G4EmModelManager * modelManager
G4double ContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety)
std::vector< G4TwoPeaksXS * > * TwoPeaksXS() const
G4VEmFluctuationModel * fluctModel
G4EmParameters * theParameters
G4PhysicsTable * SecondaryRangeTable() const
const std::vector< G4double > * theDensityFactor
void StreamInfo(std::ostream &out, const G4ParticleDefinition &part, G4bool rst=false) const
G4PhysicsTable * theRangeTableForLoss
void SetInverseRangeTable(G4PhysicsTable *p)
G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
G4bool StoreTable(const G4ParticleDefinition *p, G4PhysicsTable *, G4bool ascii, const G4String &directory, const G4String &tname)
void ActivateForcedInteraction(G4double length, const G4String ®ion, G4bool flag=true)
void SetDynamicMassCharge(G4double massratio, G4double charge2ratio)
G4GPILSelection aGPILSelection
size_t currentCoupleIndex
std::vector< const G4Region * > * scoffRegions
std::vector< G4TwoPeaksXS * > * fXSpeaks
G4bool IsIonisationProcess() const
G4PhysicsTable * theLambdaTable
G4double CrossSectionPerVolume(G4double kineticEnergy, const G4MaterialCutsCouple *couple)
const std::vector< G4int > * theDensityIdx
void SetDEDXTable(G4PhysicsTable *p, G4EmTableType tType)
void SetTwoPeaksXS(std::vector< G4TwoPeaksXS * > *p)
void SetSecondaryRangeTable(G4PhysicsTable *p)
G4PhysicsTable * BuildLambdaTable(G4EmTableType tType=fRestricted)
G4double maxKinEnergyCSDA
G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
~G4VEnergyLossProcess() override
void SetIonisation(G4bool val)
G4bool IsRegionForCubcutProcessor(const G4Track &aTrack)
void DefineMaterial(const G4MaterialCutsCouple *couple)
std::vector< G4Track * > scTracks
G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety, G4GPILSelection *selection) override
void SetLinearLossLimit(G4double val)
void SetLowestEnergyLimit(G4double)
G4bool RetrieveTable(const G4ParticleDefinition *p, G4PhysicsTable *, G4bool ascii, const G4String &directory, const G4String &tname, G4bool mandatory)
G4EmBiasingManager * biasManager
void SetLambdaTable(G4PhysicsTable *p)
const G4ParticleDefinition * secondaryParticle
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4VEnergyLossProcess(const G4String &name="EnergyLoss", G4ProcessType type=fElectromagnetic)
G4VEmModel * currentModel
G4PhysicsTable * theSecondaryRangeTable
G4double preStepKinEnergy
G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &) override
G4VAtomDeexcitation * atomDeexcitation
G4PhysicsTable * theDEDXunRestrictedTable
std::vector< G4VEmModel * > * emModels
G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple, const G4DynamicParticle *dp, G4double length)
G4PhysicsTable * IonisationTable() const
void ActivateSubCutoff(const G4Region *region)
void PrintWarning(const G4String &, G4double val) const
G4PhysicsTable * LambdaTable() const
void SetCSDARangeTable(G4PhysicsTable *pRange)
const G4ParticleDefinition * particle
void ComputeLambdaForScaledEnergy(G4double scaledKinE, G4double logScaledKinE)
G4double preStepLogKinEnergy
G4PhysicsTable * DEDXunRestrictedTable() const
const G4ParticleDefinition * theElectron
G4double GetLambdaForScaledEnergy(G4double scaledKinE)
G4PhysicsTable * theCSDARangeTable
G4LossTableManager * lManager
virtual void StreamProcessInfo(std::ostream &) const
G4SafetyHelper * safetyHelper
G4PhysicsTable * DEDXTable() const
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
void StartTracking(G4Track *) override
void SetMinKinEnergy(G4double e)
std::vector< G4DynamicParticle * > secParticles
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
G4LogicalVolume * GetLogicalVolume() 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
virtual void SampleSecondaries(const G4Step &step, std::vector< G4Track * > &tracks, G4double &eloss, G4double cut) const =0
static constexpr double mm
static constexpr double proton_mass_c2
static constexpr double TeV
static constexpr double GeV
static constexpr double keV
static constexpr double MeV
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)