75 lowEnergyLimit(250*
eV),
76 highEnergyLimit(100*
GeV),
77 intrinsicLowEnergyLimit(10*
eV),
78 intrinsicHighEnergyLimit(100*
GeV)
80 if (lowEnergyLimit < intrinsicLowEnergyLimit ||
81 highEnergyLimit > intrinsicHighEnergyLimit)
83 G4Exception(
"G4LowEnergyCompton::G4LowEnergyCompton()",
85 "Energy outside intrinsic process validity range!");
91 G4String scatterFile =
"comp/ce-sf-";
93 scatterFunctionData->
LoadData(scatterFile);
95 meanFreePathTable = 0;
106 << lowEnergyLimit /
keV <<
" keV - "
107 << highEnergyLimit /
GeV <<
" GeV"
114 delete meanFreePathTable;
115 delete crossSectionHandler;
116 delete scatterFunctionData;
123 crossSectionHandler->
Clear();
124 G4String crossSectionFile =
"comp/ce-cs-";
125 crossSectionHandler->
LoadData(crossSectionFile);
127 delete meanFreePathTable;
158 if (photonEnergy0 <= lowEnergyLimit)
170 G4double alpha1 = -std::log(epsilon0);
171 G4double alpha2 = 0.5 * (1. - epsilon0Sq);
189 epsilonSq = epsilon * epsilon;
193 epsilonSq = epsilon0Sq + (1. - epsilon0Sq) *
G4UniformRand();
194 epsilon = std::sqrt(epsilonSq);
197 oneCosT = (1. - epsilon) / ( epsilon * e0m);
198 sinT2 = oneCosT * (2. - oneCosT);
199 G4double x = std::sqrt(oneCosT/2.) / (wlPhoton/
cm);
201 gReject = (1. - epsilon * sinT2 / (1. + epsilonSq)) * scatteringFunction;
206 G4double sinTheta = std::sqrt (sinT2);
208 G4double dirX = sinTheta * std::cos(phi);
209 G4double dirY = sinTheta * std::sin(phi);
218 G4int maxDopplerIterations = 1000;
220 G4double photonEoriginal = epsilon * photonEnergy0;
231 eMax = photonEnergy0 - bindingE;
237 G4double pDoppler2 = pDoppler * pDoppler;
239 G4double var3 = var2*var2 - pDoppler2;
240 G4double var4 = var2 - pDoppler2 * cosTheta;
241 G4double var = var4*var4 - var3 + pDoppler2 * var3;
247 if (
G4UniformRand() < 0.5) photonE = (var4 - varSqrt) * scale;
248 else photonE = (var4 + varSqrt) * scale;
254 }
while ( iteration <= maxDopplerIterations &&
255 (photonE < 0. || photonE > eMax || photonE < eMax*
G4UniformRand()) );
259 if (iteration >= maxDopplerIterations)
261 photonE = photonEoriginal;
268 photonDirection1.
rotateUz(photonDirection0);
274 if (photonEnergy1 > 0.)
285 G4double eKineticEnergy = photonEnergy0 - photonEnergy1 - bindingE;
288 G4double electronE = photonEnergy0 * (1. - epsilon) + electron_mass_c2;
294 cosThetaE = (eTotalEnergy + photonEnergy1 )* (1. - epsilon) / std::sqrt(electronP2);
295 sinThetaE = -1. * std::sqrt(1. - cosThetaE * cosThetaE);
298 G4double eDirX = sinThetaE * std::cos(phi);
299 G4double eDirY = sinThetaE * std::sin(phi);
309 eDirection.
rotateUz(photonDirection0);
338 size_t materialIndex = couple->
GetIndex();
341 if (energy > highEnergyLimit) meanFreePath = meanFreePathTable->
FindValue(highEnergyLimit,materialIndex);
342 else if (energy < lowEnergyLimit) meanFreePath =
DBL_MAX;
343 else meanFreePath = meanFreePathTable->
FindValue(energy,materialIndex);
G4double GetKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
G4LowEnergyCompton(const G4String &processName="LowEnCompton")
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double BindingEnergy(G4int Z, G4int shellIndex) const
G4RDVEMDataSet * BuildMeanFreePathForMaterials(const G4DataVector *energyCuts=0)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void LoadData(const G4String &fileName)
void BuildPhysicsTable(const G4ParticleDefinition &definition)
REAL *8 function var(A, B, C, D)
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
Hep3Vector & rotateUz(const Hep3Vector &)
G4bool IsApplicable(const G4ParticleDefinition &definition)
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
const G4String & GetProcessName() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double RandomSelectMomentum(G4int Z, G4int shellIndex) const
virtual G4bool Escape(const G4ParticleDefinition *particle, const G4MaterialCutsCouple *couple, G4double energy, G4double safety) const =0
virtual void Initialize(const G4Track &)
void SetNumberOfSecondaries(G4int totSecondaries)
G4StepPoint * GetPostStepPoint() const
G4int SelectRandomAtom(const G4MaterialCutsCouple *couple, G4double e) const
void ProposeEnergy(G4double finalEnergy)
G4ParticleChange aParticleChange
G4double GetSafety() const
void AddSecondary(G4Track *aSecondary)
static G4Electron * Electron()
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &step)
void LoadData(const G4String &dataFile)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void ProposeTrackStatus(G4TrackStatus status)
G4int SelectRandomShell(G4int Z) const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
virtual G4bool LoadData(const G4String &fileName)=0