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( 94 const G4Material* material, << 87 const G4ParticleDefinition* aParticle, 95 G4double kineticEnergy) << 88 const G4Material* material, >> 89 G4double kineticEnergy) 96 { 90 { 97 G4double mass = aParticle->GetPDGMass() ; 91 G4double mass = aParticle->GetPDGMass() ; 98 G4double charge = (aParticle->GetPDGCharge() 92 G4double charge = (aParticle->GetPDGCharge())/eplus ; 99 93 100 G4double q = YangFluctuationModel(material,k 94 G4double q = YangFluctuationModel(material,kineticEnergy,mass,charge); 101 95 102 return q ; 96 return q ; 103 } 97 } 104 98 105 //....oooOO0OOooo........oooOO0OOooo........oo 99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 106 100 107 G4double G4IonYangFluctuationModel::HighEnergy << 101 G4double G4IonYangFluctuationModel::HighEnergyLimit( 108 const G4Material*) const << 102 const G4ParticleDefinition* aParticle, >> 103 const G4Material* material) const 109 { 104 { 110 return 1.0*TeV ; 105 return 1.0*TeV ; 111 } 106 } 112 107 113 //....oooOO0OOooo........oooOO0OOooo........oo 108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 114 109 115 G4double G4IonYangFluctuationModel::LowEnergyL << 110 G4double G4IonYangFluctuationModel::LowEnergyLimit( 116 const G4Material* ) const << 111 const G4ParticleDefinition* aParticle, >> 112 const G4Material* material) const 117 { 113 { 118 return 0.0 ; 114 return 0.0 ; 119 } 115 } 120 116 121 //....oooOO0OOooo........oooOO0OOooo........oo 117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 122 118 123 G4double G4IonYangFluctuationModel::HighEnergy << 119 G4double G4IonYangFluctuationModel::HighEnergyLimit( >> 120 const G4ParticleDefinition* aParticle) const 124 { 121 { 125 return 1.0*TeV ; 122 return 1.0*TeV ; 126 } 123 } 127 124 128 //....oooOO0OOooo........oooOO0OOooo........oo 125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 129 126 130 G4double G4IonYangFluctuationModel::LowEnergyL 127 G4double G4IonYangFluctuationModel::LowEnergyLimit( 131 const G4Particle << 128 const G4ParticleDefinition* aParticle) const 132 { 129 { 133 return 0.0 ; 130 return 0.0 ; 134 } 131 } 135 132 136 //....oooOO0OOooo........oooOO0OOooo........oo 133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 137 << 134 138 G4bool G4IonYangFluctuationModel::IsInCharge(c << 135 G4bool G4IonYangFluctuationModel::IsInCharge( 139 const G4Material* ) const << 136 const G4DynamicParticle* particle, >> 137 const G4Material* material) const 140 { 138 { 141 return true ; 139 return true ; 142 } 140 } 143 141 144 //....oooOO0OOooo........oooOO0OOooo........oo 142 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 145 << 143 146 G4bool G4IonYangFluctuationModel::IsInCharge(c << 144 G4bool G4IonYangFluctuationModel::IsInCharge( 147 const G4Material* ) const << 145 const G4ParticleDefinition* aParticle, >> 146 const G4Material* material) const 148 { 147 { 149 return true ; 148 return true ; 150 } 149 } 151 150 152 //....oooOO0OOooo........oooOO0OOooo........oo 151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 153 152 154 G4double G4IonYangFluctuationModel::YangFluctu << 153 G4double G4IonYangFluctuationModel::YangFluctuationModel( 155 G4double kineticEnergy, << 154 const G4Material* material, 156 G4double particleMass, << 155 G4double kineticEnergy, 157 G4double charge) const << 156 G4double particleMass, >> 157 G4double charge) const 158 { 158 { 159 // The aproximation of energy loss fluctuati << 159 // The aproximation of energy loss fluctuations 160 // Q.Yang et al., NIM B61(1991)149-155. 160 // Q.Yang et al., NIM B61(1991)149-155. 161 161 162 // Reduced energy in MeV/AMU 162 // Reduced energy in MeV/AMU 163 G4double energy = kineticEnergy *amu_c2/(par 163 G4double energy = kineticEnergy *amu_c2/(particleMass*MeV) ; 164 164 165 G4int i = 0 ; 165 G4int i = 0 ; 166 G4double factor = 1.0 ; 166 G4double factor = 1.0 ; 167 167 168 // The index of set of parameters i = 0 for 168 // The index of set of parameters i = 0 for protons(hadrons) in gases 169 // 1 for 169 // 1 for protons(hadrons) in solids 170 // 2 for 170 // 2 for ions in atomic gases 171 // 3 for 171 // 3 for ions in molecular gases 172 // 4 for 172 // 4 for ions in solids 173 static const G4double b[5][4] = { << 173 static G4double b[5][4] = { 174 {0.1014, 0.3700, 0.9642, 3.987}, 174 {0.1014, 0.3700, 0.9642, 3.987}, 175 {0.1955, 0.6941, 2.522, 1.040}, 175 {0.1955, 0.6941, 2.522, 1.040}, 176 {0.05058, 0.08975, 0.1419, 10.80}, 176 {0.05058, 0.08975, 0.1419, 10.80}, 177 {0.05009, 0.08660, 0.2751, 3.787}, 177 {0.05009, 0.08660, 0.2751, 3.787}, 178 {0.01273, 0.03458, 0.3951, 3.812} 178 {0.01273, 0.03458, 0.3951, 3.812} 179 } ; 179 } ; 180 180 181 // protons (hadrons) << 181 // protons (hadrons) 182 if(1.5 > charge) { 182 if(1.5 > charge) { 183 if( kStateGas != material->GetState() ) i 183 if( kStateGas != material->GetState() ) i = 1 ; 184 184 185 // ions 185 // ions 186 } else { 186 } else { 187 G4double zeff = (material->GetElectronDens 187 G4double zeff = (material->GetElectronDensity())/ 188 (material->GetTotNbOfAtoms 188 (material->GetTotNbOfAtomsPerVolume()) ; 189 factor = charge * std::pow(charge/zeff, 0. << 189 factor = charge * pow(charge/zeff, 0.3333) ; 190 190 191 if( kStateGas == material->GetState() ) { 191 if( kStateGas == material->GetState() ) { 192 energy /= (charge * std::sqrt(charge)) ; << 192 energy /= (charge * sqrt(charge)) ; 193 193 194 if(1 == (material->GetNumberOfElements() 194 if(1 == (material->GetNumberOfElements())) { 195 i = 2 ; 195 i = 2 ; 196 } else { 196 } else { 197 i = 3 ; 197 i = 3 ; 198 } 198 } 199 199 200 } else { 200 } else { 201 energy /= (charge * std::sqrt(charge*zef << 201 energy /= (charge * sqrt(charge*zeff)) ; 202 i = 4 ; 202 i = 4 ; 203 } 203 } 204 } 204 } 205 205 206 G4double x = b[i][2] * (1.0 - G4Exp( - energ << 206 G4double x = b[i][2] * (1.0 - exp( - energy * b[i][3] )) ; 207 207 208 G4double q = factor * x * b[i][0] / << 208 G4double q = factor * x * b[i][0] / 209 ((energy - b[i][1])*(energy - b[i 209 ((energy - b[i][1])*(energy - b[i][1]) + x*x) ; 210 210 211 return q ; << 211 return q ; 212 } 212 } >> 213 >> 214 >> 215 >> 216 >> 217 >> 218 213 219