Changeset 1340 for trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreIonisationModel.cc
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreIonisationModel.cc
r1337 r1340 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LivermoreIonisationModel.cc,v 1. 8 2010/03/26 09:32:50pandola Exp $27 // GEANT4 tag $Name: geant4-09-04-beta-01$26 // $Id: G4LivermoreIonisationModel.cc,v 1.9 2010/10/13 07:28:47 pandola Exp $ 27 // GEANT4 tag $Name: emlowen-V09-03-54 $ 28 28 // 29 29 // Author: Luciano Pandola … … 44 44 // - atomic deexcitation managed via G4VEmModel::DeexcitationFlag() is 45 45 // set as "true" (default would be false) 46 // 12 Oct 2010 L Pandola 47 // - add debugging information about energy in 48 // SampleDeexcitationAlongStep() 49 // - generate fluorescence SampleDeexcitationAlongStep() only above 50 // the cuts. 51 // 46 52 // 47 53 … … 125 131 } 126 132 energySpectrum = new G4eIonisationSpectrum(); 127 if (verboseLevel > 0)133 if (verboseLevel > 3) 128 134 G4cout << "G4VEnergySpectrum is initialized" << G4endl; 129 135 … … 159 165 } 160 166 161 if (verboseLevel > 1)167 if (verboseLevel > 3) 162 168 { 163 169 G4cout << "Cross section data: " << G4endl; … … 440 446 //secondaries. The eloss value is updated. 441 447 G4double energyLossBefore = eloss; 448 442 449 if (verboseLevel > 2) 443 G4cout << "Energy loss along step before deexcitation : " << energyLossBefore/keV << 444 " keV" << G4endl; 445 450 { 451 G4cout << "-----------------------------------------------------------" << G4endl; 452 G4cout << " SampleDeexcitationAlongStep() from G4LivermoreIonisation" << G4endl; 453 G4cout << "Energy loss along step before deexcitation : " << energyLossBefore/keV << 454 " keV" << G4endl; 455 } 446 456 G4double incidentEnergy = theTrack.GetDynamicParticle()->GetKineticEnergy(); 447 457 … … 453 463 G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index]; 454 464 455 //Notice: in LowEnergyIonisation, fluorescence is always generated above 250 eV456 //not above the tracking cut.457 //G4double cutForLowEnergySecondaryParticles = 250.0*eV;458 465 459 466 std::vector<G4DynamicParticle*>* deexcitationProducts = … … 505 512 { 506 513 e = aSecondary->GetKineticEnergy(); 507 if ( eTot + e <= eloss ) 514 G4double itsCut = cutg; 515 if (aSecondary->GetParticleDefinition() == G4Electron::Electron()) 516 itsCut = cute; 517 if ( eTot + e <= eloss && e > itsCut ) 508 518 { 509 519 eTot += e; … … 524 534 } 525 535 536 G4double energyLossInFluorescence = 0.0; 526 537 size_t nSecondaries = deexcitationProducts->size(); 527 538 if (nSecondaries > 0) 528 539 { 529 fParticleChange->SetNumberOfSecondaries(nSecondaries); 540 //You may have already secondaries produced by SampleSubCutSecondaries() 541 //at the process G4VEnergyLossProcess 542 G4int secondariesBefore = fParticleChange->GetNumberOfSecondaries(); 543 fParticleChange->SetNumberOfSecondaries(nSecondaries+secondariesBefore); 530 544 const G4StepPoint* preStep = theTrack.GetStep()->GetPreStepPoint(); 531 545 const G4StepPoint* postStep = theTrack.GetStep()->GetPostStepPoint(); … … 538 552 G4double time, q; 539 553 G4ThreeVector position; 540 554 541 555 for (size_t i=0; i<nSecondaries; i++) 542 556 { … … 553 567 position += r; 554 568 G4Track* newTrack = new G4Track(part, time, position); 569 energyLossInFluorescence += eSecondary; 555 570 pParticleChange->AddSecondary(newTrack); 556 571 } … … 566 581 delete deexcitationProducts; 567 582 583 //Check and verbosities. Ensure energy conservation 568 584 if (verboseLevel > 2) 569 G4cout << "Energy loss along step after deexcitation : " << eloss/keV << 570 " keV" << G4endl; 585 { 586 G4cout << "Energy loss along step after deexcitation : " << eloss/keV << 587 " keV" << G4endl; 588 } 589 if (verboseLevel > 1) 590 { 591 G4cout << "------------------------------------------------------------------" << G4endl; 592 G4cout << "Energy in fluorescence: " << energyLossInFluorescence/keV << " keV" << G4endl; 593 G4cout << "Residual energy loss: " << eloss/keV << " keV " << G4endl; 594 G4cout << "Total final: " << (energyLossInFluorescence+eloss)/keV << " keV" << G4endl; 595 G4cout << "Total initial: " << energyLossBefore/keV << " keV" << G4endl; 596 G4cout << "------------------------------------------------------------------" << G4endl; 597 } 598 if (verboseLevel > 0) 599 { 600 if (std::fabs(energyLossBefore-energyLossInFluorescence-eloss)>10*eV) 601 { 602 G4cout << "Found energy non-conservation at SampleDeexcitationAlongStep() " << G4endl; 603 G4cout << "Energy in fluorescence: " << energyLossInFluorescence/keV << " keV" << G4endl; 604 G4cout << "Residual energy loss: " << eloss/keV << " keV " << G4endl; 605 G4cout << "Total final: " << (energyLossInFluorescence+eloss)/keV << " keV" << G4endl; 606 G4cout << "Total initial: " << energyLossBefore/keV << " keV" << G4endl; 607 } 608 } 571 609 } 572 610 … … 655 693 xsis->AddComponent(p); 656 694 } 657 if(verboseLevel> 0) xsis->PrintData();695 if(verboseLevel>3) xsis->PrintData(); 658 696 shellVacancy->AddXsiTable(xsis); 659 697 }
Note: See TracChangeset
for help on using the changeset viewer.