Geant4 Cross Reference |
>> 1 // This code implementation is the intellectual property of >> 2 // the GEANT4 collaboration. 1 // 3 // 2 // ******************************************* << 4 // By copying, distributing or modifying the Program (or any work 3 // * License and Disclaimer << 5 // based on the Program) you indicate your acceptance of this statement, 4 // * << 6 // and all its terms. 5 // * The Geant4 software is copyright of th << 6 // * the Geant4 Collaboration. It is provided << 7 // * conditions of the Geant4 Software License << 8 // * LICENSE and available at http://cern.ch/ << 9 // * include a list of copyright holders. << 10 // * << 11 // * Neither the authors of this software syst << 12 // * institutes,nor the agencies providing fin << 13 // * work make any representation or warran << 14 // * regarding this software system or assum << 15 // * use. Please see the license in the file << 16 // * for the full disclaimer and the limitatio << 17 // * << 18 // * This code implementation is the result << 19 // * technical work of the GEANT4 collaboratio << 20 // * By using, copying, modifying or distri << 21 // * any work based on the software) you ag << 22 // * use in resulting scientific publicati << 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* << 25 // << 26 // 7 // 27 // ------------------------------------------- 8 // ------------------------------------------------------------------- 28 // 9 // 29 // GEANT4 Class file 10 // GEANT4 Class file 30 // 11 // >> 12 // For information related to this code contact: >> 13 // Geant4 Collaboration 31 // 14 // 32 // File name: G4hNuclearStoppingModel 15 // File name: G4hNuclearStoppingModel 33 // 16 // 34 // Author: V.Ivanchenko (Vladimir.Ivanc 17 // Author: V.Ivanchenko (Vladimir.Ivanchenko@cern.ch) 35 // 18 // 36 // Creation date: 20 July 2000 19 // Creation date: 20 July 2000 37 // 20 // 38 // Modifications: 21 // Modifications: 39 // 20/07/2000 V.Ivanchenko First implementati 22 // 20/07/2000 V.Ivanchenko First implementation 40 // 22/08/2000 V.Ivanchenko Bug fixed in call 23 // 22/08/2000 V.Ivanchenko Bug fixed in call of a model 41 // 03/10/2000 V.Ivanchenko CodeWizard clean u 24 // 03/10/2000 V.Ivanchenko CodeWizard clean up 42 // 25 // 43 // Class Description: 26 // Class Description: 44 // 27 // 45 // Low energy protons/ions nuclear stopping pa 28 // Low energy protons/ions nuclear stopping parametrisation 46 // 29 // 47 // Class Description: End 30 // Class Description: End 48 // 31 // 49 // ------------------------------------------- 32 // ------------------------------------------------------------------- 50 // 33 // 51 //....oooOO0OOooo........oooOO0OOooo........oo 34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 52 //....oooOO0OOooo........oooOO0OOooo........oo 35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 53 36 54 #include "G4hNuclearStoppingModel.hh" 37 #include "G4hNuclearStoppingModel.hh" 55 << 56 #include "globals.hh" << 57 #include "G4PhysicalConstants.hh" << 58 #include "G4SystemOfUnits.hh" << 59 #include "G4UnitsTable.hh" 38 #include "G4UnitsTable.hh" >> 39 #include "globals.hh" >> 40 #include "G4hZiegler1977Nuclear.hh" 60 #include "G4hZiegler1985Nuclear.hh" 41 #include "G4hZiegler1985Nuclear.hh" 61 #include "G4hICRU49Nuclear.hh" 42 #include "G4hICRU49Nuclear.hh" 62 #include "G4DynamicParticle.hh" 43 #include "G4DynamicParticle.hh" 63 #include "G4ParticleDefinition.hh" 44 #include "G4ParticleDefinition.hh" 64 #include "G4ElementVector.hh" 45 #include "G4ElementVector.hh" 65 #include "G4Material.hh" << 66 46 67 //....oooOO0OOooo........oooOO0OOooo........oo 47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 68 48 69 G4hNuclearStoppingModel::G4hNuclearStoppingMod << 49 G4hNuclearStoppingModel::G4hNuclearStoppingModel(const G4String& name): 70 :G4VLowEnergyModel(name), modelName(name) << 50 G4VLowEnergyModel(name) 71 { 51 { >> 52 modelName = name ; 72 InitializeMe() ; 53 InitializeMe() ; 73 } 54 } 74 55 75 //....oooOO0OOooo........oooOO0OOooo........oo 56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 76 57 77 void G4hNuclearStoppingModel::InitializeMe() 58 void G4hNuclearStoppingModel::InitializeMe() 78 { 59 { 79 // Constants 60 // Constants 80 highEnergyLimit = 100.*MeV ; 61 highEnergyLimit = 100.*MeV ; 81 lowEnergyLimit = 1.*eV ; 62 lowEnergyLimit = 1.*eV ; 82 factorPDG2AMU = 1.007276/proton_mass_c2 ; 63 factorPDG2AMU = 1.007276/proton_mass_c2 ; 83 theZieglerFactor= eV*cm2*1.0e-15 ; 64 theZieglerFactor= eV*cm2*1.0e-15 ; 84 65 85 // Registration of parametrisation models of 66 // Registration of parametrisation models of nuclear energy losses 86 G4String blank = G4String(" ") ; 67 G4String blank = G4String(" ") ; >> 68 G4String zi77 = G4String("Ziegler1977") ; 87 G4String ir49 = G4String("ICRU_R49") ; 69 G4String ir49 = G4String("ICRU_R49") ; 88 G4String zi85 = G4String("Ziegler1985") ; 70 G4String zi85 = G4String("Ziegler1985") ; 89 if(ir49 == modelName || blank == modelName) << 71 if(zi77 == modelName) { >> 72 nStopingPowerTable = new G4hZiegler1977Nuclear(); >> 73 >> 74 } else if(ir49 == modelName || blank == modelName) { 90 nStopingPowerTable = new G4hICRU49Nuclea 75 nStopingPowerTable = new G4hICRU49Nuclear(); 91 76 92 } else if(zi85 == modelName) { 77 } else if(zi85 == modelName) { 93 nStopingPowerTable = new G4hZiegler1985N 78 nStopingPowerTable = new G4hZiegler1985Nuclear(); 94 79 95 } else { 80 } else { 96 G4cout << 81 G4cout << 97 "G4hLowEnergyIonisation warning: There is 82 "G4hLowEnergyIonisation warning: There is no table with the modelName <" 98 << modelName << ">" << 83 << modelName << ">" 99 << " for nuclear stopping, <ICRU_R49> is << 84 << " for nuclear stopping, <ICRU_R49> is applied " 100 << G4endl; << 85 << G4endl; 101 nStopingPowerTable = new G4hICRU49Nuclear( 86 nStopingPowerTable = new G4hICRU49Nuclear(); 102 } 87 } 103 88 104 // Default is nuclear stopping fluctuations 89 // Default is nuclear stopping fluctuations On 105 // nStopingPowerTable->SetNuclearStoppingFl << 90 nStopingPowerTable->SetNuclearStoppingFluctuationsOn(); 106 nStopingPowerTable->SetNuclearStoppingFluctu << 107 } 91 } 108 92 109 //....oooOO0OOooo........oooOO0OOooo........oo 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 110 94 111 G4hNuclearStoppingModel::~G4hNuclearStoppingMo 95 G4hNuclearStoppingModel::~G4hNuclearStoppingModel() 112 { 96 { 113 delete nStopingPowerTable; 97 delete nStopingPowerTable; 114 } 98 } 115 99 116 //....oooOO0OOooo........oooOO0OOooo........oo 100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 117 101 118 G4double G4hNuclearStoppingModel::TheValue( 102 G4double G4hNuclearStoppingModel::TheValue( 119 const G4DynamicParti 103 const G4DynamicParticle* particle, 120 const G4Material* material 104 const G4Material* material) 121 { 105 { 122 // Projectile nucleus 106 // Projectile nucleus 123 G4double energy = particle->GetKineticEnergy 107 G4double energy = particle->GetKineticEnergy() ; 124 G4double z1 = std::abs((particle->GetCharge( << 108 G4double z1 = abs((particle->GetCharge())/eplus) ; 125 G4double m1 = (particle->GetMass())*factorPD 109 G4double m1 = (particle->GetMass())*factorPDG2AMU ; 126 110 127 G4double nloss = StoppingPower(material, ene 111 G4double nloss = StoppingPower(material, energy, z1, m1) * theZieglerFactor; 128 112 129 return nloss; 113 return nloss; 130 } 114 } 131 115 132 //....oooOO0OOooo........oooOO0OOooo........oo 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 133 117 134 G4double G4hNuclearStoppingModel::TheValue( 118 G4double G4hNuclearStoppingModel::TheValue( 135 const G4ParticleDefi 119 const G4ParticleDefinition* aParticle, 136 const G4Material* material, 120 const G4Material* material, 137 G4double kinet 121 G4double kineticEnergy) 138 { 122 { 139 // Projectile nucleus 123 // Projectile nucleus 140 G4double z1 = std::abs((aParticle->GetPDGCha << 124 G4double z1 = abs((aParticle->GetPDGCharge())/eplus) ; 141 G4double m1 = (aParticle->GetPDGMass())*fact 125 G4double m1 = (aParticle->GetPDGMass())*factorPDG2AMU ; 142 126 143 G4double nloss = StoppingPower(material, kin 127 G4double nloss = StoppingPower(material, kineticEnergy, z1, m1) 144 * theZieglerFactor; 128 * theZieglerFactor; 145 129 146 return nloss; 130 return nloss; 147 } 131 } 148 132 149 //....oooOO0OOooo........oooOO0OOooo........oo 133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 150 134 151 G4double G4hNuclearStoppingModel::StoppingPowe 135 G4double G4hNuclearStoppingModel::StoppingPower( 152 const G4Material* ma 136 const G4Material* material, 153 G4double kinet 137 G4double kineticEnergy, 154 G4double z1, G 138 G4double z1, G4double m1) const 155 { 139 { 156 // Target nucleus 140 // Target nucleus 157 std::size_t NumberOfElements = material->Get << 141 G4int NumberOfElements = material->GetNumberOfElements() ; 158 if(0 == NumberOfElements) return 0.0 ; 142 if(0 == NumberOfElements) return 0.0 ; 159 143 160 const G4ElementVector* theElementVector = 144 const G4ElementVector* theElementVector = 161 material->Get 145 material->GetElementVector() ; 162 const G4double* theAtomicNumDensityVector = 146 const G4double* theAtomicNumDensityVector = 163 material->Get 147 material->GetAtomicNumDensityVector() ; 164 148 165 // loop for the elements in the material 149 // loop for the elements in the material 166 150 167 G4double nloss = 0.0; 151 G4double nloss = 0.0; 168 152 169 for (std::size_t iel=0; iel<NumberOfElements << 153 for (G4int iel=0; iel<NumberOfElements; iel++) { 170 const G4Element* element = (*theElementVec << 154 const G4Element* element = (*theElementVector)(iel) ; 171 G4double z2 = element->GetZ(); << 155 G4double z2 = element->GetZ() ; 172 G4double m2Local = element->GetA()*mole/g << 156 G4double m2 = element->GetA()*mole/g ; 173 nloss += (nStopingPowerTable-> 157 nloss += (nStopingPowerTable-> 174 NuclearStoppingPower(kineticEner << 158 NuclearStoppingPower(kineticEnergy, z1, z2, m1, m2)) 175 * theAtomicNumDensityVector[iel] ; 159 * theAtomicNumDensityVector[iel] ; 176 } 160 } 177 161 178 return nloss; 162 return nloss; 179 } 163 } 180 164 181 //....oooOO0OOooo........oooOO0OOooo........oo 165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 166 >> 167 >> 168 >> 169 >> 170 >> 171 >> 172 >> 173 182 174