95 currentCoupleIndex = 0;
109 currentParticleName=
"";
110 currentMaterialName=
"";
117 isApplicable =
false;
125 for (
G4int i=0; i<nLocalMaterials; ++i) {
126 delete localCouples[i];
137 if(couple && UpdateParticle(p, kinEnergy) ) {
138 res = manager->
GetDEDX(p, kinEnergy, couple);
141 if(FindEmModel(p, currentProcessName, kinEnergy)) {
157 G4cout <<
"G4EmCalculator::GetDEDX: E(MeV)= " << kinEnergy/
MeV
158 <<
" DEDX(MeV/mm)= " << res*
mm/
MeV
162 <<
" isIon= " << isIon
187 if(couple && UpdateParticle(p, kinEnergy)) {
190 G4cout <<
"G4EmCalculator::GetRange: E(MeV)= " << kinEnergy/
MeV
191 <<
" range(mm)= " << res/
mm
209 if(couple && UpdateParticle(p, kinEnergy)) {
212 G4cout <<
"G4EmCalculator::GetRange: E(MeV)= " << kinEnergy/
MeV
213 <<
" range(mm)= " << res/
mm
231 if(couple && UpdateParticle(p, kinEnergy)) {
232 res = manager->
GetRange(p, kinEnergy, couple);
234 G4cout <<
"G4EmCalculator::GetRange: E(MeV)= " << kinEnergy/
MeV
235 <<
" range(mm)= " << res/
mm
286 if(couple && UpdateParticle(p, 1.0*
GeV)) {
287 res = manager->
GetEnergy(p, range, couple);
289 G4cout <<
"G4EmCalculator::GetKinEnergy: Range(mm)= " << range/
mm
290 <<
" KinE(MeV)= " << res/
MeV
319 if(couple && UpdateParticle(p, kinEnergy)) {
321 FindLambdaTable(p, processName, kinEnergy);
325 res = (((*currentLambda)[idx])->Value(e))*chargeSquare;
331 G4cout <<
"G4EmCalculator::GetXSPerVolume: E(MeV)= " << kinEnergy/
MeV
332 <<
" cross(cm-1)= " << res*
cm
336 G4cout <<
" idx= " << idx <<
" Escaled((MeV)= "
337 << kinEnergy*massRatio
338 <<
" q2= " << chargeSquare;
384 if(x > 0.0) { res = 1.0/
x; }
386 G4cout <<
"G4EmCalculator::GetMeanFreePath: E(MeV)= " << kinEnergy/
MeV
387 <<
" MFP(mm)= " << res/
mm
430 G4cout <<
"### G4EmCalculator: Inverse Range Table for "
443 currentMaterial =
mat;
444 currentMaterialName = mat->
GetName();
448 <<
" in " << currentMaterialName
449 <<
" e(MeV)= " << kinEnergy/
MeV <<
" cut(MeV)= " << cut/
MeV
452 if(UpdateParticle(p, kinEnergy)) {
453 if(FindEmModel(p, processName, kinEnergy)) {
454 G4double escaled = kinEnergy*massRatio;
457 mat, baseParticle, escaled, cut) * chargeSquare;
460 <<
" Escaled(MeV)= " << escaled;
464 if(verbose > 1) {
G4cout <<
" no basePart E(MeV)= " << kinEnergy <<
" "; }
468 <<
" DEDX(MeV*cm^2/g)= "
489 G4cout <<
"At boundary energy(MeV)= " << eth/
MeV
490 <<
" DEDX(MeV/mm)= " << res1*
mm/
MeV
498 if(res1 > 0.0 && escaled > 0.0) {
499 res *= (1.0 + (res0/res1 - 1.0)*eth/escaled);
516 G4cout <<
"After Corrections: DEDX(MeV/mm)= " << res*
mm/
MeV
524 G4cout <<
"Sum: E(MeV)= " << kinEnergy/
MeV
525 <<
" DEDX(MeV/mm)= " << res*
mm/
MeV
527 <<
" cut(MeV)= " << cut/
MeV
529 <<
" in " << currentMaterialName
530 <<
" Zi^2= " << chargeSquare
531 <<
" isIon=" << isIon
545 currentMaterial =
mat;
546 currentMaterialName = mat->
GetName();
548 if(UpdateParticle(part, kinEnergy)) {
551 const std::vector<G4VEnergyLossProcess*> vel =
558 for(
G4int i=0; i<
n; ++i) {
561 if(ActiveForParticle(part, p)) {
564 dedx +=
ComputeDEDX(kinEnergy,part,(vel[i])->GetProcessName(),mat,cut);
625 <<
" NuclearDEDX(MeV/mm)= " << res*
mm/
MeV
626 <<
" NuclearDEDX(MeV*cm^2/g)= "
652 currentMaterial =
mat;
653 currentMaterialName = mat->
GetName();
655 if(UpdateParticle(p, kinEnergy)) {
656 if(FindEmModel(p, processName, kinEnergy)) {
659 e *= kinEnergy*massRatio;
661 mat, baseParticle, e, cut, e) * chargeSquare;
666 G4cout <<
"G4EmCalculator::ComputeXSPerVolume: E(MeV)= " << kinEnergy/
MeV
667 <<
" cross(cm-1)= " << res*
cm
668 <<
" cut(keV)= " << cut/
keV
702 if(UpdateParticle(p, kinEnergy)) {
703 if(FindEmModel(p, processName, kinEnergy)) {
706 e *= kinEnergy*massRatio;
709 baseParticle, e, Z, A, cut) * chargeSquare;
716 <<
" cross(barn)= " << res/
barn
718 <<
" Z= " << Z <<
" A= " << A/(
g/
mole) <<
" g/mole"
751 if(res > 0.0) { res = 1.0/res; }
784 if(x > 0.0) { mfp = 1.0/
x; }
787 <<
" MFP(mm)= " << mfp/
mm
815 ConvertRangeToEnergy(part, mat, range);
835 if(p != currentParticle) {
839 dynParticle.
SetDefinition(const_cast<G4ParticleDefinition*>(p));
846 currentProcess = FindEnergyLossProcess(p);
847 currentProcessName =
"";
863 && currentParticleName !=
"deuteron"
864 && currentParticleName !=
"triton"
865 && currentParticleName !=
"alpha+"
866 && currentParticleName !=
"helium"
867 && currentParticleName !=
"hydrogen"
871 baseParticle = theGenericIon;
897 if(name != currentParticleName) {
900 G4cout <<
"### WARNING: G4EmCalculator::FindParticle fails to find "
921 if(name != currentMaterialName) {
923 currentMaterialName =
name;
925 G4cout <<
"### WARNING: G4EmCalculator::FindMaterial fails to find "
928 return currentMaterial;
936 if(reg !=
"" && reg !=
"world") {
950 if(!material)
return 0;
952 currentMaterialName = material->
GetName();
968 if(!material)
return false;
970 currentMaterialName = material->
GetName();
971 for (
G4int i=0; i<nLocalMaterials; ++i) {
972 if(material == localMaterials[i] && cut == localCuts[i]) {
973 currentCouple = localCouples[i];
974 currentCoupleIndex = currentCouple->
GetIndex();
980 localMaterials.push_back(material);
981 localCouples.push_back(cc);
982 localCuts.push_back(cut);
985 currentCoupleIndex = currentCouple->
GetIndex();
997 if (!currentLambda || p != lambdaParticle || processName != lambdaName) {
998 lambdaName = processName;
1003 if(isIon) { part = theGenericIon; }
1006 currentName = processName;
1014 isApplicable =
true;
1016 G4cout <<
"G4VEnergyLossProcess is found out: " << currentName
1024 G4VEmProcess* proc = FindDiscreteProcess(part, processName);
1028 isApplicable =
true;
1030 G4cout <<
"G4VEmProcess is found out: " << currentName <<
G4endl;
1062 isApplicable =
false;
1064 G4cout <<
"G4EmCalculator::FindEmModel WARNING: no particle defined"
1066 return isApplicable;
1070 G4double scaledEnergy = kinEnergy*massRatio;
1071 if(isIon) { part = theGenericIon; }
1074 G4cout <<
"## G4EmCalculator::FindEmModel for " << partname
1076 <<
") and " << processName <<
" at E(MeV)= " << scaledEnergy
1078 if(p != part) {
G4cout <<
" GenericIon is the base particle" <<
G4endl; }
1082 currentName = processName;
1093 if(loweModel == currentModel) { loweModel = 0; }
1099 G4VEmProcess* proc = FindDiscreteProcess(part, processName);
1105 if(loweModel == currentModel) { loweModel = 0; }
1119 if(loweModel == currentModel) { loweModel = 0; }
1120 isApplicable =
true;
1134 G4cout <<
" LowEnergy model <" << loweModel->
GetName() <<
">";
1139 return isApplicable;
1152 && currentParticleName !=
"deuteron"
1153 && currentParticleName !=
"triton"
1154 && currentParticleName !=
"alpha+"
1155 && currentParticleName !=
"helium"
1156 && currentParticleName !=
"hydrogen"
1157 ) { part = theGenericIon; }
1170 const std::vector<G4VEnergyLossProcess*>
v =
1173 for(
G4int i=0; i<
n; ++i) {
1174 if((v[i])->GetProcessName() == processName) {
1176 if(ActiveForParticle(part, p)) {
1192 const std::vector<G4VEmProcess*> v =
1195 for(
G4int i=0; i<
n; ++i) {
1196 if((v[i])->GetProcessName() == processName) {
1198 if(ActiveForParticle(part, p)) {
1214 const std::vector<G4VMultipleScattering*> v =
1217 for(
G4int i=0; i<
n; ++i) {
1218 if((v[i])->GetProcessName() == processName) {
1220 if(ActiveForParticle(part, p)) {
1238 for(
G4int i=0; i<
n; ++i) {
1239 if((*pv)[i] == proc) {
G4PhysicsTable * LambdaTable() const
G4ProductionCuts * GetProductionCuts() const
G4double LowEnergyLimit() const
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4VEmModel * SelectModel(G4double kinEnergy, size_t idx)
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4LossTableManager * Instance()
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
void SetDynamicMassCharge(G4double massratio, G4double charge2ratio)
G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
const G4Material * FindMaterial(const G4String &)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4PhysicsTable * RangeTableForLoss() const
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
const G4String & GetName() const
void PrintRangeTable(const G4ParticleDefinition *)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
virtual G4double GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=0)=0
G4double GetDensity() const
G4double ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, G4double cut=DBL_MAX)
G4double ComputeElectronicDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *mat, G4double cut=DBL_MAX)
G4double EffectiveChargeCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double GetCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=0)
G4double GetMeanFreePath(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=0)
void PrintInverseRangeTable(const G4ParticleDefinition *)
G4double GetRange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
G4ProcessManager * GetProcessManager() const
const std::vector< G4VEmProcess * > & GetEmProcessVector()
const G4String & GetParticleName() const
G4double ComputeShellIonisationCrossSectionPerAtom(const G4String &part, G4int Z, G4AtomicShellEnumerator shell, G4double kinEnergy, const G4Material *mat=0)
G4double GetCSDARange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
static G4RegionStore * GetInstance()
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
G4double GetShellIonisationCrossSectionPerAtom(const G4String &part, G4int Z, G4AtomicShellEnumerator shell, G4double kinEnergy)
G4PhysicsTable * LambdaTable() const
G4IonTable * GetIonTable() const
virtual void InitialiseForMaterial(const G4ParticleDefinition *, const G4Material *)
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * FindCouple(const G4Material *, const G4Region *r=0)
G4PhysicsTable * DEDXTable() const
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)
const G4ParticleDefinition const G4Material *G4double range
G4double NuclearDEDX(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy, G4bool fluct=true)
G4EmCorrections * EmCorrections()
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *)
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
const G4String & GetParticleType() const
const G4ParticleDefinition * BaseParticle() const
G4double GetEnergy(const G4ParticleDefinition *aParticle, G4double range, const G4MaterialCutsCouple *couple)
const G4String & GetProcessName() const
const std::vector< G4VEnergyLossProcess * > & GetEnergyLossProcessVector()
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void SetKineticEnergy(G4double aEnergy)
virtual G4double ComputeShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=0)=0
G4double GetRangeFromRestricteDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
virtual G4double GetChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4VEnergyLossProcess * GetEnergyLossProcess(const G4ParticleDefinition *)
static G4ProductionCutsTable * GetProductionCutsTable()
static G4GenericIon * GenericIon()
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
G4VEmModel * SelectModelForMaterial(G4double kinEnergy, size_t &idxRegion) const
const G4ParticleDefinition * FindParticle(const G4String &)
G4PhysicsTable * InverseRangeTable() const
G4double GetPDGMass() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static G4ParticleTable * GetParticleTable()
G4double ComputeMeanFreePath(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
G4double GetKinEnergy(G4double range, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
const G4Region * FindRegion(const G4String &)
const G4ParticleDefinition * FindIon(G4int Z, G4int A)
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
G4double ComputeGammaAttenuationLength(G4double kinEnergy, const G4Material *)
G4bool GetProcessActivation(G4VProcess *aProcess) const
G4double ComputeCrossSectionPerAtom(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, G4double Z, G4double A, G4double cut=0.0)
const G4String & GetName() const
void SetVerbose(G4int val)
void PrintDEDXTable(const G4ParticleDefinition *)
G4VAtomDeexcitation * AtomDeexcitation()
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4double ComputeEnergyCutFromRangeCut(G4double range, const G4ParticleDefinition *, const G4Material *)
G4double GetPDGCharge() const
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
const std::vector< G4VMultipleScattering * > & GetMultipleScatteringVector()
G4VEmModel * SelectModelForMaterial(G4double kinEnergy, size_t &idx) const
G4ProcessVector * GetProcessList() const