Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // 27 // ------------------------------------------- 24 // ------------------------------------------------------------------- 28 // 25 // 29 // GEANT4 Class file 26 // GEANT4 Class file 30 // 27 // 31 // 28 // 32 // File name: G4IonYangFluctuationModel 29 // File name: G4IonYangFluctuationModel 33 // 30 // 34 // Author: V.Ivanchenko (Vladimir.Ivanc 31 // Author: V.Ivanchenko (Vladimir.Ivanchenko@cern.ch) 35 // << 32 // 36 // Creation date: 18 August 2000 33 // Creation date: 18 August 2000 37 // 34 // 38 // Modifications: << 35 // Modifications: 39 // 18/08/2000 V.Ivanchenko First implementati 36 // 18/08/2000 V.Ivanchenko First implementation 40 // 04/09/2000 V.Ivanchenko Rename fluctuation << 37 // 04/09/2000 V.Ivanchenko Rename fluctuations 41 // 03/10/2000 V.Ivanchenko CodeWizard clean u 38 // 03/10/2000 V.Ivanchenko CodeWizard clean up 42 // 10/05/2001 V.Ivanchenko Clean up againist 39 // 10/05/2001 V.Ivanchenko Clean up againist Linux compilation with -Wall 43 // 40 // 44 // ------------------------------------------- 41 // ------------------------------------------------------------------- 45 // Class Description: << 42 // Class Description: 46 // 43 // 47 // The aproximation of additional ion energy l << 44 // The aproximation of additional ion energy loss fluctuations 48 // Q.Yang et al., NIM B61(1991)149-155. 45 // Q.Yang et al., NIM B61(1991)149-155. 49 // 46 // 50 // Class Description: End << 47 // Class Description: End 51 // 48 // 52 // ------------------------------------------- 49 // ------------------------------------------------------------------- 53 // 50 // 54 //....oooOO0OOooo........oooOO0OOooo........oo 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 55 52 56 #include "G4IonYangFluctuationModel.hh" 53 #include "G4IonYangFluctuationModel.hh" 57 << 58 #include "globals.hh" << 59 #include "G4PhysicalConstants.hh" << 60 #include "G4SystemOfUnits.hh" << 61 #include "G4DynamicParticle.hh" 54 #include "G4DynamicParticle.hh" 62 #include "G4ParticleDefinition.hh" 55 #include "G4ParticleDefinition.hh" 63 #include "G4Material.hh" 56 #include "G4Material.hh" 64 #include "G4Exp.hh" << 57 #include "globals.hh" 65 58 66 //....oooOO0OOooo........oooOO0OOooo........oo 59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 67 60 68 G4IonYangFluctuationModel::G4IonYangFluctuatio 61 G4IonYangFluctuationModel::G4IonYangFluctuationModel(const G4String& name) 69 : G4VLowEnergyModel(name) 62 : G4VLowEnergyModel(name) 70 {;} 63 {;} 71 64 72 //....oooOO0OOooo........oooOO0OOooo........oo 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 73 66 74 G4IonYangFluctuationModel::~G4IonYangFluctuati << 67 G4IonYangFluctuationModel::~G4IonYangFluctuationModel() 75 {;} 68 {;} 76 69 77 //....oooOO0OOooo........oooOO0OOooo........oo 70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 78 71 79 G4double G4IonYangFluctuationModel::TheValue(c 72 G4double G4IonYangFluctuationModel::TheValue(const G4DynamicParticle* particle, 80 const G4Material* material) << 73 const G4Material* material) 81 { 74 { 82 G4double energy = particle->GetKineticEnergy 75 G4double energy = particle->GetKineticEnergy() ; 83 G4double mass = particle->GetMass() ; 76 G4double mass = particle->GetMass() ; 84 G4double charge = (particle->GetCharge())/ep 77 G4double charge = (particle->GetCharge())/eplus ; 85 78 86 G4double q = YangFluctuationModel(material,e 79 G4double q = YangFluctuationModel(material,energy,mass,charge) ; 87 80 88 return q ; 81 return q ; 89 } 82 } 90 83 91 //....oooOO0OOooo........oooOO0OOooo........oo 84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 85 93 G4double G4IonYangFluctuationModel::TheValue(c 86 G4double G4IonYangFluctuationModel::TheValue(const G4ParticleDefinition* aParticle, 94 const G4Material* material, 87 const G4Material* material, 95 G4double kineticEnergy) << 88 G4double kineticEnergy) 96 { 89 { 97 G4double mass = aParticle->GetPDGMass() ; 90 G4double mass = aParticle->GetPDGMass() ; 98 G4double charge = (aParticle->GetPDGCharge() 91 G4double charge = (aParticle->GetPDGCharge())/eplus ; 99 92 100 G4double q = YangFluctuationModel(material,k 93 G4double q = YangFluctuationModel(material,kineticEnergy,mass,charge); 101 94 102 return q ; 95 return q ; 103 } 96 } 104 97 105 //....oooOO0OOooo........oooOO0OOooo........oo 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 106 99 107 G4double G4IonYangFluctuationModel::HighEnergy 100 G4double G4IonYangFluctuationModel::HighEnergyLimit(const G4ParticleDefinition*, 108 const G4Material*) const 101 const G4Material*) const 109 { 102 { 110 return 1.0*TeV ; 103 return 1.0*TeV ; 111 } 104 } 112 105 113 //....oooOO0OOooo........oooOO0OOooo........oo 106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 114 107 115 G4double G4IonYangFluctuationModel::LowEnergyL 108 G4double G4IonYangFluctuationModel::LowEnergyLimit(const G4ParticleDefinition* , 116 const G4Material* ) const 109 const G4Material* ) const 117 { 110 { 118 return 0.0 ; 111 return 0.0 ; 119 } 112 } 120 113 121 //....oooOO0OOooo........oooOO0OOooo........oo 114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 122 115 123 G4double G4IonYangFluctuationModel::HighEnergy 116 G4double G4IonYangFluctuationModel::HighEnergyLimit(const G4ParticleDefinition* ) const 124 { 117 { 125 return 1.0*TeV ; 118 return 1.0*TeV ; 126 } 119 } 127 120 128 //....oooOO0OOooo........oooOO0OOooo........oo 121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 129 122 130 G4double G4IonYangFluctuationModel::LowEnergyL 123 G4double G4IonYangFluctuationModel::LowEnergyLimit( 131 const G4Particle 124 const G4ParticleDefinition* ) const 132 { 125 { 133 return 0.0 ; 126 return 0.0 ; 134 } 127 } 135 128 136 //....oooOO0OOooo........oooOO0OOooo........oo 129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 137 << 130 138 G4bool G4IonYangFluctuationModel::IsInCharge(c 131 G4bool G4IonYangFluctuationModel::IsInCharge(const G4DynamicParticle*, 139 const G4Material* ) const 132 const G4Material* ) const 140 { 133 { 141 return true ; 134 return true ; 142 } 135 } 143 136 144 //....oooOO0OOooo........oooOO0OOooo........oo 137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 145 << 138 146 G4bool G4IonYangFluctuationModel::IsInCharge(c 139 G4bool G4IonYangFluctuationModel::IsInCharge(const G4ParticleDefinition* , 147 const G4Material* ) const 140 const G4Material* ) const 148 { 141 { 149 return true ; 142 return true ; 150 } 143 } 151 144 152 //....oooOO0OOooo........oooOO0OOooo........oo 145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 153 146 154 G4double G4IonYangFluctuationModel::YangFluctu 147 G4double G4IonYangFluctuationModel::YangFluctuationModel(const G4Material* material, 155 G4double kineticEnergy, 148 G4double kineticEnergy, 156 G4double particleMass, 149 G4double particleMass, 157 G4double charge) const 150 G4double charge) const 158 { 151 { 159 // The aproximation of energy loss fluctuati << 152 // The aproximation of energy loss fluctuations 160 // Q.Yang et al., NIM B61(1991)149-155. 153 // Q.Yang et al., NIM B61(1991)149-155. 161 154 162 // Reduced energy in MeV/AMU 155 // Reduced energy in MeV/AMU 163 G4double energy = kineticEnergy *amu_c2/(par 156 G4double energy = kineticEnergy *amu_c2/(particleMass*MeV) ; 164 157 165 G4int i = 0 ; 158 G4int i = 0 ; 166 G4double factor = 1.0 ; 159 G4double factor = 1.0 ; 167 160 168 // The index of set of parameters i = 0 for 161 // The index of set of parameters i = 0 for protons(hadrons) in gases 169 // 1 for 162 // 1 for protons(hadrons) in solids 170 // 2 for 163 // 2 for ions in atomic gases 171 // 3 for 164 // 3 for ions in molecular gases 172 // 4 for 165 // 4 for ions in solids 173 static const G4double b[5][4] = { << 166 static G4double b[5][4] = { 174 {0.1014, 0.3700, 0.9642, 3.987}, 167 {0.1014, 0.3700, 0.9642, 3.987}, 175 {0.1955, 0.6941, 2.522, 1.040}, 168 {0.1955, 0.6941, 2.522, 1.040}, 176 {0.05058, 0.08975, 0.1419, 10.80}, 169 {0.05058, 0.08975, 0.1419, 10.80}, 177 {0.05009, 0.08660, 0.2751, 3.787}, 170 {0.05009, 0.08660, 0.2751, 3.787}, 178 {0.01273, 0.03458, 0.3951, 3.812} 171 {0.01273, 0.03458, 0.3951, 3.812} 179 } ; 172 } ; 180 173 181 // protons (hadrons) << 174 // protons (hadrons) 182 if(1.5 > charge) { 175 if(1.5 > charge) { 183 if( kStateGas != material->GetState() ) i 176 if( kStateGas != material->GetState() ) i = 1 ; 184 177 185 // ions 178 // ions 186 } else { 179 } else { 187 G4double zeff = (material->GetElectronDens 180 G4double zeff = (material->GetElectronDensity())/ 188 (material->GetTotNbOfAtoms 181 (material->GetTotNbOfAtomsPerVolume()) ; 189 factor = charge * std::pow(charge/zeff, 0. << 182 factor = charge * pow(charge/zeff, 0.3333) ; 190 183 191 if( kStateGas == material->GetState() ) { 184 if( kStateGas == material->GetState() ) { 192 energy /= (charge * std::sqrt(charge)) ; << 185 energy /= (charge * sqrt(charge)) ; 193 186 194 if(1 == (material->GetNumberOfElements() 187 if(1 == (material->GetNumberOfElements())) { 195 i = 2 ; 188 i = 2 ; 196 } else { 189 } else { 197 i = 3 ; 190 i = 3 ; 198 } 191 } 199 192 200 } else { 193 } else { 201 energy /= (charge * std::sqrt(charge*zef << 194 energy /= (charge * sqrt(charge*zeff)) ; 202 i = 4 ; 195 i = 4 ; 203 } 196 } 204 } 197 } 205 198 206 G4double x = b[i][2] * (1.0 - G4Exp( - energ << 199 G4double x = b[i][2] * (1.0 - exp( - energy * b[i][3] )) ; 207 200 208 G4double q = factor * x * b[i][0] / << 201 G4double q = factor * x * b[i][0] / 209 ((energy - b[i][1])*(energy - b[i 202 ((energy - b[i][1])*(energy - b[i][1]) + x*x) ; 210 203 211 return q ; << 204 return q ; 212 } 205 } >> 206 >> 207 >> 208 >> 209 >> 210 >> 211 213 212