- Timestamp:
- Apr 6, 2009, 12:21:12 PM (17 years ago)
- Location:
- trunk/source/processes
- Files:
-
- 445 edited
-
cuts/History (modified) (2 diffs)
-
cuts/include/G4MCCIndexConversionTable.hh (modified) (1 diff)
-
cuts/include/G4MaterialCutsCouple.hh (modified) (1 diff)
-
cuts/include/G4PhysicsTableHelper.hh (modified) (1 diff)
-
cuts/include/G4ProductionCuts.hh (modified) (1 diff)
-
cuts/include/G4ProductionCutsTable.hh (modified) (5 diffs)
-
cuts/include/G4RToEConvForAntiNeutron.hh (modified) (1 diff)
-
cuts/include/G4RToEConvForAntiProton.hh (modified) (1 diff)
-
cuts/include/G4RToEConvForElectron.hh (modified) (1 diff)
-
cuts/include/G4RToEConvForGamma.hh (modified) (1 diff)
-
cuts/include/G4RToEConvForNeutron.hh (modified) (1 diff)
-
cuts/include/G4RToEConvForPositron.hh (modified) (1 diff)
-
cuts/include/G4RToEConvForProton.hh (modified) (1 diff)
-
cuts/include/G4VRangeToEnergyConverter.hh (modified) (1 diff)
-
cuts/src/G4MCCIndexConversionTable.cc (modified) (1 diff)
-
cuts/src/G4MaterialCutsCouple.cc (modified) (1 diff)
-
cuts/src/G4PhysicsTableHelper.cc (modified) (1 diff)
-
cuts/src/G4ProductionCuts.cc (modified) (1 diff)
-
cuts/src/G4ProductionCutsTable.cc (modified) (11 diffs)
-
cuts/src/G4RToEConvForAntiNeutron.cc (modified) (1 diff)
-
cuts/src/G4RToEConvForAntiProton.cc (modified) (1 diff)
-
cuts/src/G4RToEConvForElectron.cc (modified) (1 diff)
-
cuts/src/G4RToEConvForGamma.cc (modified) (1 diff)
-
cuts/src/G4RToEConvForNeutron.cc (modified) (1 diff)
-
cuts/src/G4RToEConvForPositron.cc (modified) (1 diff)
-
cuts/src/G4RToEConvForProton.cc (modified) (1 diff)
-
cuts/src/G4VRangeToEnergyConverter.cc (modified) (3 diffs)
-
decay/History (modified) (2 diffs)
-
decay/include/G4Decay.hh (modified) (3 diffs)
-
decay/include/G4UnknownDecay.hh (modified) (1 diff)
-
decay/include/G4VExtDecayer.hh (modified) (1 diff)
-
decay/src/G4Decay.cc (modified) (6 diffs)
-
decay/src/G4DecayWithSpin.cc (modified) (4 diffs)
-
decay/src/G4PionDecayMakeSpin.cc (modified) (1 diff)
-
decay/src/G4UnknownDecay.cc (modified) (3 diffs)
-
electromagnetic/GNUmakefile (modified) (2 diffs)
-
electromagnetic/highenergy/GNUmakefile (modified) (2 diffs)
-
electromagnetic/highenergy/History (modified) (2 diffs)
-
electromagnetic/highenergy/include/G4AnnihiToMuPair.hh (modified) (1 diff)
-
electromagnetic/highenergy/include/G4BetheBlochNoDeltaModel.hh (modified) (3 diffs)
-
electromagnetic/highenergy/include/G4BraggNoDeltaModel.hh (modified) (3 diffs)
-
electromagnetic/highenergy/include/G4GammaConversionToMuons.hh (modified) (1 diff)
-
electromagnetic/highenergy/include/G4Vee2hadrons.hh (modified) (4 diffs)
-
electromagnetic/highenergy/include/G4eeCrossSections.hh (modified) (3 diffs)
-
electromagnetic/highenergy/include/G4eeToHadrons.hh (modified) (4 diffs)
-
electromagnetic/highenergy/include/G4eeToHadronsModel.hh (modified) (6 diffs)
-
electromagnetic/highenergy/include/G4eeToHadronsMultiModel.hh (modified) (6 diffs)
-
electromagnetic/highenergy/include/G4eeToTwoPiModel.hh (modified) (4 diffs)
-
electromagnetic/highenergy/include/G4hhIonisation.hh (modified) (3 diffs)
-
electromagnetic/highenergy/include/G4mplIonisation.hh (modified) (3 diffs)
-
electromagnetic/highenergy/include/G4mplIonisationModel.hh (modified) (2 diffs)
-
electromagnetic/highenergy/src/G4AnnihiToMuPair.cc (modified) (3 diffs)
-
electromagnetic/highenergy/src/G4BetheBlochNoDeltaModel.cc (modified) (3 diffs)
-
electromagnetic/highenergy/src/G4BraggNoDeltaModel.cc (modified) (3 diffs)
-
electromagnetic/highenergy/src/G4GammaConversionToMuons.cc (modified) (6 diffs)
-
electromagnetic/highenergy/src/G4eeCrossSections.cc (modified) (10 diffs)
-
electromagnetic/highenergy/src/G4eeToHadrons.cc (modified) (3 diffs)
-
electromagnetic/highenergy/src/G4eeToHadronsModel.cc (modified) (4 diffs)
-
electromagnetic/highenergy/src/G4eeToHadronsMultiModel.cc (modified) (6 diffs)
-
electromagnetic/highenergy/src/G4eeToTwoPiModel.cc (modified) (6 diffs)
-
electromagnetic/highenergy/src/G4hhIonisation.cc (modified) (6 diffs)
-
electromagnetic/highenergy/src/G4mplIonisation.cc (modified) (4 diffs)
-
electromagnetic/highenergy/src/G4mplIonisationModel.cc (modified) (4 diffs)
-
electromagnetic/lowenergy/GNUmakefile (modified) (3 diffs)
-
electromagnetic/lowenergy/History (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4AtomicDeexcitation.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4AtomicShell.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4AtomicTransitionManager.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4AugerData.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4BremsstrahlungParameters.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4CompositeEMDataSet.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionChargeDecrease.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionChargeDecreasePartial.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionChargeIncrease.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionChargeIncreasePartial.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionElasticScreenedRutherford.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4CrossSectionExcitationBorn.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionExcitationBornPartial.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionExcitationEmfietzoglou.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionExcitationEmfietzoglouPartial.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionExcitationMillerGreen.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionExcitationMillerGreenPartial.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionHandler.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4CrossSectionIonisationBorn.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionIonisationBornElectron.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4CrossSectionIonisationBornPartial.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionIonisationBornPartialElectron.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4CrossSectionIonisationRudd.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionIonisationRuddPartial.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4CrossSectionKill.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4DNACrossSectionDataSet.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4DNAGenericIonsManager.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4DNAProcess.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4DNAProcess.icc (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4DummyFinalState.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4EMDataSet.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4FinalStateChargeDecrease.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4FinalStateChargeIncrease.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4FinalStateElasticBrennerZaider.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4FinalStateElasticScreenedRutherford.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4FinalStateExcitationBorn.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4FinalStateExcitationEmfietzoglou.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4FinalStateExcitationMillerGreen.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4FinalStateIonisationBorn.hh (modified) (5 diffs)
-
electromagnetic/lowenergy/include/G4FinalStateIonisationRudd.hh (modified) (5 diffs)
-
electromagnetic/lowenergy/include/G4FinalStateKill.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4FinalStateProduct.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4FluoTransition.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4LinInterpolation.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4LogLogInterpolation.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4LowEnergyBremsstrahlung.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4LowEnergyCompton.hh (modified) (4 diffs)
-
electromagnetic/lowenergy/include/G4LowEnergyGammaConversion.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4LowEnergyIonisation.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4LowEnergyPhotoElectric.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4LowEnergyPolarizedCompton.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4LowEnergyPolarizedRayleigh.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4LowEnergyRayleigh.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4PenelopeBremsstrahlung.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4PenelopeBremsstrahlungAngular.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4PenelopeBremsstrahlungContinuous.hh (modified) (4 diffs)
-
electromagnetic/lowenergy/include/G4PenelopeCompton.hh (modified) (4 diffs)
-
electromagnetic/lowenergy/include/G4PenelopeGammaConversion.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4PenelopeIonisation.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4PenelopePhotoElectric.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4PenelopeRayleigh.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4RangeNoTest.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4RangeTest.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4SemiLogInterpolation.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4ShellData.hh (modified) (4 diffs)
-
electromagnetic/lowenergy/include/G4ShellEMDataSet.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4VCrossSectionHandler.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4VDataSetAlgorithm.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4VEMDataSet.hh (modified) (2 diffs)
-
electromagnetic/lowenergy/include/G4VLowEnergyDiscretePhotonProcess.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4VLowEnergyTestableDiscreteProcess.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4VRangeTest.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4VeLowEnergyLoss.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4WaterExcitationStructure.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4WaterIonisationStructure.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4eBremsstrahlungSpectrum.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4eCrossSectionExcitationEmfietzoglou.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4eCrossSectionScreenedRutherford.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4eIonisationCrossSectionHandler.hh (modified) (3 diffs)
-
electromagnetic/lowenergy/include/G4eIonisationParameters.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4eIonisationSpectrum.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4eLowEnergyLoss.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4eLowEnergyLoss.icc (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4hLowEnergyLoss.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4hLowEnergyLoss.icc (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4hShellCrossSectionDoubleExp.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4hShellCrossSectionDoubleExpData.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4hShellCrossSectionExp.hh (modified) (1 diff)
-
electromagnetic/lowenergy/include/G4hShellCrossSectionExpData.hh (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4AtomicDeexcitation.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4AtomicShell.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4AtomicTransitionManager.cc (modified) (3 diffs)
-
electromagnetic/lowenergy/src/G4AugerData.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4BremsstrahlungCrossSectionHandler.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4BremsstrahlungParameters.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4CompositeEMDataSet.cc (modified) (2 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionChargeDecrease.cc (modified) (3 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionChargeDecreasePartial.cc (modified) (9 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionChargeIncrease.cc (modified) (4 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionChargeIncreasePartial.cc (modified) (10 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionElasticScreenedRutherford.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4CrossSectionExcitationBorn.cc (modified) (2 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionExcitationBornPartial.cc (modified) (4 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglou.cc (modified) (2 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglouPartial.cc (modified) (7 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreen.cc (modified) (5 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreenPartial.cc (modified) (13 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionHandler.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4CrossSectionIonisationBorn.cc (modified) (4 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionIonisationBornElectron.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4CrossSectionIonisationBornPartial.cc (modified) (4 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionIonisationBornPartialElectron.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4CrossSectionIonisationRudd.cc (modified) (6 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionIonisationRuddPartial.cc (modified) (10 diffs)
-
electromagnetic/lowenergy/src/G4CrossSectionKill.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4DNACrossSectionDataSet.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4DNAGenericIonsManager.cc (modified) (7 diffs)
-
electromagnetic/lowenergy/src/G4DummyFinalState.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4EMDataSet.cc (modified) (2 diffs)
-
electromagnetic/lowenergy/src/G4FinalStateChargeDecrease.cc (modified) (12 diffs)
-
electromagnetic/lowenergy/src/G4FinalStateChargeIncrease.cc (modified) (6 diffs)
-
electromagnetic/lowenergy/src/G4FinalStateElasticBrennerZaider.cc (modified) (4 diffs)
-
electromagnetic/lowenergy/src/G4FinalStateElasticScreenedRutherford.cc (modified) (5 diffs)
-
electromagnetic/lowenergy/src/G4FinalStateExcitationBorn.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4FinalStateExcitationEmfietzoglou.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4FinalStateExcitationMillerGreen.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4FinalStateIonisationBorn.cc (modified) (9 diffs)
-
electromagnetic/lowenergy/src/G4FinalStateIonisationRudd.cc (modified) (24 diffs)
-
electromagnetic/lowenergy/src/G4FinalStateKill.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4FinalStateProduct.cc (modified) (4 diffs)
-
electromagnetic/lowenergy/src/G4FluoTransition.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4LinInterpolation.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4LogLogInterpolation.cc (modified) (4 diffs)
-
electromagnetic/lowenergy/src/G4LowEnergyBremsstrahlung.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4LowEnergyCompton.cc (modified) (8 diffs)
-
electromagnetic/lowenergy/src/G4LowEnergyGammaConversion.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4LowEnergyIonisation.cc (modified) (2 diffs)
-
electromagnetic/lowenergy/src/G4LowEnergyPhotoElectric.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4LowEnergyPolarizedCompton.cc (modified) (8 diffs)
-
electromagnetic/lowenergy/src/G4LowEnergyPolarizedRayleigh.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4LowEnergyRayleigh.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4PenelopeBremsstrahlung.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungAngular.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungContinuous.cc (modified) (12 diffs)
-
electromagnetic/lowenergy/src/G4PenelopeCompton.cc (modified) (19 diffs)
-
electromagnetic/lowenergy/src/G4PenelopeIonisation.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4PenelopePhotoElectric.cc (modified) (3 diffs)
-
electromagnetic/lowenergy/src/G4PenelopeRayleigh.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4RangeTest.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4SemiLogInterpolation.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4ShellData.cc (modified) (10 diffs)
-
electromagnetic/lowenergy/src/G4ShellEMDataSet.cc (modified) (15 diffs)
-
electromagnetic/lowenergy/src/G4VCrossSectionHandler.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4VLowEnergyDiscretePhotonProcess.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4VeLowEnergyLoss.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4WaterExcitationStructure.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4WaterIonisationStructure.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4eBremsstrahlungSpectrum.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4eCrossSectionExcitationEmfietzoglou.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4eCrossSectionScreenedRutherford.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4eIonisationCrossSectionHandler.cc (modified) (6 diffs)
-
electromagnetic/lowenergy/src/G4eIonisationParameters.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4eIonisationSpectrum.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4eLowEnergyLoss.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4hLowEnergyIonisation.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4hLowEnergyLoss.cc (modified) (9 diffs)
-
electromagnetic/lowenergy/src/G4hShellCrossSectionDoubleExp.cc (modified) (2 diffs)
-
electromagnetic/lowenergy/src/G4hShellCrossSectionDoubleExpData.cc (modified) (1 diff)
-
electromagnetic/lowenergy/src/G4hShellCrossSectionExp.cc (modified) (2 diffs)
-
electromagnetic/lowenergy/src/G4hShellCrossSectionExpData.cc (modified) (1 diff)
-
electromagnetic/muons/History (modified) (2 diffs)
-
electromagnetic/muons/include/G4EnergyLossForExtrapolator.hh (modified) (9 diffs)
-
electromagnetic/muons/include/G4MuBetheBlochModel.hh (modified) (4 diffs)
-
electromagnetic/muons/include/G4MuBremsstrahlung.hh (modified) (3 diffs)
-
electromagnetic/muons/include/G4MuBremsstrahlungModel.hh (modified) (9 diffs)
-
electromagnetic/muons/include/G4MuIonisation.hh (modified) (3 diffs)
-
electromagnetic/muons/include/G4MuMultipleScattering.hh (modified) (3 diffs)
-
electromagnetic/muons/include/G4MuPairProduction.hh (modified) (3 diffs)
-
electromagnetic/muons/include/G4MuPairProductionModel.hh (modified) (16 diffs)
-
electromagnetic/muons/src/G4EnergyLossForExtrapolator.cc (modified) (11 diffs)
-
electromagnetic/muons/src/G4MuBetheBlochModel.cc (modified) (6 diffs)
-
electromagnetic/muons/src/G4MuBremsstrahlung.cc (modified) (5 diffs)
-
electromagnetic/muons/src/G4MuBremsstrahlungModel.cc (modified) (23 diffs)
-
electromagnetic/muons/src/G4MuIonisation.cc (modified) (6 diffs)
-
electromagnetic/muons/src/G4MuMultipleScattering.cc (modified) (5 diffs)
-
electromagnetic/muons/src/G4MuPairProduction.cc (modified) (5 diffs)
-
electromagnetic/muons/src/G4MuPairProductionModel.cc (modified) (13 diffs)
-
electromagnetic/polarisation/History (modified) (2 diffs)
-
electromagnetic/polarisation/include/G4PolarizationHelper.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizationManager.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizationMessenger.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedAnnihilationCrossSection.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedAnnihilationModel.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedBhabhaCrossSection.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedBremsstrahlungCrossSection.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedComptonCrossSection.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedComptonModel.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedGammaConversion.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedGammaConversionModel.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedMollerBhabhaModel.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedMollerCrossSection.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedPEEffectCrossSection.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedPEEffectModel.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedPairProductionCrossSection.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4PolarizedPhotoElectricEffect.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4StokesVector.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4VPolarizedCrossSection.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4ePolarizedBremsstrahlung.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4ePolarizedBremsstrahlungModel.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4ePolarizedIonisation.hh (modified) (1 diff)
-
electromagnetic/polarisation/include/G4eplusPolarizedAnnihilation.hh (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizationHelper.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizationManager.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizationMessenger.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedAnnihilationCrossSection.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedAnnihilationModel.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedBhabhaCrossSection.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedBremsstrahlungCrossSection.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedCompton.cc (modified) (2 diffs)
-
electromagnetic/polarisation/src/G4PolarizedComptonCrossSection.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedComptonModel.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedGammaConversion.cc (modified) (2 diffs)
-
electromagnetic/polarisation/src/G4PolarizedGammaConversionModel.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedMollerBhabhaModel.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedMollerCrossSection.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedPEEffectCrossSection.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedPEEffectModel.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedPairProductionCrossSection.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4PolarizedPhotoElectricEffect.cc (modified) (2 diffs)
-
electromagnetic/polarisation/src/G4StokesVector.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4VPolarizedCrossSection.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4ePolarizedBremsstrahlung.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4ePolarizedBremsstrahlungModel.cc (modified) (1 diff)
-
electromagnetic/polarisation/src/G4ePolarizedIonisation.cc (modified) (2 diffs)
-
electromagnetic/polarisation/src/G4eplusPolarizedAnnihilation.cc (modified) (2 diffs)
-
electromagnetic/standard/History (modified) (7 diffs)
-
electromagnetic/standard/include/G4ASTARStopping.hh (modified) (2 diffs)
-
electromagnetic/standard/include/G4BetheBlochModel.hh (modified) (7 diffs)
-
electromagnetic/standard/include/G4BetheHeitlerModel.hh (modified) (1 diff)
-
electromagnetic/standard/include/G4BohrFluctuations.hh (modified) (3 diffs)
-
electromagnetic/standard/include/G4BraggIonModel.hh (modified) (9 diffs)
-
electromagnetic/standard/include/G4BraggModel.hh (modified) (9 diffs)
-
electromagnetic/standard/include/G4ComptonScattering.hh (modified) (3 diffs)
-
electromagnetic/standard/include/G4ComptonScattering52.hh (modified) (1 diff)
-
electromagnetic/standard/include/G4CoulombScattering.hh (modified) (4 diffs)
-
electromagnetic/standard/include/G4CoulombScatteringModel.hh (modified) (5 diffs)
-
electromagnetic/standard/include/G4GammaConversion.hh (modified) (3 diffs)
-
electromagnetic/standard/include/G4InitXscPAI.hh (modified) (1 diff)
-
electromagnetic/standard/include/G4IonFluctuations.hh (modified) (6 diffs)
-
electromagnetic/standard/include/G4KleinNishinaCompton.hh (modified) (1 diff)
-
electromagnetic/standard/include/G4MollerBhabhaModel.hh (modified) (4 diffs)
-
electromagnetic/standard/include/G4MscModel71.hh (modified) (1 diff)
-
electromagnetic/standard/include/G4MultipleScattering.hh (modified) (3 diffs)
-
electromagnetic/standard/include/G4MultipleScattering71.hh (modified) (3 diffs)
-
electromagnetic/standard/include/G4PAIModel.hh (modified) (4 diffs)
-
electromagnetic/standard/include/G4PAIPhotonModel.hh (modified) (6 diffs)
-
electromagnetic/standard/include/G4PAIxSection.hh (modified) (12 diffs)
-
electromagnetic/standard/include/G4PAIySection.hh (modified) (1 diff)
-
electromagnetic/standard/include/G4PEEffectModel.hh (modified) (4 diffs)
-
electromagnetic/standard/include/G4PSTARStopping.hh (modified) (2 diffs)
-
electromagnetic/standard/include/G4PhotoElectricEffect.hh (modified) (3 diffs)
-
electromagnetic/standard/include/G4PolarizedComptonScattering.hh (modified) (1 diff)
-
electromagnetic/standard/include/G4UniversalFluctuation.hh (modified) (3 diffs)
-
electromagnetic/standard/include/G4UrbanMscModel.hh (modified) (10 diffs)
-
electromagnetic/standard/include/G4UrbanMscModel90.hh (modified) (10 diffs)
-
electromagnetic/standard/include/G4WaterStopping.hh (modified) (3 diffs)
-
electromagnetic/standard/include/G4eBremsstrahlung.hh (modified) (3 diffs)
-
electromagnetic/standard/include/G4eBremsstrahlungModel.hh (modified) (6 diffs)
-
electromagnetic/standard/include/G4eCoulombScatteringModel.hh (modified) (10 diffs)
-
electromagnetic/standard/include/G4eIonisation.hh (modified) (4 diffs)
-
electromagnetic/standard/include/G4eeToTwoGammaModel.hh (modified) (1 diff)
-
electromagnetic/standard/include/G4eplusAnnihilation.hh (modified) (4 diffs)
-
electromagnetic/standard/include/G4hIonisation.hh (modified) (6 diffs)
-
electromagnetic/standard/include/G4hMultipleScattering.hh (modified) (5 diffs)
-
electromagnetic/standard/include/G4ionGasIonisation.hh (modified) (3 diffs)
-
electromagnetic/standard/include/G4ionIonisation.hh (modified) (8 diffs)
-
electromagnetic/standard/src/G4ASTARStopping.cc (modified) (78 diffs)
-
electromagnetic/standard/src/G4BetheBlochModel.cc (modified) (12 diffs)
-
electromagnetic/standard/src/G4BetheHeitlerModel.cc (modified) (5 diffs)
-
electromagnetic/standard/src/G4BohrFluctuations.cc (modified) (2 diffs)
-
electromagnetic/standard/src/G4BraggIonModel.cc (modified) (9 diffs)
-
electromagnetic/standard/src/G4BraggModel.cc (modified) (8 diffs)
-
electromagnetic/standard/src/G4ComptonScattering.cc (modified) (5 diffs)
-
electromagnetic/standard/src/G4ComptonScattering52.cc (modified) (2 diffs)
-
electromagnetic/standard/src/G4CoulombScattering.cc (modified) (7 diffs)
-
electromagnetic/standard/src/G4CoulombScatteringModel.cc (modified) (6 diffs)
-
electromagnetic/standard/src/G4GammaConversion.cc (modified) (5 diffs)
-
electromagnetic/standard/src/G4InitXscPAI.cc (modified) (1 diff)
-
electromagnetic/standard/src/G4IonFluctuations.cc (modified) (17 diffs)
-
electromagnetic/standard/src/G4KleinNishinaCompton.cc (modified) (1 diff)
-
electromagnetic/standard/src/G4MollerBhabhaModel.cc (modified) (4 diffs)
-
electromagnetic/standard/src/G4MscModel71.cc (modified) (2 diffs)
-
electromagnetic/standard/src/G4MultipleScattering.cc (modified) (6 diffs)
-
electromagnetic/standard/src/G4MultipleScattering71.cc (modified) (3 diffs)
-
electromagnetic/standard/src/G4PAIModel.cc (modified) (9 diffs)
-
electromagnetic/standard/src/G4PAIPhotonModel.cc (modified) (12 diffs)
-
electromagnetic/standard/src/G4PAIxSection.cc (modified) (55 diffs)
-
electromagnetic/standard/src/G4PAIySection.cc (modified) (1 diff)
-
electromagnetic/standard/src/G4PEEffectModel.cc (modified) (5 diffs)
-
electromagnetic/standard/src/G4PSTARStopping.cc (modified) (76 diffs)
-
electromagnetic/standard/src/G4PhotoElectricEffect.cc (modified) (5 diffs)
-
electromagnetic/standard/src/G4PolarizedComptonScattering.cc (modified) (2 diffs)
-
electromagnetic/standard/src/G4UniversalFluctuation.cc (modified) (3 diffs)
-
electromagnetic/standard/src/G4UrbanMscModel.cc (modified) (11 diffs)
-
electromagnetic/standard/src/G4UrbanMscModel90.cc (modified) (13 diffs)
-
electromagnetic/standard/src/G4WaterStopping.cc (modified) (5 diffs)
-
electromagnetic/standard/src/G4eBremsstrahlung.cc (modified) (7 diffs)
-
electromagnetic/standard/src/G4eBremsstrahlungModel.cc (modified) (8 diffs)
-
electromagnetic/standard/src/G4eCoulombScatteringModel.cc (modified) (7 diffs)
-
electromagnetic/standard/src/G4eIonisation.cc (modified) (5 diffs)
-
electromagnetic/standard/src/G4eeToTwoGammaModel.cc (modified) (1 diff)
-
electromagnetic/standard/src/G4eplusAnnihilation.cc (modified) (5 diffs)
-
electromagnetic/standard/src/G4hIonisation.cc (modified) (8 diffs)
-
electromagnetic/standard/src/G4hMultipleScattering.cc (modified) (6 diffs)
-
electromagnetic/standard/src/G4ionGasIonisation.cc (modified) (5 diffs)
-
electromagnetic/standard/src/G4ionIonisation.cc (modified) (9 diffs)
-
electromagnetic/utils/History (modified) (6 diffs)
-
electromagnetic/utils/include/G4DummyModel.hh (modified) (1 diff)
-
electromagnetic/utils/include/G4EmCalculator.hh (modified) (1 diff)
-
electromagnetic/utils/include/G4EmCorrections.hh (modified) (11 diffs)
-
electromagnetic/utils/include/G4EmModelManager.hh (modified) (7 diffs)
-
electromagnetic/utils/include/G4EmMultiModel.hh (modified) (1 diff)
-
electromagnetic/utils/include/G4EmProcessOptions.hh (modified) (3 diffs)
-
electromagnetic/utils/include/G4EmTableType.hh (modified) (2 diffs)
-
electromagnetic/utils/include/G4EnergyLossMessenger.hh (modified) (6 diffs)
-
electromagnetic/utils/include/G4EnergyLossTables.hh (modified) (1 diff)
-
electromagnetic/utils/include/G4LossTableBuilder.hh (modified) (5 diffs)
-
electromagnetic/utils/include/G4LossTableManager.hh (modified) (11 diffs)
-
electromagnetic/utils/include/G4MscStepLimitType.hh (modified) (1 diff)
-
electromagnetic/utils/include/G4VEmFluctuationModel.hh (modified) (3 diffs)
-
electromagnetic/utils/include/G4VEmModel.hh (modified) (14 diffs)
-
electromagnetic/utils/include/G4VEmProcess.hh (modified) (14 diffs)
-
electromagnetic/utils/include/G4VEnergyLoss.hh (modified) (1 diff)
-
electromagnetic/utils/include/G4VEnergyLossProcess.hh (modified) (18 diffs)
-
electromagnetic/utils/include/G4VMultipleScattering.hh (modified) (19 diffs)
-
electromagnetic/utils/include/G4ionEffectiveCharge.hh (modified) (4 diffs)
-
electromagnetic/utils/src/G4DummyModel.cc (modified) (1 diff)
-
electromagnetic/utils/src/G4EmCalculator.cc (modified) (9 diffs)
-
electromagnetic/utils/src/G4EmCorrections.cc (modified) (15 diffs)
-
electromagnetic/utils/src/G4EmModelManager.cc (modified) (29 diffs)
-
electromagnetic/utils/src/G4EmMultiModel.cc (modified) (1 diff)
-
electromagnetic/utils/src/G4EmProcessOptions.cc (modified) (5 diffs)
-
electromagnetic/utils/src/G4EnergyLossMessenger.cc (modified) (19 diffs)
-
electromagnetic/utils/src/G4EnergyLossTables.cc (modified) (2 diffs)
-
electromagnetic/utils/src/G4LossTableBuilder.cc (modified) (9 diffs)
-
electromagnetic/utils/src/G4LossTableManager.cc (modified) (16 diffs)
-
electromagnetic/utils/src/G4VEmFluctuationModel.cc (modified) (3 diffs)
-
electromagnetic/utils/src/G4VEmModel.cc (modified) (6 diffs)
-
electromagnetic/utils/src/G4VEmProcess.cc (modified) (12 diffs)
-
electromagnetic/utils/src/G4VEnergyLoss.cc (modified) (1 diff)
-
electromagnetic/utils/src/G4VEnergyLossProcess.cc (modified) (50 diffs)
-
electromagnetic/utils/src/G4VMultipleScattering.cc (modified) (14 diffs)
-
electromagnetic/utils/src/G4ionEffectiveCharge.cc (modified) (10 diffs)
-
electromagnetic/xrays/GNUmakefile (modified) (2 diffs)
-
electromagnetic/xrays/History (modified) (2 diffs)
-
electromagnetic/xrays/include/G4Cerenkov.hh (modified) (8 diffs)
-
electromagnetic/xrays/include/G4ForwardXrayTR.hh (modified) (1 diff)
-
electromagnetic/xrays/include/G4GammaXTRadiator.hh (modified) (1 diff)
-
electromagnetic/xrays/include/G4RegularXTRadiator.hh (modified) (1 diff)
-
electromagnetic/xrays/include/G4Scintillation.hh (modified) (4 diffs)
-
electromagnetic/xrays/include/G4StrawTubeXTRadiator.hh (modified) (1 diff)
-
electromagnetic/xrays/include/G4SynchrotronRadiation.hh (modified) (1 diff)
-
electromagnetic/xrays/include/G4SynchrotronRadiationInMat.hh (modified) (1 diff)
-
electromagnetic/xrays/include/G4TransitionRadiation.hh (modified) (1 diff)
-
electromagnetic/xrays/include/G4TransparentRegXTRadiator.hh (modified) (1 diff)
-
electromagnetic/xrays/include/G4VTRModel.hh (modified) (1 diff)
-
electromagnetic/xrays/include/G4VTransitionRadiation.hh (modified) (1 diff)
-
electromagnetic/xrays/include/G4VXTRenergyLoss.hh (modified) (1 diff)
-
electromagnetic/xrays/src/G4Cerenkov.cc (modified) (21 diffs)
-
electromagnetic/xrays/src/G4ForwardXrayTR.cc (modified) (1 diff)
-
electromagnetic/xrays/src/G4GammaXTRadiator.cc (modified) (1 diff)
-
electromagnetic/xrays/src/G4RegularXTRadiator.cc (modified) (1 diff)
-
electromagnetic/xrays/src/G4Scintillation.cc (modified) (16 diffs)
-
electromagnetic/xrays/src/G4StrawTubeXTRadiator.cc (modified) (1 diff)
-
electromagnetic/xrays/src/G4SynchrotronRadiation.cc (modified) (1 diff)
-
electromagnetic/xrays/src/G4SynchrotronRadiationInMat.cc (modified) (1 diff)
-
electromagnetic/xrays/src/G4TransitionRadiation.cc (modified) (1 diff)
-
electromagnetic/xrays/src/G4TransparentRegXTRadiator.cc (modified) (1 diff)
-
electromagnetic/xrays/src/G4VTransitionRadiation.cc (modified) (1 diff)
-
electromagnetic/xrays/src/G4VXTRenergyLoss.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/cuts/History
r819 r961 1 $Id: History,v 1.2 1 2007/06/06 14:50:38 gcosmoExp $1 $Id: History,v 1.22 2008/03/02 10:52:55 kurasige Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 Mar. 2nd, 2008 - H.Kurashige (procuts-V09-01-00) 20 - Add ProductionCutsMessenger 21 - Suppress 'too big cut value' messsage for higher verbosity 19 22 20 23 June 6th, 2007 - L.Urban (procuts-V08-03-01) -
trunk/source/processes/cuts/include/G4MCCIndexConversionTable.hh
r819 r961 25 25 // 26 26 // $Id: G4MCCIndexConversionTable.hh,v 1.3 2006/06/29 19:29:42 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -
trunk/source/processes/cuts/include/G4MaterialCutsCouple.hh
r819 r961 26 26 // 27 27 // $Id: G4MaterialCutsCouple.hh,v 1.3 2006/06/29 19:29:44 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/include/G4PhysicsTableHelper.hh
r819 r961 26 26 // 27 27 // $Id: G4PhysicsTableHelper.hh,v 1.3 2006/06/29 19:29:46 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/include/G4ProductionCuts.hh
r819 r961 26 26 // 27 27 // $Id: G4ProductionCuts.hh,v 1.4 2006/06/29 19:29:48 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/include/G4ProductionCutsTable.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4ProductionCutsTable.hh,v 1. 8 2007/03/15 04:06:40kurasige Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4ProductionCutsTable.hh,v 1.9 2008/03/02 10:52:55 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 46 46 // Modify RetrieveCutsTable to allow materials and 47 47 // couples can be different from one in file (i.e. at storing) 48 // 48 // Modified 2 Mar. 2008 H.Kurashige 49 // add messenger 49 50 // ------------------------------------------------------------ 50 51 … … 57 58 class G4VPhysicalVolume; 58 59 class G4ProductionCuts; 60 61 class G4ProductionCutsTableMessenger; 59 62 60 63 #include "globals.hh" … … 227 230 228 231 private: 229 G4int verboseLevel; 232 G4int verboseLevel; 233 G4ProductionCutsTableMessenger* fMessenger; 230 234 231 235 }; … … 340 344 341 345 inline 342 void G4ProductionCutsTable::SetVerboseLevel(G4int value)343 {344 verboseLevel = value;345 }346 347 inline348 346 G4int G4ProductionCutsTable::GetVerboseLevel() const 349 347 { -
trunk/source/processes/cuts/include/G4RToEConvForAntiNeutron.hh
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForAntiNeutron.hh,v 1.2 2006/06/29 19:29:52 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/include/G4RToEConvForAntiProton.hh
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForAntiProton.hh,v 1.2 2006/06/29 19:29:54 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/include/G4RToEConvForElectron.hh
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForElectron.hh,v 1.2 2006/06/29 19:29:56 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/include/G4RToEConvForGamma.hh
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForGamma.hh,v 1.2 2006/06/29 19:29:58 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/include/G4RToEConvForNeutron.hh
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForNeutron.hh,v 1.2 2006/06/29 19:30:00 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/include/G4RToEConvForPositron.hh
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForPositron.hh,v 1.2 2006/06/29 19:30:02 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/include/G4RToEConvForProton.hh
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForProton.hh,v 1.2 2006/06/29 19:30:04 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/include/G4VRangeToEnergyConverter.hh
r819 r961 26 26 // 27 27 // $Id: G4VRangeToEnergyConverter.hh,v 1.4 2006/06/29 19:30:06 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/src/G4MCCIndexConversionTable.cc
r819 r961 25 25 // 26 26 // $Id: G4MCCIndexConversionTable.cc,v 1.3 2006/06/29 19:30:08 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -
trunk/source/processes/cuts/src/G4MaterialCutsCouple.cc
r819 r961 26 26 // 27 27 // $Id: G4MaterialCutsCouple.cc,v 1.3 2006/06/29 19:30:10 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/src/G4PhysicsTableHelper.cc
r819 r961 25 25 // 26 26 // $Id: G4PhysicsTableHelper.cc,v 1.5 2006/06/29 19:30:12 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -
trunk/source/processes/cuts/src/G4ProductionCuts.cc
r819 r961 26 26 // 27 27 // $Id: G4ProductionCuts.cc,v 1.5 2006/06/29 19:30:14 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/src/G4ProductionCutsTable.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4ProductionCutsTable.cc,v 1.1 7 2007/05/30 08:22:20kurasige Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4ProductionCutsTable.cc,v 1.18 2008/03/02 10:52:55 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 32 32 // GEANT 4 class implementation file/ History: 33 33 // 06/Oct. 2002, M.Asai : First implementation 34 // 02/Mar. 2008, H.Kurashige : Add messenger 34 35 // -------------------------------------------------------------- 35 36 … … 37 38 #include "G4ProductionCuts.hh" 38 39 #include "G4MCCIndexConversionTable.hh" 40 #include "G4ProductionCutsTableMessenger.hh" 39 41 #include "G4ParticleDefinition.hh" 40 42 #include "G4ParticleTable.hh" … … 66 68 67 69 G4ProductionCutsTable::G4ProductionCutsTable() 68 : firstUse(true),verboseLevel(1) 70 : firstUse(true),verboseLevel(1),fMessenger(0) 69 71 { 70 72 for(size_t i=0;i< NumberOfG4CutIndex;i++) … … 78 80 fG4RegionStore = G4RegionStore::GetInstance(); 79 81 defaultProductionCuts = new G4ProductionCuts(); 82 83 // add messenger for UI 84 fMessenger = new G4ProductionCutsTableMessenger(this); 80 85 } 81 86 … … 103 108 } 104 109 fG4ProductionCutsTable =0; 110 111 if (fMessenger !=0) delete fMessenger; 112 fMessenger = 0; 105 113 } 106 114 … … 108 116 { 109 117 if(firstUse){ 110 if(G4ParticleTable::GetParticleTable()->FindParticle("gamma")) 111 { converters[0] = new G4RToEConvForGamma(); } 112 if(G4ParticleTable::GetParticleTable()->FindParticle("e-")) 113 { converters[1] = new G4RToEConvForElectron(); } 114 if(G4ParticleTable::GetParticleTable()->FindParticle("e+")) 115 { converters[2] = new G4RToEConvForPositron(); } 118 if(G4ParticleTable::GetParticleTable()->FindParticle("gamma")){ 119 converters[0] = new G4RToEConvForGamma(); 120 converters[0]->SetVerboseLevel(GetVerboseLevel()); 121 } 122 if(G4ParticleTable::GetParticleTable()->FindParticle("e-")){ 123 converters[1] = new G4RToEConvForElectron(); 124 converters[1]->SetVerboseLevel(GetVerboseLevel()); 125 } 126 if(G4ParticleTable::GetParticleTable()->FindParticle("e+")){ 127 converters[2] = new G4RToEConvForPositron(); 128 converters[2]->SetVerboseLevel(GetVerboseLevel()); 129 } 116 130 firstUse = false; 117 131 } … … 376 390 377 391 #ifdef G4VERBOSE 378 if (verboseLevel > 1) {392 if (verboseLevel >2) { 379 393 G4cout << "G4ProductionCutsTable::StoreCutsTable " ; 380 394 G4cout << " Material/Cuts information have been succesfully stored "; … … 396 410 if (!RetrieveCutsInfo(dir, ascii)) return false; 397 411 #ifdef G4VERBOSE 398 if (verboseLevel > 1) {412 if (verboseLevel >2) { 399 413 G4cout << "G4ProductionCutsTable::RetrieveCutsTable " ; 400 414 G4cout << " Material/Cuts information have been succesfully retreived "; … … 420 434 // isNeedForRestoreCoupleInfo = false; 421 435 if (!CheckMaterialInfo(directory, ascii)) return false; 422 if (verboseLevel > 1) {436 if (verboseLevel >2) { 423 437 G4cerr << "G4ProductionCutsTable::CheckMaterialInfo passed !!"<< G4endl; 424 438 } 425 439 if (!CheckMaterialCutsCoupleInfo(directory, ascii)) return false; 426 if (verboseLevel > 1) {440 if (verboseLevel >2) { 427 441 G4cerr << "G4ProductionCutsTable::CheckMaterialCutsCoupleInfo passed !!"<< G4endl; 428 442 } … … 1080 1094 return true; 1081 1095 } 1096 1097 // Set Verbose Level 1098 // set same verbosity to all registered RangeToEnergyConverters 1099 void G4ProductionCutsTable::SetVerboseLevel(G4int value) 1100 { 1101 verboseLevel = value; 1102 for (int ip=0; ip< NumberOfG4CutIndex; ip++) { 1103 if (converters[ip] !=0 ){ 1104 converters[ip]->SetVerboseLevel(value); 1105 } 1106 } 1107 } 1108 -
trunk/source/processes/cuts/src/G4RToEConvForAntiNeutron.cc
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForAntiNeutron.cc,v 1.3 2006/06/29 19:30:18 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/src/G4RToEConvForAntiProton.cc
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForAntiProton.cc,v 1.3 2006/06/29 19:30:20 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/src/G4RToEConvForElectron.cc
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForElectron.cc,v 1.5 2006/06/29 19:30:22 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/src/G4RToEConvForGamma.cc
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForGamma.cc,v 1.4 2006/06/29 19:30:24 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/src/G4RToEConvForNeutron.cc
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForNeutron.cc,v 1.3 2006/06/29 19:30:26 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/src/G4RToEConvForPositron.cc
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForPositron.cc,v 1.5 2006/06/29 19:30:28 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/src/G4RToEConvForProton.cc
r819 r961 26 26 // 27 27 // $Id: G4RToEConvForProton.cc,v 1.3 2006/06/29 19:30:30 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/cuts/src/G4VRangeToEnergyConverter.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4VRangeToEnergyConverter.cc,v 1. 8 2007/06/06 05:13:34 urbanExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4VRangeToEnergyConverter.cc,v 1.9 2008/03/02 10:52:56 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 274 274 theLossTable->reserve(G4Element::GetNumberOfElements()); 275 275 #ifdef G4VERBOSE 276 if (GetVerboseLevel()> 2) {276 if (GetVerboseLevel()>3) { 277 277 G4cout << "G4VRangeToEnergyConverter::BuildLossTable() "; 278 278 G4cout << "Create theLossTable[" << theLossTable << "]"; … … 447 447 if ( theCutInLength >= rmax ) { 448 448 #ifdef G4VERBOSE 449 if (GetVerboseLevel()> 0) {449 if (GetVerboseLevel()>2) { 450 450 G4cout << "G4VRangeToEnergyConverter::ConvertCutToKineticEnergy "; 451 451 G4cout << " for " << theParticle->GetParticleName() << G4endl; -
trunk/source/processes/decay/History
r819 r961 1 $Id: History,v 1. 28.2.1 2008/04/17 08:59:24kurasige Exp $1 $Id: History,v 1.34 2008/11/14 15:55:47 kurasige Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 - Apr. 16, 08 H.Kurashige (decay-V09-00-03) 19 -Sep. 19 2008 H.Kurashige (decay-V09-01-04) 20 - modify process sub type enumeration 21 22 - Aug. 22, 08 P.Gumplinger (decay-V09-01-03) 23 - fix a bug in G4DecayWithSpin.cc: there is a memory overwrite when the 24 GetFieldValue being called initializes a fieldValue array of size 6 25 when the array is only defined of size 3 in the calling program. 26 Thanks to Kamil Sedlak (PSI) for pointing this out and suggesting this 27 fix. 28 29 - Apr. 16, 08 H.Kurashige (decay-V09-01-02) 20 30 - fix a bug when shortlived particles has finite pre-assigned proper time 21 31 32 - Apr. 11, 08 P.Gumplinger (decay-V09-01-01) 33 - modify G4DecayWithSpin::DecayIt to allow spin precession also for EM Fields; 34 e.g. fields that do "DoesFieldChangeEnergy()" but only if the B-field 35 component is > 0. (thanks to Kamil Sedlak, Toni Shiroka from PSI) 36 37 - Dec. 15, 07 H.Kurashige (decay-V09-01-00) 38 - add G4DecayProcessType 39 - define process sub type 22 40 23 41 - Oct. 29, 07 P.Gumplinger (decay-V09-00-02) -
trunk/source/processes/decay/include/G4Decay.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4Decay.hh,v 1. 18 2007/07/23 23:13:04kurasige Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4Decay.hh,v 1.20 2008/09/19 03:19:53 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 58 58 #include "G4VRestDiscreteProcess.hh" 59 59 #include "G4ParticleChangeForDecay.hh" 60 #include "G4DecayProcessType.hh" 61 60 62 class G4VExtDecayer; 61 63 … … 206 208 207 209 inline 208 void G4Decay::SetExtDecayer(G4VExtDecayer* val)209 {210 pExtDecayer = val;211 }212 213 inline214 210 const G4VExtDecayer* G4Decay::GetExtDecayer() const 215 211 { -
trunk/source/processes/decay/include/G4UnknownDecay.hh
r819 r961 26 26 // 27 27 // $Id: G4UnknownDecay.hh,v 1.3 2006/06/29 19:30:56 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/decay/include/G4VExtDecayer.hh
r819 r961 26 26 // 27 27 // $Id: G4VExtDecayer.hh,v 1.4 2006/06/29 19:31:11 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/decay/src/G4Decay.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4Decay.cc,v 1. 27.2.1 2008/04/17 08:59:24kurasige Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4Decay.cc,v 1.30 2008/09/19 03:19:53 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 64 64 pExtDecayer(0) 65 65 { 66 // set Process Sub Type 67 SetProcessSubType(static_cast<int>(DECAY)); 68 66 69 #ifdef G4VERBOSE 67 70 if (GetVerboseLevel()>1) { … … 69 72 } 70 73 #endif 74 71 75 pParticleChange = &fParticleChangeForDecay; 72 76 } … … 404 408 fRemainderLifeTime = pTime - track.GetProperTime(); 405 409 if (fRemainderLifeTime <= 0.0) fRemainderLifeTime = DBL_MIN; 410 406 411 G4double rvalue=0.0; 407 412 // use pre-assigned Decay time to determine PIL 408 413 if (aLife>0.0) { 409 414 // ordinary particle 410 rvalue = (fRemainderLifeTime/aLife)*GetMeanFreePath(track, previousStepSize 411 , condition); 415 rvalue = (fRemainderLifeTime/aLife)*GetMeanFreePath(track, previousStepSize, condition); 412 416 } else { 413 417 // shortlived particle … … 418 422 } 419 423 return rvalue; 420 421 424 } 422 425 } … … 440 443 return fRemainderLifeTime; 441 444 } 445 446 447 void G4Decay::SetExtDecayer(G4VExtDecayer* val) 448 { 449 pExtDecayer = val; 450 451 // set Process Sub Type 452 if ( pExtDecayer !=0 ) { 453 SetProcessSubType(static_cast<int>(DECAY_External)); 454 } 455 } -
trunk/source/processes/decay/src/G4DecayWithSpin.cc
r819 r961 29 29 // History: 30 30 // 17 August 2004 P. Gumplinger, T. MacPhail 31 // 11 April 2008 Kamil Sedlak (PSI), Toni Shiroka (PSI) 31 32 // ------------------------------------------------------------ 32 33 // … … 47 48 #include "G4Transform3D.hh" 48 49 49 G4DecayWithSpin::G4DecayWithSpin(const G4String& processName):G4Decay(processName){} 50 G4DecayWithSpin::G4DecayWithSpin(const G4String& processName):G4Decay(processName) 51 { 52 // set Process Sub Type 53 SetProcessSubType(static_cast<int>(DECAY_WithSpin)); 54 55 } 50 56 51 57 G4DecayWithSpin::~G4DecayWithSpin(){} … … 97 103 if(fieldMgr)field = fieldMgr->GetDetectorField(); 98 104 99 if (field && !(fieldMgr->DoesFieldChangeEnergy())) {105 if (field) { 100 106 101 107 G4double point[4]; … … 105 111 point[3] = aTrack.GetGlobalTime(); 106 112 107 G4double fieldValue[ 3];113 G4double fieldValue[6]; 108 114 field -> GetFieldValue(point,fieldValue); 109 115 110 116 G4ThreeVector B(fieldValue[0],fieldValue[1],fieldValue[2]); 111 117 112 parent_polarization = Spin_Precession(aStep,B,fRemainderLifeTime); 118 // Call the spin precession only for non-zero mag. field 119 if (B.mag2() > 0.) parent_polarization = 120 Spin_Precession(aStep,B,fRemainderLifeTime); 113 121 114 122 } -
trunk/source/processes/decay/src/G4PionDecayMakeSpin.cc
r819 r961 37 37 38 38 G4PionDecayMakeSpin::G4PionDecayMakeSpin(const G4String& processName) 39 : G4Decay(processName) { } 39 : G4Decay(processName) 40 { 41 // set Process Sub Type 42 SetProcessSubType(static_cast<int>(DECAY_PionMakeSpin)); 43 44 } 40 45 41 46 G4PionDecayMakeSpin::~G4PionDecayMakeSpin() { } -
trunk/source/processes/decay/src/G4UnknownDecay.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4UnknownDecay.cc,v 1. 5 2007/10/06 07:01:09kurasige Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4UnknownDecay.cc,v 1.6 2007/12/15 12:29:16 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 40 40 #include "G4PhysicsLogVector.hh" 41 41 #include "G4ParticleChangeForDecay.hh" 42 #include "G4DecayProcessType.hh" 43 42 44 43 45 // constructor … … 47 49 HighestValue(20.0) 48 50 { 51 // set Process Sub Type 52 SetProcessSubType(static_cast<int>(DECAY_Unknown)); 53 49 54 #ifdef G4VERBOSE 50 55 if (GetVerboseLevel()>1) { -
trunk/source/processes/electromagnetic/GNUmakefile
r819 r961 1 # $Id: GNUmakefile,v 1. 6 2006/09/21 21:35:20 vnivanchExp $1 # $Id: GNUmakefile,v 1.7 2008/11/14 19:54:40 gcosmo Exp $ 2 2 # ------------------------------------------------------------------ 3 3 # GNUmakefile for electromagnetic library. Gabriele Cosmo, 18/9/96. … … 8 8 name := G4electromagnetic 9 9 10 SUBDIRS = muons standard utils xrays lowenergy highenergy polarisation11 SUBLIBS = G4muons G4emstandard G4emutils G4xrays G4emlowenergy G4emhighenergy G4 polar10 SUBDIRS = muons standard utils xrays lowenergy highenergy adjoint polarisation 11 SUBLIBS = G4muons G4emstandard G4emutils G4xrays G4emlowenergy G4emhighenergy G4emadjoint G4polar 12 12 13 13 ifndef G4INSTALL -
trunk/source/processes/electromagnetic/highenergy/GNUmakefile
r819 r961 1 # $Id: GNUmakefile,v 1. 3 2005/05/18 10:12:32vnivanch Exp $1 # $Id: GNUmakefile,v 1.4 2008/03/06 11:47:10 vnivanch Exp $ 2 2 # -------------------------------------------------------------------- 3 3 # GNUmakefile for electromagnetic sub-library. John Allison, 25/6/98. … … 25 25 -I$(G4BASE)/processes/electromagnetic/utils/include \ 26 26 -I$(G4BASE)/processes/electromagnetic/standard/include \ 27 -I$(G4BASE)/processes/electromagnetic/muons/include \ 27 28 -I$(G4BASE)/particles/management/include \ 28 29 -I$(G4BASE)/particles/bosons/include \ -
trunk/source/processes/electromagnetic/highenergy/History
r819 r961 1 $Id: History,v 1. 22 2007/11/13 18:36:29vnivanch Exp $1 $Id: History,v 1.31 2009/02/20 16:38:33 vnivanch Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20 20 February 09: V.Ivanchenko (emhighenergy-V09-02-00) 21 - Cleanup: improved comments, move virtual methods from .hh to .cc 22 23 16 October 08: V.Ivanchenko (emhighenergy-V09-01-06) 24 - Updated processes enumeration and printout 25 26 21 July 08: V.Ivanchenko (emhighenergy-V09-01-05) 27 - G4hBremsstrahlungModel, G4hPairProductionModel - do not use A in 28 the CrossSectionPerAtom 29 30 10 July 08: V.Ivanchenko (emhighenergy-V09-01-04) 31 - G4eeCrossSections - migrated to PDG 2006 32 - G4eeToHadronsMultiModel - added main reaction channels for omega and 33 phi resonances 34 - New models: G4eeTo3PiModel, G4eeToPGammaModel, G4ee2KChargedModel, 35 G4ee2KNeutralModel 36 37 8 July 08: V.Ivanchenko (emhighenergy-V09-01-03) 38 - G4GammaConversionToMuons - all exit() substituted by warnings 39 40 4 April 08: V.Ivanchenko (emhighenergy-V09-01-02) 41 - G4hBremsstrahlungModel - remove static const 42 43 14 March 08: V.Ivanchenko (emhighenergy-V09-01-01) 44 06 March 08: V.Ivanchenko (emhighenergy-V09-01-00) 45 - G4hBremsstrahlungModel, G4hBremsstrahlung, G4hPairProductionModel, 46 G4hPairProduction are added 47 - SubType for all processes is initialized 19 48 20 49 13 November 07: V.Ivanchenko (emhighenergy-V09-00-01) -
trunk/source/processes/electromagnetic/highenergy/include/G4AnnihiToMuPair.hh
r819 r961 26 26 // 27 27 // $Id: G4AnnihiToMuPair.hh,v 1.2 2006/06/29 19:32:12 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------ G4AnnihiToMuPair physics process ------ -
trunk/source/processes/electromagnetic/highenergy/include/G4BetheBlochNoDeltaModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BetheBlochNoDeltaModel.hh,v 1. 7 2006/06/29 19:32:14 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4BetheBlochNoDeltaModel.hh,v 1.8 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 68 68 G4double cutEnergy); 69 69 70 virtual G4double C omputeCrossSectionPerElectron(71 const G4ParticleDefinition*,72 G4double kineticEnergy,73 G4double cutEnergy,74 G4double maxEnergy);70 virtual G4double CrossSectionPerVolume(const G4Material*, 71 const G4ParticleDefinition*, 72 G4double kineticEnergy, 73 G4double cutEnergy, 74 G4double maxEnergy); 75 75 76 76 private: … … 84 84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 85 85 86 inline G4double G4BetheBlochNoDeltaModel::ComputeDEDXPerVolume(87 const G4Material* material,88 const G4ParticleDefinition* pd,89 G4double kinEnergy, G4double)90 {91 G4double dedx = G4BetheBlochModel::ComputeDEDXPerVolume(material, pd, kinEnergy, DBL_MAX);92 return dedx;93 }94 95 inline G4double G4BetheBlochNoDeltaModel::ComputeCrossSectionPerElectron(96 const G4ParticleDefinition*,97 G4double, G4double, G4double)98 {99 return 0.0;100 }101 102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....103 104 86 #endif -
trunk/source/processes/electromagnetic/highenergy/include/G4BraggNoDeltaModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BraggNoDeltaModel.hh,v 1. 6 2006/06/29 19:32:16 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4BraggNoDeltaModel.hh,v 1.7 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 68 68 G4double cutEnergy); 69 69 70 virtual G4double C omputeCrossSectionPerElectron(70 virtual G4double CrossSectionPerVolume(const G4Material*, 71 71 const G4ParticleDefinition*, 72 72 G4double kineticEnergy, 73 73 G4double cutEnergy, 74 74 G4double maxEnergy); 75 76 75 private: 77 76 … … 84 83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 85 84 86 inline G4double G4BraggNoDeltaModel::ComputeDEDXPerVolume(87 const G4Material* material,88 const G4ParticleDefinition* pd,89 G4double kinEnergy, G4double)90 {91 G4double dedx = G4BraggIonModel::ComputeDEDXPerVolume(material, pd, kinEnergy, DBL_MAX);92 return dedx;93 }94 95 inline G4double G4BraggNoDeltaModel::ComputeCrossSectionPerElectron(96 const G4ParticleDefinition*,97 G4double, G4double, G4double)98 {99 return 0.0;100 }101 102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....103 104 85 #endif -
trunk/source/processes/electromagnetic/highenergy/include/G4GammaConversionToMuons.hh
r819 r961 26 26 // 27 27 // $Id: G4GammaConversionToMuons.hh,v 1.2 2006/06/29 19:32:18 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------ G4GammaConversionToMuons physics process ------ -
trunk/source/processes/electromagnetic/highenergy/include/G4Vee2hadrons.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4Vee2hadrons.hh,v 1. 3 2007/05/22 17:37:30vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4Vee2hadrons.hh,v 1.4 2008/07/10 18:06:38 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 63 63 public: 64 64 65 G4Vee2hadrons() {};65 G4Vee2hadrons() : lowEnergy(0.0), highEnergy(1.1*GeV) {}; 66 66 67 67 virtual ~G4Vee2hadrons() {}; … … 76 76 77 77 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 78 G4double, const G4ThreeVector&) const = 0; 78 G4double, const G4ThreeVector&) = 0; 79 80 void SetLowEnergy(G4double val) {lowEnergy = val;}; 81 82 G4double LowEnergy() const {return lowEnergy;}; 83 84 void SetHighEnergy(G4double val) {highEnergy = val;}; 85 86 G4double HighEnergy() const {return highEnergy;}; 79 87 80 88 private: … … 84 92 G4Vee2hadrons(const G4Vee2hadrons&); 85 93 94 G4double lowEnergy; 95 G4double highEnergy; 96 86 97 }; 87 98 -
trunk/source/processes/electromagnetic/highenergy/include/G4eeCrossSections.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eeCrossSections.hh,v 1. 2 2006/06/29 19:32:22 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4eeCrossSections.hh,v 1.3 2008/07/10 18:06:38 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 70 70 G4double CrossSection3pi(G4double); 71 71 72 G4double CrossSectionPi0G(G4double); 73 74 G4double CrossSectionEtaG(G4double); 75 72 76 G4double CrossSection2Kcharged(G4double); 73 77 74 78 G4double CrossSection2Kneutral(G4double); 79 80 std::complex<G4double> DpRho(G4double e); 75 81 76 82 private: … … 95 101 G4double WidthPhi(G4double e); 96 102 97 std::complex<G4double> DpRho(G4double e);98 99 103 std::complex<G4double> DpOm(G4double e); 100 104 101 105 std::complex<G4double> DpPhi(G4double e); 102 103 106 104 107 // hide assignment operator -
trunk/source/processes/electromagnetic/highenergy/include/G4eeToHadrons.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eeToHadrons.hh,v 1. 8 2007/05/23 08:50:41vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eeToHadrons.hh,v 1.9 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 70 70 71 71 // Print out of the class parameters 72 v oid PrintInfo();72 virtual void PrintInfo(); 73 73 74 74 // Set the factor to artificially increase the crossSection (default 1) … … 77 77 protected: 78 78 79 v oid InitialiseProcess(const G4ParticleDefinition*);79 virtual void InitialiseProcess(const G4ParticleDefinition*); 80 80 81 81 private: … … 92 92 }; 93 93 94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....96 97 inline G4bool G4eeToHadrons::IsApplicable(const G4ParticleDefinition& p)98 {99 return (&p == G4Positron::Positron());100 }101 102 94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 103 95 -
trunk/source/processes/electromagnetic/highenergy/include/G4eeToHadronsModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eeToHadronsModel.hh,v 1. 6 2007/05/22 17:37:30vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eeToHadronsModel.hh,v 1.7 2008/07/10 18:06:38 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 63 63 public: 64 64 65 G4eeToHadronsModel( constG4Vee2hadrons*, G4int ver=0,65 G4eeToHadronsModel(G4Vee2hadrons*, G4int ver=0, 66 66 const G4String& nam = "eeToHadrons"); 67 67 … … 69 69 70 70 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 71 72 G4double PeakEnergy() const;73 71 74 72 virtual G4double CrossSectionPerVolume(const G4Material*, … … 99 97 G4DynamicParticle* GenerateCMPhoton(G4double); 100 98 99 inline G4double PeakEnergy() const; 100 101 101 private: 102 102 … … 107 107 G4eeToHadronsModel(const G4eeToHadronsModel&); 108 108 109 const G4Vee2hadrons*model;109 G4Vee2hadrons* model; 110 110 G4ParticleDefinition* theGamma; 111 111 G4PhysicsVector* crossPerElectron; … … 133 133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 134 134 135 inline G4double G4eeToHadronsModel::CrossSectionPerVolume(136 const G4Material* mat,137 const G4ParticleDefinition* p,138 G4double kineticEnergy,139 G4double, G4double)140 {141 return mat->GetElectronDensity()*142 ComputeCrossSectionPerElectron(p, kineticEnergy);143 }144 145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....146 147 inline G4double G4eeToHadronsModel::ComputeCrossSectionPerAtom(148 const G4ParticleDefinition* p,149 G4double kineticEnergy,150 G4double Z, G4double,151 G4double, G4double)152 {153 return Z*ComputeCrossSectionPerElectron(p, kineticEnergy);154 }155 156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....157 158 135 #endif -
trunk/source/processes/electromagnetic/highenergy/include/G4eeToHadronsMultiModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eeToHadronsMultiModel.hh,v 1. 5 2007/05/23 08:50:41vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eeToHadronsMultiModel.hh,v 1.7 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 59 59 60 60 class G4eeCrossSections; 61 class G4Vee2hadrons; 61 62 62 63 class G4eeToHadronsMultiModel : public G4VEmModel … … 84 85 G4double maxEnergy = DBL_MAX); 85 86 86 virtual G4double ComputeCrossSectionPerElectron(87 const G4ParticleDefinition*,88 G4double kineticEnergy,89 G4double cutEnergy = 0.0,90 G4double maxEnergy = DBL_MAX);91 92 87 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 93 88 const G4MaterialCutsCouple*, … … 96 91 G4double maxEnergy = DBL_MAX); 97 92 98 v oid PrintInfo();93 virtual void PrintInfo(); 99 94 100 95 // Set the factor to artificially increase the crossSection (default 1) 101 96 void SetCrossSecFactor(G4double fac); 102 97 98 inline G4double ComputeCrossSectionPerElectron( 99 const G4ParticleDefinition*, 100 G4double kineticEnergy, 101 G4double cutEnergy = 0.0, 102 G4double maxEnergy = DBL_MAX); 103 103 104 private: 105 106 void AddEEModel(G4Vee2hadrons*); 104 107 105 108 // hide assignment operator … … 128 131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 129 132 130 inline G4double G4eeToHadronsMultiModel::CrossSectionPerVolume(131 const G4Material* mat,132 const G4ParticleDefinition* p,133 G4double kineticEnergy,134 G4double, G4double)135 {136 return mat->GetElectronDensity()*137 ComputeCrossSectionPerElectron(p, kineticEnergy);138 }139 140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....141 142 inline G4double G4eeToHadronsMultiModel::ComputeCrossSectionPerAtom(143 const G4ParticleDefinition* p,144 G4double kineticEnergy,145 G4double Z, G4double,146 G4double, G4double)147 {148 return Z*ComputeCrossSectionPerElectron(p, kineticEnergy);149 }150 151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....152 153 133 inline G4double G4eeToHadronsMultiModel::ComputeCrossSectionPerElectron( 154 134 const G4ParticleDefinition*, … … 169 149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 170 150 171 inline172 void G4eeToHadronsMultiModel::SampleSecondaries(std::vector<G4DynamicParticle*>* newp,173 const G4MaterialCutsCouple* couple,174 const G4DynamicParticle* dp,175 G4double, G4double)176 {177 G4double kinEnergy = dp->GetKineticEnergy();178 if (kinEnergy > thKineticEnergy) {179 G4double q = cumSum[nModels-1]*G4UniformRand();180 for(G4int i=0; i<nModels; i++) {181 if(q <= cumSum[i]) {182 (models[i])->SampleSecondaries(newp, couple,dp);183 if(newp->size() > 0) fParticleChange->ProposeTrackStatus(fStopAndKill);184 break;185 }186 }187 }188 }189 190 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....191 192 151 #endif -
trunk/source/processes/electromagnetic/highenergy/include/G4eeToTwoPiModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eeToTwoPiModel.hh,v 1. 3 2007/05/22 17:37:30vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eeToTwoPiModel.hh,v 1.5 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 67 67 virtual ~G4eeToTwoPiModel(); 68 68 69 G4double ThresholdEnergy() const;69 virtual G4double ThresholdEnergy() const; 70 70 71 G4double PeakEnergy() const;71 virtual G4double PeakEnergy() const; 72 72 73 G4double ComputeCrossSection(G4double) const;73 virtual G4double ComputeCrossSection(G4double) const; 74 74 75 G4PhysicsVector* PhysicsVector(G4double, G4double) const;75 virtual G4PhysicsVector* PhysicsVector(G4double, G4double) const; 76 76 77 77 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 78 G4double, const G4ThreeVector&) const;78 G4double, const G4ThreeVector&); 79 79 80 80 private: 81 82 void Initialise();83 81 84 82 // hide assignment operator … … 90 88 G4double massPi; 91 89 G4double massRho; 92 G4double highEnergy;93 90 94 91 }; … … 96 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 97 94 98 inline G4double G4eeToTwoPiModel::ThresholdEnergy() const99 {100 return 2.0*massPi;101 }102 103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....104 105 inline G4double G4eeToTwoPiModel::PeakEnergy() const106 {107 return massRho;108 }109 110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....111 112 inline G4double G4eeToTwoPiModel::ComputeCrossSection(G4double e) const113 {114 G4double ee = std::min(GeV,e);115 return cross->CrossSection2pi(ee);116 }117 118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....119 120 95 #endif -
trunk/source/processes/electromagnetic/highenergy/include/G4hhIonisation.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4hhIonisation.hh,v 1. 5 2007/05/23 08:50:41vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4hhIonisation.hh,v 1.6 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 69 69 virtual ~G4hhIonisation(); 70 70 71 G4bool IsApplicable(const G4ParticleDefinition& p);71 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 72 72 73 G4double MinPrimaryEnergy(const G4ParticleDefinition* p,74 const G4Material*, G4double cut);73 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p, 74 const G4Material*, G4double cut); 75 75 76 76 // Print out of the class parameters … … 104 104 105 105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....107 108 inline G4bool G4hhIonisation::IsApplicable(const G4ParticleDefinition& p)109 {110 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 100.0*MeV &&111 !p.IsShortLived());112 }113 114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....115 116 inline G4double G4hhIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,117 const G4Material*,118 G4double cut)119 {120 G4double x = 0.5*cut/electron_mass_c2;121 G4double y = electron_mass_c2/mass;122 G4double g = x*y + std::sqrt((1. + x)*(1. + x*y*y));123 return mass*(g - 1.0);124 }125 126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....127 106 128 107 #endif -
trunk/source/processes/electromagnetic/highenergy/include/G4mplIonisation.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4mplIonisation.hh,v 1. 5 2007/05/23 08:50:41vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4mplIonisation.hh,v 1.6 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 72 72 virtual ~G4mplIonisation(); 73 73 74 G4bool IsApplicable(const G4ParticleDefinition& p);74 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 75 75 76 76 // Print out of the class parameters … … 94 94 95 95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....97 98 inline G4bool G4mplIonisation::IsApplicable(const G4ParticleDefinition& p)99 {100 return (p.GetParticleName() == "monopole");101 }102 103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....104 96 105 97 #endif -
trunk/source/processes/electromagnetic/highenergy/include/G4mplIonisationModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4mplIonisationModel.hh,v 1. 6 2007/11/13 18:36:29vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4mplIonisationModel.hh,v 1.7 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 120 120 121 121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 122 123 inline void G4mplIonisationModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,124 const G4MaterialCutsCouple*,125 const G4DynamicParticle*,126 G4double,127 G4double)128 {}129 130 inline G4double G4mplIonisationModel::Dispersion(131 const G4Material* material,132 const G4DynamicParticle* dp,133 G4double& tmax,134 G4double& length)135 {136 G4double siga = 0.0;137 G4double tau = dp->GetKineticEnergy()/mass;138 if(tau > 0.0) {139 G4double electronDensity = material->GetElectronDensity();140 G4double gam = tau + 1.0;141 G4double invbeta2 = (gam*gam)/(tau * (tau+2.0));142 siga = (invbeta2 - 0.5) * twopi_mc2_rcl2 * tmax * length143 * electronDensity * chargeSquare;144 }145 return siga;146 }147 148 149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/highenergy/src/G4AnnihiToMuPair.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4AnnihiToMuPair.cc,v 1. 3 2006/06/29 19:32:34 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4AnnihiToMuPair.cc,v 1.5 2008/10/16 14:29:48 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------ G4AnnihiToMuPair physics process ------ … … 66 66 67 67 CrossSecFactor = 1.; 68 SetProcessSubType(6); 69 68 70 } 69 71 … … 244 246 void G4AnnihiToMuPair::PrintInfoDefinition() 245 247 { 246 G4String comments ="e+e->mu+mu- annihilation, atomic e- at rest.\n"; 247 G4cout << G4endl << GetProcessName() << ": " << comments 248 << " threshold at " << LowestEnergyLimit/GeV << " GeV" 248 G4String comments ="e+e->mu+mu- annihilation, atomic e- at rest, SubType=."; 249 G4cout << G4endl << GetProcessName() << ": " << comments 250 << GetProcessSubType() << G4endl; 251 G4cout << " threshold at " << LowestEnergyLimit/GeV << " GeV" 249 252 << " good description up to " 250 253 << HighestEnergyLimit/TeV << " TeV for all Z." << G4endl; -
trunk/source/processes/electromagnetic/highenergy/src/G4BetheBlochNoDeltaModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BetheBlochNoDeltaModel.cc,v 1. 3 2006/06/29 19:32:36 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4BetheBlochNoDeltaModel.cc,v 1.4 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 58 58 {} 59 59 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 61 60 62 G4BetheBlochNoDeltaModel::~G4BetheBlochNoDeltaModel() 61 63 {} … … 63 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 64 66 67 G4double G4BetheBlochNoDeltaModel::ComputeDEDXPerVolume( 68 const G4Material* material, 69 const G4ParticleDefinition* pd, 70 G4double kinEnergy, G4double) 71 { 72 return 73 G4BetheBlochModel::ComputeDEDXPerVolume(material, pd, kinEnergy, DBL_MAX); 74 } 65 75 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 77 78 G4double G4BetheBlochNoDeltaModel::CrossSectionPerVolume( 79 const G4Material*,const G4ParticleDefinition*, 80 G4double, G4double, G4double) 81 { 82 return 0.0; 83 } 84 85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 86 87 -
trunk/source/processes/electromagnetic/highenergy/src/G4BraggNoDeltaModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BraggNoDeltaModel.cc,v 1. 3 2006/06/29 19:32:38 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4BraggNoDeltaModel.cc,v 1.4 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 53 53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 54 54 55 56 55 G4BraggNoDeltaModel::G4BraggNoDeltaModel(const G4ParticleDefinition*p, 57 56 const G4String& nam) : 58 57 G4BraggIonModel(p, nam) 59 58 {} 59 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 60 61 61 62 G4BraggNoDeltaModel::~G4BraggNoDeltaModel() … … 64 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 65 66 67 G4double G4BraggNoDeltaModel::ComputeDEDXPerVolume( 68 const G4Material* material, 69 const G4ParticleDefinition* pd, 70 G4double kinEnergy, G4double) 71 { 72 return 73 G4BraggIonModel::ComputeDEDXPerVolume(material, pd, kinEnergy, DBL_MAX); 74 } 66 75 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 77 78 G4double G4BraggNoDeltaModel::CrossSectionPerVolume( 79 const G4Material*, 80 const G4ParticleDefinition*, 81 G4double, G4double, G4double) 82 { 83 return 0.0; 84 } 85 86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 87 88 -
trunk/source/processes/electromagnetic/highenergy/src/G4GammaConversionToMuons.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4GammaConversionToMuons.cc,v 1. 4 2006/06/29 19:32:40 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4GammaConversionToMuons.cc,v 1.7 2008/10/16 14:29:48 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------ G4GammaConversionToMuons physics process ------ … … 51 51 HighestEnergyLimit(1e21*eV), // ok to 1e21eV=1e12GeV, then LPM suppression 52 52 CrossSecFactor(1.) 53 { } 53 { 54 SetProcessSubType(15); 55 } 54 56 55 57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... … … 261 263 G4double xxp=1.-4./3.*xPM; // the main xPlus dependence 262 264 result=xxp*log(W)*LogWmaxInv; 263 if(result>1.) 264 { G4cout << "error in dSigxPlusGen, result=" << result << " is >1" << '\n';265 exit(10);265 if(result>1.) { 266 G4cout << "G4GammaConversionToMuons::PostStepDoIt WARNING:" 267 << " in dSigxPlusGen, result=" << result << " > 1" << G4endl; 266 268 } 267 269 } … … 285 287 f1=(1.-2.*xPM+4.*xPM*t*(1.-t)) / (1.+C1/(t*t)); 286 288 if(f1<0 || f1> f1_max) // should never happend 287 { G4cout << "outside allowed range f1=" << f1 << G4endl; 288 exit(1); 289 } 289 { 290 G4cout << "G4GammaConversionToMuons::PostStepDoIt WARNING:" 291 << "outside allowed range f1=" << f1 << " is set to zero" 292 << G4endl; 293 f1 = 0.0; 294 } 290 295 } 291 296 while ( G4UniformRand()*f1_max > f1); … … 299 304 f2=1.-2.*xPM+4.*xPM*t*(1.-t)*(1.+cos(2.*psi)); 300 305 if(f2<0 || f2> f2_max) // should never happend 301 { G4cout << "outside allowed range f2=" << f2 << G4endl; 302 exit(1); 303 } 306 { 307 G4cout << "G4GammaConversionToMuons::PostStepDoIt WARNING:" 308 << "outside allowed range f2=" << f2 << " is set to zero" 309 << G4endl; 310 f2 = 0.0; 311 } 304 312 } 305 313 while ( G4UniformRand()*f2_max > f2); … … 387 395 void G4GammaConversionToMuons::PrintInfoDefinition() 388 396 { 389 G4String comments ="gamma->mu+mu- Bethe Heitler process .\n";397 G4String comments ="gamma->mu+mu- Bethe Heitler process, SubType= "; 390 398 G4cout << G4endl << GetProcessName() << ": " << comments 391 << " good cross section parametrization from " 399 << GetProcessSubType() << G4endl; 400 G4cout << " good cross section parametrization from " 392 401 << G4BestUnit(LowestEnergyLimit,"Energy") 393 402 << " to " << HighestEnergyLimit/GeV << " GeV for all Z." << G4endl; -
trunk/source/processes/electromagnetic/highenergy/src/G4eeCrossSections.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eeCrossSections.cc,v 1. 6 2006/06/29 19:32:42 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4eeCrossSections.cc,v 1.7 2008/07/10 18:06:39 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 39 39 // 40 40 // Modifications: 41 // 41 // 10.07.2008 Updated for PDG Jour. Physics, G33, 1 (2006) 42 42 // 43 43 // ------------------------------------------------------------------- … … 52 52 #include "G4PionMinus.hh" 53 53 #include "G4PionZero.hh" 54 #include "G4Eta.hh" 54 55 #include "G4KaonPlus.hh" 55 56 #include "G4KaonMinus.hh" … … 80 81 MsPi = G4PionPlus::PionPlus()->GetPDGMass(); 81 82 MsPi0= G4PionZero::PionZero()->GetPDGMass(); 82 MsEta= 547.30*MeV;83 MsEta= G4Eta::Eta()->GetPDGMass(); 83 84 MsEtap=957.78*MeV; 84 85 MsKs = G4KaonZeroLong::KaonZeroLong()->GetPDGMass(); 85 MsKc =G4KaonPlus::KaonPlus()->GetPDGMass();86 MsRho= 77 0.0*MeV;87 MsOm = 78 1.94*MeV;86 MsKc = G4KaonPlus::KaonPlus()->GetPDGMass(); 87 MsRho= 775.5*MeV; 88 MsOm = 782.62*MeV; 88 89 MsF0 = 980.0*MeV; 89 MsA0 = 98 3.4*MeV;90 MsPhi= 1019.4 13*MeV;90 MsA0 = 984.7*MeV; 91 MsPhi= 1019.46*MeV; 91 92 MsK892 = 891.66*MeV; 92 MsK0892 = 896. 10*MeV;93 GRho = 1 50.7*MeV;94 GOm = 8.4 1*MeV;95 GPhi = 4. 43*MeV;93 MsK0892 = 896.0*MeV; 94 GRho = 149.4*MeV; 95 GOm = 8.49*MeV; 96 GPhi = 4.26*MeV; 96 97 GK892 = 50.8*MeV; 97 GK0892 = 50. 5*MeV;98 GK0892 = 50.3*MeV; 98 99 PhRho = 0.0; 99 100 PhOm = 0.0; … … 103 104 BrRhoPiG = 4.5e-4; 104 105 BrRhoPi0G= 6.8e-4; 105 BrRhoEtaG= 2. 4e-4;106 BrRhoEe = 4. 49e-5;107 BrOm3Pi = 0.8 88;108 BrOmPi0G= 0.08 5;109 BrOmEtaG= 6.5e-4;110 BrOm2Pi = 0.0 221;106 BrRhoEtaG= 2.95e-4; 107 BrRhoEe = 4.7e-5; 108 BrOm3Pi = 0.891; 109 BrOmPi0G= 0.089; 110 BrOmEtaG= 4.9e-4; 111 BrOm2Pi = 0.017; 111 112 PhOm2Pi = 90.0; 112 BrOmEe = 7. 07e-5;113 BrPhi2Kc = 0.49 1;114 BrPhiKsKl= 0.34 1;115 BrPhi3Pi = 0.15 5;116 BrPhiPi0G= 1. 31e-3;117 BrPhiEtaG= 1. 26e-2;118 BrPhi2Pi = 8.e-5;113 BrOmEe = 7.18e-5; 114 BrPhi2Kc = 0.492; 115 BrPhiKsKl= 0.34; 116 BrPhi3Pi = 0.153; 117 BrPhiPi0G= 1.25e-3; 118 BrPhiEtaG= 1.301e-2; 119 BrPhi2Pi = 7.3e-5; 119 120 PhPhi2Pi = -20.0*degree; 120 BrPhiEe = 2.9 9e-4;121 BrPhiEe = 2.97e-4; 121 122 122 123 MsRho3 = MsRho*MsRho*MsRho; … … 125 126 126 127 MeVnb = 3.8938e+11*nanobarn; 127 Alpha = 1.0/137.036;128 Alpha = fine_structure_const; 128 129 129 130 AOmRho = 3.0; … … 134 135 brsigpipi = 1.; 135 136 136 msrho1450 = 14 65.*MeV;137 msrho1700 = 1 700.*MeV;138 grho1450 = 310.*MeV;139 grho1700 = 240.*MeV;137 msrho1450 = 1459.*MeV; 138 msrho1700 = 1688.8*MeV; 139 grho1450 = 171.*MeV; 140 grho1700 = 161.*MeV; 140 141 arhoompi0 = 1.; 141 142 arho1450ompi0 = 1.; … … 190 191 191 192 G4double G4eeCrossSections::CrossSection2pi(G4double e) 192 { 193 193 { 194 194 complex<G4double> xr(cos(PhRho),sin(PhRho)); 195 195 complex<G4double> xo(cos(PhOm2Pi),sin(PhOm2Pi)); … … 205 205 + sqrt(Width2p(s,MsOm,GOm,BrOm2Pi,MsPi)*MsOm3*BrOmEe*GOm)*xo/dom 206 206 + sqrt(Width2p(s,MsPhi,GPhi,BrPhi2Pi,MsPi)*MsPhi3*BrPhiEe*GPhi)*xf/dphi; 207 208 G4double cross = 12.0*pi*MeVnb*norm(amp)/(e*s); 209 210 return cross; 211 } 212 213 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 214 215 G4double G4eeCrossSections::CrossSection3pi(G4double e) 216 { 217 complex<G4double> xf(cos(PhPhi2Pi),sin(PhPhi)); 218 219 G4double s = e*e; 220 complex<G4double> dom = DpOm(e); 221 complex<G4double> dphi = DpPhi(e); 222 223 complex<G4double> amp = 224 sqrt(Width3p(s,MsOm,GOm,BrOm3Pi)*MsOm3*BrOmEe*GOm)/dom 225 + sqrt(Width3p(s,MsPhi,GPhi,BrPhi3Pi)*MsPhi3*BrPhiEe*GPhi)*xf/dphi; 226 227 G4double cross = 12.0*pi*MeVnb*norm(amp)/(e*s); 228 229 return cross; 230 } 231 232 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 233 234 G4double G4eeCrossSections::CrossSectionPi0G(G4double e) 235 { 236 complex<G4double> xf(cos(PhPhi),sin(PhPhi)); 237 238 G4double s = e*e; 239 complex<G4double> drho = DpRho(e); 240 complex<G4double> dom = DpOm(e); 241 complex<G4double> dphi = DpPhi(e); 242 243 complex<G4double> amp = 244 sqrt(WidthPg(s,MsRho,GRho,BrRhoPi0G,MsPi0)*MsRho3*BrRhoEe*GRho)/drho 245 + sqrt(WidthPg(s,MsOm,GOm,BrOmPi0G,MsPi0)*MsOm3*BrOmEe*GOm)/dom 246 + sqrt(WidthPg(s,MsPhi,GPhi,BrPhiPi0G,MsPi0)*MsPhi3*BrPhiEe*GPhi)*xf/dphi; 247 248 G4double cross = 12.0*pi*MeVnb*norm(amp)/(e*s); 249 250 return cross; 251 } 252 253 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 254 255 G4double G4eeCrossSections::CrossSectionEtaG(G4double e) 256 { 257 complex<G4double> xf(cos(PhPhi),sin(PhPhi)); 258 259 G4double s = e*e; 260 complex<G4double> drho = DpRho(e); 261 complex<G4double> dom = DpOm(e); 262 complex<G4double> dphi = DpPhi(e); 263 264 complex<G4double> amp = 265 sqrt(WidthPg(s,MsRho,GRho,BrRhoEtaG,MsEta)*MsRho3*BrRhoEe*GRho)/drho 266 + sqrt(WidthPg(s,MsOm,GOm,BrOmEtaG,MsEta)*MsOm3*BrOmEe*GOm)/dom 267 + sqrt(WidthPg(s,MsPhi,GPhi,BrPhiEtaG,MsEta)*MsPhi3*BrPhiEe*GPhi)*xf/dphi; 268 269 G4double cross = 12.0*pi*MeVnb*norm(amp)/(e*s); 270 271 return cross; 272 } 273 274 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 275 276 G4double G4eeCrossSections::CrossSection2Kcharged(G4double e) 277 { 278 G4double s = e*e; 279 complex<G4double> dphi = DpPhi(e); 280 281 complex<G4double> amp = 282 sqrt(Width2p(s,MsPhi,GPhi,BrPhi2Kc,MsKc)*MsPhi3*BrPhiEe*GPhi)/dphi; 283 284 G4double cross = 12.0*pi*MeVnb*norm(amp)/(e*s); 285 286 return cross; 287 } 288 289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 290 291 G4double G4eeCrossSections::CrossSection2Kneutral(G4double e) 292 { 293 G4double s = e*e; 294 complex<G4double> dphi = DpPhi(e); 295 296 complex<G4double> amp = 297 sqrt(Width2p(s,MsPhi,GPhi,BrPhiKsKl,MsKs)*MsPhi3*BrPhiEe*GPhi)/dphi; 207 298 208 299 G4double cross = 12.0*pi*MeVnb*norm(amp)/(e*s); … … 238 329 G4double G4eeCrossSections::PhaseSpace3p(G4double e) 239 330 { 240 331 // E.A.Kuraev, Z.K.Silagadze. 332 // Once more about the omega->3 pi contact term. 333 // Yadernaya Phisica, 1995, V58, N9, p.1678-1694. 334 241 335 // G4bool b; 242 336 // G4double x = ph3p->GetValue(e, b); -
trunk/source/processes/electromagnetic/highenergy/src/G4eeToHadrons.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eeToHadrons.cc,v 1. 7 2006/06/29 19:32:44 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4eeToHadrons.cc,v 1.9 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 64 64 isInitialised(false) 65 65 { 66 SetVerboseLevel(1); 66 SetVerboseLevel(1); 67 SetProcessSubType(fAnnihilationToHadrons); 67 68 } 68 69 … … 71 72 G4eeToHadrons::~G4eeToHadrons() 72 73 {} 74 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 76 77 G4bool G4eeToHadrons::IsApplicable(const G4ParticleDefinition& p) 78 { 79 return (&p == G4Positron::Positron()); 80 } 73 81 74 82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/highenergy/src/G4eeToHadronsModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eeToHadronsModel.cc,v 1. 8 2007/05/22 17:37:30vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eeToHadronsModel.cc,v 1.9 2008/07/10 18:06:39 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 65 65 using namespace std; 66 66 67 G4eeToHadronsModel::G4eeToHadronsModel(const G4Vee2hadrons* m, 68 G4int ver, 67 G4eeToHadronsModel::G4eeToHadronsModel(G4Vee2hadrons* m, G4int ver, 69 68 const G4String& nam) 70 69 : G4VEmModel(nam), 71 model(m),72 crossPerElectron(0),73 crossBornPerElectron(0),74 isInitialised(false),75 nbins(100),76 verbose(ver)77 { 78 theGamma = G4Gamma::Gamma();70 model(m), 71 crossPerElectron(0), 72 crossBornPerElectron(0), 73 isInitialised(false), 74 nbins(100), 75 verbose(ver) 76 { 77 theGamma = G4Gamma::Gamma(); 79 78 } 80 79 … … 96 95 isInitialised = true; 97 96 97 // Lab system 98 98 highKinEnergy = HighEnergyLimit(); 99 99 lowKinEnergy = LowEnergyLimit(); 100 100 101 emin = model->ThresholdEnergy(); 102 emax = 2.0*electron_mass_c2*sqrt(1.0 + 0.5*highKinEnergy/electron_mass_c2); 103 if(emin > emax) emin = emax; 104 105 lowKinEnergy = 0.5*emin*emin/electron_mass_c2 - 2.0*electron_mass_c2; 106 107 epeak = min(model->PeakEnergy(), emax); 101 // CM system 102 emin = model->LowEnergy(); 103 emax = model->HighEnergy(); 104 105 G4double emin0 = 106 2.0*electron_mass_c2*sqrt(1.0 + 0.5*lowKinEnergy/electron_mass_c2); 107 G4double emax0 = 108 2.0*electron_mass_c2*sqrt(1.0 + 0.5*highKinEnergy/electron_mass_c2); 109 110 // recompute low energy 111 if(emin0 > emax) { 112 emin0 = emax; 113 model->SetLowEnergy(emin0); 114 } 115 if(emin > emin0) { 116 emin0 = emin; 117 lowKinEnergy = 0.5*emin*emin/electron_mass_c2 - 2.0*electron_mass_c2; 118 SetLowEnergyLimit(lowKinEnergy); 119 } 120 121 // recompute high energy 122 if(emax < emax0) { 123 emax0 = emax; 124 highKinEnergy = 0.5*emax*emax/electron_mass_c2 - 2.0*electron_mass_c2; 125 SetHighEnergyLimit(highKinEnergy); 126 } 127 128 // peak energy 129 epeak = std::min(model->PeakEnergy(), emax); 108 130 peakKinEnergy = 0.5*epeak*epeak/electron_mass_c2 - 2.0*electron_mass_c2; 109 131 … … 148 170 } 149 171 } 172 } 173 174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 175 176 G4double G4eeToHadronsModel::CrossSectionPerVolume( 177 const G4Material* mat, 178 const G4ParticleDefinition* p, 179 G4double kineticEnergy, 180 G4double, G4double) 181 { 182 return mat->GetElectronDensity()* 183 ComputeCrossSectionPerElectron(p, kineticEnergy); 184 } 185 186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 187 188 G4double G4eeToHadronsModel::ComputeCrossSectionPerAtom( 189 const G4ParticleDefinition* p, 190 G4double kineticEnergy, 191 G4double Z, G4double, 192 G4double, G4double) 193 { 194 return Z*ComputeCrossSectionPerElectron(p, kineticEnergy); 150 195 } 151 196 -
trunk/source/processes/electromagnetic/highenergy/src/G4eeToHadronsMultiModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eeToHadronsMultiModel.cc,v 1. 4 2007/05/23 08:50:41 vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eeToHadronsMultiModel.cc,v 1.6 2008/07/11 17:49:11 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 34 34 // File name: G4eeToHadronsMultiModel 35 35 // 36 // Author: Vladimir Ivanchenko on base of Michel Maire code36 // Author: Vladimir Ivanchenko 37 37 // 38 38 // Creation date: 02.08.2004 … … 51 51 #include "G4eeToHadronsMultiModel.hh" 52 52 #include "G4eeToTwoPiModel.hh" 53 #include "G4eeTo3PiModel.hh" 54 #include "G4eeToPGammaModel.hh" 55 #include "G4ee2KNeutralModel.hh" 56 #include "G4ee2KChargedModel.hh" 53 57 #include "G4eeCrossSections.hh" 58 #include "G4Vee2hadrons.hh" 54 59 55 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 80 85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 81 86 82 void G4eeToHadronsMultiModel::Initialise(const G4ParticleDefinition* p, const G4DataVector& v) 87 void G4eeToHadronsMultiModel::Initialise(const G4ParticleDefinition*, 88 const G4DataVector&) 83 89 { 84 90 if(!isInitialised) { 85 91 isInitialised = true; 86 92 87 thKineticEnergy = DBL_MAX;88 maxKineticEnergy = HighEnergyLimit();93 thKineticEnergy = DBL_MAX; 94 maxKineticEnergy = 1.2*GeV; 89 95 90 96 cross = new G4eeCrossSections(); 91 G4eeToHadronsModel* model = 92 new G4eeToHadronsModel(new G4eeToTwoPiModel(cross), verbose); 93 models.push_back(model); 94 model->SetHighEnergyLimit(maxKineticEnergy); 95 model->Initialise(p, v); 96 G4double emin = model->LowEnergyLimit(); 97 if(emin < thKineticEnergy) thKineticEnergy = emin; 98 ekinMin.push_back(emin); 99 ekinMax.push_back(model->HighEnergyLimit()); 100 ekinPeak.push_back(model->PeakEnergy()); 101 cumSum.push_back(0.0); 102 nModels = 1; 103 104 if(pParticleChange) 97 98 G4eeToTwoPiModel* m2pi = new G4eeToTwoPiModel(cross); 99 m2pi->SetHighEnergy(maxKineticEnergy); 100 AddEEModel(m2pi); 101 102 G4eeTo3PiModel* m3pi1 = new G4eeTo3PiModel(cross); 103 m3pi1->SetHighEnergy(0.95*GeV); 104 AddEEModel(m3pi1); 105 106 G4eeTo3PiModel* m3pi2 = new G4eeTo3PiModel(cross); 107 m3pi2->SetLowEnergy(0.95*GeV); 108 m3pi2->SetHighEnergy(maxKineticEnergy); 109 AddEEModel(m3pi2); 110 111 G4ee2KChargedModel* m2kc = new G4ee2KChargedModel(cross); 112 m2kc->SetHighEnergy(maxKineticEnergy); 113 AddEEModel(m2kc); 114 115 G4ee2KNeutralModel* m2kn = new G4ee2KNeutralModel(cross); 116 m2kn->SetHighEnergy(maxKineticEnergy); 117 AddEEModel(m2kn); 118 119 G4eeToPGammaModel* mpg1 = new G4eeToPGammaModel(cross,"pi0"); 120 mpg1->SetLowEnergy(0.7*GeV); 121 mpg1->SetHighEnergy(maxKineticEnergy); 122 AddEEModel(mpg1); 123 124 G4eeToPGammaModel* mpg2 = new G4eeToPGammaModel(cross,"eta"); 125 mpg2->SetLowEnergy(0.7*GeV); 126 mpg2->SetHighEnergy(maxKineticEnergy); 127 AddEEModel(mpg2); 128 129 nModels = models.size(); 130 131 if(pParticleChange) { 105 132 fParticleChange = 106 133 reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 107 else134 } else { 108 135 fParticleChange = new G4ParticleChangeForGamma(); 136 } 137 } 138 } 139 140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 141 142 void G4eeToHadronsMultiModel::AddEEModel(G4Vee2hadrons* mod) 143 { 144 G4eeToHadronsModel* model = new G4eeToHadronsModel(mod, verbose); 145 model->SetLowEnergyLimit(LowEnergyLimit()); 146 model->SetHighEnergyLimit(HighEnergyLimit()); 147 models.push_back(model); 148 G4double elow = mod->ThresholdEnergy(); 149 ekinMin.push_back(elow); 150 if(thKineticEnergy > elow) thKineticEnergy = elow; 151 ekinMax.push_back(mod->HighEnergy()); 152 ekinPeak.push_back(mod->PeakEnergy()); 153 cumSum.push_back(0.0); 154 } 155 156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 157 158 G4double G4eeToHadronsMultiModel::CrossSectionPerVolume( 159 const G4Material* mat, 160 const G4ParticleDefinition* p, 161 G4double kineticEnergy, 162 G4double, G4double) 163 { 164 return mat->GetElectronDensity()* 165 ComputeCrossSectionPerElectron(p, kineticEnergy); 166 } 167 168 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 169 170 G4double G4eeToHadronsMultiModel::ComputeCrossSectionPerAtom( 171 const G4ParticleDefinition* p, 172 G4double kineticEnergy, 173 G4double Z, G4double, 174 G4double, G4double) 175 { 176 return Z*ComputeCrossSectionPerElectron(p, kineticEnergy); 177 } 178 179 180 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 181 182 void G4eeToHadronsMultiModel::SampleSecondaries(std::vector<G4DynamicParticle*>* newp, 183 const G4MaterialCutsCouple* couple, 184 const G4DynamicParticle* dp, 185 G4double, G4double) 186 { 187 G4double kinEnergy = dp->GetKineticEnergy(); 188 if (kinEnergy > thKineticEnergy) { 189 G4double q = cumSum[nModels-1]*G4UniformRand(); 190 for(G4int i=0; i<nModels; i++) { 191 if(q <= cumSum[i]) { 192 (models[i])->SampleSecondaries(newp, couple,dp); 193 if(newp->size() > 0) fParticleChange->ProposeTrackStatus(fStopAndKill); 194 break; 195 } 196 } 109 197 } 110 198 } … … 115 203 { 116 204 if(verbose > 0) { 117 G4cout << " e+ annihilation into hadrons active above " 118 << thKineticEnergy/GeV << " GeV" 205 G4double e1 = 0.5*thKineticEnergy*thKineticEnergy/electron_mass_c2 206 - 2.0*electron_mass_c2; 207 G4double e2 = 0.5*maxKineticEnergy*maxKineticEnergy/electron_mass_c2 208 - 2.0*electron_mass_c2; 209 G4cout << " e+ annihilation into hadrons active from " 210 << e1/GeV << " GeV to " << e2/GeV << " GeV" 119 211 << G4endl; 120 212 } … … 128 220 csFactor = fac; 129 221 if(verbose > 0) 130 G4cout << "### G4eeToHadronsMultiModel: The cross section for G4eeToHadronsMultiModel is"131 << " increased by the Factor= " << csFactor << G4endl;132 } 133 } 134 135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 222 G4cout << "### G4eeToHadronsMultiModel: The cross section for G4eeToHadronsMultiModel " 223 << " is increased by the Factor= " << csFactor << G4endl; 224 } 225 } 226 227 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/highenergy/src/G4eeToTwoPiModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eeToTwoPiModel.cc,v 1. 5 2007/05/22 17:37:30vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eeToTwoPiModel.cc,v 1.7 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 64 64 cross(cr) 65 65 { 66 Initialise(); 66 massPi = G4PionPlus::PionPlus()->GetPDGMass(); 67 massRho = 775.5*MeV; 67 68 } 68 69 … … 74 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 75 76 76 void G4eeToTwoPiModel::Initialise() 77 G4double G4eeToTwoPiModel::ThresholdEnergy() const 77 78 { 78 massPi = G4PionPlus::PionPlus()->GetPDGMass(); 79 massRho = 770.*MeV; 80 highEnergy = 1.*GeV; 81 cross = new G4eeCrossSections(); 79 return 2.0*massPi; 80 } 81 82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 83 84 G4double G4eeToTwoPiModel::PeakEnergy() const 85 { 86 return massRho; 87 } 88 89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 90 91 G4double G4eeToTwoPiModel::ComputeCrossSection(G4double e) const 92 { 93 G4double ee = std::min(HighEnergy(),e); 94 return cross->CrossSection2pi(ee); 82 95 } 83 96 … … 87 100 G4double emax) const 88 101 { 89 G4double tmin = max(emin, 2.0*massPi);90 G4double tmax = max(tmin, emax);102 G4double tmin = std::max(emin, 2.0*massPi); 103 G4double tmax = std::max(tmin, emax); 91 104 G4int nbins = (G4int)((tmax - tmin)/(5.*MeV)); 92 105 G4PhysicsVector* v = new G4PhysicsLinearVector(emin,emax,nbins); 106 v->SetSpline(true); 93 107 return v; 94 108 } … … 97 111 98 112 void G4eeToTwoPiModel::SampleSecondaries(std::vector<G4DynamicParticle*>* newp, 99 G4double e, const G4ThreeVector& direction) const113 G4double e, const G4ThreeVector& direction) 100 114 { 101 115 … … 113 127 dir.rotateUz(direction); 114 128 115 // create G4DynamicParticle object for delta ray129 // create G4DynamicParticle objects 116 130 G4DynamicParticle* pip = 117 131 new G4DynamicParticle(G4PionPlus::PionPlus(),dir,tkin); -
trunk/source/processes/electromagnetic/highenergy/src/G4hhIonisation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4hhIonisation.cc,v 1. 6 2007/05/22 17:37:30vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4hhIonisation.cc,v 1.9 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 64 64 isInitialised(false) 65 65 { 66 minKinEnergy = 0.1*keV;67 maxKinEnergy = 100.*TeV;68 SetDEDXBinning(120);69 SetMinKinEnergy(minKinEnergy);70 SetMaxKinEnergy(maxKinEnergy);71 66 SetStepFunction(0.1, 0.1*mm); 72 67 SetVerboseLevel(1); 68 SetProcessSubType(fIonisation); 73 69 mass = 0.0; 74 70 ratio = 0.0; … … 79 75 G4hhIonisation::~G4hhIonisation() 80 76 {} 77 78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 79 80 G4bool G4hhIonisation::IsApplicable(const G4ParticleDefinition& p) 81 { 82 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 100.0*MeV && 83 !p.IsShortLived()); 84 } 85 86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 87 88 G4double G4hhIonisation::MinPrimaryEnergy(const G4ParticleDefinition*, 89 const G4Material*, 90 G4double cut) 91 { 92 G4double x = 0.5*cut/electron_mass_c2; 93 G4double y = electron_mass_c2/mass; 94 G4double g = x*y + std::sqrt((1. + x)*(1. + x*y*y)); 95 return mass*(g - 1.0); 96 } 81 97 82 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 101 117 G4int nm = 1; 102 118 119 minKinEnergy = MinKinEnergy(); 120 103 121 if(eth > minKinEnergy) { 104 122 G4VEmModel* em = new G4BraggNoDeltaModel(); … … 109 127 } 110 128 111 if(eth < maxKinEnergy) {129 if(eth < MaxKinEnergy()) { 112 130 G4VEmModel* em1 = new G4BetheBlochNoDeltaModel(); 113 131 em1->SetLowEnergyLimit(std::max(eth,minKinEnergy)); 114 em1->SetHighEnergyLimit( maxKinEnergy);132 em1->SetHighEnergyLimit(MaxKinEnergy()); 115 133 AddEmModel(nm, em1, flucModel); 116 134 } 117 135 118 if(verboseLevel> 0)136 if(verboseLevel>1) { 119 137 G4cout << "G4hhIonisation is initialised: Nmodels= " << nm << G4endl; 120 138 } 121 139 isInitialised = true; 122 140 } … … 127 145 { 128 146 G4cout << " Delta-ray will not be produced; " 129 << "Bether-Bloch model for E > " << std::max(eth,minKinEnergy)130 147 << G4endl; 131 if(eth > minKinEnergy) G4cout132 << " ICRU49 parametrisation scaled from protons below.";133 G4cout << G4endl;134 148 } 135 149 -
trunk/source/processes/electromagnetic/highenergy/src/G4mplIonisation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4mplIonisation.cc,v 1. 5 2007/05/31 11:13:31vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4mplIonisation.cc,v 1.8 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 64 64 65 65 SetVerboseLevel(0); 66 SetProcessSubType(fIonisation); 67 SetStepFunction(0.2, 1*mm); 66 68 } 67 69 … … 70 72 G4mplIonisation::~G4mplIonisation() 71 73 {} 74 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 76 77 G4bool G4mplIonisation::IsApplicable(const G4ParticleDefinition& p) 78 { 79 return (p.GetParticleName() == "monopole"); 80 } 72 81 73 82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 82 91 83 92 G4mplIonisationModel* ion = new G4mplIonisationModel(magneticCharge,"PAI"); 84 ion->SetLowEnergyLimit( 0.1*keV);85 ion->SetHighEnergyLimit( 100.*TeV);93 ion->SetLowEnergyLimit(MinKinEnergy()); 94 ion->SetHighEnergyLimit(MaxKinEnergy()); 86 95 AddEmModel(0,ion,ion); 87 88 SetStepFunction(0.2, 1*mm);89 96 90 97 isInitialised = true; -
trunk/source/processes/electromagnetic/highenergy/src/G4mplIonisationModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4mplIonisationModel.cc,v 1. 5 2007/11/13 18:36:29vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4mplIonisationModel.cc,v 1.6 2009/02/20 16:38:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 139 139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 140 140 141 G4double G4mplIonisationModel::ComputeDEDXAhlen(const G4Material* material, G4double bg2) 141 G4double G4mplIonisationModel::ComputeDEDXAhlen(const G4Material* material, 142 G4double bg2) 142 143 { 143 144 G4double eDensity = material->GetElectronDensity(); … … 176 177 return dedx; 177 178 } 179 180 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 181 182 void G4mplIonisationModel::SampleSecondaries(std::vector<G4DynamicParticle*>*, 183 const G4MaterialCutsCouple*, 184 const G4DynamicParticle*, 185 G4double, 186 G4double) 187 {} 178 188 179 189 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 204 214 return loss; 205 215 } 216 217 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 218 219 G4double G4mplIonisationModel::Dispersion(const G4Material* material, 220 const G4DynamicParticle* dp, 221 G4double& tmax, 222 G4double& length) 223 { 224 G4double siga = 0.0; 225 G4double tau = dp->GetKineticEnergy()/mass; 226 if(tau > 0.0) { 227 G4double electronDensity = material->GetElectronDensity(); 228 G4double gam = tau + 1.0; 229 G4double invbeta2 = (gam*gam)/(tau * (tau+2.0)); 230 siga = (invbeta2 - 0.5) * twopi_mc2_rcl2 * tmax * length 231 * electronDensity * chargeSquare; 232 } 233 return siga; 234 } 235 236 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/lowenergy/GNUmakefile
r819 r961 1 # $Id: GNUmakefile,v 1. 5 2003/09/20 14:41:31 vnivanchExp $1 # $Id: GNUmakefile,v 1.7 2008/11/20 12:06:28 alechner Exp $ 2 2 # -------------------------------------------------------------------- 3 3 # GNUmakefile for electromagnetic sub-library. John Allison, 25/6/98. … … 14 14 CPPFLAGS += -I$(G4BASE)/global/management/include \ 15 15 -I$(G4BASE)/global/HEPRandom/include \ 16 -I$(G4BASE)/global/HEPNumerics/include \ 16 17 -I$(G4BASE)/global/HEPGeometry/include \ 17 18 -I$(G4BASE)/geometry/management/include \ … … 20 21 -I$(G4BASE)/processes/cuts/include \ 21 22 -I$(G4BASE)/processes/electromagnetic/utils/include \ 23 -I$(G4BASE)/processes/electromagnetic/standard/include \ 22 24 -I$(G4BASE)/particles/management/include \ 23 25 -I$(G4BASE)/particles/bosons/include \ -
trunk/source/processes/electromagnetic/lowenergy/History
r819 r961 1 $Id: History,v 1. 284 2007/11/26 17:27:09 piaExp $1 $Id: History,v 1.346 2009/02/20 10:49:54 sincerti Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20 16.02.2009, S. Incerti, tag emlowen-V09-02-15 21 - added protections against FPE in G4hLowEnergyLoss.cc (see EM forum 22 item 893) 23 24 16.02.2009, S. Incerti, tag emlowen-V09-02-14 25 - removed compilation warning in G4DNAEmfietzoglouExcitationModel.cc 26 27 16.02.2009, S. Incerti, tag emlowen-V09-02-13 28 - improved energy limit display in Geant4-DNA model classes 29 - commented InitialiseElementSelectors call. 30 31 16.02.2009, S. Incerti, tag emlowen-V09-02-12 32 Made compatible with tag emutils-V09-02-00 the following files 33 - G4DNAElastic.cc 34 - G4DNAExcitation.cc 35 - G4DNAIonisation.cc 36 - G4DNAChargeDecrease.cc 37 - G4DNAChargeIncrease.cc 38 39 14.02.2009, S. Incerti, tag emlowen-V09-02-11 40 Added several corrections to migrated Geant4-DNA processes: 41 - G4DNABornIonisationModel.cc 42 - G4DNAEmfietzoglouExcitationModel.cc 43 - G4DNARuddIonisationModel.cc 44 - G4DNAIonisation.hh 45 46 10.02.2009, L. Pandola, tag emlowen-V09-02-10 47 - Added G4LivermoreIonisationModel, namely first implementation of 48 LowEnergyIonisation in the new design 49 50 29.01.2009, L. Pandola, tag emlowen-V09-02-09 51 - Updated public interface of G4eIonisationCrossSectionHandler.cc in order to 52 facilitate the migration from G4LowEnergyIonisation to G4LivermoreIonisationModel 53 54 22.01.2009, S. Incerti, tag emlowen-V09-02-08 55 - Fixed compilation error problem & code syntax in DNA model classes 56 57 21.01.2009, S. Incerti, tag emlowen-V09-02-07 58 - Updated Livermore photon processes classes for handling of compound materials 59 - Added pointer removal protections 60 - Involved classes are : 61 G4LivermoreRayleighModel.cc 62 G4LivermorePolarizedRayleighModel.cc 63 G4LivermorePolarizedComptonModel.cc 64 G4LivermorePhotoElectricModel.cc 65 G4LivermoreGammaconversionModel.cc 66 G4LivermoreComptonModel.cc 67 68 20.01.2009, S. Incerti, tag emlowen-V09-02-06 69 Added 'kill particle without total energy deposit' feature for DNA charge change processes 70 Involved files are : 71 - G4DNAProcess.icc, 72 - G4FinalStateProduct.hh,.cc, 73 - G4FinalStateChargeDecrease.cc 74 - G4FinalStateChargeIncrease.cc 75 76 20.01.2009, S. Incerti, tag emlowen-V09-02-05 77 - Corrected energy limits in G4CrossSectionIonisationBornPartial.cc 78 - Added proton case in G4CrossSectionExcitationMillerGreenPartial.cc 79 - Added protection (waterExcitation.ExcitationEnergy) in G4CrossSectionExcitationMillerGreenPartial.cc 80 81 19.01.2009, S. Incerti, tag emlowen-V09-02-04 82 Added angle initialisation in G4DNAScreenedRutherfordElasticModel 83 84 12.01.2009, S. Incerti, tag emlowen-V09-02-03 85 Added preliminary migrated Geant4-DNA processes and models. 86 87 08.01.2009 L. Pandola, tag emlowen-V09-02-02 88 Edited G4PenelopePhotoElectric.cc and G4PenelopePhotoElectricModel.cc 89 to suppress a warning message from G4AtomicTransitionManager appearing 90 for some elements (Oxygen ,Fluorine). This is due to the fact that 91 Penelope and G4AtomicTransitionManager databases may contain a different number 92 of shells. Physics results are unchanged. 93 94 19.12.2008 L. Pandola, tag emlowen-V09-02-01 95 Added G4RayleighScattering process (G4VEmProcess) to 96 describe Rayleigh scattering. This was not available within 97 the Std package 98 99 15.12.2008 L. Pandola, tag emlowen-V09-02-00 100 Same as the previous one (emlowen-V09-01-46). I arrived too late. 101 102 15.12.2008 L. Pandola, tag emlowen-V09-01-46 103 Added G4PenelopeBremsstrahlungModel, namely bremsstrahlung according to Penelope 104 model, migrated to the Std-design (inheriting from G4VEmModel). A few minor 105 cleaning of G4PenelopeBremsstrahlungContinuous.cc and G4PenelopeIonisation.cc. 106 From this tag, ALL Penelope processes have been migrated. 107 108 12.12.2008 S. Incerti, tag emlowen-V09-01-45 109 Upgrade to G4LogLogInterpolation_revision1c.cc 110 111 09.12.2008 S. Incerti, tag emlowen-V09-01-44 112 Added protection to G4FinalStateElasticChampion.cc for angular treatment of XS 113 at 180*deg 114 115 09.12.2008 S. Incerti, tag emlowen-V09-01-43 116 Contains G4PenelopeBremsstrahlungContinuous.hh/.cc from Luciano 117 Contains G4LogLogInterpolation_revision1b.cc 118 119 09.12.2008 S. Incerti, tag emlowen-V09-01-42 120 Upgrade to G4LogLogInterpolation_revision1b.cc 121 122 09.12.2008 S. Incerti, tag emlowen-V09-01-41 123 Return to original G4LogLogInterpolation.cc/.hh class 124 from tag emlowen-V09-01-20 125 126 08.12.2008 S. Incerti, tag emlowen-V09-01-40 127 Added protection in G4LogLogInterpolation.cc class 128 against null energy and cross section values 129 130 06.12.2008 S. Incerti, tag emlowen-V09-01-39 131 Added vector initialization and EOF protection in G4FinalStateElasticChampion.cc 132 Added EOF protection in G4FinalStateIonisationBorn.cc 133 134 06.12.2008 S. Incerti, tag emlowen-V09-01-38 135 Updated G4LogLogInterpolation class (hh and cc) provided by 136 Nicolas Karakatsanis (updated revision 1) 137 138 05.12.2008 S. Incerti, tag emlowen-V09-01-37 139 Updated G4LogLogInterpolation class (hh and cc) provided by 140 Nicolas Karakatsanis (revision 1) 141 142 05.12.2008 S. Incerti, tag emlowen-V09-01-36 143 Updated low energy limits of Geant4-DNA e- models (Brenner-Zaider and Champion's 144 elastic scattering and Emfietzoglou's excitation) 145 146 05.12.2008 S. Incerti, tag emlowen-V09-01-35 147 Added protection in G4FinalStateIonisationBorn.cc causing run-time error (valgrind with test20) 148 149 04.12.2008 L. Pandola, tag emlowen-V09-01-34 150 Correction for G4PenelopeComptonModel: now the cross section table 151 calculated by the model corresponds to the original FORTRAN-Penelope. 152 The difference was only for compounds materials and below 1 keV, so 153 irrelevant for virtually all applications. 154 First inclusion of G4PenelopeIonisationModel. 155 156 24.11.2008 G. Cosmo, tag emlowen-V09-01-33 157 Fixed compilation errors on gcc-4.3.2: 158 o added required names for struct types (and using G4 prefix); 159 o correctly initialise cached iterators (cannot be an integer!). 160 161 21.11.2008 A. Lechner, tag emlowen-V09-01-32 162 added and tagged new stopping power model for ions, which by default 163 uses ICRU 73 data tables. Following files are concerned: 164 G4IonParametrisedLossModel.hh 165 G4IonParametrisedLossModel.icc 166 G4IonParametrisedLossModel.cc 167 G4IonParametrisedLossTable.hh 168 G4IonParametrisedLossTable.icc 169 170 06.11.2008 S. Incerti, tag emlowen-V09-01-31 171 corrected bug in computation of diff cross section maximum in 172 G4FinalStateElasticBrennerZaider.cc 173 174 30.10.2008 S. Incerti, tag emlowen-V09-01-30 175 added & tagged new photon models compatible with standard EM design : 176 177 -- Penelope models are provided by L. Pandola : 178 G4PenelopeComptonModel.hh and .cc 179 G4PenelopeGammaConversionModel.hh and .cc 180 G4PenelopePhotoElectricModel.hh and .cc 181 G4PenelopeRayleighModel.hh and .cc 182 183 -- Livermore models are provided by S. Incerti : 184 G4LivermoreComptonModel.hh and .cc 185 G4LivermoreGammaConversionModel.hh and .cc 186 G4LivermorePhotoElectricModel.hh and .cc 187 G4LivermorePolarizedComptonModel.hh and .cc 188 G4LivermorePolarizedRayleighModel.hh and .cc 189 G4LivermoreRayleighModel.hh and .cc 190 191 29.10.2008 S. Incerti, tag emlowen-V09-01-29 192 - improved generation of scattering angle in G4FinalStateElasticChampion.cc 193 194 30.09.2008 S. Incerti, tag emlowen-V09-01-28 195 - removed G4cout in G4LowEnergyCompton.cc (bug report #1026) 196 197 20.08.2008 S. Incerti, tag emlowen-V09-01-27 198 - added KillParticle in G4FinalStateElasticChampion.cc below low energy limit 199 - modified condition on low energy limit in G4CrossSectionElasticChampion.cc and G4FinalStateElasticChampion.cc 200 201 20.08.2008 S. Incerti, tag emlowen-V09-01-26 202 - removed AddEnergyDeposit below low energy limit in G4FinalStateElasticBrennerZaider.cc (bug, thanks to Marion Bug) 203 - removed AddEnergyDeposit below low energy limit in G4FinalStateExcitationEmfietzoglou.cc (idem) 204 - removed AddEnergyDeposit below low energy limit in G4FinalStateIonisationRudd.cc (idem) 205 - decreased low energy limit for e- to 12.61 eV in G4CrossSectionIonisationBorn.cc (from sigma_ionisation_e_born.dat table in $G4LEDATA/dna) instead of 25 eV 206 - decreased low energy limit for e- to 12.61 eV in G4FinalStateIonisationBorn.cc (from sigma_ionisation_e_born.dat table in $G4LEDATA/dna) instead of 25 eV 207 208 16.07.2008 S. Incerti, tag emlowen-V09-01-25 209 added preliminary process for positronium production 210 from C. Champion's model 211 G4CrossSectionPsCreationChampion.hh and .cc 212 G4CrossSectionPsCreationChampionPartial.hh and .cc 213 G4FinalStatePsCreationChampion.hh and .cc 214 and updated G4DNAGenericIonsManager.cc 215 *** Will work only from version 6.2 of G4EMLOW data 216 217 15.07.2008 S. Incerti, tag emlowen-V09-01-24 218 added new elastic scattering process for electrons 219 (Geant4 DNA) from C. Champion's model 220 G4CrossSectionElasticChampion.hh and .cc 221 G4FinalStateElasticChampion.hh and .cc 222 *** Will work only from version 6.2 of G4EMLOW data 223 224 14.07.2008 S. Incerti, tag emlowen-V09-01-23 225 cleaned and updated energy limits of the following 226 25 files (Geant4 DNA) 227 228 -G4CrossSectionChargeDecrease.hh and .cc 229 -G4CrossSectionChargeDecreasePartial.hh and .cc 230 -G4CrossSectionChargeIncrease.hh and .cc 231 -G4CrossSectionChargeIncreasePartial.hh and .cc 232 -G4CrossSectionElasticScreenedRutherfordHE.hh and .cc 233 -G4CrossSectionElasticScreenedRutherfordLE.hh and .cc 234 -G4CrossSectionExcitationBorn.hh and .cc 235 -G4CrossSectionExcitationBornPartial.hh and .cc 236 -G4CrossSectionExcitationEmfietzoglou.hh and .cc 237 -G4CrossSectionExcitationEmfietzoglouPartial.hh and .cc 238 -G4CrossSectionExcitationMillerGreen.hh and .cc 239 -G4CrossSectionExcitationMillerGreenPartial.hh and .cc 240 -G4CrossSectionIonisationBorn.hh and .cc 241 -G4CrossSectionIonisationBornPartial.hh and .cc 242 -G4CrossSectionIonisationRudd.hh and .cc 243 -G4CrossSectionIonisationRuddPartial.hh and .cc 244 -G4FinalStateChargeDecrease.hh and .cc 245 -G4FinalStateChargeIncrease.hh and .cc 246 -G4FinalStateElasticBrennerZaider.hh and .cc 247 -G4FinalStateElasticScreenedRutherford.hh and .cc 248 -G4FinalStateExcitationBorn.hh and .cc 249 -G4FinalStateExcitationEmfietzoglou.hh and .cc 250 -G4FinalStateExcitationMillerGreen.hh and .cc 251 -G4FinalStateIonisationBorn.hh and .cc 252 -G4FinalStateIonisationRudd.hh and .cc 253 254 30.06.2008 S. Incerti, tag emlowen-V09-01-22 255 corrected wrong upper energy limit for : 256 - hydrogen in G4CrossSectionIonisationRudd 257 - proton in G4ChargeDecrease 258 259 27.06.2008 S. Incerti, tag emlowen-V09-01-21 260 - added two new classes for electron elastic scattering 261 G4CrossSectionElasticScreenedRutherfordLE.cc and .hh below 200 eV 262 G4CrossSectionElasticScreenedRutherfordHE.cc and .hh above 200 eV 263 that should replace the G4CrossSectionElasticScreenedRutherfordHE class 264 - raised lower energy limit of G4CrossSectionExcitationEmfietzoglou.cc up to 10 eV 265 266 27.06.2008 S. Incerti, tag emlowen-VO9-01-20 267 - added protection against negative log argument in G4LogLogInterpolation.cc 268 - added protection against energies above 200 eV in G4FinalStateElasticBrennerZaider.cc 269 - removed verbose in G4CrossSectionChargeTransferExp.cc and in G4CrossSectionExcitationBorn.cc 270 271 26.06.2208 S. Incerti, tag emlowen-V09-01-19 272 Added protection against FPE in G4hShellCrossSectionDoubleExp.cc 273 274 20.06.2008 S. Incerti, tag emlowen-V09-01-18 275 Added 4 protections against FPE in G4hLowEnergyLoss.cc 276 277 11.06.2008 S. Incerti, tag emlowen-V09-01-17 278 - added missing & for cosTheta and phi variables in G4FinalStateIonisationRudd.hh and .cc 279 which were causing wrong angular distributions (bug fix) 280 - removed annoying PrintData in G4CrossSectionExcitationBornPartial.cc 281 282 02.06.2008 S. Incerti, tag emlowen-V09-01-16 283 Removed while(1) statement in G4FinalStateIonisationBorn.cc 284 fixing compilation warning. 285 Restored headers for G4PaulKCrossSection, G4OrlicLCrossSection 286 and G4ecpssrCrossSection which were lost. 287 288 01.06.2008 F.Lei, tag emlowen-V09-01-15 289 Correction to the corrupted G4Augerdata.cc, and this tag is on top 290 of emlowen-V09-01-12! as emlowen-V09-01-13 is internal and incomplete. 291 292 22.05.2008 F.Lei, tag emlowen-V09-01-14 293 Load the the complete Auger dataset on initialization 294 295 06.05.2008 H.Ben Abdelouahed, tag emlowen-V09-01-12, emlowen-V09-01-13 296 Semi-Empirical model implementation for L-SubShells-Cross-Section 297 with protons projectiles 298 299 02.05.2008 MGP, tag emlowen-V09-01-11 300 Added Doppler broadening in G4LowEnergyComptonPolarized 301 (Francesco Longo), same model as in G4LowEnergyCompton 302 Added PIXE cross section, L shells, for protons in 303 G4OrlicLCrossSection (Haifa Ben Abdelwahed) 304 Corrected compilation warnings as in message by 305 G. Cosmo on 29/4/2008 306 307 24.04.2008 MGP, tag emlowen-V09-01-10 308 Fix in Doppler broadening of G4LowEnergyCompton 309 Attempts to fix floating point exceptions in 310 G4FinalStateElasticBrennerZaider and G4hLowEnergyLoss 311 312 22.04.2008 H.Ben Abdelouahed, tag emlowen-V09-01-09 313 ECPSSR model implementation for K-Shell-Cross-Section 314 with protons and alpha projectiles 315 316 18.03.2008 G.Cosmo, tag emlowen-V09-01-08 317 Fixed compilation error in G4CrossSectionChargeTransferExp.cc 318 for missing inclusion of <sstream>, detected on SUN-CC. 319 320 25.03.2008 MGP, tag emlowen-V09-01-07 321 New charge transfer process by incident protons 322 (two cross section and one final state policy classes) 323 324 17.03.2008 MGP, tag emlowen-V09-01-06 325 Doppler broadening added to G4LowEnergyCompton 326 based on Y. Namito, S. Ban and H. Hirayama, 327 NIM A 349, pp. 489-494, 1994 328 329 10.03.2008 MGP, tag emlowen-V09-01-05 330 Developments for Doppler broadening concerning data management 331 332 10.03.2008 MGP, tag emlowen-V09-01-04 333 Fixes to *DataSet files for better readability of the code 334 Extensions to G4ShellData to deal with shell data relevant to 335 Doppler broadening simulation 336 337 07.03.2008 MGP, tag emlowen-V09-01-03 338 Reverted to G4hLowEnergyIonisation.cc and G4hLowEnergyLoss.cc 339 as in emlowen-V09-01-01 340 341 07.03.2008 MGP, tag emlowen-V09-01-02 342 Operation for convenience of configuration management: 343 updated G4hLowEnergyIonisation.cc and G4hLowEnergyLoss.cc 344 to the head; the modifications to these two classes 345 were an attempt to address a PRS report by A. Howard, 346 but they proved ineffective and caused other problems; 347 a tag including them is made to facilitate later retrieve 348 349 06.03.2008 MGP, tag emlowen-V09-01-01 350 Restored readability of *DataSet* classes regards the 351 indentation of the code 352 353 21.02.2008 MGP, tag emlowen-V09-01-00 354 Bug fix in G4AtomicTransitionManager concerning 355 total radiative and non radiative probabilities 356 (fix provided by A. Mantero) 19 357 20 358 26.11.2007 MGP, tag emlowen-V09-00-28 -
trunk/source/processes/electromagnetic/lowenergy/include/G4AtomicDeexcitation.hh
r819 r961 26 26 // 27 27 // $Id: G4AtomicTransitionManager.hh,v 1.2 ???? 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) -
trunk/source/processes/electromagnetic/lowenergy/include/G4AtomicShell.hh
r819 r961 26 26 // 27 27 // $Id: G4AtomicShell.hh,v 1.2 ???? 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) -
trunk/source/processes/electromagnetic/lowenergy/include/G4AtomicTransitionManager.hh
r819 r961 26 26 // 27 27 // $Id: G4AtomicTransitionManager.hh,v 1.2 ???? 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) -
trunk/source/processes/electromagnetic/lowenergy/include/G4AugerData.hh
r819 r961 25 25 // 26 26 // $Id: G4AugerData.hh 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // Author: Alfonso Mantero (Alfonso.Mantero@ge.infn.it) -
trunk/source/processes/electromagnetic/lowenergy/include/G4BremsstrahlungParameters.hh
r819 r961 26 26 // 27 27 // $Id: G4BremsstrahlungParameters.hh,v 1.10 2006/06/29 19:33:06 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4CompositeEMDataSet.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4CompositeEMDataSet.hh,v 1. 8 2006/06/29 19:33:08 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4CompositeEMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 44 44 // ------------------------------------------------------------------- 45 45 46 #ifndef G4COMPOSITEEMDATASET_HH47 #defineG4COMPOSITEEMDATASET_HH 146 #ifndef G4COMPOSITEEMDATASET_HH 47 #define G4COMPOSITEEMDATASET_HH 1 48 48 49 #include "globals.hh"50 #include "G4VEMDataSet.hh"51 #include <vector>49 #include "globals.hh" 50 #include "G4VEMDataSet.hh" 51 #include <vector> 52 52 53 class G4VDataSetAlgorithm;53 class G4VDataSetAlgorithm; 54 54 55 class G4CompositeEMDataSet : public G4VEMDataSet 56 { 57 public: 58 G4CompositeEMDataSet(G4VDataSetAlgorithm* argAlgorithm, G4double argUnitEnergies=MeV, G4double argUnitData=barn, G4int argMinZ=1, G4int argMaxZ=99); 59 virtual ~G4CompositeEMDataSet(); 55 class G4CompositeEMDataSet : public G4VEMDataSet 56 { 57 public: 58 G4CompositeEMDataSet(G4VDataSetAlgorithm* argAlgorithm, 59 G4double eUnit=MeV, 60 G4double dataUnit=barn, 61 G4int zMin=1, 62 G4int zMax=99); 63 64 virtual ~G4CompositeEMDataSet(); 60 65 61 virtual G4double FindValue(G4double argEnergy, G4int argComponentId=0) const;66 virtual G4double FindValue(G4double x, G4int componentId=0) const; 62 67 63 virtual voidPrintData(void) const;68 virtual void PrintData(void) const; 64 69 65 virtual const G4VEMDataSet * GetComponent(G4int argComponentId) const { return components[argComponentId]; }66 virtual void AddComponent(G4VEMDataSet * argDataSet) { components.push_back(argDataSet); }67 virtual size_t NumberOfComponents(void) const { return components.size(); }70 virtual const G4VEMDataSet* GetComponent(G4int componentId) const { return components[componentId]; } 71 virtual void AddComponent(G4VEMDataSet* dataSet) { components.push_back(dataSet); } 72 virtual size_t NumberOfComponents() const { return components.size(); } 68 73 69 virtual const G4DataVector & GetEnergies(G4int argComponentId) const { return GetComponent(argComponentId)->GetEnergies(0); }70 virtual const G4DataVector & GetData(G4int argComponentId) const { return GetComponent(argComponentId)->GetData(0); }71 virtual void SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int argComponentId);74 virtual const G4DataVector& GetEnergies(G4int componentId) const { return GetComponent(componentId)->GetEnergies(0); } 75 virtual const G4DataVector& GetData(G4int componentId) const { return GetComponent(componentId)->GetData(0); } 76 virtual void SetEnergiesData(G4DataVector* x, G4DataVector* data, G4int componentId); 72 77 73 virtual G4bool LoadData(const G4String & argFileName); 74 virtual G4bool SaveData(const G4String & argFileName) const; 78 virtual G4bool LoadData(const G4String& fileName); 79 virtual G4bool SaveData(const G4String& fileName) const; 80 81 virtual G4double RandomSelect(G4int componentId) const; 82 75 83 76 private: 77 void CleanUpComponents(void); 84 private: 85 86 void CleanUpComponents(void); 78 87 79 // Hide copy constructor and assignment operator80 G4CompositeEMDataSet();81 G4CompositeEMDataSet(const G4CompositeEMDataSet& copy);82 G4CompositeEMDataSet & operator=(const G4CompositeEMDataSet& right);88 // Hide copy constructor and assignment operator 89 G4CompositeEMDataSet(); 90 G4CompositeEMDataSet(const G4CompositeEMDataSet& copy); 91 G4CompositeEMDataSet& operator=(const G4CompositeEMDataSet& right); 83 92 84 std::vector<G4VEMDataSet *> components;// Owned pointers93 std::vector<G4VEMDataSet*> components; // Owned pointers 85 94 86 G4VDataSetAlgorithm *algorithm; // Owned pointer95 G4VDataSetAlgorithm* algorithm; // Owned pointer 87 96 88 G4doubleunitEnergies;89 G4doubleunitData;97 G4double unitEnergies; 98 G4double unitData; 90 99 91 G4intminZ;92 G4intmaxZ;93 };100 G4int minZ; 101 G4int maxZ; 102 }; 94 103 #endif /* G4COMPOSITEEMDATASET_HH */ 95 104 -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeDecrease.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionChargeDecrease.hh,v 1.1 2007/11/08 18:24:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionChargeDecrease.hh,v 1.2 2008/07/14 20:47:32 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONCHARGEDECREASE_HH 52 30 #define G4CROSSSECTIONCHARGEDECREASE_HH 1 53 31 54 #include "globals.hh"55 #include <map>56 32 #include "G4CrossSectionChargeDecreasePartial.hh" 33 #include "G4Track.hh" 34 #include "G4Proton.hh" 35 #include "G4DNAGenericIonsManager.hh" 57 36 58 class G4Track;59 60 37 class G4CrossSectionChargeDecrease 61 38 { … … 68 45 G4double CrossSection(const G4Track&); 69 46 70 // Copy constructor and assignment operator to be added here71 72 47 private: 73 48 74 G4String name;75 49 G4double lowEnergyLimitDefault; 76 50 G4double highEnergyLimitDefault; -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeDecreasePartial.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionChargeDecreasePartial.hh,v 1.1 2007/11/08 18:24:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 08 Nov 2007 MGP Got code from S.I.; lowercase data member 37 // 38 // ------------------------------------------------------------------- 39 40 // Class description: 41 // Geant4-DNA Cross total cross section for electron elastic scattering in water 42 // Reference: TNS Geant4-DNA paper 43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 44 // design foundation and implementation of the first set of models, 45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4CrossSectionChargeDecreasePartial.hh,v 1.2 2008/07/14 20:47:32 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #ifndef G4CROSSSECTIONCHARGEDECREASEPARTIAL_HH 53 30 #define G4CROSSSECTIONCHARGEDECREASEPARTIAL_HH 1 54 31 55 #include "globals.hh" 32 #include "G4Proton.hh" 33 #include "G4DNAGenericIonsManager.hh" 34 #include "Randomize.hh" 56 35 57 36 class G4ParticleDefinition; … … 71 50 G4int RandomSelect(G4double energy, const G4ParticleDefinition* particle); 72 51 73 // Copy constructor and assignment operator to be added here74 75 52 private: 76 53 -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeIncrease.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionChargeIncrease.hh,v 1.1 2007/11/08 18:24:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionChargeIncrease.hh,v 1.2 2008/07/14 20:47:33 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONCHARGEIncrease_HH 52 30 #define G4CROSSSECTIONCHARGEIncrease_HH 1 53 31 54 #include "globals.hh"55 #include <map>56 32 #include "G4CrossSectionChargeIncreasePartial.hh" 33 #include "G4Track.hh" 34 #include "G4DNAGenericIonsManager.hh" 57 35 58 class G4Track;59 60 36 class G4CrossSectionChargeIncrease 61 37 { … … 68 44 G4double CrossSection(const G4Track&); 69 45 70 // Copy constructor and assignment operator to be added here71 72 46 private: 73 47 74 G4String name;75 48 G4double lowEnergyLimitDefault; 76 49 G4double highEnergyLimitDefault; -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeIncreasePartial.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionChargeIncreasePartial.hh,v 1.1 2007/11/08 18:24:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionChargeIncreasePartial.hh,v 1.2 2008/07/14 20:47:33 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONCHARGEIncreasePARTIAL_HH 52 30 #define G4CROSSSECTIONCHARGEIncreasePARTIAL_HH 1 53 31 54 #include "globals.hh" 55 56 class G4ParticleDefinition; 32 #include "G4DNAGenericIonsManager.hh" 33 #include "Randomize.hh" 57 34 58 35 class G4CrossSectionChargeIncreasePartial … … 70 47 G4int RandomSelect(G4double energy, const G4ParticleDefinition* particle); 71 48 72 // Copy constructor and assignment operator to be added here73 74 49 private: 75 50 -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionElasticScreenedRutherford.hh
r819 r961 26 26 // 27 27 // $Id: G4CrossSectionElasticScreenedRutherford.hh,v 1.1 2007/10/12 23:07:10 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationBorn.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationBorn.hh,v 1.1 2007/10/15 08:33:25 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionExcitationBorn.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONEXCITATIONBORN_HH 52 30 #define G4CROSSSECTIONEXCITATIONBORN_HH 1 53 31 54 #include "globals.hh"55 #include <vector>56 #include "G4WaterExcitationStructure.hh"57 32 #include "G4DNACrossSectionDataSet.hh" 33 #include "G4Track.hh" 34 #include "G4LogLogInterpolation.hh" 58 35 59 class G4Track;60 61 36 class G4CrossSectionExcitationBorn 62 37 { … … 69 44 G4double CrossSection(const G4Track& track); 70 45 71 // Copy constructor and assignment operator to be added here72 73 46 private: 74 47 75 G4String name;76 48 G4double lowEnergyLimit; 77 49 G4double highEnergyLimit; -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationBornPartial.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationBornPartial.hh,v 1.1 2007/10/15 08:34:12 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionExcitationBornPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONEXCITATIONBORNPARTIAL_HH 52 30 #define G4CROSSSECTIONEXCITATIONBORNPARTIAL_HH 1 53 31 54 #include "globals.hh"55 #include <vector>56 32 #include "G4DNACrossSectionDataSet.hh" 33 #include "G4LogLogInterpolation.hh" 34 #include "Randomize.hh" 35 #include <deque> 57 36 58 37 class G4CrossSectionExcitationBornPartial … … 64 43 virtual ~G4CrossSectionExcitationBornPartial(); 65 44 66 // Select an excitation level according to the partial cross sections67 45 G4int RandomSelect(G4double energy); 68 46 69 // Copy constructor and assignment operator to be added here70 71 47 private: 72 48 -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationEmfietzoglou.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationEmfietzoglou.hh,v 1.2 2007/10/15 08:31:49 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionExcitationEmfietzoglou.hh,v 1.3 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONEXCITATIONEMFIETZOGLOU_HH 52 30 #define G4CROSSSECTIONEXCITATIONEMFIETZOGLOU_HH 1 53 31 54 #include "globals.hh"55 32 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh" 33 #include "G4Track.hh" 56 34 57 class G4Track;58 59 35 class G4CrossSectionExcitationEmfietzoglou 60 36 { … … 67 43 G4double CrossSection(const G4Track&); 68 44 69 // Copy constructor and assignment operator to be added here70 71 45 private: 72 46 73 G4String name;74 47 G4double lowEnergyLimit; 75 48 G4double highEnergyLimit; -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationEmfietzoglouPartial.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationEmfietzoglouPartial.hh,v 1.1 2007/10/15 08:33:25 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionExcitationEmfietzoglouPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONEXCITATIONEMFIETZOGLOUPARTIAL_HH 52 30 #define G4CROSSSECTIONEXCITATIONEMFIETZOGLOUPARTIAL_HH 1 53 31 54 #include "globals.hh"55 #include <vector>56 32 #include "G4WaterExcitationStructure.hh" 33 #include <deque> 34 #include "Randomize.hh" 57 35 58 36 class G4Track; … … 72 50 G4int RandomSelect(G4double energy); 73 51 74 // Copy constructor and assignment operator to be added here75 76 52 private: 77 53 78 // Number of excitation levels of the water molecule79 54 G4int nLevels; 80 55 -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationMillerGreen.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationMillerGreen.hh,v 1.2 2007/11/08 19:56:02 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionExcitationMillerGreen.hh,v 1.3 2008/07/14 20:47:34 sincerti Exp $ 50 27 51 28 #ifndef G4CROSSSECTIONEXCITATIONMILLERGREEN_HH 52 29 #define G4CROSSSECTIONEXCITATIONMILLERGREEN_HH 1 53 30 54 #include "globals.hh"55 #include <map>56 31 #include "G4CrossSectionExcitationMillerGreenPartial.hh" 57 58 class G4Track; 32 #include "G4Track.hh" 33 #include "G4Proton.hh" 34 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh" 35 #include "G4DNAGenericIonsManager.hh" 59 36 60 37 class G4CrossSectionExcitationMillerGreen … … 68 45 G4double CrossSection(const G4Track&); 69 46 70 // Copy constructor and assignment operator to be added here71 72 47 private: 73 48 74 G4String name;75 49 G4double lowEnergyLimitDefault; 76 50 G4double highEnergyLimitDefault; … … 80 54 81 55 G4CrossSectionExcitationMillerGreenPartial partialCrossSection; 82 83 56 }; 84 57 -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationMillerGreenPartial.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationMillerGreenPartial.hh,v 1.1 2007/11/08 19:56:02 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionExcitationMillerGreenPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONEXCITATIONMILLERGREENPARTIAL_HH 52 30 #define G4CROSSSECTIONEXCITATIONMILLERGREENPARTIAL_HH 1 53 31 54 #include "globals.hh"55 #include <vector>56 32 #include "G4WaterExcitationStructure.hh" 57 #include "G4ParticleDefinition.hh" 33 #include "G4Track.hh" 34 #include "G4Proton.hh" 35 #include "G4DNAGenericIonsManager.hh" 36 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh" 37 #include "Randomize.hh" 58 38 59 class G4Track;60 61 39 class G4CrossSectionExcitationMillerGreenPartial 62 40 { … … 73 51 G4int RandomSelect(G4double energy, const G4ParticleDefinition* particle); 74 52 75 // Copy constructor and assignment operator to be added here76 77 53 private: 78 54 79 // Number of excitation levels of the water molecule80 55 G4int nLevels; 81 56 -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionHandler.hh
r819 r961 26 26 // 27 27 // $Id: G4CrossSectionHandler.hh,v 1.9 2006/06/29 19:33:10 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationBorn.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4CrossSectionIonisationBorn.hh,v 1.1 2007/10/22 09:12:58 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for ionisation cross section in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 27 // $Id: G4CrossSectionIonisationBorn.hh,v 1.3 2008/12/18 13:01:22 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 29 51 30 #ifndef G4CROSSSECTIONIONISATIONBORN_HH 52 31 #define G4CROSSSECTIONIONISATIONBORN_HH 1 53 32 54 #include "globals.hh"55 #include <map>56 33 #include "G4DNACrossSectionDataSet.hh" 34 #include "G4ParticleDefinition.hh" 35 #include "G4Electron.hh" 36 #include "G4Proton.hh" 37 #include "G4Track.hh" 38 #include "G4LogLogInterpolation.hh" 57 39 58 class G4Track;59 60 40 class G4CrossSectionIonisationBorn 61 41 { … … 68 48 G4double CrossSection(const G4Track& track); 69 49 70 // Copy constructor and assignment operator to be added here71 72 50 private: 73 51 74 G4String name;75 52 G4double lowEnergyLimitDefault; 76 53 G4double highEnergyLimitDefault; -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationBornElectron.hh
r819 r961 26 26 // 27 27 // $Id: G4CrossSectionIonisationBornElectron.hh,v 1.1 2007/10/15 08:33:25 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationBornPartial.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionIonisationBornPartial.hh,v 1.1 2007/10/22 09:12:58 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for ionisation cross section in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionIonisationBornPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONIONISATIONBORNPARTIAL_HH 52 30 #define G4CROSSSECTIONIONISATIONBORNPARTIAL_HH 1 53 31 54 #include "globals.hh"55 #include <map>56 #include <functional>57 32 #include "G4DNACrossSectionDataSet.hh" 33 #include "G4Electron.hh" 34 #include "G4Proton.hh" 35 #include "G4Track.hh" 36 #include "G4LogLogInterpolation.hh" 37 #include "Randomize.hh" 58 38 59 class G4Track;60 61 39 class G4CrossSectionIonisationBornPartial 62 40 { … … 67 45 ~G4CrossSectionIonisationBornPartial(); 68 46 69 // Partial cross section70 // G4double CrossSection(G4double energy, const G4String& particle);71 47 G4double CrossSection(const G4Track& track); 72 48 73 // Sum of partial cross sections at a given energy value for a particle type74 49 G4double Sum(G4double energy, const G4String& particle); 75 50 76 51 G4int RandomSelect(G4double energy,const G4String& particle ); 77 52 78 // Copy constructor and assignment operator to be added here79 80 53 private: 81 54 82 G4String name;83 55 G4double lowEnergyLimitDefault; 84 56 G4double highEnergyLimitDefault; … … 93 65 MapData tableData; 94 66 95 96 97 // G4DNACrossSectionDataSet* table;98 99 67 }; 100 68 -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationBornPartialElectron.hh
r819 r961 26 26 // 27 27 // $Id: G4CrossSectionIonisationBornPartialElectron.hh,v 1.1 2007/10/15 08:33:25 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationRudd.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionIonisationRudd.hh,v 1.1 2007/11/08 21:35:31 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for ionisation cross section in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionIonisationRudd.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONIONISATIONRUDD_HH 52 30 #define G4CROSSSECTIONIONISATIONRUDD_HH 1 53 31 54 #include "globals.hh"55 #include <map>56 32 #include "G4DNACrossSectionDataSet.hh" 33 #include "G4Proton.hh" 34 #include "G4Track.hh" 35 #include "G4LogLogInterpolation.hh" 36 #include "G4DNAGenericIonsManager.hh" 57 37 58 class G4Track;59 60 38 class G4CrossSectionIonisationRudd 61 39 { … … 68 46 G4double CrossSection(const G4Track& track); 69 47 70 // Copy constructor and assignment operator to be added here71 72 48 private: 73 49 74 G4String name;75 50 G4double lowEnergyLimitDefault; 76 51 G4double highEnergyLimitDefault; -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationRuddPartial.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionIonisationRuddPartial.hh,v 1.1 2007/11/08 21:35:31 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for ionisation cross section in water 41 // Reference: TNS Geant4-DNA paper 42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 43 // design foundation and implementation of the first set of models, 44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 46 // Further documentation available from http://www.ge.infn.it/geant4/dna 47 48 // ------------------------------------------------------------------- 49 26 // $Id: G4CrossSectionIonisationRuddPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 #ifndef G4CROSSSECTIONIONISATIONRuddPARTIAL_HH 52 30 #define G4CROSSSECTIONIONISATIONRuddPARTIAL_HH 1 53 31 54 #include "globals.hh"55 #include <map>56 #include <functional>57 32 #include "G4DNACrossSectionDataSet.hh" 58 59 class G4Track; 33 #include "G4Proton.hh" 34 #include "G4Track.hh" 35 #include "G4LogLogInterpolation.hh" 36 #include "G4DNAGenericIonsManager.hh" 37 #include "Randomize.hh" 60 38 61 39 class G4CrossSectionIonisationRuddPartial … … 67 45 ~G4CrossSectionIonisationRuddPartial(); 68 46 69 // Partial cross section70 // G4double CrossSection(G4double energy, const G4String& particle);71 47 G4double CrossSection(const G4Track& track); 72 48 73 // Sum of partial cross sections at a given energy value for a particle type74 49 G4double Sum(G4double energy, const G4String& particle); 75 50 76 51 G4int RandomSelect(G4double energy,const G4String& particle ); 77 52 78 // Copy constructor and assignment operator to be added here79 80 53 private: 81 54 82 G4String name;83 55 G4double lowEnergyLimitDefault; 84 56 G4double highEnergyLimitDefault; … … 92 64 typedef std::map<G4String,G4DNACrossSectionDataSet*,std::less<G4String> > MapData; 93 65 MapData tableData; 94 95 96 97 // G4DNACrossSectionDataSet* table;98 99 66 }; 100 67 -
trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionKill.hh
r819 r961 26 26 // 27 27 // $Id: G4CrossSectionKill.hh,v 1.1 2007/11/09 20:26:47 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4DNACrossSectionDataSet.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4DNACrossSectionDataSet.hh,v 1. 4 2007/10/15 08:31:49pia Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4DNACrossSectionDataSet.hh,v 1.6 2008/03/17 13:45:25 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Riccardo Capra <capra@ge.infn.it> … … 45 45 // ------------------------------------------------------------------- 46 46 47 #ifndef G4DNACROSSSECTIONDATASET_HH48 #define G4DNACROSSSECTIONDATASET_HH 147 #ifndef G4DNACROSSSECTIONDATASET_HH 48 #define G4DNACROSSSECTIONDATASET_HH 1 49 49 50 #include "G4ShellEMDataSet.hh"50 #include "G4ShellEMDataSet.hh" 51 51 52 class G4DNACrossSectionDataSet : public G4VEMDataSet 53 { 54 public: 55 G4DNACrossSectionDataSet(G4VDataSetAlgorithm* argAlgorithm, 56 G4double argUnitEnergies=MeV, 57 G4double argUnitData=barn); 52 class G4DNACrossSectionDataSet : public G4VEMDataSet 53 { 58 54 59 virtual ~G4DNACrossSectionDataSet(); 55 public: 56 G4DNACrossSectionDataSet(G4VDataSetAlgorithm* algo, 57 G4double xUnit=MeV, 58 G4double dataUnit=barn); 60 59 61 virtual G4double FindValue(G4double argEnergy, G4int argComponentId=0) const; 60 virtual ~G4DNACrossSectionDataSet(); 61 62 virtual G4double FindValue(G4double e, G4int componentId=0) const; 62 63 63 virtual void PrintData(void) const;64 virtual void PrintData(void) const; 64 65 65 virtual const G4VEMDataSet* GetComponent(G4int argComponentId) const66 { return components[argComponentId]; }66 virtual const G4VEMDataSet* GetComponent(G4int componentId) const 67 { return components[componentId]; } 67 68 68 virtual void AddComponent(G4VEMDataSet * argDataSet) 69 { components.push_back(argDataSet); } 70 virtual size_t NumberOfComponents(void) const 71 { return components.size(); } 69 virtual void AddComponent(G4VEMDataSet* dataSet) 70 { components.push_back(dataSet); } 72 71 73 virtual const G4DataVector& GetEnergies(G4int argComponentId) const74 { return GetComponent(argComponentId)->GetEnergies(0); }72 virtual size_t NumberOfComponents(void) const 73 { return components.size(); } 75 74 76 virtual const G4DataVector& GetData(G4int argComponentId) const77 { return GetComponent(argComponentId)->GetData(0); }75 virtual const G4DataVector& GetEnergies(G4int componentId) const 76 { return GetComponent(componentId)->GetEnergies(0); } 78 77 79 virtual void SetEnergiesData(G4DataVector* argEnergies, G4DataVector* argData, G4int argComponentId); 78 virtual const G4DataVector& GetData(G4int componentId) const 79 { return GetComponent(componentId)->GetData(0); } 80 80 81 virtual G4bool LoadData(const G4String & argFileName); 82 virtual G4bool SaveData(const G4String & argFileName) const; 81 virtual void SetEnergiesData(G4DataVector* x, G4DataVector* values, G4int componentId); 83 82 84 // void CleanUpComponents(); 83 virtual G4bool LoadData(const G4String & argFileName); 84 virtual G4bool SaveData(const G4String & argFileName) const; 85 86 virtual G4double RandomSelect(G4int /*componentId */) const { return -1.; }; 87 88 89 // void CleanUpComponents(); 85 90 86 private:91 private: 87 92 88 G4String FullFileName(const G4String & argFileName) const;93 G4String FullFileName(const G4String & argFileName) const; 89 94 90 // Hide copy constructor and assignment operator91 G4DNACrossSectionDataSet();92 G4DNACrossSectionDataSet(const G4DNACrossSectionDataSet & copy);93 G4DNACrossSectionDataSet& operator=(const G4DNACrossSectionDataSet & right);95 // Hide copy constructor and assignment operator 96 G4DNACrossSectionDataSet(); 97 G4DNACrossSectionDataSet(const G4DNACrossSectionDataSet & copy); 98 G4DNACrossSectionDataSet& operator=(const G4DNACrossSectionDataSet & right); 94 99 95 std::vector<G4VEMDataSet*> components; // Owned pointers100 std::vector<G4VEMDataSet*> components; // Owned pointers 96 101 97 G4int z;102 G4int z; 98 103 99 G4VDataSetAlgorithm* algorithm; // Owned pointer104 G4VDataSetAlgorithm* algorithm; // Owned pointer 100 105 101 G4double unitEnergies;102 G4double unitData;106 G4double unitEnergies; 107 G4double unitData; 103 108 104 G4double GetUnitEnergies() const { return unitEnergies; }105 G4double GetUnitData() const { return unitData; }106 const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; }109 G4double GetUnitEnergies() const { return unitEnergies; } 110 G4double GetUnitData() const { return unitData; } 111 const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; } 107 112 108 void CleanUpComponents(void);113 void CleanUpComponents(void); 109 114 110 115 -
trunk/source/processes/electromagnetic/lowenergy/include/G4DNAGenericIonsManager.hh
r819 r961 26 26 // 27 27 // $Id: G4DNAGenericIonsManager.hh,v 1.3 2006/06/29 19:34:16 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 30 30 #ifndef G4DNAGENERICIONSMANAGER_HH -
trunk/source/processes/electromagnetic/lowenergy/include/G4DNAProcess.hh
r819 r961 26 26 // 27 27 // $Id: G4DNAProcess.hh,v 1.5 2007/11/09 16:20:04 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@ge.infn.it) -
trunk/source/processes/electromagnetic/lowenergy/include/G4DNAProcess.icc
r819 r961 25 25 // 26 26 // 27 // $Id: G4DNAProcess.icc,v 1.1 1 2007/12/10 16:31:19 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4DNAProcess.icc,v 1.12 2009/01/20 07:50:28 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 111 111 aParticleChange.ProposeEnergy(0.); 112 112 aParticleChange.ProposeMomentumDirection( 0., 0., 0. ); 113 aParticleChange.ProposeLocalEnergyDeposit(track.GetKineticEnergy() + deposit); 114 113 114 if (product.PrimaryParticleIsKilledAndDoNotDepositEnergy()) 115 { 116 aParticleChange.ProposeLocalEnergyDeposit(deposit); 117 } 118 else 119 { 120 aParticleChange.ProposeLocalEnergyDeposit(track.GetKineticEnergy() + deposit); 121 } 122 115 123 } 116 124 else -
trunk/source/processes/electromagnetic/lowenergy/include/G4DummyFinalState.hh
r819 r961 26 26 // 27 27 // $Id: G4DummyFinalState.hh,v 1.2 2007/10/07 12:52:18 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4EMDataSet.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4EMDataSet.hh,v 1. 7 2006/06/29 19:35:31 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4EMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 45 45 46 46 #ifndef G4EMDATASET_HH 47 #define G4EMDATASET_HH 147 #define G4EMDATASET_HH 1 48 48 49 #include "globals.hh"50 #include "G4VEMDataSet.hh"49 #include "globals.hh" 50 #include "G4VEMDataSet.hh" 51 51 52 class G4VDataSetAlgorithm;52 class G4VDataSetAlgorithm; 53 53 54 class G4EMDataSet : public G4VEMDataSet 55 { 56 public: 57 G4EMDataSet(G4int argZ, G4VDataSetAlgorithm * argAlgorithm, G4double argUnitEnergies=MeV, G4double argUnitData=barn); 58 G4EMDataSet(G4int argZ, G4DataVector * argEnergies, G4DataVector * argData, G4VDataSetAlgorithm * argAlgorithm, G4double argUnitEnergues=MeV, G4double argUnitData=barn); 59 virtual ~G4EMDataSet(); 54 class G4EMDataSet : public G4VEMDataSet 55 { 56 public: 57 G4EMDataSet(G4int argZ, 58 G4VDataSetAlgorithm* algo, 59 G4double xUnit=MeV, 60 G4double yUnit=barn, 61 G4bool random=false); 62 63 G4EMDataSet(G4int argZ, 64 G4DataVector* xData, 65 G4DataVector* data, 66 G4VDataSetAlgorithm* algo, 67 G4double xUnit=MeV, 68 G4double yUnit=barn, 69 G4bool random=false); 70 71 virtual ~G4EMDataSet(); 60 72 61 virtual G4double FindValue(G4double argEnergy, G4int argComponentId=0) const;73 virtual G4double FindValue(G4double x, G4int componentId=0) const; 62 74 63 virtual voidPrintData(void) const;75 virtual void PrintData(void) const; 64 76 65 virtual const G4VEMDataSet * GetComponent(G4int /* argComponentId */) const { return 0; } 66 virtual void AddComponent(G4VEMDataSet * /* argDataSet */) {} 67 virtual size_t NumberOfComponents(void) const { return 0; } 77 virtual const G4VEMDataSet* GetComponent(G4int /* componentId */) const { return 0; } 68 78 69 virtual const G4DataVector & GetEnergies(G4int /* argComponentId */) const { return *energies; } 70 virtual const G4DataVector & GetData(G4int /* argComponentId */) const { return *data; } 71 virtual void SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int argComponentId); 79 virtual void AddComponent(G4VEMDataSet* /* dataSet */) {} 72 80 73 virtual G4bool LoadData(const G4String & argFileName); 74 virtual G4bool SaveData(const G4String & argFileName) const; 75 76 private: 77 size_t FindLowerBound(G4double argEnergy) const; 78 79 G4String FullFileName(const G4String & argFileName) const; 81 virtual size_t NumberOfComponents(void) const { return 0; } 80 82 81 // Hide copy constructor and assignment operator 82 G4EMDataSet(); 83 G4EMDataSet(const G4EMDataSet & copy); 84 G4EMDataSet & operator=(const G4EMDataSet & right); 83 virtual const G4DataVector& GetEnergies(G4int /* componentId */) const { return *energies; } 84 virtual const G4DataVector& GetData(G4int /* componentId */) const { return *data; } 85 virtual void SetEnergiesData(G4DataVector* xData, G4DataVector* data, G4int componentId); 85 86 86 G4int z; 87 virtual G4bool LoadData(const G4String& fileName); 88 virtual G4bool SaveData(const G4String& fileName) const; 87 89 88 G4DataVector * energies; // Owned pointer89 G4DataVector * data; // Owned pointer90 virtual G4double RandomSelect(G4int componentId = 0) const; 91 90 92 91 G4VDataSetAlgorithm * algorithm; // Owned pointer 93 private: 94 95 size_t FindLowerBound(G4double energy) const; 96 size_t FindLowerBound(G4double x, G4DataVector* values) const; 97 98 G4double IntegrationFunction(G4double x); 99 100 virtual void BuildPdf(); 92 101 93 G4double unitEnergies; 94 G4double unitData; 95 }; 102 G4String FullFileName(const G4String& fileName) const; 103 104 // Hide copy constructor and assignment operator 105 G4EMDataSet(); 106 G4EMDataSet(const G4EMDataSet& copy); 107 G4EMDataSet& operator=(const G4EMDataSet& right); 108 109 G4int z; 110 111 G4DataVector* energies; // Owned pointer 112 G4DataVector* data; // Owned pointer 113 114 G4VDataSetAlgorithm* algorithm; // Owned pointer 115 116 G4double unitEnergies; 117 G4double unitData; 118 119 G4DataVector* pdf; 120 G4bool randomSet; 121 }; 96 122 #endif /* G4EMDATASET_HH */ -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateChargeDecrease.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateChargeDecrease.hh,v 1.1 2007/11/08 18:24:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // Reference: TNS Geant4-DNA paper 43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 44 // design foundation and implementation of the first set of models, 45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateChargeDecrease.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #ifndef G4FINALSTATECHARGEDECREASE_HH 53 30 #define G4FINALSTATECHARGEDECREASE_HH 1 54 31 55 #include "globals.hh"56 32 #include "G4FinalStateProduct.hh" 57 //#include "G4WaterExcitationStructure.hh"58 33 #include "G4CrossSectionChargeDecreasePartial.hh" 59 34 60 class G4Track; 61 class G4Step; 62 63 class G4FinalStateChargeDecrease 64 { 35 class G4FinalStateChargeDecrease 36 { 65 37 public: 66 38 … … 73 45 private: 74 46 75 // Copy constructor and assignment operator to be added here76 77 G4String name;78 47 G4double lowEnergyLimit; 79 48 G4double highEnergyLimit; … … 89 58 }; 90 59 91 92 60 #endif -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateChargeIncrease.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateChargeIncrease.hh,v 1.1 2007/11/08 18:24:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // Reference: TNS Geant4-DNA paper 43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 44 // design foundation and implementation of the first set of models, 45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateChargeIncrease.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #ifndef G4FINALSTATECHARGEIncrease_HH 53 30 #define G4FINALSTATECHARGEIncrease_HH 1 54 31 55 #include "globals.hh"56 32 #include "G4FinalStateProduct.hh" 57 33 #include "G4CrossSectionChargeIncreasePartial.hh" 34 #include "G4Electron.hh" 35 #include "G4Proton.hh" 58 36 59 class G4Track; 60 class G4Step; 61 62 class G4FinalStateChargeIncrease 63 { 37 class G4FinalStateChargeIncrease 38 { 64 39 public: 65 40 … … 72 47 private: 73 48 74 // Copy constructor and assignment operator to be added here75 76 G4String name;77 49 G4double lowEnergyLimit; 78 50 G4double highEnergyLimit; … … 89 61 }; 90 62 91 92 63 #endif -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateElasticBrennerZaider.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateElasticBrennerZaider.hh,v 1.1 2007/10/12 23:07:10 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // Reference: TNS Geant4-DNA paper 43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 44 // design foundation and implementation of the first set of models, 45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateElasticBrennerZaider.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #ifndef G4FINALSTATEELASTICBRENNERZAIDER_HH 53 30 #define G4FINALSTATEELASTICBRENNERZAIDER_HH 1 54 31 55 #include "globals.hh"56 32 #include "G4FinalStateProduct.hh" 33 #include "Randomize.hh" 57 34 58 35 class G4Track; … … 71 48 private: 72 49 73 // Copy constructor and assignment operator to be added here74 75 G4String name;76 50 G4double lowEnergyLimit; 77 51 G4double highEnergyLimit; … … 89 63 }; 90 64 91 92 65 #endif -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateElasticScreenedRutherford.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateElasticScreenedRutherford.hh,v 1.2 2007/10/12 23:02:55 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // Reference: TNS Geant4-DNA paper 43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 44 // design foundation and implementation of the first set of models, 45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateElasticScreenedRutherford.hh,v 1.3 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #ifndef G4FINALSTATEELASTICSCREENEDRUTHERFORD_HH 53 30 #define G4FINALSTATEELASTICSCREENEDRUTHERFORD_HH 1 54 31 55 #include "globals.hh"56 32 #include "G4FinalStateProduct.hh" 33 #include "Randomize.hh" 57 34 58 35 class G4Track; … … 71 48 private: 72 49 73 // Copy constructor and assignment operator to be added here74 75 G4String name;76 50 G4double lowEnergyLimit; 77 51 G4double highEnergyLimit; … … 83 57 }; 84 58 85 86 59 #endif -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateExcitationBorn.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateExcitationBorn.hh,v 1.1 2007/10/15 08:33:25 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // Reference: TNS Geant4-DNA paper 43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 44 // design foundation and implementation of the first set of models, 45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateExcitationBorn.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #ifndef G4FINALSTATEEXCITATIONBORN_HH 53 30 #define G4FINALSTATEEXCITATIONBORN_HH 1 54 31 55 #include "globals.hh"56 32 #include "G4FinalStateProduct.hh" 57 33 #include "G4WaterExcitationStructure.hh" 58 34 #include "G4CrossSectionExcitationBornPartial.hh" 59 35 60 class G4Track; 61 class G4Step; 62 63 class G4FinalStateExcitationBorn 64 { 36 class G4FinalStateExcitationBorn 37 { 65 38 public: 66 39 … … 72 45 73 46 private: 74 75 // Copy constructor and assignment operator to be added here 76 77 G4String name; 47 78 48 G4double lowEnergyLimit; 79 49 G4double highEnergyLimit; … … 85 55 }; 86 56 87 88 57 #endif -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateExcitationEmfietzoglou.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateExcitationEmfietzoglou.hh,v 1.1 2007/10/15 08:33:25 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // Reference: TNS Geant4-DNA paper 43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 44 // design foundation and implementation of the first set of models, 45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateExcitationEmfietzoglou.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #ifndef G4FINALSTATEEXCITATIONEMFIETZOGLOU_HH 53 30 #define G4FINALSTATEEXCITATIONEMFIETZOGLOU_HH 1 54 31 55 #include "globals.hh"56 32 #include "G4FinalStateProduct.hh" 57 #include "G4WaterExcitationStructure.hh"58 33 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh" 59 34 … … 73 48 private: 74 49 75 // Copy constructor and assignment operator to be added here76 77 G4String name;78 50 G4double lowEnergyLimit; 79 51 G4double highEnergyLimit; … … 85 57 }; 86 58 87 88 59 #endif -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateExcitationMillerGreen.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateExcitationMillerGreen.hh,v 1.1 2007/11/08 19:56:02 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // Reference: TNS Geant4-DNA paper 43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 44 // design foundation and implementation of the first set of models, 45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateExcitationMillerGreen.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #ifndef G4FINALSTATEEXCITATIONMILLERGREEN_HH 53 30 #define G4FINALSTATEEXCITATIONMILLERGREEN_HH 1 54 31 55 #include "globals.hh"56 32 #include "G4FinalStateProduct.hh" 57 #include "G4WaterExcitationStructure.hh"58 33 #include "G4CrossSectionExcitationMillerGreenPartial.hh" 59 34 60 class G4Track; 61 class G4Step; 62 63 class G4FinalStateExcitationMillerGreen 64 { 35 class G4FinalStateExcitationMillerGreen 36 { 65 37 public: 66 38 … … 73 45 private: 74 46 75 // Copy constructor and assignment operator to be added here76 77 G4String name;78 47 G4double lowEnergyLimit; 79 48 G4double highEnergyLimit; … … 85 54 }; 86 55 87 88 56 #endif -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateIonisationBorn.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateIonisationBorn.hh,v 1.3 2007/11/13 15:20:19 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // Reference: TNS Geant4-DNA paper 43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 44 // design foundation and implementation of the first set of models, 45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateIonisationBorn.hh,v 1.4 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #ifndef G4FINALSTATEIONISATIONBORN_HH 53 30 #define G4FINALSTATEIONISATIONBORN_HH 1 54 31 55 #include "globals.hh"56 32 #include "G4FinalStateProduct.hh" 57 33 #include "G4WaterIonisationStructure.hh" … … 61 37 class G4Step; 62 38 63 class G4FinalStateIonisationBorn64 {39 class G4FinalStateIonisationBorn 40 { 65 41 public: 66 42 … … 71 47 const G4FinalStateProduct& GenerateFinalState(const G4Track& track, const G4Step& step); 72 48 73 private:49 private: 74 50 75 // Copy constructor and assignment operator to be added here76 77 G4String name;78 51 G4double lowEnergyLimitDefault; 79 52 G4double highEnergyLimitDefault; … … 112 85 TriDimensionMap eDiffCrossSectionData[6]; 113 86 TriDimensionMap pDiffCrossSectionData[6]; 114 // TriDimensionMap eDiffCrossSectionData;115 // TriDimensionMap pDiffCrossSectionData;116 87 std::vector<double> eTdummyVec; 117 88 std::vector<double> pTdummyVec; … … 121 92 VecMap pVecm; 122 93 123 // std::ifstream eDiffCrossSection;124 // std::ifstream pDiffCrossSection;125 126 94 }; 127 95 128 129 96 #endif -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateIonisationRudd.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateIonisationRudd.hh,v 1.2 2007/11/09 16:30:56 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // History: 33 // ----------- 34 // Date Name Modification 35 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 36 // 37 // ------------------------------------------------------------------- 38 39 // Class description: 40 // Geant4-DNA Cross total cross section for electron elastic scattering in water 41 // Reference: TNS Geant4-DNA paper 42 // Reference: TNS Geant4-DNA paper 43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 44 // design foundation and implementation of the first set of models, 45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 26 // $Id: G4FinalStateIonisationRudd.hh,v 1.4 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 50 28 51 29 … … 53 31 #define G4FINALSTATEIONISATIONRUDD_HH 1 54 32 55 #include "globals.hh"56 33 #include "G4FinalStateProduct.hh" 57 34 #include "G4WaterIonisationStructure.hh" 58 35 #include "G4CrossSectionIonisationRuddPartial.hh" 59 60 class G4Track; 61 class G4Step; 62 class G4ParticleDefinition; 36 #include "G4Electron.hh" 37 #include "G4Proton.hh" 63 38 64 39 class G4FinalStateIonisationRudd … … 74 49 private: 75 50 76 // Copy constructor and assignment operator to be added here77 78 G4String name;79 51 G4double lowEnergyLimitDefault; 80 52 G4double highEnergyLimitDefault; … … 95 67 G4double incomingParticleEnergy, 96 68 G4double outgoingParticleEnergy, 97 G4double cosTheta,98 G4double phi);69 G4double & cosTheta, 70 G4double & phi); 99 71 100 72 G4double DifferentialCrossSection(G4ParticleDefinition* particleDefinition, … … 130 102 }; 131 103 132 133 104 #endif -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateKill.hh
r819 r961 26 26 // 27 27 // $Id: G4FinalStateKill.hh,v 1.1 2007/11/09 20:26:47 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateProduct.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4FinalStateProduct.hh,v 1. 4 2007/10/15 08:31:49 piaExp $28 // GEANT4 tag $Name: $27 // $Id: G4FinalStateProduct.hh,v 1.5 2009/01/20 07:50:28 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 72 72 void ModifyPrimaryParticle(const G4ThreeVector& direction, G4double energy); 73 73 74 void DoNotDepositEnergy(); 74 75 void KillPrimaryParticle(); 75 76 76 77 G4bool PrimaryParticleIsKilled() const { return killStatus; } 78 79 G4bool PrimaryParticleIsKilledAndDoNotDepositEnergy() const { return doNotDepositStatus; } 77 80 78 81 G4bool PrimaryParticleIsModified() const { return isModified; } … … 96 99 97 100 G4bool killStatus; 101 G4bool doNotDepositStatus; 98 102 G4bool isModified; 99 103 G4double localEnergyDeposit; -
trunk/source/processes/electromagnetic/lowenergy/include/G4FluoTransition.hh
r819 r961 26 26 // 27 27 // $Id: G4FluoTransition.hh,v 1.2 ???? 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) -
trunk/source/processes/electromagnetic/lowenergy/include/G4LinInterpolation.hh
r819 r961 26 26 // 27 27 // $Id: G4LinInterpolation.hh,v 1.3 2006/06/29 19:35:45 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4LogLogInterpolation.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4LogLogInterpolation.hh,v 1. 4 2006/06/29 19:35:51 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4LogLogInterpolation.hh,v 1.6 2008/12/09 13:28:02 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyBremsstrahlung.hh
r819 r961 27 27 // ------------------------------------------------------------------- 28 28 // $Id: G4LowEnergyBremsstrahlung.hh,v 1.37 2006/06/29 19:35:55 gunter Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 30 30 // 31 31 // Author: A. Forti -
trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyCompton.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LowEnergyCompton.hh,v 1.2 1 2006/06/29 19:35:57 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4LowEnergyCompton.hh,v 1.24 2008/11/04 10:14:00 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // Author: A. Forti … … 48 48 #include "globals.hh" 49 49 #include "G4VDiscreteProcess.hh" 50 #include "G4ShellData.hh" 51 #include "G4DopplerProfile.hh" 50 52 51 53 class G4Track; … … 67 69 G4bool IsApplicable(const G4ParticleDefinition& definition); 68 70 69 void BuildPhysicsTable(const G4ParticleDefinition& photon);71 void BuildPhysicsTable(const G4ParticleDefinition& definition); 70 72 71 G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);73 G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step); 72 74 73 75 // For testing purpose only 74 G4double DumpMeanFreePath(const G4Track& aTrack,76 G4double DumpMeanFreePath(const G4Track& track, 75 77 G4double previousStepSize, 76 78 G4ForceCondition* condition) 77 { return GetMeanFreePath( aTrack, previousStepSize, condition); }79 { return GetMeanFreePath(track, previousStepSize, condition); } 78 80 79 81 protected: 80 82 81 G4double GetMeanFreePath(const G4Track& aTrack,83 G4double GetMeanFreePath(const G4Track& track, 82 84 G4double previousStepSize, 83 85 G4ForceCondition* condition); … … 102 104 const G4double intrinsicHighEnergyLimit; 103 105 106 G4ShellData shellData; 107 G4DopplerProfile profileData; 104 108 }; 105 109 -
trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyGammaConversion.hh
r819 r961 26 26 // 27 27 // $Id: G4LowEnergyGammaConversion.hh,v 1.15 2006/06/29 19:35:59 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: A. Forti -
trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyIonisation.hh
r819 r961 26 26 // ------------------------------------------------------------------- 27 27 // $Id: G4LowEnergyIonisation.hh,v 1.41 2006/06/29 19:36:01 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: A. Forti -
trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyPhotoElectric.hh
r819 r961 26 26 // 27 27 // $Id: G4LowEnergyPhotoElectric.hh,v 1.28 2006/06/29 19:36:03 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: A. Forti -
trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyPolarizedCompton.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4LowEnergyPolarizedCompton.hh,v 1. 9 2006/06/29 19:36:05 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4LowEnergyPolarizedCompton.hh,v 1.10 2008/05/02 13:04:41 flongo Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------------------------------------------------------ … … 57 57 #include "globals.hh" 58 58 #include "G4VDiscreteProcess.hh" 59 60 // Doppler Broadening 61 62 #include "G4ShellData.hh" 63 #include "G4DopplerProfile.hh" 64 59 65 60 66 class G4Track; … … 125 131 G4ThreeVector& polarization0, G4ThreeVector& polarization1); 126 132 133 // Doppler Broadening 134 135 G4ShellData shellData; 136 G4DopplerProfile profileData; 137 138 127 139 }; 128 140 -
trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyPolarizedRayleigh.hh
r819 r961 25 25 // 26 26 // $Id: G4LowEnergyPolarizedRayleigh.hh,v 1.5 2006/06/29 19:36:07 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyRayleigh.hh
r819 r961 26 26 // 27 27 // $Id: G4LowEnergyRayleigh.hh,v 1.16 2006/06/29 19:36:09 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeBremsstrahlung.hh
r819 r961 27 27 // ------------------------------------------------------------------- 28 28 // $Id: G4PenelopeBremsstrahlung.hh,v 1.8 2006/06/29 19:36:15 gunter Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 30 30 // 31 31 // Author: L.Pandola -
trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeBremsstrahlungAngular.hh
r819 r961 27 27 // ------------------------------------------------------------------- 28 28 // $Id: G4PenelopeBremsstrahlungAngular.hh,v 1.3 2006/06/29 19:36:17 gunter Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 30 30 // 31 31 // Author: L.Pandola -
trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeBremsstrahlungContinuous.hh
r819 r961 26 26 // 27 27 // ------------------------------------------------------------------- 28 // $Id: G4PenelopeBremsstrahlungContinuous.hh,v 1. 3 2006/06/29 19:36:19 gunterExp $29 // GEANT4 tag $Name: $28 // $Id: G4PenelopeBremsstrahlungContinuous.hh,v 1.4 2008/12/09 15:04:05 pandola Exp $ 29 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 30 30 // 31 31 // Author: L.Pandola … … 35 35 // 20 Feb 2003 L. Pandola 1st implementation 36 36 // 17 Mar 2003 L. Pandola Added the correction for positrons 37 // 09 Dec 2008 L. Pandola Cosmetics: say what variables are 38 // 37 39 // Class description: 38 40 // Calculation of continuous energy loss for Penelope Bremsstrahlung … … 54 56 public: 55 57 56 G4PenelopeBremsstrahlungContinuous(G4int Zmat,G4double tCut, G4double emin, G4double emax, 57 const G4String partName); 58 G4PenelopeBremsstrahlungContinuous(G4int Z,G4double energyCut, G4double energyMin, 59 G4double energyMax, 60 const G4String particleName); 58 61 ~G4PenelopeBremsstrahlungContinuous(); 59 G4double CalculateStopping(G4double PrimaryEnergy);62 G4double CalculateStopping(G4double energy); 60 63 61 64 private: 62 63 65 void PrepareInterpolationTable(); 64 66 void LoadFromFile(); … … 75 77 G4double ExtendedLogEnergy[NumberofExtendedEGrid]; 76 78 G4double p0[NumberofExtendedEGrid][NumberofKPoints]; 77 //G4double Pbcut[NumberofExtendedEGrid]; // serve?79 //G4double Pbcut[NumberofExtendedEGrid]; //useful? 78 80 }; 79 81 -
trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeCompton.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeCompton.hh,v 1.1 0 2006/06/29 19:36:21 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4PenelopeCompton.hh,v 1.11 2008/03/26 15:30:19 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // Author: Luciano Pandola … … 36 36 // 26 Mar 2003 L.Pandola Added fluorescence 37 37 // 18 Mar 2004 L.Pandola Use of std::map (code review) 38 // 26 Mar 2008 L.Pandola Add boolean flag to control atomic de-excitation 38 39 // 39 40 // ------------------------------------------------------------------- … … 78 79 { return GetMeanFreePath(aTrack, previousStepSize, condition); } 79 80 81 void SetUseAtomicDeexcitation(G4bool value){fUseAtomicDeexcitation = value;}; 82 83 G4bool GetUseAtomicDeexcitation(){return fUseAtomicDeexcitation;}; 84 80 85 protected: 81 86 … … 118 123 119 124 std::vector<G4VEMDataSet*> *matCrossSections; //for random choice of atom 125 120 126 G4double cutForLowEnergySecondaryPhotons; 127 G4bool fUseAtomicDeexcitation; 121 128 }; 122 129 -
trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeGammaConversion.hh
r819 r961 26 26 // 27 27 // $Id: G4PenelopeGammaConversion.hh,v 1.2 2006/06/29 19:36:25 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: L. Pandola -
trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeIonisation.hh
r819 r961 26 26 // ------------------------------------------------------------------- 27 27 // $Id: G4PenelopeIonisation.hh,v 1.5 2006/06/29 19:36:33 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: L. Pandola -
trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopePhotoElectric.hh
r819 r961 26 26 // 27 27 // $Id: G4PenelopePhotoElectric.hh,v 1.4 2006/06/29 19:36:35 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: L.Pandola -
trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeRayleigh.hh
r819 r961 26 26 // 27 27 // $Id: G4PenelopeRayleigh.hh,v 1.5 2006/06/29 19:36:37 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Luciano Pandola -
trunk/source/processes/electromagnetic/lowenergy/include/G4RangeNoTest.hh
r819 r961 26 26 // 27 27 // $Id: G4RangeNoTest.hh,v 1.4 2006/06/29 19:36:47 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4RangeTest.hh
r819 r961 26 26 // 27 27 // $Id: G4RangeTest.hh,v 1.4 2006/06/29 19:36:49 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4SemiLogInterpolation.hh
r819 r961 26 26 // 27 27 // $Id: G4SemiLogInterpolation.hh,v 1.4 2006/06/29 19:36:51 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4ShellData.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4ShellData.hh,v 1. 5 2007/02/20 16:53:16 manteroExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4ShellData.hh,v 1.7 2008/03/17 13:45:25 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 55 55 public: 56 56 57 G4ShellData(G4int minZ = 1, G4int maxZ = 100 );57 G4ShellData(G4int minZ = 1, G4int maxZ = 100, G4bool isOccupancy = false); 58 58 59 59 ~G4ShellData(); … … 63 63 G4int ShellId(G4int Z, G4int shellIndex) const; 64 64 65 const G4DataVector& ShellIdVector(G4int Z) const; 65 G4double ShellOccupancyProbability(G4int Z, G4int shellIndex) const; 66 67 const std::vector<G4double>& ShellIdVector(G4int Z) const; 66 68 67 69 G4double BindingEnergy(G4int Z, G4int shellIndex) const; 70 71 void SetOccupancyData() { occupancyData = true; } 68 72 69 73 void LoadData(const G4String& fileName); 70 74 71 75 void PrintData() const; 76 77 // Randomly select a shell based on shell occupancy 78 G4int SelectRandomShell(G4int Z) const; 72 79 73 80 private: … … 77 84 G4ShellData(const G4ShellData&); 78 85 79 G4int zMin; 86 const std::vector<G4double>& ShellVector(G4int Z) const; 87 88 G4int zMin; 80 89 G4int zMax; 81 90 82 std::map<G4int,G4DataVector*,std::less<G4int> > idMap; 91 G4bool occupancyData; 92 93 std::map<G4int,std::vector<G4double>*,std::less<G4int> > idMap; 83 94 std::map<G4int,G4DataVector*,std::less<G4int> > bindingMap; 84 95 std::vector<G4int> nShells; 96 std::map<G4int,std::vector<G4double>*,std::less<G4int> > occupancyPdfMap; 85 97 86 98 }; -
trunk/source/processes/electromagnetic/lowenergy/include/G4ShellEMDataSet.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4ShellEMDataSet.hh,v 1. 9 2007/10/15 08:31:49pia Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4ShellEMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 33 33 // ----------- 34 34 // 31 Jul 2001 MGP Created 35 // 9 Mar 2008 MGP Cleaned up unreadable code modified by former developer 36 // (Further clean-up needed) 35 37 // 36 38 // ------------------------------------------------------------------- … … 44 46 // ------------------------------------------------------------------- 45 47 46 #ifndef G4SHELLEMDATASET_HH47 #define G4SHELLEMDATASET_HH 148 #ifndef G4SHELLEMDATASET_HH 49 #define G4SHELLEMDATASET_HH 1 48 50 49 #include "globals.hh"50 #include "G4VEMDataSet.hh"51 #include <vector>51 #include "globals.hh" 52 #include "G4VEMDataSet.hh" 53 #include <vector> 52 54 53 class G4VDataSetAlgorithm;55 class G4VDataSetAlgorithm; 54 56 55 class G4ShellEMDataSet : public G4VEMDataSet 56 { 57 public: 58 G4ShellEMDataSet(G4int argZ, G4VDataSetAlgorithm* argAlgorithm, G4double argUnitEnergies=MeV, G4double argUnitData=barn); 59 virtual ~G4ShellEMDataSet(); 57 class G4ShellEMDataSet : public G4VEMDataSet 58 { 59 public: 60 G4ShellEMDataSet(G4int Z, 61 G4VDataSetAlgorithm* algo, 62 G4double eUnit=MeV, 63 G4double dataUnit=barn); 64 65 virtual ~G4ShellEMDataSet(); 60 66 61 virtual G4double FindValue(G4double argEnergy, G4int argComponentId=0) const;67 virtual G4double FindValue(G4double energy, G4int componentId=0) const; 62 68 63 virtual void PrintData(void) const;69 virtual void PrintData(void) const; 64 70 65 virtual const G4VEMDataSet* GetComponent(G4int argComponentId) const { return components[argComponentId]; }66 virtual void AddComponent(G4VEMDataSet * argDataSet) { components.push_back(argDataSet); }67 virtual size_t NumberOfComponents(void) const { return components.size(); }71 virtual const G4VEMDataSet* GetComponent(G4int componentId) const { return components[componentId]; } 72 virtual void AddComponent(G4VEMDataSet* dataSet) { components.push_back(dataSet); } 73 virtual size_t NumberOfComponents(void) const { return components.size(); } 68 74 69 virtual const G4DataVector& GetEnergies(G4int argComponentId) const { return GetComponent(argComponentId)->GetEnergies(0); }70 virtual const G4DataVector& GetData(G4int argComponentId) const { return GetComponent(argComponentId)->GetData(0); }71 virtual void SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int argComponentId);75 virtual const G4DataVector& GetEnergies(G4int componentId) const { return GetComponent(componentId)->GetEnergies(0); } 76 virtual const G4DataVector& GetData(G4int componentId) const { return GetComponent(componentId)->GetData(0); } 77 virtual void SetEnergiesData(G4DataVector* energies, G4DataVector* data, G4int componentId); 72 78 73 virtual G4bool LoadData(const G4String & argFileName); 74 virtual G4bool SaveData(const G4String & argFileName) const; 79 virtual G4bool LoadData(const G4String& fileName); 80 virtual G4bool SaveData(const G4String& fileName) const; 81 82 virtual G4double RandomSelect(G4int /*componentId = 0*/) const { return -1.; }; 75 83 76 protected: 77 G4double GetUnitEnergies() const { return unitEnergies; } 78 G4double GetUnitData() const { return unitData; } 79 const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; } 84 protected: 85 86 G4double GetUnitEnergies() const { return unitEnergies; } 87 G4double GetUnitData() const { return unitData; } 88 const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; } 80 89 81 void CleanUpComponents(void);90 void CleanUpComponents(void); 82 91 83 private: 84 G4String FullFileName(const G4String & argFileName) const; 92 private: 93 94 G4String FullFileName(const G4String& fileName) const; 85 95 86 // Hide copy constructor and assignment operator87 G4ShellEMDataSet();88 G4ShellEMDataSet(const G4ShellEMDataSet& copy);89 G4ShellEMDataSet& operator=(const G4ShellEMDataSet& right);96 // Hide copy constructor and assignment operator 97 G4ShellEMDataSet(); 98 G4ShellEMDataSet(const G4ShellEMDataSet& copy); 99 G4ShellEMDataSet& operator=(const G4ShellEMDataSet& right); 90 100 91 std::vector<G4VEMDataSet*> components; // Owned pointers101 std::vector<G4VEMDataSet*> components; // Owned pointers 92 102 93 G4int z;103 G4int z; 94 104 95 G4VDataSetAlgorithm* algorithm; // Owned pointer105 G4VDataSetAlgorithm* algorithm; // Owned pointer 96 106 97 G4double unitEnergies;98 G4double unitData;99 };107 G4double unitEnergies; 108 G4double unitData; 109 }; 100 110 #endif /* G4SHELLEMDATASET_HH */ -
trunk/source/processes/electromagnetic/lowenergy/include/G4VCrossSectionHandler.hh
r819 r961 26 26 // 27 27 // $Id: G4VCrossSectionHandler.hh,v 1.14 2006/06/29 19:37:01 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4VDataSetAlgorithm.hh
r819 r961 26 26 // 27 27 // $Id: G4VDataSetAlgorithm.hh,v 1.7 2006/06/29 19:37:07 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4VEMDataSet.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4VEMDataSet.hh,v 1. 9 2007/10/15 08:31:49pia Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4VEMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 44 44 // ------------------------------------------------------------------- 45 45 46 #ifndef G4VEMDATASET_HH47 #define G4VEMDATASET_HH 146 #ifndef G4VEMDATASET_HH 47 #define G4VEMDATASET_HH 1 48 48 49 #include "globals.hh"50 #include "G4DataVector.hh"49 #include "globals.hh" 50 #include "G4DataVector.hh" 51 51 52 class G4VEMDataSet53 {54 public:55 G4VEMDataSet() { }56 virtual~G4VEMDataSet() { }52 class G4VEMDataSet 53 { 54 public: 55 G4VEMDataSet() { } 56 virtual ~G4VEMDataSet() { } 57 57 58 virtual G4double FindValue(G4double argEnergy, G4int argComponentId=0) const = 0;58 virtual G4double FindValue(G4double x, G4int componentId = 0) const = 0; 59 59 60 virtual voidPrintData(void) const = 0;60 virtual void PrintData(void) const = 0; 61 61 62 virtual const G4VEMDataSet * GetComponent(G4int argComponentId) const = 0;63 virtual void AddComponent(G4VEMDataSet * argDataSet) = 0;64 virtual size_tNumberOfComponents(void) const = 0;62 virtual const G4VEMDataSet* GetComponent(G4int componentId) const = 0; 63 virtual void AddComponent(G4VEMDataSet* dataSet) = 0; 64 virtual size_t NumberOfComponents(void) const = 0; 65 65 66 virtual const G4DataVector & GetEnergies(G4int argComponentId) const = 0;67 virtual const G4DataVector & GetData(G4int argComponentId) const = 0;68 virtual void SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int argComponent=0) = 0;66 virtual const G4DataVector& GetEnergies(G4int componentId) const = 0; 67 virtual const G4DataVector& GetData(G4int componentId) const = 0; 68 virtual void SetEnergiesData(G4DataVector* x, G4DataVector* data, G4int component=0) = 0; 69 69 70 virtual G4bool LoadData(const G4String & argFileName) = 0; 71 virtual G4bool SaveData(const G4String & argFileName) const = 0; 70 virtual G4bool LoadData(const G4String& fileName) = 0; 71 virtual G4bool SaveData(const G4String& fileName) const = 0; 72 73 virtual G4double RandomSelect(G4int componentId = 0) const = 0; 72 74 73 private:74 // Hide copy constructor and assignment operator75 G4VEMDataSet(const G4VEMDataSet& copy);76 G4VEMDataSet & operator=(const G4VEMDataSet& right);77 };75 private: 76 // Hide copy constructor and assignment operator 77 G4VEMDataSet(const G4VEMDataSet& copy); 78 G4VEMDataSet& operator=(const G4VEMDataSet& right); 79 }; 78 80 #endif /* G4VEMDATASET_HH */ -
trunk/source/processes/electromagnetic/lowenergy/include/G4VLowEnergyDiscretePhotonProcess.hh
r819 r961 25 25 // 26 26 // $Id: G4VLowEnergyDiscretePhotonProcess.hh,v 1.4 2006/06/29 19:37:13 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/include/G4VLowEnergyTestableDiscreteProcess.hh
r819 r961 26 26 // 27 27 // $Id: G4VLowEnergyTestableDiscreteProcess.hh,v 1.3 2006/06/29 19:37:17 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 -
trunk/source/processes/electromagnetic/lowenergy/include/G4VRangeTest.hh
r819 r961 26 26 // 27 27 // $Id: G4VRangeTest.hh,v 1.3 2006/06/29 19:37:21 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4VeLowEnergyLoss.hh
r819 r961 26 26 // 27 27 // $Id: G4VeLowEnergyLoss.hh,v 1.9 2006/06/29 19:37:23 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // 3.4.2000 Veronique Lefebure: -
trunk/source/processes/electromagnetic/lowenergy/include/G4WaterExcitationStructure.hh
r819 r961 26 26 // 27 27 // $Id: G4WaterExcitationStructure.hh,v 1.1 2007/10/15 08:33:25 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4WaterIonisationStructure.hh
r819 r961 26 26 // 27 27 // $Id: G4WaterIonisationStructure.hh,v 1.1 2007/11/08 20:38:40 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4eBremsstrahlungSpectrum.hh
r819 r961 25 25 // 26 26 // $Id: G4eBremsstrahlungSpectrum.hh,v 1.8 2006/06/29 19:37:33 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/include/G4eCrossSectionExcitationEmfietzoglou.hh
r819 r961 26 26 // 27 27 // $Id: G4eCrossSectionExcitationEmfietzoglou.hh,v 1.1 2007/05/02 17:18:48 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4eCrossSectionScreenedRutherford.hh
r819 r961 26 26 // 27 27 // $Id: G4eCrossSectionScreenedRutherford.hh,v 1.2 2007/10/12 12:26:34 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4eIonisationCrossSectionHandler.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eIonisationCrossSectionHandler.hh,v 1. 6 2006/06/29 19:37:36 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4eIonisationCrossSectionHandler.hh,v 1.7 2009/01/29 08:13:27 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 40 40 // Modified: 41 41 // 10 Oct 2001 M.G. Pia Revision to improve code quality and consistency with design 42 // 42 // 28 Jan 2009 L.Pandola Added public method to make a easier migration of 43 // G4LowEnergyIonisation to G4LivermoreIonisationModel 43 44 // ------------------------------------------------------------------- 44 45 … … 72 73 73 74 ~G4eIonisationCrossSectionHandler(); 75 76 G4double GetCrossSectionAboveThresholdForElement(G4double energy, 77 G4double cutEnergy, 78 G4int Z); 74 79 75 80 protected: -
trunk/source/processes/electromagnetic/lowenergy/include/G4eIonisationParameters.hh
r819 r961 26 26 // 27 27 // $Id: G4eIonisationParameters.hh,v 1.8 2006/06/29 19:37:38 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/include/G4eIonisationSpectrum.hh
r819 r961 25 25 // 26 26 // $Id: G4eIonisationSpectrum.hh,v 1.7 2006/06/29 19:37:40 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/include/G4eLowEnergyLoss.hh
r819 r961 26 26 // 27 27 // $Id: G4eLowEnergyLoss.hh,v 1.14 2006/06/29 19:37:42 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/include/G4eLowEnergyLoss.icc
r819 r961 26 26 // 27 27 // $Id: G4eLowEnergyLoss.icc,v 1.8 2006/06/29 19:37:44 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // --------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/include/G4hLowEnergyLoss.hh
r819 r961 26 26 // 27 27 // $Id: G4hLowEnergyLoss.hh,v 1.17 2006/06/29 19:37:58 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // $Id: -
trunk/source/processes/electromagnetic/lowenergy/include/G4hLowEnergyLoss.icc
r819 r961 26 26 // 27 27 // $Id: G4hLowEnergyLoss.icc,v 1.3 2006/06/29 19:38:00 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // $Id: -
trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionDoubleExp.hh
r819 r961 45 45 // ------------------------------------------------------------------- 46 46 // $Id: G4hShellCrossSectionDoubleExp.hh,v 1.3 2006/06/29 19:38:12 gunter Exp $ 47 // GEANT4 tag $Name: $47 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 48 48 49 49 #ifndef G4HSHELLCROSSSECTIONDOUBLEEXP_HH -
trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionDoubleExpData.hh
r819 r961 40 40 // ------------------------------------------------------------------- 41 41 // $Id: G4hShellCrossSectionDoubleExpData.hh,v 1.3 2006/06/29 19:38:14 gunter Exp $ 42 // GEANT4 tag $Name: $42 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 43 43 44 44 #ifndef G4hShellCrossSectionDoubleExpData_HH -
trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionExp.hh
r819 r961 45 45 // ------------------------------------------------------------------- 46 46 // $Id: G4hShellCrossSectionExp.hh,v 1.3 2006/06/29 19:38:16 gunter Exp $ 47 // GEANT4 tag $Name: $47 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 48 48 49 49 #ifndef G4HSHELLCROSSSECTIONEXP_HH -
trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionExpData.hh
r819 r961 38 38 // ------------------------------------------------------------------- 39 39 // $Id: G4hShellCrossSectionExpData.hh,v 1.3 2006/06/29 19:38:18 gunter Exp $ 40 // GEANT4 tag $Name: $40 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 41 41 42 42 #ifndef G4hShellCrossSectionExpData_HH -
trunk/source/processes/electromagnetic/lowenergy/src/G4AtomicDeexcitation.cc
r819 r961 26 26 // 27 27 // $Id: G4AtomicDeexcitation.cc,v 1.11 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) -
trunk/source/processes/electromagnetic/lowenergy/src/G4AtomicShell.cc
r819 r961 26 26 // 27 27 // $Id: G4AtomicShell.cc,v 1.2 ???? 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) -
trunk/source/processes/electromagnetic/lowenergy/src/G4AtomicTransitionManager.cc
r819 r961 26 26 // 27 27 // $Id: G4AtomicTransitionManager.cc,v 1.2 ???? 28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) … … 319 319 G4double totalRadTransProb = 0; 320 320 321 for (size_t j = 1; j<transProb.size(); j++) 321 for (size_t j = 0; j<transProb.size(); j++) // AM -- corrected, it was 1 322 322 { 323 323 totalRadTransProb = totalRadTransProb + transProb[j]; … … 361 361 G4double totalRadTransProb = 0; 362 362 363 for(size_t j = 1; j<transProb.size(); j++)363 for(size_t j = 0; j<transProb.size(); j++) // AM -- Corrected, was 1 364 364 { 365 365 totalRadTransProb = totalRadTransProb + transProb[j]; -
trunk/source/processes/electromagnetic/lowenergy/src/G4AugerData.cc
r819 r961 480 480 481 481 482 for (G4int element = 6; element < 10 1; element++)482 for (G4int element = 6; element < 100; element++) 483 483 { 484 if(nMaterials == 0 || activeZ.contains(element)) { 485 augerTransitionTable.insert(trans_Table::value_type(element,LoadData(element))); 486 487 G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl; 488 // PrintData(element); 489 } 490 } 491 492 G4cout << "AugerTransitionTable complete"<< G4endl; 484 // if(nMaterials == 0 || activeZ.contains(element)) { 485 augerTransitionTable.insert(trans_Table::value_type(element,LoadData(element))); 486 // G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl; 487 // G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl; 488 G4cout << "AugerTransitionTable complete"<< G4endl; 489 } 493 490 } 494 491 -
trunk/source/processes/electromagnetic/lowenergy/src/G4BremsstrahlungCrossSectionHandler.cc
r819 r961 25 25 // 26 26 // $Id: G4BremsstrahlungCrossSectionHandler.cc,v 1.9 2006/06/29 19:38:42 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/src/G4BremsstrahlungParameters.cc
r819 r961 26 26 // 27 27 // $Id: G4BremsstrahlungParameters.cc,v 1.19 2006/06/29 19:38:44 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4CompositeEMDataSet.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4CompositeEMDataSet.cc,v 1. 9 2006/06/29 19:38:46 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4CompositeEMDataSet.cc,v 1.13 2008/03/17 13:40:53 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 42 42 #include <sstream> 43 43 44 G4CompositeEMDataSet :: G4CompositeEMDataSet(G4VDataSetAlgorithm* argAlgorithm, G4double argUnitEnergies, G4double argUnitData, G4int argMinZ, G4int argMaxZ) 45 : 46 algorithm(argAlgorithm), 47 unitEnergies(argUnitEnergies), 48 unitData(argUnitData), 49 minZ(argMinZ), 50 maxZ(argMaxZ) 44 G4CompositeEMDataSet::G4CompositeEMDataSet(G4VDataSetAlgorithm* argAlgorithm, 45 G4double argUnitEnergies, 46 G4double argUnitData, 47 G4int argMinZ, 48 G4int argMaxZ) 49 : 50 algorithm(argAlgorithm), 51 unitEnergies(argUnitEnergies), 52 unitData(argUnitData), 53 minZ(argMinZ), 54 maxZ(argMaxZ) 51 55 { 52 if (algorithm == 0)53 G4Exception("G4CompositeEMDataSet::G4CompositeEMDataSet - interpolation == 0");56 if (algorithm == 0) 57 G4Exception("G4CompositeEMDataSet::G4CompositeEMDataSet - interpolation == 0"); 54 58 } 55 59 56 60 57 61 58 G4CompositeEMDataSet ::~G4CompositeEMDataSet()62 G4CompositeEMDataSet::~G4CompositeEMDataSet() 59 63 { 60 CleanUpComponents(); 64 CleanUpComponents(); 65 if (algorithm) delete algorithm; 66 } 61 67 62 if (algorithm) 63 delete algorithm; 68 69 G4double G4CompositeEMDataSet::FindValue(G4double argEnergy, G4int argComponentId) const 70 { 71 const G4VEMDataSet* component(GetComponent(argComponentId)); 72 73 if (component) return component->FindValue(argEnergy); 74 75 std::ostringstream message; 76 message << "G4CompositeEMDataSet::FindValue - component " << argComponentId << " not found"; 77 78 G4Exception(message.str().c_str()); 79 80 return 0.; 81 } 82 83 void G4CompositeEMDataSet::PrintData(void) const 84 { 85 const size_t n(NumberOfComponents()); 86 87 G4cout << "The data set has " << n << " components" << G4endl; 88 G4cout << G4endl; 89 90 size_t i(0); 91 92 while (i<n) 93 { 94 G4cout << "--- Component " << i << " ---" << G4endl; 95 GetComponent(i)->PrintData(); 96 i++; 97 } 98 } 99 100 void G4CompositeEMDataSet::SetEnergiesData(G4DataVector* argEnergies, G4DataVector* argData, G4int argComponentId) 101 { 102 G4VEMDataSet * component(components[argComponentId]); 103 104 if (component) 105 { 106 component->SetEnergiesData(argEnergies, argData, 0); 107 return; 108 } 109 110 std::ostringstream message; 111 message << "G4CompositeEMDataSet::SetEnergiesData - component " << argComponentId << " not found"; 112 113 G4Exception(message.str().c_str()); 114 } 115 116 G4bool G4CompositeEMDataSet::LoadData(const G4String& argFileName) 117 { 118 CleanUpComponents(); 119 120 for (G4int z(minZ); z<maxZ; z++) 121 { 122 G4VEMDataSet* component = new G4EMDataSet(z, algorithm->Clone(), unitEnergies, unitData); 123 if (!component->LoadData(argFileName)) 124 { 125 delete component; 126 return false; 127 } 128 AddComponent(component); 129 } 130 return true; 64 131 } 65 132 66 133 67 134 135 G4bool G4CompositeEMDataSet::SaveData(const G4String& argFileName) const 136 { 137 for (G4int z=minZ; z<maxZ; z++) 138 { 139 const G4VEMDataSet* component(GetComponent(z-minZ)); 140 141 if (!component) 142 { 143 std::ostringstream message; 144 message << "G4CompositeEMDataSet::SaveData - component " << (z-minZ) << " not found"; 145 G4Exception(message.str().c_str()); 146 } 68 147 148 if (!component->SaveData(argFileName)) 149 return false; 150 } 151 152 return true; 153 } 69 154 70 71 G4double G4CompositeEMDataSet :: FindValue(G4double argEnergy, G4int argComponentId) const 155 void G4CompositeEMDataSet::CleanUpComponents(void) 72 156 { 73 const G4VEMDataSet * component(GetComponent(argComponentId)); 74 75 if (component) 76 return component->FindValue(argEnergy); 77 78 std::ostringstream message; 79 message << "G4CompositeEMDataSet::FindValue - component " << argComponentId << " not found"; 80 81 G4Exception(message.str().c_str()); 82 83 return 0.; 157 while (!components.empty()) 158 { 159 if (components.back()) 160 delete components.back(); 161 components.pop_back(); 162 } 84 163 } 85 164 86 165 87 88 89 90 void G4CompositeEMDataSet :: PrintData(void) const 166 G4double G4CompositeEMDataSet::RandomSelect(G4int componentId) const 91 167 { 92 const size_t n(NumberOfComponents()); 93 94 G4cout << "The data set has " << n << " components" << G4endl; 95 G4cout << G4endl; 96 97 size_t i(0); 98 99 while (i<n) 100 { 101 G4cout << "--- Component " << i << " ---" << G4endl; 102 GetComponent(i)->PrintData(); 103 i++; 104 } 168 G4double value = 0.; 169 if (componentId >= 0 && componentId < (G4int)components.size()) 170 { 171 const G4VEMDataSet* dataSet = GetComponent(componentId); 172 value = dataSet->RandomSelect(); 173 } 174 return value; 105 175 } 106 107 108 109 110 111 void G4CompositeEMDataSet :: SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int argComponentId)112 {113 G4VEMDataSet * component(components[argComponentId]);114 115 if (component)116 {117 component->SetEnergiesData(argEnergies, argData, 0);118 return;119 }120 121 std::ostringstream message;122 message << "G4CompositeEMDataSet::SetEnergiesData - component " << argComponentId << " not found";123 124 G4Exception(message.str().c_str());125 }126 127 128 129 130 131 G4bool G4CompositeEMDataSet :: LoadData(const G4String & argFileName)132 {133 CleanUpComponents();134 135 for (G4int z(minZ); z<maxZ; z++)136 {137 G4VEMDataSet * component=new G4EMDataSet(z, algorithm->Clone(), unitEnergies, unitData);138 if (!component->LoadData(argFileName))139 {140 delete component;141 return false;142 }143 144 AddComponent(component);145 }146 147 return true;148 }149 150 151 152 G4bool G4CompositeEMDataSet :: SaveData(const G4String & argFileName) const153 {154 for (G4int z(minZ); z<maxZ; z++)155 {156 const G4VEMDataSet * component(GetComponent(z-minZ));157 158 if (!component)159 {160 std::ostringstream message;161 message << "G4CompositeEMDataSet::SaveData - component " << (z-minZ) << " not found";162 163 G4Exception(message.str().c_str());164 }165 166 if (!component->SaveData(argFileName))167 return false;168 }169 170 return true;171 }172 173 174 175 176 177 void G4CompositeEMDataSet :: CleanUpComponents(void)178 {179 while (!components.empty())180 {181 if (components.back())182 delete components.back();183 184 components.pop_back();185 }186 }187 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecrease.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionChargeDecrease.cc,v 1.2 2007/11/09 20:11:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionChargeDecrease.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionChargeDecrease.hh" 54 #include "G4Track.hh" 55 #include "G4DynamicParticle.hh" 56 #include "G4Proton.hh" 57 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh" 58 #include "G4DNAGenericIonsManager.hh" 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 59 32 60 33 G4CrossSectionChargeDecrease::G4CrossSectionChargeDecrease() 61 34 { 62 // Default energy limits (defined for protection against anomalous behaviour only)63 name = "ChargeDecrease";64 35 lowEnergyLimitDefault = 1 * keV; 65 36 highEnergyLimitDefault = 10 * MeV; … … 76 47 77 48 if (protonDef != 0) 78 {79 proton = protonDef->GetParticleName();80 lowEnergyLimit[proton] = 1. * keV;81 highEnergyLimit[proton] = 10. * keV;82 }49 { 50 proton = protonDef->GetParticleName(); 51 lowEnergyLimit[proton] = 1. * keV; 52 highEnergyLimit[proton] = 10. * MeV; 53 } 83 54 else 84 {85 G4Exception("G4CrossSectionChargeDecrease Constructor: proton is not defined");86 }55 { 56 G4Exception("G4CrossSectionChargeDecrease Constructor: proton is not defined"); 57 } 87 58 88 59 if (alphaPlusPlusDef != 0) 89 {90 alphaPlusPlus = alphaPlusPlusDef->GetParticleName();91 lowEnergyLimit[alphaPlusPlus] = 1. * keV;92 highEnergyLimit[alphaPlusPlus] = 10. * MeV;93 }60 { 61 alphaPlusPlus = alphaPlusPlusDef->GetParticleName(); 62 lowEnergyLimit[alphaPlusPlus] = 1. * keV; 63 highEnergyLimit[alphaPlusPlus] = 10. * MeV; 64 } 94 65 else 95 {96 G4Exception("G4CrossSectionChargeDecrease Constructor: alphaPlusPlus is not defined");97 }66 { 67 G4Exception("G4CrossSectionChargeDecrease Constructor: alphaPlusPlus is not defined"); 68 } 98 69 99 70 if (alphaPlusDef != 0) 100 {101 alphaPlus = alphaPlusDef->GetParticleName();102 lowEnergyLimit[alphaPlus] = 1. * keV;103 highEnergyLimit[alphaPlus] = 10. * MeV;104 }71 { 72 alphaPlus = alphaPlusDef->GetParticleName(); 73 lowEnergyLimit[alphaPlus] = 1. * keV; 74 highEnergyLimit[alphaPlus] = 10. * MeV; 75 } 105 76 else 106 {107 G4Exception("G4CrossSectionChargeDecrease Constructor: alphaPlus is not defined");108 }77 { 78 G4Exception("G4CrossSectionChargeDecrease Constructor: alphaPlus is not defined"); 79 } 109 80 110 81 } 111 82 83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 112 84 113 85 G4CrossSectionChargeDecrease::~G4CrossSectionChargeDecrease() 114 86 {} 115 87 88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 116 89 117 90 G4double G4CrossSectionChargeDecrease::CrossSection(const G4Track& track) … … 140 113 G4Exception("G4CrossSectionChargeDecrease: attempting to calculate cross section for wrong particle"); 141 114 142 // Retrieve energy limits for the current particle type143 144 115 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 145 116 pos1 = lowEnergyLimit.find(particleName); 146 117 147 // Lower limit148 118 if (pos1 != lowEnergyLimit.end()) 149 {150 lowLim = pos1->second;151 }119 { 120 lowLim = pos1->second; 121 } 152 122 153 // Upper limit154 123 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 155 124 pos2 = highEnergyLimit.find(particleName); 156 125 157 126 if (pos2 != highEnergyLimit.end()) 158 { 159 highLim = pos2->second; 160 } 161 162 // 127 { 128 highLim = pos2->second; 129 } 163 130 164 131 G4double crossSection(0.); 165 132 if (k >= lowLim && k <= highLim) 166 {133 { 167 134 crossSection = partialCrossSection.Sum(k,particleDefinition); 168 }135 } 169 136 170 137 return crossSection; -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecreasePartial.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionChargeDecreasePartial.cc,v 1.1 2007/11/08 18:25:25 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 08 Nov 2007 MGP Got code from S.I.; added variable initialisation to avoid compilation warnings 40 // 41 // ------------------------------------------------------------------- 42 43 // Class description: 44 // Geant4-DNA Cross total cross section for electron elastic scattering in water 45 // Reference: TNS Geant4-DNA paper 46 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 47 // design foundation and implementation of the first set of models, 48 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 49 // Further documentation available from http://www.ge.infn.it/geant4/dna 50 51 // ------------------------------------------------------------------- 52 26 // $Id: G4CrossSectionChargeDecreasePartial.cc,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 53 28 54 29 #include "G4CrossSectionChargeDecreasePartial.hh" 55 #include "G4ParticleDefinition.hh" 56 #include "G4Proton.hh" 57 #include "G4DNAGenericIonsManager.hh" 58 59 #include "Randomize.hh" 60 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 61 32 62 33 G4CrossSectionChargeDecreasePartial::G4CrossSectionChargeDecreasePartial() … … 116 87 } 117 88 89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 90 118 91 G4CrossSectionChargeDecreasePartial::~G4CrossSectionChargeDecreasePartial() 119 { } 120 92 {} 93 94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 95 121 96 G4double G4CrossSectionChargeDecreasePartial::CrossSection(G4double k, G4int index, 122 97 const G4ParticleDefinition* particleDefinition) … … 149 124 150 125 if (x1[index][particleTypeIndex]<x0[index][particleTypeIndex]) 151 {126 { 152 127 // 153 128 // if x1 < x0 means that x1 and b1 will be calculated with the following formula (this piece of code is run on all alphas and not on protons) … … 163 138 + b0[index][particleTypeIndex] - c0[index][particleTypeIndex] * std::pow(x1[index][particleTypeIndex] 164 139 - x0[index][particleTypeIndex], d0[index][particleTypeIndex]); 165 }140 } 166 141 167 142 G4double x(std::log10(k/eV)); … … 197 172 198 173 while (i>0) 199 {174 { 200 175 i--; 201 176 values[i]=CrossSection(k, i, particleDefinition); 202 177 value+=values[i]; 203 }178 } 204 179 205 180 value*=G4UniformRand(); … … 207 182 i=n; 208 183 while (i>0) 209 {184 { 210 185 i--; 211 186 … … 214 189 215 190 value-=values[i]; 216 }191 } 217 192 218 193 delete[] values; … … 220 195 return i; 221 196 } 197 198 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 222 199 223 200 G4double G4CrossSectionChargeDecreasePartial::Sum(G4double k, const G4ParticleDefinition* particleDefinition) … … 234 211 235 212 for (G4int i=0; i<numberOfPartialCrossSections[particleTypeIndex]; i++) 236 {237 totalCrossSection += CrossSection(k,i,particleDefinition);238 }213 { 214 totalCrossSection += CrossSection(k,i,particleDefinition); 215 } 239 216 return totalCrossSection; 240 217 } 241 242 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeIncrease.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionChargeIncrease.cc,v 1.3 2007/12/10 16:31:21 gunter Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionChargeIncrease.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionChargeIncrease.hh" 54 #include "G4Track.hh" 55 #include "G4DynamicParticle.hh" 56 #include "G4ParticleDefinition.hh" 57 #include "G4DNAGenericIonsManager.hh" 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 58 32 59 33 G4CrossSectionChargeIncrease::G4CrossSectionChargeIncrease() 60 34 { 61 // Default energy limits (defined for protection against anomalous behaviour only)62 name = "ChargeIncrease";63 35 lowEnergyLimitDefault = 1 * keV; 64 36 highEnergyLimitDefault = 10 * MeV; … … 75 47 76 48 if (hydrogenDef != 0) 77 {78 hydrogen = hydrogenDef->GetParticleName();79 lowEnergyLimit[hydrogen] = 1. * keV;80 highEnergyLimit[hydrogen] = 10. * MeV;81 }49 { 50 hydrogen = hydrogenDef->GetParticleName(); 51 lowEnergyLimit[hydrogen] = 1. * keV; 52 highEnergyLimit[hydrogen] = 10. * MeV; 53 } 82 54 else 83 {84 G4Exception("G4CrossSectionChargeIncrease Constructor: hydrogen is not defined");85 }55 { 56 G4Exception("G4CrossSectionChargeIncrease Constructor: hydrogen is not defined"); 57 } 86 58 87 59 if (alphaPlusDef != 0) 88 {89 alphaPlus = alphaPlusDef->GetParticleName();90 lowEnergyLimit[alphaPlus] = 1. * keV;91 highEnergyLimit[alphaPlus] = 10. * MeV;92 }60 { 61 alphaPlus = alphaPlusDef->GetParticleName(); 62 lowEnergyLimit[alphaPlus] = 1. * keV; 63 highEnergyLimit[alphaPlus] = 10. * MeV; 64 } 93 65 else 94 {95 G4Exception("G4CrossSectionChargeIncrease Constructor: alphaPlus is not defined");96 }66 { 67 G4Exception("G4CrossSectionChargeIncrease Constructor: alphaPlus is not defined"); 68 } 97 69 98 70 if (heliumDef != 0) 99 {100 helium = heliumDef->GetParticleName();101 lowEnergyLimit[helium] = 1. * keV;102 highEnergyLimit[helium] = 10. * MeV;103 }71 { 72 helium = heliumDef->GetParticleName(); 73 lowEnergyLimit[helium] = 1. * keV; 74 highEnergyLimit[helium] = 10. * MeV; 75 } 104 76 else 105 {106 G4Exception("G4CrossSectionChargeIncrease Constructor: helium is not defined");107 }77 { 78 G4Exception("G4CrossSectionChargeIncrease Constructor: helium is not defined"); 79 } 108 80 109 81 } 110 82 83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 111 84 112 85 G4CrossSectionChargeIncrease::~G4CrossSectionChargeIncrease() 113 86 {} 114 87 88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 115 89 116 90 G4double G4CrossSectionChargeIncrease::CrossSection(const G4Track& track) … … 139 113 G4Exception("G4CrossSectionChargeIncrease: attempting to calculate cross section for wrong particle"); 140 114 141 142 // Retrieve energy limits for the current particle type143 144 115 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 145 116 pos1 = lowEnergyLimit.find(particleName); 146 117 147 // Lower limit148 118 if (pos1 != lowEnergyLimit.end()) 149 {150 lowLim = pos1->second;151 }119 { 120 lowLim = pos1->second; 121 } 152 122 153 // Upper limit154 123 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 155 124 pos2 = highEnergyLimit.find(particleName); 156 125 157 126 if (pos2 != highEnergyLimit.end()) 158 {159 highLim = pos2->second;160 }127 { 128 highLim = pos2->second; 129 } 161 130 162 131 G4double totalCrossSection = 0.; 163 132 164 133 if (k >= lowLim && k <= highLim) 165 {134 { 166 135 //HYDROGEN 167 136 if (particleDefinition == instance->GetIon("hydrogen")) 168 {137 { 169 138 const G4double aa = 2.835; 170 139 const G4double bb = 0.310; … … 180 149 G4double sigmah = temp * (aa * std::log(1.0 + x) + bb) / x; 181 150 totalCrossSection = 1.0/(1.0/sigmal + 1.0/sigmah) *m*m; 182 }151 } 183 152 else 184 {153 { 185 154 totalCrossSection = partialCrossSection.Sum(k,particleDefinition); 186 }187 }155 } 156 } 188 157 189 158 return totalCrossSection; -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeIncreasePartial.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionChargeIncreasePartial.cc,v 1.1 2007/11/08 18:25:25 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionChargeIncreasePartial.cc,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionChargeIncreasePartial.hh" 54 #include "G4DynamicParticle.hh" 55 #include "G4ParticleDefinition.hh" 56 #include "G4Proton.hh" 57 #include "G4DNAGenericIonsManager.hh" 58 59 #include "Randomize.hh" 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 60 32 61 33 G4CrossSectionChargeIncreasePartial::G4CrossSectionChargeIncreasePartial() 62 34 { 63 64 35 //ALPHA+ 36 65 37 f0[0][0]=1.; 66 38 a0[0][0]=2.25; … … 101 73 102 74 numberOfPartialCrossSections[1]=2; 103 104 } 75 } 76 77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 105 78 106 79 G4CrossSectionChargeIncreasePartial::~G4CrossSectionChargeIncreasePartial() 107 { }80 {} 108 81 82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 83 109 84 G4double G4CrossSectionChargeIncreasePartial::CrossSection(G4double k, G4int index, 110 85 const G4ParticleDefinition* particleDefinition) … … 137 112 138 113 if (x1[index][particleTypeIndex]<x0[index][particleTypeIndex]) 139 {114 { 140 115 // 141 116 // if x1 < x0 means that x1 and b1 will be calculated with the following formula (this piece of code is run on all alphas and not on protons) … … 148 123 x1[index][particleTypeIndex]=x0[index][particleTypeIndex] + std::pow((a0[index][particleTypeIndex] - a1[index][particleTypeIndex]) / (c0[index][particleTypeIndex] * d0[index][particleTypeIndex]), 1. / (d0[index][particleTypeIndex] - 1.)); 149 124 b1[index][particleTypeIndex]=(a0[index][particleTypeIndex] - a1[index][particleTypeIndex]) * x1[index][particleTypeIndex] + b0[index][particleTypeIndex] - c0[index][particleTypeIndex] * std::pow(x1[index][particleTypeIndex] - x0[index][particleTypeIndex], d0[index][particleTypeIndex]); 150 }125 } 151 126 152 127 G4double x(std::log10(k/eV)); … … 161 136 162 137 return f0[index][particleTypeIndex] * std::pow(10., y)*m*m; 163 164 165 } 138 139 } 140 141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 166 142 167 143 G4int G4CrossSectionChargeIncreasePartial::RandomSelect(G4double k, … … 183 159 184 160 while (i>0) 185 {161 { 186 162 i--; 187 163 values[i]=CrossSection(k, i, particleDefinition); 188 164 value+=values[i]; 189 }165 } 190 166 191 167 value*=G4UniformRand(); … … 193 169 i=n; 194 170 while (i>0) 195 {171 { 196 172 i--; 197 173 … … 200 176 201 177 value-=values[i]; 202 }178 } 203 179 204 180 delete[] values; … … 206 182 return i; 207 183 } 184 185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 208 186 209 187 G4double G4CrossSectionChargeIncreasePartial::Sum(G4double k, const G4ParticleDefinition* particleDefinition) … … 219 197 220 198 for (G4int i=0; i<numberOfPartialCrossSections[particleTypeIndex]; i++) 221 {222 totalCrossSection += CrossSection(k,i,particleDefinition);223 }199 { 200 totalCrossSection += CrossSection(k,i,particleDefinition); 201 } 224 202 return totalCrossSection; 225 203 } 226 204 227 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticScreenedRutherford.cc
r819 r961 26 26 // 27 27 // $Id: G4CrossSectionElasticScreenedRutherford.cc,v 1.1 2007/10/12 23:11:41 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationBorn.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationBorn.cc,v 1.2 2007/11/09 20:11:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionExcitationBorn.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionExcitationBorn.hh" 54 #include "G4Track.hh"55 #include "G4DynamicParticle.hh"56 #include "G4ParticleDefinition.hh"57 #include "G4Electron.hh"58 #include "G4LogLogInterpolation.hh"59 30 60 #include "Randomize.hh" 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 61 32 62 33 G4CrossSectionExcitationBorn::G4CrossSectionExcitationBorn() 63 34 { 64 65 // ---- MGP ---- Limits to be checked: current values are just temporary for testing purpose 66 name = "ExcitationBorn"; 67 lowEnergyLimit = 1. * keV; 35 lowEnergyLimit = 500. * keV; 68 36 highEnergyLimit = 10 * MeV; 69 70 37 table = 0; 71 38 } 72 39 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 73 41 74 42 G4CrossSectionExcitationBorn::~G4CrossSectionExcitationBorn() … … 77 45 } 78 46 47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 48 79 49 G4double G4CrossSectionExcitationBorn::CrossSection(const G4Track& track) 80 50 { 81 // Lazy initialisation: load cross section tables in memory the first time access to them is required 82 51 83 52 G4double sigma = 0.; 84 53 85 54 if (table == 0) 86 { 87 // Load tables 88 // ---- MGP ---- 89 table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m ); 90 table->LoadData("dna/sigma_excitation_p_born"); 91 92 // ---- MGP ---- Temporary 93 table->PrintData(); 94 } 55 { 56 table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m ); 57 table->LoadData("dna/sigma_excitation_p_born"); 58 } 95 59 96 60 const G4DynamicParticle* particle = track.GetDynamicParticle(); 97 61 G4double k = particle->GetKineticEnergy(); 98 62 99 if (k > lowEnergyLimit && k <highEnergyLimit)100 {101 sigma = table->FindValue(k); // no electron interaction ---- MGP ---- What does this mean?102 }63 if (k >= lowEnergyLimit && k <= highEnergyLimit) 64 { 65 sigma = table->FindValue(k); 66 } 103 67 return sigma; 104 68 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationBornPartial.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationBornPartial.cc,v 1.1 2007/10/15 08:57:54 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionExcitationBornPartial.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionExcitationBornPartial.hh" 54 #include "G4Track.hh"55 #include "G4DynamicParticle.hh"56 #include "G4ParticleDefinition.hh"57 #include "G4Electron.hh"58 #include "G4LogLogInterpolation.hh"59 30 60 #include "Randomize.hh" 61 62 #include <deque> 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4CrossSectionExcitationBornPartial::G4CrossSectionExcitationBornPartial() 65 34 { 66 35 table = 0; 67 // nLevels = waterExcitation.NumberOfLevels();68 36 } 69 37 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 70 39 71 40 G4CrossSectionExcitationBornPartial::~G4CrossSectionExcitationBornPartial() … … 74 43 } 75 44 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 76 46 77 47 G4int G4CrossSectionExcitationBornPartial::RandomSelect(G4double k) 78 48 { 79 // Lazy initialisation: load cross section tables in memory the first time access to them is required80 81 49 G4int level = 0; 82 50 83 51 if (table == 0) 84 { 85 // Load tables 86 // ---- MGP ---- 87 table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m ); 88 table->LoadData("dna/sigma_excitation_p_born"); 89 90 // ---- MGP ---- Temporary 91 table->PrintData(); 92 } 52 { 53 table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m ); 54 table->LoadData("dna/sigma_excitation_p_born"); 55 } 93 56 94 57 G4double* valuesBuffer = new G4double[table->NumberOfComponents()]; … … 99 62 100 63 while (i>0) 101 {102 i--;103 valuesBuffer[i] = table->GetComponent(i)->FindValue(k);104 value += valuesBuffer[i];105 }64 { 65 i--; 66 valuesBuffer[i] = table->GetComponent(i)->FindValue(k); 67 value += valuesBuffer[i]; 68 } 106 69 107 70 value *= G4UniformRand(); … … 110 73 111 74 while (i > 0) 75 { 76 i--; 77 78 if (valuesBuffer[i] > value) 112 79 { 113 i--; 114 115 if (valuesBuffer[i] > value) 116 { 117 delete[] valuesBuffer; 118 return i; 119 } 80 delete[] valuesBuffer; 81 return i; 82 } 120 83 value -= valuesBuffer[i]; 121 }84 } 122 85 123 // It should never end up here124 125 // ---- MGP ---- Is the following line really necessary?126 86 if (valuesBuffer) delete[] valuesBuffer; 127 87 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglou.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationEmfietzoglou.cc,v 1.2 2007/10/15 08:36:35 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionExcitationEmfietzoglou.cc,v 1.5 2008/12/05 11:58:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionExcitationEmfietzoglou.hh" 54 #include "G4Track.hh" 55 #include "G4DynamicParticle.hh" 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 56 32 57 33 G4CrossSectionExcitationEmfietzoglou::G4CrossSectionExcitationEmfietzoglou() 58 34 { 59 60 name = "CrossSectionExcitationEmfietzoglou"; 61 lowEnergyLimit = 7.4 * eV; 35 lowEnergyLimit = 8.23 * eV; 62 36 highEnergyLimit = 10. * MeV; 63 37 } 64 38 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 65 40 66 41 G4CrossSectionExcitationEmfietzoglou::~G4CrossSectionExcitationEmfietzoglou() 67 { }42 {} 68 43 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 69 45 70 46 G4double G4CrossSectionExcitationEmfietzoglou::CrossSection(const G4Track& track) … … 73 49 G4double k = particle->GetKineticEnergy(); 74 50 75 // Cross section = 0 outside the energy validity limits set in the constructor76 // ---- MGP ---- Better handling of these limits to be set in a following design iteration77 78 51 G4double sigma = 0.; 79 52 80 if (k > lowEnergyLimit && k <highEnergyLimit) sigma = partialCrossSection.Sum(k);53 if (k >= lowEnergyLimit && k <= highEnergyLimit) sigma = partialCrossSection.Sum(k); 81 54 82 55 return sigma; -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglouPartial.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationEmfietzoglouPartial.cc,v 1.2 2007/12/10 16:31:26 gunter Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionExcitationEmfietzoglouPartial.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh" 54 #include "G4Track.hh"55 #include "G4DynamicParticle.hh"56 #include "G4ParticleDefinition.hh"57 #include "G4Electron.hh"58 30 59 #include "Randomize.hh" 60 61 #include <deque> 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 62 32 63 33 G4CrossSectionExcitationEmfietzoglouPartial::G4CrossSectionExcitationEmfietzoglouPartial() 64 34 { 65 66 35 nLevels = waterExcitation.NumberOfLevels(); 67 //G4cout << "Water excitation energy: number of levels = " << nLevels << G4endl;68 36 } 69 37 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 70 39 71 40 G4CrossSectionExcitationEmfietzoglouPartial::~G4CrossSectionExcitationEmfietzoglouPartial() 72 { }41 {} 73 42 43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 44 74 45 G4double G4CrossSectionExcitationEmfietzoglouPartial::CrossSection(G4double t, G4int level) 75 46 { … … 84 55 // Aj, Bj, Cj & Pj are parameters that can be found in Emfietzoglou's papers 85 56 // 86 //87 57 // From Phys. Med. Biol. 48 (2003) 2355-2371, D.Emfietzoglou, 88 58 // Monte Carlo Simulation of the energy loss of low energy electrons in liquid Water 89 59 // 90 60 // Scaling for macroscopic cross section: number of water moleculs per unit volume 91 // (capra) const G4double sigma0 = (10. / 3.343e22) * cm2; 61 // const G4double sigma0 = (10. / 3.343e22) * cm2; 62 92 63 const G4double density = 3.34192e+19 * mm3; 93 64 … … 100 71 101 72 G4double exc = waterExcitation.ExcitationEnergy(level); 102 // G4cout << "Water excitation energy " << exc/keV << " level = " << level << G4endl; 103 73 104 74 if (t >= exc) 105 75 { … … 113 83 } 114 84 85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 86 115 87 G4int G4CrossSectionExcitationEmfietzoglouPartial::RandomSelect(G4double k) 116 88 { … … 119 91 std::deque<double> values; 120 92 121 // ---- MGP ---- The following algorithm is wrong: it works i sthe cross section93 // ---- MGP ---- The following algorithm is wrong: it works if the cross section 122 94 // is a monotone increasing function. 123 95 // The algorithm should be corrected by building the cumulative function … … 126 98 127 99 while (i > 0) 128 {129 i--;130 G4double partial = CrossSection(k,i);131 values.push_front(partial);132 value += partial;133 }100 { 101 i--; 102 G4double partial = CrossSection(k,i); 103 values.push_front(partial); 104 value += partial; 105 } 134 106 135 value *= G4UniformRand();107 value *= G4UniformRand(); 136 108 137 i = nLevels;109 i = nLevels; 138 110 139 while (i > 0)140 {141 i--;142 if (values[i] > value) return i;143 value -= values[i];144 }111 while (i > 0) 112 { 113 i--; 114 if (values[i] > value) return i; 115 value -= values[i]; 116 } 145 117 146 return 0;118 return 0; 147 119 } 120 121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 148 122 149 123 G4double G4CrossSectionExcitationEmfietzoglouPartial::Sum(G4double k) … … 152 126 153 127 for (G4int i=0; i<nLevels; i++) 154 {155 totalCrossSection += CrossSection(k,i);156 }128 { 129 totalCrossSection += CrossSection(k,i); 130 } 157 131 return totalCrossSection; 158 132 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreen.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationMillerGreen.cc,v 1.3 2007/11/09 20:11:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionExcitationMillerGreen.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionExcitationMillerGreen.hh" 54 #include "G4Track.hh" 55 #include "G4DynamicParticle.hh" 56 #include "G4Proton.hh" 57 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh" 58 #include "G4DNAGenericIonsManager.hh" 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 59 32 60 33 G4CrossSectionExcitationMillerGreen::G4CrossSectionExcitationMillerGreen() 61 34 { 62 // Default energy limits (defined for protection against anomalous behaviour only)63 name = "ExcitationMillerGreen";64 35 lowEnergyLimitDefault = 10 * eV; 65 36 highEnergyLimitDefault = 10 * MeV; … … 78 49 79 50 if (protonDef != 0) 80 {81 proton = protonDef->GetParticleName();82 lowEnergyLimit[proton] = 10. * eV;83 highEnergyLimit[proton] = 500. * keV;84 }51 { 52 proton = protonDef->GetParticleName(); 53 lowEnergyLimit[proton] = 10. * eV; 54 highEnergyLimit[proton] = 500. * keV; 55 } 85 56 else 86 {87 G4Exception("G4CrossSectionExcitationMillerGreen Constructor: proton is not defined");88 }57 { 58 G4Exception("G4CrossSectionExcitationMillerGreen Constructor: proton is not defined"); 59 } 89 60 90 61 if (alphaPlusPlusDef != 0) 91 {92 alphaPlusPlus = alphaPlusPlusDef->GetParticleName();93 lowEnergyLimit[alphaPlusPlus] = 1. * keV;94 highEnergyLimit[alphaPlusPlus] = 10. * MeV;95 }62 { 63 alphaPlusPlus = alphaPlusPlusDef->GetParticleName(); 64 lowEnergyLimit[alphaPlusPlus] = 1. * keV; 65 highEnergyLimit[alphaPlusPlus] = 10. * MeV; 66 } 96 67 else 97 {68 { 98 69 G4Exception("G4CrossSectionExcitationMillerGreen Constructor: alphaPlusPlus is not defined"); 99 }70 } 100 71 101 72 if (alphaPlusDef != 0) 102 {103 alphaPlus = alphaPlusDef->GetParticleName();104 lowEnergyLimit[alphaPlus] = 1. * keV;105 highEnergyLimit[alphaPlus] = 10. * MeV;106 }73 { 74 alphaPlus = alphaPlusDef->GetParticleName(); 75 lowEnergyLimit[alphaPlus] = 1. * keV; 76 highEnergyLimit[alphaPlus] = 10. * MeV; 77 } 107 78 else 108 {109 G4Exception("G4CrossSectionExcitationMillerGreen Constructor: alphaPlus is not defined");110 }79 { 80 G4Exception("G4CrossSectionExcitationMillerGreen Constructor: alphaPlus is not defined"); 81 } 111 82 112 83 if (heliumDef != 0) 113 {114 helium = heliumDef->GetParticleName();115 lowEnergyLimit[helium] = 1. * keV;116 highEnergyLimit[helium] = 10. * MeV;117 }84 { 85 helium = heliumDef->GetParticleName(); 86 lowEnergyLimit[helium] = 1. * keV; 87 highEnergyLimit[helium] = 10. * MeV; 88 } 118 89 else 119 { 120 G4Exception("G4CrossSectionExcitationMillerGreen Constructor: helium is not defined"); 121 } 122 123 90 { 91 G4Exception("G4CrossSectionExcitationMillerGreen Constructor: helium is not defined"); 92 } 93 124 94 } 125 95 96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 126 97 127 98 G4CrossSectionExcitationMillerGreen::~G4CrossSectionExcitationMillerGreen() 128 99 {} 129 100 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 130 102 131 103 G4double G4CrossSectionExcitationMillerGreen::CrossSection(const G4Track& track) … … 154 126 const G4String& particleName = particle->GetDefinition()->GetParticleName(); 155 127 156 // Retrieve energy limits for the current particle type157 158 128 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 159 129 pos1 = lowEnergyLimit.find(particleName); 160 130 161 // Lower limit162 131 if (pos1 != lowEnergyLimit.end()) 163 {164 lowLim = pos1->second;165 }132 { 133 lowLim = pos1->second; 134 } 166 135 167 // Upper limit168 136 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 169 137 pos2 = highEnergyLimit.find(particleName); 170 138 171 139 if (pos2 != highEnergyLimit.end()) 172 {173 highLim = pos2->second;174 }140 { 141 highLim = pos2->second; 142 } 175 143 176 //177 144 const G4ParticleDefinition* particleDefinition = track.GetDefinition(); 178 145 … … 180 147 181 148 if (k >= lowLim && k <= highLim) 149 { 150 crossSection = partialCrossSection.Sum(k,particleDefinition); 151 G4DNAGenericIonsManager *instance; 152 instance = G4DNAGenericIonsManager::Instance(); 153 154 // add ONE or TWO electron-water excitation for alpha+ and helium 155 156 if ( particleDefinition == instance->GetIon("alpha+") 157 || 158 particleDefinition == instance->GetIon("helium") 159 ) 182 160 { 183 184 crossSection = partialCrossSection.Sum(k,particleDefinition);185 G4DNAGenericIonsManager *instance;186 instance = G4DNAGenericIonsManager::Instance();187 188 // add ONE or TWO electron-water excitation for alpha+ and helium189 190 if ( particleDefinition == instance->GetIon("alpha+")191 ||192 particleDefinition == instance->GetIon("helium")193 )194 {195 161 G4CrossSectionExcitationEmfietzoglouPartial * excitationXS = 196 162 new G4CrossSectionExcitationEmfietzoglouPartial(); 163 197 164 G4double sigmaExcitation=0; 198 165 if (k*0.511/3728 > 7.4*eV && k*0.511/3728 < 10*keV) sigmaExcitation = excitationXS->Sum(k*0.511/3728); … … 200 167 if ( particleDefinition == instance->GetIon("alpha+") ) 201 168 crossSection = crossSection + sigmaExcitation ; 169 202 170 if ( particleDefinition == instance->GetIon("helium") ) 203 171 crossSection = crossSection + 2*sigmaExcitation ; 172 204 173 delete excitationXS; 205 }206 }174 } 175 } 207 176 208 177 return crossSection; -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreenPartial.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationMillerGreenPartial.cc,v 1.1 2007/11/08 19:57:23 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionExcitationMillerGreenPartial.cc,v 1.3 2009/01/20 07:40:53 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionExcitationMillerGreenPartial.hh" 54 #include "G4Track.hh" 55 #include "G4DynamicParticle.hh" 56 #include "G4ParticleDefinition.hh" 57 #include "G4Proton.hh" 58 #include "G4DNAGenericIonsManager.hh" 59 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh" 60 #include "Randomize.hh" 61 #include <deque> 62 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4CrossSectionExcitationMillerGreenPartial::G4CrossSectionExcitationMillerGreenPartial() 65 34 { 66 67 35 nLevels = waterExcitation.NumberOfLevels(); 68 //G4cout << "Water excitation energy: number of levels = " << nLevels << G4endl;69 36 70 37 //PROTON … … 106 73 } 107 74 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 76 108 77 G4CrossSectionExcitationMillerGreenPartial::~G4CrossSectionExcitationMillerGreenPartial() 109 { } 110 78 {} 79 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 81 111 82 G4double G4CrossSectionExcitationMillerGreenPartial::CrossSection(G4double k, G4int excitationLevel, 112 83 const G4ParticleDefinition* particleDefinition) … … 144 115 tCorrected = k * kineticEnergyCorrection[particleTypeIndex]; 145 116 146 // Assume that the material is water; proper algorithm to calculate correctly for any material to be inserted here 117 // SI - added protection 118 if (tCorrected < waterExcitation.ExcitationEnergy(excitationLevel)) return 0; 119 // 120 147 121 G4int z = 10; 148 122 … … 168 142 } 169 143 144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 145 170 146 G4int G4CrossSectionExcitationMillerGreenPartial::RandomSelect(G4double k, 171 147 const G4ParticleDefinition* particle) … … 175 151 std::deque<double> values; 176 152 177 // ---- MGP ---- The following algorithm is wrong: it works i sthe cross section153 // ---- MGP ---- The following algorithm is wrong: it works if the cross section 178 154 // is a monotone increasing function. 179 155 // The algorithm should be corrected by building the cumulative function … … 186 162 // ELECTRON CORRECTION 187 163 188 if ( particle == instance->GetIon("alpha++")) 189 { while (i > 0) 190 { 164 if ( particle == instance->GetIon("alpha++")|| 165 particle == G4Proton::ProtonDefinition()) 166 167 { while (i > 0) 168 { 191 169 i--; 192 170 G4double partial = CrossSection(k,i,particle); 193 171 values.push_front(partial); 194 172 value += partial; 195 }196 197 value *= G4UniformRand();173 } 174 175 value *= G4UniformRand(); 198 176 199 i = nLevels;200 201 while (i > 0)202 {177 i = nLevels; 178 179 while (i > 0) 180 { 203 181 i--; 204 182 if (values[i] > value) return i; 205 183 value -= values[i]; 206 } 207 } 208 209 // 184 } 185 } 186 210 187 // add ONE or TWO electron-water excitation for alpha+ and helium 211 188 … … 213 190 || 214 191 particle == instance->GetIon("helium") 215 ) 192 ) 193 { 194 while (i>0) 216 195 { 217 218 while (i>0)219 {220 196 i--; 221 197 … … 232 208 value += partial; 233 209 delete excitationXS; 234 }235 236 value*=G4UniformRand();237 238 i=5;239 while (i>0)240 {210 } 211 212 value*=G4UniformRand(); 213 214 i=5; 215 while (i>0) 216 { 241 217 i--; 242 218 … … 244 220 245 221 value-=values[i]; 246 }247 }222 } 223 } 248 224 // 225 249 226 return 0; 250 227 } 251 228 229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 230 252 231 G4double G4CrossSectionExcitationMillerGreenPartial::Sum(G4double k, const G4ParticleDefinition* particle) 253 232 { … … 255 234 256 235 for (G4int i=0; i<nLevels; i++) 257 {258 totalCrossSection += CrossSection(k,i,particle);259 }236 { 237 totalCrossSection += CrossSection(k,i,particle); 238 } 260 239 return totalCrossSection; 261 240 } 262 241 242 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 263 243 264 244 G4double G4CrossSectionExcitationMillerGreenPartial::S_1s(G4double t, … … 277 257 278 258 259 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 260 279 261 G4double G4CrossSectionExcitationMillerGreenPartial::S_2s(G4double t, 280 262 G4double energyTransferred, … … 292 274 } 293 275 276 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 294 277 295 278 G4double G4CrossSectionExcitationMillerGreenPartial::S_2p(G4double t, … … 307 290 } 308 291 292 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 309 293 310 294 G4double G4CrossSectionExcitationMillerGreenPartial::R(G4double t, -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionHandler.cc
r819 r961 26 26 // 27 27 // $Id: G4CrossSectionHandler.cc,v 1.18 2006/06/29 19:38:48 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBorn.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionIonisationBorn.cc,v 1.2 2007/11/08 18:51:34 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionIonisationBorn.cc,v 1.4 2008/08/20 14:51:48 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionIonisationBorn.hh" 54 #include "G4ParticleDefinition.hh"55 #include "G4Electron.hh"56 #include "G4Proton.hh"57 #include "G4Track.hh"58 #include "G4LogLogInterpolation.hh"59 #include "G4SystemOfUnits.hh"60 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 61 32 62 33 G4CrossSectionIonisationBorn::G4CrossSectionIonisationBorn() 63 34 { 64 65 name = "IonisationBorn"; 66 67 // Default energy limits (defined for protection against anomalous behaviour only) 68 lowEnergyLimitDefault = 25 * eV; 35 lowEnergyLimitDefault = 12.61 * eV; // SI: i/o 25 eV 69 36 highEnergyLimitDefault = 30 * keV; 70 37 … … 78 45 G4String proton; 79 46 80 // Factor to scale microscopic/macroscopic cross section data in water81 // ---- MGP ---- Hardcoded (taken from prototype code); to be replaced with proper calculation82 47 G4double scaleFactor = (1.e-22 / 3.343) * m*m; 83 48 49 if (electronDef != 0) 50 { 51 electron = electronDef->GetParticleName(); 52 tableFile[electron] = fileElectron; 84 53 85 // Data members for electrons 54 lowEnergyLimit[electron] = 12.61 * eV; // SI: i/o 25 eV 55 highEnergyLimit[electron] = 30. * keV; 86 56 87 if (electronDef != 0) 88 { 89 electron = electronDef->GetParticleName(); 90 tableFile[electron] = fileElectron; 91 92 // Energy limits 93 lowEnergyLimit[electron] = 25. * eV; 94 highEnergyLimit[electron] = 30. * keV; 95 96 // Create data set with electron cross section data and load values stored in file 97 G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 98 tableE->LoadData(fileElectron); 57 G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 58 tableE->LoadData(fileElectron); 99 59 100 // Insert key-table pair in map 101 tableData[electron] = tableE; 102 } 60 tableData[electron] = tableE; 61 } 103 62 else 104 { 105 G4Exception("G4CrossSectionIonisationBorn Constructor: electron is not defined"); 106 } 107 108 // Data members for protons 63 { 64 G4Exception("G4CrossSectionIonisationBorn Constructor: electron is not defined"); 65 } 109 66 110 67 if (protonDef != 0) 111 {112 proton = protonDef->GetParticleName();113 tableFile[proton] = fileProton;68 { 69 proton = protonDef->GetParticleName(); 70 tableFile[proton] = fileProton; 114 71 115 // Energy limits 116 lowEnergyLimit[proton] = 500. * keV; 117 highEnergyLimit[proton] = 10. * MeV; 72 lowEnergyLimit[proton] = 500. * keV; 73 highEnergyLimit[proton] = 10. * MeV; 118 74 119 // Create data set with proton cross section data and load values stored in file 120 G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 121 tableP->LoadData(fileProton); 75 G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 76 tableP->LoadData(fileProton); 122 77 123 // Insert key-table pair in map 124 tableData[proton] = tableP; 125 } 78 tableData[proton] = tableP; 79 } 126 80 else 127 {128 G4Exception("G4CrossSectionIonisationBorn Constructor: proton is not defined");129 }81 { 82 G4Exception("G4CrossSectionIonisationBorn Constructor: proton is not defined"); 83 } 130 84 } 131 85 86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 132 87 133 88 G4CrossSectionIonisationBorn::~G4CrossSectionIonisationBorn() 134 89 { 135 // Destroy the content of the map136 90 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 137 91 for (pos = tableData.begin(); pos != tableData.end(); ++pos) 138 {139 G4DNACrossSectionDataSet* table = pos->second;140 delete table;141 }92 { 93 G4DNACrossSectionDataSet* table = pos->second; 94 delete table; 95 } 142 96 } 143 97 144 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 145 99 146 100 G4double G4CrossSectionIonisationBorn::CrossSection(const G4Track& track ) … … 149 103 G4double k = particle->GetKineticEnergy(); 150 104 151 // Cross section = 0 outside the energy validity limits set in the constructor152 105 G4double sigma = 0.; 153 106 154 // ---- MGP ---- Better handling of these limits to be set in a following design iteration155 107 G4double lowLim = lowEnergyLimitDefault; 156 108 G4double highLim = highEnergyLimitDefault; … … 158 110 const G4String& particleName = particle->GetDefinition()->GetParticleName(); 159 111 160 // Retrieve energy limits for the current particle type 112 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 113 pos1 = lowEnergyLimit.find(particleName); 161 114 162 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 163 pos1 = lowEnergyLimit.find(particleName); 115 if (pos1 != lowEnergyLimit.end()) 116 { 117 lowLim = pos1->second; 118 } 164 119 165 // Lower limit 166 if (pos1 != lowEnergyLimit.end()) 120 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 121 pos2 = highEnergyLimit.find(particleName); 122 123 if (pos2 != highEnergyLimit.end()) 124 { 125 highLim = pos2->second; 126 } 127 128 if (k > lowLim && k < highLim) 129 { 130 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 131 pos = tableData.find(particleName); 132 133 if (pos != tableData.end()) 134 { 135 G4DNACrossSectionDataSet* table = pos->second; 136 if (table != 0) 167 137 { 168 lowLim = pos1->second;138 sigma = table->FindValue(k); 169 139 } 140 } 141 else 142 { 143 G4Exception("G4CrossSectionIonisationBorn: attempting to calculate cross section for wrong particle"); 144 } 145 } 170 146 171 // Upper limit 172 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 173 pos2 = highEnergyLimit.find(particleName); 174 175 if (pos2 != highEnergyLimit.end()) 176 { 177 highLim = pos2->second; 178 } 179 180 // Verify that the current track is within the energy limits of validity of the cross section model 181 if (k > lowLim && k < highLim) 182 { 183 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 184 pos = tableData.find(particleName); 185 186 if (pos != tableData.end()) 187 { 188 G4DNACrossSectionDataSet* table = pos->second; 189 if (table != 0) 190 { 191 // Cross section 192 sigma = table->FindValue(k); 193 } 194 } 195 else 196 { 197 // The track does not corresponds to a particle pertinent to this model 198 G4Exception("G4CrossSectionIonisationBorn: attempting to calculate cross section for wrong particle"); 199 } 200 } 201 202 return sigma; 147 return sigma; 203 148 } 204 149 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBornElectron.cc
r819 r961 26 26 // 27 27 // $Id: G4CrossSectionIonisationBornElectron.cc,v 1.2 2007/11/08 18:51:34 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBornPartial.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionIonisationBornPartial.cc,v 1.3 2007/11/09 20:11:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionIonisationBornPartial.cc,v 1.5 2009/01/20 07:40:53 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionIonisationBornPartial.hh" 54 #include "G4ParticleDefinition.hh" 55 #include "G4Electron.hh" 56 #include "G4Proton.hh" 57 #include "G4Track.hh" 58 #include "G4LogLogInterpolation.hh" 59 #include "G4SystemOfUnits.hh" 60 61 #include "Randomize.hh" 62 63 #include <utility> 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 64 32 65 33 G4CrossSectionIonisationBornPartial::G4CrossSectionIonisationBornPartial() 66 34 { 67 68 name = "IonisationBorn"; 69 70 // Default energy limits (defined for protection against anomalous behaviour only) 71 name = "IonisationBornPartial"; 72 lowEnergyLimitDefault = 25 * eV; 35 lowEnergyLimitDefault = 12.61 * eV; 73 36 highEnergyLimitDefault = 30 * keV; 74 37 … … 82 45 G4String proton; 83 46 84 // Factor to scale microscopic/macroscopic cross section data in water85 // ---- MGP ---- Hardcoded (taken from prototype code); to be replaced with proper calculation86 47 G4double scaleFactor = (1.e-22 / 3.343) * m*m; 87 48 88 89 // Data members for electrons90 91 49 if (electronDef != 0) 92 { 93 electron = electronDef->GetParticleName(); 94 tableFile[electron] = fileElectron; 95 96 // Energy limits 97 lowEnergyLimit[electron] = 25. * eV; 98 highEnergyLimit[electron] = 30. * keV; 99 100 // Create data set with electron cross section data and load values stored in file 101 G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 102 tableE->LoadData(fileElectron); 50 { 51 electron = electronDef->GetParticleName(); 52 tableFile[electron] = fileElectron; 53 54 lowEnergyLimit[electron] = 12.61 * eV; 55 highEnergyLimit[electron] = 30. * keV; 56 57 G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 58 tableE->LoadData(fileElectron); 103 59 104 // Insert key-table pair in map 105 tableData[electron] = tableE; 106 } 60 tableData[electron] = tableE; 61 } 107 62 else 108 { 109 G4Exception("G4CrossSectionIonisationBornPartial Constructor: electron is not defined"); 110 } 111 112 // Data members for protons 63 { 64 G4Exception("G4CrossSectionIonisationBornPartial Constructor: electron is not defined"); 65 } 113 66 114 67 if (protonDef != 0) 115 { 116 proton = protonDef->GetParticleName(); 117 tableFile[proton] = fileProton; 118 119 // Energy limits 120 lowEnergyLimit[proton] = 500. * keV; 121 highEnergyLimit[proton] = 10. * MeV; 122 123 // Create data set with proton cross section data and load values stored in file 124 G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 125 tableP->LoadData(fileProton); 68 { 69 proton = protonDef->GetParticleName(); 70 tableFile[proton] = fileProton; 71 72 lowEnergyLimit[proton] = 500. * keV; 73 highEnergyLimit[proton] = 10. * MeV; 74 75 G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 76 tableP->LoadData(fileProton); 126 77 127 // Insert key-table pair in map 128 tableData[proton] = tableP; 129 } 78 tableData[proton] = tableP; 79 } 130 80 else 131 { 132 G4Exception("G4CrossSectionIonisationBornPartial Constructor: proton is not defined"); 133 } 134 } 135 81 { 82 G4Exception("G4CrossSectionIonisationBornPartial Constructor: proton is not defined"); 83 } 84 } 85 86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 136 87 137 88 G4CrossSectionIonisationBornPartial::~G4CrossSectionIonisationBornPartial() 138 89 { 139 // Destroy the content of the map140 90 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 141 91 for (pos = tableData.begin(); pos != tableData.end(); ++pos) 142 { 143 G4DNACrossSectionDataSet* table = pos->second; 144 delete table; 145 } 146 } 147 92 { 93 G4DNACrossSectionDataSet* table = pos->second; 94 delete table; 95 } 96 } 97 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 148 99 149 100 G4int G4CrossSectionIonisationBornPartial::RandomSelect(G4double k, const G4String& particle ) 150 101 { 151 152 102 G4int level = 0; 153 103 154 // Retrieve data table corresponding to the current particle type 155 156 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 157 pos = tableData.find(particle); 158 159 if (pos != tableData.end()) 104 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 105 pos = tableData.find(particle); 106 107 if (pos != tableData.end()) 108 { 109 G4DNACrossSectionDataSet* table = pos->second; 110 111 if (table != 0) 112 { 113 G4double* valuesBuffer = new G4double[table->NumberOfComponents()]; 114 const size_t n(table->NumberOfComponents()); 115 size_t i(n); 116 G4double value = 0.; 117 118 while (i>0) 119 { 120 i--; 121 valuesBuffer[i] = table->GetComponent(i)->FindValue(k); 122 value += valuesBuffer[i]; 123 } 124 125 value *= G4UniformRand(); 126 127 i = n; 128 129 while (i > 0) 160 130 { 161 G4DNACrossSectionDataSet* table = pos->second; 162 163 if (table != 0) 164 { 165 // C-style arrays are used in G4DNACrossSectionDataSet: this design feature was 166 // introduced without authorization and should be replaced by the use of STL containers 167 168 G4double* valuesBuffer = new G4double[table->NumberOfComponents()]; 169 170 const size_t n(table->NumberOfComponents()); 171 size_t i(n); 172 G4double value = 0.; 173 174 while (i>0) 175 { 176 i--; 177 valuesBuffer[i] = table->GetComponent(i)->FindValue(k); 178 value += valuesBuffer[i]; 179 } 180 181 value *= G4UniformRand(); 182 183 i = n; 184 185 while (i > 0) 186 { 187 i--; 188 189 if (valuesBuffer[i] > value) 190 { 191 delete[] valuesBuffer; 192 return i; 193 } 194 value -= valuesBuffer[i]; 195 } 196 197 // It should never end up here 198 199 // ---- MGP ---- Is the following line really necessary? 200 if (valuesBuffer) delete[] valuesBuffer; 201 202 } 131 i--; 132 133 if (valuesBuffer[i] > value) 134 { 135 delete[] valuesBuffer; 136 return i; 137 } 138 value -= valuesBuffer[i]; 203 139 } 204 else 205 { 206 G4Exception("G4CrossSectionIonisationBornPartial: attempting to calculate cross section for wrong particle"); 207 } 140 141 if (valuesBuffer) delete[] valuesBuffer; 142 143 } 144 } 145 else 146 { 147 G4Exception("G4CrossSectionIonisationBornPartial: attempting to calculate cross section for wrong particle"); 148 } 208 149 209 150 return level; 210 151 } 211 152 153 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 212 154 213 155 G4double G4CrossSectionIonisationBornPartial::CrossSection(const G4Track& track ) … … 218 160 G4double k = particle->GetKineticEnergy(); 219 161 220 // Cross section = 0 outside the energy validity limits set in the constructor221 // ---- MGP ---- Better handling of these limits to be set in a following design iteration222 223 162 G4double lowLim = lowEnergyLimitDefault; 224 163 G4double highLim = highEnergyLimitDefault; … … 226 165 const G4String& particleName = particle->GetDefinition()->GetParticleName(); 227 166 228 // Retrieve energy limits for the current particle type 229 230 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 231 pos1 = lowEnergyLimit.find(particleName); 232 233 // Lower limit 234 if (pos1 != lowEnergyLimit.end()) 235 { 236 lowLim = pos1->second; 237 } 238 239 // Upper limit 240 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 241 pos2 = highEnergyLimit.find(particleName); 242 243 if (pos2 != highEnergyLimit.end()) 244 { 245 highLim = pos2->second; 246 } 247 248 // Verify that the current track is within the energy limits of validity of the cross section model 249 if (k > lowLim && k < highLim) 250 { 251 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 252 pos = tableData.find(particleName); 167 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 168 pos1 = lowEnergyLimit.find(particleName); 169 170 if (pos1 != lowEnergyLimit.end()) 171 { 172 lowLim = pos1->second; 173 } 174 175 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 176 pos2 = highEnergyLimit.find(particleName); 177 178 if (pos2 != highEnergyLimit.end()) 179 { 180 highLim = pos2->second; 181 } 182 183 if (k > lowLim && k < highLim) 184 { 185 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 186 pos = tableData.find(particleName); 253 187 254 if (pos != tableData.end()) 255 { 256 G4DNACrossSectionDataSet* table = pos->second; 257 if (table != 0) 258 { 259 // ---- MGP ---- Temporary 260 // table->PrintData(); 261 262 // Cross section 263 sigma = table->FindValue(k); 264 } 265 } 266 else 267 { 268 // The track corresponds to a not pertinent particle 269 G4Exception("G4CrossSectionIonisationBornPartial: attempting to calculate cross section for wrong particle"); 270 } 271 } 272 273 return sigma; 274 } 275 188 if (pos != tableData.end()) 189 { 190 G4DNACrossSectionDataSet* table = pos->second; 191 if (table != 0) 192 { 193 sigma = table->FindValue(k); 194 } 195 } 196 else 197 { 198 G4Exception("G4CrossSectionIonisationBornPartial: attempting to calculate cross section for wrong particle"); 199 } 200 } 201 202 return sigma; 203 } 204 205 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 276 206 277 207 G4double G4CrossSectionIonisationBornPartial::Sum(G4double /* energy */, const G4String& /* particle */) 278 208 { 279 280 209 return 0; 281 210 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBornPartialElectron.cc
r819 r961 26 26 // 27 27 // $Id: G4CrossSectionIonisationBornPartialElectron.cc,v 1.1 2007/10/15 08:57:54 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationRudd.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionIonisationRudd.cc,v 1.2 2007/11/09 16:20:16 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionIonisationRudd.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionIonisationRudd.hh" 54 #include "G4ParticleDefinition.hh" 55 #include "G4Electron.hh" 56 #include "G4Proton.hh" 57 #include "G4Track.hh" 58 #include "G4LogLogInterpolation.hh" 59 #include "G4SystemOfUnits.hh" 60 #include "G4DNAGenericIonsManager.hh" 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 61 32 62 33 G4CrossSectionIonisationRudd::G4CrossSectionIonisationRudd() 63 34 { 64 65 name = "IonisationRudd";66 67 // Default energy limits (defined for protection against anomalous behaviour only)68 // ZERO LOW ENERGY LIMIT FOR ALLOWED KILLING69 35 lowEnergyLimitDefault = 0 * eV; 70 36 highEnergyLimitDefault = 100 * MeV; … … 90 56 G4String helium; 91 57 92 // Factor to scale microscopic/macroscopic cross section data in water93 // ---- MGP ---- Hardcoded (taken from prototype code); to be replaced with proper calculation94 58 G4double scaleFactor = 1 * m*m; 95 59 96 // Data members for protons97 98 60 if (protonDef != 0) 99 { 100 proton = protonDef->GetParticleName(); 101 tableFile[proton] = fileProton; 102 103 // Energy limits 104 lowEnergyLimit[proton] = 0. * eV; 105 highEnergyLimit[proton] = 500. * keV; 106 107 // Create data set with proton cross section data and load values stored in file 108 G4DNACrossSectionDataSet* tableProton = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, 61 { 62 proton = protonDef->GetParticleName(); 63 tableFile[proton] = fileProton; 64 65 lowEnergyLimit[proton] = 0. * eV; 66 highEnergyLimit[proton] = 500. * keV; 67 68 G4DNACrossSectionDataSet* tableProton = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, 109 69 eV, 110 70 scaleFactor ); 111 tableProton->LoadData(fileProton); 112 113 // Insert key-table pair in map 114 tableData[proton] = tableProton; 115 } 116 else 117 { 118 G4Exception("G4CrossSectionIonisationRudd Constructor: proton is not defined"); 119 } 120 121 // Data members for hydrogen 71 tableProton->LoadData(fileProton); 72 tableData[proton] = tableProton; 73 } 74 else 75 { 76 G4Exception("G4CrossSectionIonisationRudd Constructor: proton is not defined"); 77 } 122 78 123 79 if (hydrogenDef != 0) 124 { 125 hydrogen = hydrogenDef->GetParticleName(); 126 tableFile[hydrogen] = fileHydrogen; 127 128 // Energy limits 129 lowEnergyLimit[hydrogen] = 0. * eV; 130 highEnergyLimit[hydrogen] = 100. * MeV; 131 132 // Create data set with hydrogen cross section data and load values stored in file 133 G4DNACrossSectionDataSet* tableHydrogen = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, 80 { 81 hydrogen = hydrogenDef->GetParticleName(); 82 tableFile[hydrogen] = fileHydrogen; 83 84 lowEnergyLimit[hydrogen] = 0. * eV; 85 highEnergyLimit[hydrogen] = 100. * MeV; 86 87 G4DNACrossSectionDataSet* tableHydrogen = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, 134 88 eV, 135 89 scaleFactor ); 136 tableHydrogen->LoadData(fileHydrogen);90 tableHydrogen->LoadData(fileHydrogen); 137 91 138 // Insert key-table pair in map 139 tableData[hydrogen] = tableHydrogen; 140 } 141 else 142 { 143 G4Exception("G4CrossSectionIonisationRudd Constructor: hydrogen is not defined"); 144 } 145 146 // Data members for alphaPlusPlus 92 tableData[hydrogen] = tableHydrogen; 93 } 94 else 95 { 96 G4Exception("G4CrossSectionIonisationRudd Constructor: hydrogen is not defined"); 97 } 147 98 148 99 if (alphaPlusPlusDef != 0) 149 { 150 alphaPlusPlus = alphaPlusPlusDef->GetParticleName(); 151 tableFile[alphaPlusPlus] = fileAlphaPlusPlus; 152 153 // Energy limits 154 lowEnergyLimit[alphaPlusPlus] = 0. * keV; 155 highEnergyLimit[alphaPlusPlus] = 10. * MeV; 156 157 // Create data set with hydrogen cross section data and load values stored in file 158 G4DNACrossSectionDataSet* tableAlphaPlusPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, 100 { 101 alphaPlusPlus = alphaPlusPlusDef->GetParticleName(); 102 tableFile[alphaPlusPlus] = fileAlphaPlusPlus; 103 104 lowEnergyLimit[alphaPlusPlus] = 0. * eV; 105 highEnergyLimit[alphaPlusPlus] = 10. * MeV; 106 107 G4DNACrossSectionDataSet* tableAlphaPlusPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, 159 108 eV, 160 109 scaleFactor ); 161 tableAlphaPlusPlus->LoadData(fileAlphaPlusPlus);110 tableAlphaPlusPlus->LoadData(fileAlphaPlusPlus); 162 111 163 // Insert key-table pair in map 164 tableData[alphaPlusPlus] = tableAlphaPlusPlus; 165 } 166 else 167 { 168 G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlusPlus is not defined"); 169 } 170 171 // Data members for alphaPlus 112 tableData[alphaPlusPlus] = tableAlphaPlusPlus; 113 } 114 else 115 { 116 G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlusPlus is not defined"); 117 } 172 118 173 119 if (alphaPlusDef != 0) 174 { 175 alphaPlus = alphaPlusDef->GetParticleName(); 176 tableFile[alphaPlus] = fileAlphaPlus; 177 178 // Energy limits 179 lowEnergyLimit[alphaPlus] = 0. * keV; 180 highEnergyLimit[alphaPlus] = 10. * MeV; 181 182 // Create data set with hydrogen cross section data and load values stored in file 183 G4DNACrossSectionDataSet* tableAlphaPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, 120 { 121 alphaPlus = alphaPlusDef->GetParticleName(); 122 tableFile[alphaPlus] = fileAlphaPlus; 123 124 lowEnergyLimit[alphaPlus] = 0. * eV; 125 highEnergyLimit[alphaPlus] = 10. * MeV; 126 127 G4DNACrossSectionDataSet* tableAlphaPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, 184 128 eV, 185 129 scaleFactor ); 186 tableAlphaPlus->LoadData(fileAlphaPlus); 187 188 // Insert key-table pair in map 189 tableData[alphaPlus] = tableAlphaPlus; 190 } 191 else 192 { 193 G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlus is not defined"); 194 } 195 196 // Data members for helium 130 tableAlphaPlus->LoadData(fileAlphaPlus); 131 tableData[alphaPlus] = tableAlphaPlus; 132 } 133 else 134 { 135 G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlus is not defined"); 136 } 197 137 198 138 if (heliumDef != 0) 199 { 200 helium = heliumDef->GetParticleName(); 201 tableFile[helium] = fileHelium; 202 203 // Energy limits 204 lowEnergyLimit[helium] = 0. * keV; 205 highEnergyLimit[helium] = 10. * MeV; 206 207 // Create data set with hydrogen cross section data and load values stored in file 208 G4DNACrossSectionDataSet* tableHelium = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, 139 { 140 helium = heliumDef->GetParticleName(); 141 tableFile[helium] = fileHelium; 142 143 lowEnergyLimit[helium] = 0. * eV; 144 highEnergyLimit[helium] = 10. * MeV; 145 146 G4DNACrossSectionDataSet* tableHelium = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, 209 147 eV, 210 148 scaleFactor ); 211 tableHelium->LoadData(fileHelium); 212 213 // Insert key-table pair in map 214 tableData[helium] = tableHelium; 149 tableHelium->LoadData(fileHelium); 150 tableData[helium] = tableHelium; 215 151 } 216 152 else 217 {218 G4Exception("G4CrossSectionIonisationRudd Constructor: helium is not defined");219 }153 { 154 G4Exception("G4CrossSectionIonisationRudd Constructor: helium is not defined"); 155 } 220 156 } 221 157 158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 222 159 223 160 G4CrossSectionIonisationRudd::~G4CrossSectionIonisationRudd() 224 161 { 225 // Destroy the content of the map226 162 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 227 163 for (pos = tableData.begin(); pos != tableData.end(); ++pos) 228 {229 G4DNACrossSectionDataSet* table = pos->second;230 delete table;231 }164 { 165 G4DNACrossSectionDataSet* table = pos->second; 166 delete table; 167 } 232 168 } 233 169 234 170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 235 171 236 172 G4double G4CrossSectionIonisationRudd::CrossSection(const G4Track& track ) … … 252 188 && 253 189 track.GetDefinition() != instance->GetIon("helium") 254 )190 ) 255 191 256 192 G4Exception("G4CrossSectionIonisationRudd: attempting to calculate cross section for wrong particle"); 257 193 258 // Cross section = 0 outside the energy validity limits set in the constructor259 194 G4double sigma = 0.; 260 195 261 // ---- MGP ---- Better handling of these limits to be set in a following design iteration262 196 G4double lowLim = lowEnergyLimitDefault; 263 197 G4double highLim = highEnergyLimitDefault; … … 265 199 const G4String& particleName = particle->GetDefinition()->GetParticleName(); 266 200 267 // Retrieve energy limits for the current particle type268 269 201 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 270 202 pos1 = lowEnergyLimit.find(particleName); 271 203 272 // Lower limit273 204 if (pos1 != lowEnergyLimit.end()) 274 { 275 lowLim = pos1->second; 276 } 277 278 // Upper limit 205 { 206 lowLim = pos1->second; 207 } 208 279 209 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 280 210 pos2 = highEnergyLimit.find(particleName); 281 211 282 212 if (pos2 != highEnergyLimit.end()) 213 { 214 highLim = pos2->second; 215 } 216 217 if (k >= lowLim && k <= highLim) 218 { 219 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 220 pos = tableData.find(particleName); 221 222 if (pos != tableData.end()) 283 223 { 284 highLim = pos2->second; 285 } 286 287 // Verify that the current track is within the energy limits of validity of the cross section model 288 if (k >= lowLim && k <= highLim) 289 { 290 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 291 pos = tableData.find(particleName); 292 293 if (pos != tableData.end()) 294 { 295 G4DNACrossSectionDataSet* table = pos->second; 296 if (table != 0) 297 { 298 // Cross section 224 G4DNACrossSectionDataSet* table = pos->second; 225 if (table != 0) 226 { 299 227 sigma = table->FindValue(k); 300 301 228 302 229 // BEGIN ELECTRON CORRECTION … … 307 234 particle->GetDefinition() == instance->GetIon("helium") 308 235 ) 309 {236 { 310 237 311 238 G4DNACrossSectionDataSet* electronDataset = new G4DNACrossSectionDataSet … … 317 244 318 245 if ( particle->GetDefinition() == instance->GetIon("alpha+") ) 319 {246 { 320 247 G4double tmp1 = table->FindValue(k) + electronDataset->FindValue(kElectron); 321 248 delete electronDataset; 322 249 return tmp1; 323 }250 } 324 251 325 252 if ( particle->GetDefinition() == instance->GetIon("helium") ) 326 {253 { 327 254 G4double tmp2 = table->FindValue(k) + 2. * electronDataset->FindValue(kElectron); 328 255 delete electronDataset; 329 256 return tmp2; 330 }331 }257 } 258 } 332 259 333 260 // END ELECTRON CORRECTION 334 335 } 336 } 337 else 338 { 339 // The track does not corresponds to a particle pertinent to this model 340 G4Exception("G4CrossSectionIonisationRudd: attempting to calculate cross section for wrong particle"); 341 } 261 } 342 262 } 263 else 264 { 265 G4Exception("G4CrossSectionIonisationRudd: attempting to calculate cross section for wrong particle"); 266 } 267 } 343 268 344 269 return sigma; -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationRuddPartial.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionIonisationRuddPartial.cc,v 1.3 2007/11/09 20:11:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Geant4-DNA Cross total cross section for electron elastic scattering in water 44 // Reference: TNS Geant4-DNA paper 45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 46 // design foundation and implementation of the first set of models, 47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 48 // Further documentation available from http://www.ge.infn.it/geant4/dna 49 50 // ------------------------------------------------------------------- 51 26 // $Id: G4CrossSectionIonisationRuddPartial.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionIonisationRuddPartial.hh" 54 #include "G4ParticleDefinition.hh" 55 #include "G4Electron.hh" 56 #include "G4Proton.hh" 57 #include "G4Track.hh" 58 #include "G4LogLogInterpolation.hh" 59 #include "G4SystemOfUnits.hh" 60 #include "G4DNAGenericIonsManager.hh" 61 62 #include "Randomize.hh" 63 64 #include <utility> 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 65 32 66 33 G4CrossSectionIonisationRuddPartial::G4CrossSectionIonisationRuddPartial() 67 34 { 68 name = "IonisationRudd";69 70 // Default energy limits (defined for protection against anomalous behaviour only)71 name = "IonisationRuddPartial";72 35 lowEnergyLimitDefault = 100 * eV; 73 36 highEnergyLimitDefault = 100 * MeV; … … 93 56 G4String helium; 94 57 95 // Factor to scale microscopic/macroscopic cross section data in water96 // ---- MGP ---- Hardcoded (taken from prototype code); to be replaced with proper calculation97 58 G4double scaleFactor = 1 * m*m; 98 59 99 // Data members for protons100 101 60 if (protonDef != 0) 102 { 103 proton = protonDef->GetParticleName(); 104 tableFile[proton] = fileProton; 105 106 // Energy limits 107 lowEnergyLimit[proton] = 100. * eV; 108 highEnergyLimit[proton] = 500. * keV; 109 110 // Create data set with proton cross section data and load values stored in file 111 G4DNACrossSectionDataSet* tableProton = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 112 tableProton->LoadData(fileProton); 113 114 // Insert key-table pair in map 115 tableData[proton] = tableProton; 116 } 117 else 118 { 119 G4Exception("G4CrossSectionIonisationRudd Constructor: proton is not defined"); 120 } 121 122 // Data members for hydrogen 61 { 62 proton = protonDef->GetParticleName(); 63 tableFile[proton] = fileProton; 64 65 lowEnergyLimit[proton] = 100. * eV; 66 highEnergyLimit[proton] = 500. * keV; 67 68 G4DNACrossSectionDataSet* tableProton = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 69 tableProton->LoadData(fileProton); 70 71 tableData[proton] = tableProton; 72 } 73 else 74 { 75 G4Exception("G4CrossSectionIonisationRudd Constructor: proton is not defined"); 76 } 123 77 124 78 if (hydrogenDef != 0) 125 { 126 hydrogen = hydrogenDef->GetParticleName(); 127 tableFile[hydrogen] = fileHydrogen; 128 129 // Energy limits 130 lowEnergyLimit[hydrogen] = 100. * eV; 131 highEnergyLimit[hydrogen] = 100. * MeV; 132 133 // Create data set with hydrogen cross section data and load values stored in file 134 G4DNACrossSectionDataSet* tableHydrogen = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 135 tableHydrogen->LoadData(fileHydrogen); 136 137 // Insert key-table pair in map 138 tableData[hydrogen] = tableHydrogen; 139 } 140 else 141 { 142 G4Exception("G4CrossSectionIonisationRudd Constructor: hydrogen is not defined"); 143 } 144 145 // Data members for alphaPlusPlus 79 { 80 hydrogen = hydrogenDef->GetParticleName(); 81 tableFile[hydrogen] = fileHydrogen; 82 83 lowEnergyLimit[hydrogen] = 100. * eV; 84 highEnergyLimit[hydrogen] = 100. * MeV; 85 86 G4DNACrossSectionDataSet* tableHydrogen = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 87 tableHydrogen->LoadData(fileHydrogen); 88 89 tableData[hydrogen] = tableHydrogen; 90 } 91 else 92 { 93 G4Exception("G4CrossSectionIonisationRudd Constructor: hydrogen is not defined"); 94 } 146 95 147 96 if (alphaPlusPlusDef != 0) 148 { 149 alphaPlusPlus = alphaPlusPlusDef->GetParticleName(); 150 tableFile[alphaPlusPlus] = fileAlphaPlusPlus; 151 152 // Energy limits 153 lowEnergyLimit[alphaPlusPlus] = 1. * keV; 154 highEnergyLimit[alphaPlusPlus] = 10. * MeV; 155 156 // Create data set with hydrogen cross section data and load values stored in file 157 G4DNACrossSectionDataSet* tableAlphaPlusPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 158 tableAlphaPlusPlus->LoadData(fileAlphaPlusPlus); 159 160 // Insert key-table pair in map 161 tableData[alphaPlusPlus] = tableAlphaPlusPlus; 162 } 163 else 164 { 165 G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlusPlus is not defined"); 166 } 167 168 // Data members for alphaPlus 97 { 98 alphaPlusPlus = alphaPlusPlusDef->GetParticleName(); 99 tableFile[alphaPlusPlus] = fileAlphaPlusPlus; 100 101 lowEnergyLimit[alphaPlusPlus] = 1. * keV; 102 highEnergyLimit[alphaPlusPlus] = 10. * MeV; 103 104 G4DNACrossSectionDataSet* tableAlphaPlusPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 105 tableAlphaPlusPlus->LoadData(fileAlphaPlusPlus); 106 107 tableData[alphaPlusPlus] = tableAlphaPlusPlus; 108 } 109 else 110 { 111 G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlusPlus is not defined"); 112 } 169 113 170 114 if (alphaPlusDef != 0) 171 { 172 alphaPlus = alphaPlusDef->GetParticleName(); 173 tableFile[alphaPlus] = fileAlphaPlus; 174 175 // Energy limits 176 lowEnergyLimit[alphaPlus] = 1. * keV; 177 highEnergyLimit[alphaPlus] = 10. * MeV; 178 179 // Create data set with hydrogen cross section data and load values stored in file 180 G4DNACrossSectionDataSet* tableAlphaPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 181 tableAlphaPlus->LoadData(fileAlphaPlus); 182 183 // Insert key-table pair in map 184 tableData[alphaPlus] = tableAlphaPlus; 185 } 186 else 187 { 188 G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlus is not defined"); 189 } 190 191 // Data members for helium 115 { 116 alphaPlus = alphaPlusDef->GetParticleName(); 117 tableFile[alphaPlus] = fileAlphaPlus; 118 119 lowEnergyLimit[alphaPlus] = 1. * keV; 120 highEnergyLimit[alphaPlus] = 10. * MeV; 121 122 G4DNACrossSectionDataSet* tableAlphaPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 123 tableAlphaPlus->LoadData(fileAlphaPlus); 124 125 tableData[alphaPlus] = tableAlphaPlus; 126 } 127 else 128 { 129 G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlus is not defined"); 130 } 192 131 193 132 if (heliumDef != 0) 194 { 195 helium = heliumDef->GetParticleName(); 196 tableFile[helium] = fileHelium; 197 198 // Energy limits 199 lowEnergyLimit[helium] = 1. * keV; 200 highEnergyLimit[helium] = 10. * MeV; 201 202 // Create data set with hydrogen cross section data and load values stored in file 203 G4DNACrossSectionDataSet* tableHelium = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 204 tableHelium->LoadData(fileHelium); 205 206 // Insert key-table pair in map 207 tableData[helium] = tableHelium; 208 } 209 else 210 { 211 G4Exception("G4CrossSectionIonisationRudd Constructor: helium is not defined"); 212 } 213 } 214 133 { 134 helium = heliumDef->GetParticleName(); 135 tableFile[helium] = fileHelium; 136 137 lowEnergyLimit[helium] = 1. * keV; 138 highEnergyLimit[helium] = 10. * MeV; 139 140 G4DNACrossSectionDataSet* tableHelium = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor ); 141 tableHelium->LoadData(fileHelium); 142 143 tableData[helium] = tableHelium; 144 } 145 else 146 { 147 G4Exception("G4CrossSectionIonisationRudd Constructor: helium is not defined"); 148 } 149 } 150 151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 215 152 216 153 G4CrossSectionIonisationRuddPartial::~G4CrossSectionIonisationRuddPartial() 217 154 { 218 // Destroy the content of the map219 155 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 220 156 for (pos = tableData.begin(); pos != tableData.end(); ++pos) 221 { 222 G4DNACrossSectionDataSet* table = pos->second; 223 delete table; 224 } 225 } 226 157 { 158 G4DNACrossSectionDataSet* table = pos->second; 159 delete table; 160 } 161 } 162 163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 227 164 228 165 G4int G4CrossSectionIonisationRuddPartial::RandomSelect(G4double k, const G4String& particle ) … … 243 180 particle == instance->GetIon("helium")->GetParticleName() 244 181 ) 245 {182 { 246 183 electronDataset->LoadData("dna/sigma_ionisation_e_born"); 247 184 … … 250 187 electronComponent = electronDataset->FindValue(kElectron); 251 188 252 }189 } 253 190 254 191 delete electronDataset; … … 264 201 265 202 if (pos != tableData.end()) 266 {203 { 267 204 G4DNACrossSectionDataSet* table = pos->second; 268 205 269 206 if (table != 0) 270 { 271 // C-style arrays are used in G4DNACrossSectionDataSet: this design feature was 272 // introduced without authorization and should be replaced by the use of STL containers 273 207 { 274 208 G4double* valuesBuffer = new G4double[table->NumberOfComponents()]; 275 209 … … 279 213 280 214 while (i>0) 281 {215 { 282 216 i--; 283 217 valuesBuffer[i] = table->GetComponent(i)->FindValue(k); … … 294 228 295 229 value += valuesBuffer[i]; 296 }230 } 297 231 298 232 value *= G4UniformRand(); … … 301 235 302 236 while (i > 0) 303 {237 { 304 238 i--; 305 239 306 240 if (valuesBuffer[i] > value) 307 {241 { 308 242 delete[] valuesBuffer; 309 243 return i; 310 }244 } 311 245 value -= valuesBuffer[i]; 312 } 313 314 // It should never end up here 315 316 // ---- MGP ---- Is the following line really necessary? 246 } 247 317 248 if (valuesBuffer) delete[] valuesBuffer; 318 249 319 }320 }321 else 322 {323 G4Exception("G4CrossSectionIonisationRuddPartial: attempting to calculate cross section for wrong particle");324 }250 } 251 } 252 else 253 { 254 G4Exception("G4CrossSectionIonisationRuddPartial: attempting to calculate cross section for wrong particle"); 255 } 325 256 326 257 return level; 327 258 } 328 259 260 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 329 261 330 262 G4double G4CrossSectionIonisationRuddPartial::CrossSection(const G4Track& track ) … … 335 267 G4double k = particle->GetKineticEnergy(); 336 268 337 // Cross section = 0 outside the energy validity limits set in the constructor338 // ---- MGP ---- Better handling of these limits to be set in a following design iteration339 340 269 G4double lowLim = lowEnergyLimitDefault; 341 270 G4double highLim = highEnergyLimitDefault; … … 343 272 const G4String& particleName = particle->GetDefinition()->GetParticleName(); 344 273 345 // Retrieve energy limits for the current particle type346 347 274 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 348 275 pos1 = lowEnergyLimit.find(particleName); 349 276 350 // Lower limit351 277 if (pos1 != lowEnergyLimit.end()) 352 { 353 lowLim = pos1->second; 354 } 355 356 // Upper limit 278 { 279 lowLim = pos1->second; 280 } 281 357 282 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 358 283 pos2 = highEnergyLimit.find(particleName); 359 284 360 285 if (pos2 != highEnergyLimit.end()) 361 { 362 highLim = pos2->second; 363 } 364 365 // Verify that the current track is within the energy limits of validity of the cross section model 286 { 287 highLim = pos2->second; 288 } 289 366 290 if (k >= lowLim && k <= highLim) 367 {291 { 368 292 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos; 369 293 pos = tableData.find(particleName); 370 294 371 295 if (pos != tableData.end()) 372 {296 { 373 297 G4DNACrossSectionDataSet* table = pos->second; 374 298 if (table != 0) 375 { 376 // ---- MGP ---- Temporary 377 // table->PrintData(); 378 379 // Cross section 299 { 380 300 sigma = table->FindValue(k); 381 }382 }301 } 302 } 383 303 else 384 { 385 // The track corresponds to a not pertinent particle 304 { 386 305 G4Exception("G4CrossSectionIonisationRuddPartial: attempting to calculate cross section for wrong particle"); 387 }388 }306 } 307 } 389 308 390 309 return sigma; 391 310 } 392 311 312 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 393 313 394 314 G4double G4CrossSectionIonisationRuddPartial::Sum(G4double /* energy */, const G4String& /* particle */) 395 315 { 396 397 316 return 0; 398 317 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionKill.cc
r819 r961 26 26 // 27 27 // $Id: G4CrossSectionKill.cc,v 1.1 2007/11/09 20:26:12 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4DNACrossSectionDataSet.cc
r819 r961 27 27 28 28 // $Id: G4DNACrossSectionDataSet.cc,v 1.7 2007/11/09 18:06:26 pia Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 30 30 // 31 31 // Author: Riccardo Capra <capra@ge.infn.it> -
trunk/source/processes/electromagnetic/lowenergy/src/G4DNAGenericIonsManager.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4DNAGenericIonsManager.cc,v 1.4 2006/06/29 19:39:24 gunter Exp $ 28 // GEANT4 tag $Name: $ 26 // $Id: G4DNAGenericIonsManager.cc,v 1.5 2008/07/16 19:01:07 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 28 30 29 #include "G4DNAGenericIonsManager.hh" … … 32 31 #include "G4Ions.hh" 33 32 34 G4DNAGenericIonsManager * G4DNAGenericIonsManager :: Instance(void) 33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 34 35 G4DNAGenericIonsManager * G4DNAGenericIonsManager :: Instance(void) 35 36 { 36 37 if (!theInstance) … … 40 41 } 41 42 42 G4ParticleDefinition * G4DNAGenericIonsManager :: GetIon(const G4String & name) 43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 44 45 G4ParticleDefinition * G4DNAGenericIonsManager :: GetIon(const G4String & name) 43 46 { 44 47 IonsMap::const_iterator i(map.find(name)); … … 47 50 return 0; 48 51 49 // return map[name];50 51 52 return i->second; 52 53 } 53 54 54 G4DNAGenericIonsManager :: G4DNAGenericIonsManager() 55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 56 57 G4DNAGenericIonsManager :: G4DNAGenericIonsManager() 55 58 { 56 59 // name mass width charge … … 60 63 // stable lifetime decay table 61 64 62 63 65 G4Ions *helium; 64 66 G4Ions *hydrogen; 65 67 G4Ions *alphaPlus; 68 G4Ions *positronium1s; 69 G4Ions *positronium2s; 66 70 67 71 helium= new G4Ions("helium", 3.727417*GeV, 0.0*MeV, +0.0*eplus, … … 83 87 0, 0, 0, 84 88 "nucleus", +1, +1, 0, 85 true, -1.0, 0, false, 89 true, -1.0, 0, false, 90 "", 0, 0.0); 91 92 positronium1s= new G4Ions("Ps-1s", 2*electron_mass_c2, 0.0*MeV, +0.0*eplus, 93 0, 0, 0, 94 0, 0, 0, 95 "nucleus", 0, 0, 0, 96 true, -1.0, 0, false, 97 "", 0, 0.0); 98 99 positronium2s= new G4Ions("Ps-2s", 2*electron_mass_c2, 0.0*MeV, +0.0*eplus, 100 0, 0, 0, 101 0, 0, 0, 102 "nucleus", 0, 0, 0, 103 true, -1.0, 0, false, 86 104 "", 0, 0.0); 87 105 … … 90 108 map["alpha+"]=alphaPlus; 91 109 map["alpha++"]=G4Alpha::Alpha(); 110 map["Ps-1s"]=positronium1s; 111 map["Ps-2s"]=positronium2s; 112 92 113 } 93 114 115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 94 116 95 G4DNAGenericIonsManager * G4DNAGenericIonsManager::theInstance(0);117 G4DNAGenericIonsManager * G4DNAGenericIonsManager::theInstance(0); 96 118 -
trunk/source/processes/electromagnetic/lowenergy/src/G4DummyFinalState.cc
r819 r961 26 26 // 27 27 // $Id: G4DummyFinalState.cc,v 1.2 2007/10/15 08:36:35 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4EMDataSet.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4EMDataSet.cc,v 1.1 2 2006/06/29 19:39:44 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4EMDataSet.cc,v 1.18 2008/03/17 13:40:53 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 40 40 #include <fstream> 41 41 #include <sstream> 42 43 G4EMDataSet :: G4EMDataSet(G4int argZ, G4VDataSetAlgorithm * argAlgorithm, G4double argUnitEnergies, G4double argUnitData) 44 : 45 z(argZ), 46 energies(0), 47 data(0), 48 algorithm(argAlgorithm), 49 unitEnergies(argUnitEnergies), 50 unitData(argUnitData) 51 { 52 if (algorithm == 0) 53 G4Exception("G4EMDataSet::G4EMDataSet - interpolation == 0"); 54 } 55 56 57 58 G4EMDataSet :: G4EMDataSet(G4int argZ, G4DataVector * argEnergies, G4DataVector * argData, G4VDataSetAlgorithm * argAlgorithm, G4double argUnitEnergies, G4double argUnitData) 59 : 60 z(argZ), 61 energies(argEnergies), 62 data(argData), 63 algorithm(argAlgorithm), 64 unitEnergies(argUnitEnergies), 65 unitData(argUnitData) 66 { 67 if (algorithm==0) 68 G4Exception("G4EMDataSet::G4EMDataSet - interpolation == 0"); 69 70 if ((energies==0) ^ (data==0)) 71 G4Exception("G4EMDataSet::G4EMDataSet - different size for energies and data (zero case)"); 72 73 if (energies==0) 74 return; 75 76 if (energies->size()!=data->size()) 77 G4Exception("G4EMDataSet::G4EMDataSet - different size for energies and data"); 78 } 79 80 81 82 G4EMDataSet :: ~G4EMDataSet() 42 #include "G4Integrator.hh" 43 #include "Randomize.hh" 44 #include "G4LinInterpolation.hh" 45 46 47 G4EMDataSet::G4EMDataSet(G4int Z, 48 G4VDataSetAlgorithm* algo, 49 G4double xUnit, 50 G4double yUnit, 51 G4bool random): 52 z(Z), 53 energies(0), 54 data(0), 55 algorithm(algo), 56 unitEnergies(xUnit), 57 unitData(yUnit), 58 pdf(0), 59 randomSet(random) 60 { 61 if (algorithm == 0) G4Exception("G4EMDataSet::G4EMDataSet - interpolation == 0"); 62 if (randomSet) BuildPdf(); 63 } 64 65 G4EMDataSet::G4EMDataSet(G4int argZ, 66 G4DataVector* dataX, 67 G4DataVector* dataY, 68 G4VDataSetAlgorithm* algo, 69 G4double xUnit, 70 G4double yUnit, 71 G4bool random): 72 z(argZ), 73 energies(dataX), 74 data(dataY), 75 algorithm(algo), 76 unitEnergies(xUnit), 77 unitData(yUnit), 78 pdf(0), 79 randomSet(random) 80 { 81 if (algorithm == 0) G4Exception("G4EMDataSet::G4EMDataSet - interpolation == 0"); 82 83 if ((energies == 0) ^ (data == 0)) 84 G4Exception("G4EMDataSet::G4EMDataSet - different size for energies and data (zero case)"); 85 86 if (energies == 0) return; 87 88 if (energies->size() != data->size()) 89 G4Exception("G4EMDataSet::G4EMDataSet - different size for energies and data"); 90 91 if (randomSet) BuildPdf(); 92 } 93 94 G4EMDataSet::~G4EMDataSet() 83 95 { 84 delete algorithm; 85 86 if (energies) 87 delete energies; 88 89 if (data) 90 delete data; 91 } 92 93 94 95 96 97 G4double G4EMDataSet :: FindValue(G4double argEnergy, G4int /* argComponentId */) const 98 { 99 if (!energies) 100 G4Exception("G4EMDataSet::FindValue - energies == 0"); 101 102 if (energies->empty()) 103 return 0; 104 105 if (argEnergy <= (*energies)[0]) 106 return (*data)[0]; 107 108 size_t i(energies->size()-1); 109 110 if (argEnergy >= (*energies)[i]) 111 return (*data)[i]; 112 113 return algorithm->Calculate(argEnergy, FindLowerBound(argEnergy), *energies, *data); 114 } 115 116 117 118 119 120 void G4EMDataSet :: PrintData(void) const 121 { 122 if (!energies) 123 { 124 G4cout << "Data not available." << G4endl; 125 return; 126 } 127 128 size_t size = energies->size(); 129 130 for (size_t i(0); i<size; i++) 131 G4cout << "Point: " << ((*energies)[i]/unitEnergies) 132 << " - Data value : " << ((*data)[i]/unitData) << G4endl; 133 } 134 135 136 137 138 139 void G4EMDataSet :: SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int /* argComponentId */) 140 { 141 if (energies) 142 delete energies; 143 energies=argEnergies; 144 145 if (data) 146 delete data; 147 data=argData; 148 149 if ((energies==0) ^ (data==0)) 150 G4Exception("G4EMDataSet::SetEnergiesData - different size for energies and data (zero case)"); 151 152 if (energies==0) 153 return; 154 155 if (energies->size()!=data->size()) 156 G4Exception("G4EMDataSet::SetEnergiesData - different size for energies and data"); 157 } 158 159 160 161 162 163 G4bool G4EMDataSet :: LoadData(const G4String & argFileName) 164 { 165 // The file is organized into two columns: 166 // 1st column is the energy 167 // 2nd column is the corresponding value 168 // The file terminates with the pattern: -1 -1 169 // -2 -2 170 171 G4String fullFileName(FullFileName(argFileName)); 172 std::ifstream in(fullFileName); 173 174 if (!in.is_open()) 175 { 176 G4String message("G4EMDataSet::LoadData - data file \""); 177 message+=fullFileName; 178 message+="\" not found"; 179 G4Exception(message); 180 } 181 182 G4DataVector * argEnergies=new G4DataVector; 183 G4DataVector * argData=new G4DataVector; 184 185 G4double a; 186 bool energyColumn(true); 187 188 do 189 { 190 in >> a; 191 192 if (a!=-1 && a!=-2) 193 { 194 if (energyColumn) 195 argEnergies->push_back(a*unitEnergies); 196 else 197 argData->push_back(a*unitData); 198 energyColumn=(!energyColumn); 199 } 200 } 201 while (a != -2); 202 203 SetEnergiesData(argEnergies, argData, 0); 204 205 return true; 206 } 207 208 209 210 G4bool G4EMDataSet :: SaveData(const G4String & argFileName) const 211 { 212 // The file is organized into two columns: 213 // 1st column is the energy 214 // 2nd column is the corresponding value 215 // The file terminates with the pattern: -1 -1 216 // -2 -2 217 218 G4String fullFileName(FullFileName(argFileName)); 219 std::ofstream out(fullFileName); 220 221 if (!out.is_open()) 222 { 223 G4String message("G4EMDataSet::SaveData - cannot open \""); 224 message+=fullFileName; 225 message+="\""; 226 G4Exception(message); 227 } 228 229 out.precision(10); 230 out.width(15); 231 out.setf(std::ofstream::left); 232 233 if (energies!=0 && data!=0) 234 { 235 G4DataVector::const_iterator i(energies->begin()); 236 G4DataVector::const_iterator endI(energies->end()); 237 G4DataVector::const_iterator j(data->begin()); 238 239 while (i!=endI) 240 { 241 out.precision(10); 242 out.width(15); 243 out.setf(std::ofstream::left); 244 out << ((*i)/unitEnergies) << ' '; 245 246 out.precision(10); 247 out.width(15); 248 out.setf(std::ofstream::left); 249 out << ((*j)/unitData) << std::endl; 250 251 i++; 252 j++; 253 } 254 } 255 256 out.precision(10); 257 out.width(15); 258 out.setf(std::ofstream::left); 259 out << -1.f << ' '; 260 261 out.precision(10); 262 out.width(15); 263 out.setf(std::ofstream::left); 264 out << -1.f << std::endl; 265 266 out.precision(10); 267 out.width(15); 268 out.setf(std::ofstream::left); 269 out << -2.f << ' '; 270 271 out.precision(10); 272 out.width(15); 273 out.setf(std::ofstream::left); 274 out << -2.f << std::endl; 275 276 return true; 277 } 278 279 280 281 282 283 size_t G4EMDataSet :: FindLowerBound(G4double argEnergy) const 284 { 285 size_t lowerBound(0); 286 size_t upperBound(energies->size() - 1); 287 288 while (lowerBound <= upperBound) 289 { 290 size_t midBin((lowerBound + upperBound)/2); 291 292 if (argEnergy < (*energies)[midBin]) 293 upperBound = midBin-1; 96 delete algorithm; 97 if (energies) delete energies; 98 if (data) delete data; 99 if (pdf) delete pdf; 100 } 101 102 G4double G4EMDataSet::FindValue(G4double energy, G4int /* componentId */) const 103 { 104 if (!energies) G4Exception("G4EMDataSet::FindValue - energies == 0"); 105 if (energies->empty()) return 0; 106 if (energy <= (*energies)[0]) return (*data)[0]; 107 108 size_t i = energies->size()-1; 109 if (energy >= (*energies)[i]) return (*data)[i]; 110 111 return algorithm->Calculate(energy, FindLowerBound(energy), *energies, *data); 112 } 113 114 115 void G4EMDataSet::PrintData(void) const 116 { 117 if (!energies) 118 { 119 G4cout << "Data not available." << G4endl; 120 } 294 121 else 295 lowerBound = midBin+1; 296 } 297 298 return upperBound; 299 } 300 301 302 303 304 305 G4String G4EMDataSet :: FullFileName(const G4String & argFileName) const 306 { 307 char* path = getenv("G4LEDATA"); 308 if (!path) 309 G4Exception("G4EMDataSet::FullFileName - G4LEDATA environment variable not set"); 310 311 std::ostringstream fullFileName; 312 313 fullFileName << path << '/' << argFileName << z << ".dat"; 122 { 123 size_t size = energies->size(); 124 for (size_t i(0); i<size; i++) 125 { 126 G4cout << "Point: " << ((*energies)[i]/unitEnergies) 127 << " - Data value: " << ((*data)[i]/unitData); 128 if (pdf != 0) G4cout << " - PDF : " << (*pdf)[i]; 129 G4cout << G4endl; 130 } 131 } 132 } 133 134 135 void G4EMDataSet::SetEnergiesData(G4DataVector* dataX, 136 G4DataVector* dataY, 137 G4int /* componentId */) 138 { 139 if (energies) delete energies; 140 energies = dataX; 141 142 if (data) delete data; 143 data = dataY; 144 145 if ((energies == 0) ^ (data==0)) 146 G4Exception("G4EMDataSet::SetEnergiesData - different size for energies and data (zero case)"); 147 148 if (energies == 0) return; 149 150 if (energies->size() != data->size()) 151 G4Exception("G4EMDataSet::SetEnergiesData - different size for energies and data"); 152 } 153 154 G4bool G4EMDataSet::LoadData(const G4String& fileName) 155 { 156 // The file is organized into two columns: 157 // 1st column is the energy 158 // 2nd column is the corresponding value 159 // The file terminates with the pattern: -1 -1 160 // -2 -2 161 162 G4String fullFileName(FullFileName(fileName)); 163 std::ifstream in(fullFileName); 164 165 if (!in.is_open()) 166 { 167 G4String message("G4EMDataSet::LoadData - data file \""); 168 message += fullFileName; 169 message += "\" not found"; 170 G4Exception(message); 171 } 172 173 G4DataVector* argEnergies=new G4DataVector; 174 G4DataVector* argData=new G4DataVector; 175 176 G4double a; 177 bool energyColumn(true); 178 179 do 180 { 181 in >> a; 182 183 if (a!=-1 && a!=-2) 184 { 185 if (energyColumn) 186 argEnergies->push_back(a*unitEnergies); 187 else 188 argData->push_back(a*unitData); 189 energyColumn=(!energyColumn); 190 } 191 } 192 while (a != -2); 193 194 SetEnergiesData(argEnergies, argData, 0); 195 if (randomSet) BuildPdf(); 196 197 return true; 198 } 199 200 G4bool G4EMDataSet::SaveData(const G4String& name) const 201 { 202 // The file is organized into two columns: 203 // 1st column is the energy 204 // 2nd column is the corresponding value 205 // The file terminates with the pattern: -1 -1 206 // -2 -2 207 208 G4String fullFileName(FullFileName(name)); 209 std::ofstream out(fullFileName); 210 211 if (!out.is_open()) 212 { 213 G4String message("G4EMDataSet::SaveData - cannot open \""); 214 message+=fullFileName; 215 message+="\""; 216 G4Exception(message); 217 } 218 219 out.precision(10); 220 out.width(15); 221 out.setf(std::ofstream::left); 222 223 if (energies!=0 && data!=0) 224 { 225 G4DataVector::const_iterator i(energies->begin()); 226 G4DataVector::const_iterator endI(energies->end()); 227 G4DataVector::const_iterator j(data->begin()); 228 229 while (i!=endI) 230 { 231 out.precision(10); 232 out.width(15); 233 out.setf(std::ofstream::left); 234 out << ((*i)/unitEnergies) << ' '; 235 236 out.precision(10); 237 out.width(15); 238 out.setf(std::ofstream::left); 239 out << ((*j)/unitData) << std::endl; 240 241 i++; 242 j++; 243 } 244 } 245 246 out.precision(10); 247 out.width(15); 248 out.setf(std::ofstream::left); 249 out << -1.f << ' '; 250 251 out.precision(10); 252 out.width(15); 253 out.setf(std::ofstream::left); 254 out << -1.f << std::endl; 255 256 out.precision(10); 257 out.width(15); 258 out.setf(std::ofstream::left); 259 out << -2.f << ' '; 260 261 out.precision(10); 262 out.width(15); 263 out.setf(std::ofstream::left); 264 out << -2.f << std::endl; 265 266 return true; 267 } 268 269 size_t G4EMDataSet::FindLowerBound(G4double x) const 270 { 271 size_t lowerBound = 0; 272 size_t upperBound(energies->size() - 1); 273 274 while (lowerBound <= upperBound) 275 { 276 size_t midBin((lowerBound + upperBound) / 2); 277 278 if (x < (*energies)[midBin]) upperBound = midBin - 1; 279 else lowerBound = midBin + 1; 280 } 281 282 return upperBound; 283 } 284 285 286 size_t G4EMDataSet::FindLowerBound(G4double x, G4DataVector* values) const 287 { 288 size_t lowerBound = 0;; 289 size_t upperBound(values->size() - 1); 290 291 while (lowerBound <= upperBound) 292 { 293 size_t midBin((lowerBound + upperBound) / 2); 294 295 if (x < (*values)[midBin]) upperBound = midBin - 1; 296 else lowerBound = midBin + 1; 297 } 298 299 return upperBound; 300 } 301 302 303 G4String G4EMDataSet::FullFileName(const G4String& name) const 304 { 305 char* path = getenv("G4LEDATA"); 306 if (!path) 307 G4Exception("G4EMDataSet::FullFileName - G4LEDATA environment variable not set"); 308 309 std::ostringstream fullFileName; 310 fullFileName << path << '/' << name << z << ".dat"; 314 311 315 return G4String(fullFileName.str().c_str()); 316 } 312 return G4String(fullFileName.str().c_str()); 313 } 314 315 316 void G4EMDataSet::BuildPdf() 317 { 318 pdf = new G4DataVector; 319 G4Integrator <G4EMDataSet, G4double(G4EMDataSet::*)(G4double)> integrator; 320 321 G4int nData = data->size(); 322 pdf->push_back(0.); 323 324 // Integrate the data distribution 325 G4int i; 326 G4double totalSum = 0.; 327 for (i=1; i<nData; i++) 328 { 329 G4double xLow = (*energies)[i-1]; 330 G4double xHigh = (*energies)[i]; 331 G4double sum = integrator.Legendre96(this, &G4EMDataSet::IntegrationFunction, xLow, xHigh); 332 totalSum = totalSum + sum; 333 pdf->push_back(totalSum); 334 } 335 336 // Normalize to the last bin 337 G4double tot = 0.; 338 if (totalSum > 0.) tot = 1. / totalSum; 339 for (i=1; i<nData; i++) 340 { 341 (*pdf)[i] = (*pdf)[i] * tot; 342 } 343 } 344 345 346 G4double G4EMDataSet::RandomSelect(G4int /* componentId */) const 347 { 348 // Random select a X value according to the cumulative probability distribution 349 // derived from the data 350 351 if (!pdf) G4Exception("G4EMDataSet::RandomSelect - PDF has not been created for this data set"); 352 353 G4double value = 0.; 354 G4double x = G4UniformRand(); 355 356 // Locate the random value in the X vector based on the PDF 357 size_t bin = FindLowerBound(x,pdf); 358 359 // Interpolate the PDF to calculate the X value: 360 // linear interpolation in the first bin (to avoid problem with 0), 361 // interpolation with associated data set algorithm in other bins 362 363 G4LinInterpolation linearAlgo; 364 if (bin == 0) value = linearAlgo.Calculate(x, bin, *pdf, *energies); 365 else value = algorithm->Calculate(x, bin, *pdf, *energies); 366 367 // G4cout << x << " random bin "<< bin << " - " << value << G4endl; 368 return value; 369 } 370 371 G4double G4EMDataSet::IntegrationFunction(G4double x) 372 { 373 // This function is needed by G4Integrator to calculate the integral of the data distribution 374 375 G4double y = 0; 376 377 // Locate the random value in the X vector based on the PDF 378 size_t bin = FindLowerBound(x); 379 380 // Interpolate to calculate the X value: 381 // linear interpolation in the first bin (to avoid problem with 0), 382 // interpolation with associated algorithm in other bins 383 384 G4LinInterpolation linearAlgo; 385 386 if (bin == 0) y = linearAlgo.Calculate(x, bin, *energies, *data); 387 else y = algorithm->Calculate(x, bin, *energies, *data); 388 389 return y; 390 } 391 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeDecrease.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateChargeDecrease.cc,v 1.2 2007/11/09 20:11:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Reference: TNS Geant4-DNA paper 44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 45 // design foundation and implementation of the first set of models, 46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateChargeDecrease.cc,v 1.4 2009/01/20 07:50:28 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #include "G4FinalStateChargeDecrease.hh" 53 #include "G4Track.hh"54 #include "G4Step.hh"55 #include "G4DynamicParticle.hh"56 //#include "Randomize.hh"57 30 58 #include "G4ParticleTypes.hh" 59 #include "G4ParticleDefinition.hh" 60 #include "G4SystemOfUnits.hh" 61 //#include "G4ParticleMomentum.hh" 62 #include "G4DNAGenericIonsManager.hh" 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4FinalStateChargeDecrease::G4FinalStateChargeDecrease() 65 34 { 66 name = "ChargeDecrease";67 35 lowEnergyLimit = 1 * keV; 68 36 highEnergyLimit = 10 * MeV; 69 37 } 70 38 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 71 40 72 41 G4FinalStateChargeDecrease::~G4FinalStateChargeDecrease() 73 42 {} 74 43 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 75 45 76 46 const G4FinalStateProduct& G4FinalStateChargeDecrease::GenerateFinalState(const G4Track& track, const G4Step& /* step */) 77 47 { 78 // Clear previous secondaries, energy deposit and particle kill status79 48 product.Clear(); 80 49 … … 95 64 96 65 if (outK<0) 97 {98 G4String message;99 message="ChargeDecreaseDingfelder::GenerateFinalState - Final kinetic energy is below 0! Process ";100 G4Exception(message);101 }66 { 67 G4String message; 68 message="ChargeDecreaseDingfelder::GenerateFinalState - Final kinetic energy is below 0! Process "; 69 G4Exception(message); 70 } 102 71 103 // Primary particle 72 //SI - Added protection against total energy deposit 73 product.DoNotDepositEnergy(); 74 // 104 75 product.KillPrimaryParticle(); 76 105 77 product.AddEnergyDeposit(waterBindingEnergy); 106 107 //Secondary particle 78 108 79 G4DynamicParticle* aSecondary = new G4DynamicParticle(OutgoingParticleDefinition(definition, finalStateIndex), 109 80 track.GetDynamicParticle()->GetMomentumDirection(), … … 114 85 return product; 115 86 } 87 88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 116 89 117 90 G4int G4FinalStateChargeDecrease::NumberOfFinalStates(G4ParticleDefinition* particleDefinition, … … 125 98 126 99 if (particleDefinition == instance->GetIon("alpha++") ) 127 {128 if (finalStateIndex==0) return 1;129 return 2;130 }100 { 101 if (finalStateIndex==0) return 1; 102 return 2; 103 } 131 104 132 105 if (particleDefinition == instance->GetIon("alpha+") ) return 1; … … 135 108 } 136 109 110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 137 111 138 112 G4ParticleDefinition* G4FinalStateChargeDecrease::OutgoingParticleDefinition (G4ParticleDefinition* particleDefinition, … … 144 118 145 119 if (particleDefinition == instance->GetIon("alpha++") ) 146 { 147 if (finalStateIndex == 0) return instance->GetIon("alpha+"); 148 149 return instance->GetIon("helium"); 150 } 120 { 121 if (finalStateIndex == 0) return instance->GetIon("alpha+"); 122 return instance->GetIon("helium"); 123 } 151 124 152 125 if (particleDefinition == instance->GetIon("alpha+") ) return instance->GetIon("helium"); … … 155 128 } 156 129 130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 157 131 158 132 G4double G4FinalStateChargeDecrease::WaterBindingEnergyConstant(G4ParticleDefinition* particleDefinition, … … 168 142 169 143 if (particleDefinition == instance->GetIon("alpha++") ) 170 {144 { 171 145 // Binding energy for W+ -> W++ + e- 10.79 eV 172 146 // Binding energy for W -> W+ + e- 10.79 eV … … 178 152 179 153 return 10.79*2*eV; 180 }154 } 181 155 182 156 if (particleDefinition == instance->GetIon("alpha+") ) 183 {157 { 184 158 // Binding energy for W+ -> W++ + e- 10.79 eV 185 159 // Binding energy for W -> W+ + e- 10.79 eV … … 189 163 190 164 return 10.79*eV; 191 }165 } 192 166 193 167 return 0; 194 168 } 195 169 170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 196 171 197 172 G4double G4FinalStateChargeDecrease::OutgoingParticleBindingEnergyConstant(G4ParticleDefinition* particleDefinition, … … 203 178 204 179 if (particleDefinition == instance->GetIon("alpha++") ) 205 {180 { 206 181 // Binding energy for He+ -> He++ + e- 54.509 eV 207 182 // Binding energy for He -> He+ + e- 24.587 eV … … 210 185 211 186 return (54.509 + 24.587)*eV; 212 }187 } 213 188 214 189 if (particleDefinition == instance->GetIon("alpha+") ) 215 {190 { 216 191 // Binding energy for He+ -> He++ + e- 54.509 eV 217 192 // Binding energy for He -> He+ + e- 24.587 eV 218 193 219 194 return 24.587*eV; 220 }195 } 221 196 222 197 return 0; -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeIncrease.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateChargeIncrease.cc,v 1.2 2007/11/09 20:11:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Reference: TNS Geant4-DNA paper 44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 45 // design foundation and implementation of the first set of models, 46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateChargeIncrease.cc,v 1.4 2009/01/20 07:50:28 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #include "G4FinalStateChargeIncrease.hh" 53 #include "G4Track.hh" 54 #include "G4Step.hh" 55 #include "G4DynamicParticle.hh" 56 #include "Randomize.hh" 57 #include "G4Electron.hh" 58 #include "G4ParticleTypes.hh" 59 #include "G4ParticleDefinition.hh" 60 #include "G4SystemOfUnits.hh" 61 #include "G4ParticleMomentum.hh" 62 #include "G4DNAGenericIonsManager.hh" 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4FinalStateChargeIncrease::G4FinalStateChargeIncrease() 65 34 { 66 name = "ChargeIncrease";67 35 lowEnergyLimit = 1 * keV; 68 36 highEnergyLimit = 10 * MeV; 69 37 } 70 38 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 71 40 72 41 G4FinalStateChargeIncrease::~G4FinalStateChargeIncrease() 73 42 {} 74 43 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 75 45 76 46 const G4FinalStateProduct& G4FinalStateChargeIncrease::GenerateFinalState(const G4Track& track, const G4Step& /* step */) 77 47 { 78 // Clear previous secondaries, energy deposit and particle kill status79 48 product.Clear(); 80 49 81 // Primary particle 50 //SI - Added protection against total energy deposit 51 product.DoNotDepositEnergy(); 52 // 82 53 product.KillPrimaryParticle(); 83 54 product.AddEnergyDeposit(0.); 55 84 56 G4ParticleDefinition* definition = track.GetDefinition(); 85 57 86 // Secondaries87 58 G4double inK = track.GetDynamicParticle()->GetKineticEnergy(); 88 59 … … 100 71 101 72 if (outK<0) 102 {103 G4String message;104 message="G4FinalStateChargeIncrease - Final kinetic energy is below 0! Process ";105 }73 { 74 G4String message; 75 message="G4FinalStateChargeIncrease - Final kinetic energy is below 0! Process "; 76 } 106 77 107 78 product.AddSecondary(new G4DynamicParticle(OutgoingParticleDefinition(definition,finalStateIndex), … … 112 83 113 84 while (n>0) 114 { 115 n--; 116 117 product.AddSecondary 85 { 86 n--; 87 product.AddSecondary 118 88 (new G4DynamicParticle(G4Electron::Electron(), track.GetDynamicParticle()->GetMomentumDirection(), electronK)); 119 }89 } 120 90 121 91 return product; 122 92 } 93 94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 123 95 124 96 G4int G4FinalStateChargeIncrease::NumberOfFinalStates(G4ParticleDefinition* particleDefinition, … … 132 104 133 105 if (particleDefinition == instance->GetIon("helium")) 134 { if (finalStateIndex==0) return 2;135 return 3;136 }106 { if (finalStateIndex==0) return 2; 107 return 3; 108 } 137 109 return 0; 138 110 } 139 111 112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 140 113 141 114 G4ParticleDefinition* G4FinalStateChargeIncrease::OutgoingParticleDefinition (G4ParticleDefinition* particleDefinition, … … 163 136 164 137 if(particleDefinition == instance->GetIon("alpha+")) 165 {138 { 166 139 // Binding energy for He+ -> He++ + e- 54.509 eV 167 140 // Binding energy for He -> He+ + e- 24.587 eV 168 141 return 54.509*eV; 169 }142 } 170 143 171 144 if(particleDefinition == instance->GetIon("helium")) 172 {145 { 173 146 // Binding energy for He+ -> He++ + e- 54.509 eV 174 147 // Binding energy for He -> He+ + e- 24.587 eV … … 176 149 if (finalStateIndex==0) return 24.587*eV; 177 150 return (54.509 + 24.587)*eV; 178 }151 } 179 152 180 153 return 0; 181 154 } 182 183 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticBrennerZaider.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateElasticBrennerZaider.cc,v 1.1 2007/10/12 23:11:41 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Reference: TNS Geant4-DNA paper 44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 45 // design foundation and implementation of the first set of models, 46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateElasticBrennerZaider.cc,v 1.8 2008/12/05 11:58:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #include "G4FinalStateElasticBrennerZaider.hh" 53 #include "G4Track.hh"54 #include "G4Step.hh"55 #include "G4DynamicParticle.hh"56 #include "Randomize.hh"57 30 58 #include "G4ParticleTypes.hh" 59 #include "G4ParticleDefinition.hh" 60 #include "G4Electron.hh" 61 #include "G4SystemOfUnits.hh" 62 #include "G4ParticleMomentum.hh" 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4FinalStateElasticBrennerZaider::G4FinalStateElasticBrennerZaider() 65 34 { 66 // These data members will be used in the next implementation iteration, 67 // when the enriched PhysicsModel policy is implemented 68 name = "FinalStateElasticBrennerZaider"; 69 lowEnergyLimit = 7.4 * eV; 70 highEnergyLimit = 10 * MeV; 35 lowEnergyLimit = 8.23 * eV; // SI : i/o of 7.4 * eV; 36 highEnergyLimit = 200 * eV; 71 37 72 38 betaCoeff.push_back(7.51525); … … 100 66 } 101 67 68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 102 69 103 70 G4FinalStateElasticBrennerZaider::~G4FinalStateElasticBrennerZaider() 104 { 105 // empty 106 // G4DynamicParticle objects produced are owned by client 107 } 108 71 {} 72 73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 109 74 110 75 const G4FinalStateProduct& G4FinalStateElasticBrennerZaider::GenerateFinalState(const G4Track& track, const G4Step& /* step */) 111 76 { 112 // Clear previous secondaries, energy deposit and particle kill status113 77 product.Clear(); 114 78 115 // Kinetic energy of primary particle116 79 G4double k = track.GetDynamicParticle()->GetKineticEnergy(); 80 81 if ( k>= lowEnergyLimit && k<=highEnergyLimit ) 82 { 83 G4double cosTheta = RandomizeCosTheta(k); 84 85 G4double phi = 2. * pi * G4UniformRand(); 117 86 118 // Assume material = water; H2O number of electrons119 // ---- MGP ---- To be generalized later120 // const G4int z = 10;87 G4ThreeVector zVers = track.GetDynamicParticle()->GetMomentumDirection(); 88 G4ThreeVector xVers = zVers.orthogonal(); 89 G4ThreeVector yVers = zVers.cross(xVers); 121 90 122 G4double cosTheta = RandomizeCosTheta(k); 91 G4double xDir = std::sqrt(1. - cosTheta*cosTheta); 92 G4double yDir = xDir; 93 xDir *= std::cos(phi); 94 yDir *= std::sin(phi); 95 96 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers)); 97 98 product.ModifyPrimaryParticle(zPrimeVers,k); 99 } 100 101 if (k<lowEnergyLimit) 102 { 103 product.KillPrimaryParticle(); 104 } 123 105 124 G4double phi = 2. * pi * G4UniformRand();125 126 // G4cout << "cosTheta in GenerateFinalState = " << cosTheta << ", phi = " << phi << G4endl;127 128 G4ThreeVector zVers = track.GetDynamicParticle()->GetMomentumDirection();129 G4ThreeVector xVers = zVers.orthogonal();130 G4ThreeVector yVers = zVers.cross(xVers);131 132 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);133 G4double yDir = xDir;134 xDir *= std::cos(phi);135 yDir *= std::sin(phi);136 137 // G4cout << "xDir, yDir = " << xDir <<", " << yDir << G4endl;138 139 // G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers).unit());140 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));141 142 // G4cout << "zPrimeVers = (" << zPrimeVers.x() << ", "<< zPrimeVers.y() << ", "<< zPrimeVers.z() << ") " << G4endl;143 144 // product.ModifyPrimaryParticle(zPrimeVers.x(),zPrimeVers.y(),zPrimeVers.z(),k);145 product.ModifyPrimaryParticle(zPrimeVers,k);146 147 // this->aParticleChange.ProposeEnergy(k);148 // this->aParticleChange.ProposeMomentumDirection(zPrimeVers);149 // this->aParticleChange.SetNumberOfSecondaries(0);150 151 106 return product; 152 107 } 108 109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 153 110 154 111 G4double G4FinalStateElasticBrennerZaider::RandomizeCosTheta(G4double k) … … 158 115 // d Omega (1 + 2 gamma(K) - cos(theta))^2 (1 + 2 delta(K) + cos(theta))^2 159 116 // 160 // Maximum is < 1/(4 gamma(K)^2) + beta(K)/( 4 delta(K)^2)117 // Maximum is < 1/(4 gamma(K)^2) + beta(K)/((2+2delta(K))^2) 161 118 // 162 119 // Phys. Med. Biol. 29 N.4 (1983) 443-447 163 120 164 121 // gamma(K), beta(K) and delta(K) are polynomials with coefficients for energy measured in eV 122 165 123 k /= eV; 166 124 167 125 G4double beta = std::exp(CalculatePolynomial(k,betaCoeff)); 168 126 G4double delta = std::exp(CalculatePolynomial(k,deltaCoeff)); 127 G4double gamma; 169 128 170 G4double gamma;171 129 if (k > 100.) 172 { 173 gamma = CalculatePolynomial(k, gamma100_200Coeff); // Only in this case it is not the exponent of the polynomial 174 } 130 { 131 gamma = CalculatePolynomial(k, gamma100_200Coeff); 132 // Only in this case it is not the exponent of the polynomial 133 } 175 134 else 176 { 135 { 136 if (k>10) 137 { 138 gamma = std::exp(CalculatePolynomial(k, gamma10_100Coeff)); 139 } 140 else 141 { 142 gamma = std::exp(CalculatePolynomial(k, gamma035_10Coeff)); 143 } 144 } 177 145 178 if (k>10) 179 { 180 gamma = std::exp(CalculatePolynomial(k, gamma10_100Coeff)); 181 } 182 else 183 { 184 gamma = std::exp(CalculatePolynomial(k, gamma035_10Coeff)); 185 } 186 } 187 188 // G4cout << "beta = " << beta << ", gamma = " << gamma << ", delta = " << delta << G4endl; 189 190 G4double oneOverMax = 1. / (1./(4.*gamma*gamma) + beta/(4.*delta*delta)); 146 G4double oneOverMax = 1. / (1./(4.*gamma*gamma) + beta/( (2.+2.*delta)*(2.+2.*delta) )); 191 147 192 148 G4double cosTheta = 0.; … … 196 152 197 153 do 198 {154 { 199 155 cosTheta = 2. * G4UniformRand() - 1.; 200 leftDenominator = (1 + 2.*gamma - cosTheta); 201 rightDenominator = (1 + 2.*delta + cosTheta); 202 fCosTheta = oneOverMax * (1./(leftDenominator*leftDenominator) + beta/(rightDenominator*rightDenominator)); 203 } 156 leftDenominator = (1. + 2.*gamma - cosTheta); 157 rightDenominator = (1. + 2.*delta + cosTheta); 158 if ( (leftDenominator * rightDenominator) != 0. ) 159 { 160 fCosTheta = oneOverMax * (1./(leftDenominator*leftDenominator) + beta/(rightDenominator*rightDenominator)); 161 } 162 } 204 163 while (fCosTheta < G4UniformRand()); 205 164 206 // G4cout << "cosTheta = " << cosTheta << G4endl;207 208 165 return cosTheta; 209 166 } 167 168 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 210 169 211 170 G4double G4FinalStateElasticBrennerZaider::CalculatePolynomial(G4double k, std::vector<G4double>& vec) -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticScreenedRutherford.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateElasticScreenedRutherford.cc,v 1.2 2007/10/12 23:10:33 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Reference: TNS Geant4-DNA paper 44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 45 // design foundation and implementation of the first set of models, 46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateElasticScreenedRutherford.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #include "G4FinalStateElasticScreenedRutherford.hh" 53 #include "G4Track.hh"54 #include "G4Step.hh"55 #include "G4DynamicParticle.hh"56 #include "Randomize.hh"57 30 58 #include "G4ParticleTypes.hh" 59 #include "G4ParticleDefinition.hh" 60 #include "G4Electron.hh" 61 #include "G4SystemOfUnits.hh" 62 #include "G4ParticleMomentum.hh" 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4FinalStateElasticScreenedRutherford::G4FinalStateElasticScreenedRutherford() 65 34 { 66 // These data members will be used in the next implementation iteration, 67 // when the enriched PhysicsModel policy is implemented 68 name = "FinalStateElasticScreenedRutherford"; 69 lowEnergyLimit = 7.4 * eV; 35 lowEnergyLimit = 200 * eV; 70 36 highEnergyLimit = 10 * MeV; 71 37 } 72 38 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 73 40 74 41 G4FinalStateElasticScreenedRutherford::~G4FinalStateElasticScreenedRutherford() 75 { 76 // empty 77 // G4DynamicParticle objects produced are owned by client 78 } 42 {} 79 43 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 80 45 81 const G4FinalStateProduct& G4FinalStateElasticScreenedRutherford::GenerateFinalState(const G4Track& track, const G4Step& step)46 const G4FinalStateProduct& G4FinalStateElasticScreenedRutherford::GenerateFinalState(const G4Track& track, const G4Step& ) 82 47 { 83 // Clear previous secondaries, energy deposit and particle kill status84 48 product.Clear(); 85 49 86 // Kinetic energy of primary particle87 50 G4double k = track.GetDynamicParticle()->GetKineticEnergy(); 88 51 89 // Assume material = water; H2O number of electrons90 // ---- MGP ---- To be generalized later91 52 const G4int z = 10; 92 53 … … 94 55 95 56 G4double phi = 2. * pi * G4UniformRand(); 96 97 // G4cout << "cosTheta in GenerateFinalState = " << cosTheta << ", phi = " << phi << G4endl;98 57 99 58 G4ThreeVector zVers = track.GetDynamicParticle()->GetMomentumDirection(); … … 106 65 yDir *= std::sin(phi); 107 66 108 // G4cout << "xDir, yDir = " << xDir <<", " << yDir << G4endl;109 110 // G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers).unit());111 67 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers)); 112 68 113 // G4cout << "zPrimeVers = (" << zPrimeVers.x() << ", "<< zPrimeVers.y() << ", "<< zPrimeVers.z() << ") " << G4endl;114 115 // product.ModifyPrimaryParticle(zPrimeVers.x(),zPrimeVers.y(),zPrimeVers.z(),k);116 69 product.ModifyPrimaryParticle(zPrimeVers,k); 117 118 // this->aParticleChange.ProposeEnergy(k);119 // this->aParticleChange.ProposeMomentumDirection(zPrimeVers);120 // this->aParticleChange.SetNumberOfSecondaries(0);121 70 122 71 return product; 123 72 } 73 74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 124 75 125 76 G4double G4FinalStateElasticScreenedRutherford::RandomizeCosTheta(G4double k, G4int z) const … … 144 95 145 96 do 146 {147 cosTheta = 2. * G4UniformRand() - 1.;148 fCosTheta = (1 + 2.*n - cosTheta);149 fCosTheta = oneOverMax / (fCosTheta*fCosTheta);150 }97 { 98 cosTheta = 2. * G4UniformRand() - 1.; 99 fCosTheta = (1 + 2.*n - cosTheta); 100 fCosTheta = oneOverMax / (fCosTheta*fCosTheta); 101 } 151 102 while (fCosTheta < G4UniformRand()); 152 103 153 104 return cosTheta; 154 105 } 106 107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 155 108 156 109 G4double G4FinalStateElasticScreenedRutherford::ScreeningFactor(G4double k, G4int z) const … … 180 133 G4double result = 0.; 181 134 if (denominator != 0.) 182 {183 result = numerator / denominator;184 }135 { 136 result = numerator / denominator; 137 } 185 138 else 186 { 187 // Throw an exception 188 G4Exception("G4FinalStateElasticScreenedRutherford::ScreeningFactor - denominator = 0"); 189 } 139 { 140 G4Exception("G4FinalStateElasticScreenedRutherford::ScreeningFactor - denominator = 0"); 141 } 190 142 return result; 191 192 143 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationBorn.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateExcitationBorn.cc,v 1.2 2007/11/09 20:11:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Reference: TNS Geant4-DNA paper 44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 45 // design foundation and implementation of the first set of models, 46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateExcitationBorn.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #include "G4FinalStateExcitationBorn.hh" 53 #include "G4Track.hh"54 #include "G4Step.hh"55 #include "G4DynamicParticle.hh"56 #include "Randomize.hh"57 30 58 #include "G4ParticleTypes.hh" 59 #include "G4ParticleDefinition.hh" 60 #include "G4Electron.hh" 61 #include "G4SystemOfUnits.hh" 62 #include "G4ParticleMomentum.hh" 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4FinalStateExcitationBorn::G4FinalStateExcitationBorn() 65 34 { 66 name = "FinalStateExcitationBorn"; 67 lowEnergyLimit = 7.4 * eV; 35 lowEnergyLimit = 500 * keV; 68 36 highEnergyLimit = 10 * MeV; 69 37 } 70 38 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 71 40 72 41 G4FinalStateExcitationBorn::~G4FinalStateExcitationBorn() 73 { 74 // empty 75 // G4DynamicParticle objects produced are owned by client 76 } 77 42 {} 43 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 78 45 79 46 const G4FinalStateProduct& G4FinalStateExcitationBorn::GenerateFinalState(const G4Track& track, const G4Step& /* step */) 80 47 { 81 // Clear previous secondaries, energy deposit and particle kill status82 48 product.Clear(); 83 49 84 50 const G4DynamicParticle* particle = track.GetDynamicParticle(); 85 51 86 // Kinetic energy of primary particle87 52 G4double k = particle->GetKineticEnergy(); 88 53 89 // Select excitation level on the basis of partial excitation cross section90 54 G4int level = cross.RandomSelect(k); 91 // Excitation energy corresponding to the selected level92 55 G4double excitationEnergy = waterStructure.ExcitationEnergy(level); 93 56 G4double newEnergy = k - excitationEnergy; 94 57 95 if (newEnergy > lowEnergyLimit) 96 { 97 // Deposit excitation energy locally, modify primary energy accordingly 98 // Particle direction is unchanged 99 product.ModifyPrimaryParticle(particle->GetMomentumDirection(),newEnergy); 100 product.AddEnergyDeposit(excitationEnergy); 101 } 102 else 103 { 104 // Primary particle is killed 105 product.KillPrimaryParticle(); 106 } 58 if (newEnergy > 0) 59 { 60 product.ModifyPrimaryParticle(particle->GetMomentumDirection(),newEnergy); 61 product.AddEnergyDeposit(excitationEnergy); 62 } 107 63 108 64 return product; 109 65 } 110 66 111 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationEmfietzoglou.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateExcitationEmfietzoglou.cc,v 1.2 2007/11/09 20:11:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Reference: TNS Geant4-DNA paper 44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 45 // design foundation and implementation of the first set of models, 46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateExcitationEmfietzoglou.cc,v 1.5 2008/12/05 11:58:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #include "G4FinalStateExcitationEmfietzoglou.hh" 53 #include "G4Track.hh"54 #include "G4Step.hh"55 #include "G4DynamicParticle.hh"56 #include "Randomize.hh"57 30 58 #include "G4ParticleTypes.hh" 59 #include "G4ParticleDefinition.hh" 60 #include "G4Electron.hh" 61 #include "G4SystemOfUnits.hh" 62 #include "G4ParticleMomentum.hh" 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4FinalStateExcitationEmfietzoglou::G4FinalStateExcitationEmfietzoglou() 65 34 { 66 name = "FinalStateExcitationEmfietzoglou"; 67 lowEnergyLimit = 7.4 * eV; 35 lowEnergyLimit = 8.23 * eV; 68 36 highEnergyLimit = 10 * MeV; 69 37 } 70 38 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 71 40 72 41 G4FinalStateExcitationEmfietzoglou::~G4FinalStateExcitationEmfietzoglou() 73 { 74 // empty 75 // G4DynamicParticle objects produced are owned by client 76 } 42 {} 77 43 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 78 45 79 46 const G4FinalStateProduct& G4FinalStateExcitationEmfietzoglou::GenerateFinalState(const G4Track& track, const G4Step& /* step */) 80 47 { 81 // Clear previous secondaries, energy deposit and particle kill status82 48 product.Clear(); 83 49 84 50 const G4DynamicParticle* particle = track.GetDynamicParticle(); 85 51 86 // Kinetic energy of primary particle87 52 G4double k = particle->GetKineticEnergy(); 88 53 89 // Select excitation level on the basis of partial excitation cross section90 54 G4int level = cross.RandomSelect(k); 91 // Excitation energy corresponding to the selected level 55 92 56 G4double excitationEnergy = waterStructure.ExcitationEnergy(level); 93 57 G4double newEnergy = k - excitationEnergy; 94 58 95 if (newEnergy > lowEnergyLimit) 96 { 97 // Deposit excitation energy locally, modify primary energy accordingly 98 // Particle direction is unchanged 59 if (newEnergy >= lowEnergyLimit) 60 { 99 61 product.ModifyPrimaryParticle(particle->GetMomentumDirection(),newEnergy); 100 62 product.AddEnergyDeposit(excitationEnergy); 101 } 102 else 103 { 104 // Primary particle is killed 105 product.KillPrimaryParticle(); 106 } 63 } 64 65 else product.KillPrimaryParticle(); 107 66 108 67 return product; 109 68 } 110 69 111 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationMillerGreen.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateExcitationMillerGreen.cc,v 1.2 2007/11/09 20:11:04 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 32 // Reference: TNS Geant4-DNA paper 33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 34 35 // History: 36 // ----------- 37 // Date Name Modification 38 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 39 // 40 // ------------------------------------------------------------------- 41 42 // Class description: 43 // Reference: TNS Geant4-DNA paper 44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 45 // design foundation and implementation of the first set of models, 46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 47 // Further documentation available from http://www.ge.infn.it/geant4/dna 48 49 // ------------------------------------------------------------------- 50 26 // $Id: G4FinalStateExcitationMillerGreen.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 51 28 52 29 #include "G4FinalStateExcitationMillerGreen.hh" 53 #include "G4Track.hh"54 #include "G4Step.hh"55 #include "G4DynamicParticle.hh"56 #include "Randomize.hh"57 30 58 #include "G4ParticleTypes.hh" 59 #include "G4ParticleDefinition.hh" 60 #include "G4Electron.hh" 61 #include "G4SystemOfUnits.hh" 62 #include "G4ParticleMomentum.hh" 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4FinalStateExcitationMillerGreen::G4FinalStateExcitationMillerGreen() 65 34 { 66 name = "ExcitationMillerGreen";67 35 lowEnergyLimit = 10 * eV; 68 36 highEnergyLimit = 10 * MeV; 69 37 } 70 38 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 71 40 72 41 G4FinalStateExcitationMillerGreen::~G4FinalStateExcitationMillerGreen() 73 42 {} 74 43 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 75 45 76 46 const G4FinalStateProduct& G4FinalStateExcitationMillerGreen::GenerateFinalState(const G4Track& track, const G4Step& /* step */) 77 47 { 78 // Clear previous secondaries, energy deposit and particle kill status79 48 product.Clear(); 80 49 81 50 const G4DynamicParticle* particle = track.GetDynamicParticle(); 82 51 83 // Kinetic energy of primary particle84 52 G4double k = particle->GetKineticEnergy(); 85 53 86 // Select excitation level on the basis of partial excitation cross section87 54 G4int level = cross.RandomSelect(k,track.GetDefinition()); 88 // Excitation energy corresponding to the selected level89 55 G4double excitationEnergy = waterStructure.ExcitationEnergy(level); 90 56 G4double newEnergy = k - excitationEnergy; 91 57 92 // ---- SI ---- Test on newEnergy93 58 if (newEnergy > 0) 94 { 95 // Deposit excitation energy locally, modify primary energy accordingly 96 // Particle direction is unchanged 97 product.ModifyPrimaryParticle(particle->GetMomentumDirection(),newEnergy); 98 product.AddEnergyDeposit(excitationEnergy); 99 } 100 101 // ---- SI ---- Particle is not modified by default otherwise 102 /* 103 else 104 { 105 // Primary particle is killed 106 product.KillPrimaryParticle(); 107 } 108 */ 59 { 60 product.ModifyPrimaryParticle(particle->GetMomentumDirection(),newEnergy); 61 product.AddEnergyDeposit(excitationEnergy); 62 } 109 63 110 64 return product; -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateIonisationBorn.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateIonisationBorn.cc,v 1.9 2007/11/26 17:27:09 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Sebastien Incerti (incerti@cenbg.in2p3.fr) 31 // Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 32 // 33 // Reference: TNS Geant4-DNA paper 34 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 35 36 // History: 37 // ----------- 38 // Date Name Modification 39 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 40 // Nov 2007 S. Incerti Implementation 41 // 26 Nov 2007 MGP Cleaned up std:: 42 // 43 // ------------------------------------------------------------------- 44 45 // Class description: 46 // Reference: TNS Geant4-DNA paper 47 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 48 // design foundation and implementation of the first set of models, 49 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 50 // Further documentation available from http://www.ge.infn.it/geant4/dna 51 52 // ------------------------------------------------------------------- 53 26 // $Id: G4FinalStateIonisationBorn.cc,v 1.16 2008/12/06 13:47:12 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 54 28 55 29 #include "G4FinalStateIonisationBorn.hh" 56 #include "G4Track.hh" 57 #include "G4Step.hh" 58 #include "G4DynamicParticle.hh" 59 #include "Randomize.hh" 60 61 #include "G4ParticleTypes.hh" 62 #include "G4ParticleDefinition.hh" 63 #include "G4Electron.hh" 64 #include "G4Proton.hh" 65 #include "G4SystemOfUnits.hh" 66 #include "G4ParticleMomentum.hh" 67 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 68 32 69 33 G4FinalStateIonisationBorn::G4FinalStateIonisationBorn() 70 34 { 71 72 name = "IonisationBorn";73 74 // NEW75 // Factor to scale microscopic/macroscopic cross section data in water76 77 35 G4double scaleFactor = (1.e-22 / 3.343) * m*m; 78 36 79 // Energy limits80 37 G4ParticleDefinition* electronDef = G4Electron::ElectronDefinition(); 81 38 G4ParticleDefinition* protonDef = G4Proton::ProtonDefinition(); … … 84 41 G4String proton; 85 42 86 // Default energy limits (defined for protection against anomalous behaviour only) 87 lowEnergyLimitDefault = 25 * eV; 43 lowEnergyLimitDefault = 12.61 * eV; // SI: i/o 25 eV 88 44 highEnergyLimitDefault = 10 * MeV; 89 45 … … 93 49 G4Exception("G4DNACrossSectionDataSet::FullFileName - G4LEDATA environment variable not set"); 94 50 95 // Data members for electrons96 97 51 if (electronDef != 0) 98 { 99 electron = electronDef->GetParticleName(); 100 lowEnergyLimit[electron] = 25. * eV; 101 highEnergyLimit[electron] = 30. * keV; 102 103 std::ostringstream eFullFileName; 104 eFullFileName << path << "/dna/sigmadiff_ionisation_e_born.dat"; 105 std::ifstream eDiffCrossSection(eFullFileName.str().c_str()); 106 // eDiffCrossSection(eFullFileName.str().c_str()); 107 if (!eDiffCrossSection) 108 { 109 // G4cout << "ERROR OPENING DATA FILE IN ELECTRON BORN IONIZATION !!! " << G4endl; 110 G4Exception("G4FinalStateIonisationBorn::ERROR OPENING electron DATA FILE"); 111 while(1); // ---- MGP ---- What is this? 112 } 52 { 53 electron = electronDef->GetParticleName(); 54 lowEnergyLimit[electron] = 12.61 * eV; // SI: i/o 25 eV 55 highEnergyLimit[electron] = 30. * keV; 56 57 std::ostringstream eFullFileName; 58 eFullFileName << path << "/dna/sigmadiff_ionisation_e_born.dat"; 59 std::ifstream eDiffCrossSection(eFullFileName.str().c_str()); 60 if (!eDiffCrossSection) 61 { 62 G4Exception("G4FinalStateIonisationBorn::ERROR OPENING electron DATA FILE"); 63 } 113 64 114 eTdummyVec.push_back(0.); 115 while(!eDiffCrossSection.eof()) 116 { 117 double tDummy; 118 double eDummy; 119 eDiffCrossSection>>tDummy>>eDummy; 120 if (tDummy != eTdummyVec.back()) eTdummyVec.push_back(tDummy); 121 for (int j=0; j<5; j++) 122 { 123 eDiffCrossSection>>eDiffCrossSectionData[j][tDummy][eDummy]; 124 eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor; 125 eVecm[tDummy].push_back(eDummy); 126 } 127 } 128 129 } 65 eTdummyVec.push_back(0.); 66 while(!eDiffCrossSection.eof()) 67 { 68 double tDummy; 69 double eDummy; 70 eDiffCrossSection>>tDummy>>eDummy; 71 if (tDummy != eTdummyVec.back()) eTdummyVec.push_back(tDummy); 72 for (int j=0; j<5; j++) 73 { 74 eDiffCrossSection>>eDiffCrossSectionData[j][tDummy][eDummy]; 75 76 // SI - only if eof is not reached ! 77 if (!eDiffCrossSection.eof()) eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor; 78 79 eVecm[tDummy].push_back(eDummy); 80 81 } 82 } 83 84 } 130 85 else 131 { 132 G4Exception("G4FinalStateIonisationBorn Constructor: electron is not defined"); 133 } 134 135 // Data members for protons 86 { 87 G4Exception("G4FinalStateIonisationBorn Constructor: electron is not defined"); 88 } 136 89 137 90 if (protonDef != 0) 138 { 139 proton = protonDef->GetParticleName(); 140 lowEnergyLimit[proton] = 500. * keV; 141 highEnergyLimit[proton] = 10. * MeV; 142 143 std::ostringstream pFullFileName; 144 pFullFileName << path << "/dna/sigmadiff_ionisation_p_born.dat"; 145 std::ifstream pDiffCrossSection(pFullFileName.str().c_str()); 146 // pDiffCrossSection(pFullFileName.str().c_str()); 147 if (!pDiffCrossSection) 148 { 149 // G4cout<<"ERROR OPENING DATA FILE IN PROTON BORN IONIZATION !!! "<<G4endl; 150 G4Exception("G4FinalStateIonisationBorn::ERROR OPENING proton DATA FILE"); 151 while(1); // ---- MGP ---- What is this? 152 } 91 { 92 proton = protonDef->GetParticleName(); 93 lowEnergyLimit[proton] = 500. * keV; 94 highEnergyLimit[proton] = 10. * MeV; 95 96 std::ostringstream pFullFileName; 97 pFullFileName << path << "/dna/sigmadiff_ionisation_p_born.dat"; 98 std::ifstream pDiffCrossSection(pFullFileName.str().c_str()); 99 if (!pDiffCrossSection) 100 { 101 G4Exception("G4FinalStateIonisationBorn::ERROR OPENING proton DATA FILE"); 102 } 153 103 154 pTdummyVec.push_back(0.); 155 while(!pDiffCrossSection.eof()) 156 { 157 double tDummy; 158 double eDummy; 159 pDiffCrossSection>>tDummy>>eDummy; 160 if (tDummy != pTdummyVec.back()) pTdummyVec.push_back(tDummy); 161 for (int j=0; j<5; j++) 162 { 163 pDiffCrossSection>>pDiffCrossSectionData[j][tDummy][eDummy]; 164 pDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor; 165 //G4cout << "j=" << j << " Tdum=" << tDummy << " Edum=" << eDummy << " pDiff=" << pDiffCrossSectionData[j][tDummy][eDummy] << G4endl; 166 pVecm[tDummy].push_back(eDummy); 167 } 168 } 169 } 104 pTdummyVec.push_back(0.); 105 while(!pDiffCrossSection.eof()) 106 { 107 double tDummy; 108 double eDummy; 109 pDiffCrossSection>>tDummy>>eDummy; 110 if (tDummy != pTdummyVec.back()) pTdummyVec.push_back(tDummy); 111 for (int j=0; j<5; j++) 112 { 113 pDiffCrossSection>>pDiffCrossSectionData[j][tDummy][eDummy]; 114 115 // SI - only if eof is not reached ! 116 if (!pDiffCrossSection.eof()) pDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor; 117 118 pVecm[tDummy].push_back(eDummy); 119 } 120 } 121 } 170 122 else 171 { 172 G4Exception("G4FinalStateIonisationBorn Constructor: proton is not defined"); 173 } 174 } 175 123 { 124 G4Exception("G4FinalStateIonisationBorn Constructor: proton is not defined"); 125 } 126 } 127 128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 176 129 177 130 G4FinalStateIonisationBorn::~G4FinalStateIonisationBorn() … … 181 134 } 182 135 136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 183 137 184 138 const G4FinalStateProduct& G4FinalStateIonisationBorn::GenerateFinalState(const G4Track& track, const G4Step& /* step */) 185 139 { 186 // Clear previous secondaries, energy deposit and particle kill status187 140 product.Clear(); 188 141 … … 196 149 const G4String& particleName = particle->GetDefinition()->GetParticleName(); 197 150 198 // Retrieve energy limits for the current particle type199 200 151 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 201 152 pos1 = lowEnergyLimit.find(particleName); 202 153 203 // Lower limit204 154 if (pos1 != lowEnergyLimit.end()) 205 { 206 lowLim = pos1->second; 207 } 208 209 // Upper limit 155 { 156 lowLim = pos1->second; 157 } 158 210 159 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 211 160 pos2 = highEnergyLimit.find(particleName); 212 161 213 162 if (pos2 != highEnergyLimit.end()) 214 { 215 highLim = pos2->second; 216 } 217 218 // Verify that the current track is within the energy limits of validity of the cross section model 163 { 164 highLim = pos2->second; 165 } 219 166 220 167 if (k >= lowLim && k <= highLim) 221 { 222 // Kinetic energy of primary particle 223 224 G4ParticleMomentum primaryDirection = particle->GetMomentumDirection(); 225 G4double particleMass = particle->GetDefinition()->GetPDGMass(); 226 G4double totalEnergy = k + particleMass; 227 G4double pSquare = k * (totalEnergy + particleMass); 228 G4double totalMomentum = std::sqrt(pSquare); 229 230 const G4String& particleName = particle->GetDefinition()->GetParticleName(); 231 232 G4int ionizationShell = cross.RandomSelect(k,particleName); 233 234 G4double secondaryKinetic = RandomizeEjectedElectronEnergy(particle->GetDefinition(),k,ionizationShell); 235 236 G4double bindingEnergy = waterStructure.IonisationEnergy(ionizationShell); 237 238 G4double cosTheta = 0.; 239 G4double phi = 0.; 240 RandomizeEjectedElectronDirection(track.GetDefinition(), k,secondaryKinetic, cosTheta, phi); 241 242 G4double sinTheta = std::sqrt(1.-cosTheta*cosTheta); 243 G4double dirX = sinTheta*std::cos(phi); 244 G4double dirY = sinTheta*std::sin(phi); 245 G4double dirZ = cosTheta; 246 G4ThreeVector deltaDirection(dirX,dirY,dirZ); 247 deltaDirection.rotateUz(primaryDirection); 248 249 G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 )); 250 251 //Primary Particle Direction 252 G4double finalPx = totalMomentum*primaryDirection.x() - deltaTotalMomentum*deltaDirection.x(); 253 G4double finalPy = totalMomentum*primaryDirection.y() - deltaTotalMomentum*deltaDirection.y(); 254 G4double finalPz = totalMomentum*primaryDirection.z() - deltaTotalMomentum*deltaDirection.z(); 255 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz); 256 finalPx /= finalMomentum; 257 finalPy /= finalMomentum; 258 finalPz /= finalMomentum; 259 260 product.ModifyPrimaryParticle(finalPx,finalPy,finalPz,k-bindingEnergy-secondaryKinetic); 261 product.AddEnergyDeposit(bindingEnergy); 262 263 G4DynamicParticle* aElectron = new G4DynamicParticle(G4Electron::Electron(),deltaDirection,secondaryKinetic); 264 product.AddSecondary(aElectron); 265 } 168 { 169 G4ParticleMomentum primaryDirection = particle->GetMomentumDirection(); 170 G4double particleMass = particle->GetDefinition()->GetPDGMass(); 171 G4double totalEnergy = k + particleMass; 172 G4double pSquare = k * (totalEnergy + particleMass); 173 G4double totalMomentum = std::sqrt(pSquare); 174 175 const G4String& particleName = particle->GetDefinition()->GetParticleName(); 176 177 G4int ionizationShell = cross.RandomSelect(k,particleName); 178 179 G4double secondaryKinetic = RandomizeEjectedElectronEnergy(particle->GetDefinition(),k,ionizationShell); 180 181 G4double bindingEnergy = waterStructure.IonisationEnergy(ionizationShell); 182 183 G4double cosTheta = 0.; 184 G4double phi = 0.; 185 RandomizeEjectedElectronDirection(track.GetDefinition(), k,secondaryKinetic, cosTheta, phi); 186 187 G4double sinTheta = std::sqrt(1.-cosTheta*cosTheta); 188 G4double dirX = sinTheta*std::cos(phi); 189 G4double dirY = sinTheta*std::sin(phi); 190 G4double dirZ = cosTheta; 191 G4ThreeVector deltaDirection(dirX,dirY,dirZ); 192 deltaDirection.rotateUz(primaryDirection); 193 194 G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 )); 195 196 G4double finalPx = totalMomentum*primaryDirection.x() - deltaTotalMomentum*deltaDirection.x(); 197 G4double finalPy = totalMomentum*primaryDirection.y() - deltaTotalMomentum*deltaDirection.y(); 198 G4double finalPz = totalMomentum*primaryDirection.z() - deltaTotalMomentum*deltaDirection.z(); 199 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz); 200 finalPx /= finalMomentum; 201 finalPy /= finalMomentum; 202 finalPz /= finalMomentum; 203 204 product.ModifyPrimaryParticle(finalPx,finalPy,finalPz,k-bindingEnergy-secondaryKinetic); 205 product.AddEnergyDeposit(bindingEnergy); 206 207 G4DynamicParticle* aElectron = new G4DynamicParticle(G4Electron::Electron(),deltaDirection,secondaryKinetic); 208 product.AddSecondary(aElectron); 209 } 266 210 267 211 return product; 268 212 } 269 213 214 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 270 215 271 216 G4double G4FinalStateIonisationBorn::RandomizeEjectedElectronEnergy(G4ParticleDefinition* particleDefinition, 272 G4double k, 273 G4int shell) 274 { 275 217 G4double k, G4int shell) 218 { 276 219 if (particleDefinition == G4Electron::ElectronDefinition()) 277 { 278 279 G4double maximumEnergyTransfer=0.; 280 if ((k+waterStructure.IonisationEnergy(shell))/2. > k) maximumEnergyTransfer=k; 281 else maximumEnergyTransfer = (k+waterStructure.IonisationEnergy(shell))/2.; 220 { 221 G4double maximumEnergyTransfer=0.; 222 if ((k+waterStructure.IonisationEnergy(shell))/2. > k) maximumEnergyTransfer=k; 223 else maximumEnergyTransfer = (k+waterStructure.IonisationEnergy(shell))/2.; 282 224 283 G4double crossSectionMaximum = 0.;284 for(G4double value=waterStructure.IonisationEnergy(shell); value<=maximumEnergyTransfer; value+=0.1*eV)285 {286 G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k/eV, value/eV, shell);287 if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection;288 }225 G4double crossSectionMaximum = 0.; 226 for(G4double value=waterStructure.IonisationEnergy(shell); value<=maximumEnergyTransfer; value+=0.1*eV) 227 { 228 G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k/eV, value/eV, shell); 229 if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection; 230 } 289 231 290 G4double secondaryElectronKineticEnergy=0.; 291 do 292 { 293 secondaryElectronKineticEnergy = G4UniformRand() * (maximumEnergyTransfer-waterStructure.IonisationEnergy(shell)); 294 } while(G4UniformRand()*crossSectionMaximum > 232 G4double secondaryElectronKineticEnergy=0.; 233 do 234 { 235 secondaryElectronKineticEnergy = G4UniformRand() * (maximumEnergyTransfer-waterStructure.IonisationEnergy(shell)); 236 } while(G4UniformRand()*crossSectionMaximum > 237 DifferentialCrossSection(particleDefinition, k/eV,(secondaryElectronKineticEnergy+waterStructure.IonisationEnergy(shell))/eV,shell)); 238 239 return secondaryElectronKineticEnergy; 240 241 } 242 243 if (particleDefinition == G4Proton::ProtonDefinition()) 244 { 245 G4double maximumKineticEnergyTransfer = 4.* (electron_mass_c2 / proton_mass_c2) * k - (waterStructure.IonisationEnergy(shell)); 246 247 G4double crossSectionMaximum = 0.; 248 for (G4double value = waterStructure.IonisationEnergy(shell); 249 value<=4.*waterStructure.IonisationEnergy(shell) ; 250 value+=0.1*eV) 251 { 252 G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k/eV, value/eV, shell); 253 if (differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection; 254 } 255 256 G4double secondaryElectronKineticEnergy = 0.; 257 do 258 { 259 secondaryElectronKineticEnergy = G4UniformRand() * maximumKineticEnergyTransfer; 260 } while(G4UniformRand()*crossSectionMaximum >= 295 261 DifferentialCrossSection(particleDefinition, k/eV,(secondaryElectronKineticEnergy+waterStructure.IonisationEnergy(shell))/eV,shell)); 296 262 297 return secondaryElectronKineticEnergy; 298 299 } 300 301 if (particleDefinition == G4Proton::ProtonDefinition()) 302 { 303 G4double maximumKineticEnergyTransfer = 4.* (electron_mass_c2 / proton_mass_c2) * k - (waterStructure.IonisationEnergy(shell)); 304 305 G4double crossSectionMaximum = 0.; 306 for (G4double value = waterStructure.IonisationEnergy(shell); 307 value<=4.*waterStructure.IonisationEnergy(shell) ; 308 value+=0.1*eV) 309 { 310 G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k/eV, value/eV, shell); 311 if (differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection; 312 } 313 314 G4double secondaryElectronKineticEnergy = 0.; 315 do 316 { 317 secondaryElectronKineticEnergy = G4UniformRand() * maximumKineticEnergyTransfer; 318 } while(G4UniformRand()*crossSectionMaximum >= 319 DifferentialCrossSection(particleDefinition, k/eV,(secondaryElectronKineticEnergy+waterStructure.IonisationEnergy(shell))/eV,shell)); 320 321 return secondaryElectronKineticEnergy; 322 } 263 return secondaryElectronKineticEnergy; 264 } 323 265 324 266 return 0; 325 267 } 326 268 269 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 327 270 328 271 void G4FinalStateIonisationBorn::RandomizeEjectedElectronDirection(G4ParticleDefinition* particleDefinition, … … 333 276 { 334 277 if (particleDefinition == G4Electron::ElectronDefinition()) 335 { 336 337 phi = twopi * G4UniformRand(); 338 if (secKinetic < 50.*eV) cosTheta = (2.*G4UniformRand())-1.; 339 else if (secKinetic <= 200.*eV) 340 { 341 if (G4UniformRand() <= 0.1) cosTheta = (2.*G4UniformRand())-1.; 342 else cosTheta = G4UniformRand()*(std::sqrt(2.)/2); 343 } 344 else 345 { 346 G4double sin2O = (1.-secKinetic/k) / (1.+secKinetic/(2.*electron_mass_c2)); 347 cosTheta = std::sqrt(1.-sin2O); 348 } 349 } 278 { 279 phi = twopi * G4UniformRand(); 280 if (secKinetic < 50.*eV) cosTheta = (2.*G4UniformRand())-1.; 281 else if (secKinetic <= 200.*eV) 282 { 283 if (G4UniformRand() <= 0.1) cosTheta = (2.*G4UniformRand())-1.; 284 else cosTheta = G4UniformRand()*(std::sqrt(2.)/2); 285 } 286 else 287 { 288 G4double sin2O = (1.-secKinetic/k) / (1.+secKinetic/(2.*electron_mass_c2)); 289 cosTheta = std::sqrt(1.-sin2O); 290 } 291 } 350 292 351 293 if (particleDefinition == G4Proton::ProtonDefinition()) 352 { 353 G4double maxSecKinetic = 4.* (electron_mass_c2 / proton_mass_c2) * k; 354 phi = twopi * G4UniformRand(); 355 cosTheta = std::sqrt(secKinetic / maxSecKinetic); 356 } 357 } 358 294 { 295 G4double maxSecKinetic = 4.* (electron_mass_c2 / proton_mass_c2) * k; 296 phi = twopi * G4UniformRand(); 297 cosTheta = std::sqrt(secKinetic / maxSecKinetic); 298 } 299 } 300 301 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 359 302 360 303 double G4FinalStateIonisationBorn::DifferentialCrossSection(G4ParticleDefinition * particleDefinition, … … 366 309 367 310 if (energyTransfer >= waterStructure.IonisationEnergy(ionizationLevelIndex)) 368 { 369 G4double valueT1 = 0; 370 G4double valueT2 = 0; 371 G4double valueE21 = 0; 372 G4double valueE22 = 0; 373 G4double valueE12 = 0; 374 G4double valueE11 = 0; 375 376 G4double xs11 = 0; 377 G4double xs12 = 0; 378 G4double xs21 = 0; 379 G4double xs22 = 0; 380 311 { 312 G4double valueT1 = 0; 313 G4double valueT2 = 0; 314 G4double valueE21 = 0; 315 G4double valueE22 = 0; 316 G4double valueE12 = 0; 317 G4double valueE11 = 0; 318 319 G4double xs11 = 0; 320 G4double xs12 = 0; 321 G4double xs21 = 0; 322 G4double xs22 = 0; 323 324 if (particleDefinition == G4Electron::ElectronDefinition()) 325 { 326 // k should be in eV and energy transfer eV also 327 328 std::vector<double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k); 329 330 std::vector<double>::iterator t1 = t2-1; 331 332 // SI : the following condition avoids situations where energyTransfer >last vector element 333 if (energyTransfer <= eVecm[(*t1)].back()) 334 { 335 std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), energyTransfer); 336 std::vector<double>::iterator e11 = e12-1; 337 338 std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), energyTransfer); 339 std::vector<double>::iterator e21 = e22-1; 340 341 valueT1 =*t1; 342 valueT2 =*t2; 343 valueE21 =*e21; 344 valueE22 =*e22; 345 valueE12 =*e12; 346 valueE11 =*e11; 347 348 xs11 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11]; 349 xs12 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12]; 350 xs21 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21]; 351 xs22 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22]; 352 } 353 354 } 355 356 if (particleDefinition == G4Proton::ProtonDefinition()) 357 { 358 // k should be in eV and energy transfer eV also 359 std::vector<double>::iterator t2 = std::upper_bound(pTdummyVec.begin(),pTdummyVec.end(), k); 360 std::vector<double>::iterator t1 = t2-1; 361 362 std::vector<double>::iterator e12 = std::upper_bound(pVecm[(*t1)].begin(),pVecm[(*t1)].end(), energyTransfer); 363 std::vector<double>::iterator e11 = e12-1; 364 365 std::vector<double>::iterator e22 = std::upper_bound(pVecm[(*t2)].begin(),pVecm[(*t2)].end(), energyTransfer); 366 std::vector<double>::iterator e21 = e22-1; 381 367 382 if (particleDefinition == G4Electron::ElectronDefinition()) 383 { 384 // k should be in eV and energy transfer eV also 385 std::vector<double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k); 386 std::vector<double>::iterator t1 = t2-1; 387 std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), energyTransfer); 388 std::vector<double>::iterator e11 = e12-1; 389 390 std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), energyTransfer); 391 std::vector<double>::iterator e21 = e22-1; 392 393 valueT1 =*t1; 394 valueT2 =*t2; 395 valueE21 =*e21; 396 valueE22 =*e22; 397 valueE12 =*e12; 398 valueE11 =*e11; 399 400 xs11 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11]; 401 xs12 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12]; 402 xs21 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21]; 403 xs22 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22]; 404 405 } 406 407 if (particleDefinition == G4Proton::ProtonDefinition()) 408 { 409 // k should be in eV and energy transfer eV also 410 std::vector<double>::iterator t2 = std::upper_bound(pTdummyVec.begin(),pTdummyVec.end(), k); 411 std::vector<double>::iterator t1 = t2-1; 412 std::vector<double>::iterator e12 = std::upper_bound(pVecm[(*t1)].begin(),pVecm[(*t1)].end(), energyTransfer); 413 std::vector<double>::iterator e11 = e12-1; 414 415 std::vector<double>::iterator e22 = std::upper_bound(pVecm[(*t2)].begin(),pVecm[(*t2)].end(), energyTransfer); 416 std::vector<double>::iterator e21 = e22-1; 417 418 valueT1 =*t1; 419 valueT2 =*t2; 420 valueE21 =*e21; 421 valueE22 =*e22; 422 valueE12 =*e12; 423 valueE11 =*e11; 424 425 xs11 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11]; 426 xs12 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12]; 427 xs21 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21]; 428 xs22 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22]; 429 } 430 431 G4double xsProduct = xs11 * xs12 * xs21 * xs22; 432 // if (xs11==0 || xs12==0 ||xs21==0 ||xs22==0) return (0.); 433 if (xsProduct != 0.) 434 { 435 sigma = QuadInterpolator(valueE11, valueE12, 368 valueT1 =*t1; 369 valueT2 =*t2; 370 valueE21 =*e21; 371 valueE22 =*e22; 372 valueE12 =*e12; 373 valueE11 =*e11; 374 375 xs11 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11]; 376 xs12 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12]; 377 xs21 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21]; 378 xs22 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22]; 379 380 } 381 382 G4double xsProduct = xs11 * xs12 * xs21 * xs22; 383 if (xsProduct != 0.) 384 { 385 sigma = QuadInterpolator( valueE11, valueE12, 436 386 valueE21, valueE22, 437 387 xs11, xs12, … … 439 389 valueT1, valueT2, 440 390 k, energyTransfer); 441 } 442 } 391 } 392 393 } 394 443 395 return sigma; 444 396 } 445 397 398 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 446 399 447 400 G4double G4FinalStateIonisationBorn::LogLogInterpolate(G4double e1, … … 458 411 } 459 412 413 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 460 414 461 415 G4double G4FinalStateIonisationBorn::QuadInterpolator(G4double e11, G4double e12, -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateIonisationRudd.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4FinalStateIonisationRudd.cc,v 1.5 2007/11/26 17:27:09 pia Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // Contact Author: Sebastien Incerti (incerti@cenbg.in2p3.fr) 31 // Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 32 // 33 /// 34 // Reference: TNS Geant4-DNA paper 35 // Reference for implementation model: NIM. 155, pp. 145-156, 1978 36 // 37 // History: 38 // ----------- 39 // Date Name Modification 40 // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper 41 // Nov 2007 S. Incerti Implementation 42 // 26 Nov 2007 MGP Cleaned up std:: 43 // 44 // ------------------------------------------------------------------- 45 46 // Class description: 47 // Reference: TNS Geant4-DNA paper 48 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: 49 // design foundation and implementation of the first set of models, 50 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007. 51 // Further documentation available from http://www.ge.infn.it/geant4/dna 52 53 // ------------------------------------------------------------------- 54 26 // $Id: G4FinalStateIonisationRudd.cc,v 1.8 2008/08/20 14:51:48 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 55 28 56 29 #include "G4FinalStateIonisationRudd.hh" 57 #include "G4Track.hh" 58 #include "G4Step.hh" 59 #include "G4DynamicParticle.hh" 60 #include "Randomize.hh" 61 62 #include "G4ParticleTypes.hh" 63 #include "G4ParticleDefinition.hh" 64 #include "G4Electron.hh" 65 #include "G4Proton.hh" 66 #include "G4SystemOfUnits.hh" 67 #include "G4ParticleMomentum.hh" 68 #include "G4DNAGenericIonsManager.hh" 69 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 70 32 71 33 G4FinalStateIonisationRudd::G4FinalStateIonisationRudd() 72 34 { 73 name = "IonisationBorn";74 // Default energy limits (defined for protection against anomalous behaviour only)75 35 lowEnergyLimitDefault = 100 * eV; 76 36 highEnergyLimitDefault = 100 * MeV; … … 112 72 } 113 73 74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 114 75 115 76 G4FinalStateIonisationRudd::~G4FinalStateIonisationRudd() 116 { }117 118 77 {} 78 79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 119 80 120 81 const G4FinalStateProduct& G4FinalStateIonisationRudd::GenerateFinalState(const G4Track& track, const G4Step& /* step */) 121 82 { 122 // Clear previous secondaries, energy deposit and particle kill status123 83 product.Clear(); 124 84 … … 132 92 const G4String& particleName = particle->GetDefinition()->GetParticleName(); 133 93 134 // Retrieve energy limits for the current particle type135 136 94 std::map< G4String,G4double,std::less<G4String> >::iterator pos1; 137 95 pos1 = lowEnergyLimit.find(particleName); 138 96 139 // Lower limit140 97 if (pos1 != lowEnergyLimit.end()) 141 { 142 lowLim = pos1->second; 143 } 144 145 // Upper limit 98 { 99 lowLim = pos1->second; 100 } 101 146 102 std::map< G4String,G4double,std::less<G4String> >::iterator pos2; 147 103 pos2 = highEnergyLimit.find(particleName); 148 104 149 105 if (pos2 != highEnergyLimit.end()) 150 { 151 highLim = pos2->second; 152 } 153 154 // Verify that the current track is within the energy limits of validity of the cross section model 106 { 107 highLim = pos2->second; 108 } 155 109 156 110 if (k >= lowLim && k <= highLim) 157 { 158 // Kinetic energy of primary particle 159 111 { 160 112 G4ParticleDefinition* definition = particle->GetDefinition(); 161 113 G4ParticleMomentum primaryDirection = particle->GetMomentumDirection(); … … 186 138 G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 )); 187 139 188 // Primary Particle Direction189 140 G4double finalPx = totalMomentum*primaryDirection.x() - deltaTotalMomentum*deltaDirection.x(); 190 141 G4double finalPy = totalMomentum*primaryDirection.y() - deltaTotalMomentum*deltaDirection.y(); … … 200 151 G4DynamicParticle* aElectron = new G4DynamicParticle(G4Electron::Electron(),deltaDirection,secondaryKinetic); 201 152 product.AddSecondary(aElectron); 202 } 203 204 if (k < lowLim) {product.KillPrimaryParticle();product.AddEnergyDeposit(k);} 153 } 154 155 if (k < lowLim) 156 { 157 product.KillPrimaryParticle(); 158 } 205 159 206 160 return product; 207 161 } 208 162 209 163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 210 164 211 165 G4double G4FinalStateIonisationRudd::RandomizeEjectedElectronEnergy(G4ParticleDefinition* particleDefinition, … … 220 174 if (particleDefinition == G4Proton::ProtonDefinition() 221 175 || particleDefinition == instance->GetIon("hydrogen")) 222 223 { 176 { 224 177 maximumKineticEnergyTransfer= 4.* (electron_mass_c2 / proton_mass_c2) * k; 225 }178 } 226 179 227 180 if (particleDefinition == instance->GetIon("helium") 228 181 || particleDefinition == instance->GetIon("alpha+") 229 182 || particleDefinition == instance->GetIon("alpha++")) 230 {183 { 231 184 maximumKineticEnergyTransfer= 4.* (0.511 / 3728) * k; 232 }185 } 233 186 234 187 G4double crossSectionMaximum = 0.; 188 235 189 for(G4double value=waterStructure.IonisationEnergy(shell); value<=4.*waterStructure.IonisationEnergy(shell) ; value+=0.1*eV) 236 {190 { 237 191 G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k, value, shell); 238 192 if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection; 239 } 193 } 194 240 195 G4double secElecKinetic = 0.; 241 do{ 196 197 do 198 { 242 199 secElecKinetic = G4UniformRand() * maximumKineticEnergyTransfer; 243 200 } while(G4UniformRand()*crossSectionMaximum > DifferentialCrossSection(particleDefinition, … … 249 206 } 250 207 208 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 209 251 210 252 211 void G4FinalStateIonisationRudd::RandomizeEjectedElectronDirection(G4ParticleDefinition* particleDefinition, 253 212 G4double k, 254 213 G4double secKinetic, 255 G4double cosTheta,256 G4double phi )214 G4double & cosTheta, 215 G4double & phi ) 257 216 { 258 217 G4DNAGenericIonsManager *instance; … … 263 222 if (particleDefinition == G4Proton::ProtonDefinition() 264 223 || particleDefinition == instance->GetIon("hydrogen")) 265 {224 { 266 225 maxSecKinetic = 4.* (electron_mass_c2 / proton_mass_c2) * k; 267 }226 } 268 227 269 228 if (particleDefinition == instance->GetIon("helium") 270 229 || particleDefinition == instance->GetIon("alpha+") 271 230 || particleDefinition == instance->GetIon("alpha++")) 272 {231 { 273 232 maxSecKinetic = 4.* (0.511 / 3728) * k; 274 }233 } 275 234 276 235 phi = twopi * G4UniformRand(); 277 236 cosTheta = std::sqrt(secKinetic / maxSecKinetic); 278 237 } 238 239 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 279 240 280 241 … … 314 275 315 276 if (j == 4) 316 {277 { 317 278 //Data For Liquid Water K SHELL from Dingfelder (Protons in Water) 318 279 A1 = 1.25; … … 326 287 D2 = 0.00; 327 288 alphaConst = 0.66; 328 }289 } 329 290 else 330 {291 { 331 292 //Data For Liquid Water from Dingfelder (Protons in Water) 332 293 A1 = 1.02; … … 340 301 D2 = 0.04; 341 302 alphaConst = 0.64; 342 }303 } 343 304 344 305 const G4double n = 2.; 345 306 const G4double Gj[5] = {0.99, 1.11, 1.11, 0.52, 1.}; 346 347 //const G4double I[5]={12.61*eV, 14.73*eV, 18.55*eV, 32.2*eV, 539.7*eV}; // for water Vapor348 //const G4double energyConstant[]={10.79*eV, 13.39*eV, 16.05*eV, 32.30*eV, 539.*eV};349 307 350 308 G4DNAGenericIonsManager* instance; … … 359 317 if (particleDefinition == G4Proton::ProtonDefinition() 360 318 || particleDefinition == instance->GetIon("hydrogen")) 361 {319 { 362 320 tau = (electron_mass_c2/proton_mass_c2) * k ; 363 }321 } 364 322 365 323 if ( particleDefinition == instance->GetIon("helium") 366 324 || particleDefinition == instance->GetIon("alpha+") 367 325 || particleDefinition == instance->GetIon("alpha++")) 368 {326 { 369 327 tau = (0.511/3728.) * k ; 370 }328 } 371 329 372 330 G4double S = 4.*pi * Bohr_radius*Bohr_radius * n * std::pow((Ry/waterStructure.IonisationEnergy(ionizationLevelIndex)),2); … … 390 348 || particleDefinition == instance->GetIon("hydrogen") 391 349 ) 392 {350 { 393 351 return(sigma); 394 } 395 396 // ------------ 397 352 } 353 398 354 if (particleDefinition == instance->GetIon("alpha++") ) 399 {355 { 400 356 slaterEffectiveCharge[0]=0.; 401 357 slaterEffectiveCharge[1]=0.; … … 404 360 sCoefficient[1]=0.; 405 361 sCoefficient[2]=0.; 406 }362 } 407 363 408 364 if (particleDefinition == instance->GetIon("alpha+") ) 409 {365 { 410 366 slaterEffectiveCharge[0]=2.0; 411 367 slaterEffectiveCharge[1]=1.15; … … 414 370 sCoefficient[1]=0.15; 415 371 sCoefficient[2]=0.15; 416 }372 } 417 373 418 374 if (particleDefinition == instance->GetIon("helium") ) 419 {375 { 420 376 slaterEffectiveCharge[0]=1.7; 421 377 slaterEffectiveCharge[1]=1.15; … … 424 380 sCoefficient[1]=0.25; 425 381 sCoefficient[2]=0.25; 426 }382 } 427 383 428 384 if ( particleDefinition == instance->GetIon("helium") … … 430 386 || particleDefinition == instance->GetIon("alpha++") 431 387 ) 432 {388 { 433 389 sigma = Gj[j] * (S/waterStructure.IonisationEnergy(ionizationLevelIndex)) * ( (F1+w*F2) / ( std::pow((1.+w),3) * ( 1.+std::exp(alphaConst*(w-wc)/v))) ); 434 390 … … 440 396 441 397 return zEff * zEff * sigma ; 442 }398 } 443 399 444 400 return 0; 445 401 } 402 403 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 446 404 447 405 G4double G4FinalStateIonisationRudd::S_1s(G4double t, … … 459 417 } 460 418 461 419 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 462 420 463 421 G4double G4FinalStateIonisationRudd::S_2s(G4double t, … … 476 434 } 477 435 478 436 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 479 437 480 438 G4double G4FinalStateIonisationRudd::S_2p(G4double t, … … 492 450 } 493 451 494 452 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 495 453 496 454 G4double G4FinalStateIonisationRudd::R(G4double t, … … 500 458 { 501 459 // tElectron = m_electron / m_alpha * t 502 // Hardcoded in Riccardo's implementation; to be corrected503 460 // Dingfelder, in Chattanooga 2005 proceedings, p 4 504 461 … … 509 466 } 510 467 511 468 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 512 469 513 470 G4double G4FinalStateIonisationRudd::CorrectionFactor(G4ParticleDefinition* particleDefinition, G4double k) … … 517 474 518 475 if (particleDefinition == G4Proton::Proton()) 519 {476 { 520 477 return(1.); 521 }478 } 522 479 else 523 480 if (particleDefinition == instance->GetIon("hydrogen")) 524 {481 { 525 482 G4double value = (std::log(k/eV)-4.2)/0.5; 526 483 return((0.8/(1+std::exp(value))) + 0.9); 527 }484 } 528 485 else 529 {486 { 530 487 return(1.); 531 }532 } 488 } 489 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateKill.cc
r819 r961 26 26 // 27 27 // $Id: G4FinalStateKill.cc,v 1.1 2007/11/09 20:26:12 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateProduct.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4FinalStateProduct.cc,v 1. 5 2007/11/09 20:11:04 piaExp $28 // GEANT4 tag $Name: $27 // $Id: G4FinalStateProduct.cc,v 1.6 2009/01/20 07:50:28 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 53 53 #include "G4ThreeVector.hh" 54 54 55 G4FinalStateProduct::G4FinalStateProduct() : killStatus(false), isModified(false), localEnergyDeposit(0.), modifiedEnergy(0)55 G4FinalStateProduct::G4FinalStateProduct() : killStatus(false), doNotDepositStatus(false), isModified(false), localEnergyDeposit(0.), modifiedEnergy(0) 56 56 { 57 57 // empty … … 68 68 // Reset object status 69 69 killStatus = false; 70 doNotDepositStatus = false; 70 71 isModified = false; 71 72 localEnergyDeposit = 0.; … … 98 99 } 99 100 101 void G4FinalStateProduct::DoNotDepositEnergy() 102 { 103 doNotDepositStatus = true; 104 } 105 100 106 void G4FinalStateProduct::KillPrimaryParticle() 101 107 { 108 102 109 // ---- MGP ---- To be added: Handle local energy deposit here 103 110 killStatus = true; -
trunk/source/processes/electromagnetic/lowenergy/src/G4FluoTransition.cc
r819 r961 26 26 // 27 27 // $Id: G4FluoTransition.cc,v 1.2 ???? 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) -
trunk/source/processes/electromagnetic/lowenergy/src/G4LinInterpolation.cc
r819 r961 26 26 // 27 27 // $Id: G4LinInterpolation.cc,v 1.3 2006/06/29 19:40:03 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4LogLogInterpolation.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4LogLogInterpolation.cc,v 1. 7 2006/06/29 19:40:09 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4LogLogInterpolation.cc,v 1.14 2008/12/12 08:50:59 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) 31 // 31 // Sebastian Incerti (incerti@cenbg.in2p3.fr) 32 // Nicolas A. Karakatsanis (knicolas@mail.ntua.gr) 32 33 // History: 33 34 // ----------- 34 35 // 31 Jul 2001 MGP Created 35 // 36 // 27 Jun 2008 SI Add check to avoid FPE errors 37 // 08 Dec 2008 NAK Log-Log interpolation math formula streamlined, self-test function 36 38 // ------------------------------------------------------------------- 37 39 … … 57 59 { 58 60 G4int nBins = data.size() - 1; 61 //G4double oldresult = 0.; 59 62 G4double value = 0.; 60 63 if (x < points[0]) … … 68 71 G4double d1 = data[bin]; 69 72 G4double d2 = data[bin+1]; 70 value = (std::log10(d1)*std::log10(e2/x) + std::log10(d2)*std::log10(x/e1)) / std::log10(e2/e1); 71 value = std::pow(10.,value); 73 // Check of e1, e2, d1 and d2 values to avoid floating-point errors when estimating the interpolated value below -- S.I., Jun. 2008 74 if ((d1 > 0.) && (d2 > 0.) && (e1 > 0.) && (e2 > 0.)) 75 { 76 // Streamline the Log-Log Interpolation formula in order to reduce the required number of log10() function calls 77 // Variable oldresult contains the result of old implementation of Log-Log interpolation -- M.G.P. Jun. 2001 78 // oldresult = (std::log10(d1)*std::log10(e2/x) + std::log10(d2)*std::log10(x/e1)) / std::log10(e2/e1); 79 // oldresult = std::pow(10.,oldresult); 80 // Variable value contains the result of new implementation, after streamlining the math operation -- N.A.K. Oct. 2008 81 value = std::log10(d1)+(std::log10(d2/d1)/std::log10(e2/e1)*std::log10(x/e1)); 82 value = std::pow(10.,value); 83 // Test of the new implementation result (value variable) against the old one (oldresult) -- N.A.K. Dec. 2008 84 // G4double diffResult = value - oldresult; 85 // G4double relativeDiff = 1e-11; 86 // Comparison of the two values based on a max allowable relative difference 87 // if ( std::fabs(diffResult) > relativeDiff*std::fabs(oldresult) ) 88 // { 89 // Abort comparison when at least one of two results is infinite 90 // if ((!std::isinf(oldresult)) && (!std::isinf(value))) 91 // { 92 // G4cout << "G4LogLogInterpolation> Old Interpolated Value is:" << oldresult << G4endl; 93 // G4cout << "G4LogLogInterpolation> New Interpolated Value is:" << value << G4endl << G4endl; 94 // G4cerr << "G4LogLogInterpolation> Error in Interpolation:" << G4endl; 95 // G4cerr << "The difference between new and old interpolated value is:" << diffResult << G4endl << G4endl; 96 // } 97 // } 98 } 99 else value = 0.; 72 100 } 73 101 else … … 75 103 value = data[nBins]; 76 104 } 77 78 105 return value; 79 106 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyBremsstrahlung.cc
r819 r961 25 25 // 26 26 // $Id: G4LowEnergyBremsstrahlung.cc,v 1.71 2006/06/29 19:40:13 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyCompton.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LowEnergyCompton.cc,v 1.4 1 2006/06/29 19:40:15gunter Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4LowEnergyCompton.cc,v 1.47 2008/12/18 13:01:28 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // Author: A. Forti … … 65 65 #include "G4VRangeTest.hh" 66 66 #include "G4RangeTest.hh" 67 #include "G4RangeNoTest.hh" 67 68 #include "G4MaterialCutsCouple.hh" 68 69 … … 90 91 meanFreePathTable = 0; 91 92 92 rangeTest = new G4RangeTest; 93 rangeTest = new G4RangeNoTest; 94 95 // For Doppler broadening 96 shellData.SetOccupancyData(); 93 97 94 98 if (verboseLevel > 0) … … 119 123 delete meanFreePathTable; 120 124 meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials(); 125 126 // For Doppler broadening 127 G4String file = "/doppler/shell-doppler"; 128 shellData.LoadData(file); 121 129 } 122 130 … … 154 162 G4double e0m = photonEnergy0 / electron_mass_c2 ; 155 163 G4ParticleMomentum photonDirection0 = incidentPhoton->GetMomentumDirection(); 156 157 // Select randomly one element in the current material158 const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple();159 G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0);160 161 164 G4double epsilon0 = 1. / (1. + 2. * e0m); 162 165 G4double epsilon0Sq = epsilon0 * epsilon0; 163 166 G4double alpha1 = -std::log(epsilon0); 164 167 G4double alpha2 = 0.5 * (1. - epsilon0Sq); 165 166 168 G4double wlPhoton = h_Planck*c_light/photonEnergy0; 169 170 // Select randomly one element in the current material 171 const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple(); 172 G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0); 167 173 168 174 // Sample the energy of the scattered photon … … 196 202 G4double sinTheta = std::sqrt (sinT2); 197 203 G4double phi = twopi * G4UniformRand() ; 198 G4double dirx = sinTheta * std::cos(phi); 199 G4double diry = sinTheta * std::sin(phi); 200 G4double dirz = cosTheta ; 204 G4double dirX = sinTheta * std::cos(phi); 205 G4double dirY = sinTheta * std::sin(phi); 206 G4double dirZ = cosTheta ; 207 208 // Doppler broadening - Method based on: 209 // Y. Namito, S. Ban and H. Hirayama, 210 // "Implementation of the Doppler Broadening of a Compton-Scattered Photon Into the EGS4 Code" 211 // NIM A 349, pp. 489-494, 1994 212 213 // Maximum number of sampling iterations 214 G4int maxDopplerIterations = 1000; 215 G4double bindingE = 0.; 216 G4double photonEoriginal = epsilon * photonEnergy0; 217 G4double photonE = -1.; 218 G4int iteration = 0; 219 G4double eMax = photonEnergy0; 220 do 221 { 222 iteration++; 223 // Select shell based on shell occupancy 224 G4int shell = shellData.SelectRandomShell(Z); 225 bindingE = shellData.BindingEnergy(Z,shell); 226 227 eMax = photonEnergy0 - bindingE; 228 229 // Randomly sample bound electron momentum (memento: the data set is in Atomic Units) 230 G4double pSample = profileData.RandomSelectMomentum(Z,shell); 231 // Rescale from atomic units 232 G4double pDoppler = pSample * fine_structure_const; 233 G4double pDoppler2 = pDoppler * pDoppler; 234 G4double var2 = 1. + oneCosT * e0m; 235 G4double var3 = var2*var2 - pDoppler2; 236 G4double var4 = var2 - pDoppler2 * cosTheta; 237 G4double var = var4*var4 - var3 + pDoppler2 * var3; 238 if (var > 0.) 239 { 240 G4double varSqrt = std::sqrt(var); 241 G4double scale = photonEnergy0 / var3; 242 // Random select either root 243 if (G4UniformRand() < 0.5) photonE = (var4 - varSqrt) * scale; 244 else photonE = (var4 + varSqrt) * scale; 245 } 246 else 247 { 248 photonE = -1.; 249 } 250 } while ( iteration <= maxDopplerIterations && 251 (photonE < 0. || photonE > eMax || photonE < eMax*G4UniformRand()) ); 252 253 // End of recalculation of photon energy with Doppler broadening 254 // Revert to original if maximum number of iterations threshold has been reached 255 if (iteration >= maxDopplerIterations) 256 { 257 photonE = photonEoriginal; 258 bindingE = 0.; 259 } 201 260 202 261 // Update G4VParticleChange for the scattered photon 203 262 204 G4ThreeVector photonDirection1(dir x,diry,dirz);263 G4ThreeVector photonDirection1(dirX,dirY,dirZ); 205 264 photonDirection1.rotateUz(photonDirection0); 206 aParticleChange.ProposeMomentumDirection(photonDirection1) ; 207 G4double photonEnergy1 = epsilon * photonEnergy0; 265 aParticleChange.ProposeMomentumDirection(photonDirection1); 266 267 G4double photonEnergy1 = photonE; 268 //G4cout << "--> PHOTONENERGY1 = " << photonE/keV << G4endl; 208 269 209 270 if (photonEnergy1 > 0.) … … 218 279 219 280 // Kinematics of the scattered electron 220 G4double eKineticEnergy = photonEnergy0 - photonEnergy1; 281 G4double eKineticEnergy = photonEnergy0 - photonEnergy1 - bindingE; 282 G4double eTotalEnergy = eKineticEnergy + electron_mass_c2; 283 284 G4double electronE = photonEnergy0 * (1. - epsilon) + electron_mass_c2; 285 G4double electronP2 = electronE*electronE - electron_mass_c2*electron_mass_c2; 286 G4double sinThetaE = -1.; 287 G4double cosThetaE = 0.; 288 if (electronP2 > 0.) 289 { 290 cosThetaE = (eTotalEnergy + photonEnergy1 )* (1. - epsilon) / std::sqrt(electronP2); 291 sinThetaE = -1. * std::sqrt(1. - cosThetaE * cosThetaE); 292 } 293 294 G4double eDirX = sinThetaE * std::cos(phi); 295 G4double eDirY = sinThetaE * std::sin(phi); 296 G4double eDirZ = cosThetaE; 221 297 222 298 // Generate the electron only if with large enough range w.r.t. cuts and safety … … 226 302 if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety)) 227 303 { 228 G4double eMomentum = std::sqrt(eKineticEnergy*(eKineticEnergy+2.*electron_mass_c2)); 229 G4ThreeVector eDirection((photonEnergy0 * photonDirection0 - 230 photonEnergy1 * photonDirection1) * (1./eMomentum)); 231 G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(), 232 eDirection,eKineticEnergy) ; 304 G4ThreeVector eDirection(eDirX,eDirY,eDirZ); 305 eDirection.rotateUz(photonDirection0); 306 307 G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(),eDirection,eKineticEnergy) ; 233 308 aParticleChange.SetNumberOfSecondaries(1); 234 309 aParticleChange.AddSecondary(electron); 235 aParticleChange.ProposeLocalEnergyDeposit(0.); 310 // Binding energy deposited locally 311 aParticleChange.ProposeLocalEnergyDeposit(bindingE); 236 312 } 237 313 else 238 314 { 239 315 aParticleChange.SetNumberOfSecondaries(0); 240 aParticleChange.ProposeLocalEnergyDeposit(eKineticEnergy );316 aParticleChange.ProposeLocalEnergyDeposit(eKineticEnergy + bindingE); 241 317 } 242 318 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyGammaConversion.cc
r819 r961 27 27 /// 28 28 // $Id: G4LowEnergyGammaConversion.cc,v 1.36 2006/06/29 19:40:17 gunter Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 30 30 // 31 31 // -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyIonisation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LowEnergyIonisation.cc,v 1.10 2 2006/06/29 19:40:19 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4LowEnergyIonisation.cc,v 1.103 2008/05/02 19:23:38 pia Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -------------------------------------------------------------- … … 663 663 type = aSecondary->GetDefinition(); 664 664 if ( eTot + e <= eLoss && 665 ( type == G4Gamma::Gamma() && e>cutForPhotons ) ||666 (type == G4Electron::Electron() && e>cutForElectrons)) {665 ((type == G4Gamma::Gamma() && e>cutForPhotons ) || 666 (type == G4Electron::Electron() && e>cutForElectrons))) { 667 667 668 668 eTot += e; -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPhotoElectric.cc
r819 r961 26 26 // 27 27 // $Id: G4LowEnergyPhotoElectric.cc,v 1.56 2006/06/29 19:40:23 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: A. Forti -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPolarizedCompton.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4LowEnergyPolarizedCompton.cc,v 1.2 2 2006/06/29 19:40:25 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4LowEnergyPolarizedCompton.cc,v 1.25 2008/05/02 19:23:38 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------------------------------------------------------ … … 110 110 rangeTest = new G4RangeTest; 111 111 112 // For Doppler broadening 113 shellData.SetOccupancyData(); 114 115 112 116 if (verboseLevel > 0) 113 117 { … … 139 143 delete meanFreePathTable; 140 144 meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials(); 145 146 // For Doppler broadening 147 G4String file = "/doppler/shell-doppler"; 148 shellData.LoadData(file); 149 141 150 } 142 151 … … 327 336 G4double dirz = cosTheta ; 328 337 338 339 // oneCosT , eom 340 341 342 343 // Doppler broadening - Method based on: 344 // Y. Namito, S. Ban and H. Hirayama, 345 // "Implementation of the Doppler Broadening of a Compton-Scattered Photon Into the EGS4 Code" 346 // NIM A 349, pp. 489-494, 1994 347 348 // Maximum number of sampling iterations 349 350 G4int maxDopplerIterations = 1000; 351 G4double bindingE = 0.; 352 G4double photonEoriginal = epsilon * gammaEnergy0; 353 G4double photonE = -1.; 354 G4int iteration = 0; 355 G4double eMax = gammaEnergy0; 356 357 do 358 { 359 iteration++; 360 // Select shell based on shell occupancy 361 G4int shell = shellData.SelectRandomShell(Z); 362 bindingE = shellData.BindingEnergy(Z,shell); 363 364 eMax = gammaEnergy0 - bindingE; 365 366 // Randomly sample bound electron momentum (memento: the data set is in Atomic Units) 367 G4double pSample = profileData.RandomSelectMomentum(Z,shell); 368 // Rescale from atomic units 369 G4double pDoppler = pSample * fine_structure_const; 370 G4double pDoppler2 = pDoppler * pDoppler; 371 G4double var2 = 1. + onecost * E0_m; 372 G4double var3 = var2*var2 - pDoppler2; 373 G4double var4 = var2 - pDoppler2 * cosTheta; 374 G4double var = var4*var4 - var3 + pDoppler2 * var3; 375 if (var > 0.) 376 { 377 G4double varSqrt = std::sqrt(var); 378 G4double scale = gammaEnergy0 / var3; 379 // Random select either root 380 if (G4UniformRand() < 0.5) photonE = (var4 - varSqrt) * scale; 381 else photonE = (var4 + varSqrt) * scale; 382 } 383 else 384 { 385 photonE = -1.; 386 } 387 } while ( iteration <= maxDopplerIterations && 388 (photonE < 0. || photonE > eMax || photonE < eMax*G4UniformRand()) ); 389 390 // End of recalculation of photon energy with Doppler broadening 391 // Revert to original if maximum number of iterations threshold has been reached 392 if (iteration >= maxDopplerIterations) 393 { 394 photonE = photonEoriginal; 395 bindingE = 0.; 396 } 397 398 gammaEnergy1 = photonE; 399 400 // G4cout << "--> PHOTONENERGY1 = " << photonE/keV << G4endl; 401 402 403 /// Doppler Broadeing 404 405 406 407 329 408 // 330 409 // update G4VParticleChange for the scattered photon 331 410 // 332 411 333 gammaEnergy1 = epsilon*gammaEnergy0; 412 // gammaEnergy1 = epsilon*gammaEnergy0; 413 334 414 335 415 // New polarization … … 365 445 // 366 446 367 G4double ElecKineEnergy = gammaEnergy0 - gammaEnergy1 ; 447 G4double ElecKineEnergy = gammaEnergy0 - gammaEnergy1 -bindingE; 448 368 449 369 450 // Generate the electron only if with large enough range w.r.t. cuts and safety 370 451 371 452 G4double safety = aStep.GetPostStepPoint()->GetSafety(); 453 372 454 373 455 if (rangeTest->Escape(G4Electron::Electron(),couple,ElecKineEnergy,safety)) … … 379 461 aParticleChange.SetNumberOfSecondaries(1); 380 462 aParticleChange.AddSecondary(electron); 381 aParticleChange.ProposeLocalEnergyDeposit(0.); 463 // aParticleChange.ProposeLocalEnergyDeposit(0.); 464 aParticleChange.ProposeLocalEnergyDeposit(bindingE); 382 465 } 383 466 else 384 467 { 385 468 aParticleChange.SetNumberOfSecondaries(0); 386 aParticleChange.ProposeLocalEnergyDeposit(ElecKineEnergy );469 aParticleChange.ProposeLocalEnergyDeposit(ElecKineEnergy+bindingE); 387 470 } 388 471 … … 492 575 // G4double sinsqrphi = sinPhi*sinPhi; 493 576 G4double normalisation = std::sqrt(1. - cosSqrPhi*sinSqrTh); 494 577 495 578 496 579 // Determination of Theta 497 580 498 G4double thetaProbability; 581 // ---- MGP ---- Commented out the following 3 lines to avoid compilation 582 // warnings (unused variables) 583 // G4double thetaProbability; 499 584 G4double theta; 500 G4double a, b; 501 G4double cosTheta; 502 585 // G4double a, b; 586 // G4double cosTheta; 587 588 /* 589 590 depaola method 591 503 592 do 504 {593 { 505 594 rand1 = G4UniformRand(); 506 595 rand2 = G4UniformRand(); … … 515 604 516 605 G4double cosBeta = cosTheta; 606 607 */ 608 609 610 // Dan Xu method (IEEE TNS, 52, 1160 (2005)) 611 612 rand1 = G4UniformRand(); 613 rand2 = G4UniformRand(); 614 615 if (rand1<(epsilon+1.0/epsilon-2)/(2.0*(epsilon+1.0/epsilon)-4.0*sinSqrTh*cosSqrPhi)) 616 { 617 if (rand2<0.5) 618 theta = pi/2.0; 619 else 620 theta = 3.0*pi/2.0; 621 } 622 else 623 { 624 if (rand2<0.5) 625 theta = 0; 626 else 627 theta = pi; 628 } 629 G4double cosBeta = std::cos(theta); 517 630 G4double sinBeta = std::sqrt(1-cosBeta*cosBeta); 518 631 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPolarizedRayleigh.cc
r819 r961 25 25 // 26 26 // $Id: G4LowEnergyPolarizedRayleigh.cc,v 1.7 2006/06/29 19:40:27 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyRayleigh.cc
r819 r961 27 27 // 28 28 // $Id: G4LowEnergyRayleigh.cc,v 1.37 2006/06/29 19:40:29 gunter Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 30 30 // 31 31 // Author: A. Forti -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlung.cc
r819 r961 25 25 // 26 26 // $Id: G4PenelopeBremsstrahlung.cc,v 1.18 2006/06/29 19:40:35 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungAngular.cc
r819 r961 25 25 // 26 26 // $Id: G4PenelopeBremsstrahlungAngular.cc,v 1.7 2006/06/29 19:40:37 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungContinuous.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1. 9 2006/06/29 19:40:39 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1.11 2008/12/15 09:23:06 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -------------------------------------------------------------- … … 40 40 // 19 Mar 2003 L. Pandola Bugs fixed 41 41 // 17 Mar 2004 L. Pandola Removed unnecessary calls to std::pow(a,b) 42 // 09 Dec 2008 L. Pandola Update ReadFile() in a way to make explicit use of the units of 43 // measurement. Also some cosmetics to improve readibility. 42 44 //---------------------------------------------------------------- 43 45 … … 51 53 #include <sstream> 52 54 53 G4PenelopeBremsstrahlungContinuous::G4PenelopeBremsstrahlungContinuous (G4int Zed,G4double taglio,G4double e1, 55 G4PenelopeBremsstrahlungContinuous::G4PenelopeBremsstrahlungContinuous (G4int Zed,G4double cut, 56 G4double e1, 54 57 G4double e2, 55 58 const G4String name) : 56 Zmat(Zed),tCut( taglio),MinE(e1),MaxE(e2),partName(name)59 Zmat(Zed),tCut(cut),MinE(e1),MaxE(e2),partName(name) 57 60 { 58 61 //Construct extended energy table … … 71 74 } 72 75 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 73 77 74 78 G4PenelopeBremsstrahlungContinuous::~G4PenelopeBremsstrahlungContinuous() 75 { 76 } 79 {;} 80 81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 77 82 78 83 void G4PenelopeBremsstrahlungContinuous::LoadFromFile() … … 92 97 G4String dirFile = pathString + "/penelope/" + name; 93 98 std::ifstream file(dirFile); 94 std::filebuf* lsdp = file.rdbuf(); 95 if (!(lsdp->is_open())) 99 if (!file.is_open()) 96 100 { 97 101 G4String excep = "G4PenelopeBremsstrahlungContinuous - data file " + name + " not found!"; 98 102 G4Exception(excep); 99 103 } 100 G4double a1; 101 for (size_t i=0;i<NumberofEPoints;i++){ 102 file >> a1; 103 Energies[i]=a1; 104 for (size_t j=0;j<NumberofKPoints;j++){ 104 G4double a1 = -1.; 105 for (size_t i=0;i<NumberofEPoints;i++) 106 { 105 107 file >> a1; 106 ReducedCS[i][j]=a1/millibarn; //coversion present in Penelope source 108 //1) reads energy in MeV 109 Energies[i]=a1*MeV; 110 //2) read 32 cross sections in cm2 111 for (size_t j=0;j<NumberofKPoints;j++){ 112 file >> a1; 113 ReducedCS[i][j]=a1*cm2; 114 } 115 //3) read the total cross section, in cm2 116 file >> a1; 117 TotalCS[i]=a1*cm2; 118 // Check closing item 119 file >> a1; 120 if (a1 != ((G4double) -1)) 121 { 122 G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file " 123 + name; 124 G4Exception(excep); 125 } 107 126 } 108 file >> a1;109 TotalCS[i]=a1/millibarn; //conversion present in Penelope source110 file >> a1;111 if (a1 != ((G4double) -1)){112 G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file "+ name;113 G4Exception(excep);114 }115 }116 117 127 file.close(); 118 128 } 129 130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 119 131 120 132 void G4PenelopeBremsstrahlungContinuous::PrepareInterpolationTable() … … 138 150 139 151 delete interpolator; 140 G4double Fact = ( millibarn/cm2)*(Energies[i]+electron_mass_c2)*(1.0/fine_structure_const)/152 G4double Fact = (Energies[i]+electron_mass_c2)*(1.0/fine_structure_const)*millibarn/ 141 153 (classic_electr_radius*classic_electr_radius*(Energies[i]+2.0*electron_mass_c2)); 142 154 G4double Normalization = TotalCS[i]/(Rsum*Fact); 143 G4double TST = std::abs(Normalization-1 00.0);155 G4double TST = std::abs(Normalization-1.0); 144 156 if (TST > 1.0) { 145 157 G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file"; … … 181 193 } 182 194 183 //Forse questa roba (e Pbcut come membro privato) non serve 184 // G4double PDF[NumberofKPoints]; 185 186 // for (i=0;i<NumberofExtendedEGrid;i++){ 187 // for (j=0;j<NumberofKPoints;j++){ 188 // PDF[j]=p0[i][j]; 189 // } 190 // G4double Xc=0; 191 // if (i<(NumberofExtendedEGrid-1)){ 192 // Xc=tCut/std::exp(ExtendedLogEnergy[i+1]); 193 // } 194 // else 195 // { 196 // Xc=tCut/std::exp(ExtendedLogEnergy[NumberofExtendedEGrid-1]); 197 // } 195 //All this stuff might be useful later on 196 /* 197 G4double PDF[NumberofKPoints]; 198 199 for (i=0;i<NumberofExtendedEGrid;i++){ 200 for (j=0;j<NumberofKPoints;j++){ 201 PDF[j]=p0[i][j]; 202 } 203 G4double Xc=0; 204 if (i<(NumberofExtendedEGrid-1)){ 205 Xc=tCut/std::exp(ExtendedLogEnergy[i+1]); 206 } 207 else 208 { 209 Xc=tCut/std::exp(ExtendedLogEnergy[NumberofExtendedEGrid-1]); 210 } 198 211 199 // G4PenelopeInterpolator* interpolator3 = new G4PenelopeInterpolator(pK,PDF,NumberofKPoints); 200 // Pbcut[i]=interpolator3->CalculateMomentum(Xc,-1); 201 // delete interpolator3; 202 // } 203 204 } 212 G4PenelopeInterpolator* interpolator3 = new G4PenelopeInterpolator(pK,PDF,NumberofKPoints); 213 Pbcut[i]=interpolator3->CalculateMomentum(Xc,-1); 214 delete interpolator3; 215 } 216 */ 217 218 } 219 220 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 205 221 206 G4double G4PenelopeBremsstrahlungContinuous::CalculateStopping(G4double e 1)222 G4double G4PenelopeBremsstrahlungContinuous::CalculateStopping(G4double energy) 207 223 //Stopping power expressed in MeV/mm*2 208 224 { 209 G4double Xel=std::max(std::log(e 1),ExtendedLogEnergy[0]);225 G4double Xel=std::max(std::log(energy),ExtendedLogEnergy[0]); 210 226 G4double Xe=1.0+(Xel-ExtendedLogEnergy[0])*DLFC; 211 227 G4int Ke = (G4int) Xe; … … 213 229 214 230 //Global x-section factor 215 G4double Fact=Zmat*Zmat*(e 1+electron_mass_c2)*(e1+electron_mass_c2)/(e1*(e1+2.0*electron_mass_c2))216 *(millibarn/cm2);217 Fact =Fact*PositronCorrection(e1);231 G4double Fact=Zmat*Zmat*(energy+electron_mass_c2)*(energy+electron_mass_c2)/ 232 (energy*(energy+2.0*electron_mass_c2)); 233 Fact *= PositronCorrection(energy); 218 234 219 235 //Moments of the scaled bremss x-section 220 G4double wcre = tCut/e 1;236 G4double wcre = tCut/energy; 221 237 G4double pY[NumberofKPoints]; 222 238 G4double pK[NumberofKPoints] = {1.0e-12,0.05,0.075,0.1,0.125,0.15,0.2,0.25, … … 230 246 G4PenelopeInterpolator* interpolator1 = new G4PenelopeInterpolator(pK,pY,NumberofKPoints); 231 247 G4double XS1A = interpolator1->CalculateMomentum(wcre,0); 232 G4double XS2A = interpolator1->CalculateMomentum(wcre,1);233 delete interpolator1;234 248 for (size_t k=0;k<NumberofKPoints;k++){ 235 249 pY[k] = p0[std::min(Ke+1,(G4int) NumberofExtendedEGrid-1)][k]; … … 237 251 G4PenelopeInterpolator* interpolator2 = new G4PenelopeInterpolator (pK,pY,NumberofKPoints); 238 252 G4double XS1B = interpolator2->CalculateMomentum(wcre,0); 239 G4double XS2B = interpolator2->CalculateMomentum(wcre,1); 253 254 G4double XS1 = ((1.0-Xek)*XS1A+Xek*XS1B)*Fact*energy; //weighted mean between the energy bin of the grid 255 256 //This is the 2nd momentum (straggling cross section). It might be useful later on 257 /* 258 G4double XS2A = interpolator1->CalculateMomentum(wcre,1); 259 G4double XS2 = ((1.0-Xek)*XS2A+Xek*XS2B)*Fact*energy*energy; 260 G4double XS2B = interpolator2->CalculateMomentum(wcre,1); 261 */ 262 263 delete interpolator1; 240 264 delete interpolator2; 241 242 G4double XS1 = ((1.0-Xek)*XS1A+Xek*XS1B)*Fact*e1; //weighted mean between the energy bin of the grid 243 G4double XS2 = ((1.0-Xek)*XS2A+Xek*XS2B)*Fact*e1*e1; //straggling cross section (2nd momentum); 244 //Il secondo momento XS2 potrebbe tornare utile in seguito 245 246 //XS1 is given in MeV*cm2, as in Penelope, but it must be converted in MeV*mm2 247 XS1=XS1*cm2/mm2; 248 //XS2 is given in MeV2*cm2, as in Penelope, but it must be converted in MeV2*mm2 249 XS2=XS2*cm2/mm2; 250 251 //Deve includere anche le famose correzioni per tenere conto 252 //che la sezione d'urto varia sullo step! 253 //Il valore che tira fuori va nella tabella e non viene piu' modificato 265 254 266 return XS1; 255 267 } 256 268 257 G4double G4PenelopeBremsstrahlungContinuous::PositronCorrection(G4double en) 269 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 270 271 G4double G4PenelopeBremsstrahlungContinuous::PositronCorrection(G4double energy) 258 272 { 259 273 const G4double Coeff[7]={-1.2359e-01,6.1274e-2,-3.1516e-2,7.7446e-3,-1.0595e-3, 260 274 7.0568e-5,-1.8080e-6}; 261 G4double T=0;262 275 G4double correct=0; 263 276 if (partName == "e-") { … … 265 278 } 266 279 else if (partName == "e+"){ 267 T=std::log(1+((1e6*en)/(Zmat*Zmat*electron_mass_c2)));280 G4double T=std::log(1+((1e6*energy)/(Zmat*Zmat*electron_mass_c2))); 268 281 for (G4int i=0;i<7;i++){ 269 282 correct += Coeff[i]*std::pow(T,i+1); … … 272 285 return correct; 273 286 } 274 else //ne ' elettroni ne' positroni...exception287 else //neither electrons nor positrons...exception 275 288 { 276 289 G4String excep = "G4PenelopeBremmstrahlungContinuous: the particle is not e- nor e+!"; -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeCompton.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeCompton.cc,v 1. 26 2006/06/29 19:40:41 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4PenelopeCompton.cc,v 1.33 2008/06/03 15:44:25 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // Author: Luciano Pandola … … 45 45 // 17 Mar 2004 L.Pandola Removed unnecessary calls to std::pow(a,b) 46 46 // 18 Mar 2004 L.Pandola Use of std::map (code review) 47 // 26 Mar 2008 L.Pandola Add boolean flag to control atomic de-excitation 48 // 27 Mar 2008 L.Pandola Re-named some variables to improve readability, 49 // and check for strict energy conservation 50 // 03 Jun 2008 L.Pandola Added further protection against non-conservation 51 // of energy: it may happen because ionization energy 52 // from de-excitation manager and from Penelope internal 53 // database do not match (difference is <10 eV, but may 54 // give a e- with negative kinetic energy). 47 55 // 48 56 // ------------------------------------------------------------------- … … 86 94 ZForIntegration(1), 87 95 nBins(200), 88 cutForLowEnergySecondaryPhotons(250.0*eV) 96 cutForLowEnergySecondaryPhotons(250.0*eV), 97 fUseAtomicDeexcitation(true) 89 98 { 90 99 if (lowEnergyLimit < intrinsicLowEnergyLimit || … … 118 127 delete rangeTest; 119 128 120 for (size_t i 1=0;i1<matCrossSections->size();i1++)121 { 122 delete (*matCrossSections)[i 1];129 for (size_t i=0;i<matCrossSections->size();i++) 130 { 131 delete (*matCrossSections)[i]; 123 132 } 124 133 … … 140 149 G4DataVector energyVector; 141 150 G4double dBin = std::log10(highEnergyLimit/lowEnergyLimit)/nBins; 142 G4int i; 143 for (i=0;i<nBins;i++) 151 for (G4int i=0;i<nBins;i++) 144 152 { 145 153 energyVector.push_back(std::pow(10.,std::log10(lowEnergyLimit)+i*dBin)); … … 150 158 G4VDataSetAlgorithm* algo = new G4LogLogInterpolation(); 151 159 152 size_t nOfBins = energyVector.size();153 size_t bin=0;160 //size_t nOfBins = energyVector.size(); 161 //size_t bin=0; 154 162 155 163 G4DataVector* energies; … … 158 166 matCrossSections = new std::vector<G4VEMDataSet*>; 159 167 160 161 G4int m; 162 for (m=0; m<nMaterials; m++) 168 for (G4int m=0; m<nMaterials; m++) 163 169 { 164 170 const G4Material* material= (*materialTable)[m]; … … 169 175 G4VEMDataSet* setForMat = new G4CompositeEMDataSet(algo,1.,1.); 170 176 171 for ( i=0; i<nElements; i++) {177 for (G4int i=0; i<nElements; i++) { 172 178 173 179 G4int Z = (G4int) (*elementVector)[i]->GetZ(); … … 178 184 179 185 180 for ( bin=0; bin<nOfBins; bin++)186 for (size_t bin=0; bin<energyVector.size(); bin++) 181 187 { 182 188 G4double e = energyVector[bin]; … … 200 206 201 207 202 for ( m=0; m<nMaterials; m++)208 for (G4int m=0; m<nMaterials; m++) 203 209 { 204 210 energies = new G4DataVector; … … 206 212 const G4Material* material= (*materialTable)[m]; 207 213 material= (*materialTable)[m]; 208 for ( bin=0; bin<nOfBins; bin++)214 for (size_t bin=0; bin<energyVector.size(); bin++) 209 215 { 210 216 G4double energy = energyVector[bin]; … … 254 260 const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple(); 255 261 const G4Material* material = couple->GetMaterial(); 262 256 263 G4int Z = SelectRandomAtomForCompton(material,photonEnergy0); 257 264 const G4int nmax = 64; … … 274 281 a1 = std::log(ki2); 275 282 a2 = a1+2.0*ki*(1.0+ki)/(ki2*ki2); 283 //If the incoming photon is above 5 MeV, the quicker approach based on the 284 //pure Klein-Nishina formula is used 276 285 if (photonEnergy0 > 5*MeV) 277 286 { … … 305 314 }while((epsilon*photonEnergy0-photonEnergy0+ionEnergy) >0); 306 315 } 307 308 316 else //photonEnergy0<5 MeV 309 317 { … … 359 367 if (pzomc > 0) 360 368 { 361 rn[i] = 1.0-0.5*std::exp(0.5-(std::sqrt(0.5)+std::sqrt(2.0)*pzomc)*(std::sqrt(0.5)+std::sqrt(2.0)*pzomc)); 369 rn[i] = 1.0-0.5*std::exp(0.5-(std::sqrt(0.5)+std::sqrt(2.0)*pzomc)* 370 (std::sqrt(0.5)+std::sqrt(2.0)*pzomc)); 362 371 } 363 372 else 364 373 { 365 rn[i] = 0.5*std::exp(0.5-(std::sqrt(0.5)-std::sqrt(2.0)*pzomc)*(std::sqrt(0.5)-std::sqrt(2.0)*pzomc)); 374 rn[i] = 0.5*std::exp(0.5-(std::sqrt(0.5)-std::sqrt(2.0)*pzomc)* 375 (std::sqrt(0.5)-std::sqrt(2.0)*pzomc)); 366 376 } 367 377 S = S + occupNb*rn[i]; … … 431 441 } 432 442 433 434 443 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta); 435 444 G4double phi = twopi * G4UniformRand() ; … … 456 465 457 466 458 // Kinematics of the scattered electron 459 460 467 // Kinematics of the scattered electron 461 468 G4double diffEnergy = photonEnergy0*(1-epsilon); 462 469 ionEnergy = (*(ionizationEnergy->find(Z)->second))[iosc]; 463 //G4double eKineticEnergy = diffEnergy - ionEnergy;464 470 G4double Q2 = photonEnergy0*photonEnergy0+photonEnergy1*(photonEnergy1-2.0*photonEnergy0*cosTheta); 465 471 G4double cosThetaE; //scattering angle for the electron … … 473 479 } 474 480 G4double sinThetaE = std::sqrt(1-cosThetaE*cosThetaE); 475 476 477 481 //initialize here, then check photons created by Atomic-Deexcitation, and the final state e- 482 G4int nbOfSecondaries = 0; 483 484 std::vector<G4DynamicParticle*>* photonVector=0; 485 478 486 const G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance(); 479 487 const G4AtomicShell* shell = transitionManager->Shell(Z,iosc); 480 488 G4double bindingEnergy = shell->BindingEnergy(); 481 489 G4int shellId = shell->ShellId(); 482 //G4cout << bindingEnergy/keV << " " << ionEnergy/keV << " keV" << G4endl; 483 ionEnergy = std::max(bindingEnergy,ionEnergy); //protection against energy non-conservation 484 G4double eKineticEnergy = diffEnergy - ionEnergy; 485 486 size_t nTotPhotons=0; 487 G4int nPhotons=0; 488 489 const G4ProductionCutsTable* theCoupleTable= 490 G4ProductionCutsTable::GetProductionCutsTable(); 491 size_t indx = couple->GetIndex(); 492 G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[indx]; 493 cutg = std::min(cutForLowEnergySecondaryPhotons,cutg); 494 495 G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx]; 496 cute = std::min(cutForLowEnergySecondaryPhotons,cute); 497 498 std::vector<G4DynamicParticle*>* photonVector=0; 499 G4DynamicParticle* aPhoton; 500 G4AtomicDeexcitation deexcitationManager; 501 502 if (Z>5 && (ionEnergy > cutg || ionEnergy > cute)) 503 { 504 photonVector = deexcitationManager.GenerateParticles(Z,shellId); 505 nTotPhotons = photonVector->size(); 506 for (size_t k=0;k<nTotPhotons;k++){ 507 aPhoton = (*photonVector)[k]; 508 if (aPhoton) 509 { 510 G4double itsCut = cutg; 511 if (aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cute; 512 G4double itsEnergy = aPhoton->GetKineticEnergy(); 513 if (itsEnergy > itsCut && itsEnergy <= ionEnergy) 490 G4double ionEnergyInPenelopeDatabase = ionEnergy; 491 ionEnergy = std::max(bindingEnergy,ionEnergyInPenelopeDatabase); //protection against energy non-conservation 492 493 G4double eKineticEnergy = diffEnergy - ionEnergy; //subtract the excitation energy. If not emitted by fluorescence, 494 //the ionization energy is deposited as local energy deposition 495 G4double localEnergyDeposit = ionEnergy; 496 G4double energyInFluorescence = 0.; //testing purposes only 497 498 if (eKineticEnergy < 0) 499 { 500 //It means that there was some problem/mismatch between the two databases. Try to make it work 501 //In this case available Energy (diffEnergy) < ionEnergy 502 //Full residual energy is deposited locally 503 localEnergyDeposit = diffEnergy; 504 eKineticEnergy = 0.0; 505 } 506 507 //the local energy deposit is what remains: part of this may be spent for fluorescence. 508 509 if (fUseAtomicDeexcitation) 510 { 511 G4int nPhotons=0; 512 513 const G4ProductionCutsTable* theCoupleTable= 514 G4ProductionCutsTable::GetProductionCutsTable(); 515 size_t indx = couple->GetIndex(); 516 517 G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[indx]; 518 cutg = std::max(cutForLowEnergySecondaryPhotons,cutg); 519 520 G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx]; 521 cute = std::max(cutForLowEnergySecondaryPhotons,cute); 522 523 G4DynamicParticle* aPhoton; 524 G4AtomicDeexcitation deexcitationManager; 525 526 if (Z>5 && (localEnergyDeposit > cutg || localEnergyDeposit > cute)) 527 { 528 photonVector = deexcitationManager.GenerateParticles(Z,shellId); 529 for (size_t k=0;k<photonVector->size();k++){ 530 aPhoton = (*photonVector)[k]; 531 if (aPhoton) 514 532 { 515 nPhotons++; 516 ionEnergy -= itsEnergy; 517 } 518 else 519 { 520 delete aPhoton; 521 (*photonVector)[k]=0; 533 G4double itsCut = cutg; 534 if (aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cute; 535 G4double itsEnergy = aPhoton->GetKineticEnergy(); 536 if (itsEnergy > itsCut && itsEnergy <= localEnergyDeposit) 537 { 538 nPhotons++; 539 localEnergyDeposit -= itsEnergy; 540 energyInFluorescence += itsEnergy; 541 } 542 else 543 { 544 delete aPhoton; 545 (*photonVector)[k]=0; 546 } 522 547 } 523 548 } 524 }525 }526 G4double energyDeposit =ionEnergy; //il deposito locale e' quello che rimane527 G4int nbOfSecondaries=nPhotons; 528 549 } 550 nbOfSecondaries=nPhotons; 551 } 552 553 529 554 // Generate the electron only if with large enough range w.r.t. cuts and safety 530 555 G4double safety = aStep.GetPostStepPoint()->GetSafety(); 531 556 G4DynamicParticle* electron = 0; 532 if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety)) 557 if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety) && 558 eKineticEnergy>cutForLowEnergySecondaryPhotons) 533 559 { 534 560 G4double xEl = sinThetaE * std::cos(phi+pi); … … 543 569 else 544 570 { 545 546 energyDeposit += eKineticEnergy; 571 localEnergyDeposit += eKineticEnergy; 547 572 } 548 573 549 574 aParticleChange.SetNumberOfSecondaries(nbOfSecondaries); 550 575 if (electron) aParticleChange.AddSecondary(electron); 551 for (size_t ll=0;ll<nTotPhotons;ll++) 552 { 553 aPhoton = (*photonVector)[ll]; 554 if (aPhoton) aParticleChange.AddSecondary(aPhoton); 576 577 //This block below is executed only if there is at least one secondary photon produced by 578 //AtomicDeexcitation 579 if (photonVector) 580 { 581 for (size_t ll=0;ll<photonVector->size();ll++) 582 { 583 if ((*photonVector)[ll]) aParticleChange.AddSecondary((*photonVector)[ll]); 584 } 555 585 } 556 586 delete photonVector; 557 if ( energyDeposit < 0)587 if (localEnergyDeposit < 0) 558 588 { 559 589 G4cout << "WARNING-" 560 590 << "G4PenelopeCompton::PostStepDoIt - Negative energy deposit" 561 591 << G4endl; 562 energyDeposit=0; 563 } 564 aParticleChange.ProposeLocalEnergyDeposit(energyDeposit); 565 592 localEnergyDeposit=0.; 593 } 594 aParticleChange.ProposeLocalEnergyDeposit(localEnergyDeposit); 595 596 597 if (verboseLevel > 1) 598 { 599 G4cout << "-----------------------------------------------------------" << G4endl; 600 G4cout << "Energy balance from G4PenelopeCompton" << G4endl; 601 G4cout << "Incoming photon energy: " << photonEnergy0/keV << " keV" << G4endl; 602 G4cout << "-----------------------------------------------------------" << G4endl; 603 G4cout << "Scattered photon: " << photonEnergy1/keV << " keV" << G4endl; 604 G4double electronEnergy = 0.; 605 if (electron) 606 electronEnergy = eKineticEnergy; 607 G4cout << "Scattered electron " << electronEnergy/keV << " keV" << G4endl; 608 G4cout << "Fluorescence: " << energyInFluorescence/keV << " keV" << G4endl; 609 G4cout << "Local energy deposit " << localEnergyDeposit/keV << " keV" << G4endl; 610 G4cout << "Total final state: " << (photonEnergy1+electronEnergy+energyInFluorescence+localEnergyDeposit)/keV << 611 " keV" << G4endl; 612 G4cout << "-----------------------------------------------------------" << G4endl; 613 } 566 614 567 615 return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep); -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeIonisation.cc
r819 r961 25 25 // 26 26 // $Id: G4PenelopeIonisation.cc,v 1.19 2006/06/29 19:40:49 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopePhotoElectric.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4PenelopePhotoElectric.cc,v 1.1 2 2006/06/29 19:40:51 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4PenelopePhotoElectric.cc,v 1.13 2009/01/08 09:42:54 pandola Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: L. Pandola … … 37 37 // 31 May 2005 L. Pandola Added Sauter formula for the sampling of 38 38 // the electron direction 39 // 08 Jan 2009 L. Pandola Check shell index to avoid mismatch between 40 // the Penelope cross section database and the 41 // G4AtomicTransitionManager database. It suppresses 42 // a warning from G4AtomicTransitionManager only. 43 // Results are unchanged. 39 44 // -------------------------------------------------------------- 40 45 … … 146 151 // Retrieve the corresponding identifier and binding energy of the selected shell 147 152 const G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance(); 153 154 //The number of shell cross section possibly reported in the Penelope database 155 //might be different from the number of shells in the G4AtomicTransitionManager 156 //(namely, Penelope may contain more shell, especially for very light elements). 157 //In order to avoid a warning message from the G4AtomicTransitionManager, I 158 //add this protection. Results are anyway changed, because when G4AtomicTransitionManager 159 //has a shellID>maxID, it sets the shellID to the last valid shell. 160 size_t numberOfShells = (size_t) transitionManager->NumberOfShells(Z); 161 if (shellIndex >= numberOfShells) 162 shellIndex = numberOfShells-1; 163 148 164 const G4AtomicShell* shell = transitionManager->Shell(Z,shellIndex); 149 165 G4double bindingEnergy = shell->BindingEnergy(); -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeRayleigh.cc
r819 r961 27 27 // 28 28 // $Id: G4PenelopeRayleigh.cc,v 1.15 2007/09/03 09:43:14 pandola Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 30 30 // 31 31 // Author: L. Pandola (luciano.pandola@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4RangeTest.cc
r819 r961 26 26 // 27 27 // $Id: G4RangeTest.cc,v 1.8 2006/06/29 19:41:03 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4SemiLogInterpolation.cc
r819 r961 26 26 // 27 27 // $Id: G4SemiLogInterpolation.cc,v 1.6 2006/06/29 19:41:18 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4ShellData.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4ShellData.cc,v 1. 8 2006/06/29 19:41:21 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4ShellData.cc,v 1.10 2008/03/17 13:40:53 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 38 38 #include "G4ShellData.hh" 39 39 #include "G4DataVector.hh" 40 #include "G4SystemOfUnits.hh" 40 41 #include <fstream> 41 42 #include <sstream> 43 #include <numeric> 44 #include <algorithm> 45 #include <valarray> 46 #include <functional> 47 #include "Randomize.hh" 48 49 // The following deprecated header is included because <functional> seems not to be found on MGP's laptop 50 //#include "function.h" 42 51 43 52 // Constructor 44 53 45 G4ShellData::G4ShellData(G4int minZ, G4int maxZ )46 : zMin(minZ), zMax(maxZ) 47 { }54 G4ShellData::G4ShellData(G4int minZ, G4int maxZ, G4bool isOccupancy) 55 : zMin(minZ), zMax(maxZ), occupancyData(isOccupancy) 56 { } 48 57 49 58 // Destructor 50 59 G4ShellData::~G4ShellData() 51 60 { 52 std::map<G4int,G4DataVector*,std::less<G4int> >::iterator pos; 53 61 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos; 54 62 for (pos = idMap.begin(); pos != idMap.end(); ++pos) 55 63 { 56 G4DataVector* dataSet = (*pos).second;64 std::vector<G4double>* dataSet = (*pos).second; 57 65 delete dataSet; 58 66 } 59 for (pos = bindingMap.begin(); pos != bindingMap.end(); ++pos) 60 { 61 G4DataVector* dataSet = (*pos).second; 67 68 std::map<G4int,G4DataVector*,std::less<G4int> >::iterator pos2; 69 for (pos2 = bindingMap.begin(); pos2 != bindingMap.end(); ++pos2) 70 { 71 G4DataVector* dataSet = (*pos2).second; 62 72 delete dataSet; 73 } 74 75 if (occupancyData) 76 { 77 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos3; 78 for (pos3 = occupancyPdfMap.begin(); pos3 != occupancyPdfMap.end(); ++pos3) 79 { 80 std::vector<G4double>* dataSet = (*pos3).second; 81 delete dataSet; 82 } 63 83 } 64 84 } … … 78 98 79 99 80 const G4DataVector& G4ShellData::ShellIdVector(G4int Z) const 81 { 82 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator pos; 83 if (Z < zMin || Z > zMax) 84 G4Exception("G4ShellData::ShellIdVector - Z outside boundaries"); 100 const std::vector<G4double>& G4ShellData::ShellIdVector(G4int Z) const 101 { 102 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator pos; 103 if (Z < zMin || Z > zMax) G4Exception("G4ShellData::ShellIdVector - Z outside boundaries"); 85 104 pos = idMap.find(Z); 86 G4DataVector* dataSet = (*pos).second;105 std::vector<G4double>* dataSet = (*pos).second; 87 106 return *dataSet; 88 107 } 89 108 109 110 const std::vector<G4double>& G4ShellData::ShellVector(G4int Z) const 111 { 112 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator pos; 113 if (Z < zMin || Z > zMax) G4Exception("G4ShellData::ShellVector - Z outside boundaries"); 114 pos = occupancyPdfMap.find(Z); 115 std::vector<G4double>* dataSet = (*pos).second; 116 return *dataSet; 117 } 118 119 90 120 G4int G4ShellData::ShellId(G4int Z, G4int shellIndex) const 91 121 { … … 94 124 if (Z >= zMin && Z <= zMax) 95 125 { 96 std::map<G4int, G4DataVector*,std::less<G4int> >::const_iterator pos;126 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator pos; 97 127 pos = idMap.find(Z); 98 128 if (pos!= idMap.end()) 99 129 { 100 G4DataVectordataSet = *((*pos).second);130 std::vector<G4double> dataSet = *((*pos).second); 101 131 G4int nData = dataSet.size(); 102 132 if (shellIndex >= 0 && shellIndex < nData) … … 108 138 return n; 109 139 } 140 141 142 G4double G4ShellData::ShellOccupancyProbability(G4int Z, G4int shellIndex) const 143 { 144 G4double prob = -1.; 145 146 if (Z >= zMin && Z <= zMax) 147 { 148 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator pos; 149 pos = idMap.find(Z); 150 if (pos!= idMap.end()) 151 { 152 std::vector<G4double> dataSet = *((*pos).second); 153 G4int nData = dataSet.size(); 154 if (shellIndex >= 0 && shellIndex < nData) 155 { 156 prob = dataSet[shellIndex]; 157 } 158 } 159 } 160 return prob; 161 } 162 110 163 111 164 … … 140 193 << G4endl; 141 194 G4int nSh = nShells[Z-1]; 142 std::map<G4int, G4DataVector*,std::less<G4int> >::const_iterator posId;195 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator posId; 143 196 posId = idMap.find(Z); 144 G4DataVector* ids = (*posId).second;197 std::vector<G4double>* ids = (*posId).second; 145 198 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posE; 146 199 posE = bindingMap.find(Z); … … 149 202 { 150 203 G4int id = (G4int) (*ids)[i]; 151 G4double e = (*energies)[i] / MeV; 152 G4cout << i <<") Shell id: " << id 153 << " - Binding energy = " 154 << e << " MeV " << G4endl; 204 G4double e = (*energies)[i] / keV; 205 G4cout << i << ") "; 206 207 if (occupancyData) 208 { 209 G4cout << " Occupancy: "; 210 } 211 else 212 { 213 G4cout << " Shell id: "; 214 } 215 G4cout << id << " - Binding energy = " 216 << e << " keV "; 217 if (occupancyData) 218 { 219 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator posOcc; 220 posOcc = occupancyPdfMap.find(Z); 221 std::vector<G4double> probs = *((*posOcc).second); 222 G4double prob = probs[i]; 223 G4cout << "- Probability = " << prob; 224 } 225 G4cout << G4endl; 155 226 } 156 227 G4cout << "-------------------------------------------------" … … 196 267 G4int Z = 1; 197 268 G4DataVector* energies = new G4DataVector; 198 G4DataVector* ids = new G4DataVector;269 std::vector<G4double>* ids = new std::vector<G4double>; 199 270 200 271 do { … … 211 282 nShells.push_back(n); 212 283 // Start of new shell data set 213 ids = new G4DataVector;284 ids = new std::vector<G4double>; 214 285 energies = new G4DataVector; 215 286 Z++; … … 246 317 } while (a != -2); // end of file 247 318 file.close(); 248 } 249 319 320 // For Doppler broadening: the data set contains shell occupancy and binding energy for each shell 321 // Build additional map with probability for each shell based on its occupancy 322 323 if (occupancyData) 324 { 325 // Build cumulative from raw shell occupancy 326 327 for (G4int Z=zMin; Z <= zMax; Z++) 328 { 329 std::vector<G4double> occupancy = ShellIdVector(Z); 330 331 std::vector<G4double>* prob = new std::vector<G4double>; 332 G4double scale = 1. / G4double(Z); 333 334 prob->push_back(occupancy[0] * scale); 335 for (size_t i=1; i<occupancy.size(); i++) 336 { 337 prob->push_back(occupancy[i]*scale + (*prob)[i-1]); 338 } 339 occupancyPdfMap[Z] = prob; 340 341 /* 342 G4double scale = 1. / G4double(Z); 343 // transform((*prob).begin(),(*prob).end(),(*prob).begin(),bind2nd(multiplies<G4double>(),scale)); 344 345 for (size_t i=0; i<occupancy.size(); i++) 346 { 347 (*prob)[i] *= scale; 348 } 349 */ 350 } 351 } 352 } 353 354 355 G4int G4ShellData::SelectRandomShell(G4int Z) const 356 { 357 if (Z < zMin || Z > zMax) G4Exception("G4ShellData::RandomSelect - Z outside boundaries"); 358 359 G4int shellIndex = 0; 360 std::vector<G4double> prob = ShellVector(Z); 361 G4double random = G4UniformRand(); 362 363 // std::vector<G4double>::const_iterator pos; 364 // pos = lower_bound(prob.begin(),prob.end(),random); 365 366 // Binary search the shell with probability less or equal random 367 368 G4int nShells = NumberOfShells(Z); 369 G4int upperBound = nShells; 370 371 while (shellIndex <= upperBound) 372 { 373 G4int midShell = (shellIndex + upperBound) / 2; 374 if ( random < prob[midShell] ) 375 upperBound = midShell - 1; 376 else 377 shellIndex = midShell + 1; 378 } 379 if (shellIndex >= nShells) shellIndex = nShells - 1; 380 381 return shellIndex; 382 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4ShellEMDataSet.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4ShellEMDataSet.cc,v 1.1 5 2007/10/15 08:36:35pia Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4ShellEMDataSet.cc,v 1.16 2008/03/10 15:07:41 pia Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 32 32 // History: 33 33 // ----------- 34 // 1 Aug 2001 MGP Created34 // 1 Aug 2001 MGP Created 35 35 // 09.10.01 V.Ivanchenko Add case z=0 36 // 9 Mar 2008 MGP Cleaned up unreadable code modified by former developer 37 // (Further clean-up needed) 36 38 // 37 39 // ------------------------------------------------------------------- … … 44 46 45 47 46 G4ShellEMDataSet::G4ShellEMDataSet(G4int argZ, G4VDataSetAlgorithm* argAlgorithm,47 G4double argUnitEnergies,48 G4double argUnitData)48 G4ShellEMDataSet::G4ShellEMDataSet(G4int zeta, G4VDataSetAlgorithm* algo, 49 G4double eUnit, 50 G4double dataUnit) 49 51 : 50 z(argZ), 51 algorithm(argAlgorithm), 52 unitEnergies(argUnitEnergies), 53 unitData(argUnitData) 54 { 55 if (algorithm == 0) 56 G4Exception("G4ShellEMDataSet::G4ShellEMDataSet - interpolation == 0"); 52 z(zeta), 53 algorithm(algo), 54 unitEnergies(eUnit), 55 unitData(dataUnit) 56 { 57 if (algorithm == 0) G4Exception("G4ShellEMDataSet::G4ShellEMDataSet - interpolation == 0"); 57 58 } 58 59 … … 61 62 { 62 63 CleanUpComponents(); 63 64 if (algorithm) 65 delete algorithm; 66 } 67 68 69 G4double G4ShellEMDataSet::FindValue(G4double argEnergy, G4int /* argComponentId */) const 64 if (algorithm) delete algorithm; 65 } 66 67 68 G4double G4ShellEMDataSet::FindValue(G4double energy, G4int /* componentId */) const 70 69 { 71 70 // Returns the sum over the shells corresponding to e … … 75 74 std::vector<G4VEMDataSet *>::const_iterator end(components.end()); 76 75 77 while (i !=end)78 { 79 value +=(*i)->FindValue(argEnergy);76 while (i != end) 77 { 78 value += (*i)->FindValue(energy); 80 79 i++; 81 80 } … … 87 86 void G4ShellEMDataSet::PrintData(void) const 88 87 { 89 const size_t n (NumberOfComponents());88 const size_t n = NumberOfComponents(); 90 89 91 90 G4cout << "The data set has " << n << " components" << G4endl; 92 91 G4cout << G4endl; 93 92 94 size_t i (0);95 96 while (i <n)93 size_t i = 0; 94 95 while (i < n) 97 96 { 98 97 G4cout << "--- Component " << i << " ---" << G4endl; … … 103 102 104 103 105 void G4ShellEMDataSet :: SetEnergiesData(G4DataVector* argEnergies,106 G4DataVector* argData,107 G4int argComponentId)108 { 109 G4VEMDataSet * component(components[argComponentId]);104 void G4ShellEMDataSet::SetEnergiesData(G4DataVector* energies, 105 G4DataVector* data, 106 G4int componentId) 107 { 108 G4VEMDataSet* component = components[componentId]; 110 109 111 110 if (component) 112 111 { 113 component->SetEnergiesData( argEnergies, argData, 0);112 component->SetEnergiesData(energies, data, 0); 114 113 return; 115 114 } 116 115 117 116 std::ostringstream message; 118 message << "G4ShellEMDataSet::SetEnergiesData - component " << argComponentId << " not found";117 message << "G4ShellEMDataSet::SetEnergiesData - component " << componentId << " not found"; 119 118 120 119 G4Exception(message.str().c_str()); … … 122 121 123 122 124 G4bool G4ShellEMDataSet::LoadData(const G4String& argFileName)123 G4bool G4ShellEMDataSet::LoadData(const G4String& file) 125 124 { 126 125 CleanUpComponents(); 127 126 128 G4String fullFileName (FullFileName(argFileName));127 G4String fullFileName = FullFileName(file); 129 128 std::ifstream in(fullFileName); 130 129 … … 132 131 { 133 132 G4String message("G4ShellEMDataSet::LoadData - data file \""); 134 message +=fullFileName;135 message +="\" not found";133 message += fullFileName; 134 message += "\" not found"; 136 135 G4Exception(message); 137 136 } 138 137 139 G4DataVector* argEnergies(0);140 G4DataVector* argData(0);141 142 G4double a ;143 G4int shellIndex (0);144 bool energyColumn (true);138 G4DataVector* energies = 0; 139 G4DataVector* data = 0; 140 141 G4double a = 0.; 142 G4int shellIndex = 0; 143 bool energyColumn = true; 145 144 146 145 do … … 150 149 if (a == -1) 151 150 { 152 if (energyColumn && argEnergies!=0)151 if (energyColumn && energies!=0) 153 152 { 154 AddComponent(new G4EMDataSet(shellIndex, argEnergies, argData, algorithm->Clone(), unitEnergies, unitData));155 argEnergies=0;156 argData=0;153 AddComponent(new G4EMDataSet(shellIndex, energies, data, algorithm->Clone(), unitEnergies, unitData)); 154 energies = 0; 155 data = 0; 157 156 } 158 157 159 energyColumn =(!energyColumn);158 energyColumn = (!energyColumn); 160 159 } 161 else if (a !=-2)160 else if (a != -2) 162 161 { 163 if ( argEnergies==0)162 if (energies == 0) 164 163 { 165 argEnergies=new G4DataVector;166 argData=new G4DataVector;164 energies = new G4DataVector; 165 data = new G4DataVector; 167 166 } 168 167 169 168 if (energyColumn) 170 argEnergies->push_back(a*unitEnergies);169 energies->push_back(a * unitEnergies); 171 170 else 172 argData->push_back(a*unitData);173 174 energyColumn =(!energyColumn);171 data->push_back(a * unitData); 172 173 energyColumn = (!energyColumn); 175 174 } 176 175 } … … 181 180 182 181 183 G4bool G4ShellEMDataSet::SaveData(const G4String& argFileName) const184 { 185 G4String fullFileName (FullFileName(argFileName));182 G4bool G4ShellEMDataSet::SaveData(const G4String& file) const 183 { 184 G4String fullFileName = FullFileName(file); 186 185 std::ofstream out(fullFileName); 187 186 … … 189 188 { 190 189 G4String message("G4EMDataSet::SaveData - cannot open \""); 191 message +=fullFileName;192 message +="\"";190 message += fullFileName; 191 message += "\""; 193 192 G4Exception(message); 194 193 } 195 194 196 const size_t n (NumberOfComponents());197 size_t k (0);198 199 while (k <n)200 { 201 const G4VEMDataSet * component=GetComponent(k);195 const size_t n = NumberOfComponents(); 196 size_t k = 0; 197 198 while (k < n) 199 { 200 const G4VEMDataSet* component = GetComponent(k); 202 201 203 202 if (component) 204 203 { 205 const G4DataVector & energies(component->GetEnergies(0));206 const G4DataVector & data(component->GetData(0));207 208 G4DataVector::const_iterator i (energies.begin());209 G4DataVector::const_iterator endI (energies.end());210 G4DataVector::const_iterator j (data.begin());211 212 while (i !=endI)204 const G4DataVector& energies = component->GetEnergies(0); 205 const G4DataVector& data = component->GetData(0); 206 207 G4DataVector::const_iterator i = energies.begin(); 208 G4DataVector::const_iterator endI = energies.end(); 209 G4DataVector::const_iterator j = data.begin(); 210 211 while (i != endI) 213 212 { 214 213 out.precision(10); … … 253 252 254 253 255 256 257 258 254 void G4ShellEMDataSet::CleanUpComponents(void) 259 255 { 260 256 while (!components.empty()) 261 257 { 262 if (components.back()) 263 delete components.back(); 264 258 if (components.back()) delete components.back(); 265 259 components.pop_back(); 266 260 } … … 268 262 269 263 270 271 272 273 G4String G4ShellEMDataSet::FullFileName(const G4String & argFileName) const 264 G4String G4ShellEMDataSet::FullFileName(const G4String& fileName) const 274 265 { 275 266 char* path = getenv("G4LEDATA"); … … 279 270 std::ostringstream fullFileName; 280 271 281 fullFileName << path << '/' << argFileName << z << ".dat";272 fullFileName << path << '/' << fileName << z << ".dat"; 282 273 283 274 return G4String(fullFileName.str().c_str()); -
trunk/source/processes/electromagnetic/lowenergy/src/G4VCrossSectionHandler.cc
r819 r961 26 26 // 27 27 // $Id: G4VCrossSectionHandler.cc,v 1.17 2006/06/29 19:41:42 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4VLowEnergyDiscretePhotonProcess.cc
r819 r961 25 25 // 26 26 // $Id: G4VLowEnergyDiscretePhotonProcess.cc,v 1.5 2006/06/29 19:41:44 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/src/G4VeLowEnergyLoss.cc
r819 r961 26 26 // 27 27 // $Id: G4VeLowEnergyLoss.cc,v 1.25 2006/06/29 19:41:50 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/lowenergy/src/G4WaterExcitationStructure.cc
r819 r961 26 26 // 27 27 // $Id: G4WaterExcitationStructure.cc,v 1.1 2007/10/15 08:57:54 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4WaterIonisationStructure.cc
r819 r961 26 26 // 27 27 // $Id: G4WaterIonisationStructure.cc,v 1.1 2007/11/08 20:39:35 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4eBremsstrahlungSpectrum.cc
r819 r961 25 25 // 26 26 // $Id: G4eBremsstrahlungSpectrum.cc,v 1.15 2006/06/29 19:41:58 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/src/G4eCrossSectionExcitationEmfietzoglou.cc
r819 r961 26 26 // 27 27 // $Id: G4eCrossSectionExcitationEmfietzoglou.cc,v 1.1 2007/05/04 10:16:06 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 31 31 // $Id: G4eCrossSectionExcitationEmfietzoglou.cc,v 1.1 2007/05/04 10:16:06 pia Exp $ 32 // GEANT4 tag $Name: $32 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 33 33 // 34 34 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4eCrossSectionScreenedRutherford.cc
r819 r961 26 26 // 27 27 // $Id: G4eCrossSectionScreenedRutherford.cc,v 1.3 2007/10/12 12:27:19 pia Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationCrossSectionHandler.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eIonisationCrossSectionHandler.cc,v 1.1 1 2006/06/29 19:42:00 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4eIonisationCrossSectionHandler.cc,v 1.12 2009/01/29 08:13:34 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 42 42 // 19 Jul 2002 VI Create composite data set for material 43 43 // 21 Jan 2003 V.Ivanchenko Cut per region 44 // 28 Jan 2009 L.Pandola Added public method to make a easier migration of 45 // G4LowEnergyIonisation to G4LivermoreIonisationModel 44 46 // 45 47 // ------------------------------------------------------------------- … … 98 100 G4int nElements = material->GetNumberOfElements(); 99 101 100 if(verbose > 0) { 101 G4cout << "eIonisation CS for " << m << "th material " 102 << material->GetName() 103 << " eEl= " << nElements << G4endl; 104 } 102 if(verbose > 0) 103 { 104 G4cout << "eIonisation CS for " << m << "th material " 105 << material->GetName() 106 << " eEl= " << nElements << G4endl; 107 } 105 108 106 109 G4double tcut = (*energyCuts)[m]; … … 129 132 value += cross * p * density; 130 133 131 if(verbose>0 && m == 0 && e>=1. && e<=0.) { 134 if(verbose>0 && m == 0 && e>=1. && e<=0.) 135 { 132 136 G4cout << "G4eIonCrossSH: e(MeV)= " << e/MeV 133 137 << " n= " << n … … 139 143 << " Z= " << Z 140 144 << G4endl; 141 }145 } 142 146 143 147 } … … 155 159 } 156 160 157 161 G4double G4eIonisationCrossSectionHandler::GetCrossSectionAboveThresholdForElement(G4double energy, 162 G4double cutEnergy, 163 G4int Z) 164 { 165 G4int nShells = NumberOfComponents(Z); 166 G4double value = 0.; 167 if(energy > cutEnergy) 168 { 169 for (G4int n=0; n<nShells; n++) { 170 G4double cross = FindValue(Z, energy, n); 171 G4double p = theParam->Probability(Z, cutEnergy, energy, energy, n); 172 value += cross * p; 173 } 174 } 175 return value; 176 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationParameters.cc
r819 r961 26 26 // 27 27 // $Id: G4eIonisationParameters.cc,v 1.23 2006/06/29 19:42:02 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) -
trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationSpectrum.cc
r819 r961 25 25 // 26 26 // $Id: G4eIonisationSpectrum.cc,v 1.25 2006/06/29 19:42:04 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/src/G4eLowEnergyLoss.cc
r819 r961 26 26 // 27 27 // $Id: G4eLowEnergyLoss.cc,v 1.35 2006/06/29 19:42:06 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ----------------------------------------------------------- -
trunk/source/processes/electromagnetic/lowenergy/src/G4hLowEnergyIonisation.cc
r819 r961 1501 1501 type = aSecondary->GetDefinition(); 1502 1502 if ( etot + e <= eLoss && 1503 ( type == G4Gamma::Gamma() && e > minGammaEnergy ) ||1504 (type == G4Electron::Electron() && e > minElectronEnergy) ) {1503 ( (type == G4Gamma::Gamma() && e > minGammaEnergy ) || 1504 (type == G4Electron::Electron() && e > minElectronEnergy) ) ) { 1505 1505 1506 1506 etot += e; -
trunk/source/processes/electromagnetic/lowenergy/src/G4hLowEnergyLoss.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4hLowEnergyLoss.cc,v 1.2 3 2006/06/29 19:42:23 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4hLowEnergyLoss.cc,v 1.28 2009/02/20 10:49:54 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ----------------------------------------------------------- … … 145 145 G4double G4hLowEnergyLoss::HighestKineticEnergy= 100.*GeV; 146 146 G4int G4hLowEnergyLoss::TotBin = 360; 147 G4double G4hLowEnergyLoss::RTable,G4hLowEnergyLoss::LOGRTable; 147 G4double G4hLowEnergyLoss::RTable =1.1; 148 G4double G4hLowEnergyLoss::LOGRTable = 1.1; 148 149 149 150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 772 773 theRangeTable = theRangepbarTable ; 773 774 } 774 775 775 G4double R2 = RTable*RTable ; 776 776 G4double R1 = RTable+1.; … … 796 796 else 797 797 { 798 Tim = Ti/RTable ; 798 // ---- MGP ---- Modified to avoid a floating point exception 799 // The correction is just a temporary patch, the whole class should be redesigned 800 // Original: Tim = Ti/RTable results in 0./0. 801 if (RTable != 0.) 802 { 803 Tim = Ti/RTable ; 804 } 805 else 806 { 807 Tim = 0.; 808 } 799 809 Rim = rangeVector->GetValue(Tim,isOut); 800 810 } … … 806 816 Rip = rangeVector->GetValue(Tip,isOut); 807 817 } 808 Value = (w1*Rip + w2*Ri + w3*Rim)/(Ti*Ti);818 if (Ti!=0) Value = (w1*Rip + w2*Ri + w3*Rim)/(Ti*Ti); else Value=0; 809 819 810 820 aVector->PutValue(i,Value); … … 868 878 else 869 879 { 870 Tim = Ti/RTable;880 if (RTable!=0) Tim = Ti/RTable ; else Tim =0; 871 881 Rim = rangeVector->GetValue(Tim,isOut); 872 882 } … … 878 888 Rip = rangeVector->GetValue(Tip,isOut); 879 889 } 880 Value = (w1*Rip + w2*Ri + w3*Rim)/Ti;890 if (Ti!=0) Value = (w1*Rip + w2*Ri + w3*Rim)/Ti; else Value=0; 881 891 882 892 aVector->PutValue(i,Value); … … 939 949 else 940 950 { 941 Tim = Ti/RTable;951 if (RTable!=0) Tim = Ti/RTable ; else Tim=0; 942 952 Rim = rangeVector->GetValue(Tim,isOut); 943 953 } … … 1052 1062 { 1053 1063 G4double LowEdgeRange,A,B,C,discr,KineticEnergy ; 1054 G4double Tbin = LowestKineticEnergy/RTable ; 1064 G4double Tbin = 0; 1065 if (RTable !=0.) Tbin = LowestKineticEnergy/RTable ; 1055 1066 G4double rangebin = 0.0 ; 1056 1067 G4int binnumber = -1 ; -
trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionDoubleExp.cc
r819 r961 41 41 // Empiric Model for shell cross sections in proton ionisation 42 42 // ------------------------------------------------------------------- 43 // $Id: G4hShellCrossSectionDoubleExp.cc,v 1. 8 2006/06/29 19:42:35 gunterExp $44 // GEANT4 tag $Name: $43 // $Id: G4hShellCrossSectionDoubleExp.cc,v 1.9 2008/06/26 18:19:10 sincerti Exp $ 44 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 45 45 46 46 #include "globals.hh" … … 187 187 188 188 std::vector<G4double> kProbability;//(0); 189 kProbability.push_back(GetCrossSectionDoubleExp(Z,incidentEnergy)/atomTotalCrossSection); 190 // ---- MGP ---- Next line corrected to kProbability[0] instead of [1], which is not initialized! 191 kProbability.push_back(1 - kProbability[0]); 189 190 191 if (atomTotalCrossSection!=0.) // SI - 26 june 2008 192 193 { 194 kProbability.push_back(GetCrossSectionDoubleExp(Z,incidentEnergy)/atomTotalCrossSection); 195 // ---- MGP ---- Next line corrected to kProbability[0] instead of [1], which is not initialized! 196 kProbability.push_back(1 - kProbability[0]); 197 } 192 198 193 199 return kProbability; -
trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionDoubleExpData.cc
r819 r961 34 34 // ------------------------------------------------------------------- 35 35 // $Id: G4hShellCrossSectionDoubleExpData.cc,v 1.4 2006/06/29 19:42:38 gunter Exp $ 36 // GEANT4 tag $Name: $36 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 37 37 38 38 #include "G4hShellCrossSectionDoubleExpData.hh" -
trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionExp.cc
r819 r961 41 41 // Empiric Model for shell cross sections in proton ionisation 42 42 // ------------------------------------------------------------------- 43 // $Id: G4hShellCrossSectionExp.cc,v 1. 5 2006/06/29 19:42:40 gunterExp $44 // GEANT4 tag $Name: $43 // $Id: G4hShellCrossSectionExp.cc,v 1.6 2008/05/02 19:23:38 pia Exp $ 44 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 45 45 46 46 #include "globals.hh" … … 104 104 crossSectionsInBarn = a*(std::pow(b,(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,c)); 105 105 } 106 else if( Z<66 && Z>=26|| Z==17)106 else if((Z<66 && Z>=26) || Z==17) 107 107 { 108 108 crossSectionsInBarn = std::exp(a+(b/incidentEnergyInMeV)+(c*std::log(incidentEnergyInMeV))); -
trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionExpData.cc
r819 r961 34 34 // ------------------------------------------------------------------- 35 35 // $Id: G4hShellCrossSectionExpData.cc,v 1.3 2006/06/29 19:42:42 gunter Exp $ 36 // GEANT4 tag $Name: $36 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 37 37 38 38 #include "G4hShellCrossSectionExpData.hh" -
trunk/source/processes/electromagnetic/muons/History
r819 r961 1 $Id: History,v 1.1 06 2007/11/12 10:34:23vnivanch Exp $1 $Id: History,v 1.126 2009/02/26 11:04:20 vnivanch Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20 26 February 09: V.Ivant (emmuons-V09-02-01) 21 G4MuIonisation - fixed initialisation alowing to configure external model 22 of fluctuations 23 24 20 February 09: V.Ivant (emmuons-V09-02-00) 25 - Cleanup: improved comments, move virtual methods from .hh to .cc 26 27 12 November 08: V.Ivant (emmuons-V09-01-15) 28 G4EnergyLossForExtrapolator - added method TrueStepLength; fixed initialisation 29 before a step 30 31 27 October 08: V.Ivant (emmuons-V09-01-14) 32 G4EnergyLossForExtrapolator - make method ComputeTrueStep public and cleanup 33 34 16 October 08: V.Ivant (emmuons-V09-01-13) 35 G4MuMscModel - remove obsolete 36 G4EnergyLossForExtrapolator - added spline option 37 G4MuIonisation, G4MuBremsstrahlung, G4MuPairProduction, 38 G4MuMultipleScattering - change SubType and improved cout 39 40 4 August 08: V.Ivant (emmuons-V09-01-12) 41 G4MuMscModel - added protection for ions 42 43 31 July 08: V.Ivant (emmuons-V09-01-11) 44 G4MuMscModel - do not define min and max energy in constructor but use Set 45 methods 46 G4MuMultipleScattering - added cout of model names 47 48 21 April 08: V.Ivanchenko (emmuons-V09-01-10) 49 G4MuBremsstrahlungModel, G4MuPairProductionModel - use CrossSectionPerVolume 50 from the base class, do not use A in CrossSEctionPerAtom 51 G4MuMscModel - do not use A in SetupTarget 52 53 04 April 08: V.Ivanchenko (emmuons-V09-01-09) 54 G4MuMultipleScattering - use G4WentzelVIModel model 55 build table for particles with mass < GeV 56 57 04 April 08: V.Ivanchenko (emmuons-V09-01-08) 58 - G4MuBremsstrahlungModel - instead of static const use members of a class, 59 this allows to reuse the model for different 60 particle type 61 62 27 March 08: V.Ivanchenko (emmuons-V09-01-07) 63 - G4MuPairProductionModel - fixed nan value at initialisation 64 of the sampling table 65 66 26 March 08: V.Ivanchenko (emmuons-V09-01-06) 67 - G4MuMscModel - fixed outstanding bug in sampling of scattering 68 69 25 March 08: V.Ivanchenko (emmuons-V09-01-05) 70 - G4MuMscModel - added shift along particle direction for displacement 71 - G4MuBetheBlochModel - update computation of correction 72 73 17 March 08: V.Ivanchenko (emmuons-V09-01-04) 74 - G4MuMscModel - fixed sampling 75 76 14 March 08: V.Ivanchenko (emmuons-V09-01-03) 77 - G4MuMscModel - use G4VMscModel interface 78 79 06 March 08: V.Ivanchenko (emmuons-V09-01-02) 80 - G4MuBremsstrahlungModel - remove ignoreCut flag, remove obsolete methods 81 and members, set some members protected to 82 be used by G4hBremsstrahlungModel 83 - G4MuPairProductionModel - remove ignoreCut flag, set some members protected 84 to be used by G4hBremsstrahlungModel 85 - SubType for all processes is initialized 86 87 22 February 08: V.Ivanchenko (emmuons-V09-01-01) 88 G4MuMscModel - added sampling of tail distribution 89 90 14 January 08: V.Ivanchenko (emmuons-V09-01-00) 91 G4MuMscModel - added computation of the second moment of the distribution; 92 fixed sampling 93 G4MuMultipleScattering - modified default RangeFactor 19 94 20 95 12 November 07: V.Ivanchenko (emmuons-V09-00-04) -
trunk/source/processes/electromagnetic/muons/include/G4EnergyLossForExtrapolator.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EnergyLossForExtrapolator.hh,v 1. 9 2007/07/28 13:44:25vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4EnergyLossForExtrapolator.hh,v 1.12 2008/11/13 14:14:07 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 //--------------------------------------------------------------------------- … … 81 81 82 82 G4double EnergyBeforeStep(G4double kinEnergy, G4double step, 83 const G4Material*, const G4ParticleDefinition*); 83 const G4Material*, const G4ParticleDefinition*); 84 85 G4double TrueStepLength(G4double kinEnergy, G4double step, 86 const G4Material*, const G4ParticleDefinition* part); 84 87 85 88 inline G4double EnergyAfterStep(G4double kinEnergy, G4double step, 86 const G4Material*, const G4String& particleName);89 const G4Material*, const G4String& particleName); 87 90 88 91 inline G4double EnergyBeforeStep(G4double kinEnergy, G4double step, 89 const G4Material*, const G4String& particleName);92 const G4Material*, const G4String& particleName); 90 93 91 94 inline G4double AverageScatteringAngle(G4double kinEnergy, G4double step, 92 const G4Material*, const G4ParticleDefinition* part); 95 const G4Material*, 96 const G4ParticleDefinition* part); 93 97 94 98 inline G4double AverageScatteringAngle(G4double kinEnergy, G4double step, 95 const G4Material*, const G4String& particleName); 99 const G4Material*, 100 const G4String& particleName); 101 102 inline G4double ComputeTrueStep(const G4Material*, const G4ParticleDefinition* part, 103 G4double kinEnergy, G4double stepLength); 96 104 97 105 inline G4double EnergyDispersion(G4double kinEnergy, G4double step, 98 const G4Material*, const G4ParticleDefinition*);106 const G4Material*, const G4ParticleDefinition*); 99 107 100 108 inline G4double EnergyDispersion(G4double kinEnergy, G4double step, … … 113 121 void Initialisation(); 114 122 123 G4bool SetupKinematics(const G4ParticleDefinition*, const G4Material*, 124 G4double kinEnergy); 125 115 126 G4PhysicsTable* PrepareTable(); 116 127 … … 123 134 void ComputeProtonDEDX(const G4ParticleDefinition* part, G4PhysicsTable* table); 124 135 125 G4double ComputeTrueStep(const G4Material*, const G4ParticleDefinition* part, 126 G4double kinEnergy, G4double stepLength); 136 void ComputeTrasportXS(const G4ParticleDefinition* part, G4PhysicsTable* table); 127 137 128 138 inline G4double ComputeValue(G4double x, const G4PhysicsTable* table); 129 130 inline G4double ComputeScatteringAngle(G4double x);131 139 132 140 // hide assignment operator … … 158 166 G4PhysicsTable* invRangeMuon; 159 167 G4PhysicsTable* invRangeProton; 168 G4PhysicsTable* mscElectron; 160 169 161 170 const G4Material* currentMaterial; … … 214 223 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 215 224 216 inline G4double G4EnergyLossForExtrapolator::EnergyDispersion(G4double kinEnergy, 217 G4double step, 218 const G4Material* mat, 219 const G4String& name) 225 inline G4double 226 G4EnergyLossForExtrapolator::EnergyDispersion(G4double kinEnergy, 227 G4double step, 228 const G4Material* mat, 229 const G4String& name) 220 230 { 221 231 return EnergyDispersion(kinEnergy,step,mat,FindParticle(name)); … … 224 234 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 225 235 226 inline G4double G4EnergyLossForExtrapolator::AverageScatteringAngle(G4double kinEnergy,227 G4double stepLength,228 const G4Material* mat,229 const G4ParticleDefinition* part)230 { 231 if(!isInitialised) Initialisation(); 236 inline G4double 237 G4EnergyLossForExtrapolator::AverageScatteringAngle(G4double kinEnergy, 238 G4double stepLength, 239 const G4Material* mat, 240 const G4ParticleDefinition* part) 241 { 232 242 G4double theta = 0.0; 233 if(mat && part && kinEnergy > 0.0) { 234 G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength); 235 if(step > 0.001*radLength) theta = ComputeScatteringAngle(stepLength); 243 if(SetupKinematics(part, mat, kinEnergy)) { 244 G4double t = stepLength/radLength; 245 G4double y = std::max(0.001, t); 246 theta = 19.23*MeV*std::sqrt(charge2*t)*(1.0 + 0.038*std::log(y))/(beta2*gam*mass); 236 247 } 237 248 return theta; … … 240 251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 241 252 242 inline G4double G4EnergyLossForExtrapolator::ComputeScatteringAngle(G4double x) 243 { 244 G4double t = x/radLength; 245 return 19.23*MeV*std::sqrt(charge2*t)*(1.0 + 0.038*std::log(t))/(beta2*gam*mass); 246 } 253 inline G4double 254 G4EnergyLossForExtrapolator::ComputeTrueStep(const G4Material* mat, 255 const G4ParticleDefinition* part, 256 G4double kinEnergy, 257 G4double stepLength) 258 { 259 G4double theta = AverageScatteringAngle(kinEnergy,stepLength,mat,part); 260 return stepLength*std::sqrt(1.0 + 0.625*theta*theta); 261 } 247 262 248 263 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 249 264 250 inline G4double G4EnergyLossForExtrapolator::EnergyDispersion(251 G4double kinEnergy,265 inline 266 G4double G4EnergyLossForExtrapolator::EnergyDispersion(G4double kinEnergy, 252 267 G4double stepLength, 253 268 const G4Material* mat, 254 269 const G4ParticleDefinition* part) 255 270 { 256 if(!isInitialised) Initialisation();257 271 G4double sig2 = 0.0; 258 if( mat && part) {272 if(SetupKinematics(part, mat, kinEnergy)) { 259 273 G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength); 260 sig2 = (1.0/beta2 - 0.5)* twopi_mc2_rcl2 * tmax*step * electronDensity *charge2;274 sig2 = (1.0/beta2 - 0.5)*twopi_mc2_rcl2*tmax*step*electronDensity*charge2; 261 275 } 262 276 return sig2; … … 269 283 { 270 284 G4double res = 0.0; 271 bool b;272 res = ((*table)[index])->GetValue(x, b);285 G4bool b; 286 if(table) res = ((*table)[index])->GetValue(x, b); 273 287 return res; 274 288 } -
trunk/source/processes/electromagnetic/muons/include/G4MuBetheBlochModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuBetheBlochModel.hh,v 1.1 7 2007/05/22 17:35:58vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4MuBetheBlochModel.hh,v 1.18 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 76 76 virtual ~G4MuBetheBlochModel(); 77 77 78 v oid Initialise(const G4ParticleDefinition*, const G4DataVector&);78 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 79 79 80 G4double MinEnergyCut(const G4ParticleDefinition*,81 const G4MaterialCutsCouple*);80 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 81 const G4MaterialCutsCouple*); 82 82 83 83 virtual G4double ComputeCrossSectionPerElectron( … … 113 113 protected: 114 114 115 G4double MaxSecondaryEnergy(const G4ParticleDefinition*,116 G4double kinEnergy);115 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 116 G4double kinEnergy); 117 117 118 118 private: 119 119 120 void SetParticle(const G4ParticleDefinition* p);120 inline void SetParticle(const G4ParticleDefinition* p); 121 121 122 122 // hide assignment operator … … 141 141 }; 142 142 143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 144 144 145 inline G4double G4MuBetheBlochModel::MaxSecondaryEnergy( 146 const G4ParticleDefinition*, 147 G4double kinEnergy) 145 inline void G4MuBetheBlochModel::SetParticle(const G4ParticleDefinition* p) 148 146 { 149 G4double tau = kinEnergy/mass; 150 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) / 151 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio); 152 return tmax; 147 if(!particle) { 148 particle = p; 149 mass = particle->GetPDGMass(); 150 massSquare = mass*mass; 151 ratio = electron_mass_c2/mass; 152 } 153 153 } 154 154 -
trunk/source/processes/electromagnetic/muons/include/G4MuBremsstrahlung.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuBremsstrahlung.hh,v 1. 29 2007/05/23 08:49:32vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuBremsstrahlung.hh,v 1.31 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 86 86 virtual ~G4MuBremsstrahlung(); 87 87 88 G4bool IsApplicable(const G4ParticleDefinition& p);88 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 89 89 90 G4double MinPrimaryEnergy(const G4ParticleDefinition* p,91 const G4Material*,92 G4double cut);90 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p, 91 const G4Material*, 92 G4double cut); 93 93 94 94 // Print out of the class parameters 95 v oid PrintInfo();95 virtual void PrintInfo(); 96 96 97 97 protected: 98 98 99 v oid InitialiseEnergyLossProcess(const G4ParticleDefinition*,100 const G4ParticleDefinition*);99 virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*, 100 const G4ParticleDefinition*); 101 101 102 102 private: … … 114 114 115 115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....117 118 inline G4bool G4MuBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)119 {120 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV);121 }122 123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....124 125 inline G4double G4MuBremsstrahlung::MinPrimaryEnergy(const G4ParticleDefinition*,126 const G4Material*,127 G4double)128 {129 return lowestKinEnergy;130 }131 132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......133 116 134 117 #endif -
trunk/source/processes/electromagnetic/muons/include/G4MuBremsstrahlungModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuBremsstrahlungModel.hh,v 1. 17 2007/10/11 09:25:31vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuBremsstrahlungModel.hh,v 1.22 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 45 45 // 10-02-04 Add lowestKinEnergy (V.Ivanchenko) 46 46 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko) 47 // 13-02-06 add ComputeCrossSectionPerAtom (mma)47 // 13-02-06 Add ComputeCrossSectionPerAtom (mma) 48 48 // 11-10-07 Add ignoreCut flag (V.Ivanchenko) 49 // 28-02-08 Reorganized protected methods and members (V.Ivanchenko) 50 // 06-03-08 Remove obsolete methods and members (V.Ivanchenko) 49 51 // 50 52 … … 52 54 // Class Description: 53 55 // 54 // Implementation of energy loss for gamma emissionby muons56 // Implementation of bremssrahlung by muons 55 57 56 58 // ------------------------------------------------------------------- … … 61 63 62 64 #include "G4VEmModel.hh" 65 #include "G4NistManager.hh" 63 66 64 67 class G4Element; … … 75 78 virtual ~G4MuBremsstrahlungModel(); 76 79 77 v oid SetParticle(const G4ParticleDefinition*);80 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 78 81 79 void Initialise(const G4ParticleDefinition*, const G4DataVector&); 80 81 void SetLowestKineticEnergy(G4double e) {lowestKinEnergy = e;}; 82 83 G4double MinEnergyCut(const G4ParticleDefinition*, 84 const G4MaterialCutsCouple*); 82 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 83 const G4MaterialCutsCouple*); 85 84 86 85 virtual G4double ComputeCrossSectionPerAtom( … … 90 89 G4double cutEnergy, 91 90 G4double maxEnergy); 92 93 virtual G4double CrossSectionPerVolume(const G4Material*, 94 const G4ParticleDefinition*, 95 G4double kineticEnergy, 96 G4double cutEnergy, 97 G4double maxEnergy); 98 91 99 92 virtual G4double ComputeDEDXPerVolume(const G4Material*, 100 93 const G4ParticleDefinition*, … … 102 95 G4double cutEnergy); 103 96 104 void SampleSecondaries(std::vector<G4DynamicParticle*>*, 105 const G4MaterialCutsCouple*, 106 const G4DynamicParticle*, 107 G4double tmin, 108 G4double maxEnergy); 97 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 98 const G4MaterialCutsCouple*, 99 const G4DynamicParticle*, 100 G4double tmin, 101 G4double maxEnergy); 102 103 inline void SetLowestKineticEnergy(G4double e); 109 104 110 105 protected: 111 106 112 G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 113 G4double kineticEnergy); 107 G4double ComputMuBremLoss(G4double Z, G4double tkin, G4double cut); 108 109 G4double ComputeMicroscopicCrossSection(G4double tkin, 110 G4double Z, 111 G4double cut); 114 112 115 public: 113 virtual G4double ComputeDMicroscopicCrossSection(G4double tkin, 114 G4double Z, 115 G4double gammaEnergy); 116 116 117 G4double ComputMuBremLoss(G4double Z, G4double A, G4double tkin, G4double cut); 118 119 G4double ComputeMicroscopicCrossSection(G4double tkin, 120 G4double Z, 121 G4double A, 122 G4double cut); 123 124 G4double ComputeDMicroscopicCrossSection(G4double tkin, 125 G4double Z, 126 G4double A, 127 G4double gammaEnergy); 128 129 inline void SetIgnoreCutFlag(G4bool); 130 131 inline G4bool IgnoreCutFlag() const; 117 inline void SetParticle(const G4ParticleDefinition*); 132 118 133 119 private: 134 120 135 G4DataVector* ComputePartialSumSigma(const G4Material* material,136 G4double tkin, G4double cut);121 G4DataVector* ComputePartialSumSigma(const G4Material* material, 122 G4double tkin, G4double cut); 137 123 138 const G4Element* SelectRandomAtom(const G4MaterialCutsCouple* couple) const; 139 140 void MakeSamplingTables(); 141 124 const G4Element* SelectRandomAtom(const G4MaterialCutsCouple* couple) const; 142 125 143 126 // hide assignment operator … … 145 128 G4MuBremsstrahlungModel(const G4MuBremsstrahlungModel&); 146 129 130 protected: 131 132 const G4ParticleDefinition* particle; 133 G4NistManager* nist; 134 G4double mass; 135 G4double rmass; 136 G4double cc; 137 G4double coeff; 138 G4double sqrte; 139 G4double bh; 140 G4double bh1; 141 G4double btf; 142 G4double btf1; 143 144 private: 145 147 146 G4ParticleDefinition* theGamma; 148 const G4ParticleDefinition* particle;149 147 G4ParticleChangeForLoss* fParticleChange; 150 148 … … 153 151 G4double lowestKinEnergy; 154 152 G4double minThreshold; 155 G4double mass;156 157 // tables for sampling158 G4int nzdat,ntdat,NBIN;159 static G4double zdat[5],adat[5],tdat[8];160 G4double ya[1001], proba[5][8][1001];161 G4double cutFixed;162 163 G4bool ignoreCut;164 153 165 154 std::vector<G4DataVector*> partialSumSigma; 166 G4bool samplingTablesAreFilled;167 168 155 }; 169 156 170 157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 171 158 172 inline G4double G4MuBremsstrahlungModel::MaxSecondaryEnergy( 173 const G4ParticleDefinition*, 174 G4double kineticEnergy) 159 inline void G4MuBremsstrahlungModel::SetLowestKineticEnergy(G4double e) 175 160 { 176 return kineticEnergy;161 lowestKinEnergy = e; 177 162 } 178 163 179 164 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 180 165 181 inline void G4MuBremsstrahlungModel::SetIgnoreCutFlag(G4bool val) 166 inline 167 void G4MuBremsstrahlungModel::SetParticle(const G4ParticleDefinition* p) 182 168 { 183 ignoreCut = val; 184 } 185 186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 187 188 inline G4bool G4MuBremsstrahlungModel::IgnoreCutFlag() const 189 { 190 return ignoreCut; 169 if(!particle) { 170 particle = p; 171 mass = particle->GetPDGMass(); 172 rmass=mass/electron_mass_c2 ; 173 cc=classic_electr_radius/rmass ; 174 coeff= 16.*fine_structure_const*cc*cc/3. ; 175 } 191 176 } 192 177 -
trunk/source/processes/electromagnetic/muons/include/G4MuIonisation.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuIonisation.hh,v 1.3 0 2007/05/23 08:49:32vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4MuIonisation.hh,v 1.31 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 95 95 virtual ~G4MuIonisation(); 96 96 97 G4bool IsApplicable(const G4ParticleDefinition& p);97 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 98 98 99 G4double MinPrimaryEnergy(const G4ParticleDefinition* p,100 const G4Material*, G4double cut);99 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p, 100 const G4Material*, G4double cut); 101 101 102 102 // Print out of the class parameters 103 v oid PrintInfo();103 virtual void PrintInfo(); 104 104 105 105 protected: … … 127 127 128 128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....130 131 inline G4bool G4MuIonisation::IsApplicable(const G4ParticleDefinition& p)132 {133 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV);134 }135 136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....137 138 inline G4double G4MuIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,139 const G4Material*,140 G4double cut)141 {142 G4double x = 0.5*cut/electron_mass_c2;143 G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));144 return mass*(g - 1.0);145 }146 147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....148 129 149 130 #endif -
trunk/source/processes/electromagnetic/muons/include/G4MuMultipleScattering.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuMultipleScattering.hh,v 1. 1 2007/10/26 09:52:37vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuMultipleScattering.hh,v 1.2 2008/04/13 17:19:13 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ----------------------------------------------------------------------------- … … 60 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 61 61 62 class G4 MuMscModel;62 class G4VMscModel; 63 63 64 64 class G4MuMultipleScattering : public G4VMultipleScattering … … 94 94 private: // data members 95 95 96 G4 MuMscModel* mscModel;96 G4VMscModel* mscModel; 97 97 98 98 G4double thetaLimit; -
trunk/source/processes/electromagnetic/muons/include/G4MuPairProduction.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuPairProduction.hh,v 1. 29 2007/05/23 08:49:32vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuPairProduction.hh,v 1.31 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 84 84 virtual ~G4MuPairProduction(); 85 85 86 G4bool IsApplicable(const G4ParticleDefinition& p);86 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 87 87 88 G4double MinPrimaryEnergy(const G4ParticleDefinition* p,89 const G4Material*, G4double cut);88 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p, 89 const G4Material*, G4double cut); 90 90 91 91 // Print out of the class parameters 92 v oid PrintInfo();92 virtual void PrintInfo(); 93 93 94 94 protected: 95 95 96 v oid InitialiseEnergyLossProcess(const G4ParticleDefinition*,97 const G4ParticleDefinition*);96 virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*, 97 const G4ParticleDefinition*); 98 98 99 99 private: … … 113 113 114 114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....116 117 inline G4bool G4MuPairProduction::IsApplicable(const G4ParticleDefinition& p)118 {119 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV);120 }121 122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....123 124 inline G4double G4MuPairProduction::MinPrimaryEnergy(const G4ParticleDefinition*,125 const G4Material*,126 G4double)127 {128 return lowestKinEnergy;129 }130 131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......132 115 133 116 #endif -
trunk/source/processes/electromagnetic/muons/include/G4MuPairProductionModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuPairProductionModel.hh,v 1.2 4 2007/10/11 13:52:03vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuPairProductionModel.hh,v 1.28 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 48 48 // 12-05-06 Add parameter to SelectRandomAtom (A.Bogdanov) 49 49 // 11-10-07 Add ignoreCut flag (V.Ivanchenko) 50 // 28-02-08 Reorganized protected methods and members (V.Ivanchenko) 50 51 51 52 // … … 62 63 63 64 #include "G4VEmModel.hh" 65 #include "G4NistManager.hh" 64 66 #include <vector> 65 67 … … 70 72 class G4MuPairProductionModel : public G4VEmModel 71 73 { 72 73 74 public: 74 75 … … 78 79 virtual ~G4MuPairProductionModel(); 79 80 80 void SetParticle(const G4ParticleDefinition*); 81 82 void Initialise(const G4ParticleDefinition*, const G4DataVector&); 83 84 void SetLowestKineticEnergy(G4double e) {lowestKinEnergy = e;}; 85 86 G4double MinEnergyCut(const G4ParticleDefinition*, 87 const G4MaterialCutsCouple*); 81 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 82 88 83 89 84 virtual G4double ComputeCrossSectionPerAtom( … … 94 89 G4double maxEnergy); 95 90 96 virtual G4double CrossSectionPerVolume(const G4Material*,97 const G4ParticleDefinition*,98 G4double kineticEnergy,99 G4double cutEnergy,100 G4double maxEnergy);101 102 91 virtual G4double ComputeDEDXPerVolume(const G4Material*, 103 92 const G4ParticleDefinition*, … … 105 94 G4double cutEnergy); 106 95 107 void SampleSecondaries(std::vector<G4DynamicParticle*>*, 108 const G4MaterialCutsCouple*, 109 const G4DynamicParticle*, 110 G4double tmin, 111 G4double maxEnergy); 96 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 97 const G4MaterialCutsCouple*, 98 const G4DynamicParticle*, 99 G4double tmin, 100 G4double maxEnergy); 101 102 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 103 const G4MaterialCutsCouple*); 104 105 inline void SetLowestKineticEnergy(G4double e); 106 107 inline void SetParticle(const G4ParticleDefinition*); 112 108 113 109 protected: 114 115 inline G4double MaxSecondaryEnergy(const G4ParticleDefinition*,116 G4double kineticEnergy);117 118 119 public:120 110 121 111 G4double ComputMuPairLoss(G4double Z, G4double tkin, G4double cut, … … 126 116 G4double cut); 127 117 128 G4double ComputeDMicroscopicCrossSection(G4double tkin, 129 G4double Z, 130 G4double pairEnergy); 131 132 inline void SetIgnoreCutFlag(G4bool); 133 134 inline G4bool IgnoreCutFlag() const; 118 virtual G4double ComputeDMicroscopicCrossSection(G4double tkin, 119 G4double Z, 120 G4double pairEnergy); 121 122 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 123 G4double kineticEnergy); 124 125 inline void SetCurrentElement(G4double Z); 135 126 136 127 private: … … 144 135 void MakeSamplingTables(); 145 136 146 void SetCurrentElement(G4double Z);147 148 137 inline G4double InterpolatedIntegralCrossSection( 149 138 G4double dt, G4double dz, G4int iz, … … 154 143 G4MuPairProductionModel(const G4MuPairProductionModel&); 155 144 156 G4ParticleDefinition* theElectron; 157 G4ParticleDefinition* thePositron; 158 G4ParticleChangeForLoss* fParticleChange; 159 G4ParticleChangeForGamma* gParticleChange; 160 161 G4double minPairEnergy; 162 G4double lowestKinEnergy; 145 protected: 146 147 const G4ParticleDefinition* particle; 148 G4NistManager* nist; 163 149 164 150 G4double factorForCross; … … 170 156 G4double lnZ; 171 157 172 const G4ParticleDefinition* particle; 158 static G4double xgi[8],wgi[8]; 159 160 private: 161 162 G4ParticleDefinition* theElectron; 163 G4ParticleDefinition* thePositron; 164 G4ParticleChangeForLoss* fParticleChange; 165 166 G4double minPairEnergy; 167 G4double lowestKinEnergy; 173 168 174 169 // tables for sampling … … 177 172 G4int nbiny; 178 173 size_t nmaxElements; 179 static G4double zdat[5],adat[5],tdat[8] ,xgi[8],wgi[8];174 static G4double zdat[5],adat[5],tdat[8]; 180 175 G4double ya[1001],proba[5][8][1001]; 181 176 … … 184 179 G4double dy; 185 180 186 G4bool ignoreCut;187 188 181 G4bool samplingTablesAreFilled; 189 182 std::vector<G4double> partialSum; … … 192 185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 193 186 194 inline G4double G4MuPairProductionModel::MaxSecondaryEnergy( 195 const G4ParticleDefinition*, 196 G4double kineticEnergy) 197 { 198 G4double maxPairEnergy = kineticEnergy + particleMass*(1.0 - 0.75*sqrte*z13); 199 return maxPairEnergy; 187 inline void G4MuPairProductionModel::SetLowestKineticEnergy(G4double e) 188 { 189 lowestKinEnergy = e; 190 } 191 192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 193 194 inline 195 void G4MuPairProductionModel::SetParticle(const G4ParticleDefinition* p) 196 { 197 if(!particle) { 198 particle = p; 199 particleMass = particle->GetPDGMass(); 200 } 200 201 } 201 202 … … 206 207 if(Z != currentZ) { 207 208 currentZ = Z; 208 z13 = std::pow(Z,0.333333333); 209 G4int iz = G4int(Z); 210 z13 = nist->GetZ13(iz); 209 211 z23 = z13*z13; 210 lnZ = std::log(Z);212 lnZ = nist->GetLOGZ(iz); 211 213 } 212 214 } … … 229 231 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 230 232 231 inline void G4MuPairProductionModel::SetIgnoreCutFlag(G4bool val)232 {233 ignoreCut = val;234 }235 236 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......237 238 inline G4bool G4MuPairProductionModel::IgnoreCutFlag() const239 {240 return ignoreCut;241 }242 243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......244 245 233 #endif -
trunk/source/processes/electromagnetic/muons/src/G4EnergyLossForExtrapolator.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EnergyLossForExtrapolator.cc,v 1.1 3 2007/07/28 13:44:25vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4EnergyLossForExtrapolator.cc,v 1.18 2008/11/13 14:14:07 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 //--------------------------------------------------------------------------- … … 67 67 #include "G4MuBremsstrahlungModel.hh" 68 68 #include "G4ProductionCuts.hh" 69 #include "G4LossTableManager.hh" 70 #include "G4WentzelVIModel.hh" 69 71 70 72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 88 90 delete invRangePositron; 89 91 delete invRangeProton; 92 delete mscElectron; 90 93 delete cuts; 91 94 } … … 100 103 if(!isInitialised) Initialisation(); 101 104 G4double kinEnergyFinal = kinEnergy; 102 if( mat && part) {103 G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength);105 if(SetupKinematics(part, mat, kinEnergy)) { 106 G4double step = TrueStepLength(kinEnergy,stepLength,mat,part); 104 107 G4double r = ComputeRange(kinEnergy,part); 105 108 if(r <= step) { … … 125 128 G4double kinEnergyFinal = kinEnergy; 126 129 127 if( mat && part) {128 G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength);130 if(SetupKinematics(part, mat, kinEnergy)) { 131 G4double step = TrueStepLength(kinEnergy,stepLength,mat,part); 129 132 G4double r = ComputeRange(kinEnergy,part); 130 133 … … 141 144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 142 145 143 G4double G4EnergyLossForExtrapolator::ComputeTrueStep(const G4Material* mat, 144 const G4ParticleDefinition* part, 145 G4double kinEnergy, G4double stepLength) 146 { 146 G4double G4EnergyLossForExtrapolator::TrueStepLength(G4double kinEnergy, 147 G4double stepLength, 148 const G4Material* mat, 149 const G4ParticleDefinition* part) 150 { 151 G4double res = stepLength; 152 if(!isInitialised) Initialisation(); 153 if(SetupKinematics(part, mat, kinEnergy)) { 154 if(part == electron || part == positron) { 155 G4double x = stepLength*ComputeValue(kinEnergy, mscElectron); 156 if(x < 0.2) res *= (1.0 + 0.5*x + x*x/3.0); 157 else if(x < 0.9999) res = -std::log(1.0 - x)*stepLength/x; 158 else res = ComputeRange(kinEnergy,part); 159 160 } else { 161 res = ComputeTrueStep(mat,part,kinEnergy,stepLength); 162 } 163 } 164 return res; 165 } 166 167 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 168 169 G4bool G4EnergyLossForExtrapolator::SetupKinematics(const G4ParticleDefinition* part, 170 const G4Material* mat, 171 G4double kinEnergy) 172 { 173 if(!part || !mat || kinEnergy < keV) return false; 147 174 if(!isInitialised) Initialisation(); 148 175 G4bool flag = false; … … 182 209 if(tmax > maxEnergyTransfer) tmax = maxEnergyTransfer; 183 210 } 184 G4double theta = ComputeScatteringAngle(stepLength); 185 return stepLength*std::sqrt(1.0 + 0.625*theta*theta); 211 return true; 186 212 } 187 213 … … 231 257 invRangeMuon = PrepareTable(); 232 258 invRangeProton = PrepareTable(); 259 mscElectron = PrepareTable(); 233 260 234 261 G4LossTableBuilder builder; … … 262 289 builder.BuildInverseRangeTable(rangeProton, invRangeProton); 263 290 291 ComputeTrasportXS(electron, mscElectron); 264 292 } 265 293 … … 273 301 274 302 G4PhysicsVector* v = new G4PhysicsLogVector(emin, emax, nbins); 303 v->SetSpline(G4LossTableManager::Instance()->SplineFlag()); 275 304 table->push_back(v); 276 305 } … … 488 517 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 489 518 519 void G4EnergyLossForExtrapolator::ComputeTrasportXS(const G4ParticleDefinition* part, 520 G4PhysicsTable* table) 521 { 522 G4DataVector v; 523 G4WentzelVIModel* msc = new G4WentzelVIModel(); 524 msc->SetPolarAngleLimit(CLHEP::pi); 525 msc->Initialise(part, v); 526 527 mass = part->GetPDGMass(); 528 charge2 = 1.0; 529 currentParticle = part; 530 531 const G4MaterialTable* mtable = G4Material::GetMaterialTable(); 532 533 if(0<verbose) { 534 G4cout << "G4EnergyLossForExtrapolator::ComputeProtonDEDX for " << part->GetParticleName() 535 << G4endl; 536 } 537 538 for(G4int i=0; i<nmat; i++) { 539 540 const G4Material* mat = (*mtable)[i]; 541 if(1<verbose) 542 G4cout << "i= " << i << " mat= " << mat->GetName() << G4endl; 543 G4PhysicsVector* aVector = (*table)[i]; 544 for(G4int j=0; j<nbins; j++) { 545 546 G4double e = aVector->GetLowEdgeEnergy(j); 547 G4double xs = msc->CrossSectionPerVolume(mat,part,e); 548 aVector->PutValue(j,xs); 549 if(1<verbose) { 550 G4cout << "j= " << j << " e(MeV)= " << e/MeV 551 << " xs(1/mm)= " << xs*mm << G4endl; 552 } 553 } 554 } 555 delete msc; 556 } 557 558 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 559 -
trunk/source/processes/electromagnetic/muons/src/G4MuBetheBlochModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuBetheBlochModel.cc,v 1.2 3 2007/05/22 17:35:58vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuBetheBlochModel.cc,v 1.25 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 88 88 theElectron = G4Electron::Electron(); 89 89 corr = G4LossTableManager::Instance()->EmCorrections(); 90 fParticleChange = 0; 90 91 91 92 if(p) SetParticle(p); … … 99 100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 100 101 101 void G4MuBetheBlochModel::SetParticle(const G4ParticleDefinition* p)102 {103 if(!particle) {104 particle = p;105 mass = particle->GetPDGMass();106 massSquare = mass*mass;107 ratio = electron_mass_c2/mass;108 }109 }110 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......112 113 102 G4double G4MuBetheBlochModel::MinEnergyCut(const G4ParticleDefinition*, 114 103 const G4MaterialCutsCouple* couple) … … 117 106 } 118 107 108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 109 110 G4double G4MuBetheBlochModel::MaxSecondaryEnergy(const G4ParticleDefinition*, 111 G4double kinEnergy) 112 { 113 G4double tau = kinEnergy/mass; 114 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) / 115 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio); 116 return tmax; 117 } 118 119 119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 120 120 … … 124 124 if(p) SetParticle(p); 125 125 126 if(pParticleChange) 127 fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*> 128 (pParticleChange); 129 else 130 fParticleChange = new G4ParticleChangeForLoss(); 126 if(!fParticleChange) { 127 if(pParticleChange) { 128 fParticleChange = 129 reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange); 130 } else { 131 fParticleChange = new G4ParticleChangeForLoss(); 132 } 133 } 131 134 } 132 135 … … 275 278 276 279 //High order corrections 277 dedx += corr->HighOrderCorrections(p,material,kineticEnergy );280 dedx += corr->HighOrderCorrections(p,material,kineticEnergy,cutEnergy); 278 281 279 282 return dedx; -
trunk/source/processes/electromagnetic/muons/src/G4MuBremsstrahlung.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuBremsstrahlung.cc,v 1. 38 2007/05/22 17:35:58vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuBremsstrahlung.cc,v 1.42 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 82 82 lowestKinEnergy(1.*GeV), 83 83 isInitialised(false) 84 {} 84 { 85 SetProcessSubType(fBremsstrahlung); 86 } 85 87 86 88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 91 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 94 93 void G4MuBremsstrahlung::InitialiseEnergyLossProcess(const G4ParticleDefinition* part, 94 const G4ParticleDefinition*) 95 G4bool G4MuBremsstrahlung::IsApplicable(const G4ParticleDefinition& p) 96 { 97 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV); 98 } 99 100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 101 102 G4double G4MuBremsstrahlung::MinPrimaryEnergy(const G4ParticleDefinition*, 103 const G4Material*, 104 G4double) 105 { 106 return lowestKinEnergy; 107 } 108 109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 110 111 void G4MuBremsstrahlung::InitialiseEnergyLossProcess( 112 const G4ParticleDefinition* part, 113 const G4ParticleDefinition*) 95 114 { 96 115 if(!isInitialised) { … … 105 124 em->SetLowestKineticEnergy(lowestKinEnergy); 106 125 107 G4VEmFluctuationModel* fm = new G4UniversalFluctuation();108 em->SetLowEnergyLimit( 0.1*keV);109 em->SetHighEnergyLimit( 100.0*TeV);126 G4VEmFluctuationModel* fm = 0; 127 em->SetLowEnergyLimit(MinKinEnergy()); 128 em->SetHighEnergyLimit(MaxKinEnergy()); 110 129 AddEmModel(1, em, fm); 111 130 } … … 115 134 116 135 void G4MuBremsstrahlung::PrintInfo() 117 { 118 G4cout << " Parametrised model " 119 << G4endl; 120 } 136 {} 121 137 122 138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/muons/src/G4MuBremsstrahlungModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuBremsstrahlungModel.cc,v 1. 24 2007/11/08 11:48:28vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuBremsstrahlungModel.cc,v 1.33 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 46 46 // 13-02-03 Add name (V.Ivanchenko) 47 47 // 10-02-04 Add lowestKinEnergy (V.Ivanchenko) 48 // 08-04-05 Major optimisation of internal interfaces (V.Ivan tchenko)49 // 03-08-05 Angular correlations according to PRM (V.Ivan tchenko)48 // 08-04-05 Major optimisation of internal interfaces (V.Ivanchenko) 49 // 03-08-05 Angular correlations according to PRM (V.Ivanchenko) 50 50 // 13-02-06 add ComputeCrossSectionPerAtom (mma) 51 51 // 21-03-06 Fix problem of initialisation in case when cuts are not defined (VI) 52 52 // 07-11-07 Improve sampling of final state (A.Bogdanov) 53 // 28-02-08 Use precomputed Z^1/3 and Log(A) (V.Ivanchenko) 53 54 // 54 55 … … 74 75 75 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 76 77 // static members78 //79 G4double G4MuBremsstrahlungModel::zdat[]={1., 4., 13., 29., 92.};80 G4double G4MuBremsstrahlungModel::adat[]={1.01, 9.01, 26.98, 63.55, 238.03};81 G4double G4MuBremsstrahlungModel::tdat[]={1.e3, 1.e4, 1.e5, 1.e6, 1.e7, 1.e8,82 1.e9, 1.e10};83 84 77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 85 78 … … 90 83 : G4VEmModel(nam), 91 84 particle(0), 85 sqrte(sqrt(exp(1.))), 86 bh(202.4), 87 bh1(446.), 88 btf(183.), 89 btf1(1429.), 90 fParticleChange(0), 92 91 lowestKinEnergy(1.0*GeV), 93 minThreshold(1.0*keV), 94 nzdat(5), 95 ntdat(8), 96 NBIN(1000), 97 cutFixed(0.98*keV), 98 ignoreCut(false), 99 samplingTablesAreFilled(false) 92 minThreshold(1.0*keV) 100 93 { 101 94 theGamma = G4Gamma::Gamma(); 95 nist = G4NistManager::Instance(); 102 96 if(p) SetParticle(p); 103 97 } … … 125 119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 126 120 127 void G4MuBremsstrahlungModel::SetParticle(const G4ParticleDefinition* p)128 {129 if(!particle) {130 particle = p;131 mass = particle->GetPDGMass();132 }133 }134 135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......136 137 121 void G4MuBremsstrahlungModel::Initialise(const G4ParticleDefinition* p, 138 122 const G4DataVector& cuts) … … 142 126 highKinEnergy = HighEnergyLimit(); 143 127 128 // partial cross section is computed for fixed energy 144 129 G4double fixedEnergy = 0.5*highKinEnergy; 145 130 … … 148 133 if(theCoupleTable) { 149 134 G4int numOfCouples = theCoupleTable->GetTableSize(); 150 135 136 // clear old data 151 137 G4int nn = partialSumSigma.size(); 152 138 G4int nc = cuts.size(); 153 139 if(nn > 0) { 154 140 for (G4int ii=0; ii<nn; ii++){ 155 G4DataVector* a =partialSumSigma[ii];141 G4DataVector* a = partialSumSigma[ii]; 156 142 if ( a ) delete a; 157 143 } 158 144 partialSumSigma.clear(); 159 145 } 146 // fill new data 160 147 if (numOfCouples>0) { 161 148 for (G4int i=0; i<numOfCouples; i++) { 162 149 G4double cute = DBL_MAX; 150 151 // protection for usage with extrapolator 163 152 if(i < nc) cute = cuts[i]; 164 if(cute < cutFixed || ignoreCut) cute = cutFixed; 153 165 154 const G4MaterialCutsCouple* couple = 166 155 theCoupleTable->GetMaterialCutsCouple(i); … … 171 160 } 172 161 } 173 if(!samplingTablesAreFilled) MakeSamplingTables(); 174 if(pParticleChange) 175 fParticleChange = 176 reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange); 177 else 178 fParticleChange = new G4ParticleChangeForLoss(); 162 163 // define pointer to G4ParticleChange 164 if(!fParticleChange) { 165 if(pParticleChange) 166 fParticleChange = 167 reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange); 168 else 169 fParticleChange = new G4ParticleChangeForLoss(); 170 } 179 171 } 180 172 … … 188 180 { 189 181 G4double dedx = 0.0; 190 if (kineticEnergy <= lowestKinEnergy || ignoreCut) return dedx;182 if (kineticEnergy <= lowestKinEnergy) return dedx; 191 183 192 184 G4double tmax = kineticEnergy; 193 G4double cut = min(cutEnergy,tmax);194 if(cut < cutFixed) cut = cutFixed;185 G4double cut = std::min(cutEnergy,tmax); 186 if(cut < minThreshold) cut = minThreshold; 195 187 196 188 const G4ElementVector* theElementVector = material->GetElementVector(); 197 189 const G4double* theAtomicNumDensityVector = 198 material->GetAtomicNumDensityVector();190 material->GetAtomicNumDensityVector(); 199 191 200 192 // loop for elements in the material 201 193 for (size_t i=0; i<material->GetNumberOfElements(); i++) { 202 194 203 G4double Z = (*theElementVector)[i]->GetZ(); 204 G4double A = (*theElementVector)[i]->GetA()/(g/mole) ; 205 206 G4double loss = ComputMuBremLoss(Z, A, kineticEnergy, cut); 195 G4double loss = 196 ComputMuBremLoss((*theElementVector)[i]->GetZ(), kineticEnergy, cut); 207 197 208 198 dedx += loss*theAtomicNumDensityVector[i]; 209 199 } 200 // G4cout << "BR e= " << kineticEnergy << " dedx= " << dedx << G4endl; 210 201 if(dedx < 0.) dedx = 0.; 211 202 return dedx; … … 214 205 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 215 206 216 G4double G4MuBremsstrahlungModel::ComputMuBremLoss(G4double Z, G4double A,207 G4double G4MuBremsstrahlungModel::ComputMuBremLoss(G4double Z, 217 208 G4double tkin, G4double cut) 218 209 { … … 239 230 { 240 231 G4double ep = (aa + xgi[i]*hhh)*totalEnergy; 241 loss += ep*wgi[i]*ComputeDMicroscopicCrossSection(tkin, Z, A,ep);232 loss += ep*wgi[i]*ComputeDMicroscopicCrossSection(tkin, Z, ep); 242 233 } 243 234 aa += hhh; … … 254 245 G4double tkin, 255 246 G4double Z, 256 G4double A,257 247 G4double cut) 258 248 { … … 272 262 G4double bbb = log(vmax); 273 263 G4int kkk = (G4int)((bbb-aaa)/ak1)+k2 ; 274 G4double hhh = (bbb-aaa)/ float(kkk);264 G4double hhh = (bbb-aaa)/G4double(kkk); 275 265 276 266 G4double aa = aaa; … … 281 271 { 282 272 G4double ep = exp(aa + xgi[i]*hhh)*totalEnergy; 283 cross += ep*wgi[i]*ComputeDMicroscopicCrossSection(tkin, Z, A,ep);273 cross += ep*wgi[i]*ComputeDMicroscopicCrossSection(tkin, Z, ep); 284 274 } 285 275 aa += hhh; … … 287 277 288 278 cross *=hhh; 279 280 //G4cout << "BR e= " << tkin<< " cross= " << cross/barn << G4endl; 289 281 290 282 return cross; … … 296 288 G4double tkin, 297 289 G4double Z, 298 G4double A,299 290 G4double gammaEnergy) 300 291 // differential cross section 301 292 { 302 static const G4double sqrte=sqrt(exp(1.)) ;303 static const G4double bh=202.4,bh1=446.,btf=183.,btf1=1429. ;304 static const G4double rmass=mass/electron_mass_c2 ;305 static const G4double cc=classic_electr_radius/rmass ;306 static const G4double coeff= 16.*fine_structure_const*cc*cc/3. ;307 308 293 G4double dxsection = 0.; 309 294 … … 315 300 G4double rab0=delta*sqrte ; 316 301 317 G4double z13 = exp(-log(Z)/3.) ; 318 G4double dn = 1.54*exp(0.27*log(A)) ; 302 G4int iz = G4int(Z); 303 if(iz < 1) iz = 1; 304 305 G4double z13 = 1.0/nist->GetZ13(iz); 306 G4double dn = 1.54*nist->GetA27(iz); 319 307 320 308 G4double b,b1,dnstar ; 321 309 322 if( Z<1.5)310 if(1 == iz) 323 311 { 324 b =bh;325 b1 =bh1;326 dnstar =dn;312 b = bh; 313 b1 = bh1; 314 dnstar = dn; 327 315 } 328 316 else 329 317 { 330 b =btf;331 b1 =btf1;332 dnstar = exp((1.-1./Z)*log(dn));318 b = btf; 319 b1 = btf1; 320 dnstar = dn/std::pow(dn, 1./Z); 333 321 } 334 322 … … 359 347 const G4ParticleDefinition*, 360 348 G4double kineticEnergy, 361 G4double Z, G4double A,349 G4double Z, G4double, 362 350 G4double cutEnergy, 363 G4double) 364 { 365 G4double cut = min(cutEnergy, kineticEnergy); 366 if(cut < cutFixed || ignoreCut) cut = cutFixed; 367 G4double cross = 368 ComputeMicroscopicCrossSection (kineticEnergy, Z, A/(g/mole), cut); 369 return cross; 370 } 371 372 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 373 374 G4double G4MuBremsstrahlungModel::CrossSectionPerVolume( 375 const G4Material* material, 376 const G4ParticleDefinition*, 377 G4double kineticEnergy, 378 G4double cutEnergy, 379 G4double maxEnergy) 351 G4double maxEnergy) 380 352 { 381 353 G4double cross = 0.0; 382 if (cutEnergy >= maxEnergy || kineticEnergy <= lowestKinEnergy) return cross; 383 384 G4double tmax = min(maxEnergy, kineticEnergy); 385 G4double cut = min(cutEnergy, tmax); 386 if(cut < cutFixed || ignoreCut) cut = cutFixed; 387 388 const G4ElementVector* theElementVector = material->GetElementVector(); 389 const G4double* theAtomNumDensityVector = 390 material->GetAtomicNumDensityVector(); 391 392 for (size_t i=0; i<material->GetNumberOfElements(); i++) { 393 394 G4double Z = (*theElementVector)[i]->GetZ(); 395 G4double A = (*theElementVector)[i]->GetA()/(g/mole); 396 397 G4double cr = ComputeMicroscopicCrossSection(kineticEnergy, Z, A, cut); 398 399 if(tmax < kineticEnergy) { 400 cr -= ComputeMicroscopicCrossSection(kineticEnergy, Z, A, tmax); 401 } 402 cross += theAtomNumDensityVector[i] * cr; 403 } 404 354 if (kineticEnergy <= lowestKinEnergy) return cross; 355 G4double tmax = std::min(maxEnergy, kineticEnergy); 356 G4double cut = std::min(cutEnergy, kineticEnergy); 357 if(cut < minThreshold) cut = minThreshold; 358 if (cut >= tmax) return cross; 359 360 cross = ComputeMicroscopicCrossSection (kineticEnergy, Z, cut); 361 if(tmax < kineticEnergy) { 362 cross -= ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax); 363 } 405 364 return cross; 406 365 } … … 410 369 G4DataVector* G4MuBremsstrahlungModel::ComputePartialSumSigma( 411 370 const G4Material* material, 412 G4double kineticEnergy, 413 G4double cut) 414 415 // Build the table of cross section per element. The table is built for MATERIAL 416 // This table is used by DoIt to select randomly an element in the material. 371 G4double kineticEnergy, 372 G4double cut) 373 374 // Build the table of cross section per element. 375 // The table is built for material 376 // This table is used to select randomly an element in the material. 417 377 { 418 378 G4int nElements = material->GetNumberOfElements(); 419 379 const G4ElementVector* theElementVector = material->GetElementVector(); 420 380 const G4double* theAtomNumDensityVector = 421 material->GetAtomicNumDensityVector();381 material->GetAtomicNumDensityVector(); 422 382 423 383 G4DataVector* dv = new G4DataVector(); … … 426 386 427 387 for (G4int i=0; i<nElements; i++ ) { 428 429 G4double Z = (*theElementVector)[i]->GetZ();430 G4double A = (*theElementVector)[i]->GetA()/(g/mole) ;431 388 cross += theAtomNumDensityVector[i] 432 * ComputeMicroscopicCrossSection(kineticEnergy, Z, A, cut); 389 * ComputeMicroscopicCrossSection(kineticEnergy, 390 (*theElementVector)[i]->GetZ(), cut); 433 391 dv->push_back(cross); 434 392 } … … 438 396 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 439 397 440 void G4MuBremsstrahlungModel::MakeSamplingTables() 441 { 442 443 G4double AtomicNumber,AtomicWeight,KineticEnergy, 444 TotalEnergy,Maxep; 445 446 for (G4int iz=0; iz<nzdat; iz++) 447 { 448 AtomicNumber = zdat[iz]; 449 AtomicWeight = adat[iz]*g/mole ; 450 451 for (G4int it=0; it<ntdat; it++) 452 { 453 KineticEnergy = tdat[it]; 454 TotalEnergy = KineticEnergy + mass; 455 Maxep = KineticEnergy ; 456 457 G4double CrossSection = 0.0 ; 458 459 // calculate the differential cross section 460 // numerical integration in 461 // log ............... 462 G4double c = log(Maxep/cutFixed) ; 463 G4double ymin = -5. ; 464 G4double ymax = 0. ; 465 G4double dy = (ymax-ymin)/NBIN ; 466 467 G4double y = ymin - 0.5*dy ; 468 G4double yy = ymin - dy ; 469 G4double x = exp(y); 470 G4double fac = exp(dy); 471 G4double dx = exp(yy)*(fac - 1.0); 472 473 for (G4int i=0 ; i<NBIN; i++) 474 { 475 y += dy ; 476 x *= fac; 477 dx*= fac; 478 G4double ep = cutFixed*exp(c*x) ; 479 480 CrossSection += ep*dx*ComputeDMicroscopicCrossSection( 481 KineticEnergy,AtomicNumber, 482 AtomicWeight,ep) ; 483 ya[i]=y ; 484 proba[iz][it][i] = CrossSection ; 485 486 } 487 488 proba[iz][it][NBIN] = CrossSection ; 489 ya[NBIN] = 0. ; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 490 491 if(CrossSection > 0.) 492 { 493 for(G4int ib=0; ib<=NBIN; ib++) 494 { 495 proba[iz][it][ib] /= CrossSection ; 496 } 497 } 498 } 499 } 500 samplingTablesAreFilled = true; 501 } 502 503 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 504 505 void G4MuBremsstrahlungModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp, 506 const G4MaterialCutsCouple* couple, 507 const G4DynamicParticle* dp, 508 G4double minEnergy, 509 G4double maxEnergy) 398 void G4MuBremsstrahlungModel::SampleSecondaries( 399 std::vector<G4DynamicParticle*>* vdp, 400 const G4MaterialCutsCouple* couple, 401 const G4DynamicParticle* dp, 402 G4double minEnergy, 403 G4double maxEnergy) 510 404 { 511 405 G4double kineticEnergy = dp->GetKineticEnergy(); 512 406 // check against insufficient energy 513 G4double tmax = min(kineticEnergy, maxEnergy);514 G4double tmin = min(kineticEnergy, minEnergy);515 if(tmin < cutFixed || ignoreCut) tmin = cutFixed;407 G4double tmax = std::min(kineticEnergy, maxEnergy); 408 G4double tmin = std::min(kineticEnergy, minEnergy); 409 if(tmin < minThreshold) tmin = minThreshold; 516 410 if(tmin >= tmax) return; 517 411 518 // ===== the begining of a new code ======519 412 // ===== sampling of energy transfer ====== 520 413 … … 523 416 // select randomly one element constituing the material 524 417 const G4Element* anElement = SelectRandomAtom(couple); 418 G4double Z = anElement->GetZ(); 525 419 526 420 G4double totalEnergy = kineticEnergy + mass; 527 421 G4double totalMomentum = sqrt(kineticEnergy*(kineticEnergy + 2.0*mass)); 528 422 529 G4double AtomicNumber = anElement->GetZ(); 530 G4double AtomicWeight = anElement->GetA()/(g/mole); 531 532 G4double func1 = tmin*ComputeDMicroscopicCrossSection( 533 kineticEnergy,AtomicNumber, 534 AtomicWeight,tmin); 423 G4double func1 = tmin* 424 ComputeDMicroscopicCrossSection(kineticEnergy,Z,tmin); 535 425 536 426 G4double lnepksi, epksi; 537 427 G4double func2; 538 G4double ksi2;539 428 540 429 do { 541 430 lnepksi = log(tmin) + G4UniformRand()*log(kineticEnergy/tmin); 542 431 epksi = exp(lnepksi); 543 func2 = epksi*ComputeDMicroscopicCrossSection( 544 kineticEnergy,AtomicNumber, 545 AtomicWeight,epksi); 546 ksi2 = G4UniformRand(); 547 548 } while(func2/func1 < ksi2); 549 550 // ===== the end of a new code ===== 551 552 // create G4DynamicParticle object for the Gamma 432 func2 = epksi*ComputeDMicroscopicCrossSection(kineticEnergy,Z,epksi); 433 434 } while(func2 < func1*G4UniformRand()); 435 553 436 G4double gEnergy = epksi; 554 437 555 // sample angle 438 // ===== sample angle ===== 439 556 440 G4double gam = totalEnergy/mass; 557 G4double rmax = gam* min(1.0, totalEnergy/gEnergy - 1.0);558 rmax *=rmax;559 G4double x = G4UniformRand()*rmax /(1.0 + rmax);441 G4double rmax = gam*std::min(1.0, totalEnergy/gEnergy - 1.0); 442 G4double rmax2= rmax*rmax; 443 G4double x = G4UniformRand()*rmax2/(1.0 + rmax2); 560 444 561 445 G4double theta = sqrt(x/(1.0 - x))/gam; … … 577 461 578 462 // save secondary 579 G4DynamicParticle* aGamma = new G4DynamicParticle(theGamma,gDirection,gEnergy); 463 G4DynamicParticle* aGamma = 464 new G4DynamicParticle(theGamma,gDirection,gEnergy); 580 465 vdp->push_back(aGamma); 581 466 } -
trunk/source/processes/electromagnetic/muons/src/G4MuIonisation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuIonisation.cc,v 1.5 4 2007/05/22 17:35:58vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuIonisation.cc,v 1.59 2009/02/26 11:04:20 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 86 86 #include "G4MuBetheBlochModel.hh" 87 87 #include "G4UniversalFluctuation.hh" 88 #include "G4IonFluctuations.hh" 88 89 #include "G4BohrFluctuations.hh" 89 90 #include "G4UnitsTable.hh" … … 99 100 isInitialised(false) 100 101 { 101 SetStepFunction(0.2, 1*mm); 102 SetIntegral(true); 103 SetVerboseLevel(1); 102 // SetStepFunction(0.2, 1*mm); 103 //SetIntegral(true); 104 //SetVerboseLevel(1); 105 SetProcessSubType(fIonisation); 104 106 } 105 107 … … 108 110 G4MuIonisation::~G4MuIonisation() 109 111 {} 112 113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 114 115 G4bool G4MuIonisation::IsApplicable(const G4ParticleDefinition& p) 116 { 117 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV); 118 } 119 120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 121 122 G4double G4MuIonisation::MinPrimaryEnergy(const G4ParticleDefinition*, 123 const G4Material*, 124 G4double cut) 125 { 126 G4double x = 0.5*cut/electron_mass_c2; 127 G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio)); 128 return mass*(g - 1.0); 129 } 110 130 111 131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 122 142 SetSecondaryParticle(G4Electron::Electron()); 123 143 124 flucModel = new G4UniversalFluctuation(); 144 // Bragg peak model 145 if (!EmModel(1)) SetEmModel(new G4BraggModel(),1); 146 EmModel(1)->SetLowEnergyLimit(MinKinEnergy()); 147 EmModel(1)->SetHighEnergyLimit(0.2*MeV); 148 AddEmModel(1, EmModel(1), new G4IonFluctuations()); 125 149 126 G4VEmModel* em = new G4BraggModel(); 127 em->SetLowEnergyLimit(0.1*keV); 128 em->SetHighEnergyLimit(0.2*MeV); 129 AddEmModel(1, em, flucModel); 130 G4VEmModel* em1 = new G4BetheBlochModel(); 131 em1->SetLowEnergyLimit(0.2*MeV); 132 em1->SetHighEnergyLimit(1.0*GeV); 133 AddEmModel(2, em1, flucModel); 134 G4VEmModel* em2 = new G4MuBetheBlochModel(); 135 em2->SetLowEnergyLimit(1.0*GeV); 136 em2->SetHighEnergyLimit(100.0*TeV); 137 AddEmModel(3, em2, flucModel); 150 // high energy fluctuation model 151 if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation()); 152 153 // moderate energy model 154 if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 155 EmModel(2)->SetLowEnergyLimit(0.2*MeV); 156 EmModel(2)->SetHighEnergyLimit(1.0*GeV); 157 AddEmModel(2, EmModel(2), FluctModel()); 158 159 // high energy model 160 if (!EmModel(3)) SetEmModel(new G4MuBetheBlochModel(),3); 161 EmModel(3)->SetLowEnergyLimit(1.0*GeV); 162 EmModel(3)->SetHighEnergyLimit(MaxKinEnergy()); 163 AddEmModel(3, EmModel(3), FluctModel()); 138 164 139 165 ratio = electron_mass_c2/mass; … … 145 171 146 172 void G4MuIonisation::PrintInfo() 147 { 148 G4cout << " Bether-Bloch model for E > 0.2 MeV, " 149 << "parametrisation of Bragg peak below, " 150 << G4endl; 151 G4cout << " radiative corrections for E > 1 GeV" << G4endl; 152 } 173 {} 153 174 154 175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/muons/src/G4MuMultipleScattering.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuMultipleScattering.cc,v 1. 3 2007/11/09 19:48:10vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuMultipleScattering.cc,v 1.12 2008/10/16 13:37:04 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ----------------------------------------------------------------------------- … … 47 47 48 48 #include "G4MuMultipleScattering.hh" 49 #include "G4 MuMscModel.hh"49 #include "G4WentzelVIModel.hh" 50 50 #include "G4MscStepLimitType.hh" 51 51 … … 61 61 samplez = false ; 62 62 isInitialized = false; 63 SetRangeFactor(0. 04);63 SetRangeFactor(0.2); 64 64 SetLateralDisplasmentFlag(true); 65 65 } … … 84 84 if(isInitialized) { 85 85 86 if (p->GetParticleType() != "nucleus" ) {86 if (p->GetParticleType() != "nucleus" && p->GetPDGMass() < GeV) { 87 87 mscModel->SetStepLimitType(StepLimitType()); 88 88 mscModel->SetLateralDisplasmentFlag(LateralDisplasmentFlag()); 89 //mscModel->SetThetaLimit(thetaLimit);90 89 mscModel->SetRangeFactor(RangeFactor()); 91 90 } 91 mscModel->SetPolarAngleLimit(PolarAngleLimit()); 92 92 return; 93 93 } 94 94 95 if (p->GetParticleType() == "nucleus" ) {95 if (p->GetParticleType() == "nucleus" || p->GetPDGMass() > GeV) { 96 96 SetLateralDisplasmentFlag(false); 97 97 SetBuildLambdaTable(false); 98 // SetRangeFactor(0.2);99 98 } 100 99 101 // initialisation of parameters 102 // G4String part_name = p->GetParticleName(); 103 mscModel = new G4MuMscModel(RangeFactor(),thetaLimit); 100 // initialisation of the model 101 102 mscModel = new G4WentzelVIModel(); 103 mscModel->SetStepLimitType(StepLimitType()); 104 104 mscModel->SetLateralDisplasmentFlag(LateralDisplasmentFlag()); 105 mscModel->SetRangeFactor(RangeFactor()); 106 mscModel->SetPolarAngleLimit(PolarAngleLimit()); 107 mscModel->SetLowEnergyLimit(MinKinEnergy()); 108 mscModel->SetHighEnergyLimit(MaxKinEnergy()); 105 109 106 110 AddEmModel(1,mscModel); … … 112 116 void G4MuMultipleScattering::PrintInfo() 113 117 { 114 G4cout << " Boundary/stepping algorithm is active with RangeFactor= "115 << RangeFactor()116 << " Step limit type " << StepLimitType()117 << G4endl;118 G4cout << " RangeFactor= " << RangeFactor() 119 << ", step limit type: " << StepLimitType() 120 << ", lateralDisplacement: " << LateralDisplasmentFlag() 121 << G4endl; 118 122 } 119 123 -
trunk/source/processes/electromagnetic/muons/src/G4MuPairProduction.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuPairProduction.cc,v 1. 48 2007/05/22 17:35:58vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuPairProduction.cc,v 1.52 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 89 89 lowestKinEnergy(1.*GeV), 90 90 isInitialised(false) 91 {} 91 { 92 SetProcessSubType(fPairProdByCharged); 93 } 92 94 93 95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 98 100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 99 101 100 void G4MuPairProduction::InitialiseEnergyLossProcess(const G4ParticleDefinition* part, 101 const G4ParticleDefinition*) 102 G4bool G4MuPairProduction::IsApplicable(const G4ParticleDefinition& p) 103 { 104 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV); 105 } 106 107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 108 109 G4double G4MuPairProduction::MinPrimaryEnergy(const G4ParticleDefinition*, 110 const G4Material*, 111 G4double) 112 { 113 return lowestKinEnergy; 114 } 115 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 117 118 void G4MuPairProduction::InitialiseEnergyLossProcess( 119 const G4ParticleDefinition* part, 120 const G4ParticleDefinition*) 102 121 { 103 122 if (!isInitialised) { … … 110 129 G4MuPairProductionModel* em = new G4MuPairProductionModel(); 111 130 em->SetLowestKineticEnergy(lowestKinEnergy); 112 G4VEmFluctuationModel* fm = new G4UniversalFluctuation();113 em->SetLowEnergyLimit( 0.1*keV);114 em->SetHighEnergyLimit( 100.0*TeV);131 G4VEmFluctuationModel* fm = 0; 132 em->SetLowEnergyLimit(MinKinEnergy()); 133 em->SetHighEnergyLimit(MaxKinEnergy()); 115 134 AddEmModel(1, em, fm); 116 135 } … … 120 139 121 140 void G4MuPairProduction::PrintInfo() 122 { 123 G4cout << " Parametrised model " 124 << G4endl; 125 } 141 {} 126 142 127 143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/muons/src/G4MuPairProductionModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuPairProductionModel.cc,v 1. 35 2007/10/11 13:52:04vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MuPairProductionModel.cc,v 1.40 2009/02/20 14:48:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 104 104 const G4String& nam) 105 105 : G4VEmModel(nam), 106 minPairEnergy(4.*electron_mass_c2), 107 lowestKinEnergy(1.*GeV), 108 factorForCross(4.*fine_structure_const*fine_structure_const 106 particle(0), 107 factorForCross(4.*fine_structure_const*fine_structure_const 109 108 *classic_electr_radius*classic_electr_radius/(3.*pi)), 110 109 sqrte(sqrt(exp(1.))), 111 110 currentZ(0), 112 particle(0), 111 fParticleChange(0), 112 minPairEnergy(4.*electron_mass_c2), 113 lowestKinEnergy(1.*GeV), 113 114 nzdat(5), 114 115 ntdat(8), … … 118 119 ymax(0.), 119 120 dy((ymax-ymin)/nbiny), 120 ignoreCut(false),121 121 samplingTablesAreFilled(false) 122 122 { 123 123 SetLowEnergyLimit(minPairEnergy); 124 nist = G4NistManager::Instance(); 124 125 125 126 theElectron = G4Electron::Electron(); … … 144 145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 145 146 146 void G4MuPairProductionModel::SetParticle(const G4ParticleDefinition* p) 147 { 148 if(!particle) { 149 particle = p; 150 particleMass = particle->GetPDGMass(); 151 } 147 G4double G4MuPairProductionModel::MaxSecondaryEnergy(const G4ParticleDefinition*, 148 G4double kineticEnergy) 149 { 150 G4double maxPairEnergy = kineticEnergy + particleMass*(1.0 - 0.75*sqrte*z13); 151 return maxPairEnergy; 152 152 } 153 153 … … 161 161 MakeSamplingTables(); 162 162 } 163 if(pParticleChange) { 164 if(ignoreCut) { 165 gParticleChange = 166 reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 167 fParticleChange = 0; 168 } else { 163 if(!fParticleChange) { 164 if(pParticleChange) 169 165 fParticleChange = 170 166 reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange); 171 gParticleChange = 0; 172 } 173 } else { 174 fParticleChange = new G4ParticleChangeForLoss(); 175 gParticleChange = 0; 167 else 168 fParticleChange = new G4ParticleChangeForLoss(); 176 169 } 177 170 } … … 186 179 { 187 180 G4double dedx = 0.0; 188 if (cutEnergy <= minPairEnergy || kineticEnergy <= lowestKinEnergy 189 || ignoreCut) 181 if (cutEnergy <= minPairEnergy || kineticEnergy <= lowestKinEnergy) 190 182 return dedx; 191 183 … … 216 208 G4double loss = 0.0; 217 209 218 G4double cut =min(cutEnergy,tmax);210 G4double cut = std::min(cutEnergy,tmax); 219 211 if(cut <= minPairEnergy) return loss; 220 212 … … 251 243 G4double Z, 252 244 G4double cut) 253 254 { 255 G4double cross = 0. ; 256 245 { 246 G4double cross = 0.; 257 247 SetCurrentElement(Z); 258 248 G4double tmax = MaxSecondaryEnergy(particle, tkin); 259 260 249 if (tmax <= cut) return cross; 261 250 … … 400 389 G4double Z, G4double, 401 390 G4double cutEnergy, 402 G4double) 403 { 404 G4double cut = max(minPairEnergy,cutEnergy); 405 if(ignoreCut) cut = minPairEnergy; 406 G4double cross = ComputeMicroscopicCrossSection (kineticEnergy, Z, cut); 407 return cross; 408 } 409 410 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 411 412 G4double G4MuPairProductionModel::CrossSectionPerVolume( 413 const G4Material* material, 414 const G4ParticleDefinition*, 415 G4double kineticEnergy, 416 G4double cutEnergy, 417 G4double maxEnergy) 391 G4double maxEnergy) 418 392 { 419 393 G4double cross = 0.0; 420 394 if (kineticEnergy <= lowestKinEnergy) return cross; 421 395 422 maxEnergy += particleMass; 423 424 const G4ElementVector* theElementVector = material->GetElementVector(); 425 const G4double* theAtomNumDensityVector = material-> 426 GetAtomicNumDensityVector(); 427 428 for (size_t i=0; i<material->GetNumberOfElements(); i++) { 429 G4double Z = (*theElementVector)[i]->GetZ(); 430 SetCurrentElement(Z); 431 G4double tmax = min(maxEnergy,MaxSecondaryEnergy(particle, kineticEnergy)); 432 G4double cut = max(minPairEnergy,cutEnergy); 433 if(ignoreCut) cut = minPairEnergy; 434 if(cut < tmax) { 435 G4double cr = ComputeMicroscopicCrossSection(kineticEnergy, Z, cut) 436 - ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax); 437 438 cross += theAtomNumDensityVector[i] * cr; 439 } 396 SetCurrentElement(Z); 397 G4double tmax = std::min(maxEnergy, kineticEnergy); 398 G4double cut = std::min(cutEnergy, kineticEnergy); 399 if(cut < minPairEnergy) cut = minPairEnergy; 400 if (cut >= tmax) return cross; 401 402 cross = ComputeMicroscopicCrossSection (kineticEnergy, Z, cut); 403 if(tmax < kineticEnergy) { 404 cross -= ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax); 440 405 } 441 406 return cross; … … 451 416 SetCurrentElement(Z); 452 417 453 for (G4int it=0; it<ntdat; it++) 454 { 418 for (G4int it=0; it<ntdat; it++) { 419 455 420 G4double kineticEnergy = tdat[it]; 456 421 G4double maxPairEnergy = MaxSecondaryEnergy(particle,kineticEnergy); 457 422 // G4cout << "Z= " << currentZ << " z13= " << z13 423 //<< " mE= " << maxPairEnergy << G4endl; 458 424 G4double CrossSection = 0.0 ; 459 425 460 G4double y = ymin - 0.5*dy ; 461 G4double yy = ymin - dy ; 462 G4double x = exp(y); 463 G4double fac = exp(dy); 464 G4double dx = exp(yy)*(fac - 1.0); 465 466 G4double c = log(maxPairEnergy/minPairEnergy); 467 468 for (G4int i=0 ; i<nbiny; i++) 469 { 470 y += dy ; 471 if(c > 0.0) { 472 x *= fac; 473 dx*= fac; 474 G4double ep = minPairEnergy*exp(c*x) ; 475 CrossSection += ep*dx*ComputeDMicroscopicCrossSection( 476 kineticEnergy, Z, ep); 477 } 478 ya[i] = y; 479 proba[iz][it][i] = CrossSection; 426 if(maxPairEnergy > minPairEnergy) { 427 428 G4double y = ymin - 0.5*dy ; 429 G4double yy = ymin - dy ; 430 G4double x = exp(y); 431 G4double fac = exp(dy); 432 G4double dx = exp(yy)*(fac - 1.0); 433 434 G4double c = log(maxPairEnergy/minPairEnergy); 435 436 for (G4int i=0 ; i<nbiny; i++) { 437 y += dy ; 438 if(c > 0.0) { 439 x *= fac; 440 dx*= fac; 441 G4double ep = minPairEnergy*exp(c*x) ; 442 CrossSection += 443 ep*dx*ComputeDMicroscopicCrossSection(kineticEnergy, Z, ep); 444 } 445 ya[i] = y; 446 proba[iz][it][i] = CrossSection; 447 } 448 449 } else { 450 for (G4int i=0 ; i<nbiny; i++) { 451 proba[iz][it][i] = CrossSection; 452 } 480 453 } 481 454 482 455 ya[nbiny]=ymax; 483 484 456 proba[iz][it][nbiny] = CrossSection; 485 457 … … 515 487 G4double maxEnergy = std::min(tmax, maxPairEnergy); 516 488 G4double minEnergy = std::max(tmin, minPairEnergy); 517 if(ignoreCut)minEnergy = minPairEnergy; 489 518 490 if(minEnergy >= maxEnergy) return; 519 491 //G4cout << "emin= " << minEnergy << " emax= " << maxEnergy … … 618 590 // primary change 619 591 kineticEnergy -= (ElectronEnergy + PositronEnergy); 620 if(fParticleChange) 621 fParticleChange->SetProposedKineticEnergy(kineticEnergy); 622 else 623 gParticleChange->SetProposedKineticEnergy(kineticEnergy); 592 fParticleChange->SetProposedKineticEnergy(kineticEnergy); 624 593 625 594 vdp->push_back(aParticle1); … … 655 624 G4double maxPairEnergy = MaxSecondaryEnergy(particle,kinEnergy); 656 625 G4double minEnergy = std::max(tmin, minPairEnergy); 657 if(ignoreCut)minEnergy = minPairEnergy;658 626 659 627 G4int iz; -
trunk/source/processes/electromagnetic/polarisation/History
r819 r961 1 $Id: History,v 1.1 5 2007/11/05 10:53:13 schaelic Exp $1 $Id: History,v 1.16 2008/10/30 22:34:23 schaelic Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 19 30 October 08: A.Schaelicke (empolar-V09-01-01) 20 For all process classes set sub-types according to the enumeration 20 21 05 November 07: A.Schaelicke (empolar-V09-00-02) 21 22 01 November 07: A.Schaelicke -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizationHelper.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizationHelper.hh,v 1.2 2007/11/01 17:30:25 schaelic Exp $ 27 // tag $Name: $27 // tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class header file -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizationManager.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizationManager.hh,v 1.1 2006/09/21 21:35:10 vnivanch Exp $ 27 // tag $Name: $27 // tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class header file -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizationMessenger.hh
r819 r961 27 27 // 28 28 // $Id: G4PolarizationMessenger.hh,v 1.2 2006/12/13 15:44:33 gunter Exp $ 29 // tag $Name: $29 // tag $Name: geant4-09-02-ref-02 $ 30 30 // 31 31 // GEANT4 Class header file -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedAnnihilationCrossSection.hh
r819 r961 26 26 // ------------------------------------------------------------------- 27 27 // $Id: G4PolarizedAnnihilationCrossSection.hh,v 1.4 2007/11/01 17:32:34 schaelic Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // ------------------------------------------------------------------- 30 30 // -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedAnnihilationModel.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedAnnihilationModel.hh,v 1.3 2007/07/10 09:38:17 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedBhabhaCrossSection.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedBhabhaCrossSection.hh,v 1.2 2006/11/17 14:14:17 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedBremsstrahlungCrossSection.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedBremsstrahlungCrossSection.hh,v 1.3 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedComptonCrossSection.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedComptonCrossSection.hh,v 1.3 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedComptonModel.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedComptonModel.hh,v 1.2 2007/05/23 08:52:20 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedGammaConversion.hh
r819 r961 26 26 // 27 27 // $Id: G4PolarizedGammaConversion.hh,v 1.2 2007/05/23 08:52:20 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedGammaConversionModel.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedGammaConversionModel.hh,v 1.2 2007/05/23 08:52:20 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedMollerBhabhaModel.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedMollerBhabhaModel.hh,v 1.3 2007/05/23 08:52:20 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // ------------------------------------------------------------------- 29 29 // -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedMollerCrossSection.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedMollerCrossSection.hh,v 1.3 2006/12/13 15:44:36 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedPEEffectCrossSection.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedPEEffectCrossSection.hh,v 1.1 2007/11/01 17:29:09 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedPEEffectModel.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedPEEffectModel.hh,v 1.1 2007/11/01 17:29:09 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedPairProductionCrossSection.hh
r819 r961 25 25 // 26 26 // $Id: G4PolarizedPairProductionCrossSection.hh,v 1.3 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/include/G4PolarizedPhotoElectricEffect.hh
r819 r961 26 26 // 27 27 // $Id: G4PolarizedPhotoElectricEffect.hh,v 1.1 2007/11/01 17:29:09 schaelic Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/polarisation/include/G4StokesVector.hh
r819 r961 25 25 // 26 26 // $Id: G4StokesVector.hh,v 1.4 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class header file -
trunk/source/processes/electromagnetic/polarisation/include/G4VPolarizedCrossSection.hh
r819 r961 25 25 // 26 26 // $Id: G4VPolarizedCrossSection.hh,v 1.4 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // File name: G4VPolarizedCrossSection -
trunk/source/processes/electromagnetic/polarisation/include/G4ePolarizedBremsstrahlung.hh
r819 r961 25 25 // 26 26 // $Id: G4ePolarizedBremsstrahlung.hh,v 1.2 2007/05/23 08:52:20 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/include/G4ePolarizedBremsstrahlungModel.hh
r819 r961 25 25 // 26 26 // $Id: G4ePolarizedBremsstrahlungModel.hh,v 1.2 2007/05/23 08:52:20 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/include/G4ePolarizedIonisation.hh
r819 r961 25 25 // 26 26 // $Id: G4ePolarizedIonisation.hh,v 1.3 2007/06/11 13:37:56 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // ------------------------------------------------------------------- 29 29 // -
trunk/source/processes/electromagnetic/polarisation/include/G4eplusPolarizedAnnihilation.hh
r819 r961 25 25 // 26 26 // $Id: G4eplusPolarizedAnnihilation.hh,v 1.3 2007/06/11 13:37:56 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizationHelper.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizationHelper.cc,v 1.4 2007/11/01 17:30:25 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizationManager.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizationManager.cc,v 1.1 2006/09/21 21:35:11 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizationMessenger.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizationMessenger.cc,v 1.1 2006/09/21 21:35:11 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedAnnihilationCrossSection.cc
r819 r961 26 26 // ------------------------------------------------------------------- 27 27 // $Id: G4PolarizedAnnihilationCrossSection.cc,v 1.6 2007/11/01 17:32:34 schaelic Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // ------------------------------------------------------------------- 30 30 // -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedAnnihilationModel.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizedAnnihilationModel.cc,v 1.6 2007/07/10 09:38:17 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedBhabhaCrossSection.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizedBhabhaCrossSection.cc,v 1.5 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // ------------------------------------------------------------------- 29 29 // -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedBremsstrahlungCrossSection.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizedBremsstrahlungCrossSection.cc,v 1.4 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedCompton.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4PolarizedCompton.cc,v 1. 7 2007/07/10 09:35:37schaelic Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4PolarizedCompton.cc,v 1.9 2008/10/30 22:34:23 schaelic Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 81 81 SetMinKinEnergy(0.1*keV); 82 82 SetMaxKinEnergy(100.0*GeV); 83 SetProcessSubType(fComptonScattering); 83 84 } 84 85 -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedComptonCrossSection.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizedComptonCrossSection.cc,v 1.4 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedComptonModel.cc
r819 r961 26 26 // 27 27 // $Id: G4PolarizedComptonModel.cc,v 1.4 2007/05/23 08:52:20 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedGammaConversion.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PolarizedGammaConversion.cc,v 1. 3 2007/05/23 08:52:20 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4PolarizedGammaConversion.cc,v 1.5 2008/10/30 22:34:23 schaelic Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 55 55 SetMinKinEnergy(2.0*electron_mass_c2); 56 56 SetMaxKinEnergy(100.0*GeV); 57 SetProcessSubType(fGammaConversion); 57 58 } 58 59 -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedGammaConversionModel.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizedGammaConversionModel.cc,v 1.6 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedMollerBhabhaModel.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizedMollerBhabhaModel.cc,v 1.4 2007/05/23 08:52:20 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // ------------------------------------------------------------------- 29 29 // -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedMollerCrossSection.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizedMollerCrossSection.cc,v 1.5 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // ------------------------------------------------------------------- 29 29 // -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedPEEffectCrossSection.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizedPEEffectCrossSection.cc,v 1.1 2007/11/01 17:29:09 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedPEEffectModel.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizedPEEffectModel.cc,v 1.1 2007/11/01 17:29:09 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedPairProductionCrossSection.cc
r819 r961 25 25 // 26 26 // $Id: G4PolarizedPairProductionCrossSection.cc,v 1.5 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedPhotoElectricEffect.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PolarizedPhotoElectricEffect.cc,v 1. 1 2007/11/01 17:29:09schaelic Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4PolarizedPhotoElectricEffect.cc,v 1.3 2008/10/30 22:34:23 schaelic Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 46 46 G4ProcessType type):G4VEmProcess (processName, type), 47 47 isInitialised(false) 48 {} 48 { 49 SetProcessSubType(fPhotoElectricEffect); 50 } 49 51 50 52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/polarisation/src/G4StokesVector.cc
r819 r961 25 25 // 26 26 // $Id: G4StokesVector.cc,v 1.3 2006/11/17 11:59:03 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // GEANT4 Class file -
trunk/source/processes/electromagnetic/polarisation/src/G4VPolarizedCrossSection.cc
r819 r961 25 25 // 26 26 // $Id: G4VPolarizedCrossSection.cc,v 1.4 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // File name: G4VPolarizedCrossSection 29 29 // -
trunk/source/processes/electromagnetic/polarisation/src/G4ePolarizedBremsstrahlung.cc
r819 r961 25 25 // 26 26 // $Id: G4ePolarizedBremsstrahlung.cc,v 1.3 2007/05/23 08:52:20 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/src/G4ePolarizedBremsstrahlungModel.cc
r819 r961 25 25 // 26 26 // $Id: G4ePolarizedBremsstrahlungModel.cc,v 1.4 2007/11/01 17:32:34 schaelic Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/polarisation/src/G4ePolarizedIonisation.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4ePolarizedIonisation.cc,v 1. 5 2007/07/10 09:35:37schaelic Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4ePolarizedIonisation.cc,v 1.7 2008/10/30 22:34:23 schaelic Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // ------------------------------------------------------------------- 30 30 // … … 82 82 SetMaxKinEnergy(100.0*TeV); 83 83 // PrintInfoDefinition(); 84 SetProcessSubType(fIonisation); 84 85 } 85 86 -
trunk/source/processes/electromagnetic/polarisation/src/G4eplusPolarizedAnnihilation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eplusPolarizedAnnihilation.cc,v 1. 6 2007/10/02 11:36:44 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4eplusPolarizedAnnihilation.cc,v 1.8 2008/10/30 22:34:23 schaelic Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 78 78 { 79 79 enableAtRestDoIt = true; 80 SetProcessSubType(fAnnihilation); 80 81 } 81 82 -
trunk/source/processes/electromagnetic/standard/History
r819 r961 1 $Id: History,v 1. 363.2.1 2008/04/25 00:22:53vnivanch Exp $1 $Id: History,v 1.432 2009/02/20 12:11:37 vnivanch Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 18 18 ---------------------------------------------------------- 19 19 20 25 April 08: V.Ivant (emstand-V09-00-23) 21 G4UrbanMscModel90, G4UrbanMscModel - fixed assymetry of lateral displacement 22 G4ionIonisation - use linLossLimit 0.15 as it was in 9.1 23 G4IonFluctuations - fixed discontinuity of width of the energy loss for small 24 velocities (very long alpha events) 20 20 February 09: V.Ivant (emstand-V09-02-00) 21 - Move all virtual methods from inline to source 22 G4PEEffectModel - substitute ComputeMeanFreePath by CrossSectionPerVolume 23 (minor CPU speadup for compound materials) 24 G4PAIModel, G4PAIPhotonModel - remove usage of random numbers at 25 initialisation (potential non-reproducibility) 26 G4WentzelVIModel - use generic methods of G4VMscModel to access safety 27 and other geometry information 28 29 24 November 08: V.Ivant (emstand-V09-01-45) 30 G4PSTARStopping, G4ASTARStopping - fixed non-initialized variable 31 introduced in the previous tag 32 33 19 November 08: V.Ivant (emstand-V09-01-44) 34 G4WentzelVIModel - minor fix in lateral displacement 35 36 13 November 08: A. Schaelicke (emstand-V09-01-43) 37 G4eBremsstrahlung - activate LPM switch for high energy model 38 G4eBremsstrahlungRelModel - revised LPMconstant 39 G4eBremsstrahlungModel, G4eBremsstrahlungRelModel - (VI) use LPM flag 40 from the base class 41 42 13 November 08: V.Ivant (emstand-V09-01-42) 43 G4PSTARStopping - fixed SiO2 and TEFLON data 44 G4ASTARStopping - fixed GRAFITE data 45 46 29 October 08: V.Ivant (emstand-V09-01-41) 47 G4UrbanMscModel, G4UrbanMscModel2, G4UrbanMscModel90, G4WentzelVIModel 48 use StepStatus from preStepPoint to identify first step for a given track 49 instaed of step number in order to address ATLAS problem of small step 50 limits happen with suspended tracks 51 52 27 October 08: V.Ivant (emstand-V09-01-40) 53 G4UrbanMscModel2 - extra protection for "UseDistanceToBoundary" option 54 G4WentzelVIModel - fixed cross section factor for single scattering 55 56 23 October 08: V.Ivant (emstand-V09-01-39) 57 G4eCoulombScatteringModel and G4WentzelVIModel - added protection against 58 precision loss in computation of cross section at high energy 59 G4UrbanMscModel2 - fixed screening parameter of the single scattering part 60 G4eMultipleScattering - set default RangeFactor = 0.04 61 62 22 October 08: V.Ivant (emstand-V09-01-38) 63 G4IonFluctuations - added G4UniversalFluctuation model, which are used for 64 high energy; added comments and cleanup 65 G4BetheBlochModel, G4BraggIonModel - take into account effective change 66 change over the step 67 G4hIonisation - switch off nuclear stopping for pi and K mesons 68 69 20 October 08: V.Ivant (emstand-V09-01-37) 70 G4UrbanMscModel2 - return back ref-08 version 71 G4IronStopping, G4MaterialStopping, G4SimpleMaterialStopping moved to materials 72 G4eBremsstrahlungHEModel - temporary model is removed 73 74 17 October 08: V.Ivant (emstand-V09-01-36) 75 G4UrbanMscModel2 - use logic of 9.1 version for step limitation 76 option "UseSafety" to fix CPU penalty in sampling 77 calorimeters (L.Urban) 78 G4UrbanMscModel2, G4UrbanMscModel, G4UrbanMscModel90 added protection 79 against sampling scattering angle with zero transport 80 cross section 81 82 15 October 08: V.Ivant (emstand-V09-01-35) 83 For all process classes set sub-types according to the enumeration 84 of G4EmProcessSubType.hh, improved cout 85 G4UrbanMscModel2 - use screning function from G4eCoulombScatteringModel 86 G4eBremsstrahlung - set relativistic model above 1 GeV by default 87 G4eBremsstrahlungModel, G4eBremsstrahlungRelModel removed private member 88 highEnergyTh and use access method to this threshold in the base class 89 90 21 September 08: V.Ivant (emstand-V09-01-34) 91 G4BetheBlochModel, G4BraggModel, G4BraggIonModel - simplified new methods 92 G4ionIonisation - use the same low-energy model for He ions and GenericIons 93 (like it was in 9.2beta) 94 95 16 September 08: V.Ivant (emstand-V09-01-33) 96 G4UrbanMscModel, G4UrbanMscModel2, G4UrbanMscModel90 - do not use 97 string comparison when compute transport cross section, instead 98 compare masses (G.Cosmo) 99 100 12 September 08: V.Ivant (emstand-V09-01-32) 101 Improved verbose output for processes 102 G4IonFluctuations - do not use Poisson sampling 103 G4BetheBlochModel, G4BraggModel, G4BraggIonModel - added methods 104 GetParticleCharge, GetChargeSquareRatio, CorrectionsAlongStep 105 needed for ions; define low and high energy limits inside the model 106 G4ionIonisation, G4hIonisation - remove InitialiseMassCharge and 107 CorrectionsAlongStep methods; 108 limits of kinetic energy for models 109 taken from the base class and from 110 models; separate trietment He ions 111 112 09 September 08: V.Ivant (emstand-V09-01-31) 113 G4WaterStopping, G4IronStopping, G4MaterialStopping, 114 G4SimpleMaterialStopping - use mass number instead of atomic mass 115 (A.Lechner proposal) 116 G4eBremsstrahlungModel - Migdal constant set to the vavue of 117 G4eBremsstrahlungRelModel (A.Schaelicke) 118 119 28 August 08: V.Ivant (emstand-V09-01-30) 120 G4WaterStopping, G4IronStopping - add method AddData to speeed up 121 compillation and cleanup 122 G4WentzelVIModel - fixed bug in lateral displacement 123 124 26 August 08: A.Schaelicke 125 G4eBremsstrahlungRelModel 126 * define threshold energy for LPM effect 127 * fix LPM calculation 128 * define Thomas-fermi FF (ala Tsai) 129 * some speed improvements 130 131 25 August 08: V.Ivant (emstand-V09-01-29) 132 G4MaterialStopping, G4SimpleMaterialStopping - fixed compillation 133 problem at Windows by adding a new method AddData 134 135 25 August 08: V.Ivant (emstand-V09-01-28) 136 23 August 08: V.Ivant (emstand-V09-01-27) 137 G4UrbanMscModel2 - fixed NaN in sampling of cosine theta for 50 GeV e- 138 139 22 August 08: V.Ivant (emstand-V09-01-26) 140 Added new classes with stopping data G4MaterialStopping, 141 G4SimpleMaterialStopping, G4IronStopping 142 143 13 August 08: V.Ivant (emstand-V09-01-25) 144 G4eCoulombScatteringModel - added extra protection for precision lost in 145 computation of recoil energy 146 G4eBremsstrahlungModel, G4eBremsstrahlungHEModel - define more precise names 147 of models 148 149 11 August 08: V.Ivant (emstand-V09-01-24) 150 G4IonFluctuations - do not perform loop over elements of material but use 151 effetive Z 152 G4UrbanMscModel2 - bug fix in ComputeTruePathLengthLimit (L.Urban) 153 154 4 August 08: V.Ivant (emstand-V09-01-23) 155 G4eMultipleScattering - allowed to be applied for all changed particles 156 G4UrbanMscModel2 - changed name to "UrbanMscUni2" 157 G4eCoulombScatteringModel and G4WentzelVIModel - added protections for ions 158 G4WaterStopping - added extra data 159 160 31 July 08: V.Ivant (emstand-V09-01-22) 161 G4WentzelVIModel, G4eCoulombScatteringModel, G4CoulombScatteringModel - 162 do not define min and max energy in constructor but use Set 163 methods 164 G4MultipleScattering, G4eMultipleScattering, G4hMultipleScattering - 165 added cout of model names 166 G4CoulombScattering - set angular limit of models by Set method 167 168 24 July 08: V.Ivant (emstand-V09-01-21) 169 G4UrbanMscModel2 - central part of scattering angle (theta0) and 170 tail of the scattering angle distribution have been tuned 171 using some e- and proton scattering data (L.Urban) 172 173 21 July 08: V.Ivant (emstand-V09-01-20) 174 G4eCoulombScatteringModel, G4CoulombScatteringModel - added usage of 175 G4ElementSelector vector, do not use A in SetupTarget method 176 G4WentzelVIModel - do not use A in SetupTarget method 177 178 16 June 08: V.Ivant (emstand-V09-01-19) 179 G4PAIPhotonModel - change model name 180 G4MultipleScattering71 - move inline virtual method to source to avoid 181 compillation warning 182 183 14 June 08: V.Ivant (emstand-V09-01-18) 184 - G4CoulombScattering - added SetHEModelLimit method to provide more easy 185 initialisation 186 187 11 June 08: V.Ivant (emstand-V09-01-17) 188 - G4eCoulombScatteringModel - SelectIsotope method moved from the derived 189 class and sampling of the recoil ion is performed 190 - G4CoulombScatteringModel - SelectIsotope method moved to the base class 191 - G4PAIxSection - new functions for resonance and Rutherford collisions 192 - G4IonFluctuations - fixed index 193 - G4ionIonisation - use G4BraggModel for low-energy ions heavier than He 194 - G4hIonisation - build separate tables for kaons to allow use hadron 195 bremsstrahlung and pair production by kaons 196 197 2 June 08: V.Ivant (emstand-V09-01-16) 198 - G4IonFluctuations - added method SetParticleAndCharge 199 - G4ionIonisation, G4ionGasIonisation - added pointer to G4IonFluctuations 200 and use of method SetParticleAndCharge; compute nuclear 201 stopping before adding corrections 202 203 20 May 08: V.Ivant (emstand-V09-01-15) 204 - G4IonFluctuations - summed fluctuation of components of a mixture instead 205 of computation for average Z 206 - G4BetheBlochModel - added projectile form-factor in computation of max 207 energy transfer and in sampling of the energy of e- 208 209 13 May 08: A.Schaelicke 210 - G4eBremsstrahlungHEModel - new model, which is an extension of the standard 211 bremsstrahlung model using a more sophisticated 212 LPM approach 213 214 09 May 08: V.Ivant (emstand-V09-01-14) 215 - G4hMultipleScattering - added method AlongStepGetPhysicalInteractionLength 216 in which for ions scaled energy normalized to one nucleon is used 217 - G4ionGasIonisation - fixed bug in update of the dynamic charge of 218 an ion 219 220 21 April 08: V.Ivant (emstand-V09-01-13) 221 - G4WentzelVIModel - new model of multiple scattering 222 - G4WaterStopping - use spline 223 - G4hMultipleScattering - do not build tables for particles with mass > GeV 224 - G4ionIonisation, G4ionGasIonisation - updated usage of high order 225 corrections 226 - G4CoulombScattering, G4eCoulombScatteringModel - use new parameter 227 polarAngleLimit 228 229 9 April 08: V.Ivant (emstand-V09-01-12) 230 - G4UrbanMscModel, G4UrbanMscModel90 - fixed assymetry in transverse 231 displacement 232 - G4eCoulombScatteringModel - fixed bug for compounds 233 234 31 March 08: V.Ivant (emstand-V09-01-11) 235 - G4eCoulombScatteringModel - use SelectAtomRandomly method 236 - G4UrbanMscModel2 (L.Urban): 237 - Simplification of step limitation in ComputeTruePathLengthLimit, 238 + tlimitmin is the same for UseDistancetoBoundary and UseSafety 239 - Reorganization of SampleCosineTheta + new method SimpleScattering 240 SimpleScattering is used if the relative energy loss is too big 241 or theta0 is too big (see data members rellossmax, theta0max) 242 - Tuning of the correction factor in ComputeTheta0 243 - exponent c of the 'tail' model function is not equal to 2 any more, 244 value of c has been extracted from some e- scattering data 245 - Step limitation in ComputeTruePathLengthLimit has been 246 simplified further + some data members have been removed 247 248 25 March 08: V.Ivant (emstand-V09-01-10) 249 - G4BetheBlochModel - use formfactor for sampling 250 - G4eCoulombScatteringModel - remove unsued array 251 252 25 March 08: V.Ivant (emstand-V09-01-09) 253 - G4ionIonisation - use default linLossLimit of 9.1 254 - G4hIonisation - use G4IonFluctuations at low energies 255 - G4IonFluctuations - fixed computation of corrections 256 - G4BetheBlochModel - finite size correction is taken into 257 account both for delta-electron cross section and DEDX 258 - G4eCoulombScatteringModel - reorganize and cleanup computation 259 of cross section 260 261 14 March 08: V.Ivant (emstand-V09-01-08) 262 - G4UrbanMscModel2 - L.Urban fix assymetry in lateral displacement 263 - G4UrbanMscModel90, G4MscModel71 - fixed warnings for gcc 4.3.0 264 265 10 March 08: V.Ivant (emstand-V09-01-07) 266 - G4MultipleScattering, G4hMultipleScattering, G4UrbanMscModel, 267 G4UrbanMscModel2, G4UrbanMscModel90 uses G4VMscModel interface 268 - G4eMultipleScattering - new process specialized for e+,e- 269 270 06 March 08: V.Ivant (emstand-V09-01-06) 271 - G4UrbanMscModel2 is cloned from G4UrbanMscModel 272 - SubType for all processes is initialized 273 274 20 February 08: V.Ivant (emstand-V09-01-05) 275 G4eCoulombScatteringModel - speedup run-time computations using 276 precomputed nuclear form-factors per element 277 278 14 February 08: V.Ivant (emstand-V09-01-04) 279 - G4ionIonisation, G4ionGasIonisation - use new method to compute 280 corrections: IonHighOrderCorrections 281 - G4BetheBlochModel - when computing dedx for ions use new 282 method IonBarkasCorrection 283 - G4IonFluctuations - added protection to the computation of 284 the correction factor to dispersion which provide smooth 285 transition to small velocities of an ion 286 287 04 February 08: V.Ivant (emstand-V09-01-03) 288 - G4hIonisation, G4ionIonisation, G4ionGasIonisation - add extra 289 protections in computation of non-ionizing energy loss 290 291 04 February 08: V.Ivant (emstand-V09-01-02) 292 G4IonFluctuations - added protection in computation of dispersion 293 on allowing have a corrected dispersion below Bohr value 25 294 26 295 16 January 08: V.Ivant (emstand-V09-01-01) 27 G4PAIModel, G4PAIPhotonModel - added an extra protection g aranteed28 correct usage of the last bin of the table of nergy transfers296 G4PAIModel, G4PAIPhotonModel - added an extra protection guaranteed 297 correct usage of the last bin of the table of energy transfers 29 298 30 299 14 January 08: V.Ivant (emstand-V09-01-00) 31 300 - G4hIonisation, G4ionIonisation, G4ionGasIonisation - fixed 32 computation of non-ionizing energy loss: at the last ioniz tion step301 computation of non-ionizing energy loss: at the last ionization step 33 302 and at energies above 2 MeV for protons; 34 - G4eCoulombScatteringModel - use more safe numerical e spression303 - G4eCoulombScatteringModel - use more safe numerical expression 35 304 36 305 07 December 07: V.Ivant (emstand-V09-00-22) … … 82 351 particle type (electron, muons, others) 83 352 - tuning ComputeGeomPathLength in order to get better low 84 energy behavio ur for heavy particles (mu, hadrons)353 energy behavior for heavy particles (mu, hadrons) 85 354 - small modification of theta0 in ComputeTheta0 (based on data) 86 355 - some old inconsistency/bug has been cured in SampleCosineTheta … … 115 384 - G4eCoulombScatteringModel and G4CoulombScatteringModel - fixed bug in 116 385 computation of screening parameters in SampleSecondary method; 117 reorgani sed initialisation of kinematics and screening parameters;386 reorganized initialisation of kinematics and screening parameters; 118 387 used Z(Z+1) factor to take into account scattering off e- 119 388 … … 149 418 - G4ionIonisation - remove obsolete method DefineMassCharge 150 419 - G4ionGasIonisation - new ion ionisation process with descrete ion charge and 151 no equilibrium b tween ion and media420 no equilibrium between ion and media 152 421 - G4BraggModel, G4BraggIonModel - more safe computation of scattering angle 153 422 … … 190 459 void, extra parameter std::vector<G4DynamicParticle*>*, all 191 460 classes using or inhereting this interface are modified. 192 About 5% spe adup of EM shower simulation461 About 5% speedup of EM shower simulation 193 462 194 463 21 May 07: V.Ivanchenko (emstand-V08-03-05) … … 203 472 204 473 18 May 07: V.Ivanchenko (emstand-V08-03-02) 205 - G4MultipleScattering, G4hMultipleScattering - reorgani semethods474 - G4MultipleScattering, G4hMultipleScattering - reorganized methods 206 475 for setting msc 207 476 parameters 208 - G4UrbanMscModel - reorgani seinitialisation; use G4MscStepLimitType477 - G4UrbanMscModel - reorganized initialisation; use G4MscStepLimitType 209 478 enumerator to choose step limit algorithm 210 479 -
trunk/source/processes/electromagnetic/standard/include/G4ASTARStopping.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ASTARStopping.hh,v 1. 5 2006/06/29 19:49:58 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4ASTARStopping.hh,v 1.6 2008/11/13 12:04:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 29 29 #ifndef G4ASTARStopping_h … … 86 86 G4double e[74][78], kinE[78]; 87 87 G4double effZ[74]; 88 G4int Znum[74];89 88 }; 90 89 -
trunk/source/processes/electromagnetic/standard/include/G4BetheBlochModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BetheBlochModel.hh,v 1. 9 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4BetheBlochModel.hh,v 1.17 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 45 45 // 12-11-03 Fix for GenericIons (V.Ivanchenko) 46 46 // 24-03-05 Add G4EmCorrections (V.Ivanchenko) 47 // 11-04-05 Major optimisation of internal interfaces (V.Ivan tchenko)47 // 11-04-05 Major optimisation of internal interfaces (V.Ivanchenko) 48 48 // 11-04-04 Move MaxSecondaryEnergy to models (V.Ivanchenko) 49 49 // 11-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma) 50 // 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio, 51 // CorrectionsAlongStep needed for ions(V.Ivanchenko) 50 52 51 53 // … … 65 67 class G4EmCorrections; 66 68 class G4ParticleChangeForLoss; 69 class G4NistManager; 70 67 71 68 72 class G4BetheBlochModel : public G4VEmModel … … 78 82 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 79 83 80 G4double MinEnergyCut(const G4ParticleDefinition*,81 const G4MaterialCutsCouple*);84 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 85 const G4MaterialCutsCouple*); 82 86 83 87 virtual G4double ComputeCrossSectionPerElectron( … … 105 109 G4double cutEnergy); 106 110 111 virtual G4double GetChargeSquareRatio(const G4ParticleDefinition* p, 112 const G4Material* mat, 113 G4double kineticEnergy); 114 115 virtual G4double GetParticleCharge(const G4ParticleDefinition* p, 116 const G4Material* mat, 117 G4double kineticEnergy); 118 119 virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*, 120 const G4DynamicParticle*, 121 G4double& eloss, 122 G4double& niel, 123 G4double length); 124 107 125 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 108 126 const G4MaterialCutsCouple*, … … 113 131 protected: 114 132 115 G4double MaxSecondaryEnergy(const G4ParticleDefinition*,116 G4double kinEnergy);133 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 134 G4double kinEnergy); 117 135 118 136 private: … … 125 143 126 144 const G4ParticleDefinition* particle; 145 const G4Material* currentMaterial; 127 146 G4ParticleDefinition* theElectron; 128 147 G4EmCorrections* corr; 129 148 G4ParticleChangeForLoss* fParticleChange; 149 G4NistManager* nist; 130 150 131 151 G4double mass; 132 152 G4double tlimit; 133 153 G4double spin; 154 G4double magMoment2; 134 155 G4double chargeSquare; 135 156 G4double ratio; 157 G4double formfact; 136 158 G4double twoln10; 137 159 G4double bg2lim; 138 160 G4double taulim; 161 G4double corrFactor; 139 162 G4bool isIon; 163 G4bool isInitialised; 140 164 }; 141 165 142 166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 143 167 144 inline G4double G4BetheBlochModel::MaxSecondaryEnergy(145 const G4ParticleDefinition* pd,146 G4double kinEnergy)147 {148 if(isIon) SetParticle(pd);149 G4double tau = kinEnergy/mass;150 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /151 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);152 return std::min(tmax,tlimit);153 }154 155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....156 157 inline void G4BetheBlochModel::SetParticle(const G4ParticleDefinition* p)158 {159 if(particle != p) {160 particle = p;161 mass = particle->GetPDGMass();162 spin = particle->GetPDGSpin();163 G4double q = particle->GetPDGCharge()/eplus;164 chargeSquare = q*q;165 ratio = electron_mass_c2/mass;166 if(mass > 120.*MeV) tlimit = 51.2*GeV*std::pow(proton_mass_c2/mass,0.66667);167 }168 }169 170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....171 172 168 #endif -
trunk/source/processes/electromagnetic/standard/include/G4BetheHeitlerModel.hh
r819 r961 25 25 // 26 26 // $Id: G4BetheHeitlerModel.hh,v 1.6 2007/05/22 17:34:36 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/standard/include/G4BohrFluctuations.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BohrFluctuations.hh,v 1. 3 2007/09/27 13:53:11vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4BohrFluctuations.hh,v 1.4 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 79 79 void InitialiseMe(const G4ParticleDefinition*); 80 80 81 protected:82 83 81 private: 84 82 … … 103 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 104 102 105 106 inline G4double G4BohrFluctuations::Dispersion(107 const G4Material* material,108 const G4DynamicParticle* dp,109 G4double& tmax,110 G4double& length)111 {112 if(!particle) InitialiseMe(dp->GetDefinition());113 114 G4double electronDensity = material->GetElectronDensity();115 kineticEnergy = dp->GetKineticEnergy();116 G4double etot = kineticEnergy + particleMass;117 beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);118 G4double siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length119 * electronDensity * chargeSquare;120 121 return siga;122 }123 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....125 126 103 #endif 127 104 -
trunk/source/processes/electromagnetic/standard/include/G4BraggIonModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BraggIonModel.hh,v 1. 8 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4BraggIonModel.hh,v 1.12 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 43 43 // 15-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma) 44 44 // 25-04-06 Add stopping data from ASTAR (V.Ivanchenko) 45 // 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio, 46 // CorrectionsAlongStep needed for ions(V.Ivanchenko) 45 47 46 48 // … … 48 50 // 49 51 // Implementation of energy loss and delta-electron production 50 // by heavy slow charged particles using eveluated data 52 // by heavy slow charged particles using ICRU'49 and NIST evaluated data 53 // for He4 ions 51 54 52 55 // ------------------------------------------------------------------- … … 60 63 61 64 class G4ParticleChangeForLoss; 65 class G4EmCorrections; 62 66 63 67 class G4BraggIonModel : public G4VEmModel … … 73 77 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 74 78 75 G4double MinEnergyCut(const G4ParticleDefinition*,76 const G4MaterialCutsCouple*);79 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 80 const G4MaterialCutsCouple*); 77 81 78 82 virtual G4double ComputeCrossSectionPerElectron( … … 106 110 G4double maxEnergy); 107 111 112 // Compute ion charge 113 virtual G4double GetChargeSquareRatio(const G4ParticleDefinition*, 114 const G4Material*, 115 G4double kineticEnergy); 116 117 virtual G4double GetParticleCharge(const G4ParticleDefinition* p, 118 const G4Material* mat, 119 G4double kineticEnergy); 120 121 // add correction to energy loss and ompute non-ionizing energy loss 122 virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*, 123 const G4DynamicParticle*, 124 G4double& eloss, 125 G4double& niel, 126 G4double length); 127 108 128 protected: 109 129 110 G4double MaxSecondaryEnergy(const G4ParticleDefinition*,111 G4double kinEnergy);130 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 131 G4double kinEnergy); 112 132 113 133 private: … … 133 153 G4double DEDX(const G4Material* material, G4double kineticEnergy); 134 154 155 G4EmCorrections* corr; 156 135 157 const G4ParticleDefinition* particle; 136 158 G4ParticleDefinition* theElectron; … … 144 166 G4double massRate; 145 167 G4double ratio; 146 G4double highKinEnergy;147 G4double lowKinEnergy;148 168 G4double lowestKinEnergy; 149 169 G4double HeMass; 150 170 G4double massFactor; 171 G4double corrFactor; 151 172 G4double rateMassHe2p; 152 173 G4double theZieglerFactor; … … 154 175 G4int iMolecula; // index in the molecula's table 155 176 G4bool isIon; 177 G4bool isInitialised; 156 178 }; 157 158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......159 160 inline G4double G4BraggIonModel::MaxSecondaryEnergy(161 const G4ParticleDefinition* pd,162 G4double kinEnergy)163 {164 if(pd != particle) SetParticle(pd);165 G4double tau = kinEnergy/mass;166 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /167 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);168 return tmax;169 }170 179 171 180 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/include/G4BraggModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BraggModel.hh,v 1.1 0 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4BraggModel.hh,v 1.13 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 45 45 // 11-04-05 Major optimisation of internal interfaces (V.Ivantchenko) 46 46 // 15-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma) 47 // 25-04-06 Add stopping data from PSTAR (V.Ivanchenko) 47 // 25-04-06 Added stopping data from PSTAR (V.Ivanchenko) 48 // 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio, 49 // CorrectionsAlongStep needed for ions(V.Ivanchenko) 48 50 49 51 // … … 51 53 // 52 54 // Implementation of energy loss and delta-electron production 53 // by heavy slow charged particles using eveluated data 55 // by heavy slow charged particles using ICRU'49 and NIST evaluated data 56 // for protons 54 57 55 58 // ------------------------------------------------------------------- … … 63 66 64 67 class G4ParticleChangeForLoss; 68 class G4EmCorrections; 65 69 66 70 class G4BraggModel : public G4VEmModel … … 76 80 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 77 81 78 G4double MinEnergyCut(const G4ParticleDefinition*,79 const G4MaterialCutsCouple*);82 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 83 const G4MaterialCutsCouple*); 80 84 81 85 virtual G4double ComputeCrossSectionPerElectron( … … 109 113 G4double maxEnergy); 110 114 115 // Compute ion charge 116 virtual G4double GetChargeSquareRatio(const G4ParticleDefinition*, 117 const G4Material*, 118 G4double kineticEnergy); 119 120 virtual G4double GetParticleCharge(const G4ParticleDefinition* p, 121 const G4Material* mat, 122 G4double kineticEnergy); 123 124 // add correction to energy loss and compute non-ionizing energy loss 125 virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*, 126 const G4DynamicParticle*, 127 G4double& eloss, 128 G4double& niel, 129 G4double length); 130 111 131 protected: 112 132 113 G4double MaxSecondaryEnergy(const G4ParticleDefinition*,114 G4double kinEnergy);133 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 134 G4double kinEnergy); 115 135 116 136 private: 117 137 118 void SetParticle(const G4ParticleDefinition* p);138 inline void SetParticle(const G4ParticleDefinition* p); 119 139 120 140 G4bool HasMaterial(const G4Material* material); … … 139 159 G4BraggModel & operator=(const G4BraggModel &right); 140 160 G4BraggModel(const G4BraggModel&); 161 162 163 G4EmCorrections* corr; 141 164 142 165 const G4ParticleDefinition* particle; … … 150 173 G4double massRate; 151 174 G4double ratio; 152 G4double highKinEnergy;153 G4double lowKinEnergy;154 175 G4double lowestKinEnergy; 155 176 G4double protonMassAMU; … … 159 180 G4int iMolecula; // index in the molecula's table 160 181 G4bool isIon; 182 G4bool isInitialised; 161 183 }; 162 163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......164 165 inline G4double G4BraggModel::MaxSecondaryEnergy(166 const G4ParticleDefinition* pd,167 G4double kinEnergy)168 {169 if(pd != particle) SetParticle(pd);170 G4double tau = kinEnergy/mass;171 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /172 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);173 return tmax;174 }175 184 176 185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/include/G4ComptonScattering.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4ComptonScattering.hh,v 1.2 0 2007/05/23 08:47:34vnivanch Exp $28 // GEANT4 tag $Name: $27 // $Id: G4ComptonScattering.hh,v 1.21 2009/02/20 12:06:37 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //------------------ G4ComptonScattering physics process ----------------------- … … 82 82 83 83 // true for Gamma only. 84 G4bool IsApplicable(const G4ParticleDefinition&);84 virtual G4bool IsApplicable(const G4ParticleDefinition&); 85 85 86 86 // Print few lines of informations about the process: validity range, 87 87 virtual void PrintInfo(); 88 89 88 90 89 protected: … … 97 96 }; 98 97 99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....101 102 inline103 G4bool G4ComptonScattering::IsApplicable(const G4ParticleDefinition& p)104 {105 return (&p == G4Gamma::Gamma());106 }107 108 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 109 99 -
trunk/source/processes/electromagnetic/standard/include/G4ComptonScattering52.hh
r819 r961 26 26 // 27 27 // $Id: G4ComptonScattering52.hh,v 1.4 2007/05/16 14:00:56 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //------------------ G4ComptonScattering52 physics process ----------------------- -
trunk/source/processes/electromagnetic/standard/include/G4CoulombScattering.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CoulombScattering.hh,v 1. 8 2007/07/31 17:24:04vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4CoulombScattering.hh,v 1.12 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 65 65 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 66 66 67 void SetThetaMin(G4double);67 inline void SetThetaMin(G4double); 68 68 69 void SetThetaMax(G4double);69 inline void SetThetaMax(G4double); 70 70 71 void SetQ2Max(G4double); 71 inline void SetQ2Max(G4double); 72 73 // Set energy above which high energy model will be used 74 inline void SetHEModelLimit(G4double); 72 75 73 76 // obsolete method to be removed 74 void SetBuildTableFlag(G4bool);77 inline void SetBuildTableFlag(G4bool); 75 78 76 79 // Print out of the class parameters … … 101 104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 102 105 103 inline G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p)104 {105 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());106 }107 108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....109 110 106 inline void G4CoulombScattering::SetThetaMin(G4double val) 111 107 { … … 132 128 {} 133 129 130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 131 132 inline void G4CoulombScattering::SetHEModelLimit(G4double val) 133 { 134 thEnergy = val; 135 thEnergyElec = val; 136 } 137 134 138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 135 139 -
trunk/source/processes/electromagnetic/standard/include/G4CoulombScatteringModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CoulombScatteringModel.hh,v 1.1 1 2007/10/09 08:16:29vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4CoulombScatteringModel.hh,v 1.15 2008/07/31 13:11:34 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 44 44 // 19.10.06 V.Ivanchenko use inheritance from G4eCoulombScatteringModel 45 45 // 09.10.07 V.Ivanchenko reorganized methods, add cut dependence in scattering off e- 46 // 09.06.08 V.Ivanchenko SelectIsotope is moved to the base class 46 47 // 47 48 // Class Description: … … 64 65 #include "globals.hh" 65 66 66 class G4ParticleTable;67 class G4NistManager;68 69 67 class G4CoulombScatteringModel : public G4eCoulombScatteringModel 70 68 { … … 72 70 public: 73 71 74 G4CoulombScatteringModel(G4double thetaMin = 0.0, G4double thetaMax = pi, 75 G4bool build = false, G4double tlim = TeV*TeV, 76 const G4String& nam = "CoulombScattering"); 72 G4CoulombScatteringModel(const G4String& nam = "CoulombScattering"); 77 73 78 74 virtual ~G4CoulombScatteringModel(); … … 94 90 private: 95 91 96 G4double SelectIsotope(const G4Element*);97 98 92 // hide assignment operator 99 93 G4CoulombScatteringModel & operator=(const G4CoulombScatteringModel &right); 100 94 G4CoulombScatteringModel(const G4CoulombScatteringModel&); 101 95 102 G4ParticleTable* theParticleTable;103 const G4NistManager* theMatManager;104 96 }; 105 97 -
trunk/source/processes/electromagnetic/standard/include/G4GammaConversion.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4GammaConversion.hh,v 1.2 2 2007/05/23 08:47:34vnivanch Exp $28 // GEANT4 tag $Name: $27 // $Id: G4GammaConversion.hh,v 1.23 2009/02/20 12:06:37 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 85 85 86 86 // true for Gamma only. 87 G4bool IsApplicable(const G4ParticleDefinition&);87 virtual G4bool IsApplicable(const G4ParticleDefinition&); 88 88 89 89 // Print few lines of informations about the process: validity range, … … 99 99 }; 100 100 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....103 104 inline G4bool G4GammaConversion::IsApplicable(const G4ParticleDefinition& p)105 {106 return (&p == G4Gamma::Gamma());107 }108 109 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 110 102 -
trunk/source/processes/electromagnetic/standard/include/G4InitXscPAI.hh
r819 r961 26 26 // 27 27 // $Id: G4InitXscPAI.hh,v 1.8 2006/06/29 19:50:22 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/standard/include/G4IonFluctuations.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4IonFluctuations.hh,v 1. 3 2007/09/27 13:53:11vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4IonFluctuations.hh,v 1.9 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 41 41 // 42 42 // 16-10-03 Changed interface to Initialisation (V.Ivanchenko) 43 // 01-06-08 Added initialisation of effective charge prestep (V.Ivanchenko) 43 44 // 44 45 // Class Description: … … 54 55 55 56 #include "G4VEmFluctuationModel.hh" 57 #include "G4ParticleDefinition.hh" 58 #include "G4UniversalFluctuation.hh" 56 59 57 60 class G4IonFluctuations : public G4VEmFluctuationModel … … 64 67 virtual ~G4IonFluctuations(); 65 68 69 // Sample fluctuations 66 70 G4double SampleFluctuations(const G4Material*, 67 71 const G4DynamicParticle*, 68 G4double&,69 G4double&,70 G4double&);72 G4double& tmax, 73 G4double& length, 74 G4double& meanLoss); 71 75 72 G4double Dispersion( const G4Material*, 73 const G4DynamicParticle*, 74 G4double&, 75 G4double&); 76 // Compute dispertion 77 G4double Dispersion(const G4Material*, 78 const G4DynamicParticle*, 79 G4double& tmax, 80 G4double& length); 76 81 82 // Initialisation prerun 77 83 void InitialiseMe(const G4ParticleDefinition*); 84 85 // Initialisation prestep 86 void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2); 78 87 79 88 private: 80 89 81 G4double CoeffitientA(G4double&); 82 G4double CoeffitientB(const G4Material*, G4double&); 83 G4double RelativisticFactor(const G4Material*, G4double&); 90 G4double Factor(const G4Material*, G4double Zeff); 91 G4double RelativisticFactor(const G4Material*, G4double Zeff); 84 92 85 93 // hide assignment operator … … 87 95 G4IonFluctuations(const G4IonFluctuations&); 88 96 97 G4UniversalFluctuation uniFluct; 89 98 const G4ParticleDefinition* particle; 90 99 … … 92 101 G4double charge; 93 102 G4double chargeSquare; 94 G4double chargeSqRatio;103 G4double effChargeSquare; 95 104 96 105 // data members to speed up the fluctuation calculation 106 G4double parameter; 97 107 G4double minNumberInteractionsBohr; 98 108 G4double theBohrBeta2; -
trunk/source/processes/electromagnetic/standard/include/G4KleinNishinaCompton.hh
r819 r961 25 25 // 26 26 // $Id: G4KleinNishinaCompton.hh,v 1.9 2007/05/22 17:34:36 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/standard/include/G4MollerBhabhaModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MollerBhabhaModel.hh,v 1. 19 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4MollerBhabhaModel.hh,v 1.20 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 74 74 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 75 75 76 G4double MinEnergyCut(const G4ParticleDefinition*,77 const G4MaterialCutsCouple*);76 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 77 const G4MaterialCutsCouple*); 78 78 79 79 virtual G4double ComputeCrossSectionPerElectron( … … 109 109 protected: 110 110 111 G4double MaxSecondaryEnergy(const G4ParticleDefinition*,112 G4double kinEnergy);111 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 112 G4double kinEnergy); 113 113 114 void SetParticle(const G4ParticleDefinition* p);114 inline void SetParticle(const G4ParticleDefinition* p); 115 115 116 116 const G4ParticleDefinition* particle; … … 127 127 G4MollerBhabhaModel & operator=(const G4MollerBhabhaModel &right); 128 128 G4MollerBhabhaModel(const G4MollerBhabhaModel&); 129 130 G4bool isInitialised; 131 129 132 }; 130 133 131 134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 132 135 133 inline G4double G4MollerBhabhaModel::MaxSecondaryEnergy( 134 const G4ParticleDefinition*, 135 G4double kinEnergy) 136 inline void G4MollerBhabhaModel::SetParticle(const G4ParticleDefinition* p) 136 137 { 137 G4double tmax = kinEnergy; 138 if(isElectron) tmax *= 0.5; 139 return tmax; 138 particle = p; 139 if(p != theElectron) isElectron = false; 140 140 } 141 141 -
trunk/source/processes/electromagnetic/standard/include/G4MscModel71.hh
r819 r961 25 25 // 26 26 // $Id: G4MscModel71.hh,v 1.5 2007/05/22 17:34:36 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/standard/include/G4MultipleScattering.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MultipleScattering.hh,v 1.3 5 2007/05/18 18:43:32vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MultipleScattering.hh,v 1.36 2008/03/10 10:39:21 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ----------------------------------------------------------------------------- … … 100 100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 101 101 102 class G4 UrbanMscModel;102 class G4VMscModel; 103 103 104 104 class G4MultipleScattering : public G4VMultipleScattering … … 133 133 private: // data members 134 134 135 G4 UrbanMscModel* mscUrban;135 G4VMscModel* mscUrban; 136 136 137 137 G4double lambdalimit; -
trunk/source/processes/electromagnetic/standard/include/G4MultipleScattering71.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MultipleScattering71.hh,v 1. 5 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4MultipleScattering71.hh,v 1.6 2008/07/16 11:27:41 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 58 58 //------------------------------------------------------------------------------ 59 59 // 60 // $Id: G4MultipleScattering71.hh,v 1. 5 2007/05/22 17:34:36vnivanch Exp $61 // GEANT4 tag $Name: $60 // $Id: G4MultipleScattering71.hh,v 1.6 2008/07/16 11:27:41 vnivanch Exp $ 61 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 62 62 63 63 // class description … … 180 180 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 181 181 182 inline G4double G4MultipleScattering71::GetContinuousStepLimit(183 const G4Track& track,184 G4double,185 G4double currentMinimalStep,186 G4double&)187 {188 DefineMaterial(track.GetMaterialCutsCouple());189 const G4MaterialCutsCouple* couple = CurrentMaterialCutsCouple();190 G4double e = track.GetKineticEnergy();191 model = dynamic_cast<G4MscModel71*>(SelectModel(e));192 const G4ParticleDefinition* p = track.GetDefinition();193 G4double lambda0 = GetLambda(p, e);194 range = G4LossTableManager::Instance()->GetRangeFromRestricteDEDX(p,e,couple);195 if(range < currentMinimalStep) currentMinimalStep = range;196 truePathLength = TruePathLengthLimit(track,lambda0,currentMinimalStep);197 // G4cout << "StepLimit: tpl= " << truePathLength << " lambda0= "198 // << lambda0 << " range= " << currentRange199 // << " currentMinStep= " << currentMinimalStep << G4endl;200 if (truePathLength < currentMinimalStep) valueGPILSelectionMSC = CandidateForSelection;201 geomPathLength = model->GeomPathLength(LambdaTable(),couple,202 p,e,lambda0,range,truePathLength);203 if(geomPathLength > lambda0) geomPathLength = lambda0;204 return geomPathLength;205 }206 207 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....208 209 182 inline G4VParticleChange* G4MultipleScattering71::AlongStepDoIt( 210 183 const G4Track&, -
trunk/source/processes/electromagnetic/standard/include/G4PAIModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PAIModel.hh,v 1.22 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 26 28 // 27 29 // ------------------------------------------------------------------- … … 75 77 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 76 78 77 virtual void InitialiseMe(const G4ParticleDefinition*) {};78 79 virtual G4double ComputeDEDX (const G4MaterialCutsCouple*,79 virtual void InitialiseMe(const G4ParticleDefinition*); 80 81 virtual G4double ComputeDEDXPerVolume(const G4Material*, 80 82 const G4ParticleDefinition*, 81 83 G4double kineticEnergy, 82 84 G4double cutEnergy); 83 85 84 virtual G4double CrossSection (const G4MaterialCutsCouple*,86 virtual G4double CrossSectionPerVolume(const G4Material*, 85 87 const G4ParticleDefinition*, 86 88 G4double kineticEnergy, … … 118 120 119 121 void SetVerboseLevel(G4int verbose){fVerbose=verbose;}; 120 121 122 122 123 123 protected: … … 192 192 }; 193 193 194 /////////////////////////////////////////////////////////////////////195 196 inline G4double G4PAIModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,197 G4double kinEnergy)198 {199 G4double tmax = kinEnergy;200 if(p == fElectron) tmax *= 0.5;201 else if(p != fPositron) {202 G4double mass = p->GetPDGMass();203 G4double ratio= electron_mass_c2/mass;204 G4double gamma= kinEnergy/mass + 1.0;205 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /206 (1. + 2.0*gamma*ratio + ratio*ratio);207 }208 return tmax;209 }210 211 ///////////////////////////////////////////////////////////////212 213 inline void G4PAIModel::DefineForRegion(const G4Region* r)214 {215 fPAIRegionVector.push_back(r);216 }217 218 194 #endif 219 195 -
trunk/source/processes/electromagnetic/standard/include/G4PAIPhotonModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PAIPhotonModel.hh,v 1.12 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 26 28 // 27 29 // ------------------------------------------------------------------- … … 68 70 public: 69 71 70 G4PAIPhotonModel(const G4ParticleDefinition* p = 0, const G4String& nam = "PAI ");72 G4PAIPhotonModel(const G4ParticleDefinition* p = 0, const G4String& nam = "PAIPhoton"); 71 73 72 74 virtual ~G4PAIPhotonModel(); … … 74 76 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 75 77 76 virtual void InitialiseMe(const G4ParticleDefinition*) {};77 78 virtual G4double ComputeDEDX (const G4MaterialCutsCouple*,79 const G4ParticleDefinition*,80 G4double kineticEnergy,81 G4double cutEnergy);82 83 virtual G4double CrossSection (const G4MaterialCutsCouple*,84 const G4ParticleDefinition*,85 G4double kineticEnergy,86 G4double cutEnergy,87 G4double maxEnergy);78 virtual void InitialiseMe(const G4ParticleDefinition*); 79 80 virtual G4double ComputeDEDXPerVolume(const G4Material*, 81 const G4ParticleDefinition*, 82 G4double kineticEnergy, 83 G4double cutEnergy); 84 85 virtual G4double CrossSectionPerVolume(const G4Material*, 86 const G4ParticleDefinition*, 87 G4double kineticEnergy, 88 G4double cutEnergy, 89 G4double maxEnergy); 88 90 89 91 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, … … 122 124 G4double position, G4int iTransfer ); 123 125 124 125 126 126 protected: 127 127 128 128 G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 129 G4double kinEnergy);129 G4double kinEnergy); 130 130 131 131 private: … … 145 145 G4int fVerbose; 146 146 G4PhysicsLogVector* fProtonEnergyVector ; 147 148 149 147 150 148 // vectors … … 204 202 }; 205 203 206 /////////////////////////////////////////////////////////////////////207 208 inline G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,209 G4double kinEnergy)210 {211 G4double tmax = kinEnergy;212 if(p == fElectron) tmax *= 0.5;213 else if(p != fPositron) {214 G4double mass = p->GetPDGMass();215 G4double ratio= electron_mass_c2/mass;216 G4double gamma= kinEnergy/mass + 1.0;217 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /218 (1. + 2.0*gamma*ratio + ratio*ratio);219 }220 return tmax;221 }222 223 ///////////////////////////////////////////////////////////////224 225 inline void G4PAIPhotonModel::DefineForRegion(const G4Region* r)226 {227 fPAIRegionVector.push_back(r);228 }229 230 204 #endif 231 205 -
trunk/source/processes/electromagnetic/standard/include/G4PAIxSection.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4PAIxSection.hh,v 1.1 2 2006/06/29 19:50:44 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4PAIxSection.hh,v 1.15 2008/05/30 16:04:40 grichine Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 74 74 75 75 G4PAIxSection( G4int materialIndex, 76 G4double maxEnergyTransfer ) ;76 G4double maxEnergyTransfer ); 77 77 78 78 G4PAIxSection( G4int materialIndex, // for proton loss table 79 79 G4double maxEnergyTransfer, 80 80 G4double betaGammaSq , 81 G4double** photoAbsCof, G4int intNumber ) ;81 G4double** photoAbsCof, G4int intNumber ); 82 82 83 83 G4PAIxSection( G4int materialIndex, // test constructor 84 84 G4double maxEnergyTransfer, 85 G4double betaGammaSq ) ;86 87 // G4PAIxSection(const G4PAIxSection& right) ;85 G4double betaGammaSq ); 86 87 // G4PAIxSection(const G4PAIxSection& right); 88 88 89 89 // Destructor 90 90 91 ~G4PAIxSection() ;91 ~G4PAIxSection(); 92 92 93 93 // Operators 94 // G4PAIxSection& operator=(const G4PAIxSection& right) ;95 // G4int operator==(const G4PAIxSection& right)const ;96 // G4int operator!=(const G4PAIxSection& right)const ;94 // G4PAIxSection& operator=(const G4PAIxSection& right); 95 // G4int operator==(const G4PAIxSection& right)const; 96 // G4int operator!=(const G4PAIxSection& right)const; 97 97 98 98 // Methods … … 100 100 // General control functions 101 101 102 void InitPAI() ;103 104 void NormShift( G4double betaGammaSq ) ;105 106 void SplainPAI( G4double betaGammaSq ) ;102 void InitPAI(); 103 104 void NormShift( G4double betaGammaSq ); 105 106 void SplainPAI( G4double betaGammaSq ); 107 107 108 108 // Physical methods … … 111 111 G4double RutherfordIntegral( G4int intervalNumber, 112 112 G4double limitLow, 113 G4double limitHigh ) ;113 G4double limitHigh ); 114 114 115 115 G4double ImPartDielectricConst( G4int intervalNumber, 116 G4double energy ) ; 117 118 G4double RePartDielectricConst(G4double energy) ; 116 G4double energy ); 117 118 G4double GetPhotonRange( G4double energy ); 119 G4double GetElectronRange( G4double energy ); 120 121 G4double RePartDielectricConst(G4double energy); 119 122 120 123 G4double DifPAIxSection( G4int intervalNumber, 121 G4double betaGammaSq ) ;124 G4double betaGammaSq ); 122 125 123 126 G4double PAIdNdxCerenkov( G4int intervalNumber, 124 G4double betaGammaSq ) ; 127 G4double betaGammaSq ); 128 G4double PAIdNdxMM( G4int intervalNumber, 129 G4double betaGammaSq ); 125 130 126 131 G4double PAIdNdxPlasmon( G4int intervalNumber, 127 G4double betaGammaSq ) ; 128 129 void IntegralPAIxSection() ; 130 void IntegralCerenkov() ; 131 void IntegralPlasmon() ; 132 133 G4double SumOverInterval(G4int intervalNumber) ; 134 G4double SumOverIntervaldEdx(G4int intervalNumber) ; 135 G4double SumOverInterCerenkov(G4int intervalNumber) ; 136 G4double SumOverInterPlasmon(G4int intervalNumber) ; 132 G4double betaGammaSq ); 133 134 G4double PAIdNdxResonance( G4int intervalNumber, 135 G4double betaGammaSq ); 136 137 void IntegralPAIxSection(); 138 void IntegralCerenkov(); 139 void IntegralMM(); 140 void IntegralPlasmon(); 141 void IntegralResonance(); 142 143 G4double SumOverInterval(G4int intervalNumber); 144 G4double SumOverIntervaldEdx(G4int intervalNumber); 145 G4double SumOverInterCerenkov(G4int intervalNumber); 146 G4double SumOverInterMM(G4int intervalNumber); 147 G4double SumOverInterPlasmon(G4int intervalNumber); 148 G4double SumOverInterResonance(G4int intervalNumber); 137 149 138 150 G4double SumOverBorder( G4int intervalNumber, 139 G4double energy ) ;151 G4double energy ); 140 152 G4double SumOverBorderdEdx( G4int intervalNumber, 141 G4double energy ) ;153 G4double energy ); 142 154 G4double SumOverBordCerenkov( G4int intervalNumber, 143 G4double energy ) ; 155 G4double energy ); 156 G4double SumOverBordMM( G4int intervalNumber, 157 G4double energy ); 144 158 G4double SumOverBordPlasmon( G4int intervalNumber, 145 G4double energy ) ; 146 147 G4double GetStepEnergyLoss( G4double step ) ; 148 G4double GetStepCerenkovLoss( G4double step ) ; 149 G4double GetStepPlasmonLoss( G4double step ) ; 159 G4double energy ); 160 G4double SumOverBordResonance( G4int intervalNumber, 161 G4double energy ); 162 163 G4double GetStepEnergyLoss( G4double step ); 164 G4double GetStepCerenkovLoss( G4double step ); 165 G4double GetStepMMLoss( G4double step ); 166 G4double GetStepPlasmonLoss( G4double step ); 167 G4double GetStepResonanceLoss( G4double step ); 168 169 G4double GetEnergyTransfer(); 170 G4double GetCerenkovEnergyTransfer(); 171 G4double GetMMEnergyTransfer(); 172 G4double GetPlasmonEnergyTransfer(); 173 G4double GetResonanceEnergyTransfer(); 174 G4double GetRutherfordEnergyTransfer(); 150 175 151 176 // Inline access functions 152 177 153 G4int GetNumberOfGammas() const { return fNumberOfGammas ; } 154 155 G4int GetSplineSize() const { return fSplineNumber ; } 156 157 G4int GetIntervalNumber() const { return fIntervalNumber ; } 158 159 G4double GetEnergyInterval(G4int i){ return fEnergyInterval[i] ; } 160 161 G4double GetDifPAIxSection(G4int i){ return fDifPAIxSection[i] ; } 162 G4double GetPAIdNdxCrenkov(G4int i){ return fdNdxCerenkov[i] ; } 163 G4double GetPAIdNdxPlasmon(G4int i){ return fdNdxPlasmon[i] ; } 164 165 G4double GetMeanEnergyLoss() const {return fIntegralPAIxSection[0] ; } 166 G4double GetMeanCerenkovLoss() const {return fIntegralCerenkov[0] ; } 167 G4double GetMeanPlasmonLoss() const {return fIntegralPlasmon[0] ; } 168 169 G4double GetNormalizationCof() const { return fNormalizationCof ; } 178 G4int GetNumberOfGammas() const { return fNumberOfGammas; } 179 180 G4int GetSplineSize() const { return fSplineNumber; } 181 182 G4int GetIntervalNumber() const { return fIntervalNumber; } 183 184 G4double GetEnergyInterval(G4int i){ return fEnergyInterval[i]; } 185 186 G4double GetDifPAIxSection(G4int i){ return fDifPAIxSection[i]; } 187 G4double GetPAIdNdxCerenkov(G4int i){ return fdNdxCerenkov[i]; } 188 G4double GetPAIdNdxMM(G4int i){ return fdNdxMM[i]; } 189 G4double GetPAIdNdxPlasmon(G4int i){ return fdNdxPlasmon[i]; } 190 G4double GetPAIdNdxResonance(G4int i){ return fdNdxResonance[i]; } 191 192 G4double GetMeanEnergyLoss() const {return fIntegralPAIxSection[0]; } 193 G4double GetMeanCerenkovLoss() const {return fIntegralCerenkov[0]; } 194 G4double GetMeanMMLoss() const {return fIntegralMM[0]; } 195 G4double GetMeanPlasmonLoss() const {return fIntegralPlasmon[0]; } 196 G4double GetMeanResonanceLoss() const {return fIntegralResonance[0]; } 197 198 G4double GetNormalizationCof() const { return fNormalizationCof; } 170 199 171 inline G4double GetPAItable(G4int i,G4int j) const ;172 173 inline G4double GetLorentzFactor(G4int i) const;200 inline G4double GetPAItable(G4int i,G4int j) const; 201 202 inline G4double GetLorentzFactor(G4int i) const; 174 203 175 inline G4double GetSplineEnergy(G4int i) const ; 176 177 inline G4double GetIntegralPAIxSection(G4int i) const ; 178 inline G4double GetIntegralPAIdEdx(G4int i) const ; 179 inline G4double GetIntegralCerenkov(G4int i) const ; 180 inline G4double GetIntegralPlasmon(G4int i) const ; 204 inline G4double GetSplineEnergy(G4int i) const; 205 206 inline G4double GetIntegralPAIxSection(G4int i) const; 207 inline G4double GetIntegralPAIdEdx(G4int i) const; 208 inline G4double GetIntegralCerenkov(G4int i) const; 209 inline G4double GetIntegralMM(G4int i) const; 210 inline G4double GetIntegralPlasmon(G4int i) const; 211 inline G4double GetIntegralResonance(G4int i) const; 181 212 182 213 protected : … … 186 217 // Local class constants 187 218 188 static const G4double fDelta ; // energy shift from interval border = 0.001189 static const G4double fError ; // error in lin-log approximation = 0.005190 191 static G4int fNumberOfGammas ; // = 111;192 static const G4double fLorentzFactor[112] ; // static gamma array219 static const G4double fDelta; // energy shift from interval border = 0.001 220 static const G4double fError; // error in lin-log approximation = 0.005 221 222 static G4int fNumberOfGammas; // = 111; 223 static const G4double fLorentzFactor[112]; // static gamma array 193 224 194 225 static 195 const G4int fRefGammaNumber ; // The number of gamma for creation of spline (15) 196 197 G4int fIntervalNumber ; // The number of energy intervals 198 G4double fNormalizationCof ; // Normalization cof for PhotoAbsorptionXsection 199 200 // G4double fBetaGammaSq ; // (beta*gamma)^2 201 202 G4double fDensity ; // Current density 203 G4double fElectronDensity ; // Current electron (number) density 204 G4int fSplineNumber ; // Current size of spline 226 const G4int fRefGammaNumber ; // The number of gamma for creation of spline (15) 227 228 G4int fIntervalNumber ; // The number of energy intervals 229 G4double fNormalizationCof; // Normalization cof for PhotoAbsorptionXsection 230 231 // G4double fBetaGammaSq; // (beta*gamma)^2 232 233 G4int fMaterialIndex; // current material index 234 G4double fDensity; // Current density 235 G4double fElectronDensity; // Current electron (number) density 236 G4int fSplineNumber; // Current size of spline 205 237 206 238 // Arrays of Sandia coefficients … … 209 241 G4SandiaTable* fSandia; 210 242 211 G4double* fEnergyInterval ;212 G4double* fA1 ;213 G4double* fA2 ;214 G4double* fA3 ;215 G4double* fA4 ;243 G4double* fEnergyInterval; 244 G4double* fA1; 245 G4double* fA2; 246 G4double* fA3; 247 G4double* fA4; 216 248 217 249 static 218 const G4int fMaxSplineSize ; // Max size of output splain arrays = 500250 const G4int fMaxSplineSize ; // Max size of output splain arrays = 500 219 251 220 252 /* ****************** 221 G4double* fSplineEnergy ; // energy points of splain222 G4double* fRePartDielectricConst ; // Real part of dielectric const223 G4double* fImPartDielectricConst ; // Imaginary part of dielectric const224 G4double* fIntegralTerm ; // Integral term in PAI cross section225 G4double* fDifPAIxSection ; // Differential PAI cross section226 G4double* fIntegralPAIxSection ; // Integral PAI cross section ?253 G4double* fSplineEnergy; // energy points of splain 254 G4double* fRePartDielectricConst; // Real part of dielectric const 255 G4double* fImPartDielectricConst; // Imaginary part of dielectric const 256 G4double* fIntegralTerm; // Integral term in PAI cross section 257 G4double* fDifPAIxSection; // Differential PAI cross section 258 G4double* fIntegralPAIxSection; // Integral PAI cross section ? 227 259 */ /////////////// 228 260 229 261 230 G4double fSplineEnergy[500] ; // energy points of splain 231 G4double fRePartDielectricConst[500] ; // Real part of dielectric const 232 G4double fImPartDielectricConst[500] ; // Imaginary part of dielectric const 233 G4double fIntegralTerm[500] ; // Integral term in PAI cross section 234 G4double fDifPAIxSection[500] ; // Differential PAI cross section 235 G4double fdNdxCerenkov[500] ; // dNdx of Cerenkov collisions 236 G4double fdNdxPlasmon[500] ; // dNdx of Plasmon collisions 237 238 G4double fIntegralPAIxSection[500] ; // Integral PAI cross section ? 239 G4double fIntegralPAIdEdx[500] ; // Integral PAI dEdx ? 240 G4double fIntegralCerenkov[500] ; // Integral Cerenkov N>omega ? 241 G4double fIntegralPlasmon[500] ; // Integral Plasmon N>omega ? 242 243 G4double fPAItable[500][112] ; // Output array 244 245 } ; 262 G4double fSplineEnergy[500]; // energy points of splain 263 G4double fRePartDielectricConst[500]; // Real part of dielectric const 264 G4double fImPartDielectricConst[500]; // Imaginary part of dielectric const 265 G4double fIntegralTerm[500]; // Integral term in PAI cross section 266 G4double fDifPAIxSection[500]; // Differential PAI cross section 267 G4double fdNdxCerenkov[500]; // dNdx of Cerenkov collisions 268 G4double fdNdxMM[500]; // dNdx of MM-Cerenkov collisions 269 G4double fdNdxPlasmon[500]; // dNdx of Plasmon collisions 270 G4double fdNdxResonance[500]; // dNdx of resonance collisions 271 272 G4double fIntegralPAIxSection[500]; // Integral PAI cross section ? 273 G4double fIntegralPAIdEdx[500]; // Integral PAI dEdx ? 274 G4double fIntegralCerenkov[500]; // Integral Cerenkov N>omega ? 275 G4double fIntegralMM[500]; // Integral MM-Cerenkov N>omega ? 276 G4double fIntegralPlasmon[500]; // Integral Plasmon N>omega ? 277 G4double fIntegralResonance[500]; // Integral resonance N>omega ? 278 279 G4double fPAItable[500][112]; // Output array 280 281 }; 246 282 247 283 //////////////// Inline methods ////////////////////////////////// … … 251 287 inline G4double G4PAIxSection::GetPAItable(G4int i, G4int j) const 252 288 { 253 return fPAItable[i][j] ;289 return fPAItable[i][j]; 254 290 } 255 291 256 292 inline G4double G4PAIxSection::GetLorentzFactor(G4int j) const 257 293 { 258 return fLorentzFactor[j] ;294 return fLorentzFactor[j]; 259 295 } 260 296 … … 265 301 G4Exception("Invalid argument in G4PAIxSection::GetSplineEnergy"); 266 302 } 267 return fSplineEnergy[i] ;303 return fSplineEnergy[i]; 268 304 } 269 305 … … 274 310 G4Exception("Invalid argument in G4PAIxSection::GetIntegralPAIxSection"); 275 311 } 276 return fIntegralPAIxSection[i] ;312 return fIntegralPAIxSection[i]; 277 313 } 278 314 … … 283 319 G4Exception("Invalid argument in G4PAIxSection::GetIntegralPAIxSection"); 284 320 } 285 return fIntegralPAIdEdx[i] ;321 return fIntegralPAIdEdx[i]; 286 322 } 287 323 … … 292 328 G4Exception("Invalid argument in G4PAIxSection::GetIntegralCerenkov"); 293 329 } 294 return fIntegralCerenkov[i] ; 330 return fIntegralCerenkov[i]; 331 } 332 333 inline G4double G4PAIxSection::GetIntegralMM(G4int i) const 334 { 335 if(i < 1 || i > fSplineNumber) 336 { 337 G4Exception("Invalid argument in G4PAIxSection::GetIntegralMM"); 338 } 339 return fIntegralMM[i]; 295 340 } 296 341 … … 301 346 G4Exception("Invalid argument in G4PAIxSection::GetIntegralPlasmon"); 302 347 } 303 return fIntegralPlasmon[i] ; 348 return fIntegralPlasmon[i]; 349 } 350 351 inline G4double G4PAIxSection::GetIntegralResonance(G4int i) const 352 { 353 if(i < 1 || i > fSplineNumber) 354 { 355 G4Exception("Invalid argument in G4PAIxSection::GetIntegralResonance"); 356 } 357 return fIntegralResonance[i]; 304 358 } 305 359 -
trunk/source/processes/electromagnetic/standard/include/G4PAIySection.hh
r819 r961 26 26 // 27 27 // $Id: G4PAIySection.hh,v 1.1 2007/10/01 17:45:14 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/standard/include/G4PEEffectModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PEEffectModel.hh,v 1. 6 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4PEEffectModel.hh,v 1.7 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 41 41 // 42 42 // 06.02.2006 : added ComputeMeanFreePath() (mma) 43 // 20.02.2009 : move virtual inline to .cc, substitute 44 // ComputeMeanFreePath() by CrossSectionPerVolume (VI) 43 45 // 44 46 // Class Description: … … 70 72 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 71 73 72 G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,73 G4double kinEnergy,74 G4double Z,75 G4double A,76 G4double, G4double);74 virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 75 G4double kinEnergy, 76 G4double Z, 77 G4double A, 78 G4double, G4double); 77 79 78 G4double ComputeMeanFreePath( const G4ParticleDefinition*, 79 G4double kinEnergy, 80 const G4Material* material, 81 G4double, G4double); 80 virtual G4double CrossSectionPerVolume(const G4Material*, 81 const G4ParticleDefinition*, 82 G4double kineticEnergy, 83 G4double cutEnergy, 84 G4double maxEnergy); 82 85 83 86 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, … … 100 103 }; 101 104 102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....103 104 inline G4double G4PEEffectModel::ComputeCrossSectionPerAtom(105 const G4ParticleDefinition*,106 G4double energy,107 G4double Z, G4double,108 G4double, G4double)109 {110 G4double* SandiaCof = G4SandiaTable::GetSandiaCofPerAtom((G4int)Z, energy);111 112 G4double energy2 = energy*energy, energy3 = energy*energy2,113 energy4 = energy2*energy2;114 115 return SandiaCof[0]/energy + SandiaCof[1]/energy2 +116 SandiaCof[2]/energy3 + SandiaCof[3]/energy4;117 }118 119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....120 121 inline G4double G4PEEffectModel::ComputeMeanFreePath(122 const G4ParticleDefinition*,123 G4double energy,124 const G4Material* material,125 G4double, G4double)126 {127 G4double* SandiaCof = material->GetSandiaTable()128 ->GetSandiaCofForMaterial(energy);129 130 G4double energy2 = energy*energy, energy3 = energy*energy2,131 energy4 = energy2*energy2;132 133 G4double cross = SandiaCof[0]/energy + SandiaCof[1]/energy2 +134 SandiaCof[2]/energy3 + SandiaCof[3]/energy4;135 136 G4double mfp = DBL_MAX;137 if (cross > 0.) mfp = 1./cross;138 return mfp;139 }140 141 105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 142 106 -
trunk/source/processes/electromagnetic/standard/include/G4PSTARStopping.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PSTARStopping.hh,v 1. 4 2006/06/29 19:50:48 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4PSTARStopping.hh,v 1.5 2008/11/13 12:04:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 29 29 #ifndef G4PSTARStopping_h … … 85 85 G4double currentE, res; 86 86 G4double e[74][60], kinE[60]; 87 G4int Znum[74];88 87 }; 89 88 -
trunk/source/processes/electromagnetic/standard/include/G4PhotoElectricEffect.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4PhotoElectricEffect.hh,v 1.2 4 2007/05/23 08:47:34vnivanch Exp $28 // GEANT4 tag $Name: $27 // $Id: G4PhotoElectricEffect.hh,v 1.25 2009/02/20 12:06:37 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 91 91 92 92 // true for Gamma only. 93 G4bool IsApplicable(const G4ParticleDefinition&);93 virtual G4bool IsApplicable(const G4ParticleDefinition&); 94 94 95 95 // Print few lines of informations about the process: validity range, 96 v oid PrintInfo();96 virtual void PrintInfo(); 97 97 98 98 protected: 99 99 100 v oid InitialiseProcess(const G4ParticleDefinition*);100 virtual void InitialiseProcess(const G4ParticleDefinition*); 101 101 102 102 private: … … 105 105 }; 106 106 107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....109 110 inline111 G4bool G4PhotoElectricEffect::IsApplicable(const G4ParticleDefinition& p)112 {113 return (&p == G4Gamma::Gamma());114 }115 116 107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 117 108 -
trunk/source/processes/electromagnetic/standard/include/G4PolarizedComptonScattering.hh
r819 r961 26 26 // 27 27 // $Id: G4PolarizedComptonScattering.hh,v 1.9 2006/06/29 19:51:14 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // --------- G4PolarizedComptonScattering physics process ---------------------- -
trunk/source/processes/electromagnetic/standard/include/G4UniversalFluctuation.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4UniversalFluctuation.hh,v 1. 5 2007/04/03 11:08:36 urbanExp $27 // GEANT4 tag $Name: $26 // $Id: G4UniversalFluctuation.hh,v 1.8 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 59 59 60 60 #include "G4VEmFluctuationModel.hh" 61 #include "G4ParticleDefinition.hh" 61 62 62 63 class G4UniversalFluctuation : public G4VEmFluctuationModel … … 69 70 virtual ~G4UniversalFluctuation(); 70 71 71 G4double SampleFluctuations(const G4Material*,72 const G4DynamicParticle*,73 G4double&,74 G4double&,75 G4double&);72 virtual G4double SampleFluctuations(const G4Material*, 73 const G4DynamicParticle*, 74 G4double&, 75 G4double&, 76 G4double&); 76 77 77 G4double Dispersion( const G4Material*,78 const G4DynamicParticle*,79 G4double&,80 G4double&);78 virtual G4double Dispersion( const G4Material*, 79 const G4DynamicParticle*, 80 G4double&, 81 G4double&); 81 82 82 void InitialiseMe(const G4ParticleDefinition*); 83 // Initialisation before the run 84 virtual void InitialiseMe(const G4ParticleDefinition*); 83 85 84 protected: 86 // Initialisation prestep 87 virtual void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2); 85 88 86 89 private: -
trunk/source/processes/electromagnetic/standard/include/G4UrbanMscModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4UrbanMscModel.hh,v 1.3 1 2007/10/29 08:42:43vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4UrbanMscModel.hh,v 1.33 2008/03/10 10:39:21 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 91 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 92 92 93 #include "G4V EmModel.hh"93 #include "G4VMscModel.hh" 94 94 #include "G4PhysicsTable.hh" 95 95 #include "G4MscStepLimitType.hh" … … 101 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 102 102 103 class G4UrbanMscModel : public G4V EmModel103 class G4UrbanMscModel : public G4VMscModel 104 104 { 105 105 106 106 public: 107 107 108 G4UrbanMscModel(G4double facrange, G4double dtrl, G4double lambdalimit, 109 G4double facgeom,G4double skin, 110 G4bool samplez, G4MscStepLimitType stepAlg, 111 const G4String& nam = "UrbanMscUni"); 108 G4UrbanMscModel(const G4String& nam = "UrbanMscUni"); 112 109 113 110 virtual ~G4UrbanMscModel(); 114 111 115 v irtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);116 112 void Initialise(const G4ParticleDefinition*, const G4DataVector&); 113 117 114 G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition* particle, 118 115 G4double KineticEnergy, … … 142 139 G4double KineticEnergy); 143 140 144 void SetStepLimitType(G4MscStepLimitType);145 146 void SetLateralDisplasmentFlag(G4bool val);147 148 void SetRangeFactor(G4double);149 150 void SetGeomFactor(G4double);151 152 void SetSkin(G4double);153 154 141 private: 155 142 … … 160 147 G4double LatCorrelation(); 161 148 162 G4double GetLambda(G4double kinEnergy);163 164 149 void GeomLimit(const G4Track& track); 165 150 166 void SetParticle(const G4ParticleDefinition* p); 151 inline G4double GetLambda(G4double kinEnergy); 152 153 inline void SetParticle(const G4ParticleDefinition*); 167 154 168 155 // hide assignment operator … … 178 165 G4LossTableManager* theManager; 179 166 180 181 167 G4double mass; 182 168 G4double charge; … … 188 174 G4double taulim; 189 175 G4double currentTau; 190 G4double dtrl;191 192 G4double lambdalimit;193 G4double facrange;194 176 G4double frscaling1,frscaling2; 195 177 G4double tlimit; … … 201 183 G4double geommin; 202 184 G4double geomlimit; 203 G4double facgeom;204 G4double skin;205 185 G4double skindepth; 206 186 G4double smallstep; 207 187 208 188 G4double presafety; 209 G4double facsafety;210 189 211 190 G4double lambda0; … … 213 192 G4double tPathLength; 214 193 G4double zPathLength; 215 G4double par1,par2,par3 ;216 217 G4double stepmin ;194 G4double par1,par2,par3; 195 196 G4double stepmin; 218 197 219 198 G4double currentKinEnergy; … … 225 204 G4int currentMaterialIndex; 226 205 227 G4MscStepLimitType steppingAlgorithm;228 229 G4bool samplez;230 G4bool latDisplasment;231 206 G4bool isInitialized; 232 233 207 G4bool inside; 234 208 G4bool insideskin; 235 209 236 210 }; 237 238 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......239 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......240 241 inline242 void G4UrbanMscModel::SetLateralDisplasmentFlag(G4bool val)243 {244 latDisplasment = val;245 }246 247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......248 249 inline250 void G4UrbanMscModel::SetSkin(G4double val)251 {252 skin = val;253 stepmin = tlimitminfix;254 skindepth = skin*stepmin;255 }256 257 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......258 259 inline260 void G4UrbanMscModel::SetRangeFactor(G4double val)261 {262 facrange = val;263 }264 265 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......266 267 inline268 void G4UrbanMscModel::SetGeomFactor(G4double val)269 {270 facgeom = val;271 }272 273 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......274 275 inline276 void G4UrbanMscModel::SetStepLimitType(G4MscStepLimitType val)277 {278 steppingAlgorithm = val;279 }280 211 281 212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/include/G4UrbanMscModel90.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4UrbanMscModel90.hh,v 1. 1 2007/12/07 17:35:52vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4UrbanMscModel90.hh,v 1.4 2008/10/29 14:15:30 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 55 55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 56 56 57 #include "G4V EmModel.hh"57 #include "G4VMscModel.hh" 58 58 #include "G4PhysicsTable.hh" 59 59 #include "G4MscStepLimitType.hh" … … 65 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 66 66 67 class G4UrbanMscModel90 : public G4V EmModel67 class G4UrbanMscModel90 : public G4VMscModel 68 68 { 69 69 70 70 public: 71 71 72 G4UrbanMscModel90(G4double facrange, G4double dtrl, G4double lambdalimit, 73 G4double facgeom,G4double skin, 74 G4bool samplez, G4MscStepLimitType stepAlg, 75 const G4String& nam = "UrbanMscUni"); 72 G4UrbanMscModel90(const G4String& nam = "UrbanMscUni90"); 76 73 77 74 virtual ~G4UrbanMscModel90(); 78 75 79 v irtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);76 void Initialise(const G4ParticleDefinition*, const G4DataVector&); 80 77 81 78 G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition* particle, … … 106 103 G4double KineticEnergy); 107 104 108 void SetStepLimitType(G4MscStepLimitType);109 110 void SetLateralDisplasmentFlag(G4bool val);111 112 void SetRangeFactor(G4double);113 114 void SetGeomFactor(G4double);115 116 void SetSkin(G4double);117 118 105 private: 119 106 … … 124 111 G4double LatCorrelation(); 125 112 126 G4double GetLambda(G4double kinEnergy);127 128 113 void GeomLimit(const G4Track& track); 129 114 130 void SetParticle(const G4ParticleDefinition* p); 115 inline G4double GetLambda(G4double kinEnergy); 116 117 inline void SetParticle(const G4ParticleDefinition*); 131 118 132 119 // hide assignment operator … … 142 129 G4LossTableManager* theManager; 143 130 144 145 131 G4double mass; 146 132 G4double charge; … … 152 138 G4double taulim; 153 139 G4double currentTau; 154 G4double dtrl;155 156 G4double lambdalimit;157 G4double facrange;158 140 G4double frscaling1,frscaling2; 159 141 G4double tlimit; … … 165 147 G4double geommin; 166 148 G4double geomlimit; 167 G4double facgeom;168 G4double skin;169 149 G4double skindepth; 170 150 G4double smallstep; 171 151 172 152 G4double presafety; 173 G4double facsafety;174 153 175 154 G4double lambda0; … … 177 156 G4double tPathLength; 178 157 G4double zPathLength; 179 G4double par1,par2,par3 ;180 181 G4double stepmin ;158 G4double par1,par2,par3; 159 160 G4double stepmin; 182 161 183 162 G4double currentKinEnergy; … … 189 168 G4int currentMaterialIndex; 190 169 191 G4MscStepLimitType steppingAlgorithm;192 193 G4bool samplez;194 G4bool latDisplasment;195 170 G4bool isInitialized; 196 197 171 G4bool inside; 198 172 G4bool insideskin; 199 173 200 174 }; 201 202 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......204 205 inline206 void G4UrbanMscModel90::SetLateralDisplasmentFlag(G4bool val)207 {208 latDisplasment = val;209 }210 211 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......212 213 inline214 void G4UrbanMscModel90::SetSkin(G4double val)215 {216 skin = val;217 stepmin = tlimitminfix;218 skindepth = skin*stepmin;219 }220 221 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......222 223 inline224 void G4UrbanMscModel90::SetRangeFactor(G4double val)225 {226 facrange = val;227 }228 229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......230 231 inline232 void G4UrbanMscModel90::SetGeomFactor(G4double val)233 {234 facgeom = val;235 }236 237 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......238 239 inline240 void G4UrbanMscModel90::SetStepLimitType(G4MscStepLimitType val)241 {242 steppingAlgorithm = val;243 }244 175 245 176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/include/G4WaterStopping.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4WaterStopping.hh,v 1. 2 2006/06/29 19:51:56 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4WaterStopping.hh,v 1.6 2008/09/09 09:30:58 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 29 29 #ifndef G4WaterStopping_h … … 60 60 public: 61 61 62 G4WaterStopping(G4EmCorrections* corr = 0 );62 G4WaterStopping(G4EmCorrections* corr = 0, G4bool splineFlag = true); 63 63 64 64 ~G4WaterStopping(); … … 70 70 void Initialise(G4EmCorrections*); 71 71 72 void AddData(G4double* energy, G4double* stoppower, G4double factor); 73 72 74 // hide assignment operator 73 75 G4WaterStopping & operator=(const G4WaterStopping &right); 74 76 G4WaterStopping(const G4WaterStopping&); 75 77 76 G4int Z[8]; 77 G4int A[8]; 78 G4bool spline; 79 G4int Z[16]; 80 G4double A[16]; 78 81 std::vector<G4LPhysicsFreeVector*> dedx; 79 82 }; -
trunk/source/processes/electromagnetic/standard/include/G4eBremsstrahlung.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlung.hh,v 1.3 6 2007/05/23 08:47:34vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eBremsstrahlung.hh,v 1.37 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 89 89 virtual ~G4eBremsstrahlung(); 90 90 91 G4bool IsApplicable(const G4ParticleDefinition& p);91 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 92 92 93 93 // Print out of the class parameters … … 111 111 112 112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....114 115 inline G4bool G4eBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)116 {117 return (&p == G4Electron::Electron() || &p == G4Positron::Positron());118 }119 120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....121 113 122 114 #endif -
trunk/source/processes/electromagnetic/standard/include/G4eBremsstrahlungModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlungModel.hh,v 1.2 2 2007/05/23 08:47:34vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eBremsstrahlungModel.hh,v 1.26 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 69 69 70 70 G4eBremsstrahlungModel(const G4ParticleDefinition* p = 0, 71 const G4String& nam = " StandBrem");71 const G4String& nam = "eBrem"); 72 72 73 73 virtual ~G4eBremsstrahlungModel(); … … 75 75 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 76 76 77 G4double MinEnergyCut(const G4ParticleDefinition*,78 const G4MaterialCutsCouple*);77 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 78 const G4MaterialCutsCouple*); 79 79 80 80 virtual G4double ComputeDEDXPerVolume(const G4Material*, … … 101 101 G4double maxEnergy); 102 102 103 inline void SetLPMflag(G4bool val);104 inline G4bool LPMflag() const;105 106 inline void SetEnergyThreshold(G4double val);107 inline G4double EnergyThreshold() const;108 109 103 protected: 110 111 inline G4double MaxSecondaryEnergy(const G4ParticleDefinition*,112 G4double kineticEnergy);113 104 114 105 const G4Element* SelectRandomAtom(const G4MaterialCutsCouple* couple); … … 154 145 G4double MigdalConstant; 155 146 G4double LPMconstant; 156 G4double highEnergyTh;157 G4bool theLPMflag;158 147 G4bool isInitialised; 159 148 … … 199 188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 200 189 201 inline202 G4double G4eBremsstrahlungModel::MaxSecondaryEnergy(203 const G4ParticleDefinition*,204 G4double kineticEnergy)205 {206 return kineticEnergy;207 }208 209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....210 211 inline212 void G4eBremsstrahlungModel::SetLPMflag(G4bool val)213 {214 theLPMflag = val;215 }216 217 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....218 219 inline220 G4bool G4eBremsstrahlungModel::LPMflag() const221 {222 return theLPMflag;223 }224 225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....226 227 inline228 void G4eBremsstrahlungModel::SetEnergyThreshold(G4double val)229 {230 highEnergyTh = val;231 }232 233 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....234 235 inline236 G4double G4eBremsstrahlungModel::EnergyThreshold() const237 {238 return highEnergyTh;239 }240 241 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....242 243 190 #endif -
trunk/source/processes/electromagnetic/standard/include/G4eCoulombScatteringModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eCoulombScatteringModel.hh,v 1. 20 2007/10/24 10:42:05vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4eCoulombScatteringModel.hh,v 1.36 2008/08/04 08:49:09 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 45 45 // make some members protected 46 46 // 09.10.07 V.Ivanchenko reorganized methods, add cut dependence in scattering off e- 47 // 09.06.08 V.Ivanchenko add SelectIsotope and sampling of the recoil ion 47 48 // 48 49 // Class Description: … … 75 76 public: 76 77 77 G4eCoulombScatteringModel(G4double thetaMin = 0.0, G4double thetaMax = pi, 78 G4bool build = false, G4double tlim = TeV*TeV, 79 const G4String& nam = "eCoulombScattering"); 78 G4eCoulombScatteringModel(const G4String& nam = "eCoulombScattering"); 80 79 81 80 virtual ~G4eCoulombScatteringModel(); … … 97 96 G4double maxEnergy); 98 97 98 inline void SetRecoilThreshold(G4double eth); 99 99 100 protected: 100 101 101 G4double ComputeElectronXSectionPerAtom( 102 const G4ParticleDefinition*, 103 G4double kinEnergy, 104 G4double Z, 105 G4double A, 106 G4double cut); 107 108 virtual G4double CalculateCrossSectionPerAtom( 109 const G4ParticleDefinition*, 110 G4double kinEnergy, 111 G4double Z, G4double A); 102 G4double CrossSectionPerAtom(); 103 104 G4double SampleCosineTheta(); 105 106 inline void DefineMaterial(const G4MaterialCutsCouple*); 112 107 113 108 inline void SetupParticle(const G4ParticleDefinition*); 114 109 115 inline void SetupKinematic(G4double kinEnergy );110 inline void SetupKinematic(G4double kinEnergy, G4double cut); 116 111 117 inline void SetupTarget(G4double Z, G4double A, G4doublekinEnergy);112 inline void SetupTarget(G4double Z, G4double kinEnergy); 118 113 119 114 private: 115 116 void ComputeMaxElectronScattering(G4double cut); 120 117 121 118 // hide assignment operator … … 124 121 125 122 protected: 126 123 127 124 const G4ParticleDefinition* theProton; 128 125 const G4ParticleDefinition* theElectron; 129 126 const G4ParticleDefinition* thePositron; 130 127 128 G4ParticleTable* theParticleTable; 131 129 G4ParticleChangeForGamma* fParticleChange; 132 130 G4NistManager* fNistManager; 131 const G4DataVector* currentCuts; 132 133 const G4MaterialCutsCouple* currentCouple; 134 const G4Material* currentMaterial; 135 const G4Element* currentElement; 136 G4int currentMaterialIndex; 133 137 134 138 G4double coeff; … … 136 140 G4double cosThetaMin; 137 141 G4double cosThetaMax; 142 G4double cosTetMinNuc; 138 143 G4double cosTetMaxNuc; 144 G4double cosTetMaxNuc2; 139 145 G4double cosTetMaxElec; 146 G4double cosTetMaxElec2; 140 147 G4double q2Limit; 148 G4double recoilThreshold; 141 149 G4double elecXSection; 142 150 G4double nucXSection; … … 152 160 G4double mom2; 153 161 G4double invbeta2; 162 G4double etag; 163 G4double lowEnergyLimit; 154 164 155 165 // target 156 166 G4double targetZ; 157 G4double targetA;158 167 G4double screenZ; 159 168 G4double formfactA; 169 G4int idxelm; 160 170 161 171 private: 162 172 163 G4PhysicsTable* theCrossSectionTable;164 165 173 G4double a0; 166 G4double lowKEnergy;167 G4double highKEnergy;168 174 G4double alpha2; 169 175 G4double faclim; 170 171 G4int nbins; 172 G4int nmax; 173 G4int index[100]; 174 175 G4bool buildTable; 176 G4double FF[100]; 177 176 178 G4bool isInitialised; 177 179 }; 180 181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 182 183 inline 184 void G4eCoulombScatteringModel::DefineMaterial(const G4MaterialCutsCouple* cup) 185 { 186 if(cup != currentCouple) { 187 currentCouple = cup; 188 currentMaterial = cup->GetMaterial(); 189 currentMaterialIndex = currentCouple->GetIndex(); 190 } 191 } 178 192 179 193 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 190 204 chargeSquare = q*q; 191 205 tkin = 0.0; 206 lowEnergyLimit = keV*mass/electron_mass_c2; 192 207 } 193 208 } … … 195 210 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 196 211 197 inline void G4eCoulombScatteringModel::SetupKinematic(G4double ekin) 198 { 199 if(ekin != tkin) { 200 tkin = ekin; 201 mom2 = tkin*(tkin + 2.0*mass); 212 inline void G4eCoulombScatteringModel::SetupKinematic(G4double ekin, 213 G4double cut) 214 { 215 if(ekin != tkin || ecut != cut) { 216 tkin = ekin; 217 mom2 = tkin*(tkin + 2.0*mass); 202 218 invbeta2 = 1.0 + mass*mass/mom2; 203 } 219 cosTetMinNuc = cosThetaMin; 220 cosTetMaxNuc = cosThetaMax; 221 if(ekin <= 10.*cut && mass < MeV && cosThetaMin < 1.0) { 222 cosTetMinNuc = ekin*(cosThetaMin + 1.0)/(10.*cut) - 1.0; 223 } 224 ComputeMaxElectronScattering(cut); 225 } 204 226 } 205 227 206 228 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 207 229 208 inline void G4eCoulombScatteringModel::SetupTarget(G4double Z, G4double A,209 G4double e) 210 {211 if(e != tkin || Z != targetZ || A != targetA) {230 inline void G4eCoulombScatteringModel::SetupTarget(G4double Z, G4double e) 231 { 232 if(Z != targetZ || e != etag) { 233 etag = e; 212 234 targetZ = Z; 213 targetA = A; 214 SetupKinematic(e); 215 cosTetMaxNuc = std::max(cosThetaMax, 1.0 - 0.5*q2Limit/mom2); 216 G4double x = fNistManager->GetZ13(Z); 217 screenZ = a0*x*x*(1.13 + 3.76*invbeta2*Z*Z*chargeSquare*alpha2)/mom2; 218 if(particle == theProton && A < 1.5 && cosTetMaxNuc < 0.0) 219 cosTetMaxNuc = 0.0; 235 G4int iz= G4int(Z); 236 if(iz > 99) iz = 99; 237 G4double x = fNistManager->GetZ13(iz); 238 screenZ = a0*x*x/mom2; 239 if(iz > 1) screenZ *=(1.13 + 3.76*invbeta2*Z*Z*chargeSquare*alpha2); 240 //screenZ = a0*x*x*(1.13 + 3.76*Z*Z*chargeSquare*alpha2)/mom2; 220 241 // A.V. Butkevich et al., NIM A 488 (2002) 282 221 x = fNistManager->GetLOGA(A); 222 formfactA = mom2*constn*std::exp(0.54*x); 242 formfactA = FF[iz]; 243 if(formfactA == 0.0) { 244 x = fNistManager->GetA27(iz); 245 formfactA = constn*x*x; 246 FF[iz] = formfactA; 247 } 248 formfactA *= mom2; 249 cosTetMaxNuc2 = cosTetMaxNuc; 250 if(particle == theProton && 1 == iz && cosTetMaxNuc2 < 0.0) { 251 cosTetMaxNuc2 = 0.0; 252 } 253 /* 254 G4double ee = 10.*eV*Z; 255 if(1 == iz) ee *= 2.0; 256 G4double z = std::min(cosTetMaxElec, 1.0 - std::max(ecut,ee)*amu_c2 257 *fNistManager->GetAtomicMassAmu(iz)/mom2); 258 cosTetMaxElec2 = std::max(cosTetMaxNuc2, z); 259 */ 260 cosTetMaxElec2 = cosTetMaxElec; 223 261 } 224 262 } … … 226 264 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 227 265 266 inline void G4eCoulombScatteringModel::SetRecoilThreshold(G4double eth) 267 { 268 recoilThreshold = eth; 269 } 270 271 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 272 228 273 #endif -
trunk/source/processes/electromagnetic/standard/include/G4eIonisation.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eIonisation.hh,v 1.3 5 2007/05/23 08:47:34vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eIonisation.hh,v 1.36 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 88 88 virtual ~G4eIonisation(); 89 89 90 G4bool IsApplicable(const G4ParticleDefinition& p);90 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 91 91 92 92 // Print out of the class parameters … … 98 98 const G4ParticleDefinition*); 99 99 100 G4double MinPrimaryEnergy(const G4ParticleDefinition*,101 const G4Material*, G4double cut);100 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*, 101 const G4Material*, G4double cut); 102 102 103 103 private: … … 114 114 }; 115 115 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....118 119 inline G4double G4eIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,120 const G4Material*,121 G4double cut)122 {123 G4double x = cut;124 if(isElectron) x += cut;125 return x;126 }127 128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....129 130 inline G4bool G4eIonisation::IsApplicable(const G4ParticleDefinition& p)131 {132 return (&p == G4Electron::Electron() || &p == G4Positron::Positron());133 }134 135 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 136 117 -
trunk/source/processes/electromagnetic/standard/include/G4eeToTwoGammaModel.hh
r819 r961 25 25 // 26 26 // $Id: G4eeToTwoGammaModel.hh,v 1.14 2007/05/23 08:47:34 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/standard/include/G4eplusAnnihilation.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eplusAnnihilation.hh,v 1.2 3 2007/05/23 08:47:34vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eplusAnnihilation.hh,v 1.24 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 73 73 virtual ~G4eplusAnnihilation(); 74 74 75 G4bool IsApplicable(const G4ParticleDefinition& p);75 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 76 76 77 77 virtual G4VParticleChange* AtRestDoIt( … … 79 79 const G4Step& stepData); 80 80 81 G4double AtRestGetPhysicalInteractionLength(81 virtual G4double AtRestGetPhysicalInteractionLength( 82 82 const G4Track& track, 83 83 G4ForceCondition* condition … … 96 96 }; 97 97 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....100 101 inline G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& p)102 {103 return (&p == G4Positron::Positron());104 }105 106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....107 108 inline109 G4double G4eplusAnnihilation::AtRestGetPhysicalInteractionLength(110 const G4Track&, G4ForceCondition* condition)111 {112 *condition = NotForced;113 return 0.0;114 }115 116 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 117 99 -
trunk/source/processes/electromagnetic/standard/include/G4hIonisation.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4hIonisation.hh,v 1. 38 2008/01/14 11:59:45vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4hIonisation.hh,v 1.42 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 63 63 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko) 64 64 // 11-04-04 Move MaxSecondaryEnergy to models (V.Ivanchenko) 65 // 12-09-08 Removed CorrectionsAlongStep (VI) 65 66 // 66 67 // Class Description: … … 80 81 #include "G4Positron.hh" 81 82 #include "globals.hh" 82 #include "G4VEmModel.hh"83 #include "G4EmCorrections.hh"84 83 85 84 class G4Material; … … 94 93 virtual ~G4hIonisation(); 95 94 96 G4bool IsApplicable(const G4ParticleDefinition& p);95 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 97 96 98 G4double MinPrimaryEnergy(const G4ParticleDefinition* p,99 const G4Material*, G4double cut);97 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p, 98 const G4Material*, G4double cut); 100 99 101 100 // Print out of the class parameters … … 105 104 106 105 protected: 107 108 void CorrectionsAlongStep(109 const G4MaterialCutsCouple*,110 const G4DynamicParticle*,111 G4double& eloss,112 G4double& length);113 106 114 107 virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*, … … 121 114 G4hIonisation(const G4hIonisation&); 122 115 116 G4bool isInitialised; 117 G4bool nuclearStopping; 118 123 119 G4double mass; 124 120 G4double ratio; 125 126 const G4ParticleDefinition* theParticle; 127 const G4ParticleDefinition* theBaseParticle; 128 G4EmCorrections* corr; 129 130 G4bool isInitialised; 131 G4bool nuclearStopping; 132 133 G4double eth; 134 G4double ethnuc; 135 G4double massratio; 136 121 G4double eth; 137 122 }; 138 139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....141 142 inline G4bool G4hIonisation::IsApplicable(const G4ParticleDefinition& p)143 {144 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV &&145 !p.IsShortLived());146 }147 148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....149 150 inline G4double G4hIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,151 const G4Material*,152 G4double cut)153 {154 G4double x = 0.5*cut/electron_mass_c2;155 G4double y = electron_mass_c2/mass;156 G4double g = x*y + std::sqrt((1. + x)*(1. + x*y*y));157 return mass*(g - 1.0);158 }159 123 160 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/standard/include/G4hMultipleScattering.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4hMultipleScattering.hh,v 1. 4 2007/12/07 17:35:52vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4hMultipleScattering.hh,v 1.6 2008/05/09 08:23:44 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ----------------------------------------------------------------------------- … … 60 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 61 61 62 class G4 UrbanMscModel90;62 class G4VMscModel; 63 63 64 64 class G4hMultipleScattering : public G4VMultipleScattering … … 86 86 void SetLambdalimit(G4double value) { lambdalimit = value;}; 87 87 88 // The function overloads the corresponding function of the base 89 // class.It limits the step near to boundaries only 90 // and invokes the method GetMscContinuousStepLimit at every step. 91 G4double AlongStepGetPhysicalInteractionLength( 92 const G4Track&, 93 G4double previousStepSize, 94 G4double currentMinimalStep, 95 G4double& currentSafety, 96 G4GPILSelection* selection); 97 88 98 protected: 89 99 … … 93 103 private: // data members 94 104 95 G4 UrbanMscModel90* mscUrban;105 G4VMscModel* mscUrban; 96 106 97 107 G4double lambdalimit; … … 100 110 G4bool samplez; 101 111 G4bool isInitialized; 112 G4bool isIon; 102 113 103 114 }; -
trunk/source/processes/electromagnetic/standard/include/G4ionGasIonisation.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ionGasIonisation.hh,v 1. 2 2007/08/13 06:13:30vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4ionGasIonisation.hh,v 1.4 2008/09/12 16:26:34 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 55 55 #include "G4ionIonisation.hh" 56 56 57 class G4Material;58 59 57 class G4ionGasIonisation : public G4ionIonisation 60 58 { … … 65 63 virtual ~G4ionGasIonisation(); 66 64 67 virtual void PrintInfo();68 69 protected:70 71 // Initialise process before run72 virtual void InitialiseEnergyLossProcess(73 const G4ParticleDefinition*,74 const G4ParticleDefinition*);75 76 // Initialise dynamic charge before step77 virtual void InitialiseMassCharge(const G4Track&);78 79 // Apply correction after step and modify dynamic charge80 virtual void CorrectionsAlongStep(81 const G4MaterialCutsCouple*,82 const G4DynamicParticle*,83 G4double& eloss,84 G4double& length);85 86 65 private: 87 88 // Sample change of charge of the projectile ion89 G4double SampleChargeAfterStep(G4double qeff, G4double xeff);90 66 91 67 // hide assignment operator 92 68 G4ionGasIonisation & operator=(const G4ionGasIonisation &right); 93 69 G4ionGasIonisation(const G4ionGasIonisation&); 94 95 const G4ParticleDefinition* currParticle;96 const G4ParticleDefinition* baseParticle;97 98 G4double basePartMass;99 G4double currMassRatio;100 G4double atomXS;101 G4double preStepKinEnergy;102 103 G4int currentIonZ;104 G4int ionZ;105 106 G4bool initialised;107 108 70 }; 109 71 -
trunk/source/processes/electromagnetic/standard/include/G4ionIonisation.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ionIonisation.hh,v 1.5 0 2007/11/09 11:45:45vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4ionIonisation.hh,v 1.57 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 57 57 // 22-07-06 Remove obsolete method (V.Ivantchenko) 58 58 // 07-11-07 Moved CorrectionsAlongStep to cc (V.Ivantchenko) 59 // 12-09-08 Removed InitialiseMassCharge and CorrectionsAlongStep (VI) 59 60 // 60 61 // Class Description: … … 72 73 73 74 #include "G4VEnergyLossProcess.hh" 74 #include "G4ionEffectiveCharge.hh"75 #include "G4VEmModel.hh"76 #include "G4EmCorrections.hh"77 75 78 76 class G4Material; 79 class G4PhysicsVector; 80 class G4BraggIonModel; 77 class G4EmCorrections; 81 78 82 79 class G4ionIonisation : public G4VEnergyLossProcess … … 88 85 virtual ~G4ionIonisation(); 89 86 90 inlineG4bool IsApplicable(const G4ParticleDefinition& p);87 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 91 88 92 89 // Print out of the class parameters … … 94 91 95 92 void AddStoppingData(G4int Z, G4int A, const G4String& materialName, 96 G4PhysicsVector &dVector);93 G4PhysicsVector* dVector); 97 94 98 95 void ActivateStoppingData(G4bool); … … 105 102 const G4ParticleDefinition*); 106 103 107 virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*, 108 const G4DynamicParticle*, 109 G4double& eloss, 110 G4double& length); 111 112 inline void InitialiseMassCharge(const G4Track&); 113 114 inline G4double MinPrimaryEnergy(const G4ParticleDefinition* p, 104 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p, 115 105 const G4Material*, G4double cut); 116 106 … … 118 108 119 109 inline G4bool NuclearStoppingFlag(); 120 121 // protected pointers122 G4ionEffectiveCharge* effCharge;123 G4EmCorrections* corr;124 110 125 111 private: … … 129 115 G4ionIonisation(const G4ionIonisation&); 130 116 131 // cash 132 const G4Material* curMaterial; 133 const G4ParticleDefinition* curParticle; 117 G4EmCorrections* corr; 118 134 119 const G4ParticleDefinition* theParticle; 135 const G4ParticleDefinition* theBaseParticle;136 120 137 G4double preKinEnergy;121 G4double eth; 138 122 139 G4double eth; 140 G4double baseMass; 141 G4double massRatio; 142 G4double massFactor; 143 G4double charge2; 144 145 G4bool isInitialised; 146 G4bool stopDataActive; 147 G4bool nuclearStopping; 123 G4bool isInitialised; 124 G4bool stopDataActive; 125 G4bool nuclearStopping; 148 126 }; 149 127 150 128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....152 153 inline G4bool G4ionIonisation::IsApplicable(const G4ParticleDefinition& p)154 {155 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived() &&156 p.GetParticleType() == "nucleus");157 }158 159 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....160 161 inline G4double G4ionIonisation::MinPrimaryEnergy(162 const G4ParticleDefinition*, const G4Material*, G4double cut)163 {164 G4double x = 0.5*cut/electron_mass_c2;165 G4double g = std::sqrt(1. + x);166 return proton_mass_c2*(g - 1.0);167 }168 169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....170 171 inline void G4ionIonisation::InitialiseMassCharge(const G4Track& track)172 {173 preKinEnergy = track.GetKineticEnergy();174 massRatio = baseMass/track.GetDynamicParticle()->GetMass();175 charge2 = effCharge->EffectiveChargeSquareRatio(track.GetDefinition(),176 track.GetMaterial(),177 preKinEnergy);178 SetDynamicMassCharge(massRatio, charge2);179 }180 181 129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 182 130 -
trunk/source/processes/electromagnetic/standard/src/G4ASTARStopping.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ASTARStopping.cc,v 1. 6 2006/06/29 19:52:36 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4ASTARStopping.cc,v 1.8 2008/11/24 18:28:09 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 29 29 //--------------------------------------------------------------------------- … … 53 53 G4ASTARStopping::G4ASTARStopping() 54 54 { 55 currentE = 0.0; 55 56 currentMaterial = 0; 56 57 index = 0; … … 72 73 for (G4int i=0; i<74; i++){ 73 74 if (matName == name[i]){ 74 matIndex = -1;75 matIndex = i; 75 76 currentMaterial = mat; 76 77 return i; … … 102 103 return res; 103 104 } else if (energy >= kinE[77]) { 104 index = 58;105 index = 76; 105 106 res = e[matIndex][77]; 106 107 return res; … … 134 135 for(i=0; i<74; i++) {effZ[i]=Z[i];} 135 136 136 name [0] = "G4_A-150_TISSUE"; 137 Znum [0] = 0; 138 137 name [0] = "G4_A-150_TISSUE"; 139 138 G4double T0[78] = { 0.001, 0.0015, 0.002, 0.0025, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.0125, 0.015, 0.0175, 0.02, 0.0225, 0.025, 0.0275, 0.03, 0.035, 0.04, 0.045, 0.05, 0.055, 0.06, 0.065, 0.07, 0.075, 0.08, 0.085, 0.09, 0.095, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225, 0.25, 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10 }; 140 139 … … 145 144 146 145 name [1] = "G4_ACETYLENE"; 147 Znum [1] = 0;148 149 146 G4double e1[78] = { 192.2, 229.4, 260.2, 287, 311, 353.1, 389.7, 422.5, 452.4, 480.1, 506, 530.3, 585.9, 635.7, 681.2, 723.2, 762.5, 799.4, 834.3, 867.5, 929.6, 986.9, 1040, 1090, 1137, 1182, 1224, 1265, 1304, 1341, 1376, 1411, 1444, 1475, 1619, 1741, 1847, 1938, 2017, 2085, 2144, 2195, 2275, 2331, 2367, 2388, 2397, 2395, 2386, 2370, 2350, 2326, 2299, 2271, 2241, 2210, 2056, 1913, 1783, 1666, 1562, 1468, 1384, 1308, 1177, 1072, 986.8, 915.5, 855, 802.8, 757.2, 717.1, 681.4, 649.5, 620.7, 594.7, 570.9, 549.2 }; 150 147 … … 152 149 153 150 name [2] = "G4_ADIPOSE_TISSUE_ICRP"; 154 Znum [2] = 0;155 156 151 G4double e2[78] = { 169.4, 204.2, 233.3, 258.8, 281.8, 322.4, 358.1, 390.2, 419.7, 447.2, 472.9, 497.2, 552.9, 603.2, 649.4, 692.4, 732.7, 770.7, 806.8, 841.3, 906, 966.1, 1022, 1075, 1125, 1173, 1219, 1262, 1304, 1344, 1383, 1420, 1456, 1491, 1650, 1787, 1907, 2012, 2104, 2185, 2256, 2317, 2417, 2489, 2539, 2571, 2588, 2592, 2587, 2573, 2554, 2529, 2500, 2468, 2434, 2398, 2213, 2035, 1874, 1731, 1605, 1499, 1408, 1328, 1197, 1091, 1004, 932.2, 870.7, 817.8, 771.5, 730.8, 694.5, 662.1, 632.9, 606.4, 582.3, 560.2 }; 157 152 … … 159 154 160 155 name [3] = "G4_Ag"; 161 Znum [3] = 47;162 163 156 G4double e3[78] = { 31.26, 38.13, 43.91, 48.98, 53.56, 61.66, 68.79, 75.21, 81.11, 86.6, 91.74, 96.6, 107.7, 117.8, 127, 135.6, 143.6, 151.2, 158.4, 165.3, 178.2, 190.2, 201.4, 212, 222, 231.6, 240.7, 249.5, 257.9, 266, 273.9, 281.4, 288.8, 295.9, 328.8, 357.8, 383.8, 407.4, 428.8, 448.4, 466.3, 482.8, 511.8, 536.2, 556.6, 573.5, 587.3, 598.4, 607.2, 613.8, 618.5, 621.6, 623.4, 623.8, 623.3, 621.8, 604.4, 578.7, 550.8, 523.3, 497.6, 474.4, 453.6, 435, 402.7, 375.9, 353.2, 333.6, 316.9, 302, 288.8, 276.9, 266.2, 256.5, 247.7, 239.5, 232, 225.1 }; 164 157 … … 166 159 167 160 name [4] = "G4_AIR"; 168 Znum [4] = 0;169 170 161 G4double e4[78] = { 87.5, 108.6, 126.7, 142.7, 157.3, 183.5, 206.7, 227.9, 247.5, 265.9, 283.2, 299.6, 337.7, 372.3, 404.3, 434.3, 462.6, 489.4, 515, 539.5, 585.8, 629, 669.6, 708.1, 744.8, 779.8, 813.4, 845.7, 876.8, 906.8, 935.9, 964, 991.3, 1018, 1140, 1247, 1343, 1429, 1506, 1575, 1637, 1693, 1787, 1861, 1918, 1961, 1990, 2008, 2017, 2019, 2013, 2002, 1987, 1968, 1946, 1922, 1774, 1625, 1494, 1382, 1287, 1205, 1133, 1072, 968.6, 885.9, 818, 760.7, 711.7, 669.6, 632.7, 600.2, 571.2, 545.3, 521.9, 500.6, 481.2, 463.4 }; 171 162 … … 173 164 174 165 name [5] = "G4_Al"; 175 Znum [5] = 13;176 177 166 G4double e5[78] = { 55.8, 71.89, 86.05, 98.92, 110.9, 132.7, 152.5, 170.9, 188.2, 204.5, 220.1, 235.1, 270.1, 302.5, 332.8, 361.5, 388.6, 414.6, 439.4, 463.3, 508.4, 550.4, 589.6, 626.5, 661.1, 693.7, 724.3, 753.2, 780.3, 805.9, 830.1, 852.8, 874.3, 894.5, 980, 1045, 1096, 1136, 1168, 1195, 1216, 1234, 1262, 1280, 1291, 1297, 1298, 1297, 1293, 1286, 1279, 1269, 1259, 1248, 1237, 1225, 1161, 1098, 1039, 984.9, 937.6, 895.4, 856.8, 821, 756.1, 698.6, 647.8, 604.8, 567.8, 535.7, 507.4, 482.4, 460, 439.8, 421.6, 405.1, 389.9, 376 }; 178 167 … … 180 169 181 170 name [6] = "G4_ALUMINUM_OXIDE"; 182 Znum [6] = 0;183 184 171 G4double e6[78] = { 71.39, 88.59, 103.3, 116.4, 128.4, 149.9, 169, 186.5, 202.8, 218, 232.3, 246, 277.7, 306.6, 333.4, 358.5, 382.1, 404.6, 426, 446.5, 485, 520.9, 554.3, 585.8, 615.5, 643.5, 670, 695.2, 719.1, 741.9, 763.6, 784.3, 804, 822.9, 905.9, 974, 1031, 1080, 1122, 1159, 1191, 1220, 1267, 1304, 1332, 1353, 1368, 1378, 1383, 1385, 1384, 1381, 1376, 1370, 1362, 1352, 1308, 1253, 1187, 1115, 1044, 982.5, 928.4, 880, 801.2, 737, 683.4, 638.1, 599.1, 565.2, 535.4, 508.9, 485.3, 464, 444.8, 427.3, 411.4, 396.7 }; 185 172 … … 187 174 188 175 name [7] = "G4_Ar"; 189 Znum [7] = 40;190 191 176 G4double e7[78] = { 34.54, 44.56, 53.39, 61.42, 68.88, 82.53, 94.95, 106.5, 117.3, 127.6, 137.4, 146.8, 168.8, 189.3, 208.5, 226.7, 244.1, 260.8, 276.8, 292.3, 321.9, 349.8, 376.5, 401.9, 426.4, 450, 472.8, 494.9, 516.3, 537.1, 557.3, 577, 596.1, 614.8, 702.1, 780.3, 850.8, 914.4, 971.9, 1024, 1070, 1111, 1181, 1233, 1272, 1298, 1314, 1321, 1321, 1315, 1305, 1291, 1276, 1258, 1240, 1222, 1130, 1047, 974, 911.2, 856.7, 809, 767, 729.8, 666.1, 613.2, 569.7, 532.7, 501, 473.4, 449.1, 427.4, 408.3, 391, 375.4, 361.1, 348.1, 336 }; 192 177 … … 194 179 195 180 name [8] = "G4_Au"; 196 Znum [8] = 79;197 198 181 G4double e8[78] = { 11.5, 14.55, 17.2, 19.57, 21.76, 25.72, 29.27, 32.54, 35.59, 38.46, 41.18, 43.78, 49.83, 55.39, 60.56, 65.44, 70.06, 74.46, 78.68, 82.74, 90.45, 97.69, 104.5, 111.1, 117.3, 123.3, 129.1, 134.6, 140, 145.2, 150.3, 155.2, 160, 164.7, 186.4, 205.8, 223.5, 239.5, 254.2, 267.7, 280.1, 291.5, 311.6, 328.5, 342.6, 354.3, 363.8, 371.5, 377.5, 382.1, 385.5, 387.8, 389.1, 389.6, 389.4, 388.7, 384.4, 375.7, 362.6, 346.8, 330.5, 316.4, 304, 293, 274.1, 258.4, 245, 233.4, 223.1, 214, 205.8, 198.4, 191.6, 185.5, 179.7, 174.5, 169.6, 165 }; 199 182 … … 201 184 202 185 name [9] = "G4_B-100_BONE"; 203 Znum [9] = 0;204 205 186 G4double e9[78] = { 138.6, 167.7, 192, 213.3, 232.4, 266.3, 296, 322.7, 347.2, 369.9, 391.2, 411.3, 457.3, 498.8, 536.8, 572, 605, 636.1, 665.7, 693.8, 746.5, 795.4, 841, 883.9, 924.5, 963.1, 999.9, 1035, 1069, 1101, 1133, 1163, 1192, 1220, 1348, 1460, 1557, 1643, 1719, 1786, 1845, 1897, 1983, 2047, 2093, 2124, 2142, 2149, 2148, 2139, 2125, 2106, 2084, 2059, 2031, 2003, 1861, 1726, 1600, 1484, 1379, 1290, 1214, 1147, 1035, 945.3, 871.8, 810, 757.7, 712.5, 672.9, 638.1, 607, 579.2, 554.1, 531.3, 510.5, 491.5 }; 206 187 … … 208 189 209 190 name [10] = "G4_Be"; 210 Znum [10] = 4;211 212 191 G4double e10[78] = { 146.3, 177.1, 202.9, 225.4, 245.6, 281.3, 312.5, 340.6, 366.2, 390, 412.2, 433.2, 481.1, 524.1, 563.3, 599.7, 633.6, 665.4, 695.6, 724.2, 777.7, 827, 872.7, 915.5, 955.7, 993.7, 1030, 1064, 1096, 1128, 1157, 1186, 1213, 1239, 1356, 1453, 1534, 1602, 1659, 1706, 1745, 1776, 1821, 1846, 1856, 1855, 1845, 1829, 1809, 1785, 1759, 1732, 1703, 1674, 1645, 1617, 1499, 1406, 1326, 1254, 1189, 1129, 1075, 1024, 935.3, 858.7, 792.9, 737.6, 690, 648.7, 612.5, 580.4, 552, 526.4, 503.3, 482.4, 463.3, 445.8 }; 213 192 … … 215 194 216 195 name [11] = "G4_BONE_COMPACT_ICRU"; 217 Znum [11] = 0;218 219 196 G4double e11[78] = { 125.9, 152.6, 175, 194.8, 212.5, 244.1, 271.8, 296.8, 319.8, 341.1, 361.2, 380.2, 423.8, 463.1, 499.3, 533, 564.6, 594.5, 622.8, 649.9, 700.8, 748.1, 792.4, 834.2, 873.7, 911.4, 947.4, 981.9, 1015, 1047, 1078, 1107, 1136, 1164, 1291, 1401, 1498, 1584, 1660, 1727, 1787, 1839, 1926, 1991, 2039, 2072, 2092, 2103, 2105, 2100, 2089, 2075, 2056, 2035, 2011, 1986, 1846, 1705, 1576, 1460, 1358, 1271, 1196, 1130, 1020, 931.6, 859.4, 798.8, 747.4, 702.9, 664, 629.7, 599.1, 571.7, 547.1, 524.7, 504.3, 485.6 }; 220 197 … … 222 199 223 200 name [12] = "G4_C"; 224 Znum [12] = 6;225 226 201 G4double e12[78] = { 190.6, 225.6, 254.3, 279, 300.9, 339.2, 372.1, 401.4, 427.9, 452.3, 475, 496.2, 544.3, 586.9, 625.5, 661, 693.8, 724.6, 753.5, 780.8, 831.5, 877.9, 920.8, 960.6, 998, 1033, 1066, 1098, 1128, 1156, 1184, 1210, 1235, 1259, 1366, 1455, 1531, 1595, 1650, 1698, 1738, 1772, 1825, 1862, 1886, 1900, 1906, 1906, 1901, 1892, 1880, 1866, 1850, 1833, 1814, 1795, 1684, 1571, 1466, 1372, 1288, 1213, 1145, 1085, 981.9, 898.2, 829.6, 772, 722.9, 680.4, 643.1, 610.2, 580.8, 554.4, 530.6, 509, 489.2, 471.2 }; 227 202 … … 229 204 230 205 name [13] = "G4_C_Graphite"; 231 Znum [13] = 0;232 233 206 G4double e13[78] = { 192.3, 228.9, 259, 285.1, 308.3, 348.9, 384, 415.3, 443.7, 469.9, 494.2, 517, 568.9, 615.1, 657, 695.5, 731.3, 764.8, 796.3, 826.2, 881.8, 932.7, 979.8, 1024, 1065, 1104, 1141, 1175, 1209, 1240, 1271, 1300, 1327, 1354, 1473, 1574, 1658, 1731, 1793, 1845, 1890, 1929, 1987, 2027, 2051, 2063, 2065, 2060, 2049, 2034, 2015, 1993, 1969, 1944, 1917, 1891, 1751, 1620, 1502, 1400, 1310, 1231, 1161, 1099, 994.3, 909, 839.2, 780.7, 730.8, 687.6, 649.8, 616.4, 586.6, 559.8, 535.7, 513.8, 493.8, 475.5 }; 234 207 … … 236 209 237 210 name [14] = "G4_ETHYLENE"; 238 Znum [14] = 0;239 240 211 G4double e14[78] = { 159.8, 195.8, 226, 252.7, 276.8, 319.7, 357.4, 391.5, 422.9, 452.1, 479.5, 505.4, 565.1, 619, 668.6, 714.8, 758.1, 799.1, 838.1, 875.3, 945.4, 1011, 1072, 1130, 1185, 1237, 1288, 1336, 1383, 1428, 1471, 1514, 1555, 1594, 1779, 1945, 2094, 2230, 2354, 2468, 2571, 2666, 2830, 2961, 3060, 3130, 3172, 3189, 3185, 3164, 3129, 3086, 3038, 2986, 2931, 2876, 2578, 2306, 2084, 1907, 1763, 1642, 1539, 1450, 1303, 1185, 1089, 1010, 941.9, 883.6, 832.8, 788.1, 748.4, 712.9, 680.9, 652, 625.7, 601.7 }; 241 212 … … 243 214 244 215 name [15] = "G4_C-552"; 245 Znum [15] = 0;246 247 216 G4double e15[78] = { 124.1, 148.8, 169.3, 187.2, 203.3, 231.5, 256.1, 278.2, 298.4, 317.1, 334.5, 351, 388.6, 422.4, 453.2, 481.8, 508.4, 533.5, 557.3, 579.9, 622.2, 661.3, 697.8, 732, 764.3, 794.9, 824, 851.9, 878.5, 904.1, 928.7, 952.4, 975.2, 997.3, 1097, 1184, 1259, 1325, 1384, 1435, 1481, 1521, 1588, 1639, 1678, 1706, 1726, 1738, 1744, 1745, 1743, 1736, 1727, 1716, 1703, 1688, 1603, 1511, 1421, 1338, 1261, 1190, 1126, 1067, 965.5, 883.8, 816.4, 759.6, 711.1, 669.1, 632.3, 599.9, 571, 545, 521.6, 500.3, 480.9, 463.1 }; 248 217 … … 250 219 251 220 name [16] = "G4_CARBON_DIOXIDE"; 252 Znum [16] = 0;253 254 221 G4double e16[78] = { 93.28, 114.2, 131.9, 147.5, 161.6, 186.6, 208.6, 228.5, 246.8, 263.8, 279.8, 295, 329.8, 361.2, 390.2, 417.1, 442.4, 466.4, 489.1, 510.8, 551.8, 589.8, 625.6, 659.4, 691.5, 722.2, 751.6, 779.8, 807.1, 833.4, 858.9, 883.7, 907.7, 931.1, 1040, 1137, 1225, 1306, 1380, 1449, 1513, 1571, 1676, 1763, 1834, 1891, 1933, 1961, 1977, 1982, 1978, 1967, 1952, 1932, 1911, 1888, 1752, 1614, 1490, 1383, 1290, 1209, 1139, 1077, 973.3, 890, 821.5, 764, 714.9, 672.6, 635.5, 602.6, 573.5, 547.3, 523.7, 502.4, 482.9, 465 }; 255 222 … … 257 224 258 225 name [17] = "G4_CALCIUM_FLUORIDE"; 259 Znum [17] = 0;260 261 226 G4double e17[78] = { 72.78, 90.74, 106.1, 119.8, 132.3, 154.7, 174.6, 192.8, 209.7, 225.5, 240.4, 254.5, 287.2, 317, 344.6, 370.4, 394.6, 417.6, 439.5, 460.5, 499.9, 536.5, 570.8, 603.1, 633.6, 662.6, 690.1, 716.4, 741.5, 765.6, 788.6, 810.8, 832.1, 852.6, 944.4, 1022, 1088, 1145, 1194, 1237, 1275, 1308, 1361, 1401, 1431, 1453, 1467, 1476, 1481, 1481, 1479, 1474, 1466, 1458, 1447, 1436, 1352, 1256, 1166, 1086, 1016, 954.4, 900.2, 852.3, 772.1, 708.1, 655.5, 610.7, 573.3, 540.6, 511.9, 486.6, 464, 443.8, 425.4, 408.7, 393.4, 379.4 }; 262 227 … … 264 229 265 230 name [18] = "G4_CERIC_SULFATE"; 266 Znum [18] = 0;267 268 231 G4double e18[78] = { 99.73, 123.7, 144.1, 162.3, 178.8, 208.3, 234.6, 258.5, 280.5, 301.2, 320.6, 339.1, 381.8, 420.6, 456.5, 490, 521.6, 551.5, 580.1, 607.4, 658.9, 707, 752.2, 795, 835.7, 874.6, 911.8, 947.6, 982, 1015, 1047, 1078, 1109, 1138, 1273, 1391, 1497, 1591, 1676, 1753, 1822, 1884, 1990, 2074, 2140, 2190, 2227, 2251, 2266, 2273, 2272, 2266, 2254, 2238, 2220, 2198, 2049, 1886, 1737, 1607, 1495, 1399, 1315, 1242, 1120, 1023, 942.8, 875.6, 818.4, 769.2, 726.1, 688, 654.2, 624, 596.7, 572, 549.5, 528.9 }; 269 232 … … 271 234 272 235 name [19] = "G4_CELLULOSE_NITRATE"; 273 Znum [19] = 0;274 275 236 G4double e19[78] = { 157.6, 186.4, 209.9, 230.3, 248.3, 279.7, 306.8, 330.8, 352.6, 372.6, 391.2, 408.7, 448.1, 483.2, 514.9, 544.1, 571.1, 596.4, 620.3, 642.8, 684.8, 723.2, 758.8, 792, 823.2, 852.7, 880.6, 907.2, 932.6, 956.9, 980.2, 1003, 1024, 1045, 1139, 1220, 1290, 1353, 1408, 1457, 1502, 1541, 1608, 1662, 1704, 1736, 1761, 1778, 1789, 1796, 1798, 1796, 1790, 1782, 1772, 1760, 1674, 1574, 1476, 1385, 1302, 1227, 1160, 1099, 993.8, 909.3, 839.7, 781.1, 731.2, 688.1, 650.2, 616.7, 587, 560.3, 536.2, 514.4, 494.5, 476.2 }; 276 237 … … 278 239 279 240 name [20] = "G4_BONE_CORTICAL_ICRP"; 280 Znum [20] = 0;281 282 241 G4double e20[78] = { 109.1, 132.8, 152.8, 170.4, 186.2, 214.4, 239.3, 261.7, 282.4, 301.6, 319.7, 336.8, 376.1, 411.7, 444.5, 475, 503.6, 530.7, 556.5, 581.1, 627.4, 670.4, 710.8, 748.9, 785, 819.4, 852.4, 883.9, 914.3, 943.5, 971.7, 999, 1025, 1051, 1168, 1270, 1360, 1440, 1511, 1574, 1630, 1680, 1763, 1826, 1872, 1905, 1927, 1939, 1943, 1941, 1933, 1921, 1905, 1887, 1866, 1844, 1720, 1593, 1475, 1369, 1274, 1193, 1123, 1062, 959.2, 877.1, 809.7, 753, 704.9, 663.4, 627, 594.9, 566.3, 540.6, 517.5, 496.5, 477.4, 459.8 }; 283 242 … … 285 244 286 245 name [21] = "G4_CESIUM_IODIDE"; 287 Znum [21] = 0;288 289 246 G4double e21[78] = { 40.6, 48.54, 55.16, 60.95, 66.15, 75.33, 83.38, 90.64, 97.29, 103.5, 109.3, 114.8, 127.3, 138.7, 149.2, 158.9, 168, 176.7, 184.9, 192.8, 207.6, 221.3, 234.2, 246.4, 258, 269.1, 279.7, 289.9, 299.7, 309.2, 318.3, 327.1, 335.7, 344, 382.3, 415.8, 445.6, 472.1, 495.7, 516.7, 535.4, 551.8, 578.9, 599.2, 613.8, 623.8, 629.9, 633, 633.6, 632.3, 629.5, 625.5, 620.6, 615.1, 609.1, 602.8, 567.7, 533, 501.8, 474.4, 450.3, 429, 410.1, 393.3, 364.6, 340.9, 321, 304, 289.2, 275.9, 264.1, 253.6, 243.9, 235, 226.7, 218.9, 211.9, 205.4 }; 290 247 … … 292 249 293 250 name [22] = "G4_Cu"; 294 Znum [22] = 29;295 296 251 G4double e22[78] = { 29.51, 36.49, 42.42, 47.68, 52.45, 60.98, 68.54, 75.4, 81.74, 87.65, 93.23, 98.51, 110.7, 121.8, 132, 141.5, 150.5, 159, 167.2, 174.9, 189.5, 203.2, 216, 228.1, 239.7, 250.7, 261.3, 271.4, 281.2, 290.7, 299.8, 308.7, 317.3, 325.6, 364.2, 398.4, 429.1, 456.8, 482.1, 505.1, 526.2, 545.4, 579, 607, 630.1, 649.1, 664.4, 676.6, 686.2, 693.4, 698.8, 702.4, 704.6, 705.7, 705.7, 704.9, 692.5, 672.6, 650.3, 627.6, 606, 585.6, 566.3, 548, 514, 483.4, 455.8, 431, 408.4, 388, 369.6, 353.7, 339.1, 325.7, 313.4, 302, 291.7, 282.3 }; 297 252 … … 299 254 300 255 name [23] = "G4_Fe"; 301 Znum [23] = 26;302 303 256 G4double e23[78] = { 54.06, 65.42, 74.91, 83.2, 90.66, 103.8, 115.3, 125.6, 135.1, 143.8, 152, 159.8, 177.4, 193.3, 207.8, 221.3, 233.9, 245.7, 256.9, 267.6, 287.7, 306.2, 323.5, 339.8, 355.2, 369.8, 383.8, 397.1, 410, 422.3, 434.2, 445.7, 456.9, 467.6, 517.1, 560.6, 599.4, 634.3, 665.9, 694.6, 720.8, 744.8, 786.6, 821.5, 850.4, 874.1, 893.1, 908.1, 919.6, 928, 933.6, 936.8, 938, 937.3, 935.1, 931.5, 899.9, 856.7, 810.9, 766.9, 727.3, 691.9, 660.2, 631.5, 581.8, 540.1, 504.6, 473.9, 447.2, 423.6, 402.6, 383.5, 366.9, 352, 338.3, 325.7, 314.1, 303.6 }; 304 257 … … 306 259 307 260 name [24] = "G4_FERROUS_SULFATE"; 308 Znum [24] = 0;309 310 261 G4double e24[78] = { 99.58, 123.5, 144, 162.1, 178.6, 208.1, 234.3, 258.2, 280.2, 300.8, 320.3, 338.7, 381.4, 420.2, 456, 489.5, 521, 551, 579.5, 606.8, 658.3, 706.3, 751.5, 794.2, 834.9, 873.7, 910.9, 946.6, 981, 1014, 1046, 1077, 1108, 1137, 1271, 1390, 1495, 1590, 1675, 1751, 1820, 1882, 1988, 2072, 2138, 2188, 2225, 2250, 2265, 2271, 2271, 2264, 2253, 2237, 2218, 2197, 2048, 1886, 1738, 1609, 1497, 1401, 1317, 1244, 1122, 1025, 944.6, 877.4, 820, 770.7, 727.5, 689.3, 655.4, 625.2, 597.8, 573.1, 550.5, 529.9 }; 311 262 … … 313 264 314 265 name [25] = "G4_Gd"; 315 Znum [25] = 64;316 317 266 G4double e25[78] = { 38.11, 45.4, 51.41, 56.61, 61.25, 69.34, 76.36, 82.61, 88.29, 93.53, 98.41, 103, 113.4, 122.7, 131.1, 138.9, 146.1, 152.9, 159.3, 165.4, 176.7, 187.1, 196.8, 205.9, 214.4, 222.5, 230.3, 237.6, 244.7, 251.5, 258, 264.3, 270.3, 276.2, 303.1, 326.6, 347.4, 366.2, 383.1, 398.5, 412.5, 425.4, 447.8, 466.5, 482.1, 494.8, 505.1, 513.2, 519.4, 523.9, 526.9, 528.6, 529.1, 528.6, 527.3, 525.2, 505.6, 481, 456.8, 434.6, 414.6, 396.6, 380.5, 366, 340.9, 319.7, 301.6, 285.8, 272, 259.8, 248.8, 239, 230.1, 222, 214.6, 207.7, 201.4, 195.6 }; 318 267 … … 320 269 321 270 name [26] = "G4_Ge"; 322 Znum [26] = 32;323 324 271 G4double e26[78] = { 47.65, 57.57, 65.83, 73.05, 79.53, 90.94, 100.9, 109.9, 118, 125.6, 132.7, 139.4, 154.6, 168.3, 180.8, 192.3, 203.1, 213.3, 222.9, 232, 249.1, 264.8, 279.5, 293.2, 306.1, 318.4, 330, 341.1, 351.7, 361.8, 371.5, 380.8, 389.8, 398.4, 437.2, 469.9, 497.8, 521.7, 542.3, 560.1, 575.5, 588.9, 610.7, 627.4, 640.1, 649.9, 657.3, 662.8, 666.8, 669.6, 671.4, 672.3, 672.4, 671.9, 670.9, 669.4, 656.9, 639.5, 619.8, 599.4, 578.4, 557.6, 537.5, 518.5, 483.6, 452.9, 425.8, 401.8, 380.5, 361.5, 344.3, 328.6, 315.1, 303.1, 292.1, 282, 272.6, 263.8 }; 325 272 … … 327 274 328 275 name [27] = "G4_Pyrex_Glass"; 329 Znum [27] = 0;330 331 276 G4double e27[78] = { 83.85, 102.1, 117.5, 131, 143.3, 165, 184.1, 201.3, 217.2, 232, 245.9, 259, 289.2, 316.5, 341.5, 364.8, 386.7, 407.4, 427.1, 445.8, 481.1, 513.8, 544.4, 573.2, 600.6, 626.6, 651.5, 675.3, 698.1, 720.1, 741.3, 761.7, 781.5, 800.6, 888, 963.9, 1031, 1090, 1142, 1189, 1231, 1268, 1330, 1378, 1414, 1441, 1460, 1473, 1481, 1485, 1484, 1481, 1475, 1466, 1456, 1445, 1389, 1323, 1249, 1171, 1095, 1029, 971.4, 920.7, 835.9, 768, 711.5, 663.8, 622.8, 587.4, 556.1, 528.4, 503.7, 481.5, 461.4, 443.2, 426.5, 411.2 }; 332 277 … … 334 279 335 280 name [28] = "G4_H"; 336 Znum [28] = 1;337 338 281 G4double e28[78] = { 212, 275.4, 331.7, 383, 430.9, 518.8, 599.2, 674, 744.5, 811.5, 875.6, 937.1, 1082, 1217, 1344, 1465, 1580, 1691, 1798, 1901, 2098, 2285, 2463, 2634, 2798, 2956, 3108, 3256, 3399, 3538, 3674, 3805, 3933, 4058, 4637, 5152, 5610, 6019, 6383, 6705, 6988, 7235, 7632, 7915, 8100, 8203, 8240, 8222, 8161, 8067, 7947, 7808, 7655, 7494, 7327, 7157, 6345, 5647, 5068, 4588, 4188, 3860, 3585, 3351, 2971, 2675, 2438, 2242, 2078, 1939, 1818, 1713, 1620, 1538, 1464, 1398, 1337, 1283 }; 339 282 … … 341 284 342 285 name [29] = "G4_HELIUM"; 343 Znum [29] = 2;344 345 286 G4double e29[78] = { 87.26, 110.8, 131.3, 149.8, 166.8, 197.7, 225.5, 251.1, 275, 297.5, 318.9, 339.4, 387, 430.9, 471.8, 510.4, 547, 581.9, 615.3, 647.5, 708.7, 766.1, 820.5, 872.3, 921.8, 969.3, 1015, 1059, 1102, 1143, 1183, 1221, 1259, 1296, 1465, 1614, 1748, 1867, 1975, 2071, 2156, 2233, 2361, 2460, 2535, 2588, 2624, 2644, 2652, 2650, 2639, 2621, 2598, 2571, 2540, 2507, 2323, 2139, 1976, 1832, 1706, 1593, 1493, 1402, 1249, 1130, 1033, 953.8, 886.8, 829.5, 779.8, 736.4, 697.9, 663.7, 632.9, 605.2, 580, 557 }; 346 287 … … 348 289 349 290 name [30] = "G4_KAPTON"; 350 Znum [30] = 0;351 352 291 G4double e30[78] = { 165.5, 197.6, 224.2, 247.2, 267.8, 304, 335.4, 363.5, 389.1, 412.8, 434.8, 455.6, 502.9, 545.2, 583.8, 619.4, 652.6, 683.8, 713.3, 741.2, 793.5, 841.6, 886.3, 928.2, 967.7, 1005, 1041, 1074, 1107, 1138, 1167, 1196, 1223, 1250, 1369, 1471, 1560, 1636, 1703, 1762, 1812, 1857, 1928, 1981, 2018, 2042, 2056, 2062, 2061, 2054, 2043, 2028, 2010, 1990, 1969, 1946, 1819, 1688, 1565, 1451, 1350, 1264, 1190, 1125, 1017, 929.8, 858.3, 798.2, 747, 702.8, 664, 629.8, 599.3, 571.9, 547.2, 524.8, 504.4, 485.7 }; 353 292 … … 355 294 356 295 name [31] = "G4_Kr"; 357 Znum [31] = 36;358 359 296 G4double e31[78] = { 10.15, 13.69, 16.93, 19.96, 22.84, 28.23, 33.29, 38.08, 42.66, 47.08, 51.35, 55.5, 65.43, 74.84, 83.85, 92.52, 100.9, 109.1, 117, 124.7, 139.7, 154.1, 168, 181.5, 194.6, 207.4, 219.9, 232.1, 244, 255.7, 267.2, 278.4, 289.5, 300.3, 351.9, 399.6, 443.7, 484.4, 522.1, 556.7, 588.4, 617.2, 666.6, 705.7, 735.5, 757, 771.4, 779.9, 783.4, 783, 779.4, 773.6, 765.9, 757, 747.2, 736.9, 683.7, 635.6, 595.2, 561.5, 533, 508.6, 487.3, 468.5, 439.9, 417.9, 398.8, 381.4, 364.9, 349.2, 334.2, 319.8, 306.2, 293.7, 282.8, 272.8, 263.6, 255.2 }; 360 297 … … 362 299 363 300 name [32] = "G4_LITHIUM_TETRABORATE"; 364 Znum [32] = 0;365 366 301 G4double e32[78] = { 132.7, 159.4, 181.6, 200.9, 218.2, 248.6, 275, 298.7, 320.4, 340.4, 359.1, 376.6, 416.8, 452.7, 485.5, 515.8, 544, 570.6, 595.8, 619.7, 664.3, 705.6, 743.9, 779.9, 813.9, 846.1, 876.8, 906.1, 934.2, 961.1, 987, 1012, 1036, 1059, 1166, 1258, 1338, 1410, 1474, 1531, 1583, 1628, 1706, 1767, 1814, 1849, 1874, 1891, 1899, 1902, 1899, 1891, 1875, 1852, 1825, 1795, 1638, 1494, 1375, 1276, 1193, 1121, 1058, 1002, 908.8, 833.2, 770.5, 717.6, 672.4, 633.2, 598.8, 568.3, 541.2, 516.9, 494.8, 474.9, 456.6, 439.9 }; 367 302 … … 369 304 370 305 name [33] = "G4_LITHIUM_FLUORIDE"; 371 Znum [33] = 0;372 373 306 G4double e33[78] = { 118.7, 142.6, 162.5, 179.7, 195.2, 222.4, 246, 267.2, 286.5, 304.3, 321, 336.6, 372.4, 404.4, 433.5, 460.4, 485.5, 509.1, 531.4, 552.6, 592.1, 628.5, 662.4, 694.1, 724.1, 752.4, 779.4, 805.1, 829.6, 853.2, 875.9, 897.6, 918.7, 938.9, 1031, 1110, 1179, 1240, 1294, 1341, 1383, 1421, 1483, 1530, 1566, 1592, 1610, 1621, 1627, 1627, 1624, 1618, 1609, 1598, 1585, 1571, 1483, 1387, 1296, 1214, 1140, 1074, 1015, 962.2, 872, 799.7, 739.5, 688.5, 644.8, 606.9, 573.7, 544.4, 518.3, 494.9, 473.6, 454.3, 436.7, 420.6 }; 374 307 … … 376 309 377 310 name [34] = "G4_M3_WAX"; 378 Znum [34] = 0;379 380 311 G4double e34[78] = { 173.6, 209, 238.5, 264.3, 287.6, 328.7, 364.7, 397.1, 426.9, 454.5, 480.4, 504.9, 561, 611.6, 658, 701.1, 741.6, 779.8, 816, 850.6, 915.4, 975.6, 1032, 1085, 1135, 1182, 1228, 1271, 1313, 1353, 1392, 1429, 1465, 1499, 1657, 1792, 1910, 2012, 2101, 2179, 2247, 2305, 2398, 2463, 2507, 2533, 2544, 2544, 2534, 2517, 2494, 2468, 2437, 2405, 2371, 2335, 2154, 1981, 1825, 1686, 1564, 1460, 1372, 1295, 1167, 1064, 980.4, 910.2, 850.4, 798.9, 753.8, 714.2, 678.9, 647.3, 618.8, 593, 569.4, 547.9 }; 381 312 … … 383 314 384 315 name [35] = "G4_MS20_TISSUE"; 385 Znum [35] = 0;386 387 316 G4double e35[78] = { 163.5, 196.6, 224.1, 248.2, 269.8, 308, 341.4, 371.4, 398.9, 424.4, 448.3, 470.9, 522.5, 569, 611.6, 651.1, 688, 722.9, 756, 787.5, 846.6, 901.2, 952.3, 1000, 1046, 1089, 1130, 1169, 1207, 1243, 1278, 1311, 1344, 1375, 1516, 1638, 1744, 1836, 1916, 1986, 2048, 2101, 2185, 2247, 2288, 2314, 2327, 2330, 2325, 2312, 2295, 2273, 2249, 2222, 2193, 2163, 2002, 1845, 1703, 1575, 1463, 1368, 1286, 1215, 1097, 1001, 923.2, 857.7, 802, 753.9, 711.7, 674.6, 641.6, 611.9, 585.2, 561, 539, 518.8 }; 388 317 … … 390 319 391 320 name [36] = "G4_METHANE"; 392 Znum [36] = 0;393 394 321 G4double e36[78] = { 197.5, 241.8, 279.3, 312.2, 342, 394.9, 441.5, 483.7, 522.4, 558.5, 592.4, 624.4, 698.1, 764.8, 826, 883.1, 936.6, 987.3, 1035, 1081, 1168, 1249, 1324, 1396, 1464, 1529, 1591, 1650, 1708, 1764, 1818, 1870, 1920, 1970, 2198, 2402, 2586, 2754, 2907, 3047, 3175, 3291, 3492, 3652, 3773, 3856, 3905, 3921, 3899, 3849, 3783, 3708, 3627, 3544, 3460, 3378, 2998, 2685, 2432, 2226, 2055, 1911, 1789, 1683, 1508, 1370, 1257, 1163, 1084, 1015, 955.9, 903.7, 857.5, 816.2, 779.1, 745.5, 714.9, 687.1 }; 395 322 … … 397 324 398 325 name [37] = "G4_Mo"; 399 Znum [37] = 42;400 401 326 G4double e37[78] = { 58.22, 68.98, 77.79, 85.4, 92.16, 103.9, 114.1, 123.1, 131.3, 138.8, 145.8, 152.4, 167.3, 180.5, 192.5, 203.5, 213.8, 223.4, 232.4, 241, 256.9, 271.6, 285.1, 297.8, 309.8, 321.1, 331.8, 342.1, 351.9, 361.3, 370.3, 379, 387.4, 395.5, 432.4, 464.5, 492.9, 518.2, 541, 561.6, 580.4, 597.4, 626.9, 651.2, 671.2, 687.3, 700.1, 710, 717.3, 722.3, 725.4, 726.7, 726.5, 725, 722.3, 718.8, 690.9, 655, 617.8, 582.6, 552.1, 525.7, 502.3, 481.5, 445.5, 415.5, 389.9, 367.7, 348.1, 330.6, 314.8, 300.9, 288.6, 277.3, 266.9, 257.6, 249, 241.2 }; 402 327 … … 404 329 405 330 name [38] = "G4_MUSCLE_WITH_SUCROSE"; 406 Znum [38] = 0;407 408 331 G4double e38[78] = { 111.7, 137.5, 159.4, 178.8, 196.5, 227.9, 255.7, 281, 304.4, 326.2, 346.7, 366.2, 411.2, 452, 489.7, 525, 558.1, 589.5, 619.5, 648.1, 702.2, 752.5, 799.9, 844.6, 887.2, 927.9, 966.8, 1004, 1040, 1075, 1108, 1141, 1172, 1203, 1343, 1467, 1576, 1674, 1762, 1841, 1912, 1975, 2081, 2165, 2230, 2277, 2310, 2331, 2342, 2344, 2339, 2329, 2313, 2293, 2270, 2244, 2074, 1896, 1739, 1607, 1494, 1398, 1314, 1241, 1120, 1022, 942.4, 875.3, 818.1, 768.9, 725.8, 687.7, 653.9, 623.7, 596.4, 571.7, 549.2, 528.6 }; 409 332 … … 411 334 412 335 name [39] = "G4_MUSCLE_WITHOUT_SUCROSE"; 413 Znum [39] = 0;414 415 336 G4double e39[78] = { 108.2, 133.5, 155, 174.1, 191.4, 222.4, 249.8, 274.8, 297.8, 319.3, 339.6, 358.9, 403.3, 443.7, 481, 515.9, 548.7, 579.8, 609.5, 637.9, 691.4, 741.4, 788.3, 832.7, 875, 915.3, 953.9, 991.1, 1027, 1061, 1095, 1127, 1158, 1189, 1328, 1451, 1560, 1658, 1745, 1824, 1895, 1958, 2065, 2150, 2215, 2263, 2298, 2320, 2332, 2335, 2331, 2321, 2306, 2287, 2265, 2240, 2075, 1901, 1746, 1613, 1501, 1404, 1320, 1247, 1125, 1027, 946.2, 878.8, 821.4, 772, 728.6, 690.4, 656.4, 626.1, 598.7, 573.9, 551.3, 530.6 }; 416 337 … … 418 339 419 340 name [40] = "G4_MUSCLE_SKELETAL_ICRP"; 420 Znum [40] = 0;421 422 341 G4double e40[78] = { 104.5, 129.2, 150.2, 168.8, 185.8, 216.1, 242.9, 267.4, 290, 311.1, 331, 349.8, 393.5, 433.1, 469.7, 503.9, 536.2, 566.7, 595.9, 623.7, 676.3, 725.4, 771.5, 815.1, 856.6, 896.2, 934.1, 970.6, 1006, 1040, 1072, 1104, 1135, 1165, 1302, 1422, 1530, 1626, 1712, 1790, 1860, 1922, 2029, 2113, 2178, 2228, 2263, 2286, 2299, 2304, 2302, 2293, 2280, 2262, 2242, 2218, 2059, 1888, 1735, 1604, 1492, 1396, 1312, 1240, 1118, 1021, 941.1, 874.1, 817, 767.9, 724.9, 686.8, 653.1, 622.9, 595.7, 571, 548.6, 528 }; 423 342 … … 425 344 426 345 name [41] = "G4_MUSCLE_STRIATED_ICRU"; 427 Znum [41] = 0;428 429 346 G4double e41[78] = { 104.7, 129.4, 150.5, 169.2, 186.2, 216.5, 243.4, 267.9, 290.5, 311.7, 331.6, 350.5, 394.2, 433.9, 470.6, 504.9, 537.2, 567.8, 596.9, 624.9, 677.5, 726.7, 772.8, 816.5, 858.1, 897.8, 935.8, 972.3, 1007, 1041, 1074, 1106, 1137, 1167, 1304, 1425, 1532, 1629, 1715, 1793, 1863, 1925, 2032, 2116, 2181, 2230, 2265, 2289, 2302, 2306, 2304, 2295, 2282, 2264, 2244, 2220, 2063, 1894, 1742, 1611, 1498, 1401, 1318, 1244, 1123, 1025, 944.5, 877.2, 819.9, 770.6, 727.3, 689.2, 655.3, 625, 597.7, 572.9, 550.4, 529.7 }; 430 347 … … 432 349 433 350 name [42] = "G4_N"; 434 Znum [42] = 7;435 436 351 G4double e42[78] = { 82.8, 103.7, 121.6, 137.7, 152.3, 178.7, 202.3, 223.8, 243.8, 262.5, 280.2, 297.1, 336.2, 372, 405.1, 436.2, 465.5, 493.4, 520.1, 545.7, 594.1, 639.3, 682, 722.5, 761, 797.9, 833.4, 867.4, 900.3, 932, 962.8, 992.5, 1021, 1049, 1179, 1293, 1395, 1486, 1567, 1640, 1706, 1765, 1864, 1940, 1999, 2041, 2069, 2086, 2093, 2091, 2083, 2069, 2051, 2030, 2005, 1978, 1819, 1660, 1522, 1406, 1308, 1224, 1151, 1088, 982.9, 898.5, 829.5, 771.1, 721.3, 678.5, 641, 608, 578.6, 552.3, 528.5, 506.9, 487.2, 469.1 }; 437 352 … … 439 354 440 355 name [43] = "G4_SODIUM_IODIDE"; 441 Znum [43] = 0;442 443 356 G4double e43[78] = { 35.86, 44.19, 51.24, 57.48, 63.13, 73.21, 82.12, 90.2, 97.64, 104.6, 111.1, 117.3, 131.6, 144.5, 156.4, 167.6, 178, 187.9, 197.3, 206.3, 223.3, 239.1, 253.9, 268, 281.3, 294, 306.2, 317.9, 329.2, 340.1, 350.6, 360.8, 370.6, 380.2, 424.5, 463.5, 498.4, 529.9, 558.2, 583.8, 607, 627.8, 663.4, 691.6, 713.4, 729.6, 740.9, 748.1, 751.7, 752.4, 750.7, 747, 741.7, 735.1, 727.6, 719.5, 664.4, 611.2, 569.4, 538.3, 514, 491.6, 472.1, 454, 422.9, 393.7, 370.2, 349.6, 331.4, 315.3, 301.2, 288.5, 276.8, 266.1, 256.3, 247.1, 238.9, 231.5 }; 444 357 … … 446 359 447 360 name [44] = "G4_Ne"; 448 Znum [44] = 10;449 450 361 G4double e44[78] = { 68.73, 83.7, 96.26, 107.3, 117.2, 134.8, 150.3, 164.2, 177, 188.8, 199.9, 210.4, 234.5, 256.2, 276.1, 294.6, 311.9, 328.3, 343.8, 358.6, 386.3, 412, 436.1, 458.8, 480.3, 500.8, 520.3, 539.1, 557.1, 574.5, 591.2, 607.5, 623.2, 638.4, 708.4, 770.3, 825.6, 875.7, 921.2, 962.8, 1001, 1036, 1098, 1150, 1194, 1230, 1260, 1285, 1304, 1319, 1330, 1338, 1343, 1344, 1344, 1341, 1296, 1229, 1160, 1095, 1035, 981.4, 932.6, 888.5, 812.1, 748.3, 695.6, 650.4, 611.3, 577, 546.8, 520, 496, 474.4, 454.8, 437, 420.7, 405.7 }; 451 362 … … 453 364 454 365 name [45] = "G4_NYLON-6/6"; 455 Znum [45] = 0;456 457 366 G4double e45[78] = { 167.4, 201.6, 230.3, 255.4, 278, 317.9, 352.9, 384.4, 413.4, 440.3, 465.5, 489.3, 544, 593.3, 638.6, 680.6, 720.1, 757.3, 792.7, 826.4, 889.7, 948.5, 1003, 1055, 1104, 1151, 1195, 1238, 1279, 1318, 1356, 1392, 1427, 1461, 1617, 1750, 1867, 1969, 2059, 2138, 2207, 2267, 2363, 2433, 2482, 2512, 2527, 2531, 2525, 2511, 2491, 2467, 2439, 2408, 2375, 2340, 2160, 1987, 1830, 1690, 1567, 1463, 1374, 1297, 1169, 1066, 981.3, 910.8, 850.9, 799.3, 754.1, 714.4, 679, 647.4, 618.9, 593, 569.5, 547.9 }; 458 367 … … 460 369 461 370 name [46] = "G4_O"; 462 Znum [46] = 8;463 464 371 G4double e46[78] = { 105.8, 117.3, 257.6, 1.139e-05, 5.976e-06, 0.005, 248.1, 71.83, 352, 3.186e-05, 2.012e-05, 0.015, 412.7, 40.96, 503.1, 6.782e-05, 5.098e-05, 0.035, 610.6, 24.07, 700.7, 0.0001156, 9.613e-05, 0.07, 820, 15.89, 884.2, 0.0001583, 0.0001354, 0.125, 1124, 8.719, 1280, 0.0002775, 0.0002641, 0.3, 1573, 4.478, 1697, 0.0004528, 0.000448, 0.65, 1818, 2.655, 1822, 0.0006468, 0.0006403, 1, 1667, 1.474, 1431, 0.00138, 0.001539, 2.75, 1038, 0.7076, 860.9, 0.003906, 0.004519, 6, 616.1, 0.3845, 556.8, 0.009419, 0.01034, 9.5, 452, 0.2295, 334.7, 0.03447, 0.04325, 27.5, 196.3, 0.09039, 156.5, 0.1784, 0.2149, 60 }; 465 372 … … 467 374 468 375 name [47] = "G4_PARAFFIN"; 469 Znum [47] = 0;470 471 376 G4double e47[78] = { 193.8, 233, 265.8, 294.4, 320.3, 365.9, 405.9, 441.9, 475, 505.7, 534.5, 561.7, 624.2, 680.6, 732.3, 780.4, 825.5, 868.2, 908.6, 947.2, 1020, 1087, 1150, 1209, 1265, 1319, 1370, 1419, 1465, 1510, 1554, 1595, 1636, 1675, 1852, 2004, 2137, 2253, 2354, 2442, 2518, 2584, 2688, 2762, 2810, 2837, 2848, 2845, 2831, 2810, 2782, 2749, 2713, 2674, 2633, 2592, 2381, 2184, 2007, 1851, 1714, 1598, 1500, 1414, 1272, 1158, 1066, 988.4, 922.7, 866.1, 816.7, 773.2, 734.5, 699.9, 668.8, 640.6, 614.9, 591.4 }; 472 377 … … 474 379 475 380 name [48] = "G4_Pb"; 476 Znum [48] = 82;477 478 381 G4double e48[78] = { 17.96, 22.18, 25.76, 28.92, 31.8, 36.93, 41.47, 45.6, 49.4, 52.95, 56.3, 59.46, 66.77, 73.41, 79.52, 85.23, 90.6, 95.69, 100.5, 105.2, 113.9, 122, 129.7, 136.9, 143.8, 150.3, 156.6, 162.7, 168.5, 174.1, 179.5, 184.8, 189.9, 194.9, 217.7, 237.9, 256, 272.3, 287, 300.4, 312.6, 323.6, 342.6, 358.2, 370.7, 380.6, 388.3, 394.2, 398.4, 401.3, 403.1, 404, 404.1, 403.5, 402.4, 401, 392.5, 380.4, 365.3, 348.6, 332, 317.6, 304.9, 293.7, 274.4, 258.3, 244.7, 232.9, 222.5, 213.2, 205, 197.5, 190.7, 184.4, 178.7, 173.4, 168.4, 163.9 }; 479 382 … … 481 384 482 385 name [49] = "G4_PHOTOGRAPHIC_EMULSION"; 483 Znum [49] = 0;484 485 386 G4double e49[78] = { 46.69, 57.18, 66.06, 73.91, 81.04, 93.75, 105, 115.2, 124.7, 133.5, 141.8, 149.6, 167.8, 184.3, 199.6, 213.8, 227.3, 240, 252.1, 263.8, 285.7, 306.2, 325.4, 343.6, 361, 377.5, 393.4, 408.7, 423.3, 437.5, 451.2, 464.5, 477.3, 489.8, 547, 597.3, 641.7, 681.2, 716.3, 747.6, 775.5, 800.2, 841.5, 873.5, 897.8, 915.8, 928.6, 937.1, 940, 938.4, 933.8, 927, 918.6, 909.2, 899.1, 888.5, 833.7, 781.8, 735.1, 693.7, 657.1, 624.6, 595.5, 569.4, 524.5, 487.2, 455.6, 428.5, 404.9, 383.9, 365.2, 348.6, 333.8, 320.5, 308.3, 297.2, 287, 277.8 }; 486 387 … … 488 389 489 390 name [50] = "G4_PLASTIC_SC_VINYLTOLUENE"; 490 Znum [50] = 0;491 492 391 G4double e50[78] = { 192.4, 229.8, 260.8, 287.8, 312, 354.4, 391.4, 424.6, 454.8, 482.8, 509, 533.7, 590, 640.5, 686.6, 729.3, 769.2, 806.7, 842.2, 876, 939.2, 997.5, 1052, 1103, 1151, 1197, 1240, 1281, 1321, 1359, 1395, 1430, 1464, 1497, 1644, 1769, 1878, 1971, 2053, 2123, 2184, 2236, 2319, 2377, 2414, 2436, 2445, 2443, 2433, 2417, 2396, 2371, 2343, 2314, 2283, 2251, 2091, 1936, 1791, 1657, 1537, 1435, 1349, 1273, 1148, 1047, 964.8, 895.9, 837.3, 786.7, 742.4, 703.5, 668.8, 637.7, 609.7, 584.3, 561.2, 540 }; 493 392 … … 495 394 496 395 name [51] = "G4_POLYCARBONATE"; 497 Znum [51] = 0;498 499 396 G4double e51[78] = { 146.3, 178.1, 204.7, 228.1, 249.2, 286.4, 319.1, 348.5, 375.5, 400.6, 424.1, 446.2, 497, 542.8, 584.7, 623.5, 659.9, 694.2, 726.6, 757.6, 815.5, 869.1, 919, 965.9, 1010, 1052, 1092, 1130, 1167, 1202, 1235, 1268, 1299, 1329, 1465, 1581, 1681, 1768, 1843, 1908, 1965, 2013, 2090, 2144, 2180, 2201, 2210, 2209, 2202, 2188, 2170, 2149, 2125, 2099, 2072, 2044, 1912, 1785, 1661, 1543, 1433, 1340, 1261, 1191, 1076, 982.4, 906, 842, 787.5, 740.5, 699.2, 662.9, 630.5, 601.5, 575.3, 551.6, 529.9, 510.1 }; 500 397 … … 502 399 503 400 name [52] = "G4_POLYETHYLENE"; 504 Znum [52] = 0;505 506 401 G4double e52[78] = { 168.2, 205.8, 237.5, 265.4, 290.7, 335.4, 374.8, 410.5, 443.2, 473.7, 502.3, 529.3, 591.4, 647.6, 699.1, 747.1, 792.1, 834.6, 874.9, 913.5, 985.9, 1053, 1116, 1175, 1232, 1285, 1336, 1385, 1432, 1478, 1521, 1564, 1604, 1644, 1825, 1983, 2122, 2246, 2355, 2453, 2539, 2615, 2740, 2833, 2899, 2940, 2962, 2967, 2958, 2938, 2908, 2871, 2829, 2782, 2732, 2681, 2418, 2183, 1987, 1826, 1691, 1577, 1480, 1396, 1257, 1145, 1053, 977.1, 912.4, 856.5, 807.8, 764.9, 726.7, 692.6, 661.8, 633.9, 608.6, 585.4 }; 507 402 … … 509 404 510 405 name [53] = "G4_MYLAR"; 511 Znum [53] = 0;512 513 406 G4double e53[78] = { 163.2, 195.3, 221.8, 244.9, 265.6, 301.9, 333.5, 361.8, 387.6, 411.5, 433.8, 454.8, 502.7, 545.7, 584.8, 621, 654.8, 686.6, 716.7, 745.3, 798.7, 847.9, 893.8, 936.8, 977.4, 1016, 1052, 1087, 1121, 1153, 1183, 1213, 1241, 1269, 1393, 1500, 1593, 1673, 1744, 1806, 1860, 1908, 1985, 2042, 2083, 2110, 2126, 2133, 2133, 2126, 2115, 2100, 2082, 2061, 2038, 2014, 1874, 1731, 1599, 1482, 1379, 1290, 1215, 1148, 1038, 948.5, 875.3, 813.8, 761.5, 716.3, 676.6, 641.6, 610.5, 582.5, 557.3, 534.4, 513.6, 494.5 }; 514 407 … … 516 409 517 410 name [54] = "G4_PLEXIGLASS"; 518 Znum [54] = 0;519 520 411 G4double e54[78] = { 118.7, 146.6, 170.3, 191.4, 210.4, 244.5, 274.7, 302.1, 327.3, 350.9, 373.1, 394.2, 442.7, 486.8, 527.4, 565.2, 600.9, 634.6, 666.7, 697.4, 755.1, 808.9, 859.3, 906.9, 952, 995, 1036, 1075, 1113, 1150, 1185, 1219, 1252, 1283, 1428, 1554, 1665, 1762, 1848, 1923, 1990, 2049, 2144, 2216, 2266, 2300, 2320, 2328, 2327, 2318, 2302, 2282, 2259, 2232, 2203, 2173, 2008, 1847, 1702, 1574, 1464, 1369, 1288, 1217, 1099, 1004, 925.6, 860.1, 804.4, 756.3, 714.1, 676.9, 643.8, 614.2, 587.4, 563.2, 541.1, 520.8 }; 521 412 … … 523 414 524 415 name [55] = "G4_POLYPROPYLENE"; 525 Znum [55] = 0;526 527 416 G4double e55[78] = { 193.7, 232.8, 265.4, 293.9, 319.6, 365, 404.8, 440.6, 473.4, 503.9, 532.5, 559.6, 621.6, 677.5, 728.8, 776.5, 821.2, 863.4, 903.5, 941.8, 1014, 1080, 1142, 1201, 1257, 1309, 1360, 1408, 1454, 1499, 1541, 1583, 1622, 1661, 1836, 1986, 2117, 2231, 2331, 2417, 2492, 2557, 2660, 2732, 2779, 2806, 2817, 2814, 2801, 2780, 2752, 2720, 2684, 2646, 2606, 2565, 2359, 2165, 1991, 1836, 1700, 1585, 1488, 1403, 1263, 1150, 1058, 981.3, 916.1, 860, 810.9, 767.8, 729.5, 695.1, 664.3, 636.2, 610.8, 587.5 }; 528 417 … … 530 419 531 420 name [56] = "G4_POLYSTYRENE"; 532 Znum [56] = 0;533 534 421 G4double e56[78] = { 153, 187.5, 216.6, 242.2, 265.3, 306.5, 342.7, 375.5, 405.6, 433.6, 460, 484.9, 542.1, 593.8, 641.3, 685.4, 726.9, 766, 803.1, 838.5, 905, 966.6, 1024, 1078, 1130, 1178, 1225, 1269, 1312, 1352, 1392, 1429, 1466, 1501, 1661, 1797, 1915, 2017, 2106, 2183, 2249, 2305, 2394, 2454, 2492, 2511, 2516, 2509, 2494, 2471, 2443, 2410, 2376, 2339, 2301, 2262, 2070, 1895, 1742, 1609, 1493, 1395, 1312, 1239, 1119, 1021, 941.4, 874.6, 817.8, 768.7, 725.7, 687.9, 654.1, 623.9, 596.6, 571.9, 549.4, 528.7 }; 535 422 … … 537 424 538 425 name [57] = "G4_TEFLON"; 539 Znum [57] = 0;540 541 426 G4double e57[78] = { 82.7, 99.97, 114.4, 127.1, 138.4, 158.5, 176.2, 192, 206.5, 220, 232.6, 244.5, 271.9, 296.4, 319, 339.8, 359.4, 377.8, 395.3, 412, 443.3, 472.2, 499.3, 524.7, 548.8, 571.7, 593.6, 614.5, 634.6, 653.9, 672.5, 690.4, 707.8, 724.6, 801.6, 868.9, 928.6, 981.9, 1030, 1073, 1112, 1148, 1209, 1260, 1301, 1334, 1361, 1382, 1397, 1408, 1415, 1419, 1420, 1418, 1414, 1409, 1399, 1373, 1319, 1246, 1165, 1095, 1034, 979.4, 887.4, 813.7, 752.5, 700.8, 656.5, 618.1, 584.5, 554.8, 528.3, 504.6, 483, 463.5, 445.6, 429.3 }; 542 427 … … 544 429 545 430 name [58] = "G4_POLYVINYL_CHLORIDE"; 546 Znum [58] = 0;547 548 431 G4double e58[78] = { 94.27, 114.4, 131.3, 146.3, 159.9, 184, 205.5, 224.9, 242.9, 259.7, 275.5, 290.5, 325.3, 357, 386.3, 413.7, 439.5, 464.1, 487.6, 510.1, 552.6, 592.4, 629.9, 665.5, 699.4, 731.8, 762.9, 792.9, 821.8, 849.7, 876.7, 902.9, 928.2, 952.9, 1067, 1167, 1255, 1335, 1405, 1468, 1525, 1574, 1657, 1719, 1764, 1795, 1814, 1823, 1824, 1818, 1807, 1792, 1774, 1753, 1731, 1708, 1591, 1482, 1385, 1299, 1222, 1153, 1092, 1037, 941.7, 862.4, 795.8, 739.8, 692.3, 651.2, 615.4, 583.7, 555.6, 530.3, 507.5, 486.9, 468, 450.8 }; 549 432 … … 551 434 552 435 name [59] = "G4_PROPANE"; 553 Znum [59] = 0;554 555 436 G4double e59[78] = { 194.5, 234.7, 268.4, 298, 324.7, 372, 413.6, 451.2, 485.8, 518, 548.2, 576.8, 642.6, 702.2, 756.9, 808, 855.9, 901.2, 944.4, 985.6, 1063, 1135, 1203, 1267, 1327, 1385, 1440, 1492, 1543, 1592, 1639, 1684, 1728, 1770, 1964, 2131, 2277, 2404, 2516, 2613, 2698, 2771, 2887, 2969, 3022, 3053, 3065, 3061, 3046, 3021, 2990, 2953, 2912, 2868, 2822, 2775, 2564, 2372, 2191, 2022, 1868, 1739, 1629, 1534, 1377, 1252, 1150, 1065, 993, 931.1, 877.2, 829.9, 787.8, 750.2, 716.4, 685.8, 658, 632.5 }; 556 437 … … 558 439 559 440 name [60] = "G4_Pt"; 560 Znum [60] = 78;561 562 441 G4double e60[78] = { 14.45, 17.87, 20.78, 23.37, 25.71, 29.9, 33.61, 36.99, 40.1, 43.01, 45.75, 48.35, 54.36, 59.81, 64.84, 69.54, 73.97, 78.17, 82.17, 86, 93.22, 99.96, 106.3, 112.3, 118, 123.5, 128.7, 133.8, 138.7, 143.4, 147.9, 152.4, 156.7, 160.8, 180.3, 197.6, 213.3, 227.7, 240.9, 253, 264.3, 274.7, 293.2, 309, 322.4, 333.7, 343.1, 350.7, 356.8, 361.6, 365.1, 367.6, 369.1, 369.8, 369.9, 369.3, 364.7, 357, 347.3, 336.6, 325.5, 314.4, 303.6, 293.2, 274.3, 258.5, 245.1, 233.4, 223.1, 214, 205.8, 198.4, 191.6, 185.4, 179.7, 174.4, 169.5, 164.9 }; 563 442 … … 565 444 566 445 name [61] = "G4_Si"; 567 Znum [61] = 14;568 569 446 G4double e61[78] = { 47.32, 61.63, 74.34, 85.98, 96.82, 116.8, 135.1, 152.1, 168.2, 183.4, 198.1, 212.1, 245.3, 276.1, 305.2, 332.7, 359.1, 384.4, 408.7, 432.2, 477, 519.3, 559.4, 597.5, 633.9, 668.6, 701.9, 733.7, 764.3, 793.5, 821.6, 848.5, 874.4, 899.1, 1008, 1097, 1168, 1225, 1270, 1307, 1336, 1359, 1390, 1408, 1416, 1417, 1413, 1405, 1395, 1383, 1370, 1356, 1341, 1326, 1310, 1295, 1218, 1146, 1081, 1023, 970.6, 923.9, 881.4, 842.4, 773.1, 713.1, 661.2, 617.4, 579.7, 547, 518.2, 492.7, 470, 449.5, 430.9, 414, 398.6, 384.4 }; 570 447 … … 572 449 573 450 name [62] = "G4_SILICON_DIOXIDE"; 574 Znum [62] = 0;575 576 451 G4double e62[78] = { 68.9, 85.1, 98.85, 111, 122.1, 141.8, 159.3, 175.1, 189.8, 203.4, 216.3, 228.5, 256.6, 282.1, 305.7, 327.6, 348.3, 367.9, 386.5, 404.4, 437.9, 469.2, 498.5, 526.3, 552.6, 577.7, 601.7, 624.7, 646.9, 668.2, 688.8, 708.7, 728, 746.7, 832.2, 906.8, 972.6, 1031, 1083, 1129, 1170, 1207, 1268, 1315, 1351, 1377, 1396, 1409, 1417, 1421, 1421, 1419, 1414, 1406, 1397, 1387, 1349, 1301, 1237, 1163, 1087, 1021, 964, 913.7, 829.4, 762.2, 706.3, 659, 618.4, 583.3, 552.3, 524.9, 500.4, 478.4, 458.5, 440.4, 423.9, 408.7 }; 577 452 … … 579 454 580 455 name [63] = "G4_STILBENE"; 581 Znum [63] = 0;582 583 456 G4double e63[78] = { 192, 228.9, 259.4, 286, 309.7, 351.2, 387.4, 419.7, 449.2, 476.4, 501.9, 525.8, 580.4, 629.2, 673.8, 714.9, 753.3, 789.4, 823.5, 856, 916.5, 972.3, 1024, 1073, 1119, 1162, 1203, 1243, 1280, 1316, 1351, 1384, 1416, 1446, 1585, 1703, 1805, 1892, 1968, 2034, 2090, 2139, 2215, 2268, 2303, 2323, 2331, 2330, 2321, 2307, 2287, 2265, 2240, 2212, 2184, 2155, 1995, 1841, 1703, 1582, 1477, 1385, 1305, 1233, 1113, 1015, 936, 869.6, 813, 764.1, 721.3, 683.7, 650.1, 620, 592.9, 568.3, 545.9, 525.4 }; 584 457 … … 586 459 587 460 name [64] = "G4_Ti"; 588 Znum [64] = 22;589 590 461 G4double e64[78] = { 59.24, 72.81, 84.28, 94.41, 103.6, 119.9, 134.3, 147.4, 159.4, 170.6, 181.1, 191.1, 214, 234.7, 253.8, 271.6, 288.3, 304.1, 319.1, 333.5, 360.5, 385.5, 409, 431.2, 452.2, 472.2, 491.4, 509.7, 527.3, 544.3, 560.6, 576.4, 591.7, 606.5, 674.2, 733.1, 785, 831, 871.7, 907.9, 940, 968.3, 1015, 1051, 1077, 1095, 1106, 1112, 1114, 1112, 1107, 1100, 1092, 1082, 1071, 1059, 995.6, 933.7, 877.6, 827.9, 785.2, 747.8, 714.5, 684.4, 631.9, 587.1, 548.3, 514.3, 484.2, 457.3, 433.4, 412.5, 393.7, 376.7, 361.5, 347.6, 334.9, 323.2 }; 591 462 … … 593 464 594 465 name [65] = "G4_Sn"; 595 Znum [65] = 50;596 597 466 G4double e65[78] = { 27.39, 33.96, 39.55, 44.52, 49.04, 57.11, 64.28, 70.8, 76.82, 82.45, 87.76, 92.79, 104.4, 115, 124.8, 133.9, 142.5, 150.6, 158.4, 165.8, 179.8, 192.9, 205.2, 216.8, 227.8, 238.4, 248.4, 258.1, 267.4, 276.4, 285.1, 293.5, 301.6, 309.5, 345.7, 377.3, 405.3, 430.1, 452.1, 471.8, 489.3, 504.8, 530.7, 550.9, 566.3, 577.9, 586.3, 592.2, 596.1, 598.4, 599.3, 599.1, 598.1, 596.4, 594.2, 591.5, 573.8, 552.8, 531.2, 510.1, 488.3, 467, 447, 428.6, 396.3, 369.4, 346.8, 327.7, 311.4, 297.1, 283.9, 271.9, 260.8, 250.6, 241.7, 233.6, 226, 218.9 }; 598 467 … … 600 469 601 470 name [66] = "G4_TISSUE_METHANE"; 602 Znum [66] = 0;603 604 471 G4double e66[78] = { 135.1, 165.6, 191.3, 213.9, 234.4, 270.7, 302.8, 331.8, 358.4, 383.2, 406.5, 428.6, 479.3, 525.2, 567.4, 606.7, 643.6, 678.5, 711.7, 743.4, 803.1, 858.6, 910.7, 960.1, 1007, 1052, 1095, 1136, 1176, 1214, 1251, 1287, 1322, 1356, 1514, 1655, 1783, 1899, 2006, 2104, 2193, 2275, 2418, 2535, 2626, 2693, 2737, 2760, 2764, 2752, 2728, 2695, 2655, 2612, 2566, 2519, 2278, 2060, 1878, 1727, 1602, 1494, 1403, 1323, 1191, 1085, 998.2, 926, 864.6, 811.7, 765.6, 724.9, 688.8, 656.5, 627.4, 601.1, 577.1, 555.2 }; 605 472 … … 607 474 608 475 name [67] = "G4_TISSUE_PROPANE"; 609 Znum [67] = 0;610 611 476 G4double e67[78] = { 149.7, 181.5, 208.2, 231.7, 252.8, 290.4, 323.5, 353.4, 380.9, 406.5, 430.5, 453.3, 505.7, 553, 596.6, 637.2, 675.4, 711.5, 745.8, 778.6, 840.4, 897.8, 951.6, 1003, 1051, 1097, 1141, 1183, 1224, 1263, 1301, 1337, 1372, 1407, 1563, 1701, 1822, 1929, 2024, 2109, 2185, 2252, 2362, 2446, 2507, 2549, 2573, 2583, 2581, 2569, 2550, 2524, 2494, 2461, 2426, 2389, 2211, 2043, 1887, 1744, 1616, 1507, 1415, 1334, 1201, 1094, 1006, 933.3, 871.4, 818.1, 771.5, 730.5, 694.1, 661.5, 632.1, 605.6, 581.4, 559.3 }; 612 477 … … 614 479 615 480 name [68] = "G4_TOLUENE"; 616 Znum [68] = 0;617 618 481 G4double e68[78] = { 192.5, 230, 261, 288.1, 312.3, 354.9, 392, 425.3, 455.6, 483.7, 510, 534.8, 591.3, 642.1, 688.4, 731.3, 771.4, 809.1, 844.8, 878.8, 942.4, 1001, 1056, 1107, 1155, 1201, 1245, 1287, 1327, 1365, 1401, 1437, 1471, 1504, 1652, 1779, 1888, 1983, 2065, 2136, 2197, 2250, 2333, 2392, 2430, 2452, 2461, 2459, 2449, 2433, 2411, 2386, 2358, 2328, 2296, 2264, 2109, 1960, 1817, 1683, 1560, 1456, 1368, 1291, 1163, 1060, 976.6, 906.6, 847.1, 795.7, 750.8, 711.3, 676.1, 644.6, 616.2, 590.5, 567, 545.6 }; 619 482 … … 621 484 622 485 name [69] = "G4_U"; 623 Znum [69] = 92;624 625 486 G4double e69[78] = { 13.2, 16.72, 19.77, 22.52, 25.04, 29.61, 33.73, 37.51, 41.03, 44.35, 47.5, 50.51, 57.52, 63.96, 69.97, 75.62, 80.99, 86.11, 91.01, 95.73, 104.7, 113.1, 121.1, 128.7, 136, 143, 149.8, 156.3, 162.6, 168.8, 174.7, 180.5, 186.2, 191.7, 217.4, 240.5, 261.5, 280.8, 298.5, 314.8, 329.8, 343.7, 368, 388.4, 405.3, 419, 429.8, 438.1, 444.2, 448.4, 450.8, 451.8, 451.6, 450.3, 448.2, 445.4, 420, 390.1, 362.9, 339.6, 319.8, 303.1, 288.9, 276.7, 256.9, 241.7, 229.4, 218.6, 209.1, 200.6, 193, 186.1, 179.8, 174, 168.6, 163.7, 159.1, 154.8 }; 626 487 … … 628 489 629 490 name [70] = "G4_W"; 630 Znum [70] = 74;631 632 491 G4double e70[78] = { 20.75, 25.23, 28.99, 32.29, 35.26, 40.51, 45.11, 49.26, 53.06, 56.59, 59.9, 63.02, 70.18, 76.63, 82.54, 88.02, 93.16, 98.01, 102.6, 107, 115.2, 122.9, 130, 136.7, 143.1, 149.2, 155, 160.6, 165.9, 171.1, 176.1, 180.9, 185.6, 190.1, 211.1, 229.6, 246.2, 261.3, 275.1, 287.7, 299.3, 310, 328.8, 344.7, 358.1, 369.2, 378.3, 385.6, 391.3, 395.6, 398.7, 400.6, 401.7, 401.9, 401.4, 400.4, 389.5, 374.8, 359.5, 344.8, 331, 318.3, 306.5, 295.7, 276.7, 260.8, 247.3, 235.5, 225.2, 216.1, 207.8, 200.3, 193.5, 187.3, 181.5, 176.2, 171.3, 166.7 }; 633 492 … … 635 494 636 495 name [71] = "G4_WATER"; 637 Znum [71] = 0;638 639 496 G4double e71[78] = { 98.91, 122.7, 143.1, 161.1, 177.5, 206.9, 233, 256.8, 278.8, 299.3, 318.6, 337, 379.5, 418.1, 453.8, 487.1, 518.6, 548.3, 576.7, 603.9, 655.2, 703, 748, 790.5, 831, 869.6, 906.6, 942.2, 976.4, 1009, 1041, 1072, 1102, 1131, 1265, 1383, 1488, 1582, 1666, 1743, 1811, 1873, 1978, 2062, 2128, 2178, 2215, 2240, 2255, 2262, 2262, 2256, 2245, 2230, 2211, 2190, 2050, 1896, 1752, 1624, 1511, 1414, 1329, 1255, 1132, 1034, 952.7, 884.8, 826.9, 777.1, 733.4, 694.9, 660.7, 630.1, 602.5, 577.6, 554.8, 534 }; 640 497 … … 642 499 643 500 name [72] = "G4_WATER_VAPOR"; 644 Znum [72] = 0;645 646 501 G4double e72[78] = { 126.3, 154.7, 178.7, 199.8, 218.8, 252.7, 282.5, 309.5, 334.3, 357.3, 379, 399.5, 446.7, 489.3, 528.5, 565, 599.2, 631.6, 662.4, 691.9, 747.3, 798.8, 847.2, 892.9, 936.3, 977.8, 1018, 1056, 1093, 1128, 1163, 1196, 1228, 1260, 1405, 1535, 1652, 1758, 1855, 1942, 2022, 2094, 2216, 2309, 2377, 2422, 2446, 2455, 2453, 2446, 2436, 2423, 2409, 2392, 2371, 2346, 2169, 1971, 1797, 1653, 1537, 1437, 1351, 1275, 1149, 1049, 965.8, 896.6, 837.6, 786.9, 742.5, 703.3, 668.6, 637.5, 609.5, 584.2, 561.1, 539.9 }; 647 502 … … 649 504 650 505 name [73] = "G4_Xe"; 651 Znum [73] = 54;652 653 506 G4double e73[78] = { 18.11, 23.3, 27.86, 31.99, 35.83, 42.84, 49.2, 55.1, 60.63, 65.87, 70.87, 75.65, 86.89, 97.3, 107.1, 116.3, 125.1, 133.5, 141.7, 149.5, 164.4, 178.6, 192, 204.9, 217.3, 229.2, 240.7, 251.8, 262.6, 273.1, 283.4, 293.3, 303, 312.5, 356.7, 396.5, 432.5, 465.2, 494.9, 521.8, 546.1, 567.9, 604.7, 633.2, 654.5, 669.3, 678.8, 683.6, 684.6, 682.5, 678, 671.7, 663.9, 655.1, 645.6, 635.6, 584.6, 538.7, 500.4, 468.8, 446.7, 430.5, 417.1, 405.3, 383.9, 364, 344.9, 326.8, 309.7, 294.6, 281.3, 269.5, 258.7, 248.8, 239.6, 231.1, 223.2, 216.2 }; 654 507 -
trunk/source/processes/electromagnetic/standard/src/G4BetheBlochModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BetheBlochModel.cc,v 1. 13 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4BetheBlochModel.cc,v 1.25 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 45 45 // 13-02-03 Add name (V.Ivanchenko) 46 46 // 24-03-05 Add G4EmCorrections (V.Ivanchenko) 47 // 11-04-05 Major optimisation of internal interfaces (V.Ivan tchenko)47 // 11-04-05 Major optimisation of internal interfaces (V.Ivanchenko) 48 48 // 11-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma) 49 49 // 12-02-06 move G4LossTableManager::Instance()->EmCorrections() 50 50 // in constructor (mma) 51 // 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio, 52 // CorrectionsAlongStep needed for ions(V.Ivanchenko) 51 53 // 52 54 // ------------------------------------------------------------------- … … 63 65 #include "G4EmCorrections.hh" 64 66 #include "G4ParticleChangeForLoss.hh" 67 #include "G4NistManager.hh" 65 68 66 69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 71 74 const G4String& nam) 72 75 : G4VEmModel(nam), 73 particle(0), 74 tlimit(DBL_MAX), 75 twoln10(2.0*log(10.0)), 76 bg2lim(0.0169), 77 taulim(8.4146e-3), 78 isIon(false) 79 { 76 particle(0), 77 tlimit(DBL_MAX), 78 twoln10(2.0*log(10.0)), 79 bg2lim(0.0169), 80 taulim(8.4146e-3), 81 isIon(false), 82 isInitialised(false) 83 { 84 fParticleChange = 0; 80 85 if(p) SetParticle(p); 81 86 theElectron = G4Electron::Electron(); 82 87 corr = G4LossTableManager::Instance()->EmCorrections(); 88 nist = G4NistManager::Instance(); 89 SetLowEnergyLimit(2.0*MeV); 83 90 } 84 91 … … 102 109 { 103 110 if (!particle) SetParticle(p); 104 G4String pname = particle->GetParticleName(); 105 if (particle->GetParticleType() == "nucleus" && 106 pname != "deuteron" && pname != "triton") isIon = true; 107 108 if (pParticleChange) 109 fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*> 110 (pParticleChange); 111 else 112 fParticleChange = new G4ParticleChangeForLoss(); 113 } 114 115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 116 117 G4double G4BetheBlochModel::ComputeCrossSectionPerElectron( 118 const G4ParticleDefinition* p, 119 G4double kineticEnergy, 120 G4double cutEnergy, 121 G4double maxKinEnergy) 111 112 corrFactor = chargeSquare; 113 // always false before the run 114 SetDeexcitationFlag(false); 115 116 if(!isInitialised) { 117 isInitialised = true; 118 119 if(!fParticleChange) { 120 if (pParticleChange) { 121 fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*> 122 (pParticleChange); 123 } else { 124 fParticleChange = new G4ParticleChangeForLoss(); 125 } 126 } 127 } 128 } 129 130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 131 132 void G4BetheBlochModel::SetParticle(const G4ParticleDefinition* p) 133 { 134 if(particle != p) { 135 particle = p; 136 G4String pname = particle->GetParticleName(); 137 if (particle->GetParticleType() == "nucleus" && 138 pname != "deuteron" && pname != "triton") { 139 isIon = true; 140 } 141 142 mass = particle->GetPDGMass(); 143 spin = particle->GetPDGSpin(); 144 G4double q = particle->GetPDGCharge()/eplus; 145 chargeSquare = q*q; 146 ratio = electron_mass_c2/mass; 147 G4double magmom = particle->GetPDGMagneticMoment() 148 *mass/(0.5*eplus*hbar_Planck*c_squared); 149 magMoment2 = magmom*magmom - 1.0; 150 formfact = 0.0; 151 if(particle->GetLeptonNumber() == 0) { 152 G4double x = 0.8426*GeV; 153 if(spin == 0.0 && mass < GeV) {x = 0.736*GeV;} 154 else if(mass > GeV) { 155 x /= nist->GetZ13(mass/proton_mass_c2); 156 // tlimit = 51.2*GeV*A13[iz]*A13[iz]; 157 } 158 formfact = 2.0*electron_mass_c2/(x*x); 159 tlimit = 2.0/formfact; 160 } 161 } 162 } 163 164 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 165 166 G4double G4BetheBlochModel::GetChargeSquareRatio(const G4ParticleDefinition* p, 167 const G4Material* mat, 168 G4double kineticEnergy) 169 { 170 // this method is called only for ions 171 G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,kineticEnergy); 172 corrFactor = q2*corr->EffectiveChargeCorrection(p,mat,kineticEnergy); 173 return corrFactor; 174 } 175 176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 177 178 G4double G4BetheBlochModel::GetParticleCharge(const G4ParticleDefinition* p, 179 const G4Material* mat, 180 G4double kineticEnergy) 181 { 182 // this method is called only for ions 183 return corr->GetParticleCharge(p,mat,kineticEnergy); 184 } 185 186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 187 188 G4double 189 G4BetheBlochModel::ComputeCrossSectionPerElectron(const G4ParticleDefinition* p, 190 G4double kineticEnergy, 191 G4double cutEnergy, 192 G4double maxKinEnergy) 122 193 { 123 194 G4double cross = 0.0; … … 130 201 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2; 131 202 132 cross = 1.0/cutEnergy - 1.0/maxEnergy - beta2*log(maxEnergy/cutEnergy)/tmax; 203 cross = 1.0/cutEnergy - 1.0/maxEnergy 204 - beta2*log(maxEnergy/cutEnergy)/tmax; 133 205 134 206 // +term for spin=1/2 particle 135 207 if( 0.5 == spin ) cross += 0.5*(maxEnergy - cutEnergy)/energy2; 208 209 // High order correction different for hadrons and ions 210 // nevetheless they are applied to reduce high energy transfers 211 // if(!isIon) 212 //cross += corr->FiniteSizeCorrectionXS(p,currentMaterial, 213 // kineticEnergy,cutEnergy); 136 214 137 215 cross *= twopi_mc2_rcl2*chargeSquare/beta2; … … 167 245 G4double maxEnergy) 168 246 { 247 currentMaterial = material; 169 248 G4double eDensity = material->GetElectronDensity(); 170 249 G4double cross = eDensity*ComputeCrossSectionPerElectron … … 222 301 dedx *= twopi_mc2_rcl2*chargeSquare*eDensity/beta2; 223 302 224 //High order correction only for hadrons 225 if(!isIon) dedx += corr->HighOrderCorrections(p,material,kineticEnergy); 226 303 //High order correction different for hadrons and ions 304 if(isIon) { 305 dedx += corr->IonBarkasCorrection(p,material,kineticEnergy); 306 } else { 307 dedx += corr->HighOrderCorrections(p,material,kineticEnergy,cutEnergy); 308 } 227 309 return dedx; 310 } 311 312 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 313 314 void G4BetheBlochModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple, 315 const G4DynamicParticle* dp, 316 G4double& eloss, 317 G4double&, 318 G4double length) 319 { 320 const G4ParticleDefinition* p = dp->GetDefinition(); 321 const G4Material* mat = couple->GetMaterial(); 322 G4double preKinEnergy = dp->GetKineticEnergy(); 323 G4double e = preKinEnergy - eloss*0.5; 324 if(e < 0.0) e = preKinEnergy*0.5; 325 326 if(isIon) { 327 G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,e); 328 GetModelOfFluctuations()->SetParticleAndCharge(p, q2); 329 eloss *= q2*corr->EffectiveChargeCorrection(p,mat,e)/corrFactor; 330 eloss += length*corr->IonHighOrderCorrections(p,couple,e); 331 } 332 333 if(nuclearStopping && preKinEnergy*proton_mass_c2/mass < chargeSquare*100.*MeV) { 334 335 G4double nloss = length*corr->NuclearDEDX(p,mat,e,false); 336 337 // too big energy loss 338 if(eloss + nloss > preKinEnergy) { 339 nloss *= (preKinEnergy/(eloss + nloss)); 340 eloss = preKinEnergy; 341 } else { 342 eloss += nloss; 343 } 344 /* 345 G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy 346 << " de= " << eloss << " NIEL= " << nloss 347 << " dynQ= " << dp->GetCharge()/eplus << G4endl; 348 */ 349 fParticleChange->ProposeNonIonizingEnergyDeposit(nloss); 350 } 351 228 352 } 229 353 … … 239 363 G4double tmax = MaxSecondaryEnergy(dp->GetDefinition(),kineticEnergy); 240 364 241 G4double maxKinEnergy = min(maxEnergy,tmax);365 G4double maxKinEnergy = std::min(maxEnergy,tmax); 242 366 if(minKinEnergy >= maxKinEnergy) return; 243 367 … … 246 370 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/etot2; 247 371 248 G4double deltaKinEnergy, f; 249 250 // sampling follows ... 372 G4double deltaKinEnergy, f; 373 G4double f1 = 0.0; 374 G4double fmax = 1.0; 375 if( 0.5 == spin ) fmax += 0.5*maxKinEnergy*maxKinEnergy/etot2; 376 377 // sampling without nuclear size effect 251 378 do { 252 379 G4double q = G4UniformRand(); … … 255 382 256 383 f = 1.0 - beta2*deltaKinEnergy/tmax; 257 if( 0.5 == spin ) f += 0.5*deltaKinEnergy*deltaKinEnergy/etot2; 258 259 if(f > 1.0) { 260 G4cout << "G4BetheBlochModel::SampleSecondary Warning! " 261 << "Majorant 1.0 < " 262 << f << " for Edelta= " << deltaKinEnergy 263 << G4endl; 264 } 265 266 } while( G4UniformRand() > f ); 267 384 if( 0.5 == spin ) { 385 f1 = 0.5*deltaKinEnergy*deltaKinEnergy/etot2; 386 f += f1; 387 } 388 389 } while( fmax*G4UniformRand() > f); 390 391 // projectile formfactor - suppresion of high energy 392 // delta-electron production at high energy 393 394 G4double x = formfact*deltaKinEnergy; 395 if(x > 1.e-6) { 396 397 G4double x1 = 1.0 + x; 398 G4double g = 1.0/(x1*x1); 399 if( 0.5 == spin ) { 400 G4double x2 = 0.5*electron_mass_c2*deltaKinEnergy/(mass*mass); 401 g *= (1.0 + magMoment2*(x2 - f1/f)/(1.0 + x2)); 402 } 403 if(g > 1.0) { 404 G4cout << "### G4BetheBlochModel WARNING: g= " << g 405 << dp->GetDefinition()->GetParticleName() 406 << " Ekin(MeV)= " << kineticEnergy 407 << " delEkin(MeV)= " << deltaKinEnergy 408 << G4endl; 409 } 410 if(G4UniformRand() > g) return; 411 } 412 413 // delta-electron is produced 268 414 G4double totMomentum = totEnergy*sqrt(beta2); 269 415 G4double deltaMomentum = … … 309 455 } 310 456 311 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 457 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 458 459 G4double G4BetheBlochModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd, 460 G4double kinEnergy) 461 { 462 if(isIon) SetParticle(pd); 463 G4double tau = kinEnergy/mass; 464 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) / 465 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio); 466 return std::min(tmax,tlimit); 467 } 468 469 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/src/G4BetheHeitlerModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BetheHeitlerModel.cc,v 1.1 1 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4BetheHeitlerModel.cc,v 1.12 2008/10/15 15:54:57 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 61 61 #include "G4PhysicsLogVector.hh" 62 62 #include "G4ParticleChangeForGamma.hh" 63 #include "G4LossTableManager.hh" 63 64 64 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 70 71 : G4VEmModel(nam), 71 72 theCrossSectionTable(0), 72 nbins(200) 73 { 73 nbins(10) 74 { 75 fParticleChange = 0; 74 76 theGamma = G4Gamma::Gamma(); 75 77 thePositron = G4Positron::Positron(); … … 92 94 const G4DataVector&) 93 95 { 94 if(pParticleChange) 95 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 96 else 97 fParticleChange = new G4ParticleChangeForGamma(); 96 if(!fParticleChange) { 97 if(pParticleChange) { 98 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 99 } else { 100 fParticleChange = new G4ParticleChangeForGamma(); 101 } 102 } 98 103 99 104 if(theCrossSectionTable) { … … 108 113 G4double emin = LowEnergyLimit(); 109 114 G4double emax = HighEnergyLimit(); 115 G4int n = nbins*G4int(log10(emax/emin)); 116 G4bool spline = G4LossTableManager::Instance()->SplineFlag(); 110 117 G4double e, value; 111 118 112 119 for(size_t j=0; j<nvect ; j++) { 113 120 114 ptrVector = new G4PhysicsLogVector(emin, emax, nbins); 121 ptrVector = new G4PhysicsLogVector(emin, emax, n); 122 ptrVector->SetSpline(spline); 115 123 G4double Z = (*theElementTable)[j]->GetZ(); 116 124 G4int iz = G4int(Z); -
trunk/source/processes/electromagnetic/standard/src/G4BohrFluctuations.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BohrFluctuations.cc,v 1. 6 2007/09/27 14:02:41vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4BohrFluctuations.cc,v 1.7 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 137 137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 138 138 139 G4double G4BohrFluctuations::Dispersion(const G4Material* material, 140 const G4DynamicParticle* dp, 141 G4double& tmax, 142 G4double& length) 143 { 144 if(!particle) InitialiseMe(dp->GetDefinition()); 139 145 146 G4double electronDensity = material->GetElectronDensity(); 147 kineticEnergy = dp->GetKineticEnergy(); 148 G4double etot = kineticEnergy + particleMass; 149 beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot); 150 G4double siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length 151 * electronDensity * chargeSquare; 152 153 return siga; 154 } 155 156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 157 158 -
trunk/source/processes/electromagnetic/standard/src/G4BraggIonModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BraggIonModel.cc,v 1. 17 2007/07/28 13:30:53vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4BraggIonModel.cc,v 1.23 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 44 44 // 25-04-06 Add stopping data from ASTAR (V.Ivanchenko) 45 45 // 23-10-06 Reduce lowestKinEnergy to 0.25 keV (V.Ivanchenko) 46 // 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio, 47 // CorrectionsAlongStep needed for ions(V.Ivanchenko) 46 48 // 47 49 … … 62 64 #include "G4Electron.hh" 63 65 #include "G4ParticleChangeForLoss.hh" 66 #include "G4LossTableManager.hh" 67 #include "G4EmCorrections.hh" 64 68 65 69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 70 74 const G4String& nam) 71 75 : G4VEmModel(nam), 72 particle(0), 73 iMolecula(0), 74 isIon(false) 76 corr(0), 77 particle(0), 78 fParticleChange(0), 79 iMolecula(0), 80 isIon(false), 81 isInitialised(false) 75 82 { 76 83 if(p) SetParticle(p); 77 highKinEnergy = 2.0*MeV;78 lowKinEnergy = 0.0*MeV; 84 SetHighEnergyLimit(2.0*MeV); 85 79 86 HeMass = 3.727417*GeV; 80 87 rateMassHe2p = HeMass/proton_mass_c2; … … 104 111 { 105 112 if(p != particle) SetParticle(p); 106 G4String pname = particle->GetParticleName(); 107 if(particle->GetParticleType() == "nucleus" && 108 pname != "deuteron" && pname != "triton") isIon = true; 109 110 if(pParticleChange) 111 fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*> 112 (pParticleChange); 113 else 114 fParticleChange = new G4ParticleChangeForLoss(); 115 113 114 corrFactor = chargeSquare; 115 116 // always false before the run 117 SetDeexcitationFlag(false); 118 119 if(!isInitialised) { 120 isInitialised = true; 121 122 G4String pname = particle->GetParticleName(); 123 if(particle->GetParticleType() == "nucleus" && 124 pname != "deuteron" && pname != "triton") isIon = true; 125 126 corr = G4LossTableManager::Instance()->EmCorrections(); 127 128 if(!fParticleChange) { 129 if(pParticleChange) { 130 fParticleChange = 131 reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange); 132 } else { 133 fParticleChange = new G4ParticleChangeForLoss(); 134 } 135 } 136 } 137 } 138 139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 140 141 G4double G4BraggIonModel::GetChargeSquareRatio(const G4ParticleDefinition* p, 142 const G4Material* mat, 143 G4double kineticEnergy) 144 { 145 // this method is called only for ions 146 G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,kineticEnergy); 147 corrFactor = q2*corr->EffectiveChargeCorrection(p,mat,kineticEnergy); 148 return corrFactor; 149 } 150 151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 152 153 G4double G4BraggIonModel::GetParticleCharge(const G4ParticleDefinition* p, 154 const G4Material* mat, 155 G4double kineticEnergy) 156 { 157 // this method is called only for ions 158 return corr->GetParticleCharge(p,mat,kineticEnergy); 116 159 } 117 160 … … 124 167 G4double maxKinEnergy) 125 168 { 126 127 169 G4double cross = 0.0; 128 170 G4double tmax = MaxSecondaryEnergy(p, kineticEnergy); 129 G4double maxEnergy = min(tmax,maxKinEnergy);171 G4double maxEnergy = std::min(tmax,maxKinEnergy); 130 172 if(cutEnergy < tmax) { 131 173 … … 213 255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 214 256 257 void G4BraggIonModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple, 258 const G4DynamicParticle* dp, 259 G4double& eloss, 260 G4double&, 261 G4double length) 262 { 263 // this method is called only for ions 264 const G4ParticleDefinition* p = dp->GetDefinition(); 265 const G4Material* mat = couple->GetMaterial(); 266 G4double preKinEnergy = dp->GetKineticEnergy(); 267 G4double e = preKinEnergy - eloss*0.5; 268 if(e < 0.0) e = preKinEnergy*0.5; 269 270 G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,e); 271 GetModelOfFluctuations()->SetParticleAndCharge(p, q2); 272 eloss *= q2*corr->EffectiveChargeCorrection(p,mat,e)/corrFactor; 273 274 if(nuclearStopping) { 275 276 G4double nloss = length*corr->NuclearDEDX(p,mat,e,false); 277 278 // too big energy loss 279 if(eloss + nloss > preKinEnergy) { 280 nloss *= (preKinEnergy/(eloss + nloss)); 281 eloss = preKinEnergy; 282 } else { 283 eloss += nloss; 284 } 285 /* 286 G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy 287 << " de= " << eloss << " NIEL= " << nloss 288 << " dynQ= " << dp->GetCharge()/eplus << G4endl; 289 */ 290 fParticleChange->ProposeNonIonizingEnergyDeposit(nloss); 291 } 292 } 293 294 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 295 215 296 void G4BraggIonModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp, 216 297 const G4MaterialCutsCouple*, … … 220 301 { 221 302 G4double tmax = MaxSecondaryKinEnergy(dp); 222 G4double xmax = min(tmax, maxEnergy);303 G4double xmax = std::min(tmax, maxEnergy); 223 304 if(xmin >= xmax) return; 224 305 … … 274 355 fParticleChange->SetProposedKineticEnergy(kineticEnergy); 275 356 fParticleChange->SetProposedMomentumDirection(finalP); 357 } 358 359 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 360 361 G4double G4BraggIonModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd, 362 G4double kinEnergy) 363 { 364 if(pd != particle) SetParticle(pd); 365 G4double tau = kinEnergy/mass; 366 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) / 367 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio); 368 return tmax; 276 369 } 277 370 -
trunk/source/processes/electromagnetic/standard/src/G4BraggModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BraggModel.cc,v 1. 16 2007/07/28 13:30:53vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4BraggModel.cc,v 1.21 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 50 50 // 15-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma) 51 51 // 25-04-06 Add stopping data from PSTAR (V.Ivanchenko) 52 // 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio, 53 // CorrectionsAlongStep needed for ions(V.Ivanchenko) 52 54 53 55 // Class Description: … … 67 69 #include "G4Electron.hh" 68 70 #include "G4ParticleChangeForLoss.hh" 71 #include "G4LossTableManager.hh" 72 #include "G4EmCorrections.hh" 69 73 70 74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 74 78 G4BraggModel::G4BraggModel(const G4ParticleDefinition* p, const G4String& nam) 75 79 : G4VEmModel(nam), 76 particle(0), 77 protonMassAMU(1.007276), 78 iMolecula(0), 79 isIon(false) 80 particle(0), 81 protonMassAMU(1.007276), 82 iMolecula(0), 83 isIon(false), 84 isInitialised(false) 80 85 { 81 86 if(p) SetParticle(p); 87 SetHighEnergyLimit(2.0*MeV); 88 82 89 lowestKinEnergy = 1.0*keV; 83 90 theZieglerFactor = eV*cm2*1.0e-15; … … 104 111 { 105 112 if(p != particle) SetParticle(p); 106 G4String pname = particle->GetParticleName(); 107 if(particle->GetParticleType() == "nucleus" && 108 pname != "deuteron" && pname != "triton") isIon = true; 109 110 if(pParticleChange) 111 fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*> 112 (pParticleChange); 113 else 114 fParticleChange = new G4ParticleChangeForLoss(); 113 114 // always false before the run 115 SetDeexcitationFlag(false); 116 117 if(!isInitialised) { 118 isInitialised = true; 119 120 G4String pname = particle->GetParticleName(); 121 if(particle->GetParticleType() == "nucleus" && 122 pname != "deuteron" && pname != "triton") isIon = true; 123 124 corr = G4LossTableManager::Instance()->EmCorrections(); 125 126 if(pParticleChange) { 127 fParticleChange = 128 reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange); 129 } else { 130 fParticleChange = new G4ParticleChangeForLoss(); 131 } 132 } 133 } 134 135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 136 137 G4double G4BraggModel::GetChargeSquareRatio(const G4ParticleDefinition* p, 138 const G4Material* mat, 139 G4double kineticEnergy) 140 { 141 // this method is called only for ions 142 G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,kineticEnergy); 143 GetModelOfFluctuations()->SetParticleAndCharge(p, q2); 144 return q2*corr->EffectiveChargeCorrection(p,mat,kineticEnergy); 145 } 146 147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 148 149 G4double G4BraggModel::GetParticleCharge(const G4ParticleDefinition* p, 150 const G4Material* mat, 151 G4double kineticEnergy) 152 { 153 // this method is called only for ions 154 return corr->GetParticleCharge(p,mat,kineticEnergy); 115 155 } 116 156 … … 123 163 G4double maxKinEnergy) 124 164 { 125 126 165 G4double cross = 0.0; 127 166 G4double tmax = MaxSecondaryEnergy(p, kineticEnergy); 128 G4double maxEnergy = min(tmax,maxKinEnergy);167 G4double maxEnergy = std::min(tmax,maxKinEnergy); 129 168 if(cutEnergy < tmax) { 130 169 … … 203 242 204 243 return dedx; 244 } 245 246 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 247 248 void G4BraggModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple, 249 const G4DynamicParticle* dp, 250 G4double& eloss, 251 G4double&, 252 G4double length) 253 { 254 if(nuclearStopping) { 255 256 G4double preKinEnergy = dp->GetKineticEnergy(); 257 G4double e = preKinEnergy - eloss*0.5; 258 if(e < 0.0) e = preKinEnergy*0.5; 259 G4double nloss = length*corr->NuclearDEDX(dp->GetDefinition(), 260 couple->GetMaterial(), 261 e,false); 262 263 // too big energy loss 264 if(eloss + nloss > preKinEnergy) { 265 nloss *= (preKinEnergy/(eloss + nloss)); 266 eloss = preKinEnergy; 267 } else { 268 eloss += nloss; 269 } 270 /* 271 G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy 272 << " de= " << eloss << " NIEL= " << nloss 273 << " dynQ= " << dp->GetCharge()/eplus << G4endl; 274 */ 275 fParticleChange->ProposeNonIonizingEnergyDeposit(nloss); 276 } 205 277 } 206 278 … … 268 340 269 341 vdp->push_back(delta); 342 } 343 344 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 345 346 G4double G4BraggModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd, 347 G4double kinEnergy) 348 { 349 if(pd != particle) SetParticle(pd); 350 G4double tau = kinEnergy/mass; 351 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) / 352 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio); 353 return tmax; 270 354 } 271 355 -
trunk/source/processes/electromagnetic/standard/src/G4ComptonScattering.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ComptonScattering.cc,v 1. 27 2006/09/14 10:27:19 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4ComptonScattering.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 74 74 isInitialised(false) 75 75 { 76 SetLambdaBinning(90); 77 SetMinKinEnergy(0.1*keV); 78 SetMaxKinEnergy(100.0*GeV); 76 SetProcessSubType(fComptonScattering); 79 77 } 80 78 … … 86 84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 87 85 86 G4bool G4ComptonScattering::IsApplicable(const G4ParticleDefinition& p) 87 { 88 return (&p == G4Gamma::Gamma()); 89 } 90 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 88 93 void G4ComptonScattering::InitialiseProcess(const G4ParticleDefinition*) 89 94 { … … 92 97 SetBuildTableFlag(true); 93 98 SetSecondaryParticle(G4Electron::Electron()); 94 G4double emin = MinKinEnergy();95 G4double emax = MaxKinEnergy();96 99 if(!Model()) SetModel(new G4KleinNishinaCompton); 97 Model()->SetLowEnergyLimit( emin);98 Model()->SetHighEnergyLimit( emax);100 Model()->SetLowEnergyLimit(MinKinEnergy()); 101 Model()->SetHighEnergyLimit(MaxKinEnergy()); 99 102 AddEmModel(1, Model()); 100 103 } … … 104 107 105 108 void G4ComptonScattering::PrintInfo() 106 { 107 G4cout 108 << " Total cross sections has a good parametrisation" 109 << " from 10 KeV to (100/Z) GeV" 110 << "\n Sampling according " << Model()->GetName() << " model" 111 << G4endl; 112 } 109 {} 113 110 114 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/src/G4ComptonScattering52.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ComptonScattering52.cc,v 1. 5 2007/05/16 14:00:56vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4ComptonScattering52.cc,v 1.7 2008/10/15 17:53:44 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 73 73 NumbBinTable(80), 74 74 fminimalEnergy(1*eV) 75 {} 75 { 76 SetProcessSubType(13); 77 G4cout << "!!! G4ComptonScattering52 is the obsolete process class and will be removed soon !!!" 78 << G4endl; 79 } 76 80 77 81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/src/G4CoulombScattering.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CoulombScattering.cc,v 1. 11 2007/11/20 18:43:25vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4CoulombScattering.cc,v 1.20 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 59 59 60 60 G4CoulombScattering::G4CoulombScattering(const G4String& name) 61 : G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max( DBL_MAX),61 : G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max(TeV*TeV), 62 62 isInitialised(false) 63 63 { 64 G4VEmProcess::SetBuildTableFlag(true);64 SetBuildTableFlag(true); 65 65 SetStartFromNullFlag(false); 66 66 SetIntegral(true); 67 SetMinKinEnergy(keV);68 SetMaxKinEnergy(PeV);69 67 thEnergy = PeV; 70 68 thEnergyElec = PeV; … … 73 71 thEnergyElec = 10.*GeV; 74 72 } 75 SetLambdaBinning(120);76 73 SetSecondaryParticle(G4Electron::Electron()); 77 buildElmTableFlag = true;74 SetProcessSubType(fCoulombScattering); 78 75 } 79 76 … … 85 82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 86 83 84 G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p) 85 { 86 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived()); 87 } 88 89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 90 87 91 void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p) 88 92 { 89 if(!isInitialised) { 93 // second initialisation 94 if(isInitialised) { 95 G4VEmModel* mod = GetModelByIndex(0); 96 mod->SetPolarAngleLimit(PolarAngleLimit()); 97 mod = GetModelByIndex(1); 98 if(mod) mod->SetPolarAngleLimit(PolarAngleLimit()); 99 100 // first initialisation 101 } else { 90 102 isInitialised = true; 91 103 aParticle = p; 92 104 G4double mass = p->GetPDGMass(); 93 105 if (mass > GeV || p->GetParticleType() == "nucleus") { 94 buildElmTableFlag = false;106 SetBuildTableFlag(false); 95 107 verboseLevel = 0; 96 108 } else { … … 106 118 if(mass < MeV) eth = thEnergyElec; 107 119 if(eth > emin) { 108 G4eCoulombScatteringModel* model = 109 new G4eCoulombScatteringModel(thetaMin,thetaMax,buildElmTableFlag,q2Max);120 G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel(); 121 model->SetPolarAngleLimit(PolarAngleLimit()); 110 122 model->SetLowEnergyLimit(emin); 111 123 model->SetHighEnergyLimit(std::min(eth,emax)); … … 113 125 } 114 126 if(eth < emax) { 115 G4CoulombScatteringModel* model = 116 new G4CoulombScatteringModel(thetaMin,thetaMax,buildElmTableFlag,q2Max);127 G4CoulombScatteringModel* model = new G4CoulombScatteringModel(); 128 model->SetPolarAngleLimit(PolarAngleLimit()); 117 129 model->SetLowEnergyLimit(eth); 118 130 model->SetHighEnergyLimit(emax); … … 126 138 void G4CoulombScattering::PrintInfo() 127 139 { 128 G4cout << " Scattering of " << aParticle->GetParticleName() 129 << " with " << thetaMin/degree 130 << " < Theta(degree) < " << thetaMax/degree 131 << "; Eth(MeV)= "; 140 G4cout << " " << PolarAngleLimit()/degree 141 << " < Theta(degree) < 180" 142 << ", Eth(MeV)= "; 132 143 if(aParticle->GetPDGMass() < MeV) G4cout << thEnergyElec; 133 144 else G4cout << thEnergy; -
trunk/source/processes/electromagnetic/standard/src/G4CoulombScatteringModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CoulombScatteringModel.cc,v 1. 29 2007/11/09 11:45:45vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4CoulombScatteringModel.cc,v 1.37 2008/07/31 13:11:34 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 44 44 // 19.10.06 V.Ivanchenko use inheritance from G4eCoulombScatteringModel 45 45 // 09.10.07 V.Ivanchenko reorganized methods, add cut dependence in scattering off e- 46 // 09.06.08 V.Ivanchenko SelectIsotope is moved to the base class 46 47 // 47 48 // Class Description: … … 55 56 #include "Randomize.hh" 56 57 #include "G4ParticleChangeForGamma.hh" 57 #include "G4NistManager.hh"58 58 #include "G4ParticleTable.hh" 59 59 #include "G4IonTable.hh" … … 64 64 using namespace std; 65 65 66 G4CoulombScatteringModel::G4CoulombScatteringModel( 67 G4double thetaMin, G4double thetaMax, G4bool build, 68 G4double tlim, const G4String& nam) 69 : G4eCoulombScatteringModel(thetaMin,thetaMax,build,tlim,nam) 70 { 71 theMatManager = G4NistManager::Instance(); 72 theParticleTable = G4ParticleTable::GetParticleTable(); 73 } 66 G4CoulombScatteringModel::G4CoulombScatteringModel(const G4String& nam) 67 : G4eCoulombScatteringModel(nam) 68 {} 74 69 75 70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 84 79 G4double kinEnergy, 85 80 G4double Z, 86 G4double A,81 G4double, 87 82 G4double cutEnergy, 88 83 G4double) 89 84 { 90 if(p == particle && kinEnergy == tkin && Z == targetZ && 91 A == targetA && cutEnergy == ecut) return nucXSection; 92 93 // Lab system 94 G4double ekin = std::max(keV, kinEnergy); 95 nucXSection = ComputeElectronXSectionPerAtom(p,ekin,Z,A,cutEnergy); 85 SetupParticle(p); 86 G4double ekin = std::max(lowEnergyLimit, kinEnergy); 87 SetupKinematic(ekin, cutEnergy); 88 89 // save lab system kinematics 90 G4double xtkin = tkin; 91 G4double xmom2 = mom2; 92 G4double xinvb = invbeta2; 96 93 97 94 // CM system 98 95 G4int iz = G4int(Z); 99 G4double m 1 = theMatManager->GetAtomicMassAmu(iz)*amu_c2;96 G4double m2 = fNistManager->GetAtomicMassAmu(iz)*amu_c2; 100 97 G4double etot = tkin + mass; 101 98 G4double ptot = sqrt(mom2); 102 G4double bet = ptot/(etot + m1); 103 G4double gam = 1.0/sqrt((1.0 - bet)*(1.0 + bet)); 104 G4double momCM= gam*(ptot - bet*etot); 105 106 // G4cout << "ptot= " << ptot << " etot= " << etot << " beta= " 107 // << bet << " gam= " << gam << " Z= " << Z << " A= " << A << G4endl; 108 // G4cout << " CM. mom= " << momCM << " m= " << m 109 // << " m1= " << m1 << " iz= " << iz <<G4endl; 110 111 G4double momCM2 = momCM*momCM; 112 cosTetMaxNuc = std::max(cosThetaMax, 1.0 - 0.5*q2Limit/momCM2); 113 if(1.5 > targetA && p == theProton && cosTetMaxNuc < 0.0) cosTetMaxNuc = 0.0; 114 //G4cout << " ctmax= " << cosTetMaxNuc 115 //<< " ctmin= " << cosThetaMin << G4endl; 116 117 // Cross section in CM system 118 if(cosTetMaxNuc < cosThetaMin) { 119 G4double effmass = mass*m1/(mass + m1); 120 G4double x1 = 1.0 - cosThetaMin; 121 G4double x2 = 1.0 - cosTetMaxNuc; 122 G4double z1 = x1 + screenZ; 123 G4double z2 = x2 + screenZ; 124 G4double d = 1.0/formfactA; 125 G4double zn1= x1 + d; 126 G4double zn2= x2 + d; 127 nucXSection += coeff*Z*Z*chargeSquare*(1.0 + effmass*effmass/momCM2) 128 *(1./z1 - 1./z2 + 1./zn1 - 1./zn2 + 129 2.0*formfactA*std::log(z1*zn2/(z2*zn1)))/momCM2; 130 //G4cout << "XS: x1= " << x1 << " x2= " << x2 131 //<< " cross= " << cross << G4endl; 132 //G4cout << "momCM2= " << momCM2 << " invbeta2= " << invbeta2 133 // << " coeff= " << coeff << G4endl; 134 } 135 if(nucXSection < 0.0) nucXSection = 0.0; 136 return nucXSection; 137 } 138 139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 140 141 G4double G4CoulombScatteringModel::SelectIsotope(const G4Element* elm) 142 { 143 G4double N = elm->GetN(); 144 G4int ni = elm->GetNumberOfIsotopes(); 145 if(ni > 0) { 146 G4double* ab = elm->GetRelativeAbundanceVector(); 147 G4double x = G4UniformRand(); 148 G4int idx; 149 for(idx=0; idx<ni; idx++) { 150 x -= ab[idx]; 151 if (x <= 0.0) break; 152 } 153 if(idx >= ni) { 154 G4cout << "G4CoulombScatteringModel::SelectIsotope WARNING: " 155 << "abandance vector for" 156 << elm->GetName() << " is not normalised to unit" << G4endl; 157 } else { 158 N = G4double(elm->GetIsotope(idx)->GetN()); 159 } 160 } 161 return N; 99 100 G4double m12 = mass*mass; 101 G4double momCM= ptot*m2/sqrt(m12 + m2*m2 + 2.0*etot*m2); 102 103 mom2 = momCM*momCM; 104 tkin = sqrt(mom2 + m12) - mass; 105 invbeta2 = 1.0 + m12/mom2; 106 107 SetupTarget(Z, tkin); 108 109 G4double xsec = CrossSectionPerAtom(); 110 111 // restore Lab system kinematics 112 tkin = xtkin; 113 mom2 = xmom2; 114 invbeta2 = xinvb; 115 116 return xsec; 162 117 } 163 118 … … 169 124 const G4DynamicParticle* dp, 170 125 G4double cutEnergy, 171 G4double maxEnergy)126 G4double) 172 127 { 173 const G4Material* aMaterial = couple->GetMaterial();174 const G4ParticleDefinition* p = dp->GetDefinition();175 128 G4double kinEnergy = dp->GetKineticEnergy(); 176 177 // Select isotope and setup 178 SetupParticle(p); 179 const G4Element* elm = 180 SelectRandomAtom(aMaterial,p,kinEnergy,cutEnergy,maxEnergy); 181 G4double Z = elm->GetZ(); 182 G4double A = SelectIsotope(elm); 129 if(kinEnergy <= DBL_MIN) return; 130 DefineMaterial(couple); 131 SetupParticle(dp->GetDefinition()); 132 G4double ekin = std::max(lowEnergyLimit, kinEnergy); 133 SetupKinematic(ekin, cutEnergy); 134 135 // Choose nucleus 136 currentElement = SelectRandomAtom(couple,particle,ekin,ecut,tkin); 137 138 G4double Z = currentElement->GetZ(); 183 139 G4int iz = G4int(Z); 184 G4int ia = G4int(A + 0.5); 185 186 G4double cross = 187 ComputeCrossSectionPerAtom(p,kinEnergy,Z,A,cutEnergy,maxEnergy); 188 189 G4double costm = cosTetMaxNuc; 190 G4double formf = formfactA; 191 if(G4UniformRand()*cross < elecXSection) { 192 costm = cosTetMaxElec; 193 formf = 0.0; 194 } 195 196 // G4cout << "SampleSec: Ekin= " << kinEnergy << " m1= " << m1 197 // << " Z= "<< Z << " A= " <<A<< G4endl; 198 199 if(costm >= cosThetaMin) return; 200 201 // kinematics in CM system 202 G4double m1 = theParticleTable->GetIonTable()->GetNucleusMass(iz, ia); 203 G4double etot = kinEnergy + mass; 140 G4int ia = SelectIsotopeNumber(currentElement); 141 G4double m2 = theParticleTable->GetIonTable()->GetNucleusMass(iz, ia); 142 143 // CM system 144 G4double etot = tkin + mass; 204 145 G4double ptot = sqrt(mom2); 205 G4double bet = ptot/(etot + m1); 146 147 G4double momCM= ptot*m2/sqrt(mass*mass + m2*m2 + 2.0*etot*m2); 148 mom2 = momCM*momCM; 149 G4double m12 = mass*mass; 150 G4double eCM = sqrt(mom2 + m12); 151 152 // a correction for heavy projectile 153 G4double fm = m2/(mass + m2); 154 invbeta2 = 1.0 + m12*fm*fm/mom2; 155 156 // sample scattering angle in CM system 157 SetupTarget(Z, eCM - mass); 158 159 G4double cost = SampleCosineTheta(); 160 G4double z1 = 1.0 - cost; 161 if(z1 < 0.0) return; 162 163 G4double sint = sqrt(z1*(1.0 + cost)); 164 G4double phi = twopi * G4UniformRand(); 165 166 // kinematics in the Lab system 167 G4double bet = ptot/(etot + m2); 206 168 G4double gam = 1.0/sqrt((1.0 - bet)*(1.0 + bet)); 207 G4double pCM = gam*(ptot - bet*etot); 208 G4double eCM = gam*(etot - bet*ptot); 209 210 G4double x1 = 1. - cosThetaMin + screenZ; 211 G4double x2 = 1. - costm; 212 G4double x3 = cosThetaMin - costm; 213 214 G4double grej, z, z1; 215 do { 216 z = G4UniformRand()*x3; 217 z1 = (x1*x2 - screenZ*z)/(x1 + z); 218 if(z1 < 0.0) z1 = 0.0; 219 else if(z1 > 2.0) z1 = 2.0; 220 grej = 1.0/(1.0 + formf*z1); 221 } while ( G4UniformRand() > grej*grej ); 222 223 G4double cost = 1.0 - z1; 224 G4double sint= sqrt(z1*(2.0 - z1)); 225 226 G4double phi = twopi * G4UniformRand(); 227 228 // projectile after scattering 229 G4double pzCM = pCM*cost; 230 G4ThreeVector v1(pCM*cos(phi)*sint,pCM*sin(phi)*sint,gam*(pzCM + bet*eCM)); 169 G4double pzCM = momCM*cost; 170 171 G4ThreeVector v1(momCM*cos(phi)*sint,momCM*sin(phi)*sint,gam*(pzCM + bet*eCM)); 231 172 G4ThreeVector dir = dp->GetMomentumDirection(); 232 173 G4ThreeVector newDirection = v1.unit(); 233 174 newDirection.rotateUz(dir); 234 175 fParticleChange->ProposeMomentumDirection(newDirection); 176 235 177 G4double elab = gam*(eCM + bet*pzCM); 236 G4doubleekin = elab - mass;178 ekin = elab - mass; 237 179 if(ekin < 0.0) ekin = 0.0; 238 G4double plab = sqrt(ekin*(ekin + 2.0*mass));239 180 fParticleChange->SetProposedKineticEnergy(ekin); 240 181 241 182 // recoil 242 183 G4double erec = kinEnergy - ekin; 243 if(erec > Z*aMaterial->GetIonisation()->GetMeanExcitationEnergy()) { 184 G4double th = 185 std::min(recoilThreshold, 186 Z*currentElement->GetIonisation()->GetMeanExcitationEnergy()); 187 188 if(erec > th) { 244 189 G4ParticleDefinition* ion = theParticleTable->FindIon(iz, ia, 0, iz); 190 G4double plab = sqrt(ekin*(ekin + 2.0*mass)); 245 191 G4ThreeVector p2 = (ptot*dir - plab*newDirection).unit(); 246 192 G4DynamicParticle* newdp = new G4DynamicParticle(ion, p2, erec); -
trunk/source/processes/electromagnetic/standard/src/G4GammaConversion.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GammaConversion.cc,v 1. 27 2006/09/14 10:27:19 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4GammaConversion.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 79 79 isInitialised(false) 80 80 { 81 SetLambdaBinning(100);82 81 SetMinKinEnergy(2.0*electron_mass_c2); 83 Set MaxKinEnergy(100.0*GeV);82 SetProcessSubType(fGammaConversion); 84 83 } 85 84 … … 91 90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 91 92 G4bool G4GammaConversion::IsApplicable(const G4ParticleDefinition& p) 93 { 94 return (&p == G4Gamma::Gamma()); 95 } 96 97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 98 93 99 void G4GammaConversion::InitialiseProcess(const G4ParticleDefinition*) 94 100 { … … 97 103 SetBuildTableFlag(true); 98 104 SetSecondaryParticle(G4Electron::Electron()); 99 G4double emin = max(MinKinEnergy(), 2.0*electron_mass_c2);105 G4double emin = std::max(MinKinEnergy(), 2.0*electron_mass_c2); 100 106 SetMinKinEnergy(emin); 101 G4double emax = MaxKinEnergy(); 102 if(!Model()) SetModel(new G4BetheHeitlerModel); 107 if(!Model()) SetModel(new G4BetheHeitlerModel()); 103 108 Model()->SetLowEnergyLimit(emin); 104 Model()->SetHighEnergyLimit( emax);109 Model()->SetHighEnergyLimit(MaxKinEnergy()); 105 110 AddEmModel(1, Model()); 106 111 } … … 110 115 111 116 void G4GammaConversion::PrintInfo() 112 { 113 G4cout 114 << " Total cross sections has a good parametrisation" 115 << " from 1.5 MeV to 100 GeV for all Z;" 116 << "\n sampling secondary e+e- according " 117 << Model()->GetName() << " model" 118 << G4endl; 119 } 117 {} 120 118 121 119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/src/G4InitXscPAI.cc
r819 r961 26 26 // 27 27 // $Id: G4InitXscPAI.cc,v 1.9 2006/06/29 19:53:00 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/standard/src/G4IonFluctuations.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4IonFluctuations.cc,v 1. 5.2.1 2008/04/25 00:22:53vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4IonFluctuations.cc,v 1.25 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 46 46 // 16-10-03 Changed interface to Initialisation (V.Ivanchenko) 47 47 // 27-09-07 Use FermiEnergy from material, add cut dependence (V.Ivanchenko) 48 // 01-02-08 Add protection for small energies and optimise the code (V.Ivanchenko) 49 // 01-06-08 Added initialisation of effective charge prestep (V.Ivanchenko) 48 50 // 49 51 // Class Description: … … 60 62 #include "G4Material.hh" 61 63 #include "G4DynamicParticle.hh" 62 #include "G4ParticleDefinition.hh"63 64 64 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 67 68 68 69 G4IonFluctuations::G4IonFluctuations(const G4String& nam) 69 :G4VEmFluctuationModel(nam), 70 particle(0), 71 minNumberInteractionsBohr(10.0), 72 theBohrBeta2(50.0*keV/proton_mass_c2), 73 minFraction(0.2), 74 xmin(0.2), 75 minLoss(0.001*eV) 70 : G4VEmFluctuationModel(nam), 71 particle(0), 72 particleMass(proton_mass_c2), 73 charge(1.0), 74 chargeSquare(1.0), 75 effChargeSquare(1.0), 76 parameter(10.0*CLHEP::MeV/CLHEP::proton_mass_c2), 77 minNumberInteractionsBohr(0.0), 78 theBohrBeta2(50.0*keV/CLHEP::proton_mass_c2), 79 minFraction(0.2), 80 xmin(0.2), 81 minLoss(0.001*eV) 76 82 {} 77 83 … … 89 95 charge = part->GetPDGCharge()/eplus; 90 96 chargeSquare = charge*charge; 91 chargeSqRatio = 1.0; 97 effChargeSquare= chargeSquare; 98 uniFluct.InitialiseMe(part); 92 99 } 93 100 … … 96 103 G4double G4IonFluctuations::SampleFluctuations(const G4Material* material, 97 104 const G4DynamicParticle* dp, 98 G4double& tmax, 99 G4double& length, 100 G4double& meanLoss) 101 { 105 G4double& tmax, 106 G4double& length, 107 G4double& meanLoss) 108 { 109 // G4cout << "### meanLoss= " << meanLoss << G4endl; 102 110 if(meanLoss <= minLoss) return meanLoss; 103 // G4cout << "### meanLoss= " << meanLoss << G4endl; 111 112 //G4cout << "G4IonFluctuations::SampleFluctuations E(MeV)= " << dp->GetKineticEnergy() 113 // << " Elim(MeV)= " << parameter*charge*particleMass << G4endl; 114 115 // Vavilov fluctuations 116 if(dp->GetKineticEnergy() > parameter*charge*particleMass) { 117 return uniFluct.SampleFluctuations(material,dp,tmax,length,meanLoss); 118 } 104 119 105 120 G4double siga = Dispersion(material,dp,tmax,length); … … 107 122 108 123 G4double navr = minNumberInteractionsBohr; 109 110 124 navr = meanLoss*meanLoss/siga; 111 // G4cout << "### siga= " << sqrt(siga) << " navr= " << navr << G4endl;125 //G4cout << "### siga= " << sqrt(siga) << " navr= " << navr << G4endl; 112 126 113 127 // Gaussian fluctuation … … 126 140 // G4cout << "siga= " << siga << G4endl; 127 141 siga = sqrt(siga); 128 129 142 G4double lossmax = meanLoss+meanLoss; 130 do { 131 loss = G4RandGauss::shoot(meanLoss,siga); 132 } while (0.0 > loss || loss > lossmax); 133 143 144 if(siga > 5.0*meanLoss) { 145 loss = lossmax*G4UniformRand(); 146 } else { 147 do { 148 loss = G4RandGauss::shoot(meanLoss,siga); 149 } while (0.0 > loss || loss > lossmax); 150 } 134 151 // Poisson fluctuations 135 152 } else { … … 139 156 } 140 157 141 // G4cout << "meanLoss= " << meanLoss << " loss= " << loss << G4endl;158 //G4cout << "meanLoss= " << meanLoss << " loss= " << loss << G4endl; 142 159 return loss; 143 160 } … … 145 162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 146 163 147 G4double G4IonFluctuations::Dispersion( 148 const G4Material* material, 149 const G4DynamicParticle* dp, 150 G4double& tmax, 151 G4double& length) 152 { 153 particle = dp->GetDefinition(); 154 charge = particle->GetPDGCharge()/eplus; 155 G4double Q2 = charge*charge; 156 particleMass = particle->GetPDGMass(); 157 G4double q = dp->GetCharge()/eplus; 158 chargeSquare = q*q; 159 chargeSqRatio = chargeSquare/Q2; 160 161 //chargeSquare = charge*charge; 162 //chargeSqRatio = 1.0; 164 G4double G4IonFluctuations::Dispersion(const G4Material* material, 165 const G4DynamicParticle* dp, 166 G4double& tmax, 167 G4double& length) 168 { 169 kineticEnergy = dp->GetKineticEnergy(); 170 G4double etot = kineticEnergy + particleMass; 171 beta2 = kineticEnergy*(kineticEnergy + 2.*particleMass)/(etot*etot); 163 172 164 173 G4double electronDensity = material->GetElectronDensity(); 165 kineticEnergy = dp->GetKineticEnergy(); 166 G4double etot = kineticEnergy + particleMass;167 //G4cout << "e= " << kineticEnergy << " m= " << particleMass168 // << " tmax= " << tmax << " l= " << length << " q^2= " << chargeSquare << G4endl;169 beta2 = kineticEnergy*(kineticEnergy + 2.*particleMass)/(etot*etot);170 174 175 /* 176 G4cout << "e= " << kineticEnergy << " m= " << particleMass 177 << " tmax= " << tmax << " l= " << length 178 << " q^2= " << effChargeSquare << " beta2=" << beta2<< G4endl; 179 */ 171 180 G4double siga = (1. - beta2*0.5)*tmax*length*electronDensity* 172 twopi_mc2_rcl2* Q2/beta2;181 twopi_mc2_rcl2*chargeSquare/beta2; 173 182 174 183 // Low velocity - additional ion charge fluctuations according to 175 184 // Q.Yang et al., NIM B61(1991)149-155. 176 G4double zeff = electronDensity/(material->GetTotNbOfAtomsPerVolume()); 177 //G4cout << "siga= " << siga << " zeff= " << zeff << " c= " << c << G4endl; 178 179 G4double f = 0.0; 180 181 // correction factors with cut dependence 182 if ( beta2 < 3.0*theBohrBeta2*zeff ) { 183 184 G4double a = CoeffitientA (zeff); 185 G4double b = CoeffitientB (material, zeff); 186 // G4cout << "a= " << a << " b= " << b << G4endl; 187 f = a*chargeSqRatio + b; 188 } else { 189 190 // H.Geissel et al. NIM B, 195 (2002) 3. 191 f = RelativisticFactor(material, zeff); 192 } 185 //G4cout << "sigE= " << sqrt(siga) << " charge= " << charge <<G4endl; 186 187 G4double Z = electronDensity/material->GetTotNbOfAtomsPerVolume(); 188 189 G4double fac = Factor(material, Z); 193 190 194 191 // heavy ion correction … … 196 193 if(beta2 > theBohrBeta2) f1/= beta2; 197 194 else f1/= theBohrBeta2; 198 if(f1 > 2.0) f1 = 2.0; 199 f *= (1.0 + f1); 200 201 if(f > 1.0) { 202 siga *= (1. + (f - 1.0)*2.0*electron_mass_c2*beta2/(tmax*(1.0 - beta2))); 203 } 204 // G4cout << "siga= " << siga << G4endl; 195 if(f1 > 2.5) f1 = 2.5; 196 fac *= (1.0 + f1); 197 198 // taking into account the cut 199 if(fac > 1.0) { 200 siga *= (1.0 + (fac - 1.0)*2.0*electron_mass_c2*beta2/(tmax*(1.0 - beta2))); 201 } 202 //G4cout << "siga(keV)= " << sqrt(siga)/keV << " fac= " << fac 203 // << " f1= " << f1 << G4endl; 205 204 206 205 return siga; … … 209 208 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 210 209 211 G4double G4IonFluctuations:: CoeffitientA(G4double& zeff)210 G4double G4IonFluctuations::Factor(const G4Material* material, G4double Z) 212 211 { 213 212 // The aproximation of energy loss fluctuations … … 215 214 216 215 // Reduced energy in MeV/AMU 217 G4double energy = kineticEnergy * amu_c2/(particleMass*MeV) ; 218 static G4double a[96][4] = { 216 G4double energy = kineticEnergy *amu_c2/(particleMass*MeV) ; 217 218 // simple approximation for higher beta2 219 G4double s1 = RelativisticFactor(material, Z); 220 221 // tabulation for lower beta2 222 if( beta2 < 3.0*theBohrBeta2*Z ) { 223 224 static G4double a[96][4] = { 219 225 {-0.3291, -0.8312, 0.2460, -1.0220}, 220 226 {-0.5615, -0.5898, 0.5205, -0.7258}, … … 260 266 {-0.3972, -0.3600, 1.0260, -0.5842}, 261 267 262 {-0.3985, -0.3803, 1.0200, -0.6013},268 {-0.3985, -0.3803, 1.0200, -0.6013}, 263 269 {-0.3985, -0.3979, 1.0150, -0.6168}, 264 270 {-0.3968, -0.3990, 1.0160, -0.6195}, … … 322 328 {-0.4284, -0.3204, 1.6290, -0.6380}, 323 329 {-0.4227, -0.3217, 1.6360, -0.6438} 324 } ; 325 326 G4int iz = (G4int)zeff - 2 ; 327 if( 0 > iz ) iz = 0 ; 328 if(95 < iz ) iz = 95 ; 329 330 G4double q = 1.0 / (1.0 + a[iz][0]*pow(energy,a[iz][1])+ 331 + a[iz][2]*pow(energy,a[iz][3])) ; 332 333 return q ; 334 } 335 336 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 337 338 G4double G4IonFluctuations::CoeffitientB(const G4Material* material, G4double& zeff) 339 { 340 // The aproximation of energy loss fluctuations 341 // Q.Yang et al., NIM B61(1991)149-155. 342 343 // Reduced energy in MeV/AMU 344 G4double energy = kineticEnergy *amu_c2/(particleMass*MeV) ; 330 } ; 331 332 G4int iz = G4int(Z) - 2; 333 if( 0 > iz ) iz = 0; 334 else if(95 < iz ) iz = 95; 335 336 G4double ss = 1.0 + a[iz][0]*pow(energy,a[iz][1])+ 337 + a[iz][2]*pow(energy,a[iz][3]); 338 339 // protection for the validity range for low beta 340 G4double slim = 0.001; 341 if(ss < slim) s1 = 1.0/slim; 342 // for high value of beta 343 else if(s1*ss < 1.0) s1 = 1.0/ss; 344 } 345 345 346 346 G4int i = 0 ; … … 366 366 // ions 367 367 } else { 368 factor = charge * pow(charge/zeff, 0.3333) ; 368 369 factor = charge * pow(charge/Z, 0.33333333); 369 370 370 371 if( kStateGas == material->GetState() ) { … … 378 379 379 380 } else { 380 energy /= (charge * sqrt(charge* zeff)) ;381 energy /= (charge * sqrt(charge*Z)) ; 381 382 i = 4 ; 382 383 } 383 384 } 384 385 385 G4double x = b[i][2] * (1.0 - exp( - energy * b[i][3] )) ; 386 387 G4double q = factor * x * b[i][0] / 388 ((energy - b[i][1])*(energy - b[i][1]) + x*x) ; 389 390 return q ; 391 } 392 393 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 394 395 G4double G4IonFluctuations::RelativisticFactor(const G4Material* material, 396 G4double& zeff) 397 { 386 G4double x = b[i][2]; 387 G4double y = energy * b[i][3]; 388 if(y <= 0.2) x *= (y*(1.0 - 0.5*y)); 389 else x *= (1.0 - exp(-y)); 390 391 y = energy - b[i][1]; 392 393 G4double s2 = factor * x * b[i][0] / (y*y + x*x); 394 /* 395 G4cout << "s1= " << s1 << " s2= " << s2 << " q^2= " << effChargeSquare 396 << " e= " << energy << G4endl; 397 */ 398 return s1*effChargeSquare/chargeSquare + s2; 399 } 400 401 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 402 403 G4double G4IonFluctuations::RelativisticFactor(const G4Material* mat, 404 G4double Z) 405 { 406 G4double eF = mat->GetIonisation()->GetFermiEnergy(); 407 G4double I = mat->GetIonisation()->GetMeanExcitationEnergy(); 408 398 409 // H.Geissel et al. NIM B, 195 (2002) 3. 399 G4double eF = material->GetIonisation()->GetFermiEnergy();400 410 G4double bF2= 2.0*eF/electron_mass_c2; 401 G4double I = material->GetIonisation()->GetMeanExcitationEnergy(); 402 G4double f = 0.4*(1.0 - beta2)/((1.0 - 0.5*beta2)*zeff); 411 G4double f = 0.4*(1.0 - beta2)/((1.0 - 0.5*beta2)*Z); 403 412 if(beta2 > bF2) f *= log(2.0*electron_mass_c2*beta2/I)*bF2/beta2; 404 413 else f *= log(4.0*eF/I); 405 414 415 // G4cout << "f= " << f << " beta2= " << beta2 416 // << " bf2= " << bF2 << " q^2= " << chargeSquare << G4endl; 417 406 418 return 1.0 + f; 407 419 } 408 420 409 421 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 422 423 void G4IonFluctuations::SetParticleAndCharge(const G4ParticleDefinition* part, 424 G4double q2) 425 { 426 if(part != particle) { 427 particle = part; 428 particleMass = part->GetPDGMass(); 429 charge = part->GetPDGCharge()/eplus; 430 chargeSquare = charge*charge; 431 } 432 effChargeSquare = q2; 433 uniFluct.SetParticleAndCharge(part, q2); 434 } 435 436 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/standard/src/G4KleinNishinaCompton.cc
r819 r961 25 25 // 26 26 // $Id: G4KleinNishinaCompton.cc,v 1.9 2007/05/22 17:34:36 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/standard/src/G4MollerBhabhaModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MollerBhabhaModel.cc,v 1.3 0 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4MollerBhabhaModel.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 74 74 const G4String& nam) 75 75 : G4VEmModel(nam), 76 particle(0), 77 isElectron(true), 78 twoln10(2.0*log(10.0)), 79 lowLimit(0.2*keV) 76 particle(0), 77 isElectron(true), 78 twoln10(2.0*log(10.0)), 79 lowLimit(0.2*keV), 80 isInitialised(false) 80 81 { 81 82 theElectron = G4Electron::Electron(); … … 87 88 G4MollerBhabhaModel::~G4MollerBhabhaModel() 88 89 {} 89 90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......91 92 void G4MollerBhabhaModel::SetParticle(const G4ParticleDefinition* p)93 {94 particle = p;95 if(p != theElectron) isElectron = false;96 }97 90 98 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 108 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 109 102 103 G4double G4MollerBhabhaModel::MaxSecondaryEnergy(const G4ParticleDefinition*, 104 G4double kinEnergy) 105 { 106 G4double tmax = kinEnergy; 107 if(isElectron) tmax *= 0.5; 108 return tmax; 109 } 110 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 112 110 113 void G4MollerBhabhaModel::Initialise(const G4ParticleDefinition* p, 111 114 const G4DataVector&) 112 115 { 113 116 if(!particle) SetParticle(p); 114 if(pParticleChange) 117 SetDeexcitationFlag(false); 118 119 if(isInitialised) return; 120 121 isInitialised = true; 122 if(pParticleChange) { 115 123 fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*> 116 124 (pParticleChange); 117 else125 } else { 118 126 fParticleChange = new G4ParticleChangeForLoss(); 127 } 119 128 } 120 129 -
trunk/source/processes/electromagnetic/standard/src/G4MscModel71.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MscModel71.cc,v 1. 5 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MscModel71.cc,v 1.6 2008/03/13 17:20:07 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 561 561 G4double tau = trueStepLength/lambda0 ; 562 562 563 if(trueStepLength >= currentRange*dtrl) 563 if(trueStepLength >= currentRange*dtrl) { 564 564 if(par1*trueStepLength < 1.) 565 565 tau = -par2*log(1.-par1*trueStepLength) ; 566 566 else 567 567 tau = taubig ; 568 568 } 569 569 currentTau = tau ; 570 570 -
trunk/source/processes/electromagnetic/standard/src/G4MultipleScattering.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MultipleScattering.cc,v 1.7 0 2007/10/29 08:57:19vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4MultipleScattering.cc,v 1.75 2008/10/15 17:53:44 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ----------------------------------------------------------------------------- … … 121 121 // 12-02-07 skin can be changed via UI command, default skin=1 (VI) 122 122 // 24-04-07 default skin=0 (temporal protection) (VI) 123 // 11-03-08 use G4VMscModel interface (VI) 123 124 // 124 125 // ----------------------------------------------------------------------------- … … 130 131 #include "G4UrbanMscModel.hh" 131 132 #include "G4MscStepLimitType.hh" 133 #include "G4UrbanMscModel.hh" 132 134 133 135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 138 140 : G4VMultipleScattering(processName) 139 141 { 140 dtrl = 0.05; 141 lambdalimit = 1.*mm; 142 143 samplez = false ; 144 isInitialized = false; 142 isInitialized = false; 145 143 } 146 144 … … 178 176 SetLateralDisplasmentFlag(false); 179 177 SetBuildLambdaTable(false); 180 SetSkin(0.0);181 SetRangeFactor(0.2);182 178 } 183 179 184 180 // initialisation of parameters - defaults for particles other 185 181 // than ions can be overwritten by users 186 mscUrban = new G4UrbanMscModel(RangeFactor(),dtrl,lambdalimit, 187 GeomFactor(),Skin(), 188 samplez,StepLimitType()); 182 mscUrban = new G4UrbanMscModel(); 183 mscUrban->SetStepLimitType(StepLimitType()); 189 184 mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag()); 185 mscUrban->SetSkin(Skin()); 186 mscUrban->SetRangeFactor(RangeFactor()); 187 mscUrban->SetGeomFactor(GeomFactor()); 190 188 191 189 AddEmModel(1,mscUrban); … … 204 202 void G4MultipleScattering::PrintInfo() 205 203 { 206 G4cout << " Boundary/stepping algorithm is active with RangeFactor= " 207 << RangeFactor() 208 << " Step limit type " << StepLimitType() 204 G4cout << " RangeFactor= " << RangeFactor() 205 << ", step limit type: " << StepLimitType() 206 << ", lateralDisplacement: " << LateralDisplasmentFlag() 207 << ", skin= " << Skin() 208 << ", geomFactor= " << GeomFactor() 209 209 << G4endl; 210 210 } -
trunk/source/processes/electromagnetic/standard/src/G4MultipleScattering71.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MultipleScattering71.cc,v 1. 4 2006/10/16 15:26:49vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4MultipleScattering71.cc,v 1.5 2008/07/16 11:27:41 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ----------------------------------------------------------------------------- … … 76 76 77 77 #include "G4MultipleScattering71.hh" 78 #include "G4LossTableManager.hh" 78 79 #include "G4MscModel71.hh" 79 80 … … 176 177 } 177 178 179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 180 181 G4double G4MultipleScattering71::GetContinuousStepLimit( 182 const G4Track& track, 183 G4double, 184 G4double currentMinimalStep, 185 G4double&) 186 { 187 DefineMaterial(track.GetMaterialCutsCouple()); 188 const G4MaterialCutsCouple* couple = CurrentMaterialCutsCouple(); 189 G4double e = track.GetKineticEnergy(); 190 model = dynamic_cast<G4MscModel71*>(SelectModel(e)); 191 const G4ParticleDefinition* p = track.GetDefinition(); 192 G4double lambda0 = GetLambda(p, e); 193 range = G4LossTableManager::Instance()->GetRangeFromRestricteDEDX(p,e,couple); 194 if(range < currentMinimalStep) currentMinimalStep = range; 195 truePathLength = TruePathLengthLimit(track,lambda0,currentMinimalStep); 196 // G4cout << "StepLimit: tpl= " << truePathLength << " lambda0= " 197 // << lambda0 << " range= " << currentRange 198 // << " currentMinStep= " << currentMinimalStep << G4endl; 199 if (truePathLength < currentMinimalStep) valueGPILSelectionMSC = CandidateForSelection; 200 geomPathLength = model->GeomPathLength(LambdaTable(),couple, 201 p,e,lambda0,range,truePathLength); 202 if(geomPathLength > lambda0) geomPathLength = lambda0; 203 return geomPathLength; 204 } 205 178 206 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 179 207 -
trunk/source/processes/electromagnetic/standard/src/G4PAIModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PAIModel.cc,v 1.46 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 // 29 // ------------------------------------------------------------------- 30 // 31 // GEANT4 Class 26 32 // File name: G4PAIModel.cc 27 33 // … … 177 183 fCutCouple = theCoupleTable->GetMaterialCutsCouple( fMaterial, 178 184 curReg->GetProductionCuts() ); 185 //G4cout << "Reg <" <<curReg->GetName() << "> mat <" 186 // << fMaterial->GetName() << "> fCouple= " 187 // << fCutCouple<<G4endl; 179 188 if( fCutCouple ) { 180 189 fMaterialCutsCoupleVector.push_back(fCutCouple); … … 197 206 } 198 207 } 208 209 ////////////////////////////////////////////////////////////////// 210 211 void G4PAIModel::InitialiseMe(const G4ParticleDefinition*) 212 {} 199 213 200 214 ////////////////////////////////////////////////////////////////// … … 393 407 { 394 408 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 395 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 409 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 410 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 396 411 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 397 412 } … … 435 450 { 436 451 // if ( x1 == x2 ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 437 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 452 // if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 453 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*0.5 ; 438 454 else dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 439 455 } … … 444 460 ////////////////////////////////////////////////////////////////////////////// 445 461 446 G4double G4PAIModel::ComputeDEDX (const G4MaterialCutsCouple* matCC,447 const G4ParticleDefinition* p,448 G4double kineticEnergy,449 G4double cutEnergy)462 G4double G4PAIModel::ComputeDEDXPerVolume(const G4Material*, 463 const G4ParticleDefinition* p, 464 G4double kineticEnergy, 465 G4double cutEnergy) 450 466 { 451 467 G4int iTkin,iPlace; 452 468 size_t jMat; 469 470 //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy); 471 G4double cut = cutEnergy; 472 453 473 G4double massRatio = fMass/p->GetPDGMass(); 454 474 G4double scaledTkin = kineticEnergy*massRatio; 455 475 G4double charge = p->GetPDGCharge(); 456 G4double charge2 = charge*charge, dEdx; 476 G4double charge2 = charge*charge; 477 const G4MaterialCutsCouple* matCC = CurrentCouple(); 457 478 458 479 for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat ) … … 470 491 iPlace = iTkin - 1; 471 492 if(iPlace < 0) iPlace = 0; 472 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 473 493 G4double dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) ); 474 494 if( dEdx < 0.) dEdx = 0.; 475 495 return dEdx; … … 478 498 ///////////////////////////////////////////////////////////////////////// 479 499 480 G4double G4PAIModel::CrossSection ( const G4MaterialCutsCouple* matCC,481 const G4ParticleDefinition* p,482 G4double kineticEnergy,483 G4double cutEnergy,484 G4double maxEnergy )500 G4double G4PAIModel::CrossSectionPerVolume( const G4Material*, 501 const G4ParticleDefinition* p, 502 G4double kineticEnergy, 503 G4double cutEnergy, 504 G4double maxEnergy ) 485 505 { 486 506 G4int iTkin,iPlace; 487 507 size_t jMat; 488 G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 508 G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 509 if(tmax <= cutEnergy) return 0.0; 489 510 G4double massRatio = fMass/p->GetPDGMass(); 490 511 G4double scaledTkin = kineticEnergy*massRatio; 491 512 G4double charge = p->GetPDGCharge(); 492 513 G4double charge2 = charge*charge, cross, cross1, cross2; 514 const G4MaterialCutsCouple* matCC = CurrentCouple(); 493 515 494 516 for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat ) … … 935 957 } 936 958 959 ///////////////////////////////////////////////////////////////////// 960 961 G4double G4PAIModel::MaxSecondaryEnergy( const G4ParticleDefinition* p, 962 G4double kinEnergy) 963 { 964 G4double tmax = kinEnergy; 965 if(p == fElectron) tmax *= 0.5; 966 else if(p != fPositron) { 967 G4double mass = p->GetPDGMass(); 968 G4double ratio= electron_mass_c2/mass; 969 G4double gamma= kinEnergy/mass + 1.0; 970 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) / 971 (1. + 2.0*gamma*ratio + ratio*ratio); 972 } 973 return tmax; 974 } 975 976 /////////////////////////////////////////////////////////////// 977 978 void G4PAIModel::DefineForRegion(const G4Region* r) 979 { 980 fPAIRegionVector.push_back(r); 981 } 937 982 938 983 // -
trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PAIPhotonModel.cc,v 1.21 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 // 29 // ------------------------------------------------------------------- 30 // 31 // GEANT4 Class 26 32 // File name: G4PAIPhotonModel.cc 27 33 // … … 217 223 ////////////////////////////////////////////////////////////////// 218 224 225 void G4PAIPhotonModel::InitialiseMe(const G4ParticleDefinition*) 226 {} 227 228 ////////////////////////////////////////////////////////////////// 229 219 230 void G4PAIPhotonModel::ComputeSandiaPhotoAbsCof() 220 231 { … … 487 498 { 488 499 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 489 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 500 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 501 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 490 502 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 491 503 } … … 530 542 { 531 543 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 532 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 544 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 545 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 533 546 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 534 547 } … … 574 587 { 575 588 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 576 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 589 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 590 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 577 591 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 578 592 } … … 617 631 { 618 632 // if ( x1 == x2 ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 619 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 633 // if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 634 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*0.5 ; 620 635 else dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 621 636 } … … 626 641 ////////////////////////////////////////////////////////////////////////////// 627 642 628 G4double G4PAIPhotonModel::ComputeDEDX (const G4MaterialCutsCouple* matCC,629 const G4ParticleDefinition* p,630 G4double kineticEnergy,631 G4double cutEnergy)643 G4double G4PAIPhotonModel::ComputeDEDXPerVolume(const G4Material*, 644 const G4ParticleDefinition* p, 645 G4double kineticEnergy, 646 G4double cutEnergy) 632 647 { 633 648 G4int iTkin,iPlace; 634 649 size_t jMat; 650 651 //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy); 652 G4double cut = cutEnergy; 653 635 654 G4double particleMass = p->GetPDGMass(); 636 655 G4double scaledTkin = kineticEnergy*proton_mass_c2/particleMass; … … 638 657 G4double charge2 = charge*charge; 639 658 G4double dEdx = 0.; 659 const G4MaterialCutsCouple* matCC = CurrentCouple(); 640 660 641 661 for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat ) … … 653 673 iPlace = iTkin - 1; 654 674 if(iPlace < 0) iPlace = 0; 655 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut Energy) ) ;675 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) ) ; 656 676 657 677 if( dEdx < 0.) dEdx = 0.; … … 661 681 ///////////////////////////////////////////////////////////////////////// 662 682 663 G4double G4PAIPhotonModel::CrossSection ( const G4MaterialCutsCouple* matCC,664 const G4ParticleDefinition* p,665 G4double kineticEnergy,666 G4double cutEnergy,667 G4double maxEnergy )683 G4double G4PAIPhotonModel::CrossSectionPerVolume( const G4Material*, 684 const G4ParticleDefinition* p, 685 G4double kineticEnergy, 686 G4double cutEnergy, 687 G4double maxEnergy ) 668 688 { 669 689 G4int iTkin,iPlace; 670 690 size_t jMat, jMatCC; 671 G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 691 G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 692 if(cutEnergy >= tmax) return 0.0; 672 693 G4double particleMass = p->GetPDGMass(); 673 694 G4double scaledTkin = kineticEnergy*proton_mass_c2/particleMass; … … 675 696 G4double charge2 = charge*charge, cross, cross1, cross2; 676 697 G4double photon1, photon2, plasmon1, plasmon2; 698 699 const G4MaterialCutsCouple* matCC = CurrentCouple(); 677 700 678 701 const G4ProductionCutsTable* theCoupleTable= … … 1225 1248 } 1226 1249 1250 ///////////////////////////////////////////////////////////////////// 1251 1252 G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition* p, 1253 G4double kinEnergy) 1254 { 1255 G4double tmax = kinEnergy; 1256 if(p == fElectron) tmax *= 0.5; 1257 else if(p != fPositron) { 1258 G4double mass = p->GetPDGMass(); 1259 G4double ratio= electron_mass_c2/mass; 1260 G4double gamma= kinEnergy/mass + 1.0; 1261 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) / 1262 (1. + 2.0*gamma*ratio + ratio*ratio); 1263 } 1264 return tmax; 1265 } 1266 1267 /////////////////////////////////////////////////////////////// 1268 1269 void G4PAIPhotonModel::DefineForRegion(const G4Region* r) 1270 { 1271 fPAIRegionVector.push_back(r); 1272 } 1273 1227 1274 1228 1275 // -
trunk/source/processes/electromagnetic/standard/src/G4PAIxSection.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4PAIxSection.cc,v 1.2 1 2006/06/29 19:53:20 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4PAIxSection.cc,v 1.24 2008/05/30 16:04:40 grichine Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 70 70 70.0 , 100.0 , 300.0 , 600.0 , 1000.0 , 3000.0 , 71 71 10000.0 , 50000.0 72 } ;72 }; 73 73 74 74 const G4int G4PAIxSection:: 75 fRefGammaNumber = 29 ; // The number of gamma for creation of75 fRefGammaNumber = 29; // The number of gamma for creation of 76 76 // spline (9) 77 77 … … 80 80 // Local class constants 81 81 82 const G4double G4PAIxSection::fDelta = 0.005 ; // energy shift from interval border83 const G4double G4PAIxSection::fError = 0.005 ; // error in lin-log approximation84 85 const G4int G4PAIxSection::fMaxSplineSize = 500 ; // Max size of output spline82 const G4double G4PAIxSection::fDelta = 0.005; // energy shift from interval border 83 const G4double G4PAIxSection::fError = 0.005; // error in lin-log approximation 84 85 const G4int G4PAIxSection::fMaxSplineSize = 500; // Max size of output spline 86 86 // arrays 87 87 … … 95 95 fDensity = matCC->GetMaterial()->GetDensity(); 96 96 G4int matIndex = matCC->GetMaterial()->GetIndex(); 97 fMaterialIndex = matIndex; 97 98 fSandia = new G4SandiaTable(matIndex); 98 99 … … 108 109 (*(*fMatSandiaMatrix)[i])[0] = fSandia->GetSandiaMatTable(i,0); 109 110 110 for(j = 1; j < 5 ; j++)111 for(j = 1; j < 5; j++) 111 112 { 112 113 (*(*fMatSandiaMatrix)[i])[j] = fSandia->GetSandiaMatTable(i,j)*fDensity; 113 114 } 114 115 } 115 116 117 118 116 } 117 118 //////////////////////////////////////////////////////////////// 119 119 120 120 G4PAIxSection::G4PAIxSection(G4int materialIndex, 121 121 G4double maxEnergyTransfer) 122 122 { 123 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable() ; 124 G4int i, j ; 125 126 fDensity = (*theMaterialTable)[materialIndex]->GetDensity() ; 123 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable(); 124 G4int i, j; 125 126 fMaterialIndex = materialIndex; 127 fDensity = (*theMaterialTable)[materialIndex]->GetDensity(); 127 128 fElectronDensity = (*theMaterialTable)[materialIndex]-> 128 GetElectronDensity() ;129 GetElectronDensity(); 129 130 fIntervalNumber = (*theMaterialTable)[materialIndex]-> 130 GetSandiaTable()->GetMatNbOfIntervals() ;131 GetSandiaTable()->GetMatNbOfIntervals(); 131 132 fIntervalNumber--; 132 // G4cout<<fDensity<<"\t"<<fElectronDensity<<"\t"<<fIntervalNumber<<G4endl ;133 134 fEnergyInterval = new G4double[fIntervalNumber+2] ;135 fA1 = new G4double[fIntervalNumber+2] ;136 fA2 = new G4double[fIntervalNumber+2] ;137 fA3 = new G4double[fIntervalNumber+2] ;138 fA4 = new G4double[fIntervalNumber+2] ;139 140 for(i = 1 ; i <= fIntervalNumber; i++ )133 // G4cout<<fDensity<<"\t"<<fElectronDensity<<"\t"<<fIntervalNumber<<G4endl; 134 135 fEnergyInterval = new G4double[fIntervalNumber+2]; 136 fA1 = new G4double[fIntervalNumber+2]; 137 fA2 = new G4double[fIntervalNumber+2]; 138 fA3 = new G4double[fIntervalNumber+2]; 139 fA4 = new G4double[fIntervalNumber+2]; 140 141 for(i = 1; i <= fIntervalNumber; i++ ) 141 142 { 142 143 if(((*theMaterialTable)[materialIndex]-> … … 144 145 i > fIntervalNumber ) 145 146 { 146 fEnergyInterval[i] = maxEnergyTransfer ;147 fIntervalNumber = i ;147 fEnergyInterval[i] = maxEnergyTransfer; 148 fIntervalNumber = i; 148 149 break; 149 150 } … … 159 160 GetSandiaTable()->GetSandiaCofForMaterial(i-1,4); 160 161 // G4cout<<i<<"\t"<<fEnergyInterval[i]<<"\t"<<fA1[i]<<"\t"<<fA2[i]<<"\t" 161 // <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl ;162 // <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl; 162 163 } 163 164 if(fEnergyInterval[fIntervalNumber] != maxEnergyTransfer) 164 165 { 165 166 fIntervalNumber++; 166 fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ;167 fEnergyInterval[fIntervalNumber] = maxEnergyTransfer; 167 168 } 168 169 … … 174 175 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i])) 175 176 { 176 continue ;177 continue; 177 178 } 178 179 else … … 180 181 for(j=i;j<fIntervalNumber;j++) 181 182 { 182 fEnergyInterval[j] = fEnergyInterval[j+1] ;183 fA1[j] = fA1[j+1] ;184 fA2[j] = fA2[j+1] ;185 fA3[j] = fA3[j+1] ;186 fA4[j] = fA4[j+1] ;183 fEnergyInterval[j] = fEnergyInterval[j+1]; 184 fA1[j] = fA1[j+1]; 185 fA2[j] = fA2[j+1]; 186 fA3[j] = fA3[j+1]; 187 fA4[j] = fA4[j+1]; 187 188 } 188 fIntervalNumber-- ;189 i-- ;189 fIntervalNumber--; 190 i--; 190 191 } 191 192 } … … 194 195 /* ********************************* 195 196 196 fSplineEnergy = new G4double[fMaxSplineSize] ;197 fRePartDielectricConst = new G4double[fMaxSplineSize] ;198 fImPartDielectricConst = new G4double[fMaxSplineSize] ;199 fIntegralTerm = new G4double[fMaxSplineSize] ;200 fDifPAIxSection = new G4double[fMaxSplineSize] ;201 fIntegralPAIxSection = new G4double[fMaxSplineSize] ;197 fSplineEnergy = new G4double[fMaxSplineSize]; 198 fRePartDielectricConst = new G4double[fMaxSplineSize]; 199 fImPartDielectricConst = new G4double[fMaxSplineSize]; 200 fIntegralTerm = new G4double[fMaxSplineSize]; 201 fDifPAIxSection = new G4double[fMaxSplineSize]; 202 fIntegralPAIxSection = new G4double[fMaxSplineSize]; 202 203 203 204 for(i=0;i<fMaxSplineSize;i++) 204 205 { 205 fSplineEnergy[i] = 0.0 ;206 fRePartDielectricConst[i] = 0.0 ;207 fImPartDielectricConst[i] = 0.0 ;208 fIntegralTerm[i] = 0.0 ;209 fDifPAIxSection[i] = 0.0 ;210 fIntegralPAIxSection[i] = 0.0 ;206 fSplineEnergy[i] = 0.0; 207 fRePartDielectricConst[i] = 0.0; 208 fImPartDielectricConst[i] = 0.0; 209 fIntegralTerm[i] = 0.0; 210 fDifPAIxSection[i] = 0.0; 211 fIntegralPAIxSection[i] = 0.0; 211 212 } 212 213 ************************************************** */ 213 214 214 InitPAI() ; // create arrays allocated above215 InitPAI(); // create arrays allocated above 215 216 216 delete[] fEnergyInterval ;217 delete[] fA1 ;218 delete[] fA2 ;219 delete[] fA3 ;220 delete[] fA4 ;217 delete[] fEnergyInterval; 218 delete[] fA1; 219 delete[] fA2; 220 delete[] fA3; 221 delete[] fA4; 221 222 } 222 223 … … 232 233 { 233 234 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable(); 234 G4int i, j ; 235 235 G4int i, j; 236 237 fMaterialIndex = materialIndex; 236 238 fDensity = (*theMaterialTable)[materialIndex]->GetDensity(); 237 239 fElectronDensity = (*theMaterialTable)[materialIndex]-> 238 GetElectronDensity() ;239 240 fIntervalNumber = intNumber ;240 GetElectronDensity(); 241 242 fIntervalNumber = intNumber; 241 243 fIntervalNumber--; 242 // G4cout<<fDensity<<"\t"<<fElectronDensity<<"\t"<<fIntervalNumber<<G4endl ;244 // G4cout<<fDensity<<"\t"<<fElectronDensity<<"\t"<<fIntervalNumber<<G4endl; 243 245 244 fEnergyInterval = new G4double[fIntervalNumber+2] ;245 fA1 = new G4double[fIntervalNumber+2] ;246 fA2 = new G4double[fIntervalNumber+2] ;247 fA3 = new G4double[fIntervalNumber+2] ;248 fA4 = new G4double[fIntervalNumber+2] ;249 250 for( i = 1 ; i <= fIntervalNumber; i++ )246 fEnergyInterval = new G4double[fIntervalNumber+2]; 247 fA1 = new G4double[fIntervalNumber+2]; 248 fA2 = new G4double[fIntervalNumber+2]; 249 fA3 = new G4double[fIntervalNumber+2]; 250 fA4 = new G4double[fIntervalNumber+2]; 251 252 for( i = 1; i <= fIntervalNumber; i++ ) 251 253 { 252 254 if( ( photoAbsCof[i-1][0] >= maxEnergyTransfer ) || 253 255 i > fIntervalNumber ) 254 256 { 255 fEnergyInterval[i] = maxEnergyTransfer ;256 fIntervalNumber = i ;257 fEnergyInterval[i] = maxEnergyTransfer; 258 fIntervalNumber = i; 257 259 break; 258 260 } 259 fEnergyInterval[i] = photoAbsCof[i-1][0] ;260 fA1[i] = photoAbsCof[i-1][1] ;261 fA2[i] = photoAbsCof[i-1][2] ;262 fA3[i] = photoAbsCof[i-1][3] ;263 fA4[i] = photoAbsCof[i-1][4] ;261 fEnergyInterval[i] = photoAbsCof[i-1][0]; 262 fA1[i] = photoAbsCof[i-1][1]; 263 fA2[i] = photoAbsCof[i-1][2]; 264 fA3[i] = photoAbsCof[i-1][3]; 265 fA4[i] = photoAbsCof[i-1][4]; 264 266 // G4cout<<i<<"\t"<<fEnergyInterval[i]<<"\t"<<fA1[i]<<"\t"<<fA2[i]<<"\t" 265 // <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl ;267 // <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl; 266 268 } 267 269 // G4cout<<"i last = "<<i<<"; "<<"fIntervalNumber = "<<fIntervalNumber<<G4endl; … … 269 271 { 270 272 fIntervalNumber++; 271 fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ;273 fEnergyInterval[fIntervalNumber] = maxEnergyTransfer; 272 274 } 273 275 for(i=1;i<=fIntervalNumber;i++) 274 276 { 275 277 // G4cout<<i<<"\t"<<fEnergyInterval[i]<<"\t"<<fA1[i]<<"\t"<<fA2[i]<<"\t" 276 // <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl ;278 // <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl; 277 279 } 278 280 // Now checking, if two borders are too close together 279 281 280 for( i = 1 ; i < fIntervalNumber; i++ )282 for( i = 1; i < fIntervalNumber; i++ ) 281 283 { 282 284 if(fEnergyInterval[i+1]-fEnergyInterval[i] > 283 285 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i])) 284 286 { 285 continue ;287 continue; 286 288 } 287 289 else … … 289 291 for(j=i;j<fIntervalNumber;j++) 290 292 { 291 fEnergyInterval[j] = fEnergyInterval[j+1] ;292 fA1[j] = fA1[j+1] ;293 fA2[j] = fA2[j+1] ;294 fA3[j] = fA3[j+1] ;295 fA4[j] = fA4[j+1] ;293 fEnergyInterval[j] = fEnergyInterval[j+1]; 294 fA1[j] = fA1[j+1]; 295 fA2[j] = fA2[j+1]; 296 fA3[j] = fA3[j+1]; 297 fA4[j] = fA4[j+1]; 296 298 } 297 fIntervalNumber-- ;298 i-- ;299 fIntervalNumber--; 300 i--; 299 301 } 300 302 } … … 305 307 fLorentzFactor[fRefGammaNumber]*fLorentzFactor[fRefGammaNumber] - 1; 306 308 307 NormShift(betaGammaSqRef) ;308 SplainPAI(betaGammaSqRef) ;309 NormShift(betaGammaSqRef); 310 SplainPAI(betaGammaSqRef); 309 311 310 312 // Preparation of integral PAI cross section for input betaGammaSq 311 313 312 for(i = 1 ; i <= fSplineNumber; i++)314 for(i = 1; i <= fSplineNumber; i++) 313 315 { 314 316 fdNdxCerenkov[i] = PAIdNdxCerenkov(i,betaGammaSq); 317 fdNdxMM[i] = PAIdNdxMM(i,betaGammaSq); 315 318 fdNdxPlasmon[i] = PAIdNdxPlasmon(i,betaGammaSq); 319 fdNdxResonance[i] = PAIdNdxResonance(i,betaGammaSq); 316 320 fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq); 321 317 322 // G4cout<<i<<"; dNdxC = "<<fdNdxCerenkov[i]<<"; dNdxP = "<<fdNdxPlasmon[i] 318 323 // <<"; dNdxPAI = "<<fDifPAIxSection[i]<<G4endl; 319 324 } 320 IntegralCerenkov() ; 321 IntegralPlasmon() ; 322 IntegralPAIxSection() ; 325 IntegralCerenkov(); 326 IntegralMM(); 327 IntegralPlasmon(); 328 IntegralResonance(); 329 IntegralPAIxSection(); 323 330 324 delete[] fEnergyInterval ;325 delete[] fA1 ;326 delete[] fA2 ;327 delete[] fA3 ;328 delete[] fA4 ;331 delete[] fEnergyInterval; 332 delete[] fA1; 333 delete[] fA2; 334 delete[] fA3; 335 delete[] fA4; 329 336 } 330 337 … … 339 346 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable(); 340 347 341 G4int i, j, numberOfElements ; 342 348 G4int i, j, numberOfElements; 349 350 fMaterialIndex = materialIndex; 343 351 fDensity = (*theMaterialTable)[materialIndex]->GetDensity(); 344 fElectronDensity = (*theMaterialTable)[materialIndex]->GetElectronDensity() ;345 numberOfElements = (*theMaterialTable)[materialIndex]->GetNumberOfElements() ;346 347 G4int* thisMaterialZ = new G4int[numberOfElements] ;348 349 for( i = 0 ; i < numberOfElements; i++ )352 fElectronDensity = (*theMaterialTable)[materialIndex]->GetElectronDensity(); 353 numberOfElements = (*theMaterialTable)[materialIndex]->GetNumberOfElements(); 354 355 G4int* thisMaterialZ = new G4int[numberOfElements]; 356 357 for( i = 0; i < numberOfElements; i++ ) 350 358 { 351 359 thisMaterialZ[i] = (G4int)(*theMaterialTable)[materialIndex]-> 352 GetElement(i)->GetZ() ; 353 } 354 G4SandiaTable thisMaterialSandiaTable(materialIndex) ; 360 GetElement(i)->GetZ(); 361 } 362 // fSandia = new G4SandiaTable(materialIndex); 363 fSandia = (*theMaterialTable)[materialIndex]-> 364 GetSandiaTable(); 365 G4SandiaTable thisMaterialSandiaTable(materialIndex); 355 366 fIntervalNumber = thisMaterialSandiaTable.SandiaIntervals 356 (thisMaterialZ,numberOfElements) ;367 (thisMaterialZ,numberOfElements); 357 368 fIntervalNumber = thisMaterialSandiaTable.SandiaMixing 358 369 ( thisMaterialZ , 359 370 (*theMaterialTable)[materialIndex]->GetFractionVector() , 360 numberOfElements,fIntervalNumber) ;371 numberOfElements,fIntervalNumber); 361 372 362 373 fIntervalNumber--; 363 374 364 fEnergyInterval = new G4double[fIntervalNumber+2] ;365 fA1 = new G4double[fIntervalNumber+2] ;366 fA2 = new G4double[fIntervalNumber+2] ;367 fA3 = new G4double[fIntervalNumber+2] ;368 fA4 = new G4double[fIntervalNumber+2] ;369 370 for( i=1;i<=fIntervalNumber;i++)375 fEnergyInterval = new G4double[fIntervalNumber+2]; 376 fA1 = new G4double[fIntervalNumber+2]; 377 fA2 = new G4double[fIntervalNumber+2]; 378 fA3 = new G4double[fIntervalNumber+2]; 379 fA4 = new G4double[fIntervalNumber+2]; 380 381 for( i = 1; i <= fIntervalNumber; i++ ) 371 382 { 372 383 if((thisMaterialSandiaTable.GetPhotoAbsorpCof(i,0) >= maxEnergyTransfer) || 373 384 i > fIntervalNumber) 374 385 { 375 fEnergyInterval[i] = maxEnergyTransfer ;376 fIntervalNumber = i ;386 fEnergyInterval[i] = maxEnergyTransfer; 387 fIntervalNumber = i; 377 388 break; 378 389 } 379 fEnergyInterval[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,0) ;380 fA1[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,1)*fDensity ;381 fA2[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,2)*fDensity ;382 fA3[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,3)*fDensity ;383 fA4[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,4)*fDensity ;390 fEnergyInterval[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,0); 391 fA1[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,1)*fDensity; 392 fA2[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,2)*fDensity; 393 fA3[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,3)*fDensity; 394 fA4[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,4)*fDensity; 384 395 385 396 } … … 387 398 { 388 399 fIntervalNumber++; 389 fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ;390 fA1[fIntervalNumber] = fA1[fIntervalNumber-1] ;391 fA2[fIntervalNumber] = fA2[fIntervalNumber-1] ;392 fA3[fIntervalNumber] = fA3[fIntervalNumber-1] ;393 fA4[fIntervalNumber] = fA4[fIntervalNumber-1] ;400 fEnergyInterval[fIntervalNumber] = maxEnergyTransfer; 401 fA1[fIntervalNumber] = fA1[fIntervalNumber-1]; 402 fA2[fIntervalNumber] = fA2[fIntervalNumber-1]; 403 fA3[fIntervalNumber] = fA3[fIntervalNumber-1]; 404 fA4[fIntervalNumber] = fA4[fIntervalNumber-1]; 394 405 } 395 406 for(i=1;i<=fIntervalNumber;i++) 396 407 { 397 408 // G4cout<<fEnergyInterval[i]<<"\t"<<fA1[i]<<"\t"<<fA2[i]<<"\t" 398 // <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl ;409 // <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl; 399 410 } 400 411 // Now checking, if two borders are too close together 401 412 402 for( i=1;i<fIntervalNumber;i++)413 for( i = 1; i < fIntervalNumber; i++ ) 403 414 { 404 415 if(fEnergyInterval[i+1]-fEnergyInterval[i] > 405 416 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i])) 406 417 { 407 continue ;418 continue; 408 419 } 409 420 else 410 421 { 411 for( j=i;j<fIntervalNumber;j++)422 for( j = i; j < fIntervalNumber; j++ ) 412 423 { 413 fEnergyInterval[j] = fEnergyInterval[j+1] ;414 fA1[j] = fA1[j+1] ;415 fA2[j] = fA2[j+1] ;416 fA3[j] = fA3[j+1] ;417 fA4[j] = fA4[j+1] ;424 fEnergyInterval[j] = fEnergyInterval[j+1]; 425 fA1[j] = fA1[j+1]; 426 fA2[j] = fA2[j+1]; 427 fA3[j] = fA3[j+1]; 428 fA4[j] = fA4[j+1]; 418 429 } 419 fIntervalNumber-- ;420 i-- ;430 fIntervalNumber--; 431 i--; 421 432 } 422 433 } 423 434 424 435 /* ********************************* 425 fSplineEnergy = new G4double[fMaxSplineSize] ;426 fRePartDielectricConst = new G4double[fMaxSplineSize] ;427 fImPartDielectricConst = new G4double[fMaxSplineSize] ;428 fIntegralTerm = new G4double[fMaxSplineSize] ;429 fDifPAIxSection = new G4double[fMaxSplineSize] ;430 fIntegralPAIxSection = new G4double[fMaxSplineSize] ;436 fSplineEnergy = new G4double[fMaxSplineSize]; 437 fRePartDielectricConst = new G4double[fMaxSplineSize]; 438 fImPartDielectricConst = new G4double[fMaxSplineSize]; 439 fIntegralTerm = new G4double[fMaxSplineSize]; 440 fDifPAIxSection = new G4double[fMaxSplineSize]; 441 fIntegralPAIxSection = new G4double[fMaxSplineSize]; 431 442 432 443 for(i=0;i<fMaxSplineSize;i++) 433 444 { 434 fSplineEnergy[i] = 0.0 ;435 fRePartDielectricConst[i] = 0.0 ;436 fImPartDielectricConst[i] = 0.0 ;437 fIntegralTerm[i] = 0.0 ;438 fDifPAIxSection[i] = 0.0 ;439 fIntegralPAIxSection[i] = 0.0 ;445 fSplineEnergy[i] = 0.0; 446 fRePartDielectricConst[i] = 0.0; 447 fImPartDielectricConst[i] = 0.0; 448 fIntegralTerm[i] = 0.0; 449 fDifPAIxSection[i] = 0.0; 450 fIntegralPAIxSection[i] = 0.0; 440 451 } 441 452 */ //////////////////////// … … 446 457 fLorentzFactor[fRefGammaNumber]*fLorentzFactor[fRefGammaNumber] - 1; 447 458 448 NormShift(betaGammaSqRef) ;449 SplainPAI(betaGammaSqRef) ;459 NormShift(betaGammaSqRef); 460 SplainPAI(betaGammaSqRef); 450 461 451 462 // Preparation of integral PAI cross section for input betaGammaSq 452 463 453 for(i = 1 ; i <= fSplineNumber; i++)464 for(i = 1; i <= fSplineNumber; i++) 454 465 { 455 466 fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq); 456 467 fdNdxCerenkov[i] = PAIdNdxCerenkov(i,betaGammaSq); 468 fdNdxMM[i] = PAIdNdxMM(i,betaGammaSq); 457 469 fdNdxPlasmon[i] = PAIdNdxPlasmon(i,betaGammaSq); 458 } 459 IntegralPAIxSection() ; 460 IntegralCerenkov() ; 461 IntegralPlasmon() ; 470 fdNdxResonance[i] = PAIdNdxResonance(i,betaGammaSq); 471 } 472 IntegralPAIxSection(); 473 IntegralCerenkov(); 474 IntegralMM(); 475 IntegralPlasmon(); 476 IntegralResonance(); 462 477 463 // delete[] fEnergyInterval ;464 delete[] fA1 ;465 delete[] fA2 ;466 delete[] fA3 ;467 delete[] fA4 ;478 // delete[] fEnergyInterval; 479 delete[] fA1; 480 delete[] fA2; 481 delete[] fA3; 482 delete[] fA4; 468 483 } 469 484 … … 476 491 { 477 492 /* ************************ 478 delete[] fSplineEnergy ;479 delete[] fRePartDielectricConst ;480 delete[] fImPartDielectricConst ;481 delete[] fIntegralTerm ;482 delete[] fDifPAIxSection ;483 delete[] fIntegralPAIxSection ;493 delete[] fSplineEnergy ; 494 delete[] fRePartDielectricConst; 495 delete[] fImPartDielectricConst; 496 delete[] fIntegralTerm ; 497 delete[] fDifPAIxSection ; 498 delete[] fIntegralPAIxSection ; 484 499 */ //////////////////////// 485 500 } … … 492 507 void G4PAIxSection::InitPAI() 493 508 { 494 G4int i ;509 G4int i; 495 510 G4double betaGammaSq = fLorentzFactor[fRefGammaNumber]* 496 511 fLorentzFactor[fRefGammaNumber] - 1; … … 498 513 // Preparation of integral PAI cross section for reference gamma 499 514 500 NormShift(betaGammaSq) ; 501 SplainPAI(betaGammaSq) ; 502 503 IntegralPAIxSection() ; 504 IntegralCerenkov() ; 505 IntegralPlasmon() ; 506 507 for(i = 0 ; i<=fSplineNumber ; i++) 508 { 509 fPAItable[i][fRefGammaNumber] = fIntegralPAIxSection[i] ; 515 NormShift(betaGammaSq); 516 SplainPAI(betaGammaSq); 517 518 IntegralPAIxSection(); 519 IntegralCerenkov(); 520 IntegralMM(); 521 IntegralPlasmon(); 522 IntegralResonance(); 523 524 for(i = 0; i<= fSplineNumber; i++) 525 { 526 fPAItable[i][fRefGammaNumber] = fIntegralPAIxSection[i]; 510 527 if(i != 0) 511 528 { 512 fPAItable[i][0] = fSplineEnergy[i] ;513 } 514 } 515 fPAItable[0][0] = fSplineNumber ;516 517 for(G4int j = 1 ; j < 112; j++) // for other gammas518 { 519 if( j == fRefGammaNumber ) continue ;529 fPAItable[i][0] = fSplineEnergy[i]; 530 } 531 } 532 fPAItable[0][0] = fSplineNumber; 533 534 for(G4int j = 1; j < 112; j++) // for other gammas 535 { 536 if( j == fRefGammaNumber ) continue; 520 537 521 betaGammaSq = fLorentzFactor[j]*fLorentzFactor[j] - 1 ;538 betaGammaSq = fLorentzFactor[j]*fLorentzFactor[j] - 1; 522 539 523 for(i = 1 ; i <= fSplineNumber; i++)540 for(i = 1; i <= fSplineNumber; i++) 524 541 { 525 542 fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq); 526 543 fdNdxCerenkov[i] = PAIdNdxCerenkov(i,betaGammaSq); 544 fdNdxMM[i] = PAIdNdxMM(i,betaGammaSq); 527 545 fdNdxPlasmon[i] = PAIdNdxPlasmon(i,betaGammaSq); 528 } 529 IntegralPAIxSection() ; 530 IntegralCerenkov() ; 531 IntegralPlasmon() ; 546 fdNdxResonance[i] = PAIdNdxResonance(i,betaGammaSq); 547 } 548 IntegralPAIxSection(); 549 IntegralCerenkov(); 550 IntegralMM(); 551 IntegralPlasmon(); 552 IntegralResonance(); 532 553 533 for(i = 0 ; i <= fSplineNumber; i++)534 { 535 fPAItable[i][j] = fIntegralPAIxSection[i] ;554 for(i = 0; i <= fSplineNumber; i++) 555 { 556 fPAItable[i][j] = fIntegralPAIxSection[i]; 536 557 } 537 558 } … … 546 567 void G4PAIxSection::NormShift(G4double betaGammaSq) 547 568 { 548 G4int i, j ;549 550 for( i = 1 ; i <= fIntervalNumber-1; i++ )551 { 552 for( j = 1 ; j <= 2; j++ )569 G4int i, j; 570 571 for( i = 1; i <= fIntervalNumber-1; i++ ) 572 { 573 for( j = 1; j <= 2; j++ ) 553 574 { 554 fSplineNumber = (i-1)*2 + j ;575 fSplineNumber = (i-1)*2 + j; 555 576 556 577 if( j == 1 ) fSplineEnergy[fSplineNumber] = fEnergyInterval[i ]*(1+fDelta); … … 562 583 fIntegralTerm[1]=RutherfordIntegral(1,fEnergyInterval[1],fSplineEnergy[1]); 563 584 564 j = 1 ;565 566 for( i=2;i<=fSplineNumber;i++)585 j = 1; 586 587 for( i = 2; i <= fSplineNumber; i++ ) 567 588 { 568 589 if(fSplineEnergy[i]<fEnergyInterval[j+1]) … … 570 591 fIntegralTerm[i] = fIntegralTerm[i-1] + 571 592 RutherfordIntegral(j,fSplineEnergy[i-1], 572 fSplineEnergy[i] ) ;593 fSplineEnergy[i] ); 573 594 } 574 595 else 575 596 { 576 597 G4double x = RutherfordIntegral(j,fSplineEnergy[i-1], 577 fEnergyInterval[j+1] ) ;598 fEnergyInterval[j+1] ); 578 599 j++; 579 600 fIntegralTerm[i] = fIntegralTerm[i-1] + x + 580 601 RutherfordIntegral(j,fEnergyInterval[j], 581 fSplineEnergy[i] ) ;602 fSplineEnergy[i] ); 582 603 } 583 604 // G4cout<<i<<"\t"<<fSplineEnergy[i]<<"\t"<<fIntegralTerm[i]<<"\n"<<G4endl; 584 605 } 585 fNormalizationCof = 2*pi*pi*hbarc*hbarc*fine_structure_const/electron_mass_c2 ;586 fNormalizationCof *= fElectronDensity/fIntegralTerm[fSplineNumber] ;587 588 // G4cout<<"fNormalizationCof = "<<fNormalizationCof<<G4endl ;606 fNormalizationCof = 2*pi*pi*hbarc*hbarc*fine_structure_const/electron_mass_c2; 607 fNormalizationCof *= fElectronDensity/fIntegralTerm[fSplineNumber]; 608 609 // G4cout<<"fNormalizationCof = "<<fNormalizationCof<<G4endl; 589 610 590 611 // Calculation of PAI differrential cross-section (1/(keV*cm)) 591 612 // in the energy points near borders of energy intervals 592 613 593 for(G4int k =1;k<=fIntervalNumber-1;k++)594 { 595 for( j=1;j<=2;j++)596 { 597 i = (k-1)*2 + j ;614 for(G4int k = 1; k <= fIntervalNumber-1; k++ ) 615 { 616 for( j = 1; j <= 2; j++ ) 617 { 618 i = (k-1)*2 + j; 598 619 fImPartDielectricConst[i] = fNormalizationCof* 599 620 ImPartDielectricConst(k,fSplineEnergy[i]); … … 604 625 fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq); 605 626 fdNdxCerenkov[i] = PAIdNdxCerenkov(i,betaGammaSq); 627 fdNdxMM[i] = PAIdNdxMM(i,betaGammaSq); 606 628 fdNdxPlasmon[i] = PAIdNdxPlasmon(i,betaGammaSq); 629 fdNdxResonance[i] = PAIdNdxResonance(i,betaGammaSq); 607 630 } 608 631 } … … 616 639 // linear approximation would be smaller than 'fError' 617 640 618 void 619 G4PAIxSection::SplainPAI(G4double betaGammaSq) 641 void G4PAIxSection::SplainPAI(G4double betaGammaSq) 620 642 { 621 G4int k = 1 ;622 G4int i = 1 ;643 G4int k = 1; 644 G4int i = 1; 623 645 624 646 while ( (i < fSplineNumber) && (fSplineNumber < fMaxSplineSize-1) ) … … 626 648 if(fSplineEnergy[i+1] > fEnergyInterval[k+1]) 627 649 { 628 k++ ; // Here next energy point is in next energy interval650 k++; // Here next energy point is in next energy interval 629 651 i++; 630 652 continue; … … 634 656 fSplineNumber++; 635 657 636 for(G4int j = fSplineNumber; j >= i+2 ; j-- )658 for(G4int j = fSplineNumber; j >= i+2; j-- ) 637 659 { 638 660 fSplineEnergy[j] = fSplineEnergy[j-1]; … … 643 665 fDifPAIxSection[j] = fDifPAIxSection[j-1]; 644 666 fdNdxCerenkov[j] = fdNdxCerenkov[j-1]; 667 fdNdxMM[j] = fdNdxMM[j-1]; 645 668 fdNdxPlasmon[j] = fdNdxPlasmon[j-1]; 669 fdNdxResonance[j] = fdNdxResonance[j-1]; 646 670 } 647 671 G4double x1 = fSplineEnergy[i]; … … 658 682 G4double a = log10(y2/yy1)/log10(x2/x1); 659 683 G4double b = log10(yy1) - a*log10(x1); 660 G4double y = a*log10(en1) + b ;684 G4double y = a*log10(en1) + b; 661 685 y = pow(10.,y); 662 686 … … 673 697 fDifPAIxSection[i+1] = DifPAIxSection(i+1,betaGammaSq); 674 698 fdNdxCerenkov[i+1] = PAIdNdxCerenkov(i+1,betaGammaSq); 699 fdNdxMM[i+1] = PAIdNdxMM(i+1,betaGammaSq); 675 700 fdNdxPlasmon[i+1] = PAIdNdxPlasmon(i+1,betaGammaSq); 701 fdNdxResonance[i+1] = PAIdNdxResonance(i+1,betaGammaSq); 676 702 677 703 // Condition for next division of this segment or to pass … … 682 708 if( x < 0 ) 683 709 { 684 x = -x ;710 x = -x; 685 711 } 686 712 if( x > fError && fSplineNumber < fMaxSplineSize-1 ) … … 704 730 G4double x2 ) 705 731 { 706 G4double c1, c2, c3 ;732 G4double c1, c2, c3; 707 733 // G4cout<<"RI: x1 = "<<x1<<"; "<<"x2 = "<<x2<<G4endl; 708 c1 = (x2 - x1)/x1/x2 ;709 c2 = (x2 - x1)*(x2 + x1)/x1/x1/x2/x2 ;710 c3 = (x2 - x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/x2 ;734 c1 = (x2 - x1)/x1/x2; 735 c2 = (x2 - x1)*(x2 + x1)/x1/x1/x2/x2; 736 c3 = (x2 - x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/x2; 711 737 // G4cout<<" RI: c1 = "<<c1<<"; "<<"c2 = "<<c2<<"; "<<"c3 = "<<c3<<G4endl; 712 738 713 return fA1[k]*log(x2/x1) + fA2[k]*c1 + fA3[k]*c2/2 + fA4[k]*c3/3 ;739 return fA1[k]*log(x2/x1) + fA2[k]*c1 + fA3[k]*c2/2 + fA4[k]*c3/3; 714 740 715 741 } // end of RutherfordIntegral … … 730 756 energy4 = energy3*energy1; 731 757 732 result = fA1[k]/energy1+fA2[k]/energy2+fA3[k]/energy3+fA4[k]/energy4 ;733 result *=hbarc/energy1 ;734 735 return result ;758 result = fA1[k]/energy1+fA2[k]/energy2+fA3[k]/energy3+fA4[k]/energy4; 759 result *=hbarc/energy1; 760 761 return result; 736 762 737 763 } // end of ImPartDielectricConst 738 764 765 ///////////////////////////////////////////////////////////////// 766 // 767 // Returns lambda of photon with energy1 in current material 768 769 G4double G4PAIxSection::GetPhotonRange( G4double energy1 ) 770 { 771 G4int i; 772 G4double energy2, energy3, energy4, result, lambda; 773 774 energy2 = energy1*energy1; 775 energy3 = energy2*energy1; 776 energy4 = energy3*energy1; 777 778 // G4double* SandiaCof = fSandia->GetSandiaCofForMaterialPAI(energy1); 779 // result = SandiaCof[0]/energy1+SandiaCof[1]/energy2+SandiaCof[2]/energy3+SandiaCof[3]/energy4; 780 // result *= fDensity; 781 782 for( i = 1; i <= fIntervalNumber; i++ ) 783 { 784 if( energy1 < fEnergyInterval[i]) break; 785 } 786 i--; 787 if(i == 0) i = 1; 788 789 result = fA1[i]/energy1+fA2[i]/energy2+fA3[i]/energy3+fA4[i]/energy4; 790 791 if( result > DBL_MIN ) lambda = 1./result; 792 else lambda = DBL_MAX; 793 794 return lambda; 795 } 796 797 ///////////////////////////////////////////////////////////////// 798 // 799 // Return lambda of electron with energy1 in current material 800 // parametrisation from NIM A554(2005)474-493 801 802 G4double G4PAIxSection::GetElectronRange( G4double energy ) 803 { 804 G4double range; 805 /* 806 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable(); 807 808 G4double Z = (*theMaterialTable)[fMaterialIndex]->GetIonisation()->GetZeffective(); 809 G4double A = (*theMaterialTable)[fMaterialIndex]->GetA(); 810 811 energy /= keV; // energy in keV in parametrised formula 812 813 if (energy < 10.) 814 { 815 range = 3.872e-3*A/Z; 816 range *= pow(energy,1.492); 817 } 818 else 819 { 820 range = 6.97e-3*pow(energy,1.6); 821 } 822 */ 823 // Blum&Rolandi Particle Detection with Drift Chambers, p. 7 824 825 G4double cofA = 5.37e-4*g/cm2/keV; 826 G4double cofB = 0.9815; 827 G4double cofC = 3.123e-3/keV; 828 // energy /= keV; 829 830 range = cofA*energy*( 1 - cofB/(1 + cofC*energy) ); 831 832 // range *= g/cm2; 833 range /= fDensity; 834 835 return range; 836 } 739 837 740 838 ////////////////////////////////////////////////////////////////////////////// … … 747 845 { 748 846 G4double x0, x02, x03, x04, x05, x1, x2, xx1 ,xx2 , xx12, 749 c1, c2, c3, cof1, cof2, xln1, xln2, xln3, result ;750 751 x0 = enb ;752 result = 0 ;847 c1, c2, c3, cof1, cof2, xln1, xln2, xln3, result; 848 849 x0 = enb; 850 result = 0; 753 851 754 852 for(G4int i=1;i<=fIntervalNumber-1;i++) 755 853 { 756 x1 = fEnergyInterval[i] ;757 x2 = fEnergyInterval[i+1] ;758 xx1 = x1 - x0 ;759 xx2 = x2 - x0 ;760 xx12 = xx2/xx1 ;854 x1 = fEnergyInterval[i]; 855 x2 = fEnergyInterval[i+1]; 856 xx1 = x1 - x0; 857 xx2 = x2 - x0; 858 xx12 = xx2/xx1; 761 859 762 860 if(xx12<0) … … 764 862 xx12 = -xx12; 765 863 } 766 xln1 = log(x2/x1) ;767 xln2 = log(xx12) ;768 xln3 = log((x2 + x0)/(x1 + x0)) ;769 x02 = x0*x0 ;770 x03 = x02*x0 ;771 x04 = x03*x0 ;864 xln1 = log(x2/x1); 865 xln2 = log(xx12); 866 xln3 = log((x2 + x0)/(x1 + x0)); 867 x02 = x0*x0; 868 x03 = x02*x0; 869 x04 = x03*x0; 772 870 x05 = x04*x0; 773 c1 = (x2 - x1)/x1/x2 ;774 c2 = (x2 - x1)*(x2 +x1)/x1/x1/x2/x2 ;775 c3 = (x2 -x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/x2 ;776 777 result -= (fA1[i]/x02 + fA3[i]/x04)*xln1 ;778 result -= (fA2[i]/x02 + fA4[i]/x04)*c1 ;779 result -= fA3[i]*c2/2/x02 ;780 result -= fA4[i]*c3/3/x02 ;781 782 cof1 = fA1[i]/x02 + fA3[i]/x04 ;783 cof2 = fA2[i]/x03 + fA4[i]/x05 ;784 785 result += 0.5*(cof1 +cof2)*xln2 ;786 result += 0.5*(cof1 - cof2)*xln3 ;871 c1 = (x2 - x1)/x1/x2; 872 c2 = (x2 - x1)*(x2 +x1)/x1/x1/x2/x2; 873 c3 = (x2 -x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/x2; 874 875 result -= (fA1[i]/x02 + fA3[i]/x04)*xln1; 876 result -= (fA2[i]/x02 + fA4[i]/x04)*c1; 877 result -= fA3[i]*c2/2/x02; 878 result -= fA4[i]*c3/3/x02; 879 880 cof1 = fA1[i]/x02 + fA3[i]/x04; 881 cof2 = fA2[i]/x03 + fA4[i]/x05; 882 883 result += 0.5*(cof1 +cof2)*xln2; 884 result += 0.5*(cof1 - cof2)*xln3; 787 885 } 788 result *= 2*hbarc/pi ;789 790 return result ;886 result *= 2*hbarc/pi; 887 888 return result; 791 889 792 890 } // end of RePartDielectricConst … … 801 899 G4double betaGammaSq ) 802 900 { 803 G4double be2,cof,x1,x2,x3,x4,x5,x6,x7,x8,result ;804 //G4double beta, be4 ;805 G4double be4 ;806 G4double betaBohr2 = fine_structure_const*fine_structure_const ;807 G4double betaBohr4 = betaBohr2*betaBohr2*4.0 ;808 be2 = betaGammaSq/(1 + betaGammaSq) ;809 be4 = be2*be2 ;810 // beta = sqrt(be2) ;811 cof = 1 ;812 x1 = log(2*electron_mass_c2/fSplineEnergy[i]) ;813 814 if( betaGammaSq < 0.01 ) x2 = log(be2) ;901 G4double be2,cof,x1,x2,x3,x4,x5,x6,x7,x8,result; 902 //G4double beta, be4; 903 G4double be4; 904 G4double betaBohr2 = fine_structure_const*fine_structure_const; 905 G4double betaBohr4 = betaBohr2*betaBohr2*4.0; 906 be2 = betaGammaSq/(1 + betaGammaSq); 907 be4 = be2*be2; 908 // beta = sqrt(be2); 909 cof = 1; 910 x1 = log(2*electron_mass_c2/fSplineEnergy[i]); 911 912 if( betaGammaSq < 0.01 ) x2 = log(be2); 815 913 else 816 914 { 817 915 x2 = -log( (1/betaGammaSq - fRePartDielectricConst[i])* 818 916 (1/betaGammaSq - fRePartDielectricConst[i]) + 819 fImPartDielectricConst[i]*fImPartDielectricConst[i] )/2 ;917 fImPartDielectricConst[i]*fImPartDielectricConst[i] )/2; 820 918 } 821 919 if( fImPartDielectricConst[i] == 0.0 ||betaGammaSq < 0.01 ) 822 920 { 823 x6=0 ;921 x6=0; 824 922 } 825 923 else 826 924 { 827 x3 = -fRePartDielectricConst[i] + 1/betaGammaSq ;925 x3 = -fRePartDielectricConst[i] + 1/betaGammaSq; 828 926 x5 = -1 - fRePartDielectricConst[i] + 829 927 be2*((1 +fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) + 830 fImPartDielectricConst[i]*fImPartDielectricConst[i]) ;831 832 x7 = atan2(fImPartDielectricConst[i],x3) ;833 x6 = x5 * x7 ;834 } 835 // if(fImPartDielectricConst[i] == 0) x6 = 0 ;836 837 x4 = ((x1 + x2)*fImPartDielectricConst[i] + x6)/hbarc ;838 // if( x4 < 0.0 ) x4 = 0.0 ;928 fImPartDielectricConst[i]*fImPartDielectricConst[i]); 929 930 x7 = atan2(fImPartDielectricConst[i],x3); 931 x6 = x5 * x7; 932 } 933 // if(fImPartDielectricConst[i] == 0) x6 = 0; 934 935 x4 = ((x1 + x2)*fImPartDielectricConst[i] + x6)/hbarc; 936 // if( x4 < 0.0 ) x4 = 0.0; 839 937 x8 = (1 + fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) + 840 fImPartDielectricConst[i]*fImPartDielectricConst[i] ;841 842 result = (x4 + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i]) ;843 if(result < 1.0e-8) result = 1.0e-8 ;844 result *= fine_structure_const/be2/pi ;845 // result *= (1-exp(-beta/betaBohr))*(1-exp(-beta/betaBohr)) ;846 // result *= (1-exp(-be2/betaBohr2)) ;847 result *= (1-exp(-be4/betaBohr4)) ;938 fImPartDielectricConst[i]*fImPartDielectricConst[i]; 939 940 result = (x4 + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i]); 941 if(result < 1.0e-8) result = 1.0e-8; 942 result *= fine_structure_const/be2/pi; 943 // result *= (1-exp(-beta/betaBohr))*(1-exp(-beta/betaBohr)); 944 // result *= (1-exp(-be2/betaBohr2)); 945 result *= (1-exp(-be4/betaBohr4)); 848 946 if(fDensity >= 0.1) 849 947 { 850 result /= x8 ;851 } 852 return result ;948 result /= x8; 949 } 950 return result; 853 951 854 952 } // end of DifPAIxSection … … 861 959 G4double betaGammaSq ) 862 960 { 863 G4double cof, logarithm, x3, x5, argument, modul2, dNdxC ; 864 G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr ; 865 866 cof = 1.0 ; 867 cofBetaBohr = 4.0 ; 868 betaBohr2 = fine_structure_const*fine_structure_const ; 869 betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr ; 870 871 be2 = betaGammaSq/(1 + betaGammaSq) ; 872 be4 = be2*be2 ; 873 874 if( betaGammaSq < 0.01 ) logarithm = log(1.0+betaGammaSq) ; // 0.0 ; 961 G4double logarithm, x3, x5, argument, modul2, dNdxC; 962 G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr; 963 964 cofBetaBohr = 4.0; 965 betaBohr2 = fine_structure_const*fine_structure_const; 966 betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr; 967 968 be2 = betaGammaSq/(1 + betaGammaSq); 969 be4 = be2*be2; 970 971 if( betaGammaSq < 0.01 ) logarithm = log(1.0+betaGammaSq); // 0.0; 875 972 else 876 973 { 877 974 logarithm = -log( (1/betaGammaSq - fRePartDielectricConst[i])* 878 975 (1/betaGammaSq - fRePartDielectricConst[i]) + 879 fImPartDielectricConst[i]*fImPartDielectricConst[i] )*0.5 ;880 logarithm += log(1+1.0/betaGammaSq) ;976 fImPartDielectricConst[i]*fImPartDielectricConst[i] )*0.5; 977 logarithm += log(1+1.0/betaGammaSq); 881 978 } 882 979 883 980 if( fImPartDielectricConst[i] == 0.0 || betaGammaSq < 0.01 ) 884 981 { 885 argument = 0.0 ;982 argument = 0.0; 886 983 } 887 984 else 888 985 { 889 x3 = -fRePartDielectricConst[i] + 1.0/betaGammaSq ;986 x3 = -fRePartDielectricConst[i] + 1.0/betaGammaSq; 890 987 x5 = -1.0 - fRePartDielectricConst[i] + 891 988 be2*((1.0 +fRePartDielectricConst[i])*(1.0 + fRePartDielectricConst[i]) + 892 fImPartDielectricConst[i]*fImPartDielectricConst[i]) ;989 fImPartDielectricConst[i]*fImPartDielectricConst[i]); 893 990 if( x3 == 0.0 ) argument = 0.5*pi; 894 else argument = atan2(fImPartDielectricConst[i],x3) ;895 argument *= x5 ;991 else argument = atan2(fImPartDielectricConst[i],x3); 992 argument *= x5 ; 896 993 } 897 dNdxC = ( logarithm*fImPartDielectricConst[i] + argument )/hbarc ;994 dNdxC = ( logarithm*fImPartDielectricConst[i] + argument )/hbarc; 898 995 899 if(dNdxC < 1.0e-8) dNdxC = 1.0e-8 ;900 901 dNdxC *= fine_structure_const/be2/pi ;902 903 dNdxC *= (1-exp(-be4/betaBohr4)) ;996 if(dNdxC < 1.0e-8) dNdxC = 1.0e-8; 997 998 dNdxC *= fine_structure_const/be2/pi; 999 1000 dNdxC *= (1-exp(-be4/betaBohr4)); 904 1001 905 1002 if(fDensity >= 0.1) 906 1003 { 907 1004 modul2 = (1.0 + fRePartDielectricConst[i])*(1.0 + fRePartDielectricConst[i]) + 908 fImPartDielectricConst[i]*fImPartDielectricConst[i] ;909 dNdxC /= modul2 ;910 } 911 return dNdxC ;1005 fImPartDielectricConst[i]*fImPartDielectricConst[i]; 1006 dNdxC /= modul2; 1007 } 1008 return dNdxC; 912 1009 913 1010 } // end of PAIdNdxCerenkov 1011 1012 ////////////////////////////////////////////////////////////////////////// 1013 // 1014 // Calculation od dN/dx of collisions of MM with creation of Cerenkov pseudo-photons 1015 1016 G4double G4PAIxSection::PAIdNdxMM( G4int i , 1017 G4double betaGammaSq ) 1018 { 1019 G4double logarithm, x3, x5, argument, dNdxC; 1020 G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr; 1021 1022 cofBetaBohr = 4.0; 1023 betaBohr2 = fine_structure_const*fine_structure_const; 1024 betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr; 1025 1026 be2 = betaGammaSq/(1 + betaGammaSq); 1027 be4 = be2*be2; 1028 1029 if( betaGammaSq < 0.01 ) logarithm = log(1.0+betaGammaSq); // 0.0; 1030 else 1031 { 1032 logarithm = -log( (1/betaGammaSq - fRePartDielectricConst[i])* 1033 (1/betaGammaSq - fRePartDielectricConst[i]) + 1034 fImPartDielectricConst[i]*fImPartDielectricConst[i] )*0.5; 1035 logarithm += log(1+1.0/betaGammaSq); 1036 } 1037 1038 if( fImPartDielectricConst[i] == 0.0 || betaGammaSq < 0.01 ) 1039 { 1040 argument = 0.0; 1041 } 1042 else 1043 { 1044 x3 = -fRePartDielectricConst[i] + 1.0/betaGammaSq; 1045 x5 = be2*( 1.0 + fRePartDielectricConst[i] ) - 1.0; 1046 if( x3 == 0.0 ) argument = 0.5*pi; 1047 else argument = atan2(fImPartDielectricConst[i],x3); 1048 argument *= x5 ; 1049 } 1050 dNdxC = ( logarithm*fImPartDielectricConst[i]*be2 + argument )/hbarc; 1051 1052 if(dNdxC < 1.0e-8) dNdxC = 1.0e-8; 1053 1054 dNdxC *= fine_structure_const/be2/pi; 1055 1056 dNdxC *= (1-exp(-be4/betaBohr4)); 1057 return dNdxC; 1058 1059 } // end of PAIdNdxMM 914 1060 915 1061 ////////////////////////////////////////////////////////////////////////// … … 921 1067 G4double betaGammaSq ) 922 1068 { 923 G4double cof, resonance, modul2, dNdxP;924 G4double be2, be4, betaBohr2, betaBohr4, cofBetaBohr ;925 926 cof = 1 ;927 cofBetaBohr = 4.0 ;928 betaBohr2 = fine_structure_const*fine_structure_const ;929 betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr ;930 931 be2 = betaGammaSq/(1 + betaGammaSq) ;932 be4 = be2*be2 ;1069 G4double resonance, modul2, dNdxP, cof = 1.; 1070 G4double be2, be4, betaBohr2, betaBohr4, cofBetaBohr; 1071 1072 1073 cofBetaBohr = 4.0; 1074 betaBohr2 = fine_structure_const*fine_structure_const; 1075 betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr; 1076 1077 be2 = betaGammaSq/(1 + betaGammaSq); 1078 be4 = be2*be2; 933 1079 934 resonance = log(2*electron_mass_c2*be2/fSplineEnergy[i]) ;935 resonance *= fImPartDielectricConst[i]/hbarc ;936 937 938 dNdxP = ( resonance + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i] ) ;939 940 if( dNdxP < 1.0e-8 ) dNdxP = 1.0e-8 ;941 942 dNdxP *= fine_structure_const/be2/pi ;943 dNdxP *= (1-exp(-be4/betaBohr4)) ;1080 resonance = log(2*electron_mass_c2*be2/fSplineEnergy[i]); 1081 resonance *= fImPartDielectricConst[i]/hbarc; 1082 1083 1084 dNdxP = ( resonance + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i] ); 1085 1086 if( dNdxP < 1.0e-8 ) dNdxP = 1.0e-8; 1087 1088 dNdxP *= fine_structure_const/be2/pi; 1089 dNdxP *= (1-exp(-be4/betaBohr4)); 944 1090 945 1091 if( fDensity >= 0.1 ) 946 1092 { 947 1093 modul2 = (1 + fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) + 948 fImPartDielectricConst[i]*fImPartDielectricConst[i] ;949 dNdxP /= modul2 ;950 } 951 return dNdxP ;1094 fImPartDielectricConst[i]*fImPartDielectricConst[i]; 1095 dNdxP /= modul2; 1096 } 1097 return dNdxP; 952 1098 953 1099 } // end of PAIdNdxPlasmon 1100 1101 ////////////////////////////////////////////////////////////////////////// 1102 // 1103 // Calculation od dN/dx of collisions with creation of longitudinal EM 1104 // resonance excitations (plasmons, delta-electrons) 1105 1106 G4double G4PAIxSection::PAIdNdxResonance( G4int i , 1107 G4double betaGammaSq ) 1108 { 1109 G4double resonance, modul2, dNdxP; 1110 G4double be2, be4, betaBohr2, betaBohr4, cofBetaBohr; 1111 1112 cofBetaBohr = 4.0; 1113 betaBohr2 = fine_structure_const*fine_structure_const; 1114 betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr; 1115 1116 be2 = betaGammaSq/(1 + betaGammaSq); 1117 be4 = be2*be2; 1118 1119 resonance = log(2*electron_mass_c2*be2/fSplineEnergy[i]); 1120 resonance *= fImPartDielectricConst[i]/hbarc; 1121 1122 1123 dNdxP = resonance; 1124 1125 if( dNdxP < 1.0e-8 ) dNdxP = 1.0e-8; 1126 1127 dNdxP *= fine_structure_const/be2/pi; 1128 dNdxP *= (1-exp(-be4/betaBohr4)); 1129 1130 if( fDensity >= 0.1 ) 1131 { 1132 modul2 = (1 + fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) + 1133 fImPartDielectricConst[i]*fImPartDielectricConst[i]; 1134 dNdxP /= modul2; 1135 } 1136 return dNdxP; 1137 1138 } // end of PAIdNdxResonance 954 1139 955 1140 //////////////////////////////////////////////////////////////////////// … … 961 1146 void G4PAIxSection::IntegralPAIxSection() 962 1147 { 963 fIntegralPAIxSection[fSplineNumber] = 0 ;964 fIntegralPAIdEdx[fSplineNumber] = 0 ;965 fIntegralPAIxSection[0] = 0 ;966 G4int k = fIntervalNumber -1 ;967 968 for(G4int i = fSplineNumber-1 ; i >= 1; i--)1148 fIntegralPAIxSection[fSplineNumber] = 0; 1149 fIntegralPAIdEdx[fSplineNumber] = 0; 1150 fIntegralPAIxSection[0] = 0; 1151 G4int k = fIntervalNumber -1; 1152 1153 for(G4int i = fSplineNumber-1; i >= 1; i--) 969 1154 { 970 1155 if(fSplineEnergy[i] >= fEnergyInterval[k]) 971 1156 { 972 fIntegralPAIxSection[i] = fIntegralPAIxSection[i+1] + SumOverInterval(i) ;973 fIntegralPAIdEdx[i] = fIntegralPAIdEdx[i+1] + SumOverIntervaldEdx(i) ;1157 fIntegralPAIxSection[i] = fIntegralPAIxSection[i+1] + SumOverInterval(i); 1158 fIntegralPAIdEdx[i] = fIntegralPAIdEdx[i+1] + SumOverIntervaldEdx(i); 974 1159 } 975 1160 else 976 1161 { 977 1162 fIntegralPAIxSection[i] = fIntegralPAIxSection[i+1] + 978 SumOverBorder(i+1,fEnergyInterval[k]) ;1163 SumOverBorder(i+1,fEnergyInterval[k]); 979 1164 fIntegralPAIdEdx[i] = fIntegralPAIdEdx[i+1] + 980 SumOverBorderdEdx(i+1,fEnergyInterval[k]) ;981 k-- ;1165 SumOverBorderdEdx(i+1,fEnergyInterval[k]); 1166 k--; 982 1167 } 983 1168 } … … 992 1177 void G4PAIxSection::IntegralCerenkov() 993 1178 { 994 G4int i, k ;995 fIntegralCerenkov[fSplineNumber] = 0 ;996 fIntegralCerenkov[0] = 0 ;997 k = fIntervalNumber -1 ;998 999 for( i = fSplineNumber-1 ; i >= 1; i-- )1179 G4int i, k; 1180 fIntegralCerenkov[fSplineNumber] = 0; 1181 fIntegralCerenkov[0] = 0; 1182 k = fIntervalNumber -1; 1183 1184 for( i = fSplineNumber-1; i >= 1; i-- ) 1000 1185 { 1001 1186 if(fSplineEnergy[i] >= fEnergyInterval[k]) 1002 1187 { 1003 fIntegralCerenkov[i] = fIntegralCerenkov[i+1] + SumOverInterCerenkov(i) ;1188 fIntegralCerenkov[i] = fIntegralCerenkov[i+1] + SumOverInterCerenkov(i); 1004 1189 // G4cout<<"int: i = "<<i<<"; sumC = "<<fIntegralCerenkov[i]<<G4endl; 1005 1190 } … … 1007 1192 { 1008 1193 fIntegralCerenkov[i] = fIntegralCerenkov[i+1] + 1009 SumOverBordCerenkov(i+1,fEnergyInterval[k]) ;1010 k-- ;1194 SumOverBordCerenkov(i+1,fEnergyInterval[k]); 1195 k--; 1011 1196 // G4cout<<"bord: i = "<<i<<"; sumC = "<<fIntegralCerenkov[i]<<G4endl; 1012 1197 } … … 1014 1199 1015 1200 } // end of IntegralCerenkov 1201 1202 //////////////////////////////////////////////////////////////////////// 1203 // 1204 // Calculation of the PAI MM-Cerenkov integral cross-section 1205 // fIntegralMM[1] = specific MM-Cerenkov ionisation, 1/cm 1206 // and fIntegralMM[0] = mean MM-Cerenkov loss per cm in keV/cm 1207 1208 void G4PAIxSection::IntegralMM() 1209 { 1210 G4int i, k; 1211 fIntegralMM[fSplineNumber] = 0; 1212 fIntegralMM[0] = 0; 1213 k = fIntervalNumber -1; 1214 1215 for( i = fSplineNumber-1; i >= 1; i-- ) 1216 { 1217 if(fSplineEnergy[i] >= fEnergyInterval[k]) 1218 { 1219 fIntegralMM[i] = fIntegralMM[i+1] + SumOverInterMM(i); 1220 // G4cout<<"int: i = "<<i<<"; sumC = "<<fIntegralMM[i]<<G4endl; 1221 } 1222 else 1223 { 1224 fIntegralMM[i] = fIntegralMM[i+1] + 1225 SumOverBordMM(i+1,fEnergyInterval[k]); 1226 k--; 1227 // G4cout<<"bord: i = "<<i<<"; sumC = "<<fIntegralMM[i]<<G4endl; 1228 } 1229 } 1230 1231 } // end of IntegralMM 1016 1232 1017 1233 //////////////////////////////////////////////////////////////////////// … … 1023 1239 void G4PAIxSection::IntegralPlasmon() 1024 1240 { 1025 fIntegralPlasmon[fSplineNumber] = 0 ;1026 fIntegralPlasmon[0] = 0 ;1027 G4int k = fIntervalNumber -1 ;1241 fIntegralPlasmon[fSplineNumber] = 0; 1242 fIntegralPlasmon[0] = 0; 1243 G4int k = fIntervalNumber -1; 1028 1244 for(G4int i=fSplineNumber-1;i>=1;i--) 1029 1245 { 1030 1246 if(fSplineEnergy[i] >= fEnergyInterval[k]) 1031 1247 { 1032 fIntegralPlasmon[i] = fIntegralPlasmon[i+1] + SumOverInterPlasmon(i) ;1248 fIntegralPlasmon[i] = fIntegralPlasmon[i+1] + SumOverInterPlasmon(i); 1033 1249 } 1034 1250 else 1035 1251 { 1036 1252 fIntegralPlasmon[i] = fIntegralPlasmon[i+1] + 1037 SumOverBordPlasmon(i+1,fEnergyInterval[k]) ;1038 k-- ;1253 SumOverBordPlasmon(i+1,fEnergyInterval[k]); 1254 k--; 1039 1255 } 1040 1256 } 1041 1257 1042 1258 } // end of IntegralPlasmon 1259 1260 //////////////////////////////////////////////////////////////////////// 1261 // 1262 // Calculation of the PAI resonance integral cross-section 1263 // fIntegralResonance[1] = resonance primary ionisation, 1/cm 1264 // and fIntegralResonance[0] = mean resonance loss per cm in keV/cm 1265 1266 void G4PAIxSection::IntegralResonance() 1267 { 1268 fIntegralResonance[fSplineNumber] = 0; 1269 fIntegralResonance[0] = 0; 1270 G4int k = fIntervalNumber -1; 1271 for(G4int i=fSplineNumber-1;i>=1;i--) 1272 { 1273 if(fSplineEnergy[i] >= fEnergyInterval[k]) 1274 { 1275 fIntegralResonance[i] = fIntegralResonance[i+1] + SumOverInterResonance(i); 1276 } 1277 else 1278 { 1279 fIntegralResonance[i] = fIntegralResonance[i+1] + 1280 SumOverBordResonance(i+1,fEnergyInterval[k]); 1281 k--; 1282 } 1283 } 1284 1285 } // end of IntegralResonance 1043 1286 1044 1287 ////////////////////////////////////////////////////////////////////// … … 1050 1293 G4double G4PAIxSection::SumOverInterval( G4int i ) 1051 1294 { 1052 G4double x0,x1,y0,yy1,a,b,c,result ;1053 1054 x0 = fSplineEnergy[i] ;1055 x1 = fSplineEnergy[i+1] ;1056 y0 = fDifPAIxSection[i] ;1295 G4double x0,x1,y0,yy1,a,b,c,result; 1296 1297 x0 = fSplineEnergy[i]; 1298 x1 = fSplineEnergy[i+1]; 1299 y0 = fDifPAIxSection[i]; 1057 1300 yy1 = fDifPAIxSection[i+1]; 1058 1301 c = x1/x0; 1059 a = log10(yy1/y0)/log10(c) ;1060 // b = log10(y0) - a*log10(x0) ;1061 b = y0/pow(x0,a) ;1062 a += 1 ;1302 a = log10(yy1/y0)/log10(c); 1303 // b = log10(y0) - a*log10(x0); 1304 b = y0/pow(x0,a); 1305 a += 1; 1063 1306 if(a == 0) 1064 1307 { 1065 result = b*log(x1/x0) ;1308 result = b*log(x1/x0); 1066 1309 } 1067 1310 else 1068 1311 { 1069 result = y0*(x1*pow(c,a-1) - x0)/a ;1312 result = y0*(x1*pow(c,a-1) - x0)/a; 1070 1313 } 1071 1314 a++; 1072 1315 if(a == 0) 1073 1316 { 1074 fIntegralPAIxSection[0] += b*log(x1/x0) ;1317 fIntegralPAIxSection[0] += b*log(x1/x0); 1075 1318 } 1076 1319 else 1077 1320 { 1078 fIntegralPAIxSection[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a ;1079 } 1080 return result ;1321 fIntegralPAIxSection[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a; 1322 } 1323 return result; 1081 1324 1082 1325 } // end of SumOverInterval … … 1086 1329 G4double G4PAIxSection::SumOverIntervaldEdx( G4int i ) 1087 1330 { 1088 G4double x0,x1,y0,yy1,a,b,c,result ;1089 1090 x0 = fSplineEnergy[i] ;1091 x1 = fSplineEnergy[i+1] ;1092 y0 = fDifPAIxSection[i] ;1331 G4double x0,x1,y0,yy1,a,b,c,result; 1332 1333 x0 = fSplineEnergy[i]; 1334 x1 = fSplineEnergy[i+1]; 1335 y0 = fDifPAIxSection[i]; 1093 1336 yy1 = fDifPAIxSection[i+1]; 1094 1337 c = x1/x0; 1095 a = log10(yy1/y0)/log10(c) ;1096 // b = log10(y0) - a*log10(x0) ;1097 b = y0/pow(x0,a) ;1098 a += 2 ;1338 a = log10(yy1/y0)/log10(c); 1339 // b = log10(y0) - a*log10(x0); 1340 b = y0/pow(x0,a); 1341 a += 2; 1099 1342 if(a == 0) 1100 1343 { 1101 result = b*log(x1/x0) ;1344 result = b*log(x1/x0); 1102 1345 } 1103 1346 else 1104 1347 { 1105 result = y0*(x1*x1*pow(c,a-2) - x0*x0)/a ;1106 } 1107 return result ;1348 result = y0*(x1*x1*pow(c,a-2) - x0*x0)/a; 1349 } 1350 return result; 1108 1351 1109 1352 } // end of SumOverInterval … … 1117 1360 G4double G4PAIxSection::SumOverInterCerenkov( G4int i ) 1118 1361 { 1119 G4double x0,x1,y0,yy1,a,b,c,result ;1120 1121 x0 = fSplineEnergy[i] ;1122 x1 = fSplineEnergy[i+1] ;1123 y0 = fdNdxCerenkov[i] ;1362 G4double x0,x1,y0,yy1,a,b,c,result; 1363 1364 x0 = fSplineEnergy[i]; 1365 x1 = fSplineEnergy[i+1]; 1366 y0 = fdNdxCerenkov[i]; 1124 1367 yy1 = fdNdxCerenkov[i+1]; 1125 1368 // G4cout<<"SumC, i = "<<i<<"; x0 ="<<x0<<"; x1 = "<<x1 … … 1127 1370 1128 1371 c = x1/x0; 1129 a = log10(yy1/y0)/log10(c) ;1130 b = y0/pow(x0,a) ;1131 1132 a += 1.0 ;1133 if(a == 0) result = b*log(c) ;1134 else result = y0*(x1*pow(c,a-1) - x0)/a ;1135 a += 1.0 ;1136 1137 if( a == 0 ) fIntegralCerenkov[0] += b*log(x1/x0) ;1138 else fIntegralCerenkov[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a ;1372 a = log10(yy1/y0)/log10(c); 1373 b = y0/pow(x0,a); 1374 1375 a += 1.0; 1376 if(a == 0) result = b*log(c); 1377 else result = y0*(x1*pow(c,a-1) - x0)/a; 1378 a += 1.0; 1379 1380 if( a == 0 ) fIntegralCerenkov[0] += b*log(x1/x0); 1381 else fIntegralCerenkov[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a; 1139 1382 // G4cout<<"a = "<<a<<"; b = "<<b<<"; result = "<<result<<G4endl; 1140 return result ;1383 return result; 1141 1384 1142 1385 } // end of SumOverInterCerenkov 1386 1387 ////////////////////////////////////////////////////////////////////// 1388 // 1389 // Calculation the PAI MM-Cerenkov integral cross-section inside 1390 // of interval of continuous values of photo-ionisation Cerenkov 1391 // cross-section. Parameter 'i' is the number of interval. 1392 1393 G4double G4PAIxSection::SumOverInterMM( G4int i ) 1394 { 1395 G4double x0,x1,y0,yy1,a,b,c,result; 1396 1397 x0 = fSplineEnergy[i]; 1398 x1 = fSplineEnergy[i+1]; 1399 y0 = fdNdxMM[i]; 1400 yy1 = fdNdxMM[i+1]; 1401 // G4cout<<"SumC, i = "<<i<<"; x0 ="<<x0<<"; x1 = "<<x1 1402 // <<"; y0 = "<<y0<<"; yy1 = "<<yy1<<G4endl; 1403 1404 c = x1/x0; 1405 a = log10(yy1/y0)/log10(c); 1406 b = y0/pow(x0,a); 1407 1408 a += 1.0; 1409 if(a == 0) result = b*log(c); 1410 else result = y0*(x1*pow(c,a-1) - x0)/a; 1411 a += 1.0; 1412 1413 if( a == 0 ) fIntegralMM[0] += b*log(x1/x0); 1414 else fIntegralMM[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a; 1415 // G4cout<<"a = "<<a<<"; b = "<<b<<"; result = "<<result<<G4endl; 1416 return result; 1417 1418 } // end of SumOverInterMM 1143 1419 1144 1420 ////////////////////////////////////////////////////////////////////// … … 1150 1426 G4double G4PAIxSection::SumOverInterPlasmon( G4int i ) 1151 1427 { 1152 G4double x0,x1,y0,yy1,a,b,c,result ;1153 1154 x0 = fSplineEnergy[i] ;1155 x1 = fSplineEnergy[i+1] ;1156 y0 = fdNdxPlasmon[i] ;1428 G4double x0,x1,y0,yy1,a,b,c,result; 1429 1430 x0 = fSplineEnergy[i]; 1431 x1 = fSplineEnergy[i+1]; 1432 y0 = fdNdxPlasmon[i]; 1157 1433 yy1 = fdNdxPlasmon[i+1]; 1158 1434 c =x1/x0; 1159 a = log10(yy1/y0)/log10(c) ;1160 // b = log10(y0) - a*log10(x0) ;1161 b = y0/pow(x0,a) ;1162 1163 a += 1.0 ;1164 if(a == 0) result = b*log(x1/x0) ;1165 else result = y0*(x1*pow(c,a-1) - x0)/a ;1166 a += 1.0 ;1167 1168 if( a == 0 ) fIntegralPlasmon[0] += b*log(x1/x0) ;1169 else fIntegralPlasmon[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a ;1170 1171 return result ;1435 a = log10(yy1/y0)/log10(c); 1436 // b = log10(y0) - a*log10(x0); 1437 b = y0/pow(x0,a); 1438 1439 a += 1.0; 1440 if(a == 0) result = b*log(x1/x0); 1441 else result = y0*(x1*pow(c,a-1) - x0)/a; 1442 a += 1.0; 1443 1444 if( a == 0 ) fIntegralPlasmon[0] += b*log(x1/x0); 1445 else fIntegralPlasmon[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a; 1446 1447 return result; 1172 1448 1173 1449 } // end of SumOverInterPlasmon 1450 1451 ////////////////////////////////////////////////////////////////////// 1452 // 1453 // Calculation the PAI resonance integral cross-section inside 1454 // of interval of continuous values of photo-ionisation resonance 1455 // cross-section. Parameter 'i' is the number of interval. 1456 1457 G4double G4PAIxSection::SumOverInterResonance( G4int i ) 1458 { 1459 G4double x0,x1,y0,yy1,a,b,c,result; 1460 1461 x0 = fSplineEnergy[i]; 1462 x1 = fSplineEnergy[i+1]; 1463 y0 = fdNdxResonance[i]; 1464 yy1 = fdNdxResonance[i+1]; 1465 c =x1/x0; 1466 a = log10(yy1/y0)/log10(c); 1467 // b = log10(y0) - a*log10(x0); 1468 b = y0/pow(x0,a); 1469 1470 a += 1.0; 1471 if(a == 0) result = b*log(x1/x0); 1472 else result = y0*(x1*pow(c,a-1) - x0)/a; 1473 a += 1.0; 1474 1475 if( a == 0 ) fIntegralResonance[0] += b*log(x1/x0); 1476 else fIntegralResonance[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a; 1477 1478 return result; 1479 1480 } // end of SumOverInterResonance 1174 1481 1175 1482 /////////////////////////////////////////////////////////////////////////////// … … 1181 1488 G4double en0 ) 1182 1489 { 1183 G4double x0,x1,y0,yy1,a,b,c,d,e0,result ;1184 1185 e0 = en0 ;1186 x0 = fSplineEnergy[i] ;1187 x1 = fSplineEnergy[i+1] ;1188 y0 = fDifPAIxSection[i] ;1189 yy1 = fDifPAIxSection[i+1] ;1490 G4double x0,x1,y0,yy1,a,b,c,d,e0,result; 1491 1492 e0 = en0; 1493 x0 = fSplineEnergy[i]; 1494 x1 = fSplineEnergy[i+1]; 1495 y0 = fDifPAIxSection[i]; 1496 yy1 = fDifPAIxSection[i+1]; 1190 1497 1191 1498 c = x1/x0; 1192 1499 d = e0/x0; 1193 a = log10(yy1/y0)/log10(x1/x0) ;1194 // b0 = log10(y0) - a*log10(x0) ;1195 b = y0/pow(x0,a); // pow(10.,b) ;1196 1197 a += 1 ;1500 a = log10(yy1/y0)/log10(x1/x0); 1501 // b0 = log10(y0) - a*log10(x0); 1502 b = y0/pow(x0,a); // pow(10.,b); 1503 1504 a += 1; 1198 1505 if(a == 0) 1199 1506 { 1200 result = b*log(x0/e0) ;1507 result = b*log(x0/e0); 1201 1508 } 1202 1509 else 1203 1510 { 1204 result = y0*(x0 - e0*pow(d,a-1))/a ;1205 } 1206 a++ ;1511 result = y0*(x0 - e0*pow(d,a-1))/a; 1512 } 1513 a++; 1207 1514 if(a == 0) 1208 1515 { 1209 fIntegralPAIxSection[0] += b*log(x0/e0) ;1516 fIntegralPAIxSection[0] += b*log(x0/e0); 1210 1517 } 1211 1518 else 1212 1519 { 1213 fIntegralPAIxSection[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a ;1214 } 1215 x0 = fSplineEnergy[i - 1] ;1216 x1 = fSplineEnergy[i - 2] ;1217 y0 = fDifPAIxSection[i - 1] ;1218 yy1 = fDifPAIxSection[i - 2] ;1520 fIntegralPAIxSection[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a; 1521 } 1522 x0 = fSplineEnergy[i - 1]; 1523 x1 = fSplineEnergy[i - 2]; 1524 y0 = fDifPAIxSection[i - 1]; 1525 yy1 = fDifPAIxSection[i - 2]; 1219 1526 1220 1527 c = x1/x0; 1221 1528 d = e0/x0; 1222 a = log10(yy1/y0)/log10(x1/x0) ;1223 // b0 = log10(y0) - a*log10(x0) ;1224 b = y0/pow(x0,a) ;1225 a += 1 ;1529 a = log10(yy1/y0)/log10(x1/x0); 1530 // b0 = log10(y0) - a*log10(x0); 1531 b = y0/pow(x0,a); 1532 a += 1; 1226 1533 if(a == 0) 1227 1534 { 1228 result += b*log(e0/x0) ;1535 result += b*log(e0/x0); 1229 1536 } 1230 1537 else 1231 1538 { 1232 result += y0*(e0*pow(d,a-1) - x0)/a ;1233 } 1234 a++ ;1539 result += y0*(e0*pow(d,a-1) - x0)/a; 1540 } 1541 a++; 1235 1542 if(a == 0) 1236 1543 { 1237 fIntegralPAIxSection[0] += b*log(e0/x0) ;1544 fIntegralPAIxSection[0] += b*log(e0/x0); 1238 1545 } 1239 1546 else 1240 1547 { 1241 fIntegralPAIxSection[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a ;1242 } 1243 return result ;1548 fIntegralPAIxSection[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a; 1549 } 1550 return result; 1244 1551 1245 1552 } … … 1250 1557 G4double en0 ) 1251 1558 { 1252 G4double x0,x1,y0,yy1,a,b,c,d,e0,result ;1253 1254 e0 = en0 ;1255 x0 = fSplineEnergy[i] ;1256 x1 = fSplineEnergy[i+1] ;1257 y0 = fDifPAIxSection[i] ;1258 yy1 = fDifPAIxSection[i+1] ;1559 G4double x0,x1,y0,yy1,a,b,c,d,e0,result; 1560 1561 e0 = en0; 1562 x0 = fSplineEnergy[i]; 1563 x1 = fSplineEnergy[i+1]; 1564 y0 = fDifPAIxSection[i]; 1565 yy1 = fDifPAIxSection[i+1]; 1259 1566 1260 1567 c = x1/x0; 1261 1568 d = e0/x0; 1262 a = log10(yy1/y0)/log10(x1/x0) ;1263 // b0 = log10(y0) - a*log10(x0) ;1264 b = y0/pow(x0,a); // pow(10.,b) ;1265 1266 a += 2 ;1569 a = log10(yy1/y0)/log10(x1/x0); 1570 // b0 = log10(y0) - a*log10(x0); 1571 b = y0/pow(x0,a); // pow(10.,b); 1572 1573 a += 2; 1267 1574 if(a == 0) 1268 1575 { 1269 result = b*log(x0/e0) ;1576 result = b*log(x0/e0); 1270 1577 } 1271 1578 else 1272 1579 { 1273 result = y0*(x0*x0 - e0*e0*pow(d,a-2))/a ;1274 } 1275 x0 = fSplineEnergy[i - 1] ;1276 x1 = fSplineEnergy[i - 2] ;1277 y0 = fDifPAIxSection[i - 1] ;1278 yy1 = fDifPAIxSection[i - 2] ;1580 result = y0*(x0*x0 - e0*e0*pow(d,a-2))/a; 1581 } 1582 x0 = fSplineEnergy[i - 1]; 1583 x1 = fSplineEnergy[i - 2]; 1584 y0 = fDifPAIxSection[i - 1]; 1585 yy1 = fDifPAIxSection[i - 2]; 1279 1586 1280 1587 c = x1/x0; 1281 1588 d = e0/x0; 1282 a = log10(yy1/y0)/log10(x1/x0) ;1283 // b0 = log10(y0) - a*log10(x0) ;1284 b = y0/pow(x0,a) ;1285 a += 2 ;1589 a = log10(yy1/y0)/log10(x1/x0); 1590 // b0 = log10(y0) - a*log10(x0); 1591 b = y0/pow(x0,a); 1592 a += 2; 1286 1593 if(a == 0) 1287 1594 { 1288 result += b*log(e0/x0) ;1595 result += b*log(e0/x0); 1289 1596 } 1290 1597 else 1291 1598 { 1292 result += y0*(e0*e0*pow(d,a-2) - x0*x0)/a ;1293 } 1294 return result ;1599 result += y0*(e0*e0*pow(d,a-2) - x0*x0)/a; 1600 } 1601 return result; 1295 1602 1296 1603 } … … 1304 1611 G4double en0 ) 1305 1612 { 1306 G4double x0,x1,y0,yy1,a,b,e0,c,d,result ;1307 1308 e0 = en0 ;1309 x0 = fSplineEnergy[i] ;1310 x1 = fSplineEnergy[i+1] ;1311 y0 = fdNdxCerenkov[i] ;1312 yy1 = fdNdxCerenkov[i+1] ;1613 G4double x0,x1,y0,yy1,a,b,e0,c,d,result; 1614 1615 e0 = en0; 1616 x0 = fSplineEnergy[i]; 1617 x1 = fSplineEnergy[i+1]; 1618 y0 = fdNdxCerenkov[i]; 1619 yy1 = fdNdxCerenkov[i+1]; 1313 1620 1314 1621 // G4cout<<G4endl; 1315 1622 // G4cout<<"SumBordC, i = "<<i<<"; en0 = "<<en0<<"; x0 ="<<x0<<"; x1 = "<<x1 1316 1623 // <<"; y0 = "<<y0<<"; yy1 = "<<yy1<<G4endl; 1317 c = x1/x0 ;1318 d = e0/x0 ;1319 a = log10(yy1/y0)/log10(c) ;1320 // b0 = log10(y0) - a*log10(x0) ;1321 b = y0/pow(x0,a); // pow(10.,b0) ;1322 1323 a += 1.0 ;1324 if( a == 0 ) result = b*log(x0/e0) ;1325 else result = y0*(x0 - e0*pow(d,a-1))/a ;1326 a += 1.0 ;1327 1328 if( a == 0 ) fIntegralCerenkov[0] += b*log(x0/e0) ;1329 else fIntegralCerenkov[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a ;1624 c = x1/x0; 1625 d = e0/x0; 1626 a = log10(yy1/y0)/log10(c); 1627 // b0 = log10(y0) - a*log10(x0); 1628 b = y0/pow(x0,a); // pow(10.,b0); 1629 1630 a += 1.0; 1631 if( a == 0 ) result = b*log(x0/e0); 1632 else result = y0*(x0 - e0*pow(d,a-1))/a; 1633 a += 1.0; 1634 1635 if( a == 0 ) fIntegralCerenkov[0] += b*log(x0/e0); 1636 else fIntegralCerenkov[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a; 1330 1637 1331 1638 // G4cout<<"a = "<<a<<"; b0 = "<<b0<<"; b = "<<b<<"; result = "<<result<<G4endl; 1332 1639 1333 x0 = fSplineEnergy[i - 1] ;1334 x1 = fSplineEnergy[i - 2] ;1335 y0 = fdNdxCerenkov[i - 1] ;1336 yy1 = fdNdxCerenkov[i - 2] ;1640 x0 = fSplineEnergy[i - 1]; 1641 x1 = fSplineEnergy[i - 2]; 1642 y0 = fdNdxCerenkov[i - 1]; 1643 yy1 = fdNdxCerenkov[i - 2]; 1337 1644 1338 1645 // G4cout<<"x0 ="<<x0<<"; x1 = "<<x1 1339 1646 // <<"; y0 = "<<y0<<"; yy1 = "<<yy1<<G4endl; 1340 1647 1341 c = x1/x0 ;1342 d = e0/x0 ;1343 a = log10(yy1/y0)/log10(x1/x0) ;1344 // b0 = log10(y0) - a*log10(x0) ;1345 b = y0/pow(x0,a); // pow(10.,b0) ;1346 1347 a += 1.0 ;1348 if( a == 0 ) result += b*log(e0/x0) ;1349 else result += y0*(e0*pow(d,a-1) - x0 )/a ;1350 a += 1.0 ;1351 1352 if( a == 0 ) fIntegralCerenkov[0] += b*log(e0/x0) ;1353 else fIntegralCerenkov[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a ;1648 c = x1/x0; 1649 d = e0/x0; 1650 a = log10(yy1/y0)/log10(x1/x0); 1651 // b0 = log10(y0) - a*log10(x0); 1652 b = y0/pow(x0,a); // pow(10.,b0); 1653 1654 a += 1.0; 1655 if( a == 0 ) result += b*log(e0/x0); 1656 else result += y0*(e0*pow(d,a-1) - x0 )/a; 1657 a += 1.0; 1658 1659 if( a == 0 ) fIntegralCerenkov[0] += b*log(e0/x0); 1660 else fIntegralCerenkov[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a; 1354 1661 1355 1662 // G4cout<<"a = "<<a<<"; b0 = "<<b0<<"; b = " 1356 1663 // <<b<<"; result = "<<result<<G4endl; 1357 1664 1358 return result ; 1665 return result; 1666 1667 } 1668 1669 /////////////////////////////////////////////////////////////////////////////// 1670 // 1671 // Integration of MM-Cerenkov cross-section for the case of 1672 // passing across border between intervals 1673 1674 G4double G4PAIxSection::SumOverBordMM( G4int i , 1675 G4double en0 ) 1676 { 1677 G4double x0,x1,y0,yy1,a,b,e0,c,d,result; 1678 1679 e0 = en0; 1680 x0 = fSplineEnergy[i]; 1681 x1 = fSplineEnergy[i+1]; 1682 y0 = fdNdxMM[i]; 1683 yy1 = fdNdxMM[i+1]; 1684 1685 // G4cout<<G4endl; 1686 // G4cout<<"SumBordC, i = "<<i<<"; en0 = "<<en0<<"; x0 ="<<x0<<"; x1 = "<<x1 1687 // <<"; y0 = "<<y0<<"; yy1 = "<<yy1<<G4endl; 1688 c = x1/x0; 1689 d = e0/x0; 1690 a = log10(yy1/y0)/log10(c); 1691 // b0 = log10(y0) - a*log10(x0); 1692 b = y0/pow(x0,a); // pow(10.,b0); 1693 1694 a += 1.0; 1695 if( a == 0 ) result = b*log(x0/e0); 1696 else result = y0*(x0 - e0*pow(d,a-1))/a; 1697 a += 1.0; 1698 1699 if( a == 0 ) fIntegralMM[0] += b*log(x0/e0); 1700 else fIntegralMM[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a; 1701 1702 // G4cout<<"a = "<<a<<"; b0 = "<<b0<<"; b = "<<b<<"; result = "<<result<<G4endl; 1703 1704 x0 = fSplineEnergy[i - 1]; 1705 x1 = fSplineEnergy[i - 2]; 1706 y0 = fdNdxMM[i - 1]; 1707 yy1 = fdNdxMM[i - 2]; 1708 1709 // G4cout<<"x0 ="<<x0<<"; x1 = "<<x1 1710 // <<"; y0 = "<<y0<<"; yy1 = "<<yy1<<G4endl; 1711 1712 c = x1/x0; 1713 d = e0/x0; 1714 a = log10(yy1/y0)/log10(x1/x0); 1715 // b0 = log10(y0) - a*log10(x0); 1716 b = y0/pow(x0,a); // pow(10.,b0); 1717 1718 a += 1.0; 1719 if( a == 0 ) result += b*log(e0/x0); 1720 else result += y0*(e0*pow(d,a-1) - x0 )/a; 1721 a += 1.0; 1722 1723 if( a == 0 ) fIntegralMM[0] += b*log(e0/x0); 1724 else fIntegralMM[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a; 1725 1726 // G4cout<<"a = "<<a<<"; b0 = "<<b0<<"; b = " 1727 // <<b<<"; result = "<<result<<G4endl; 1728 1729 return result; 1359 1730 1360 1731 } … … 1368 1739 G4double en0 ) 1369 1740 { 1370 G4double x0,x1,y0,yy1,a,b,c,d,e0,result ;1371 1372 e0 = en0 ;1373 x0 = fSplineEnergy[i] ;1374 x1 = fSplineEnergy[i+1] ;1375 y0 = fdNdxPlasmon[i] ;1376 yy1 = fdNdxPlasmon[i+1] ;1377 1378 c = x1/x0 ;1379 d = e0/x0 ;1380 a = log10(yy1/y0)/log10(c) ;1381 // b0 = log10(y0) - a*log10(x0) ;1382 b = y0/pow(x0,a); //pow(10.,b) ;1383 1384 a += 1.0 ;1385 if( a == 0 ) result = b*log(x0/e0) ;1386 else result = y0*(x0 - e0*pow(d,a-1))/a ;1387 a += 1.0 ;1388 1389 if( a == 0 ) fIntegralPlasmon[0] += b*log(x0/e0) ;1390 else fIntegralPlasmon[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a ;1391 1392 x0 = fSplineEnergy[i - 1] ;1393 x1 = fSplineEnergy[i - 2] ;1394 y0 = fdNdxPlasmon[i - 1] ;1395 yy1 = fdNdxPlasmon[i - 2] ;1396 1397 c = x1/x0 ;1398 d = e0/x0 ;1399 a = log10(yy1/y0)/log10(c) ;1400 // b0 = log10(y0) - a*log10(x0) ;1401 b = y0/pow(x0,a);// pow(10.,b0) ;1402 1403 a += 1.0 ;1404 if( a == 0 ) result += b*log(e0/x0) ;1405 else result += y0*(e0*pow(d,a-1) - x0)/a ;1406 a += 1.0 ;1407 1408 if( a == 0 ) fIntegralPlasmon[0] += b*log(e0/x0) ;1409 else fIntegralPlasmon[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a ;1410 1411 return result ;1741 G4double x0,x1,y0,yy1,a,b,c,d,e0,result; 1742 1743 e0 = en0; 1744 x0 = fSplineEnergy[i]; 1745 x1 = fSplineEnergy[i+1]; 1746 y0 = fdNdxPlasmon[i]; 1747 yy1 = fdNdxPlasmon[i+1]; 1748 1749 c = x1/x0; 1750 d = e0/x0; 1751 a = log10(yy1/y0)/log10(c); 1752 // b0 = log10(y0) - a*log10(x0); 1753 b = y0/pow(x0,a); //pow(10.,b); 1754 1755 a += 1.0; 1756 if( a == 0 ) result = b*log(x0/e0); 1757 else result = y0*(x0 - e0*pow(d,a-1))/a; 1758 a += 1.0; 1759 1760 if( a == 0 ) fIntegralPlasmon[0] += b*log(x0/e0); 1761 else fIntegralPlasmon[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a; 1762 1763 x0 = fSplineEnergy[i - 1]; 1764 x1 = fSplineEnergy[i - 2]; 1765 y0 = fdNdxPlasmon[i - 1]; 1766 yy1 = fdNdxPlasmon[i - 2]; 1767 1768 c = x1/x0; 1769 d = e0/x0; 1770 a = log10(yy1/y0)/log10(c); 1771 // b0 = log10(y0) - a*log10(x0); 1772 b = y0/pow(x0,a);// pow(10.,b0); 1773 1774 a += 1.0; 1775 if( a == 0 ) result += b*log(e0/x0); 1776 else result += y0*(e0*pow(d,a-1) - x0)/a; 1777 a += 1.0; 1778 1779 if( a == 0 ) fIntegralPlasmon[0] += b*log(e0/x0); 1780 else fIntegralPlasmon[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a; 1781 1782 return result; 1412 1783 1413 1784 } 1414 1785 1786 /////////////////////////////////////////////////////////////////////////////// 1787 // 1788 // Integration of resonance cross-section for the case of 1789 // passing across border between intervals 1790 1791 G4double G4PAIxSection::SumOverBordResonance( G4int i , 1792 G4double en0 ) 1793 { 1794 G4double x0,x1,y0,yy1,a,b,c,d,e0,result; 1795 1796 e0 = en0; 1797 x0 = fSplineEnergy[i]; 1798 x1 = fSplineEnergy[i+1]; 1799 y0 = fdNdxResonance[i]; 1800 yy1 = fdNdxResonance[i+1]; 1801 1802 c = x1/x0; 1803 d = e0/x0; 1804 a = log10(yy1/y0)/log10(c); 1805 // b0 = log10(y0) - a*log10(x0); 1806 b = y0/pow(x0,a); //pow(10.,b); 1807 1808 a += 1.0; 1809 if( a == 0 ) result = b*log(x0/e0); 1810 else result = y0*(x0 - e0*pow(d,a-1))/a; 1811 a += 1.0; 1812 1813 if( a == 0 ) fIntegralResonance[0] += b*log(x0/e0); 1814 else fIntegralResonance[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a; 1815 1816 x0 = fSplineEnergy[i - 1]; 1817 x1 = fSplineEnergy[i - 2]; 1818 y0 = fdNdxResonance[i - 1]; 1819 yy1 = fdNdxResonance[i - 2]; 1820 1821 c = x1/x0; 1822 d = e0/x0; 1823 a = log10(yy1/y0)/log10(c); 1824 // b0 = log10(y0) - a*log10(x0); 1825 b = y0/pow(x0,a);// pow(10.,b0); 1826 1827 a += 1.0; 1828 if( a == 0 ) result += b*log(e0/x0); 1829 else result += y0*(e0*pow(d,a-1) - x0)/a; 1830 a += 1.0; 1831 1832 if( a == 0 ) fIntegralResonance[0] += b*log(e0/x0); 1833 else fIntegralResonance[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a; 1834 1835 return result; 1836 1837 } 1838 1415 1839 ///////////////////////////////////////////////////////////////////////// 1416 1840 // 1417 // 1841 // Returns random PAI-total energy loss over step 1418 1842 1419 1843 G4double G4PAIxSection::GetStepEnergyLoss( G4double step ) 1420 1844 { 1421 G4int iTransfer ; 1422 G4long numOfCollisions ; 1423 G4double loss = 0.0 ; 1424 G4double meanNumber, position ; 1425 1426 // G4cout<<" G4PAIxSection::GetStepEnergyLoss "<<G4endl ; 1427 1428 1429 1430 meanNumber = fIntegralPAIxSection[1]*step ; 1431 numOfCollisions = G4Poisson(meanNumber) ; 1432 1433 // G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl ; 1845 G4long numOfCollisions; 1846 G4double meanNumber, loss = 0.0; 1847 1848 // G4cout<<" G4PAIxSection::GetStepEnergyLoss "<<G4endl; 1849 1850 meanNumber = fIntegralPAIxSection[1]*step; 1851 numOfCollisions = G4Poisson(meanNumber); 1852 1853 // G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl; 1434 1854 1435 1855 while(numOfCollisions) 1436 1856 { 1437 position = fIntegralPAIxSection[1]*G4UniformRand() ; 1438 1439 for( iTransfer=1 ; iTransfer<=fSplineNumber ; iTransfer++ ) 1440 { 1441 if( position >= fIntegralPAIxSection[iTransfer] ) break ; 1442 } 1443 loss += fSplineEnergy[iTransfer] ; 1444 numOfCollisions-- ; 1857 loss += GetEnergyTransfer(); 1858 numOfCollisions--; 1445 1859 } 1446 // G4cout<<"PAI energy loss = "<<loss/keV<<" keV"<<G4endl ;1447 1448 return loss ;1860 // G4cout<<"PAI energy loss = "<<loss/keV<<" keV"<<G4endl; 1861 1862 return loss; 1449 1863 } 1450 1864 1451 1865 ///////////////////////////////////////////////////////////////////////// 1452 1866 // 1453 // 1867 // Returns random PAI-total energy transfer in one collision 1868 1869 G4double G4PAIxSection::GetEnergyTransfer() 1870 { 1871 G4int iTransfer ; 1872 1873 G4double energyTransfer, position; 1874 1875 position = fIntegralPAIxSection[1]*G4UniformRand(); 1876 1877 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ ) 1878 { 1879 if( position >= fIntegralPAIxSection[iTransfer] ) break; 1880 } 1881 if(iTransfer > fSplineNumber) iTransfer--; 1882 1883 energyTransfer = fSplineEnergy[iTransfer]; 1884 1885 if(iTransfer > 1) 1886 { 1887 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand(); 1888 } 1889 return energyTransfer; 1890 } 1891 1892 ///////////////////////////////////////////////////////////////////////// 1893 // 1894 // Returns random Cerenkov energy loss over step 1454 1895 1455 1896 G4double G4PAIxSection::GetStepCerenkovLoss( G4double step ) 1456 1897 { 1457 G4int iTransfer ; 1458 G4long numOfCollisions ; 1459 G4double loss = 0.0 ; 1460 G4double meanNumber, position ; 1461 1462 // G4cout<<" G4PAIxSection::GetStepCreLosnkovs "<<G4endl ; 1463 1464 1465 1466 meanNumber = fIntegralCerenkov[1]*step ; 1467 numOfCollisions = G4Poisson(meanNumber) ; 1468 1469 // G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl ; 1898 G4long numOfCollisions; 1899 G4double meanNumber, loss = 0.0; 1900 1901 // G4cout<<" G4PAIxSection::GetStepCerenkovLoss "<<G4endl; 1902 1903 meanNumber = fIntegralCerenkov[1]*step; 1904 numOfCollisions = G4Poisson(meanNumber); 1905 1906 // G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl; 1470 1907 1471 1908 while(numOfCollisions) 1472 1909 { 1473 position = fIntegralCerenkov[1]*G4UniformRand() ; 1474 1475 for( iTransfer=1 ; iTransfer<=fSplineNumber ; iTransfer++ ) 1476 { 1477 if( position >= fIntegralCerenkov[iTransfer] ) break ; 1478 } 1479 loss += fSplineEnergy[iTransfer] ; 1480 numOfCollisions-- ; 1910 loss += GetCerenkovEnergyTransfer(); 1911 numOfCollisions--; 1481 1912 } 1482 // G4cout<<"PAI Cerenkov loss = "<<loss/keV<<" keV"<<G4endl ;1483 1484 return loss ;1913 // G4cout<<"PAI Cerenkov loss = "<<loss/keV<<" keV"<<G4endl; 1914 1915 return loss; 1485 1916 } 1486 1917 1487 1918 ///////////////////////////////////////////////////////////////////////// 1488 1919 // 1489 // 1920 // Returns random MM-Cerenkov energy loss over step 1921 1922 G4double G4PAIxSection::GetStepMMLoss( G4double step ) 1923 { 1924 G4long numOfCollisions; 1925 G4double meanNumber, loss = 0.0; 1926 1927 // G4cout<<" G4PAIxSection::GetStepMMLoss "<<G4endl; 1928 1929 meanNumber = fIntegralMM[1]*step; 1930 numOfCollisions = G4Poisson(meanNumber); 1931 1932 // G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl; 1933 1934 while(numOfCollisions) 1935 { 1936 loss += GetMMEnergyTransfer(); 1937 numOfCollisions--; 1938 } 1939 // G4cout<<"PAI MM-Cerenkov loss = "<<loss/keV<<" keV"<<G4endl; 1940 1941 return loss; 1942 } 1943 1944 ///////////////////////////////////////////////////////////////////////// 1945 // 1946 // Returns Cerenkov energy transfer in one collision 1947 1948 G4double G4PAIxSection::GetCerenkovEnergyTransfer() 1949 { 1950 G4int iTransfer ; 1951 1952 G4double energyTransfer, position; 1953 1954 position = fIntegralCerenkov[1]*G4UniformRand(); 1955 1956 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ ) 1957 { 1958 if( position >= fIntegralCerenkov[iTransfer] ) break; 1959 } 1960 if(iTransfer > fSplineNumber) iTransfer--; 1961 1962 energyTransfer = fSplineEnergy[iTransfer]; 1963 1964 if(iTransfer > 1) 1965 { 1966 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand(); 1967 } 1968 return energyTransfer; 1969 } 1970 1971 ///////////////////////////////////////////////////////////////////////// 1972 // 1973 // Returns MM-Cerenkov energy transfer in one collision 1974 1975 G4double G4PAIxSection::GetMMEnergyTransfer() 1976 { 1977 G4int iTransfer ; 1978 1979 G4double energyTransfer, position; 1980 1981 position = fIntegralMM[1]*G4UniformRand(); 1982 1983 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ ) 1984 { 1985 if( position >= fIntegralMM[iTransfer] ) break; 1986 } 1987 if(iTransfer > fSplineNumber) iTransfer--; 1988 1989 energyTransfer = fSplineEnergy[iTransfer]; 1990 1991 if(iTransfer > 1) 1992 { 1993 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand(); 1994 } 1995 return energyTransfer; 1996 } 1997 1998 ///////////////////////////////////////////////////////////////////////// 1999 // 2000 // Returns random plasmon energy loss over step 1490 2001 1491 2002 G4double G4PAIxSection::GetStepPlasmonLoss( G4double step ) 1492 2003 { 1493 G4int iTransfer ; 1494 G4long numOfCollisions ; 1495 G4double loss = 0.0 ; 1496 G4double meanNumber, position ; 1497 1498 // G4cout<<" G4PAIxSection::GetStepCreLosnkovs "<<G4endl ; 1499 1500 1501 1502 meanNumber = fIntegralPlasmon[1]*step ; 1503 numOfCollisions = G4Poisson(meanNumber) ; 1504 1505 // G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl ; 2004 G4long numOfCollisions; 2005 G4double meanNumber, loss = 0.0; 2006 2007 // G4cout<<" G4PAIxSection::GetStepPlasmonLoss "<<G4endl; 2008 2009 meanNumber = fIntegralPlasmon[1]*step; 2010 numOfCollisions = G4Poisson(meanNumber); 2011 2012 // G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl; 1506 2013 1507 2014 while(numOfCollisions) 1508 2015 { 1509 position = fIntegralPlasmon[1]*G4UniformRand() ; 1510 1511 for( iTransfer=1 ; iTransfer<=fSplineNumber ; iTransfer++ ) 1512 { 1513 if( position >= fIntegralPlasmon[iTransfer] ) break ; 1514 } 1515 loss += fSplineEnergy[iTransfer] ; 1516 numOfCollisions-- ; 2016 loss += GetPlasmonEnergyTransfer(); 2017 numOfCollisions--; 1517 2018 } 1518 // G4cout<<"PAI Plasmon loss = "<<loss/keV<<" keV"<<G4endl ;1519 1520 return loss ;2019 // G4cout<<"PAI Plasmon loss = "<<loss/keV<<" keV"<<G4endl; 2020 2021 return loss; 1521 2022 } 1522 2023 2024 ///////////////////////////////////////////////////////////////////////// 2025 // 2026 // Returns plasmon energy transfer in one collision 2027 2028 G4double G4PAIxSection::GetPlasmonEnergyTransfer() 2029 { 2030 G4int iTransfer ; 2031 2032 G4double energyTransfer, position; 2033 2034 position = fIntegralPlasmon[1]*G4UniformRand(); 2035 2036 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ ) 2037 { 2038 if( position >= fIntegralPlasmon[iTransfer] ) break; 2039 } 2040 if(iTransfer > fSplineNumber) iTransfer--; 2041 2042 energyTransfer = fSplineEnergy[iTransfer]; 2043 2044 if(iTransfer > 1) 2045 { 2046 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand(); 2047 } 2048 return energyTransfer; 2049 } 2050 2051 ///////////////////////////////////////////////////////////////////////// 2052 // 2053 // Returns random resonance energy loss over step 2054 2055 G4double G4PAIxSection::GetStepResonanceLoss( G4double step ) 2056 { 2057 G4long numOfCollisions; 2058 G4double meanNumber, loss = 0.0; 2059 2060 // G4cout<<" G4PAIxSection::GetStepCreLosnkovs "<<G4endl; 2061 2062 meanNumber = fIntegralResonance[1]*step; 2063 numOfCollisions = G4Poisson(meanNumber); 2064 2065 // G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl; 2066 2067 while(numOfCollisions) 2068 { 2069 loss += GetResonanceEnergyTransfer(); 2070 numOfCollisions--; 2071 } 2072 // G4cout<<"PAI resonance loss = "<<loss/keV<<" keV"<<G4endl; 2073 2074 return loss; 2075 } 2076 2077 2078 ///////////////////////////////////////////////////////////////////////// 2079 // 2080 // Returns resonance energy transfer in one collision 2081 2082 G4double G4PAIxSection::GetResonanceEnergyTransfer() 2083 { 2084 G4int iTransfer ; 2085 2086 G4double energyTransfer, position; 2087 2088 position = fIntegralResonance[1]*G4UniformRand(); 2089 2090 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ ) 2091 { 2092 if( position >= fIntegralResonance[iTransfer] ) break; 2093 } 2094 if(iTransfer > fSplineNumber) iTransfer--; 2095 2096 energyTransfer = fSplineEnergy[iTransfer]; 2097 2098 if(iTransfer > 1) 2099 { 2100 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand(); 2101 } 2102 return energyTransfer; 2103 } 2104 2105 2106 ///////////////////////////////////////////////////////////////////////// 2107 // 2108 // Returns Rutherford energy transfer in one collision 2109 2110 G4double G4PAIxSection::GetRutherfordEnergyTransfer() 2111 { 2112 G4int iTransfer ; 2113 2114 G4double energyTransfer, position; 2115 2116 position = (fIntegralPlasmon[1]-fIntegralResonance[1])*G4UniformRand(); 2117 2118 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ ) 2119 { 2120 if( position >= (fIntegralPlasmon[iTransfer]-fIntegralResonance[iTransfer]) ) break; 2121 } 2122 if(iTransfer > fSplineNumber) iTransfer--; 2123 2124 energyTransfer = fSplineEnergy[iTransfer]; 2125 2126 if(iTransfer > 1) 2127 { 2128 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand(); 2129 } 2130 return energyTransfer; 2131 } 1523 2132 1524 2133 … … 1528 2137 // 1529 2138 1530 G4int G4PAIxSection::fNumberOfGammas = 111 ;2139 G4int G4PAIxSection::fNumberOfGammas = 111; 1531 2140 1532 2141 const G4double G4PAIxSection::fLorentzFactor[112] = // fNumberOfGammas+1 … … 1556 2165 5.658206e+04, 6.422112e+04, 7.289153e+04, 8.273254e+04, 9.390219e+04, // 110 1557 2166 1.065799e+05 1558 } ;2167 }; 1559 2168 1560 2169 /////////////////////////////////////////////////////////////////////// … … 1564 2173 1565 2174 const 1566 G4int G4PAIxSection::fRefGammaNumber = 29 ;2175 G4int G4PAIxSection::fRefGammaNumber = 29; 1567 2176 1568 2177 -
trunk/source/processes/electromagnetic/standard/src/G4PAIySection.cc
r819 r961 26 26 // 27 27 // $Id: G4PAIySection.cc,v 1.3 2007/10/01 18:38:10 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/standard/src/G4PEEffectModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PEEffectModel.cc,v 1. 6 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4PEEffectModel.cc,v 1.7 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 41 41 // 42 42 // 04.12.05 : SetProposedKineticEnergy(0.) for the killed photon (mma) 43 // 20.02.09 : Added initialisation of deexcitation flag and method 44 // CrossSectionPerVolume instead of mfp (V.Ivanchenko) 43 45 // 44 46 // Class Description: … … 66 68 theGamma = G4Gamma::Gamma(); 67 69 theElectron = G4Electron::Electron(); 70 fminimalEnergy = 1.0*eV; 68 71 } 69 72 … … 71 74 72 75 G4PEEffectModel::~G4PEEffectModel() 73 { 74 } 76 {} 75 77 76 78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 79 81 const G4DataVector&) 80 82 { 81 if (isInitialized) return; 82 if (pParticleChange) 83 fParticleChange = 84 reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 85 else 86 fParticleChange = new G4ParticleChangeForGamma(); 87 88 fminimalEnergy = 1.0*eV; 83 // always false before the run 84 SetDeexcitationFlag(false); 85 86 if (isInitialized) return; 87 if (pParticleChange) { 88 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 89 } else { 90 fParticleChange = new G4ParticleChangeForGamma(); 91 } 92 isInitialized = true; 93 } 94 95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 96 97 G4double G4PEEffectModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 98 G4double energy, 99 G4double Z, G4double, 100 G4double, G4double) 101 { 102 G4double* SandiaCof = G4SandiaTable::GetSandiaCofPerAtom((G4int)Z, energy); 103 104 G4double energy2 = energy*energy; 105 G4double energy3 = energy*energy2; 106 G4double energy4 = energy2*energy2; 107 108 return SandiaCof[0]/energy + SandiaCof[1]/energy2 + 109 SandiaCof[2]/energy3 + SandiaCof[3]/energy4; 110 } 111 112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 113 114 G4double G4PEEffectModel::CrossSectionPerVolume(const G4Material* material, 115 const G4ParticleDefinition*, 116 G4double energy, 117 G4double, G4double) 118 { 119 G4double* SandiaCof = 120 material->GetSandiaTable()->GetSandiaCofForMaterial(energy); 121 122 G4double energy2 = energy*energy; 123 G4double energy3 = energy*energy2; 124 G4double energy4 = energy2*energy2; 125 126 return SandiaCof[0]/energy + SandiaCof[1]/energy2 + 127 SandiaCof[2]/energy3 + SandiaCof[3]/energy4; 89 128 } 90 129 -
trunk/source/processes/electromagnetic/standard/src/G4PSTARStopping.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PSTARStopping.cc,v 1. 5 2006/06/29 19:53:24 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4PSTARStopping.cc,v 1.8 2008/11/24 18:28:09 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 29 29 //--------------------------------------------------------------------------- … … 53 53 G4PSTARStopping::G4PSTARStopping() 54 54 { 55 currentE = 0.0; 55 56 currentMaterial = 0; 56 57 index = 0; … … 72 73 for (G4int i=0; i<74; i++){ 73 74 if (matName == name[i]){ 74 matIndex = -1;75 matIndex = i; 75 76 currentMaterial = mat; 76 77 return i; … … 115 116 res = e1*std::exp(std::log(energy/t1)*std::log(e2/e1)/std::log(t2/t1)); 116 117 return res; 117 }118 } 118 119 119 120 void G4PSTARStopping::Initialise() … … 122 123 123 124 name [0] = "G4_A-150_TISSUE"; 124 Znum [0] = 0;125 126 125 G4double T0[60] = { 127 126 0.001, 0.0015, 0.002, 0.0025, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, … … 131 130 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 132 131 0.75, 0.8, 0.85, 0.9, 0.95, 1., 1.25, 1.5, 1.75, 2. }; 133 134 132 G4double e0[60] = { 176.8, 216.6, 250.1, 279.6, 306.3, 351.1, 390.9, 426.8, 459.8, 489.9, 517.8, 544, 596.4, 641.3, 680.6, 715.7, 747, 775, 800, 822.6, 861.7, 894.2, 920.7, 941.5, 957.3, 968.6, 976.2, 980.5, 982, 981, 978, 973.2, 967, 959.5, 910.4, 853.6, 797.9, 746.9, 701.5, 661.5, 626.4, 595.6, 544.8, 504.4, 471.1, 442.8, 416.4, 392, 369.9, 350, 332.2, 316.4, 302.2, 289.5, 278.1, 267.9, 228.9, 200.8, 179.5, 162.6 }; 135 133 … … 138 136 139 137 name [1] = "G4_ACETYLENE"; 140 Znum [1] = 0;141 142 138 G4double e1[60] = { 185.5, 227.2, 262.3, 293.2, 321.2, 364.8, 404, 439.3, 471.6, 500.3, 526.4, 550.6, 600.2, 641.6, 677.4, 709.2, 737.3, 762, 783.7, 803.1, 837.2, 866.8, 891.7, 911.6, 926.6, 937.4, 944.7, 949, 950.8, 950.3, 947.9, 943.9, 938.4, 931.8, 887.1, 833.7, 779.9, 729.5, 686.8, 650.4, 618.5, 590.2, 541.4, 500.4, 465.3, 434.8, 408, 384.6, 364.4, 346.5, 330.5, 316.1, 303.2, 291.3, 280.4, 270.4, 230.7, 202.2, 180.5, 163.5 }; 143 139 … … 145 141 146 142 name [2] = "G4_ADIPOSE_TISSUE_ICRP"; 147 Znum [2] = 0;148 149 143 G4double e2[60] = { 195.9, 239.9, 277, 309.7, 339.3, 387.5, 430.6, 469.4, 505, 537.2, 566.9, 594.6, 649.9, 696.7, 737.4, 773.3, 805.2, 833.4, 858.3, 880.5, 918.9, 951, 977.2, 997.6, 1013, 1023, 1030, 1034, 1034, 1033, 1029, 1023, 1016, 1008, 955.6, 895, 835.1, 779.6, 729.7, 685.6, 646.6, 612.3, 555, 509.1, 471.6, 440.3, 413.7, 390.4, 370.1, 352.1, 336, 321.4, 308.3, 296.3, 285.3, 275.2, 234.9, 206, 184, 166.7 }; 150 144 … … 152 146 153 147 name [3] = "G4_Ag"; 154 Znum [3] = 47;155 156 148 G4double e3[60] = { 29.73, 36.41, 42.05, 47.01, 51.5, 59.46, 66.48, 72.83, 78.66, 84.09, 89.2, 94.02, 103.7, 112.1, 119.7, 126.6, 132.8, 138.5, 143.7, 148.5, 157.1, 164.3, 170.5, 175.7, 180.1, 183.7, 186.7, 189.1, 191.1, 192.5, 193.6, 194.4, 194.8, 195, 193.4, 189.3, 184.4, 179.2, 174.1, 169.3, 164.8, 160.5, 152.7, 145.7, 139.5, 133.8, 128.6, 123.9, 119.5, 115.4, 111.7, 108.1, 104.8, 101.7, 98.74, 95.98, 84.49, 75.92, 69.3, 64.05 }; 157 149 … … 159 151 160 152 name [4] = "G4_AIR"; 161 Znum [4] = 0;162 163 153 G4double e4[60] = { 119.7, 146.7, 169.3, 189.3, 207.4, 239.5, 267.8, 293.3, 316.8, 338.7, 359.2, 378.7, 417, 450.4, 480.1, 506.7, 530.7, 552.6, 572.4, 590.5, 622.1, 648.3, 670, 687.7, 702, 713.2, 721.7, 727.8, 731.9, 734.1, 734.8, 734, 732, 729, 702.9, 667.2, 629.1, 592.2, 558.3, 527.8, 500.6, 476.3, 434.9, 401.2, 373.3, 349.8, 329.7, 312.1, 296.4, 282.4, 269.9, 258.7, 248.5, 239.1, 230.6, 222.7, 191.1, 168.2, 150.8, 137 }; 164 154 … … 166 156 167 157 name [5] = "G4_Al"; 168 Znum [5] = 13;169 170 158 G4double e5[60] = { 92.38, 113.1, 130.6, 146.1, 160, 184.8, 206.6, 226.3, 244.4, 261.3, 277.1, 292.1, 320.6, 344.8, 365.7, 383.8, 399.6, 413.2, 425, 435.1, 451, 462, 469.2, 473.4, 475.2, 475.1, 473.7, 471.2, 468, 464.2, 460.1, 455.8, 451.3, 446.8, 424.5, 404.5, 386.7, 371, 356.8, 344, 332.3, 321.5, 301.7, 284.2, 268.6, 254.8, 242.5, 231.4, 221.5, 212.4, 204.2, 196.6, 189.7, 183.3, 177.4, 171.9, 149.4, 132.7, 119.8, 109.4 }; 171 159 … … 173 161 174 162 name [6] = "G4_ALUMINUM_OXIDE"; 175 Znum [6] = 0;176 177 163 G4double e6[60] = { 73.51, 90.03, 104, 116.2, 127.3, 147, 164.4, 180.1, 194.5, 207.9, 220.5, 232.5, 256.1, 276.8, 295.3, 311.9, 327, 340.8, 353.4, 364.9, 385.3, 402.5, 417, 429.2, 439.3, 447.6, 454.3, 459.6, 463.7, 466.6, 468.6, 469.8, 470.2, 470, 461.9, 447.2, 430.1, 412.7, 396.5, 381.4, 367.5, 354.5, 331.1, 310.6, 292.6, 276.5, 262.2, 249.4, 238.1, 227.9, 218.7, 210.2, 202.6, 195.7, 189.2, 183.2, 158.9, 140.9, 127, 116 }; 178 164 … … 180 166 181 167 name [7] = "G4_Ar"; 182 Znum [7] = 40;183 184 168 G4double e7[60] = { 86.08, 105.4, 121.7, 136.1, 149.1, 172.2, 192.5, 210.9, 227.7, 243.5, 258.2, 272.2, 299.7, 323.5, 344.5, 363.3, 380.2, 395.3, 409, 421.4, 442.5, 459.4, 472.8, 483.1, 490.7, 496, 499.2, 500.7, 500.8, 499.5, 497.2, 494, 490, 485.5, 457.4, 426.7, 397.7, 371.9, 349.5, 330.1, 313.2, 298.5, 274.2, 254.9, 239, 225.6, 214.4, 204.7, 196.1, 188.4, 181.3, 174.9, 168.9, 163.4, 158.2, 153.3, 133, 118.2, 106.8, 97.72 }; 185 169 … … 187 171 188 172 name [8] = "G4_Au"; 189 Znum [8] = 79;190 191 173 G4double e8[60] = { 14.76, 18.07, 20.87, 23.33, 25.56, 29.51, 33, 36.15, 39.04, 41.74, 44.27, 46.66, 51.51, 55.8, 59.66, 63.18, 66.43, 69.43, 72.23, 74.84, 79.58, 83.77, 87.5, 90.81, 93.77, 96.4, 98.74, 100.8, 102.6, 104.3, 105.7, 106.9, 108, 108.9, 111.5, 112, 111.2, 109.6, 107.6, 105.4, 103.2, 101, 96.33, 91.8, 87.7, 84.05, 80.83, 78, 75.47, 73.18, 71.11, 69.21, 67.46, 65.83, 64.32, 62.91, 56.98, 52.39, 48.68, 45.58 }; 192 174 … … 194 176 195 177 name [9] = "G4_B-100_BONE"; 196 Znum [9] = 0;197 198 178 G4double e9[60] = { 142.5, 174.5, 201.5, 225.2, 246.7, 283.1, 315.3, 344.4, 371.1, 395.5, 418.2, 439.6, 482.3, 519, 551.3, 580.1, 606, 629.2, 650.1, 669, 701.9, 729.5, 752.2, 770.4, 784.5, 795.1, 802.6, 807.4, 810, 810.5, 809.3, 806.6, 802.7, 797.7, 762.5, 719.5, 676.2, 635.8, 599.3, 566.7, 537.9, 512.3, 468.1, 431.4, 400.8, 375, 353, 333.7, 316.9, 301.9, 288.5, 276.3, 265.3, 255.1, 245.9, 237.4, 203.4, 178.9, 160.2, 145.4 }; 199 179 … … 201 181 202 182 name [10] = "G4_Be"; 203 Znum [10] = 4;204 205 183 G4double e10[60] = { 149.7, 183.3, 211.7, 236.7, 259.2, 299.3, 334.7, 366.6, 396, 423.3, 449, 473.3, 517.2, 553.4, 583.6, 608.7, 629.6, 646.8, 660.7, 671.9, 687.3, 695.5, 698.4, 697.6, 694.2, 689.1, 682.8, 675.7, 668.2, 660.5, 652.7, 644.9, 637.2, 629.6, 594.2, 563, 535.4, 510.7, 488.4, 468.2, 449.8, 432.8, 404.4, 380.1, 358.1, 337.6, 318.8, 302.2, 287.4, 274.2, 262.3, 251.5, 241.7, 232.7, 224.4, 216.8, 186, 163.6, 146.3, 132.6 }; 206 184 … … 208 186 209 187 name [11] = "G4_BONE_COMPACT_ICRU"; 210 Znum [11] = 0;211 212 188 G4double e11[60] = { 141.6, 173.4, 200.2, 223.8, 245.2, 281.3, 313.3, 342.2, 368.8, 393.1, 415.6, 436.8, 479, 515.2, 547, 575.3, 600.7, 623.4, 643.8, 662.1, 694.2, 721, 743.2, 760.9, 774.8, 785.2, 792.6, 797.6, 800.3, 801.1, 800.3, 797.9, 794.4, 789.9, 756.4, 714.5, 671.4, 630.5, 593.2, 559.7, 530, 503.5, 459, 423, 393.3, 368.3, 346.9, 328.1, 311.6, 296.9, 283.7, 271.8, 261, 251.1, 242, 233.7, 200.3, 176.3, 158, 143.5 }; 213 189 … … 215 191 216 192 name [12] = "G4_C"; 217 Znum [12] = 6;218 219 193 G4double e12[60] = { 138.4, 169.5, 195.7, 218.8, 239.7, 270.2, 297.8, 322.7, 345.4, 365.1, 382.6, 398.7, 433.5, 462.4, 487.4, 509.9, 530, 547.7, 563.4, 577.6, 603.9, 628.3, 650.1, 668.6, 683.5, 695.3, 704.5, 711.4, 716.3, 719.4, 720.8, 720.9, 719.7, 717.4, 694.5, 661.1, 624.7, 589.1, 556, 526, 499.1, 475, 435.8, 404.4, 377.9, 354.6, 334, 315.9, 300.2, 286.2, 273.7, 262.4, 252.2, 242.7, 234.1, 226.1, 194.2, 171.1, 153.4, 139.4 }; 220 194 221 195 for(i=0; i<60; i++) {e[12][i]=e12[i]*MeV*cm2/g;} 222 196 223 name [13] = "G4_C_Graphite"; 224 Znum [13] = 0; 225 197 name [13] = "G4_GRAPHITE"; 226 198 G4double e13[60] = { 142.6, 175.3, 203.1, 228, 250.5, 283.4, 313.3, 340.4, 365.1, 386.7, 405.9, 423.5, 462, 494, 521.9, 546.9, 569.3, 589.2, 606.9, 622.9, 652.4, 679.9, 704.5, 725.3, 742.2, 755.6, 766.1, 774, 779.6, 783.1, 784.7, 784.8, 783.4, 780.7, 753.8, 714.5, 671.4, 629.1, 590.2, 555.6, 524.9, 497.7, 453.9, 419.3, 390.3, 365.1, 343, 323.7, 307.1, 292.3, 279.1, 267.3, 256.6, 246.8, 237.8, 229.5, 196.7, 173, 155, 140.8 }; 227 199 … … 229 201 230 202 name [14] = "G4_ETHYLENE"; 231 Znum [14] = 0;232 233 203 G4double e14[60] = { 225.8, 276.5, 319.3, 357, 391.1, 445.9, 494.9, 539.1, 579.6, 616, 649.5, 680.6, 742.9, 795.1, 840.1, 879.9, 914.8, 945.5, 972.4, 996.1, 1037, 1071, 1099, 1120, 1135, 1145, 1150, 1152, 1152, 1148, 1142, 1135, 1126, 1115, 1052, 981.5, 912.8, 849.7, 795.6, 749, 708.3, 672.4, 611.7, 562.1, 520.6, 485.3, 454.9, 428.4, 405.5, 385.2, 367.1, 350.8, 336.2, 322.8, 310.5, 299.3, 254.6, 222.7, 198.6, 179.6 }; 234 204 … … 236 206 237 207 name [15] = "G4_C-552"; 238 Znum [15] = 0;239 240 208 G4double e15[60] = { 119.2, 146, 168.6, 188.5, 206.5, 235.1, 260.7, 283.8, 305, 323.9, 341.3, 357.4, 390.7, 418.9, 443.7, 465.8, 485.7, 503.6, 519.5, 534.1, 560.1, 583.2, 603.2, 620, 633.7, 644.7, 653.4, 660.1, 665, 668.4, 670.3, 671.1, 670.7, 669.5, 652.9, 626.4, 596.2, 565.7, 537, 510.7, 486.8, 465.1, 427.5, 396.1, 369.6, 347, 327.4, 310.1, 294.9, 281.3, 269, 258, 247.9, 238.6, 230.2, 222.4, 191, 168.2, 150.8, 137 }; 241 209 … … 243 211 244 212 name [16] = "G4_CARBON_DIOXIDE"; 245 Znum [16] = 0;246 247 213 G4double e16[60] = { 106.4, 130.3, 150.4, 168.2, 184.2, 212.7, 237.9, 260.6, 281.4, 300.9, 319.1, 336.4, 370.9, 401.2, 428.3, 452.8, 475.1, 495.6, 514.4, 531.8, 562.6, 588.8, 611.2, 630.2, 646.1, 659.3, 670.1, 678.6, 685.2, 690, 693.2, 694.9, 695.4, 694.8, 679, 650.5, 617.3, 583.6, 552.1, 523.6, 497.8, 474.6, 434.7, 401.8, 374.3, 351, 330.9, 313.2, 297.6, 283.7, 271.2, 259.9, 249.6, 240.3, 231.7, 223.7, 191.9, 168.9, 151.4, 137.5 }; 248 214 … … 250 216 251 217 name [17] = "G4_CALCIUM_FLUORIDE"; 252 Znum [17] = 0;253 254 218 G4double e17[60] = { 74.48, 91.21, 105.3, 117.8, 129, 149, 166.5, 182.4, 197, 210.6, 223.4, 235.5, 259.6, 280.7, 299.6, 316.6, 332, 346.2, 359.1, 371.1, 392.2, 410.1, 425.2, 438, 448.7, 457.5, 464.6, 470.3, 474.7, 477.9, 480.1, 481.4, 481.9, 481.7, 473, 456.7, 437.6, 417.8, 398.6, 380.6, 364, 348.7, 322.9, 301.7, 283.5, 267.5, 253.4, 240.9, 229.8, 219.9, 210.8, 202.5, 194.8, 187.7, 181.3, 175.5, 151.6, 134.4, 121.1, 110.6 }; 255 219 … … 257 221 258 222 name [18] = "G4_CERIC_SULFATE"; 259 Znum [18] = 0;260 261 223 G4double e18[60] = { 135.4, 165.8, 191.5, 214.1, 234.5, 270.8, 302.8, 331.7, 358.2, 383, 406.2, 428.2, 471.7, 509.8, 543.6, 574, 601.5, 626.5, 649.3, 670.1, 706.4, 736.5, 761.2, 781.4, 797.4, 809.8, 819, 825.3, 829.2, 830.8, 830.6, 828.7, 825.4, 820.9, 785.9, 741.4, 696, 653.6, 618.4, 588.8, 562.8, 539.6, 499.3, 464.8, 434.6, 407.9, 384.2, 363.4, 344.9, 328.4, 313.6, 300.3, 288.2, 277.2, 267, 257.7, 220.4, 193.5, 173, 156.9 }; 262 224 … … 264 226 265 227 name [19] = "G4_CELLULOSE_NITRATE"; 266 Znum [19] = 0;267 268 228 G4double e19[60] = { 132.2, 161.9, 187, 209, 229, 262.6, 292.5, 319.4, 344.2, 366.8, 387.8, 407.5, 447, 481, 510.8, 537.6, 561.6, 583.2, 602.7, 620.4, 651.5, 677.9, 700, 718.2, 732.7, 744.1, 752.7, 759, 763.2, 765.5, 766.2, 765.5, 763.5, 760.6, 734.4, 698.2, 659.3, 621.4, 586, 553.8, 524.9, 498.9, 452.4, 413.9, 382.9, 358, 337.7, 319.7, 303.9, 289.7, 277.1, 265.6, 255.2, 245.6, 236.9, 228.8, 196.4, 173, 155, 140.8 }; 269 229 … … 271 231 272 232 name [20] = "G4_BONE_CORTICAL_ICRP"; 273 Znum [20] = 0;274 275 233 G4double e20[60] = { 123.5, 151.3, 174.7, 195.3, 214, 246.1, 274.5, 300.2, 323.8, 345.6, 365.9, 385, 423, 455.7, 484.7, 510.5, 533.8, 554.8, 573.7, 590.9, 620.8, 645.9, 666.5, 683.3, 696.6, 706.8, 714.4, 719.7, 723, 724.5, 724.5, 723.1, 720.6, 717.1, 689.6, 653.5, 615.8, 579.8, 546.6, 516.7, 490, 466.2, 426.1, 393.6, 366.6, 343.7, 324, 306.7, 291.5, 278, 265.8, 254.7, 244.7, 235.5, 227.1, 219.4, 188.4, 166.1, 149, 135.4 }; 276 234 … … 278 236 279 237 name [21] = "G4_CESIUM_IODIDE"; 280 Znum [21] = 0;281 282 238 G4double e21[60] = { 34.67, 42.46, 49.03, 54.82, 60.05, 69.34, 77.52, 84.92, 91.73, 98.06, 104, 109.6, 121, 130.9, 139.9, 148, 155.5, 162.3, 168.6, 174.5, 184.9, 194, 201.8, 208.5, 214.2, 219, 223, 226.3, 228.9, 231, 232.5, 233.4, 234, 234.1, 230.4, 221.9, 211.4, 200.6, 190.1, 180.6, 171.9, 164.1, 151.1, 140.6, 132.1, 125.1, 119.1, 114, 109.6, 105.6, 102.1, 98.92, 95.83, 92.83, 89.95, 87.22, 75.76, 67.41, 61.26, 56.63 }; 283 239 … … 285 241 286 242 name [22] = "G4_Cu"; 287 Znum [22] = 29;288 289 243 G4double e22[60] = { 34.9, 42.74, 49.35, 55.18, 60.45, 69.8, 78.04, 85.48, 92.33, 98.71, 104.7, 110.4, 121.4, 130.9, 139.2, 146.6, 153.2, 159, 164.3, 168.9, 176.9, 183.2, 188.4, 192.5, 195.9, 198.7, 201, 202.8, 204.4, 205.6, 206.7, 207.5, 208.2, 208.7, 209.9, 209.2, 207.5, 205.1, 202.3, 199.1, 195.8, 192.3, 185.4, 178.6, 172, 165.8, 159.6, 153.6, 148, 142.7, 137.8, 133.3, 129.1, 125.2, 121.7, 118.3, 104.7, 94.43, 86.45, 79.87 }; 290 244 … … 292 246 293 247 name [23] = "G4_Fe"; 294 Znum [23] = 26;295 296 248 G4double e23[60] = { 37.81, 46.31, 53.47, 59.78, 65.49, 75.62, 84.54, 92.61, 100, 106.9, 113.4, 119.6, 132, 143, 153, 162, 170.4, 178.2, 185.4, 192.2, 204.6, 215.6, 225.4, 234.2, 242.1, 249.2, 255.5, 261.2, 266.2, 270.7, 274.6, 278.1, 281, 283.6, 290.9, 291.5, 287.6, 281, 272.8, 263.9, 254.9, 246, 229.5, 214.8, 202.1, 191.1, 181.6, 173.4, 166.2, 159.7, 153.8, 148.5, 143.6, 139.1, 135, 131.1, 115.3, 103.5, 94.02, 86.52 }; 297 249 … … 299 251 300 252 name [24] = "G4_FERROUS_SULFATE"; 301 Znum [24] = 0;302 303 253 G4double e24[60] = { 135.1, 165.5, 191.1, 213.6, 234, 270.2, 302.1, 330.9, 357.4, 382.1, 405.3, 427.2, 470.7, 508.7, 542.4, 572.8, 600.3, 625.3, 648, 668.8, 705, 735.1, 759.9, 780.1, 796.1, 808.5, 817.7, 824.1, 827.9, 829.6, 829.4, 827.5, 824.2, 819.7, 784.9, 740.5, 695.1, 652.8, 617.8, 588.4, 562.8, 539.9, 499.9, 465.6, 435.5, 408.8, 385, 364.1, 345.6, 329.1, 314.3, 300.9, 288.8, 277.7, 267.6, 258.3, 220.8, 193.9, 173.4, 157.2 }; 304 254 … … 306 256 307 257 name [25] = "G4_Gd"; 308 Znum [25] = 64;309 310 258 G4double e25[60] = { 25.71, 31.49, 36.37, 40.66, 44.54, 51.43, 57.5, 62.99, 68.03, 72.73, 77.14, 81.32, 89.78, 97.24, 104, 110.1, 115.8, 121, 125.8, 130.4, 138.5, 145.7, 152.1, 157.7, 162.6, 166.9, 170.7, 173.9, 176.7, 179, 181, 182.5, 183.8, 184.7, 185.6, 182.1, 176.3, 169.4, 162.2, 155.2, 148.7, 142.6, 132, 123.3, 116.2, 110.2, 105, 100.6, 96.67, 93.2, 90.08, 87.27, 84.72, 82.38, 80.24, 78.26, 70.14, 63.87, 58.87, 54.76 }; 311 259 … … 313 261 314 262 name [26] = "G4_Ge"; 315 Znum [26] = 32;316 317 263 G4double e26[60] = { 45.91, 56.23, 64.93, 72.59, 79.52, 91.82, 102.7, 112.5, 121.5, 129.9, 137.7, 145.2, 159.7, 172.3, 183.3, 193.1, 201.7, 209.4, 216.3, 222.3, 232.3, 240, 245.6, 249.6, 252.3, 253.9, 254.5, 254.5, 253.9, 252.9, 251.5, 250, 248.2, 246.4, 236.5, 227.2, 218.9, 211.6, 205.1, 199.3, 193.9, 189, 180.1, 172.3, 165.2, 158.8, 152.6, 146.6, 140.9, 135.7, 130.8, 126.3, 122.1, 118.3, 114.7, 111.3, 97.72, 87.77, 80.18, 74.18 }; 318 264 … … 320 266 321 267 name [27] = "G4_Pyrex_Glass"; 322 Znum [27] = 0;323 324 268 G4double e27[60] = { 88.74, 108.7, 125.5, 140.3, 153.7, 177.5, 198.4, 217.4, 234.8, 251, 266.2, 280.6, 308.9, 333.6, 355.6, 375.3, 393.1, 409.2, 423.9, 437.3, 460.8, 480.4, 496.7, 510.2, 521.2, 530.1, 537.1, 542.5, 546.4, 549.1, 550.6, 551.2, 551, 550.1, 537.6, 518.1, 496.1, 473.9, 451.2, 429.2, 408.8, 390.1, 357.9, 331.5, 309.8, 291.7, 276.2, 262.4, 250.1, 239.1, 229.2, 220.2, 212, 204.6, 197.7, 191.4, 165.6, 146.7, 132.1, 120.4 }; 325 269 … … 327 271 328 272 name [28] = "G4_H"; 329 Znum [28] = 1;330 331 273 G4double e28[60] = { 746.5, 914.3, 1056, 1180, 1293, 1493, 1669, 1829, 1975, 2112, 2240, 2361, 2586, 2777, 2942, 3084, 3208, 3316, 3409, 3490, 3618, 3710, 3771, 3808, 3823, 3822, 3807, 3781, 3745, 3702, 3654, 3601, 3545, 3487, 3183, 2890, 2629, 2402, 2204, 2031, 1882, 1753, 1544, 1384, 1258, 1159, 1077, 1007, 947, 894.2, 847.5, 805.9, 768.6, 734.9, 704.3, 676.4, 566.7, 489.7, 432.5, 388.1 }; 332 274 … … 334 276 335 277 name [29] = "G4_He"; 336 Znum [29] = 2;337 338 278 G4double e29[60] = { 184.2, 225.6, 260.6, 291.3, 319.1, 368.5, 412, 451.3, 487.4, 521.1, 552.7, 582.6, 641.3, 691.9, 736.7, 776.6, 812.5, 844.9, 874.2, 900.8, 946.6, 984.1, 1014, 1039, 1058, 1072, 1083, 1089, 1093, 1094, 1093, 1090, 1085, 1079, 1032, 973, 911.2, 852.1, 797.5, 748.3, 704.5, 665.8, 600.4, 547.7, 504.5, 468.3, 437.7, 411.3, 388.2, 368, 349.9, 333.8, 319.3, 306.2, 294.2, 283.2, 239.6, 208.6, 185.2, 167 }; 339 279 … … 341 281 342 282 name [30] = "G4_KAPTON"; 343 Znum [30] = 0;344 345 283 G4double e30[60] = { 145.4, 178.1, 205.6, 229.9, 251.8, 286.2, 317.1, 344.9, 370.4, 393.1, 413.7, 432.9, 472.6, 506.1, 535.2, 561.3, 584.6, 605.3, 623.8, 640.4, 670.2, 696.5, 719.1, 737.7, 752.5, 763.9, 772.5, 778.6, 782.6, 784.6, 784.9, 783.8, 781.4, 778, 749.2, 710.6, 669.6, 630, 593.5, 560.4, 530.8, 504.4, 459.6, 423.3, 393.3, 368.2, 346.8, 328, 311.6, 296.9, 283.8, 272, 261.3, 251.5, 242.4, 234.1, 200.8, 176.8, 158.4, 143.8 }; 346 284 … … 348 286 349 287 name [31] = "G4_Kr"; 350 Znum [31] = 36;351 352 288 G4double e31[60] = { 45.92, 56.24, 64.94, 72.6, 79.53, 91.84, 102.7, 112.5, 121.5, 129.9, 137.8, 145.2, 160.1, 173.2, 184.9, 195.5, 205.1, 213.8, 221.8, 229.1, 242, 252.7, 261.6, 268.8, 274.6, 279, 282.3, 284.5, 285.8, 286.2, 286, 285.1, 283.8, 281.9, 268.6, 252.2, 236.2, 221.7, 209, 198.2, 188.9, 180.9, 168.1, 158.1, 150.2, 143.7, 138.1, 133.2, 128.8, 124.8, 121.2, 117.8, 114.6, 111.6, 108.8, 106.1, 94.63, 85.43, 77.91, 71.84 }; 353 289 … … 355 291 356 292 name [32] = "G4_LITHIUM_TETRABORATE"; 357 Znum [32] = 0;358 359 293 G4double e32[60] = { 111, 135.9, 157, 175.5, 192.2, 222, 248.2, 271.9, 293.6, 313.9, 333, 351, 386.5, 417.4, 444.8, 469.4, 491.6, 511.7, 530.1, 546.7, 575.8, 599.9, 619.8, 636, 649.1, 659.3, 667.2, 672.9, 676.7, 678.9, 679.6, 679.1, 677.6, 675.1, 653, 622.4, 589.5, 557.3, 525.5, 495.6, 468.4, 444.1, 403.1, 370.6, 344.6, 323.5, 305.9, 290.3, 276.4, 263.9, 252.7, 242.4, 233.2, 224.7, 216.9, 209.6, 180.4, 159.2, 142.8, 129.9 }; 360 294 … … 362 296 363 297 name [33] = "G4_LITHIUM_FLUORIDE"; 364 Znum [33] = 0;365 366 298 G4double e33[60] = { 80.87, 99.04, 114.4, 127.9, 140.1, 161.7, 180.8, 198.1, 214, 228.7, 242.6, 255.7, 281.9, 304.9, 325.4, 344, 360.9, 376.5, 390.8, 404, 427.6, 447.8, 465.3, 480.3, 493.1, 504.1, 513.3, 521.1, 527.4, 532.5, 536.5, 539.6, 541.7, 543, 540.3, 527.4, 509.2, 488.8, 467.4, 446.5, 426.9, 408.7, 376.9, 350.4, 328, 309.1, 292.7, 278.1, 265.1, 253.3, 242.5, 232.8, 223.9, 215.6, 208.2, 201.2, 173.1, 152.5, 136.8, 124.4 }; 367 299 … … 369 301 370 302 name [34] = "G4_M3_WAX"; 371 Znum [34] = 0;372 373 303 G4double e34[60] = { 198.1, 242.6, 280.2, 313.3, 343.1, 391.9, 435.4, 474.6, 510.6, 543.1, 573, 601, 656.7, 703.7, 744.4, 780.4, 812.2, 840.3, 865, 887, 925, 956.5, 982.1, 1002, 1016, 1026, 1032, 1035, 1036, 1033, 1029, 1023, 1016, 1007, 953.3, 891.9, 831.3, 775.4, 725.1, 680.6, 641.3, 606.6, 546.6, 497.8, 458.8, 427.4, 401.7, 379.2, 359.6, 342.2, 326.7, 312.7, 300.1, 288.5, 277.8, 268.1, 229.1, 201, 179.7, 162.8 }; 374 304 … … 376 306 377 307 name [35] = "G4_MS20_TISSUE"; 378 Znum [35] = 0;379 380 308 G4double e35[60] = { 174.4, 213.6, 246.7, 275.8, 302.1, 345, 383.2, 417.7, 449.4, 477.9, 504.3, 528.8, 578.1, 619.8, 656, 688.2, 716.7, 742, 764.4, 784.4, 819.3, 848.7, 872.8, 892, 906.4, 916.8, 923.7, 927.8, 929.4, 928.8, 926.4, 922.3, 916.9, 910.4, 866.6, 814.5, 762, 712.8, 668.3, 628.6, 593.3, 562.1, 507.7, 463.3, 427.6, 398.9, 375.3, 354.7, 336.7, 320.6, 306.2, 293.3, 281.6, 270.9, 261, 252, 215.7, 189.5, 169.6, 153.9 }; 381 309 … … 383 311 384 312 name [36] = "G4_METHANE"; 385 Znum [36] = 0;386 387 313 G4double e36[60] = { 272.8, 334.1, 385.8, 431.4, 472.5, 545.6, 610, 668.2, 721.8, 771.6, 818.4, 862.7, 949.2, 1024, 1090, 1148, 1200, 1246, 1288, 1325, 1387, 1436, 1473, 1500, 1518, 1528, 1532, 1530, 1524, 1514, 1501, 1485, 1467, 1447, 1338, 1227, 1127, 1041, 967.3, 904.6, 850.4, 803.2, 724.6, 661.8, 610.5, 567.7, 531.4, 499.8, 472.5, 448.3, 426.7, 407.4, 390, 374.1, 359.6, 346.4, 293.7, 256.2, 227.9, 205.7 }; 388 314 … … 390 316 391 317 name [37] = "G4_Mo"; 392 Znum [37] = 42;393 394 318 G4double e37[60] = { 40.18, 49.21, 56.82, 63.53, 69.59, 80.35, 89.84, 98.41, 106.3, 113.6, 120.5, 127, 140.2, 151.7, 162.1, 171.5, 180.1, 188, 195.4, 202.1, 214.3, 224.8, 233.8, 241.6, 248.3, 253.9, 258.7, 262.6, 265.7, 268.2, 270, 271.3, 272.1, 272.4, 268.7, 259.5, 248, 235.8, 224, 213.1, 203.1, 194.1, 178.9, 166.6, 156.5, 148.1, 141, 134.9, 129.5, 124.7, 120.4, 116.4, 112.6, 109.1, 105.8, 102.6, 89.8, 80.34, 73.15, 67.51 }; 395 319 … … 397 321 398 322 name [38] = "G4_MUSCLE_WITH_SUCROSE"; 399 Znum [38] = 0;400 401 323 G4double e38[60] = { 149.4, 183, 211.3, 236.2, 258.7, 298.3, 333.3, 364.8, 393.8, 420.8, 446, 469.8, 516.6, 557.2, 593.1, 625.2, 654, 680, 703.5, 724.8, 761.7, 792, 816.7, 836.5, 851.9, 863.6, 871.9, 877.4, 880.4, 881.2, 880.1, 877.3, 873.2, 867.9, 829.5, 781.9, 733.4, 688, 647.9, 612.8, 581.8, 554.2, 507.1, 468.4, 435.9, 408.3, 384.4, 363.5, 344.9, 328.4, 313.7, 300.3, 288.2, 277.2, 267, 257.7, 220.4, 193.5, 173, 156.9 }; 402 324 … … 404 326 405 327 name [39] = "G4_MUSCLE_WITHOUT_SUCROSE"; 406 Znum [39] = 0;407 408 328 G4double e39[60] = { 146.6, 179.5, 207.3, 231.8, 253.9, 292.9, 327.3, 358.4, 386.9, 413.5, 438.4, 461.9, 508.2, 548.4, 584, 615.8, 644.5, 670.4, 693.8, 715.1, 752, 782.3, 807.1, 827, 842.5, 854.3, 862.9, 868.5, 871.6, 872.6, 871.6, 869, 865, 859.8, 822, 774.9, 726.9, 682, 643, 609.2, 579.4, 552.9, 507.4, 469.6, 437.7, 410.1, 386.1, 365.1, 346.5, 329.9, 315, 301.6, 289.4, 278.3, 268.2, 258.8, 221.3, 194.3, 173.7, 157.5 }; 409 329 … … 411 331 412 332 name [40] = "G4_MUSCLE_SKELETAL_ICRP"; 413 Znum [40] = 0;414 415 333 G4double e40[60] = { 141.3, 173.1, 199.9, 223.5, 244.8, 282.5, 315.8, 345.8, 373.5, 399.2, 423.3, 446.1, 491.1, 530.2, 565, 596.1, 624.2, 649.7, 672.8, 693.8, 730.4, 760.6, 785.3, 805.3, 821.1, 833.1, 841.9, 847.9, 851.4, 852.6, 852, 849.7, 846.1, 841.2, 804.8, 758.9, 712.2, 668.5, 631.2, 599, 570.8, 545.6, 502.2, 465.8, 434.6, 407.5, 383.7, 362.8, 344.4, 327.9, 313.1, 299.8, 287.7, 276.7, 266.6, 257.3, 220, 193.2, 172.8, 156.7 }; 416 334 … … 418 336 419 337 name [41] = "G4_MUSCLE_STRIATED_ICRU"; 420 Znum [41] = 0;421 422 338 G4double e41[60] = { 141.7, 173.5, 200.4, 224, 245.4, 283.2, 316.5, 346.6, 374.3, 400, 424.2, 447, 492.1, 531.3, 566.1, 597.3, 625.4, 650.9, 674, 695.1, 731.6, 761.9, 786.7, 806.6, 822.4, 834.4, 843.3, 849.2, 852.6, 853.9, 853.2, 851, 847.3, 842.4, 805.8, 759.8, 713, 669.2, 632, 600.1, 572.1, 547.1, 504, 467.7, 436.5, 409.3, 385.3, 364.3, 345.7, 329.2, 314.4, 300.9, 288.8, 277.8, 267.6, 258.3, 220.8, 193.9, 173.4, 157.2 }; 423 339 … … 425 341 426 342 name [42] = "G4_N"; 427 Znum [42] = 7;428 429 343 G4double e42[60] = { 126.5, 155, 179, 200.1, 219.2, 253.1, 283, 310, 334.8, 357.9, 379.6, 400.2, 440.6, 475.8, 507, 535, 560.2, 583.1, 603.8, 622.7, 655.5, 682.7, 704.9, 722.9, 737.3, 748.4, 756.6, 762.3, 765.9, 767.5, 767.5, 766, 763.3, 759.4, 729.3, 689.8, 648.6, 609.1, 572.9, 540.4, 511.6, 486.2, 443.4, 408.8, 380.1, 356, 335.4, 317.2, 301.2, 286.8, 274.1, 262.6, 252.2, 242.7, 234, 225.9, 193.8, 170.5, 152.8, 138.8 }; 430 344 … … 432 346 433 347 name [43] = "G4_SODIUM_IODIDE"; 434 Znum [43] = 0;435 436 348 G4double e43[60] = { 41.1, 50.34, 58.12, 64.98, 71.19, 82.2, 91.9, 100.7, 108.7, 116.2, 123.3, 130, 143.4, 155.2, 165.8, 175.4, 184.2, 192.3, 199.7, 206.6, 219, 229.6, 238.9, 246.8, 253.5, 259.2, 264, 268, 271.1, 273.6, 275.4, 276.7, 277.4, 277.7, 273.7, 264.2, 252.3, 239.7, 227.6, 216.2, 205.9, 196.6, 180.7, 167.8, 157.3, 148.5, 141.1, 134.7, 129.1, 124.1, 119.7, 115.7, 111.9, 108.4, 105.1, 101.9, 88.79, 78.99, 71.48, 65.54 }; 437 349 … … 439 351 440 352 name [44] = "G4_Ne"; 441 Znum [44] = 10;442 443 353 G4double e44[60] = { 58.01, 71.05, 82.04, 91.73, 100.5, 116, 129.7, 142.1, 153.5, 164.1, 174, 183.5, 202.5, 219.3, 234.5, 248.3, 261, 272.8, 283.8, 294, 312.7, 329.2, 343.8, 356.9, 368.6, 379, 388.3, 396.5, 403.8, 410.2, 415.8, 420.7, 424.8, 428.4, 438.1, 437.9, 431.3, 420.8, 408.2, 394.6, 380.7, 367.1, 339, 313.8, 293.3, 277.2, 264.3, 252.6, 241.9, 232.2, 223.2, 215, 207.4, 200.4, 193.8, 187.7, 163, 144.6, 130.3, 118.9 }; 444 354 … … 446 356 447 357 name [45] = "G4_NYLON_6/6"; 448 Znum [45] = 0;449 450 358 G4double e45[60] = { 191, 233.9, 270.1, 302, 330.8, 377.8, 419.7, 457.5, 492.1, 523.4, 552.3, 579.2, 633, 678.5, 717.9, 752.9, 783.8, 811.1, 835.3, 856.8, 894.2, 925.4, 951, 971, 985.8, 996.3, 1003, 1007, 1008, 1006, 1003, 997.7, 991.2, 983.5, 933.5, 875.4, 817.5, 763.6, 715, 671.7, 633.5, 599.6, 542.9, 497.4, 460.4, 429.7, 403.7, 381, 361.2, 343.6, 327.9, 313.8, 301, 289.3, 278.6, 268.8, 229.5, 201.3, 179.8, 162.9 }; 451 359 … … 453 361 454 362 name [46] = "G4_O"; 455 Znum [46] = 8;456 457 363 G4double e46[60] = { 99.46, 121.8, 140.7, 157.3, 172.3, 198.9, 222.4, 243.6, 263.1, 281.3, 298.4, 314.5, 346.6, 374.7, 399.8, 422.4, 443, 461.9, 479.1, 495, 523.1, 547, 567.2, 584.4, 598.7, 610.6, 620.2, 628, 633.9, 638.3, 641.3, 643, 643.6, 643.3, 630.5, 606.7, 578.3, 549.1, 520.9, 494.6, 470.9, 449.7, 413.2, 383.1, 357.8, 336.3, 317.6, 301.1, 286.3, 273.2, 261.3, 250.5, 240.8, 231.9, 223.7, 216.1, 185.7, 163.7, 146.7, 133.4 }; 458 364 … … 460 366 461 367 name [47] = "G4_PARAFFIN"; 462 Znum [47] = 0;463 464 368 G4double e47[60] = { 228.8, 280.2, 323.5, 361.7, 396.2, 451.9, 501.6, 546.5, 587.6, 624.6, 658.6, 690.2, 753.4, 806.4, 852.1, 892.4, 927.9, 959.1, 986.3, 1010, 1052, 1086, 1114, 1135, 1150, 1160, 1166, 1168, 1166, 1163, 1157, 1149, 1140, 1129, 1064, 992.4, 922.6, 858.6, 801.5, 751.1, 706.8, 667.8, 601.8, 548.9, 506.2, 471.3, 442.2, 416.9, 394.9, 375.4, 358, 342.3, 328.2, 315.3, 303.4, 292.6, 249.3, 218.3, 194.8, 176.3 }; 465 369 … … 467 371 468 372 name [48] = "G4_Pb"; 469 Znum [48] = 82;470 471 373 G4double e48[60] = { 15.4, 18.86, 21.78, 24.35, 26.68, 30.81, 34.44, 37.73, 40.75, 43.57, 46.21, 48.71, 53.82, 58.34, 62.45, 66.21, 69.7, 72.94, 75.98, 78.85, 84.11, 88.84, 93.13, 97.02, 100.6, 103.8, 106.8, 109.5, 111.9, 114.1, 116.2, 118, 119.6, 121.1, 126.1, 128.1, 127.9, 126.3, 123.6, 120.4, 116.9, 113.3, 106.4, 99.98, 94.37, 89.5, 85.18, 81.37, 78.01, 75.05, 72.42, 70.08, 67.99, 66.12, 64.44, 62.92, 56.88, 52.22, 48.46, 45.34 }; 472 374 … … 474 376 475 377 name [49] = "G4_PHOTO_EMULSION"; 476 Znum [49] = 0;477 478 378 G4double e49[60] = { 61.33, 75.12, 86.74, 96.97, 106.2, 122.2, 136.3, 149.1, 160.8, 171.6, 181.6, 191.1, 210, 226.3, 240.6, 253.5, 265, 275.4, 284.8, 293.3, 308, 320.3, 330.3, 338.4, 344.7, 349.4, 352.8, 355.1, 356.4, 356.9, 356.6, 355.7, 354.3, 352.4, 338.9, 322.3, 305.5, 289.9, 275.7, 263, 251.7, 241.5, 224.4, 210.3, 198.3, 188, 179, 171, 163.9, 157.5, 151.6, 146.3, 141.3, 136.6, 132.1, 128, 110.6, 97.75, 87.92, 80.2 }; 479 379 … … 481 381 482 382 name [50] = "G4_PLASTIC_SC_VINYLTOLUENE"; 483 Znum [50] = 0;484 485 383 G4double e50[60] = { 190.1, 232.8, 268.8, 300.5, 329.2, 374.1, 414.4, 450.7, 483.9, 513.5, 540.4, 565.4, 616.5, 659.2, 696, 728.7, 757.6, 783, 805.3, 825.2, 860.1, 890.2, 915.4, 935.4, 950.4, 961.1, 968.2, 972.3, 973.8, 973, 970.2, 965.7, 959.9, 952.8, 906, 850.6, 795.1, 743.3, 696.4, 654.7, 617.9, 585.3, 530.7, 487.1, 451.3, 421.4, 395.9, 373.7, 354.4, 337.2, 321.9, 308.1, 295.7, 284.2, 273.8, 264.1, 225.7, 198.1, 177.1, 160.5 }; 486 384 … … 488 386 489 387 name [51] = "G4_POLYCARBONATE"; 490 Znum [51] = 0;491 492 388 G4double e51[60] = { 164.8, 201.8, 233, 260.5, 285.4, 324.6, 359.7, 391.4, 420.3, 446.2, 469.7, 491.7, 536.5, 574.3, 607.1, 636.2, 662.2, 685.1, 705.4, 723.6, 755.9, 783.9, 807.7, 826.9, 841.7, 852.8, 860.8, 866, 868.8, 869.6, 868.6, 866, 862.1, 857.1, 820.5, 774.5, 727.2, 682.2, 641.1, 604.1, 571.2, 542, 492.3, 452.1, 419.1, 391.8, 368.6, 348.4, 330.7, 314.9, 300.8, 288.1, 276.7, 266.1, 256.5, 247.6, 212, 186.3, 166.8, 151.3 }; 493 389 … … 495 391 496 392 name [52] = "G4_POLYETHYLENE"; 497 Znum [52] = 0;498 499 393 G4double e52[60] = { 184.9, 226.5, 261.5, 292.4, 320.3, 369.9, 413.5, 453, 489.3, 523, 554.8, 584.8, 643.9, 695.3, 740.8, 781.4, 817.9, 850.9, 880.6, 907.5, 953.7, 990.9, 1021, 1044, 1061, 1073, 1081, 1084, 1085, 1083, 1078, 1072, 1064, 1054, 994.1, 927.8, 865, 808.9, 760.1, 717.9, 681.4, 649.7, 591.2, 541, 499.2, 464.9, 436.3, 411.4, 389.8, 370.6, 353.4, 338.1, 324.2, 311.4, 299.8, 289.1, 246.4, 215.9, 192.7, 174.4 }; 500 394 … … 502 396 503 397 name [53] = "G4_POLYETHYLENE_TEREPHTHALATE_MYLAR"; 504 Znum [53] = 0;505 506 398 G4double e53[60] = { 150.9, 184.9, 213.5, 238.7, 261.4, 297.8, 330.2, 359.6, 386.4, 410.5, 432.5, 453, 494.9, 530.3, 561.2, 588.8, 613.4, 635.3, 654.7, 672.3, 703.4, 730.5, 753.5, 772.3, 787, 798.3, 806.6, 812.4, 816, 817.6, 817.4, 815.8, 812.9, 808.9, 777.6, 736.5, 693.4, 651.9, 613.6, 579.1, 548.2, 520.6, 472.9, 434, 402.2, 376.1, 354.3, 335, 318.2, 303.2, 289.8, 277.7, 266.7, 256.6, 247.4, 238.9, 204.8, 180.2, 161.4, 146.5 }; 507 399 … … 509 401 510 402 name [54] = "G4_PLEXIGLASS"; 511 Znum [54] = 0;512 513 403 G4double e54[60] = { 174.9, 214.2, 247.4, 276.6, 303, 345.9, 384.1, 418.7, 450.4, 479, 505.2, 529.8, 579.1, 620.8, 657.1, 689.3, 717.9, 743.2, 765.7, 785.8, 820.8, 850.5, 875, 894.5, 909.3, 920.1, 927.4, 931.9, 933.9, 933.7, 931.6, 928, 922.9, 916.8, 874.4, 823.2, 771.3, 722.4, 676.2, 634, 596.2, 562.8, 507.2, 463.4, 428.5, 400.2, 376.7, 356.1, 338, 321.9, 307.5, 294.5, 282.8, 272, 262.1, 253, 216.6, 190.4, 170.3, 154.5 }; 514 404 … … 516 406 517 407 name [55] = "G4_POLYPROPYLENE"; 518 Znum [55] = 0;519 520 408 G4double e55[60] = { 197.6, 242, 279.4, 312.4, 342.2, 395.1, 441.8, 483.9, 522.7, 558.8, 592.7, 624.8, 687.3, 741.3, 789, 831.4, 869.4, 903.6, 934.3, 962, 1009, 1048, 1078, 1101, 1119, 1132, 1140, 1145, 1146, 1145, 1141, 1135, 1128, 1119, 1060, 991.7, 924.3, 862, 806.1, 756.5, 712.8, 674.2, 605.4, 548.6, 503.3, 467.5, 438.7, 413.6, 391.8, 372.4, 355.2, 339.7, 325.7, 312.9, 301.1, 290.4, 247.5, 216.8, 193.5, 175.1 }; 521 409 … … 523 411 524 412 name [56] = "G4_POLYSTYRENE"; 525 Znum [56] = 0;526 527 413 G4double e56[60] = { 186, 227.8, 263.1, 294.1, 322.2, 372.1, 416, 455.7, 492.2, 526.2, 558.1, 588.3, 645.3, 693.8, 735.8, 772.4, 804.5, 832.6, 857.2, 878.7, 913.5, 939.2, 957.2, 969, 975.6, 978, 976.8, 972.8, 966.5, 958.4, 948.9, 938.3, 926.9, 914.9, 851.3, 789.6, 734.2, 685.4, 642.9, 605.7, 573, 543.9, 499.5, 465.2, 435.8, 409.1, 384.6, 363.2, 344.6, 328.1, 313.3, 300, 288, 277, 266.8, 257.5, 220.4, 193.6, 173.2, 157 }; 528 414 529 415 for(i=0; i<60; i++) {e[56][i]=e56[i]*MeV*cm2/g;} 530 416 531 name [57] = "G4_POLYTETRAFLUOROETHYLENE"; 532 Znum [57] = 0; 533 417 name [57] = "G4_TEFLON"; 534 418 G4double e57[60] = { 83.27, 102, 117.8, 131.7, 144.2, 165, 183.4, 200.1, 215.3, 229.2, 242, 254, 278.7, 300, 319, 336.2, 351.9, 366.1, 379.2, 391.2, 413.1, 432.7, 450, 465.1, 478, 489.1, 498.5, 506.4, 513, 518.4, 522.7, 526, 528.4, 530.1, 528.6, 516.7, 499.4, 479.6, 460.4, 442.3, 425.4, 409.6, 381.2, 356.4, 334.6, 315.4, 298.3, 283.1, 269.6, 257.4, 246.5, 236.5, 227.4, 219.1, 211.5, 204.4, 175.9, 155.2, 139.3, 126.7 }; 535 419 … … 537 421 538 422 name [58] = "G4_POLYVINYL_CHLORIDE"; 539 Znum [58] = 0;540 541 423 G4double e58[60] = { 140.2, 171.7, 198.3, 221.7, 242.8, 277.9, 309, 337.2, 363, 386.4, 408.1, 428.4, 468.9, 503.4, 533.6, 560.3, 584.1, 605.3, 624.1, 640.9, 670.1, 694.5, 714.3, 729.8, 741.4, 749.6, 755, 757.9, 758.6, 757.6, 755, 751, 746, 740, 701.3, 656.7, 612.9, 572.6, 538.7, 509.8, 484.7, 462.4, 424.2, 392.4, 365.3, 341.8, 321.1, 302.9, 287.3, 273.6, 261.3, 250.1, 240.1, 231.1, 222.7, 215, 184.5, 162.6, 145.9, 132.6 }; 542 424 … … 544 426 545 427 name [59] = "G4_PROPANE"; 546 Znum [59] = 0;547 548 428 G4double e59[60] = { 194.5, 234.7, 268.4, 298, 324.7, 372, 413.6, 451.2, 485.8, 518, 548.2, 576.8, 642.6, 702.2, 756.9, 808, 855.9, 901.2, 944.4, 985.6, 1063, 1135, 1203, 1267, 1327, 1385, 1440, 1492, 1543, 1592, 1639, 1684, 1728, 1770, 1964, 2131, 2277, 2404, 2516, 2613, 2698, 2771, 2887, 2969, 3022, 3053, 3065, 3061, 3046, 3021, 2990, 2953, 2912, 2868, 2822, 2775, 2564, 2372, 2191, 2022 }; 549 429 … … 551 431 552 432 name [60] = "G4_Pt"; 553 Znum [60] = 78;554 555 433 G4double e60[60] = { 30.79, 33.73, 36.43, 38.95, 41.31, 43.55, 48.11, 52.16, 55.83, 59.2, 62.32, 65.23, 67.95, 70.51, 75.22, 79.46, 83.3, 86.79, 89.97, 92.87, 95.51, 97.92, 100.1, 102.1, 103.9, 105.5, 107, 108.3, 112.7, 114.5, 114.4, 113, 110.8, 108.1, 105.3, 102.4, 96.92, 92.12, 87.91, 84.22, 80.97, 78.11, 75.56, 73.26, 71.17, 69.26, 67.5, 65.87, 64.36, 62.94, 57, 52.39, 48.67, 45.57, 42.94, 40.66, 38.67, 36.9, 33.91, 31.45 }; 556 434 … … 558 436 559 437 name [61] = "G4_Si"; 560 Znum [61] = 14;561 562 438 G4double e61[60] = { 105, 128.6, 148.5, 166, 181.8, 210, 234.8, 257.2, 277.8, 296.9, 315, 332, 364.6, 392.5, 416.7, 437.8, 456.3, 472.5, 486.6, 498.9, 518.4, 532.3, 541.6, 547, 549.2, 549, 546.8, 543, 538, 532.2, 525.7, 518.8, 511.7, 504.4, 468.7, 437.3, 410.7, 388.4, 369.4, 353, 338.7, 325.9, 304.1, 285.9, 270.3, 256.7, 245.2, 235.1, 225.9, 217.2, 209, 201.1, 193.6, 187, 180.9, 175.3, 152.3, 135.4, 122.2, 111.7 }; 563 439 564 440 for(i=0; i<60; i++) {e[61][i]=e61[i]*MeV*cm2/g;} 565 441 566 name [62] = "G4_SiO2"; 567 Znum [62] = 0; 568 442 name [62] = "G4_SILICON_DIOXIDE"; 569 443 G4double e62[60] = { 85.64, 104.9, 121.1, 135.4, 148.3, 171.3, 191.5, 209.8, 226.6, 242.2, 256.9, 270.8, 298.1, 322, 343.1, 362.1, 379.3, 394.9, 409.1, 422.1, 444.8, 463.8, 479.7, 492.8, 503.6, 512.3, 519.2, 524.5, 528.5, 531.2, 532.9, 533.7, 533.6, 532.9, 521.9, 503.9, 483.5, 462.8, 442.9, 424.2, 406.7, 390.6, 358.9, 330.8, 307.6, 288.9, 273.6, 259.9, 247.8, 236.9, 227.1, 218.2, 210.1, 202.7, 195.9, 189.7, 164.2, 145.5, 131.1, 119.6 }; 570 444 … … 572 446 573 447 name [63] = "G4_STILBENE"; 574 Znum [63] = 0;575 576 448 G4double e63[60] = { 179.2, 219.5, 253.4, 283.3, 310.4, 352.2, 389.8, 423.8, 454.7, 482.3, 507.2, 530.3, 577.9, 617.7, 652.1, 682.6, 709.7, 733.5, 754.4, 773, 806.1, 835.1, 859.5, 879.2, 894.2, 905.1, 912.7, 917.4, 919.6, 919.6, 917.7, 914.2, 909.3, 903.3, 861.4, 810.7, 759.2, 710.8, 667.1, 628.3, 593.9, 563.4, 511.8, 470.2, 435.9, 407.2, 382.8, 361.4, 342.9, 326.4, 311.6, 298.4, 286.4, 275.4, 265.3, 256.1, 219, 192.4, 172.1, 156.1 }; 577 449 … … 579 451 580 452 name [64] = "G4_Ti"; 581 Znum [64] = 22;582 583 453 G4double e64[60] = { 60.88, 74.56, 86.1, 96.26, 105.4, 121.8, 136.1, 149.1, 161.1, 172.2, 182.6, 192.5, 212.3, 229.6, 245.1, 259.1, 271.8, 283.5, 294.2, 304.1, 321.6, 336.5, 349.1, 359.8, 368.7, 376, 382, 386.7, 390.2, 392.7, 394.4, 395.2, 395.3, 394.8, 385.4, 369.3, 351, 332.6, 315.4, 299.6, 285.5, 272.8, 251.3, 233.9, 219.6, 207.6, 197.4, 188.7, 181, 174.1, 167.9, 162.2, 157, 152.2, 147.7, 143.5, 126, 112.5, 101.7, 93.07 }; 584 454 … … 586 456 587 457 name [65] = "G4_Sn"; 588 Znum [65] = 50;589 590 458 G4double e65[60] = { 32.4, 39.68, 45.82, 51.23, 56.12, 64.8, 72.45, 79.36, 85.72, 91.64, 97.2, 102.5, 113.1, 122.4, 130.8, 138.5, 145.5, 151.9, 157.9, 163.4, 173.4, 182, 189.5, 196, 201.6, 206.4, 210.4, 213.8, 216.5, 218.7, 220.4, 221.6, 222.4, 222.9, 220.7, 213.8, 204.9, 195.4, 186, 177.3, 169.4, 162.3, 150.1, 140.3, 132.2, 125.5, 119.7, 114.7, 110.1, 106.1, 102.5, 99.14, 96.12, 93.34, 90.77, 88.4, 78.69, 71.47, 65.7, 60.79 }; 591 459 … … 593 461 594 462 name [66] = "G4_TISSUE-METHANE"; 595 Znum [66] = 0;596 597 463 G4double e66[60] = { 174.5, 213.8, 246.8, 276, 302.3, 349.1, 390.3, 427.6, 461.8, 493.7, 523.6, 552, 607.8, 656.2, 699.1, 737.4, 771.9, 803, 831.1, 856.5, 900.2, 935.6, 963.8, 985.9, 1003, 1015, 1022, 1027, 1028, 1027, 1023, 1018, 1011, 1002, 947.8, 885.5, 824.9, 769.7, 720.9, 678.2, 641, 608.6, 553.2, 507.9, 470.5, 439.1, 412.4, 389, 368.6, 350.5, 334.4, 319.8, 306.6, 294.6, 283.6, 273.5, 233.2, 204.4, 182.5, 165.2 }; 598 464 … … 600 466 601 467 name [67] = "G4_TISSUE-PROPANE"; 602 Znum [67] = 0;603 604 468 G4double e67[60] = { 169.9, 208.1, 240.3, 268.6, 294.3, 339.8, 379.9, 416.2, 449.5, 480.6, 509.7, 537.3, 591.5, 638.4, 679.9, 716.9, 750.2, 780.2, 807.4, 832, 874.4, 909.1, 937.1, 959.3, 976.6, 989.5, 998.7, 1005, 1008, 1008, 1006, 1003, 998, 991.7, 946.9, 891.9, 836, 783.4, 735.7, 693.2, 655.4, 622, 563.5, 515.3, 475.8, 443.4, 416.2, 392.6, 371.9, 353.6, 337.3, 322.5, 309.3, 297.1, 286, 275.8, 235.1, 206, 183.9, 166.5 }; 605 469 … … 607 471 608 472 name [68] = "G4_TOLUENE"; 609 Znum [68] = 0;610 611 473 G4double e68[60] = { 191.6, 234.7, 271, 302.9, 331.9, 377.2, 417.8, 454.5, 488, 517.9, 545.1, 570.4, 621.9, 665, 702.2, 735.2, 764.3, 790, 812.4, 832.5, 867.7, 897.9, 923.2, 943.3, 958.3, 969, 976, 980, 981.4, 980.4, 977.5, 972.9, 966.9, 959.8, 912.2, 856.2, 800.1, 747.8, 700.6, 658.5, 621.4, 588.5, 535.1, 492.8, 457.8, 427.9, 401.8, 379.1, 359.4, 341.9, 326.3, 312.3, 299.6, 287.9, 277.3, 267.5, 228.5, 200.4, 179.1, 162.3 }; 612 474 … … 614 476 615 477 name [69] = "G4_U"; 616 Znum [69] = 92;617 618 478 G4double e69[60] = { 18.38, 22.51, 25.99, 29.06, 31.83, 36.75, 41.09, 45.01, 48.62, 51.98, 55.13, 58.11, 64.19, 69.57, 74.44, 78.9, 83.02, 86.84, 90.42, 93.78, 99.92, 105.4, 110.3, 114.8, 118.8, 122.4, 125.7, 128.6, 131.2, 133.5, 135.6, 137.4, 139, 140.4, 144.4, 144.8, 142.7, 139.1, 134.5, 129.6, 124.2, 118.8, 108.7, 100, 92.78, 86.72, 81.64, 77.35, 73.71, 70.6, 67.92, 65.59, 63.56, 61.77, 60.19, 58.78, 53.33, 49.08, 45.62, 42.73 }; 619 479 … … 621 481 622 482 name [70] = "G4_W"; 623 Znum [70] = 74;624 625 483 G4double e70[60] = { 14.97, 18.34, 21.17, 23.67, 25.93, 29.94, 33.47, 36.67, 39.61, 42.34, 44.91, 47.34, 52.3, 56.7, 60.68, 64.33, 67.7, 70.84, 73.78, 76.55, 81.61, 86.15, 90.24, 93.95, 97.3, 100.3, 103.1, 105.6, 107.8, 109.9, 111.7, 113.3, 114.7, 116, 120, 121.2, 120.5, 118.5, 115.9, 112.9, 109.8, 106.7, 100.2, 94.14, 89.08, 85, 81.68, 78.78, 76.2, 73.88, 71.78, 69.86, 68.09, 66.45, 64.93, 63.5, 57.52, 52.9, 49.15, 46.04 }; 626 484 … … 628 486 629 487 name [71] = "G4_WATER"; 630 Znum [71] = 0;631 632 488 G4double e71[60] = { 133.7, 163.8, 189.1, 211.4, 231.6, 267.5, 299, 327.6, 353.8, 378.2, 401.2, 422.9, 466, 503.6, 537.2, 567.3, 594.6, 619.5, 642.1, 662.8, 698.9, 729, 753.8, 774, 790.1, 802.6, 811.9, 818.3, 822.3, 824.1, 823.9, 822.2, 819, 814.5, 780.1, 736, 695.9, 660.4, 628.6, 599.9, 573.7, 549.7, 507.5, 471.4, 440.1, 412.8, 388.8, 367.6, 348.9, 332.2, 317.2, 303.7, 291.4, 280.3, 270, 260.6, 222.8, 195.5, 174.8, 158.5 }; 633 489 … … 635 491 636 492 name [72] = "G4_WATER_VAPOR"; 637 Znum [72] = 0;638 639 493 G4double e72[60] = { 152.2, 186.5, 215.3, 240.7, 263.7, 304.5, 340.4, 372.9, 402.8, 430.6, 456.7, 481.4, 530.5, 573.2, 611.3, 645.4, 676.4, 704.4, 730, 753.3, 793.8, 827.4, 855, 877.2, 894.8, 908.2, 918.1, 924.7, 928.5, 929.9, 929.1, 926.5, 922.3, 916.9, 876.3, 825.9, 775.3, 728.5, 686.8, 650.1, 618, 589.9, 536.1, 489.2, 450.8, 420.2, 395.5, 373.8, 354.6, 337.5, 322.2, 308.3, 295.8, 284.4, 273.9, 264.3, 225.7, 198, 176.9, 160.4 }; 640 494 … … 642 496 643 497 name [73] = "G4_Xe"; 644 Znum [73] = 54;645 646 498 G4double e73[60] = { 38.1, 46.67, 53.88, 60.24, 65.99, 76.2, 85.2, 93.33, 100.8, 107.8, 114.3, 120.5, 132.8, 143.6, 153.2, 161.8, 169.6, 176.7, 183.2, 189.1, 199.4, 208, 215, 220.7, 225.2, 228.7, 231.2, 232.9, 233.9, 234.3, 234.1, 233.5, 232.5, 231.1, 221.3, 209.3, 197.4, 186.5, 177, 168.6, 161.3, 155, 144.4, 135.9, 128.8, 122.8, 117.5, 112.7, 108.4, 104.5, 101, 97.75, 94.8, 92.09, 89.6, 87.29, 77.8, 70.52, 64.84, 60.13 }; 647 499 -
trunk/source/processes/electromagnetic/standard/src/G4PhotoElectricEffect.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PhotoElectricEffect.cc,v 1. 37 2006/09/14 10:27:19 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4PhotoElectricEffect.cc,v 1.42 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 80 80 G4ProcessType type):G4VEmProcess (processName, type), 81 81 isInitialised(false) 82 {} 82 { 83 SetProcessSubType(fPhotoElectricEffect); 84 } 83 85 84 86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 86 88 G4PhotoElectricEffect::~G4PhotoElectricEffect() 87 89 {} 90 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 93 G4bool G4PhotoElectricEffect::IsApplicable(const G4ParticleDefinition& p) 94 { 95 return (&p == G4Gamma::Gamma()); 96 } 88 97 89 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 95 104 SetBuildTableFlag(false); 96 105 SetSecondaryParticle(G4Electron::Electron()); 97 if(!Model()) SetModel(new G4PEEffectModel );106 if(!Model()) SetModel(new G4PEEffectModel()); 98 107 Model()->SetLowEnergyLimit(MinKinEnergy()); 99 108 Model()->SetHighEnergyLimit(MaxKinEnergy()); … … 105 114 106 115 void G4PhotoElectricEffect::PrintInfo() 107 { 108 G4cout 109 << " Total cross sections from Sandia parametrisation. " 110 << "\n Sampling according " << Model()->GetName() << " model" 111 << G4endl; 112 } 116 {} 113 117 114 118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/src/G4PolarizedComptonScattering.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4PolarizedComptonScattering.cc,v 1.1 6 2006/06/29 19:53:30 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4PolarizedComptonScattering.cc,v 1.18 2008/10/15 17:53:44 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 50 50 using namespace std; 51 51 52 G4PolarizedComptonScattering::G4PolarizedComptonScattering( 53 const G4String& processName) 54 : G4ComptonScattering52 (processName) 52 G4PolarizedComptonScattering::G4PolarizedComptonScattering(const G4String& pname) 53 : G4ComptonScattering52 (pname) 55 54 { } 56 55 -
trunk/source/processes/electromagnetic/standard/src/G4UniversalFluctuation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4UniversalFluctuation.cc,v 1.1 5 2007/07/13 11:01:50vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4UniversalFluctuation.cc,v 1.17 2009/02/19 11:26:01 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 107 107 108 108 G4double G4UniversalFluctuation::SampleFluctuations(const G4Material* material, 109 const G4DynamicParticle* dp,110 G4double& tmax,111 G4double& length,112 G4double& meanLoss)109 const G4DynamicParticle* dp, 110 G4double& tmax, 111 G4double& length, 112 G4double& meanLoss) 113 113 { 114 114 // Calculate actual loss from the mean loss. … … 305 305 } 306 306 307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 308 309 void 310 G4UniversalFluctuation::SetParticleAndCharge(const G4ParticleDefinition* part, 311 G4double q2) 312 { 313 if(part != particle) { 314 particle = part; 315 particleMass = part->GetPDGMass(); 316 } 317 chargeSquare = q2; 318 } 319 320 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4UrbanMscModel.cc,v 1. 77.2.2 2008/04/25 00:34:55vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4UrbanMscModel.cc,v 1.86 2008/10/29 14:15:30 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 178 178 using namespace std; 179 179 180 G4UrbanMscModel::G4UrbanMscModel(G4double m_facrange, G4double m_dtrl, 181 G4double m_lambdalimit, 182 G4double m_facgeom,G4double m_skin, 183 G4bool m_samplez, G4MscStepLimitType m_stepAlg, 184 const G4String& nam) 185 : G4VEmModel(nam), 186 dtrl(m_dtrl), 187 lambdalimit(m_lambdalimit), 188 facrange(m_facrange), 189 facgeom(m_facgeom), 190 skin(m_skin), 191 steppingAlgorithm(m_stepAlg), 192 samplez(m_samplez), 180 G4UrbanMscModel::G4UrbanMscModel(const G4String& nam) 181 : G4VMscModel(nam), 193 182 isInitialized(false) 194 183 { … … 202 191 tlimitminfix = 1.e-6*mm; 203 192 stepmin = tlimitminfix; 204 skindepth = skin*stepmin;205 193 smallstep = 1.e10; 206 194 currentRange = 0. ; … … 213 201 geommin = 1.e-3*mm; 214 202 geomlimit = geombig; 215 facsafety = 0.25;216 203 presafety = 0.*mm; 217 204 Zeff = 1.; … … 396 383 G4double eKineticEnergy = KineticEnergy; 397 384 398 if((particle->GetParticleName() != "e-") && 399 (particle->GetParticleName() != "e+") ) 385 if(mass > electron_mass_c2) 400 386 { 401 G4double TAU = KineticEnergy/mass ;402 G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;403 G4double w = c-2. ;404 G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;405 eKineticEnergy = electron_mass_c2*tau ;387 G4double TAU = KineticEnergy/mass ; 388 G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ; 389 G4double w = c-2. ; 390 G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ; 391 eKineticEnergy = electron_mass_c2*tau ; 406 392 } 407 393 … … 504 490 { 505 491 tPathLength = currentMinimalStep; 506 G4int stepNumber = track.GetCurrentStepNumber();507 492 const G4DynamicParticle* dp = track.GetDynamicParticle(); 508 509 if(stepNumber == 1) { 493 G4StepPoint* sp = track.GetStep()->GetPreStepPoint(); 494 G4StepStatus stepStatus = sp->GetStepStatus(); 495 496 if(stepStatus == fUndefined) { 510 497 inside = false; 511 498 insideskin = false; … … 527 514 if(tPathLength > currentRange) tPathLength = currentRange; 528 515 529 G4StepPoint* sp = track.GetStep()->GetPreStepPoint();530 516 presafety = sp->GetSafety(); 531 517 … … 541 527 } 542 528 543 G4StepStatus stepStatus = sp->GetStepStatus();544 545 529 // standard version 546 530 // … … 560 544 insideskin = false; 561 545 562 if((stepStatus == fGeomBoundary) || (step Number == 1))546 if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined)) 563 547 { 564 if(step Number == 1) smallstep = 1.e10;548 if(stepStatus == fUndefined) smallstep = 1.e10; 565 549 else smallstep = 1.; 566 550 … … 660 644 } 661 645 662 if((stepStatus == fGeomBoundary) || (step Number == 1))646 if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined)) 663 647 { 664 648 // facrange scaling in lambda … … 870 854 { 871 855 G4double kineticEnergy = dynParticle->GetKineticEnergy(); 872 if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix)) return; 856 if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix) || 857 (tPathLength/tausmall < lambda0) ) return; 873 858 874 859 G4double cth = SampleCosineTheta(tPathLength,kineticEnergy); 875 860 // protection against 'bad' cth values 876 if( cth > 1.) cth = 1.;877 if(cth < -1.) cth = -1.; 861 if(abs(cth) > 1.) return; 862 878 863 G4double sth = sqrt((1.0 - cth)*(1.0 + cth)); 879 864 G4double phi = twopi*G4UniformRand(); -
trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel90.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4UrbanMscModel90.cc,v 1.1 .2.2 2008/04/25 00:34:55vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4UrbanMscModel90.cc,v 1.10 2008/10/29 14:15:30 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 69 69 using namespace std; 70 70 71 G4UrbanMscModel90::G4UrbanMscModel90(G4double m_facrange, G4double m_dtrl, 72 G4double m_lambdalimit, 73 G4double m_facgeom,G4double m_skin, 74 G4bool m_samplez, G4MscStepLimitType m_stepAlg, 75 const G4String& nam) 76 : G4VEmModel(nam), 77 dtrl(m_dtrl), 78 lambdalimit(m_lambdalimit), 79 facrange(m_facrange), 80 facgeom(m_facgeom), 81 skin(m_skin), 82 steppingAlgorithm(m_stepAlg), 83 samplez(m_samplez), 71 G4UrbanMscModel90::G4UrbanMscModel90(const G4String& nam) 72 : G4VMscModel(nam), 84 73 isInitialized(false) 85 74 { … … 90 79 tlimitminfix = 1.e-6*mm; 91 80 stepmin = tlimitminfix; 92 skindepth = skin*stepmin;93 81 smallstep = 1.e10; 94 82 currentRange = 0. ; … … 101 89 geommin = 1.e-3*mm; 102 90 geomlimit = geombig; 103 facsafety = 0.25;104 91 presafety = 0.*mm; 105 92 Zeff = 1.; … … 126 113 SetParticle(p); 127 114 128 if (pParticleChange) 115 if (pParticleChange) { 129 116 fParticleChange = reinterpret_cast<G4ParticleChangeForMSC*>(pParticleChange); 130 else117 } else { 131 118 fParticleChange = new G4ParticleChangeForMSC(); 132 119 } 133 120 safetyHelper = G4TransportationManager::GetTransportationManager() 134 121 ->GetSafetyHelper(); … … 283 270 G4double eKineticEnergy = KineticEnergy; 284 271 285 if((particle->GetParticleName() != "e-") && 286 (particle->GetParticleName() != "e+") ) 272 if(mass > electron_mass_c2) 287 273 { 288 G4double TAU = KineticEnergy/mass ;289 G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;290 G4double w = c-2. ;291 G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;292 eKineticEnergy = electron_mass_c2*tau ;274 G4double TAU = KineticEnergy/mass ; 275 G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ; 276 G4double w = c-2. ; 277 G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ; 278 eKineticEnergy = electron_mass_c2*tau ; 293 279 } 294 280 … … 391 377 { 392 378 tPathLength = currentMinimalStep; 393 G4int stepNumber = track.GetCurrentStepNumber();394 379 const G4DynamicParticle* dp = track.GetDynamicParticle(); 395 396 if(stepNumber == 1) { 380 G4StepPoint* sp = track.GetStep()->GetPreStepPoint(); 381 G4StepStatus stepStatus = sp->GetStepStatus(); 382 383 if(stepStatus == fUndefined) { 397 384 inside = false; 398 385 insideskin = false; … … 414 401 if(tPathLength > currentRange) tPathLength = currentRange; 415 402 416 G4StepPoint* sp = track.GetStep()->GetPreStepPoint();417 403 presafety = sp->GetSafety(); 418 419 //G4cout << "G4UrbanMscModel90::ComputeTruePathLengthLimit tPathLength= "420 //<<tPathLength<<" safety= " << presafety421 //<< " range= " <<currentRange<<G4endl;422 404 /* 405 G4cout << "G4UrbanMscModel90::ComputeTruePathLengthLimit tPathLength= " 406 <<tPathLength<<" safety= " << presafety 407 << " range= " <<currentRange<<G4endl; 408 */ 423 409 // far from geometry boundary 424 410 if(currentRange < presafety) … … 427 413 return tPathLength; 428 414 } 429 430 G4StepStatus stepStatus = sp->GetStepStatus();431 415 432 416 // standard version … … 447 431 insideskin = false; 448 432 449 if((stepStatus == fGeomBoundary) || (step Number == 1))433 if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined)) 450 434 { 451 435 452 if(step Number == 1) smallstep = 1.e10;436 if(stepStatus == fUndefined) smallstep = 1.e10; 453 437 else smallstep = 1.; 454 438 … … 547 531 } 548 532 549 if((stepStatus == fGeomBoundary) || (step Number == 1))533 if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined)) 550 534 { 551 535 // facrange scaling in lambda … … 584 568 // G4cout << "tPathLength= " << tPathLength << " geomlimit= " << geomlimit 585 569 // << " currentMinimalStep= " << currentMinimalStep << G4endl; 586 587 570 return tPathLength ; 588 571 } … … 755 738 void G4UrbanMscModel90::SampleScattering(const G4DynamicParticle* dynParticle, 756 739 G4double safety) 757 758 759 760 740 { 761 741 G4double kineticEnergy = dynParticle->GetKineticEnergy(); 762 if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix)) return; 742 if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix) || 743 (tPathLength/tausmall < lambda0) ) return; 763 744 764 745 G4double cth = SampleCosineTheta(tPathLength,kineticEnergy); 765 746 // protection against 'bad' cth values 766 if(cth > 1.) cth = 1.; 767 if(cth < -1.) cth = -1.; 747 if(std::abs(cth) > 1.) return; 768 748 769 749 G4double sth = sqrt((1.0 - cth)*(1.0 + cth)); -
trunk/source/processes/electromagnetic/standard/src/G4WaterStopping.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4WaterStopping.cc,v 1. 2 2006/06/29 19:53:40gunter Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4WaterStopping.cc,v 1.11 2008/12/18 13:01:38 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 29 29 //--------------------------------------------------------------------------- … … 48 48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 49 49 50 G4WaterStopping::G4WaterStopping(G4EmCorrections* corr )50 G4WaterStopping::G4WaterStopping(G4EmCorrections* corr, G4bool splineFlag) 51 51 { 52 spline = splineFlag; 52 53 Initialise(corr); 53 54 } … … 56 57 57 58 G4WaterStopping::~G4WaterStopping() 58 { 59 int n = dedx.size(); 60 for(int i=0; i<n; i++) {delete dedx[i];} 61 } 59 {} 62 60 63 61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 66 64 { 67 65 G4double res = 0.0; 66 if(iz < 3 || iz > 18) return res; 68 67 G4bool b; 69 G4int idx = 0; 70 for(; idx<8; idx++) { 71 if(iz == Z[idx]) { 72 res = (dedx[idx])->GetValue(energy, b); 73 break; 74 } 68 G4int idx = iz - 3; 69 G4double scaledEnergy = energy/A[idx]; 70 G4double emin = 0.025*MeV; 71 if(scaledEnergy < emin) { 72 res = (dedx[idx])->GetValue(emin, b)*std::sqrt(scaledEnergy/emin); 73 } else { 74 res = (dedx[idx])->GetValue(scaledEnergy, b); 75 75 } 76 76 return res; 77 } 77 } 78 79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 80 81 void G4WaterStopping::AddData(G4double* energy, G4double* stoppower, 82 G4double factor) 83 { 84 G4LPhysicsFreeVector* pv = new G4LPhysicsFreeVector(53,energy[0],energy[52]); 85 pv->SetSpline(spline); 86 dedx.push_back(pv); 87 for(G4int i=0;i<53;i++) { 88 pv->PutValues(i,energy[i],stoppower[i]*factor); 89 } 90 } 91 92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 78 93 79 94 void G4WaterStopping::Initialise(G4EmCorrections* corr) … … 81 96 G4int i; 82 97 //..List of ions 83 G4int zz[ 8] = {3, 4, 5, 6, 7, 8, 9, 10};84 G4int aa[ 8] = {7, 9, 11, 12, 14, 16, 19, 20};85 86 for(i=0; i< 8; i++) {98 G4int zz[16] = {3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,17,18}; 99 G4int aa[16] = {7, 9, 11, 12, 14, 16, 19, 20, 23, 24, 27, 28,31,32, 35,40}; 100 // G4double A_Ion[16] = {6.941,9.0122,10.811,12.011,14.007,15.999,18.998,20.180,22.990,24.305,26.982,28.086,30.974,32.065,35.453,39.948}; 101 for(i=0; i<16; i++) { 87 102 Z[i] = zz[i]; 88 A[i] = aa[i];103 A[i] = G4double(aa[i]); 89 104 } 90 105 //..Reduced energies 91 G4double E[53] = {0.025,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.15,0.2,0.25,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.5,2,2.5,3,4,5,6,7,8,9,10,15,20,25,30,40,50,60,70,80,90,100,150,200,250 92 ,300,400,500,600,700,800,900,1000}; 106 G4double E[53] = {0.025,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.15,0.2,0.25,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.5,2,2.5,3,4,5,6,7,8,9,10,15,20,25,30,40,50,60,70,80,90,100,150,200,250,300,400,500,600,700,800,900,1000}; 93 107 for(i=0; i<53; i++) {E[i] *= MeV;} 94 108 95 //..Li 96 G4double Li[53] = {2.626,2.84,3.191,3.461,3.665,3.817,3.927,4.004,4.056,4.102,3.998,3.853,3.702,3.413,3.158,2.934,2.739,2.567,2.415,2.28,1.782,1.465,1.247,1.087,0.8706,0.7299,0.631,0.5575,0.5005,0.455,0.4178,0.3004,0.2376,0.1981,0.1708,0.1354,0.1132,0.09803,0.08692,0.07842,0.07171,0.06627,0.0495,0.04085,0.03557,0.03203,0.0276,0.02498,0.02327,0.0221,0.02126,0.02064,0.02016}; 97 G4LPhysicsFreeVector* pv = new G4LPhysicsFreeVector(53,E[0],E[52]); 98 dedx.push_back(pv); 99 for(i=0; i<53; i++) { pv->PutValues(i,E[i],Li[i]*1000.*MeV/cm); } 109 G4double factor = 1000.*MeV/cm; 100 110 101 //..Be 102 G4double Be[53] = {3.272,3.565,4.061,4.463,4.79,5.052,5.258,5.419,5.542,5.803,5.787,5.675,5.529,5.215,4.912,4.634,4.381,4.152,3.944,3.756,3.026,2.533,2.179,1.913,1.542,1.296,1.122,0.9911,0.8898,0.8087,0.7423,0.5335,0.4219,0.3518,0.3034,0.2406,0.2013,0.1743,0.1545,0.1394,0.1275,0.1178,0.08805,0.07266,0.06328,0.05698,0.0491,0.04444,0.04141,0.03933,0.03783,0.03672,0.03588}; 103 pv = new G4LPhysicsFreeVector(53,E[0],E[52]); 104 dedx.push_back(pv); 105 for(i=0; i<53; i++) { pv->PutValues(i,E[i],Be[i]*1000.*MeV/cm); } 111 G4double G4_WATER_Li [53]={2.626, 2.84, 3.191, 3.461, 3.665, 3.817, 3.927, 4.004, 4.056, 4.102, 3.998, 3.853, 3.702, 3.413, 3.158, 2.934, 2.739, 2.567, 2.415, 2.28, 1.782, 1.465, 1.247, 1.087, 0.8706, 0.7299, 0.631, 0.5575, 0.5005, 0.455, 0.4178, 0.3004, 0.2376, 0.1981, 0.1708, 0.1354, 0.1132, 0.09803, 0.08692, 0.07842, 0.07171, 0.06627, 0.0495, 0.04085, 0.03557, 0.03203, 0.0276, 0.02498, 0.02327, 0.0221, 0.02126, 0.02064, 0.02016, }; 112 AddData(E,G4_WATER_Li,factor); 106 113 107 //..B 108 G4double B[53] = {3.773,4.142,4.776,5.304,5.749,6.122,6.431,6.684,6.89,7.432,7.551,7.505,7.391,7.091,6.772,6.463,6.172,5.901,5.65,5.418,4.484,3.817,3.322,2.94,2.392,2.02,1.752,1.549,1.391,1.265,1.161,0.8332,0.6587,0.5492,0.4737,0.3757,0.3144,0.2723,0.2415,0.2179,0.1993,0.1842,0.1376,0.1136,0.09894,0.08909,0.07678,0.0695,0.06477,0.06151,0.05916,0.05743,0.05611}; 109 pv = new G4LPhysicsFreeVector(53,E[0],E[52]); 110 dedx.push_back(pv); 111 for(i=0; i<53; i++) { pv->PutValues(i,E[i],B[i]*1000.*MeV/cm); } 114 G4double G4_WATER_Be [53]={3.272, 3.565, 4.061, 4.463, 4.79, 5.052, 5.258, 5.419, 5.542, 5.803, 5.787, 5.675, 5.529, 5.215, 4.912, 4.634, 4.381, 4.152, 3.944, 3.756, 3.026, 2.533, 2.179, 1.913, 1.542, 1.296, 1.122, 0.9911, 0.8898, 0.8087, 0.7423, 0.5335, 0.4219, 0.3518, 0.3034, 0.2406, 0.2013, 0.1743, 0.1545, 0.1394, 0.1275, 0.1178, 0.08805, 0.07266, 0.06328, 0.05698, 0.0491, 0.04444, 0.04141, 0.03933, 0.03783, 0.03672, 0.03588, }; 115 AddData(E,G4_WATER_Be,factor); 112 116 113 //..C 114 G4double C[53] = {4.154,4.593,5.358,6.009,6.568,7.049,7.46,7.809,8.103,8.968,9.262,9.311,9.25,8.994,8.68,8.358,8.045,7.747,7.465,7.199,6.093,5.269,4.636,4.137,3.403,2.891,2.516,2.23,2.004,1.823,1.673,1.2,0.9483,0.7904,0.6817,0.5406,0.4525,0.392,0.3477,0.3138,0.287,0.2653,0.1983,0.1637,0.1426,0.1284,0.1107,0.1002,0.09335,0.08865,0.08528,0.08278,0.08088}; 115 pv = new G4LPhysicsFreeVector(53,E[0],E[52]); 116 dedx.push_back(pv); 117 for(i=0; i<53; i++) { pv->PutValues(i,E[i],C[i]*1000.*MeV/cm); } 117 G4double G4_WATER_B [53]={3.773, 4.142, 4.776, 5.304, 5.749, 6.122, 6.431, 6.684, 6.89, 7.432, 7.551, 7.505, 7.391, 7.091, 6.772, 6.463, 6.172, 5.901, 5.65, 5.418, 4.484, 3.817, 3.322, 2.94, 2.392, 2.02, 1.752, 1.549, 1.391, 1.265, 1.161, 0.8332, 0.6587, 0.5492, 0.4737, 0.3757, 0.3144, 0.2723, 0.2415, 0.2179, 0.1993, 0.1842, 0.1376, 0.1136, 0.09894, 0.08909, 0.07678, 0.0695, 0.06477, 0.06151, 0.05916, 0.05743, 0.05611, }; 118 AddData(E,G4_WATER_B,factor); 118 119 119 //..N 120 G4double N[53] = {4.49,4.984,5.86,6.616,7.276,7.854,8.36,8.799,9.179,10.39,10.89,11.07,11.08,10.9,10.61,10.3,9.974,9.66,9.357,9.068,7.823,6.859,6.097,5.484,4.56,3.9,3.408,3.029,2.727,2.482,2.28,1.636,1.291,1.076,0.9274,0.7354,0.6156,0.5333,0.4731,0.427,0.3906,0.3611,0.27,0.2229,0.1942,0.1749,0.1507,0.1365,0.1272,0.1208,0.1162,0.1128,0.1102}; 121 pv = new G4LPhysicsFreeVector(53,E[0],E[52]); 122 dedx.push_back(pv); 123 for(i=0; i<53; i++) { pv->PutValues(i,E[i],N[i]*1000.*MeV/cm); } 120 G4double G4_WATER_C [53]={4.154, 4.593, 5.358, 6.009, 6.568, 7.049, 7.46, 7.809, 8.103, 8.968, 9.262, 9.311, 9.25, 8.994, 8.68, 8.358, 8.045, 7.747, 7.465, 7.199, 6.093, 5.269, 4.636, 4.137, 3.403, 2.891, 2.516, 2.23, 2.004, 1.823, 1.673, 1.2, 0.9483, 0.7904, 0.6817, 0.5406, 0.4525, 0.392, 0.3477, 0.3138, 0.287, 0.2653, 0.1983, 0.1637, 0.1426, 0.1284, 0.1107, 0.1002, 0.09335, 0.08865, 0.08528, 0.08278, 0.08088, }; 121 AddData(E,G4_WATER_C,factor); 124 122 125 //..O 126 G4double O[53] = {4.778,5.321,6.298,7.152,7.907,8.578,9.173,9.7,10.16,11.73,12.46,12.78,12.89,12.81,12.57,12.27,11.95,11.63,11.32,11.01,9.659,8.571,7.691,6.967,5.854,5.042,4.427,3.945,3.56,3.245,2.983,2.142,1.689,1.406,1.212,0.9602,0.8037,0.6963,0.6178,0.5577,0.5102,0.4716,0.3527,0.2913,0.2538,0.2285,0.197,0.1784,0.1663,0.1579,0.1519,0.1475,0.1441}; 127 pv = new G4LPhysicsFreeVector(53,E[0],E[52]); 128 dedx.push_back(pv); 129 for(i=0; i<53; i++) { pv->PutValues(i,E[i],O[i]*1000.*MeV/cm); } 123 G4double G4_WATER_N [53]={4.49, 4.984, 5.86, 6.616, 7.276, 7.854, 8.36, 8.799, 9.179, 10.39, 10.89, 11.07, 11.08, 10.9, 10.61, 10.3, 9.974, 9.66, 9.357, 9.068, 7.823, 6.859, 6.097, 5.484, 4.56, 3.9, 3.408, 3.029, 2.727, 2.482, 2.28, 1.636, 1.291, 1.076, 0.9274, 0.7354, 0.6156, 0.5333, 0.4731, 0.427, 0.3906, 0.3611, 0.27, 0.2229, 0.1942, 0.1749, 0.1507, 0.1365, 0.1272, 0.1208, 0.1162, 0.1128, 0.1102, }; 124 AddData(E,G4_WATER_N,factor); 130 125 131 //..F 132 G4double F[53] = {4.992, 5.575, 6.637, 7.578, 8.418, 9.171, 9.847, 10.45, 11, 12.9, 13.88, 14.35, 14.56, 14.59, 14.4, 14.13, 13.83, 13.51, 13.19, 12.87, 11.44, 10.26, 9.279, 8.463, 7.187, 6.237, 5.506, 4.928, 4.461, 4.076, 3.753, 2.707, 2.137, 1.779, 1.533, 1.215, 1.017, 0.8809, 0.7816, 0.7056, 0.6456, 0.5969, 0.4466, 0.3688, 0.3213, 0.2894, 0.2496, 0.2259, 133 0.2106, 0.2, 0.1924, 0.1868, 0.1825}; 134 pv = new G4LPhysicsFreeVector(53,E[0],E[52]); 135 dedx.push_back(pv); 136 for(i=0; i<53; i++) { pv->PutValues(i,E[i],F[i]*1000.*MeV/cm); } 126 G4double G4_WATER_O [53]={4.778, 5.321, 6.298, 7.152, 7.907, 8.578, 9.173, 9.7, 10.16, 11.73, 12.46, 12.78, 12.89, 12.81, 12.57, 12.27, 11.95, 11.63, 11.32, 11.01, 9.659, 8.571, 7.691, 6.967, 5.854, 5.042, 4.427, 3.945, 3.56, 3.245, 2.983, 2.142, 1.689, 1.406, 1.212, 0.9602, 0.8037, 0.6963, 0.6178, 0.5577, 0.5102, 0.4716, 0.3527, 0.2913, 0.2538, 0.2285, 0.197, 0.1784, 0.1663, 0.1579, 0.1519, 0.1475, 0.1441, }; 127 AddData(E,G4_WATER_O,factor); 137 128 138 //..Ne 139 G4double Ne[53] = {5.182, 5.797, 6.931, 7.948, 8.865, 9.693, 10.044, 11.12, 11.74, 13.98, 15.21, 15.85, 16.17, 16.33, 16.21, 15.98, 15.69, 15.38, 15.06, 14.74, 13.24, 11.98, 10.91, 10.01, 8.584, 7.503, 6.66, 5.986, 5.436, 4.979, 4.595, 3.332, 2.635, 2.195, 1.892, 1.499, 1.255, 1.087, 0.9646, 0.8709, 0.7969, 0.7368, 0.5514, 0.4555, 0.3969, 0.3576, 0.3083, 0.2792, 0.2602, 0.2472, 0.2378, 0.2308, 0.2255}; 140 pv = new G4LPhysicsFreeVector(53,E[0],E[52]); 141 dedx.push_back(pv); 142 for(i=0; i<53; i++) { pv->PutValues(i,E[i],Ne[i]*1000.*MeV/cm); } 129 G4double G4_WATER_F [53]={4.992, 5.575, 6.637, 7.578, 8.418, 9.171, 9.847, 10.45, 11, 12.9, 13.88, 14.35, 14.56, 14.59, 14.4, 14.13, 13.83, 13.51, 13.19, 12.87, 11.44, 10.26, 9.279, 8.463, 7.187, 6.237, 5.506, 4.928, 4.461, 4.076, 3.753, 2.707, 2.137, 1.779, 1.533, 1.215, 1.017, 0.8809, 0.7816, 0.7056, 0.6456, 0.5969, 0.4466, 0.3688, 0.3213, 0.2894, 0.2496, 0.2259, 0.2106, 0.2, 0.1924, 0.1868, 0.1825, }; 130 AddData(E,G4_WATER_F,factor); 131 132 G4double G4_WATER_Ne [53]={5.182, 5.797, 6.931, 7.948, 8.865, 9.693, 10.44, 11.12, 11.74, 13.98, 15.21, 15.85, 16.17, 16.33, 16.21, 15.98, 15.69, 15.38, 15.06, 14.74, 13.24, 11.98, 10.91, 10.01, 8.584, 7.503, 6.66, 5.986, 5.436, 4.979, 4.595, 3.332, 2.635, 2.195, 1.892, 1.499, 1.255, 1.087, 0.9646, 0.8709, 0.7969, 0.7368, 0.5514, 0.4555, 0.3969, 0.3576, 0.3083, 0.2792, 0.2602, 0.2472, 0.2378, 0.2308, 0.2255, }; 133 AddData(E,G4_WATER_Ne,factor); 134 135 G4double G4_WATER_Na [53]={5.352, 5.998, 7.203, 8.3, 9.298, 10.21, 11.04, 11.81, 12.5, 15.13, 16.68, 17.56, 18.04, 18.43, 18.44, 18.29, 18.05, 17.78, 17.48, 17.18, 15.67, 14.32, 13.15, 12.14, 10.5, 9.226, 8.218, 7.401, 6.728, 6.166, 5.69, 4.112, 3.237, 2.686, 2.307, 1.821, 1.521, 1.317, 1.168, 1.054, 0.9644, 0.8917, 0.6674, 0.5514, 0.4806, 0.4329, 0.3734, 0.3381, 0.3152, 0.2993, 0.288, 0.2796, 0.2732, }; 136 AddData(E,G4_WATER_Na,factor); 137 138 G4double G4_WATER_Mg [53]={5.542, 6.193, 7.42, 8.551, 9.59, 10.54, 11.42, 12.23, 12.98, 15.85, 17.62, 18.66, 19.26, 19.76, 19.83, 19.7, 19.47, 19.2, 18.89, 18.58, 17.02, 15.62, 14.41, 13.36, 11.64, 10.3, 9.233, 8.362, 7.64, 7.033, 6.516, 4.777, 3.792, 3.162, 2.725, 2.159, 1.806, 1.565, 1.388, 1.254, 1.147, 1.061, 0.7944, 0.6565, 0.5722, 0.5156, 0.4447, 0.4027, 0.3754, 0.3566, 0.343, 0.333, 0.3254, }; 139 AddData(E,G4_WATER_Mg,factor); 140 141 G4double G4_WATER_Al [53]={5.724, 6.39, 7.649, 8.82, 9.905, 10.91, 11.84, 12.71, 13.51, 16.66, 18.69, 19.93, 20.68, 21.38, 21.56, 21.5, 21.32, 21.07, 20.79, 20.48, 18.91, 17.47, 16.19, 15.08, 13.24, 11.78, 10.61, 9.641, 8.835, 8.153, 7.569, 5.583, 4.444, 3.71, 3.199, 2.534, 2.12, 1.836, 1.629, 1.471, 1.346, 1.245, 0.9325, 0.7707, 0.6719, 0.6054, 0.5223, 0.473, 0.441, 0.4189, 0.403, 0.3912, 0.3823, }; 142 AddData(E,G4_WATER_Al,factor); 143 144 G4double G4_WATER_Si [53]={5.905, 6.583, 7.868, 9.073, 10.2, 11.25, 12.23, 13.14, 13.99, 17.4, 19.66, 21.1, 22.01, 22.91, 23.21, 23.22, 23.09, 22.87, 22.61, 22.32, 20.76, 19.28, 17.95, 16.78, 14.83, 13.26, 11.99, 10.94, 10.06, 9.304, 8.656, 6.43, 5.135, 4.294, 3.705, 2.938, 2.458, 2.129, 1.889, 1.706, 1.561, 1.444, 1.082, 0.8942, 0.7796, 0.7026, 0.6061, 0.549, 0.5119, 0.4862, 0.4678, 0.4542, 0.4438, }; 145 AddData(E,G4_WATER_Si,factor); 146 147 G4double G4_WATER_P [53]={6.12, 6.81, 8.118, 9.352, 10.51, 11.61, 12.63, 13.58, 14.48, 18.13, 20.63, 22.28, 23.34, 24.47, 24.91, 25.02, 24.95, 24.78, 24.55, 24.28, 22.76, 21.26, 19.89, 18.67, 16.59, 14.92, 13.54, 12.39, 11.42, 10.59, 9.867, 7.367, 5.896, 4.935, 4.259, 3.376, 2.824, 2.445, 2.169, 1.959, 1.792, 1.657, 1.242, 1.027, 0.8954, 0.807, 0.6963, 0.6308, 0.5881, 0.5587, 0.5375, 0.5219, 0.51, }; 148 AddData(E,G4_WATER_P,factor); 149 150 G4double G4_WATER_S [53]={6.294, 7, 8.338, 9.604, 10.8, 11.94, 13, 14, 14.94, 18.82, 21.55, 23.41, 24.65, 26.01, 26.6, 26.81, 26.81, 26.69, 26.5, 26.26, 24.79, 23.28, 21.88, 20.61, 18.43, 16.64, 15.16, 13.92, 12.86, 11.95, 11.15, 8.371, 6.715, 5.624, 4.856, 3.847, 3.217, 2.785, 2.47, 2.229, 2.04, 1.886, 1.413, 1.169, 1.019, 0.9187, 0.7929, 0.7183, 0.6697, 0.6362, 0.6122, 0.5944, 0.5808, }; 151 AddData(E,G4_WATER_S,factor); 152 153 G4double G4_WATER_Cl [53]={6.522, 7.237, 8.59, 9.875, 11.1, 12.26, 13.36, 14.39, 15.37, 19.45, 22.4, 24.45, 25.86, 27.46, 28.19, 28.5, 28.57, 28.5, 28.34, 28.13, 26.72, 25.21, 23.78, 22.47, 20.2, 18.32, 16.75, 15.42, 14.28, 13.3, 12.44, 9.392, 7.557, 6.34, 5.479, 4.344, 3.633, 3.145, 2.789, 2.517, 2.303, 2.13, 1.596, 1.32, 1.151, 1.038, 0.8957, 0.8115, 0.7567, 0.7189, 0.6917, 0.6717, 0.6563, }; 154 AddData(E,G4_WATER_Cl,factor); 155 156 G4double G4_WATER_Ar [53]={6.642, 7.369, 8.739, 10.04, 11.28, 12.47, 13.59, 14.66, 15.66, 19.93, 23.08, 25.32, 26.89, 28.72, 29.6, 30.01, 30.15, 30.13, 30, 29.82, 28.46, 26.94, 25.49, 24.15, 21.81, 19.86, 18.22, 16.82, 15.61, 14.57, 13.65, 10.39, 8.394, 7.063, 6.114, 4.859, 4.067, 3.522, 3.125, 2.821, 2.581, 2.387, 1.789, 1.48, 1.291, 1.164, 1.005, 0.9105, 0.8491, 0.8067, 0.7763, 0.7537, 0.7365, }; 157 AddData(E,G4_WATER_Ar,factor); 143 158 144 159 if(corr) { 145 for(i=0; i< 8; i++) {corr->AddStoppingData(Z[i], A[i], "G4_WATER", *(dedx[i]));}160 for(i=0; i<16; i++) {corr->AddStoppingData(Z[i], aa[i], "G4_WATER", dedx[i]);} 146 161 } 147 162 } -
trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlung.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlung.cc,v 1. 48 2007/05/23 08:47:34vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4eBremsstrahlung.cc,v 1.56 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 69 69 // 22-05-06 Use gammaThreshold from manager (V.Ivantchenko) 70 70 // 15-01-07 use SetEmModel() from G4VEnergyLossProcess (mma) 71 // 71 // use RelEmModel above 1GeV (AS & VI) 72 // 13-11-08 reenable LPM switch (A.Schaelicke) 72 73 // ------------------------------------------------------------------- 73 74 // … … 78 79 #include "G4Gamma.hh" 79 80 #include "G4eBremsstrahlungModel.hh" 80 #include "G4 UniversalFluctuation.hh"81 #include "G4eBremsstrahlungRelModel.hh" 81 82 #include "G4UnitsTable.hh" 82 83 #include "G4LossTableManager.hh" … … 92 93 G4VEnergyLossProcess(name), 93 94 isInitialised(false) 94 {} 95 { 96 SetProcessSubType(fBremsstrahlung); 97 } 95 98 96 99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 98 101 G4eBremsstrahlung::~G4eBremsstrahlung() 99 102 {} 103 104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 105 106 G4bool G4eBremsstrahlung::IsApplicable(const G4ParticleDefinition& p) 107 { 108 return (&p == G4Electron::Electron() || &p == G4Positron::Positron()); 109 } 100 110 101 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 109 119 SetSecondaryParticle(G4Gamma::Gamma()); 110 120 SetIonisation(false); 111 if (!EmModel()) SetEmModel(new G4eBremsstrahlungModel()); 112 EmModel()->SetLowEnergyLimit (100*eV); 113 EmModel()->SetHighEnergyLimit(100*TeV); 114 if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation()); 121 122 if (!EmModel(1)) SetEmModel(new G4eBremsstrahlungModel(), 1); 123 if (!EmModel(2)) SetEmModel(new G4eBremsstrahlungRelModel(), 2); 124 125 EmModel(1)->SetLowEnergyLimit(MinKinEnergy()); 126 EmModel(1)->SetHighEnergyLimit(EmModel(2)->LowEnergyLimit()); 127 EmModel(2)->SetHighEnergyLimit(MaxKinEnergy()); 115 128 116 AddEmModel(1, EmModel(), FluctModel()); 129 G4VEmFluctuationModel* fm = 0; 130 AddEmModel(1, EmModel(1), fm); 131 AddEmModel(2, EmModel(2), fm); 117 132 isInitialised = true; 118 133 } 119 134 G4LossTableManager* man = G4LossTableManager::Instance(); 120 dynamic_cast<G4eBremsstrahlungModel*>(EmModel()) 121 ->SetEnergyThreshold(man->BremsstrahlungTh()); 122 dynamic_cast<G4eBremsstrahlungModel*>(EmModel()) 123 ->SetLPMflag(man->LPMFlag()); 135 G4double eth = man->BremsstrahlungTh(); 136 EmModel(1)->SetSecondaryThreshold(eth); 137 EmModel(2)->SetSecondaryThreshold(eth); 138 139 // Only high energy model LMP flag is ON/OFF 140 EmModel(1)->SetLPMFlag(false); 141 EmModel(2)->SetLPMFlag(man->LPMFlag()); 124 142 } 125 143 … … 128 146 void G4eBremsstrahlung::PrintInfo() 129 147 { 130 if(EmModel()) { 131 G4cout << " Total cross sections and sampling from " 132 << EmModel()->GetName() << " model" 133 << " (based on the EEDL data library) " 134 << "\n Good description from 1 KeV to 100 GeV, " 135 << "log scale extrapolation above 100 GeV." 136 << " LPM flag " 137 << dynamic_cast<G4eBremsstrahlungModel*>(EmModel())->LPMflag() 138 << G4endl; 139 G4double eth = dynamic_cast<G4eBremsstrahlungModel*>(EmModel())->EnergyThreshold(); 140 if(eth < DBL_MIN) 141 G4cout << " HighEnergyThreshold(GeV)= " << eth/GeV 142 << G4endl; 148 if(EmModel(1)) { 149 G4LossTableManager* man = G4LossTableManager::Instance(); 150 G4double eth = man->BremsstrahlungTh(); 151 G4cout << " LPM flag: " << man->LPMFlag() << " for E > " 152 << EmModel(1)->HighEnergyLimit()/GeV << " GeV"; 153 if(eth < DBL_MAX) G4cout << ", HighEnergyThreshold(GeV)= " << eth/GeV; 154 G4cout << G4endl; 143 155 } 144 156 } -
trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlungModel.cc,v 1. 39 2007/05/23 08:47:35vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4eBremsstrahlungModel.cc,v 1.43 2008/11/13 19:28:58 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 54 54 // 27-03-06 Fix calculation of fl parameter at low energy (energy loss) (VI) 55 55 // 15-02-07 correct LPMconstant by a factor 2, thanks to G. Depaola (mma) 56 // 09-09-08 MigdalConstant increased in (2pi)^2 times (A.Schaelicke) 56 57 // 57 58 // Class Description: … … 85 86 isElectron(true), 86 87 probsup(1.0), 87 MigdalConstant(classic_electr_radius*electron_Compton_length*electron_Compton_length /pi),88 MigdalConstant(classic_electr_radius*electron_Compton_length*electron_Compton_length*4.0*pi), 88 89 LPMconstant(fine_structure_const*electron_mass_c2*electron_mass_c2/(4.*pi*hbarc)), 89 theLPMflag(true),90 90 isInitialised(false) 91 91 { … … 93 93 theGamma = G4Gamma::Gamma(); 94 94 minThreshold = 1.0*keV; 95 highKinEnergy= 100.*TeV;96 lowKinEnergy = 1.0*keV;97 highEnergyTh = DBL_MAX;98 95 } 99 96 … … 164 161 if(isInitialised) return; 165 162 166 if(pParticleChange) 163 if(pParticleChange) { 167 164 fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange); 168 else165 } else { 169 166 fParticleChange = new G4ParticleChangeForLoss(); 170 167 } 171 168 isInitialised = true; 172 169 } … … 834 831 gammaEnergy = x*kineticEnergy; 835 832 836 if ( theLPMflag) {833 if (LPMFlag()) { 837 834 // take into account the supression due to the LPM effect 838 835 if (G4UniformRand() <= SupressionFunction(material,kineticEnergy, … … 879 876 880 877 // stop tracking and create new secondary instead of primary 881 if(gammaEnergy > highEnergyTh) {878 if(gammaEnergy > SecondaryThreshold()) { 882 879 fParticleChange->ProposeTrackStatus(fStopAndKill); 883 880 fParticleChange->SetProposedKineticEnergy(0.0); … … 951 948 G4double supr = 1.0; 952 949 953 if ( theLPMflag) {950 if (LPMFlag()) { 954 951 955 952 G4double s2lpm = LPMEnergy*gammaEnergy/totEnergySquare; -
trunk/source/processes/electromagnetic/standard/src/G4eCoulombScatteringModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eCoulombScatteringModel.cc,v 1. 40 2008/01/07 08:32:01vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4eCoulombScatteringModel.cc,v 1.59 2008/10/22 18:39:29 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 44 44 // 19.08.06 V.Ivanchenko add inline function ScreeningParameter 45 45 // 09.10.07 V.Ivanchenko reorganized methods, add cut dependence in scattering off e- 46 // 09.06.08 V.Ivanchenko add SelectIsotope and sampling of the recoil ion 46 47 // 47 48 // Class Description: … … 61 62 #include "G4Positron.hh" 62 63 #include "G4Proton.hh" 64 #include "G4ParticleTable.hh" 63 65 64 66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 66 68 using namespace std; 67 69 68 G4eCoulombScatteringModel::G4eCoulombScatteringModel( 69 G4double thetaMin, G4double thetaMax, G4bool build, 70 G4double tlim, const G4String& nam) 70 G4eCoulombScatteringModel::G4eCoulombScatteringModel(const G4String& nam) 71 71 : G4VEmModel(nam), 72 cosThetaMin(cos(thetaMin)), 73 cosThetaMax(cos(thetaMax)), 74 q2Limit(tlim), 75 theCrossSectionTable(0), 76 lowKEnergy(keV), 77 highKEnergy(TeV), 72 cosThetaMin(1.0), 73 cosThetaMax(-1.0), 74 q2Limit(TeV*TeV), 78 75 alpha2(fine_structure_const*fine_structure_const), 79 76 faclim(100.0), 80 nbins(12),81 nmax(100),82 buildTable(build),83 77 isInitialised(false) 84 78 { 85 79 fNistManager = G4NistManager::Instance(); 80 theParticleTable = G4ParticleTable::GetParticleTable(); 86 81 theElectron = G4Electron::Electron(); 87 82 thePositron = G4Positron::Positron(); 88 83 theProton = G4Proton::Proton(); 84 currentMaterial = 0; 85 currentElement = 0; 89 86 a0 = alpha2*electron_mass_c2*electron_mass_c2/(0.885*0.885); 90 87 G4double p0 = electron_mass_c2*classic_electr_radius; 91 88 coeff = twopi*p0*p0; 92 89 constn = 6.937e-6/(MeV*MeV); 93 tkin = targetZ = targetA =mom2 = DBL_MIN;90 tkin = targetZ = mom2 = DBL_MIN; 94 91 elecXSection = nucXSection = 0.0; 92 recoilThreshold = DBL_MAX; 95 93 ecut = DBL_MAX; 96 94 particle = 0; 97 for(size_t j=0; j<100; j++) {index[j] = -1;} 95 currentCouple = 0; 96 for(size_t j=0; j<100; j++) { 97 FF[j] = 0.0; 98 } 98 99 } 99 100 … … 101 102 102 103 G4eCoulombScatteringModel::~G4eCoulombScatteringModel() 103 { 104 if(theCrossSectionTable) { 105 theCrossSectionTable->clearAndDestroy(); 106 delete theCrossSectionTable; 107 } 108 } 104 {} 109 105 110 106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 111 107 112 108 void G4eCoulombScatteringModel::Initialise(const G4ParticleDefinition* p, 113 const G4DataVector&) 114 { 115 // G4cout << "!!! G4eCoulombScatteringModel::Initialise for " 116 // << p->GetParticleName() << " cos(TetMin)= " << cosThetaMin 117 // << " cos(TetMax)= " << cosThetaMax <<G4endl; 109 const G4DataVector& cuts) 110 { 111 SetupParticle(p); 112 currentCouple = 0; 113 elecXSection = nucXSection = 0.0; 114 tkin = targetZ = mom2 = DBL_MIN; 115 ecut = etag = DBL_MAX; 116 cosThetaMin = cos(PolarAngleLimit()); 117 currentCuts = &cuts; 118 //G4cout << "!!! G4eCoulombScatteringModel::Initialise for " 119 // << p->GetParticleName() << " cos(TetMin)= " << cosThetaMin 120 // << " cos(TetMax)= " << cosThetaMax <<G4endl; 118 121 if(!isInitialised) { 119 122 isInitialised = true; … … 124 127 else 125 128 fParticleChange = new G4ParticleChangeForGamma(); 126 } else { 127 return; 128 } 129 130 if(p->GetParticleType() == "nucleus") buildTable = false; 131 if(!buildTable) return; 132 133 // Compute log cross section table per atom 134 if(!theCrossSectionTable) theCrossSectionTable = new G4PhysicsTable(); 135 136 nbins = 2*G4int(log10(highKEnergy/lowKEnergy)); 137 } 138 139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 140 141 G4double G4eCoulombScatteringModel::ComputeCrossSectionPerAtom( 142 const G4ParticleDefinition* p, 143 G4double kinEnergy, 144 G4double Z, G4double A, 145 G4double cutEnergy, G4double) 146 { 147 if(p == particle && kinEnergy == tkin && Z == targetZ && 148 A == targetA && cutEnergy == ecut) return nucXSection; 149 150 //G4cout << "### G4eCoulombScatteringModel::ComputeCrossSectionPerAtom for " 151 // << p->GetParticleName() << " Z= " << Z << " A= " << A 152 // << " e= " << kinEnergy << G4endl; 153 154 nucXSection = ComputeElectronXSectionPerAtom(p,kinEnergy,Z,A,cutEnergy); 155 156 // nuclear cross section 157 if(theCrossSectionTable) { 158 G4bool b; 159 G4int iz = G4int(Z); 160 G4int idx = index[iz]; 161 162 // compute table for given Z 163 if(-1 == idx) { 164 idx = theCrossSectionTable->size(); 165 index[iz] = idx; 166 G4PhysicsLogVector* ptrVector 167 = new G4PhysicsLogVector(lowKEnergy, highKEnergy, nbins); 168 // G4cout << "New vector Z= " << iz << " A= " << A << " idx= " << idx << G4endl; 169 G4double e, value; 170 for(G4int i=0; i<=nbins; i++) { 171 e = ptrVector->GetLowEdgeEnergy( i ) ; 172 value = CalculateCrossSectionPerAtom(p, e, Z, A); 173 ptrVector->PutValue( i, log(value) ); 174 } 175 theCrossSectionTable->push_back(ptrVector); 176 } 177 178 // take value from the table 179 nucXSection += 180 std::exp((((*theCrossSectionTable)[idx]))->GetValue(kinEnergy, b)); 181 182 // compute value from scratch 183 } else nucXSection += CalculateCrossSectionPerAtom(p, kinEnergy, Z, A); 184 185 // G4cout << " cross(bn)= " << nucXSection/barn << G4endl; 186 187 if(nucXSection < 0.0) nucXSection = 0.0; 188 return nucXSection; 189 } 190 191 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 192 193 G4double G4eCoulombScatteringModel::ComputeElectronXSectionPerAtom( 194 const G4ParticleDefinition* p, 195 G4double kinEnergy, 196 G4double Z, 197 G4double A, 198 G4double cutEnergy) 199 { 200 if(p == particle && kinEnergy == tkin && Z == targetZ && 201 cutEnergy == ecut) return elecXSection; 129 } 130 if(mass < GeV && particle->GetParticleType() != "nucleus") { 131 InitialiseElementSelectors(p,cuts); 132 } 133 } 134 135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 136 137 void G4eCoulombScatteringModel::ComputeMaxElectronScattering(G4double cutEnergy) 138 { 202 139 ecut = cutEnergy; 203 elecXSection = 0.0;204 SetupParticle(p);205 G4double ekin = std::max(keV, kinEnergy);206 //G4double ekin = kinEnergy;207 SetupTarget(Z, A, ekin);208 209 140 G4double tmax = tkin; 210 if(p == theElectron) tmax *= 0.5;211 else if(p != thePositron) {141 cosTetMaxElec = 1.0; 142 if(mass > MeV) { 212 143 G4double ratio = electron_mass_c2/mass; 213 144 G4double tau = tkin/mass; 214 145 tmax = 2.0*electron_mass_c2*tau*(tau + 2.)/ 215 146 (1.0 + 2.0*ratio*(tau + 1.0) + ratio*ratio); 216 } 217 218 cosTetMaxElec = cosTetMaxNuc; 219 G4double t = std::min(cutEnergy, tmax); 220 G4double mom21 = t*(t + 2.0*electron_mass_c2); 221 G4double t1 = tkin - t; 222 if(t1 > 0.0) { 223 G4double mom22 = t1*(t1 + 2.0*mass); 224 G4double ctm = (mom2 + mom22 - mom21)*0.5/sqrt(mom2*mom22); 225 if(ctm > cosTetMaxElec && ctm <= 1.0) cosTetMaxElec = ctm; 226 } 227 228 if(cosTetMaxElec < cosThetaMin) { 229 G4double x1 = 1.0 - cosThetaMin + screenZ; 230 G4double x2 = 1.0 - cosTetMaxElec + screenZ; 231 elecXSection = coeff*Z*chargeSquare*invbeta2* 232 (cosThetaMin - cosTetMaxElec)/(x1*x2*mom2); 233 } 234 // G4cout << "cut= " << ecut << " e= " << tkin 235 // << " croosE(barn)= " << elecXSection/barn 236 // << " cosEl= " << cosTetMaxElec << " costmin= " << cosThetaMin << G4endl; 237 return elecXSection; 238 } 239 240 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 241 242 G4double G4eCoulombScatteringModel::CalculateCrossSectionPerAtom( 243 const G4ParticleDefinition* p, 244 G4double kinEnergy, 245 G4double Z, G4double A) 246 { 247 G4double cross = 0.0; 147 cosTetMaxElec = 1.0 - std::min(cutEnergy, tmax)*electron_mass_c2/mom2; 148 } else { 149 150 if(particle == theElectron) tmax *= 0.5; 151 G4double t = std::min(cutEnergy, tmax); 152 G4double mom21 = t*(t + 2.0*electron_mass_c2); 153 G4double t1 = tkin - t; 154 //G4cout << "tkin= " << tkin << " t= " << t << " t1= " << t1 << G4endl; 155 if(t1 > 0.0) { 156 G4double mom22 = t1*(t1 + 2.0*mass); 157 G4double ctm = (mom2 + mom22 - mom21)*0.5/sqrt(mom2*mom22); 158 //G4cout << "ctm= " << ctm << G4endl; 159 if(ctm < 1.0) cosTetMaxElec = ctm; 160 } 161 } 162 } 163 164 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 165 166 G4double G4eCoulombScatteringModel::ComputeCrossSectionPerAtom( 167 const G4ParticleDefinition* p, 168 G4double kinEnergy, 169 G4double Z, G4double, 170 G4double cutEnergy, G4double) 171 { 172 //G4cout << "### G4eCoulombScatteringModel::ComputeCrossSectionPerAtom for " 173 // << p->GetParticleName()<<" Z= "<<Z<<" e(MeV)= "<< kinEnergy/MeV << G4endl; 174 G4double xsec = 0.0; 248 175 SetupParticle(p); 249 G4double ekin = std::max(keV, kinEnergy); 250 //G4double ekin = kinEnergy; 251 SetupTarget(Z, A, ekin); 252 253 if(cosTetMaxNuc < cosThetaMin) { 254 G4double x1 = 1.0 - cosThetaMin; 255 G4double x2 = 1.0 - cosTetMaxNuc; 256 G4double x3 = cosThetaMin - cosTetMaxNuc; 257 G4double z1 = x1 + screenZ; 258 G4double z2 = x2 + screenZ; 259 G4double d = 1.0/formfactA - screenZ; 260 G4double d1 = 1.0 - formfactA*screenZ; 261 G4double zn1= x1 + d; 262 G4double zn2= x2 + d; 263 cross = coeff*Z*Z*chargeSquare*invbeta2 264 *(x3/(z1*z2) + x3/(zn1*zn2) + 265 2.0*std::log(z1*zn2/(z2*zn1))/d) / (mom2*d1*d1); 266 } 176 G4double ekin = std::max(lowEnergyLimit, kinEnergy); 177 SetupKinematic(ekin, cutEnergy); 178 if(cosTetMaxNuc < cosTetMinNuc) { 179 SetupTarget(Z, ekin); 180 xsec = CrossSectionPerAtom(); 181 } 182 /* 183 G4cout << "e(MeV)= " << ekin/MeV << "cosTetMinNuc= " << cosTetMinNuc 184 << " cosTetMaxNuc= " << cosTetMaxNuc 185 << " cosTetMaxElec= " << cosTetMaxElec 186 << " screenZ= " << screenZ 187 << " formfactA= " << formfactA 188 << " cosTetMaxHad= " << cosTetMaxHad << G4endl; 189 */ 190 return xsec; 191 } 192 193 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 194 195 G4double G4eCoulombScatteringModel::CrossSectionPerAtom() 196 { 197 // This method needs initialisation before be called 198 199 G4double fac = coeff*targetZ*chargeSquare*invbeta2/mom2; 200 elecXSection = 0.0; 201 nucXSection = 0.0; 202 203 G4double x = 1.0 - cosTetMinNuc; 204 G4double x1 = x + screenZ; 205 206 if(cosTetMaxElec2 < cosTetMinNuc) { 207 elecXSection = fac*(cosTetMinNuc - cosTetMaxElec2)/ 208 (x1*(1.0 - cosTetMaxElec2 + screenZ)); 209 nucXSection = elecXSection; 210 } 211 212 //G4cout << "XS tkin(MeV)= " << tkin<<" xs= " <<nucXSection 213 // << " costmax= " << cosTetMaxNuc2 214 // << " costmin= " << cosTetMinNuc << " Z= " << targetZ <<G4endl; 215 if(cosTetMaxNuc2 < cosTetMinNuc) { 216 G4double s = screenZ*formfactA; 217 G4double z1 = 1.0 - cosTetMaxNuc2 + screenZ; 218 G4double d = (1.0 - s)/formfactA; 219 //G4cout <<"x1= "<<x1<<" z1= " <<z1<<" s= "<<s << " d= " <<d <<G4endl; 220 if(d < 0.2*x1) { 221 G4double x2 = x1*x1; 222 G4double z2 = z1*z1; 223 x = (1.0/(x1*x2) - 1.0/(z1*z2) - d*1.5*(1.0/(x2*x2) - 1.0/(z2*z2)))/ 224 (3.0*formfactA*formfactA); 225 } else { 226 G4double x2 = x1 + d; 227 G4double z2 = z1 + d; 228 x = (1.0 + 2.0*s)*((cosTetMinNuc - cosTetMaxNuc2)*(1.0/(x1*z1) + 1.0/(x2*z2)) - 229 2.0*log(z1*x2/(z2*x1))/d); 230 } 231 nucXSection += fac*targetZ*x; 232 } 233 234 //G4cout<<" cross(bn)= "<<nucXSection/barn<<" xsElec(bn)= "<<elecXSection/barn 235 // << " Asc= " << screenZ << G4endl; 267 236 268 // G4cout << "CalculateCrossSectionPerAtom: e(MeV)= " << tkin 269 // << " cross(b)= " << cross/barn << " ctmin= " << cosThetaMin 270 // << " ctmax= " << cosTetMaxNuc << G4endl; 271 272 return cross; 237 return nucXSection; 273 238 } 274 239 … … 276 241 277 242 void G4eCoulombScatteringModel::SampleSecondaries( 278 std::vector<G4DynamicParticle*>* ,243 std::vector<G4DynamicParticle*>* fvect, 279 244 const G4MaterialCutsCouple* couple, 280 245 const G4DynamicParticle* dp, 281 246 G4double cutEnergy, 282 G4double maxEnergy) 283 { 284 const G4Material* aMaterial = couple->GetMaterial(); 285 const G4ParticleDefinition* p = dp->GetDefinition(); 247 G4double) 248 { 286 249 G4double kinEnergy = dp->GetKineticEnergy(); 287 288 // Select atom and setup 289 SetupParticle(p); 290 const G4Element* elm = 291 SelectRandomAtom(aMaterial,p,kinEnergy,cutEnergy,maxEnergy); 292 G4double Z = elm->GetZ(); 293 G4double A = elm->GetN(); 294 295 G4double cross = 296 ComputeCrossSectionPerAtom(p,kinEnergy,Z,A,cutEnergy,maxEnergy); 297 298 G4double costm = cosTetMaxNuc; 250 if(kinEnergy <= DBL_MIN) return; 251 DefineMaterial(couple); 252 SetupParticle(dp->GetDefinition()); 253 G4double ekin = std::max(lowEnergyLimit, kinEnergy); 254 SetupKinematic(ekin, cutEnergy); 255 //G4cout << "G4eCoulombScatteringModel::SampleSecondaries e(MeV)= " 256 // << kinEnergy << " " << particle->GetParticleName() << G4endl; 257 258 // Choose nucleus 259 currentElement = SelectRandomAtom(couple,particle,ekin,cutEnergy,ekin); 260 261 SetupTarget(currentElement->GetZ(),ekin); 262 263 G4double cost = SampleCosineTheta(); 264 G4double z1 = 1.0 - cost; 265 if(z1 < 0.0) return; 266 267 G4double sint = sqrt(z1*(1.0 + cost)); 268 269 //G4cout<<"## Sampled sint= " << sint << " Z= " << targetZ 270 // << " screenZ= " << screenZ << " cn= " << formfactA << G4endl; 271 272 G4double phi = twopi * G4UniformRand(); 273 274 G4ThreeVector direction = dp->GetMomentumDirection(); 275 G4ThreeVector newDirection(cos(phi)*sint,sin(phi)*sint,cost); 276 newDirection.rotateUz(direction); 277 278 fParticleChange->ProposeMomentumDirection(newDirection); 279 280 // recoil sampling assuming a small recoil 281 // and first order correction to primary 4-momentum 282 if(lowEnergyLimit < kinEnergy) { 283 G4int ia = SelectIsotopeNumber(currentElement); 284 G4double Trec = z1*mom2/(amu_c2*G4double(ia)); 285 G4double th = 286 std::min(recoilThreshold, 287 targetZ*currentElement->GetIonisation()->GetMeanExcitationEnergy()); 288 289 if(Trec > th) { 290 G4int iz = G4int(targetZ); 291 G4ParticleDefinition* ion = theParticleTable->FindIon(iz, ia, 0, iz); 292 Trec = z1*mom2/ion->GetPDGMass(); 293 if(Trec < kinEnergy) { 294 G4ThreeVector dir = (direction - newDirection).unit(); 295 G4DynamicParticle* newdp = new G4DynamicParticle(ion, dir, Trec); 296 fvect->push_back(newdp); 297 fParticleChange->SetProposedKineticEnergy(kinEnergy - Trec); 298 } 299 } 300 } 301 302 return; 303 } 304 305 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 306 307 G4double G4eCoulombScatteringModel::SampleCosineTheta() 308 { 309 G4double costm = cosTetMaxNuc2; 299 310 G4double formf = formfactA; 300 if(G4UniformRand()*cross < elecXSection) { 301 costm = cosTetMaxElec; 311 G4double prob = 0.0; 312 G4double xs = CrossSectionPerAtom(); 313 if(xs > 0.0) prob = elecXSection/xs; 314 315 // scattering off e or A? 316 if(G4UniformRand() < prob) { 317 costm = cosTetMaxElec2; 302 318 formf = 0.0; 303 319 } 320 304 321 /* 305 G4cout << " G4eCoul...SampleSecondaries: e(MeV)= " << tkin322 G4cout << "SampleCost: e(MeV)= " << tkin 306 323 << " ctmin= " << cosThetaMin 307 324 << " ctmaxN= " << cosTetMaxNuc 308 325 << " ctmax= " << costm 309 << " Z= " << Z << " A= " << A 310 << " cross= " << cross/barn << " crossE= " << elecXSection/barn 326 << " Z= " << targetZ << " A= " << targetA 311 327 << G4endl; 312 328 */ 313 if(costm >= cosT hetaMin) return;314 315 G4double x1 = 1. - cosT hetaMin+ screenZ;316 G4double x2 = 1. - costm ;317 G4double x3 = cosT hetaMin- costm;318 G4double grej, z,z1;329 if(costm >= cosTetMinNuc) return 2.0; 330 331 G4double x1 = 1. - cosTetMinNuc + screenZ; 332 G4double x2 = 1. - costm + screenZ; 333 G4double x3 = cosTetMinNuc - costm; 334 G4double grej, z1; 319 335 do { 320 z = G4UniformRand()*x3; 321 z1 = (x1*x2 - screenZ*z)/(x1 + z); 322 if(z1 < 0.0) z1 = 0.0; 323 else if(z1 > 2.0) z1 = 2.0; 336 z1 = x1*x2/(x1 + G4UniformRand()*x3) - screenZ; 324 337 grej = 1.0/(1.0 + formf*z1); 325 338 } while ( G4UniformRand() > grej*grej ); 326 327 G4double cost = 1.0 - z1; 328 G4double sint= sqrt(z1*(2.0 - z1)); 329 /* 330 if(sint > 0.1) 331 G4cout<<"## SampleSecondaries: e(MeV)= " << kinEnergy 332 << " sint= " << sint << " Z= " << Z << " screenZ= " << screenZ 333 << " cn= " << formf 334 << G4endl; 335 */ 336 G4double phi = twopi * G4UniformRand(); 337 338 G4ThreeVector direction = dp->GetMomentumDirection(); 339 G4ThreeVector newDirection(cos(phi)*sint,sin(phi)*sint,cost); 340 newDirection.rotateUz(direction); 341 342 fParticleChange->ProposeMomentumDirection(newDirection); 343 344 return; 345 } 346 347 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 348 349 339 340 //G4cout << "z= " << z1 << " cross= " << nucXSection/barn 341 // << " crossE= " << elecXSection/barn << G4endl; 342 343 return 1.0 - z1; 344 } 345 346 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 347 348 -
trunk/source/processes/electromagnetic/standard/src/G4eIonisation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eIonisation.cc,v 1.5 3 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4eIonisation.cc,v 1.57 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 90 90 isInitialised(false) 91 91 { 92 SetStepFunction(0.2, 1*mm); 93 SetIntegral(true); 94 SetVerboseLevel(1); 92 // SetStepFunction(0.2, 1*mm); 93 // SetIntegral(true); 94 // SetVerboseLevel(1); 95 SetProcessSubType(fIonisation); 95 96 } 96 97 … … 99 100 G4eIonisation::~G4eIonisation() 100 101 {} 102 103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 104 105 G4double G4eIonisation::MinPrimaryEnergy(const G4ParticleDefinition*, 106 const G4Material*, 107 G4double cut) 108 { 109 G4double x = cut; 110 if(isElectron) x += cut; 111 return x; 112 } 113 114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 115 116 G4bool G4eIonisation::IsApplicable(const G4ParticleDefinition& p) 117 { 118 return (&p == G4Electron::Electron() || &p == G4Positron::Positron()); 119 } 101 120 102 121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 110 129 SetSecondaryParticle(theElectron); 111 130 if (!EmModel()) SetEmModel(new G4MollerBhabhaModel()); 112 EmModel()->SetLowEnergyLimit ( 100*eV);113 EmModel()->SetHighEnergyLimit( 100*TeV);131 EmModel()->SetLowEnergyLimit (MinKinEnergy()); 132 EmModel()->SetHighEnergyLimit(MaxKinEnergy()); 114 133 if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation()); 115 134 … … 122 141 123 142 void G4eIonisation::PrintInfo() 124 { 125 if(EmModel()) 126 G4cout << " Delta cross sections and sampling from " 127 << EmModel()->GetName() << " model" 128 << "\n Good description from 1 KeV to 100 GeV." 129 << G4endl; 130 } 143 {} 131 144 132 145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/standard/src/G4eeToTwoGammaModel.cc
r819 r961 25 25 // 26 26 // $Id: G4eeToTwoGammaModel.cc,v 1.14 2007/05/23 08:47:35 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/standard/src/G4eplusAnnihilation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eplusAnnihilation.cc,v 1. 27 2007/10/02 10:17:12vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4eplusAnnihilation.cc,v 1.30 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 68 68 : G4VEmProcess(name), isInitialised(false) 69 69 { 70 SetProcessSubType(fAnnihilation); 70 71 enableAtRestDoIt = true; 71 72 } … … 78 79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 79 80 81 G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& p) 82 { 83 return (&p == G4Positron::Positron()); 84 } 85 86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 87 88 G4double G4eplusAnnihilation::AtRestGetPhysicalInteractionLength( 89 const G4Track&, G4ForceCondition* condition) 90 { 91 *condition = NotForced; 92 return 0.0; 93 } 94 95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 96 80 97 void G4eplusAnnihilation::InitialiseProcess(const G4ParticleDefinition*) 81 98 { … … 85 102 SetStartFromNullFlag(false); 86 103 SetSecondaryParticle(G4Gamma::Gamma()); 87 G4double emin = 0.1*keV; 88 G4double emax = 100.*TeV; 89 SetLambdaBinning(120); 90 SetMinKinEnergy(emin); 91 SetMaxKinEnergy(emax); 92 if(!Model()) SetModel(new G4eeToTwoGammaModel); 93 Model()->SetLowEnergyLimit(emin); 94 Model()->SetHighEnergyLimit(emax); 104 if(!Model()) SetModel(new G4eeToTwoGammaModel()); 105 Model()->SetLowEnergyLimit(MinKinEnergy()); 106 Model()->SetHighEnergyLimit(MaxKinEnergy()); 95 107 AddEmModel(1, Model()); 96 108 } … … 100 112 101 113 void G4eplusAnnihilation::PrintInfo() 102 { 103 G4cout 104 << " Sampling according " << Model()->GetName() << " model" 105 << G4endl; 106 } 114 {} 107 115 108 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/standard/src/G4hIonisation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4hIonisation.cc,v 1. 70 2008/01/14 11:59:45vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4hIonisation.cc,v 1.82 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 78 78 // positive from pi+ and p (VI) 79 79 // 14-01-07 use SetEmModel() and SetFluctModel() from G4VEnergyLossProcess (mma) 80 // 12-09-08 Removed CorrectionsAlongStep (VI) 80 81 // 81 82 // ------------------------------------------------------------------- … … 90 91 #include "G4BraggModel.hh" 91 92 #include "G4BetheBlochModel.hh" 93 #include "G4IonFluctuations.hh" 92 94 #include "G4UniversalFluctuation.hh" 93 95 #include "G4BohrFluctuations.hh" … … 95 97 #include "G4PionPlus.hh" 96 98 #include "G4PionMinus.hh" 97 #include "G4LossTableManager.hh" 99 #include "G4KaonPlus.hh" 100 #include "G4KaonMinus.hh" 98 101 99 102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 103 106 G4hIonisation::G4hIonisation(const G4String& name) 104 107 : G4VEnergyLossProcess(name), 105 theParticle(0),106 theBaseParticle(0),107 isInitialised(false) 108 { 109 SetStepFunction(0.2, 1*mm);110 SetIntegral(true);111 Set VerboseLevel(1);108 isInitialised(false), 109 nuclearStopping(true) 110 { 111 // SetStepFunction(0.2, 1.0*mm); 112 //SetIntegral(true); 113 //SetVerboseLevel(1); 114 SetProcessSubType(fIonisation); 112 115 mass = 0.0; 113 116 ratio = 0.0; 114 corr = G4LossTableManager::Instance()->EmCorrections();115 nuclearStopping = true;116 117 } 117 118 … … 120 121 G4hIonisation::~G4hIonisation() 121 122 {} 123 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 126 G4bool G4hIonisation::IsApplicable(const G4ParticleDefinition& p) 127 { 128 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV && 129 !p.IsShortLived()); 130 } 131 132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 133 134 G4double G4hIonisation::MinPrimaryEnergy(const G4ParticleDefinition*, 135 const G4Material*, 136 G4double cut) 137 { 138 G4double x = 0.5*cut/electron_mass_c2; 139 G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio)); 140 return mass*(g - 1.0); 141 } 122 142 123 143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 127 147 const G4ParticleDefinition* bpart) 128 148 { 129 if(isInitialised) return; 130 131 theParticle = part; 132 133 G4String pname = part->GetParticleName(); 134 135 // standard base particles 136 if(part == bpart || pname == "proton" || 137 pname == "anti_proton" || pname == "pi+" || pname == "pi-" ) 138 theBaseParticle = 0; 139 140 // select base particle 141 else if(bpart == 0) { 142 143 if(pname == "kaon+") theBaseParticle = G4PionPlus::PionPlus(); 144 else if(pname == "kaon-") theBaseParticle = G4PionMinus::PionMinus(); 145 else if(part->GetPDGCharge() > 0.0) theBaseParticle = G4Proton::Proton(); 146 else theBaseParticle = G4AntiProton::AntiProton(); 147 148 } else theBaseParticle = bpart; 149 150 SetBaseParticle(theBaseParticle); 151 SetSecondaryParticle(G4Electron::Electron()); 152 mass = theParticle->GetPDGMass(); 153 ratio = electron_mass_c2/mass; 154 massratio = 1.0; 155 if(theBaseParticle) massratio = theBaseParticle->GetPDGMass()/mass; 156 157 if (!EmModel(1)) SetEmModel(new G4BraggModel(),1); 158 EmModel(1)->SetLowEnergyLimit(100*eV); 159 eth = 2.0*MeV*mass/proton_mass_c2; 160 ethnuc = eth*50.0; 161 EmModel(1)->SetHighEnergyLimit(eth); 162 if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation()); 163 AddEmModel(1, EmModel(1), FluctModel()); 164 165 if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 166 EmModel(2)->SetLowEnergyLimit(eth); 167 EmModel(2)->SetHighEnergyLimit(100*TeV); 168 AddEmModel(2, EmModel(2), FluctModel()); 169 170 isInitialised = true; 149 if(!isInitialised) { 150 151 const G4ParticleDefinition* theBaseParticle = 0; 152 G4String pname = part->GetParticleName(); 153 154 // standard base particles 155 if(part == bpart || pname == "proton" || 156 pname == "anti_proton" || 157 pname == "pi+" || pname == "pi-" || 158 pname == "kaon+" || pname == "kaon-") 159 { 160 theBaseParticle = 0; 161 } 162 // select base particle 163 else if(bpart == 0) { 164 165 if(part->GetPDGSpin() == 0.0) 166 if(part->GetPDGCharge() > 0.0 ) { 167 theBaseParticle = G4KaonPlus::KaonPlus(); 168 } else { 169 theBaseParticle = G4KaonMinus::KaonMinus(); 170 } 171 else if(part->GetPDGCharge() > 0.0) { 172 theBaseParticle = G4Proton::Proton(); 173 } else { 174 theBaseParticle = G4AntiProton::AntiProton(); 175 } 176 // base particle defined by interface 177 } else { 178 theBaseParticle = bpart; 179 } 180 SetBaseParticle(theBaseParticle); 181 SetSecondaryParticle(G4Electron::Electron()); 182 183 mass = part->GetPDGMass(); 184 ratio = electron_mass_c2/mass; 185 186 if(mass < 900.*MeV) nuclearStopping = false; 187 188 if (!EmModel(1)) SetEmModel(new G4BraggModel(),1); 189 EmModel(1)->SetLowEnergyLimit(MinKinEnergy()); 190 191 // model limit defined for protons 192 eth = (EmModel(1)->HighEnergyLimit())*mass/proton_mass_c2; 193 EmModel(1)->SetHighEnergyLimit(eth); 194 AddEmModel(1, EmModel(1), new G4IonFluctuations()); 195 196 if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation()); 197 198 if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 199 EmModel(2)->SetLowEnergyLimit(eth); 200 EmModel(2)->SetHighEnergyLimit(MaxKinEnergy()); 201 AddEmModel(2, EmModel(2), FluctModel()); 202 203 isInitialised = true; 204 } 205 EmModel(1)->ActivateNuclearStopping(nuclearStopping); 206 EmModel(2)->ActivateNuclearStopping(nuclearStopping); 171 207 } 172 208 … … 175 211 void G4hIonisation::PrintInfo() 176 212 { 177 if(EmModel(1) && EmModel(2)) 178 G4cout << " Scaling relation is used from proton dE/dx and range." 179 << "\n Delta cross sections and sampling from " 180 << EmModel(2)->GetName() << " model for scaled energy > " 181 << eth/MeV << " MeV" 182 << "\n Parametrisation from " 183 << EmModel(1)->GetName() << " for protons below." 184 << " NuclearStopping= " << nuclearStopping 213 if(EmModel(1) && EmModel(2)) { 214 G4cout << " NuclearStopping= " << nuclearStopping 185 215 << G4endl; 186 }187 188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....189 190 void G4hIonisation::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,191 const G4DynamicParticle* dp,192 G4double& eloss,193 G4double& s)194 {195 G4double ekin = dp->GetKineticEnergy();196 if(nuclearStopping && ekin < ethnuc) {197 G4double nloss = s*corr->NuclearDEDX(theParticle,couple->GetMaterial(),198 ekin - eloss*0.5);199 eloss += nloss;200 // G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy201 // << " de= " << eloss << " NIEL= " << nloss << G4endl;202 fParticleChange.ProposeNonIonizingEnergyDeposit(nloss);203 216 } 204 217 } -
trunk/source/processes/electromagnetic/standard/src/G4hMultipleScattering.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4hMultipleScattering.cc,v 1. 7 2007/12/07 17:35:52vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4hMultipleScattering.cc,v 1.13 2008/10/15 17:53:44 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ----------------------------------------------------------------------------- … … 58 58 : G4VMultipleScattering(processName) 59 59 { 60 dtrl = 0.05; 61 lambdalimit = 1.*mm; 62 63 samplez = false ; 64 isInitialized = false; 65 66 SetLateralDisplasmentFlag(true); 67 SetSkin(0.0); 68 SetRangeFactor(0.2); 69 SetGeomFactor(0.1); 60 isInitialized = false; 61 isIon = false; 70 62 SetStepLimitType(fMinimal); 71 63 } … … 89 81 // Modification of parameters between runs 90 82 if(isInitialized) { 91 if (p->GetParticleType() != "nucleus" ) {83 if (p->GetParticleType() != "nucleus" && p->GetPDGMass() < GeV) { 92 84 mscUrban->SetStepLimitType(StepLimitType()); 93 85 mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag()); … … 99 91 } 100 92 93 // defaults for ions, which cannot be overwritten 94 if (p->GetParticleType() == "nucleus" || p->GetPDGMass() > GeV) { 95 SetStepLimitType(fMinimal); 96 SetLateralDisplasmentFlag(false); 97 SetBuildLambdaTable(false); 98 if(p->GetParticleType() == "nucleus") isIon = true; 99 } 100 101 101 // initialisation of parameters 102 102 G4String part_name = p->GetParticleName(); 103 mscUrban = new G4UrbanMscModel90( RangeFactor(),dtrl,lambdalimit,104 GeomFactor(),Skin(), 105 samplez,StepLimitType());103 mscUrban = new G4UrbanMscModel90(); 104 105 mscUrban->SetStepLimitType(StepLimitType()); 106 106 mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag()); 107 mscUrban->SetSkin(Skin()); 108 mscUrban->SetRangeFactor(RangeFactor()); 109 mscUrban->SetGeomFactor(GeomFactor()); 107 110 108 if (p->GetParticleType() == "nucleus") {109 mscUrban->SetStepLimitType(fMinimal);110 SetLateralDisplasmentFlag(false);111 SetBuildLambdaTable(false);112 SetSkin(0.0);113 SetRangeFactor(0.2);114 }115 111 AddEmModel(1,mscUrban); 116 112 isInitialized = true; … … 121 117 void G4hMultipleScattering::PrintInfo() 122 118 { 123 G4cout << " Boundary/stepping algorithm is active with RangeFactor= " 124 << RangeFactor() 125 << " Step limit type " << StepLimitType() 119 G4cout << " RangeFactor= " << RangeFactor() 120 << ", step limit type: " << StepLimitType() 121 << ", lateralDisplacement: " << LateralDisplasmentFlag() 122 << ", skin= " << Skin() 123 // << ", geomFactor= " << GeomFactor() 126 124 << G4endl; 127 125 } … … 129 127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 130 128 129 G4double G4hMultipleScattering::AlongStepGetPhysicalInteractionLength( 130 const G4Track& track, 131 G4double, 132 G4double currentMinimalStep, 133 G4double& currentSafety, 134 G4GPILSelection* selection) 135 { 136 // get Step limit proposed by the process 137 valueGPILSelectionMSC = NotCandidateForSelection; 138 139 G4double escaled = track.GetKineticEnergy(); 140 if(isIon) escaled *= track.GetDynamicParticle()->GetMass()/proton_mass_c2; 141 142 G4double steplength = GetMscContinuousStepLimit(track, 143 escaled, 144 currentMinimalStep, 145 currentSafety); 146 // G4cout << "StepLimit= " << steplength << G4endl; 147 // set return value for G4GPILSelection 148 *selection = valueGPILSelectionMSC; 149 return steplength; 150 } 151 152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 153 -
trunk/source/processes/electromagnetic/standard/src/G4ionGasIonisation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ionGasIonisation.cc,v 1. 4 2008/01/14 11:59:45vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4ionGasIonisation.cc,v 1.14 2008/09/12 16:26:34 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 56 56 57 57 G4ionGasIonisation::G4ionGasIonisation(const G4String& name) 58 : G4ionIonisation(name), 59 currParticle(0), 60 baseParticle(0), 61 initialised(false) 58 : G4ionIonisation(name) 62 59 { 63 atomXS = CLHEP::pi*CLHEP::Bohr_radius*CLHEP::Bohr_radius;64 verboseLevel = 1;65 60 } 66 61 … … 70 65 {} 71 66 72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 73 74 void G4ionGasIonisation::InitialiseEnergyLossProcess( 75 const G4ParticleDefinition* part, 76 const G4ParticleDefinition* bpart) 77 { 78 G4ionIonisation::InitialiseEnergyLossProcess(part, bpart); 79 if(initialised) return; 80 81 currParticle = part; 82 83 if(part == bpart || part == G4GenericIon::GenericIon()) baseParticle = 0; 84 else if(bpart == 0) baseParticle = G4GenericIon::GenericIon(); 85 else baseParticle = bpart; 86 87 if(baseParticle) basePartMass = baseParticle->GetPDGMass(); 88 else basePartMass = currParticle->GetPDGMass(); 89 90 initialised = true; 91 } 92 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 94 95 void G4ionGasIonisation::PrintInfo() 96 { 97 G4ionIonisation::PrintInfo(); 98 G4cout << " Version of ion process with simulation discrete ion/media change exchange." 99 << G4endl; 100 } 101 102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 103 104 void G4ionGasIonisation::InitialiseMassCharge(const G4Track& track) 105 { 106 // First step of an ion 107 if(track.GetCurrentStepNumber() == 1) { 108 currParticle = track.GetDefinition(); 109 ionZ = G4int(currParticle->GetPDGCharge()/eplus + 0.5); 110 currentIonZ = G4int(track.GetDynamicParticle()->GetCharge()/eplus + 0.5); 111 currMassRatio = basePartMass/currParticle->GetPDGMass(); 112 } 113 // any step 114 G4double q = eplus*currentIonZ; 115 SetDynamicMassCharge(currMassRatio, q*q); 116 preStepKinEnergy = track.GetKineticEnergy(); 117 } 118 119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 120 121 void G4ionGasIonisation::CorrectionsAlongStep(const G4MaterialCutsCouple* couple, 122 const G4DynamicParticle* dp, 123 G4double& eloss, 124 G4double& s) 125 { 126 const G4ParticleDefinition* part = dp->GetDefinition(); 127 const G4Material* mat = couple->GetMaterial(); 128 // add corrections 129 if(eloss < preStepKinEnergy) { 130 131 // use Bethe-Bloch with corrections 132 if(preStepKinEnergy*currMassRatio > BetheBlochEnergyThreshold()) 133 eloss += s*corr->HighOrderCorrections(part,mat,preStepKinEnergy); 134 135 // effective number of collisions 136 G4double x = mat->GetElectronDensity()*s*atomXS; 137 // equilibrium charge 138 G4double q = fParticleChange.GetProposedCharge(); 139 140 // sample charge change during the step 141 fParticleChange.SetProposedCharge(SampleChargeAfterStep(q, x)); 142 } 143 144 // use nuclear stopping 145 if(NuclearStoppingFlag()) { 146 G4double nloss = s*corr->NuclearDEDX(part,mat,preStepKinEnergy - eloss*0.5); 147 eloss += nloss; 148 fParticleChange.ProposeNonIonizingEnergyDeposit(nloss); 149 } 150 } 151 67 /* 152 68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 153 69 … … 157 73 // xeff - effective number of collisions 158 74 // q - current charge 159 G4double q = eplus*currentIonZ; 75 G4double q = G4double(currentIonZ); 76 if(qeff > q) { 77 if(G4UniformRand() < qeff - q) currentIonZ++; 78 } else { 79 if(G4UniformRand() < q - qeff) currentIonZ--; 80 } 81 82 q = eplus*currentIonZ; 160 83 if(verboseLevel > 1) G4cout << "G4ionGasIonisation: Q1= " << currentIonZ 161 84 << " Qeff= " << qeff/eplus << " Neff= " << xeff … … 163 86 return q; 164 87 } 165 88 */ 166 89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/standard/src/G4ionIonisation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ionIonisation.cc,v 1. 45.2.2 2008/04/25 00:34:55vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4ionIonisation.cc,v 1.66 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 55 55 // 16-05-07 Add data for light ion stopping only for GenericIon (V.Ivantchenko) 56 56 // 07-11-07 Fill non-ionizing energy loss (V.Ivantchenko) 57 // 12-09-08 Removed InitialiseMassCharge and CorrectionsAlongStep (VI) 57 58 // 58 59 // … … 65 66 #include "G4Electron.hh" 66 67 #include "G4Proton.hh" 68 //#include "G4Alpha.hh" 67 69 #include "G4GenericIon.hh" 68 70 #include "G4BraggModel.hh" 69 71 #include "G4BraggIonModel.hh" 70 72 #include "G4BetheBlochModel.hh" 71 #include "G4IonFluctuations.hh"72 73 #include "G4UnitsTable.hh" 73 74 #include "G4LossTableManager.hh" 74 75 #include "G4WaterStopping.hh" 76 #include "G4EmCorrections.hh" 77 #include "G4IonFluctuations.hh" 75 78 76 79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 80 83 G4ionIonisation::G4ionIonisation(const G4String& name) 81 84 : G4VEnergyLossProcess(name), 85 corr(0), 82 86 theParticle(0), 83 theBaseParticle(0),84 87 isInitialised(false), 85 88 stopDataActive(true), … … 89 92 SetStepFunction(0.1, 0.1*mm); 90 93 SetIntegral(true); 91 SetVerboseLevel(1); 94 SetProcessSubType(fIonisation); 95 // SetVerboseLevel(1); 92 96 corr = G4LossTableManager::Instance()->EmCorrections(); 93 97 } … … 100 104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 101 105 106 G4bool G4ionIonisation::IsApplicable(const G4ParticleDefinition& p) 107 { 108 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived() && 109 p.GetParticleType() == "nucleus"); 110 } 111 112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 113 114 G4double G4ionIonisation::MinPrimaryEnergy(const G4ParticleDefinition* p, 115 const G4Material*, 116 G4double cut) 117 { 118 return 119 p->GetPDGMass()*(std::sqrt(1. + 0.5*cut/CLHEP::electron_mass_c2) - 1.0); 120 } 121 122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 123 102 124 void G4ionIonisation::InitialiseEnergyLossProcess( 103 125 const G4ParticleDefinition* part, 104 126 const G4ParticleDefinition* bpart) 105 127 { 106 if(isInitialised) return;128 const G4ParticleDefinition* ion = G4GenericIon::GenericIon(); 107 129 108 theParticle = part;130 if(!isInitialised) { 109 131 110 if(part == bpart || part == G4GenericIon::GenericIon()) theBaseParticle = 0; 111 else if(bpart == 0) theBaseParticle = G4GenericIon::GenericIon(); 112 else theBaseParticle = bpart; 132 theParticle = part; 133 //G4String pname = part->GetParticleName(); 113 134 114 SetBaseParticle(theBaseParticle);115 SetSecondaryParticle(G4Electron::Electron());135 // define base particle 136 const G4ParticleDefinition* theBaseParticle = 0; 116 137 117 if(theBaseParticle) baseMass = theBaseParticle->GetPDGMass(); 118 else baseMass = theParticle->GetPDGMass(); 119 120 if (!EmModel(1)) SetEmModel(new G4BraggIonModel(),1); 121 EmModel(1)->SetLowEnergyLimit(100*eV); 122 eth = 2.0*MeV; 123 EmModel(1)->SetHighEnergyLimit(eth); 124 if (!FluctModel()) SetFluctModel(new G4IonFluctuations()); 125 AddEmModel(1, EmModel(1), FluctModel()); 138 if(part == ion) theBaseParticle = 0; 139 else if(bpart == 0) theBaseParticle = ion; 140 else theBaseParticle = bpart; 126 141 127 if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 128 EmModel(2)->SetLowEnergyLimit(eth); 129 EmModel(2)->SetHighEnergyLimit(100*TeV); 130 AddEmModel(2, EmModel(2), FluctModel()); 142 SetBaseParticle(theBaseParticle); 143 SetSecondaryParticle(G4Electron::Electron()); 131 144 132 // Add ion stoping tables for Generic Ion 133 if(part == G4GenericIon::GenericIon()) { 134 G4WaterStopping ws(corr); 135 effCharge = corr->GetIonEffectiveCharge(EmModel(1)); 136 } else { 137 effCharge = corr->GetIonEffectiveCharge(0); 145 if (!EmModel(1)) SetEmModel(new G4BraggIonModel(), 1); 146 EmModel(1)->SetLowEnergyLimit(MinKinEnergy()); 147 148 // model limit defined for protons 149 eth = (EmModel(1)->HighEnergyLimit())*part->GetPDGMass()/proton_mass_c2; 150 EmModel(1)->SetHighEnergyLimit(eth); 151 152 if (!FluctModel()) SetFluctModel(new G4IonFluctuations()); 153 AddEmModel(1, EmModel(1), FluctModel()); 154 155 if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 156 EmModel(2)->SetLowEnergyLimit(eth); 157 EmModel(2)->SetHighEnergyLimit(MaxKinEnergy()); 158 AddEmModel(2, EmModel(2), FluctModel()); 159 160 // Add ion stoping tables for Generic Ion 161 if(part == ion) { 162 G4WaterStopping ws(corr); 163 corr->SetIonisationModels(EmModel(1),EmModel(2)); 164 } 165 isInitialised = true; 138 166 } 139 140 isInitialised = true; 167 // reinitialisation of corrections for the new run 168 EmModel(1)->ActivateNuclearStopping(nuclearStopping); 169 EmModel(2)->ActivateNuclearStopping(nuclearStopping); 170 if(part == ion) corr->InitialiseForNewRun(); 141 171 } 142 172 … … 145 175 void G4ionIonisation::PrintInfo() 146 176 { 147 if(EmModel(1) && EmModel(2)) 148 G4cout << " Scaling relation is used from proton dE/dx and range." 149 << "\n Delta cross sections and sampling from " 150 << EmModel(2)->GetName() << " model for scaled energy > " 151 << eth/MeV << " MeV" 152 << "\n Parametrisation from " 153 << EmModel(1)->GetName() << " for protons below." 154 << " NuclearStopping= " << nuclearStopping 155 << G4endl; 156 if (stopDataActive) 157 G4cout << "\n Stopping Power data for " 177 if (stopDataActive && G4GenericIon::GenericIon() == theParticle) { 178 G4cout << " Stopping Power data for " 158 179 << corr->GetNumberOfStoppingVectors() 159 << " ion/material pairs are used."180 << " ion/material pairs, nuclearStopping: " << nuclearStopping 160 181 << G4endl; 182 } 161 183 } 162 184 … … 165 187 void G4ionIonisation::AddStoppingData(G4int Z, G4int A, 166 188 const G4String& mname, 167 G4PhysicsVector &dVector)189 G4PhysicsVector* dVector) 168 190 { 169 191 corr->AddStoppingData(Z, A, mname, dVector); … … 171 193 172 194 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 173 174 void G4ionIonisation::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,175 const G4DynamicParticle* dp,176 G4double& eloss,177 G4double& s)178 {179 const G4ParticleDefinition* part = dp->GetDefinition();180 const G4Material* mat = couple->GetMaterial();181 if(eloss < preKinEnergy) {182 // G4cout << "e= " << preKinEnergy << " ratio= " << massRatio << " eth= " << eth<< G4endl;183 if(preKinEnergy*massRatio > eth)184 eloss += s*corr->HighOrderCorrections(part,mat,preKinEnergy);185 else {186 187 if(stopDataActive)188 eloss *= corr->EffectiveChargeCorrection(part,mat,preKinEnergy);189 190 }191 fParticleChange.SetProposedCharge(effCharge->EffectiveCharge(part,192 mat,preKinEnergy-eloss));193 }194 if(nuclearStopping && preKinEnergy*massRatio < 50.*eth*charge2) {195 G4double nloss = s*corr->NuclearDEDX(part,mat,preKinEnergy - eloss*0.5);196 eloss += nloss;197 // G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy198 // << " de= " << eloss << " NIEL= " << nloss << G4endl;199 fParticleChange.ProposeNonIonizingEnergyDeposit(nloss);200 }201 }202 203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/utils/History
r819 r961 1 $Id: History,v 1.3 08.2.1 2008/04/22 15:28:12vnivanch Exp $1 $Id: History,v 1.372 2009/02/26 11:33:33 vnivanch Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 18 18 ---------------------------------------------------------- 19 19 20 22 April 08: V.Ivant (emutils-V09-00-14) 21 - G4EmCorrections - set finite size correction to zero (provides 22 flat distribution of vertex detector response 23 for high energy hadrons) 24 - G4ionEffectiveCharge - minor change of numerical constants to provide 25 a continuous change of charge versus energy 26 20 26 February 09: V.Ivant (emutils-V09-02-03) 21 G4EmConfigurator - fixed for the case if only fluctuation model is set 22 and main model is default 23 24 22 February 09: V.Ivant (emutils-V09-02-02) 25 - G4VEmModel - make methods to access geometry protected, added new 26 method SetSampleZ, added geommax private member 27 - G4EmCalculator - added possibility to be used by DNA processes: 28 take into account special DNA particles 29 30 18 February 09: V.Ivant (emutils-V09-02-01) 31 G4VEmModel, G4VEmFluctuationModel, G4VEnegryLossProcess, G4VEmProcess, 32 G4VMultipleScattering - move all virtual methods to source, update comments 33 G4VEmModel - added flagDeexcitation and Get/Set methods 34 G4VEnegryLossProcess, G4VEmProcess - added calls to deexcitation PostStep 35 G4EmProcessOptions - added ActivateDeexcitation method 36 G4EnergyLossMessenger - added /process/em/deexcitation UI command 37 G4LossTableBuilder - added protection in BuildRangeTable against zero dedx 38 39 27 January 09: V.Ivant (emutils-V09-02-00) 40 G4VEmModel - added method SampleDeexcitationAlongStep 41 G4VEnegryLossProcess - added deexcitation AlongStep per region 42 G4VMscModel - added methdos: InitialiseSafetyHelper, ComputeSafety, 43 ComputeGeomLimit, ComputeDisplacement 44 G4VEmProcess - added possibility to set more than 1 model 45 46 20 November 08: V.Ivant (emutils-V09-01-37) 47 G4EmConfigurator - fixed energy interval selection for a model 48 G4VMultipleScattering - set process sub-type 10 to distinguish with 49 single Coulomb scattering 50 51 13 Novemver 08: A.Schaelicke (emutils-V09-01-36) 52 G4LossTableManager - changed default LPM effect to ON again 53 G4VEmModel - (VI) add LPM flag and Get/Set methods 54 55 12 November 08: V.Ivant (emutils-V09-01-35) 56 G4VEmModel - fixed memory leak by destruction G4EmElementSelectors 57 G4EmSaturation - activate saturation for energy deposition due to 58 photo-electric effect 59 60 24 October 08: V.Ivant (emutils-V09-01-34) 61 G4EmProcessSubType - moved optical processes enumeration to optical directory 62 63 20 October 08: V.Ivant (emutils-V09-01-33) 64 G4EnergyLossMessenger - added /process/em/applyCuts command 65 66 17 October 08: V.Ivant (emutils-V09-01-32) 67 G4VEnergyLossProcess, G4VEmProcess, G4VMultipleScattering set number 68 of bins for tables 7 per decade 69 70 15 October 08: V.Ivant (emutils-V09-01-31) 71 G4VEnergyLossProcess, G4VEmProcess, G4VMultipleScattering improved cout 72 73 14 October 08: V.Ivant (emutils-V09-01-30) 74 G4VEmModel - add secondaryThreshold variable and Get/Set methods 75 G4EmCorrections - define the range of correction vector 25 keV - 2.5 MeV, 76 as it is in ICRU'73 table, use 20 bins 77 G4LossTableManager - set spline option "true" and flagLPM "false" by default 78 G4VEnergyLossProcess, G4VEmProcess, G4VMultipleScattering set default 79 table size 0.1 keV - 100 TeV in 60 bins 80 G4EmModelManager - included G4EmProcessSubType.hh header 81 G4EmTableType.hh - changed enumeration names fIonisation -> fIsIonisation, 82 fSubIonisation -> fIsSubIonisation to avoid clash with 83 sub-type enumeration name 84 85 21 September 08: V.Ivant (emutils-V09-01-29) 86 G4EmCorrections - do not compute ion corrections if for ions 87 G4hIonisation process is used 88 89 21 September 08: V.Ivant (emutils-V09-01-28) 90 G4ionEffectiveCharge - remove chargeFactor - return to 01-25 91 G4VEnergyLossProcess - fixed initialisation; 92 93 12 September 08: V.Ivant (emutils-V09-01-27) 94 G4VEmProcess - improved verbose output 95 G4VEnergyLossProcess - added pointer to current G4VEmModel; 96 removed method CorrectionsAlongStep, instead 97 corresponding method of a model are used; 98 improved verbose output 99 G4VEmFluctuationModel - added method SetParticleAndCharge 100 G4VEmModel - minor optimisations of SelectRandomAtom and SelectIsotope; 101 added methods GetParticleCharge, GetChargeSquareRatio, 102 CorrectionsAlongStep, ActivateNuclearStopping needed for 103 simulation of ion transport 104 G4EmCorrections - added interfaces to effective charge 105 G4ionEffectiveCharge - added variable chargeFactor to be used for He ions 106 107 29 August 08: V.Ivant (emutils-V09-01-26) 108 G4VEmProcess, G4VMultipleScattering, G4VEnergyLossProcess - use 109 new DumpModelList method from G4EmModelManager 110 in the verbosity output 111 G4EmModelManager - fixed crash in destructor when verbosity > 1; 112 fixed selection of models per energy; 113 update printout with DumpModelList method 114 115 21 August 08: V.Ivant (emutils-V09-01-25) 116 G4VEmModel - add parameter kinEnergy to SetupMaterial method; 117 set pointer currentElement in ComputeCrossSectionPerAtom 118 G4EmElementSelector - update usage of methods SetupMaterial and 119 ComputeCrossSectionPerAtom 120 121 3 August 08: V.Ivant (emutils-V09-01-24) 122 G4EmCorrections - dEdx data for ions are initialised at the start of a run for 123 materials used in geometry; search for ion/material pairs updated 124 G4EmCalculator - improved cout 125 126 31 July 08: V.Ivant (emutils-V09-01-23) 127 G4VEmProcess, G4VMultipleScattering, G4VEnergyLossProcess - use verbosity flag 128 for GetEmModel method 129 G4VEmModel - use stl vector for cross sections instead of array 130 131 21 July 08: V.Ivant (emutils-V09-01-22) 132 G4VEmModel - added vector of G4ElementSelectors, in which vectors 133 of relative cross sections per elements of a compound 134 material are stored; added new methods: 135 InitialisaElementSelectors and SelectRandomAtom, 136 G4LossTableBuilder - remove dependence on G4LossTableManager 137 G4LossTableManager - propagated spline flag to G4LossTableBuilder 138 139 15 July 08: V.Ivant (emutils-V09-01-21) 140 G4EmConfigurator - a new helper class to add model per particle type, 141 process, energy range and G4Region 142 G4VEmProcess, G4VEnergyLossProcess - renamed and improved method 143 "MicroscopicCrossSection" by "CrossSectionPerVolume" 144 G4VEmModel, G4VEmProcess, G4VMultipleScattering, G4VEnergyLossProcess 145 reodering of members of classes and improved comments: 146 - separated members fixed at construction, defined at 147 ininitialisation, and modified in run time 148 - improved comments in header files 149 G4LossTableManager - added register/deregister mechanism and deletion 150 at the end of job for G4VEmModel 151 G4EmModelManager - does not delete models anymore 152 153 9 July 08: V.Ivant (emutils-V09-01-20) 154 G4ElectronIonPair - a new helper class to sample number of primary ionisations 155 in detectors 156 157 8 July 08: V.Ivant (emutils-V09-01-19) 158 G4VEmModel - added inline method ComputeCrossSectionPerAtom 159 G4LossTableManager and G4EnergyLossTable - remove call to exit() 160 161 9 June 08: V.Ivant (emutils-V09-01-18) 162 G4ionEffectiveCharge - return back Ziegler formula for effective charge of ions; 163 min effective charge is 1.0 (instead of 0.1) 164 G4EmCorrections - a minor change of the scale for external ion data 165 166 2 June 08: V.Ivant (emutils-V09-01-17) 167 G4ionEffectiveCharge - use simplified formula for effective charge of ions 168 169 28 May 08: V.Ivant (emutils-V09-01-16) 170 G4VEmModel - added virtual method SetupForMaterial 171 G4EmElementSelector - helper class to sample random G4Element in a 172 compound material 173 174 28 May 08: V.Ivant (emutils-V09-01-15) 175 G4VEnergyLossProcess - fixed problem of subcutoff option for ions (ion 176 ranges were wrong) 177 G4LossableBuilder - use more precise algorith to compute range for the 178 case, when spline is used 179 180 20 May 08: V.Ivant (emutils-V09-01-14) 181 - G4EmCorrections - computation of the finite size correction is moved to 182 the Bethe-Bloch model 183 184 11 May 08: V.Ivant (emutils-V09-01-13) 185 - G4VMultipleScattering - make AlongStepGetPhysicalInteractionLength 186 method virtual allowing to overwrite it by a derived class - 187 needed for ion simulation 188 - G4EmCalculator - fixed bug in computation for ions 189 190 21 April 08: V.Ivant (emutils-V09-01-12) 191 - G4VEmModel, G4VEmProcess, G4VMultipleScattering, G4EnergyLossMessenger 192 G4EmProcessOptions - introduced polarAngleLimit parameter and Get/Set 193 methods for single and multiple scattering models 194 - G4ionEffectiveCharge - fixed initialisation at first event 195 - G4EmCorrections - review and fix computation of high order corrections 196 for ions 197 - G4EmCalculator - updated computations for ions 198 199 08 April 08: V.Ivant (emutils-V09-01-11) 200 - G4VEnergyLossProcess, G4VEmProcess, G4VMultipleScattering, 201 G4LossTableBuilder - introduced spline 202 203 25 March 08: V.Ivant (emutils-V09-01-10) 204 - G4EmCorrections - precompute EM formfactor for corrections 205 - G4VEnergyLossProcess - store bremsstrahlung cross sections 206 207 25 March 08: V.Ivant (emutils-V09-01-09) 208 - G4EmCorrections - added cut dependence into finite size correction 209 - G4VEnergyLossProcess - added cout of linLossLimit 210 211 17 March 08: V.Ivant (emutils-V09-01-08) 212 - G4EmSaturation - added interface with G4Step 213 214 14 March 08: mma (emutils-V09-01-07) 215 - modifs in G4EmSaturation 216 217 14 March 08: V.Ivant (emutils-V09-01-06) 218 - G4EmSaturation - added computation of the average recoil mass, 219 use Birks coefficient from G4Material 220 - G4LossTableManager - fixed logic in compute dedx table for an 221 inactive process 222 223 10 March 08: V.Ivant (emutils-V09-01-05) 224 - G4LossTableManager, G4EmProcessOptions - added Set/Get spline flag 225 - G4EnergyLossMessenger - added a command "/process/em/spline" 226 - G4VMultipleScattering - SetSkin method does not change 227 StepLimitType anymore 228 - G4VMscModel - new class to define general msc parameters 229 230 21 February 08: V.Ivant (emutils-V09-01-04) 231 - G4EmSaturation - fixed initialisation problem 232 233 21 February 08: V.Ivant (emutils-V09-01-03) 234 - G4EmCorrections - added correction on effective charge for NIST 235 materials in the IonHighOrderCorrections method 236 - G4EmSaturation - new helper class 237 - G4LossTableManager - added GetEmSaturation method 238 239 14 February 08: V.Ivant (emutils-V09-01-02) 240 - G4EmCorrections - added IonBarkasCorrection, IonHighOrderCorrections 241 and ComputeIonCorrections methods in order to provide a smooth transition 242 between low-energy parameterization and Bethe-Bloch model 243 - G4ionEffectiveCharge - use precomputed Z^1/3 values, use expantions 244 of exp and pow functions, do not perform recomputation if arguments 245 of methods unchanged 246 247 04 February 08: V.Ivant (emutils-V09-01-01) 248 - G4VEnergyLossProcess - fixed computation of NIEL at the last step 249 of a particle 250 27 251 11 January 08: V.Ivant (emutils-V09-01-00) 28 252 - G4EmCorrections - improve CPU by usage expansions and precalculated … … 33 257 09 November 07: V.Ivant (emutils-V09-00-13) 34 258 - G4VMultipleScattering - set at initialisation that scattering may be 35 off electrons (needed for single scattering)259 off lectrons (needed for single scattering) 36 260 - G4EmModelmanager - add pointers to G4Gamma and G4Positron at 37 261 initialisation … … 39 263 07 November 07: V.Ivant (emutils-V09-00-12) 40 264 - G4VEnergyLossProcess - simplify logic to switch on/off fluctuations 41 - G4EmProcessOptions - add forgot ten initialisation of G4LossTableManager265 - G4EmProcessOptions - add forgoten initialisation of G4LossTableManager 42 266 parameters together with parameters of concrete 43 267 processes (fixed initialisation when options 44 defined before proce sses are instantiated)268 defined before proceeses are instantiated) 45 269 46 270 29 October 07: V.Ivant (emutils-V09-00-11) … … 75 299 - G4VEnergyLossProcess and G4VEmProcess - fixed handling zero cross 76 300 section in PostStepGetPhysicalInteractionLength method to avoid problem 77 happ ens in FanoCavity example when cross section inside cavity is zero301 happans in FanoCavity example when cross section inside cavity is zero 78 302 - G4VEmModel - compare cross section with DBL_MIN instead of zero 79 303 … … 124 348 void, extra parameter std::vector<G4DynamicParticle*>*, this vector 125 349 is now a member of base class G4VEnergyLossProcess, G4VEmProcess, 126 no new and delete of the vector in the run time. About 5% spe edup350 no new and delete of the vector in the run time. About 5% speadup 127 351 of EM shower simulation 128 352 - G4VEnergyLossProcess, G4VEmProcess, G4VMultipleScattering modified -
trunk/source/processes/electromagnetic/utils/include/G4DummyModel.hh
r819 r961 25 25 // 26 26 // $Id: G4DummyModel.hh,v 1.3 2007/05/22 17:31:57 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4EmCalculator.hh
r819 r961 25 25 // 26 26 // $Id: G4EmCalculator.hh,v 1.18 2007/03/15 12:34:46 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // -
trunk/source/processes/electromagnetic/utils/include/G4EmCorrections.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmCorrections.hh,v 1. 10 2008/01/11 19:55:29vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4EmCorrections.hh,v 1.24 2008/09/12 14:44:48 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 41 41 // 28.04.2006 General cleanup, add finite size corrections (V.Ivanchenko) 42 42 // 13.05.2006 Add corrections for ion stopping (V.Ivanhcenko) 43 // 20.05.2008 Removed Finite Size correction (V.Ivanchenko) 44 // 12.09.2008 Added inlined interfaces to effective charge (V.Ivanchenko) 43 45 // 44 46 // Class Description: … … 58 60 #include "G4Material.hh" 59 61 #include "G4ParticleDefinition.hh" 62 #include "G4NistManager.hh" 60 63 61 64 class G4VEmModel; 62 65 class G4PhysicsVector; 63 66 class G4IonTable; 64 class G4 NistManager;67 class G4MaterialCutsCouple; 65 68 66 69 class G4EmCorrections … … 73 76 virtual ~G4EmCorrections(); 74 77 75 G4double HighOrderCorrections(const G4ParticleDefinition* p, 76 const G4Material* material, 77 G4double kineticEnergy); 78 79 G4double Bethe(const G4ParticleDefinition* p, 80 const G4Material* material, 78 G4double HighOrderCorrections(const G4ParticleDefinition*, 79 const G4Material*, 80 G4double kineticEnergy, 81 G4double cutEnergy); 82 83 G4double IonHighOrderCorrections(const G4ParticleDefinition*, 84 const G4MaterialCutsCouple*, 85 G4double kineticEnergy); 86 87 G4double ComputeIonCorrections(const G4ParticleDefinition*, 88 const G4Material*, 89 G4double kineticEnergy); 90 91 G4double IonBarkasCorrection(const G4ParticleDefinition*, 92 const G4Material*, 93 G4double kineticEnergy); 94 95 G4double Bethe(const G4ParticleDefinition*, 96 const G4Material*, 81 97 G4double kineticEnergy); 82 98 83 G4double SpinCorrection(const G4ParticleDefinition* p,84 const G4Material* material,99 G4double SpinCorrection(const G4ParticleDefinition*, 100 const G4Material*, 85 101 G4double kineticEnergy); 86 102 87 G4double KShellCorrection(const G4ParticleDefinition* p,88 const G4Material* material,103 G4double KShellCorrection(const G4ParticleDefinition*, 104 const G4Material*, 89 105 G4double kineticEnergy); 90 106 91 G4double LShellCorrection(const G4ParticleDefinition* p,92 const G4Material* material,107 G4double LShellCorrection(const G4ParticleDefinition*, 108 const G4Material*, 93 109 G4double kineticEnergy); 94 110 95 G4double ShellCorrection(const G4ParticleDefinition* p,96 const G4Material* material,111 G4double ShellCorrection(const G4ParticleDefinition*, 112 const G4Material*, 97 113 G4double kineticEnergy); 98 114 99 G4double ShellCorrectionSTD(const G4ParticleDefinition* p,100 const G4Material* material,115 G4double ShellCorrectionSTD(const G4ParticleDefinition*, 116 const G4Material*, 101 117 G4double kineticEnergy); 102 118 103 G4double DensityCorrection(const G4ParticleDefinition* p,104 const G4Material* material,119 G4double DensityCorrection(const G4ParticleDefinition*, 120 const G4Material*, 105 121 G4double kineticEnergy); 106 122 107 G4double BarkasCorrection(const G4ParticleDefinition* p,108 const G4Material* material,123 G4double BarkasCorrection(const G4ParticleDefinition*, 124 const G4Material*, 109 125 G4double kineticEnergy); 110 126 111 G4double BlochCorrection(const G4ParticleDefinition* p,112 const G4Material* material,127 G4double BlochCorrection(const G4ParticleDefinition*, 128 const G4Material*, 113 129 G4double kineticEnergy); 114 130 115 G4double MottCorrection(const G4ParticleDefinition* p,116 const G4Material* material,131 G4double MottCorrection(const G4ParticleDefinition*, 132 const G4Material*, 117 133 G4double kineticEnergy); 118 134 119 G4double FiniteSizeCorrection(const G4ParticleDefinition* p, 120 const G4Material* material, 121 G4double kineticEnergy); 122 123 G4double NuclearDEDX(const G4ParticleDefinition* p, 124 const G4Material* material, 135 G4double NuclearDEDX(const G4ParticleDefinition*, 136 const G4Material*, 125 137 G4double kineticEnergy, 126 138 G4bool fluct = true); 127 139 128 140 void AddStoppingData(G4int Z, G4int A, const G4String& materialName, 129 G4PhysicsVector& dVector); 130 141 G4PhysicsVector* dVector); 142 143 void InitialiseForNewRun(); 144 145 // effective charge correction using stopping power data 131 146 G4double EffectiveChargeCorrection(const G4ParticleDefinition*, 132 147 const G4Material*, 133 G4double); 134 135 G4ionEffectiveCharge* GetIonEffectiveCharge(G4VEmModel* m = 0); 136 137 G4int GetNumberOfStoppingVectors(); 148 G4double kineticEnergy); 149 150 // effective charge of an ion 151 inline G4double GetParticleCharge(const G4ParticleDefinition*, 152 const G4Material*, 153 G4double kineticEnergy); 154 155 inline 156 G4double EffectiveChargeSquareRatio(const G4ParticleDefinition*, 157 const G4Material*, 158 G4double kineticEnergy); 159 160 // ionisation models for ions 161 inline void SetIonisationModels(G4VEmModel* m1 = 0, G4VEmModel* m2 = 0); 162 163 inline G4int GetNumberOfStoppingVectors(); 138 164 139 165 private: … … 141 167 void Initialise(); 142 168 143 G4PhysicsVector* InitialiseMaterial(const G4Material* mat);144 145 void SetupKinematics(const G4ParticleDefinition* p,146 const G4Material* material,169 void BuildCorrectionVector(); 170 171 void SetupKinematics(const G4ParticleDefinition*, 172 const G4Material*, 147 173 G4double kineticEnergy); 148 174 … … 207 233 G4double Z23[100]; 208 234 235 std::vector<const G4Material*> currmat; 236 std::vector<G4double> thcorr[100]; 237 size_t ncouples; 238 209 239 const G4ParticleDefinition* particle; 210 240 const G4ParticleDefinition* curParticle; … … 218 248 G4double mass; 219 249 G4double massFactor; 250 G4double formfact; 251 G4double eth; 220 252 G4double tau; 221 253 G4double gamma; … … 225 257 G4double ba2; 226 258 G4double tmax; 227 G4double tmax0;228 259 G4double charge; 229 260 G4double q2; 261 G4double eCorrMin; 262 G4double eCorrMax; 263 G4int nbinCorr; 230 264 231 265 G4AtomicShells shells; … … 234 268 G4NistManager* nist; 235 269 const G4IonTable* ionTable; 236 G4VEmModel* ionModel; 270 G4VEmModel* ionLEModel; 271 G4VEmModel* ionHEModel; 237 272 238 273 // Ion stopping data 239 274 G4int nIons; 240 275 G4int idx; 276 G4int currentZ; 241 277 std::vector<G4int> Zion; 242 278 std::vector<G4int> Aion; 243 279 std::vector<G4String> materialName; 280 281 std::vector<const G4ParticleDefinition*> ionList; 244 282 245 283 std::vector<const G4Material*> materialList; … … 271 309 z21*((xv-x1)*(y2-yv)+(yv-y1)*(x2-xv)))) 272 310 / ((x2-x1)*(y2-y1)); 311 } 312 313 inline 314 void G4EmCorrections::SetIonisationModels(G4VEmModel* m1, G4VEmModel* m2) 315 { 316 if(m1) ionLEModel = m1; 317 if(m2) ionHEModel = m2; 318 } 319 320 inline G4int G4EmCorrections::GetNumberOfStoppingVectors() 321 { 322 return nIons; 323 } 324 325 inline G4double 326 G4EmCorrections::GetParticleCharge(const G4ParticleDefinition* p, 327 const G4Material* mat, 328 G4double kineticEnergy) 329 { 330 return effCharge.EffectiveCharge(p,mat,kineticEnergy); 331 } 332 333 inline G4double 334 G4EmCorrections::EffectiveChargeSquareRatio(const G4ParticleDefinition* p, 335 const G4Material* mat, 336 G4double kineticEnergy) 337 { 338 return effCharge.EffectiveChargeSquareRatio(p,mat,kineticEnergy); 273 339 } 274 340 … … 289 355 G4double ratio = electron_mass_c2/mass; 290 356 tmax = 2.0*electron_mass_c2*bg2 /(1. + 2.0*gamma*ratio + ratio*ratio); 291 tmax0 = tmax;292 357 charge = p->GetPDGCharge()/eplus; 293 if(charge < 1.5) q2 = charge*charge;358 if(charge < 1.5) {q2 = charge*charge;} 294 359 else { 295 360 q2 = effCharge.EffectiveChargeSquareRatio(p,mat,kinEnergy); 296 361 charge = std::sqrt(q2); 297 362 } 298 if(mass > 120.*MeV)299 tmax = std::min(tmax,51200.*electron_mass_c2*std::pow(proton_mass_c2/mass,0.666667));300 363 } 301 364 if(mat != material) { -
trunk/source/processes/electromagnetic/utils/include/G4EmModelManager.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmModelManager.hh,v 1.2 2 2007/11/09 11:35:54vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4EmModelManager.hh,v 1.25 2008/10/13 14:56:56 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 74 74 #include "G4DataVector.hh" 75 75 #include "G4EmTableType.hh" 76 #include "G4EmProcessSubType.hh" 77 #include "G4Region.hh" 76 78 77 79 class G4RegionModels … … 84 86 private: 85 87 86 G4RegionModels(G4int nMod, std::vector<G4int>& list, G4DataVector& lowE); 88 G4RegionModels(G4int nMod, std::vector<G4int>& indx, 89 G4DataVector& lowE, const G4Region* reg); 87 90 88 91 ~G4RegionModels(); … … 105 108 }; 106 109 110 G4double LowEdgeEnergy(G4int n) const { 111 return lowKineticEnergy[n]; 112 }; 113 114 const G4Region* Region() const { 115 return theRegion; 116 }; 117 118 const G4Region* theRegion; 107 119 G4int nModelsForRegion; 108 120 G4int* theListOfModelIndexes; … … 150 162 G4VEmModel* SelectModel(G4double& energy, size_t& index); 151 163 152 G4VEmModel* GetModel(G4int );164 G4VEmModel* GetModel(G4int, G4bool ver = false); 153 165 154 166 G4int NumberOfModels() const; … … 157 169 158 170 void UpdateEmModel(const G4String&, G4double, G4double); 171 172 void DumpModelList(G4int verb); 159 173 160 174 private: … … 176 190 std::vector<const G4Region*> regions; 177 191 std::vector<G4int> orderOfModels; 178 G4DataVector upperEkin;179 192 180 193 G4int nEmModels; -
trunk/source/processes/electromagnetic/utils/include/G4EmMultiModel.hh
r819 r961 25 25 // 26 26 // $Id: G4EmMultiModel.hh,v 1.6 2007/05/22 17:31:57 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4EmProcessOptions.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmProcessOptions.hh,v 1.1 2 2007/05/18 18:39:54vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4EmProcessOptions.hh,v 1.15 2009/02/18 14:40:10 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 107 107 void SetLinearLossLimit(G4double val); 108 108 109 void ActivateDeexcitation(G4bool val, const G4Region* r = 0); 109 void ActivateDeexcitation(const G4String& proc, G4bool val, 110 const G4String& reg = ""); 110 111 111 112 void SetMscStepLimitation(G4MscStepLimitType val); … … 121 122 void SetLPMFlag(G4bool val); 122 123 124 void SetSplineFlag(G4bool val); 125 123 126 void SetBremsstrahlungTh(G4double val); 127 128 void SetPolarAngleLimit(G4double val); 124 129 125 130 private: -
trunk/source/processes/electromagnetic/utils/include/G4EmTableType.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4EmTableType.hh,v 1. 3 2007/01/15 17:27:40vnivanch Exp $28 // GEANT4 tag $Name: $27 // $Id: G4EmTableType.hh,v 1.4 2008/10/13 14:56:56 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //--------------------------------------------------------------- … … 51 51 fRestricted, 52 52 fSubRestricted, 53 fI onisation,54 f SubIonisation53 fIsIonisation, 54 fIsSubIonisation 55 55 }; 56 56 #endif -
trunk/source/processes/electromagnetic/utils/include/G4EnergyLossMessenger.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4EnergyLossMessenger.hh,v 1. 18 2007/05/18 18:39:54vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4EnergyLossMessenger.hh,v 1.23 2009/02/18 14:40:10 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------------------------------------------------------------- … … 45 45 // 16-03-07 modify /process/eLoss/minsubsec command (V.Ivanchenko) 46 46 // 18-05-07 add /process/msc directory and commands (V.Ivanchenko) 47 // 11-03-08 add /process/em directory and commands (V.Ivanchenko) 47 48 // 48 49 // ------------------------------------------------------------------- … … 100 101 G4UIdirectory* eLossDirectory; 101 102 G4UIdirectory* mscDirectory; 103 G4UIdirectory* emDirectory; 102 104 G4UIcmdWithABool* RndmStepCmd; 103 105 G4UIcmdWithABool* EnlossFlucCmd; … … 105 107 G4UIcmdWithADouble* MinSubSecCmd; 106 108 G4UIcommand* StepFuncCmd; 109 G4UIcommand* deexCmd; 107 110 G4UIcmdWithAString* mscCmd; 108 111 G4UIcmdWithADoubleAndUnit* MinEnCmd; … … 112 115 G4UIcmdWithABool* lpmCmd; 113 116 G4UIcmdWithABool* latCmd; 117 G4UIcmdWithABool* splCmd; 118 G4UIcmdWithABool* aplCmd; 114 119 G4UIcmdWithAnInteger* verCmd; 120 G4UIcmdWithAnInteger* ver1Cmd; 115 121 G4UIcmdWithAnInteger* dedxCmd; 116 122 G4UIcmdWithAnInteger* lamCmd; … … 120 126 G4UIcmdWithADouble* frCmd; 121 127 G4UIcmdWithADouble* fgCmd; 128 G4UIcmdWithADoubleAndUnit* angCmd; 122 129 }; 123 130 -
trunk/source/processes/electromagnetic/utils/include/G4EnergyLossTables.hh
r819 r961 26 26 // 27 27 // $Id: G4EnergyLossTables.hh,v 1.19 2006/06/29 19:54:35 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // $Id: -
trunk/source/processes/electromagnetic/utils/include/G4LossTableBuilder.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LossTableBuilder.hh,v 1. 7 2006/06/29 19:54:37 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4LossTableBuilder.hh,v 1.8 2008/07/22 15:55:15 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 40 40 // 41 41 // Modifications: 42 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivan tchenko)43 // 42 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko) 43 // 17-07-08 Added splineFlag (V.Ivanchenko) 44 44 // 45 45 // Class Description: … … 56 56 #include "globals.hh" 57 57 #include "G4PhysicsTable.hh" 58 59 58 60 59 class G4LossTableBuilder … … 75 74 G4PhysicsTable* invRangeTable, 76 75 G4bool isIonisation = false); 76 77 inline void SetSplineFlag(G4bool flag); 77 78 78 79 private: … … 81 82 G4LossTableBuilder(const G4LossTableBuilder&); 82 83 84 G4bool splineFlag; 85 83 86 }; 87 88 inline void G4LossTableBuilder::SetSplineFlag(G4bool flag) 89 { 90 splineFlag = flag; 91 } 84 92 85 93 //....oooOO0OOooo.......oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/utils/include/G4LossTableManager.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LossTableManager.hh,v 1. 48 2007/11/07 18:38:49vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4LossTableManager.hh,v 1.53 2008/07/15 16:56:38 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 77 77 #define G4LossTableManager_h 1 78 78 79 80 79 #include <map> 81 80 #include <vector> … … 91 90 class G4VEmProcess; 92 91 class G4EmCorrections; 92 class G4EmSaturation; 93 93 class G4LossTableBuilder; 94 94 … … 152 152 153 153 void DeRegister(G4VEmProcess* p); 154 155 void Register(G4VEmModel* p); 156 157 void DeRegister(G4VEmModel* p); 158 159 void Register(G4VEmFluctuationModel* p); 160 161 void DeRegister(G4VEmFluctuationModel* p); 154 162 155 163 void EnergyLossProcessIsInitialised(const G4ParticleDefinition* aParticle, … … 195 203 void SetLPMFlag(G4bool val); 196 204 205 void SetSplineFlag(G4bool val); 206 197 207 void SetLinearLossLimit(G4double val); 198 208 … … 207 217 G4bool LPMFlag() const; 208 218 219 G4bool SplineFlag() const; 220 209 221 G4double BremsstrahlungTh() const; 210 222 … … 217 229 inline G4VEnergyLossProcess* GetEnergyLossProcess(const G4ParticleDefinition*); 218 230 219 inline G4EmCorrections* EmCorrections(); 231 G4EmCorrections* EmCorrections(); 232 233 G4EmSaturation* EmSaturation(); 220 234 221 235 private: … … 251 265 std::vector<G4VMultipleScattering*> msc_vector; 252 266 std::vector<G4VEmProcess*> emp_vector; 267 std::vector<G4VEmModel*> mod_vector; 268 std::vector<G4VEmFluctuationModel*> fmod_vector; 253 269 254 270 // cash … … 274 290 G4bool stepFunctionActive; 275 291 G4bool flagLPM; 292 G4bool splineFlag; 276 293 277 294 G4double minSubRange; … … 286 303 G4EnergyLossMessenger* theMessenger; 287 304 G4EmCorrections* emCorrections; 305 G4EmSaturation* emSaturation; 306 288 307 const G4ParticleDefinition* firstParticle; 289 308 G4int verbose; … … 418 437 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 419 438 420 inline G4EmCorrections* G4LossTableManager::EmCorrections()421 {422 return emCorrections;423 }424 425 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......426 427 439 #endif 428 440 -
trunk/source/processes/electromagnetic/utils/include/G4MscStepLimitType.hh
r819 r961 26 26 // 27 27 // $Id: G4MscStepLimitType.hh,v 1.2 2007/06/11 14:56:51 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //--------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4VEmFluctuationModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEmFluctuationModel.hh,v 1.1 0 2006/06/29 19:54:41 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4VEmFluctuationModel.hh,v 1.12 2009/02/19 11:25:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 95 95 virtual void InitialiseMe(const G4ParticleDefinition*); 96 96 97 virtual void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2); 98 97 99 //------------------------------------------------------------------------ 98 100 // Generic methods common to all models 99 101 //------------------------------------------------------------------------ 100 102 101 G4String GetName() const;103 inline G4String GetName() const; 102 104 103 105 private: … … 113 115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 114 116 115 inline void G4VEmFluctuationModel::InitialiseMe(const G4ParticleDefinition*)116 {}117 118 117 inline G4String G4VEmFluctuationModel::GetName() const 119 118 { -
trunk/source/processes/electromagnetic/utils/include/G4VEmModel.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEmModel.hh,v 1. 48 2007/10/29 08:38:58vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4VEmModel.hh,v 1.66 2009/02/19 09:57:36 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 61 61 // 29-06-06 Add member currentElement and Get/Set methods (V.Ivanchenko) 62 62 // 29-10-07 Added SampleScattering (V.Ivanchenko) 63 // 15-07-08 Reorder class members and improve comments (VI) 64 // 21-07-08 Added vector of G4ElementSelector and methods to use it (VI) 65 // 12-09-08 Added methods GetParticleCharge, GetChargeSquareRatio, 66 // CorrectionsAlongStep, ActivateNuclearStopping (VI) 67 // 16-02-09 Move implementations of virtual methods to source (VI) 63 68 // 64 69 // Class Description: … … 81 86 #include "G4DataVector.hh" 82 87 #include "G4VEmFluctuationModel.hh" 88 #include "G4EmElementSelector.hh" 83 89 #include "Randomize.hh" 90 #include <vector> 84 91 85 92 class G4PhysicsTable; … … 98 105 99 106 //------------------------------------------------------------------------ 100 // Virtual methods to be implemented for theconcrete model101 //------------------------------------------------------------------------ 102 103 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&) = 0;104 107 // Virtual methods to be implemented for any concrete model 108 //------------------------------------------------------------------------ 109 110 virtual void Initialise(const G4ParticleDefinition*, 111 const G4DataVector&) = 0; 105 112 106 113 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, … … 114 121 //------------------------------------------------------------------------ 115 122 116 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 117 const G4MaterialCutsCouple*); 118 119 virtual G4double ComputeDEDX(const G4MaterialCutsCouple*, 120 const G4ParticleDefinition*, 121 G4double kineticEnergy, 122 G4double cutEnergy = DBL_MAX); 123 124 virtual G4double CrossSection(const G4MaterialCutsCouple*, 125 const G4ParticleDefinition*, 126 G4double kineticEnergy, 127 G4double cutEnergy = 0.0, 128 G4double maxEnergy = DBL_MAX); 129 123 // main method to compute dEdx 130 124 virtual G4double ComputeDEDXPerVolume(const G4Material*, 131 125 const G4ParticleDefinition*, … … 133 127 G4double cutEnergy = DBL_MAX); 134 128 135 136 virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 137 G4double kinEnergy, 138 G4double Z, 139 G4double A = 0., 140 G4double cutEnergy = 0.0, 141 G4double maxEnergy = DBL_MAX); 142 143 virtual G4double ComputeMeanFreePath(const G4ParticleDefinition*, 144 G4double kineticEnergy, 145 const G4Material*, 146 G4double cutEnergy = 0.0, 147 G4double maxEnergy = DBL_MAX); 148 129 // main method to compute cross section per Volume 149 130 virtual G4double CrossSectionPerVolume(const G4Material*, 150 131 const G4ParticleDefinition*, … … 153 134 G4double maxEnergy = DBL_MAX); 154 135 136 // main method to compute cross section depending on atom 137 virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 138 G4double kinEnergy, 139 G4double Z, 140 G4double A = 0., /* amu */ 141 G4double cutEnergy = 0.0, 142 G4double maxEnergy = DBL_MAX); 143 144 // min cut in kinetic energy allowed by the model 145 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 146 const G4MaterialCutsCouple*); 147 148 // Compute effective ion charge square 149 virtual G4double GetChargeSquareRatio(const G4ParticleDefinition*, 150 const G4Material*, 151 G4double kineticEnergy); 152 153 // Compute ion charge 154 virtual G4double GetParticleCharge(const G4ParticleDefinition*, 155 const G4Material*, 156 G4double kineticEnergy); 157 158 // add correction to energy loss and ompute non-ionizing energy loss 159 virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*, 160 const G4DynamicParticle*, 161 G4double& eloss, 162 G4double& niel, 163 G4double length); 164 165 // sample PIXE deexcitation 166 virtual void SampleDeexcitationAlongStep(const G4Material*, 167 const G4Track&, 168 G4double& eloss); 169 155 170 protected: 156 171 172 // kinematically allowed max kinetic energy of a secondary 157 173 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 158 174 G4double kineticEnergy); … … 177 193 virtual void DefineForRegion(const G4Region*); 178 194 195 virtual void SetupForMaterial(const G4ParticleDefinition*, 196 const G4Material*, 197 G4double kineticEnergy); 198 179 199 //------------------------------------------------------------------------ 180 200 // Generic methods common to all models 181 201 //------------------------------------------------------------------------ 182 202 183 void SetParticleChange(G4VParticleChange*, G4VEmFluctuationModel*); 184 185 G4VEmFluctuationModel* GetModelOfFluctuations(); 186 187 G4double HighEnergyLimit(); 188 189 G4double LowEnergyLimit(); 190 191 void SetHighEnergyLimit(G4double); 192 193 void SetLowEnergyLimit(G4double); 194 195 G4double MaxSecondaryKinEnergy(const G4DynamicParticle* dynParticle); 196 197 const G4Element* SelectRandomAtom(const G4Material*, 198 const G4ParticleDefinition*, 199 G4double kineticEnergy, 200 G4double cutEnergy = 0.0, 201 G4double maxEnergy = DBL_MAX); 202 203 const G4String& GetName() const; 203 // should be called at initialisation to build element selectors 204 void InitialiseElementSelectors(const G4ParticleDefinition*, 205 const G4DataVector&); 206 207 // dEdx per unit length 208 inline G4double ComputeDEDX(const G4MaterialCutsCouple*, 209 const G4ParticleDefinition*, 210 G4double kineticEnergy, 211 G4double cutEnergy = DBL_MAX); 212 213 // cross section per volume 214 inline G4double CrossSection(const G4MaterialCutsCouple*, 215 const G4ParticleDefinition*, 216 G4double kineticEnergy, 217 G4double cutEnergy = 0.0, 218 G4double maxEnergy = DBL_MAX); 219 220 // compute mean free path via cross section per volume 221 inline G4double ComputeMeanFreePath(const G4ParticleDefinition*, 222 G4double kineticEnergy, 223 const G4Material*, 224 G4double cutEnergy = 0.0, 225 G4double maxEnergy = DBL_MAX); 226 227 // generic cross section per element 228 inline G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 229 const G4Element*, 230 G4double kinEnergy, 231 G4double cutEnergy = 0.0, 232 G4double maxEnergy = DBL_MAX); 233 234 // atom can be selected effitiantly if element selectors are initialised 235 inline const G4Element* SelectRandomAtom(const G4MaterialCutsCouple*, 236 const G4ParticleDefinition*, 237 G4double kineticEnergy, 238 G4double cutEnergy = 0.0, 239 G4double maxEnergy = DBL_MAX); 240 241 // to select atom cross section per volume is recomputed for each element 242 inline const G4Element* SelectRandomAtom(const G4Material*, 243 const G4ParticleDefinition*, 244 G4double kineticEnergy, 245 G4double cutEnergy = 0.0, 246 G4double maxEnergy = DBL_MAX); 247 248 // select isotope in order to have precise mass of the nucleus 249 inline G4int SelectIsotopeNumber(const G4Element*); 250 251 //------------------------------------------------------------------------ 252 // Get/Set methods 253 //------------------------------------------------------------------------ 254 255 inline G4VEmFluctuationModel* GetModelOfFluctuations(); 256 257 inline G4double HighEnergyLimit() const; 258 259 inline G4double LowEnergyLimit() const; 260 261 inline G4double PolarAngleLimit() const; 262 263 inline G4double SecondaryThreshold() const; 264 265 inline G4bool LPMFlag() const; 266 267 inline G4bool DeexcitationFlag() const; 268 269 inline void SetHighEnergyLimit(G4double); 270 271 inline void SetLowEnergyLimit(G4double); 272 273 inline void SetPolarAngleLimit(G4double); 274 275 inline void SetSecondaryThreshold(G4double); 276 277 inline void SetLPMFlag(G4bool val); 278 279 inline void SetDeexcitationFlag(G4bool val); 280 281 inline void ActivateNuclearStopping(G4bool); 282 283 inline G4double MaxSecondaryKinEnergy(const G4DynamicParticle* dynParticle); 284 285 inline const G4String& GetName() const; 286 287 inline void SetParticleChange(G4VParticleChange*, G4VEmFluctuationModel*); 288 289 inline void SetCurrentCouple(const G4MaterialCutsCouple*); 204 290 205 291 protected: 206 292 207 const G4Element* GetCurrentElement() const; 208 209 void SetCurrentElement(const G4Element*); 293 inline const G4MaterialCutsCouple* CurrentCouple() const; 294 295 inline void SetCurrentElement(const G4Element*); 296 297 inline const G4Element* GetCurrentElement() const; 210 298 211 299 private: … … 215 303 G4VEmModel(const G4VEmModel&); 216 304 305 // ======== Parameters of the class fixed at construction ========= 306 307 G4VEmFluctuationModel* fluc; 308 const G4String name; 309 310 // ======== Parameters of the class fixed at initialisation ======= 311 217 312 G4double lowLimit; 218 313 G4double highLimit; 219 G4double xsec[40];220 221 G4 VEmFluctuationModel* fluc;222 223 const G4String name;224 const G4Element* currentElement;314 G4double polarAngleLimit; 315 G4double secondaryThreshold; 316 G4bool theLPMflag; 317 318 G4int nSelectors; 319 std::vector<G4EmElementSelector*> elmSelectors; 225 320 226 321 protected: 227 322 228 323 G4VParticleChange* pParticleChange; 324 G4bool nuclearStopping; 325 326 // ======== Cashed values - may be state dependent ================ 327 328 private: 329 330 const G4MaterialCutsCouple* currentCouple; 331 const G4Element* currentElement; 332 333 G4int nsec; 334 G4bool flagDeexcitation; 335 std::vector<G4double> xsec; 336 229 337 }; 230 338 231 339 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 232 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......233 234 inline G4double G4VEmModel::HighEnergyLimit()235 {236 return highLimit;237 }238 239 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......240 241 inline G4double G4VEmModel::LowEnergyLimit()242 {243 return lowLimit;244 }245 246 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......247 248 inline void G4VEmModel::SetHighEnergyLimit(G4double val)249 {250 highLimit = val;251 }252 253 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......254 255 inline void G4VEmModel::SetLowEnergyLimit(G4double val)256 {257 lowLimit = val;258 }259 260 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......261 262 inline void G4VEmModel::SetParticleChange(G4VParticleChange* p,263 G4VEmFluctuationModel* f = 0)264 {265 if(p && pParticleChange != p) pParticleChange = p;266 fluc = f;267 }268 269 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......270 271 272 inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()273 {274 return fluc;275 }276 277 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......278 279 inline G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*,280 const G4MaterialCutsCouple*)281 {282 return 0.0;283 }284 285 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......286 287 inline G4double G4VEmModel::ComputeDEDXPerVolume(288 const G4Material*,289 const G4ParticleDefinition*,290 G4double,291 G4double)292 {293 return 0.0;294 }295 296 340 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 297 341 … … 301 345 G4double cutEnergy) 302 346 { 347 currentCouple = c; 303 348 return ComputeDEDXPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy); 304 349 } … … 312 357 G4double maxEnergy) 313 358 { 314 return 315 CrossSectionPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy,maxEnergy); 359 currentCouple = c; 360 return CrossSectionPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy,maxEnergy); 361 } 362 363 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 364 365 inline G4double G4VEmModel::ComputeMeanFreePath(const G4ParticleDefinition* p, 366 G4double ekin, 367 const G4Material* material, 368 G4double emin, 369 G4double emax) 370 { 371 G4double mfp = DBL_MAX; 372 G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax); 373 if (cross > DBL_MIN) mfp = 1./cross; 374 return mfp; 316 375 } 317 376 … … 319 378 320 379 inline G4double G4VEmModel::ComputeCrossSectionPerAtom( 321 const G4ParticleDefinition*, 322 G4double, G4double, G4double, 323 G4double, G4double) 324 { 325 return 0.0; 326 } 327 328 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 329 330 inline const G4Element* G4VEmModel::SelectRandomAtom( 331 const G4Material* material, 332 const G4ParticleDefinition* pd, 333 G4double kinEnergy, 334 G4double tcut, 335 G4double tmax) 380 const G4ParticleDefinition* part, 381 const G4Element* elm, 382 G4double kinEnergy, 383 G4double cutEnergy, 384 G4double maxEnergy) 385 { 386 currentElement = elm; 387 return ComputeCrossSectionPerAtom(part,kinEnergy,elm->GetZ(),elm->GetN(), 388 cutEnergy,maxEnergy); 389 } 390 391 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 392 393 inline 394 const G4Element* G4VEmModel::SelectRandomAtom(const G4MaterialCutsCouple* couple, 395 const G4ParticleDefinition* p, 396 G4double kinEnergy, 397 G4double cutEnergy, 398 G4double maxEnergy) 399 { 400 currentCouple = couple; 401 if(nSelectors > 0) { 402 currentElement = 403 elmSelectors[couple->GetIndex()]->SelectRandomAtom(kinEnergy); 404 } else { 405 currentElement = SelectRandomAtom(couple->GetMaterial(),p,kinEnergy, 406 cutEnergy,maxEnergy); 407 } 408 return currentElement; 409 } 410 411 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 412 413 inline 414 const G4Element* G4VEmModel::SelectRandomAtom(const G4Material* material, 415 const G4ParticleDefinition* pd, 416 G4double kinEnergy, 417 G4double tcut, 418 G4double tmax) 336 419 { 337 420 const G4ElementVector* theElementVector = material->GetElementVector(); 338 G4int n elm = material->GetNumberOfElements();339 currentElement = (*theElementVector)[n elm-1];340 if (n elm > 1) {421 G4int n = material->GetNumberOfElements() - 1; 422 currentElement = (*theElementVector)[n]; 423 if (n > 0) { 341 424 G4double x = G4UniformRand()* 342 CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax);343 for(G4int i=0; i<n elm; i++) {425 G4VEmModel::CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax); 426 for(G4int i=0; i<n; i++) { 344 427 if (x <= xsec[i]) { 345 428 currentElement = (*theElementVector)[i]; … … 353 436 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 354 437 438 inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm) 439 { 440 G4int N = G4int(elm->GetN() + 0.5); 441 G4int ni = elm->GetNumberOfIsotopes(); 442 if(ni > 0) { 443 G4int idx = 0; 444 if(ni > 1) { 445 G4double* ab = currentElement->GetRelativeAbundanceVector(); 446 G4double x = G4UniformRand(); 447 for(; idx<ni; idx++) { 448 x -= ab[idx]; 449 if (x <= 0.0) break; 450 } 451 if(idx >= ni) idx = ni - 1; 452 } 453 N = elm->GetIsotope(idx)->GetN(); 454 } 455 return N; 456 } 457 458 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 459 460 inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations() 461 { 462 return fluc; 463 } 464 465 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 466 467 inline G4double G4VEmModel::HighEnergyLimit() const 468 { 469 return highLimit; 470 } 471 472 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 473 474 inline G4double G4VEmModel::LowEnergyLimit() const 475 { 476 return lowLimit; 477 } 478 479 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 480 481 inline G4double G4VEmModel::PolarAngleLimit() const 482 { 483 return polarAngleLimit; 484 } 485 486 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 487 488 inline G4double G4VEmModel::SecondaryThreshold() const 489 { 490 return secondaryThreshold; 491 } 492 493 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 494 495 inline G4bool G4VEmModel::LPMFlag() const 496 { 497 return theLPMflag; 498 } 499 500 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 501 502 inline G4bool G4VEmModel::DeexcitationFlag() const 503 { 504 return flagDeexcitation; 505 } 506 507 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 508 509 inline void G4VEmModel::SetHighEnergyLimit(G4double val) 510 { 511 highLimit = val; 512 } 513 514 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 515 516 inline void G4VEmModel::SetLowEnergyLimit(G4double val) 517 { 518 lowLimit = val; 519 } 520 521 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 522 523 inline void G4VEmModel::SetPolarAngleLimit(G4double val) 524 { 525 polarAngleLimit = val; 526 } 527 528 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 529 530 inline void G4VEmModel::SetSecondaryThreshold(G4double val) 531 { 532 secondaryThreshold = val; 533 } 534 535 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 536 537 inline void G4VEmModel::SetLPMFlag(G4bool val) 538 { 539 theLPMflag = val; 540 } 541 542 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 543 544 inline void G4VEmModel::SetDeexcitationFlag(G4bool val) 545 { 546 flagDeexcitation = val; 547 } 548 549 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 550 551 inline void G4VEmModel::ActivateNuclearStopping(G4bool val) 552 { 553 nuclearStopping = val; 554 } 555 556 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 557 558 inline 559 G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart) 560 { 561 return MaxSecondaryEnergy(dynPart->GetDefinition(), 562 dynPart->GetKineticEnergy()); 563 } 564 565 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 566 567 inline const G4String& G4VEmModel::GetName() const 568 { 569 return name; 570 } 571 572 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 573 574 inline void G4VEmModel::SetParticleChange(G4VParticleChange* p, 575 G4VEmFluctuationModel* f = 0) 576 { 577 if(p && pParticleChange != p) pParticleChange = p; 578 fluc = f; 579 } 580 581 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 582 583 inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p) 584 { 585 currentCouple = p; 586 } 587 588 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 589 590 inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const 591 { 592 return currentCouple; 593 } 594 595 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 596 597 inline void G4VEmModel::SetCurrentElement(const G4Element* elm) 598 { 599 currentElement = elm; 600 } 601 602 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 603 355 604 inline const G4Element* G4VEmModel::GetCurrentElement() const 356 605 { … … 360 609 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 361 610 362 inline void G4VEmModel::SetCurrentElement(const G4Element* elm)363 {364 currentElement = elm;365 }366 367 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......368 369 inline G4double G4VEmModel::MaxSecondaryKinEnergy(370 const G4DynamicParticle* dynParticle)371 {372 return MaxSecondaryEnergy(dynParticle->GetDefinition(),373 dynParticle->GetKineticEnergy());374 }375 376 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......377 378 inline G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*,379 G4double kineticEnergy)380 {381 return kineticEnergy;382 }383 384 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......385 386 inline const G4String& G4VEmModel::GetName() const387 {388 return name;389 }390 391 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......392 // Methods for msc simulation393 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......394 395 inline void G4VEmModel::SampleScattering(const G4DynamicParticle*, G4double)396 {}397 398 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......399 400 inline G4double G4VEmModel::ComputeTruePathLengthLimit(401 const G4Track&,402 G4PhysicsTable*,403 G4double)404 {405 return DBL_MAX;406 }407 408 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......409 410 inline G4double G4VEmModel::ComputeGeomPathLength(G4double truePathLength)411 {412 return truePathLength;413 }414 415 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......416 417 inline G4double G4VEmModel::ComputeTrueStepLength(G4double geomPathLength)418 {419 return geomPathLength;420 }421 422 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......423 424 inline void G4VEmModel::DefineForRegion(const G4Region*)425 {}426 427 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......428 429 611 #endif 430 612 -
trunk/source/processes/electromagnetic/utils/include/G4VEmProcess.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEmProcess.hh,v 1. 43 2007/10/29 08:38:58vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4VEmProcess.hh,v 1.50 2009/02/19 09:57:36 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 55 55 // PostStepGetPhysicalInteractionLength (V.Ivanchenko) 56 56 // 27-10-07 Virtual functions moved to source (V.Ivanchenko) 57 // 15-07-08 Reorder class members for further multi-thread development (VI) 57 58 // 58 59 // Class Description: … … 90 91 91 92 G4VEmProcess(const G4String& name, 92 G4ProcessType type = fElectromagnetic);93 G4ProcessType type = fElectromagnetic); 93 94 94 95 virtual ~G4VEmProcess(); … … 107 108 108 109 //------------------------------------------------------------------------ 109 // Methods with standard implementation; may be overwritten if needed 110 //------------------------------------------------------------------------ 111 112 inline G4double RecalculateLambda(G4double kinEnergy, 113 const G4MaterialCutsCouple* couple); 114 115 //------------------------------------------------------------------------ 116 // Generic methods common to all Discrete processes 110 // Implementation of virtual methods common to all Discrete processes 117 111 //------------------------------------------------------------------------ 118 112 119 113 public: 120 114 115 // Initialise for build of tables 116 void PreparePhysicsTable(const G4ParticleDefinition&); 117 118 // Build physics table during initialisation 119 void BuildPhysicsTable(const G4ParticleDefinition&); 120 121 121 void PrintInfoDefinition(); 122 122 123 G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); 124 125 void PreparePhysicsTable(const G4ParticleDefinition&); 126 // Initialise for build of tables 127 128 void BuildPhysicsTable(const G4ParticleDefinition&); 129 // Build physics table during initialisation 130 131 G4bool StorePhysicsTable(const G4ParticleDefinition*, 132 const G4String& directory, 133 G4bool ascii = false); 134 // Store PhysicsTable in a file. 135 // Return false in case of failure at I/O 136 137 G4bool RetrievePhysicsTable(const G4ParticleDefinition*, 138 const G4String& directory, 139 G4bool ascii); 140 // Retrieve Physics from a file. 141 // (return true if the Physics Table can be build by using file) 142 // (return false if the process has no functionality or in case of failure) 143 // File name should is constructed as processName+particleName and the 144 // should be placed under the directory specifed by the argument. 145 146 //------------------------------------------------------------------------ 147 // Specific methods for Discrete EM post step simulation 148 //------------------------------------------------------------------------ 149 150 inline G4double MicroscopicCrossSection(G4double kineticEnergy, 151 const G4MaterialCutsCouple* couple); 152 // It returns the cross section of the process for energy/ material 153 154 inline G4double ComputeCrossSectionPerAtom(G4double kineticEnergy, 155 G4double Z, G4double A=0., 156 G4double cut=0.0); 157 // It returns the cross section of the process per atom 158 159 inline G4double MeanFreePath(const G4Track& track); 160 161 virtual G4double PostStepGetPhysicalInteractionLength( 123 // implementation of virtual method, specific for G4VEmProcess 124 G4double PostStepGetPhysicalInteractionLength( 162 125 const G4Track& track, 163 126 G4double previousStepSize, … … 165 128 ); 166 129 130 // implementation of virtual method, specific for G4VEmProcess 131 G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); 132 133 // Store PhysicsTable in a file. 134 // Return false in case of failure at I/O 135 G4bool StorePhysicsTable(const G4ParticleDefinition*, 136 const G4String& directory, 137 G4bool ascii = false); 138 139 // Retrieve Physics from a file. 140 // (return true if the Physics Table can be build by using file) 141 // (return false if the process has no functionality or in case of failure) 142 // File name should is constructed as processName+particleName and the 143 // should be placed under the directory specifed by the argument. 144 G4bool RetrievePhysicsTable(const G4ParticleDefinition*, 145 const G4String& directory, 146 G4bool ascii); 147 148 // deexcitation activated per G4Region 149 void ActivateDeexcitation(G4bool, const G4Region* r = 0); 150 151 //------------------------------------------------------------------------ 152 // Specific methods for Discrete EM post step simulation 153 //------------------------------------------------------------------------ 154 155 // It returns the cross section per volume for energy/ material 156 G4double CrossSectionPerVolume(G4double kineticEnergy, 157 const G4MaterialCutsCouple* couple); 158 159 // It returns the cross section of the process per atom 160 inline G4double ComputeCrossSectionPerAtom(G4double kineticEnergy, 161 G4double Z, G4double A=0., 162 G4double cut=0.0); 163 164 inline G4double MeanFreePath(const G4Track& track); 165 166 // It returns cross section per volume 167 inline G4double GetLambda(G4double& kinEnergy, 168 const G4MaterialCutsCouple* couple); 169 170 //------------------------------------------------------------------------ 171 // Specific methods to build and access Physics Tables 172 //------------------------------------------------------------------------ 173 174 // Binning for lambda table 175 inline void SetLambdaBinning(G4int nbins); 176 inline G4int LambdaBinning() const; 177 178 // Min kinetic energy for tables 179 inline void SetMinKinEnergy(G4double e); 180 inline G4double MinKinEnergy() const; 181 182 // Max kinetic energy for tables 183 inline void SetMaxKinEnergy(G4double e); 184 inline G4double MaxKinEnergy() const; 185 186 inline void SetPolarAngleLimit(G4double a); 187 inline G4double PolarAngleLimit() const; 188 189 inline const G4PhysicsTable* LambdaTable() const; 190 191 //------------------------------------------------------------------------ 192 // Define and access particle type 193 //------------------------------------------------------------------------ 194 195 inline const G4ParticleDefinition* Particle() const; 196 inline const G4ParticleDefinition* SecondaryParticle() const; 197 198 //------------------------------------------------------------------------ 199 // Specific methods to set, access, modify models and basic parameters 200 //------------------------------------------------------------------------ 201 202 protected: 203 // Select model in run time 204 inline void SelectModel(G4double& kinEnergy); 205 206 public: 207 // Select model by energy and region index 167 208 inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, 168 209 size_t& idxRegion) const; 169 170 inline G4double GetLambda(G4double& kinEnergy, 171 const G4MaterialCutsCouple* couple); 172 // It returns the Lambda of the process 173 174 //------------------------------------------------------------------------ 175 // Specific methods to build and access Physics Tables 176 //------------------------------------------------------------------------ 177 178 inline void SetLambdaBinning(G4int nbins); 179 inline G4int LambdaBinning() const; 180 // Binning for lambda table 181 182 inline void SetMinKinEnergy(G4double e); 183 inline G4double MinKinEnergy() const; 184 // Min kinetic energy for tables 185 186 inline void SetMaxKinEnergy(G4double e); 187 inline G4double MaxKinEnergy() const; 188 // Max kinetic energy for tables 189 190 inline const G4PhysicsTable* LambdaTable() const; 191 192 //------------------------------------------------------------------------ 193 // Define and access particle type 194 //------------------------------------------------------------------------ 195 196 inline const G4ParticleDefinition* Particle() const; 197 inline const G4ParticleDefinition* SecondaryParticle() const; 198 199 //------------------------------------------------------------------------ 200 // Specific methods to set, access, modify models 201 //------------------------------------------------------------------------ 202 210 211 // Add model for region, smaller value of order defines which 212 // model will be selected for a given energy interval 203 213 inline void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0); 204 // Add EM model coupled for the region 205 206 inline void SetModel(G4VEmModel*); 214 207 215 // Assign a model to a process 216 inline void SetModel(G4VEmModel*, G4int index = 1); 208 217 209 inline G4VEmModel* Model();210 218 // return the assigned model 219 inline G4VEmModel* Model(G4int index = 1); 211 220 221 // Define new energy range for the model identified by the name 212 222 inline void UpdateEmModel(const G4String&, G4double, G4double); 213 // Define new energy range for the model identified by the name214 223 215 224 // Access to models 216 inline G4VEmModel* GetModelByIndex(G4int idx = 0); 217 218 //------------------------------------------------------------------------ 219 // Get/set parameters used for simulation of energy loss 220 //------------------------------------------------------------------------ 221 222 inline void ActivateDeexcitation(G4bool, const G4Region* r = 0); 225 inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false); 223 226 224 227 inline void SetLambdaFactor(G4double val); … … 228 231 229 232 inline void SetApplyCuts(G4bool val); 233 234 //------------------------------------------------------------------------ 235 // Other generic methods 236 //------------------------------------------------------------------------ 230 237 231 238 protected: … … 237 244 G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*); 238 245 246 inline G4double RecalculateLambda(G4double kinEnergy, 247 const G4MaterialCutsCouple* couple); 248 249 inline G4ParticleChangeForGamma* GetParticleChange(); 250 239 251 inline void SetParticle(const G4ParticleDefinition* p); 240 252 241 253 inline void SetSecondaryParticle(const G4ParticleDefinition* p); 242 254 243 inline G4VEmModel* SelectModel(G4double& kinEnergy);244 245 255 inline size_t CurrentMaterialCutsCoupleIndex() const; 246 256 … … 273 283 inline G4double ComputeCurrentLambda(G4double kinEnergy); 274 284 275 // hide assignment operator 276 285 // copy constructor and hide assignment operator 277 286 G4VEmProcess(G4VEmProcess &); 278 287 G4VEmProcess & operator=(const G4VEmProcess &right); 279 288 280 // ===================================================================== 281 282 protected: 283 284 G4ParticleChangeForGamma fParticleChange; 285 286 private: 287 288 std::vector<G4DynamicParticle*> secParticles; 289 // ======== Parameters of the class fixed at construction ========= 289 290 290 291 G4EmModelManager* modelManager; 291 G4VEmModel* selectedModel; 292 const G4ParticleDefinition* theGamma; 293 const G4ParticleDefinition* theElectron; 294 const G4ParticleDefinition* thePositron; 295 const G4ParticleDefinition* secondaryParticle; 296 297 G4bool buildLambdaTable; 298 299 // ======== Parameters of the class fixed at initialisation ======= 300 301 std::vector<G4VEmModel*> emModels; 292 302 293 303 // tables and vectors … … 296 306 G4double* theCrossSectionMax; 297 307 298 const G4ParticleDefinition* particle;299 const G4ParticleDefinition* secondaryParticle;300 const G4ParticleDefinition* theGamma;301 const G4ParticleDefinition* theElectron;302 const G4ParticleDefinition* thePositron;303 304 308 const std::vector<G4double>* theCuts; 305 309 const std::vector<G4double>* theCutsGamma; … … 312 316 G4double maxKinEnergy; 313 317 G4double lambdaFactor; 318 G4double polarAngleLimit; 319 320 G4bool integral; 321 G4bool applyCuts; 322 G4bool startFromNull; 323 G4bool useDeexcitation; 324 325 G4int nDERegions; 326 std::vector<const G4Region*> deRegions; 327 G4bool* idxDERegions; 328 329 // ======== Cashed values - may be state dependent ================ 330 331 protected: 332 333 G4ParticleChangeForGamma fParticleChange; 334 335 private: 336 337 std::vector<G4DynamicParticle*> secParticles; 338 339 G4VEmModel* currentModel; 340 341 const G4ParticleDefinition* particle; 314 342 315 343 // cash … … 322 350 G4double preStepLambda; 323 351 324 G4bool integral;325 G4bool buildLambdaTable;326 G4bool applyCuts;327 G4bool startFromNull;328 329 G4int nRegions;330 std::vector<G4Region*> regions;331 std::vector<G4bool> flagsDeexcitation;332 333 352 }; 334 353 335 354 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 355 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 356 357 inline G4double G4VEmProcess::ComputeCrossSectionPerAtom( 358 G4double kineticEnergy, G4double Z, G4double A, G4double cut) 359 { 360 SelectModel(kineticEnergy); 361 G4double x = 0.0; 362 if(currentModel) { 363 x = currentModel->ComputeCrossSectionPerAtom(particle,kineticEnergy, 364 Z,A,cut); 365 } 366 return x; 367 } 368 369 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 370 371 inline G4double G4VEmProcess::MeanFreePath(const G4Track& track) 372 { 373 DefineMaterial(track.GetMaterialCutsCouple()); 374 preStepLambda = GetCurrentLambda(track.GetKineticEnergy()); 375 G4double x = DBL_MAX; 376 if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda; 377 return x; 378 } 379 380 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 381 382 inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy, 383 const G4MaterialCutsCouple* couple) 384 { 385 DefineMaterial(couple); 386 return GetCurrentLambda(kineticEnergy); 387 } 388 389 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 390 391 inline void G4VEmProcess::SetLambdaBinning(G4int nbins) 392 { 393 nLambdaBins = nbins; 394 } 395 396 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 397 398 inline G4int G4VEmProcess::LambdaBinning() const 399 { 400 return nLambdaBins; 401 } 402 403 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 404 405 inline void G4VEmProcess::SetMinKinEnergy(G4double e) 406 { 407 minKinEnergy = e; 408 } 409 410 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 411 412 inline G4double G4VEmProcess::MinKinEnergy() const 413 { 414 return minKinEnergy; 415 } 416 417 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 418 419 inline void G4VEmProcess::SetMaxKinEnergy(G4double e) 420 { 421 maxKinEnergy = e; 422 } 423 424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 425 426 inline G4double G4VEmProcess::MaxKinEnergy() const 427 { 428 return maxKinEnergy; 429 } 430 431 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 432 433 inline void G4VEmProcess::SetPolarAngleLimit(G4double val) 434 { 435 if(val < 0.0) polarAngleLimit = 0.0; 436 else if(val > pi) polarAngleLimit = pi; 437 else polarAngleLimit = val; 438 } 439 440 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 441 442 inline G4double G4VEmProcess::PolarAngleLimit() const 443 { 444 return polarAngleLimit; 445 } 446 447 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 448 449 inline const G4PhysicsTable* G4VEmProcess::LambdaTable() const 450 { 451 return theLambdaTable; 452 } 453 454 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 455 456 inline const G4ParticleDefinition* G4VEmProcess::Particle() const 457 { 458 return particle; 459 } 460 461 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 462 463 inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const 464 { 465 return secondaryParticle; 466 } 467 468 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 469 470 inline void G4VEmProcess::SelectModel(G4double& kinEnergy) 471 { 472 currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex); 473 currentModel->SetCurrentCouple(currentCouple); 474 } 475 476 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 477 478 inline G4VEmModel* G4VEmProcess::SelectModelForMaterial( 479 G4double kinEnergy, size_t& idxRegion) const 480 { 481 return modelManager->SelectModel(kinEnergy, idxRegion); 482 } 483 484 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 485 486 inline void G4VEmProcess::AddEmModel(G4int order, G4VEmModel* p, 487 const G4Region* region) 488 { 489 G4VEmFluctuationModel* fm = 0; 490 modelManager->AddEmModel(order, p, fm, region); 491 if(p) p->SetParticleChange(pParticleChange); 492 } 493 494 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 495 496 inline void G4VEmProcess::SetModel(G4VEmModel* p, G4int index) 497 { 498 G4int n = emModels.size(); 499 if(index >= n) for(G4int i=n; i<index+1; i++) {emModels.push_back(0);} 500 emModels[index] = p; 501 } 502 503 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 504 505 inline G4VEmModel* G4VEmProcess::Model(G4int index) 506 { 507 G4VEmModel* p = 0; 508 if(index >= 0 && index < G4int(emModels.size())) p = emModels[index]; 509 return p; 510 } 511 512 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 513 514 inline void G4VEmProcess::UpdateEmModel(const G4String& nam, 515 G4double emin, G4double emax) 516 { 517 modelManager->UpdateEmModel(nam, emin, emax); 518 } 519 520 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 521 522 inline G4VEmModel* G4VEmProcess::GetModelByIndex(G4int idx, G4bool ver) 523 { 524 return modelManager->GetModel(idx, ver); 525 } 526 527 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 528 529 inline void G4VEmProcess::SetLambdaFactor(G4double val) 530 { 531 if(val > 0.0 && val <= 1.0) lambdaFactor = val; 532 } 533 534 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 535 536 inline void G4VEmProcess::SetIntegral(G4bool val) 537 { 538 if(particle && particle != theGamma) integral = val; 539 if(integral) buildLambdaTable = true; 540 } 541 542 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 543 544 inline G4bool G4VEmProcess::IsIntegral() const 545 { 546 return integral; 547 } 548 549 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 550 551 inline void G4VEmProcess::SetApplyCuts(G4bool val) 552 { 553 applyCuts = val; 554 } 555 556 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 557 558 inline G4double G4VEmProcess::RecalculateLambda(G4double e, 559 const G4MaterialCutsCouple* couple) 560 { 561 DefineMaterial(couple); 562 return ComputeCurrentLambda(e); 563 } 564 565 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 566 567 inline G4ParticleChangeForGamma* G4VEmProcess::GetParticleChange() 568 { 569 return &fParticleChange; 570 } 571 572 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 573 574 inline void G4VEmProcess::SetParticle(const G4ParticleDefinition* p) 575 { 576 particle = p; 577 } 578 579 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 580 581 inline void G4VEmProcess::SetSecondaryParticle(const G4ParticleDefinition* p) 582 { 583 secondaryParticle = p; 584 } 585 586 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 587 588 inline size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex() const 589 { 590 return currentMaterialIndex; 591 } 592 593 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 594 595 inline G4double G4VEmProcess::GetGammaEnergyCut() 596 { 597 return (*theCutsGamma)[currentMaterialIndex]; 598 } 599 600 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 601 602 inline G4double G4VEmProcess::GetElectronEnergyCut() 603 { 604 return (*theCutsElectron)[currentMaterialIndex]; 605 } 606 607 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 608 609 inline void G4VEmProcess::SetBuildTableFlag(G4bool val) 610 { 611 buildLambdaTable = val; 612 if(!val) integral = false; 613 } 614 615 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 616 617 inline void G4VEmProcess::SetStartFromNullFlag(G4bool val) 618 { 619 startFromNull = val; 620 } 621 622 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 623 624 inline void G4VEmProcess::InitialiseStep(const G4Track& track) 625 { 626 preStepKinEnergy = track.GetKineticEnergy(); 627 DefineMaterial(track.GetMaterialCutsCouple()); 628 if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX; 629 } 630 336 631 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 337 632 … … 344 639 mfpKinEnergy = DBL_MAX; 345 640 } 346 }347 348 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....349 350 inline void G4VEmProcess::InitialiseStep(const G4Track& track)351 {352 preStepKinEnergy = track.GetKineticEnergy();353 DefineMaterial(track.GetMaterialCutsCouple());354 if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;355 }356 357 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....358 359 inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,360 const G4MaterialCutsCouple* couple)361 {362 DefineMaterial(couple);363 return GetCurrentLambda(kineticEnergy);364 }365 366 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....367 368 inline G4double G4VEmProcess::GetCurrentLambda(G4double e)369 {370 G4double x = 0.0;371 if(theLambdaTable) x = GetLambdaFromTable(e);372 else x = ComputeCurrentLambda(e);373 return x;374 }375 376 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....377 378 inline G4double G4VEmProcess::RecalculateLambda(G4double e,379 const G4MaterialCutsCouple* couple)380 {381 DefineMaterial(couple);382 return ComputeCurrentLambda(e);383 }384 385 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....386 387 inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e)388 {389 G4VEmModel* currentModel = SelectModel(e);390 G4double x = 0.0;391 if(currentModel)392 x = currentModel->CrossSectionPerVolume(currentMaterial,particle,393 e,(*theCuts)[currentMaterialIndex]);394 return x;395 }396 397 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....398 399 inline G4double G4VEmProcess::GetLambdaFromTable(G4double e)400 {401 G4bool b;402 return (((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));403 641 } 404 642 … … 428 666 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 429 667 430 inline G4double G4VEmProcess::MeanFreePath(const G4Track& track) 431 { 432 DefineMaterial(track.GetMaterialCutsCouple()); 433 preStepLambda = GetCurrentLambda(track.GetKineticEnergy()); 434 G4double x = DBL_MAX; 435 if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda; 668 inline G4double G4VEmProcess::GetLambdaFromTable(G4double e) 669 { 670 G4bool b; 671 return (((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b)); 672 } 673 674 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 675 676 inline G4double G4VEmProcess::GetCurrentLambda(G4double e) 677 { 678 G4double x = 0.0; 679 if(theLambdaTable) x = GetLambdaFromTable(e); 680 else x = ComputeCurrentLambda(e); 436 681 return x; 437 682 } … … 439 684 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 440 685 441 inline G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy) 442 { 443 return modelManager->SelectModel(kinEnergy, currentMaterialIndex); 444 } 445 446 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 447 448 inline G4VEmModel* G4VEmProcess::SelectModelForMaterial( 449 G4double kinEnergy, size_t& idxRegion) const 450 { 451 return modelManager->SelectModel(kinEnergy, idxRegion); 452 } 453 454 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 455 456 inline const G4ParticleDefinition* G4VEmProcess::Particle() const 457 { 458 return particle; 459 } 460 461 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 462 463 inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const 464 { 465 return secondaryParticle; 466 } 467 468 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 469 470 inline G4double G4VEmProcess::GetGammaEnergyCut() 471 { 472 return (*theCutsGamma)[currentMaterialIndex]; 473 } 474 475 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 476 477 inline G4double G4VEmProcess::GetElectronEnergyCut() 478 { 479 return (*theCutsElectron)[currentMaterialIndex]; 480 } 481 482 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 483 484 inline void G4VEmProcess::SetLambdaFactor(G4double val) 485 { 486 if(val > 0.0 && val <= 1.0) lambdaFactor = val; 487 } 488 489 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 490 491 inline G4VEmModel* G4VEmProcess::GetModelByIndex(G4int idx) 492 { 493 return modelManager->GetModel(idx); 494 } 495 496 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 497 498 inline void G4VEmProcess::SetParticle(const G4ParticleDefinition* p) 499 { 500 particle = p; 501 } 502 503 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 504 505 inline void G4VEmProcess::SetSecondaryParticle(const G4ParticleDefinition* p) 506 { 507 secondaryParticle = p; 508 } 509 510 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 511 512 inline void G4VEmProcess::AddEmModel(G4int order, G4VEmModel* p, 513 const G4Region* region) 514 { 515 G4VEmFluctuationModel* fm = 0; 516 modelManager->AddEmModel(order, p, fm, region); 517 if(p) p->SetParticleChange(pParticleChange); 518 } 519 520 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 521 522 inline void G4VEmProcess::SetModel(G4VEmModel* model) 523 { 524 selectedModel = model; 525 } 526 527 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 528 529 inline G4VEmModel* G4VEmProcess::Model() 530 { 531 return selectedModel; 532 } 533 534 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 535 536 inline void G4VEmProcess::UpdateEmModel(const G4String& nam, 537 G4double emin, G4double emax) 538 { 539 modelManager->UpdateEmModel(nam, emin, emax); 540 } 541 542 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 543 544 inline G4double G4VEmProcess::ComputeCrossSectionPerAtom( 545 G4double kineticEnergy, G4double Z, G4double A, G4double cut) 546 { 547 G4VEmModel* model = SelectModel(kineticEnergy); 548 return model->ComputeCrossSectionPerAtom(particle,kineticEnergy,Z,A,cut); 549 } 550 551 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 552 553 inline void G4VEmProcess::SetLambdaBinning(G4int nbins) 554 { 555 nLambdaBins = nbins; 556 } 557 558 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 559 560 inline G4int G4VEmProcess::LambdaBinning() const 561 { 562 return nLambdaBins; 563 } 564 565 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 566 567 inline void G4VEmProcess::SetMinKinEnergy(G4double e) 568 { 569 minKinEnergy = e; 570 } 571 572 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 573 574 inline G4double G4VEmProcess::MinKinEnergy() const 575 { 576 return minKinEnergy; 577 } 578 579 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 580 581 inline void G4VEmProcess::SetMaxKinEnergy(G4double e) 582 { 583 maxKinEnergy = e; 584 } 585 586 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 587 588 inline G4double G4VEmProcess::MaxKinEnergy() const 589 { 590 return maxKinEnergy; 591 } 592 593 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 594 595 inline void G4VEmProcess::ActivateDeexcitation(G4bool, const G4Region*) 596 {} 597 598 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 599 600 inline const G4PhysicsTable* G4VEmProcess::LambdaTable() const 601 { 602 return theLambdaTable; 603 } 604 605 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 606 607 inline void G4VEmProcess::SetIntegral(G4bool val) 608 { 609 if(particle && particle != theGamma) integral = val; 610 if(integral) buildLambdaTable = true; 611 } 612 613 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 614 615 inline G4bool G4VEmProcess::IsIntegral() const 616 { 617 return integral; 618 } 619 620 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 621 622 inline void G4VEmProcess::SetBuildTableFlag(G4bool val) 623 { 624 buildLambdaTable = val; 625 if(!val) integral = false; 626 } 627 628 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 629 630 inline void G4VEmProcess::SetStartFromNullFlag(G4bool val) 631 { 632 startFromNull = val; 633 } 634 635 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 636 637 inline void G4VEmProcess::SetApplyCuts(G4bool val) 638 { 639 applyCuts = val; 640 } 641 642 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 643 644 inline size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex() const 645 { 646 return currentMaterialIndex; 686 inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e) 687 { 688 SelectModel(e); 689 G4double x = 0.0; 690 if(currentModel) { 691 x = currentModel->CrossSectionPerVolume(currentMaterial,particle, 692 e,(*theCuts)[currentMaterialIndex]); 693 } 694 return x; 647 695 } 648 696 -
trunk/source/processes/electromagnetic/utils/include/G4VEnergyLoss.hh
r819 r961 26 26 // 27 27 // $Id: G4VEnergyLoss.hh,v 1.18 2006/06/29 19:54:47 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEnergyLossProcess.hh,v 1. 76 2007/11/07 18:38:49vnivanch Exp $26 // $Id: G4VEnergyLossProcess.hh,v 1.86 2009/02/19 09:57:36 vnivanch Exp $ 27 27 // GEANT4 tag $Name: 28 28 // … … 79 79 // PostStepGetPhysicalInteractionLength (V.Ivanchenko) 80 80 // 27-10-07 Virtual functions moved to source (V.Ivanchenko) 81 // 15-07-08 Reorder class members for further multi-thread development (VI) 81 82 // 82 83 // Class Description: … … 125 126 virtual ~G4VEnergyLossProcess(); 126 127 128 private: 129 // clean vectors and arrays 130 void Clean(); 131 127 132 //------------------------------------------------------------------------ 128 133 // Virtual methods to be implemented in concrete processes 129 134 //------------------------------------------------------------------------ 130 135 136 public: 131 137 virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0; 132 138 … … 141 147 // Methods with standard implementation; may be overwritten if needed 142 148 //------------------------------------------------------------------------ 143 protected:144 149 145 150 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*, 146 151 const G4Material*, G4double cut); 147 152 148 virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*, 149 const G4DynamicParticle*, 150 G4double& eloss, 151 G4double& length); 152 153 //------------------------------------------------------------------------ 154 // Generic methods common to all ContinuousDiscrete processes 155 //------------------------------------------------------------------------ 153 //------------------------------------------------------------------------ 154 // Virtual methods implementation common to all EM ContinuousDiscrete 155 // processes. Further inheritance is not assumed 156 //------------------------------------------------------------------------ 157 156 158 public: 157 159 160 // prepare all tables 161 void PreparePhysicsTable(const G4ParticleDefinition&); 162 163 // build all tables 164 void BuildPhysicsTable(const G4ParticleDefinition&); 165 166 // build a table 167 G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted); 168 169 // build a table 170 G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted); 171 172 // summary printout after initialisation 158 173 void PrintInfoDefinition(); 159 174 160 void PreparePhysicsTable(const G4ParticleDefinition&); 161 162 void BuildPhysicsTable(const G4ParticleDefinition&); 163 175 // Add subcutoff option for the region 176 void ActivateSubCutoff(G4bool val, const G4Region* region = 0); 177 178 // Activate deexcitation code for region 179 void ActivateDeexcitation(G4bool, const G4Region* region = 0); 180 181 // Step limit from AlongStep 182 G4double AlongStepGetPhysicalInteractionLength(const G4Track&, 183 G4double previousStepSize, 184 G4double currentMinimumStep, 185 G4double& currentSafety, 186 G4GPILSelection* selection); 187 188 // Step limit from cross section 189 G4double PostStepGetPhysicalInteractionLength(const G4Track& track, 190 G4double previousStepSize, 191 G4ForceCondition* condition); 192 193 // AlongStep computations 164 194 G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&); 165 195 196 // Sampling of secondaries in vicinity of geometrical boundary 197 void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&, 198 G4VEmModel* model, G4int matIdx, 199 G4double& extraEdep); 200 201 // PostStep sampling of secondaries 166 202 G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); 167 203 168 // Store PhysicsTable in a file.169 // Return false in case of failure at I/O204 // Store all PhysicsTable in files. 205 // Return false in case of any fatal failure at I/O 170 206 G4bool StorePhysicsTable(const G4ParticleDefinition*, 171 207 const G4String& directory, 172 208 G4bool ascii = false); 173 209 174 // Retrieve Physics from a file. 175 // (return true if the Physics Table can be build by using file) 176 // (return false if the process has no functionality or in case of failure) 177 // File name should is constructed as processName+particleName and the 178 // should be placed under the directory specifed by the argument. 210 // Retrieve all Physics from a files. 211 // Return true if all the Physics Table are built. 212 // Return false if any fatal failure. 179 213 G4bool RetrievePhysicsTable(const G4ParticleDefinition*, 180 214 const G4String& directory, 181 215 G4bool ascii); 182 216 217 private: 218 // store a table 219 G4bool StoreTable(const G4ParticleDefinition* p, 220 G4PhysicsTable*, G4bool ascii, 221 const G4String& directory, 222 const G4String& tname); 223 224 // retrieve a table 225 G4bool RetrieveTable(const G4ParticleDefinition* p, 226 G4PhysicsTable*, G4bool ascii, 227 const G4String& directory, 228 const G4String& tname, 229 G4bool mandatory); 230 231 //------------------------------------------------------------------------ 232 // Public interface to cross section, mfp and sampling of fluctuations 233 // These methods are not used in run time 234 //------------------------------------------------------------------------ 235 236 public: 237 // access to dispersion of restricted energy loss 238 G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple, 239 const G4DynamicParticle* dp, 240 G4double length); 241 242 // Access to cross section table 243 G4double CrossSectionPerVolume(G4double kineticEnergy, 244 const G4MaterialCutsCouple* couple); 245 246 // access to cross section 247 G4double MeanFreePath(const G4Track& track); 248 249 // access to step limit 250 G4double ContinuousStepLimit(const G4Track& track, 251 G4double previousStepSize, 252 G4double currentMinimumStep, 253 G4double& currentSafety); 254 183 255 protected: 184 256 257 // implementation of the pure virtual method 185 258 G4double GetMeanFreePath(const G4Track& track, 186 259 G4double previousStepSize, 187 260 G4ForceCondition* condition); 188 261 262 // implementation of the pure virtual method 189 263 G4double GetContinuousStepLimit(const G4Track& track, 190 264 G4double previousStepSize, … … 193 267 194 268 //------------------------------------------------------------------------ 195 // Specific methods for along/post step EM processes 196 //------------------------------------------------------------------------ 269 // Run time method which may be also used by derived processes 270 //------------------------------------------------------------------------ 271 272 // creeation of an empty vector for cross section 273 G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*, 274 G4double cut); 275 276 inline G4ParticleChangeForLoss* GetParticleChange(); 277 278 inline size_t CurrentMaterialCutsCoupleIndex() const; 279 280 inline G4double GetCurrentRange() const; 281 282 //------------------------------------------------------------------------ 283 // Specific methods to set, access, modify models 284 //------------------------------------------------------------------------ 285 286 // Select model in run time 287 inline void SelectModel(G4double kinEnergy); 197 288 198 289 public: 199 290 // Select model by energy and region index 291 inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, 292 size_t& idx) const; 293 294 // Add EM model coupled with fluctuation model for region, smaller value 295 // of order defines which pair of models will be selected for a given 296 // energy interval 297 inline void AddEmModel(G4int, G4VEmModel*, 298 G4VEmFluctuationModel* fluc = 0, 299 const G4Region* region = 0); 300 301 // Define new energy range for the model identified by the name 302 inline void UpdateEmModel(const G4String&, G4double, G4double); 303 304 // Assign a model to a process 305 inline void SetEmModel(G4VEmModel*, G4int index=1); 306 307 // return the assigned model 308 inline G4VEmModel* EmModel(G4int index=1); 309 310 // Access to models 311 inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false); 312 313 inline G4int NumberOfModels(); 314 315 // Assign a fluctuation model to a process 316 inline void SetFluctModel(G4VEmFluctuationModel*); 317 318 // return the assigned fluctuation model 319 inline G4VEmFluctuationModel* FluctModel(); 320 321 //------------------------------------------------------------------------ 322 // Define and access particle type 323 //------------------------------------------------------------------------ 324 325 protected: 326 inline void SetParticle(const G4ParticleDefinition* p); 327 inline void SetSecondaryParticle(const G4ParticleDefinition* p); 328 329 public: 330 inline void SetBaseParticle(const G4ParticleDefinition* p); 331 inline const G4ParticleDefinition* Particle() const; 332 inline const G4ParticleDefinition* BaseParticle() const; 333 inline const G4ParticleDefinition* SecondaryParticle() const; 334 335 //------------------------------------------------------------------------ 336 // Get/set parameters to configure the process at initialisation time 337 //------------------------------------------------------------------------ 338 339 // Add subcutoff process (bremsstrahlung) to sample secondary 340 // particle production in vicinity of the geometry boundary 200 341 void AddCollaborativeProcess(G4VEnergyLossProcess*); 201 342 202 void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&, 203 G4VEmModel* model, G4int matIdx, 204 G4double& extraEdep); 205 206 G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple, 207 const G4DynamicParticle* dp, 208 G4double length); 209 210 211 virtual G4double AlongStepGetPhysicalInteractionLength( 212 const G4Track&, 213 G4double previousStepSize, 214 G4double currentMinimumStep, 215 G4double& currentSafety, 216 G4GPILSelection* selection 217 ); 218 219 virtual G4double PostStepGetPhysicalInteractionLength( 220 const G4Track& track, 221 G4double previousStepSize, 222 G4ForceCondition* condition 223 ); 224 225 //------------------------------------------------------------------------ 226 // Specific methods to build and access Physics Tables 227 //------------------------------------------------------------------------ 228 229 G4double MicroscopicCrossSection(G4double kineticEnergy, 230 const G4MaterialCutsCouple* couple); 231 232 G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted); 233 234 G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted); 343 inline void SetLossFluctuations(G4bool val); 344 inline void SetRandomStep(G4bool val); 345 346 inline void SetIntegral(G4bool val); 347 inline G4bool IsIntegral() const; 348 349 // Set/Get flag "isIonisation" 350 inline void SetIonisation(G4bool val); 351 inline G4bool IsIonisationProcess() const; 352 353 // Redefine parameteters for stepping control 354 // 355 inline void SetLinearLossLimit(G4double val); 356 inline void SetMinSubRange(G4double val); 357 inline void SetLambdaFactor(G4double val); 358 inline void SetStepFunction(G4double v1, G4double v2); 359 360 inline G4int NumberOfSubCutoffRegions() const; 361 inline G4int NumberOfDERegions() const; 362 363 //------------------------------------------------------------------------ 364 // Specific methods to path Physics Tables to the process 365 //------------------------------------------------------------------------ 235 366 236 367 void SetDEDXTable(G4PhysicsTable* p, G4EmTableType tType); 237 368 void SetCSDARangeTable(G4PhysicsTable* pRange); 238 369 void SetRangeTableForLoss(G4PhysicsTable* p); 370 void SetSecondaryRangeTable(G4PhysicsTable* p); 239 371 void SetInverseRangeTable(G4PhysicsTable* p); 240 void SetSecondaryRangeTable(G4PhysicsTable* p);241 372 242 373 void SetLambdaTable(G4PhysicsTable* p); … … 260 391 // Max kinetic energy for tables 261 392 inline void SetMaxKinEnergyForCSDARange(G4double e); 393 394 // Return values for given G4MaterialCutsCouple 395 inline G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*); 396 inline G4double GetDEDXForSubsec(G4double& kineticEnergy, 397 const G4MaterialCutsCouple*); 398 inline G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*); 399 inline G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*); 400 inline G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*); 401 inline G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple*); 402 inline G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple*); 403 404 inline G4bool TablesAreBuilt() const; 262 405 263 406 // Access to specific tables … … 273 416 inline G4PhysicsTable* SubLambdaTable(); 274 417 275 // Return values for given G4MaterialCutsCouple276 inline G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*);277 inline G4double GetDEDXForSubsec(G4double& kineticEnergy,278 const G4MaterialCutsCouple*);279 inline G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*);280 inline G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*);281 inline G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*);282 inline G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple*);283 inline G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple*);284 285 inline G4bool TablesAreBuilt() const;286 287 //------------------------------------------------------------------------288 // Define and access particle type289 //------------------------------------------------------------------------290 291 inline void SetBaseParticle(const G4ParticleDefinition* p);292 inline const G4ParticleDefinition* Particle() const;293 inline const G4ParticleDefinition* BaseParticle() const;294 inline const G4ParticleDefinition* SecondaryParticle() const;295 296 //------------------------------------------------------------------------297 // Specific methods to set, access, modify models298 //------------------------------------------------------------------------299 300 // Add EM model coupled with fluctuation model for the region301 inline void AddEmModel(G4int, G4VEmModel*, G4VEmFluctuationModel* fluc = 0,302 const G4Region* region = 0);303 304 // Assign a model to a process305 inline void SetEmModel(G4VEmModel*, G4int index=1);306 307 // return the assigned model308 inline G4VEmModel* EmModel(G4int index=1);309 310 // Assign a fluctuation model to a process311 inline void SetFluctModel(G4VEmFluctuationModel*);312 313 // return the assigned fluctuation model314 inline G4VEmFluctuationModel* FluctModel();315 316 // Define new energy range for the model identified by the name317 inline void UpdateEmModel(const G4String&, G4double, G4double);318 319 // Access to models320 inline G4VEmModel* GetModelByIndex(G4int idx = 0);321 322 inline G4int NumberOfModels();323 324 //------------------------------------------------------------------------325 // Get/set parameters used for simulation of energy loss326 //------------------------------------------------------------------------327 328 inline void SetLossFluctuations(G4bool val);329 inline void SetRandomStep(G4bool val);330 inline void SetIntegral(G4bool val);331 inline G4bool IsIntegral() const;332 333 // Set/Get flag "isIonisation"334 inline void SetIonisation(G4bool val);335 inline G4bool IsIonisationProcess() const;336 337 // Redefine parameteters for stepping control338 //339 inline void SetLinearLossLimit(G4double val);340 inline void SetMinSubRange(G4double val);341 inline void SetStepFunction(G4double v1, G4double v2);342 inline void SetLambdaFactor(G4double val);343 344 345 // Add subcutoff option for the region346 void ActivateSubCutoff(G4bool val, const G4Region* region = 0);347 348 inline G4int NumberOfSubCutoffRegions() const;349 350 // Activate deexcitation code351 virtual void ActivateDeexcitation(G4bool, const G4Region* region = 0);352 353 418 //------------------------------------------------------------------------ 354 419 // Run time method for simulation of ionisation 355 420 //------------------------------------------------------------------------ 356 421 422 // sample range at the end of a step 357 423 inline G4double SampleRange(); 358 424 359 inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idx) const; 360 361 362 // Set scaling parameters 425 // Set scaling parameters for ions is needed to G4EmCalculator 363 426 inline void SetDynamicMassCharge(G4double massratio, G4double charge2ratio); 364 427 365 // Helper functions366 inline G4double MeanFreePath(const G4Track& track);367 368 inline G4double ContinuousStepLimit(const G4Track& track,369 G4double previousStepSize,370 G4double currentMinimumStep,371 G4double& currentSafety);372 373 protected:374 375 G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*,376 G4double cut);377 378 inline virtual void InitialiseMassCharge(const G4Track&);379 380 inline void SetParticle(const G4ParticleDefinition* p);381 382 inline void SetSecondaryParticle(const G4ParticleDefinition* p);383 384 inline G4VEmModel* SelectModel(G4double kinEnergy);385 386 inline size_t CurrentMaterialCutsCoupleIndex() const;387 388 inline G4double GetCurrentRange() const;389 390 428 private: 391 429 392 // Clear tables 393 void Clear(); 394 395 inline void InitialiseStep(const G4Track&); 396 430 // define material and indexes 397 431 inline void DefineMaterial(const G4MaterialCutsCouple* couple); 398 432 399 // Returnd values for scaled energy and base particles mass 400 // 433 //------------------------------------------------------------------------ 434 // Compute values using scaling relation, mass and charge of based particle 435 //------------------------------------------------------------------------ 436 401 437 inline G4double GetDEDXForScaledEnergy(G4double scaledKinEnergy); 402 438 inline G4double GetSubDEDXForScaledEnergy(G4double scaledKinEnergy); … … 405 441 inline G4double GetScaledRangeForScaledEnergy(G4double scaledKinEnergy); 406 442 inline G4double GetLimitScaledRangeForScaledEnergy(G4double scaledKinEnergy); 443 inline G4double ScaledKinEnergyForLoss(G4double range); 407 444 inline G4double GetLambdaForScaledEnergy(G4double scaledKinEnergy); 408 inline G4double ScaledKinEnergyForLoss(G4double range);409 445 inline void ComputeLambdaForScaledEnergy(G4double scaledKinEnergy); 410 446 411 447 // hide assignment operator 412 413 448 G4VEnergyLossProcess(G4VEnergyLossProcess &); 414 449 G4VEnergyLossProcess & operator=(const G4VEnergyLossProcess &right); 415 450 416 // ===================================================================== 417 418 protected: 419 420 G4ParticleChangeForLoss fParticleChange; 421 422 private: 423 424 G4EmModelManager* modelManager; 451 // ======== Parameters of the class fixed at construction ========= 452 453 G4EmModelManager* modelManager; 454 G4SafetyHelper* safetyHelper; 455 456 const G4ParticleDefinition* secondaryParticle; 457 const G4ParticleDefinition* theElectron; 458 const G4ParticleDefinition* thePositron; 459 const G4ParticleDefinition* theGenericIon; 460 461 G4PhysicsVector* vstrag; 462 463 // ======== Parameters of the class fixed at initialisation ======= 464 425 465 std::vector<G4VEmModel*> emModels; 426 466 G4VEmFluctuationModel* fluctModel; 427 467 std::vector<const G4Region*> scoffRegions; 468 std::vector<const G4Region*> deRegions; 428 469 G4int nSCoffRegions; 429 G4int* idxSCoffRegions; 430 std::vector<G4DynamicParticle*> secParticles; 431 std::vector<G4Track*> scTracks; 470 G4int nDERegions; 471 G4bool* idxSCoffRegions; 472 G4bool* idxDERegions; 473 432 474 std::vector<G4VEnergyLossProcess*> scProcesses; 433 475 G4int nProcesses; … … 453 495 const G4DataVector* theSubCuts; 454 496 455 G4SafetyHelper* safetyHelper;456 457 const G4ParticleDefinition* particle;458 497 const G4ParticleDefinition* baseParticle; 459 const G4ParticleDefinition* secondaryParticle;460 const G4ParticleDefinition* theElectron;461 const G4ParticleDefinition* thePositron;462 463 G4PhysicsVector* vstrag;464 465 // cash466 const G4Material* currentMaterial;467 const G4MaterialCutsCouple* currentCouple;468 size_t currentMaterialIndex;469 498 470 499 G4int nBins; 471 500 G4int nBinsCSDA; 472 G4int nWarnings;473 501 474 502 G4double lowestKinEnergy; … … 477 505 G4double maxKinEnergyCSDA; 478 506 479 G4double massRatio;480 G4double reduceFactor;481 G4double chargeSquare;482 G4double chargeSqRatio;483 484 G4double preStepLambda;485 G4double fRange;486 G4double preStepKinEnergy;487 G4double preStepScaledEnergy;488 507 G4double linLossLimit; 489 508 G4double minSubRange; … … 491 510 G4double finalRange; 492 511 G4double lambdaFactor; 493 G4double mfpKinEnergy;494 495 G4GPILSelection aGPILSelection;496 512 497 513 G4bool lossFluctuationFlag; … … 499 515 G4bool tablesAreBuilt; 500 516 G4bool integral; 517 G4bool isIon; 501 518 G4bool isIonisation; 502 519 G4bool useSubCutoff; 520 G4bool useDeexcitation; 521 522 protected: 523 524 G4ParticleChangeForLoss fParticleChange; 525 526 // ======== Cashed values - may be state dependent ================ 527 528 private: 529 530 std::vector<G4DynamicParticle*> secParticles; 531 std::vector<G4Track*> scTracks; 532 533 const G4ParticleDefinition* particle; 534 535 G4VEmModel* currentModel; 536 const G4Material* currentMaterial; 537 const G4MaterialCutsCouple* currentCouple; 538 size_t currentMaterialIndex; 539 540 G4int nWarnings; 541 542 G4double massRatio; 543 G4double reduceFactor; 544 G4double chargeSqRatio; 545 546 G4double preStepLambda; 547 G4double fRange; 548 G4double preStepKinEnergy; 549 G4double preStepScaledEnergy; 550 G4double mfpKinEnergy; 551 552 G4GPILSelection aGPILSelection; 553 503 554 }; 504 555 … … 506 557 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 507 558 508 inline void G4VEnergyLossProcess::DefineMaterial( 509 const G4MaterialCutsCouple* couple) 510 { 511 if(couple != currentCouple) { 512 currentCouple = couple; 513 currentMaterial = couple->GetMaterial(); 514 currentMaterialIndex = couple->GetIndex(); 515 mfpKinEnergy = DBL_MAX; 516 } 517 } 518 519 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 520 521 inline void G4VEnergyLossProcess::InitialiseStep(const G4Track& track) 522 { 523 InitialiseMassCharge(track); 524 preStepKinEnergy = track.GetKineticEnergy(); 525 preStepScaledEnergy = preStepKinEnergy*massRatio; 526 DefineMaterial(track.GetMaterialCutsCouple()); 527 if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX; 528 } 529 530 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 531 532 inline void G4VEnergyLossProcess::InitialiseMassCharge(const G4Track&) 533 {} 559 inline G4ParticleChangeForLoss* G4VEnergyLossProcess::GetParticleChange() 560 { 561 return &fParticleChange; 562 } 563 564 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 565 566 inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const 567 { 568 return currentMaterialIndex; 569 } 570 571 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 572 573 inline G4double G4VEnergyLossProcess::GetCurrentRange() const 574 { 575 return fRange; 576 } 577 578 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 579 580 inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy) 581 { 582 currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex); 583 currentModel->SetCurrentCouple(currentCouple); 584 } 585 586 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 587 588 inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial( 589 G4double kinEnergy, size_t& idx) const 590 { 591 return modelManager->SelectModel(kinEnergy, idx); 592 } 593 594 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 595 596 inline 597 void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p, 598 G4VEmFluctuationModel* fluc, 599 const G4Region* region) 600 { 601 modelManager->AddEmModel(order, p, fluc, region); 602 if(p) p->SetParticleChange(pParticleChange, fluc); 603 } 604 605 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 606 607 inline void G4VEnergyLossProcess::UpdateEmModel(const G4String& nam, 608 G4double emin, G4double emax) 609 { 610 modelManager->UpdateEmModel(nam, emin, emax); 611 } 612 613 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 614 615 inline void G4VEnergyLossProcess::SetEmModel(G4VEmModel* p, G4int index) 616 { 617 G4int n = emModels.size(); 618 if(index >= n) for(G4int i=n; i<index+1; i++) {emModels.push_back(0);} 619 emModels[index] = p; 620 } 621 622 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 623 624 inline G4VEmModel* G4VEnergyLossProcess::EmModel(G4int index) 625 { 626 G4VEmModel* p = 0; 627 if(index >= 0 && index < G4int(emModels.size())) p = emModels[index]; 628 return p; 629 } 630 631 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 632 633 inline 634 G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx, G4bool ver) 635 { 636 return modelManager->GetModel(idx, ver); 637 } 638 639 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 640 641 inline G4int G4VEnergyLossProcess::NumberOfModels() 642 { 643 return modelManager->NumberOfModels(); 644 } 645 646 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 647 648 inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p) 649 { 650 fluctModel = p; 651 } 652 653 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 654 655 inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel() 656 { 657 return fluctModel; 658 } 659 660 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 661 662 inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p) 663 { 664 particle = p; 665 } 666 667 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 668 669 inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p) 670 { 671 secondaryParticle = p; 672 } 673 674 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 675 676 inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p) 677 { 678 baseParticle = p; 679 } 680 681 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 682 683 inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const 684 { 685 return particle; 686 } 687 688 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 689 690 inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const 691 { 692 return baseParticle; 693 } 694 695 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 696 697 inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const 698 { 699 return secondaryParticle; 700 } 701 702 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 703 704 inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val) 705 { 706 lossFluctuationFlag = val; 707 } 708 709 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 710 711 inline void G4VEnergyLossProcess::SetRandomStep(G4bool val) 712 { 713 rndmStepFlag = val; 714 } 715 716 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 717 718 inline void G4VEnergyLossProcess::SetIntegral(G4bool val) 719 { 720 integral = val; 721 } 722 723 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 724 725 inline G4bool G4VEnergyLossProcess::IsIntegral() const 726 { 727 return integral; 728 } 729 730 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 731 732 inline void G4VEnergyLossProcess::SetIonisation(G4bool val) 733 { 734 isIonisation = val; 735 if(val) aGPILSelection = CandidateForSelection; 736 else aGPILSelection = NotCandidateForSelection; 737 } 738 739 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 740 741 inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const 742 { 743 return isIonisation; 744 } 745 746 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 747 748 inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val) 749 { 750 linLossLimit = val; 751 } 752 753 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 754 755 inline void G4VEnergyLossProcess::SetMinSubRange(G4double val) 756 { 757 minSubRange = val; 758 } 759 760 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 761 762 inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val) 763 { 764 if(val > 0.0 && val <= 1.0) lambdaFactor = val; 765 } 766 767 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 768 769 void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2) 770 { 771 dRoverRange = v1; 772 finalRange = v2; 773 if (dRoverRange > 0.999) dRoverRange = 1.0; 774 currentCouple = 0; 775 mfpKinEnergy = DBL_MAX; 776 } 777 778 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 779 780 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const 781 { 782 return nSCoffRegions; 783 } 784 785 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 786 787 inline G4int G4VEnergyLossProcess::NumberOfDERegions() const 788 { 789 return nDERegions; 790 } 791 792 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 793 794 inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins) 795 { 796 nBins = nbins; 797 } 798 799 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 800 801 inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins) 802 { 803 nBins = nbins; 804 } 805 806 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 807 808 inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins) 809 { 810 nBinsCSDA = nbins; 811 } 812 813 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 814 815 inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e) 816 { 817 minKinEnergy = e; 818 } 819 820 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 821 822 inline G4double G4VEnergyLossProcess::MinKinEnergy() const 823 { 824 return minKinEnergy; 825 } 826 827 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 828 829 inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e) 830 { 831 maxKinEnergy = e; 832 if(e < maxKinEnergyCSDA) maxKinEnergyCSDA = e; 833 } 834 835 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 836 837 inline G4double G4VEnergyLossProcess::MaxKinEnergy() const 838 { 839 return maxKinEnergy; 840 } 841 842 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 843 844 inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e) 845 { 846 maxKinEnergyCSDA = e; 847 } 534 848 535 849 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 549 863 DefineMaterial(couple); 550 864 return GetSubDEDXForScaledEnergy(kineticEnergy*massRatio); 551 }552 553 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....554 555 inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)556 {557 G4bool b;558 G4double x =559 ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;560 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);561 return x;562 }563 564 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....565 566 inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)567 {568 G4bool b;569 G4double x =570 ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;571 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);572 return x;573 }574 575 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....576 577 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)578 {579 G4bool b;580 G4double x = 0.0;581 // if(theIonisationTable) {582 x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b))583 *chargeSqRatio;584 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);585 //}586 return x;587 }588 589 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....590 591 inline592 G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)593 {594 G4bool b;595 G4double x = 0.0;596 //if(theIonisationSubTable) {597 x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b))598 *chargeSqRatio;599 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);600 //}601 return x;602 865 } 603 866 … … 634 897 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 635 898 899 inline G4double G4VEnergyLossProcess::GetRangeForLoss( 900 G4double& kineticEnergy, 901 const G4MaterialCutsCouple* couple) 902 { 903 DefineMaterial(couple); 904 G4double x = DBL_MAX; 905 if(theRangeTableForLoss) 906 x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor; 907 // G4cout << "Range from " << GetProcessName() 908 // << " e= " << kineticEnergy << " r= " << x << G4endl; 909 return x; 910 } 911 912 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 913 914 inline G4double G4VEnergyLossProcess::GetKineticEnergy( 915 G4double& range, 916 const G4MaterialCutsCouple* couple) 917 { 918 DefineMaterial(couple); 919 G4double r = range/reduceFactor; 920 G4double e = ScaledKinEnergyForLoss(r)/massRatio; 921 return e; 922 } 923 924 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 925 926 inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy, 927 const G4MaterialCutsCouple* couple) 928 { 929 DefineMaterial(couple); 930 G4double x = 0.0; 931 if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio); 932 return x; 933 } 934 935 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 936 937 inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const 938 { 939 return tablesAreBuilt; 940 } 941 942 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 943 944 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const 945 { 946 return theDEDXTable; 947 } 948 949 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 950 951 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const 952 { 953 return theDEDXSubTable; 954 } 955 956 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 957 958 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const 959 { 960 return theDEDXunRestrictedTable; 961 } 962 963 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 964 965 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const 966 { 967 G4PhysicsTable* t = theDEDXTable; 968 if(theIonisationTable) t = theIonisationTable; 969 return t; 970 } 971 972 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 973 974 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const 975 { 976 G4PhysicsTable* t = theDEDXSubTable; 977 if(theIonisationSubTable) t = theIonisationSubTable; 978 return t; 979 } 980 981 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 982 983 inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const 984 { 985 return theCSDARangeTable; 986 } 987 988 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 989 990 inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const 991 { 992 return theRangeTableForLoss; 993 } 994 995 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 996 997 inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const 998 { 999 return theInverseRangeTable; 1000 } 1001 1002 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1003 1004 inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable() 1005 { 1006 return theLambdaTable; 1007 } 1008 1009 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1010 1011 inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable() 1012 { 1013 return theSubLambdaTable; 1014 } 1015 1016 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1017 1018 inline G4double G4VEnergyLossProcess::SampleRange() 1019 { 1020 G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass(); 1021 G4bool b; 1022 G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b)); 1023 G4double x = fRange + G4RandGauss::shoot(0.0,s); 1024 if(x > 0.0) fRange = x; 1025 return fRange; 1026 } 1027 1028 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1029 1030 inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio, 1031 G4double charge2ratio) 1032 { 1033 massRatio = massratio; 1034 chargeSqRatio = charge2ratio; 1035 reduceFactor = 1.0/(chargeSqRatio*massRatio); 1036 } 1037 1038 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1039 1040 inline void G4VEnergyLossProcess::DefineMaterial( 1041 const G4MaterialCutsCouple* couple) 1042 { 1043 if(couple != currentCouple) { 1044 currentCouple = couple; 1045 currentMaterial = couple->GetMaterial(); 1046 currentMaterialIndex = couple->GetIndex(); 1047 mfpKinEnergy = DBL_MAX; 1048 } 1049 } 1050 1051 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1052 1053 inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e) 1054 { 1055 G4bool b; 1056 G4double x = 1057 ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio; 1058 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1059 return x; 1060 } 1061 1062 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1063 1064 inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e) 1065 { 1066 G4bool b; 1067 G4double x = 1068 ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio; 1069 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1070 return x; 1071 } 1072 1073 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1074 1075 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e) 1076 { 1077 G4bool b; 1078 G4double x = 0.0; 1079 // if(theIonisationTable) { 1080 x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b)) 1081 *chargeSqRatio; 1082 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1083 //} 1084 return x; 1085 } 1086 1087 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1088 1089 inline 1090 G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e) 1091 { 1092 G4bool b; 1093 G4double x = 0.0; 1094 //if(theIonisationSubTable) { 1095 x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b)) 1096 *chargeSqRatio; 1097 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1098 //} 1099 return x; 1100 } 1101 1102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1103 1104 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e) 1105 { 1106 G4bool b; 1107 G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b); 1108 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1109 return x; 1110 } 1111 1112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1113 636 1114 inline G4double G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy( 637 1115 G4double e) … … 648 1126 } 649 1127 return x; 650 }651 652 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....653 654 inline G4double G4VEnergyLossProcess::GetRangeForLoss(655 G4double& kineticEnergy,656 const G4MaterialCutsCouple* couple)657 {658 DefineMaterial(couple);659 G4double x = DBL_MAX;660 if(theRangeTableForLoss)661 x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;662 // G4cout << "Range from " << GetProcessName()663 // << " e= " << kineticEnergy << " r= " << x << G4endl;664 return x;665 }666 667 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....668 669 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)670 {671 G4bool b;672 G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b);673 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);674 return x;675 }676 677 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....678 679 inline G4double G4VEnergyLossProcess::GetKineticEnergy(680 G4double& range,681 const G4MaterialCutsCouple* couple)682 {683 DefineMaterial(couple);684 G4double r = range/reduceFactor;685 G4double e = ScaledKinEnergyForLoss(r)/massRatio;686 return e;687 1128 } 688 1129 … … 702 1143 } 703 1144 return e; 704 }705 706 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....707 708 inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,709 const G4MaterialCutsCouple* couple)710 {711 DefineMaterial(couple);712 G4double x = 0.0;713 if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio);714 return x;715 1145 } 716 1146 … … 749 1179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 750 1180 751 inline G4double G4VEnergyLossProcess::ContinuousStepLimit(752 const G4Track& track, G4double x, G4double y, G4double& z)753 {754 G4GPILSelection sel;755 return AlongStepGetPhysicalInteractionLength(track, x, y, z, &sel);756 }757 758 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....759 760 inline G4double G4VEnergyLossProcess::SampleRange()761 {762 G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass();763 G4bool b;764 G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b));765 G4double x = fRange + G4RandGauss::shoot(0.0,s);766 if(x > 0.0) fRange = x;767 return fRange;768 }769 770 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....771 772 inline G4double G4VEnergyLossProcess::MeanFreePath(const G4Track& track)773 {774 DefineMaterial(track.GetMaterialCutsCouple());775 preStepLambda = GetLambdaForScaledEnergy(track.GetKineticEnergy()*massRatio);776 G4double x = DBL_MAX;777 if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;778 return x;779 }780 781 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....782 783 inline G4double G4VEnergyLossProcess::MinPrimaryEnergy(784 const G4ParticleDefinition*, const G4Material*, G4double cut)785 {786 return cut;787 }788 789 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....790 791 inline G4VEmModel* G4VEnergyLossProcess::SelectModel(G4double kinEnergy)792 {793 return modelManager->SelectModel(kinEnergy, currentMaterialIndex);794 }795 796 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....797 798 inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial(799 G4double kinEnergy, size_t& idx) const800 {801 return modelManager->SelectModel(kinEnergy, idx);802 }803 804 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....805 806 inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const807 {808 return particle;809 }810 811 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....812 813 inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const814 {815 return baseParticle;816 }817 818 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....819 820 inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const821 {822 return secondaryParticle;823 }824 825 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....826 827 inline void G4VEnergyLossProcess::CorrectionsAlongStep(828 const G4MaterialCutsCouple*,829 const G4DynamicParticle*,830 G4double&,831 G4double&)832 {}833 834 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....835 836 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const837 {838 return theDEDXTable;839 }840 841 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....842 843 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const844 {845 return theDEDXSubTable;846 }847 848 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....849 850 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const851 {852 return theDEDXunRestrictedTable;853 }854 855 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....856 857 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const858 {859 G4PhysicsTable* t = theDEDXTable;860 if(theIonisationTable) t = theIonisationTable;861 return t;862 }863 864 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....865 866 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const867 {868 G4PhysicsTable* t = theDEDXSubTable;869 if(theIonisationSubTable) t = theIonisationSubTable;870 return t;871 }872 873 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....874 875 inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const876 {877 return theCSDARangeTable;878 }879 880 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....881 882 inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const883 {884 return theRangeTableForLoss;885 }886 887 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....888 889 inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const890 {891 return theInverseRangeTable;892 }893 894 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....895 896 inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()897 {898 return theLambdaTable;899 }900 901 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....902 903 inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()904 {905 return theSubLambdaTable;906 }907 908 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....909 910 inline G4bool G4VEnergyLossProcess::IsIntegral() const911 {912 return integral;913 }914 915 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....916 917 inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const918 {919 return currentMaterialIndex;920 }921 922 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....923 924 inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,925 G4double charge2ratio)926 {927 massRatio = massratio;928 chargeSqRatio = charge2ratio;929 chargeSquare = charge2ratio*eplus*eplus;930 if(chargeSqRatio > 0.0) reduceFactor = 1.0/(chargeSqRatio*massRatio);931 }932 933 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....934 935 inline G4double G4VEnergyLossProcess::GetCurrentRange() const936 {937 return fRange;938 }939 940 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....941 942 void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p,943 G4VEmFluctuationModel* fluc,944 const G4Region* region)945 {946 modelManager->AddEmModel(order, p, fluc, region);947 if(p) p->SetParticleChange(pParticleChange, fluc);948 }949 950 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....951 952 inline G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx)953 {954 return modelManager->GetModel(idx);955 }956 957 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....958 959 inline G4int G4VEnergyLossProcess::NumberOfModels()960 {961 return modelManager->NumberOfModels();962 }963 964 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....965 966 inline void G4VEnergyLossProcess::SetEmModel(G4VEmModel* p, G4int index)967 {968 G4int n = emModels.size();969 if(index >= n) for(G4int i=n; i<index+1; i++) {emModels.push_back(0);}970 emModels[index] = p;971 }972 973 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....974 975 inline G4VEmModel* G4VEnergyLossProcess::EmModel(G4int index)976 {977 G4VEmModel* p = 0;978 if(index >= 0 && index < G4int(emModels.size())) p = emModels[index];979 return p;980 }981 982 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....983 984 inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p)985 {986 fluctModel = p;987 }988 989 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....990 991 inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel()992 {993 return fluctModel;994 }995 996 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....997 998 inline void G4VEnergyLossProcess::UpdateEmModel(const G4String& nam,999 G4double emin, G4double emax)1000 {1001 modelManager->UpdateEmModel(nam, emin, emax);1002 }1003 1004 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1005 1006 inline void G4VEnergyLossProcess::SetIntegral(G4bool val)1007 {1008 integral = val;1009 }1010 1011 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1012 1013 inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p)1014 {1015 particle = p;1016 }1017 1018 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1019 1020 inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p)1021 {1022 baseParticle = p;1023 }1024 1025 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1026 1027 inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p)1028 {1029 secondaryParticle = p;1030 }1031 1032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1033 1034 inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val)1035 {1036 linLossLimit = val;1037 }1038 1039 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1040 1041 inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val)1042 {1043 lossFluctuationFlag = val;1044 }1045 1046 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1047 1048 inline void G4VEnergyLossProcess::SetRandomStep(G4bool val)1049 {1050 rndmStepFlag = val;1051 }1052 1053 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1054 1055 inline void G4VEnergyLossProcess::SetMinSubRange(G4double val)1056 {1057 minSubRange = val;1058 }1059 1060 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1061 1062 inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const1063 {1064 return tablesAreBuilt;1065 }1066 1067 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1068 1069 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const1070 {1071 return nSCoffRegions;1072 }1073 1074 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1075 1076 inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins)1077 {1078 nBins = nbins;1079 }1080 1081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1082 1083 inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins)1084 {1085 nBins = nbins;1086 }1087 1088 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1089 1090 inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins)1091 {1092 nBinsCSDA = nbins;1093 }1094 1095 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1096 1097 inline G4double G4VEnergyLossProcess::MinKinEnergy() const1098 {1099 return minKinEnergy;1100 }1101 1102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1103 1104 inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e)1105 {1106 minKinEnergy = e;1107 }1108 1109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1110 1111 inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e)1112 {1113 maxKinEnergy = e;1114 if(e < maxKinEnergyCSDA) maxKinEnergyCSDA = e;1115 }1116 1117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1118 1119 inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e)1120 {1121 maxKinEnergyCSDA = e;1122 }1123 1124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1125 1126 inline G4double G4VEnergyLossProcess::MaxKinEnergy() const1127 {1128 return maxKinEnergy;1129 }1130 1131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1132 1133 inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val)1134 {1135 if(val > 0.0 && val <= 1.0) lambdaFactor = val;1136 }1137 1138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1139 1140 inline void G4VEnergyLossProcess::SetIonisation(G4bool val)1141 {1142 isIonisation = val;1143 if(val) aGPILSelection = CandidateForSelection;1144 else aGPILSelection = NotCandidateForSelection;1145 }1146 1147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1148 1149 inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const1150 {1151 return isIonisation;1152 }1153 1154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1155 1156 void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2)1157 {1158 dRoverRange = v1;1159 finalRange = v2;1160 if (dRoverRange > 0.999) dRoverRange = 1.0;1161 currentCouple = 0;1162 mfpKinEnergy = DBL_MAX;1163 }1164 1165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1166 1167 1181 #endif -
trunk/source/processes/electromagnetic/utils/include/G4VMultipleScattering.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VMultipleScattering.hh,v 1. 48 2007/10/29 08:38:58vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4VMultipleScattering.hh,v 1.55 2009/02/18 12:19:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 63 63 // 12-02-07 Add get/set skin (V.Ivanchenko) 64 64 // 27-10-07 Virtual functions moved to source (V.Ivanchenko) 65 // 15-07-08 Reorder class members for further multi-thread development (VI) 65 66 // 66 67 … … 72 73 73 74 #include "G4VContinuousDiscreteProcess.hh" 74 #include "G4LossTableManager.hh"75 75 #include "globals.hh" 76 76 #include "G4Material.hh" … … 95 95 96 96 G4VMultipleScattering(const G4String& name = "msc", 97 G4ProcessType type = fElectromagnetic);97 G4ProcessType type = fElectromagnetic); 98 98 99 99 virtual ~G4VMultipleScattering(); … … 104 104 105 105 virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0; 106 // True for all charged particles107 106 108 107 virtual void PrintInfo() = 0; … … 112 111 virtual void InitialiseProcess(const G4ParticleDefinition*) = 0; 113 112 114 //------------------------------------------------------------------------115 // Methods with standard implementation; may be overwritten if needed116 //------------------------------------------------------------------------117 113 public: 118 114 … … 138 134 G4bool StorePhysicsTable(const G4ParticleDefinition*, 139 135 const G4String& directory, 140 G4bool ascii = false);136 G4bool ascii = false); 141 137 142 138 // Retrieve Physics from a file. … … 147 143 G4bool RetrievePhysicsTable(const G4ParticleDefinition*, 148 144 const G4String& directory, 149 G4bool ascii); 150 151 //------------------------------------------------------------------------ 152 // Specific methods for msc processes 153 //------------------------------------------------------------------------ 145 G4bool ascii); 154 146 155 147 // The function overloads the corresponding function of the base … … 158 150 G4double AlongStepGetPhysicalInteractionLength( 159 151 const G4Track&, 160 G4double previousStepSize,161 G4double currentMinimalStep,162 G4double& currentSafety,163 G4GPILSelection* selection);152 G4double previousStepSize, 153 G4double currentMinimalStep, 154 G4double& currentSafety, 155 G4GPILSelection* selection); 164 156 165 157 // The function overloads the corresponding function of the base … … 188 180 inline void SetMinKinEnergy(G4double e); 189 181 inline G4double MinKinEnergy() const; 190 // Print out of the class parameters191 182 192 183 inline void SetMaxKinEnergy(G4double e); … … 197 188 inline G4PhysicsTable* LambdaTable() const; 198 189 199 //------------------------------------------------------------------------ 200 // Define and access particle type 201 //------------------------------------------------------------------------ 202 190 // access particle type 203 191 inline const G4ParticleDefinition* Particle() const; 204 inline void SetParticle(const G4ParticleDefinition*);205 192 206 193 //------------------------------------------------------------------------ … … 208 195 //------------------------------------------------------------------------ 209 196 210 inline void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0); 211 197 protected: 198 // Select model in run time 199 inline G4VEmModel* SelectModel(G4double kinEnergy); 200 201 public: 202 // Select model in run time 212 203 inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, 213 204 size_t& idxRegion) const; 214 205 215 // Access to models 216 inline G4VEmModel* GetModelByIndex(G4int idx = 0); 217 218 //------------------------------------------------------------------------ 219 // Parameters for simulation of multiple scattering 220 //------------------------------------------------------------------------ 221 206 // Add model for region, smaller value of order defines which 207 // model will be selected for a given energy interval 208 inline void AddEmModel(G4int order, G4VEmModel*, const G4Region* region = 0); 209 210 // Access to models by index 211 inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false); 212 213 //------------------------------------------------------------------------ 214 // Get/Set parameters for simulation of multiple scattering 215 //------------------------------------------------------------------------ 216 217 inline G4bool LateralDisplasmentFlag() const; 222 218 inline void SetLateralDisplasmentFlag(G4bool val); 223 // lateral displacement to be/not to be computed 224 219 220 inline G4double Skin() const; 225 221 inline void SetSkin(G4double val); 226 // skin parameter 227 222 223 inline G4double RangeFactor() const; 228 224 inline void SetRangeFactor(G4double val); 229 // FactorRange parameter 230 225 226 inline G4double GeomFactor() const; 231 227 inline void SetGeomFactor(G4double val); 232 // FactorRange parameter 233 228 229 inline G4double PolarAngleLimit() const; 230 inline void SetPolarAngleLimit(G4double val); 231 232 inline G4MscStepLimitType StepLimitType() const; 234 233 inline void SetStepLimitType(G4MscStepLimitType val); 235 // FactorRange parameter 234 235 //------------------------------------------------------------------------ 236 // Run time methods 237 //------------------------------------------------------------------------ 236 238 237 239 protected: … … 241 243 G4double, 242 244 G4ForceCondition* condition); 243 244 //------------------------------------------------------------------------245 // Run time methods246 //------------------------------------------------------------------------247 245 248 246 // This method is not used for tracking, it returns step limit … … 252 250 G4double& currentSafety); 253 251 254 inline G4double GetLambda(const G4ParticleDefinition* p, G4double& kineticEnergy); 252 inline G4double GetLambda(const G4ParticleDefinition* p, 253 G4double& kineticEnergy); 255 254 256 255 // This method is used for tracking, it returns step limit 257 256 inline G4double GetMscContinuousStepLimit(const G4Track& track, 258 G4double previousStepSize,257 G4double scaledKinEnergy, 259 258 G4double currentMinimalStep, 260 259 G4double& currentSafety); 261 260 262 inline G4VEmModel* SelectModel(G4double kinEnergy);263 // Select concrete model261 // define current material 262 inline void DefineMaterial(const G4MaterialCutsCouple* couple); 264 263 265 264 inline const G4MaterialCutsCouple* CurrentMaterialCutsCouple() const; 266 // Return current G4MaterialCutsCouple 267 268 inline void DefineMaterial(const G4MaterialCutsCouple* couple); 269 // define current material 270 271 //------------------------------------------------------------------------ 272 // Parameters for simulation of multiple scattering 273 //------------------------------------------------------------------------ 274 275 inline G4double Skin() const; 276 277 inline G4double RangeFactor() const; 278 279 inline G4double GeomFactor() const; 280 281 inline G4MscStepLimitType StepLimitType() const; 282 283 inline G4bool LateralDisplasmentFlag() const; 265 266 inline G4ParticleChangeForMSC* GetParticleChange(); 267 284 268 285 269 private: 286 270 287 271 // hide assignment operator 288 289 272 G4VMultipleScattering(G4VMultipleScattering &); 290 273 G4VMultipleScattering & operator=(const G4VMultipleScattering &right); 291 274 292 // ===================================================================== 293 294 protected: 295 296 G4GPILSelection valueGPILSelectionMSC; 297 G4ParticleChangeForMSC fParticleChange; 298 299 private: 275 // ======== Parameters of the class fixed at construction ========= 300 276 301 277 G4EmModelManager* modelManager; 302 G4VEmModel* currentModel; 278 G4bool buildLambdaTable; 279 280 // ======== Parameters of the class fixed at initialisation ======= 281 303 282 G4PhysicsTable* theLambdaTable; 304 305 // cache306 283 const G4ParticleDefinition* firstParticle; 307 const G4ParticleDefinition* currentParticle;308 const G4MaterialCutsCouple* currentCouple;309 size_t currentMaterialIndex;310 311 G4int nBins;312 284 313 285 G4MscStepLimitType stepLimit; … … 318 290 G4double facrange; 319 291 G4double facgeom; 292 G4double polarAngleLimit; 293 294 G4int nBins; 320 295 321 296 G4bool latDisplasment; 322 G4bool buildLambdaTable; 297 298 // ======== Cashed values - may be state dependent ================ 299 300 protected: 301 302 G4GPILSelection valueGPILSelectionMSC; 303 G4ParticleChangeForMSC fParticleChange; 304 305 private: 306 307 G4VEmModel* currentModel; 308 309 // cache 310 const G4ParticleDefinition* currentParticle; 311 const G4MaterialCutsCouple* currentCouple; 312 size_t currentMaterialIndex; 313 323 314 }; 324 315 325 316 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 326 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....327 328 inline void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)329 {330 if(couple != currentCouple) {331 currentCouple = couple;332 currentMaterialIndex = couple->GetIndex();333 }334 }335 336 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....337 338 inline G4double G4VMultipleScattering::GetMscContinuousStepLimit(339 const G4Track& track,340 G4double,341 G4double currentMinimalStep,342 G4double&)343 {344 G4double x = currentMinimalStep;345 G4double e = track.GetKineticEnergy();346 DefineMaterial(track.GetMaterialCutsCouple());347 currentModel = SelectModel(e);348 if(x > 0.0 && e > 0.0) {349 G4double tPathLength =350 currentModel->ComputeTruePathLengthLimit(track, theLambdaTable, x);351 if (tPathLength < x) valueGPILSelectionMSC = CandidateForSelection;352 x = currentModel->ComputeGeomPathLength(tPathLength);353 // G4cout << "tPathLength= " << tPathLength354 // << " stepLimit= " << x355 // << " currentMinimalStep= " << currentMinimalStep<< G4endl;356 }357 return x;358 }359 360 317 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 361 318 … … 367 324 { 368 325 return GetMscContinuousStepLimit(track,previousStepSize,currentMinimalStep, 369 currentSafety); 370 } 371 372 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 373 374 inline G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p, G4double& e) 326 currentSafety); 327 } 328 329 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 330 331 inline void G4VMultipleScattering::SetBinning(G4int nbins) 332 { 333 nBins = nbins; 334 } 335 336 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 337 338 inline G4int G4VMultipleScattering::Binning() const 339 { 340 return nBins; 341 } 342 343 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 344 345 inline void G4VMultipleScattering::SetMinKinEnergy(G4double e) 346 { 347 minKinEnergy = e; 348 } 349 350 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 351 352 inline G4double G4VMultipleScattering::MinKinEnergy() const 353 { 354 return minKinEnergy; 355 } 356 357 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 358 359 inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e) 360 { 361 maxKinEnergy = e; 362 } 363 364 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 365 366 inline G4double G4VMultipleScattering::MaxKinEnergy() const 367 { 368 return maxKinEnergy; 369 } 370 371 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 372 373 inline void G4VMultipleScattering::SetBuildLambdaTable(G4bool val) 374 { 375 buildLambdaTable = val; 376 } 377 378 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 379 380 inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const 381 { 382 return theLambdaTable; 383 } 384 385 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 386 387 inline const G4ParticleDefinition* G4VMultipleScattering::Particle() const 388 { 389 return currentParticle; 390 } 391 392 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 393 394 inline void G4VMultipleScattering::AddEmModel(G4int order, G4VEmModel* p, 395 const G4Region* region) 396 { 397 G4VEmFluctuationModel* fm = 0; 398 modelManager->AddEmModel(order, p, fm, region); 399 if(p) p->SetParticleChange(pParticleChange); 400 } 401 402 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 403 404 inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy) 405 { 406 return modelManager->SelectModel(kinEnergy, currentMaterialIndex); 407 } 408 409 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 410 411 inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial( 412 G4double kinEnergy, size_t& idxRegion) const 413 { 414 return modelManager->SelectModel(kinEnergy, idxRegion); 415 } 416 417 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 418 419 inline 420 G4VEmModel* G4VMultipleScattering::GetModelByIndex(G4int idx, G4bool ver) 421 { 422 return modelManager->GetModel(idx, ver); 423 } 424 425 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 426 427 inline G4bool G4VMultipleScattering::LateralDisplasmentFlag() const 428 { 429 return latDisplasment; 430 } 431 432 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 433 434 inline void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val) 435 { 436 latDisplasment = val; 437 } 438 439 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 440 441 inline G4double G4VMultipleScattering::Skin() const 442 { 443 return skin; 444 } 445 446 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 447 448 inline void G4VMultipleScattering::SetSkin(G4double val) 449 { 450 if(val < 1.0) skin = 0.0; 451 else skin = val; 452 } 453 454 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 455 456 inline G4double G4VMultipleScattering::RangeFactor() const 457 { 458 return facrange; 459 } 460 461 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 462 463 inline void G4VMultipleScattering::SetRangeFactor(G4double val) 464 { 465 if(val > 0.0) facrange = val; 466 } 467 468 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 469 470 inline G4double G4VMultipleScattering::GeomFactor() const 471 { 472 return facgeom; 473 } 474 475 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 476 477 inline void G4VMultipleScattering::SetGeomFactor(G4double val) 478 { 479 if(val > 0.0) facgeom = val; 480 } 481 482 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 483 484 inline G4double G4VMultipleScattering::PolarAngleLimit() const 485 { 486 return polarAngleLimit; 487 } 488 489 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 490 491 inline void G4VMultipleScattering::SetPolarAngleLimit(G4double val) 492 { 493 if(val < 0.0) polarAngleLimit = 0.0; 494 else if(val > pi) polarAngleLimit = pi; 495 else polarAngleLimit = val; 496 } 497 498 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 499 500 inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const 501 { 502 return stepLimit; 503 } 504 505 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 506 507 inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val) 508 { 509 stepLimit = val; 510 if(val == fMinimal) facrange = 0.2; 511 } 512 513 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 514 515 inline 516 G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p, 517 G4double& e) 375 518 { 376 519 G4double x; … … 388 531 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 389 532 390 inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy) 391 { 392 return modelManager->SelectModel(kinEnergy, currentMaterialIndex); 393 } 394 395 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 396 397 inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial( 398 G4double kinEnergy, size_t& idxRegion) const 399 { 400 return modelManager->SelectModel(kinEnergy, idxRegion); 401 } 402 403 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 404 405 inline void G4VMultipleScattering::SetBinning(G4int nbins) 406 { 407 nBins = nbins; 408 } 409 410 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 411 412 inline G4int G4VMultipleScattering::Binning() const 413 { 414 return nBins; 415 } 416 417 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 418 419 inline void G4VMultipleScattering::SetMinKinEnergy(G4double e) 420 { 421 minKinEnergy = e; 422 } 423 424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 425 426 inline G4double G4VMultipleScattering::MinKinEnergy() const 427 { 428 return minKinEnergy; 429 } 430 431 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 432 433 inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e) 434 { 435 maxKinEnergy = e; 436 } 437 438 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 439 440 inline G4double G4VMultipleScattering::MaxKinEnergy() const 441 { 442 return maxKinEnergy; 443 } 444 445 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 446 447 inline G4bool G4VMultipleScattering::LateralDisplasmentFlag() const 448 { 449 return latDisplasment; 450 } 451 452 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 453 454 inline void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val) 455 { 456 latDisplasment = val; 457 } 458 459 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 460 461 inline G4double G4VMultipleScattering::Skin() const 462 { 463 return skin; 464 } 465 466 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 467 468 inline void G4VMultipleScattering::SetSkin(G4double val) 469 { 470 if(val <= 0.99999) { 471 skin = 0.0; 472 stepLimit = fUseSafety; 473 } else { 474 skin = val; 475 stepLimit = fUseDistanceToBoundary; 533 inline G4double G4VMultipleScattering::GetMscContinuousStepLimit( 534 const G4Track& track, 535 G4double scaledKinEnergy, 536 G4double currentMinimalStep, 537 G4double&) 538 { 539 G4double x = currentMinimalStep; 540 DefineMaterial(track.GetMaterialCutsCouple()); 541 currentModel = SelectModel(scaledKinEnergy); 542 if(x > 0.0 && scaledKinEnergy > 0.0) { 543 G4double tPathLength = 544 currentModel->ComputeTruePathLengthLimit(track, theLambdaTable, x); 545 if (tPathLength < x) valueGPILSelectionMSC = CandidateForSelection; 546 x = currentModel->ComputeGeomPathLength(tPathLength); 547 // G4cout << "tPathLength= " << tPathLength 548 // << " stepLimit= " << x 549 // << " currentMinimalStep= " << currentMinimalStep<< G4endl; 476 550 } 477 } 478 479 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 480 481 inline G4double G4VMultipleScattering::RangeFactor() const 482 { 483 return facrange; 484 } 485 486 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 487 488 inline void G4VMultipleScattering::SetRangeFactor(G4double val) 489 { 490 if(val > 0.0) facrange = val; 491 } 492 493 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 494 495 inline G4double G4VMultipleScattering::GeomFactor() const 496 { 497 return facgeom; 498 } 499 500 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 501 502 inline void G4VMultipleScattering::SetGeomFactor(G4double val) 503 { 504 if(val > 0.0) facgeom = val; 505 } 506 507 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 508 509 inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const 510 { 511 return stepLimit; 512 } 513 514 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 515 516 inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val) 517 { 518 stepLimit = val; 519 if(val == fMinimal) { 520 skin = 0; 521 facrange = 0.2; 522 } else if(val == fUseSafety) { 523 skin = 0; 551 return x; 552 } 553 554 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 555 556 inline 557 void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple) 558 { 559 if(couple != currentCouple) { 560 currentCouple = couple; 561 currentMaterialIndex = couple->GetIndex(); 524 562 } 525 563 } … … 527 565 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 528 566 529 inline void G4VMultipleScattering::SetBuildLambdaTable(G4bool val) 530 { 531 buildLambdaTable = val; 532 } 533 534 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 535 536 inline const G4ParticleDefinition* G4VMultipleScattering::Particle() const 537 { 538 return currentParticle; 539 } 540 541 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 542 543 inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const 544 { 545 return theLambdaTable; 546 } 547 548 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 549 550 inline 551 const G4MaterialCutsCouple* G4VMultipleScattering::CurrentMaterialCutsCouple() const 567 inline const G4MaterialCutsCouple* 568 G4VMultipleScattering::CurrentMaterialCutsCouple() const 552 569 { 553 570 return currentCouple; … … 556 573 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 557 574 558 inline void G4VMultipleScattering::AddEmModel(G4int order, G4VEmModel* p, 559 const G4Region* region) 560 { 561 G4VEmFluctuationModel* fm = 0; 562 modelManager->AddEmModel(order, p, fm, region); 563 if(p)p->SetParticleChange(pParticleChange); 564 } 565 566 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 567 568 inline G4VEmModel* G4VMultipleScattering::GetModelByIndex(G4int idx) 569 { 570 return modelManager->GetModel(idx); 575 inline G4ParticleChangeForMSC* G4VMultipleScattering::GetParticleChange() 576 { 577 return &fParticleChange; 571 578 } 572 579 -
trunk/source/processes/electromagnetic/utils/include/G4ionEffectiveCharge.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ionEffectiveCharge.hh,v 1. 8 2006/08/15 16:21:39vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4ionEffectiveCharge.hh,v 1.12 2008/09/20 19:39:34 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 56 56 57 57 #include "globals.hh" 58 #include "G4ParticleDefinition.hh" 58 59 59 60 class G4Material; 60 class G4 ParticleDefinition;61 class G4NistManager; 61 62 62 63 class G4ionEffectiveCharge … … 84 85 G4ionEffectiveCharge(const G4ionEffectiveCharge&); 85 86 87 G4NistManager* nist; 88 89 const G4ParticleDefinition* lastPart; 90 const G4Material* lastMat; 91 G4double lastKinEnergy; 92 86 93 G4double chargeCorrection; 94 G4double effCharge; 95 87 96 G4double energyHighLimit; 88 97 G4double energyLowLimit; … … 100 109 G4double kineticEnergy) 101 110 { 102 G4double charge = EffectiveCharge(p,material,kineticEnergy)/eplus; 103 charge *= chargeCorrection; 111 G4double charge = effCharge; 112 if( kineticEnergy != lastKinEnergy || material != lastMat || p != lastPart) { 113 charge = EffectiveCharge(p,material,kineticEnergy); 114 } 115 charge *= chargeCorrection/CLHEP::eplus; 104 116 105 117 return charge*charge; -
trunk/source/processes/electromagnetic/utils/src/G4DummyModel.cc
r819 r961 25 25 // 26 26 // $Id: G4DummyModel.cc,v 1.3 2007/05/22 17:31:58 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/src/G4EmCalculator.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmCalculator.cc,v 1. 37 2007/08/16 15:55:42vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4EmCalculator.cc,v 1.46 2009/02/24 09:56:03 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 55 55 // 10 keV to 1 keV (V. Ivanchenko) 56 56 // 15.03.2007 Add ComputeEnergyCutFromRangeCut methods (V.Ivanchenko) 57 // 21.04.2008 Updated computations for ions (V.Ivanchenko) 57 58 // 58 59 // Class Description: … … 126 127 if(couple && UpdateParticle(p, kinEnergy) ) { 127 128 res = manager->GetDEDX(p, kinEnergy, couple); 129 if(isIon) { 130 G4double eth = 2.0*MeV/massRatio; 131 if(kinEnergy > eth) { 132 G4double x1 = corr->ComputeIonCorrections(p,mat,kinEnergy); 133 G4double x2 = corr->ComputeIonCorrections(p,mat,eth); 134 res += x1 - x2*eth/kinEnergy; 135 /* 136 G4cout << "### GetDEDX: E= " << kinEnergy << " res= " << res 137 << " x1= " << x1 << " x2= " << x2 138 << " del= " << x1 - x2*eth/kinEnergy << G4endl;; 139 */ 140 } 141 } 142 128 143 if(verbose>0) { 129 144 G4cout << "G4EmCalculator::GetDEDX: E(MeV)= " << kinEnergy/MeV … … 406 421 res = currentModel->ComputeDEDXPerVolume( 407 422 mat, baseParticle, escaled, cut) * chargeSquare; 408 if(verbose > 1) 423 if(verbose > 1) { 409 424 G4cout << baseParticle->GetParticleName() 410 425 << " Escaled(MeV)= " << escaled; 426 } 411 427 } else { 412 428 res = currentModel->ComputeDEDXPerVolume(mat, p, kinEnergy, cut); 413 429 if(verbose > 1) G4cout << " no basePart E(MeV)= " << kinEnergy; 414 430 } 415 if(verbose > 1) 431 if(verbose > 1) { 416 432 G4cout << " DEDX(MeV/mm)= " << res*mm/MeV 417 433 << " DEDX(MeV*cm^2/g)= " 418 434 << res*gram/(MeV*cm2*mat->GetDensity()) 419 435 << G4endl; 420 421 if(isIon) { 422 if(currentModel->HighEnergyLimit() > 100.*MeV) 423 res += corr->HighOrderCorrections(p,mat,kinEnergy); 424 else 425 res *= corr->EffectiveChargeCorrection(p,mat,kinEnergy); 426 if(verbose > 1) 427 G4cout << "After Corrections: DEDX(MeV/mm)= " << res*mm/MeV 428 << " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity()) 429 << G4endl; 430 } 431 432 436 } 437 433 438 // emulate boundary region for different parameterisations 434 439 G4double eth = currentModel->LowEnergyLimit(); … … 447 452 res0 = loweModel->ComputeDEDXPerVolume(mat, p, eth, cut); 448 453 } 449 if(verbose > 1) 454 if(verbose > 1) { 450 455 G4cout << "At boundary energy(MeV)= " << eth/MeV 451 456 << " DEDX(MeV/mm)= " << res1*mm/MeV 452 457 << G4endl; 453 if(isIon) res1 += corr->HighOrderCorrections(p,mat,eth/massRatio); 454 //G4cout << "eth= " << eth << " escaled= " << escaled 455 // << " res0= " << res0 << " res1= " 456 // << res1 << " q2= " << chargeSquare << G4endl; 458 } 459 /* 460 G4cout << "eth= " << eth << " escaled= " << escaled 461 << " res0= " << res0 << " res1= " 462 << res1 << " q2= " << chargeSquare << G4endl; 463 */ 457 464 res *= (1.0 + (res0/res1 - 1.0)*eth/escaled); 465 466 if(isIon) { 467 G4double ethscaled = eth/massRatio; 468 if(kinEnergy > ethscaled) { 469 G4double x1 = corr->ComputeIonCorrections(p,mat,kinEnergy); 470 G4double x2 = corr->ComputeIonCorrections(p,mat,ethscaled); 471 res += x1 - x2*ethscaled/kinEnergy; 472 } 473 474 if(verbose > 1) { 475 G4cout << "After Corrections: DEDX(MeV/mm)= " << res*mm/MeV 476 << " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity()) 477 << G4endl; 478 } 479 } 458 480 } 459 481 … … 507 529 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 508 530 509 G4double G4EmCalculator::ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition* part, 510 const G4Material* mat, G4double cut) 531 G4double G4EmCalculator::ComputeTotalDEDX(G4double kinEnergy, 532 const G4ParticleDefinition* part, 533 const G4Material* mat, 534 G4double cut) 511 535 { 512 536 G4double dedx = ComputeElectronicDEDX(kinEnergy,part,mat,cut); … … 517 541 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 518 542 519 G4double G4EmCalculator::ComputeTotalDEDX(G4double kinEnergy, const G4String& part, 520 const G4String& mat, G4double cut) 543 G4double G4EmCalculator::ComputeTotalDEDX(G4double kinEnergy, 544 const G4String& part, 545 const G4String& mat, 546 G4double cut) 521 547 { 522 548 return ComputeTotalDEDX(kinEnergy,FindParticle(part),FindMaterial(mat),cut); … … 729 755 if(currentProcess) currentProcessName = currentProcess->GetProcessName(); 730 756 731 if(p->GetParticleType() == "nucleus" && 732 currentParticleName != "deuteron" && currentParticleName != "triton") { 757 if(p->GetParticleType() == "nucleus" 758 && currentParticleName != "deuteron" 759 && currentParticleName != "triton" 760 && currentParticleName != "alpha+" 761 && currentParticleName != "helium" 762 && currentParticleName != "hydrogen" 763 ) { 733 764 baseParticle = theGenericIon; 734 765 massRatio = baseParticle->GetPDGMass()/p->GetPDGMass(); … … 755 786 if(isIon) { 756 787 chargeSquare = 757 ionEffCharge->EffectiveChargeSquareRatio(p, currentMaterial, kinEnergy); 758 if(currentProcess) 788 ionEffCharge->EffectiveChargeSquareRatio(p, currentMaterial, kinEnergy) 789 * corr->EffectiveChargeCorrection(p,currentMaterial,kinEnergy); 790 if(currentProcess) { 759 791 currentProcess->SetDynamicMassCharge(massRatio,chargeSquare); 760 // G4cout << "massR= " << massRatio << " q2= " << chargeSquare << G4endl; 792 //G4cout << "NewP: massR= " << massRatio << " q2= " << chargeSquare << G4endl; 793 } 761 794 } 762 795 return true; -
trunk/source/processes/electromagnetic/utils/src/G4EmCorrections.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmCorrections.cc,v 1. 23.2.1 2008/04/22 15:28:13 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4EmCorrections.cc,v 1.51 2008/12/18 13:01:44 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 44 44 // 08.05.2007 V.Ivanchenko Use G4IonTable for ion mass instead of NistTable to avoid 45 45 // division by zero 46 // 29.02.2008 V.Ivanchenko use expantions for log and power function 47 // 21.04.2008 Updated computations for ions (V.Ivanchenko) 48 // 20.05.2008 Removed Finite Size correction (V.Ivanchenko) 46 49 // 47 50 // … … 56 59 #include "G4EmCorrections.hh" 57 60 #include "Randomize.hh" 58 #include "G4NistManager.hh"59 61 #include "G4ParticleTable.hh" 60 62 #include "G4IonTable.hh" 61 63 #include "G4VEmModel.hh" 62 64 #include "G4Proton.hh" 65 #include "G4GenericIon.hh" 63 66 #include "G4LPhysicsFreeVector.hh" 67 #include "G4PhysicsLogVector.hh" 68 #include "G4ProductionCutsTable.hh" 69 #include "G4MaterialCutsCouple.hh" 64 70 65 71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 67 73 G4EmCorrections::G4EmCorrections() 68 74 { 69 Initialise();70 75 particle = 0; 71 76 curParticle= 0; … … 74 79 curVector = 0; 75 80 kinEnergy = 0.0; 76 ionModel = 0; 81 ionLEModel = 0; 82 ionHEModel = 0; 77 83 nIons = 0; 78 84 verbose = 1; 85 ncouples = 0; 79 86 massFactor = 1.0; 87 eth = 2.0*MeV; 88 nbinCorr = 20; 89 eCorrMin = 25.*keV; 90 eCorrMax = 250.*MeV; 80 91 nist = G4NistManager::Instance(); 81 92 ionTable = G4ParticleTable::GetParticleTable()->GetIonTable(); 93 Initialise(); 82 94 } 83 95 … … 93 105 G4double G4EmCorrections::HighOrderCorrections(const G4ParticleDefinition* p, 94 106 const G4Material* mat, 95 G4double e )107 G4double e, G4double) 96 108 { 97 109 // . Z^3 Barkas effect in the stopping power of matter for charged particles … … 108 120 G4double Bloch = BlochCorrection (p, mat, e); 109 121 G4double Mott = MottCorrection (p, mat, e); 110 G4double FSize = FiniteSizeCorrection (p, mat, e); 111 112 G4double sum = (2.0*(Barkas + Bloch) + FSize + Mott); 122 123 G4double sum = (2.0*(Barkas + Bloch) + Mott); 113 124 114 125 if(verbose > 1) 115 126 G4cout << "EmCorrections: E(MeV)= " << e/MeV << " Barkas= " << Barkas 116 << " Bloch= " << Bloch << " Mott= " << Mott << " Fsize= " << FSize127 << " Bloch= " << Bloch << " Mott= " << Mott 117 128 << " Sum= " << sum << G4endl; 118 129 119 130 sum *= material->GetElectronDensity() * q2 * twopi_mc2_rcl2 /beta2; 131 return sum; 132 } 133 134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 135 136 G4double G4EmCorrections::IonBarkasCorrection(const G4ParticleDefinition* p, 137 const G4Material* mat, 138 G4double e) 139 { 140 // . Z^3 Barkas effect in the stopping power of matter for charged particles 141 // J.C Ashley and R.H.Ritchie 142 // Physical review B Vol.5 No.7 1 April 1972 pagg. 2393-2397 143 // and ICRU49 report 144 // valid for kineticEnergy < 0.5 MeV 145 146 SetupKinematics(p, mat, e); 147 G4double res = 0.0; 148 if(tau > 0.0) 149 res = 2.0*BarkasCorrection(p, mat, e)* 150 material->GetElectronDensity() * q2 * twopi_mc2_rcl2 /beta2; 151 return res; 152 } 153 154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 155 156 G4double G4EmCorrections::ComputeIonCorrections(const G4ParticleDefinition* p, 157 const G4Material* mat, 158 G4double e) 159 { 160 // . Z^3 Barkas effect in the stopping power of matter for charged particles 161 // J.C Ashley and R.H.Ritchie 162 // Physical review B Vol.5 No.7 1 April 1972 pagg. 2393-2397 163 // and ICRU49 report 164 // valid for kineticEnergy < 0.5 MeV 165 // Other corrections from S.P.Ahlen Rev. Mod. Phys., Vol 52, No1, 1980 166 SetupKinematics(p, mat, e); 167 if(tau <= 0.0) return 0.0; 168 169 G4double Barkas = BarkasCorrection (p, mat, e); 170 G4double Bloch = BlochCorrection (p, mat, e); 171 G4double Mott = MottCorrection (p, mat, e); 172 173 G4double sum = 2.0*(Barkas*(charge - 1.0)/charge + Bloch) + Mott; 174 175 if(verbose > 1) { 176 G4cout << "EmCorrections: E(MeV)= " << e/MeV << " Barkas= " << Barkas 177 << " Bloch= " << Bloch << " Mott= " << Mott 178 << " Sum= " << sum << G4endl; 179 } 180 sum *= material->GetElectronDensity() * q2 * twopi_mc2_rcl2 /beta2; 181 182 if(verbose > 1) G4cout << " Sum= " << sum << G4endl; 183 return sum; 184 } 185 186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 187 188 G4double G4EmCorrections::IonHighOrderCorrections(const G4ParticleDefinition* p, 189 const G4MaterialCutsCouple* couple, 190 G4double e) 191 { 192 // . Z^3 Barkas effect in the stopping power of matter for charged particles 193 // J.C Ashley and R.H.Ritchie 194 // Physical review B Vol.5 No.7 1 April 1972 pagg. 2393-2397 195 // and ICRU49 report 196 // valid for kineticEnergy < 0.5 MeV 197 // Other corrections from S.P.Ahlen Rev. Mod. Phys., Vol 52, No1, 1980 198 199 G4double sum = 0.0; 200 201 if(ionHEModel) { 202 G4int Z = G4int(p->GetPDGCharge()/eplus + 0.5); 203 if(Z >= 100) Z = 99; 204 else if(Z < 1) Z = 1; 205 206 // fill vector 207 if(thcorr[Z].size() == 0) { 208 thcorr[Z].resize(ncouples); 209 G4double ethscaled = eth*p->GetPDGMass()/proton_mass_c2; 210 211 for(size_t i=0; i<ncouples; i++) { 212 (thcorr[Z])[i] = ethscaled*ComputeIonCorrections(p, currmat[i], ethscaled); 213 //G4cout << i << ". ethscaled= " << ethscaled 214 //<< " corr= " << (thcorr[Z])[i]/ethscaled << G4endl; 215 } 216 } 217 G4double rest = (thcorr[Z])[couple->GetIndex()]; 218 219 sum = ComputeIonCorrections(p,couple->GetMaterial(),e) - rest/e; 220 221 if(verbose > 1) G4cout << " Sum= " << sum << " dSum= " << rest/e << G4endl; 222 } 120 223 return sum; 121 224 } … … 226 329 G4int ieta = Index(y, Eta, nEtaK); 227 330 corr = Value2(x, y, TheK[itet], TheK[itet+1], Eta[ieta], Eta[ieta+1], 228 CK[itet][ieta], CK[itet+1][ieta], CK[itet][ieta+1], CK[itet+1][ieta+1]); 331 CK[itet][ieta], CK[itet+1][ieta], 332 CK[itet][ieta+1], CK[itet+1][ieta+1]); 229 333 //G4cout << " x= " <<x<<" y= "<<y<<" tet= " <<TheK[itet] 230 334 //<<" "<< TheK[itet+1]<<" eta= "<< Eta[ieta]<<" "<< Eta[ieta+1] … … 439 543 else { 440 544 G4int iw = Index(W, engBarkas, 47); 441 val = Value(W, engBarkas[iw], engBarkas[iw+1], corBarkas[iw], corBarkas[iw+1]); 545 val = Value(W, engBarkas[iw], engBarkas[iw+1], 546 corBarkas[iw], corBarkas[iw+1]); 442 547 } 443 548 // G4cout << "i= " << i << " b= " << b << " W= " << W … … 479 584 { 480 585 SetupKinematics(p, mat, e); 481 G4double mterm = pi*fine_structure_const*beta*charge; 482 /* 483 G4double mterm = 0.0; 484 if(beta > 0.0) { 485 486 // Estimation of mean square root of the ionisation potential 487 G4double Zeff = 0.0; 488 G4double norm = 0.0; 489 490 for (G4int i = 0; i<numberOfElements; i++) { 491 G4double Z = (*theElementVector)[i]->GetZ(); 492 Zeff += Z*atomDensity[i]; 493 norm += atomDensity[i]; 494 } 495 Zeff *= (2.0/norm); 496 G4double ze1 = std::log(Zeff); 497 G4double eexc= material->GetIonisation()->GetMeanExcitationEnergy()*ze1*ze1/Zeff; 498 499 G4double invbeta = 1.0/beta; 500 G4double invbeta2= invbeta*invbeta; 501 G4double za = charge*fine_structure_const; 502 G4double za2 = za*za; 503 G4double za3 = za2*za; 504 G4double x = za*invbeta; 505 G4double cosx; 506 if(x < COSEB[13]) { 507 G4int i = Index(x,COSEB,14); 508 cosx = Value(x,COSEB[i], COSEB[i+1],COSXI[i],COSXI[i+1]); 509 } else { 510 cosx = COSXI[13]*COSEB[13]/x; 511 } 512 513 mterm = 514 za*beta*(1.725 + pi*cosx*(0.52 - 2.0*std::sqrt(eexc/(2.0*electron_mass_c2*bg2)))); 515 + za2*(3.246 - 0.451*beta2) 516 + za3*(1.522*beta + 0.987*invbeta) 517 + za2*za2*(4.569 - 0.494*beta2 - 2.696*invbeta2) 518 + za3*za2*(1.254*beta + 0.222*invbeta - 1.17*invbeta*invbeta2); 519 } 520 */ 586 G4double mterm = CLHEP::pi*fine_structure_const*beta*charge; 521 587 return mterm; 522 }523 524 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....525 526 G4double G4EmCorrections::FiniteSizeCorrection(const G4ParticleDefinition* p,527 const G4Material* mat,528 G4double e)529 // Finite size corrections are parameterized according to530 // J.D.Jackson Phys. Rev. D59 (1998) 017301531 {532 if(p) return 0.0;533 SetupKinematics(p, mat, e);534 G4double term = 0.0;535 G4double numlim = 0.2;536 537 //Leptons538 if(p->GetLeptonNumber() != 0) {539 G4double x = tmax/(e + mass);540 term = x*x;541 542 // Pions and Kaons543 } else if(p->GetPDGSpin() == 0.0 && q2 < 1.5) {544 G4double xpi = 0.736*GeV;545 G4double x = 2.0*electron_mass_c2*tmax0/(xpi*xpi);546 if(x <= numlim) term = -x*(1.0 - 0.5*x);547 else term = -std::log(1.0 + x);548 549 // Protons and baryons550 } else if(q2 < 1.5) {551 G4double xp = 0.8426*GeV;552 G4double x = 2.0*electron_mass_c2*tmax0/(xp*xp);553 G4double ksi2 = 2.79285*2.79285;554 if(x <= numlim) term = -x*((1.0 + 5.0*x/6.0)/((1.0 + x)*(1 + x)) + 0.5*x);555 else term = -x*(1.0 + 5.0*x/6.0)/((1.0 + x)*(1 + x)) - std::log(1.0 + x);556 G4double b = xp*0.5/mass;557 G4double c = xp*mass/(electron_mass_c2*(mass + e));558 G4double lb = b*b;559 G4double lb2= lb*lb;560 G4double nu = 0.5*c*c;561 G4double x1 = 1.0 + x;562 G4double x2 = x1*x1;563 G4double l1 = 1.0 - lb;564 G4double l2 = l1*l1;565 G4double lx = 1.0 + lb*x;566 G4double ia = lb2*(lx*std::log(lx/x1)/x + l1 -567 0.5*x*l2/(lb*x1) +568 x*(3.0 + 2.0*x)*l2*l1/(6.0*x2*lb2))/(l2*l2);569 G4double ib = x*x*(3.0 + x)/(6.0*x2*x1);570 term += lb*((ksi2 - 1.0)*ia + nu*ksi2*ib);571 // G4cout << "Proton F= " << term << " ia= " << ia << " ib= " << ib << " lb= " << lb<< G4endl;572 573 //ions574 } else {575 G4double xp = 0.8426*GeV/std::pow(mass/proton_mass_c2,-0.33333333);576 G4double x = 2.0*electron_mass_c2*tmax0/(xp*xp);577 if(x <= numlim) term = -x*(1.0 - 0.5*x);578 else term = -std::log(1.0 + x);579 //G4cout << "Ion F= " << term << G4endl;580 }581 582 return term;583 588 } 584 589 … … 629 634 if (er >= ed[0]) nloss = a[0]; 630 635 else { 636 // the table is inverse in energy 631 637 for (G4int i=102; i>=0; i--) 632 638 { … … 657 663 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 658 664 659 G4ionEffectiveCharge* G4EmCorrections::GetIonEffectiveCharge(G4VEmModel* m)660 {661 if(m) ionModel = m;662 return &effCharge;663 }664 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....665 666 G4int G4EmCorrections::GetNumberOfStoppingVectors()667 {668 return nIons;669 }670 671 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....672 673 665 G4double G4EmCorrections::EffectiveChargeCorrection(const G4ParticleDefinition* p, 674 666 const G4Material* mat, … … 676 668 { 677 669 G4double factor = 1.0; 678 if(p->GetPDGCharge() <= 2.5*eplus) return factor; 679 if(verbose > 1) 680 G4cout << "EffectiveChargeCorrection: " << p->GetParticleName() << " in " << mat->GetName() 670 if(p->GetPDGCharge() <= 2.5*eplus || nIons <= 0) return factor; 671 /* 672 if(verbose > 1) { 673 G4cout << "EffectiveChargeCorrection: " << p->GetParticleName() 674 << " in " << mat->GetName() 681 675 << " ekin(MeV)= " << ekin/MeV << G4endl; 676 } 677 */ 682 678 if(p != curParticle || mat != curMaterial) { 683 679 curParticle = p; 684 curMaterial = 0;680 curMaterial = mat; 685 681 curVector = 0; 686 G4int Z = p->GetAtomicNumber(); 687 G4int A = p->GetAtomicMass(); 688 if(verbose > 1) G4cout << "Zion= " << Z << " Aion= " << A << G4endl; 689 massFactor = proton_mass_c2/ionTable->GetIonMass(Z,A); 690 idx = 0; 691 for(; idx<nIons; idx++) { 692 if(Z == Zion[idx] && A == Aion[idx]) { 693 if(materialList[idx] == mat) { 694 curMaterial = mat; 695 curVector = stopData[idx]; 696 break; 697 } else if(materialList[idx] == 0) { 698 if(materialName[idx] == mat->GetName()) 699 curVector = InitialiseMaterial(mat); 700 } 682 currentZ = p->GetAtomicNumber(); 683 if(verbose > 1) { 684 G4cout << "G4EmCorrections::EffectiveChargeCorrection: Zion= " 685 << currentZ << " Aion= " << p->GetPDGMass()/amu_c2 << G4endl; 686 } 687 massFactor = proton_mass_c2/p->GetPDGMass(); 688 idx = -1; 689 G4int dz = 1000; 690 691 for(G4int i=0; i<nIons; i++) { 692 if(materialList[i] == mat) { 693 G4int delz = currentZ - Zion[i]; 694 if(delz < 0) delz = -delz; 695 if(delz < dz) { 696 idx = i; 697 dz = delz; 698 if(0 == delz) break; 699 } 701 700 } 701 } 702 // G4cout << " idx= " << idx << " dz= " << dz << G4endl; 703 if(idx > 0) { 704 if(!ionList[idx]) BuildCorrectionVector(); 705 if(ionList[idx]) curVector = stopData[idx]; 702 706 } 703 707 } … … 705 709 G4bool b; 706 710 factor = curVector->GetValue(ekin*massFactor,b); 707 } 708 if(verbose > 1) G4cout << " factor= " << factor << G4endl; 711 if(verbose > 1) { 712 G4cout << "E= " << ekin << " factor= " << factor << " massfactor= " 713 << massFactor << G4endl; 714 } 715 } 709 716 return factor; 710 717 } … … 714 721 void G4EmCorrections::AddStoppingData(G4int Z, G4int A, 715 722 const G4String& mname, 716 G4PhysicsVector& dVector) 717 { 718 idx = 0; 719 for(; idx<nIons; idx++) { 720 if(Z == Zion[idx] && A == Aion[idx] && mname == materialName[idx]) 721 break; 722 } 723 if(idx == nIons) { 723 G4PhysicsVector* dVector) 724 { 725 G4int i = 0; 726 for(; i<nIons; i++) { 727 if(Z == Zion[i] && A == Aion[i] && mname == materialName[i]) break; 728 } 729 if(i == nIons) { 724 730 Zion.push_back(Z); 725 731 Aion.push_back(A); 726 732 materialName.push_back(mname); 727 733 materialList.push_back(0); 728 stopData.push_back(0); 734 ionList.push_back(0); 735 stopData.push_back(dVector); 729 736 nIons++; 730 } else { 731 if(stopData[idx]) delete stopData[idx]; 732 } 733 size_t nbins = dVector.GetVectorLength(); 734 size_t n = 0; 735 for(; n<nbins; n++) { 736 if(dVector.GetLowEdgeEnergy(n) > 2.0*MeV) break; 737 } 738 if(n < nbins) nbins = n + 1; 739 G4LPhysicsFreeVector* v = 740 new G4LPhysicsFreeVector(nbins, 741 dVector.GetLowEdgeEnergy(0), 742 dVector.GetLowEdgeEnergy(nbins-1)); 737 if(verbose>1) { 738 G4cout << "AddStoppingData Z= " << Z << " A= " << A << " " << mname 739 << " idx= " << i << G4endl; 740 } 741 } 742 } 743 744 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 745 746 void G4EmCorrections::BuildCorrectionVector() 747 { 748 if(!ionLEModel || !ionHEModel) { 749 return; 750 } 751 752 const G4ParticleDefinition* ion = curParticle; 753 G4int Z = Zion[idx]; 754 if(currentZ != Z) { 755 ion = G4ParticleTable::GetParticleTable()->FindIon(Z, Aion[idx], 0, Z); 756 } 757 //G4cout << "BuildCorrectionVector: idx= " << idx << " Z= " << Z 758 // << " curZ= " << currentZ << G4endl; 759 760 // G4double A = nist->GetAtomicMassAmu(Z); 761 G4double A = G4double(ion->GetBaryonNumber()); 762 G4PhysicsVector* v = stopData[idx]; 763 764 const G4ParticleDefinition* p = G4GenericIon::GenericIon(); 765 G4double massRatio = proton_mass_c2/ion->GetPDGMass(); 766 767 if(verbose>1) { 768 G4cout << "BuildCorrectionVector: Stopping for " 769 << curParticle->GetParticleName() << " in " 770 << materialName[idx] << " Ion Z= " << Z << " A= " << A 771 << " massRatio= " << massRatio << G4endl; 772 } 743 773 G4bool b; 744 for(size_t i=0; i<nbins; i++) { 745 G4double e = dVector.GetLowEdgeEnergy(i); 746 G4double dedx = dVector.GetValue(e, b); 747 v->PutValues(i, e, dedx); 748 } 749 // G4cout << *v << G4endl; 750 stopData[idx] = v; 751 } 752 753 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 754 755 G4PhysicsVector* G4EmCorrections::InitialiseMaterial(const G4Material* mat) 756 { 757 G4PhysicsVector* v = 0; 758 const G4Material* m = nist->FindOrBuildMaterial(materialName[idx],false); 759 if(m) { 760 materialList[idx] = m; 761 curMaterial = mat; 762 v = stopData[idx]; 763 size_t nbins = v->GetVectorLength(); 764 const G4ParticleDefinition* p = G4Proton::Proton(); 765 if(verbose>1) G4cout << "G4ionIonisation::InitialiseMaterial Stooping data for " 766 << materialName[idx] << G4endl; 767 G4bool b; 768 for(size_t i=0; i<nbins; i++) { 769 G4double e = v->GetLowEdgeEnergy(i); 770 G4double dedx = v->GetValue(e, b); 771 G4double dedx1= ionModel->ComputeDEDXPerVolume(mat, p, e, e)* 772 effCharge.EffectiveChargeSquareRatio(curParticle,mat,e/massFactor); 773 v->PutValue(i, dedx/dedx1); 774 if(verbose>1) G4cout << " E(meV)= " << e/MeV << " Correction= " << dedx/dedx1 775 << " " << dedx << " " << dedx1 << G4endl; 776 } 777 } 778 return v; 774 775 G4PhysicsLogVector* vv = 776 new G4PhysicsLogVector(eCorrMin,eCorrMax,nbinCorr); 777 vv->SetSpline(true); 778 G4double e, eion, dedx, dedx1; 779 G4double eth0 = v->GetLowEdgeEnergy(0); 780 G4double escal = eth/massRatio; 781 G4double qe = 782 effCharge.EffectiveChargeSquareRatio(ion, curMaterial, escal); 783 G4double dedxt = 784 ionLEModel->ComputeDEDXPerVolume(curMaterial, p, eth, eth)*qe; 785 G4double dedx1t = 786 ionHEModel->ComputeDEDXPerVolume(curMaterial, p, eth, eth)*qe 787 + ComputeIonCorrections(curParticle, curMaterial, escal); 788 G4double rest = escal*(dedxt - dedx1t); 789 //G4cout << "Escal(MeV)= "<<escal<<" dedxt0= " <<dedxt 790 // << " dedxt1= " << dedx1t << G4endl; 791 792 for(G4int i=0; i<nbinCorr; i++) { 793 e = vv->GetLowEdgeEnergy(i); 794 escal = e/massRatio; 795 eion = escal/A; 796 if(eion <= eth0) { 797 dedx = v->GetValue(eth0, b)*std::sqrt(eion/eth0); 798 } else { 799 dedx = v->GetValue(eion, b); 800 } 801 qe = effCharge.EffectiveChargeSquareRatio(curParticle,curMaterial,escal); 802 if(e <= eth) { 803 dedx1 = ionLEModel->ComputeDEDXPerVolume(curMaterial, p, e, e)*qe; 804 } else { 805 dedx1 = ionHEModel->ComputeDEDXPerVolume(curMaterial, p, e, e)*qe + 806 ComputeIonCorrections(curParticle, curMaterial, escal) + rest/escal; 807 } 808 vv->PutValue(i, dedx/dedx1); 809 if(verbose>1) { 810 G4cout << " E(meV)= " << e/MeV << " Correction= " << dedx/dedx1 811 << " " << dedx << " " << dedx1 812 << " massF= " << massFactor << G4endl; 813 } 814 } 815 delete v; 816 ionList[idx] = ion; 817 stopData[idx] = vv; 818 if(verbose>1) G4cout << "End data set " << G4endl; 819 } 820 821 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 822 823 void G4EmCorrections::InitialiseForNewRun() 824 { 825 G4ProductionCutsTable* tb = G4ProductionCutsTable::GetProductionCutsTable(); 826 ncouples = tb->GetTableSize(); 827 if(currmat.size() != ncouples) { 828 currmat.resize(ncouples); 829 size_t i; 830 for(i=0; i<100; i++) {thcorr[i].clear();} 831 for(i=0; i<ncouples; i++) { 832 currmat[i] = tb->GetMaterialCutsCouple(i)->GetMaterial(); 833 G4String nam = currmat[i]->GetName(); 834 for(G4int j=0; j<nIons; j++) { 835 if(nam == materialName[j]) { materialList[j] = currmat[i]; } 836 } 837 } 838 } 779 839 } 780 840 -
trunk/source/processes/electromagnetic/utils/src/G4EmModelManager.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmModelManager.cc,v 1.4 0 2007/11/09 11:35:54vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4EmModelManager.cc,v 1.46 2008/10/13 14:56:56 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 78 78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 79 79 80 G4RegionModels::G4RegionModels(G4int nMod, std::vector<G4int>& list, G4DataVector& lowE) 80 G4RegionModels::G4RegionModels(G4int nMod, std::vector<G4int>& indx, 81 G4DataVector& lowE, const G4Region* reg) 81 82 { 82 83 nModelsForRegion = nMod; 83 84 theListOfModelIndexes = new G4int [nModelsForRegion]; 84 lowKineticEnergy = new G4double [nModelsForRegion ];85 lowKineticEnergy = new G4double [nModelsForRegion+1]; 85 86 for (G4int i=0; i<nModelsForRegion; i++) { 86 theListOfModelIndexes[i] = list[i];87 theListOfModelIndexes[i] = indx[i]; 87 88 lowKineticEnergy[i] = lowE[i]; 88 89 } 90 lowKineticEnergy[nModelsForRegion] = lowE[nModelsForRegion]; 91 theRegion = reg; 89 92 } 90 93 … … 99 102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 100 103 101 #include "G4LossTableManager.hh"102 104 #include "G4Step.hh" 103 105 #include "G4ParticleDefinition.hh" … … 107 109 #include "G4MaterialCutsCouple.hh" 108 110 #include "G4ProductionCutsTable.hh" 109 #include "G4Region.hh"110 111 #include "G4RegionStore.hh" 111 112 #include "G4Gamma.hh" 112 113 #include "G4Positron.hh" 114 #include "G4UnitsTable.hh" 113 115 114 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 128 130 regions.clear(); 129 131 orderOfModels.clear(); 130 upperEkin.clear();131 132 maxCutInRange = 12.*cm; 132 133 maxSubCutInRange = 0.7*mm; … … 139 140 G4EmModelManager::~G4EmModelManager() 140 141 { 141 G4int i,j;142 142 Clear(); 143 } 144 145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 146 147 void G4EmModelManager::Clear() 148 { 143 149 if(1 < verboseLevel) { 144 G4cout << "G4EmModelManager:: delete models "; 145 if(particle) G4cout << " for " << particle->GetParticleName(); 146 G4cout << " nModels=" << nEmModels <<G4endl; 147 } 148 149 for(i = 0; i<nEmModels; i++) { 150 orderOfModels[i] = 1; 151 } 152 for(i = 0; i<nEmModels; i++) { 153 if (orderOfModels[i]) { 154 orderOfModels[i] = 0; 155 for(j = i+1; j<nEmModels; j++) { 156 if(models[i] == models[j]) orderOfModels[j] = 0; 157 } 158 G4String nam = models[i]->GetName(); 159 if(nam != "PAI" && nam != "PAIModel" ) delete models[i]; 160 } 161 } 162 for(i = 0; i<nEmModels; i++) { 163 orderOfModels[i] = 1; 164 } 165 for(i = 0; i<nEmModels; i++) { 166 if (orderOfModels[i]) { 167 orderOfModels[i] = 0; 168 for(j = i+1; j<nEmModels; j++) { 169 if(flucModels[i] == flucModels[j]) orderOfModels[j] = 0; 170 } 171 delete flucModels[i]; 172 } 173 } 174 if(1 < verboseLevel) 175 G4cout << "G4EmModelManager:: models are deleted!" << G4endl; 176 } 177 178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 179 180 void G4EmModelManager::Clear() 181 { 182 if(1 < verboseLevel) { 183 G4cout << "G4EmModelManager::Clear()"; 184 if(particle) G4cout << " for " << particle->GetParticleName(); 185 G4cout << G4endl; 150 G4cout << "G4EmModelManager::Clear()" << G4endl; 186 151 } 187 152 188 153 theCuts.clear(); 189 154 theSubCuts.clear(); 190 upperEkin.clear();191 155 if(idxOfRegionModels) delete [] idxOfRegionModels; 192 156 if(setOfRegionModels && nRegions) { … … 215 179 orderOfModels.push_back(num); 216 180 p->DefineForRegion(r); 217 if (nEmModels>0) {218 G4int idx = nEmModels;219 do {idx--;} while (idx && num < orderOfModels[idx]);220 if (num >= orderOfModels[idx] && num <= orderOfModels[idx+1]) idx++;221 if (idx < nEmModels) {222 models[nEmModels] = models[idx];223 flucModels[nEmModels] = flucModels[idx];224 regions[nEmModels] = regions[idx];225 orderOfModels[nEmModels] = orderOfModels[idx];226 models[idx] = p;227 flucModels[idx] = fm;228 regions[idx] = r;229 orderOfModels[idx] = num;230 }231 }232 181 nEmModels++; 233 182 } … … 254 203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 255 204 256 G4VEmModel* G4EmModelManager::GetModel(G4int i )205 G4VEmModel* G4EmModelManager::GetModel(G4int i, G4bool ver) 257 206 { 258 207 G4VEmModel* m = 0; 259 if(i >= 0 && i < nEmModels) m = models[i];260 else if(verboseLevel > 0 )208 if(i >= 0 && i < nEmModels) {m = models[i];} 209 else if(verboseLevel > 0 && ver) { 261 210 G4cout << "G4EmModelManager::GetModel WARNING: " 262 211 << "index " << i << " is wrong Nmodels= " 263 << nEmModels << G4endl; 212 << nEmModels; 213 if(particle) G4cout << " for " << particle->GetParticleName(); 214 G4cout<< G4endl; 215 } 264 216 return m; 265 217 } … … 269 221 const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p, 270 222 const G4ParticleDefinition* sp, 271 G4double theMinSubRange,272 G4int val)223 G4double theMinSubRange, 224 G4int val) 273 225 { 274 226 verboseLevel = val; … … 293 245 // Identify the list of regions with different set of models 294 246 nRegions = 1; 295 std::vector<const G4Region*> set ;296 set .push_back(world);247 std::vector<const G4Region*> setr; 248 setr.push_back(world); 297 249 G4bool isWorld = false; 298 250 … … 306 258 if (nRegions>1) { 307 259 for (G4int j=1; j<nRegions; j++) { 308 if ( r == set [j] ) newRegion = false;260 if ( r == setr[j] ) newRegion = false; 309 261 } 310 262 } 311 263 if (newRegion) { 312 set .push_back(r);264 setr.push_back(r); 313 265 nRegions++; 314 266 } … … 322 274 idxOfRegionModels[numOfCouples] = 0; 323 275 setOfRegionModels = new G4RegionModels*[nRegions]; 324 upperEkin.resize(nEmModels); 276 277 std::vector<G4int> modelAtRegion(nEmModels); 278 std::vector<G4int> modelOrd(nEmModels); 279 G4DataVector eLow(nEmModels); 280 G4DataVector eHigh(nEmModels); 281 G4int nmax = nEmModels; 325 282 326 283 // Order models for regions 327 284 for (G4int reg=0; reg<nRegions; reg++) { 328 const G4Region* region = set[reg]; 329 285 const G4Region* region = setr[reg]; 330 286 G4int n = 0; 331 332 std::vector<G4int> modelAtRegion;333 G4DataVector eLow;334 G4DataVector eHigh;335 modelAtRegion.clear();336 eLow.clear();337 eHigh.clear();338 287 339 288 if(isWorld || 0 < reg) { … … 346 295 G4double tmin = model->LowEnergyLimit(); 347 296 G4double tmax = model->HighEnergyLimit(); 348 if (n>0) tmin = std::max(tmin, eHigh[n-1]); 297 G4int ord = orderOfModels[ii]; 298 G4bool push = true; 299 G4bool insert = false; 300 G4int idx = n; 349 301 350 302 if(1 < verboseLevel) { … … 355 307 << " tmin(MeV)= " << tmin/MeV 356 308 << "; tmax(MeV)= " << tmax/MeV 357 << "; order= " << ord erOfModels[ii]309 << "; order= " << ord 358 310 << G4endl; 359 311 } 360 361 if (tmin < tmax) { 362 modelAtRegion.push_back(ii); 363 eLow.push_back(tmin); 364 eHigh.push_back(tmax); 365 upperEkin[ii] = tmax; 366 n++; 312 313 if (n == 0) n++; 314 else { 315 tmin = std::min(tmin, eHigh[n-1]); 316 if(tmin >= tmax) push = false; 317 else { 318 319 // high energy model 320 if(tmin == eHigh[n-1] && tmax > eHigh[n-1]) n++; 321 else if (tmax > eHigh[n-1]) { 322 323 // compare order of models 324 for(G4int k = n-1; k>=0; k--) { 325 326 if (ord >= modelOrd[k]) { 327 tmin = std::max(tmin, eHigh[k]); 328 if(k < n-1) n = k + 2; 329 break; 330 } else if (tmin > eLow[k]) { 331 eHigh[k] = tmin; 332 n = k + 2; 333 break; 334 } else if (tmin == eLow[k]) { 335 n = k + 1; 336 break; 337 } 338 } 339 if(tmin < eLow[0]) n = 1; 340 idx = n - 1; 341 342 // low energy model 343 } else { 344 345 tmax = std::max(tmax, eLow[0]); 346 insert = true; 347 push = false; 348 idx = 0; 349 if(tmax <= eLow[0]) tmax = eLow[0]; 350 else { 351 352 for(G4int k=0; k<n; k++) { 353 354 if (ord >= modelOrd[k]) { 355 if(k == 0) { 356 if(tmin < eLow[0]) tmax = eLow[0]; 357 else insert = false; 358 break; 359 } else { 360 insert = false; 361 break; 362 } 363 } else if(tmax < eHigh[k]) { 364 idx = k; 365 if(k > 0) tmin = eLow[k]; 366 eLow[k] = tmax; 367 break; 368 } else if(tmax == eHigh[k]) { 369 insert = false; 370 push = true; 371 idx = k; 372 if(k > 0) tmin = eLow[k]; 373 else tmin = std::min(tmin,eLow[0]); 374 break; 375 } else { 376 modelAtRegion[k] = ii; 377 modelOrd[k] = ord; 378 if(k == 0) eLow[idx] = std::min(tmin,eLow[0]); 379 } 380 } 381 } 382 if(insert && idx < n) n++; 383 else insert = false; 384 } 385 } 386 } 387 if(n > nmax) { 388 nmax = n; 389 modelAtRegion.resize(nmax); 390 modelOrd.resize(nmax); 391 eLow.resize(nmax); 392 eHigh.resize(nmax); 393 } 394 if(insert) { 395 for(G4int k=n-2; k>=idx; k--) { 396 modelAtRegion[k+1] = modelAtRegion[k]; 397 modelOrd[k+1] = modelOrd[k]; 398 eLow[k+1] = eLow[k]; 399 eHigh[k+1] = eHigh[k]; 400 } 401 } 402 if (push || insert) { 403 modelAtRegion[idx] = ii; 404 modelOrd[idx] = ord; 405 eLow[idx] = tmin; 406 eHigh[idx] = tmax; 367 407 } 368 408 } … … 374 414 eLow.push_back(0.0); 375 415 eHigh.push_back(DBL_MAX); 376 upperEkin.push_back(DBL_MAX);377 416 } 378 417 eLow[0] = 0.0; 418 if(n >= nmax) eLow.resize(nmax+1); 419 eLow[n] = eHigh[n-1]; 379 420 380 421 if(1 < verboseLevel) { … … 382 423 if (region) G4cout << region->GetName(); 383 424 G4cout << "> Elow(MeV)= "; 384 for(G4int ii=0; ii< n; ii++) {G4cout << eLow[ii]/MeV << " ";}425 for(G4int ii=0; ii<=n; ii++) {G4cout << eLow[ii]/MeV << " ";} 385 426 G4cout << G4endl; 386 427 } 387 G4RegionModels* rm = new G4RegionModels(n, modelAtRegion, eLow );428 G4RegionModels* rm = new G4RegionModels(n, modelAtRegion, eLow, region); 388 429 setOfRegionModels[reg] = rm; 389 430 } … … 399 440 400 441 G4int reg = nRegions; 401 do {reg--;} while (reg>0 && pcuts != (set [reg]->GetProductionCuts()));442 do {reg--;} while (reg>0 && pcuts != (setr[reg]->GetProductionCuts())); 402 443 idxOfRegionModels[i] = reg; 403 444 … … 474 515 { 475 516 476 // vectors to provide continues dE/dx477 G4DataVector factor;478 G4DataVector dedxLow;479 G4DataVector dedxHigh;480 481 517 G4double e; 482 518 … … 491 527 G4cout << "G4EmModelManager::FillDEDXVector() for " 492 528 << couple->GetMaterial()->GetName() 493 << " Ecut(MeV)= " << cut494 << " Esubcut(MeV)= " << subcut529 << " cut(MeV)= " << cut 530 << " subcut(MeV)= " << subcut 495 531 << " Type " << tType 496 532 << " for " << particle->GetParticleName() … … 501 537 const G4RegionModels* regModels = setOfRegionModels[reg]; 502 538 G4int nmod = regModels->NumberOfModels(); 503 factor.resize(nmod); 504 dedxLow.resize(nmod); 505 dedxHigh.resize(nmod); 539 540 // vectors to provide continues dE/dx 541 G4DataVector factor(nmod); 542 G4DataVector eLow(nmod+1); 543 G4DataVector dedxLow(nmod); 544 G4DataVector dedxHigh(nmod); 506 545 507 546 if(1 < verboseLevel) { … … 512 551 } 513 552 514 515 553 // calculate factors to provide continuity of energy loss 554 555 516 556 factor[0] = 1.0; 517 557 G4int j; … … 519 559 G4int totBinsLoss = aVector->GetVectorLength(); 520 560 521 dedxLow[0] = 0.0; 522 523 e = upperEkin[regModels->ModelIndex(0)]; 561 dedxLow[0] = 0.0; 562 eLow[0] = 0.0; 563 564 e = regModels->LowEdgeEnergy(1); 565 eLow[1] = e; 524 566 G4VEmModel* model = models[regModels->ModelIndex(0)]; 525 567 dedxHigh[0] = 0.0; 526 568 if(model && cut > subcut) { 527 569 dedxHigh[0] = model->ComputeDEDX(couple,particle,e,cut); 528 if(subcut > 0.0) 570 if(subcut > 0.0) { 529 571 dedxHigh[0] -= model->ComputeDEDX(couple,particle,e,subcut); 572 } 530 573 } 531 574 if(nmod > 1) { 532 575 for(j=1; j<nmod; j++) { 533 576 534 e = upperEkin[regModels->ModelIndex(j-1)]; 577 e = regModels->LowEdgeEnergy(j); 578 eLow[j] = e; 535 579 G4int idx = regModels->ModelIndex(j); 536 580 537 581 dedxLow[j] = models[idx]->ComputeDEDX(couple,particle,e,cut); 538 if(subcut > 0.0) 582 if(subcut > 0.0) { 539 583 dedxLow[j] -= models[idx]->ComputeDEDX(couple,particle,e,subcut); 584 } 540 585 if(subcut == cut) dedxLow[j] = 0.0; 541 586 542 e = upperEkin[idx]; 587 e = regModels->LowEdgeEnergy(j+1); 588 eLow[j+1] = e; 543 589 dedxHigh[j] = models[idx]->ComputeDEDX(couple,particle,e,cut); 544 if(subcut > 0.0) 590 if(subcut > 0.0) { 545 591 dedxHigh[j] -= models[idx]->ComputeDEDX(couple,particle,e,subcut); 592 } 546 593 if(subcut == cut) dedxHigh[j] = 0.0; 547 594 } 595 if(1 < verboseLevel) { 596 G4cout << " model #0" 597 << " dedx(" << eLow[0] << ")= " << dedxLow[0] 598 << " dedx(" << eLow[1] << ")= " << dedxHigh[0] 599 << G4endl; 600 } 548 601 549 602 for(j=1; j<nmod; j++) { 550 if(dedxLow[j] > 0.0) factor[j] = (dedxHigh[j-1]/dedxLow[j] - 1.0); 551 else factor[j] = 0.0; 603 if(dedxLow[j] > 0.0) { 604 factor[j] = (dedxHigh[j-1]/dedxLow[j] - 1.0)*eLow[j]; 605 } else factor[j] = 0.0; 606 if(1 < verboseLevel) { 607 G4cout << " model #" << j 608 << " dedx(" << eLow[j] << ")= " << dedxLow[j] 609 << " dedx(" << eLow[j+1] << ")= " << dedxHigh[j] 610 << " factor= " << factor[j]/eLow[j] 611 << G4endl; 612 } 552 613 } 553 614 … … 565 626 // Choose a model of energy losses 566 627 G4int k = 0; 567 if (nmod > 1 && e > upperEkin[regModels->ModelIndex(0)]) {628 if (nmod > 1 && e > eLow[1]) { 568 629 do { 569 630 k++; 570 fac *= (1.0 + factor[k] *upperEkin[regModels->ModelIndex(k-1)]/e);571 } while (k <nmod-1 && e > upperEkin[regModels->ModelIndex(k)]);631 fac *= (1.0 + factor[k]/e); 632 } while (k+1 < nmod && e > eLow[k+1]); 572 633 } 573 634 … … 602 663 G4EmTableType tType) 603 664 { 604 // vectors to provide continues cross section605 G4DataVector factor;606 G4DataVector sigmaLow;607 G4DataVector sigmaHigh;608 609 665 G4double e; 610 666 … … 630 686 const G4RegionModels* regModels = setOfRegionModels[reg]; 631 687 G4int nmod = regModels->NumberOfModels(); 632 factor.resize(nmod); 633 sigmaLow.resize(nmod); 634 sigmaHigh.resize(nmod); 688 689 // vectors to provide continues dE/dx 690 G4DataVector factor(nmod); 691 G4DataVector eLow(nmod+1); 692 G4DataVector sigmaLow(nmod); 693 G4DataVector sigmaHigh(nmod); 635 694 636 695 if(2 < verboseLevel) { … … 644 703 G4int totBinsLambda = aVector->GetVectorLength(); 645 704 646 sigmaLow[0] = 0.0; 647 648 e = upperEkin[regModels->ModelIndex(0)]; 705 sigmaLow[0] = 0.0; 706 eLow[0] = 0.0; 707 708 e = regModels->LowEdgeEnergy(1); 709 eLow[1] = e; 649 710 G4VEmModel* model = models[regModels->ModelIndex(0)]; 650 711 sigmaHigh[0] = 0.0; … … 668 729 for(j=1; j<nmod; j++) { 669 730 670 e = upperEkin[regModels->ModelIndex(j-1)]; 671 sigmaLow[j] = 672 models[regModels->ModelIndex(j)]->CrossSection(couple,particle,e,cut,tmax); 673 e = upperEkin[regModels->ModelIndex(j)]; 674 sigmaHigh[j] = 675 models[regModels->ModelIndex(j)]->CrossSection(couple,particle,e,cut,tmax); 731 e = regModels->LowEdgeEnergy(j); 732 eLow[j] = e; 733 G4int idx = regModels->ModelIndex(j); 734 735 sigmaLow[j] = models[idx]->CrossSection(couple,particle,e,cut,tmax); 736 e = regModels->LowEdgeEnergy(j+1); 737 eLow[j+1] = e; 738 sigmaHigh[j] = models[idx]->CrossSection(couple,particle,e,cut,tmax); 739 } 740 if(1 < verboseLevel) { 741 G4cout << " model #0" 742 << " sigma(" << eLow[0] << ")= " << sigmaLow[0] 743 << " sigma(" << eLow[1] << ")= " << sigmaHigh[0] 744 << G4endl; 745 } 746 for(j=1; j<nmod; j++) { 747 if(sigmaLow[j] > 0.0) { 748 factor[j] = (sigmaHigh[j-1]/sigmaLow[j] - 1.0)*eLow[j]; 749 } else factor[j] = 0.0; 676 750 if(1 < verboseLevel) { 677 G4cout << " model #" << j << " eUp= " << e 678 << " sigmaUp= " << sigmaHigh[j] 679 << " sigmaDown= " << sigmaLow[j] 751 G4cout << " model #" << j 752 << " sigma(" << eLow[j] << ")= " << sigmaLow[j] 753 << " sigma(" << eLow[j+1] << ")= " << sigmaHigh[j] 754 << " factor= " << factor[j]/eLow[j] 680 755 << G4endl; 681 756 } 682 }683 for(j=1; j<nmod; j++) {684 if(sigmaLow[j] > 0.0) factor[j] = (sigmaHigh[j-1]/sigmaLow[j] - 1.0);685 else factor[j] = 0.0;686 757 } 687 758 } … … 695 766 G4int k = 0; 696 767 G4double fac = 1.0; 697 if (nmod > 1 && e > upperEkin[regModels->ModelIndex(0)]) {768 if (nmod > 1 && e > eLow[1]) { 698 769 do { 699 770 k++; 700 fac *= (1.0 + factor[k] *upperEkin[regModels->ModelIndex(k-1)]/e);701 } while ( k<nmod-1 && e > upperEkin[regModels->ModelIndex(k)] );771 fac *= (1.0 + factor[k]/e); 772 } while ( k+1 < nmod && e > eLow[k+1] ); 702 773 } 703 774 … … 721 792 722 793 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 794 795 void G4EmModelManager::DumpModelList(G4int verb) 796 { 797 if(verb == 0) return; 798 for(G4int i=0; i<nRegions; i++) { 799 G4RegionModels* r = setOfRegionModels[i]; 800 const G4Region* reg = r->Region(); 801 if(verb > 1 || nRegions > 1) { 802 } 803 G4int n = r->NumberOfModels(); 804 if(verb > 1 || n > 0) { 805 G4cout << " ===== EM models for the G4Region " << reg->GetName() 806 << " ======" << G4endl;; 807 for(G4int j=0; j<n; j++) { 808 const G4VEmModel* m = models[r->ModelIndex(j)]; 809 G4cout << std::setw(20); 810 G4cout << m->GetName() << " : Emin= " 811 << std::setw(10) << G4BestUnit(r->LowEdgeEnergy(j),"Energy") 812 << " Emax= " 813 << G4BestUnit(r->LowEdgeEnergy(j+1),"Energy") 814 << G4endl; 815 } 816 } 817 } 818 } 819 820 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/utils/src/G4EmMultiModel.cc
r819 r961 25 25 // 26 26 // $Id: G4EmMultiModel.cc,v 1.6 2007/05/22 17:31:58 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/src/G4EmProcessOptions.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmProcessOptions.cc,v 1.2 2 2007/11/07 18:38:49vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4EmProcessOptions.cc,v 1.26 2009/02/18 14:43:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 59 59 #include "G4VMultipleScattering.hh" 60 60 #include "G4Region.hh" 61 #include "G4RegionStore.hh" 61 62 62 63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 392 393 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 393 394 394 void G4EmProcessOptions::ActivateDeexcitation(G4bool val, const G4Region* r) 395 { 396 const std::vector<G4VEnergyLossProcess*>& v = 397 theManager->GetEnergyLossProcessVector(); 398 std::vector<G4VEnergyLossProcess*>::const_iterator itr; 399 for(itr = v.begin(); itr != v.end(); itr++) { 400 G4VEnergyLossProcess* p = *itr; 401 if(p) p->ActivateDeexcitation(val,r); 402 } 403 const std::vector<G4VEmProcess*>& w = 404 theManager->GetEmProcessVector(); 405 std::vector<G4VEmProcess*>::const_iterator itp; 406 for(itp = w.begin(); itp != w.end(); itp++) { 407 G4VEmProcess* q = *itp; 408 if(q) q->ActivateDeexcitation(val,r); 395 void G4EmProcessOptions::ActivateDeexcitation(const G4String& pname, 396 G4bool val, 397 const G4String& reg) 398 { 399 G4RegionStore* regionStore = G4RegionStore::GetInstance(); 400 const G4Region* r = 0; 401 if(reg == "" || reg == "World") { 402 r = regionStore->GetRegion("DefaultRegionForTheWorld", false); 403 } else { 404 r = regionStore->GetRegion(reg, false); 405 } 406 if(!r) { 407 G4cout << "G4EmProcessOptions::ActivateDeexcitation ERROR: G4Region <" 408 << reg << "> not found, the command ignored" << G4endl; 409 return; 410 } 411 412 const std::vector<G4VEnergyLossProcess*>& v = 413 theManager->GetEnergyLossProcessVector(); 414 std::vector<G4VEnergyLossProcess*>::const_iterator itr; 415 for(itr = v.begin(); itr != v.end(); itr++) { 416 G4VEnergyLossProcess* p = *itr; 417 if(p) { 418 if(pname == p->GetProcessName()) p->ActivateDeexcitation(val,r); 419 } 420 } 421 const std::vector<G4VEmProcess*>& w = 422 theManager->GetEmProcessVector(); 423 std::vector<G4VEmProcess*>::const_iterator itp; 424 for(itp = w.begin(); itp != w.end(); itp++) { 425 G4VEmProcess* q = *itp; 426 if(q) { 427 if(pname == q->GetProcessName()) q->ActivateDeexcitation(val,r); 428 } 409 429 } 410 430 } … … 477 497 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 478 498 499 void G4EmProcessOptions::SetPolarAngleLimit(G4double val) 500 { 501 const std::vector<G4VMultipleScattering*>& u = 502 theManager->GetMultipleScatteringVector(); 503 std::vector<G4VMultipleScattering*>::const_iterator itm; 504 for(itm = u.begin(); itm != u.end(); itm++) { 505 if(*itm) (*itm)->SetPolarAngleLimit(val); 506 } 507 const std::vector<G4VEmProcess*>& w = 508 theManager->GetEmProcessVector(); 509 std::vector<G4VEmProcess*>::const_iterator itp; 510 for(itp = w.begin(); itp != w.end(); itp++) { 511 G4VEmProcess* q = *itp; 512 if(q) q->SetPolarAngleLimit(val); 513 } 514 } 515 516 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 517 479 518 void G4EmProcessOptions::SetLPMFlag(G4bool val) 480 519 { … … 484 523 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 485 524 525 void G4EmProcessOptions::SetSplineFlag(G4bool val) 526 { 527 theManager->SetSplineFlag(val); 528 } 529 530 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 531 486 532 void G4EmProcessOptions::SetLinearLossLimit(G4double val) 487 533 { -
trunk/source/processes/electromagnetic/utils/src/G4EnergyLossMessenger.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4EnergyLossMessenger.cc,v 1. 29 2007/06/11 14:56:51vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4EnergyLossMessenger.cc,v 1.37 2009/02/18 14:43:27 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------------------------------------------------------------- … … 49 49 // 16-03-07 modify /process/eLoss/minsubsec command (V.Ivanchenko) 50 50 // 18-05-07 add /process/msc directory and commands (V.Ivanchenko) 51 // 11-03-08 add /process/em directory and commands (V.Ivanchenko) 51 52 // 52 53 // ------------------------------------------------------------------- … … 84 85 mscDirectory = new G4UIdirectory("/process/msc/"); 85 86 mscDirectory->SetGuidance("Commands for EM scattering processes."); 87 emDirectory = new G4UIdirectory("/process/em/"); 88 emDirectory->SetGuidance("General commands for EM processes."); 86 89 87 90 RndmStepCmd = new G4UIcmdWithABool("/process/eLoss/rndmStep",this); … … 146 149 147 150 IntegCmd = new G4UIcmdWithABool("/process/eLoss/integral",this); 148 IntegCmd->SetGuidance("Switch true/false the integra tion of cross section over step.");151 IntegCmd->SetGuidance("Switch true/false the integral option"); 149 152 IntegCmd->SetParameterName("integ",true); 150 153 IntegCmd->SetDefaultValue(true); … … 152 155 153 156 rangeCmd = new G4UIcmdWithABool("/process/eLoss/CSDARange",this); 154 rangeCmd->SetGuidance("Switch true/false the precise range calculation.");157 rangeCmd->SetGuidance("Switch true/false the CSDA range calculation"); 155 158 rangeCmd->SetParameterName("range",true); 156 159 rangeCmd->SetDefaultValue(true); … … 158 161 159 162 lpmCmd = new G4UIcmdWithABool("/process/eLoss/LPM",this); 160 lpmCmd->SetGuidance(" Switch true/false the LPM effect calculation.");163 lpmCmd->SetGuidance("The flag of the LPM effect calculation"); 161 164 lpmCmd->SetParameterName("lpm",true); 162 165 lpmCmd->SetDefaultValue(true); 163 166 lpmCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 164 167 168 splCmd = new G4UIcmdWithABool("/process/em/spline",this); 169 splCmd->SetGuidance("The flag of usage spline for Physics Vectors"); 170 splCmd->SetParameterName("spl",true); 171 splCmd->SetDefaultValue(false); 172 splCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 173 174 aplCmd = new G4UIcmdWithABool("/process/em/applyCuts",this); 175 aplCmd->SetGuidance("The flag to Apply Cuts for gamma processes"); 176 aplCmd->SetParameterName("apl",true); 177 aplCmd->SetDefaultValue(false); 178 aplCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 179 180 deexCmd = new G4UIcommand("/process/em/deexcitation",this); 181 deexCmd->SetGuidance("Set deexcitation flag per process and G4Region."); 182 deexCmd->SetGuidance(" procName : process name"); 183 deexCmd->SetGuidance(" flag : flag"); 184 deexCmd->SetGuidance(" regName : G4Region name"); 185 186 G4UIparameter* pName = new G4UIparameter("pName",'s',false); 187 deexCmd->SetParameter(pName); 188 189 G4UIparameter* flag = new G4UIparameter("flag",'s',false); 190 deexCmd->SetParameter(flag); 191 192 G4UIparameter* regName = new G4UIparameter("regName",'s',false); 193 deexCmd->SetParameter(regName); 194 165 195 dedxCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsDEDX",this); 166 dedxCmd->SetGuidance("Set number of bins for DEDX tables .");196 dedxCmd->SetGuidance("Set number of bins for DEDX tables"); 167 197 dedxCmd->SetParameterName("binsDEDX",true); 168 198 dedxCmd->SetDefaultValue(120); … … 170 200 171 201 lamCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsLambda",this); 172 lamCmd->SetGuidance("Set number of bins for Lambda tables .");202 lamCmd->SetGuidance("Set number of bins for Lambda tables"); 173 203 lamCmd->SetParameterName("binsL",true); 174 204 lamCmd->SetDefaultValue(120); … … 176 206 177 207 verCmd = new G4UIcmdWithAnInteger("/process/eLoss/verbose",this); 178 verCmd->SetGuidance("Set verbose level for EM physics .");208 verCmd->SetGuidance("Set verbose level for EM physics"); 179 209 verCmd->SetParameterName("verb",true); 180 210 verCmd->SetDefaultValue(1); 181 211 verCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 182 212 213 ver1Cmd = new G4UIcmdWithAnInteger("/process/em/verbose",this); 214 ver1Cmd->SetGuidance("Set verbose level for EM physics"); 215 ver1Cmd->SetParameterName("verb1",true); 216 ver1Cmd->SetDefaultValue(1); 217 ver1Cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 218 183 219 lllCmd = new G4UIcmdWithADouble("/process/eLoss/linLossLimit",this); 184 lllCmd->SetGuidance("Set linearLossLimit parameter .");220 lllCmd->SetGuidance("Set linearLossLimit parameter"); 185 221 lllCmd->SetParameterName("linlim",true); 186 222 lllCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 187 223 188 labCmd = new G4UIcmdWithADouble("/process/eLoss/ lambdaFactor",this);189 labCmd->SetGuidance("Set lambdaFactor parameter .");224 labCmd = new G4UIcmdWithADouble("/process/eLoss/LambdaFactor",this); 225 labCmd->SetGuidance("Set lambdaFactor parameter for integral option"); 190 226 labCmd->SetParameterName("Fl",true); 191 227 labCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 192 228 193 229 mscCmd = new G4UIcmdWithAString("/process/msc/StepLimit",this); 194 mscCmd->SetGuidance("Set msc step limitation type .");230 mscCmd->SetGuidance("Set msc step limitation type"); 195 231 mscCmd->SetParameterName("StepLim",true); 196 232 mscCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 197 233 198 234 latCmd = new G4UIcmdWithABool("/process/msc/LateralDisplacement",this); 199 latCmd->SetGuidance("S witch true/false sampling of latra dislacent.");235 latCmd->SetGuidance("Set flag of sampling of lateral displacement"); 200 236 latCmd->SetParameterName("lat",true); 201 237 latCmd->SetDefaultValue(true); … … 203 239 204 240 frCmd = new G4UIcmdWithADouble("/process/msc/RangeFactor",this); 205 frCmd->SetGuidance("Set RangeFactor parameter for msc process .");241 frCmd->SetGuidance("Set RangeFactor parameter for msc processes"); 206 242 frCmd->SetParameterName("Fr",true); 207 243 frCmd->SetRange("Fr>0"); … … 210 246 211 247 fgCmd = new G4UIcmdWithADouble("/process/msc/GeomFactor",this); 212 fgCmd->SetGuidance("Set GeomFactor parameter for msc process .");248 fgCmd->SetGuidance("Set GeomFactor parameter for msc processes"); 213 249 fgCmd->SetParameterName("Fg",true); 214 250 fgCmd->SetRange("Fg>0"); … … 217 253 218 254 skinCmd = new G4UIcmdWithADouble("/process/msc/Skin",this); 219 skinCmd->SetGuidance("Set skin parameter for m ultiple scattering.");255 skinCmd->SetGuidance("Set skin parameter for msc processes"); 220 256 skinCmd->SetParameterName("skin",true); 221 257 skinCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 222 258 259 angCmd = new G4UIcmdWithADoubleAndUnit("/process/msc/ThetaLimit",this); 260 angCmd->SetGuidance("Set the limit on the polar angle"); 261 angCmd->SetParameterName("theta",true); 262 angCmd->SetUnitCategory("Angle"); 263 angCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 223 264 } 224 265 … … 233 274 delete MinSubSecCmd; 234 275 delete StepFuncCmd; 276 delete deexCmd; 235 277 delete eLossDirectory; 236 278 delete mscDirectory; 279 delete emDirectory; 237 280 delete MinEnCmd; 238 281 delete MaxEnCmd; … … 240 283 delete rangeCmd; 241 284 delete lpmCmd; 285 delete splCmd; 286 delete aplCmd; 242 287 delete latCmd; 243 288 delete verCmd; 289 delete ver1Cmd; 244 290 delete mscCmd; 245 291 delete dedxCmd; … … 250 296 delete labCmd; 251 297 delete skinCmd; 298 delete angCmd; 252 299 } 253 300 … … 289 336 } 290 337 338 if (command == deexCmd) { 339 G4String s1 (""), s2(""), s3(""); 340 G4bool b = false; 341 std::istringstream is(newValue); 342 is >> s1 >> s2 >> s3; 343 if(s2 == "true") b = true; 344 opt->ActivateDeexcitation(s1,b,s3); 345 } 346 291 347 if (command == mscCmd) { 292 348 if(newValue == "Minimal") … … 317 373 } 318 374 319 if (command == IntegCmd) 375 if (command == IntegCmd) { 320 376 opt->SetIntegral(IntegCmd->GetNewBoolValue(newValue)); 321 377 } 322 378 if (command == rangeCmd) { 323 379 opt->SetBuildCSDARange(rangeCmd->GetNewBoolValue(newValue)); … … 330 386 } 331 387 388 if (command == splCmd) { 389 opt->SetSplineFlag(splCmd->GetNewBoolValue(newValue)); 390 G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified"); 391 } 392 393 if (command == aplCmd) { 394 opt->SetApplyCuts(aplCmd->GetNewBoolValue(newValue)); 395 } 396 332 397 if (command == latCmd) { 333 398 opt->SetMscLateralDisplacement(latCmd->GetNewBoolValue(newValue)); … … 335 400 } 336 401 337 if (command == verCmd) 402 if (command == verCmd) { 338 403 opt->SetVerbose(verCmd->GetNewIntValue(newValue)); 339 340 if (command == lllCmd) 404 } 405 if (command == ver1Cmd) { 406 opt->SetVerbose(ver1Cmd->GetNewIntValue(newValue)); 407 } 408 if (command == lllCmd) { 341 409 opt->SetLinearLossLimit(lllCmd->GetNewDoubleValue(newValue)); 342 343 if (command == labCmd) 410 } 411 if (command == labCmd) { 344 412 opt->SetLambdaFactor(labCmd->GetNewDoubleValue(newValue)); 345 413 } 346 414 if (command == skinCmd) { 347 415 opt->SetSkin(skinCmd->GetNewDoubleValue(newValue)); … … 364 432 G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified"); 365 433 } 434 if (command == angCmd) { 435 opt->SetPolarAngleLimit(angCmd->GetNewDoubleValue(newValue)); 436 G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified"); 437 } 366 438 } 367 439 -
trunk/source/processes/electromagnetic/utils/src/G4EnergyLossTables.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4EnergyLossTables.cc,v 1.3 3 2006/06/29 19:55:09 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4EnergyLossTables.cc,v 1.34 2008/07/08 10:57:22 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------------------------------------------------------------- … … 998 998 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 999 999 1000 void G4EnergyLossTables::ParticleHaveNoLoss(const G4ParticleDefinition* aParticle, const G4String& q) 1001 { 1002 G4String s = "G4EnergyLossTables:: " + q + " table not found for " 1003 + aParticle->GetParticleName() + "!"; 1004 G4Exception(s); 1005 exit(1); 1006 } 1007 1008 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 1000 void G4EnergyLossTables::ParticleHaveNoLoss(const G4ParticleDefinition* aParticle, 1001 const G4String& q) 1002 { 1003 G4String s = " " + q + " table not found for " 1004 + aParticle->GetParticleName() + " !"; 1005 G4Exception("G4EnergyLossTables::ParticleHaveNoLoss", "EM01", 1006 FatalException, s); 1007 } 1008 1009 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/utils/src/G4LossTableBuilder.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LossTableBuilder.cc,v 1.2 4 2007/02/16 11:59:35vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4LossTableBuilder.cc,v 1.28 2009/02/18 16:24:47 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 64 64 65 65 G4LossTableBuilder::G4LossTableBuilder() 66 {} 66 { 67 splineFlag = true; 68 } 67 69 68 70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 73 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 74 76 75 void G4LossTableBuilder::BuildDEDXTable(G4PhysicsTable* dedxTable, 76 const std::vector<G4PhysicsTable*>& list) 77 void 78 G4LossTableBuilder::BuildDEDXTable(G4PhysicsTable* dedxTable, 79 const std::vector<G4PhysicsTable*>& list) 77 80 { 78 81 size_t n_processes = list.size(); … … 91 94 92 95 pv = new G4PhysicsLogVector(elow, ehigh, nbins); 96 pv->SetSpline(splineFlag); 93 97 for (size_t j=0; j<nbins; j++) { 94 98 G4double dedx = 0.0; … … 128 132 G4double dedx1 = pv->GetValue(elow, b); 129 133 134 //G4cout << "nbins= " << nbins << " dedx1= " << dedx1 << G4endl; 135 136 // protection for specific cases dedx=0 130 137 if(dedx1 == 0.0) { 131 for (size_t k=1; k<nbins ; k++) {138 for (size_t k=1; k<nbins-1; k++) { 132 139 bin0++; 133 140 elow = pv->GetLowEdgeEnergy(k); … … 138 145 } 139 146 147 //G4cout << "nbins= " << nbins << " elow= " << elow << " ehigh= " << ehigh << G4endl; 148 // initialisation of a new vector 140 149 G4PhysicsLogVector* v = new G4PhysicsLogVector(elow, ehigh, nbins); 141 150 // dedx is exect zero 151 if(nbins <= 2) { 152 v->PutValue(0,1000.); 153 v->PutValue(1,2000.); 154 G4PhysicsTableHelper::SetPhysicsVector(rangeTable, i, v); 155 return; 156 } 157 v->SetSpline(splineFlag); 158 159 // assumed dedx proportional to beta 142 160 G4double range = 2.*elow/dedx1; 143 //G4double range = elow/dedx1;144 161 v->PutValue(0,range); 145 162 G4double energy1 = elow; … … 148 165 149 166 G4double energy2 = pv->GetLowEdgeEnergy(j+bin0); 150 G4double dedx2 = pv->GetValue(energy2, b);151 167 G4double de = (energy2 - energy1) * del; 152 G4double energy = energy1 - de*0.5; 153 154 G4bool yes = true; 155 //G4bool yes = false; 156 if(dedx1 < DBL_MIN || dedx2 < DBL_MIN) yes = false; 157 158 G4double fac, f; 159 160 if(yes) fac = std::log(dedx2/dedx1)/std::log(energy2/energy1); 161 else fac = (dedx2 - dedx1)/(energy2 - energy1); 162 168 G4double energy = energy2 + de*0.5; 163 169 for (size_t k=0; k<n; k++) { 164 energy += de;165 if(yes) f = dedx1*std::exp(fac*std::log(energy/energy1));166 else f = dedx1 + fac*(energy - energy1);167 if(f > DBL_MIN) range += de/f; 168 } 170 energy -= de; 171 dedx1 = pv->GetValue(energy, b); 172 if(dedx1 > 0.0) range += de/dedx1; 173 } 174 169 175 // G4cout << "Range i= " <<i << " j= " << j << G4endl; 170 176 v->PutValue(j,range); 171 177 energy1 = energy2; 172 dedx1 = dedx2;173 178 } 174 179 G4PhysicsTableHelper::SetPhysicsVector(rangeTable, i, v); … … 197 202 G4double rlow = pv->GetValue(elow, b); 198 203 G4double rhigh = pv->GetValue(ehigh, b); 199 200 rhigh *= std::exp(std::log(rhigh/rlow)/((G4double)(nbins-1)));201 202 204 203 205 G4LPhysicsFreeVector* v = new G4LPhysicsFreeVector(nbins,rlow,rhigh); 206 v->SetSpline(splineFlag); 207 204 208 for (size_t j=0; j<nbins; j++) { 205 209 G4double e = pv->GetLowEdgeEnergy(j); … … 207 211 v->PutValues(j,r,e); 208 212 } 213 v->PutValues(nbins,rhigh+rlow,ehigh); 209 214 210 215 G4PhysicsTableHelper::SetPhysicsVector(invRangeTable, i, v); -
trunk/source/processes/electromagnetic/utils/src/G4LossTableManager.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LossTableManager.cc,v 1. 84 2007/06/14 07:28:48 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4LossTableManager.cc,v 1.95 2008/11/13 18:23:39 schaelic Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 70 70 // 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko) 71 71 // 18-06-07 Move definition of msc parameters to G4EmProcessOptions (V.Ivanchenko) 72 // 21-02-08 Add G4EmSaturation (V.Ivanchenko) 72 73 // 73 74 // Class Description: … … 91 92 #include "G4PhysicsTableHelper.hh" 92 93 #include "G4EmCorrections.hh" 94 #include "G4EmSaturation.hh" 93 95 #include "G4EmTableType.hh" 94 96 #include "G4LossTableBuilder.hh" … … 116 118 size_t msc = msc_vector.size(); 117 119 for (size_t j=0; j<msc; j++) { 118 if( msc_vector[j] ) delete msc_vector[j];120 if( msc_vector[j] ) delete msc_vector[j]; 119 121 } 120 122 size_t emp = emp_vector.size(); 121 123 for (size_t k=0; k<emp; k++) { 122 if(emp_vector[k] ) delete emp_vector[k]; 124 if( emp_vector[k] ) delete emp_vector[k]; 125 } 126 size_t mod = mod_vector.size(); 127 for (size_t a=0; a<mod; a++) { 128 if( mod_vector[a] ) delete mod_vector[a]; 129 } 130 size_t fmod = fmod_vector.size(); 131 for (size_t b=0; b<fmod; b++) { 132 if( fmod_vector[b] ) delete fmod_vector[b]; 123 133 } 124 134 Clear(); … … 126 136 delete tableBuilder; 127 137 delete emCorrections; 138 delete emSaturation; 128 139 } 129 140 … … 152 163 tableBuilder = new G4LossTableBuilder(); 153 164 emCorrections= new G4EmCorrections(); 165 emSaturation = new G4EmSaturation(); 154 166 integral = true; 155 167 integralActive = false; … … 160 172 stepFunctionActive = false; 161 173 flagLPM = true; 174 splineFlag = true; 162 175 bremsTh = DBL_MAX; 163 176 verbose = 1; 177 tableBuilder->SetSplineFlag(splineFlag); 164 178 } 165 179 … … 226 240 { 227 241 msc_vector.push_back(p); 228 if(verbose > 1) 242 if(verbose > 1) { 229 243 G4cout << "G4LossTableManager::Register G4VMultipleScattering : " 230 244 << p->GetProcessName() << G4endl; 245 } 231 246 } 232 247 … … 246 261 { 247 262 emp_vector.push_back(p); 248 if(verbose > 1) 263 if(verbose > 1) { 249 264 G4cout << "G4LossTableManager::Register G4VEmProcess : " 250 265 << p->GetProcessName() << G4endl; 266 } 251 267 } 252 268 … … 258 274 for (size_t i=0; i<emp; i++) { 259 275 if(emp_vector[i] == p) emp_vector[i] = 0; 276 } 277 } 278 279 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 280 281 void G4LossTableManager::Register(G4VEmModel* p) 282 { 283 mod_vector.push_back(p); 284 if(verbose > 1) { 285 G4cout << "G4LossTableManager::Register G4VEmModel : " 286 << p->GetName() << G4endl; 287 } 288 } 289 290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 291 292 void G4LossTableManager::DeRegister(G4VEmModel* p) 293 { 294 size_t n = mod_vector.size(); 295 for (size_t i=0; i<n; i++) { 296 if(mod_vector[i] == p) mod_vector[i] = 0; 297 } 298 } 299 300 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 301 302 void G4LossTableManager::Register(G4VEmFluctuationModel* p) 303 { 304 fmod_vector.push_back(p); 305 if(verbose > 1) { 306 G4cout << "G4LossTableManager::Register G4VEmFluctuationModel : " 307 << p->GetName() << G4endl; 308 } 309 } 310 311 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 312 313 void G4LossTableManager::DeRegister(G4VEmFluctuationModel* p) 314 { 315 size_t n = fmod_vector.size(); 316 for (size_t i=0; i<n; i++) { 317 if(fmod_vector[i] == p) fmod_vector[i] = 0; 260 318 } 261 319 } … … 364 422 const G4ParticleDefinition* aParticle) 365 423 { 366 G4String s = "G4LossTableManager:: dE/dx table not found for " 367 + aParticle->GetParticleName() + "!"; 368 G4Exception(s); 369 exit(1); 424 G4String s = " dE/dx table not found for " 425 + aParticle->GetParticleName() + " !"; 426 G4Exception("G4LossTableManager::ParticleHaveNoLoss", "EM01", 427 FatalException, s); 428 370 429 } 371 430 … … 476 535 p = loss_vector[i]; 477 536 if (p && aParticle == part_vector[i] && !tables_are_built[i]) { 478 if (p->IsIonisationProcess() && isActive[i] || !em || (em && !isActive[iem]) ) { 537 if ((p->IsIonisationProcess() && isActive[i]) || 538 !em || (em && !isActive[iem]) ) { 479 539 em = p; 480 540 iem= i; … … 509 569 dedx = em->IonisationTable(); 510 570 if (1 < n_dedx) { 511 em->SetDEDXTable(dedx, fI onisation);571 em->SetDEDXTable(dedx, fIsIonisation); 512 572 dedx = 0; 513 573 dedx = G4PhysicsTableHelper::PreparePhysicsTable(dedx); … … 560 620 G4PhysicsTable* dedxSub = em->IonisationTableForSubsec(); 561 621 if (1 < listSub.size()) { 562 em->SetDEDXTable(dedxSub, f SubIonisation);622 em->SetDEDXTable(dedxSub, fIsSubIonisation); 563 623 dedxSub = 0; 564 624 dedxSub = G4PhysicsTableHelper::PreparePhysicsTable(dedxSub); … … 829 889 } 830 890 891 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 892 893 void G4LossTableManager::SetSplineFlag(G4bool val) 894 { 895 splineFlag = val; 896 tableBuilder->SetSplineFlag(splineFlag); 897 } 898 899 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 900 901 G4bool G4LossTableManager::SplineFlag() const 902 { 903 return splineFlag; 904 } 905 831 906 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 832 907 … … 843 918 } 844 919 920 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 921 922 G4EmCorrections* G4LossTableManager::EmCorrections() 923 { 924 return emCorrections; 925 } 926 927 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 928 929 G4EmSaturation* G4LossTableManager::EmSaturation() 930 { 931 return emSaturation; 932 } 933 845 934 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/utils/src/G4VEmFluctuationModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEmFluctuationModel.cc,v 1. 2 2006/06/29 19:55:15 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: G4VEmFluctuationModel.cc,v 1.4 2009/02/19 11:25:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 49 49 50 50 #include "G4VEmFluctuationModel.hh" 51 51 #include "G4LossTableManager.hh" 52 52 53 53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 56 56 G4VEmFluctuationModel::G4VEmFluctuationModel(const G4String& nam) 57 57 : name(nam) 58 { 59 G4LossTableManager::Instance()->Register(this); 60 } 61 62 G4VEmFluctuationModel::~G4VEmFluctuationModel() 63 { 64 G4LossTableManager::Instance()->DeRegister(this); 65 } 66 67 void G4VEmFluctuationModel::InitialiseMe(const G4ParticleDefinition*) 58 68 {} 59 69 60 G4VEmFluctuationModel::~G4VEmFluctuationModel() 70 void G4VEmFluctuationModel::SetParticleAndCharge(const G4ParticleDefinition*, 71 G4double) 61 72 {} 62 73 -
trunk/source/processes/electromagnetic/utils/src/G4VEmModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEmModel.cc,v 1. 8 2007/09/25 10:19:07vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4VEmModel.cc,v 1.25 2009/02/19 09:57:36 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 41 41 // 25.10.2005 Set default highLimit=100.TeV (V.Ivanchenko) 42 42 // 06.02.2006 add method ComputeMeanFreePath() (mma) 43 // 16.02.2009 Move implementations of virtual methods to source (VI) 43 44 // 44 45 // … … 51 52 52 53 #include "G4VEmModel.hh" 54 #include "G4LossTableManager.hh" 55 #include "G4ProductionCutsTable.hh" 53 56 54 57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 56 59 57 60 G4VEmModel::G4VEmModel(const G4String& nam): 58 lowLimit(0.1*keV), highLimit(100.0*TeV), fluc(0), name(nam), pParticleChange(0) 59 {} 61 fluc(0), name(nam), lowLimit(0.1*keV), highLimit(100.0*TeV), 62 polarAngleLimit(0.0),secondaryThreshold(DBL_MAX),theLPMflag(false), 63 pParticleChange(0),nuclearStopping(false), 64 currentCouple(0),currentElement(0), 65 nsec(5),flagDeexcitation(false) 66 { 67 xsec.resize(nsec); 68 nSelectors = 0; 69 G4LossTableManager::Instance()->Register(this); 70 } 60 71 61 72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 62 73 63 74 G4VEmModel::~G4VEmModel() 64 {} 75 { 76 G4LossTableManager::Instance()->DeRegister(this); 77 G4int n = elmSelectors.size(); 78 if(n > 0) { 79 for(G4int i=0; i<n; i++) { 80 delete elmSelectors[i]; 81 } 82 } 83 } 84 85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 86 87 void G4VEmModel::InitialiseElementSelectors(const G4ParticleDefinition* p, 88 const G4DataVector& cuts) 89 { 90 // initialise before run 91 flagDeexcitation = false; 92 93 G4int nbins = G4int(std::log10(highLimit/lowLimit) + 0.5); 94 if(nbins < 3) nbins = 3; 95 G4bool spline = G4LossTableManager::Instance()->SplineFlag(); 96 97 G4ProductionCutsTable* theCoupleTable= 98 G4ProductionCutsTable::GetProductionCutsTable(); 99 G4int numOfCouples = theCoupleTable->GetTableSize(); 100 101 // prepare vector 102 if(numOfCouples > nSelectors) { 103 elmSelectors.resize(numOfCouples); 104 nSelectors = numOfCouples; 105 } 106 107 // initialise vector 108 for(G4int i=0; i<numOfCouples; i++) { 109 const G4MaterialCutsCouple* couple = 110 theCoupleTable->GetMaterialCutsCouple(i); 111 const G4Material* material = couple->GetMaterial(); 112 G4int idx = couple->GetIndex(); 113 114 // selector already exist check if should be deleted 115 G4bool create = true; 116 if(elmSelectors[i]) { 117 if(material == elmSelectors[i]->GetMaterial()) create = false; 118 else delete elmSelectors[i]; 119 } 120 if(create) { 121 elmSelectors[i] = new G4EmElementSelector(this,material,nbins, 122 lowLimit,highLimit,spline); 123 } 124 elmSelectors[i]->Initialise(p, cuts[idx]); 125 //elmSelectors[i]->Dump(p); 126 } 127 } 128 129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 130 131 G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*, 132 const G4ParticleDefinition*, 133 G4double,G4double) 134 { 135 return 0.0; 136 } 65 137 66 138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 68 140 G4double G4VEmModel::CrossSectionPerVolume(const G4Material* material, 69 141 const G4ParticleDefinition* p, 70 G4double ekin, 71 G4double emin, 72 G4double emax) 73 { 142 G4double ekin, 143 G4double emin, 144 G4double emax) 145 { 146 SetupForMaterial(p, material, ekin); 74 147 G4double cross = 0.0; 75 148 const G4ElementVector* theElementVector = material->GetElementVector(); 76 149 const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume(); 77 size_t nelm = material->GetNumberOfElements(); 78 for (size_t i=0; i<nelm; i++) { 79 const G4Element* elm = (*theElementVector)[i]; 150 G4int nelm = material->GetNumberOfElements(); 151 if(nelm > nsec) { 152 xsec.resize(nelm); 153 nsec = nelm; 154 } 155 for (G4int i=0; i<nelm; i++) { 80 156 cross += theAtomNumDensityVector[i]* 81 ComputeCrossSectionPerAtom(p, ekin,elm->GetZ(),elm->GetN(),emin,emax);157 ComputeCrossSectionPerAtom(p,(*theElementVector)[i],ekin,emin,emax); 82 158 xsec[i] = cross; 83 159 } … … 87 163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 88 164 89 G4double G4VEmModel::ComputeMeanFreePath(const G4ParticleDefinition* p, 90 G4double ekin, 91 const G4Material* material, 92 G4double emin, 93 G4double emax) 94 { 95 G4double mfp = DBL_MAX; 96 G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax); 97 if (cross > DBL_MIN) mfp = 1./cross; 98 return mfp; 99 } 100 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 102 103 165 G4double G4VEmModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 166 G4double, G4double, G4double, 167 G4double, G4double) 168 { 169 return 0.0; 170 } 171 172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 173 174 G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*, 175 const G4MaterialCutsCouple*) 176 { 177 return 0.0; 178 } 179 180 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 181 182 G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p, 183 const G4Material*, G4double) 184 { 185 G4double q = p->GetPDGCharge()/CLHEP::eplus; 186 return q*q; 187 } 188 189 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 190 191 G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p, 192 const G4Material*, G4double) 193 { 194 return p->GetPDGCharge(); 195 } 196 197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 198 199 void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*, 200 const G4DynamicParticle*, 201 G4double&,G4double&,G4double) 202 {} 203 204 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 205 206 void G4VEmModel::SampleDeexcitationAlongStep(const G4Material*, 207 const G4Track&, 208 G4double& ) 209 {} 210 211 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 212 213 G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*, 214 G4double kineticEnergy) 215 { 216 return kineticEnergy; 217 } 218 219 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 220 221 void G4VEmModel::SampleScattering(const G4DynamicParticle*, G4double) 222 {} 223 224 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 225 226 G4double G4VEmModel::ComputeTruePathLengthLimit(const G4Track&, 227 G4PhysicsTable*, 228 G4double) 229 { 230 return DBL_MAX; 231 } 232 233 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 234 235 G4double G4VEmModel::ComputeGeomPathLength(G4double truePathLength) 236 { 237 return truePathLength; 238 } 239 240 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 241 242 G4double G4VEmModel::ComputeTrueStepLength(G4double geomPathLength) 243 { 244 return geomPathLength; 245 } 246 247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 248 249 void G4VEmModel::DefineForRegion(const G4Region*) 250 {} 251 252 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 253 254 void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*, 255 const G4Material*, G4double) 256 {} 257 258 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/utils/src/G4VEmProcess.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEmProcess.cc,v 1. 48 2007/10/29 08:38:58vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4VEmProcess.cc,v 1.62 2009/02/19 09:57:36 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 82 82 83 83 G4VEmProcess::G4VEmProcess(const G4String& name, G4ProcessType type): 84 G4VDiscreteProcess(name, type), 85 selectedModel(0), 84 G4VDiscreteProcess(name, type), 85 secondaryParticle(0), 86 buildLambdaTable(true), 86 87 theLambdaTable(0), 87 88 theEnergyOfCrossSectionMax(0), 88 89 theCrossSectionMax(0), 89 particle(0),90 secondaryParticle(0),91 nLambdaBins(90),92 lambdaFactor(0.8),93 currentCouple(0),94 90 integral(false), 95 buildLambdaTable(true),96 91 applyCuts(false), 97 92 startFromNull(true), 98 nRegions(0) 93 useDeexcitation(false), 94 nDERegions(0), 95 idxDERegions(0), 96 currentModel(0), 97 particle(0), 98 currentCouple(0) 99 99 { 100 100 SetVerboseLevel(1); 101 102 // Size of tables assuming spline 101 103 minKinEnergy = 0.1*keV; 102 maxKinEnergy = 100.0*GeV; 104 maxKinEnergy = 100.0*TeV; 105 nLambdaBins = 84; 106 107 // default lambda factor 108 lambdaFactor = 0.8; 109 110 // default limit on polar angle 111 polarAngleLimit = 0.0; 112 113 // particle types 103 114 theGamma = G4Gamma::Gamma(); 104 115 theElectron = G4Electron::Electron(); … … 126 137 delete modelManager; 127 138 (G4LossTableManager::Instance())->DeRegister(this); 139 } 140 141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 142 143 void G4VEmProcess::Clear() 144 { 145 delete [] theEnergyOfCrossSectionMax; 146 delete [] theCrossSectionMax; 147 delete [] idxDERegions; 148 theEnergyOfCrossSectionMax = 0; 149 theCrossSectionMax = 0; 150 idxDERegions = 0; 151 currentCouple = 0; 152 preStepLambda = 0.0; 153 mfpKinEnergy = DBL_MAX; 154 deRegions.clear(); 155 nDERegions = 0; 128 156 } 129 157 … … 153 181 theLambdaTable = G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTable); 154 182 } 155 } 156 157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 158 159 void G4VEmProcess::Clear() 160 { 161 if(theEnergyOfCrossSectionMax) delete [] theEnergyOfCrossSectionMax; 162 if(theCrossSectionMax) delete [] theCrossSectionMax; 163 theEnergyOfCrossSectionMax = 0; 164 theCrossSectionMax = 0; 165 currentCouple = 0; 166 preStepLambda = 0.0; 167 mfpKinEnergy = DBL_MAX; 183 // Sub Cutoff and Deexcitation 184 if (nDERegions>0) { 185 186 const G4ProductionCutsTable* theCoupleTable= 187 G4ProductionCutsTable::GetProductionCutsTable(); 188 size_t numOfCouples = theCoupleTable->GetTableSize(); 189 190 idxDERegions = new G4bool[numOfCouples]; 191 192 for (size_t j=0; j<numOfCouples; j++) { 193 194 const G4MaterialCutsCouple* couple = 195 theCoupleTable->GetMaterialCutsCouple(j); 196 const G4ProductionCuts* pcuts = couple->GetProductionCuts(); 197 G4bool reg = false; 198 for(G4int i=0; i<nDERegions; i++) { 199 if(deRegions[i]) { 200 if(pcuts == deRegions[i]->GetProductionCuts()) reg = true; 201 } 202 } 203 idxDERegions[j] = reg; 204 } 205 } 206 if (1 < verboseLevel && nDERegions>0) { 207 G4cout << " Deexcitation is activated for regions: " << G4endl; 208 for (G4int i=0; i<nDERegions; i++) { 209 const G4Region* r = deRegions[i]; 210 G4cout << " " << r->GetName() << G4endl; 211 } 212 } 168 213 } 169 214 … … 228 273 G4cout << *theLambdaTable << G4endl; 229 274 } 275 } 276 } 277 278 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 279 280 void G4VEmProcess::PrintInfoDefinition() 281 { 282 if(verboseLevel > 0) { 283 G4cout << G4endl << GetProcessName() << ": for " 284 << particle->GetParticleName(); 285 if(integral) G4cout << ", integral: 1 "; 286 if(applyCuts) G4cout << ", applyCuts: 1 "; 287 G4cout << " SubType= " << GetProcessSubType() << G4endl; 288 if(buildLambdaTable) { 289 G4cout << " Lambda tables from " 290 << G4BestUnit(minKinEnergy,"Energy") 291 << " to " 292 << G4BestUnit(maxKinEnergy,"Energy") 293 << " in " << nLambdaBins << " bins, spline: " 294 << (G4LossTableManager::Instance())->SplineFlag() 295 << G4endl; 296 } 297 PrintInfo(); 298 modelManager->DumpModelList(verboseLevel); 299 } 300 301 if(verboseLevel > 2 && buildLambdaTable) { 302 G4cout << " LambdaTable address= " << theLambdaTable << G4endl; 303 if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl; 230 304 } 231 305 } … … 295 369 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 296 370 297 G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,298 G4double,299 G4ForceCondition* condition)300 {301 *condition = NotForced;302 return G4VEmProcess::MeanFreePath(track);303 }304 305 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....306 307 371 G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track, 308 372 const G4Step&) … … 333 397 } 334 398 335 G4VEmModel* currentModel = SelectModel(finalT); 336 399 SelectModel(finalT); 400 if(useDeexcitation) { 401 currentModel->SetDeexcitationFlag(idxDERegions[currentMaterialIndex]); 402 } 337 403 /* 338 404 if(0 < verboseLevel) { … … 373 439 374 440 } else if (p == thePositron) { 375 if (e < (*theCutsPositron)[currentMaterialIndex]) { 441 if (electron_mass_c2 < (*theCutsGamma)[currentMaterialIndex] && 442 e < (*theCutsPositron)[currentMaterialIndex]) { 376 443 good = false; 377 444 e += 2.0*electron_mass_c2; … … 394 461 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 395 462 396 void G4VEmProcess::PrintInfoDefinition()397 {398 if(verboseLevel > 0) {399 G4cout << G4endl << GetProcessName() << ": " ;400 PrintInfo();401 if(integral) {402 G4cout << " Integral mode is used "<< G4endl;403 }404 }405 406 if (!buildLambdaTable) return;407 408 if(verboseLevel > 0) {409 G4cout << " tables are built for "410 << particle->GetParticleName()411 << G4endl412 << " Lambda tables from "413 << G4BestUnit(minKinEnergy,"Energy")414 << " to "415 << G4BestUnit(maxKinEnergy,"Energy")416 << " in " << nLambdaBins << " bins."417 << G4endl;418 }419 420 if(verboseLevel > 1) {421 G4cout << "Tables are built for " << particle->GetParticleName()422 << G4endl;423 424 if(verboseLevel > 2) {425 G4cout << "LambdaTable address= " << theLambdaTable << G4endl;426 if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;427 }428 }429 }430 431 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....432 433 G4double G4VEmProcess::MicroscopicCrossSection(G4double kineticEnergy,434 const G4MaterialCutsCouple* couple)435 {436 // Cross section per atom is calculated437 DefineMaterial(couple);438 G4double cross = 0.0;439 G4bool b;440 if(theLambdaTable) {441 cross = (((*theLambdaTable)[currentMaterialIndex])->442 GetValue(kineticEnergy, b));443 444 cross /= currentMaterial->GetTotNbOfAtomsPerVolume();445 } else {446 G4VEmModel* model = SelectModel(kineticEnergy);447 cross =448 model->CrossSectionPerVolume(currentMaterial,particle,kineticEnergy);449 }450 451 return cross;452 }453 454 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....455 456 463 G4bool G4VEmProcess::StorePhysicsTable(const G4ParticleDefinition* part, 457 464 const G4String& directory, … … 508 515 << G4endl; 509 516 } 517 if((G4LossTableManager::Instance())->SplineFlag()) { 518 size_t n = theLambdaTable->length(); 519 for(size_t i=0; i<n; i++) {(* theLambdaTable)[i]->SetSpline(true);} 520 } 510 521 } else { 511 522 if (1 < verboseLevel) { … … 517 528 518 529 return yes; 530 } 531 532 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 533 534 void G4VEmProcess::ActivateDeexcitation(G4bool val, const G4Region* r) 535 { 536 G4RegionStore* regionStore = G4RegionStore::GetInstance(); 537 const G4Region* reg = r; 538 if (!reg) {reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);} 539 540 // the region is in the list 541 if (nDERegions) { 542 for (G4int i=0; i<nDERegions; i++) { 543 if (reg == deRegions[i]) { 544 if(!val) deRegions[i] = 0; 545 return; 546 } 547 } 548 } 549 550 // new region 551 if(val) { 552 useDeexcitation = true; 553 deRegions.push_back(reg); 554 nDERegions++; 555 } else { 556 useDeexcitation = false; 557 } 558 } 559 560 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 561 562 G4double G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy, 563 const G4MaterialCutsCouple* couple) 564 { 565 // Cross section per atom is calculated 566 DefineMaterial(couple); 567 G4double cross = 0.0; 568 G4bool b; 569 if(theLambdaTable) { 570 cross = (((*theLambdaTable)[currentMaterialIndex])-> 571 GetValue(kineticEnergy, b)); 572 } else { 573 SelectModel(kineticEnergy); 574 cross = currentModel->CrossSectionPerVolume(currentMaterial, 575 particle,kineticEnergy); 576 } 577 578 return cross; 579 } 580 581 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 582 583 G4double G4VEmProcess::GetMeanFreePath(const G4Track& track, 584 G4double, 585 G4ForceCondition* condition) 586 { 587 *condition = NotForced; 588 return G4VEmProcess::MeanFreePath(track); 519 589 } 520 590 … … 568 638 G4PhysicsVector* v = 569 639 new G4PhysicsLogVector(minKinEnergy, maxKinEnergy, nLambdaBins); 640 v->SetSpline((G4LossTableManager::Instance())->SplineFlag()); 570 641 return v; 571 642 } -
trunk/source/processes/electromagnetic/utils/src/G4VEnergyLoss.cc
r819 r961 26 26 // 27 27 // $Id: G4VEnergyLoss.cc,v 1.46 2006/06/29 19:55:21 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 -
trunk/source/processes/electromagnetic/utils/src/G4VEnergyLossProcess.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEnergyLossProcess.cc,v 1.1 23 2008/01/11 19:55:29vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4VEnergyLossProcess.cc,v 1.146 2009/02/19 11:25:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 146 146 147 147 G4VEnergyLossProcess::G4VEnergyLossProcess(const G4String& name, 148 G4ProcessType type): G4VContinuousDiscreteProcess(name, type), 148 G4ProcessType type): 149 G4VContinuousDiscreteProcess(name, type), 150 secondaryParticle(0), 149 151 nSCoffRegions(0), 152 nDERegions(0), 150 153 idxSCoffRegions(0), 154 idxDERegions(0), 151 155 nProcesses(0), 152 156 theDEDXTable(0), … … 165 169 theEnergyOfCrossSectionMax(0), 166 170 theCrossSectionMax(0), 167 particle(0),168 171 baseParticle(0), 169 secondaryParticle(0),170 currentCouple(0),171 nBins(120),172 nBinsCSDA(70),173 nWarnings(0),174 linLossLimit(0.05),175 172 minSubRange(0.1), 176 lambdaFactor(0.8),177 mfpKinEnergy(0.0),178 173 lossFluctuationFlag(true), 179 174 rndmStepFlag(false), 180 175 tablesAreBuilt(false), 181 176 integral(true), 177 isIon(false), 182 178 isIonisation(true), 183 useSubCutoff(false) 179 useSubCutoff(false), 180 useDeexcitation(false), 181 particle(0), 182 currentCouple(0), 183 nWarnings(0), 184 mfpKinEnergy(0.0) 184 185 { 185 186 SetVerboseLevel(1); 186 187 187 // Size of tables188 // low energy limit 188 189 lowestKinEnergy = 1.*eV; 190 191 // Size of tables assuming spline 189 192 minKinEnergy = 0.1*keV; 190 193 maxKinEnergy = 100.0*TeV; 194 nBins = 84; 191 195 maxKinEnergyCSDA = 1.0*GeV; 196 nBinsCSDA = 35; 197 198 // default linear loss limit for spline 199 linLossLimit = 0.01; 192 200 193 201 // default dRoverRange and finalRange 194 202 SetStepFunction(0.2, 1.0*mm); 195 203 196 theElectron = G4Electron::Electron(); 197 thePositron = G4Positron::Positron(); 204 // default lambda factor 205 lambdaFactor = 0.8; 206 207 // particle types 208 theElectron = G4Electron::Electron(); 209 thePositron = G4Positron::Positron(); 210 theGenericIon = 0; 198 211 199 212 // run time objects … … 208 221 fluctModel = 0; 209 222 210 scoffRegions.clear();211 scProcesses.clear();212 223 scTracks.reserve(5); 213 224 secParticles.reserve(5); … … 215 226 // Data for stragling of ranges from ICRU'37 report 216 227 const G4int nrbins = 7; 217 vstrag = new G4PhysicsLogVector(keV, GeV, nrbins); 228 vstrag = new G4PhysicsLogVector(keV, GeV, nrbins-1); 229 vstrag->SetSpline(true); 218 230 G4double s[nrbins] = {-0.2, -0.85, -1.3, -1.578, -1.76, -1.85, -1.9}; 219 231 for(G4int i=0; i<nrbins; i++) {vstrag->PutValue(i, s[i]);} … … 228 240 << G4endl; 229 241 delete vstrag; 230 Clea r();242 Clean(); 231 243 232 244 if ( !baseParticle ) { … … 282 294 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 283 295 284 void G4VEnergyLossProcess::Clea r()285 { 286 if(1 < verboseLevel) 296 void G4VEnergyLossProcess::Clean() 297 { 298 if(1 < verboseLevel) { 287 299 G4cout << "G4VEnergyLossProcess::Clear() for " << GetProcessName() 288 << G4endl;289 300 << G4endl; 301 } 290 302 delete [] theDEDXAtMaxEnergy; 291 303 delete [] theRangeAtMaxEnergy; … … 293 305 delete [] theCrossSectionMax; 294 306 delete [] idxSCoffRegions; 307 delete [] idxDERegions; 295 308 296 309 theDEDXAtMaxEnergy = 0; … … 300 313 tablesAreBuilt = false; 301 314 302 scTracks.clear();315 //scTracks.clear(); 303 316 scProcesses.clear(); 304 } 305 306 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 307 308 void G4VEnergyLossProcess::PreparePhysicsTable( 309 const G4ParticleDefinition& part) 310 { 311 312 // Are particle defined? 313 if( !particle ) { 314 if(part.GetParticleType() == "nucleus" && 315 part.GetParticleSubType() == "generic") 316 particle = G4GenericIon::GenericIon(); 317 else particle = ∂ 318 } 319 317 nProcesses = 0; 318 } 319 320 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 321 322 G4double G4VEnergyLossProcess::MinPrimaryEnergy(const G4ParticleDefinition*, 323 const G4Material*, 324 G4double cut) 325 { 326 return cut; 327 } 328 329 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 330 331 void 332 G4VEnergyLossProcess::PreparePhysicsTable(const G4ParticleDefinition& part) 333 { 320 334 if(1 < verboseLevel) { 321 335 G4cout << "G4VEnergyLossProcess::PreparePhysicsTable for " 322 336 << GetProcessName() 323 337 << " for " << part.GetParticleName() 324 << " local: " << particle->GetParticleName()325 338 << G4endl; 326 339 } 327 328 G4LossTableManager* lManager = G4LossTableManager::Instance();329 330 if(&part != particle) {331 if(part.GetParticleType() == "nucleus") lManager->RegisterIon(&part, this);332 else lManager->RegisterExtraParticle(&part, this);333 return;334 }335 336 Clear();337 340 338 341 currentCouple = 0; … … 341 344 fRange = DBL_MAX; 342 345 preStepKinEnergy = 0.0; 346 chargeSqRatio = 1.0; 347 massRatio = 1.0; 348 reduceFactor = 1.0; 349 350 G4LossTableManager* lManager = G4LossTableManager::Instance(); 351 352 // Are particle defined? 353 if( !particle ) { 354 particle = ∂ 355 if(part.GetParticleType() == "nucleus") { 356 if(!theGenericIon) theGenericIon = G4GenericIon::GenericIon(); 357 if(particle == theGenericIon) { isIon = true; } 358 else if(part.GetPDGCharge() > eplus) { 359 isIon = true; 360 361 // generic ions created on-fly 362 if(part.GetPDGCharge() > 2.5*eplus) { 363 particle = theGenericIon; 364 } 365 } 366 } 367 } 368 369 if( particle != &part) { 370 if(part.GetParticleType() == "nucleus") { 371 isIon = true; 372 lManager->RegisterIon(&part, this); 373 } else { 374 lManager->RegisterExtraParticle(&part, this); 375 } 376 return; 377 } 378 379 Clean(); 343 380 344 381 // Base particle and set of models can be defined here … … 372 409 G4double initialCharge = particle->GetPDGCharge(); 373 410 G4double initialMass = particle->GetPDGMass(); 374 chargeSquare = initialCharge*initialCharge/(eplus*eplus);375 chargeSqRatio = 1.0;376 massRatio = 1.0;377 reduceFactor = 1.0;378 411 379 412 if (baseParticle) { … … 387 420 minSubRange, verboseLevel); 388 421 389 // Sub Cutoff Regime 390 scProcesses.clear(); 391 nProcesses = 0; 392 393 if (nSCoffRegions>0) { 422 // Sub Cutoff and Deexcitation 423 if (nSCoffRegions>0 || nDERegions>0) { 394 424 theSubCuts = modelManager->SubCutoff(); 395 425 … … 397 427 G4ProductionCutsTable::GetProductionCutsTable(); 398 428 size_t numOfCouples = theCoupleTable->GetTableSize(); 399 idxSCoffRegions = new G4int[numOfCouples]; 429 430 if(nSCoffRegions>0) idxSCoffRegions = new G4bool[numOfCouples]; 431 if(nDERegions>0) idxDERegions = new G4bool[numOfCouples]; 400 432 401 433 for (size_t j=0; j<numOfCouples; j++) { … … 404 436 theCoupleTable->GetMaterialCutsCouple(j); 405 437 const G4ProductionCuts* pcuts = couple->GetProductionCuts(); 406 G4int reg = 0; 407 for(G4int i=0; i<nSCoffRegions; i++) { 408 if( pcuts == scoffRegions[i]->GetProductionCuts()) reg = 1; 409 } 410 idxSCoffRegions[j] = reg; 438 439 if(nSCoffRegions>0) { 440 G4bool reg = false; 441 for(G4int i=0; i<nSCoffRegions; i++) { 442 if( pcuts == scoffRegions[i]->GetProductionCuts()) reg = true; 443 } 444 idxSCoffRegions[j] = reg; 445 } 446 if(nDERegions>0) { 447 G4bool reg = false; 448 for(G4int i=0; i<nDERegions; i++) { 449 if( pcuts == deRegions[i]->GetProductionCuts()) reg = true; 450 } 451 idxDERegions[j] = reg; 452 } 411 453 } 412 454 } … … 416 458 if (1 < verboseLevel) { 417 459 G4cout << "G4VEnergyLossProcess::Initialise() is done " 460 << " for local " << particle->GetParticleName() 461 << " isIon= " << isIon 418 462 << " chargeSqRatio= " << chargeSqRatio 419 463 << " massRatio= " << massRatio … … 426 470 } 427 471 } 472 if (nDERegions) { 473 G4cout << " Deexcitation is ON for regions: " << G4endl; 474 for (G4int i=0; i<nDERegions; i++) { 475 const G4Region* r = deRegions[i]; 476 G4cout << " " << r->GetName() << G4endl; 477 } 478 } 428 479 } 429 480 } … … 442 493 } 443 494 444 if(!tablesAreBuilt && &part == particle) 445 G4LossTableManager::Instance()->BuildPhysicsTable(particle, this); 446 447 if(0 < verboseLevel && (&part == particle) && !baseParticle) { 448 PrintInfoDefinition(); 449 safetyHelper->InitialiseHelper(); 495 if(&part == particle) { 496 if(!tablesAreBuilt) { 497 G4LossTableManager::Instance()->BuildPhysicsTable(particle, this); 498 } 499 if(!baseParticle) { 500 if(0 < verboseLevel) PrintInfoDefinition(); 501 502 // needs to be done only once 503 safetyHelper->InitialiseHelper(); 504 } 450 505 } 451 506 … … 456 511 if(isIonisation) G4cout << " isIonisation flag = 1"; 457 512 G4cout << G4endl; 458 }459 }460 461 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....462 463 void G4VEnergyLossProcess::ActivateSubCutoff(G4bool val, const G4Region* r)464 {465 G4RegionStore* regionStore = G4RegionStore::GetInstance();466 if(val) {467 useSubCutoff = true;468 if (!r) r = regionStore->GetRegion("DefaultRegionForTheWorld", false);469 if (nSCoffRegions) {470 for (G4int i=0; i<nSCoffRegions; i++) {471 if (r == scoffRegions[i]) return;472 }473 }474 scoffRegions.push_back(r);475 nSCoffRegions++;476 } else {477 useSubCutoff = false;478 513 } 479 514 } … … 528 563 for(size_t i=0; i<numOfCouples; i++) { 529 564 530 if(1 < verboseLevel) 565 if(1 < verboseLevel) { 531 566 G4cout << "G4VEnergyLossProcess::BuildDEDXVector flag= " 532 567 << table->GetFlag(i) << G4endl; 533 568 } 534 569 if (table->GetFlag(i)) { 535 570 … … 538 573 theCoupleTable->GetMaterialCutsCouple(i); 539 574 G4PhysicsVector* aVector = new G4PhysicsLogVector(emin, emax, bin); 575 aVector->SetSpline((G4LossTableManager::Instance())->SplineFlag()); 576 540 577 modelManager->FillDEDXVector(aVector, couple, tType); 541 578 … … 580 617 << G4endl; 581 618 } 582 if(!table) return table;619 if(!table) {return table;} 583 620 584 621 // Access to materials … … 615 652 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 616 653 617 G4double G4VEnergyLossProcess::GetContinuousStepLimit( 618 const G4Track&, 619 G4double, G4double, G4double&) 620 { 621 return DBL_MAX; 654 void G4VEnergyLossProcess::PrintInfoDefinition() 655 { 656 if(0 < verboseLevel) { 657 G4cout << G4endl << GetProcessName() << ": for " 658 << particle->GetParticleName() 659 << " SubType= " << GetProcessSubType() 660 << G4endl 661 << " dE/dx and range tables from " 662 << G4BestUnit(minKinEnergy,"Energy") 663 << " to " << G4BestUnit(maxKinEnergy,"Energy") 664 << " in " << nBins << " bins" << G4endl 665 << " Lambda tables from threshold to " 666 << G4BestUnit(maxKinEnergy,"Energy") 667 << " in " << nBins << " bins, spline: " 668 << (G4LossTableManager::Instance())->SplineFlag() 669 << G4endl; 670 if(theRangeTableForLoss && isIonisation) { 671 G4cout << " finalRange(mm)= " << finalRange/mm 672 << ", dRoverRange= " << dRoverRange 673 << ", integral: " << integral 674 << ", fluct: " << lossFluctuationFlag 675 << ", linLossLimit= " << linLossLimit 676 << G4endl; 677 } 678 PrintInfo(); 679 modelManager->DumpModelList(verboseLevel); 680 if(theCSDARangeTable && isIonisation) { 681 G4cout << " CSDA range table up" 682 << " to " << G4BestUnit(maxKinEnergyCSDA,"Energy") 683 << " in " << nBinsCSDA << " bins" << G4endl; 684 } 685 if(nSCoffRegions>0 && isIonisation) { 686 G4cout << " Subcutoff sampling in " << nSCoffRegions 687 << " regions" << G4endl; 688 } 689 if(2 < verboseLevel) { 690 G4cout << " DEDXTable address= " << theDEDXTable << G4endl; 691 if(theDEDXTable && isIonisation) G4cout << (*theDEDXTable) << G4endl; 692 G4cout << "non restricted DEDXTable address= " 693 << theDEDXunRestrictedTable << G4endl; 694 if(theDEDXunRestrictedTable && isIonisation) { 695 G4cout << (*theDEDXunRestrictedTable) << G4endl; 696 } 697 if(theDEDXSubTable && isIonisation) { 698 G4cout << (*theDEDXSubTable) << G4endl; 699 } 700 G4cout << " CSDARangeTable address= " << theCSDARangeTable 701 << G4endl; 702 if(theCSDARangeTable && isIonisation) { 703 G4cout << (*theCSDARangeTable) << G4endl; 704 } 705 G4cout << " RangeTableForLoss address= " << theRangeTableForLoss 706 << G4endl; 707 if(theRangeTableForLoss && isIonisation) { 708 G4cout << (*theRangeTableForLoss) << G4endl; 709 } 710 G4cout << " InverseRangeTable address= " << theInverseRangeTable 711 << G4endl; 712 if(theInverseRangeTable && isIonisation) { 713 G4cout << (*theInverseRangeTable) << G4endl; 714 } 715 G4cout << " LambdaTable address= " << theLambdaTable << G4endl; 716 if(theLambdaTable && isIonisation) { 717 G4cout << (*theLambdaTable) << G4endl; 718 } 719 G4cout << " SubLambdaTable address= " << theSubLambdaTable << G4endl; 720 if(theSubLambdaTable && isIonisation) { 721 G4cout << (*theSubLambdaTable) << G4endl; 722 } 723 } 724 } 725 } 726 727 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 728 729 void G4VEnergyLossProcess::ActivateSubCutoff(G4bool val, const G4Region* r) 730 { 731 G4RegionStore* regionStore = G4RegionStore::GetInstance(); 732 const G4Region* reg = r; 733 if (!reg) {reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);} 734 735 // the region is in the list 736 if (nSCoffRegions) { 737 for (G4int i=0; i<nSCoffRegions; i++) { 738 if (reg == scoffRegions[i]) { 739 if(!val) deRegions[i] = 0; 740 return; 741 } 742 } 743 } 744 745 // new region 746 if(val) { 747 useSubCutoff = true; 748 scoffRegions.push_back(reg); 749 nSCoffRegions++; 750 } else { 751 useSubCutoff = false; 752 } 753 } 754 755 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 756 757 void G4VEnergyLossProcess::ActivateDeexcitation(G4bool val, const G4Region* r) 758 { 759 G4RegionStore* regionStore = G4RegionStore::GetInstance(); 760 const G4Region* reg = r; 761 if (!reg) {reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);} 762 763 // the region is in the list 764 if (nDERegions) { 765 for (G4int i=0; i<nDERegions; i++) { 766 if (reg == deRegions[i]) { 767 if(!val) deRegions[i] = 0; 768 return; 769 } 770 } 771 } 772 773 // new region 774 if(val) { 775 useDeexcitation = true; 776 deRegions.push_back(reg); 777 nDERegions++; 778 } else { 779 useDeexcitation = false; 780 } 622 781 } 623 782 … … 641 800 if(x > finalRange && y < currentMinStep) { 642 801 x = y + finalRange*(1.0 - dRoverRange)*(2.0 - finalRange/fRange); 643 } else if (rndmStepFlag) x = SampleRange();644 // G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy645 // <<" range= "<<fRange <<" cMinSt="<<currentMinStep646 // <<" safety= " << safety<< " limit= " << x <<G4endl;647 } 648 // G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy802 } else if (rndmStepFlag) {x = SampleRange();} 803 //G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy 804 // <<" range= "<<fRange <<" cMinSt="<<currentMinStep 805 // << " limit= " << x <<G4endl; 806 } 807 //G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy 649 808 // <<" stepLimit= "<<x<<G4endl; 650 809 return x; 651 }652 653 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....654 655 G4double G4VEnergyLossProcess::GetMeanFreePath(656 const G4Track& track,657 G4double,658 G4ForceCondition* condition)659 660 {661 *condition = NotForced;662 return MeanFreePath(track);663 810 } 664 811 … … 673 820 *condition = NotForced; 674 821 G4double x = DBL_MAX; 822 823 // initialisation of material, mass, charge, model at the beginning of the step 824 DefineMaterial(track.GetMaterialCutsCouple()); 825 826 const G4ParticleDefinition* currPart = track.GetDefinition(); 827 if(theGenericIon == particle) { 828 massRatio = proton_mass_c2/currPart->GetPDGMass(); 829 } 830 preStepKinEnergy = track.GetKineticEnergy(); 831 preStepScaledEnergy = preStepKinEnergy*massRatio; 832 SelectModel(preStepScaledEnergy); 833 834 if(isIon) { 835 chargeSqRatio = 836 currentModel->GetChargeSquareRatio(currPart,currentMaterial,preStepKinEnergy); 837 reduceFactor = 1.0/(chargeSqRatio*massRatio); 838 } 839 //G4cout << "q2= " << chargeSqRatio << " massRatio= " << massRatio << G4endl; 840 // initialisation for sampling of the interaction length 675 841 if(previousStepSize <= DBL_MIN) theNumberOfInteractionLengthLeft = -1.0; 676 InitialiseStep(track); 677 842 if(theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX; 843 844 // compute mean free path 678 845 if(preStepScaledEnergy < mfpKinEnergy) { 679 846 if (integral) ComputeLambdaForScaledEnergy(preStepScaledEnergy); … … 686 853 if (theNumberOfInteractionLengthLeft < 0.0) { 687 854 // beggining of tracking (or just after DoIt of this process) 855 //G4cout<<"G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength Reset"<<G4endl; 688 856 ResetNumberOfInteractionLengthLeft(); 689 857 } else if(currentInteractionLength < DBL_MAX) { … … 702 870 G4cout << "G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength "; 703 871 G4cout << "[ " << GetProcessName() << "]" << G4endl; 704 G4cout << " for " << particle->GetParticleName()872 G4cout << " for " << currPart->GetParticleName() 705 873 << " in Material " << currentMaterial->GetName() 706 874 << " Ekin(MeV)= " << preStepKinEnergy/MeV … … 710 878 } 711 879 #endif 712 713 880 // zero cross section case 714 881 } else { … … 738 905 if(length <= DBL_MIN) return &fParticleChange; 739 906 G4double eloss = 0.0; 740 741 /* 907 G4double esecdep = 0.0; 908 909 /* 742 910 if(-1 < verboseLevel) { 743 911 const G4ParticleDefinition* d = track.GetDefinition(); … … 755 923 */ 756 924 925 const G4DynamicParticle* dynParticle = track.GetDynamicParticle(); 926 757 927 // stopping 758 928 if (length >= fRange) { 929 eloss = preStepKinEnergy; 930 if (useDeexcitation) { 931 if(idxDERegions[currentMaterialIndex]) { 932 currentModel->SampleDeexcitationAlongStep(currentMaterial, track, eloss); 933 if(eloss < 0.0) eloss = 0.0; 934 } 935 } 759 936 fParticleChange.SetProposedKineticEnergy(0.0); 760 fParticleChange.ProposeLocalEnergyDeposit( preStepKinEnergy);937 fParticleChange.ProposeLocalEnergyDeposit(eloss); 761 938 return &fParticleChange; 762 939 } … … 772 949 GetScaledRangeForScaledEnergy(preStepScaledEnergy) - length/reduceFactor; 773 950 eloss = preStepKinEnergy - ScaledKinEnergyForLoss(x)/massRatio; 951 774 952 /* 775 953 if(-1 < verboseLevel) … … 781 959 << " eloss0(MeV)= " 782 960 << GetDEDXForScaledEnergy(preStepScaledEnergy)*length/MeV 961 << " lim(MeV)= " << preStepKinEnergy*linLossLimit/MeV 783 962 << G4endl; 784 963 */ 785 964 } 786 965 787 const G4DynamicParticle* dynParticle = track.GetDynamicParticle(); 788 G4VEmModel* currentModel = SelectModel(preStepScaledEnergy); 789 /* 966 /* 790 967 G4double eloss0 = eloss; 791 968 if(-1 < verboseLevel ) { … … 801 978 G4double cut = (*theCuts)[currentMaterialIndex]; 802 979 G4double esec = 0.0; 803 G4double esecdep = 0.0;804 980 805 981 // SubCutOff … … 807 983 if(idxSCoffRegions[currentMaterialIndex]) { 808 984 809 G4 double currentMinSafety = 0.0;985 G4bool yes = false; 810 986 G4StepPoint* prePoint = step.GetPreStepPoint(); 811 G4StepPoint* postPoint = step.GetPostStepPoint(); 812 G4double preSafety = prePoint->GetSafety(); 813 G4double postSafety = preSafety - length; 814 G4double rcut = currentCouple->GetProductionCuts()->GetProductionCut(1); 815 816 // recompute safety 817 if(prePoint->GetStepStatus() != fGeomBoundary && 818 postPoint->GetStepStatus() != fGeomBoundary) { 819 820 /* 821 // G4bool yes = (track.GetTrackID() == 5512); 822 G4bool yes = false; 823 if(yes) 824 G4cout << "G4VEnergyLoss: presafety= " << preSafety 825 << " rcut= " << rcut << " length= " << length 826 << " dir " << track.GetMomentumDirection() 827 << G4endl; 828 */ 829 830 if(preSafety < rcut) 987 988 // Check boundary 989 if(prePoint->GetStepStatus() == fGeomBoundary) yes = true; 990 991 // Check PrePoint 992 else { 993 G4double preSafety = prePoint->GetSafety(); 994 G4double rcut = currentCouple->GetProductionCuts()->GetProductionCut(1); 995 996 // recompute presafety 997 if(preSafety < rcut) { 831 998 preSafety = safetyHelper->ComputeSafety(prePoint->GetPosition()); 832 833 //if(yes) { 834 // G4cout << "G4VEnergyLoss: newsafety= " << preSafety << G4endl; 835 // if(preSafety==0.0 && track.GetTrackID() == 5512 ) exit(1); 836 //} 837 if(postSafety < rcut) 838 postSafety = safetyHelper->ComputeSafety(postPoint->GetPosition()); 839 /* 840 if(-1 < verboseLevel) 841 G4cout << "Subcutoff: presafety(mm)= " << preSafety/mm 842 << " postsafety(mm)= " << postSafety/mm 843 << " rcut(mm)= " << rcut/mm 844 << G4endl; 845 */ 846 currentMinSafety = std::min(preSafety,postSafety); 847 } 848 999 } 1000 1001 if(preSafety < rcut) yes = true; 1002 1003 // Check PostPoint 1004 else { 1005 G4double postSafety = preSafety - length; 1006 if(postSafety < rcut) { 1007 postSafety = 1008 safetyHelper->ComputeSafety(step.GetPostStepPoint()->GetPosition()); 1009 if(postSafety < rcut) yes = true; 1010 } 1011 } 1012 } 1013 849 1014 // Decide to start subcut sampling 850 if( currentMinSafety < rcut) {1015 if(yes) { 851 1016 852 1017 cut = (*theSubCuts)[currentMaterialIndex]; … … 856 1021 currentModel,currentMaterialIndex, 857 1022 esecdep); 1023 // add bremsstrahlung sampling 858 1024 /* 859 1025 if(nProcesses > 0) { … … 876 1042 esec += e; 877 1043 pParticleChange->AddSecondary(t); 878 // mom -= t->GetMomentum();879 1044 } 880 // fParticleChange.SetProposedMomentum(mom);881 1045 } 882 1046 } … … 885 1049 886 1050 // Corrections, which cannot be tabulated 887 CorrectionsAlongStep(currentCouple, dynParticle, eloss, length); 1051 currentModel->CorrectionsAlongStep(currentCouple, dynParticle, 1052 eloss, esecdep, length); 888 1053 889 1054 // Sample fluctuations … … 895 1060 G4double tmax = 896 1061 std::min(currentModel->MaxSecondaryKinEnergy(dynParticle),cut); 1062 G4double emean = eloss; 897 1063 eloss = fluc->SampleFluctuations(currentMaterial,dynParticle, 898 tmax,length,e loss);899 /* 1064 tmax,length,emean); 1065 /* 900 1066 if(-1 < verboseLevel) 901 1067 G4cout << "After fluct: eloss(MeV)= " << eloss/MeV 902 1068 << " fluc= " << (eloss-eloss0)/MeV 903 << " currentChargeSquare= " << chargeSquare1069 << " ChargeSqRatio= " << chargeSqRatio 904 1070 << " massRatio= " << massRatio 905 1071 << " tmax= " << tmax … … 911 1077 eloss += esecdep; 912 1078 if(eloss < 0.0) eloss = 0.0; 1079 1080 // deexcitation 1081 else if (useDeexcitation) { 1082 if(idxDERegions[currentMaterialIndex]) { 1083 currentModel->SampleDeexcitationAlongStep(currentMaterial, track, eloss); 1084 if(eloss < 0.0) eloss = 0.0; 1085 } 1086 } 913 1087 914 1088 // Energy balanse … … 917 1091 eloss = preStepKinEnergy - esec; 918 1092 finalT = 0.0; 1093 } else if(isIon) { 1094 fParticleChange.SetProposedCharge( 1095 currentModel->GetParticleCharge(track.GetDefinition(),currentMaterial,finalT)); 919 1096 } 920 1097 … … 922 1099 fParticleChange.ProposeLocalEnergyDeposit(eloss); 923 1100 924 /* 1101 /* 925 1102 if(-1 < verboseLevel) { 926 1103 G4cout << "Final value eloss(MeV)= " << eloss/MeV … … 931 1108 << G4endl; 932 1109 } 933 */ 1110 */ 934 1111 935 1112 return &fParticleChange; … … 943 1120 G4VEmModel* model, 944 1121 G4int idx, 945 G4double& extraEdep)1122 G4double& /*extraEdep*/) 946 1123 { 947 1124 // Fast check weather subcutoff can work … … 952 1129 const G4Track* track = step.GetTrack(); 953 1130 const G4DynamicParticle* dp = track->GetDynamicParticle(); 1131 G4double e = dp->GetKineticEnergy()*massRatio; 954 1132 G4bool b; 955 G4double cross = 956 chargeSqRatio*(((*theSubLambdaTable)[idx])->GetValue(dp->GetKineticEnergy(),b)); 1133 G4double cross = chargeSqRatio*(((*theSubLambdaTable)[idx])->GetValue(e,b)); 957 1134 G4double length = step.GetStepLength(); 958 1135 959 1136 // negligible probability to get any interaction 960 1137 if(length*cross < perMillion) return; 961 /* 1138 /* 962 1139 if(-1 < verboseLevel) 963 1140 G4cout << "<<< Subcutoff for " << GetProcessName() … … 970 1147 // Sample subcutoff secondaries 971 1148 G4StepPoint* preStepPoint = step.GetPreStepPoint(); 1149 G4StepPoint* postStepPoint = step.GetPostStepPoint(); 972 1150 G4ThreeVector prepoint = preStepPoint->GetPosition(); 973 G4ThreeVector dr = step.GetPostStepPoint()->GetPosition() - prepoint;1151 G4ThreeVector dr = postStepPoint->GetPosition() - prepoint; 974 1152 G4double pretime = preStepPoint->GetGlobalTime(); 975 // G4double dt = length/preStepPoint->GetVelocity(); 1153 G4double dt = postStepPoint->GetGlobalTime() - pretime; 1154 //G4double dt = length/preStepPoint->GetVelocity(); 976 1155 G4double fragment = 0.0; 977 1156 … … 992 1171 993 1172 G4bool addSec = true; 1173 /* 994 1174 // do not track very low-energy delta-electrons 995 1175 if(theSecondaryRangeTable && (*it)->GetDefinition() == theElectron) { … … 1004 1184 } 1005 1185 } 1186 */ 1006 1187 if(addSec) { 1007 //G4Track* t = new G4Track((*it), pretime + fragment*dt, r);1008 G4Track* t = new G4Track((*it), pretime, r);1188 G4Track* t = new G4Track((*it), pretime + fragment*dt, r); 1189 //G4Track* t = new G4Track((*it), pretime, r); 1009 1190 t->SetTouchableHandle(track->GetTouchableHandle()); 1010 1191 tracks.push_back(t); 1011 1192 1012 /* 1013 if(-1 < verboseLevel)1014 G4cout << "New track " << p->GetDefinition()->GetParticleName()1015 << " e(keV)= " << p->GetKineticEnergy()/keV1016 << " fragment= " << fragment1017 << G4endl;1193 /* 1194 if(-1 < verboseLevel) 1195 G4cout << "New track " << t->GetDefinition()->GetParticleName() 1196 << " e(keV)= " << t->GetKineticEnergy()/keV 1197 << " fragment= " << fragment 1198 << G4endl; 1018 1199 */ 1019 1200 } … … 1059 1240 } 1060 1241 1061 G4VEmModel* currentModel = SelectModel(postStepScaledEnergy); 1242 SelectModel(postStepScaledEnergy); 1243 if(useDeexcitation) { 1244 currentModel->SetDeexcitationFlag(idxDERegions[currentMaterialIndex]); 1245 } 1246 1062 1247 const G4DynamicParticle* dynParticle = track.GetDynamicParticle(); 1063 1248 G4double tcut = (*theCuts)[currentMaterialIndex]; … … 1094 1279 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1095 1280 1096 void G4VEnergyLossProcess::PrintInfoDefinition() 1097 { 1098 if(0 < verboseLevel) { 1099 G4cout << G4endl << GetProcessName() << ": tables are built for " 1100 << particle->GetParticleName() 1101 << G4endl 1102 << " dE/dx and range tables from " 1103 << G4BestUnit(minKinEnergy,"Energy") 1104 << " to " << G4BestUnit(maxKinEnergy,"Energy") 1105 << " in " << nBins << " bins." << G4endl 1106 << " Lambda tables from threshold to " 1107 << G4BestUnit(maxKinEnergy,"Energy") 1108 << " in " << nBins << " bins." 1281 G4bool G4VEnergyLossProcess::StorePhysicsTable( 1282 const G4ParticleDefinition* part, const G4String& directory, 1283 G4bool ascii) 1284 { 1285 G4bool res = true; 1286 if ( baseParticle || part != particle ) return res; 1287 1288 if(!StoreTable(part,theDEDXTable,ascii,directory,"DEDX")) 1289 {res = false;} 1290 1291 if(!StoreTable(part,theDEDXunRestrictedTable,ascii,directory,"DEDXnr")) 1292 {res = false;} 1293 1294 if(!StoreTable(part,theDEDXSubTable,ascii,directory,"SubDEDX")) 1295 {res = false;} 1296 1297 if(!StoreTable(part,theIonisationTable,ascii,directory,"Ionisation")) 1298 {res = false;} 1299 1300 if(!StoreTable(part,theIonisationSubTable,ascii,directory,"SubIonisation")) 1301 {res = false;} 1302 1303 if(isIonisation && 1304 !StoreTable(part,theCSDARangeTable,ascii,directory,"CSDARange")) 1305 {res = false;} 1306 1307 if(isIonisation && 1308 !StoreTable(part,theRangeTableForLoss,ascii,directory,"Range")) 1309 {res = false;} 1310 1311 if(isIonisation && 1312 !StoreTable(part,theInverseRangeTable,ascii,directory,"InverseRange")) 1313 {res = false;} 1314 1315 if(!StoreTable(part,theLambdaTable,ascii,directory,"Lambda")) 1316 {res = false;} 1317 1318 if(!StoreTable(part,theSubLambdaTable,ascii,directory,"SubLambda")) 1319 {res = false;} 1320 1321 if ( res ) { 1322 if(0 < verboseLevel) { 1323 G4cout << "Physics tables are stored for " << particle->GetParticleName() 1324 << " and process " << GetProcessName() 1325 << " in the directory <" << directory 1326 << "> " << G4endl; 1327 } 1328 } else { 1329 G4cout << "Fail to store Physics Tables for " 1330 << particle->GetParticleName() 1331 << " and process " << GetProcessName() 1332 << " in the directory <" << directory 1333 << "> " << G4endl; 1334 } 1335 return res; 1336 } 1337 1338 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 1339 1340 G4bool G4VEnergyLossProcess::RetrievePhysicsTable( 1341 const G4ParticleDefinition* part, const G4String& directory, 1342 G4bool ascii) 1343 { 1344 G4bool res = true; 1345 const G4String particleName = part->GetParticleName(); 1346 1347 if(1 < verboseLevel) { 1348 G4cout << "G4VEnergyLossProcess::RetrievePhysicsTable() for " 1349 << particleName << " and process " << GetProcessName() 1350 << "; tables_are_built= " << tablesAreBuilt 1109 1351 << G4endl; 1110 PrintInfo(); 1111 if(theRangeTableForLoss && isIonisation) 1112 G4cout << " Step function: finalRange(mm)= " << finalRange/mm 1113 << ", dRoverRange= " << dRoverRange 1114 << ", integral: " << integral 1115 << ", fluct: " << lossFluctuationFlag 1116 << G4endl; 1117 1118 if(theCSDARangeTable && isIonisation) 1119 G4cout << " CSDA range table up" 1120 << " to " << G4BestUnit(maxKinEnergyCSDA,"Energy") 1121 << " in " << nBinsCSDA << " bins." << G4endl; 1122 1123 if(nSCoffRegions>0) 1124 G4cout << " Subcutoff sampling in " << nSCoffRegions 1125 << " regions" << G4endl; 1126 1127 if(2 < verboseLevel) { 1128 G4cout << "DEDXTable address= " << theDEDXTable << G4endl; 1129 if(theDEDXTable && isIonisation) G4cout << (*theDEDXTable) << G4endl; 1130 G4cout << "non restricted DEDXTable address= " 1131 << theDEDXunRestrictedTable << G4endl; 1132 if(theDEDXunRestrictedTable && isIonisation) 1133 G4cout << (*theDEDXunRestrictedTable) << G4endl; 1134 if(theDEDXSubTable && isIonisation) G4cout << (*theDEDXSubTable) 1135 << G4endl; 1136 G4cout << "CSDARangeTable address= " << theCSDARangeTable 1352 } 1353 if(particle == part) { 1354 1355 // G4bool yes = true; 1356 if ( !baseParticle ) { 1357 1358 G4bool fpi = true; 1359 if(!RetrieveTable(part,theDEDXTable,ascii,directory,"DEDX",fpi)) 1360 {fpi = false;} 1361 1362 if(!RetrieveTable(part,theIonisationTable,ascii,directory,"Ionisation",false)) 1363 {fpi = false;} 1364 1365 if(!RetrieveTable(part,theRangeTableForLoss,ascii,directory,"Range",fpi)) 1366 {res = false;} 1367 1368 if(!RetrieveTable(part,theDEDXunRestrictedTable,ascii,directory,"DEDXnr",false)) 1369 {res = false;} 1370 1371 if(!RetrieveTable(part,theCSDARangeTable,ascii,directory,"CSDARange",false)) 1372 {res = false;} 1373 1374 if(!RetrieveTable(part,theInverseRangeTable,ascii,directory,"InverseRange",fpi)) 1375 {res = false;} 1376 1377 if(!RetrieveTable(part,theLambdaTable,ascii,directory,"Lambda",true)) 1378 {res = false;} 1379 1380 G4bool yes = false; 1381 if(nSCoffRegions > 0) {yes = true;} 1382 1383 if(!RetrieveTable(part,theDEDXSubTable,ascii,directory,"SubDEDX",yes)) 1384 {res = false;} 1385 1386 if(!RetrieveTable(part,theSubLambdaTable,ascii,directory,"SubLambda",yes)) 1387 {res = false;} 1388 1389 if(!fpi) yes = false; 1390 if(!RetrieveTable(part,theIonisationSubTable,ascii,directory,"SubIonisation",yes)) 1391 {res = false;} 1392 } 1393 } 1394 1395 return res; 1396 } 1397 1398 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 1399 1400 G4bool G4VEnergyLossProcess::StoreTable(const G4ParticleDefinition* part, 1401 G4PhysicsTable* aTable, G4bool ascii, 1402 const G4String& directory, 1403 const G4String& tname) 1404 { 1405 G4bool res = true; 1406 if ( aTable ) { 1407 const G4String name = GetPhysicsTableFileName(part,directory,tname,ascii); 1408 if( !aTable->StorePhysicsTable(name,ascii)) res = false; 1409 } 1410 return res; 1411 } 1412 1413 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 1414 1415 G4bool G4VEnergyLossProcess::RetrieveTable(const G4ParticleDefinition* part, 1416 G4PhysicsTable* aTable, G4bool ascii, 1417 const G4String& directory, 1418 const G4String& tname, 1419 G4bool mandatory) 1420 { 1421 G4bool res = true; 1422 G4String filename = GetPhysicsTableFileName(part,directory,tname,ascii); 1423 G4bool yes = aTable->ExistPhysicsTable(filename); 1424 if(yes) { 1425 yes = G4PhysicsTableHelper::RetrievePhysicsTable(aTable,filename,ascii); 1426 if((G4LossTableManager::Instance())->SplineFlag()) { 1427 size_t n = aTable->length(); 1428 for(size_t i=0; i<n; i++) {(*aTable)[i]->SetSpline(true);} 1429 } 1430 } 1431 if(yes) { 1432 if (0 < verboseLevel) { 1433 G4cout << tname << " table for " << part->GetParticleName() 1434 << " is Retrieved from <" << filename << ">" 1137 1435 << G4endl; 1138 if(theCSDARangeTable && isIonisation) G4cout << (*theCSDARangeTable) 1139 << G4endl; 1140 G4cout << "RangeTableForLoss address= " << theRangeTableForLoss 1436 } 1437 } else { 1438 if(mandatory) res = false; 1439 if(mandatory || 1 < verboseLevel) { 1440 G4cout << tname << " table for " << part->GetParticleName() 1441 << " from file <" 1442 << filename << "> is not Retrieved" 1141 1443 << G4endl; 1142 if(theRangeTableForLoss && isIonisation) 1143 G4cout << (*theRangeTableForLoss) << G4endl; 1144 G4cout << "InverseRangeTable address= " << theInverseRangeTable 1145 << G4endl; 1146 if(theInverseRangeTable && isIonisation) 1147 G4cout << (*theInverseRangeTable) << G4endl; 1148 G4cout << "LambdaTable address= " << theLambdaTable << G4endl; 1149 if(theLambdaTable && isIonisation) G4cout << (*theLambdaTable) << G4endl; 1150 G4cout << "SubLambdaTable address= " << theSubLambdaTable << G4endl; 1151 if(theSubLambdaTable && isIonisation) G4cout << (*theSubLambdaTable) 1152 << G4endl; 1444 } 1445 } 1446 return res; 1447 } 1448 1449 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1450 1451 G4double G4VEnergyLossProcess::GetDEDXDispersion( 1452 const G4MaterialCutsCouple *couple, 1453 const G4DynamicParticle* dp, 1454 G4double length) 1455 { 1456 DefineMaterial(couple); 1457 G4double ekin = dp->GetKineticEnergy(); 1458 SelectModel(ekin*massRatio); 1459 G4double tmax = currentModel->MaxSecondaryKinEnergy(dp); 1460 tmax = std::min(tmax,(*theCuts)[currentMaterialIndex]); 1461 G4double d = 0.0; 1462 G4VEmFluctuationModel* fm = currentModel->GetModelOfFluctuations(); 1463 if(fm) d = fm->Dispersion(currentMaterial,dp,tmax,length); 1464 return d; 1465 } 1466 1467 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1468 1469 G4double G4VEnergyLossProcess::CrossSectionPerVolume( 1470 G4double kineticEnergy, const G4MaterialCutsCouple* couple) 1471 { 1472 // Cross section per volume is calculated 1473 DefineMaterial(couple); 1474 G4double cross = 0.0; 1475 G4bool b; 1476 if(theLambdaTable) { 1477 cross = 1478 ((*theLambdaTable)[currentMaterialIndex])->GetValue(kineticEnergy, b); 1479 } else { 1480 SelectModel(kineticEnergy); 1481 cross = 1482 currentModel->CrossSectionPerVolume(currentMaterial, 1483 particle, kineticEnergy, 1484 (*theCuts)[currentMaterialIndex]); 1485 } 1486 1487 return cross; 1488 } 1489 1490 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1491 1492 G4double G4VEnergyLossProcess::MeanFreePath(const G4Track& track) 1493 { 1494 DefineMaterial(track.GetMaterialCutsCouple()); 1495 preStepLambda = GetLambdaForScaledEnergy(track.GetKineticEnergy()*massRatio); 1496 G4double x = DBL_MAX; 1497 if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda; 1498 return x; 1499 } 1500 1501 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1502 1503 G4double G4VEnergyLossProcess::ContinuousStepLimit(const G4Track& track, 1504 G4double x, G4double y, 1505 G4double& z) 1506 { 1507 G4GPILSelection sel; 1508 return AlongStepGetPhysicalInteractionLength(track, x, y, z, &sel); 1509 } 1510 1511 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1512 1513 G4double G4VEnergyLossProcess::GetMeanFreePath( 1514 const G4Track& track, 1515 G4double, 1516 G4ForceCondition* condition) 1517 1518 { 1519 *condition = NotForced; 1520 return MeanFreePath(track); 1521 } 1522 1523 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1524 1525 G4double G4VEnergyLossProcess::GetContinuousStepLimit( 1526 const G4Track&, 1527 G4double, G4double, G4double&) 1528 { 1529 return DBL_MAX; 1530 } 1531 1532 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1533 1534 G4PhysicsVector* G4VEnergyLossProcess::LambdaPhysicsVector( 1535 const G4MaterialCutsCouple* couple, G4double cut) 1536 { 1537 // G4double cut = (*theCuts)[couple->GetIndex()]; 1538 // G4int nbins = nLambdaBins; 1539 G4double tmin = 1540 std::max(MinPrimaryEnergy(particle, couple->GetMaterial(), cut), 1541 minKinEnergy); 1542 if(tmin >= maxKinEnergy) tmin = 0.5*maxKinEnergy; 1543 G4PhysicsVector* v = new G4PhysicsLogVector(tmin, maxKinEnergy, nBins); 1544 v->SetSpline((G4LossTableManager::Instance())->SplineFlag()); 1545 1546 return v; 1547 } 1548 1549 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1550 1551 void G4VEnergyLossProcess::AddCollaborativeProcess( 1552 G4VEnergyLossProcess* p) 1553 { 1554 G4bool add = true; 1555 if(p->GetProcessName() != "eBrem") add = false; 1556 if(add && nProcesses > 0) { 1557 for(G4int i=0; i<nProcesses; i++) { 1558 if(p == scProcesses[i]) { 1559 add = false; 1560 break; 1561 } 1562 } 1563 } 1564 if(add) { 1565 scProcesses.push_back(p); 1566 nProcesses++; 1567 if (1 < verboseLevel) { 1568 G4cout << "### The process " << p->GetProcessName() 1569 << " is added to the list of collaborative processes of " 1570 << GetProcessName() << G4endl; 1153 1571 } 1154 1572 } … … 1182 1600 } else if(fSubRestricted == tType) { 1183 1601 theDEDXSubTable = p; 1184 } else if(fI onisation == tType && theIonisationTable != p) {1602 } else if(fIsIonisation == tType && theIonisationTable != p) { 1185 1603 if(theIonisationTable) theIonisationTable->clearAndDestroy(); 1186 1604 theIonisationTable = p; 1187 } else if(f SubIonisation == tType && theIonisationSubTable != p) {1605 } else if(fIsSubIonisation == tType && theIonisationSubTable != p) { 1188 1606 if(theIonisationSubTable) theIonisationSubTable->clearAndDestroy(); 1189 1607 theIonisationSubTable = p; … … 1319 1737 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1320 1738 1321 G4PhysicsVector* G4VEnergyLossProcess::LambdaPhysicsVector(1322 const G4MaterialCutsCouple* couple, G4double cut)1323 {1324 // G4double cut = (*theCuts)[couple->GetIndex()];1325 // G4int nbins = nLambdaBins;1326 G4double tmin =1327 std::max(MinPrimaryEnergy(particle, couple->GetMaterial(), cut),1328 minKinEnergy);1329 if(tmin >= maxKinEnergy) tmin = 0.5*maxKinEnergy;1330 G4PhysicsVector* v = new G4PhysicsLogVector(tmin, maxKinEnergy, nBins);1331 return v;1332 }1333 1334 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1335 1336 G4double G4VEnergyLossProcess::MicroscopicCrossSection(1337 G4double kineticEnergy, const G4MaterialCutsCouple* couple)1338 {1339 // Cross section per atom is calculated1340 DefineMaterial(couple);1341 G4double cross = 0.0;1342 G4bool b;1343 if(theLambdaTable)1344 cross =1345 ((*theLambdaTable)[currentMaterialIndex])->GetValue(kineticEnergy, b)/1346 currentMaterial->GetTotNbOfAtomsPerVolume();1347 1348 return cross;1349 }1350 1351 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1352 1353 G4bool G4VEnergyLossProcess::StorePhysicsTable(1354 const G4ParticleDefinition* part, const G4String& directory,1355 G4bool ascii)1356 {1357 G4bool res = true;1358 if ( baseParticle || part != particle ) return res;1359 1360 if ( theDEDXTable ) {1361 const G4String name = GetPhysicsTableFileName(part,directory,"DEDX",ascii);1362 if( !theDEDXTable->StorePhysicsTable(name,ascii)) res = false;1363 }1364 1365 if ( theDEDXunRestrictedTable ) {1366 const G4String name =1367 GetPhysicsTableFileName(part,directory,"DEDXnr",ascii);1368 if( !theDEDXTable->StorePhysicsTable(name,ascii)) res = false;1369 }1370 1371 if ( theDEDXSubTable ) {1372 const G4String name =1373 GetPhysicsTableFileName(part,directory,"SubDEDX",ascii);1374 if( !theDEDXSubTable->StorePhysicsTable(name,ascii)) res = false;1375 }1376 1377 if ( theIonisationTable ) {1378 const G4String name =1379 GetPhysicsTableFileName(part,directory,"Ionisation",ascii);1380 if( !theIonisationTable->StorePhysicsTable(name,ascii)) res = false;1381 }1382 1383 if ( theIonisationSubTable ) {1384 const G4String name =1385 GetPhysicsTableFileName(part,directory,"SubIonisation",ascii);1386 if( !theIonisationSubTable->StorePhysicsTable(name,ascii)) res = false;1387 }1388 1389 if ( theCSDARangeTable && isIonisation ) {1390 const G4String name =1391 GetPhysicsTableFileName(part,directory,"CSDARange",ascii);1392 if( !theCSDARangeTable->StorePhysicsTable(name,ascii)) res = false;1393 }1394 1395 if ( theRangeTableForLoss && isIonisation ) {1396 const G4String name =1397 GetPhysicsTableFileName(part,directory,"Range",ascii);1398 if( !theRangeTableForLoss->StorePhysicsTable(name,ascii)) res = false;1399 }1400 1401 if ( theInverseRangeTable && isIonisation ) {1402 const G4String name =1403 GetPhysicsTableFileName(part,directory,"InverseRange",ascii);1404 if( !theInverseRangeTable->StorePhysicsTable(name,ascii)) res = false;1405 }1406 1407 if ( theLambdaTable && isIonisation) {1408 const G4String name =1409 GetPhysicsTableFileName(part,directory,"Lambda",ascii);1410 if( !theLambdaTable->StorePhysicsTable(name,ascii)) res = false;1411 }1412 1413 if ( theSubLambdaTable && isIonisation) {1414 const G4String name =1415 GetPhysicsTableFileName(part,directory,"SubLambda",ascii);1416 if( !theSubLambdaTable->StorePhysicsTable(name,ascii)) res = false;1417 }1418 if ( res ) {1419 if(0 < verboseLevel) {1420 G4cout << "Physics tables are stored for " << particle->GetParticleName()1421 << " and process " << GetProcessName()1422 << " in the directory <" << directory1423 << "> " << G4endl;1424 }1425 } else {1426 G4cout << "Fail to store Physics Tables for "1427 << particle->GetParticleName()1428 << " and process " << GetProcessName()1429 << " in the directory <" << directory1430 << "> " << G4endl;1431 }1432 return res;1433 }1434 1435 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....1436 1437 G4bool G4VEnergyLossProcess::RetrievePhysicsTable(1438 const G4ParticleDefinition* part, const G4String& directory,1439 G4bool ascii)1440 {1441 G4bool res = true;1442 const G4String particleName = part->GetParticleName();1443 1444 if(1 < verboseLevel) {1445 G4cout << "G4VEnergyLossProcess::RetrievePhysicsTable() for "1446 << particleName << " and process " << GetProcessName()1447 << "; tables_are_built= " << tablesAreBuilt1448 << G4endl;1449 }1450 if(particle == part) {1451 1452 G4bool yes = true;1453 G4bool fpi = true;1454 if ( !baseParticle ) {1455 G4String filename;1456 1457 filename = GetPhysicsTableFileName(part,directory,"DEDX",ascii);1458 yes = theDEDXTable->ExistPhysicsTable(filename);1459 if(yes) yes = G4PhysicsTableHelper::RetrievePhysicsTable(1460 theDEDXTable,filename,ascii);1461 if(yes) {1462 if (0 < verboseLevel) {1463 G4cout << "DEDX table for " << particleName1464 << " is Retrieved from <"1465 << filename << ">"1466 << G4endl;1467 }1468 } else {1469 fpi = false;1470 if (1 < verboseLevel) {1471 G4cout << "DEDX table for " << particleName << " from file <"1472 << filename << "> is not Retrieved"1473 << G4endl;1474 }1475 }1476 1477 filename = GetPhysicsTableFileName(part,directory,"Range",ascii);1478 yes = theRangeTableForLoss->ExistPhysicsTable(filename);1479 if(yes) yes = G4PhysicsTableHelper::RetrievePhysicsTable(1480 theRangeTableForLoss,filename,ascii);1481 if(yes) {1482 if (0 < verboseLevel) {1483 G4cout << "Range table for loss for " << particleName1484 << " is Retrieved from <"1485 << filename << ">"1486 << G4endl;1487 }1488 } else {1489 if(fpi) {1490 res = false;1491 G4cout << "Range table for loss for " << particleName1492 << " from file <"1493 << filename << "> is not Retrieved"1494 << G4endl;1495 }1496 }1497 1498 filename = GetPhysicsTableFileName(part,directory,"DEDXnr",ascii);1499 yes = theDEDXunRestrictedTable->ExistPhysicsTable(filename);1500 if(yes) yes = G4PhysicsTableHelper::RetrievePhysicsTable(1501 theDEDXunRestrictedTable,filename,ascii);1502 if(yes) {1503 if (0 < verboseLevel) {1504 G4cout << "Non-restricted DEDX table for " << particleName1505 << " is Retrieved from <"1506 << filename << ">"1507 << G4endl;1508 }1509 } else {1510 if (1 < verboseLevel) {1511 G4cout << "Non-restricted DEDX table for " << particleName1512 << " from file <"1513 << filename << "> is not Retrieved"1514 << G4endl;1515 }1516 }1517 1518 filename = GetPhysicsTableFileName(part,directory,"CSDARange",ascii);1519 yes = theCSDARangeTable->ExistPhysicsTable(filename);1520 if(yes) yes = G4PhysicsTableHelper::RetrievePhysicsTable(1521 theCSDARangeTable,filename,ascii);1522 if(yes) {1523 if (0 < verboseLevel) {1524 G4cout << "CSDA Range table for " << particleName1525 << " is Retrieved from <"1526 << filename << ">"1527 << G4endl;1528 }1529 } else {1530 G4cout << "CSDA Range table for loss for " << particleName1531 << " does not exist"1532 << G4endl;1533 }1534 1535 filename = GetPhysicsTableFileName(part,directory,"InverseRange",ascii);1536 yes = theInverseRangeTable->ExistPhysicsTable(filename);1537 if(yes) yes = G4PhysicsTableHelper::RetrievePhysicsTable(1538 theInverseRangeTable,filename,ascii);1539 if(yes) {1540 if (0 < verboseLevel) {1541 G4cout << "InverseRange table for " << particleName1542 << " is Retrieved from <"1543 << filename << ">"1544 << G4endl;1545 }1546 } else {1547 if(fpi) {1548 res = false;1549 G4cout << "InverseRange table for " << particleName1550 << " from file <"1551 << filename << "> is not Retrieved"1552 << G4endl;1553 1554 }1555 }1556 1557 filename = GetPhysicsTableFileName(part,directory,"Lambda",ascii);1558 yes = theLambdaTable->ExistPhysicsTable(filename);1559 if(yes) yes = G4PhysicsTableHelper::RetrievePhysicsTable(1560 theLambdaTable,filename,ascii);1561 if(yes) {1562 if (0 < verboseLevel) {1563 G4cout << "Lambda table for " << particleName1564 << " is Retrieved from <"1565 << filename << ">"1566 << G4endl;1567 }1568 } else {1569 if(fpi) {1570 res = false;1571 G4cout << "Lambda table for " << particleName << " from file <"1572 << filename << "> is not Retrieved"1573 << G4endl;1574 }1575 }1576 1577 filename = GetPhysicsTableFileName(part,directory,"SubDEDX",ascii);1578 yes = theDEDXSubTable->ExistPhysicsTable(filename);1579 if(yes) yes = G4PhysicsTableHelper::RetrievePhysicsTable(1580 theDEDXSubTable,filename,ascii);1581 if(yes) {1582 if (0 < verboseLevel) {1583 G4cout << "SubDEDX table for " << particleName1584 << " is Retrieved from <"1585 << filename << ">"1586 << G4endl;1587 }1588 } else {1589 if(nSCoffRegions) {1590 res=false;1591 G4cout << "SubDEDX table for " << particleName << " from file <"1592 << filename << "> is not Retrieved"1593 << G4endl;1594 }1595 }1596 1597 filename = GetPhysicsTableFileName(part,directory,"SubLambda",ascii);1598 yes = theSubLambdaTable->ExistPhysicsTable(filename);1599 if(yes) yes = G4PhysicsTableHelper::RetrievePhysicsTable(1600 theSubLambdaTable,filename,ascii);1601 if(yes) {1602 if (0 < verboseLevel) {1603 G4cout << "SubLambda table for " << particleName1604 << " is Retrieved from <"1605 << filename << ">"1606 << G4endl;1607 }1608 } else {1609 if(nSCoffRegions) {1610 res=false;1611 G4cout << "SubLambda table for " << particleName << " from file <"1612 << filename << "> is not Retrieved"1613 << G4endl;1614 }1615 }1616 1617 filename = GetPhysicsTableFileName(part,directory,"Ionisation",ascii);1618 yes = theIonisationTable->ExistPhysicsTable(filename);1619 if(yes) {1620 theIonisationTable =1621 G4PhysicsTableHelper::PreparePhysicsTable(theIonisationTable);1622 1623 yes = G4PhysicsTableHelper::RetrievePhysicsTable(1624 theIonisationTable,filename,ascii);1625 }1626 if(yes) {1627 if (0 < verboseLevel) {1628 G4cout << "Ionisation table for " << particleName1629 << " is Retrieved from <"1630 << filename << ">"1631 << G4endl;1632 }1633 }1634 1635 filename = GetPhysicsTableFileName(part,directory,"SubIonisation",ascii);1636 yes = theIonisationSubTable->ExistPhysicsTable(filename);1637 if(yes) {1638 theIonisationSubTable =1639 G4PhysicsTableHelper::PreparePhysicsTable(theIonisationSubTable);1640 yes = G4PhysicsTableHelper::RetrievePhysicsTable(1641 theIonisationSubTable,filename,ascii);1642 }1643 if(yes) {1644 if (0 < verboseLevel) {1645 G4cout << "SubIonisation table for " << particleName1646 << " is Retrieved from <"1647 << filename << ">"1648 << G4endl;1649 }1650 }1651 }1652 }1653 1654 return res;1655 }1656 1657 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1658 1659 void G4VEnergyLossProcess::AddCollaborativeProcess(1660 G4VEnergyLossProcess* p)1661 {1662 G4bool add = true;1663 if(nProcesses > 0) {1664 for(G4int i=0; i<nProcesses; i++) {1665 if(p == scProcesses[i]) {1666 add = false;1667 break;1668 }1669 }1670 }1671 if(add) {1672 scProcesses.push_back(p);1673 nProcesses++;1674 if (0 < verboseLevel)1675 G4cout << "### The process " << p->GetProcessName()1676 << " is added to the list of collaborative processes of "1677 << GetProcessName() << G4endl;1678 }1679 }1680 1681 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1682 1683 G4double G4VEnergyLossProcess::GetDEDXDispersion(1684 const G4MaterialCutsCouple *couple,1685 const G4DynamicParticle* dp,1686 G4double length)1687 {1688 DefineMaterial(couple);1689 G4double ekin = dp->GetKineticEnergy();1690 G4VEmModel* currentModel = SelectModel(ekin*massRatio);1691 G4double tmax = currentModel->MaxSecondaryKinEnergy(dp);1692 tmax = std::min(tmax,(*theCuts)[currentMaterialIndex]);1693 G4double d = 0.0;1694 G4VEmFluctuationModel* fm = currentModel->GetModelOfFluctuations();1695 if(fm) d = fm->Dispersion(currentMaterial,dp,tmax,length);1696 return d;1697 }1698 1699 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1700 1701 void G4VEnergyLossProcess::ActivateDeexcitation(G4bool, const G4Region*)1702 {}1703 1704 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1705 -
trunk/source/processes/electromagnetic/utils/src/G4VMultipleScattering.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VMultipleScattering.cc,v 1. 47 2007/11/09 11:35:54vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4VMultipleScattering.cc,v 1.60 2008/11/20 20:32:40 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 55 55 // 12-04-07 Add verbosity at destruction (V.Ivanchenko) 56 56 // 27-10-07 Virtual functions moved to source (V.Ivanchenko) 57 // 11-03-08 Set skin value does not effect step limit type (V.Ivanchenko) 57 58 // 58 59 // Class Description: … … 85 86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 86 87 87 G4VMultipleScattering::G4VMultipleScattering(const G4String& name, G4ProcessType type): 88 G4VContinuousDiscreteProcess(name, type), 88 G4VMultipleScattering::G4VMultipleScattering(const G4String& name, 89 G4ProcessType type): 90 G4VContinuousDiscreteProcess(name, type), 91 buildLambdaTable(true), 89 92 theLambdaTable(0), 90 93 firstParticle(0), 91 currentParticle(0),92 currentCouple(0),93 nBins(120),94 94 stepLimit(fUseSafety), 95 skin( 0.0),95 skin(3.0), 96 96 facrange(0.02), 97 97 facgeom(2.5), 98 98 latDisplasment(true), 99 buildLambdaTable(true) 100 { 99 currentParticle(0), 100 currentCouple(0) 101 { 102 SetVerboseLevel(1); 103 SetProcessSubType(fMultipleScattering); 104 105 // Size of tables assuming spline 101 106 minKinEnergy = 0.1*keV; 102 107 maxKinEnergy = 100.0*TeV; 103 SetVerboseLevel(1); 108 nBins = 84; 109 110 // default limit on polar angle 111 polarAngleLimit = 0.0; 104 112 105 113 pParticleChange = &fParticleChange; … … 114 122 G4VMultipleScattering::~G4VMultipleScattering() 115 123 { 116 if(1 < verboseLevel) 124 if(1 < verboseLevel) { 117 125 G4cout << "G4VMultipleScattering destruct " << GetProcessName() 118 126 << G4endl; 127 } 119 128 delete modelManager; 120 129 if (theLambdaTable) { … … 131 140 G4String num = part.GetParticleName(); 132 141 if(1 < verboseLevel) { 133 // G4cout << "========================================================" << G4endl;134 142 G4cout << "### G4VMultipleScattering::BuildPhysicsTable() for " 135 143 << GetProcessName() … … 148 156 if (theLambdaTable->GetFlag(i)) { 149 157 // create physics vector and fill it 150 const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i); 158 const G4MaterialCutsCouple* couple = 159 theCoupleTable->GetMaterialCutsCouple(i); 151 160 G4PhysicsVector* aVector = PhysicsVector(couple); 152 161 modelManager->FillLambdaVector(aVector, couple, false); … … 162 171 } 163 172 if(verboseLevel>0 && ( num == "e-" || num == "mu+" || 164 num == "proton" || num == "pi-" || num == "GenericIon")) { 173 num == "proton" || num == "pi-" || 174 num == "GenericIon")) { 165 175 PrintInfoDefinition(); 166 176 if(2 < verboseLevel && theLambdaTable) G4cout << *theLambdaTable << G4endl; … … 182 192 currentCouple = 0; 183 193 if(part.GetParticleType() == "nucleus" && 184 part.GetParticleSubType() == "generic") 185 firstParticle = G4GenericIon::GenericIon(); 186 else firstParticle = ∂ 194 part.GetParticleSubType() == "generic") { 195 firstParticle = G4GenericIon::GenericIon(); 196 } else { 197 firstParticle = ∂ 198 } 199 187 200 currentParticle = ∂ 188 201 } 189 202 190 203 if(1 < verboseLevel) { 191 // G4cout << "========================================================" << G4endl;192 204 G4cout << "### G4VMultipleScattering::PrepearPhysicsTable() for " 193 205 << GetProcessName() … … 217 229 { 218 230 if (0 < verboseLevel) { 219 G4cout << G4endl << GetProcessName() << ": Model variant of multiple scattering " 220 << "for " << firstParticle->GetParticleName() 231 G4cout << G4endl << GetProcessName() 232 << ": for " << firstParticle->GetParticleName() 233 << " SubType= " << GetProcessSubType() 221 234 << G4endl; 222 235 if (theLambdaTable) { … … 225 238 << " to " 226 239 << G4BestUnit(MaxKinEnergy(),"Energy") 227 << " in " << nBins << " bins." 240 << " in " << nBins << " bins, spline: " 241 << (G4LossTableManager::Instance())->SplineFlag() 228 242 << G4endl; 229 243 } 230 G4cout << " LateralDisplacementFlag= " << latDisplasment231 << " Skin= " << skin << G4endl;232 244 PrintInfo(); 245 modelManager->DumpModelList(verboseLevel); 233 246 if (2 < verboseLevel) { 234 247 G4cout << "LambdaTable address= " << theLambdaTable << G4endl; … … 242 255 G4double G4VMultipleScattering::AlongStepGetPhysicalInteractionLength( 243 256 const G4Track& track, 244 G4double previousStepSize,257 G4double, 245 258 G4double currentMinimalStep, 246 259 G4double& currentSafety, … … 249 262 // get Step limit proposed by the process 250 263 valueGPILSelectionMSC = NotCandidateForSelection; 251 G4double steplength = GetMscContinuousStepLimit(track,previousStepSize, 252 currentMinimalStep,currentSafety); 264 G4double steplength = GetMscContinuousStepLimit(track, 265 track.GetKineticEnergy(), 266 currentMinimalStep, 267 currentSafety); 253 268 // G4cout << "StepLimit= " << steplength << G4endl; 254 269 // set return value for G4GPILSelection … … 315 330 if( couple->IsUsed() ) nbins = nBins; 316 331 G4PhysicsVector* v = new G4PhysicsLogVector(minKinEnergy, maxKinEnergy, nbins); 332 v->SetSpline((G4LossTableManager::Instance())->SplineFlag()); 317 333 return v; 318 334 } … … 372 388 << G4endl; 373 389 } 390 if((G4LossTableManager::Instance())->SplineFlag()) { 391 size_t n = theLambdaTable->length(); 392 for(size_t i=0; i<n; i++) {(* theLambdaTable)[i]->SetSpline(true);} 393 } 374 394 } else { 375 395 if (1 < verboseLevel) { -
trunk/source/processes/electromagnetic/utils/src/G4ionEffectiveCharge.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ionEffectiveCharge.cc,v 1. 17.2.1 2008/04/22 15:28:13 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4ionEffectiveCharge.cc,v 1.24 2008/12/18 13:01:46 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 54 54 #include "G4ionEffectiveCharge.hh" 55 55 #include "G4UnitsTable.hh" 56 #include "G4ParticleDefinition.hh"57 56 #include "G4Material.hh" 57 #include "G4NistManager.hh" 58 58 59 59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 62 62 { 63 63 chargeCorrection = 1.0; 64 energyHighLimit = 10.0*MeV;64 energyHighLimit = 20.0*MeV; 65 65 energyLowLimit = 1.0*keV; 66 66 energyBohr = 25.*keV; 67 67 massFactor = amu_c2/(proton_mass_c2*keV); 68 minCharge = 0.1; 68 minCharge = 1.0; 69 lastPart = 0; 70 lastMat = 0; 71 lastKinEnergy = 0.0; 72 effCharge = eplus; 73 nist = G4NistManager::Instance(); 69 74 } 70 75 … … 78 83 G4double G4ionEffectiveCharge::EffectiveCharge(const G4ParticleDefinition* p, 79 84 const G4Material* material, 80 G4double kineticEnergy)85 G4double kineticEnergy) 81 86 { 87 if(p == lastPart && material == lastMat && kineticEnergy == lastKinEnergy) 88 return effCharge; 89 90 lastPart = p; 91 lastMat = material; 92 lastKinEnergy = kineticEnergy; 93 82 94 G4double mass = p->GetPDGMass(); 83 95 G4double charge = p->GetPDGCharge(); … … 85 97 86 98 chargeCorrection = 1.0; 99 effCharge = charge; 87 100 88 101 // The aproximation of ion effective charge from: … … 94 107 if( reducedEnergy > Zi*energyHighLimit || Zi < 1.5 || !material) return charge; 95 108 96 static G4double c[6] = {0.2865, 0.1266, -0.001429,97 0.02402,-0.01135, 0.001475} ;98 99 109 G4double z = material->GetIonisation()->GetZeffective(); 100 reducedEnergy = std::max(reducedEnergy,energyLowLimit); 101 G4double q; 110 // reducedEnergy = std::max(reducedEnergy,energyLowLimit); 102 111 103 112 // Helium ion case 104 113 if( Zi < 2.5 ) { 114 115 static G4double c[6] = {0.2865, 0.1266, -0.001429, 116 0.02402,-0.01135, 0.001475} ; 105 117 106 118 G4double Q = std::max(0.0,std::log(reducedEnergy*massFactor)); … … 120 132 if(tq2 < 0.2) tt *= (1.0 - tq2 + 0.5*tq2*tq2); 121 133 else tt *= std::exp(-tq2); 122 q = (1.0 + tt) * std::sqrt(ex); 134 135 effCharge = charge*(1.0 + tt) * std::sqrt(ex); 123 136 124 137 // Heavy ion case 125 138 } else { 126 139 127 G4double z23 = std::pow(z, 0.666666); 128 G4double zi13 = std::pow(Zi, 0.333333); 140 G4double y; 141 // = nist->GetZ13(z); 142 //G4double z23 = y*y; 143 G4double zi13 = nist->GetZ13(Zi); 129 144 G4double zi23 = zi13*zi13; 130 G4double e = std::max(reducedEnergy,energyBohr/z23); 145 // G4double e = std::max(reducedEnergy,energyBohr/z23); 146 //G4double e = reducedEnergy; 131 147 132 148 // v1 is ion velocity in vF unit 133 149 G4double eF = material->GetIonisation()->GetFermiEnergy(); 134 G4double v1sq = e/eF;150 G4double v1sq = reducedEnergy/eF; 135 151 G4double vFsq = eF/energyBohr; 136 G4double vF = std::sqrt(vFsq); 137 138 G4double y ; 152 G4double vF = std::sqrt(eF/energyBohr); 139 153 140 154 // Faster than Fermi velocity … … 147 161 } 148 162 163 G4double q; 149 164 G4double y3 = std::pow(y, 0.3) ; 150 // G4cout << "y= " << y << " y3= " << y3 << " v1= " << v1 << " vF= " << vF <<G4endl;165 // G4cout<<"y= "<<y<<" y3= "<<y3<<" v1= "<<v1<<" vF= "<<vF<<G4endl; 151 166 q = 1.0 - std::exp( 0.803*y3 - 1.3167*y3*y3 - 0.38157*y - 0.008983*y*y ) ; 152 153 // q = 1.0 - std::exp(-0.95*std::sqrt(reducedEnergy/energyBohr)/zi23); 167 168 //y *= 0.77; 169 //y *= (0.75 + 0.52/Zi); 170 171 //if( y < 0.2 ) q = y*(1.0 - 0.5*y); 172 //else q = 1.0 - std::exp(-y); 154 173 155 174 G4double qmin = minCharge/Zi; 156 157 175 if(q < qmin) q = qmin; 176 177 effCharge = q*charge; 178 179 /* 180 G4double x1 = 1.0*effCharge*(1.0 - 0.132*std::log(y))/(y*std::sqrt(z)); 181 G4double x2 = 0.1*effCharge*effCharge*energyBohr/reducedEnergy; 182 183 chargeCorrection = 1.0 + x1 - x2; 184 185 G4cout << "x1= "<<x1<<" x2= "<< x2<<" corr= "<<chargeCorrection<<G4endl; 186 */ 158 187 159 188 G4double tq = 7.6 - std::log(reducedEnergy/keV); … … 170 199 171 200 G4double lambda = 10.0 * vF / (zi13 * (6.0 + q)); 172 if(q < 0.2) lambda *= (1.0 - 0.666666 *q - q*q/9.0);201 if(q < 0.2) lambda *= (1.0 - 0.66666667*q - q*q/9.0); 173 202 else lambda *= std::pow(1.0-q, 0.666666); 174 203 … … 180 209 181 210 chargeCorrection = sq * (1.0 + xx); 211 182 212 } 183 213 // G4cout << "G4ionEffectiveCharge: charge= " << charge << " q= " << q 184 214 // << " chargeCor= " << chargeCorrection 185 215 // << " e(MeV)= " << kineticEnergy/MeV << G4endl; 186 return q*charge;216 return effCharge; 187 217 } 188 218 -
trunk/source/processes/electromagnetic/xrays/GNUmakefile
r819 r961 1 # $Id: GNUmakefile,v 1. 6 2006/04/05 13:34:23 vnivanchExp $1 # $Id: GNUmakefile,v 1.7 2008/06/13 01:06:31 gum Exp $ 2 2 # -------------------------------------------------------------------- 3 3 # GNUmakefile for electromagnetic sub-library. John Allison, 25/6/98. … … 24 24 -I$(G4BASE)/processes/management/include \ 25 25 -I$(G4BASE)/processes/cuts/include \ 26 -I$(G4BASE)/processes/electromagnetic/utils/include \ 26 27 -I$(G4BASE)/particles/management/include \ 27 28 -I$(G4BASE)/particles/bosons/include \ -
trunk/source/processes/electromagnetic/xrays/History
r819 r961 1 $Id: History,v 1.6 2 2007/11/02 20:56:36gum Exp $1 $Id: History,v 1.69 2008/11/14 20:47:11 gum Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 18 18 ---------------------------------------------------------- 19 19 20 14 November 08: P. Gumplinger (xrays-V09-01-06) 21 - Do not calculate a step limit coming from G4Cerenkov when the 22 minimum beta for a particle to radiate in the material (vacuum) 23 is already 1; fix G4Cerenkov.cc 24 25 12 November 08: V. Ivanchenko (xrays-V09-01-05) 26 - exclude G4MscRadiation from the release 27 28 21 October 08: P. Gumplinger (xrays-V09-01-04) 29 - Add SetProcessSubType(G4EmProcessSubType) to G4Cerenkov.cc 30 and G4Scintillation. Modify G4Cerenkov to allow for 31 MaxBetaChangePerStep, sets PostStepGetPhysicalInteractionLength to 32 where the particle would drop below the Cerenkov threshold in the 33 current material. The Cerenkov photon origins are now sampled 34 according to the linear decrease in the MeanNumberOfPhotons over 35 the step. G4Cerenkov now inherits from G4VProcess. For this to work 36 tracking-V09-01-03 or newer is required. 37 38 04 July 08: P. Gumplinger (xrays-V09-01-03) 39 - In G4Scintillation and G4Cerenkov now 40 SetTouchableHandle(aStep.GetPreStepPoint()->GetTouchableHandle()) 41 for the secondaries in the DoIt. 42 43 06 June 08: P. Gumplinger (xrays-V09-01-02) 44 - G4Scintillation: make now use of G4EmSaturation to implement the 45 Birks Correction. 46 47 05 June 08: P. Gumplinger (xrays-V09-01-01) 48 - G4Scintillation, G4Cerenkov 49 trivial name changes: momentum->energy, momenta->energies 50 51 05 February 08: P. Gumplinger 52 - G4BirkScintillation class was removed and scintillation with Birk's law 53 was added to the G4Scintillation class directly. 54 55 01 February 08: V. Grichine 56 - G4BirkScintillation class was added. The class implements the scintillation 57 process with Birk's law 58 20 59 02 November 07: P. Gumplinger (xrays-V09-00-03) 21 60 - G4Cerenkov constructor add warning printout about the change -
trunk/source/processes/electromagnetic/xrays/include/G4Cerenkov.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4Cerenkov.hh,v 1. 9 2007/09/30 22:17:04gum Exp $28 // GEANT4 tag $Name: $27 // $Id: G4Cerenkov.hh,v 1.10 2008/10/22 01:17:36 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 60 60 #include "G4ParticleMomentum.hh" 61 61 #include "G4Step.hh" 62 #include "G4V DiscreteProcess.hh"62 #include "G4VProcess.hh" 63 63 #include "G4OpticalPhoton.hh" 64 64 #include "G4DynamicParticle.hh" … … 77 77 ///////////////////// 78 78 79 class G4Cerenkov : public G4V DiscreteProcess79 class G4Cerenkov : public G4VProcess 80 80 { 81 81 … … 116 116 // condition for the DoIt to be invoked at every step. 117 117 118 G4double PostStepGetPhysicalInteractionLength(const G4Track& aTrack, 119 G4double , 120 G4ForceCondition* ); 121 // Returns the discrete step limit and sets the 'StronglyForced' 122 // condition for the DoIt to be invoked at every step. 123 118 124 G4VParticleChange* PostStepDoIt(const G4Track& aTrack, 119 125 const G4Step& aStep); 120 126 // This is the method implementing the Cerenkov process. 127 128 // no operation in AtRestDoIt and AlongStepDoIt 129 virtual G4double AlongStepGetPhysicalInteractionLength( 130 const G4Track&, 131 G4double , 132 G4double , 133 G4double& , 134 G4GPILSelection* 135 ) { return -1.0; }; 136 137 virtual G4double AtRestGetPhysicalInteractionLength( 138 const G4Track& , 139 G4ForceCondition* 140 ) { return -1.0; }; 141 142 // no operation in AtRestDoIt and AlongStepDoIt 143 virtual G4VParticleChange* AtRestDoIt( 144 const G4Track& , 145 const G4Step& 146 ) {return 0;}; 147 148 virtual G4VParticleChange* AlongStepDoIt( 149 const G4Track& , 150 const G4Step& 151 ) {return 0;}; 121 152 122 153 void SetTrackSecondariesFirst(const G4bool state); … … 125 156 // been tracked, the tracking of the primary resumes. 126 157 158 void SetMaxBetaChangePerStep(const G4double d); 159 // Set the maximum allowed change in beta = v/c in % (perCent) 160 // per step. 161 127 162 void SetMaxNumPhotonsPerStep(const G4int NumPhotons); 128 163 // Set the maximum number of Cerenkov photons allowed to be … … 166 201 167 202 G4bool fTrackSecondariesFirst; 168 G4int fMaxPhotons; 203 G4double fMaxBetaChange; 204 G4int fMaxPhotons; 169 205 }; 170 206 … … 190 226 191 227 inline 228 void G4Cerenkov::SetMaxBetaChangePerStep(const G4double value) 229 { 230 fMaxBetaChange = value*perCent; 231 } 232 233 inline 192 234 void G4Cerenkov::SetMaxNumPhotonsPerStep(const G4int NumPhotons) 193 235 { … … 208 250 } 209 251 210 inline G4PhysicsTable* G4Cerenkov::GetPhysicsTable() const 252 inline 253 G4PhysicsTable* G4Cerenkov::GetPhysicsTable() const 211 254 { 212 255 return thePhysicsTable; -
trunk/source/processes/electromagnetic/xrays/include/G4ForwardXrayTR.hh
r819 r961 26 26 // 27 27 // $Id: G4ForwardXrayTR.hh,v 1.14 2006/06/29 19:55:33 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // G4ForwardXrayTR -- header file -
trunk/source/processes/electromagnetic/xrays/include/G4GammaXTRadiator.hh
r819 r961 26 26 // 27 27 // $Id: G4GammaXTRadiator.hh,v 1.4 2006/06/29 19:55:35 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/xrays/include/G4RegularXTRadiator.hh
r819 r961 26 26 // 27 27 // $Id: G4RegularXTRadiator.hh,v 1.3 2006/06/29 19:55:37 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/xrays/include/G4Scintillation.hh
r819 r961 25 25 // 26 26 // 27 // $Id: G4Scintillation.hh,v 1.1 3 2006/06/29 19:55:39 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4Scintillation.hh,v 1.15 2008/06/13 01:04:49 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 72 72 #include "G4PhysicsOrderedFreeVector.hh" 73 73 74 #include "G4EmSaturation.hh" 75 74 76 // Class Description: 75 77 // RestDiscrete Process - Generation of Scintillation Photons. … … 170 172 // Returns the address of the slow scintillation integral table. 171 173 174 void AddSaturation(G4EmSaturation* sat) { emSaturation = sat; } 175 // Adds Birks Saturation to the process. 176 177 G4EmSaturation* GetSaturation() const { return emSaturation; } 178 // Returns the Birks Saturation. 179 172 180 void DumpPhysicsTable() const; 173 181 // Prints the fast and slow scintillation integral tables. 174 182 175 pr ivate:183 protected: 176 184 177 185 void BuildThePhysicsTable(); … … 183 191 /////////////////////// 184 192 185 protected:186 193 187 194 G4PhysicsTable* theSlowIntegralTable; 188 195 G4PhysicsTable* theFastIntegralTable; 189 196 197 198 199 G4bool fTrackSecondariesFirst; 200 201 G4double YieldFactor; 202 203 G4double ExcitationRatio; 204 190 205 private: 191 206 192 G4bool fTrackSecondariesFirst; 193 194 G4double YieldFactor; 195 196 G4double ExcitationRatio; 207 G4EmSaturation* emSaturation; 197 208 198 209 }; -
trunk/source/processes/electromagnetic/xrays/include/G4StrawTubeXTRadiator.hh
r819 r961 26 26 // 27 27 // $Id: G4StrawTubeXTRadiator.hh,v 1.4 2007/09/29 17:49:34 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/xrays/include/G4SynchrotronRadiation.hh
r819 r961 26 26 // 27 27 // $Id: G4SynchrotronRadiation.hh,v 1.4 2006/06/29 19:55:43 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------------------------------------------------------ -
trunk/source/processes/electromagnetic/xrays/include/G4SynchrotronRadiationInMat.hh
r819 r961 26 26 // 27 27 // $Id: G4SynchrotronRadiationInMat.hh,v 1.2 2006/06/29 19:55:45 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // ------------------------------------------------------------ -
trunk/source/processes/electromagnetic/xrays/include/G4TransitionRadiation.hh
r819 r961 26 26 // 27 27 // $Id: G4TransitionRadiation.hh,v 1.9 2006/06/29 19:55:47 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // G4TransitionRadiation -- header file -
trunk/source/processes/electromagnetic/xrays/include/G4TransparentRegXTRadiator.hh
r819 r961 26 26 // 27 27 // $Id: G4TransparentRegXTRadiator.hh,v 1.2 2006/06/29 19:55:49 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/xrays/include/G4VTRModel.hh
r819 r961 26 26 // 27 27 // $Id: G4VTRModel.hh,v 1.3 2006/06/29 19:55:51 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // G4VTRModel -- header file -
trunk/source/processes/electromagnetic/xrays/include/G4VTransitionRadiation.hh
r819 r961 26 26 // 27 27 // $Id: G4VTransitionRadiation.hh,v 1.3 2006/06/29 19:55:53 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // G4VTransitionRadiation -- header file -
trunk/source/processes/electromagnetic/xrays/include/G4VXTRenergyLoss.hh
r819 r961 26 26 // 27 27 // $Id: G4VXTRenergyLoss.hh,v 1.24 2007/09/29 17:49:34 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/xrays/src/G4Cerenkov.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4Cerenkov.cc,v 1.2 3 2007/10/15 20:05:23gum Exp $28 // GEANT4 tag $Name: $27 // $Id: G4Cerenkov.cc,v 1.26 2008/11/14 20:16:51 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //////////////////////////////////////////////////////////////////////// … … 65 65 #include "G4ios.hh" 66 66 #include "G4Poisson.hh" 67 #include "G4EmProcessSubType.hh" 68 69 #include "G4LossTableManager.hh" 70 #include "G4MaterialCutsCouple.hh" 71 #include "G4ParticleDefinition.hh" 72 67 73 #include "G4Cerenkov.hh" 68 74 … … 86 92 87 93 G4Cerenkov::G4Cerenkov(const G4String& processName, G4ProcessType type) 88 : G4V DiscreteProcess(processName, type)94 : G4VProcess(processName, type) 89 95 { 90 96 G4cout << "G4Cerenkov::G4Cerenkov constructor" << G4endl; 91 G4cout << "NOTE: this is now a G4V DiscreteProcess!" << G4endl;97 G4cout << "NOTE: this is now a G4VProcess!" << G4endl; 92 98 G4cout << "Required change in UserPhysicsList: " << G4endl; 93 99 G4cout << "change: pmanager->AddContinuousProcess(theCerenkovProcess);" << G4endl; … … 95 101 G4cout << " pmanager->SetProcessOrdering(theCerenkovProcess,idxPostStep);" << G4endl; 96 102 103 SetProcessSubType(fCerenkov); 104 97 105 fTrackSecondariesFirst = false; 106 fMaxBetaChange = 0.; 98 107 fMaxPhotons = 0; 99 108 … … 141 150 142 151 { 143 144 152 ////////////////////////////////////////////////////// 145 153 // Should we ensure that the material is dispersive? … … 160 168 G4MaterialPropertiesTable* aMaterialPropertiesTable = 161 169 aMaterial->GetMaterialPropertiesTable(); 162 if (!aMaterialPropertiesTable) 163 return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep); 170 if (!aMaterialPropertiesTable) return pParticleChange; 164 171 165 172 const G4MaterialPropertyVector* Rindex = 166 173 aMaterialPropertiesTable->GetProperty("RINDEX"); 167 if (!Rindex) 168 return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep); 174 if (!Rindex) return pParticleChange; 169 175 170 176 // particle charge … … 184 190 aParticleChange.SetNumberOfSecondaries(0); 185 191 186 return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);192 return pParticleChange; 187 193 188 194 } … … 201 207 aParticleChange.SetNumberOfSecondaries(0); 202 208 203 return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);209 return pParticleChange; 204 210 } 205 211 … … 215 221 //////////////////////////////////////////////////////////////// 216 222 217 G4double Pmin = Rindex->GetMinPhoton Momentum();218 G4double Pmax = Rindex->GetMaxPhoton Momentum();223 G4double Pmin = Rindex->GetMinPhotonEnergy(); 224 G4double Pmax = Rindex->GetMaxPhotonEnergy(); 219 225 G4double dp = Pmax - Pmin; 220 226 … … 226 232 G4double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos); 227 233 234 const G4double beta1 = pPreStepPoint ->GetBeta(); 235 const G4double beta2 = pPostStepPoint->GetBeta(); 236 237 G4double MeanNumberOfPhotons1 = 238 GetAverageNumberOfPhotons(charge,beta1,aMaterial,Rindex); 239 G4double MeanNumberOfPhotons2 = 240 GetAverageNumberOfPhotons(charge,beta2,aMaterial,Rindex); 241 228 242 for (G4int i = 0; i < NumPhotons; i++) { 229 243 230 // Determine photon momentum244 // Determine photon energy 231 245 232 246 G4double rand; 233 G4double sampled Momentum, sampledRI;247 G4double sampledEnergy, sampledRI; 234 248 G4double cosTheta, sin2Theta; 235 249 236 // sample a momentum250 // sample an energy 237 251 238 252 do { 239 253 rand = G4UniformRand(); 240 sampled Momentum= Pmin + rand * dp;241 sampledRI = Rindex->GetProperty(sampled Momentum);254 sampledEnergy = Pmin + rand * dp; 255 sampledRI = Rindex->GetProperty(sampledEnergy); 242 256 cosTheta = BetaInverse / sampledRI; 243 257 … … 256 270 G4double cosPhi = cos(phi); 257 271 258 // calculate x,y, and z components of photon momentum272 // calculate x,y, and z components of photon energy 259 273 // (in coord system with primary particle direction 260 274 // aligned with the z axis) … … 299 313 photonPolarization.z()); 300 314 301 aCerenkovPhoton->SetKineticEnergy(sampled Momentum);315 aCerenkovPhoton->SetKineticEnergy(sampledEnergy); 302 316 303 317 // Generate new G4Track object: 304 318 305 rand = G4UniformRand(); 306 307 G4double delta = rand * aStep.GetStepLength(); 319 G4double delta, NumberOfPhotons, N; 320 321 do { 322 rand = G4UniformRand(); 323 delta = rand * aStep.GetStepLength(); 324 NumberOfPhotons = MeanNumberOfPhotons1 - delta * 325 (MeanNumberOfPhotons1-MeanNumberOfPhotons2)/ 326 aStep.GetStepLength(); 327 N = G4UniformRand() * 328 std::max(MeanNumberOfPhotons1,MeanNumberOfPhotons2); 329 } while (N > NumberOfPhotons); 330 308 331 G4double deltaTime = delta / 309 332 ((pPreStepPoint->GetVelocity()+ … … 318 341 new G4Track(aCerenkovPhoton,aSecondaryTime,aSecondaryPosition); 319 342 320 aSecondaryTrack->SetTouchableHandle((G4VTouchable*)0); 343 aSecondaryTrack->SetTouchableHandle( 344 aStep.GetPreStepPoint()->GetTouchableHandle()); 321 345 322 346 aSecondaryTrack->SetParentID(aTrack.GetTrackID()); … … 330 354 } 331 355 332 return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);356 return pParticleChange; 333 357 } 334 358 … … 372 396 373 397 // Retrieve the first refraction index in vector 374 // of (photon momentum, refraction index) pairs398 // of (photon energy, refraction index) pairs 375 399 376 400 theRefractionIndexVector->ResetIterator(); … … 382 406 if (currentRI > 1.0) { 383 407 384 // Create first (photon momentum, Cerenkov Integral)408 // Create first (photon energy, Cerenkov Integral) 385 409 // pair 386 410 387 411 G4double currentPM = theRefractionIndexVector-> 388 GetPhoton Momentum();412 GetPhotonEnergy(); 389 413 G4double currentCAI = 0.0; 390 414 … … 398 422 G4double prevRI = currentRI; 399 423 400 // loop over all (photon momentum, refraction index)424 // loop over all (photon energy, refraction index) 401 425 // pairs stored for this material 402 426 … … 407 431 408 432 currentPM = theRefractionIndexVector-> 409 GetPhoton Momentum();433 GetPhotonEnergy(); 410 434 411 435 currentCAI = 0.5*(1.0/(prevRI*prevRI) + … … 441 465 // 442 466 443 G4double G4Cerenkov::GetMeanFreePath(const G4Track& aTrack, 467 G4double G4Cerenkov::GetMeanFreePath(const G4Track&, 468 G4double, 469 G4ForceCondition*) 470 { 471 return 1.; 472 } 473 474 G4double G4Cerenkov::PostStepGetPhysicalInteractionLength( 475 const G4Track& aTrack, 444 476 G4double, 445 477 G4ForceCondition* condition) 446 478 { 447 *condition = StronglyForced; 448 449 // If user has defined an average maximum number of photons to 450 // be generated in a Step, then return the Step length for that 451 // number of photons. 452 453 if (fMaxPhotons <= 0) return DBL_MAX; 479 *condition = NotForced; 480 G4double StepLimit = DBL_MAX; 454 481 455 482 const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle(); 456 483 const G4Material* aMaterial = aTrack.GetMaterial(); 457 458 G4MaterialPropertiesTable* aMaterialPropertiesTable = 459 aMaterial->GetMaterialPropertiesTable(); 460 if (!aMaterialPropertiesTable) return DBL_MAX; 461 462 const G4MaterialPropertyVector* Rindex = 463 aMaterialPropertiesTable->GetProperty("RINDEX"); 464 if (!Rindex) return DBL_MAX; 465 466 // particle charge 467 const G4double charge = aParticle->GetDefinition()->GetPDGCharge(); 484 const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple(); 485 486 const G4double kineticEnergy = aParticle->GetKineticEnergy(); 487 const G4ParticleDefinition* particleType = aParticle->GetDefinition(); 488 const G4double mass = particleType->GetPDGMass(); 468 489 469 490 // particle beta 470 491 const G4double beta = aParticle->GetTotalMomentum() / 471 492 aParticle->GetTotalEnergy(); 472 473 G4double MeanNumberOfPhotons = 474 GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex); 475 476 if(MeanNumberOfPhotons <= 0.0) return DBL_MAX; 477 478 G4double StepLimit = fMaxPhotons / MeanNumberOfPhotons; 479 480 return StepLimit; 493 // particle gamma 494 const G4double gamma = 1./std::sqrt(1.-beta*beta); 495 496 G4MaterialPropertiesTable* aMaterialPropertiesTable = 497 aMaterial->GetMaterialPropertiesTable(); 498 499 const G4MaterialPropertyVector* Rindex = NULL; 500 501 if (aMaterialPropertiesTable) 502 Rindex = aMaterialPropertiesTable->GetProperty("RINDEX"); 503 504 G4double nMax; 505 if (Rindex) { 506 nMax = Rindex->GetMaxProperty(); 507 } else { 508 return StepLimit; 509 } 510 511 G4double BetaMin = 1./nMax; 512 if ( BetaMin >= 1. ) return StepLimit; 513 514 G4double GammaMin = 1./std::sqrt(1.-BetaMin*BetaMin); 515 516 if (gamma < GammaMin ) return StepLimit; 517 518 G4double kinEmin = mass*(GammaMin-1.); 519 520 G4double RangeMin = G4LossTableManager::Instance()-> 521 GetRange(particleType, 522 kinEmin, 523 couple); 524 G4double Range = G4LossTableManager::Instance()-> 525 GetRange(particleType, 526 kineticEnergy, 527 couple); 528 529 G4double Step = Range - RangeMin; 530 if (Step < 1.*um ) return StepLimit; 531 532 if (Step > 0. && Step < StepLimit) StepLimit = Step; 533 534 // If user has defined an average maximum number of photons to 535 // be generated in a Step, then calculate the Step length for 536 // that number of photons. 537 538 if (fMaxPhotons > 0) { 539 540 // particle charge 541 const G4double charge = aParticle-> 542 GetDefinition()->GetPDGCharge(); 543 544 G4double MeanNumberOfPhotons = 545 GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex); 546 547 G4double Step = 0.; 548 if (MeanNumberOfPhotons > 0.0) Step = fMaxPhotons / 549 MeanNumberOfPhotons; 550 551 if (Step > 0. && Step < StepLimit) StepLimit = Step; 552 } 553 554 // If user has defined an maximum allowed change in beta per step 555 if (fMaxBetaChange > 0.) { 556 557 G4double dedx = G4LossTableManager::Instance()-> 558 GetDEDX(particleType, 559 kineticEnergy, 560 couple); 561 562 G4double deltaGamma = gamma - 563 1./std::sqrt(1.-beta*beta* 564 (1.-fMaxBetaChange)* 565 (1.-fMaxBetaChange)); 566 567 G4double Step = mass * deltaGamma / dedx; 568 569 if (Step > 0. && Step < StepLimit) StepLimit = Step; 570 571 } 572 573 *condition = StronglyForced; 574 return StepLimit; 481 575 } 482 576 … … 512 606 if(!(CerenkovAngleIntegrals->IsFilledVectorExist()))return 0.0; 513 607 514 // Min and Max photon momenta515 G4double Pmin = Rindex->GetMinPhoton Momentum();516 G4double Pmax = Rindex->GetMaxPhoton Momentum();608 // Min and Max photon energies 609 G4double Pmin = Rindex->GetMinPhotonEnergy(); 610 G4double Pmax = Rindex->GetMaxPhotonEnergy(); 517 611 518 612 // Min and Max Refraction Indices … … 541 635 // If n(Pmin) < 1/Beta, and n(Pmax) >= 1/Beta, then 542 636 // we need to find a P such that the value of n(P) == 1/Beta. 543 // Interpolation is performed by the GetPhoton Momentum() and637 // Interpolation is performed by the GetPhotonEnergy() and 544 638 // GetProperty() methods of the G4MaterialPropertiesTable and 545 639 // the GetValue() method of G4PhysicsVector. 546 640 547 641 else { 548 Pmin = Rindex->GetPhoton Momentum(BetaInverse);642 Pmin = Rindex->GetPhotonEnergy(BetaInverse); 549 643 dp = Pmax - Pmin; 550 644 -
trunk/source/processes/electromagnetic/xrays/src/G4ForwardXrayTR.cc
r819 r961 26 26 // 27 27 // $Id: G4ForwardXrayTR.cc,v 1.14 2007/05/11 14:23:04 gcosmo Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // G4ForwardXrayTR class -- implementation file -
trunk/source/processes/electromagnetic/xrays/src/G4GammaXTRadiator.cc
r819 r961 26 26 // 27 27 // $Id: G4GammaXTRadiator.cc,v 1.5 2006/06/29 19:56:07 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 -
trunk/source/processes/electromagnetic/xrays/src/G4RegularXTRadiator.cc
r819 r961 26 26 // 27 27 // $Id: G4RegularXTRadiator.cc,v 1.9 2006/06/29 19:56:09 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 -
trunk/source/processes/electromagnetic/xrays/src/G4Scintillation.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4Scintillation.cc,v 1. 26 2006/06/29 19:56:11 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4Scintillation.cc,v 1.30 2008/10/22 01:19:11 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //////////////////////////////////////////////////////////////////////// … … 64 64 65 65 #include "G4ios.hh" 66 #include "G4EmProcessSubType.hh" 67 66 68 #include "G4Scintillation.hh" 67 69 … … 88 90 : G4VRestDiscreteProcess(processName, type) 89 91 { 92 SetProcessSubType(fScintillation); 93 90 94 fTrackSecondariesFirst = false; 91 95 … … 101 105 102 106 BuildThePhysicsTable(); 107 108 emSaturation = NULL; 103 109 } 104 110 … … 180 186 G4double ScintillationYield = aMaterialPropertiesTable-> 181 187 GetConstProperty("SCINTILLATIONYIELD"); 188 ScintillationYield *= YieldFactor; 189 182 190 G4double ResolutionScale = aMaterialPropertiesTable-> 183 191 GetConstProperty("RESOLUTIONSCALE"); 184 192 185 ScintillationYield = YieldFactor * ScintillationYield; 186 187 G4double MeanNumberOfPhotons = ScintillationYield * TotalEnergyDeposit; 193 // Birks law saturation: 194 195 G4double constBirks = 0.0; 196 197 constBirks = aMaterial->GetIonisation()->GetBirksConstant(); 198 199 G4double MeanNumberOfPhotons; 200 201 if (emSaturation) { 202 MeanNumberOfPhotons = ScintillationYield* 203 (emSaturation->VisibleEnergyDeposition(&aStep)); 204 } else { 205 MeanNumberOfPhotons = ScintillationYield*TotalEnergyDeposit; 206 } 188 207 189 208 G4int NumPhotons; 190 if (MeanNumberOfPhotons > 10.) { 209 210 if (MeanNumberOfPhotons > 10.) 211 { 191 212 G4double sigma = ResolutionScale * sqrt(MeanNumberOfPhotons); 192 213 NumPhotons = G4int(G4RandGauss::shoot(MeanNumberOfPhotons,sigma)+0.5); 193 214 } 194 else { 215 else 216 { 195 217 NumPhotons = G4int(G4Poisson(MeanNumberOfPhotons)); 196 218 } 197 219 198 if (NumPhotons <= 0) {199 220 if (NumPhotons <= 0) 221 { 200 222 // return unchanged particle and no secondaries 201 223 … … 274 296 for (G4int i = 0; i < Num; i++) { 275 297 276 // Determine photon momentum298 // Determine photon energy 277 299 278 300 G4double CIIvalue = G4UniformRand()*CIImax; 279 G4double sampled Momentum=301 G4double sampledEnergy = 280 302 ScintillationIntegral->GetEnergy(CIIvalue); 281 303 282 304 if (verboseLevel>1) { 283 G4cout << "sampled Momentum = " << sampledMomentum<< G4endl;305 G4cout << "sampledEnergy = " << sampledEnergy << G4endl; 284 306 G4cout << "CIIvalue = " << CIIvalue << G4endl; 285 307 } … … 330 352 photonPolarization.z()); 331 353 332 aScintillationPhoton->SetKineticEnergy(sampled Momentum);354 aScintillationPhoton->SetKineticEnergy(sampledEnergy); 333 355 334 356 // Generate new G4Track object: … … 358 380 new G4Track(aScintillationPhoton,aSecondaryTime,aSecondaryPosition); 359 381 360 aSecondaryTrack->SetTouchableHandle((G4VTouchable*)0); 382 aSecondaryTrack->SetTouchableHandle( 383 aStep.GetPreStepPoint()->GetTouchableHandle()); 384 // aSecondaryTrack->SetTouchableHandle((G4VTouchable*)0); 361 385 362 386 aSecondaryTrack->SetParentID(aTrack.GetTrackID()); … … 417 441 418 442 // Retrieve the first intensity point in vector 419 // of (photon momentum, intensity) pairs443 // of (photon energy, intensity) pairs 420 444 421 445 theFastLightVector->ResetIterator(); … … 427 451 if (currentIN >= 0.0) { 428 452 429 // Create first (photon momentum, Scintillation453 // Create first (photon energy, Scintillation 430 454 // Integral pair 431 455 432 456 G4double currentPM = theFastLightVector-> 433 GetPhoton Momentum();457 GetPhotonEnergy(); 434 458 435 459 G4double currentCII = 0.0; … … 444 468 G4double prevIN = currentIN; 445 469 446 // loop over all (photon momentum, intensity)470 // loop over all (photon energy, intensity) 447 471 // pairs stored for this material 448 472 … … 450 474 { 451 475 currentPM = theFastLightVector-> 452 GetPhoton Momentum();476 GetPhotonEnergy(); 453 477 454 478 currentIN=theFastLightVector-> … … 477 501 478 502 // Retrieve the first intensity point in vector 479 // of (photon momentum, intensity) pairs503 // of (photon energy, intensity) pairs 480 504 481 505 theSlowLightVector->ResetIterator(); … … 487 511 if (currentIN >= 0.0) { 488 512 489 // Create first (photon momentum, Scintillation513 // Create first (photon energy, Scintillation 490 514 // Integral pair 491 515 492 516 G4double currentPM = theSlowLightVector-> 493 GetPhoton Momentum();517 GetPhotonEnergy(); 494 518 495 519 G4double currentCII = 0.0; … … 504 528 G4double prevIN = currentIN; 505 529 506 // loop over all (photon momentum, intensity)530 // loop over all (photon energy, intensity) 507 531 // pairs stored for this material 508 532 … … 510 534 { 511 535 currentPM = theSlowLightVector-> 512 GetPhoton Momentum();536 GetPhotonEnergy(); 513 537 514 538 currentIN=theSlowLightVector-> -
trunk/source/processes/electromagnetic/xrays/src/G4StrawTubeXTRadiator.cc
r819 r961 26 26 // 27 27 // $Id: G4StrawTubeXTRadiator.cc,v 1.6 2007/09/29 17:49:34 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 -
trunk/source/processes/electromagnetic/xrays/src/G4SynchrotronRadiation.cc
r819 r961 26 26 // 27 27 // $Id: G4SynchrotronRadiation.cc,v 1.5 2006/06/29 19:56:15 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -------------------------------------------------------------- -
trunk/source/processes/electromagnetic/xrays/src/G4SynchrotronRadiationInMat.cc
r819 r961 26 26 // 27 27 // $Id: G4SynchrotronRadiationInMat.cc,v 1.2 2006/06/29 19:56:17 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -------------------------------------------------------------- -
trunk/source/processes/electromagnetic/xrays/src/G4TransitionRadiation.cc
r819 r961 26 26 // 27 27 // $Id: G4TransitionRadiation.cc,v 1.7 2006/06/29 19:56:19 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // G4TransitionRadiation class -- implementation file -
trunk/source/processes/electromagnetic/xrays/src/G4TransparentRegXTRadiator.cc
r819 r961 26 26 // 27 27 // $Id: G4TransparentRegXTRadiator.cc,v 1.11 2007/09/29 17:49:34 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 -
trunk/source/processes/electromagnetic/xrays/src/G4VTransitionRadiation.cc
r819 r961 26 26 // 27 27 // $Id: G4VTransitionRadiation.cc,v 1.5 2006/06/29 19:56:23 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // G4VTransitionRadiation class -- implementation file -
trunk/source/processes/electromagnetic/xrays/src/G4VXTRenergyLoss.cc
r819 r961 26 26 // 27 27 // $Id: G4VXTRenergyLoss.cc,v 1.44 2007/09/29 17:49:34 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // History:
Note:
See TracChangeset
for help on using the changeset viewer.
