Changeset 1347 for trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePolarizedPhotoElectricModel.cc
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePolarizedPhotoElectricModel.cc
r1197 r1347 50 50 // 4 = entering in methods 51 51 52 SetDeexcitationFlag(true); 53 ActivateAuger(false); 54 52 55 G4cout << "Livermore Polarized PhotoElectric is constructed " << G4endl 53 56 << "Energy range: " … … 62 65 G4LivermorePolarizedPhotoElectricModel::~G4LivermorePolarizedPhotoElectricModel() 63 66 { 64 if (meanFreePathTable) delete meanFreePathTable;67 // if (meanFreePathTable) delete meanFreePathTable; 65 68 if (crossSectionHandler) delete crossSectionHandler; 66 69 if (shellCrossSectionHandler) delete shellCrossSectionHandler; … … 90 93 91 94 95 /* 92 96 // Energy limits 93 97 94 98 if (LowEnergyLimit() < lowEnergyLimit) 95 96 97 98 99 100 99 { 100 G4cout << "G4LivermorePolarizedPhotoElectricModel: low energy limit increased from " << 101 LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl; 102 SetLowEnergyLimit(lowEnergyLimit); 103 } 104 101 105 if (HighEnergyLimit() > highEnergyLimit) 102 { 103 G4cout << "G4LivermorePolarizedPhotoElectricModel: high energy limit decreased from " << 104 HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl; 105 SetHighEnergyLimit(highEnergyLimit); 106 } 107 106 { 107 G4cout << "G4LivermorePolarizedPhotoElectricModel: high energy limit decreased from " << 108 HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl; 109 SetHighEnergyLimit(highEnergyLimit); 110 } 111 */ 112 108 113 // Reading of data files - all materials are read 109 114 … … 114 119 115 120 meanFreePathTable = 0; 116 meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();121 // meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials(); 117 122 118 123 shellCrossSectionHandler = new G4CrossSectionHandler(); … … 125 130 if (verboseLevel > 2) 126 131 G4cout << "Loaded cross section files for Livermore Polarized PhotoElectric model" << G4endl; 127 132 128 133 InitialiseElementSelectors(particle,cuts); 129 134 … … 138 143 if(isInitialised) return; 139 144 140 if(pParticleChange)145 /* if(pParticleChange) 141 146 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 142 147 else 143 148 fParticleChange = new G4ParticleChangeForGamma(); 144 149 */ 150 151 fParticleChange = GetParticleChangeForGamma(); 152 145 153 isInitialised = true; 146 154 } … … 179 187 180 188 G4double photonEnergy = aDynamicGamma->GetKineticEnergy(); 181 // Within energy limit? 182 183 if(photonEnergy <= lowEnergyLimit) 184 { 185 fParticleChange->ProposeTrackStatus(fStopAndKill); 186 fParticleChange->SetProposedKineticEnergy(0.); 189 G4ThreeVector gammaPolarization0 = aDynamicGamma->GetPolarization(); 190 G4ThreeVector photonDirection = aDynamicGamma->GetMomentumDirection(); 191 192 // kill incident photon 193 194 fParticleChange->SetProposedKineticEnergy(0.); 195 fParticleChange->ProposeTrackStatus(fStopAndKill); 196 197 // low-energy gamma is absorpted by this process 198 199 if (photonEnergy <= lowEnergyLimit) 200 { 187 201 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy); 188 202 return; 189 203 } 190 191 192 G4ThreeVector gammaPolarization0 = aDynamicGamma->GetPolarization(); 193 204 194 205 // Protection: a polarisation parallel to the 195 206 // direction causes problems; 196 207 // in that case find a random polarization 197 208 198 G4ThreeVector photonDirection = aDynamicGamma->GetMomentumDirection();199 200 209 // Make sure that the polarization vector is perpendicular to the 201 210 // gamma direction. If not 202 211 203 212 if(!(gammaPolarization0.isOrthogonal(photonDirection, 1e-6))||(gammaPolarization0.mag()==0)) 204 213 { // only for testing now … … 212 221 } 213 222 } 214 223 215 224 // End of Protection 216 225 217 226 // G4double E0_m = photonEnergy / electron_mass_c2 ; 218 227 219 228 // Select randomly one element in the current material 220 229 221 G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy); 230 // G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy); 231 232 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition(); 233 const G4Element* elm = SelectRandomAtom(couple->GetMaterial(),particle,photonEnergy); 234 G4int Z = (G4int)elm->GetZ(); 222 235 223 236 // Select the ionised shell in the current atom according to shell cross sections … … 229 242 G4double bindingEnergy = shell->BindingEnergy(); 230 243 G4int shellId = shell->ShellId(); 231 232 // Create lists of pointers to DynamicParticles (photons and electrons) 233 // (Is the electron vector necessary? To be checked) 234 std::vector<G4DynamicParticle*>* photonVector = 0; 235 std::vector<G4DynamicParticle*> electronVector; 236 237 G4double energyDeposit = 0.0; 238 244 239 245 // Primary outgoing electron 240 246 241 247 G4double eKineticEnergy = photonEnergy - bindingEnergy; 242 248 … … 256 262 electronDirection, 257 263 eKineticEnergy); 258 electronVector.push_back(electron);264 fvect->push_back(electron); 259 265 } 260 266 else … … 264 270 265 271 266 G4int nElectrons = electronVector.size(); 267 size_t nTotPhotons = 0; 268 G4int nPhotons=0; 269 270 const G4ProductionCutsTable* theCoupleTable= 271 G4ProductionCutsTable::GetProductionCutsTable(); 272 size_t index = couple->GetIndex(); 273 G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[index]; 274 cutg = std::min(cutForLowEnergySecondaryPhotons,cutg); 275 276 G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index]; 277 cute = std::min(cutForLowEnergySecondaryPhotons,cute); 278 279 G4DynamicParticle* aPhoton; 280 281 // Generation of fluorescence 282 // Data in EADL are available only for Z > 5 283 // Protection to avoid generating photons in the unphysical case of 284 // shell binding energy > photon energy 285 if (Z > 5 && (bindingEnergy > cutg || bindingEnergy > cute)) 286 { 287 photonVector = deexcitationManager.GenerateParticles(Z,shellId); 288 nTotPhotons = photonVector->size(); 289 for (size_t k=0; k<nTotPhotons; k++) 290 { 291 aPhoton = (*photonVector)[k]; 292 if (aPhoton) 293 { 294 G4double itsCut = cutg; 295 if(aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cute; 296 297 G4double itsEnergy = aPhoton->GetKineticEnergy(); 298 299 if (itsEnergy > itsCut && itsEnergy <= bindingEnergy) 272 // deexcitation 273 if(DeexcitationFlag() && Z > 5) { 274 const G4ProductionCutsTable* theCoupleTable= 275 G4ProductionCutsTable::GetProductionCutsTable(); 276 size_t index = couple->GetIndex(); 277 G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[index]; 278 //cutg = std::min(cutForLowEnergySecondaryPhotons,cutg); 279 G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index]; 280 //cute = std::min(cutForLowEnergySecondaryPhotons,cute); 281 282 // G4DynamicParticle* aPhoton; 283 284 // Generation of fluorescence 285 // Data in EADL are available only for Z > 5 286 // Protection to avoid generating photons in the unphysical case of 287 // shell binding energy > photon energy 288 if (bindingEnergy > cutg || bindingEnergy > cute) 289 { 290 G4DynamicParticle* aPhoton; 291 deexcitationManager.SetCutForSecondaryPhotons(cutg); 292 deexcitationManager.SetCutForAugerElectrons(cute); 293 std::vector<G4DynamicParticle*>* photonVector = 294 deexcitationManager.GenerateParticles(Z,shellId); 295 size_t nTotPhotons = photonVector->size(); 296 for (size_t k=0; k<nTotPhotons; k++) 297 { 298 aPhoton = (*photonVector)[k]; 299 if (aPhoton) 300 { 301 G4double itsEnergy = aPhoton->GetKineticEnergy(); 302 if (itsEnergy <= bindingEnergy) 300 303 { 301 nPhotons++;302 304 // Local energy deposit is given as the sum of the 303 305 // energies of incident photons minus the energies 304 306 // of the outcoming fluorescence photons 305 307 bindingEnergy -= itsEnergy; 306 308 fvect->push_back(aPhoton); 307 309 } 308 else 309 { 310 delete aPhoton; 311 (*photonVector)[k] = 0; 312 } 313 } 314 } 315 } 310 else 311 { 312 delete aPhoton; 313 (*photonVector)[k] = 0; 314 } 315 } 316 } 317 delete photonVector; 318 } 319 } 320 // excitation energy left 321 fParticleChange->ProposeLocalEnergyDeposit(bindingEnergy); 322 } 323 324 /* 316 325 energyDeposit += bindingEnergy; 317 326 // Final state 318 327 319 328 for (G4int l = 0; l<nElectrons; l++ ) 320 321 322 323 324 325 329 { 330 aPhoton = electronVector[l]; 331 if(aPhoton) { 332 fvect->push_back(aPhoton); 333 } 334 } 326 335 for ( size_t ll = 0; ll < nTotPhotons; ll++) 327 328 329 330 331 332 } 333 334 delete photonVector;335 336 if (energyDeposit < 0)337 { 338 339 340 341 342 } 343 344 // kill incident photon336 { 337 aPhoton = (*photonVector)[ll]; 338 if(aPhoton) { 339 fvect->push_back(aPhoton); 340 } 341 } 342 343 delete photonVector; 344 345 if (energyDeposit < 0) 346 { 347 G4cout << "WARNING - " 348 << "G4LowEnergyPhotoElectric::PostStepDoIt - Negative energy deposit" 349 << G4endl; 350 energyDeposit = 0; 351 } 352 353 // kill incident photon 345 354 fParticleChange->ProposeMomentumDirection( 0., 0., 0. ); 346 355 fParticleChange->SetProposedKineticEnergy(0.); … … 349 358 350 359 } 351 352 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 353 354 void G4LivermorePolarizedPhotoElectricModel::SetCutForLowEnSecPhotons(G4double cut) 355 { 356 cutForLowEnergySecondaryPhotons = cut; 357 deexcitationManager.SetCutForSecondaryPhotons(cut); 358 } 359 360 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 361 362 void G4LivermorePolarizedPhotoElectricModel::SetCutForLowEnSecElectrons(G4double cut) 363 { 364 cutForLowEnergySecondaryElectrons = cut; 365 deexcitationManager.SetCutForAugerElectrons(cut); 366 } 367 368 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 369 370 void G4LivermorePolarizedPhotoElectricModel::ActivateAuger(G4bool val) 371 { 372 deexcitationManager.ActivateAugerElectronProduction(val); 360 */ 361 362 363 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 364 365 void G4LivermorePolarizedPhotoElectricModel::ActivateAuger(G4bool augerbool) 366 { 367 if (!DeexcitationFlag() && augerbool) 368 { 369 G4cout << "WARNING - G4LivermorePolarizedPhotoElectricModel" << G4endl; 370 G4cout << "The use of the Atomic Deexcitation Manager is set to false " << G4endl; 371 G4cout << "Therefore, Auger electrons will be not generated anyway" << G4endl; 372 } 373 deexcitationManager.ActivateAugerElectronProduction(augerbool); 374 if (verboseLevel > 1) 375 G4cout << "Auger production set to " << augerbool << G4endl; 376 373 377 } 374 378 … … 526 530 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 527 531 528 G4double G4LivermorePolarizedPhotoElectricModel::GetMeanFreePath(const G4Track& track, 529 G4double, 530 G4ForceCondition*) 531 { 532 533 const G4DynamicParticle* photon = track.GetDynamicParticle(); 534 G4double energy = photon->GetKineticEnergy(); 535 G4Material* material = track.GetMaterial(); 536 // size_t materialIndex = material->GetIndex(); 537 538 G4double meanFreePath = DBL_MAX; 539 540 // if (energy > highEnergyLimit) 541 // meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex); 542 // else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX; 543 // else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex); 544 545 G4double cross = shellCrossSectionHandler->ValueForMaterial(material,energy); 546 if(cross > 0.0) meanFreePath = 1.0/cross; 547 548 return meanFreePath; 549 550 551 } 552 553 532 /* 533 G4double G4LivermorePolarizedPhotoElectricModel::GetMeanFreePath(const G4Track& track, 534 G4double, 535 G4ForceCondition*) 536 { 537 538 const G4DynamicParticle* photon = track.GetDynamicParticle(); 539 G4double energy = photon->GetKineticEnergy(); 540 G4Material* material = track.GetMaterial(); 541 // size_t materialIndex = material->GetIndex(); 542 543 G4double meanFreePath = DBL_MAX; 544 545 // if (energy > highEnergyLimit) 546 // meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex); 547 // else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX; 548 // else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex); 549 550 G4double cross = shellCrossSectionHandler->ValueForMaterial(material,energy); 551 if(cross > 0.0) meanFreePath = 1.0/cross; 552 553 return meanFreePath; 554 555 556 } 557 */ 558 559
Note: See TracChangeset
for help on using the changeset viewer.