Changeset 1055 for trunk/source/processes/electromagnetic/lowenergy/src
- Timestamp:
- May 28, 2009, 4:26:57 PM (15 years ago)
- Location:
- trunk/source/processes/electromagnetic/lowenergy/src
- Files:
-
- 60 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/lowenergy/src/G4AtomicDeexcitation.cc
r1007 r1055 26 26 // 27 27 // $Id: G4AtomicDeexcitation.cc,v 1.11 28 // GEANT4 tag $Name: geant4-09-0 2$28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 29 29 // 30 30 // Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) … … 111 111 } 112 112 113 // Look this in a particular way: only one auger emitted! // 113 // Look this in a particular way: only one auger emitted! // ???? 114 114 while (provShellId > -2); 115 115 … … 297 297 // G4cout << "G4AtomicDeexcitation warning: No Auger transition found" << G4endl; 298 298 // G4cout << "Absorbed enrgy deposited locally" << G4endl; 299 return 0;300 // // G4Exception("G4AtomicDeexcitation: No Auger transition found");299 G4Exception("G4AtomicDeexcitation: No Auger transition found"); 300 return 0; 301 301 } 302 302 } … … 394 394 // G4int augerOriginatingShellId = 0; 395 395 396 G4int numberOfPossibleAuger = 397 (anAugerTransition->AugerTransitionProbabilities(transitionRandomShellId))->size(); 396 G4int numberOfPossibleAuger = 0; 397 numberOfPossibleAuger = anAugerTransition->AugerTransitionProbabilities(transitionRandomShellId)->size(); 398 399 398 400 G4bool foundFlag = false; 399 401 -
trunk/source/processes/electromagnetic/lowenergy/src/G4AugerData.cc
r961 r1055 486 486 // G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl; 487 487 // G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl; 488 G4cout << "AugerTransitionTable complete"<< G4endl;488 //G4cout << "AugerTransitionTable complete"<< G4endl; 489 489 } 490 490 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4BremsstrahlungCrossSectionHandler.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BremsstrahlungCrossSectionHandler.cc,v 1. 9 2006/06/29 19:38:42 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4BremsstrahlungCrossSectionHandler.cc,v 1.10 2009/03/03 11:19:18 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 41 41 // 10.10.2001 MGP Revision to improve code quality and consistency with design 42 42 // 21.01.2003 VI cut per region 43 // 03.03.2009 LP Added public method to make a easier migration of 44 // G4LowEnergyBremsstrahlung to G4LivermoreBremsstrahlungModel 43 45 // 44 46 // ------------------------------------------------------------------- … … 55 57 #include "G4ProductionCutsTable.hh" 56 58 59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 60 57 61 G4BremsstrahlungCrossSectionHandler::G4BremsstrahlungCrossSectionHandler(const G4VEnergySpectrum* spec, 58 62 G4VDataSetAlgorithm* ) … … 62 66 } 63 67 68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 64 69 65 70 G4BremsstrahlungCrossSectionHandler::~G4BremsstrahlungCrossSectionHandler() … … 68 73 } 69 74 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 70 76 71 77 std::vector<G4VEMDataSet*>* … … 127 133 return set; 128 134 } 135 136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 137 138 G4double G4BremsstrahlungCrossSectionHandler::GetCrossSectionAboveThresholdForElement(G4double energy, 139 G4double cutEnergy, 140 G4int Z) 141 { 142 G4double value = 0.; 143 if(energy > cutEnergy) 144 { 145 G4double elemCs = FindValue(Z, energy); 146 value = theBR->Probability(Z,cutEnergy, energy, energy); 147 value *= elemCs; 148 } 149 return value; 150 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecrease.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionChargeDecrease.cc,v 1. 4 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionChargeDecrease.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionChargeDecrease.hh" … … 79 79 } 80 80 81 G4cout << G4endl; 82 G4cout << "*******************************************************************************" << G4endl; 83 G4cout << "*******************************************************************************" << G4endl; 84 G4cout << " The class G4CrossSectionChargeDecrease is NOT SUPPORTED ANYMORE. " << G4endl; 85 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 86 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 87 G4cout << "*******************************************************************************" << G4endl; 88 G4cout << "*******************************************************************************" << G4endl; 89 G4cout << G4endl; 81 90 } 82 91 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeIncrease.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionChargeIncrease.cc,v 1. 4 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionChargeIncrease.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionChargeIncrease.hh" … … 79 79 } 80 80 81 G4cout << G4endl; 82 G4cout << "*******************************************************************************" << G4endl; 83 G4cout << "*******************************************************************************" << G4endl; 84 G4cout << " The class G4CrossSectionChargeIncrease is NOT SUPPORTED ANYMORE. " << G4endl; 85 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 86 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 87 G4cout << "*******************************************************************************" << G4endl; 88 G4cout << "*******************************************************************************" << G4endl; 89 G4cout << G4endl; 81 90 } 82 91 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticChampion.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionElasticChampion.cc,v 1. 4 2008/12/05 11:58:16sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionElasticChampion.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // ------------------------------------------------------------------- 29 29 … … 57 57 G4Exception("G4CrossSectionElasticChampion constructor: electron is not defined"); 58 58 } 59 60 G4cout << G4endl; 61 G4cout << "*******************************************************************************" << G4endl; 62 G4cout << "*******************************************************************************" << G4endl; 63 G4cout << " The class G4CrossSectionElasticChampion is NOT SUPPORTED ANYMORE. " << G4endl; 64 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 65 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 66 G4cout << "*******************************************************************************" << G4endl; 67 G4cout << "*******************************************************************************" << G4endl; 68 G4cout << G4endl; 59 69 } 60 70 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticScreenedRutherfordHE.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionElasticScreenedRutherfordHE.cc,v 1. 2 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionElasticScreenedRutherfordHE.cc,v 1.3 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionElasticScreenedRutherfordHE.hh" … … 35 35 lowEnergyLimit = 200. * eV; 36 36 highEnergyLimit = 10. * MeV; 37 38 G4cout << G4endl; 39 G4cout << "*******************************************************************************" << G4endl; 40 G4cout << "*******************************************************************************" << G4endl; 41 G4cout << " The class G4CrossSectionElasticScreenedRutherfordHE is NOT SUPPORTED ANYMORE. " << G4endl; 42 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 43 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 44 G4cout << "*******************************************************************************" << G4endl; 45 G4cout << "*******************************************************************************" << G4endl; 46 G4cout << G4endl; 37 47 } 38 48 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticScreenedRutherfordLE.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionElasticScreenedRutherfordLE.cc,v 1. 2 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionElasticScreenedRutherfordLE.cc,v 1.3 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionElasticScreenedRutherfordLE.hh" … … 35 35 lowEnergyLimit = 0 * eV; 36 36 highEnergyLimit = 200 * eV; 37 38 G4cout << G4endl; 39 G4cout << "*******************************************************************************" << G4endl; 40 G4cout << "*******************************************************************************" << G4endl; 41 G4cout << " The class G4CrossSectionElasticScreenedRutherfordLE is NOT SUPPORTED ANYMORE. " << G4endl; 42 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 43 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 44 G4cout << "*******************************************************************************" << G4endl; 45 G4cout << "*******************************************************************************" << G4endl; 46 G4cout << G4endl; 37 47 } 38 48 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationBorn.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionExcitationBorn.cc,v 1. 4 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionExcitationBorn.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionExcitationBorn.hh" … … 36 36 highEnergyLimit = 10 * MeV; 37 37 table = 0; 38 39 G4cout << G4endl; 40 G4cout << "*******************************************************************************" << G4endl; 41 G4cout << "*******************************************************************************" << G4endl; 42 G4cout << " The class G4CrossSectionExcitationBorn is NOT SUPPORTED ANYMORE. " << G4endl; 43 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 44 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 45 G4cout << "*******************************************************************************" << G4endl; 46 G4cout << "*******************************************************************************" << G4endl; 47 G4cout << G4endl; 38 48 } 39 49 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglou.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionExcitationEmfietzoglou.cc,v 1. 5 2008/12/05 11:58:16sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionExcitationEmfietzoglou.cc,v 1.6 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionExcitationEmfietzoglou.hh" … … 35 35 lowEnergyLimit = 8.23 * eV; 36 36 highEnergyLimit = 10. * MeV; 37 38 G4cout << G4endl; 39 G4cout << "*******************************************************************************" << G4endl; 40 G4cout << "*******************************************************************************" << G4endl; 41 G4cout << " The class G4CrossSectionExcitationEmfietzoglou is NOT SUPPORTED ANYMORE. " << G4endl; 42 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 43 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 44 G4cout << "*******************************************************************************" << G4endl; 45 G4cout << "*******************************************************************************" << G4endl; 46 G4cout << G4endl; 37 47 } 38 48 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreen.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionExcitationMillerGreen.cc,v 1. 4 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionExcitationMillerGreen.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionExcitationMillerGreen.hh" … … 92 92 } 93 93 94 95 G4cout << G4endl; 96 G4cout << "*******************************************************************************" << G4endl; 97 G4cout << "*******************************************************************************" << G4endl; 98 G4cout << " The class G4CrossSectionExcitationMillerGreen is NOT SUPPORTED ANYMORE. " << G4endl; 99 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 100 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 101 G4cout << "*******************************************************************************" << G4endl; 102 G4cout << "*******************************************************************************" << G4endl; 103 G4cout << G4endl; 94 104 } 95 105 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreenPartial.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionExcitationMillerGreenPartial.cc,v 1. 2 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionExcitationMillerGreenPartial.cc,v 1.3 2009/01/20 07:40:53 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionExcitationMillerGreenPartial.hh" … … 115 115 tCorrected = k * kineticEnergyCorrection[particleTypeIndex]; 116 116 117 // SI - added protection 118 if (tCorrected < waterExcitation.ExcitationEnergy(excitationLevel)) return 0; 119 // 120 117 121 G4int z = 10; 118 122 … … 158 162 // ELECTRON CORRECTION 159 163 160 if ( particle == instance->GetIon("alpha++")) 164 if ( particle == instance->GetIon("alpha++")|| 165 particle == G4Proton::ProtonDefinition()) 166 161 167 { while (i > 0) 162 168 { -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBorn.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionIonisationBorn.cc,v 1. 4 2008/08/20 14:51:48sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionIonisationBorn.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionIonisationBorn.hh" … … 82 82 G4Exception("G4CrossSectionIonisationBorn Constructor: proton is not defined"); 83 83 } 84 85 G4cout << G4endl; 86 G4cout << "*******************************************************************************" << G4endl; 87 G4cout << "*******************************************************************************" << G4endl; 88 G4cout << " The class G4CrossSectionIonisationBorn is NOT SUPPORTED ANYMORE. " << G4endl; 89 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 90 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 91 G4cout << "*******************************************************************************" << G4endl; 92 G4cout << "*******************************************************************************" << G4endl; 93 G4cout << G4endl; 84 94 } 85 95 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBornPartial.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionIonisationBornPartial.cc,v 1. 4 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionIonisationBornPartial.cc,v 1.5 2009/01/20 07:40:53 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionIonisationBornPartial.hh" … … 33 33 G4CrossSectionIonisationBornPartial::G4CrossSectionIonisationBornPartial() 34 34 { 35 lowEnergyLimitDefault = 25* eV;35 lowEnergyLimitDefault = 12.61 * eV; 36 36 highEnergyLimitDefault = 30 * keV; 37 37 … … 52 52 tableFile[electron] = fileElectron; 53 53 54 lowEnergyLimit[electron] = 25.* eV;54 lowEnergyLimit[electron] = 12.61 * eV; 55 55 highEnergyLimit[electron] = 30. * keV; 56 56 -
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationRudd.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionIonisationRudd.cc,v 1. 4 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4CrossSectionIonisationRudd.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4CrossSectionIonisationRudd.hh" … … 154 154 G4Exception("G4CrossSectionIonisationRudd Constructor: helium is not defined"); 155 155 } 156 157 G4cout << G4endl; 158 G4cout << "*******************************************************************************" << G4endl; 159 G4cout << "*******************************************************************************" << G4endl; 160 G4cout << " The class G4CrossSectionIonisationRudd is NOT SUPPORTED ANYMORE. " << G4endl; 161 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 162 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 163 G4cout << "*******************************************************************************" << G4endl; 164 G4cout << "*******************************************************************************" << G4endl; 165 G4cout << G4endl; 166 156 167 } 157 168 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeDecrease.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4FinalStateChargeDecrease.cc,v 1. 3 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4FinalStateChargeDecrease.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4FinalStateChargeDecrease.hh" … … 35 35 lowEnergyLimit = 1 * keV; 36 36 highEnergyLimit = 10 * MeV; 37 38 G4cout << G4endl; 39 G4cout << "*******************************************************************************" << G4endl; 40 G4cout << "*******************************************************************************" << G4endl; 41 G4cout << " The class G4FinalStateChargeDecrease is NOT SUPPORTED ANYMORE. " << G4endl; 42 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 43 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 44 G4cout << "*******************************************************************************" << G4endl; 45 G4cout << "*******************************************************************************" << G4endl; 46 G4cout << G4endl; 37 47 } 38 48 … … 70 80 } 71 81 82 //SI - Added protection against total energy deposit 83 product.DoNotDepositEnergy(); 84 // 72 85 product.KillPrimaryParticle(); 86 73 87 product.AddEnergyDeposit(waterBindingEnergy); 74 88 75 89 G4DynamicParticle* aSecondary = new G4DynamicParticle(OutgoingParticleDefinition(definition, finalStateIndex), 76 90 track.GetDynamicParticle()->GetMomentumDirection(), -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeIncrease.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4FinalStateChargeIncrease.cc,v 1. 3 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4FinalStateChargeIncrease.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4FinalStateChargeIncrease.hh" … … 35 35 lowEnergyLimit = 1 * keV; 36 36 highEnergyLimit = 10 * MeV; 37 38 G4cout << G4endl; 39 G4cout << "*******************************************************************************" << G4endl; 40 G4cout << "*******************************************************************************" << G4endl; 41 G4cout << " The class 4FinalStateChargeIncrease is NOT SUPPORTED ANYMORE. " << G4endl; 42 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 43 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 44 G4cout << "*******************************************************************************" << G4endl; 45 G4cout << "*******************************************************************************" << G4endl; 46 G4cout << G4endl; 37 47 } 38 48 … … 48 58 product.Clear(); 49 59 60 //SI - Added protection against total energy deposit 61 product.DoNotDepositEnergy(); 62 // 50 63 product.KillPrimaryParticle(); 51 64 product.AddEnergyDeposit(0.); 65 52 66 G4ParticleDefinition* definition = track.GetDefinition(); 53 67 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticBrennerZaider.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4FinalStateElasticBrennerZaider.cc,v 1. 8 2008/12/05 11:58:16sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4FinalStateElasticBrennerZaider.cc,v 1.9 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4FinalStateElasticBrennerZaider.hh" … … 64 64 gamma100_200Coeff.push_back(-2.96264E-5); 65 65 gamma100_200Coeff.push_back(-1.20655E-7); 66 67 G4cout << G4endl; 68 G4cout << "*******************************************************************************" << G4endl; 69 G4cout << "*******************************************************************************" << G4endl; 70 G4cout << " The class G4FinalStateElasticBrennerZaider is NOT SUPPORTED ANYMORE. " << G4endl; 71 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 72 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 73 G4cout << "*******************************************************************************" << G4endl; 74 G4cout << "*******************************************************************************" << G4endl; 75 G4cout << G4endl; 66 76 } 67 77 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticChampion.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4FinalStateElasticChampion.cc,v 1. 7 2008/12/10 18:25:28sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4FinalStateElasticChampion.cc,v 1.8 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // ------------------------------------------------------------------- 29 29 … … 84 84 G4Exception("G4FinalStateElastiChampion : constructor: electron is not defined"); 85 85 } 86 87 G4cout << G4endl; 88 G4cout << "*******************************************************************************" << G4endl; 89 G4cout << "*******************************************************************************" << G4endl; 90 G4cout << " The class G4FinalStateElastiChampion is NOT SUPPORTED ANYMORE. " << G4endl; 91 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 92 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 93 G4cout << "*******************************************************************************" << G4endl; 94 G4cout << "*******************************************************************************" << G4endl; 95 G4cout << G4endl; 86 96 } 87 97 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticScreenedRutherford.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4FinalStateElasticScreenedRutherford.cc,v 1. 4 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4FinalStateElasticScreenedRutherford.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4FinalStateElasticScreenedRutherford.hh" … … 35 35 lowEnergyLimit = 200 * eV; 36 36 highEnergyLimit = 10 * MeV; 37 38 G4cout << G4endl; 39 G4cout << "*******************************************************************************" << G4endl; 40 G4cout << "*******************************************************************************" << G4endl; 41 G4cout << " The class G4FinalStateElasticScreenedRutherford is NOT SUPPORTED ANYMORE. " << G4endl; 42 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 43 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 44 G4cout << "*******************************************************************************" << G4endl; 45 G4cout << "*******************************************************************************" << G4endl; 46 G4cout << G4endl; 37 47 } 38 48 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationBorn.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4FinalStateExcitationBorn.cc,v 1. 3 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4FinalStateExcitationBorn.cc,v 1.4 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4FinalStateExcitationBorn.hh" … … 35 35 lowEnergyLimit = 500 * keV; 36 36 highEnergyLimit = 10 * MeV; 37 38 G4cout << G4endl; 39 G4cout << "*******************************************************************************" << G4endl; 40 G4cout << "*******************************************************************************" << G4endl; 41 G4cout << " The class G4FinalStateExcitationBorn is NOT SUPPORTED ANYMORE. " << G4endl; 42 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 43 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 44 G4cout << "*******************************************************************************" << G4endl; 45 G4cout << "*******************************************************************************" << G4endl; 46 G4cout << G4endl; 37 47 } 38 48 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationEmfietzoglou.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4FinalStateExcitationEmfietzoglou.cc,v 1. 5 2008/12/05 11:58:16sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4FinalStateExcitationEmfietzoglou.cc,v 1.6 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4FinalStateExcitationEmfietzoglou.hh" … … 35 35 lowEnergyLimit = 8.23 * eV; 36 36 highEnergyLimit = 10 * MeV; 37 38 G4cout << G4endl; 39 G4cout << "*******************************************************************************" << G4endl; 40 G4cout << "*******************************************************************************" << G4endl; 41 G4cout << " The class G4FinalStateExcitationEmfietzoglou is NOT SUPPORTED ANYMORE. " << G4endl; 42 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 43 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 44 G4cout << "*******************************************************************************" << G4endl; 45 G4cout << "*******************************************************************************" << G4endl; 46 G4cout << G4endl; 37 47 } 38 48 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationMillerGreen.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4FinalStateExcitationMillerGreen.cc,v 1. 3 2008/07/14 20:47:34sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4FinalStateExcitationMillerGreen.cc,v 1.4 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4FinalStateExcitationMillerGreen.hh" … … 35 35 lowEnergyLimit = 10 * eV; 36 36 highEnergyLimit = 10 * MeV; 37 38 G4cout << G4endl; 39 G4cout << "*******************************************************************************" << G4endl; 40 G4cout << "*******************************************************************************" << G4endl; 41 G4cout << " The class G4FinalStateExcitationMillerGreen is NOT SUPPORTED ANYMORE. " << G4endl; 42 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 43 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 44 G4cout << "*******************************************************************************" << G4endl; 45 G4cout << "*******************************************************************************" << G4endl; 46 G4cout << G4endl; 37 47 } 38 48 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateIonisationBorn.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4FinalStateIonisationBorn.cc,v 1.1 6 2008/12/06 13:47:12sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4FinalStateIonisationBorn.cc,v 1.17 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4FinalStateIonisationBorn.hh" … … 124 124 G4Exception("G4FinalStateIonisationBorn Constructor: proton is not defined"); 125 125 } 126 127 G4cout << G4endl; 128 G4cout << "*******************************************************************************" << G4endl; 129 G4cout << "*******************************************************************************" << G4endl; 130 G4cout << " The class G4FinalStateIonisationBorn is NOT SUPPORTED ANYMORE. " << G4endl; 131 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 132 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 133 G4cout << "*******************************************************************************" << G4endl; 134 G4cout << "*******************************************************************************" << G4endl; 135 G4cout << G4endl; 126 136 } 127 137 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateIonisationRudd.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4FinalStateIonisationRudd.cc,v 1. 8 2008/08/20 14:51:48sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4FinalStateIonisationRudd.cc,v 1.9 2009/05/02 15:07:47 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #include "G4FinalStateIonisationRudd.hh" … … 70 70 lowEnergyLimit[helium] = 1. * keV; 71 71 highEnergyLimit[helium] = 10. * MeV; 72 73 G4cout << G4endl; 74 G4cout << "*******************************************************************************" << G4endl; 75 G4cout << "*******************************************************************************" << G4endl; 76 G4cout << " The class G4FinalStateIonisationRudd is NOT SUPPORTED ANYMORE. " << G4endl; 77 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 78 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 79 G4cout << "*******************************************************************************" << G4endl; 80 G4cout << "*******************************************************************************" << G4endl; 81 G4cout << G4endl; 72 82 } 73 83 -
trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateProduct.cc
r1007 r1055 25 25 // 26 26 // 27 // $Id: G4FinalStateProduct.cc,v 1. 5 2007/11/09 20:11:04 piaExp $28 // GEANT4 tag $Name: geant4-09-0 2$27 // $Id: G4FinalStateProduct.cc,v 1.6 2009/01/20 07:50:28 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 29 29 // 30 30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 53 53 #include "G4ThreeVector.hh" 54 54 55 G4FinalStateProduct::G4FinalStateProduct() : killStatus(false), isModified(false), localEnergyDeposit(0.), modifiedEnergy(0)55 G4FinalStateProduct::G4FinalStateProduct() : killStatus(false), doNotDepositStatus(false), isModified(false), localEnergyDeposit(0.), modifiedEnergy(0) 56 56 { 57 57 // empty … … 68 68 // Reset object status 69 69 killStatus = false; 70 doNotDepositStatus = false; 70 71 isModified = false; 71 72 localEnergyDeposit = 0.; … … 98 99 } 99 100 101 void G4FinalStateProduct::DoNotDepositEnergy() 102 { 103 doNotDepositStatus = true; 104 } 105 100 106 void G4FinalStateProduct::KillPrimaryParticle() 101 107 { 108 102 109 // ---- MGP ---- To be added: Handle local energy deposit here 103 110 killStatus = true; -
trunk/source/processes/electromagnetic/lowenergy/src/G4IonParametrisedLossModel.cc
r1007 r1055 37 37 // First implementation: 10. 11. 2008 38 38 // 39 // Modifications: 40 // 39 // Modifications: 03. 02. 2009 - Bug fix iterators (AL) 40 // 11. 03. 2009 - Introduced new table handler (G4IonDEDXHandler) 41 // and modified method to add/remove tables 42 // (tables are now built in initialisation phase), 43 // Minor bug fix in ComputeDEDXPerVolume (AL) 44 // 11. 05. 2009 - Introduced scaling algorithm for heavier ions: 45 // G4IonDEDXScalingICRU73 (AL) 41 46 // 42 47 // Class description: … … 55 60 #include "G4MaterialStoppingICRU73.hh" 56 61 #include "G4SimpleMaterialStoppingICRU73.hh" 62 #include "G4IronStoppingICRU73.hh" 63 #include "G4VIonDEDXTable.hh" 64 #include "G4VIonDEDXScalingAlgorithm.hh" 65 #include "G4IonDEDXScalingICRU73.hh" 57 66 #include "G4BraggIonModel.hh" 58 67 #include "G4BetheBlochModel.hh" 68 #include "G4ProductionCutsTable.hh" 59 69 #include "G4ParticleChangeForLoss.hh" 60 70 #include "G4LossTableManager.hh" … … 63 73 #include "Randomize.hh" 64 74 75 //#define PRINT_TABLE_BUILT 76 77 78 // ######################################################################### 65 79 66 80 G4IonParametrisedLossModel::G4IonParametrisedLossModel( … … 89 103 betheBlochModel = new G4BetheBlochModel(); 90 104 91 // By default ICRU 73 stopping power tables are loaded 92 AddDEDXTable<G4SimpleMaterialStoppingICRU73>(); 93 AddDEDXTable<G4MaterialStoppingICRU73>(); 105 // By default ICRU 73 stopping power tables are loaded: 106 107 // Ions with Z above between 19 and 21: Ar-40 data is used as basis 108 // for stopping power scaling 109 G4int ionZMin = 19; 110 G4int ionZMax = 21; 111 G4int refIonZ = 18; 112 G4int refIonA = 40; 113 114 AddDEDXTable("ICRU73-elemmat", 115 new G4SimpleMaterialStoppingICRU73, 116 new G4IonDEDXScalingICRU73(ionZMin, ionZMax, refIonZ, refIonA)); 117 118 // Ions with Z above 21: Fe-56 data is used as basis for stopping power 119 // scaling 120 ionZMin = 22; 121 ionZMax = 102; 122 refIonZ = 26; 123 refIonA = 56; 124 125 AddDEDXTable("ICRU73-ironions", 126 new G4IronStoppingICRU73, 127 new G4IonDEDXScalingICRU73(ionZMin, ionZMax, refIonZ, refIonA)); 128 129 // Compound materials: Ar-40 data is used as basis for stopping power 130 // scaling (except for iron ions) 131 ionZMin = 19; 132 ionZMax = 102; 133 refIonZ = 18; 134 refIonA = 40; 135 136 G4IonDEDXScalingICRU73* scaling = 137 new G4IonDEDXScalingICRU73(ionZMin, ionZMax, refIonZ, refIonA); 138 139 G4int ironIonAtomicNumber = 26; 140 scaling -> AddException(ironIonAtomicNumber); 141 142 AddDEDXTable("ICRU73-compmat", 143 new G4MaterialStoppingICRU73, 144 scaling); 94 145 95 146 // The boundaries for the range tables are set … … 107 158 dedxCacheMaterial = 0; 108 159 dedxCacheEnergyCut = 0; 109 dedxCacheIter = lossTableList. begin();160 dedxCacheIter = lossTableList.end(); 110 161 dedxCacheTransitionEnergy = 0.0; 111 162 dedxCacheTransitionFactor = 0.0; … … 113 164 } 114 165 166 // ######################################################################### 115 167 116 168 G4IonParametrisedLossModel::~G4IonParametrisedLossModel() { … … 142 194 } 143 195 196 // ######################################################################### 144 197 145 198 G4double G4IonParametrisedLossModel::MinEnergyCut( … … 151 204 } 152 205 206 // ######################################################################### 153 207 154 208 void G4IonParametrisedLossModel::Initialise( … … 166 220 dedxCacheMaterial = 0; 167 221 dedxCacheEnergyCut = 0; 168 dedxCacheIter = lossTableList. begin();222 dedxCacheIter = lossTableList.end(); 169 223 dedxCacheTransitionEnergy = 0.0; 170 224 dedxCacheTransitionFactor = 0.0; … … 196 250 cutEnergies.clear(); 197 251 for(size_t i = 0; i < size; i++) cutEnergies.push_back(cuts[i]); 252 253 // All dE/dx vectors are built 254 const G4ProductionCutsTable* coupleTable= 255 G4ProductionCutsTable::GetProductionCutsTable(); 256 size_t nmbCouples = coupleTable -> GetTableSize(); 257 258 #ifdef PRINT_TABLE_BUILT 259 G4cout << "G4IonParametrisedLossModel::Initialise():" 260 << " Building dE/dx vectors:" 261 << G4endl; 262 #endif 263 264 for (size_t i = 0; i < nmbCouples; i++) { 265 266 const G4MaterialCutsCouple* couple = 267 coupleTable -> GetMaterialCutsCouple(i); 268 269 const G4Material* material = couple -> GetMaterial(); 270 // G4ProductionCuts* productionCuts = couple -> GetProductionCuts(); 271 272 for(G4int atomicNumberIon = 3; atomicNumberIon < 102; atomicNumberIon++) { 273 274 LossTableList::iterator iter = lossTableList.begin(); 275 LossTableList::iterator iter_end = lossTableList.end(); 276 277 for(;iter != iter_end; iter++) { 278 279 if(*iter == 0) { 280 G4cout << "G4IonParametrisedLossModel::Initialise():" 281 << " Skipping illegal table." 282 << G4endl; 283 } 284 285 G4bool isApplicable = 286 (*iter) -> BuildDEDXTable(atomicNumberIon, material); 287 if(isApplicable) { 288 289 #ifdef PRINT_TABLE_BUILT 290 G4cout << " Atomic Number Ion = " << atomicNumberIon 291 << ", Material = " << material -> GetName() 292 << ", Table = " << (*iter) -> GetName() 293 << G4endl; 294 #endif 295 break; 296 } 297 } 298 } 299 } 198 300 199 301 // The particle change object is cast to G4ParticleChangeForLoss … … 221 323 } 222 324 325 // ######################################################################### 223 326 224 327 G4double G4IonParametrisedLossModel::ComputeCrossSectionPerAtom( … … 285 388 } 286 389 390 // ######################################################################### 287 391 288 392 G4double G4IonParametrisedLossModel::CrossSectionPerVolume( … … 303 407 } 304 408 409 // ######################################################################### 305 410 306 411 G4double G4IonParametrisedLossModel::ComputeDEDXPerVolume( … … 342 447 LossTableList::iterator iter = dedxCacheIter; 343 448 344 if(iter != lossTableList. begin()) {449 if(iter != lossTableList.end()) { 345 450 346 451 G4double transitionEnergy = dedxCacheTransitionEnergy; … … 369 474 if(scaledTransitionEnergy >= lowEnergyLimit) { 370 475 371 G4double factor = 1.0 + dedxCacheTransitionFactor /372 kineticEnergy;373 374 476 dEdx = betheBlochModel -> ComputeDEDXPerVolume( 375 477 material, genericIon, 376 478 scaledKineticEnergy, cutEnergy); 479 480 dEdx *= chargeSquare; 481 482 dEdx += corrections -> ComputeIonCorrections(particle, 483 material, kineticEnergy); 484 485 G4double factor = 1.0 + dedxCacheTransitionFactor / 486 kineticEnergy; 487 377 488 dEdx *= factor; 378 379 } 380 dEdx *= chargeSquare; 381 382 dEdx += corrections -> ComputeIonCorrections(particle, 383 material, kineticEnergy); 489 } 384 490 } 385 491 } … … 446 552 if (dEdx < 0.0) dEdx = 0.0; 447 553 448 #ifdef PRINT_DEBUG449 450 G4cout << "########################################################"451 << G4endl452 << "# G4IonParametrisedLossModel::ComputeDEDXPerVolume"453 << G4endl454 << "# Material =" << material -> GetName()455 << G4endl456 << "# Particle = " << particle -> GetParticleName()457 << G4endl;458 << "# Cut energy (MeV) = " << cutEnergy/MeV459 << G4endl;460 461 G4cout << "#"462 << std::setw(13) << std::right << "E(MeV)"463 << std::setw(14) << "dE/dx(keV/um)"464 << std::setw(14) << "d:dE/dx(keV/um)"465 << std::setw(14) << "(d:dE/dx)/dE/dx"466 << G4endl467 << "# ------------------------------------------------------"468 << G4endl;469 470 G4cout << std::setw(14) << std::right << kineticEnergy / MeV471 << std::setw(14) << (dEdx + dEdXDeltaRays) / keV * um472 << std::setw(14) << dEdXDeltaRays / keV * um473 << std::setw(14) << dEdXDeltaRays / (dEdx + dEdXDeltaRays) * 100.0474 << G4endl;475 #endif476 477 554 return dEdx; 478 555 } 479 556 557 // ######################################################################### 480 558 481 559 void G4IonParametrisedLossModel::PrintDEDXTable( … … 508 586 << std::setw(13) << std::right << "(MeV)" 509 587 << std::setw(14) << "(MeV)" 510 << std::setw(14) << "(MeV/ mm)"588 << std::setw(14) << "(MeV/cm)" 511 589 << std::setw(14) << "(MeV*cm2/mg)" 512 590 << G4endl … … 535 613 G4cout << std::setw(14) << std::right << energy / MeV 536 614 << std::setw(14) << energy / atomicMassNumber / MeV 537 << std::setw(14) << dedx / MeV * mm615 << std::setw(14) << dedx / MeV * cm 538 616 << std::setw(14) << dedx / materialDensity / (MeV*cm2/(0.001*g)) 539 617 << G4endl; … … 541 619 } 542 620 621 // ######################################################################### 622 623 void G4IonParametrisedLossModel::PrintDEDXTableHandlers( 624 const G4ParticleDefinition* particle, // Projectile (ion) 625 const G4Material* material, // Absorber material 626 G4double lowerBoundary, // Minimum energy per nucleon 627 G4double upperBoundary, // Maximum energy per nucleon 628 G4int nmbBins, // Number of bins 629 G4bool logScaleEnergy) { // Logarithmic scaling of energy 630 631 LossTableList::iterator iter = lossTableList.begin(); 632 LossTableList::iterator iter_end = lossTableList.end(); 633 634 for(;iter != iter_end; iter++) { 635 G4bool isApplicable = (*iter) -> IsApplicable(particle, material); 636 if(isApplicable) { 637 (*iter) -> PrintDEDXTable(particle, material, 638 lowerBoundary, upperBoundary, 639 nmbBins,logScaleEnergy); 640 break; 641 } 642 } 643 } 644 645 // ######################################################################### 543 646 544 647 void G4IonParametrisedLossModel::SampleSecondaries( … … 641 744 } 642 745 746 // ######################################################################### 643 747 644 748 void G4IonParametrisedLossModel::UpdateDEDXCache( … … 672 776 673 777 // If any table is applicable, the transition factor is computed: 674 if(iter != lossTableList. begin()) {778 if(iter != lossTableList.end()) { 675 779 676 780 // Retrieving the transition energy from the parameterisation table … … 740 844 } 741 845 846 // ######################################################################### 742 847 743 848 void G4IonParametrisedLossModel::CorrectionsAlongStep( … … 767 872 G4double kineticEnergy = dynamicParticle -> GetKineticEnergy(); 768 873 874 if(kineticEnergy == eloss) { return; } 875 769 876 G4double cutEnergy = DBL_MAX; 770 877 size_t cutIndex = couple -> GetIndex(); … … 777 884 // If parameterization for ions is available the electronic energy loss 778 885 // is overwritten 779 if(iter != lossTableList. begin()) {886 if(iter != lossTableList.end()) { 780 887 781 888 // The energy loss is calculated using the ComputeDEDXPerVolume function … … 832 939 833 940 } 834 835 941 } 836 942 … … 854 960 G4double transitionEnergy = dedxCacheTransitionEnergy; 855 961 856 if(iter != lossTableList. begin() && transitionEnergy < kineticEnergy) {962 if(iter != lossTableList.end() && transitionEnergy < kineticEnergy) { 857 963 chargeSquareRatio *= corrections -> EffectiveChargeCorrection(particle, 858 964 material, … … 862 968 eloss *= chargeSquareRatioCorr; 863 969 } 864 else if (iter == lossTableList. begin()) {970 else if (iter == lossTableList.end()) { 865 971 866 972 chargeSquareRatio *= corrections -> EffectiveChargeCorrection(particle, … … 875 981 // overwrite the energy loss (i.e. when the effective charge approach is 876 982 // used) 877 if(iter == lossTableList. begin()) {983 if(iter == lossTableList.end()) { 878 984 879 985 G4double scaledKineticEnergy = kineticEnergy * dedxCacheGenIonMassRatio; … … 906 1012 particleChangeLoss -> ProposeNonIonizingEnergyDeposit(nloss); 907 1013 } 908 909 } 910 1014 } 1015 1016 // ######################################################################### 911 1017 912 1018 void G4IonParametrisedLossModel::BuildRangeVector( … … 1018 1124 1019 1125 IonMatCouple ionMatCouple = std::make_pair(particle, material); 1020 1126 1021 1127 E[ionMatCouple] = energyRangeVector; 1022 1128 r[ionMatCouple] = rangeEnergyVector; 1023 1129 } 1024 1130 1131 // ######################################################################### 1132 1133 G4double G4IonParametrisedLossModel::GetRange( 1134 const G4ParticleDefinition* particle, // Projectile 1135 const G4Material* material, // Target Material 1136 G4double kineticEnergy) { 1137 1138 G4double range = 0.0; 1139 1140 IonMatCouple couple = std::make_pair(particle, material); 1141 1142 EnergyRangeTable::iterator iter = E.find(couple); 1143 1144 if(iter == E.end()) { 1145 G4cerr << "G4IonParametrisedLossModel::GetRange() No range vector found." 1146 << G4endl; 1147 1148 G4cout << " Ion-material pair: " << particle ->GetParticleName() 1149 << " " << material -> GetName() 1150 << G4endl 1151 << " Available couples:" 1152 << G4endl; 1153 1154 EnergyRangeTable::iterator iter_beg = E.begin(); 1155 EnergyRangeTable::iterator iter_end = E.end(); 1156 1157 for(;iter_beg != iter_end; iter_beg++) { 1158 IonMatCouple key = (*iter_beg).first; 1159 1160 G4cout << " " << (key.first) -> GetParticleName() 1161 << " " << (key.second) -> GetName() 1162 << G4endl; 1163 } 1164 } 1165 else { 1166 G4PhysicsVector* energyRange = (*iter).second; 1167 1168 if(energyRange != 0) { 1169 G4bool b; 1170 1171 // Computing range for kinetic energy: 1172 range = energyRange -> GetValue(kineticEnergy, b); 1173 } 1174 } 1175 1176 return range; 1177 } 1178 1179 // ######################################################################### 1025 1180 1026 1181 G4double G4IonParametrisedLossModel::ComputeLossForStep( … … 1061 1216 if(loss < 0.0) loss = 0.0; 1062 1217 } 1063 1064 #ifdef PRINT_DEBUG1065 G4cout << "G4IonParametrisedLossModel::ComputeLossForStep() E = "1066 << kineticEnergy / MeV << " MeV * "1067 << value.energyScaling << " = "1068 << kineticEnergy * value.energyScaling / MeV1069 << " MeV, dE/dx = " << dedx / MeV * cm << " MeV/cm = "1070 << dedx/factor/MeV*cm << " * " << factor << " MeV/cm; index = "1071 << value.dEdxIndex << ", material = " << material -> GetName()1072 << G4endl;1073 #endif1074 1075 1218 } 1076 1219 1077 1220 return loss; 1078 1221 } 1222 1223 // ######################################################################### 1224 1225 G4bool G4IonParametrisedLossModel::AddDEDXTable( 1226 const G4String& name, 1227 G4VIonDEDXTable* table, 1228 G4VIonDEDXScalingAlgorithm* algorithm) { 1229 1230 if(table == 0) { 1231 G4cerr << "G4IonParametrisedLossModel::AddDEDXTable() Cannot " 1232 << " add table: Invalid pointer." 1233 << G4endl; 1234 1235 return false; 1236 } 1237 1238 // Checking uniqueness of name 1239 LossTableList::iterator iter = lossTableList.begin(); 1240 LossTableList::iterator iter_end = lossTableList.end(); 1241 1242 for(;iter != iter_end; iter++) { 1243 G4String tableName = (*iter) -> GetName(); 1244 1245 if(tableName == name) { 1246 G4cerr << "G4IonParametrisedLossModel::AddDEDXTable() Cannot " 1247 << " add table: Name already exists." 1248 << G4endl; 1249 1250 return false; 1251 } 1252 } 1253 1254 G4VIonDEDXScalingAlgorithm* scalingAlgorithm = algorithm; 1255 if(scalingAlgorithm == 0) 1256 scalingAlgorithm = new G4VIonDEDXScalingAlgorithm; 1257 1258 G4IonDEDXHandler* handler = 1259 new G4IonDEDXHandler(table, scalingAlgorithm, name); 1260 1261 lossTableList.push_front(handler); 1262 1263 return true; 1264 } 1265 1266 // ######################################################################### 1267 1268 G4bool G4IonParametrisedLossModel::RemoveDEDXTable( 1269 const G4String& name) { 1270 1271 LossTableList::iterator iter = lossTableList.begin(); 1272 LossTableList::iterator iter_end = lossTableList.end(); 1273 1274 for(;iter != iter_end; iter++) { 1275 G4String tableName = (*iter) -> GetName(); 1276 1277 if(tableName == name) { 1278 delete (*iter); 1279 1280 lossTableList.erase(iter); 1281 return true; 1282 } 1283 } 1284 1285 return false; 1286 } 1287 1288 // ######################################################################### 1289 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreComptonModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LivermoreComptonModel.cc,v 1.1 2008/10/30 14:17:46 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02 $ 28 // 26 // $Id: G4LivermoreComptonModel.cc,v 1.6 2009/04/18 18:29:34 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 // 29 // 30 // Author: Sebastien Inserti 31 // 30 October 2008 32 // 33 // History: 34 // -------- 35 // 18 Apr 2009 V Ivanchenko Cleanup initialisation and generation of secondaries: 36 // - apply internal high-energy limit only in constructor 37 // - do not apply low-energy limit (default is 0) 38 // - remove GetMeanFreePath method and table 39 // - added protection against numerical problem in energy sampling 40 // - use G4ElementSelector 29 41 30 42 #include "G4LivermoreComptonModel.hh" … … 37 49 38 50 G4LivermoreComptonModel::G4LivermoreComptonModel(const G4ParticleDefinition*, 39 const G4String& nam) 40 :G4VEmModel(nam),isInitialised(false) 51 const G4String& nam) 52 :G4VEmModel(nam),isInitialised(false),meanFreePathTable(0), 53 scatterFunctionData(0),crossSectionHandler(0) 41 54 { 42 lowEnergyLimit = 250 * eV; // SI - Could be 10 eV ?55 lowEnergyLimit = 250 * eV; 43 56 highEnergyLimit = 100 * GeV; 44 SetLowEnergyLimit(lowEnergyLimit);57 // SetLowEnergyLimit(lowEnergyLimit); 45 58 SetHighEnergyLimit(highEnergyLimit); 46 59 47 verboseLevel= 0;60 verboseLevel=0 ; 48 61 // Verbosity scale: 49 62 // 0 = nothing … … 52 65 // 3 = calculation of cross sections, file openings, sampling of atoms 53 66 // 4 = entering in methods 54 55 G4cout << "Livermore Compton model is constructed " << G4endl 56 << "Energy range: " 57 << lowEnergyLimit / keV << " keV - " 58 << highEnergyLimit / GeV << " GeV" 59 << G4endl; 60 67 68 if( verboseLevel>0 ) { 69 G4cout << "Livermore Compton model is constructed " << G4endl 70 << "Energy range: " 71 << lowEnergyLimit / eV << " eV - " 72 << highEnergyLimit / GeV << " GeV" 73 << G4endl; 74 } 61 75 } 62 76 … … 65 79 G4LivermoreComptonModel::~G4LivermoreComptonModel() 66 80 { 67 delete meanFreePathTable; 68 delete crossSectionHandler; 69 delete scatterFunctionData; 81 if (crossSectionHandler) delete crossSectionHandler; 82 if (scatterFunctionData) delete scatterFunctionData; 70 83 } 71 84 … … 73 86 74 87 void G4LivermoreComptonModel::Initialise(const G4ParticleDefinition* particle, 75 88 const G4DataVector& cuts) 76 89 { 77 90 if (verboseLevel > 3) 78 91 G4cout << "Calling G4LivermoreComptonModel::Initialise()" << G4endl; 79 92 80 InitialiseElementSelectors(particle,cuts); 81 82 // Energy limits 83 84 if (LowEnergyLimit() < lowEnergyLimit) 85 { 86 G4cout << "G4LivermoreComptonModel: low energy limit increased from " << 87 LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl; 88 SetLowEnergyLimit(lowEnergyLimit); 89 } 90 91 if (HighEnergyLimit() > highEnergyLimit) 92 { 93 G4cout << "G4LivermoreComptonModel: high energy limit decreased from " << 94 HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl; 95 SetHighEnergyLimit(highEnergyLimit); 96 } 97 93 if (crossSectionHandler) 94 { 95 crossSectionHandler->Clear(); 96 delete crossSectionHandler; 97 } 98 98 99 // Reading of data files - all materials are read 99 100 … … 113 114 shellData.LoadData(file); 114 115 115 meanFreePathTable = 0;116 meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();117 118 116 if (verboseLevel > 2) 119 117 G4cout << "Loaded cross section files for Livermore Compton model" << G4endl; 120 118 121 G4cout << "Livermore Compton model is initialized " << G4endl 122 << "Energy range: " 123 << LowEnergyLimit() / keV << " keV - " 124 << HighEnergyLimit() / GeV << " GeV" 125 << G4endl; 126 127 // 128 119 InitialiseElementSelectors(particle,cuts); 120 121 if( verboseLevel>0 ) { 122 G4cout << "Livermore Compton model is initialized " << G4endl 123 << "Energy range: " 124 << LowEnergyLimit() / eV << " eV - " 125 << HighEnergyLimit() / GeV << " GeV" 126 << G4endl; 127 } 128 // 129 129 if(isInitialised) return; 130 131 if(pParticleChange) 132 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 133 else 134 fParticleChange = new G4ParticleChangeForGamma(); 135 130 fParticleChange = GetParticleChangeForGamma(); 136 131 isInitialised = true; 137 132 } … … 148 143 G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermoreComptonModel" << G4endl; 149 144 150 G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy); 145 if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) return 0.0; 146 147 G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy); 151 148 return cs; 152 149 } … … 155 152 156 153 void G4LivermoreComptonModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect, 157 const G4MaterialCutsCouple* couple, 158 const G4DynamicParticle* aDynamicGamma, 159 G4double, 160 G4double) 154 const G4MaterialCutsCouple* couple, 155 const G4DynamicParticle* aDynamicGamma, 156 G4double, G4double) 161 157 { 158 162 159 // The scattered gamma energy is sampled according to Klein - Nishina formula. 163 160 // then accepted or rejected depending on the Scattering Function multiplied … … 174 171 // (Nucl Phys 20(1960),15). 175 172 176 if (verboseLevel > 3)177 G4cout << "Calling SampleSecondaries() of G4LivermoreComptonModel" << G4endl;178 179 173 G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy(); 180 181 if (photonEnergy0 <= lowEnergyLimit) 182 { 174 175 if (verboseLevel > 3) { 176 G4cout << "G4LivermoreComptonModel::SampleSecondaries() E(MeV)= " 177 << photonEnergy0/MeV << " in " << couple->GetMaterial()->GetName() 178 << G4endl; 179 } 180 181 // low-energy gamma is absorpted by this process 182 if (photonEnergy0 <= lowEnergyLimit) 183 { 183 184 fParticleChange->ProposeTrackStatus(fStopAndKill); 184 185 fParticleChange->SetProposedKineticEnergy(0.); 185 186 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0); 186 // SI - IS THE FOLLOWING RETURN NECESSARY ?187 187 return ; 188 }188 } 189 189 190 190 G4double e0m = photonEnergy0 / electron_mass_c2 ; … … 192 192 193 193 // Select randomly one element in the current material 194 G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0); 194 // G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0); 195 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition(); 196 const G4Element* elm = SelectRandomAtom(couple,particle,photonEnergy0); 197 G4int Z = (G4int)elm->GetZ(); 195 198 196 199 G4double epsilon0 = 1. / (1. + 2. * e0m); … … 212 215 if ( alpha1/(alpha1+alpha2) > G4UniformRand()) 213 216 { 214 epsilon = std::exp(-alpha1 * G4UniformRand()); // std::pow(epsilon0,G4UniformRand()) 217 // std::pow(epsilon0,G4UniformRand()) 218 epsilon = std::exp(-alpha1 * G4UniformRand()); 215 219 epsilonSq = epsilon * epsilon; 216 220 } … … 238 242 // Doppler broadening - Method based on: 239 243 // Y. Namito, S. Ban and H. Hirayama, 240 // "Implementation of the Doppler Broadening of a Compton-Scattered Photon Into the EGS4 Code"241 // NIM A 349, pp. 489-494, 1994244 // "Implementation of the Doppler Broadening of a Compton-Scattered Photon 245 // into the EGS4 Code", NIM A 349, pp. 489-494, 1994 242 246 243 247 // Maximum number of sampling iterations … … 257 261 eMax = photonEnergy0 - bindingE; 258 262 259 // Randomly sample bound electron momentum (memento: the data set is in Atomic Units) 263 // Randomly sample bound electron momentum 264 // (memento: the data set is in Atomic Units) 260 265 G4double pSample = profileData.RandomSelectMomentum(Z,shell); 261 266 // Rescale from atomic units … … 299 304 300 305 if (photonEnergy1 > 0.) 301 {302 fParticleChange->SetProposedKineticEnergy(photonEnergy1) ;303 }306 { 307 fParticleChange->SetProposedKineticEnergy(photonEnergy1) ; 308 } 304 309 else 305 { 306 fParticleChange->SetProposedKineticEnergy(0.) ; 307 fParticleChange->ProposeTrackStatus(fStopAndKill); 308 } 310 { 311 photonEnergy1 = 0.; 312 fParticleChange->SetProposedKineticEnergy(0.) ; 313 fParticleChange->ProposeTrackStatus(fStopAndKill); 314 } 309 315 310 316 // Kinematics of the scattered electron 311 317 G4double eKineticEnergy = photonEnergy0 - photonEnergy1 - bindingE; 318 319 // protection against negative final energy: no e- is created 320 if(eKineticEnergy < 0.0) { 321 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0 - photonEnergy1); 322 return; 323 } 312 324 G4double eTotalEnergy = eKineticEnergy + electron_mass_c2; 313 325 … … 329 341 eDirection.rotateUz(photonDirection0); 330 342 331 // SI - The range test has been removed wrt original G4LowEnergyCompton class343 // SI - The range test has been removed wrt original G4LowEnergyCompton class 332 344 333 345 fParticleChange->ProposeLocalEnergyDeposit(bindingE); 334 346 335 G4DynamicParticle* dp = new G4DynamicParticle (G4Electron::Electron(),eDirection,eKineticEnergy) ; 347 G4DynamicParticle* dp = new G4DynamicParticle (G4Electron::Electron(), 348 eDirection,eKineticEnergy) ; 336 349 fvect->push_back(dp); 337 350 } 338 351 339 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....340 341 G4double G4LivermoreComptonModel::GetMeanFreePath(const G4Track& track,342 G4double, // previousStepSize343 G4ForceCondition*)344 {345 const G4DynamicParticle* photon = track.GetDynamicParticle();346 G4double energy = photon->GetKineticEnergy();347 const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple();348 size_t materialIndex = couple->GetIndex();349 350 G4double meanFreePath;351 if (energy > highEnergyLimit) meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex);352 else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX;353 else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex);354 return meanFreePath;355 }356 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreGammaConversionModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LivermoreGammaConversionModel.cc,v 1.1 2008/10/30 14:16:35 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02 $ 28 // 26 // $Id: G4LivermoreGammaConversionModel.cc,v 1.6 2009/05/02 09:14:43 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 // 29 // 30 // Author: Sebastien Inserti 31 // 30 October 2008 32 // 33 // History: 34 // -------- 35 // 12 Apr 2009 V Ivanchenko Cleanup initialisation and generation of secondaries: 36 // - apply internal high-energy limit only in constructor 37 // - do not apply low-energy limit (default is 0) 38 // - use CLHEP electron mass for low-enegry limit 39 // - remove MeanFreePath method and table 40 29 41 30 42 #include "G4LivermoreGammaConversionModel.hh" … … 37 49 38 50 G4LivermoreGammaConversionModel::G4LivermoreGammaConversionModel(const G4ParticleDefinition*, 39 const G4String& nam) 40 :G4VEmModel(nam),smallEnergy(2.*MeV),isInitialised(false) 41 { 42 lowEnergyLimit = 1.022000 * MeV; 51 const G4String& nam) 52 :G4VEmModel(nam),smallEnergy(2.*MeV),isInitialised(false), 53 crossSectionHandler(0),meanFreePathTable(0) 54 { 55 lowEnergyLimit = 2.0*electron_mass_c2; 43 56 highEnergyLimit = 100 * GeV; 44 45 G4cout << "Livermore Gamma conversion is constructed " << G4endl 46 << "Energy range: " 47 << lowEnergyLimit / keV << " keV - " 48 << highEnergyLimit / GeV << " GeV" 49 << G4endl; 50 57 SetHighEnergyLimit(highEnergyLimit); 58 51 59 verboseLevel= 0; 52 60 // Verbosity scale: … … 57 65 // 4 = entering in methods 58 66 67 if(verboseLevel > 0) { 68 G4cout << "Livermore Gamma conversion is constructed " << G4endl 69 << "Energy range: " 70 << lowEnergyLimit / MeV << " MeV - " 71 << highEnergyLimit / GeV << " GeV" 72 << G4endl; 73 } 59 74 } 60 75 … … 63 78 G4LivermoreGammaConversionModel::~G4LivermoreGammaConversionModel() 64 79 { 65 delete meanFreePathTable;66 delete crossSectionHandler; 67 } 68 69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 70 71 void G4LivermoreGammaConversionModel::Initialise(const G4ParticleDefinition* particle,72 const G4DataVector& cuts)80 if (crossSectionHandler) delete crossSectionHandler; 81 } 82 83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 84 85 void 86 G4LivermoreGammaConversionModel::Initialise(const G4ParticleDefinition*, 87 const G4DataVector&) 73 88 { 74 89 if (verboseLevel > 3) 75 90 G4cout << "Calling G4LivermoreGammaConversionModel::Initialise()" << G4endl; 76 91 77 InitialiseElementSelectors(particle,cuts); 78 79 // Energy limits 80 81 if (LowEnergyLimit() < lowEnergyLimit) 92 if (crossSectionHandler) 82 93 { 83 G4cout << "G4LivermoreGammaConversionModel: low energy limit increased from " << 84 LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl; 85 SetLowEnergyLimit(lowEnergyLimit); 94 crossSectionHandler->Clear(); 95 delete crossSectionHandler; 86 96 } 87 97 88 if (HighEnergyLimit() > highEnergyLimit)89 {90 G4cout << "G4LivermoreGammaConversionModel: high energy limit decreased from " <<91 HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl;92 SetHighEnergyLimit(highEnergyLimit);93 }94 95 98 // Read data tables for all materials 96 99 97 100 crossSectionHandler = new G4CrossSectionHandler(); 98 crossSectionHandler->Initialise(0, 1.0220*MeV,100.*GeV,400);101 crossSectionHandler->Initialise(0,lowEnergyLimit,100.*GeV,400); 99 102 G4String crossSectionFile = "pair/pp-cs-"; 100 103 crossSectionHandler->LoadData(crossSectionFile); 101 104 102 meanFreePathTable = 0;103 meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();104 105 105 // 106 106 … … 108 108 G4cout << "Loaded cross section files for PenelopeGammaConversion" << G4endl; 109 109 110 G4cout << "Livermore Gamma Conversion model is initialized " << G4endl 111 << "Energy range: " 112 << LowEnergyLimit() / MeV << " MeV - " 113 << HighEnergyLimit() / GeV << " GeV" 114 << G4endl; 110 if (verboseLevel > 0) { 111 G4cout << "Livermore Gamma Conversion model is initialized " << G4endl 112 << "Energy range: " 113 << LowEnergyLimit() / MeV << " MeV - " 114 << HighEnergyLimit() / GeV << " GeV" 115 << G4endl; 116 } 115 117 116 118 if(isInitialised) return; 117 118 i f(pParticleChange)119 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 120 else 121 fParticleChange = new G4ParticleChangeForGamma(); 122 isInitialised = true;} 123 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 126 G4double G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom( 127 const G4ParticleDefinition*, 128 G4double GammaEnergy, 129 G4double Z, G4double,130 G4double, G4double)131 { 132 if (verboseLevel > 3)133 G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermoreGammaConversionModel" << G4endl;119 fParticleChange = GetParticleChangeForGamma(); 120 isInitialised = true; 121 } 122 123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 124 125 G4double 126 G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 127 G4double GammaEnergy, 128 G4double Z, G4double, 129 G4double, G4double) 130 { 131 if (verboseLevel > 3) { 132 G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermoreGammaConversionModel" 133 << G4endl; 134 } 135 if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) return 0; 134 136 135 137 G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy); … … 173 175 { 174 176 // Select randomly one element in the current material 175 const G4Element* element = crossSectionHandler->SelectRandomElement(couple,photonEnergy); 177 //const G4Element* element = crossSectionHandler->SelectRandomElement(couple,photonEnergy); 178 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition(); 179 const G4Element* element = SelectRandomAtom(couple,particle,photonEnergy); 176 180 177 181 if (element == 0) 178 182 { 179 G4cout << "G4LivermoreGammaConversionModel::SampleSecondaries - element = 0" << G4endl; 183 G4cout << "G4LivermoreGammaConversionModel::SampleSecondaries - element = 0" 184 << G4endl; 185 return; 180 186 } 181 187 G4IonisParamElm* ionisation = element->GetIonisation(); 182 188 if (ionisation == 0) 183 189 { 184 G4cout << "G4LivermoreGammaConversionModel::SampleSecondaries - ionisation = 0" << G4endl; 190 G4cout << "G4LivermoreGammaConversionModel::SampleSecondaries - ionisation = 0" 191 << G4endl; 192 return; 185 193 } 186 194 … … 272 280 // distribution with respect to the Z axis along the parent photon 273 281 274 // aParticleChange.SetNumberOfSecondaries(2) ;275 282 G4double electronKineEnergy = std::max(0.,electronTotEnergy - electron_mass_c2) ; 276 283 277 // SI - The range test has been removed wrt original G4LowEnergyGammaconversion class284 // SI - The range test has been removed wrt original G4LowEnergyGammaconversion class 278 285 279 286 G4ThreeVector electronDirection (dxEle, dyEle, dzEle); … … 287 294 G4double positronKineEnergy = std::max(0.,positronTotEnergy - electron_mass_c2) ; 288 295 289 // SI - The range test has been removed wrt original G4LowEnergyGammaconversion class296 // SI - The range test has been removed wrt original G4LowEnergyGammaconversion class 290 297 291 298 G4ThreeVector positronDirection (dxPos, dyPos, dzPos); … … 337 344 } 338 345 339 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....340 341 G4double G4LivermoreGammaConversionModel::GetMeanFreePath(const G4Track& track,342 G4double, // previousStepSize343 G4ForceCondition*)344 {345 const G4DynamicParticle* photon = track.GetDynamicParticle();346 G4double energy = photon->GetKineticEnergy();347 const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple();348 size_t materialIndex = couple->GetIndex();349 350 G4double meanFreePath;351 if (energy > highEnergyLimit) meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex);352 else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX;353 else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex);354 return meanFreePath;355 }356 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePhotoElectricModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LivermorePhotoElectricModel.cc,v 1.1 2008/10/30 14:16:35 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02 $ 28 // 26 // $Id: G4LivermorePhotoElectricModel.cc,v 1.7 2009/04/18 18:29:34 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 // 29 // 30 // Author: Sebastien Inserti 31 // 30 October 2008 32 // 33 // History: 34 // -------- 35 // 15 Apr 2009 V Ivanchenko Cleanup initialisation and generation of secondaries: 36 // - apply internal high-energy limit only in constructor 37 // - do not apply low-energy limit (default is 0) 38 // - remove GetMeanFreePath method and table 39 // - simplify sampling of deexcitation by using cut in energy 40 // - added protection against numerical problem in energy sampling 41 // - use G4ElementSelector 29 42 30 43 #include "G4LivermorePhotoElectricModel.hh" … … 38 51 G4LivermorePhotoElectricModel::G4LivermorePhotoElectricModel(const G4ParticleDefinition*, 39 52 const G4String& nam) 40 :G4VEmModel(nam),isInitialised(false) 41 { 42 lowEnergyLimit = 250 * eV; // SI - Could be 10 eV ? 53 :G4VEmModel(nam),isInitialised(false),meanFreePathTable(0), 54 crossSectionHandler(0),shellCrossSectionHandler(0),ElectronAngularGenerator(0) 55 { 56 lowEnergyLimit = 250 * eV; 43 57 highEnergyLimit = 100 * GeV; 44 SetLowEnergyLimit(lowEnergyLimit);58 // SetLowEnergyLimit(lowEnergyLimit); 45 59 SetHighEnergyLimit(highEnergyLimit); 46 47 G4cout << "Livermore Compton is constructed " << G4endl 48 << "Energy range: " 49 << lowEnergyLimit / keV << " keV - " 50 << highEnergyLimit / GeV << " GeV" 51 << G4endl; 52 60 61 ActivateAuger(false); 62 53 63 verboseLevel= 0; 54 64 // Verbosity scale: … … 58 68 // 3 = calculation of cross sections, file openings, sampling of atoms 59 69 // 4 = entering in methods 70 if(verboseLevel>0) { 71 G4cout << "Livermore PhotoElectric is constructed " << G4endl 72 << "Energy range: " 73 << lowEnergyLimit / eV << " eV - " 74 << highEnergyLimit / GeV << " GeV" 75 << G4endl; 76 } 60 77 } 61 78 … … 64 81 G4LivermorePhotoElectricModel::~G4LivermorePhotoElectricModel() 65 82 { 66 delete meanFreePathTable;67 delete crossSectionHandler;68 delete shellCrossSectionHandler;69 delete ElectronAngularGenerator; 70 } 71 72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 73 74 void G4LivermorePhotoElectricModel::Initialise(const G4ParticleDefinition* particle,75 const G4DataVector& cuts)83 if (crossSectionHandler) delete crossSectionHandler; 84 if (shellCrossSectionHandler) delete shellCrossSectionHandler; 85 if (ElectronAngularGenerator) delete ElectronAngularGenerator; 86 } 87 88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 89 90 void 91 G4LivermorePhotoElectricModel::Initialise(const G4ParticleDefinition*, 92 const G4DataVector&) 76 93 { 77 94 if (verboseLevel > 3) 78 95 G4cout << "Calling G4LivermorePhotoElectricModel::Initialise()" << G4endl; 79 96 80 InitialiseElementSelectors(particle,cuts); 81 82 // Energy limits 83 84 if (LowEnergyLimit() < lowEnergyLimit) 97 if (crossSectionHandler) 85 98 { 86 G4cout << "G4LivermorePhotoElectricModel: low energy limit increased from " << 87 LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << 88 G4endl; 89 SetLowEnergyLimit(lowEnergyLimit); 90 } 91 92 if (HighEnergyLimit() > highEnergyLimit) 99 crossSectionHandler->Clear(); 100 delete crossSectionHandler; 101 } 102 103 if (shellCrossSectionHandler) 93 104 { 94 G4cout << "G4LivermorePhotoElectricModel: high energy limit decreased from " << 95 HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" 96 << G4endl; 97 SetHighEnergyLimit(highEnergyLimit); 98 } 99 105 shellCrossSectionHandler->Clear(); 106 delete shellCrossSectionHandler; 107 } 108 100 109 // Read data tables for all materials 101 110 … … 105 114 crossSectionHandler->LoadData(crossSectionFile); 106 115 107 meanFreePathTable = 0;108 meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();109 110 116 shellCrossSectionHandler = new G4CrossSectionHandler(); 111 117 shellCrossSectionHandler->Clear(); … … 113 119 shellCrossSectionHandler->LoadShellData(shellCrossSectionFile); 114 120 115 // SI - Buggy default ?121 // SI - Simple generator is buggy 116 122 //generatorName = "geant4.6.2"; 117 123 //ElectronAngularGenerator = new G4PhotoElectricAngularGeneratorSimple("GEANTSimpleGenerator"); // default generator 118 119 // 120 124 ElectronAngularGenerator = 125 new G4PhotoElectricAngularGeneratorSauterGavrila("GEANTSauterGavrilaGenerator"); 126 127 // 121 128 if (verboseLevel > 2) 122 129 G4cout << "Loaded cross section files for Livermore PhotoElectric model" << G4endl; 123 130 124 G4cout << "Livermore PhotoElectric model is initialized " << G4endl 125 << "Energy range: " 126 << LowEnergyLimit() / keV << " keV - " 127 << HighEnergyLimit() / GeV << " GeV" 128 << G4endl; 131 // InitialiseElementSelectors(particle,cuts); 132 133 if (verboseLevel > 0) { 134 G4cout << "Livermore PhotoElectric model is initialized " << G4endl 135 << "Energy range: " 136 << LowEnergyLimit() / eV << " eV - " 137 << HighEnergyLimit() / GeV << " GeV" 138 << G4endl; 139 } 129 140 130 141 if(isInitialised) return; 131 132 if(pParticleChange) 133 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 134 else 135 fParticleChange = new G4ParticleChangeForGamma(); 136 142 fParticleChange = GetParticleChangeForGamma(); 137 143 isInitialised = true; 138 144 } … … 147 153 { 148 154 if (verboseLevel > 3) 149 G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermorePhotoElectricModel" << G4endl; 155 G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermorePhotoElectricModel" 156 << G4endl; 157 158 if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) 159 return 0; 150 160 151 161 G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy); … … 155 165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 156 166 157 void G4LivermorePhotoElectricModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect, 158 const G4MaterialCutsCouple* couple, 159 const G4DynamicParticle* aDynamicGamma, 160 G4double, 161 G4double) 167 void 168 G4LivermorePhotoElectricModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect, 169 const G4MaterialCutsCouple* couple, 170 const G4DynamicParticle* aDynamicGamma, 171 G4double, 172 G4double) 162 173 { 163 174 … … 172 183 G4double photonEnergy = aDynamicGamma->GetKineticEnergy(); 173 184 185 // kill incident photon 186 fParticleChange->SetProposedKineticEnergy(0.); 187 fParticleChange->ProposeTrackStatus(fStopAndKill); 188 189 // low-energy gamma is absorpted by this process 174 190 if (photonEnergy <= lowEnergyLimit) 175 191 { 176 fParticleChange->ProposeTrackStatus(fStopAndKill);177 fParticleChange->SetProposedKineticEnergy(0.);178 192 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy); 179 // SI - IS THE FOLLOWING RETURN NECESSARY ? 180 return ; 193 return; 181 194 } 182 195 183 G4ThreeVector photonDirection = aDynamicGamma->GetMomentumDirection(); // Returns the normalized direction of the momentum 196 // Returns the normalized direction of the momentum 197 G4ThreeVector photonDirection = aDynamicGamma->GetMomentumDirection(); 184 198 185 199 // Select randomly one element in the current material 186 G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy); 200 // G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy); 201 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition(); 202 const G4Element* elm = SelectRandomAtom(couple->GetMaterial(),particle,photonEnergy); 203 G4int Z = (G4int)elm->GetZ(); 187 204 188 205 // Select the ionised shell in the current atom according to shell cross sections … … 195 212 G4int shellId = shell->ShellId(); 196 213 197 // Create lists of pointers to DynamicParticles (photons and electrons)198 // (Is the electron vector necessary? To be checked)199 std::vector<G4DynamicParticle*>* photonVector = 0;200 std::vector<G4DynamicParticle*> electronVector;201 202 G4double energyDeposit = 0.0;203 204 214 // Primary outcoming electron 205 215 G4double eKineticEnergy = photonEnergy - bindingEnergy; … … 209 219 if (eKineticEnergy > 0.) 210 220 { 211 // SI - Removed safety 212 213 // Generate the electron only if with large enough range w.r.t. cuts and safety 214 //G4double safety = aStep.GetPostStepPoint()->GetSafety(); 215 216 //if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety)) 217 { 218 219 // Calculate direction of the photoelectron 220 G4ThreeVector gammaPolarization = aDynamicGamma->GetPolarization(); 221 G4ThreeVector electronDirection = ElectronAngularGenerator->GetPhotoElectronDirection(photonDirection,eKineticEnergy,gammaPolarization,shellId); 222 223 // The electron is created ... 224 G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(), 225 electronDirection, 226 eKineticEnergy); 227 electronVector.push_back(electron); 228 } 229 /*else 230 { 231 energyDeposit += eKineticEnergy; 232 }*/ 221 // Calculate direction of the photoelectron 222 G4ThreeVector gammaPolarization = aDynamicGamma->GetPolarization(); 223 G4ThreeVector electronDirection = 224 ElectronAngularGenerator->GetPhotoElectronDirection(photonDirection, 225 eKineticEnergy, 226 gammaPolarization, 227 shellId); 228 229 // The electron is created ... 230 G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(), 231 electronDirection, 232 eKineticEnergy); 233 fvect->push_back(electron); 233 234 } 234 235 else … … 237 238 } 238 239 239 G4int nElectrons = electronVector.size(); 240 size_t nTotPhotons = 0; 241 G4int nPhotons=0; 242 const G4ProductionCutsTable* theCoupleTable= 243 G4ProductionCutsTable::GetProductionCutsTable(); 244 245 size_t index = couple->GetIndex(); 246 G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[index]; 247 cutg = std::min(cutForLowEnergySecondaryPhotons,cutg); 248 249 G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index]; 250 cute = std::min(cutForLowEnergySecondaryPhotons,cute); 251 252 G4DynamicParticle* aPhoton; 253 254 // Generation of fluorescence 255 // Data in EADL are available only for Z > 5 256 // Protection to avoid generating photons in the unphysical case of 257 // shell binding energy > photon energy 258 if (Z > 5 && (bindingEnergy > cutg || bindingEnergy > cute)) 259 { 260 photonVector = deexcitationManager.GenerateParticles(Z,shellId); 261 nTotPhotons = photonVector->size(); 262 for (size_t k=0; k<nTotPhotons; k++) 263 { 264 aPhoton = (*photonVector)[k]; 265 if (aPhoton) 266 { 267 G4double itsCut = cutg; 268 if(aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cute; 269 G4double itsEnergy = aPhoton->GetKineticEnergy(); 270 271 if (itsEnergy > itsCut && itsEnergy <= bindingEnergy) 272 { 273 nPhotons++; 274 // Local energy deposit is given as the sum of the 275 // energies of incident photons minus the energies 276 // of the outcoming fluorescence photons 277 bindingEnergy -= itsEnergy; 278 279 } 280 else 281 { 282 delete aPhoton; 283 (*photonVector)[k] = 0; 284 } 285 } 286 } 287 } 288 289 energyDeposit += bindingEnergy; 290 291 // Final state 292 293 for (G4int l = 0; l<nElectrons; l++ ) 294 { 295 aPhoton = electronVector[l]; 296 if(aPhoton) { 297 fvect->push_back(aPhoton); 240 // deexcitation 241 if(DeexcitationFlag() && Z > 5) { 242 243 const G4ProductionCutsTable* theCoupleTable= 244 G4ProductionCutsTable::GetProductionCutsTable(); 245 246 size_t index = couple->GetIndex(); 247 G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[index]; 248 G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index]; 249 250 // Generation of fluorescence 251 // Data in EADL are available only for Z > 5 252 // Protection to avoid generating photons in the unphysical case of 253 // shell binding energy > photon energy 254 if (bindingEnergy > cutg || bindingEnergy > cute) 255 { 256 G4DynamicParticle* aPhoton; 257 deexcitationManager.SetCutForSecondaryPhotons(cutg); 258 deexcitationManager.SetCutForAugerElectrons(cute); 259 260 std::vector<G4DynamicParticle*>* photonVector = 261 deexcitationManager.GenerateParticles(Z,shellId); 262 size_t nTotPhotons = photonVector->size(); 263 for (size_t k=0; k<nTotPhotons; k++) 264 { 265 aPhoton = (*photonVector)[k]; 266 if (aPhoton) 267 { 268 G4double itsEnergy = aPhoton->GetKineticEnergy(); 269 if (itsEnergy <= bindingEnergy) 270 { 271 // Local energy deposit is given as the sum of the 272 // energies of incident photons minus the energies 273 // of the outcoming fluorescence photons 274 bindingEnergy -= itsEnergy; 275 fvect->push_back(aPhoton); 276 } 277 else 278 { 279 // abnormal case of energy non-conservation 280 delete aPhoton; 281 (*photonVector)[k] = 0; 282 } 283 } 284 } 285 delete photonVector; 298 286 } 299 } 300 for ( size_t ll = 0; ll < nTotPhotons; ll++) 301 { 302 aPhoton = (*photonVector)[ll]; 303 if(aPhoton) { 304 fvect->push_back(aPhoton); 305 } 306 } 307 308 delete photonVector; 309 310 if (energyDeposit < 0) 311 { 312 G4cout << "WARNING - " 313 << "G4LowEnergyPhotoElectric::PostStepDoIt - Negative energy deposit" 314 << G4endl; 315 energyDeposit = 0; 316 } 317 318 // kill incident photon 319 fParticleChange->ProposeMomentumDirection( 0., 0., 0. ); 320 fParticleChange->SetProposedKineticEnergy(0.); 321 fParticleChange->ProposeTrackStatus(fStopAndKill); 322 fParticleChange->ProposeLocalEnergyDeposit(energyDeposit); 287 } 288 // excitation energy left 289 fParticleChange->ProposeLocalEnergyDeposit(bindingEnergy); 323 290 } 324 291 … … 348 315 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 349 316 350 void G4LivermorePhotoElectricModel::SetAngularGenerator(G4VPhotoElectricAngularDistribution* distribution) 351 { 352 ElectronAngularGenerator = distribution; 317 void 318 G4LivermorePhotoElectricModel::SetAngularGenerator(G4VPhotoElectricAngularDistribution* dist) 319 { 320 ElectronAngularGenerator = dist; 353 321 ElectronAngularGenerator->PrintGeneratorInformation(); 354 322 } … … 361 329 { 362 330 delete ElectronAngularGenerator; 363 ElectronAngularGenerator = new G4PhotoElectricAngularGeneratorSimple("GEANT4LowEnergySimpleGenerator"); 331 ElectronAngularGenerator = 332 new G4PhotoElectricAngularGeneratorSimple("GEANT4LowEnergySimpleGenerator"); 364 333 generatorName = name; 365 334 } … … 367 336 { 368 337 delete ElectronAngularGenerator; 369 ElectronAngularGenerator = new G4PhotoElectricAngularGeneratorSauterGavrila("GEANT4SauterGavrilaGenerator"); 338 ElectronAngularGenerator = 339 new G4PhotoElectricAngularGeneratorSauterGavrila("GEANT4SauterGavrilaGenerator"); 370 340 generatorName = name; 371 341 } … … 373 343 { 374 344 delete ElectronAngularGenerator; 375 ElectronAngularGenerator = new G4PhotoElectricAngularGeneratorPolarized("GEANT4LowEnergyPolarizedGenerator"); 345 ElectronAngularGenerator = 346 new G4PhotoElectricAngularGeneratorPolarized("GEANT4LowEnergyPolarizedGenerator"); 376 347 generatorName = name; 377 348 } … … 384 355 } 385 356 386 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....387 388 G4double G4LivermorePhotoElectricModel::GetMeanFreePath(const G4Track& track,389 G4double, // previousStepSize390 G4ForceCondition*)391 {392 const G4DynamicParticle* photon = track.GetDynamicParticle();393 G4double energy = photon->GetKineticEnergy();394 G4Material* material = track.GetMaterial();395 // size_t materialIndex = material->GetIndex();396 397 G4double meanFreePath = DBL_MAX;398 399 // if (energy > highEnergyLimit)400 // meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex);401 // else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX;402 // else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex);403 404 G4double cross = shellCrossSectionHandler->ValueForMaterial(material,energy);405 if(cross > 0.0) meanFreePath = 1.0/cross;406 407 return meanFreePath;408 }409 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePolarizedComptonModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LivermorePolarizedComptonModel.cc,v 1. 1 2008/10/30 14:16:35 sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4LivermorePolarizedComptonModel.cc,v 1.6 2009/05/03 08:29:55 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 // History: 30 // -------- 31 // 02 May 2009 S Incerti as V. Ivanchenko proposed in G4LivermoreComptonModel.cc 32 // 33 // Cleanup initialisation and generation of secondaries: 34 // - apply internal high-energy limit only in constructor 35 // - do not apply low-energy limit (default is 0) 36 // - remove GetMeanFreePath method and table 37 // - added protection against numerical problem in energy sampling 38 // - use G4ElementSelector 29 39 30 40 #include "G4LivermorePolarizedComptonModel.hh" … … 38 48 G4LivermorePolarizedComptonModel::G4LivermorePolarizedComptonModel(const G4ParticleDefinition*, 39 49 const G4String& nam) 40 :G4VEmModel(nam),isInitialised(false) 41 { 42 lowEnergyLimit = 250 * eV; // SI - Could be 10 eV ?50 :G4VEmModel(nam),isInitialised(false),meanFreePathTable(0),scatterFunctionData(0),crossSectionHandler(0) 51 { 52 lowEnergyLimit = 250 * eV; 43 53 highEnergyLimit = 100 * GeV; 44 SetLowEnergyLimit(lowEnergyLimit);54 //SetLowEnergyLimit(lowEnergyLimit); 45 55 SetHighEnergyLimit(highEnergyLimit); 46 56 … … 53 63 // 4 = entering in methods 54 64 65 if( verboseLevel>0 ) { 55 66 G4cout << "Livermore Polarized Compton is constructed " << G4endl 56 67 << "Energy range: " 57 << lowEnergyLimit / keV << " keV - "68 << lowEnergyLimit / eV << " eV - " 58 69 << highEnergyLimit / GeV << " GeV" 59 70 << G4endl; 60 71 } 61 72 } 62 73 … … 65 76 G4LivermorePolarizedComptonModel::~G4LivermorePolarizedComptonModel() 66 77 { 67 delete meanFreePathTable;68 delete crossSectionHandler;69 delete scatterFunctionData;78 if (meanFreePathTable) delete meanFreePathTable; 79 if (crossSectionHandler) delete crossSectionHandler; 80 if (scatterFunctionData) delete scatterFunctionData; 70 81 } 71 82 … … 78 89 G4cout << "Calling G4LivermorePolarizedComptonModel::Initialise()" << G4endl; 79 90 80 InitialiseElementSelectors(particle,cuts); 81 82 // Energy limits 83 84 if (LowEnergyLimit() < lowEnergyLimit) 85 { 86 G4cout << "G4LivermorePolarizedComptonModel: low energy limit increased from " << 87 LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl; 88 SetLowEnergyLimit(lowEnergyLimit); 89 } 90 91 if (HighEnergyLimit() > highEnergyLimit) 92 { 93 G4cout << "G4LivermorePolarizedComptonModel: high energy limit decreased from " << 94 HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl; 95 SetHighEnergyLimit(highEnergyLimit); 96 } 91 if (crossSectionHandler) 92 { 93 crossSectionHandler->Clear(); 94 delete crossSectionHandler; 95 } 97 96 98 97 // Reading of data files - all materials are read … … 116 115 shellData.LoadData(file); 117 116 118 //119 117 if (verboseLevel > 2) 120 118 G4cout << "Loaded cross section files for Livermore Polarized Compton model" << G4endl; 121 119 122 G4cout << "Livermore Polarized Compton model is initialized " << G4endl 120 InitialiseElementSelectors(particle,cuts); 121 122 if( verboseLevel>0 ) { 123 G4cout << "Livermore Polarized Compton model is initialized " << G4endl 123 124 << "Energy range: " 124 << LowEnergyLimit() / keV << " keV - "125 << LowEnergyLimit() / eV << " eV - " 125 126 << HighEnergyLimit() / GeV << " GeV" 126 127 << G4endl; 127 128 } 129 128 130 // 129 131 130 132 if(isInitialised) return; 131 132 if(pParticleChange) 133 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 134 else 135 fParticleChange = new G4ParticleChangeForGamma(); 136 133 fParticleChange = GetParticleChangeForGamma(); 137 134 isInitialised = true; 138 135 } … … 149 146 G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermorePolarizedComptonModel" << G4endl; 150 147 148 if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) return 0.0; 149 151 150 G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy); 152 151 return cs; … … 203 202 fParticleChange->SetProposedKineticEnergy(0.); 204 203 fParticleChange->ProposeLocalEnergyDeposit(gammaEnergy0); 205 // SI - IS THE FOLLOWING RETURN NECESSARY ?206 204 return; 207 205 } … … 210 208 211 209 // Select randomly one element in the current material 212 213 G4int Z = crossSectionHandler->SelectRandomAtom(couple,gammaEnergy0); 210 //G4int Z = crossSectionHandler->SelectRandomAtom(couple,gammaEnergy0); 211 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition(); 212 const G4Element* elm = SelectRandomAtom(couple,particle,gammaEnergy0); 213 G4int Z = (G4int)elm->GetZ(); 214 214 215 215 // Sample the energy and the polarization of the scattered photon … … 429 429 else 430 430 { 431 gammaEnergy1 = 0.; 431 432 fParticleChange->SetProposedKineticEnergy(0.) ; 432 433 fParticleChange->ProposeTrackStatus(fStopAndKill); … … 439 440 G4double ElecKineEnergy = gammaEnergy0 - gammaEnergy1 -bindingE; 440 441 442 // SI -protection against negative final energy: no e- is created 443 // like in G4LivermoreComptonModel.cc 444 if(ElecKineEnergy < 0.0) { 445 fParticleChange->ProposeLocalEnergyDeposit(gammaEnergy0 - gammaEnergy1); 446 return; 447 } 448 441 449 // SI - Removed range test 442 450 … … 664 672 } 665 673 666 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 667 668 G4double G4LivermorePolarizedComptonModel::GetMeanFreePath(const G4Track& track, 669 G4double, 670 G4ForceCondition*) 671 { 672 const G4DynamicParticle* photon = track.GetDynamicParticle(); 673 G4double energy = photon->GetKineticEnergy(); 674 const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple(); 675 size_t materialIndex = couple->GetIndex(); 676 G4double meanFreePath; 677 if (energy > highEnergyLimit) meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex); 678 else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX; 679 else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex); 680 return meanFreePath; 681 } 682 683 674 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePolarizedRayleighModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LivermorePolarizedRayleighModel.cc,v 1. 1 2008/10/30 14:16:35sincerti Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4LivermorePolarizedRayleighModel.cc,v 1.5 2009/05/02 15:20:53 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 // History: 30 // -------- 31 // 02 May 2009 S Incerti as V. Ivanchenko proposed in G4LivermoreRayleighModel.cc 32 // 33 // Cleanup initialisation and generation of secondaries: 34 // - apply internal high-energy limit only in constructor 35 // - do not apply low-energy limit (default is 0) 36 // - remove GetMeanFreePath method and table 37 // - remove initialisation of element selector 38 // - use G4ElementSelector 29 39 30 40 #include "G4LivermorePolarizedRayleighModel.hh" … … 38 48 G4LivermorePolarizedRayleighModel::G4LivermorePolarizedRayleighModel(const G4ParticleDefinition*, 39 49 const G4String& nam) 40 :G4VEmModel(nam),isInitialised(false) 41 { 42 lowEnergyLimit = 250 * eV; // SI - Could be 10 eV ?50 :G4VEmModel(nam),isInitialised(false),crossSectionHandler(0),formFactorData(0) 51 { 52 lowEnergyLimit = 250 * eV; 43 53 highEnergyLimit = 100 * GeV; 44 54 45 SetLowEnergyLimit(lowEnergyLimit);55 //SetLowEnergyLimit(lowEnergyLimit); 46 56 SetHighEnergyLimit(highEnergyLimit); 47 57 // … … 54 64 // 4 = entering in methods 55 65 56 G4cout << "Livermore Polarized Rayleigh is constructed " << G4endl 66 if(verboseLevel > 0) { 67 G4cout << "Livermore Polarized Rayleigh is constructed " << G4endl 57 68 << "Energy range: " 58 << lowEnergyLimit / keV << " keV - "69 << lowEnergyLimit / eV << " eV - " 59 70 << highEnergyLimit / GeV << " GeV" 60 71 << G4endl; 72 } 61 73 } 62 74 … … 65 77 G4LivermorePolarizedRayleighModel::~G4LivermorePolarizedRayleighModel() 66 78 { 67 delete crossSectionHandler;68 delete formFactorData;79 if (crossSectionHandler) delete crossSectionHandler; 80 if (formFactorData) delete formFactorData; 69 81 } 70 82 … … 84 96 G4cout << "Calling G4LivermorePolarizedRayleighModel::Initialise()" << G4endl; 85 97 86 InitialiseElementSelectors(particle,cuts); 87 88 // Energy limits 89 90 if (LowEnergyLimit() < lowEnergyLimit) 91 { 92 G4cout << "G4LivermorePolarizedRayleighModel: low energy limit increased from " << 93 LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl; 94 SetLowEnergyLimit(lowEnergyLimit); 95 } 96 if (HighEnergyLimit() > highEnergyLimit) 97 { 98 G4cout << "G4LivermorePolarizedRayleighModel: high energy limit decreased from " << 99 HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl; 100 SetHighEnergyLimit(highEnergyLimit); 101 } 102 98 if (crossSectionHandler) 99 { 100 crossSectionHandler->Clear(); 101 delete crossSectionHandler; 102 } 103 103 104 // Read data files for all materials 104 105 … … 113 114 formFactorData->LoadData(formFactorFile); 114 115 116 InitialiseElementSelectors(particle,cuts); 117 115 118 // 116 119 if (verboseLevel > 2) 117 120 G4cout << "Loaded cross section files for Livermore Polarized Rayleigh model" << G4endl; 118 121 119 G4cout << "Livermore Polarized Rayleigh model is initialized " << G4endl 122 InitialiseElementSelectors(particle,cuts); 123 124 if (verboseLevel > 0) { 125 G4cout << "Livermore Polarized Rayleigh model is initialized " << G4endl 120 126 << "Energy range: " 121 << LowEnergyLimit() / keV << " keV - "127 << LowEnergyLimit() / eV << " eV - " 122 128 << HighEnergyLimit() / GeV << " GeV" 123 129 << G4endl; 130 } 124 131 125 132 if(isInitialised) return; 126 127 if(pParticleChange) 128 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 129 else 130 fParticleChange = new G4ParticleChangeForGamma(); 131 133 fParticleChange = GetParticleChangeForGamma(); 132 134 isInitialised = true; 133 135 } … … 144 146 G4cout << "Calling CrossSectionPerAtom() of G4LivermorePolarizedRayleighModel" << G4endl; 145 147 148 if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) return 0.0; 149 146 150 G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy); 147 151 return cs; … … 166 170 fParticleChange->SetProposedKineticEnergy(0.); 167 171 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0); 168 // SI - IS THE FOLLOWING RETURN NECESSARY ?169 172 return ; 170 173 } … … 173 176 174 177 // Select randomly one element in the current material 175 G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0); 178 // G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0); 179 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition(); 180 const G4Element* elm = SelectRandomAtom(couple,particle,photonEnergy0); 181 G4int Z = (G4int)elm->GetZ(); 176 182 177 183 G4double outcomingPhotonCosTheta = GenerateCosTheta(photonEnergy0, Z); -
trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreRayleighModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LivermoreRayleighModel.cc,v 1.1 2008/10/30 14:16:35 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02 $ 28 // 26 // $Id: G4LivermoreRayleighModel.cc,v 1.6 2009/04/18 18:29:34 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 // 29 // Author: Sebastien Inserti 30 // 30 October 2008 31 // 32 // History: 33 // -------- 34 // 18 Apr 2009 V Ivanchenko Cleanup initialisation and generation of secondaries: 35 // - apply internal high-energy limit only in constructor 36 // - do not apply low-energy limit (default is 0) 37 // - remove GetMeanFreePath method and table 38 // - remove initialisation of element selector 39 // - use G4ElementSelector 29 40 30 41 #include "G4LivermoreRayleighModel.hh" … … 37 48 38 49 G4LivermoreRayleighModel::G4LivermoreRayleighModel(const G4ParticleDefinition*, 39 const G4String& nam) 40 :G4VEmModel(nam),isInitialised(false) 41 { 42 lowEnergyLimit = 250 * eV; // SI - Could be 10 eV ? 50 const G4String& nam) 51 :G4VEmModel(nam),isInitialised(false),meanFreePathTable(0), 52 formFactorData(0),crossSectionHandler(0) 53 { 54 lowEnergyLimit = 250 * eV; 43 55 highEnergyLimit = 100 * GeV; 44 56 45 SetLowEnergyLimit(lowEnergyLimit);57 // SetLowEnergyLimit(lowEnergyLimit); 46 58 SetHighEnergyLimit(highEnergyLimit); 47 59 // … … 54 66 // 4 = entering in methods 55 67 56 G4cout << "Livermore Rayleigh is constructed " << G4endl 57 << "Energy range: " 58 << lowEnergyLimit / keV << " keV - " 59 << highEnergyLimit / GeV << " GeV" 60 << G4endl; 68 if(verboseLevel > 0) { 69 G4cout << "Livermore Rayleigh is constructed " << G4endl 70 << "Energy range: " 71 << lowEnergyLimit / eV << " eV - " 72 << highEnergyLimit / GeV << " GeV" 73 << G4endl; 74 } 61 75 } 62 76 … … 65 79 G4LivermoreRayleighModel::~G4LivermoreRayleighModel() 66 80 { 67 delete meanFreePathTable; 68 delete crossSectionHandler; 69 delete formFactorData; 81 if (crossSectionHandler) delete crossSectionHandler; 82 if (formFactorData) delete formFactorData; 70 83 } 71 84 … … 73 86 74 87 void G4LivermoreRayleighModel::Initialise(const G4ParticleDefinition* particle, 75 88 const G4DataVector& cuts) 76 89 { 77 90 if (verboseLevel > 3) 78 91 G4cout << "Calling G4LivermoreRayleighModel::Initialise()" << G4endl; 79 92 80 InitialiseElementSelectors(particle,cuts); 81 82 // Energy limits 93 if (crossSectionHandler) 94 { 95 crossSectionHandler->Clear(); 96 delete crossSectionHandler; 97 } 83 98 84 if (LowEnergyLimit() < lowEnergyLimit)85 {86 G4cout << "G4LivermoreRayleighModel: low energy limit increased from " <<87 LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl;88 SetLowEnergyLimit(lowEnergyLimit);89 }90 91 if (HighEnergyLimit() > highEnergyLimit)92 {93 G4cout << "G4LivermoreRayleighModel: high energy limit decreased from " <<94 HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl;95 SetHighEnergyLimit(highEnergyLimit);96 }97 98 99 // Data are read for all materials 99 100 … … 103 104 crossSectionHandler->LoadData(crossSectionFile); 104 105 105 meanFreePathTable = 0;106 meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();107 108 106 G4VDataSetAlgorithm* ffInterpolation = new G4LogLogInterpolation; 109 107 G4String formFactorFile = "rayl/re-ff-"; … … 111 109 formFactorData->LoadData(formFactorFile); 112 110 113 // 114 111 InitialiseElementSelectors(particle,cuts); 112 113 // 115 114 if (verboseLevel > 2) 116 115 G4cout << "Loaded cross section files for Livermore Rayleigh model" << G4endl; 117 116 118 G4cout << "Livermore Rayleigh model is initialized " << G4endl 119 << "Energy range: " 120 << LowEnergyLimit() / keV << " keV - " 121 << HighEnergyLimit() / GeV << " GeV" 122 << G4endl; 117 if (verboseLevel > 0) { 118 G4cout << "Livermore Rayleigh model is initialized " << G4endl 119 << "Energy range: " 120 << LowEnergyLimit() / eV << " eV - " 121 << HighEnergyLimit() / GeV << " GeV" 122 << G4endl; 123 } 123 124 124 125 if(isInitialised) return; 125 126 if(pParticleChange) 127 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 128 else 129 fParticleChange = new G4ParticleChangeForGamma(); 130 126 fParticleChange = GetParticleChangeForGamma(); 131 127 isInitialised = true; 132 128 … … 144 140 G4cout << "Calling CrossSectionPerAtom() of G4LivermoreRayleighModel" << G4endl; 145 141 142 if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) 143 return 0.0; 144 146 145 G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy); 147 146 return cs; … … 160 159 161 160 G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy(); 162 161 162 // absorption of low-energy gamma 163 163 if (photonEnergy0 <= lowEnergyLimit) 164 {164 { 165 165 fParticleChange->ProposeTrackStatus(fStopAndKill); 166 166 fParticleChange->SetProposedKineticEnergy(0.); 167 167 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0); 168 // SI - IS THE FOLLOWING RETURN NECESSARY ?169 168 return ; 170 }169 } 171 170 172 171 G4ParticleMomentum photonDirection0 = aDynamicGamma->GetMomentumDirection(); 173 172 174 173 // Select randomly one element in the current material 175 G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0); 174 // G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0); 175 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition(); 176 const G4Element* elm = SelectRandomAtom(couple,particle,photonEnergy0); 177 G4int Z = (G4int)elm->GetZ(); 176 178 177 179 // Sample the angle of the scattered photon … … 188 190 { 189 191 do 190 191 192 193 192 { 193 cosTheta = 2. * G4UniformRand() - 1.; 194 fcostheta = ( 1. + cosTheta*cosTheta)/2.; 195 } while (fcostheta < G4UniformRand()); 194 196 195 197 G4double sinThetaHalf = std::sqrt((1. - cosTheta) / 2.); 196 198 x = sinThetaHalf / (wlPhoton/cm); 197 199 if (x > 1.e+005) 198 dataFormFactor = formFactorData->FindValue(x,Z-1); 200 { 201 dataFormFactor = formFactorData->FindValue(x,Z-1); 202 } 199 203 else 200 dataFormFactor = formFactorData->FindValue(0.,Z-1); 204 { 205 dataFormFactor = formFactorData->FindValue(0.,Z-1); 206 } 201 207 randomFormFactor = G4UniformRand() * Z * Z; 202 208 sinTheta = std::sqrt(1. - cosTheta*cosTheta); … … 219 225 } 220 226 221 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 222 223 G4double G4LivermoreRayleighModel::GetMeanFreePath(const G4Track& track, 224 G4double, // previousStepSize 225 G4ForceCondition*) 226 { 227 const G4DynamicParticle* photon = track.GetDynamicParticle(); 228 G4double energy = photon->GetKineticEnergy(); 229 const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple(); 230 size_t materialIndex = couple->GetIndex(); 231 232 G4double meanFreePath; 233 if (energy > highEnergyLimit) meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex); 234 else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX; 235 else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex); 236 return meanFreePath; 237 } 238 227 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyBremsstrahlung.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LowEnergyBremsstrahlung.cc,v 1.7 1 2006/06/29 19:40:13 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4LowEnergyBremsstrahlung.cc,v 1.72 2009/05/02 09:59:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // -------------------------------------------------------------- … … 93 93 // angularDistribution->PrintGeneratorInformation(); 94 94 TsaiAngularDistribution = new G4ModifiedTsai("TsaiGenerator"); 95 96 97 G4cout << G4endl; 98 G4cout << "*******************************************************************************" << G4endl; 99 G4cout << "*******************************************************************************" << G4endl; 100 G4cout << " The class G4LowEnergyBremsstrahlung is NOT SUPPORTED ANYMORE. " << G4endl; 101 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 102 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 103 G4cout << "*******************************************************************************" << G4endl; 104 G4cout << "*******************************************************************************" << G4endl; 105 G4cout << G4endl; 95 106 } 96 107 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyCompton.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LowEnergyCompton.cc,v 1.4 7 2008/12/18 13:01:28 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4LowEnergyCompton.cc,v 1.48 2009/05/02 09:59:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // Author: A. Forti … … 104 104 << G4endl; 105 105 } 106 107 G4cout << G4endl; 108 G4cout << "*******************************************************************************" << G4endl; 109 G4cout << "*******************************************************************************" << G4endl; 110 G4cout << " The class G4LowEnergyCompton is NOT SUPPORTED ANYMORE. " << G4endl; 111 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 112 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 113 G4cout << "*******************************************************************************" << G4endl; 114 G4cout << "*******************************************************************************" << G4endl; 115 G4cout << G4endl; 106 116 } 107 117 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyGammaConversion.cc
r1007 r1055 26 26 // -------------------------------------------------------------------- 27 27 /// 28 // $Id: G4LowEnergyGammaConversion.cc,v 1.3 6 2006/06/29 19:40:17 gunterExp $29 // GEANT4 tag $Name: geant4-09-0 2$28 // $Id: G4LowEnergyGammaConversion.cc,v 1.37 2009/05/02 09:59:16 sincerti Exp $ 29 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 30 30 // 31 31 // … … 104 104 << G4endl; 105 105 } 106 107 G4cout << G4endl; 108 G4cout << "*******************************************************************************" << G4endl; 109 G4cout << "*******************************************************************************" << G4endl; 110 G4cout << " The class G4LowEnergyGammaConversion is NOT SUPPORTED ANYMORE. " << G4endl; 111 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 112 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 113 G4cout << "*******************************************************************************" << G4endl; 114 G4cout << "*******************************************************************************" << G4endl; 115 G4cout << G4endl; 106 116 } 107 117 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyIonisation.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LowEnergyIonisation.cc,v 1.10 3 2008/05/02 19:23:38 piaExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4LowEnergyIonisation.cc,v 1.104 2009/05/02 09:59:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // -------------------------------------------------------------- … … 131 131 cutForElectrons = 250.0*eV; 132 132 verboseLevel = 0; 133 134 G4cout << G4endl; 135 G4cout << "*******************************************************************************" << G4endl; 136 G4cout << "*******************************************************************************" << G4endl; 137 G4cout << " The class G4LowEnergyIonisation is NOT SUPPORTED ANYMORE. " << G4endl; 138 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 139 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 140 G4cout << "*******************************************************************************" << G4endl; 141 G4cout << "*******************************************************************************" << G4endl; 142 G4cout << G4endl; 133 143 } 134 144 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPhotoElectric.cc
r1007 r1055 25 25 // 26 26 // 27 // $Id: G4LowEnergyPhotoElectric.cc,v 1.5 6 2006/06/29 19:40:23 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 2$27 // $Id: G4LowEnergyPhotoElectric.cc,v 1.57 2009/05/02 09:59:16 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 29 29 // 30 30 // Author: A. Forti … … 122 122 << G4endl; 123 123 } 124 125 G4cout << G4endl; 126 G4cout << "*******************************************************************************" << G4endl; 127 G4cout << "*******************************************************************************" << G4endl; 128 G4cout << " The class G4LowEnergyPhotoElectric is NOT SUPPORTED ANYMORE. " << G4endl; 129 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 130 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 131 G4cout << "*******************************************************************************" << G4endl; 132 G4cout << "*******************************************************************************" << G4endl; 133 G4cout << G4endl; 124 134 } 125 135 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPolarizedCompton.cc
r1007 r1055 25 25 // 26 26 // 27 // $Id: G4LowEnergyPolarizedCompton.cc,v 1.2 5 2008/05/02 19:23:38 piaExp $28 // GEANT4 tag $Name: geant4-09-0 2$27 // $Id: G4LowEnergyPolarizedCompton.cc,v 1.26 2009/05/02 09:59:16 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 29 29 // 30 30 // ------------------------------------------------------------ … … 122 122 << G4endl; 123 123 } 124 125 G4cout << G4endl; 126 G4cout << "*******************************************************************************" << G4endl; 127 G4cout << "*******************************************************************************" << G4endl; 128 G4cout << " The class G4LowEnergyPolarizedCompton is NOT SUPPORTED ANYMORE. " << G4endl; 129 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 130 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 131 G4cout << "*******************************************************************************" << G4endl; 132 G4cout << "*******************************************************************************" << G4endl; 133 G4cout << G4endl; 124 134 } 125 135 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPolarizedRayleigh.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LowEnergyPolarizedRayleigh.cc,v 1. 7 2006/06/29 19:40:27 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4LowEnergyPolarizedRayleigh.cc,v 1.8 2009/05/02 09:59:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // -------------------------------------------------------------- … … 63 63 64 64 65 G4cout << G4endl; 66 G4cout << "*******************************************************************************" << G4endl; 67 G4cout << "*******************************************************************************" << G4endl; 68 G4cout << " The class G4LowEnergyPolarizedRayleigh is NOT SUPPORTED ANYMORE. " << G4endl; 69 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 70 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 71 G4cout << "*******************************************************************************" << G4endl; 72 G4cout << "*******************************************************************************" << G4endl; 73 G4cout << G4endl; 65 74 } 66 75 -
trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyRayleigh.cc
r1007 r1055 26 26 // -------------------------------------------------------------------- 27 27 // 28 // $Id: G4LowEnergyRayleigh.cc,v 1.3 7 2006/06/29 19:40:29 gunterExp $29 // GEANT4 tag $Name: geant4-09-0 2$28 // $Id: G4LowEnergyRayleigh.cc,v 1.38 2009/05/02 09:59:16 sincerti Exp $ 29 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 30 30 // 31 31 // Author: A. Forti … … 99 99 << G4endl; 100 100 } 101 102 G4cout << G4endl; 103 G4cout << "*******************************************************************************" << G4endl; 104 G4cout << "*******************************************************************************" << G4endl; 105 G4cout << " The class G4LowEnergyRayleigh is NOT SUPPORTED ANYMORE. " << G4endl; 106 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 107 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 108 G4cout << "*******************************************************************************" << G4endl; 109 G4cout << "*******************************************************************************" << G4endl; 110 G4cout << G4endl; 101 111 } 102 112 -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeAnnihilation.cc
r819 r1055 64 64 << G4endl; 65 65 } 66 67 G4cout << G4endl; 68 G4cout << "*******************************************************************************" << G4endl; 69 G4cout << "*******************************************************************************" << G4endl; 70 G4cout << " The class G4PenelopeAnnihilation is NOT SUPPORTED ANYMORE. " << G4endl; 71 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 72 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 73 G4cout << "*******************************************************************************" << G4endl; 74 G4cout << "*******************************************************************************" << G4endl; 75 G4cout << G4endl; 66 76 } 67 77 -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeAnnihilationModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeAnnihilationModel.cc,v 1. 2 2008/12/04 14:09:36 pandolaExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4PenelopeAnnihilationModel.cc,v 1.3 2009/04/17 10:29:20 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // Author: Luciano Pandola … … 32 32 // -------- 33 33 // 29 Oct 2008 L Pandola Migration from process to model 34 // 34 // 15 Apr 2009 V Ivanchenko Cleanup initialisation and generation of secondaries: 35 // - apply internal high-energy limit only in constructor 36 // - do not apply low-energy limit (default is 0) 37 // - do not use G4ElementSelector 35 38 36 39 #include "G4PenelopeAnnihilationModel.hh" … … 48 51 :G4VEmModel(nam),isInitialised(false) 49 52 { 50 fIntrinsicLowEnergyLimit = 0.0 *eV;53 fIntrinsicLowEnergyLimit = 0.0; 51 54 fIntrinsicHighEnergyLimit = 100.0*GeV; 52 SetLowEnergyLimit(fIntrinsicLowEnergyLimit);55 // SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 53 56 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 54 57 … … 73 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 74 77 75 void G4PenelopeAnnihilationModel::Initialise(const G4ParticleDefinition* particle,76 const G4DataVector& cuts)78 void G4PenelopeAnnihilationModel::Initialise(const G4ParticleDefinition*, 79 const G4DataVector&) 77 80 { 78 81 if (verboseLevel > 3) 79 82 G4cout << "Calling G4PenelopeAnnihilationModel::Initialise()" << G4endl; 80 83 81 InitialiseElementSelectors(particle,cuts); 82 if (LowEnergyLimit() < fIntrinsicLowEnergyLimit) 83 { 84 G4cout << "G4PenelopeAnnihilationModel: low energy limit increased from " << 85 LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << G4endl; 86 SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 87 } 88 if (HighEnergyLimit() > fIntrinsicHighEnergyLimit) 89 { 90 G4cout << "G4PenelopeAnnihilationModel: high energy limit decreased from " << 91 HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" << G4endl; 92 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 93 } 94 95 G4cout << "Penelope Annihilation model is initialized " << G4endl 96 << "Energy range: " 97 << LowEnergyLimit() / keV << " keV - " 98 << HighEnergyLimit() / GeV << " GeV" 99 << G4endl; 84 if(verboseLevel > 0) { 85 G4cout << "Penelope Annihilation model is initialized " << G4endl 86 << "Energy range: " 87 << LowEnergyLimit() / keV << " keV - " 88 << HighEnergyLimit() / GeV << " GeV" 89 << G4endl; 90 } 100 91 101 92 if(isInitialised) return; 102 103 if(pParticleChange) 104 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 105 else 106 fParticleChange = new G4ParticleChangeForGamma(); 93 fParticleChange = GetParticleChangeForGamma(); 107 94 isInitialised = true; 108 95 } … … 155 142 156 143 G4double kineticEnergy = aDynamicPositron->GetKineticEnergy(); 157 158 if (kineticEnergy == 0) 144 145 // kill primary 146 fParticleChange->SetProposedKineticEnergy(0.); 147 fParticleChange->ProposeTrackStatus(fStopAndKill); 148 149 if (kineticEnergy == 0.0) 159 150 { 160 151 //Old AtRestDoIt … … 170 161 fvect->push_back(firstGamma); 171 162 fvect->push_back(secondGamma); 172 fParticleChange->SetProposedKineticEnergy(0.);173 fParticleChange->ProposeTrackStatus(fStopAndKill);174 163 return; 175 164 } … … 227 216 photon2Energy); 228 217 fvect->push_back(aParticle2); 229 fParticleChange->SetProposedKineticEnergy(0.);230 fParticleChange->ProposeTrackStatus(fStopAndKill);231 218 232 219 if (verboseLevel > 1) … … 244 231 } 245 232 if (verboseLevel > 0) 246 { 247 233 { 248 234 G4double energyDiff = std::fabs(totalAvailableEnergy-photon1Energy-photon2Energy); 249 235 if (energyDiff > 0.05*keV) -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlung.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeBremsstrahlung.cc,v 1.1 8 2006/06/29 19:40:35 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4PenelopeBremsstrahlung.cc,v 1.19 2009/05/02 09:59:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // -------------------------------------------------------------- … … 71 71 cutForPhotons = 0.; 72 72 verboseLevel = 0; 73 74 G4cout << G4endl; 75 G4cout << "*******************************************************************************" << G4endl; 76 G4cout << "*******************************************************************************" << G4endl; 77 G4cout << " The class G4PenelopeBremsstrahlung is NOT SUPPORTED ANYMORE. " << G4endl; 78 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 79 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 80 G4cout << "*******************************************************************************" << G4endl; 81 G4cout << "*******************************************************************************" << G4endl; 82 G4cout << G4endl; 83 73 84 } 74 85 -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungContinuous.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1.1 0 2008/12/09 15:08:13pandola Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1.11 2008/12/15 09:23:06 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // -------------------------------------------------------------- … … 97 97 G4String dirFile = pathString + "/penelope/" + name; 98 98 std::ifstream file(dirFile); 99 std::filebuf* lsdp = file.rdbuf(); 100 if (!(lsdp->is_open())) 99 if (!file.is_open()) 101 100 { 102 101 G4String excep = "G4PenelopeBremsstrahlungContinuous - data file " + name + " not found!"; … … 112 111 for (size_t j=0;j<NumberofKPoints;j++){ 113 112 file >> a1; 114 ReducedCS[i][j]=a1*cm2; //coversion present in Penelope source113 ReducedCS[i][j]=a1*cm2; 115 114 } 116 115 //3) read the total cross section, in cm2 117 116 file >> a1; 118 TotalCS[i]=a1*cm2; //conversion present in Penelope source117 TotalCS[i]=a1*cm2; 119 118 // Check closing item 120 119 file >> a1; 121 120 if (a1 != ((G4double) -1)) 122 121 { 123 G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file " + name; 122 G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file " 123 + name; 124 124 G4Exception(excep); 125 125 } … … 229 229 230 230 //Global x-section factor 231 G4double Fact=Zmat*Zmat*(energy+electron_mass_c2)*(energy+electron_mass_c2)/(energy*(energy+2.0*electron_mass_c2)); 231 G4double Fact=Zmat*Zmat*(energy+electron_mass_c2)*(energy+electron_mass_c2)/ 232 (energy*(energy+2.0*electron_mass_c2)); 232 233 Fact *= PositronCorrection(energy); 233 234 -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeCompton.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeCompton.cc,v 1.3 3 2008/06/03 15:44:25 pandolaExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4PenelopeCompton.cc,v 1.34 2009/05/02 09:59:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // Author: Luciano Pandola … … 120 120 << G4endl; 121 121 } 122 123 124 G4cout << G4endl; 125 G4cout << "*******************************************************************************" << G4endl; 126 G4cout << "*******************************************************************************" << G4endl; 127 G4cout << " The class G4PenelopeCompton is NOT SUPPORTED ANYMORE. " << G4endl; 128 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 129 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 130 G4cout << "*******************************************************************************" << G4endl; 131 G4cout << "*******************************************************************************" << G4endl; 132 G4cout << G4endl; 133 122 134 } 123 135 -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeComptonModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeComptonModel.cc,v 1. 2 2008/12/04 14:11:21 pandolaExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4PenelopeComptonModel.cc,v 1.4 2009/04/18 18:29:34 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // Author: Luciano Pandola … … 40 40 // that are read from the external files. 41 41 // 24 Nov 2008 L Pandola Find a cleaner way to delete vectors. 42 // 16 Apr 2009 V Ivanchenko Cleanup initialisation and generation of secondaries: 43 // - apply internal high-energy limit only in constructor 44 // - do not apply low-energy limit (default is 0) 45 // - do not apply production threshold on level of the model 42 46 // 43 47 … … 69 73 fIntrinsicLowEnergyLimit = 100.0*eV; 70 74 fIntrinsicHighEnergyLimit = 100.0*GeV; 71 SetLowEnergyLimit(fIntrinsicLowEnergyLimit);75 // SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 72 76 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 73 77 // … … 118 122 119 123 void G4PenelopeComptonModel::Initialise(const G4ParticleDefinition* particle, 120 124 const G4DataVector& cuts) 121 125 { 122 126 if (verboseLevel > 3) … … 124 128 125 129 InitialiseElementSelectors(particle,cuts); 126 if (LowEnergyLimit() < fIntrinsicLowEnergyLimit) 127 { 128 G4cout << "G4PenelopeComptonModel: low energy limit increased from " << 129 LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << G4endl; 130 SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 131 } 132 if (HighEnergyLimit() > fIntrinsicHighEnergyLimit) 133 { 134 G4cout << "G4PenelopeComptonModel: high energy limit decreased from " << 135 HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" << G4endl; 136 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 137 } 138 139 G4cout << "Penelope Compton model is initialized " << G4endl 140 << "Energy range: " 141 << LowEnergyLimit() / keV << " keV - " 142 << HighEnergyLimit() / GeV << " GeV" 143 << G4endl; 130 131 if (verboseLevel > 0) { 132 G4cout << "Penelope Compton model is initialized " << G4endl 133 << "Energy range: " 134 << LowEnergyLimit() / keV << " keV - " 135 << HighEnergyLimit() / GeV << " GeV" 136 << G4endl; 137 } 144 138 145 139 if(isInitialised) return; 146 147 if(pParticleChange) 148 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 149 else 150 fParticleChange = new G4ParticleChangeForGamma(); 140 fParticleChange = GetParticleChangeForGamma(); 151 141 isInitialised = true; 152 142 } … … 249 239 G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy(); 250 240 251 if (photonEnergy0 <= LowEnergyLimit())252 {241 if (photonEnergy0 <= fIntrinsicLowEnergyLimit) 242 { 253 243 fParticleChange->ProposeTrackStatus(fStopAndKill); 254 244 fParticleChange->SetProposedKineticEnergy(0.); 255 245 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0); 256 246 return ; 257 }247 } 258 248 259 249 G4ParticleMomentum photonDirection0 = aDynamicGamma->GetMomentumDirection(); … … 263 253 G4cout << "Going to select element in " << couple->GetMaterial()->GetName() << G4endl; 264 254 // atom can be selected effitiantly if element selectors are initialised 265 const G4Element* anElement = SelectRandomAtom(couple,G4Gamma::GammaDefinition(),photonEnergy0); 255 const G4Element* anElement = 256 SelectRandomAtom(couple,G4Gamma::GammaDefinition(),photonEnergy0); 266 257 G4int Z = (G4int) anElement->GetZ(); 267 258 if (verboseLevel > 2) … … 320 311 }while((epsilon*photonEnergy0-photonEnergy0+ionEnergy) >0); 321 312 } 322 else //photonEnergy0 <5 MeV313 else //photonEnergy0 < 5 MeV 323 314 { 324 315 //Incoherent scattering function for theta=PI … … 472 463 } 473 464 474 475 465 //Create scattered electron 476 466 G4double diffEnergy = photonEnergy0*(1-epsilon); 477 467 ionEnergy = (*(ionizationEnergy->find(Z)->second))[iosc]; 478 G4double Q2 = photonEnergy0*photonEnergy0+photonEnergy1*(photonEnergy1-2.0*photonEnergy0*cosTheta); 468 G4double Q2 = 469 photonEnergy0*photonEnergy0+photonEnergy1*(photonEnergy1-2.0*photonEnergy0*cosTheta); 479 470 G4double cosThetaE; //scattering angle for the electron 480 471 if (Q2 > 1.0e-12) … … 496 487 G4int shellId = shell->ShellId(); 497 488 G4double ionEnergyInPenelopeDatabase = ionEnergy; 498 ionEnergy = std::max(bindingEnergy,ionEnergyInPenelopeDatabase); //protection against energy non-conservation 499 500 G4double eKineticEnergy = diffEnergy - ionEnergy; //subtract the excitation energy. If not emitted by fluorescence, 489 //protection against energy non-conservation 490 ionEnergy = std::max(bindingEnergy,ionEnergyInPenelopeDatabase); 491 492 //subtract the excitation energy. If not emitted by fluorescence 501 493 //the ionization energy is deposited as local energy deposition 494 G4double eKineticEnergy = diffEnergy - ionEnergy; 502 495 G4double localEnergyDeposit = ionEnergy; 503 496 G4double energyInFluorescence = 0.; //testing purposes only … … 505 498 if (eKineticEnergy < 0) 506 499 { 507 //It means that there was some problem/mismatch between the two databases. Try to make it work 500 //It means that there was some problem/mismatch between the two databases. 501 //Try to make it work 508 502 //In this case available Energy (diffEnergy) < ionEnergy 509 503 //Full residual energy is deposited locally … … 511 505 eKineticEnergy = 0.0; 512 506 } 513 G4double cutForLowEnergySecondaryPhotons = 250.0*eV;514 515 //Get the cut for electrons516 const G4ProductionCutsTable* theCoupleTable=517 G4ProductionCutsTable::GetProductionCutsTable();518 size_t indx = couple->GetIndex();519 G4double cutE = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx];520 cutE = std::max(cutForLowEnergySecondaryPhotons,cutE);521 507 522 508 //the local energy deposit is what remains: part of this may be spent for fluorescence. 523 if (fUseAtomicDeexcitation) 524 { 525 G4int nPhotons=0; 526 527 G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[indx]; 528 cutg = std::max(cutForLowEnergySecondaryPhotons,cutg); 529 530 G4DynamicParticle* aPhoton; 531 G4AtomicDeexcitation deexcitationManager; 509 if(DeexcitationFlag() && Z > 5) { 510 511 const G4ProductionCutsTable* theCoupleTable= 512 G4ProductionCutsTable::GetProductionCutsTable(); 513 514 size_t index = couple->GetIndex(); 515 G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[index]; 516 G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index]; 517 518 // Generation of fluorescence 519 // Data in EADL are available only for Z > 5 520 // Protection to avoid generating photons in the unphysical case of 521 // shell binding energy > photon energy 522 if (localEnergyDeposit > cutg || localEnergyDeposit > cute) 523 { 524 G4DynamicParticle* aPhoton; 525 G4AtomicDeexcitation deexcitationManager; 526 deexcitationManager.SetCutForSecondaryPhotons(cutg); 527 deexcitationManager.SetCutForAugerElectrons(cute); 528 deexcitationManager.ActivateAugerElectronProduction(false); 532 529 533 if (Z>5 && (localEnergyDeposit > cutg || localEnergyDeposit > cutE)) 534 { 535 photonVector = deexcitationManager.GenerateParticles(Z,shellId); 536 for (size_t k=0;k<photonVector->size();k++){ 537 aPhoton = (*photonVector)[k]; 538 if (aPhoton) 530 photonVector = deexcitationManager.GenerateParticles(Z,shellId); 531 if(photonVector) 532 { 533 size_t nPhotons = photonVector->size(); 534 for (size_t k=0; k<nPhotons; k++) 539 535 { 540 G4double itsCut = cutg; 541 if (aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cutE; 542 G4double itsEnergy = aPhoton->GetKineticEnergy(); 543 if (itsEnergy > itsCut && itsEnergy <= localEnergyDeposit) 536 aPhoton = (*photonVector)[k]; 537 if (aPhoton) 544 538 { 545 nPhotons++; 546 localEnergyDeposit -= itsEnergy; 547 energyInFluorescence += itsEnergy; 548 } 549 else 550 { 551 delete aPhoton; 552 (*photonVector)[k]=0; 539 G4double itsEnergy = aPhoton->GetKineticEnergy(); 540 if (itsEnergy <= localEnergyDeposit) 541 { 542 localEnergyDeposit -= itsEnergy; 543 if (aPhoton->GetDefinition() == G4Gamma::Gamma()) 544 energyInFluorescence += itsEnergy;; 545 fvect->push_back(aPhoton); 546 } 547 else 548 { 549 delete aPhoton; 550 (*photonVector)[k]=0; 551 } 553 552 } 554 553 } 555 } 556 } 557 } 554 delete photonVector; 555 } 556 } 557 } 558 558 559 559 //Produce explicitely the electron only if its proposed kinetic energy is 560 560 //above the cut, otherwise add local energy deposition 561 561 G4DynamicParticle* electron = 0; 562 if (eKineticEnergy > cutE) 562 // if (eKineticEnergy > cutE) // VI: may be consistency problem if cut is applied here 563 if (eKineticEnergy > 0.0) 563 564 { 564 565 G4double xEl = sinThetaE * std::cos(phi+pi); … … 576 577 } 577 578 578 //This block below is executed only if there is at least one secondary photon produced by579 //AtomicDeexcitation580 if (photonVector)581 {582 for (size_t ll=0;ll<photonVector->size();ll++)583 {584 if ((*photonVector)[ll])585 {586 G4DynamicParticle* aFluorescencePhoton = (*photonVector)[ll];587 fvect->push_back(aFluorescencePhoton);588 }589 }590 }591 delete photonVector;592 579 if (localEnergyDeposit < 0) 593 580 { -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeGammaConversion.cc
r819 r1055 97 97 << G4endl; 98 98 } 99 100 G4cout << G4endl; 101 G4cout << "*******************************************************************************" << G4endl; 102 G4cout << "*******************************************************************************" << G4endl; 103 G4cout << " The class G4PenelopeGammaConversion is NOT SUPPORTED ANYMORE. " << G4endl; 104 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 105 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 106 G4cout << "*******************************************************************************" << G4endl; 107 G4cout << "*******************************************************************************" << G4endl; 108 G4cout << G4endl; 99 109 } 100 110 -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeGammaConversionModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeGammaConversionModel.cc,v 1. 2 2008/12/04 14:09:36pandola Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4PenelopeGammaConversionModel.cc,v 1.4 2009/05/19 14:57:01 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // Author: Luciano Pandola … … 32 32 // -------- 33 33 // 06 Oct 2008 L Pandola Migration from process to model 34 // 17 Apr 2009 V Ivanchenko Cleanup initialisation and generation of secondaries: 35 // - apply internal high-energy limit only in constructor 36 // - do not apply low-energy limit (default is 0) 37 // - do not apply production threshold on level of the model 38 // 19 May 2009 L Pandola Explicitely set to zero pointers deleted in 39 // Initialise(), since they might be checked later on 34 40 // 35 41 … … 56 62 fSmallEnergy = 1.1*MeV; 57 63 58 SetLowEnergyLimit(fIntrinsicLowEnergyLimit);64 // SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 59 65 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 60 66 // … … 89 95 crossSectionHandler->Clear(); 90 96 delete crossSectionHandler; 97 crossSectionHandler = 0; 91 98 } 92 99 93 //Check energy limits94 if (LowEnergyLimit() < fIntrinsicLowEnergyLimit)95 {96 G4cout << "G4PenelopeGammaConversionModel: low energy limit increased from " <<97 LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << G4endl;98 SetLowEnergyLimit(fIntrinsicLowEnergyLimit);99 }100 if (HighEnergyLimit() > fIntrinsicHighEnergyLimit)101 {102 G4cout << "G4PenelopeGammaConversionModel: high energy limit decreased from " <<103 HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" << G4endl;104 SetHighEnergyLimit(fIntrinsicHighEnergyLimit);105 }106 107 100 //Re-initialize cross section handler 108 101 crossSectionHandler = new G4CrossSectionHandler(); 109 crossSectionHandler->Initialise(0, LowEnergyLimit(),HighEnergyLimit(),400);102 crossSectionHandler->Initialise(0,fIntrinsicLowEnergyLimit,HighEnergyLimit(),400); 110 103 crossSectionHandler->Clear(); 111 104 G4String crossSectionFile = "penelope/pp-cs-pen-"; … … 117 110 G4cout << "Loaded cross section files for PenelopeGammaConversion" << G4endl; 118 111 119 G4cout << "Penelope Gamma Conversion model is initialized " << G4endl 120 << "Energy range: " 121 << LowEnergyLimit() / MeV << " MeV - " 122 << HighEnergyLimit() / GeV << " GeV" 123 << G4endl; 112 if (verboseLevel > 0) { 113 G4cout << "Penelope Gamma Conversion model is initialized " << G4endl 114 << "Energy range: " 115 << LowEnergyLimit() / MeV << " MeV - " 116 << HighEnergyLimit() / GeV << " GeV" 117 << G4endl; 118 } 124 119 125 120 if(isInitialised) return; 126 127 if(pParticleChange) 128 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 129 else 130 fParticleChange = new G4ParticleChangeForGamma(); 121 fParticleChange = GetParticleChangeForGamma(); 131 122 isInitialised = true; 132 123 } … … 151 142 152 143 G4int iZ = (G4int) Z; 153 if (!crossSectionHandler)154 {155 G4cout << "G4PenelopeGammaConversionModel::ComputeCrossSectionPerAtom" << G4endl;156 G4cout << "The cross section handler is not correctly initialized" << G4endl;157 G4Exception();158 }144 // if (!crossSectionHandler) //VI: should not be checked in run time 145 // { 146 // G4cout << "G4PenelopeGammaConversionModel::ComputeCrossSectionPerAtom" << G4endl; 147 // G4cout << "The cross section handler is not correctly initialized" << G4endl; 148 // G4Exception(); 149 // } 159 150 G4double cs = crossSectionHandler->FindValue(iZ,energy); 160 151 … … 167 158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 168 159 169 void G4PenelopeGammaConversionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect, 170 const G4MaterialCutsCouple* couple, 171 const G4DynamicParticle* aDynamicGamma, 172 G4double, 173 G4double) 160 void 161 G4PenelopeGammaConversionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect, 162 const G4MaterialCutsCouple* couple, 163 const G4DynamicParticle* aDynamicGamma, 164 G4double, 165 G4double) 174 166 { 175 167 // … … 191 183 G4double photonEnergy = aDynamicGamma->GetKineticEnergy(); 192 184 193 if (photonEnergy <= LowEnergyLimit()) 194 { 195 fParticleChange->ProposeTrackStatus(fStopAndKill); 196 fParticleChange->SetProposedKineticEnergy(0.); 185 // Always kill primary 186 fParticleChange->ProposeTrackStatus(fStopAndKill); 187 fParticleChange->SetProposedKineticEnergy(0.); 188 189 if (photonEnergy <= fIntrinsicLowEnergyLimit) 190 { 197 191 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy); 198 192 return ; 199 }193 } 200 194 201 195 G4ParticleMomentum photonDirection = aDynamicGamma->GetMomentumDirection(); … … 310 304 311 305 //Generate explicitely the electron in the pair, only if it is > threshold 312 const G4ProductionCutsTable* theCoupleTable= 313 G4ProductionCutsTable::GetProductionCutsTable(); 314 size_t indx = couple->GetIndex(); 315 G4double cutE = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx]; 316 //G4double cutP = (*(theCoupleTable->GetEnergyCutsVector(2)))[indx]; 317 318 if (electronKineEnergy > cutE) 306 //VI: applying cut here provides inconsistency 307 308 if (electronKineEnergy > 0.0) 319 309 { 320 310 G4ThreeVector electronDirection ( dirX_el, dirY_el, dirZ_el); … … 333 323 //Generate the positron. Real particle in any case, because it will annihilate. If below 334 324 //threshold, produce it at rest 335 if (positronKineEnergy < cutE) 325 // VI: here there was a bug - positron and electron cuts are different 326 if (positronKineEnergy < 0.0) 336 327 { 337 328 localEnergyDeposit += positronKineEnergy; … … 344 335 fvect->push_back(positron); 345 336 346 //Update the status of the primary gamma (kill it) 347 fParticleChange->SetProposedKineticEnergy(0.); 337 //Add rest of energy to the local energy deposit 348 338 fParticleChange->ProposeLocalEnergyDeposit(localEnergyDeposit); 349 fParticleChange->ProposeTrackStatus(fStopAndKill);350 351 339 352 if (verboseLevel > 1)340 if (verboseLevel > 1) 353 341 { 354 342 G4cout << "-----------------------------------------------------------" << G4endl; … … 357 345 G4cout << "-----------------------------------------------------------" << G4endl; 358 346 if (electronKineEnergy) 359 G4cout << "Electron (explicitely produced) " << electronKineEnergy/keV << " keV" << G4endl; 347 G4cout << "Electron (explicitely produced) " << electronKineEnergy/keV << " keV" 348 << G4endl; 360 349 if (positronKineEnergy) 361 350 G4cout << "Positron (not at rest) " << positronKineEnergy/keV << " keV" << G4endl; … … 373 362 localEnergyDeposit+2.0*electron_mass_c2-photonEnergy); 374 363 if (energyDiff > 0.05*keV) 375 G4cout << "Warning from G4PenelopeGammaConversion: problem with energy conservation: " << 376 (electronKineEnergy+positronKineEnergy+ 377 localEnergyDeposit+2.0*electron_mass_c2)/keV << " keV (final) vs. " << 378 photonEnergy/keV << " keV (initial)" << G4endl; 379 } 380 364 G4cout << "Warning from G4PenelopeGammaConversion: problem with energy conservation: " 365 << (electronKineEnergy+positronKineEnergy+ 366 localEnergyDeposit+2.0*electron_mass_c2)/keV 367 << " keV (final) vs. " << photonEnergy/keV << " keV (initial)" << G4endl; 368 } 381 369 } 382 370 -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeIonisation.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeIonisation.cc,v 1. 19 2006/06/29 19:40:49 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4PenelopeIonisation.cc,v 1.20 2009/05/02 09:59:16 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // -------------------------------------------------------------- … … 93 93 ReadData(); //Read data from file 94 94 95 G4cout << G4endl; 96 G4cout << "*******************************************************************************" << G4endl; 97 G4cout << "*******************************************************************************" << G4endl; 98 G4cout << " The class G4PenelopeIonisation is NOT SUPPORTED ANYMORE. " << G4endl; 99 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 100 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 101 G4cout << "*******************************************************************************" << G4endl; 102 G4cout << "*******************************************************************************" << G4endl; 103 G4cout << G4endl; 104 95 105 } 96 106 -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeIonisationModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeIonisationModel.cc,v 1. 2 2008/12/05 09:15:43pandola Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4PenelopeIonisationModel.cc,v 1.5 2009/05/19 14:57:01 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // Author: Luciano Pandola … … 32 32 // -------- 33 33 // 26 Nov 2008 L Pandola Migration from process to model 34 // 17 Apr 2009 V Ivanchenko Cleanup initialisation and generation of secondaries: 35 // - apply internal high-energy limit only in constructor 36 // - do not apply low-energy limit (default is 0) 37 // - added MinEnergyCut method 38 // - do not change track status 39 // 19 May 2009 L Pandola Explicitely set to zero pointers deleted in 40 // Initialise(), since they might be checked later on 34 41 // 35 42 … … 48 55 #include "G4CrossSectionHandler.hh" 49 56 #include "G4AtomicDeexcitation.hh" 50 #include "G4ProcessManager.hh"51 57 #include "G4VEMDataSet.hh" 52 58 … … 68 74 fIntrinsicLowEnergyLimit = 100.0*eV; 69 75 fIntrinsicHighEnergyLimit = 100.0*GeV; 70 SetLowEnergyLimit(fIntrinsicLowEnergyLimit);76 // SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 71 77 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 72 78 // … … 136 142 G4cout << "Calling G4PenelopeIonisationModel::Initialise()" << G4endl; 137 143 138 InitialiseElementSelectors(particle,cuts);139 140 144 //Delete and re-initialize the cross section handler 141 145 if (crossSectionHandler) … … 143 147 crossSectionHandler->Clear(); 144 148 delete crossSectionHandler; 149 crossSectionHandler = 0; 145 150 } 146 151 … … 148 153 { 149 154 for (size_t i=0; i<theXSTable->size(); i++) 150 delete (*theXSTable)[i]; 155 { 156 delete (*theXSTable)[i]; 157 (*theXSTable)[i] = 0; 158 } 151 159 delete theXSTable; 160 theXSTable = 0; 152 161 } 153 154 155 if (LowEnergyLimit() < fIntrinsicLowEnergyLimit)156 {157 G4cout << "G4PenelopeIonisationModel: low energy limit increased from " <<158 LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << G4endl;159 SetLowEnergyLimit(fIntrinsicLowEnergyLimit);160 }161 if (HighEnergyLimit() > fIntrinsicHighEnergyLimit)162 {163 G4cout << "G4PenelopeIonisationModel: high energy limit decreased from " <<164 HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" << G4endl;165 SetHighEnergyLimit(fIntrinsicHighEnergyLimit);166 }167 162 168 163 crossSectionHandler = new G4CrossSectionHandler(); … … 177 172 //This is used to retrieve cross section values later on 178 173 crossSectionHandler->BuildMeanFreePathForMaterials(); 179 180 if (verboseLevel > 2) 174 175 InitialiseElementSelectors(particle,cuts); 176 177 if (verboseLevel > 2) 181 178 G4cout << "Loaded cross section files for PenelopeIonisationModel" << G4endl; 182 179 183 184 G4cout << "Penelope Ionisation model is initialized " << G4endl 185 << "Energy range: " 186 << LowEnergyLimit() / keV << " keV - " 187 << HighEnergyLimit() / GeV << " GeV" 188 << G4endl; 180 if (verboseLevel > 2) { 181 G4cout << "Penelope Ionisation model is initialized " << G4endl 182 << "Energy range: " 183 << LowEnergyLimit() / keV << " keV - " 184 << HighEnergyLimit() / GeV << " GeV" 185 << G4endl; 186 } 189 187 190 188 if(isInitialised) return; 191 192 if(pParticleChange) 193 fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange); 194 else 195 fParticleChange = new G4ParticleChangeForLoss(); 189 fParticleChange = GetParticleChangeForLoss(); 196 190 isInitialised = true; 197 191 } … … 227 221 SetupForMaterial(theParticle, material, energy); 228 222 223 // VI - should be check at initialisation not in run time 224 /* 229 225 if (!crossSectionHandler) 230 226 { … … 233 229 G4Exception(); 234 230 } 235 231 */ 236 232 if (!theXSTable) 237 233 { … … 244 240 theXSTable = BuildCrossSectionTable(theParticle); 245 241 } 246 242 247 243 G4double totalCross = 0.0; 248 244 G4double cross = 0.0; … … 356 352 const G4MaterialCutsCouple* couple, 357 353 const G4DynamicParticle* aDynamicParticle, 358 G4double, 359 G4double) 354 G4double cutE, G4double) 360 355 { 361 356 // Penelope model to sample the final state following an hard inelastic interaction. … … 397 392 const G4ParticleDefinition* theParticle = aDynamicParticle->GetDefinition(); 398 393 399 if (kineticEnergy0 <= LowEnergyLimit())394 if (kineticEnergy0 <= fIntrinsicLowEnergyLimit) 400 395 { 401 396 fParticleChange->SetProposedKineticEnergy(0.); 402 397 fParticleChange->ProposeLocalEnergyDeposit(kineticEnergy0); 403 //Check if there are AtRest processes404 if (theParticle->GetProcessManager()->GetAtRestProcessVector()->size())405 //In this case there is at least one AtRest process406 fParticleChange->ProposeTrackStatus(fStopButAlive);407 else408 fParticleChange->ProposeTrackStatus(fStopAndKill);409 398 return ; 410 399 } … … 430 419 G4int iZ = SampleRandomAtom(couple,kineticEnergy0); 431 420 432 G4double cutForLowEnergySecondaryParticles = 250.0*eV;433 421 const G4ProductionCutsTable* theCoupleTable= 434 422 G4ProductionCutsTable::GetProductionCutsTable(); 435 423 size_t indx = couple->GetIndex(); 436 G4double cutE = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx];437 424 G4double cutG = (*(theCoupleTable->GetEnergyCutsVector(0)))[indx]; 438 439 //Production cut for delta-rays (electrons)440 cutE = std::max(cutForLowEnergySecondaryParticles,cutE);441 //Production cut for gamma (fluorescence)442 cutG = std::max(cutForLowEnergySecondaryParticles,cutG);443 425 444 426 if (verboseLevel > 2) … … 474 456 else 475 457 { 476 fParticleChange->ProposeMomentumDirection(electronDirection1); 477 fParticleChange->SetProposedKineticEnergy(0.*eV); 478 if (theParticle->GetProcessManager()->GetAtRestProcessVector()->size()) 479 //In this case there is at least one AtRest process 480 fParticleChange->ProposeTrackStatus(fStopButAlive); 481 else 482 fParticleChange->ProposeTrackStatus(fStopAndKill); 458 fParticleChange->SetProposedKineticEnergy(0.); 483 459 } 484 460 … … 517 493 //Penelope subtracted the fluorescence, but one has to match the databases 518 494 eKineticEnergy = energySecondary+ioniEnergy-bindingEnergy; 519 520 //VERIFICA QUI LA STORIA DEL LOCAL ENERGY DEPOSIT! 521 495 522 496 G4double localEnergyDeposit = ionEnergy; 523 497 G4double energyInFluorescence = 0.0*eV; 524 498 525 std::vector<G4DynamicParticle*> *photonVector = 0; 526 if (fUseAtomicDeexcitation) 527 { 528 if (iZ>5 && (ionEnergy > cutG || ionEnergy > cutE)) 499 if(DeexcitationFlag() && iZ > 5) 500 { 501 if (ionEnergy > cutG || ionEnergy > cutE) 529 502 { 530 photonVector = deexcitationManager.GenerateParticles(iZ,shellId); 531 //Check for single photons if they are above threshold 532 for (size_t k=0;k<photonVector->size();k++) 503 deexcitationManager.SetCutForSecondaryPhotons(cutG); 504 deexcitationManager.SetCutForAugerElectrons(cutE); 505 std::vector<G4DynamicParticle*> *photonVector = 506 deexcitationManager.GenerateParticles(iZ,shellId); 507 //Check for secondaries 508 if(photonVector) 533 509 { 534 G4DynamicParticle* aPhoton = (*photonVector)[k]; 535 if (aPhoton) 510 for (size_t k=0;k<photonVector->size();k++) 536 511 { 537 G4double itsCut = cutG; 538 if (aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cutE; 539 G4double itsEnergy = aPhoton->GetKineticEnergy(); 540 if (itsEnergy > itsCut && itsEnergy <= ionEnergy) 512 G4DynamicParticle* aPhoton = (*photonVector)[k]; 513 if (aPhoton) 541 514 { 542 localEnergyDeposit -= itsEnergy; 543 energyInFluorescence += itsEnergy; 544 } 545 else 546 { 547 delete aPhoton; 548 (*photonVector)[k] = 0; 515 G4double itsEnergy = aPhoton->GetKineticEnergy(); 516 if (itsEnergy <= localEnergyDeposit) 517 { 518 if(aPhoton->GetDefinition() == G4Gamma::Gamma()) 519 energyInFluorescence += itsEnergy; 520 localEnergyDeposit -= itsEnergy; 521 fvect->push_back(aPhoton); 522 } 523 else 524 { 525 delete aPhoton; 526 (*photonVector)[k] = 0; 527 } 549 528 } 550 529 } 530 delete photonVector; 551 531 } 552 532 } … … 567 547 fvect->push_back(deltaElectron); 568 548 569 //Generate fluorescence, if it is the case570 //This block is executed only if there is at least one secondary photon produced by571 //G4AtomicDeexcitation572 if (photonVector)573 {574 for (size_t ll=0;ll<photonVector->size();ll++)575 if ((*photonVector)[ll])576 {577 G4DynamicParticle* aFluorescencePhoton = (*photonVector)[ll];578 fvect->push_back(aFluorescencePhoton);579 }580 }581 delete photonVector;582 583 549 if (localEnergyDeposit < 0) 584 550 { … … 753 719 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 754 720 755 void G4PenelopeIonisationModel::CalculateDiscreteForElectrons(G4double kinEnergy,G4double cutoffEnergy, 756 G4int Z,G4double electronVolumeDensity) 721 void 722 G4PenelopeIonisationModel::CalculateDiscreteForElectrons(G4double kinEnergy, 723 G4double cutoffEnergy, 724 G4int Z, 725 G4double electronVolumeDensity) 757 726 { 758 727 if (verboseLevel > 2) … … 1030 999 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1031 1000 1032 void G4PenelopeIonisationModel::CalculateDiscreteForPositrons(G4double kinEnergy,G4double cutoffEnergy, 1033 G4int Z,G4double electronVolumeDensity) 1001 void 1002 G4PenelopeIonisationModel::CalculateDiscreteForPositrons(G4double kinEnergy, 1003 G4double cutoffEnergy, 1004 G4int Z, 1005 G4double electronVolumeDensity) 1034 1006 { 1035 1007 kineticEnergy1=kinEnergy; … … 1287 1259 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1288 1260 1289 G4double G4PenelopeIonisationModel::CalculateCrossSectionsRatio(G4double kinEnergy, 1290 G4double cutoffEnergy, 1291 G4int Z, G4double electronVolumeDensity, 1292 const G4ParticleDefinition* theParticle) 1261 G4double 1262 G4PenelopeIonisationModel::CalculateCrossSectionsRatio(G4double kinEnergy, 1263 G4double cutoffEnergy, 1264 G4int Z, G4double electronVolumeDensity, 1265 const G4ParticleDefinition* theParticle) 1293 1266 { 1294 1267 //Constants … … 1320 1293 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1321 1294 1322 std::pair<G4double,G4double> G4PenelopeIonisationModel::CrossSectionsRatioForElectrons(G4double kineticEnergy, 1323 G4double resEnergy, 1324 G4double densityCorrection, 1325 G4double cutoffEnergy) 1295 std::pair<G4double,G4double> 1296 G4PenelopeIonisationModel::CrossSectionsRatioForElectrons(G4double kineticEnergy, 1297 G4double resEnergy, 1298 G4double densityCorrection, 1299 G4double cutoffEnergy) 1326 1300 { 1327 1301 std::pair<G4double,G4double> theResult(0.,0.); … … 1410 1384 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1411 1385 1412 std::pair<G4double,G4double> G4PenelopeIonisationModel::CrossSectionsRatioForPositrons(G4double kineticEnergy, 1413 G4double resEnergy, 1414 G4double densityCorrection, 1415 G4double cutoffEnergy) 1386 std::pair<G4double,G4double> 1387 G4PenelopeIonisationModel::CrossSectionsRatioForPositrons(G4double kineticEnergy, 1388 G4double resEnergy, 1389 G4double densityCorrection, 1390 G4double cutoffEnergy) 1416 1391 { 1417 1392 … … 1640 1615 #include "G4EMDataSet.hh" 1641 1616 1642 std::vector<G4VEMDataSet*>* G4PenelopeIonisationModel::BuildCrossSectionTable(const1643 1617 std::vector<G4VEMDataSet*>* 1618 G4PenelopeIonisationModel::BuildCrossSectionTable(const G4ParticleDefinition* theParticle) 1644 1619 { 1645 1620 std::vector<G4VEMDataSet*>* set = new std::vector<G4VEMDataSet*>; -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopePhotoElectric.cc
r1007 r1055 25 25 // 26 26 // 27 // $Id: G4PenelopePhotoElectric.cc,v 1.1 2 2006/06/29 19:40:51 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 2$27 // $Id: G4PenelopePhotoElectric.cc,v 1.14 2009/05/02 09:59:17 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 29 29 // 30 30 // Author: L. Pandola … … 37 37 // 31 May 2005 L. Pandola Added Sauter formula for the sampling of 38 38 // the electron direction 39 // 08 Jan 2009 L. Pandola Check shell index to avoid mismatch between 40 // the Penelope cross section database and the 41 // G4AtomicTransitionManager database. It suppresses 42 // a warning from G4AtomicTransitionManager only. 43 // Results are unchanged. 39 44 // -------------------------------------------------------------- 40 45 … … 89 94 << G4endl; 90 95 } 96 97 G4cout << G4endl; 98 G4cout << "*******************************************************************************" << G4endl; 99 G4cout << "*******************************************************************************" << G4endl; 100 G4cout << " The class G4PenelopePhotoElectric is NOT SUPPORTED ANYMORE. " << G4endl; 101 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 102 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 103 G4cout << "*******************************************************************************" << G4endl; 104 G4cout << "*******************************************************************************" << G4endl; 105 G4cout << G4endl; 106 91 107 } 92 108 … … 146 162 // Retrieve the corresponding identifier and binding energy of the selected shell 147 163 const G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance(); 164 165 //The number of shell cross section possibly reported in the Penelope database 166 //might be different from the number of shells in the G4AtomicTransitionManager 167 //(namely, Penelope may contain more shell, especially for very light elements). 168 //In order to avoid a warning message from the G4AtomicTransitionManager, I 169 //add this protection. Results are anyway changed, because when G4AtomicTransitionManager 170 //has a shellID>maxID, it sets the shellID to the last valid shell. 171 size_t numberOfShells = (size_t) transitionManager->NumberOfShells(Z); 172 if (shellIndex >= numberOfShells) 173 shellIndex = numberOfShells-1; 174 148 175 const G4AtomicShell* shell = transitionManager->Shell(Z,shellIndex); 149 176 G4double bindingEnergy = shell->BindingEnergy(); -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopePhotoElectricModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopePhotoElectricModel.cc,v 1. 2 2008/12/04 14:09:36pandola Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4PenelopePhotoElectricModel.cc,v 1.6 2009/05/19 14:57:01 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // Author: Luciano Pandola … … 31 31 // History: 32 32 // -------- 33 // 08 Oct 2008 L Pandola Migration from process to model 33 // 08 Oct 2008 L Pandola Migration from process to model 34 // 08 Jan 2009 L Pandola Check shell index to avoid mismatch between 35 // the Penelope cross section database and the 36 // G4AtomicTransitionManager database. It suppresses 37 // a warning from G4AtomicTransitionManager only. 38 // Results are unchanged. 39 // 25 Mar 2009 L Pandola Small fix to avoid wrong energy-violation warnings 40 // 17 Apr 2009 V Ivanchenko Cleanup initialisation and generation of secondaries: 41 // - apply internal high-energy limit only in constructor 42 // - do not apply low-energy limit (default is 0) 43 // - do not apply production threshold on secondaries 44 // 19 May 2009 L Pandola Explicitely set to zero pointers deleted in 45 // Initialise(), since they might be checked later on 34 46 // 35 47 … … 58 70 fIntrinsicLowEnergyLimit = 100.0*eV; 59 71 fIntrinsicHighEnergyLimit = 100.0*GeV; 60 SetLowEnergyLimit(fIntrinsicLowEnergyLimit);72 // SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 61 73 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 62 74 // … … 90 102 crossSectionHandler->Clear(); 91 103 delete crossSectionHandler; 104 crossSectionHandler = 0; 92 105 } 93 106 if (shellCrossSectionHandler) … … 95 108 shellCrossSectionHandler->Clear(); 96 109 delete shellCrossSectionHandler; 97 } 98 99 //Check energy limits 100 if (LowEnergyLimit() < fIntrinsicLowEnergyLimit) 101 { 102 G4cout << "G4PenelopePhotoElectricModel: low energy limit increased from " << 103 LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << 104 G4endl; 105 SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 106 } 107 if (HighEnergyLimit() > fIntrinsicHighEnergyLimit) 108 { 109 G4cout << "G4PenelopePhotoElectricModel: high energy limit decreased from " << 110 HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" 111 << G4endl; 112 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 113 } 114 110 shellCrossSectionHandler =0; 111 } 115 112 116 113 //Re-initialize cross section handlers … … 129 126 G4cout << "Loaded cross section files for PenelopePhotoElectric" << G4endl; 130 127 131 G4cout << "Penelope Photo-Electric model is initialized " << G4endl 132 << "Energy range: " 133 << LowEnergyLimit() / MeV << " MeV - " 134 << HighEnergyLimit() / GeV << " GeV" 135 << G4endl; 128 if (verboseLevel > 0) { 129 G4cout << "Penelope Photo-Electric model is initialized " << G4endl 130 << "Energy range: " 131 << LowEnergyLimit() / MeV << " MeV - " 132 << HighEnergyLimit() / GeV << " GeV" 133 << G4endl; 134 } 136 135 137 136 if(isInitialised) return; 138 139 if(pParticleChange) 140 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 141 else 142 fParticleChange = new G4ParticleChangeForGamma(); 137 fParticleChange = GetParticleChangeForGamma(); 143 138 isInitialised = true; 144 139 } … … 162 157 163 158 G4int iZ = (G4int) Z; 164 if (!crossSectionHandler)165 {166 G4cout << "G4PenelopePhotoElectricModel::ComputeCrossSectionPerAtom" << G4endl;167 G4cout << "The cross section handler is not correctly initialized" << G4endl;168 G4Exception();169 }159 // if (!crossSectionHandler) // VI: should not be 160 // { 161 // G4cout << "G4PenelopePhotoElectricModel::ComputeCrossSectionPerAtom" << G4endl; 162 // G4cout << "The cross section handler is not correctly initialized" << G4endl; 163 // G4Exception(); 164 // } 170 165 G4double cs = crossSectionHandler->FindValue(iZ,energy); 171 166 … … 203 198 G4double photonEnergy = aDynamicGamma->GetKineticEnergy(); 204 199 205 if (photonEnergy <= LowEnergyLimit()) 206 { 207 fParticleChange->ProposeTrackStatus(fStopAndKill); 208 fParticleChange->SetProposedKineticEnergy(0.); 200 // always kill primary 201 fParticleChange->ProposeTrackStatus(fStopAndKill); 202 fParticleChange->SetProposedKineticEnergy(0.); 203 204 if (photonEnergy <= fIntrinsicLowEnergyLimit) 205 { 209 206 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy); 210 207 return ; 211 }208 } 212 209 213 210 G4ParticleMomentum photonDirection = aDynamicGamma->GetMomentumDirection(); … … 217 214 G4cout << "Going to select element in " << couple->GetMaterial()->GetName() << G4endl; 218 215 //use crossSectionHandler instead of G4EmElementSelector because in this case 219 //the dimension of the table is equal to the dimension of the database (less interpolation errors) 216 //the dimension of the table is equal to the dimension of the database 217 //(less interpolation errors) 220 218 G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy); 221 219 if (verboseLevel > 2) … … 227 225 // Retrieve the corresponding identifier and binding energy of the selected shell 228 226 const G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance(); 227 228 //The number of shell cross section possibly reported in the Penelope database 229 //might be different from the number of shells in the G4AtomicTransitionManager 230 //(namely, Penelope may contain more shell, especially for very light elements). 231 //In order to avoid a warning message from the G4AtomicTransitionManager, I 232 //add this protection. Results are anyway changed, because when G4AtomicTransitionManager 233 //has a shellID>maxID, it sets the shellID to the last valid shell. 234 size_t numberOfShells = (size_t) transitionManager->NumberOfShells(Z); 235 if (shellIndex >= numberOfShells) 236 shellIndex = numberOfShells-1; 237 229 238 const G4AtomicShell* shell = transitionManager->Shell(Z,shellIndex); 230 239 G4double bindingEnergy = shell->BindingEnergy(); … … 236 245 G4double eKineticEnergy = photonEnergy - bindingEnergy; 237 246 238 G4double cutForLowEnergySecondaryParticles = 250.0*eV;239 const G4ProductionCutsTable* theCoupleTable=240 G4ProductionCutsTable::GetProductionCutsTable();241 size_t indx = couple->GetIndex();242 G4double cutE = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx];243 cutE = std::max(cutForLowEnergySecondaryParticles,cutE);244 245 247 // There may be cases where the binding energy of the selected shell is > photon energy 246 248 // In such cases do not generate secondaries … … 248 250 { 249 251 //Now check if the electron is above cuts: if so, it is created explicitely 250 if (eKineticEnergy > cutE) 251 { 252 // The electron is created 253 // Direction sampled from the Sauter distribution 254 G4double cosTheta = SampleElectronDirection(eKineticEnergy); 255 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta); 256 G4double phi = twopi * G4UniformRand() ; 257 G4double dirx = sinTheta * std::cos(phi); 258 G4double diry = sinTheta * std::sin(phi); 259 G4double dirz = cosTheta ; 260 G4ThreeVector electronDirection(dirx,diry,dirz); //electron direction 261 electronDirection.rotateUz(photonDirection); 262 G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(), 263 electronDirection, 264 eKineticEnergy); 265 fvect->push_back(electron); 266 } 267 else 268 localEnergyDeposit += eKineticEnergy; 269 } 252 //VI: checking cut here provides inconsistency in testing 253 // if (eKineticEnergy > cutE) 254 // The electron is created 255 // Direction sampled from the Sauter distribution 256 G4double cosTheta = SampleElectronDirection(eKineticEnergy); 257 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta); 258 G4double phi = twopi * G4UniformRand() ; 259 G4double dirx = sinTheta * std::cos(phi); 260 G4double diry = sinTheta * std::sin(phi); 261 G4double dirz = cosTheta ; 262 G4ThreeVector electronDirection(dirx,diry,dirz); //electron direction 263 electronDirection.rotateUz(photonDirection); 264 G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(), 265 electronDirection, 266 eKineticEnergy); 267 fvect->push_back(electron); 268 } 269 // else 270 // { 271 // localEnergyDeposit += eKineticEnergy; 272 // eKineticEnergy = 0; 273 // } 274 // } 270 275 else 276 { 271 277 bindingEnergy = photonEnergy; 272 273 278 } 274 279 G4double energyInFluorescence = 0; //testing purposes 275 280 276 281 //Now, take care of fluorescence, if required 277 if (fUseAtomicDeexcitation) 278 { 282 if(DeexcitationFlag() && Z > 5) 283 { 284 const G4ProductionCutsTable* theCoupleTable= 285 G4ProductionCutsTable::GetProductionCutsTable(); 286 size_t indx = couple->GetIndex(); 279 287 G4double cutG = (*(theCoupleTable->GetEnergyCutsVector(0)))[indx]; 280 cutG = std::min(cutForLowEnergySecondaryParticles,cutG);288 G4double cutE = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx]; 281 289 282 std::vector<G4DynamicParticle*>* photonVector = 0;283 284 290 // Protection to avoid generating photons in the unphysical case of 285 291 // shell binding energy > photon energy 286 if ( Z > 5 && (bindingEnergy > cutG || bindingEnergy > cutE))292 if (bindingEnergy > cutG || bindingEnergy > cutE) 287 293 { 288 photonVector = deexcitationManager.GenerateParticles(Z,shellId); 289 //Check for single photons (if they are above threshold) 290 for (size_t k=0; k< photonVector->size(); k++) 294 deexcitationManager.SetCutForSecondaryPhotons(cutG); 295 deexcitationManager.SetCutForAugerElectrons(cutE); 296 std::vector<G4DynamicParticle*>* photonVector = 297 deexcitationManager.GenerateParticles(Z,shellId); 298 //Check for secondaries 299 if(photonVector) 291 300 { 292 G4DynamicParticle* aPhoton = (*photonVector)[k]; 293 if (aPhoton) 301 for (size_t k=0; k< photonVector->size(); k++) 294 302 { 295 G4double itsCut = cutG; 296 if(aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cutE; 297 G4double itsEnergy = aPhoton->GetKineticEnergy(); 298 299 if (itsEnergy > itsCut && itsEnergy <= bindingEnergy) 303 G4DynamicParticle* aPhoton = (*photonVector)[k]; 304 if (aPhoton) 300 305 { 301 // Local energy deposit is given as the sum of the 302 // energies of incident photons minus the energies 303 // of the outcoming fluorescence photons 304 bindingEnergy -= itsEnergy; 305 306 } 307 else 308 { 309 (*photonVector)[k] = 0; 306 G4double itsEnergy = aPhoton->GetKineticEnergy(); 307 if (itsEnergy <= bindingEnergy) 308 { 309 if(aPhoton->GetDefinition() == G4Gamma::Gamma()) 310 energyInFluorescence += itsEnergy; 311 bindingEnergy -= itsEnergy; 312 fvect->push_back(aPhoton); 313 } 314 else 315 { 316 delete aPhoton; 317 (*photonVector)[k] = 0; 318 } 310 319 } 311 320 } 321 delete photonVector; 312 322 } 313 }314 //Register valid secondaries315 if (photonVector)316 {317 for ( size_t ll = 0; ll <photonVector->size(); ll++)318 {319 G4DynamicParticle* aPhoton = (*photonVector)[ll];320 if (aPhoton)321 {322 energyInFluorescence += aPhoton->GetKineticEnergy();323 fvect->push_back(aPhoton);324 }325 }326 delete photonVector;327 323 } 328 324 } … … 330 326 localEnergyDeposit += bindingEnergy; 331 327 332 333 328 if (localEnergyDeposit < 0) 334 329 { … … 339 334 } 340 335 341 //Update the status of the primary gamma (kill it)342 fParticleChange->SetProposedKineticEnergy(0.);343 336 fParticleChange->ProposeLocalEnergyDeposit(localEnergyDeposit); 344 fParticleChange->ProposeTrackStatus(fStopAndKill);345 337 346 338 if (verboseLevel > 1) … … 360 352 if (verboseLevel > 0) 361 353 { 362 G4double energyDiff = std::fabs(eKineticEnergy+energyInFluorescence+localEnergyDeposit-photonEnergy); 354 G4double energyDiff = 355 std::fabs(eKineticEnergy+energyInFluorescence+localEnergyDeposit-photonEnergy); 363 356 if (energyDiff > 0.05*keV) 364 357 G4cout << "Warning from G4PenelopePhotoElectric: problem with energy conservation: " << 365 (eKineticEnergy+energyInFluorescence+localEnergyDeposit)/keV << " keV (final) vs. " << 358 (eKineticEnergy+energyInFluorescence+localEnergyDeposit)/keV 359 << " keV (final) vs. " << 366 360 photonEnergy/keV << " keV (initial)" << G4endl; 367 361 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeRayleigh.cc
r1007 r1055 26 26 // -------------------------------------------------------------------- 27 27 // 28 // $Id: G4PenelopeRayleigh.cc,v 1.1 5 2007/09/03 09:43:14 pandolaExp $29 // GEANT4 tag $Name: geant4-09-0 2$28 // $Id: G4PenelopeRayleigh.cc,v 1.17 2009/05/02 09:59:17 sincerti Exp $ 29 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 30 30 // 31 31 // Author: L. Pandola (luciano.pandola@cern.ch) … … 41 41 // 03 Sep 2007 L.Pandola Bug fix for the filling of physics table for 42 42 // compounds defined by the mass fraction (bug #965) 43 // 02 Apr 2009 L.Pandola Bux fixed in the calculation of mfp for compound 44 // materials defined as fraction of mass 45 // (reported by Zhang Qiwei) 43 46 // -------------------------------------------------------------------- 44 47 … … 93 96 << G4endl; 94 97 } 98 99 G4cout << G4endl; 100 G4cout << "*******************************************************************************" << G4endl; 101 G4cout << "*******************************************************************************" << G4endl; 102 G4cout << " The class G4PenelopeRayleigh is NOT SUPPORTED ANYMORE. " << G4endl; 103 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl; 104 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl; 105 G4cout << "*******************************************************************************" << G4endl; 106 G4cout << "*******************************************************************************" << G4endl; 107 G4cout << G4endl; 95 108 } 96 109 … … 162 175 const G4double* vector_of_atoms = material->GetVecNbOfAtomsPerVolume(); 163 176 const G4int* stechiometric = material->GetAtomsVector(); 164 G4double density = vector_of_atoms[iright]; //non-bound molecules (default) 177 //cs is the cross section _per atom_ in the case of compounds, while it is 178 //_per molecule_ in the case of molecules 179 G4double density = material->GetTotNbOfAtomsPerVolume(); //non-bound molecules (default) 165 180 if (stechiometric) 166 181 { -
trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeRayleighModel.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PenelopeRayleighModel.cc,v 1. 2 2008/12/04 14:09:36pandola Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4PenelopeRayleighModel.cc,v 1.4 2009/05/19 14:57:01 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // Author: Luciano Pandola … … 32 32 // -------- 33 33 // 14 Oct 2008 L Pandola Migration from process to model 34 // 17 Apr 2009 V Ivanchenko Cleanup initialisation and generation of secondaries: 35 // - apply internal high-energy limit only in constructor 36 // - do not apply low-energy limit (default is 0) 37 // 19 May 2009 L Pandola Explicitely set to zero pointers deleted in 38 // PrepareConstants(), since they might be checked later on 34 39 // 35 40 … … 56 61 fIntrinsicLowEnergyLimit = 100.0*eV; 57 62 fIntrinsicHighEnergyLimit = 100.0*GeV; 58 SetLowEnergyLimit(fIntrinsicLowEnergyLimit);63 // SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 59 64 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 60 65 // … … 90 95 G4cout << "Calling G4PenelopeRayleighModel::Initialise()" << G4endl; 91 96 92 if (LowEnergyLimit() < fIntrinsicLowEnergyLimit) 93 { 94 G4cout << "G4PenelopeRayleighModel: low energy limit increased from " << 95 LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << G4endl; 96 SetLowEnergyLimit(fIntrinsicLowEnergyLimit); 97 } 98 if (HighEnergyLimit() > fIntrinsicHighEnergyLimit) 99 { 100 G4cout << "G4PenelopeRayleighModel: high energy limit decreased from " << 101 HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" << G4endl; 102 SetHighEnergyLimit(fIntrinsicHighEnergyLimit); 103 } 104 105 G4cout << "Penelope Rayleigh model is initialized " << G4endl 106 << "Energy range: " 107 << LowEnergyLimit() / keV << " keV - " 108 << HighEnergyLimit() / GeV << " GeV" 109 << G4endl; 97 98 if (verboseLevel > 0) { 99 G4cout << "Penelope Rayleigh model is initialized " << G4endl 100 << "Energy range: " 101 << LowEnergyLimit() / keV << " keV - " 102 << HighEnergyLimit() / GeV << " GeV" 103 << G4endl; 104 } 110 105 111 106 if(isInitialised) return; 112 113 if(pParticleChange) 114 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 115 else 116 fParticleChange = new G4ParticleChangeForGamma(); 107 fParticleChange = GetParticleChangeForGamma(); 117 108 isInitialised = true; 118 109 } … … 120 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 121 112 122 G4double G4PenelopeRayleighModel::CrossSectionPerVolume(const G4Material* material, 123 const G4ParticleDefinition* p, 124 G4double ekin, 125 G4double, 126 G4double) 113 G4double 114 G4PenelopeRayleighModel::CrossSectionPerVolume(const G4Material* material, 115 const G4ParticleDefinition* p, 116 G4double ekin, 117 G4double, 118 G4double) 127 119 { 128 120 // Penelope model to calculate the Rayleigh scattering inverse mean … … 233 225 234 226 void G4PenelopeRayleighModel::SampleSecondaries(std::vector<G4DynamicParticle*>* , 235 236 237 238 227 const G4MaterialCutsCouple* couple, 228 const G4DynamicParticle* aDynamicGamma, 229 G4double, 230 G4double) 239 231 { 240 232 // Penelope model to sample the Rayleigh scattering final state. … … 249 241 if (verboseLevel > 3) 250 242 G4cout << "Calling SamplingSecondaries() of G4PenelopeRayleighModel" << G4endl; 251 243 252 244 G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy(); 253 245 254 if (photonEnergy0 <= LowEnergyLimit())255 {246 if (photonEnergy0 <= fIntrinsicLowEnergyLimit) 247 { 256 248 fParticleChange->ProposeTrackStatus(fStopAndKill); 257 249 fParticleChange->SetProposedKineticEnergy(0.); 258 250 fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0); 259 251 return ; 260 }252 } 261 253 262 254 G4ParticleMomentum photonDirection0 = aDynamicGamma->GetMomentumDirection(); … … 534 526 Xhigh=1e06; 535 527 if (samplingFunction_x) 536 delete samplingFunction_x; 528 { 529 delete samplingFunction_x; 530 samplingFunction_x = 0; 531 } 537 532 if (samplingFunction_xNoLog) 538 delete samplingFunction_xNoLog; 539 533 { 534 delete samplingFunction_xNoLog; 535 samplingFunction_xNoLog = 0; 536 } 537 540 538 samplingFunction_x = new G4DataVector(); 541 539 samplingFunction_xNoLog = new G4DataVector(); -
trunk/source/processes/electromagnetic/lowenergy/src/G4ShellVacancy.cc
r819 r1055 50 50 51 51 { 52 /* 52 53 G4int size = xsis.size(); 53 54 for (G4int k =0; k<size; k++) … … 56 57 xsis[k] = 0; 57 58 } 59 */ 58 60 } 59 61 60 void G4ShellVacancy::AddXsiTable(G4VEMDataSet* set) 61 62 void G4ShellVacancy::AddXsiTable(G4VEMDataSet* p) 62 63 { 63 xsis.push_back( set);64 xsis.push_back(p); 64 65 } 65 66 -
trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationCrossSectionHandler.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eIonisationCrossSectionHandler.cc,v 1.1 1 2006/06/29 19:42:00 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4eIonisationCrossSectionHandler.cc,v 1.12 2009/01/29 08:13:34 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 42 42 // 19 Jul 2002 VI Create composite data set for material 43 43 // 21 Jan 2003 V.Ivanchenko Cut per region 44 // 28 Jan 2009 L.Pandola Added public method to make a easier migration of 45 // G4LowEnergyIonisation to G4LivermoreIonisationModel 44 46 // 45 47 // ------------------------------------------------------------------- … … 98 100 G4int nElements = material->GetNumberOfElements(); 99 101 100 if(verbose > 0) { 101 G4cout << "eIonisation CS for " << m << "th material " 102 << material->GetName() 103 << " eEl= " << nElements << G4endl; 104 } 102 if(verbose > 0) 103 { 104 G4cout << "eIonisation CS for " << m << "th material " 105 << material->GetName() 106 << " eEl= " << nElements << G4endl; 107 } 105 108 106 109 G4double tcut = (*energyCuts)[m]; … … 129 132 value += cross * p * density; 130 133 131 if(verbose>0 && m == 0 && e>=1. && e<=0.) { 134 if(verbose>0 && m == 0 && e>=1. && e<=0.) 135 { 132 136 G4cout << "G4eIonCrossSH: e(MeV)= " << e/MeV 133 137 << " n= " << n … … 139 143 << " Z= " << Z 140 144 << G4endl; 141 }145 } 142 146 143 147 } … … 155 159 } 156 160 157 161 G4double G4eIonisationCrossSectionHandler::GetCrossSectionAboveThresholdForElement(G4double energy, 162 G4double cutEnergy, 163 G4int Z) 164 { 165 G4int nShells = NumberOfComponents(Z); 166 G4double value = 0.; 167 if(energy > cutEnergy) 168 { 169 for (G4int n=0; n<nShells; n++) { 170 G4double cross = FindValue(Z, energy, n); 171 G4double p = theParam->Probability(Z, cutEnergy, energy, energy, n); 172 value += cross * p; 173 } 174 } 175 return value; 176 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationParameters.cc
r1007 r1055 25 25 // 26 26 // 27 // $Id: G4eIonisationParameters.cc,v 1.2 3 2006/06/29 19:42:02 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 2$27 // $Id: G4eIonisationParameters.cc,v 1.24 2009/03/23 09:13:44 pandola Exp $ 28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 41 41 // chenged to "ion-..." 42 42 // 17.02.04 V.Ivanchenko Increase buffer size 43 // 23.03.09 L.Pandola Updated warning message 43 44 // 44 45 // ------------------------------------------------------------------- … … 199 200 if (! (lsdp->is_open()) ) { 200 201 G4String excep = G4String("G4IonisationParameters - data file: ") 201 + name + G4String(" not found. The version 1.# of G4LEDATA should be used");202 + name + G4String(" not found. Please check and/or update G4LEDATA"); 202 203 G4Exception(excep); 203 204 } -
trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationSpectrum.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eIonisationSpectrum.cc,v 1.2 5 2006/06/29 19:42:04 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4eIonisationSpectrum.cc,v 1.26 2009/03/23 09:13:44 pandola Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 46 46 // 30.05.2002 VI Update to 24-parameters data 47 47 // 11.07.2002 VI Fix in integration over spectrum 48 // 23.03.2009 LP Added protection against division by zero (for 49 // faulty database files), Bug Report 1042 48 50 // 49 51 // ------------------------------------------------------------------- … … 125 127 p.push_back((2.0*g - 1.0)/(g*g)); 126 128 127 p[iMax-1] = Function(p[3], p); 129 //Add protection against division by zero: actually in Function() 130 //parameter p[3] appears in the denominator. Bug report 1042 131 if (p[3] > 0) 132 p[iMax-1] = Function(p[3], p); 133 else 134 { 135 G4cout << "WARNING: G4eIonisationSpectrum::Probability " 136 << "parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = " 137 << Z << ". Please check and/or update it " << G4endl; 138 } 128 139 129 140 if(e >= 1. && e <= 0. && Z == 4) p.push_back(0.0); … … 210 221 p.push_back((2.0*g - 1.0)/(g*g)); 211 222 212 p[iMax-1] = Function(p[3], p); 223 224 //Add protection against division by zero: actually in Function() 225 //parameter p[3] appears in the denominator. Bug report 1042 226 if (p[3] > 0) 227 p[iMax-1] = Function(p[3], p); 228 else 229 { 230 G4cout << "WARNING: G4eIonisationSpectrum::AverageEnergy " 231 << "parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = " 232 << Z << ". Please check and/or update it " << G4endl; 233 } 213 234 214 235 G4double val = AverageValue(x1, x2, p); … … 288 309 p.push_back((2.0*g - 1.0)/(g*g)); 289 310 290 p[iMax-1] = Function(p[3], p); 311 312 //Add protection against division by zero: actually in Function() 313 //parameter p[3] appears in the denominator. Bug report 1042 314 if (p[3] > 0) 315 p[iMax-1] = Function(p[3], p); 316 else 317 { 318 G4cout << "WARNING: G4eIonisationSpectrum::SampleSpectrum " 319 << "parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = " 320 << Z << ". Please check and/or update it " << G4endl; 321 } 291 322 292 323 G4double aria1 = 0.0; -
trunk/source/processes/electromagnetic/lowenergy/src/G4hLowEnergyLoss.cc
r1007 r1055 25 25 // 26 26 // 27 // $Id: G4hLowEnergyLoss.cc,v 1.2 7 2008/06/20 19:54:03sincerti Exp $28 // GEANT4 tag $Name: geant4-09-0 2$27 // $Id: G4hLowEnergyLoss.cc,v 1.28 2009/02/20 10:49:54 sincerti Exp $ 28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 29 29 // 30 30 // ----------------------------------------------------------- … … 145 145 G4double G4hLowEnergyLoss::HighestKineticEnergy= 100.*GeV; 146 146 G4int G4hLowEnergyLoss::TotBin = 360; 147 G4double G4hLowEnergyLoss::RTable,G4hLowEnergyLoss::LOGRTable; 147 G4double G4hLowEnergyLoss::RTable =1.1; 148 G4double G4hLowEnergyLoss::LOGRTable = 1.1; 148 149 149 150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 772 773 theRangeTable = theRangepbarTable ; 773 774 } 774 775 775 G4double R2 = RTable*RTable ; 776 776 G4double R1 = RTable+1.; … … 1062 1062 { 1063 1063 G4double LowEdgeRange,A,B,C,discr,KineticEnergy ; 1064 G4double Tbin = LowestKineticEnergy/RTable ; 1064 G4double Tbin = 0; 1065 if (RTable !=0.) Tbin = LowestKineticEnergy/RTable ; 1065 1066 G4double rangebin = 0.0 ; 1066 1067 G4int binnumber = -1 ;
Note: See TracChangeset
for help on using the changeset viewer.