Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4EmDNAPhysicsActivator.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// Author V.Ivanchenko
27//
28
30
31#include "G4EmParameters.hh"
33#include "G4ParticleTable.hh"
34#include "G4Region.hh"
36
37#include "G4Gamma.hh"
38#include "G4Electron.hh"
39#include "G4Positron.hh"
40#include "G4Proton.hh"
41#include "G4GenericIon.hh"
42#include "G4Alpha.hh"
43
44#include "G4ProcessManager.hh"
45#include "G4DummyModel.hh"
46#include "G4EmProcessSubType.hh"
48
49#include "G4BraggModel.hh"
50#include "G4BraggIonModel.hh"
51#include "G4BetheBlochModel.hh"
52#include "G4UrbanMscModel.hh"
56#include "G4IonFluctuations.hh"
58#include "G4IonFluctuations.hh"
59#include "G4LowECapture.hh"
64#include "G4eIonisation.hh"
65#include "G4eBremsstrahlung.hh"
66#include "G4hIonisation.hh"
67#include "G4ionIonisation.hh"
68#include "G4NuclearStopping.hh"
70#include "G4Generator2BS.hh"
71
72#include "G4Threading.hh"
73#include "G4EmDNABuilder.hh"
74#include "G4EmUtility.hh"
75#include "G4PhysListUtil.hh"
76#include "G4SystemOfUnits.hh"
77#include <vector>
78
79//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80
82 : G4VPhysicsConstructor("G4EmDNAPhysicsActivator"), verbose(ver)
83{
84 theParameters = G4EmParameters::Instance();
85 theParameters->ActivateDNA();
86 theParameters->SetFluo(true);
87}
88
89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90
91G4bool G4EmDNAPhysicsActivator::IsVerbose() const
92{
93 return (0 < verbose && G4Threading::IsMasterThread());
94}
95
96//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97
102
103//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104
106{
107 const std::vector<G4String>& regnamesDNA = theParameters->RegionsDNA();
108 std::size_t nreg = regnamesDNA.size();
109 if(0 == nreg)
110 {
111 return;
112 }
113
114 const std::vector<G4String>& typesDNA = theParameters->TypesDNA();
115 G4bool fast = theParameters->DNAFast();
116 G4bool st = theParameters->DNAStationary();
117
118 const G4double emaxDNA = 1.*CLHEP::MeV;
119 const G4double emaxIonDNA = 300.*CLHEP::MeV;
120 const G4double eminBorn = 500.*CLHEP::keV;
121 const G4double emax = theParameters->MaxKinEnergy();
122
123 if(IsVerbose()) {
124 G4cout << "### G4EmDNAPhysicsActivator::ConstructProcess for " << nreg
125 << " regions; DNA physics type " << G4endl;
126 }
127
128 // list of particles
131
132 G4DNAGenericIonsManager * genericIonsManager =
135 G4ParticleDefinition* alpha1 = genericIonsManager->GetIon("alpha+");
136 G4ParticleDefinition* alpha0 = genericIonsManager->GetIon("helium");
137 G4ParticleDefinition* h0 = genericIonsManager->GetIon("hydrogen");
138
139 // loop over regions
140 for(std::size_t i = 0; i < nreg; ++i)
141 {
142 if(IsVerbose())
143 {
144 G4cout << "### DNA models type " << typesDNA[i]
145 << " are activated for G4Region " << regnamesDNA[i] << G4endl;
146 }
147 const G4Region* reg = G4EmUtility::FindRegion(regnamesDNA[i], verbose);
148 if(nullptr == reg) { continue; }
149 G4int opt = 0;
150 if(typesDNA[i] == "DNA_Opt1") {
151 opt = 1;
152 } else if(typesDNA[i] == "DNA_Opt2") {
153 opt = 2;
154 } else if(typesDNA[i] == "DNA_Opt3") {
155 opt = 3;
156 } else if(typesDNA[i] == "DNA_Opt4") {
157 opt = 4;
158 } else if(typesDNA[i] == "DNA_Opt5") {
159 opt = 4;
160 } else if(typesDNA[i] == "DNA_Opt6") {
161 opt = 6;
162 } else if(typesDNA[i] == "DNA_Opt7") {
163 opt = 6;
164 } else if(typesDNA[i] == "DNA_Opt8") {
165 opt = 8;
166 }
167 DeactivateElectronProcesses(emaxDNA, emax, reg);
168 G4EmDNABuilder::ConstructDNAElectronPhysics(emaxDNA, opt, fast, st, reg);
169 DeactivateHadronProcesses(prot, emaxDNA, emax, reg);
170 G4EmDNABuilder::ConstructDNAProtonPhysics(eminBorn, emaxIonDNA, opt, fast, st, reg);
171 DeactivateIonProcesses(gion, emaxIonDNA, emax, reg);
173 DeactivateIonProcesses(alpha2, emaxIonDNA, emax, reg);
174 G4EmDNABuilder::ConstructDNALightIonPhysics(alpha2, 2, opt, emaxIonDNA, fast, st, reg);
175 DeactivateHadronProcesses(alpha1, emaxIonDNA, emax, reg);
176 G4EmDNABuilder::ConstructDNALightIonPhysics(alpha1, 1, opt, emaxIonDNA, fast, st, reg);
177 G4EmDNABuilder::ConstructDNALightIonPhysics(alpha0, 0, opt, emaxIonDNA, fast, st, reg);
178 G4EmDNABuilder::ConstructDNALightIonPhysics(h0, 0, opt, emaxIonDNA, fast, st, reg);
179 }
180}
181
182//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
183
184void G4EmDNAPhysicsActivator::DeactivateElectronProcesses(const G4double emaxDNA,
185 const G4double emax,
186 const G4Region* reg)
187{
188 if(emaxDNA >= emax) { return; }
189 const G4double msclimit = 100.*CLHEP::MeV;
192
193 G4VProcess* p;
194 if(emaxDNA < msclimit) {
196 G4VMultipleScattering* msc = dynamic_cast<G4VMultipleScattering*>(p);
197 G4double elim = std::min(msclimit, emax);
198 if(nullptr == msc) {
199 msc = new G4eMultipleScattering();
200 ph->RegisterProcess(msc, elec);
201 }
202 auto mod = new G4GoudsmitSaundersonMscModel();
203 mod->SetActivationLowEnergyLimit(emaxDNA);
204 mod->SetHighEnergyLimit(elim);
205 msc->AddEmModel(-2, mod, reg);
206 }
207
209 G4VEnergyLossProcess* ptr = dynamic_cast<G4VEnergyLossProcess*>(p);
210 G4VEmFluctuationModel* fluc = nullptr;
211 if(nullptr == ptr) {
212 ptr = new G4eIonisation();
213 ph->RegisterProcess(ptr, elec);
214 }
215 auto modi = new G4MollerBhabhaModel();
216 modi->SetActivationLowEnergyLimit(emaxDNA);
217 modi->SetHighEnergyLimit(emax);
218 fluc = new G4UniversalFluctuation();
219 ptr->AddEmModel(-2, modi, fluc, reg);
220
222 ptr = dynamic_cast<G4VEnergyLossProcess*>(p);
223 if(nullptr == ptr) {
224 ptr = new G4eBremsstrahlung();
225 ph->RegisterProcess(ptr, elec);
226 }
227 auto modb = new G4SeltzerBergerModel();
228 modb->SetAngularDistribution(new G4Generator2BS());
229 modb->SetActivationLowEnergyLimit(emaxDNA);
230 modb->SetHighEnergyLimit(emax);
231 fluc = nullptr;
232 ptr->AddEmModel(-2, modb, fluc, reg);
233}
234
235//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
236
237void
238G4EmDNAPhysicsActivator::DeactivateHadronProcesses(G4ParticleDefinition* part,
239 const G4double emaxDNA,
240 const G4double emax,
241 const G4Region* reg)
242{
243 if(emaxDNA >= emax) { return; }
246 G4VMultipleScattering* msc = dynamic_cast<G4VMultipleScattering*>(p);
247 if(nullptr == msc) {
248 msc = new G4hMultipleScattering();
249 ph->RegisterProcess(msc, part);
250 }
251 G4VMscModel* mod = new G4UrbanMscModel();
252 mod->SetActivationLowEnergyLimit(emaxDNA);
253 mod->SetHighEnergyLimit(emax);
254 msc->AddEmModel(-2, mod, reg);
255
256 const G4double braggmax = 2*CLHEP::MeV;
258 G4VEnergyLossProcess* ptr = dynamic_cast<G4VEnergyLossProcess*>(p);
260 G4VEmModel* br;
261 if(part == G4GenericIon::GenericIon() || part == G4Alpha::Alpha()) {
262 br = new G4BraggIonModel();
263 fluc = new G4IonFluctuations();
264 } else {
265 br = new G4BraggModel();
266 fluc = new G4UniversalFluctuation();
267 }
268 if(nullptr == ptr) {
269 if(part == G4GenericIon::GenericIon() || part == G4Alpha::Alpha()) {
270 ptr = new G4ionIonisation();
271 } else {
272 ptr = new G4hIonisation();
273 }
274 ptr->SetFluctModel(fluc);
275 ph->RegisterProcess(ptr, part);
276 }
277 br->SetActivationLowEnergyLimit(emaxDNA);
278 br->SetHighEnergyLimit(braggmax);
279 ptr->AddEmModel(-2, br, fluc, reg);
280
281 auto be = new G4BetheBlochModel();
282 be->SetLowEnergyLimit(braggmax);
283 be->SetActivationLowEnergyLimit(braggmax);
284 be->SetHighEnergyLimit(emax);
285 ptr->AddEmModel(-3, be, fluc, reg);
286
287 DeactivateNuclearStopping(part, emaxDNA, reg);
288}
289
290//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
291
292void
293G4EmDNAPhysicsActivator::DeactivateIonProcesses(G4ParticleDefinition* part,
294 const G4double emaxDNA,
295 const G4double emax,
296 const G4Region* reg)
297{
298 if(emaxDNA >= emax) { return; }
301 G4VMultipleScattering* msc = dynamic_cast<G4VMultipleScattering*>(p);
302 if(nullptr == msc) {
303 msc = new G4hMultipleScattering();
304 ph->RegisterProcess(msc, part);
305 }
306 auto mod = new G4UrbanMscModel();
307 mod->SetActivationLowEnergyLimit(emaxDNA);
308 mod->SetHighEnergyLimit(emax);
309 msc->AddEmModel(-2, mod, reg);
310
311 const G4double braggmax = 2*CLHEP::MeV;
313 G4VEnergyLossProcess* ptr = dynamic_cast<G4VEnergyLossProcess*>(p);
315 if(nullptr == ptr) {
316 ptr = new G4ionIonisation();
317 ptr->SetFluctModel(fluc);
318 ph->RegisterProcess(ptr, part);
319 }
320 auto br = new G4BraggIonModel();
321 br->SetActivationLowEnergyLimit(emaxDNA);
322 br->SetHighEnergyLimit(braggmax);
323 ptr->AddEmModel(-2, br, fluc, reg);
324
325 auto be = new G4BetheBlochModel();
326 be->SetLowEnergyLimit(braggmax);
327 be->SetActivationLowEnergyLimit(braggmax);
328 be->SetHighEnergyLimit(emax);
329 ptr->AddEmModel(-3, be, fluc, reg);
330
331 DeactivateNuclearStopping(part, emaxDNA, reg);
332}
333
334//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
335
336void
337G4EmDNAPhysicsActivator::DeactivateNuclearStopping(const G4ParticleDefinition* part,
338 const G4double emax,
339 const G4Region* reg)
340{
342 G4NuclearStopping* ptr = dynamic_cast<G4NuclearStopping*>(p);
343 if(nullptr != ptr) {
344 auto mod = new G4ICRU49NuclearStoppingModel();
346 ptr->AddEmModel(-2, mod, reg);
347 }
348}
349
350//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@ fBremsstrahlung
@ fIonisation
@ fNuclearStopping
@ fMultipleScattering
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
const G4double alpha2
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4Alpha * Alpha()
Definition G4Alpha.cc:83
static G4DNAGenericIonsManager * Instance()
G4ParticleDefinition * GetIon(const G4String &name)
static G4Electron * Electron()
Definition G4Electron.cc:91
static void ConstructDNALightIonPhysics(G4ParticleDefinition *part, const G4int charge, const G4int opt, const G4double emax, const G4bool fast, const G4bool stationary, const G4Region *reg=nullptr)
static void ConstructDNAParticles()
static void ConstructDNAIonPhysics(const G4double emax, const G4bool stationary, const G4Region *reg=nullptr)
static void ConstructDNAProtonPhysics(const G4double e1DNA, const G4double emaxDNA, const G4int opt, const G4bool fast, const G4bool stationary, const G4Region *reg=nullptr)
static void ConstructDNAElectronPhysics(const G4double emaxDNA, const G4int opt, const G4bool fast, const G4bool stationary, const G4Region *reg=nullptr)
static G4EmParameters * Instance()
G4bool DNAFast() const
G4bool DNAStationary() const
void SetFluo(G4bool val)
const std::vector< G4String > & TypesDNA() const
const std::vector< G4String > & RegionsDNA() const
G4double MaxKinEnergy() const
static const G4Region * FindRegion(const G4String &regionName, const G4int verbose=0)
static G4GenericIon * GenericIon()
static G4VProcess * FindProcess(const G4ParticleDefinition *, G4int subtype)
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
static G4PhysicsListHelper * GetPhysicsListHelper()
static G4Proton * Proton()
Definition G4Proton.cc:90
void SetHighEnergyLimit(G4double)
void SetActivationLowEnergyLimit(G4double)
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=nullptr)
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=nullptr, const G4Region *region=nullptr)
void SetFluctModel(G4VEmFluctuationModel *)
void AddEmModel(G4int order, G4VMscModel *, const G4Region *region=nullptr)
G4bool IsMasterThread()