Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // ------------------------------------------- 26 // ------------------------------------------------------------------- 27 // 27 // 28 // GEANT4 Class file 28 // GEANT4 Class file 29 // 29 // 30 // 30 // 31 // File name: G4hIonisation 31 // File name: G4hIonisation 32 // 32 // 33 // Author: Laszlo Urban 33 // Author: Laszlo Urban 34 // 34 // 35 // Creation date: 30.05.1997 35 // Creation date: 30.05.1997 36 // 36 // 37 // Modified by Laszlo Urban, Michel Maire and 37 // Modified by Laszlo Urban, Michel Maire and Vladimir Ivanchenko 38 // 38 // 39 // ------------------------------------------- 39 // ------------------------------------------------------------------- 40 // 40 // 41 //....oooOO0OOooo........oooOO0OOooo........oo 41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 42 //....oooOO0OOooo........oooOO0OOooo........oo 42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 43 43 44 #include "G4hIonisation.hh" 44 #include "G4hIonisation.hh" 45 #include "G4PhysicalConstants.hh" 45 #include "G4PhysicalConstants.hh" 46 #include "G4SystemOfUnits.hh" 46 #include "G4SystemOfUnits.hh" 47 #include "G4Electron.hh" 47 #include "G4Electron.hh" 48 #include "G4Proton.hh" 48 #include "G4Proton.hh" 49 #include "G4AntiProton.hh" 49 #include "G4AntiProton.hh" 50 #include "G4BraggModel.hh" 50 #include "G4BraggModel.hh" 51 #include "G4BetheBlochModel.hh" 51 #include "G4BetheBlochModel.hh" 52 #include "G4EmStandUtil.hh" 52 #include "G4EmStandUtil.hh" 53 #include "G4PionPlus.hh" 53 #include "G4PionPlus.hh" 54 #include "G4PionMinus.hh" 54 #include "G4PionMinus.hh" 55 #include "G4KaonPlus.hh" 55 #include "G4KaonPlus.hh" 56 #include "G4KaonMinus.hh" 56 #include "G4KaonMinus.hh" 57 #include "G4ICRU73QOModel.hh" 57 #include "G4ICRU73QOModel.hh" 58 #include "G4EmParameters.hh" 58 #include "G4EmParameters.hh" 59 59 60 //....oooOO0OOooo........oooOO0OOooo........oo 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 61 61 62 G4hIonisation::G4hIonisation(const G4String& n 62 G4hIonisation::G4hIonisation(const G4String& name) 63 : G4VEnergyLossProcess(name) << 63 : G4VEnergyLossProcess(name), >> 64 isInitialised(false) 64 { 65 { 65 SetProcessSubType(fIonisation); 66 SetProcessSubType(fIonisation); 66 SetSecondaryParticle(G4Electron::Electron()) 67 SetSecondaryParticle(G4Electron::Electron()); >> 68 mass = 0.0; >> 69 ratio = 0.0; 67 eth = 2*CLHEP::MeV; 70 eth = 2*CLHEP::MeV; 68 } 71 } 69 72 70 //....oooOO0OOooo........oooOO0OOooo........oo 73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 71 74 >> 75 G4hIonisation::~G4hIonisation() = default; >> 76 >> 77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 78 72 G4bool G4hIonisation::IsApplicable(const G4Par 79 G4bool G4hIonisation::IsApplicable(const G4ParticleDefinition&) 73 { 80 { 74 return true; 81 return true; 75 } 82 } 76 83 77 //....oooOO0OOooo........oooOO0OOooo........oo 84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 78 85 79 G4double G4hIonisation::MinPrimaryEnergy(const 86 G4double G4hIonisation::MinPrimaryEnergy(const G4ParticleDefinition*, 80 const G4Material*, 87 const G4Material*, 81 G4double cut) 88 G4double cut) 82 { 89 { 83 G4double x = 0.5*cut/electron_mass_c2; 90 G4double x = 0.5*cut/electron_mass_c2; 84 G4double gam = x*ratio + std::sqrt((1. + x)* 91 G4double gam = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio)); 85 return mass*(gam - 1.0); 92 return mass*(gam - 1.0); 86 } 93 } 87 94 88 //....oooOO0OOooo........oooOO0OOooo........oo 95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 89 96 90 void G4hIonisation::InitialiseEnergyLossProces 97 void G4hIonisation::InitialiseEnergyLossProcess( 91 const G4ParticleDefinition* part, 98 const G4ParticleDefinition* part, 92 const G4ParticleDefinition* bpart) 99 const G4ParticleDefinition* bpart) 93 { 100 { 94 if(!isInitialised) { 101 if(!isInitialised) { 95 102 96 const G4ParticleDefinition* theBaseParticl 103 const G4ParticleDefinition* theBaseParticle = nullptr; 97 G4String pname = part->GetParticleName(); 104 G4String pname = part->GetParticleName(); 98 G4double q = part->GetPDGCharge(); 105 G4double q = part->GetPDGCharge(); 99 106 100 //G4cout << " G4hIonisation::InitialiseEne 107 //G4cout << " G4hIonisation::InitialiseEnergyLossProcess " << pname 101 // << " " << bpart << G4endl; 108 // << " " << bpart << G4endl; 102 109 103 // define base particle 110 // define base particle 104 if(part == bpart) { 111 if(part == bpart) { 105 theBaseParticle = nullptr; 112 theBaseParticle = nullptr; 106 } else if(nullptr != bpart) { 113 } else if(nullptr != bpart) { 107 theBaseParticle = bpart; 114 theBaseParticle = bpart; 108 115 109 } else if(pname == "proton" || pname == "a 116 } else if(pname == "proton" || pname == "anti_proton" || 110 pname == "pi+" || pname == "pi-" || 117 pname == "pi+" || pname == "pi-" || 111 pname == "kaon+" || pname == "kaon-" | 118 pname == "kaon+" || pname == "kaon-" || 112 pname == "GenericIon" || pname == "alp 119 pname == "GenericIon" || pname == "alpha") { 113 // no base particles 120 // no base particles 114 theBaseParticle = nullptr; 121 theBaseParticle = nullptr; 115 122 116 } else { 123 } else { 117 // select base particle 124 // select base particle 118 if(part->GetPDGSpin() == 0.0) { 125 if(part->GetPDGSpin() == 0.0) { 119 if(q > 0.0) { theBaseParticle = G4KaonPlus:: 126 if(q > 0.0) { theBaseParticle = G4KaonPlus::KaonPlus(); } 120 else { theBaseParticle = G4KaonMinus::KaonMi 127 else { theBaseParticle = G4KaonMinus::KaonMinus(); } 121 } else { 128 } else { 122 if(q > 0.0) { theBaseParticle = G4Proton::Pr 129 if(q > 0.0) { theBaseParticle = G4Proton::Proton(); } 123 else { theBaseParticle = G4AntiProton::AntiP 130 else { theBaseParticle = G4AntiProton::AntiProton(); } 124 } 131 } 125 } 132 } 126 SetBaseParticle(theBaseParticle); 133 SetBaseParticle(theBaseParticle); 127 134 128 // model limit defined for protons 135 // model limit defined for protons 129 mass = part->GetPDGMass(); 136 mass = part->GetPDGMass(); 130 ratio = electron_mass_c2/mass; 137 ratio = electron_mass_c2/mass; 131 eth = 2.0*MeV*mass/proton_mass_c2; 138 eth = 2.0*MeV*mass/proton_mass_c2; 132 139 133 G4EmParameters* param = G4EmParameters::In 140 G4EmParameters* param = G4EmParameters::Instance(); 134 G4double emin = param->MinKinEnergy(); 141 G4double emin = param->MinKinEnergy(); 135 G4double emax = param->MaxKinEnergy(); 142 G4double emax = param->MaxKinEnergy(); 136 143 137 // define model of energy loss fluctuation 144 // define model of energy loss fluctuations 138 if (nullptr == FluctModel()) { 145 if (nullptr == FluctModel()) { 139 G4bool ion = (pname == "GenericIon" || p 146 G4bool ion = (pname == "GenericIon" || pname == "alpha"); 140 SetFluctModel(G4EmStandUtil::ModelOfFluc 147 SetFluctModel(G4EmStandUtil::ModelOfFluctuations(ion)); 141 } 148 } 142 149 143 if (nullptr == EmModel(0)) { 150 if (nullptr == EmModel(0)) { 144 if(q > 0.0) { SetEmModel(new G4BraggMode 151 if(q > 0.0) { SetEmModel(new G4BraggModel()); } 145 else { SetEmModel(new G4ICRU73QOM 152 else { SetEmModel(new G4ICRU73QOModel()); } 146 } 153 } 147 // to compute ranges correctly we have to 154 // to compute ranges correctly we have to use low-energy 148 // model even if activation limit is high 155 // model even if activation limit is high 149 EmModel(0)->SetLowEnergyLimit(emin); 156 EmModel(0)->SetLowEnergyLimit(emin); 150 157 151 // high energy limit may be eth or DBL_MAX 158 // high energy limit may be eth or DBL_MAX 152 G4double emax1 = (EmModel(0)->HighEnergyLi 159 G4double emax1 = (EmModel(0)->HighEnergyLimit() < emax) ? eth : emax; 153 EmModel(0)->SetHighEnergyLimit(emax1); 160 EmModel(0)->SetHighEnergyLimit(emax1); 154 AddEmModel(1, EmModel(0), FluctModel()); 161 AddEmModel(1, EmModel(0), FluctModel()); 155 162 156 // second model is used if the first does 163 // second model is used if the first does not cover energy range 157 if(emax1 < emax) { 164 if(emax1 < emax) { 158 if (nullptr == EmModel(1)) { SetEmModel( 165 if (nullptr == EmModel(1)) { SetEmModel(new G4BetheBlochModel()); } 159 EmModel(1)->SetLowEnergyLimit(emax1); 166 EmModel(1)->SetLowEnergyLimit(emax1); 160 167 161 // for extremely heavy particles upper l 168 // for extremely heavy particles upper limit of the model 162 // should be increased 169 // should be increased 163 emax = std::max(emax, eth*10); 170 emax = std::max(emax, eth*10); 164 EmModel(1)->SetHighEnergyLimit(emax); 171 EmModel(1)->SetHighEnergyLimit(emax); 165 AddEmModel(2, EmModel(1), FluctModel()); 172 AddEmModel(2, EmModel(1), FluctModel()); 166 } 173 } 167 isInitialised = true; 174 isInitialised = true; 168 } 175 } 169 } 176 } 170 177 171 //....oooOO0OOooo........oooOO0OOooo........oo 178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 172 179 173 void G4hIonisation::ProcessDescription(std::os 180 void G4hIonisation::ProcessDescription(std::ostream& out) const 174 { 181 { 175 out << " Hadron ionisation"; << 182 out << " Ionisation"; 176 G4VEnergyLossProcess::ProcessDescription(out 183 G4VEnergyLossProcess::ProcessDescription(out); 177 } 184 } 178 185 179 //....oooOO0OOooo........oooOO0OOooo........oo 186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 180 187