- Timestamp:
- Apr 6, 2009, 12:21:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/src/G4hIonisation.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4hIonisation.cc,v 1. 70 2008/01/14 11:59:45vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4hIonisation.cc,v 1.82 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 78 78 // positive from pi+ and p (VI) 79 79 // 14-01-07 use SetEmModel() and SetFluctModel() from G4VEnergyLossProcess (mma) 80 // 12-09-08 Removed CorrectionsAlongStep (VI) 80 81 // 81 82 // ------------------------------------------------------------------- … … 90 91 #include "G4BraggModel.hh" 91 92 #include "G4BetheBlochModel.hh" 93 #include "G4IonFluctuations.hh" 92 94 #include "G4UniversalFluctuation.hh" 93 95 #include "G4BohrFluctuations.hh" … … 95 97 #include "G4PionPlus.hh" 96 98 #include "G4PionMinus.hh" 97 #include "G4LossTableManager.hh" 99 #include "G4KaonPlus.hh" 100 #include "G4KaonMinus.hh" 98 101 99 102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 103 106 G4hIonisation::G4hIonisation(const G4String& name) 104 107 : G4VEnergyLossProcess(name), 105 theParticle(0),106 theBaseParticle(0),107 isInitialised(false) 108 { 109 SetStepFunction(0.2, 1*mm);110 SetIntegral(true);111 Set VerboseLevel(1);108 isInitialised(false), 109 nuclearStopping(true) 110 { 111 // SetStepFunction(0.2, 1.0*mm); 112 //SetIntegral(true); 113 //SetVerboseLevel(1); 114 SetProcessSubType(fIonisation); 112 115 mass = 0.0; 113 116 ratio = 0.0; 114 corr = G4LossTableManager::Instance()->EmCorrections();115 nuclearStopping = true;116 117 } 117 118 … … 120 121 G4hIonisation::~G4hIonisation() 121 122 {} 123 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 126 G4bool G4hIonisation::IsApplicable(const G4ParticleDefinition& p) 127 { 128 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV && 129 !p.IsShortLived()); 130 } 131 132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 133 134 G4double G4hIonisation::MinPrimaryEnergy(const G4ParticleDefinition*, 135 const G4Material*, 136 G4double cut) 137 { 138 G4double x = 0.5*cut/electron_mass_c2; 139 G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio)); 140 return mass*(g - 1.0); 141 } 122 142 123 143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 127 147 const G4ParticleDefinition* bpart) 128 148 { 129 if(isInitialised) return; 130 131 theParticle = part; 132 133 G4String pname = part->GetParticleName(); 134 135 // standard base particles 136 if(part == bpart || pname == "proton" || 137 pname == "anti_proton" || pname == "pi+" || pname == "pi-" ) 138 theBaseParticle = 0; 139 140 // select base particle 141 else if(bpart == 0) { 142 143 if(pname == "kaon+") theBaseParticle = G4PionPlus::PionPlus(); 144 else if(pname == "kaon-") theBaseParticle = G4PionMinus::PionMinus(); 145 else if(part->GetPDGCharge() > 0.0) theBaseParticle = G4Proton::Proton(); 146 else theBaseParticle = G4AntiProton::AntiProton(); 147 148 } else theBaseParticle = bpart; 149 150 SetBaseParticle(theBaseParticle); 151 SetSecondaryParticle(G4Electron::Electron()); 152 mass = theParticle->GetPDGMass(); 153 ratio = electron_mass_c2/mass; 154 massratio = 1.0; 155 if(theBaseParticle) massratio = theBaseParticle->GetPDGMass()/mass; 156 157 if (!EmModel(1)) SetEmModel(new G4BraggModel(),1); 158 EmModel(1)->SetLowEnergyLimit(100*eV); 159 eth = 2.0*MeV*mass/proton_mass_c2; 160 ethnuc = eth*50.0; 161 EmModel(1)->SetHighEnergyLimit(eth); 162 if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation()); 163 AddEmModel(1, EmModel(1), FluctModel()); 164 165 if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 166 EmModel(2)->SetLowEnergyLimit(eth); 167 EmModel(2)->SetHighEnergyLimit(100*TeV); 168 AddEmModel(2, EmModel(2), FluctModel()); 169 170 isInitialised = true; 149 if(!isInitialised) { 150 151 const G4ParticleDefinition* theBaseParticle = 0; 152 G4String pname = part->GetParticleName(); 153 154 // standard base particles 155 if(part == bpart || pname == "proton" || 156 pname == "anti_proton" || 157 pname == "pi+" || pname == "pi-" || 158 pname == "kaon+" || pname == "kaon-") 159 { 160 theBaseParticle = 0; 161 } 162 // select base particle 163 else if(bpart == 0) { 164 165 if(part->GetPDGSpin() == 0.0) 166 if(part->GetPDGCharge() > 0.0 ) { 167 theBaseParticle = G4KaonPlus::KaonPlus(); 168 } else { 169 theBaseParticle = G4KaonMinus::KaonMinus(); 170 } 171 else if(part->GetPDGCharge() > 0.0) { 172 theBaseParticle = G4Proton::Proton(); 173 } else { 174 theBaseParticle = G4AntiProton::AntiProton(); 175 } 176 // base particle defined by interface 177 } else { 178 theBaseParticle = bpart; 179 } 180 SetBaseParticle(theBaseParticle); 181 SetSecondaryParticle(G4Electron::Electron()); 182 183 mass = part->GetPDGMass(); 184 ratio = electron_mass_c2/mass; 185 186 if(mass < 900.*MeV) nuclearStopping = false; 187 188 if (!EmModel(1)) SetEmModel(new G4BraggModel(),1); 189 EmModel(1)->SetLowEnergyLimit(MinKinEnergy()); 190 191 // model limit defined for protons 192 eth = (EmModel(1)->HighEnergyLimit())*mass/proton_mass_c2; 193 EmModel(1)->SetHighEnergyLimit(eth); 194 AddEmModel(1, EmModel(1), new G4IonFluctuations()); 195 196 if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation()); 197 198 if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 199 EmModel(2)->SetLowEnergyLimit(eth); 200 EmModel(2)->SetHighEnergyLimit(MaxKinEnergy()); 201 AddEmModel(2, EmModel(2), FluctModel()); 202 203 isInitialised = true; 204 } 205 EmModel(1)->ActivateNuclearStopping(nuclearStopping); 206 EmModel(2)->ActivateNuclearStopping(nuclearStopping); 171 207 } 172 208 … … 175 211 void G4hIonisation::PrintInfo() 176 212 { 177 if(EmModel(1) && EmModel(2)) 178 G4cout << " Scaling relation is used from proton dE/dx and range." 179 << "\n Delta cross sections and sampling from " 180 << EmModel(2)->GetName() << " model for scaled energy > " 181 << eth/MeV << " MeV" 182 << "\n Parametrisation from " 183 << EmModel(1)->GetName() << " for protons below." 184 << " NuclearStopping= " << nuclearStopping 213 if(EmModel(1) && EmModel(2)) { 214 G4cout << " NuclearStopping= " << nuclearStopping 185 215 << G4endl; 186 }187 188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....189 190 void G4hIonisation::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,191 const G4DynamicParticle* dp,192 G4double& eloss,193 G4double& s)194 {195 G4double ekin = dp->GetKineticEnergy();196 if(nuclearStopping && ekin < ethnuc) {197 G4double nloss = s*corr->NuclearDEDX(theParticle,couple->GetMaterial(),198 ekin - eloss*0.5);199 eloss += nloss;200 // G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy201 // << " de= " << eloss << " NIEL= " << nloss << G4endl;202 fParticleChange.ProposeNonIonizingEnergyDeposit(nloss);203 216 } 204 217 }
Note: See TracChangeset
for help on using the changeset viewer.