72 :
G4VEmModel(nam),fParticleChange(0),fParticle(0),isInitialised(false),
73 fAtomDeexcitation(0),kineticEnergy1(0.*
eV),
74 cosThetaPrimary(1.0),energySecondary(0.*
eV),
75 cosThetaSecondary(0.0),targetOscillator(-1),
76 theCrossSectionHandler(0),fLocalTable(false)
120 G4cout <<
"Calling G4PenelopeIonisationModel::Initialise()" <<
G4endl;
127 G4cout <<
"WARNING from G4PenelopeIonisationModel " <<
G4endl;
128 G4cout <<
"Atomic de-excitation module is not instantiated, so there will not be ";
130 G4cout <<
"Please make sure this is intended" <<
G4endl;
166 G4cout <<
"Penelope Ionisation model v2008 is initialized " << G4endl
189 G4cout <<
"Calling G4PenelopeIonisationModel::InitialiseLocal()" <<
G4endl;
241 G4cout <<
"Calling CrossSectionPerVolume() of G4PenelopeIonisationModel" <<
G4endl;
270 ed <<
"Unable to retrieve the cross section table for " << theParticle->
GetParticleName() <<
271 " in " << material->
GetName() <<
", cut = " << cutEnergy/
keV <<
" keV " <<
G4endl;
272 ed <<
"This can happen only in Unit Tests or via G4EmCalculator" <<
G4endl;
273 G4Exception(
"G4PenelopeIonisationModel::CrossSectionPerVolume()",
277 G4AutoLock lock(&PenelopeIonisationModelMutex);
295 G4cout <<
"Material " << material->
GetName() <<
" has " << atPerMol <<
296 "atoms per molecule" <<
G4endl;
300 moleculeDensity = atomDensity/atPerMol;
302 G4double crossPerVolume = crossPerMolecule*moleculeDensity;
307 G4cout <<
"Mean free path for delta emission > " << cutEnergy/
keV <<
" keV at " <<
308 energy/
keV <<
" keV = " << (1./crossPerVolume)/
mm <<
" mm" << G4endl;
311 G4cout <<
"Total free path for ionisation (no threshold) at " <<
312 energy/
keV <<
" keV = " << (1./totalCross)/
mm <<
" mm" << G4endl;
314 return crossPerVolume;
329 G4cout <<
"*** G4PenelopeIonisationModel -- WARNING ***" <<
G4endl;
330 G4cout <<
"Penelope Ionisation model v2008 does not calculate cross section _per atom_ " <<
G4endl;
331 G4cout <<
"so the result is always zero. For physics values, please invoke " <<
G4endl;
332 G4cout <<
"GetCrossSectionPerVolume() or GetMeanFreePath() via the G4EmCalculator" <<
G4endl;
359 G4cout <<
"Calling ComputeDEDX() of G4PenelopeIonisationModel" <<
G4endl;
383 ed <<
"Unable to retrieve the cross section table for " << theParticle->
GetParticleName() <<
384 " in " << material->
GetName() <<
", cut = " << cutEnergy/
keV <<
" keV " <<
G4endl;
385 ed <<
"This can happen only in Unit Tests or via G4EmCalculator" <<
G4endl;
386 G4Exception(
"G4PenelopeIonisationModel::ComputeDEDXPerVolume()",
390 G4AutoLock lock(&PenelopeIonisationModelMutex);
410 moleculeDensity = atomDensity/atPerMol;
412 G4double sPowerPerVolume = sPowerPerMolecule*moleculeDensity;
417 G4cout <<
"Stopping power < " << cutEnergy/
keV <<
" keV at " <<
418 kineticEnergy/
keV <<
" keV = " <<
419 sPowerPerVolume/(
keV/
mm) <<
" keV/mm" << G4endl;
421 return sPowerPerVolume;
472 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeIonisationModel" <<
G4endl;
505 G4Exception(
"G4PenelopeIonisationModel::SamplingSecondaries()",
513 G4cout <<
"G4PenelopeIonisationModel::SamplingSecondaries() for " <<
525 G4double dirx = sint * std::cos(phiPrimary);
526 G4double diry = sint * std::sin(phiPrimary);
530 electronDirection1.rotateUz(particleDirection0);
542 G4double ionEnergyInPenelopeDatabase =
557 if (Z > 0 && shFlag<30)
559 shell = transitionManager->
Shell(Z,shFlag-1);
591 size_t nBefore = fvect->size();
593 size_t nAfter = fvect->size();
595 if (nAfter > nBefore)
597 for (
size_t j=nBefore;j<nAfter;j++)
599 G4double itsEnergy = ((*fvect)[j])->GetKineticEnergy();
600 localEnergyDeposit -= itsEnergy;
602 energyInFluorescence += itsEnergy;
604 energyInAuger += itsEnergy;
616 G4double xEl = sinThetaE * std::cos(phiEl);
617 G4double yEl = sinThetaE * std::sin(phiEl);
620 eDirection.rotateUz(particleDirection0);
623 fvect->push_back(electron);
631 if (localEnergyDeposit < 0)
634 <<
"G4PenelopeIonisationModel::SampleSecondaries - Negative energy deposit"
636 localEnergyDeposit=0.;
642 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
643 G4cout <<
"Energy balance from G4PenelopeIonisation" <<
G4endl;
644 G4cout <<
"Incoming primary energy: " << kineticEnergy0/
keV <<
" keV" <<
G4endl;
645 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
648 if (energyInFluorescence)
649 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/
keV <<
" keV" <<
G4endl;
651 G4cout <<
"Auger electrons: " << energyInAuger/
keV <<
" keV" <<
G4endl;
652 G4cout <<
"Local energy deposit " << localEnergyDeposit/
keV <<
" keV" <<
G4endl;
654 localEnergyDeposit+energyInAuger)/
keV <<
656 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
662 localEnergyDeposit+energyInAuger-kineticEnergy0);
663 if (energyDiff > 0.05*
keV)
664 G4cout <<
"Warning from G4PenelopeIonisation: problem with energy conservation: " <<
666 " keV (final) vs. " <<
667 kineticEnergy0/
keV <<
" keV (initial)" << G4endl;
686 size_t numberOfOscillators = theTable->size();
697 for (
size_t i=0;i<numberOfOscillators-1;i++)
724 G4double rb = kineticEnergy + 2.0*electron_mass_c2;
742 if (resEne > cutEnergy && resEne < kineticEnergy)
744 cps = kineticEnergy*rb;
747 if (resEne > 1.0e-6*kineticEnergy)
749 G4double cpp = std::sqrt((kineticEnergy-resEne)*(kineticEnergy-resEne+2.0*electron_mass_c2));
750 QM = std::sqrt((cp-cpp)*(cp-cpp)+electron_mass_c2*electron_mass_c2)-electron_mass_c2;
754 QM = resEne*resEne/(beta2*2.0*electron_mass_c2);
755 QM *= (1.0-QM*0.5/electron_mass_c2);
759 XHDL = std::log(cutoffEne*(QM+2.0*electron_mass_c2)/(QM*(cutoffEne+2.0*electron_mass_c2)))
761 XHDT = XHDT0*invResEne;
780 G4double EE = kineticEnergy + ionEne;
789 XHC = (amol*(0.5-rcl)+1.0/rcl-rrl1+
790 (1.0-amol)*std::log(rcl*rrl1))/EE;
797 if (XHTOT < 1.e-14*
barn)
825 rk = rcl/(1.0-fb*(1.0-(rcl+rcl)));
827 rk = rcl + (fb-1.0)*(0.5-rcl)/ARCL;
830 G4double phi = 1.0+rkf*rkf-rkf+amol*(rk2+rkf);
841 cosThetaSecondary= std::sqrt(deltaE*rb/(kineticEnergy*(deltaE+2.0*electron_mass_c2)));
843 G4cout <<
"SampleFinalStateElectron: sampled close collision " <<
G4endl;
854 G4double QS = QM/(1.0+QM*0.5/electron_mass_c2);
856 - (QS*0.5/electron_mass_c2));
857 G4double QTREV = Q*(Q+2.0*electron_mass_c2);
860 if (cosThetaPrimary > 1.)
861 cosThetaPrimary = 1.0;
864 cosThetaSecondary = 0.5*(deltaE*(kineticEnergy+rb-deltaE)+QTREV)/std::sqrt(cps*QTREV);
868 G4cout <<
"SampleFinalStateElectron: sampled distant longitudinal collision " <<
G4endl;
878 G4cout <<
"SampleFinalStateElectron: sampled distant transverse collision " <<
G4endl;
899 size_t numberOfOscillators = theTable->size();
909 for (
size_t i=0;i<numberOfOscillators-1;i++)
929 G4double rb = kineticEnergy + 2.0*electron_mass_c2;
936 G4double bha1 = amol*(2.0*g12-1.0)/(gam2-1.0);
938 G4double bha3 = amol*2.0*gam*(gam-1.0)/g12;
939 G4double bha4 = amol*(gam-1.0)*(gam-1.0)/g12;
956 if (resEne > cutEnergy && resEne < kineticEnergy)
958 cps = kineticEnergy*rb;
961 if (resEne > 1.0e-6*kineticEnergy)
963 G4double cpp = std::sqrt((kineticEnergy-resEne)*(kineticEnergy-resEne+2.0*electron_mass_c2));
964 QM = std::sqrt((cp-cpp)*(cp-cpp)+electron_mass_c2*electron_mass_c2)-electron_mass_c2;
968 QM = resEne*resEne/(beta2*2.0*electron_mass_c2);
969 QM *= (1.0-QM*0.5/electron_mass_c2);
973 XHDL = std::log(cutoffEne*(QM+2.0*electron_mass_c2)/(QM*(cutoffEne+2.0*electron_mass_c2)))
975 XHDT = XHDT0*invResEne;
1000 XHC = ((1.0/rcl-1.0)+bha1*std::log(rcl)+bha2*rl1
1001 + (bha3/2.0)*(rcl*rcl-1.0)
1002 + (bha4/3.0)*(1.0-rcl*rcl*rcl))/kineticEnergy;
1006 G4double XHTOT = XHC + XHDL + XHDT;
1009 if (XHTOT < 1.e-14*
barn)
1028 G4bool loopAgain =
false;
1033 G4double phi = 1.0-rk*(bha1-rk*(bha2-rk*(bha3-bha4*rk)));
1038 G4double deltaE = rk*kineticEnergy;
1043 cosThetaSecondary= std::sqrt(deltaE*rb/(kineticEnergy*(deltaE+2.0*electron_mass_c2)));
1045 G4cout <<
"SampleFinalStatePositron: sampled close collision " <<
G4endl;
1055 G4double QS = QM/(1.0+QM*0.5/electron_mass_c2);
1057 - (QS*0.5/electron_mass_c2));
1058 G4double QTREV = Q*(Q+2.0*electron_mass_c2);
1061 if (cosThetaPrimary > 1.)
1062 cosThetaPrimary = 1.0;
1065 cosThetaSecondary = 0.5*(deltaE*(kineticEnergy+rb-deltaE)+QTREV)/std::sqrt(cps*QTREV);
1069 G4cout <<
"SampleFinalStatePositron: sampled distant longitudinal collision " <<
G4endl;
1080 G4cout <<
"SampleFinalStatePositron: sampled distant transverse collision " <<
G4endl;
G4double cosThetaSecondary
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4VAtomDeexcitation * fAtomDeexcitation
G4PenelopeOscillatorTable * GetOscillatorTableIonisation(const G4Material *)
G4double LowEnergyLimit() const
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
static G4LossTableManager * Instance()
G4ParticleChangeForLoss * GetParticleChangeForLoss()
G4double GetSoftStoppingPower(G4double energy) const
Returns the total stopping power due to soft collisions.
std::ostringstream G4ExceptionDescription
G4double GetKineticEnergy() const
void SetVerboseLevel(G4int vl)
Setter for the verbosity level.
CLHEP::Hep3Vector G4ThreeVector
void SampleFinalStateElectron(const G4Material *, G4double cutEnergy, G4double kineticEnergy)
G4double HighEnergyLimit() const
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *theParticle, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy=DBL_MAX)
G4PenelopeOscillatorManager * oscManager
const G4String & GetName() const
virtual void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
static G4Electron * Definition()
G4double GetHardCrossSection(G4double energy) const
Returns hard cross section at the given energy.
G4ParticleDefinition * GetDefinition() const
const G4PenelopeCrossSection * GetCrossSectionTableForCouple(const G4ParticleDefinition *, const G4Material *, const G4double cut) const
Returns the table of cross sections for the given particle, given material and given cut as a G4Penel...
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *)
G4double BindingEnergy() const
#define G4MUTEX_INITIALIZER
const G4String & GetParticleName() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double fIntrinsicLowEnergyLimit
void SetHighEnergyLimit(G4double)
G4GLOB_DLL std::ostream G4cout
virtual ~G4PenelopeIonisationModel()
size_t GetTableSize() const
const G4ThreeVector & GetMomentumDirection() const
G4PenelopeIonisationXSHandler * theCrossSectionHandler
G4double GetTotalCrossSection(G4double energy) const
Returns total cross section at the given energy.
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4ParticleChangeForLoss * fParticleChange
static G4PenelopeOscillatorManager * GetOscillatorManager()
static const G4double A[nN]
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetParticle(const G4ParticleDefinition *)
G4double GetTotNbOfAtomsPerVolume() const
static G4ProductionCutsTable * GetProductionCutsTable()
virtual G4double MinEnergyCut(const G4ParticleDefinition *, const G4MaterialCutsCouple *)
static G4Positron * Positron()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
G4double fIntrinsicHighEnergyLimit
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double energy(const ThreeVector &p, const G4double m)
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
G4double GetDensityCorrection(const G4Material *, const G4double energy) const
Returns the density coeection for the material at the given energy.
static G4Electron * Electron()
G4VAtomDeexcitation * AtomDeexcitation()
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy)
void BuildXSTable(const G4Material *, G4double cut, const G4ParticleDefinition *, G4bool isMaster=true)
This can be inkoved only by the master.
G4double GetNormalizedShellCrossSection(size_t shellID, G4double energy) const
Returns the hard cross section for the given shell (normalized to 1)
const G4ParticleDefinition * fParticle
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
void SetDeexcitationFlag(G4bool val)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
G4double GetAtomsPerMolecule(const G4Material *)
Returns the total number of atoms per molecule.
G4ThreeVector G4ParticleMomentum
G4double bindingEnergy(G4int A, G4int Z)
G4PenelopeIonisationModel(const G4ParticleDefinition *p=0, const G4String &processName="PenIoni")
void SampleFinalStatePositron(const G4Material *, G4double cutEnergy, G4double kineticEnergy)
static G4AtomicTransitionManager * Instance()
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double, G4double, G4double, G4double, G4double)
static G4Gamma * Definition()
const G4Material * GetMaterial() const