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 // >> 23 // $Id: G4hIonisation.cc,v 1.50 2003/11/12 16:23:42 vnivanch Exp $ >> 24 // GEANT4 tag $Name: geant4-06-00-patch-01 $ >> 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 // Modifications: >> 38 // >> 39 // corrected by L.Urban on 24/09/97 >> 40 // several bugs corrected by L.Urban on 13/01/98 >> 41 // 07-04-98 remove 'tracking cut' of the ionizing particle, mma >> 42 // 22-10-98 cleanup L.Urban >> 43 // 02-02-99 bugs fixed , L.Urban >> 44 // 29-07-99 correction in BuildLossTable for low energy, L.Urban >> 45 // 10-02-00 modifications , new e.m. structure, L.Urban >> 46 // 10-08-00 V.Ivanchenko change BuildLambdaTable, in order to >> 47 // simulate energy losses of ions; correction to >> 48 // cross section for particles with spin 1 is inserted as well >> 49 // 28-05-01 V.Ivanchenko minor changes to provide ANSI -wall compilation >> 50 // 10-08-01 new methods Store/Retrieve PhysicsTable (mma) >> 51 // 14-08-01 new function ComputeRestrictedMeandEdx() + 'cleanup' (mma) >> 52 // 29-08-01 PostStepDoIt: correction for spin 1/2 (instead of 1) (mma) >> 53 // 17-09-01 migration of Materials to pure STL (mma) >> 54 // 25-09-01 completion of RetrievePhysicsTable() (mma) >> 55 // 29-10-01 all static functions no more inlined >> 56 // 08-11-01 Charge renamed zparticle; added to the dedx >> 57 // 27-03-02 Bug fix in scaling of lambda table (V.Ivanchenko) >> 58 // 09-04-02 Update calculation of tables for GenericIons (V.Ivanchenko) >> 59 // 30-04-02 V.Ivanchenko update to new design >> 60 // 04-12-02 Add verbose level definition (VI) >> 61 // 23-12-02 Change interface in order to move to cut per region (V.Ivanchenko) >> 62 // 26-12-02 Secondary production moved to derived classes (V.Ivanchenko) >> 63 // 13-02-03 SubCutoff regime is assigned to a region (V.Ivanchenko) >> 64 // 23-05-03 Define default integral + BohrFluctuations (V.Ivanchenko) >> 65 // 03-06-03 Fix initialisation problem for STD ionisation (V.Ivanchenko) >> 66 // 04-08-03 Set integral=false to be default (V.Ivanchenko) >> 67 // 08-08-03 STD substitute standard (V.Ivanchenko) >> 68 // 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko) 38 // 69 // 39 // ------------------------------------------- 70 // ------------------------------------------------------------------- 40 // 71 // 41 //....oooOO0OOooo........oooOO0OOooo........oo 72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 42 //....oooOO0OOooo........oooOO0OOooo........oo 73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 43 74 44 #include "G4hIonisation.hh" 75 #include "G4hIonisation.hh" 45 #include "G4PhysicalConstants.hh" << 46 #include "G4SystemOfUnits.hh" << 47 #include "G4Electron.hh" 76 #include "G4Electron.hh" 48 #include "G4Proton.hh" 77 #include "G4Proton.hh" 49 #include "G4AntiProton.hh" 78 #include "G4AntiProton.hh" 50 #include "G4BraggModel.hh" 79 #include "G4BraggModel.hh" 51 #include "G4BetheBlochModel.hh" 80 #include "G4BetheBlochModel.hh" 52 #include "G4EmStandUtil.hh" << 81 #include "G4UniversalFluctuation.hh" 53 #include "G4PionPlus.hh" << 82 #include "G4BohrFluctuations.hh" 54 #include "G4PionMinus.hh" << 83 #include "G4UnitsTable.hh" 55 #include "G4KaonPlus.hh" << 56 #include "G4KaonMinus.hh" << 57 #include "G4ICRU73QOModel.hh" << 58 #include "G4EmParameters.hh" << 59 84 60 //....oooOO0OOooo........oooOO0OOooo........oo 85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 61 86 62 G4hIonisation::G4hIonisation(const G4String& n 87 G4hIonisation::G4hIonisation(const G4String& name) 63 : G4VEnergyLossProcess(name) << 88 : G4VEnergyLossProcess(name), >> 89 theParticle(0), >> 90 theBaseParticle(0), >> 91 subCutoff(false), >> 92 isInitialised(false) 64 { 93 { 65 SetProcessSubType(fIonisation); << 94 SetDEDXBinning(120); 66 SetSecondaryParticle(G4Electron::Electron()) << 95 SetLambdaBinning(120); 67 eth = 2*CLHEP::MeV; << 96 SetMinKinEnergy(0.1*keV); >> 97 SetMaxKinEnergy(100.0*TeV); >> 98 SetVerboseLevel(0); >> 99 SetIntegral(false); >> 100 mass = 0.0; >> 101 ratio = 0.0; 68 } 102 } 69 103 70 //....oooOO0OOooo........oooOO0OOooo........oo 104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 71 105 72 G4bool G4hIonisation::IsApplicable(const G4Par << 106 G4hIonisation::~G4hIonisation() >> 107 {} >> 108 >> 109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 110 >> 111 void G4hIonisation::InitialiseProcess() 73 { 112 { 74 return true; << 113 if(isInitialised) return; >> 114 SetSecondaryParticle(G4Electron::Electron()); >> 115 mass = theParticle->GetPDGMass(); >> 116 ratio = electron_mass_c2/mass; >> 117 >> 118 G4double massFactor = mass/proton_mass_c2; >> 119 G4VEmModel* em = new G4BraggModel(); >> 120 em->SetLowEnergyLimit(0.1*keV); >> 121 em->SetHighEnergyLimit(2.0*MeV*massFactor); >> 122 >> 123 if(IsIntegral()) { >> 124 flucModel = new G4BohrFluctuations(); >> 125 } else { >> 126 flucModel = new G4UniversalFluctuation(); >> 127 } >> 128 >> 129 AddEmModel(1, em, flucModel); >> 130 G4VEmModel* em1 = new G4BetheBlochModel(); >> 131 em1->SetLowEnergyLimit(2.0*MeV*massFactor); >> 132 em1->SetHighEnergyLimit(100.0*TeV); >> 133 AddEmModel(2, em1, flucModel); >> 134 >> 135 isInitialised = true; 75 } 136 } 76 137 77 //....oooOO0OOooo........oooOO0OOooo........oo 138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 78 139 79 G4double G4hIonisation::MinPrimaryEnergy(const << 140 const G4ParticleDefinition* G4hIonisation::DefineBaseParticle( 80 const G4Material*, << 141 const G4ParticleDefinition* p) 81 G4double cut) << 82 { 142 { 83 G4double x = 0.5*cut/electron_mass_c2; << 143 if(!theParticle) theParticle = p; 84 G4double gam = x*ratio + std::sqrt((1. + x)* << 144 if(p != BaseParticle() && p != G4Proton::Proton()) theBaseParticle = G4Proton::Proton(); 85 return mass*(gam - 1.0); << 145 if(!isInitialised) InitialiseProcess(); >> 146 >> 147 return theBaseParticle; 86 } 148 } 87 149 88 //....oooOO0OOooo........oooOO0OOooo........oo << 150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 89 151 90 void G4hIonisation::InitialiseEnergyLossProces << 152 void G4hIonisation::PrintInfoDefinition() 91 const G4ParticleDefinition* part, << 92 const G4ParticleDefinition* bpart) << 93 { 153 { 94 if(!isInitialised) { << 154 G4VEnergyLossProcess::PrintInfoDefinition(); 95 155 96 const G4ParticleDefinition* theBaseParticl << 156 G4cout << " Bether-Bloch model for Escaled > 2 MeV, " 97 G4String pname = part->GetParticleName(); << 157 << "parametrisation of Bragg peak below, " 98 G4double q = part->GetPDGCharge(); << 158 << "Integral mode " << IsIntegral() 99 << 159 << G4endl; 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 } 160 } 170 161 171 //....oooOO0OOooo........oooOO0OOooo........oo 162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 172 163 173 void G4hIonisation::ProcessDescription(std::os << 164 void G4hIonisation::SetSubCutoff(G4bool val) 174 { 165 { 175 out << " Hadron ionisation"; << 166 subCutoff = val; 176 G4VEnergyLossProcess::ProcessDescription(out << 177 } 167 } 178 168 179 //....oooOO0OOooo........oooOO0OOooo........oo << 169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 180 170