Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 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 // ------------------------------------------- 27 // 28 // GEANT4 Class file 29 // 30 // 31 // File name: G4hIonisation 32 // 33 // Author: Laszlo Urban 34 // 35 // Creation date: 30.05.1997 36 // 37 // Modified by Laszlo Urban, Michel Maire and 38 // 39 // ------------------------------------------- 40 // 41 //....oooOO0OOooo........oooOO0OOooo........oo 42 //....oooOO0OOooo........oooOO0OOooo........oo 43 44 #include "G4hIonisation.hh" 45 #include "G4PhysicalConstants.hh" 46 #include "G4SystemOfUnits.hh" 47 #include "G4Electron.hh" 48 #include "G4Proton.hh" 49 #include "G4AntiProton.hh" 50 #include "G4BraggModel.hh" 51 #include "G4BetheBlochModel.hh" 52 #include "G4EmStandUtil.hh" 53 #include "G4PionPlus.hh" 54 #include "G4PionMinus.hh" 55 #include "G4KaonPlus.hh" 56 #include "G4KaonMinus.hh" 57 #include "G4ICRU73QOModel.hh" 58 #include "G4EmParameters.hh" 59 60 //....oooOO0OOooo........oooOO0OOooo........oo 61 62 G4hIonisation::G4hIonisation(const G4String& n 63 : G4VEnergyLossProcess(name) 64 { 65 SetProcessSubType(fIonisation); 66 SetSecondaryParticle(G4Electron::Electron()) 67 eth = 2*CLHEP::MeV; 68 } 69 70 //....oooOO0OOooo........oooOO0OOooo........oo 71 72 G4bool G4hIonisation::IsApplicable(const G4Par 73 { 74 return true; 75 } 76 77 //....oooOO0OOooo........oooOO0OOooo........oo 78 79 G4double G4hIonisation::MinPrimaryEnergy(const 80 const G4Material*, 81 G4double cut) 82 { 83 G4double x = 0.5*cut/electron_mass_c2; 84 G4double gam = x*ratio + std::sqrt((1. + x)* 85 return mass*(gam - 1.0); 86 } 87 88 //....oooOO0OOooo........oooOO0OOooo........oo 89 90 void G4hIonisation::InitialiseEnergyLossProces 91 const G4ParticleDefinition* part, 92 const G4ParticleDefinition* bpart) 93 { 94 if(!isInitialised) { 95 96 const G4ParticleDefinition* theBaseParticl 97 G4String pname = part->GetParticleName(); 98 G4double q = part->GetPDGCharge(); 99 100 //G4cout << " G4hIonisation::InitialiseEne 101 // << " " << bpart << G4endl; 102 103 // define base particle 104 if(part == bpart) { 105 theBaseParticle = nullptr; 106 } else if(nullptr != bpart) { 107 theBaseParticle = bpart; 108 109 } else if(pname == "proton" || pname == "a 110 pname == "pi+" || pname == "pi-" || 111 pname == "kaon+" || pname == "kaon-" | 112 pname == "GenericIon" || pname == "alp 113 // no base particles 114 theBaseParticle = nullptr; 115 116 } else { 117 // select base particle 118 if(part->GetPDGSpin() == 0.0) { 119 if(q > 0.0) { theBaseParticle = G4KaonPlus:: 120 else { theBaseParticle = G4KaonMinus::KaonMi 121 } else { 122 if(q > 0.0) { theBaseParticle = G4Proton::Pr 123 else { theBaseParticle = G4AntiProton::AntiP 124 } 125 } 126 SetBaseParticle(theBaseParticle); 127 128 // model limit defined for protons 129 mass = part->GetPDGMass(); 130 ratio = electron_mass_c2/mass; 131 eth = 2.0*MeV*mass/proton_mass_c2; 132 133 G4EmParameters* param = G4EmParameters::In 134 G4double emin = param->MinKinEnergy(); 135 G4double emax = param->MaxKinEnergy(); 136 137 // define model of energy loss fluctuation 138 if (nullptr == FluctModel()) { 139 G4bool ion = (pname == "GenericIon" || p 140 SetFluctModel(G4EmStandUtil::ModelOfFluc 141 } 142 143 if (nullptr == EmModel(0)) { 144 if(q > 0.0) { SetEmModel(new G4BraggMode 145 else { SetEmModel(new G4ICRU73QOM 146 } 147 // to compute ranges correctly we have to 148 // model even if activation limit is high 149 EmModel(0)->SetLowEnergyLimit(emin); 150 151 // high energy limit may be eth or DBL_MAX 152 G4double emax1 = (EmModel(0)->HighEnergyLi 153 EmModel(0)->SetHighEnergyLimit(emax1); 154 AddEmModel(1, EmModel(0), FluctModel()); 155 156 // second model is used if the first does 157 if(emax1 < emax) { 158 if (nullptr == EmModel(1)) { SetEmModel( 159 EmModel(1)->SetLowEnergyLimit(emax1); 160 161 // for extremely heavy particles upper l 162 // should be increased 163 emax = std::max(emax, eth*10); 164 EmModel(1)->SetHighEnergyLimit(emax); 165 AddEmModel(2, EmModel(1), FluctModel()); 166 } 167 isInitialised = true; 168 } 169 } 170 171 //....oooOO0OOooo........oooOO0OOooo........oo 172 173 void G4hIonisation::ProcessDescription(std::os 174 { 175 out << " Hadron ionisation"; 176 G4VEnergyLossProcess::ProcessDescription(out 177 } 178 179 //....oooOO0OOooo........oooOO0OOooo........oo 180