65 :
G4VEmModel(nam),fParticleChange(0),isInitialised(false),
66 scatterFunctionData(0),
67 crossSectionHandler(0),fAtomDeexcitation(0)
69 lowEnergyLimit = 250 * eV;
70 highEnergyLimit = 100 * GeV;
80 if( verboseLevel>0 ) {
81 G4cout <<
"Livermore Compton model is constructed " <<
G4endl
83 << lowEnergyLimit / eV <<
" eV - "
84 << highEnergyLimit / GeV <<
" GeV"
97 delete crossSectionHandler;
98 delete scatterFunctionData;
106 if (verboseLevel > 2) {
107 G4cout <<
"Calling G4LivermoreComptonModel::Initialise()" <<
G4endl;
110 if (crossSectionHandler)
112 crossSectionHandler->
Clear();
113 delete crossSectionHandler;
115 delete scatterFunctionData;
119 G4String crossSectionFile =
"comp/ce-cs-";
120 crossSectionHandler->
LoadData(crossSectionFile);
123 G4String scatterFile =
"comp/ce-sf-";
125 scatterFunctionData->
LoadData(scatterFile);
129 G4String file =
"/doppler/shell-doppler";
134 if (verboseLevel > 2) {
135 G4cout <<
"Loaded cross section files for Livermore Compton model" <<
G4endl;
138 if(isInitialised) {
return; }
139 isInitialised =
true;
145 if( verboseLevel>0 ) {
146 G4cout <<
"Livermore Compton model is initialized " <<
G4endl
162 if (verboseLevel > 3) {
163 G4cout <<
"Calling ComputeCrossSectionPerAtom() of G4LivermoreComptonModel" <<
G4endl;
165 if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) {
return 0.0; }
195 if (verboseLevel > 3) {
196 G4cout <<
"G4LivermoreComptonModel::SampleSecondaries() E(MeV)= "
202 if (photonEnergy0 <= lowEnergyLimit)
210 G4double e0m = photonEnergy0 / electron_mass_c2 ;
218 G4double epsilon0Local = 1. / (1. + 2. * e0m);
219 G4double epsilon0Sq = epsilon0Local * epsilon0Local;
220 G4double alpha1 = -std::log(epsilon0Local);
221 G4double alpha2 = 0.5 * (1. - epsilon0Sq);
223 G4double wlPhoton = h_Planck*c_light/photonEnergy0;
238 epsilonSq = epsilon * epsilon;
242 epsilonSq = epsilon0Sq + (1. - epsilon0Sq) *
G4UniformRand();
243 epsilon = std::sqrt(epsilonSq);
246 oneCosT = (1. - epsilon) / ( epsilon * e0m);
247 sinT2 = oneCosT * (2. - oneCosT);
248 G4double x = std::sqrt(oneCosT/2.) / (wlPhoton/cm);
250 gReject = (1. - epsilon * sinT2 / (1. + epsilonSq)) * scatteringFunction;
255 G4double sinTheta = std::sqrt (sinT2);
257 G4double dirx = sinTheta * std::cos(phi);
258 G4double diry = sinTheta * std::sin(phi);
267 G4int maxDopplerIterations = 1000;
269 G4double photonEoriginal = epsilon * photonEnergy0;
283 eMax = photonEnergy0 - bindingE;
289 G4double pDoppler = pSample * fine_structure_const;
290 G4double pDoppler2 = pDoppler * pDoppler;
292 G4double var3 = var2*var2 - pDoppler2;
293 G4double var4 = var2 - pDoppler2 * cosTheta;
294 G4double var = var4*var4 - var3 + pDoppler2 * var3;
298 G4double scale = photonEnergy0 / var3;
300 if (
G4UniformRand() < 0.5) { photonE = (var4 - varSqrt) * scale; }
301 else { photonE = (var4 + varSqrt) * scale; }
307 }
while ( iteration <= maxDopplerIterations &&
317 if (iteration >= maxDopplerIterations)
319 photonE = photonEoriginal;
326 photonDirection1.
rotateUz(photonDirection0);
331 if (photonEnergy1 > 0.)
343 G4double eKineticEnergy = photonEnergy0 - photonEnergy1 - bindingE;
346 if(eKineticEnergy < 0.0) {
347 bindingE = photonEnergy0 - photonEnergy1;
350 G4double eTotalEnergy = eKineticEnergy + electron_mass_c2;
352 G4double electronE = photonEnergy0 * (1. - epsilon) + electron_mass_c2;
353 G4double electronP2 = electronE*electronE - electron_mass_c2*electron_mass_c2;
358 cosThetaE = (eTotalEnergy + photonEnergy1 )* (1. - epsilon) / std::sqrt(electronP2);
359 sinThetaE = -sqrt((1. - cosThetaE) * (1. + cosThetaE));
362 G4double eDirX = sinThetaE * std::cos(phi);
363 G4double eDirY = sinThetaE * std::sin(phi);
367 eDirection.
rotateUz(photonDirection0);
369 eDirection,eKineticEnergy) ;
370 fvect->push_back(dp);
375 if(fAtomDeexcitation && iteration < maxDopplerIterations) {
378 size_t nbefore = fvect->size();
382 size_t nafter = fvect->size();
383 if(nafter > nbefore) {
384 for (
size_t i=nbefore; i<nafter; ++i) {
385 bindingE -= ((*fvect)[i])->GetKineticEnergy();
390 if(bindingE < 0.0) { bindingE = 0.0; }
G4DLLIMPORT std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
G4double RandomSelectMomentum(G4int Z, G4int shellIndex) const
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4LivermoreComptonModel(const G4ParticleDefinition *p=0, const G4String &nam="LivermoreCompton")
G4ParticleChangeForGamma * fParticleChange
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
virtual ~G4LivermoreComptonModel()
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
const G4Material * GetMaterial() const
const G4String & GetName() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double BindingEnergy(G4int Z, G4int shellIndex) const
void LoadData(const G4String &fileName)
G4int SelectRandomShell(G4int Z) const
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
G4double FindValue(G4int Z, G4double e) const
void LoadData(const G4String &dataFile)
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
virtual G4bool LoadData(const G4String &fileName)=0
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void SetDeexcitationFlag(G4bool val)
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)