#include <G4PenelopeComptonModel.hh>
Inheritance diagram for G4PenelopeComptonModel:
Public Member Functions | |
G4PenelopeComptonModel (const G4ParticleDefinition *p=0, const G4String &processName="PenCompton") | |
virtual | ~G4PenelopeComptonModel () |
virtual void | Initialise (const G4ParticleDefinition *, const G4DataVector &) |
virtual G4double | CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX) |
virtual G4double | ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double, G4double, G4double, G4double, G4double) |
virtual void | SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) |
void | SetVerbosityLevel (G4int lev) |
G4int | GetVerbosityLevel () |
Protected Attributes | |
G4ParticleChangeForGamma * | fParticleChange |
Definition at line 62 of file G4PenelopeComptonModel.hh.
G4PenelopeComptonModel::G4PenelopeComptonModel | ( | const G4ParticleDefinition * | p = 0 , |
|
const G4String & | processName = "PenCompton" | |||
) |
Definition at line 61 of file G4PenelopeComptonModel.cc.
References G4PenelopeOscillatorManager::GetOscillatorManager(), G4AtomicTransitionManager::Instance(), G4VEmModel::SetDeexcitationFlag(), and G4VEmModel::SetHighEnergyLimit().
00063 :G4VEmModel(nam),fParticleChange(0),isInitialised(false),fAtomDeexcitation(0), 00064 oscManager(0) 00065 { 00066 fIntrinsicLowEnergyLimit = 100.0*eV; 00067 fIntrinsicHighEnergyLimit = 100.0*GeV; 00068 // SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 00069 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 00070 // 00071 oscManager = G4PenelopeOscillatorManager::GetOscillatorManager(); 00072 00073 verboseLevel= 0; 00074 // Verbosity scale: 00075 // 0 = nothing 00076 // 1 = warning for energy non-conservation 00077 // 2 = details of energy budget 00078 // 3 = calculation of cross sections, file openings, sampling of atoms 00079 // 4 = entering in methods 00080 00081 //Mark this model as "applicable" for atomic deexcitation 00082 SetDeexcitationFlag(true); 00083 00084 fTransitionManager = G4AtomicTransitionManager::Instance(); 00085 }
G4PenelopeComptonModel::~G4PenelopeComptonModel | ( | ) | [virtual] |
G4double G4PenelopeComptonModel::ComputeCrossSectionPerAtom | ( | const G4ParticleDefinition * | , | |
G4double | , | |||
G4double | , | |||
G4double | , | |||
G4double | , | |||
G4double | ||||
) | [virtual] |
Reimplemented from G4VEmModel.
Definition at line 198 of file G4PenelopeComptonModel.cc.
References G4cout, and G4endl.
00204 { 00205 G4cout << "*** G4PenelopeComptonModel -- WARNING ***" << G4endl; 00206 G4cout << "Penelope Compton model v2008 does not calculate cross section _per atom_ " << G4endl; 00207 G4cout << "so the result is always zero. For physics values, please invoke " << G4endl; 00208 G4cout << "GetCrossSectionPerVolume() or GetMeanFreePath() via the G4EmCalculator" << G4endl; 00209 return 0; 00210 }
G4double G4PenelopeComptonModel::CrossSectionPerVolume | ( | const G4Material * | , | |
const G4ParticleDefinition * | , | |||
G4double | kineticEnergy, | |||
G4double | cutEnergy = 0.0 , |
|||
G4double | maxEnergy = DBL_MAX | |||
) | [virtual] |
Reimplemented from G4VEmModel.
Definition at line 128 of file G4PenelopeComptonModel.cc.
References G4cout, G4endl, G4PenelopeOscillatorManager::GetAtomsPerMolecule(), G4Material::GetName(), G4PenelopeOscillatorManager::GetOscillatorTableCompton(), G4Material::GetTotNbOfAtomsPerVolume(), G4INCL::Math::pi, and G4VEmModel::SetupForMaterial().
00133 { 00134 // Penelope model v2008 to calculate the Compton scattering cross section: 00135 // D. Brusa et al., Nucl. Instrum. Meth. A 379 (1996) 167 00136 // 00137 // The cross section for Compton scattering is calculated according to the Klein-Nishina 00138 // formula for energy > 5 MeV. 00139 // For E < 5 MeV it is used a parametrization for the differential cross-section dSigma/dOmega, 00140 // which is integrated numerically in cos(theta), G4PenelopeComptonModel::DifferentialCrossSection(). 00141 // The parametrization includes the J(p) 00142 // distribution profiles for the atomic shells, that are tabulated from Hartree-Fock calculations 00143 // from F. Biggs et al., At. Data Nucl. Data Tables 16 (1975) 201 00144 // 00145 if (verboseLevel > 3) 00146 G4cout << "Calling CrossSectionPerVolume() of G4PenelopeComptonModel" << G4endl; 00147 SetupForMaterial(p, material, energy); 00148 00149 //Retrieve the oscillator table for this material 00150 G4PenelopeOscillatorTable* theTable = oscManager->GetOscillatorTableCompton(material); 00151 00152 G4double cs = 0; 00153 00154 if (energy < 5*MeV) //explicit calculation for E < 5 MeV 00155 { 00156 size_t numberOfOscillators = theTable->size(); 00157 for (size_t i=0;i<numberOfOscillators;i++) 00158 { 00159 G4PenelopeOscillator* theOsc = (*theTable)[i]; 00160 //sum contributions coming from each oscillator 00161 cs += OscillatorTotalCrossSection(energy,theOsc); 00162 } 00163 } 00164 else //use Klein-Nishina for E>5 MeV 00165 cs = KleinNishinaCrossSection(energy,material); 00166 00167 //cross sections are in units of pi*classic_electr_radius^2 00168 cs *= pi*classic_electr_radius*classic_electr_radius; 00169 00170 //Now, cs is the cross section *per molecule*, let's calculate the 00171 //cross section per volume 00172 00173 G4double atomDensity = material->GetTotNbOfAtomsPerVolume(); 00174 G4double atPerMol = oscManager->GetAtomsPerMolecule(material); 00175 00176 if (verboseLevel > 3) 00177 G4cout << "Material " << material->GetName() << " has " << atPerMol << 00178 "atoms per molecule" << G4endl; 00179 00180 G4double moleculeDensity = 0.; 00181 00182 if (atPerMol) 00183 moleculeDensity = atomDensity/atPerMol; 00184 00185 G4double csvolume = cs*moleculeDensity; 00186 00187 if (verboseLevel > 2) 00188 G4cout << "Compton mean free path at " << energy/keV << " keV for material " << 00189 material->GetName() << " = " << (1./csvolume)/mm << " mm" << G4endl; 00190 return csvolume; 00191 }
G4int G4PenelopeComptonModel::GetVerbosityLevel | ( | ) | [inline] |
void G4PenelopeComptonModel::Initialise | ( | const G4ParticleDefinition * | , | |
const G4DataVector & | ||||
) | [virtual] |
Implements G4VEmModel.
Definition at line 94 of file G4PenelopeComptonModel.cc.
References G4LossTableManager::AtomDeexcitation(), fParticleChange, G4cout, G4endl, G4VEmModel::GetParticleChangeForGamma(), G4VEmModel::HighEnergyLimit(), G4LossTableManager::Instance(), and G4VEmModel::LowEnergyLimit().
00096 { 00097 if (verboseLevel > 3) 00098 G4cout << "Calling G4PenelopeComptonModel::Initialise()" << G4endl; 00099 00100 fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation(); 00101 //Issue warning if the AtomicDeexcitation has not been declared 00102 if (!fAtomDeexcitation) 00103 { 00104 G4cout << G4endl; 00105 G4cout << "WARNING from G4PenelopeComptonModel " << G4endl; 00106 G4cout << "Atomic de-excitation module is not instantiated, so there will not be "; 00107 G4cout << "any fluorescence/Auger emission." << G4endl; 00108 G4cout << "Please make sure this is intended" << G4endl; 00109 } 00110 00111 00112 if (verboseLevel > 0) 00113 { 00114 G4cout << "Penelope Compton model v2008 is initialized " << G4endl 00115 << "Energy range: " 00116 << LowEnergyLimit() / keV << " keV - " 00117 << HighEnergyLimit() / GeV << " GeV"; 00118 } 00119 00120 if(isInitialised) return; 00121 fParticleChange = GetParticleChangeForGamma(); 00122 isInitialised = true; 00123 00124 }
void G4PenelopeComptonModel::SampleSecondaries | ( | std::vector< G4DynamicParticle * > * | , | |
const G4MaterialCutsCouple * | , | |||
const G4DynamicParticle * | , | |||
G4double | tmin, | |||
G4double | maxEnergy | |||
) | [virtual] |
Implements G4VEmModel.
Definition at line 214 of file G4PenelopeComptonModel.cc.
References G4AtomicShell::BindingEnergy(), G4InuclSpecialFunctions::bindingEnergy(), G4VAtomDeexcitation::CheckDeexcitationActiveRegion(), G4Electron::Definition(), G4Gamma::Definition(), G4Electron::Electron(), fParticleChange, fStopAndKill, G4cout, G4endl, G4UniformRand, G4VAtomDeexcitation::GenerateParticles(), G4MaterialCutsCouple::GetIndex(), G4DynamicParticle::GetKineticEnergy(), G4MaterialCutsCouple::GetMaterial(), G4DynamicParticle::GetMomentumDirection(), G4PenelopeOscillatorManager::GetOscillatorTableCompton(), G4PenelopeOscillatorManager::GetTotalZ(), G4INCL::Math::pi, G4VParticleChange::ProposeLocalEnergyDeposit(), G4ParticleChangeForGamma::ProposeMomentumDirection(), G4VParticleChange::ProposeTrackStatus(), G4InuclParticleNames::s0, G4ParticleChangeForGamma::SetProposedKineticEnergy(), and G4AtomicTransitionManager::Shell().
00219 { 00220 00221 // Penelope model v2008 to sample the Compton scattering final state. 00222 // D. Brusa et al., Nucl. Instrum. Meth. A 379 (1996) 167 00223 // The model determines also the original shell from which the electron is expelled, 00224 // in order to produce fluorescence de-excitation (from G4DeexcitationManager) 00225 // 00226 // The final state for Compton scattering is calculated according to the Klein-Nishina 00227 // formula for energy > 5 MeV. In this case, the Doppler broadening is negligible and 00228 // one can assume that the target electron is at rest. 00229 // For E < 5 MeV it is used the parametrization for the differential cross-section dSigma/dOmega, 00230 // to sample the scattering angle and the energy of the emerging electron, which is 00231 // G4PenelopeComptonModel::DifferentialCrossSection(). The rejection method is 00232 // used to sample cos(theta). The efficiency increases monotonically with photon energy and is 00233 // nearly independent on the Z; typical values are 35%, 80% and 95% for 1 keV, 1 MeV and 10 MeV, 00234 // respectively. 00235 // The parametrization includes the J(p) distribution profiles for the atomic shells, that are 00236 // tabulated 00237 // from Hartree-Fock calculations from F. Biggs et al., At. Data Nucl. Data Tables 16 (1975) 201. 00238 // Doppler broadening is included. 00239 // 00240 00241 if (verboseLevel > 3) 00242 G4cout << "Calling SampleSecondaries() of G4PenelopeComptonModel" << G4endl; 00243 00244 G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy(); 00245 00246 if (photonEnergy0 <= fIntrinsicLowEnergyLimit) 00247 { 00248 fParticleChange->ProposeTrackStatus(fStopAndKill); 00249 fParticleChange->SetProposedKineticEnergy(0.); 00250 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0); 00251 return ; 00252 } 00253 00254 G4ParticleMomentum photonDirection0 = aDynamicGamma->GetMomentumDirection(); 00255 const G4Material* material = couple->GetMaterial(); 00256 00257 G4PenelopeOscillatorTable* theTable = oscManager->GetOscillatorTableCompton(material); 00258 00259 const G4int nmax = 64; 00260 G4double rn[nmax]={0.0}; 00261 G4double pac[nmax]={0.0}; 00262 00263 G4double S=0.0; 00264 G4double epsilon = 0.0; 00265 G4double cosTheta = 1.0; 00266 G4double hartreeFunc = 0.0; 00267 G4double oscStren = 0.0; 00268 size_t numberOfOscillators = theTable->size(); 00269 size_t targetOscillator = 0; 00270 G4double ionEnergy = 0.0*eV; 00271 00272 G4double ek = photonEnergy0/electron_mass_c2; 00273 G4double ek2 = 2.*ek+1.0; 00274 G4double eks = ek*ek; 00275 G4double ek1 = eks-ek2-1.0; 00276 00277 G4double taumin = 1.0/ek2; 00278 G4double a1 = std::log(ek2); 00279 G4double a2 = a1+2.0*ek*(1.0+ek)/(ek2*ek2); 00280 00281 G4double TST = 0; 00282 G4double tau = 0.; 00283 00284 //If the incoming photon is above 5 MeV, the quicker approach based on the 00285 //pure Klein-Nishina formula is used 00286 if (photonEnergy0 > 5*MeV) 00287 { 00288 do{ 00289 do{ 00290 if ((a2*G4UniformRand()) < a1) 00291 tau = std::pow(taumin,G4UniformRand()); 00292 else 00293 tau = std::sqrt(1.0+G4UniformRand()*(taumin*taumin-1.0)); 00294 //rejection function 00295 TST = (1.0+tau*(ek1+tau*(ek2+tau*eks)))/(eks*tau*(1.0+tau*tau)); 00296 }while (G4UniformRand()> TST); 00297 epsilon=tau; 00298 cosTheta = 1.0 - (1.0-tau)/(ek*tau); 00299 00300 //Target shell electrons 00301 TST = oscManager->GetTotalZ(material)*G4UniformRand(); 00302 targetOscillator = numberOfOscillators-1; //last level 00303 S=0.0; 00304 G4bool levelFound = false; 00305 for (size_t j=0;j<numberOfOscillators && !levelFound; j++) 00306 { 00307 S += (*theTable)[j]->GetOscillatorStrength(); 00308 if (S > TST) 00309 { 00310 targetOscillator = j; 00311 levelFound = true; 00312 } 00313 } 00314 //check whether the level is valid 00315 ionEnergy = (*theTable)[targetOscillator]->GetIonisationEnergy(); 00316 }while((epsilon*photonEnergy0-photonEnergy0+ionEnergy) >0); 00317 } 00318 else //photonEnergy0 < 5 MeV 00319 { 00320 //Incoherent scattering function for theta=PI 00321 G4double s0=0.0; 00322 G4double pzomc=0.0; 00323 G4double rni=0.0; 00324 G4double aux=0.0; 00325 for (size_t i=0;i<numberOfOscillators;i++) 00326 { 00327 ionEnergy = (*theTable)[i]->GetIonisationEnergy(); 00328 if (photonEnergy0 > ionEnergy) 00329 { 00330 G4double aux2 = photonEnergy0*(photonEnergy0-ionEnergy)*2.0; 00331 hartreeFunc = (*theTable)[i]->GetHartreeFactor(); 00332 oscStren = (*theTable)[i]->GetOscillatorStrength(); 00333 pzomc = hartreeFunc*(aux2-electron_mass_c2*ionEnergy)/ 00334 (electron_mass_c2*std::sqrt(2.0*aux2+ionEnergy*ionEnergy)); 00335 if (pzomc > 0) 00336 rni = 1.0-0.5*std::exp(0.5-(std::sqrt(0.5)+std::sqrt(2.0)*pzomc)* 00337 (std::sqrt(0.5)+std::sqrt(2.0)*pzomc)); 00338 else 00339 rni = 0.5*std::exp(0.5-(std::sqrt(0.5)-std::sqrt(2.0)*pzomc)* 00340 (std::sqrt(0.5)-std::sqrt(2.0)*pzomc)); 00341 s0 += oscStren*rni; 00342 } 00343 } 00344 //Sampling tau 00345 G4double cdt1 = 0.; 00346 do 00347 { 00348 if ((G4UniformRand()*a2) < a1) 00349 tau = std::pow(taumin,G4UniformRand()); 00350 else 00351 tau = std::sqrt(1.0+G4UniformRand()*(taumin*taumin-1.0)); 00352 cdt1 = (1.0-tau)/(ek*tau); 00353 //Incoherent scattering function 00354 S = 0.; 00355 for (size_t i=0;i<numberOfOscillators;i++) 00356 { 00357 ionEnergy = (*theTable)[i]->GetIonisationEnergy(); 00358 if (photonEnergy0 > ionEnergy) //sum only on excitable levels 00359 { 00360 aux = photonEnergy0*(photonEnergy0-ionEnergy)*cdt1; 00361 hartreeFunc = (*theTable)[i]->GetHartreeFactor(); 00362 oscStren = (*theTable)[i]->GetOscillatorStrength(); 00363 pzomc = hartreeFunc*(aux-electron_mass_c2*ionEnergy)/ 00364 (electron_mass_c2*std::sqrt(2.0*aux+ionEnergy*ionEnergy)); 00365 if (pzomc > 0) 00366 rn[i] = 1.0-0.5*std::exp(0.5-(std::sqrt(0.5)+std::sqrt(2.0)*pzomc)* 00367 (std::sqrt(0.5)+std::sqrt(2.0)*pzomc)); 00368 else 00369 rn[i] = 0.5*std::exp(0.5-(std::sqrt(0.5)-std::sqrt(2.0)*pzomc)* 00370 (std::sqrt(0.5)-std::sqrt(2.0)*pzomc)); 00371 S += oscStren*rn[i]; 00372 pac[i] = S; 00373 } 00374 else 00375 pac[i] = S-1e-6; 00376 } 00377 //Rejection function 00378 TST = S*(1.0+tau*(ek1+tau*(ek2+tau*eks)))/(eks*tau*(1.0+tau*tau)); 00379 }while ((G4UniformRand()*s0) > TST); 00380 00381 cosTheta = 1.0 - cdt1; 00382 G4double fpzmax=0.0,fpz=0.0; 00383 G4double A=0.0; 00384 //Target electron shell 00385 do 00386 { 00387 do 00388 { 00389 TST = S*G4UniformRand(); 00390 targetOscillator = numberOfOscillators-1; //last level 00391 G4bool levelFound = false; 00392 for (size_t i=0;i<numberOfOscillators && !levelFound;i++) 00393 { 00394 if (pac[i]>TST) 00395 { 00396 targetOscillator = i; 00397 levelFound = true; 00398 } 00399 } 00400 A = G4UniformRand()*rn[targetOscillator]; 00401 hartreeFunc = (*theTable)[targetOscillator]->GetHartreeFactor(); 00402 oscStren = (*theTable)[targetOscillator]->GetOscillatorStrength(); 00403 if (A < 0.5) 00404 pzomc = (std::sqrt(0.5)-std::sqrt(0.5-std::log(2.0*A)))/ 00405 (std::sqrt(2.0)*hartreeFunc); 00406 else 00407 pzomc = (std::sqrt(0.5-std::log(2.0-2.0*A))-std::sqrt(0.5))/ 00408 (std::sqrt(2.0)*hartreeFunc); 00409 } while (pzomc < -1); 00410 00411 // F(EP) rejection 00412 G4double XQC = 1.0+tau*(tau-2.0*cosTheta); 00413 G4double AF = std::sqrt(XQC)*(1.0+tau*(tau-cosTheta)/XQC); 00414 if (AF > 0) 00415 fpzmax = 1.0+AF*0.2; 00416 else 00417 fpzmax = 1.0-AF*0.2; 00418 fpz = 1.0+AF*std::max(std::min(pzomc,0.2),-0.2); 00419 }while ((fpzmax*G4UniformRand())>fpz); 00420 00421 //Energy of the scattered photon 00422 G4double T = pzomc*pzomc; 00423 G4double b1 = 1.0-T*tau*tau; 00424 G4double b2 = 1.0-T*tau*cosTheta; 00425 if (pzomc > 0.0) 00426 epsilon = (tau/b1)*(b2+std::sqrt(std::abs(b2*b2-b1*(1.0-T)))); 00427 else 00428 epsilon = (tau/b1)*(b2-std::sqrt(std::abs(b2*b2-b1*(1.0-T)))); 00429 } //energy < 5 MeV 00430 00431 //Ok, the kinematics has been calculated. 00432 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta); 00433 G4double phi = twopi * G4UniformRand() ; 00434 G4double dirx = sinTheta * std::cos(phi); 00435 G4double diry = sinTheta * std::sin(phi); 00436 G4double dirz = cosTheta ; 00437 00438 // Update G4VParticleChange for the scattered photon 00439 G4ThreeVector photonDirection1(dirx,diry,dirz); 00440 photonDirection1.rotateUz(photonDirection0); 00441 fParticleChange->ProposeMomentumDirection(photonDirection1) ; 00442 00443 G4double photonEnergy1 = epsilon * photonEnergy0; 00444 00445 if (photonEnergy1 > 0.) 00446 fParticleChange->SetProposedKineticEnergy(photonEnergy1) ; 00447 else 00448 { 00449 fParticleChange->SetProposedKineticEnergy(0.) ; 00450 fParticleChange->ProposeTrackStatus(fStopAndKill); 00451 } 00452 00453 //Create scattered electron 00454 G4double diffEnergy = photonEnergy0*(1-epsilon); 00455 ionEnergy = (*theTable)[targetOscillator]->GetIonisationEnergy(); 00456 00457 G4double Q2 = 00458 photonEnergy0*photonEnergy0+photonEnergy1*(photonEnergy1-2.0*photonEnergy0*cosTheta); 00459 G4double cosThetaE = 0.; //scattering angle for the electron 00460 00461 if (Q2 > 1.0e-12) 00462 cosThetaE = (photonEnergy0-photonEnergy1*cosTheta)/std::sqrt(Q2); 00463 else 00464 cosThetaE = 1.0; 00465 G4double sinThetaE = std::sqrt(1-cosThetaE*cosThetaE); 00466 00467 //Now, try to handle fluorescence 00468 //Notice: merged levels are indicated with Z=0 and flag=30 00469 G4int shFlag = (*theTable)[targetOscillator]->GetShellFlag(); 00470 G4int Z = (G4int) (*theTable)[targetOscillator]->GetParentZ(); 00471 00472 //initialize here, then check photons created by Atomic-Deexcitation, and the final state e- 00473 G4double bindingEnergy = 0.*eV; 00474 const G4AtomicShell* shell = 0; 00475 00476 //Real level 00477 if (Z > 0 && shFlag<30) 00478 { 00479 shell = fTransitionManager->Shell(Z,shFlag-1); 00480 bindingEnergy = shell->BindingEnergy(); 00481 } 00482 00483 G4double ionEnergyInPenelopeDatabase = ionEnergy; 00484 //protection against energy non-conservation 00485 ionEnergy = std::max(bindingEnergy,ionEnergyInPenelopeDatabase); 00486 00487 //subtract the excitation energy. If not emitted by fluorescence 00488 //the ionization energy is deposited as local energy deposition 00489 G4double eKineticEnergy = diffEnergy - ionEnergy; 00490 G4double localEnergyDeposit = ionEnergy; 00491 G4double energyInFluorescence = 0.; //testing purposes only 00492 G4double energyInAuger = 0; //testing purposes 00493 00494 if (eKineticEnergy < 0) 00495 { 00496 //It means that there was some problem/mismatch between the two databases. 00497 //Try to make it work 00498 //In this case available Energy (diffEnergy) < ionEnergy 00499 //Full residual energy is deposited locally 00500 localEnergyDeposit = diffEnergy; 00501 eKineticEnergy = 0.0; 00502 } 00503 00504 //the local energy deposit is what remains: part of this may be spent for fluorescence. 00505 //Notice: shell might be NULL (invalid!) if shFlag=30. Must be protected 00506 //Now, take care of fluorescence, if required 00507 if (fAtomDeexcitation && shell) 00508 { 00509 G4int index = couple->GetIndex(); 00510 if (fAtomDeexcitation->CheckDeexcitationActiveRegion(index)) 00511 { 00512 size_t nBefore = fvect->size(); 00513 fAtomDeexcitation->GenerateParticles(fvect,shell,Z,index); 00514 size_t nAfter = fvect->size(); 00515 00516 if (nAfter > nBefore) //actual production of fluorescence 00517 { 00518 for (size_t j=nBefore;j<nAfter;j++) //loop on products 00519 { 00520 G4double itsEnergy = ((*fvect)[j])->GetKineticEnergy(); 00521 localEnergyDeposit -= itsEnergy; 00522 if (((*fvect)[j])->GetParticleDefinition() == G4Gamma::Definition()) 00523 energyInFluorescence += itsEnergy; 00524 else if (((*fvect)[j])->GetParticleDefinition() == G4Electron::Definition()) 00525 energyInAuger += itsEnergy; 00526 00527 } 00528 } 00529 00530 } 00531 } 00532 00533 00534 /* 00535 if(DeexcitationFlag() && Z > 5 && shellId>0) { 00536 00537 const G4ProductionCutsTable* theCoupleTable= 00538 G4ProductionCutsTable::GetProductionCutsTable(); 00539 00540 size_t index = couple->GetIndex(); 00541 G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[index]; 00542 G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index]; 00543 00544 // Generation of fluorescence 00545 // Data in EADL are available only for Z > 5 00546 // Protection to avoid generating photons in the unphysical case of 00547 // shell binding energy > photon energy 00548 if (localEnergyDeposit > cutg || localEnergyDeposit > cute) 00549 { 00550 G4DynamicParticle* aPhoton; 00551 deexcitationManager.SetCutForSecondaryPhotons(cutg); 00552 deexcitationManager.SetCutForAugerElectrons(cute); 00553 00554 photonVector = deexcitationManager.GenerateParticles(Z,shellId); 00555 if(photonVector) 00556 { 00557 size_t nPhotons = photonVector->size(); 00558 for (size_t k=0; k<nPhotons; k++) 00559 { 00560 aPhoton = (*photonVector)[k]; 00561 if (aPhoton) 00562 { 00563 G4double itsEnergy = aPhoton->GetKineticEnergy(); 00564 G4bool keepIt = false; 00565 if (itsEnergy <= localEnergyDeposit) 00566 { 00567 //check if good! 00568 if(aPhoton->GetDefinition() == G4Gamma::Gamma() 00569 && itsEnergy >= cutg) 00570 { 00571 keepIt = true; 00572 energyInFluorescence += itsEnergy; 00573 } 00574 if (aPhoton->GetDefinition() == G4Electron::Electron() && 00575 itsEnergy >= cute) 00576 { 00577 energyInAuger += itsEnergy; 00578 keepIt = true; 00579 } 00580 } 00581 //good secondary, register it 00582 if (keepIt) 00583 { 00584 localEnergyDeposit -= itsEnergy; 00585 fvect->push_back(aPhoton); 00586 } 00587 else 00588 { 00589 delete aPhoton; 00590 (*photonVector)[k] = 0; 00591 } 00592 } 00593 } 00594 delete photonVector; 00595 } 00596 } 00597 } 00598 */ 00599 00600 00601 //Always produce explicitely the electron 00602 G4DynamicParticle* electron = 0; 00603 00604 G4double xEl = sinThetaE * std::cos(phi+pi); 00605 G4double yEl = sinThetaE * std::sin(phi+pi); 00606 G4double zEl = cosThetaE; 00607 G4ThreeVector eDirection(xEl,yEl,zEl); //electron direction 00608 eDirection.rotateUz(photonDirection0); 00609 electron = new G4DynamicParticle (G4Electron::Electron(), 00610 eDirection,eKineticEnergy) ; 00611 fvect->push_back(electron); 00612 00613 00614 if (localEnergyDeposit < 0) 00615 { 00616 G4cout << "WARNING-" 00617 << "G4PenelopeComptonModel::SampleSecondaries - Negative energy deposit" 00618 << G4endl; 00619 localEnergyDeposit=0.; 00620 } 00621 fParticleChange->ProposeLocalEnergyDeposit(localEnergyDeposit); 00622 00623 G4double electronEnergy = 0.; 00624 if (electron) 00625 electronEnergy = eKineticEnergy; 00626 if (verboseLevel > 1) 00627 { 00628 G4cout << "-----------------------------------------------------------" << G4endl; 00629 G4cout << "Energy balance from G4PenelopeCompton" << G4endl; 00630 G4cout << "Incoming photon energy: " << photonEnergy0/keV << " keV" << G4endl; 00631 G4cout << "-----------------------------------------------------------" << G4endl; 00632 G4cout << "Scattered photon: " << photonEnergy1/keV << " keV" << G4endl; 00633 G4cout << "Scattered electron " << electronEnergy/keV << " keV" << G4endl; 00634 if (energyInFluorescence) 00635 G4cout << "Fluorescence x-rays: " << energyInFluorescence/keV << " keV" << G4endl; 00636 if (energyInAuger) 00637 G4cout << "Auger electrons: " << energyInAuger/keV << " keV" << G4endl; 00638 G4cout << "Local energy deposit " << localEnergyDeposit/keV << " keV" << G4endl; 00639 G4cout << "Total final state: " << (photonEnergy1+electronEnergy+energyInFluorescence+ 00640 localEnergyDeposit+energyInAuger)/keV << 00641 " keV" << G4endl; 00642 G4cout << "-----------------------------------------------------------" << G4endl; 00643 } 00644 if (verboseLevel > 0) 00645 { 00646 G4double energyDiff = std::fabs(photonEnergy1+ 00647 electronEnergy+energyInFluorescence+ 00648 localEnergyDeposit+energyInAuger-photonEnergy0); 00649 if (energyDiff > 0.05*keV) 00650 G4cout << "Warning from G4PenelopeCompton: problem with energy conservation: " << 00651 (photonEnergy1+electronEnergy+energyInFluorescence+energyInAuger+localEnergyDeposit)/keV << 00652 " keV (final) vs. " << 00653 photonEnergy0/keV << " keV (initial)" << G4endl; 00654 } 00655 }
void G4PenelopeComptonModel::SetVerbosityLevel | ( | G4int | lev | ) | [inline] |
Definition at line 97 of file G4PenelopeComptonModel.hh.
Referenced by Initialise(), and SampleSecondaries().