]>
Commit | Line | Data |
---|---|---|
2817d3e2 | 1 | // $Id$ |
2 | // Category: physics | |
3 | // | |
4 | // According to: | |
5 | // ExN04PhysicsList.cc,v 1.7 1999/12/15 14:49:26 gunter | |
6 | // GEANT4 tag Name: geant4-01-01 | |
7 | ||
8 | #include "TG4PhysicsList.h" | |
9 | #include "TG4PhysicsListMessenger.h" | |
10 | #include "TG4PhysicsManager.h" | |
2817d3e2 | 11 | #include "TG4FlagVector.h" |
12 | #include "TG4SpecialCuts.h" | |
13 | #include "TG4SpecialFlags.h" | |
14 | ||
15 | #include <G4ParticleDefinition.hh> | |
2817d3e2 | 16 | #include <G4ProcessManager.hh> |
17 | #include <G4ProcessVector.hh> | |
2817d3e2 | 18 | #include <G4BosonConstructor.hh> |
19 | #include <G4LeptonConstructor.hh> | |
20 | #include <G4MesonConstructor.hh> | |
21 | #include <G4BaryonConstructor.hh> | |
22 | #include <G4IonConstructor.hh> | |
23 | #include <G4ShortLivedConstructor.hh> | |
2817d3e2 | 24 | #include <G4ProcessTable.hh> |
2817d3e2 | 25 | |
26 | ||
27 | TG4PhysicsList::TG4PhysicsList() | |
28 | : G4VUserPhysicsList(), | |
29 | fSetOptical(false), | |
30 | fSetHadron(false), | |
31 | fSetSpecialCuts(false), | |
32 | fSetSpecialFlags(false) | |
33 | { | |
34 | // default cut value (1.0mm) | |
35 | defaultCutValue = 1.0*mm; | |
36 | ||
37 | // messenger | |
38 | fMessenger = new TG4PhysicsListMessenger(this); | |
39 | ||
40 | SetVerboseLevel(1); | |
41 | } | |
42 | ||
43 | TG4PhysicsList::TG4PhysicsList(const TG4PhysicsList& right) | |
44 | : G4VUserPhysicsList(right) | |
45 | { | |
46 | // messenger | |
47 | fMessenger = new TG4PhysicsListMessenger(this); | |
48 | ||
49 | fSetOptical = right.fSetOptical; | |
50 | fSetHadron = right.fSetHadron; | |
51 | fSetSpecialCuts = right.fSetSpecialCuts; | |
52 | fSetSpecialFlags = right.fSetSpecialFlags; | |
53 | } | |
54 | ||
55 | TG4PhysicsList::~TG4PhysicsList() { | |
56 | // | |
57 | } | |
58 | ||
59 | // operators | |
60 | ||
61 | TG4PhysicsList& TG4PhysicsList::operator=(const TG4PhysicsList& right) | |
62 | { | |
63 | // check assignement to self | |
64 | if (this == &right) return *this; | |
65 | ||
66 | // base class assignement | |
67 | G4VUserPhysicsList::operator=(right); | |
68 | ||
69 | fSetOptical = right.fSetOptical; | |
70 | fSetHadron = right.fSetHadron; | |
71 | fSetSpecialCuts = right.fSetSpecialCuts; | |
72 | fSetSpecialFlags = right.fSetSpecialFlags; | |
73 | ||
74 | return *this; | |
75 | } | |
76 | ||
77 | // public methods | |
78 | ||
79 | void TG4PhysicsList::ConstructParticle() | |
80 | { | |
81 | // In this method, static member functions should be called | |
82 | // for all particles which you want to use. | |
83 | // This ensures that objects of these particle types will be | |
84 | // created in the program. | |
85 | // --- | |
86 | ||
87 | // lock physics manager | |
88 | TG4PhysicsManager* physicsManager = TG4PhysicsManager::Instance(); | |
89 | physicsManager->Lock(); | |
90 | physicsManager->SetPhysicsList(this); | |
91 | ||
92 | // create all particles | |
93 | ConstructAllBosons(); | |
94 | ConstructAllLeptons(); | |
95 | ConstructAllMesons(); | |
96 | ConstructAllBaryons(); | |
97 | ConstructAllIons(); | |
98 | ConstructAllShortLiveds(); | |
99 | } | |
100 | ||
101 | void TG4PhysicsList::ConstructProcess() | |
102 | { | |
103 | // Constructs all processes. | |
104 | // --- | |
105 | ||
106 | AddTransportation(); | |
107 | ||
108 | ConstructEM(); | |
109 | if (fSetHadron) ConstructHad(); | |
110 | if (fSetOptical) ConstructOp(); | |
111 | if (fSetSpecialCuts) ConstructSpecialCuts(); | |
112 | if (fSetSpecialFlags) ConstructSpecialFlags(); | |
113 | ConstructGeneral(); | |
114 | if (verboseLevel>1) PrintAllProcesses(); | |
115 | // InActivateEM(); | |
116 | } | |
117 | ||
118 | void TG4PhysicsList::SetProcessActivation() | |
119 | { | |
120 | // (In)Activates built processes according | |
121 | // to the setup in TG4PhysicsManager::fFlagVector. | |
122 | // --- | |
123 | ||
3c7cd15a | 124 | G4cout << "TG4PhysicsList::SetProcessActivation() start" << G4endl; |
2817d3e2 | 125 | |
126 | TG4PhysicsManager* physicsManager = TG4PhysicsManager::Instance(); | |
127 | TG4FlagVector* flagVector = physicsManager->GetFlagVector(); | |
128 | ||
129 | // uncomment following lines to print | |
130 | // the flagVector values | |
131 | //for (G4int i=0; i<kNoG3Flags; i++) | |
3c7cd15a | 132 | //{ cout << i << " flag: " << (*flagVector)[i] << G4endl; } |
2817d3e2 | 133 | |
134 | if (flagVector) { | |
135 | theParticleIterator->reset(); | |
136 | while ((*theParticleIterator)()) | |
137 | { | |
138 | G4ParticleDefinition* particle = theParticleIterator->value(); | |
139 | G4ProcessManager* processManager = particle->GetProcessManager(); | |
140 | G4ProcessVector* processVector = processManager->GetProcessList(); | |
141 | ||
142 | // set processes flags | |
143 | for (G4int i=0; i<processManager->GetProcessListLength(); i++) { | |
144 | G4int flag = flagVector->GetFlag((*processVector)[i]); | |
145 | if ((flag == kInActivate) && | |
146 | (processManager->GetProcessActivation(i))) { | |
147 | if (verboseLevel>1) { | |
148 | G4cout << "Set process inactivation for " | |
3c7cd15a | 149 | << (*processVector)[i]->GetProcessName() << G4endl; |
2817d3e2 | 150 | } |
151 | processManager->SetProcessActivation(i,false); | |
152 | } | |
153 | else if (((flag == kActivate) || (flag == kActivate2)) && | |
154 | (!processManager->GetProcessActivation(i))) { | |
155 | if (verboseLevel>1) { | |
156 | G4cout << "Set process activation for " | |
3c7cd15a | 157 | << (*processVector)[i]->GetProcessName() << G4endl; |
2817d3e2 | 158 | } |
159 | processManager->SetProcessActivation(i,true); | |
160 | } | |
161 | } | |
162 | } | |
163 | } | |
164 | else { | |
165 | G4String text = "TG4PhysicsList::SetProcessActivation: \n"; | |
166 | text = text + " Vector of processes flags is not set."; | |
167 | TG4Globals::Warning(text); | |
168 | } | |
3c7cd15a | 169 | G4cout << "TG4PhysicsList::SetProcessActivation() end" << G4endl; |
2817d3e2 | 170 | } |
171 | ||
172 | void TG4PhysicsList::PrintAllProcesses() const | |
173 | { | |
174 | // Prints all processes. | |
175 | // --- | |
176 | ||
3c7cd15a | 177 | G4cout << "TG4PhysicsList processes: " << G4endl; |
178 | G4cout << "========================= " << G4endl; | |
2817d3e2 | 179 | |
180 | G4ProcessTable* processTable = G4ProcessTable::GetProcessTable(); | |
055b749a | 181 | G4ProcessTable::G4ProcNameVector* processNameList |
182 | = processTable->GetNameList(); | |
2817d3e2 | 183 | |
055b749a | 184 | for (G4int i=0; i <processNameList->size(); i++){ |
3c7cd15a | 185 | G4cout << " " << (*processNameList)[i] << G4endl; |
2817d3e2 | 186 | } |
187 | } | |
188 | ||
189 | // protected methods | |
190 | ||
191 | #include <G4ComptonScattering.hh> | |
192 | #include <G4GammaConversion.hh> | |
193 | #include <G4PhotoElectricEffect.hh> | |
194 | ||
195 | #include <G4MultipleScattering.hh> | |
196 | ||
197 | #include <G4eIonisation.hh> | |
198 | #include <G4eBremsstrahlung.hh> | |
199 | #include <G4eplusAnnihilation.hh> | |
200 | ||
201 | #include <G4MuIonisation.hh> | |
202 | #include <G4MuBremsstrahlung.hh> | |
203 | #include <G4MuPairProduction.hh> | |
204 | ||
205 | #include <G4hIonisation.hh> | |
2817d3e2 | 206 | |
207 | void TG4PhysicsList::ConstructEM() | |
208 | { | |
209 | // Constructs electromagnetic processes. | |
210 | // --- | |
211 | ||
212 | theParticleIterator->reset(); | |
213 | while( (*theParticleIterator)() ){ | |
214 | G4ParticleDefinition* particle = theParticleIterator->value(); | |
215 | G4ProcessManager* pmanager = particle->GetProcessManager(); | |
216 | G4String particleName = particle->GetParticleName(); | |
217 | ||
218 | if (particleName == "gamma") { | |
219 | // gamma | |
220 | // Construct processes for gamma | |
221 | pmanager->AddDiscreteProcess(new G4GammaConversion()); | |
222 | pmanager->AddDiscreteProcess(new G4ComptonScattering()); | |
223 | pmanager->AddDiscreteProcess(new G4PhotoElectricEffect()); | |
224 | ||
225 | } else if (particleName == "e-") { | |
226 | //electron | |
227 | // Construct processes for electron | |
228 | G4VProcess* theeminusMultipleScattering = new G4MultipleScattering(); | |
229 | G4VProcess* theeminusIonisation = new G4eIonisation(); | |
230 | G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung(); | |
231 | // add processes | |
232 | pmanager->AddProcess(theeminusMultipleScattering); | |
233 | pmanager->AddProcess(theeminusIonisation); | |
234 | pmanager->AddProcess(theeminusBremsstrahlung); | |
235 | // set ordering for AlongStepDoIt | |
236 | pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep, 1); | |
237 | pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep, 2); | |
238 | // set ordering for PostStepDoIt | |
239 | pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep, 1); | |
240 | pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep, 2); | |
241 | pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep, 3); | |
242 | ||
243 | } else if (particleName == "e+") { | |
244 | //positron | |
245 | // Construct processes for positron | |
246 | G4VProcess* theeplusMultipleScattering = new G4MultipleScattering(); | |
247 | G4VProcess* theeplusIonisation = new G4eIonisation(); | |
248 | G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung(); | |
249 | G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation(); | |
250 | // add processes | |
251 | pmanager->AddProcess(theeplusMultipleScattering); | |
252 | pmanager->AddProcess(theeplusIonisation); | |
253 | pmanager->AddProcess(theeplusBremsstrahlung); | |
254 | pmanager->AddProcess(theeplusAnnihilation); | |
255 | // set ordering for AtRestDoIt | |
256 | pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest); | |
257 | // set ordering for AlongStepDoIt | |
258 | pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep, 1); | |
259 | pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep, 2); | |
260 | // set ordering for PostStepDoIt | |
261 | pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep, 1); | |
262 | pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep, 2); | |
263 | pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep, 3); | |
264 | pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep, 4); | |
265 | ||
266 | } else if( particleName == "mu+" || | |
267 | particleName == "mu-" ) { | |
268 | //muon | |
269 | // Construct processes for muon+ | |
270 | G4VProcess* aMultipleScattering = new G4MultipleScattering(); | |
271 | G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung(); | |
272 | G4VProcess* aPairProduction = new G4MuPairProduction(); | |
273 | G4VProcess* anIonisation = new G4MuIonisation(); | |
274 | // add processes | |
275 | pmanager->AddProcess(anIonisation); | |
276 | pmanager->AddProcess(aMultipleScattering); | |
277 | pmanager->AddProcess(aBremsstrahlung); | |
278 | pmanager->AddProcess(aPairProduction); | |
279 | // set ordering for AlongStepDoIt | |
280 | pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1); | |
281 | pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2); | |
282 | // set ordering for PostStepDoIt | |
283 | pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1); | |
284 | pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2); | |
285 | pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep, 3); | |
286 | pmanager->SetProcessOrdering(aPairProduction, idxPostStep, 4); | |
287 | ||
288 | } else if( particleName == "GenericIon" ) { | |
3a240a0d | 289 | G4VProcess* aionIonization = new G4hIonisation; |
2817d3e2 | 290 | G4VProcess* aMultipleScattering = new G4MultipleScattering(); |
291 | pmanager->AddProcess(aionIonization); | |
292 | pmanager->AddProcess(aMultipleScattering); | |
293 | // set ordering for AlongStepDoIt | |
294 | pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1); | |
295 | pmanager->SetProcessOrdering(aionIonization, idxAlongStep, 2); | |
296 | // set ordering for PostStepDoIt | |
297 | pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1); | |
298 | pmanager->SetProcessOrdering(aionIonization, idxPostStep, 2); | |
299 | ||
300 | } else if ((!particle->IsShortLived()) && | |
301 | (particle->GetPDGCharge() != 0.0) && | |
302 | (particle->GetParticleName() != "chargedgeantino")) { | |
303 | // all others charged particles except geantino | |
304 | G4VProcess* aMultipleScattering = new G4MultipleScattering(); | |
305 | G4VProcess* anIonisation = new G4hIonisation(); | |
306 | // add processes | |
307 | pmanager->AddProcess(anIonisation); | |
308 | pmanager->AddProcess(aMultipleScattering); | |
309 | // set ordering for AlongStepDoIt | |
310 | pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1); | |
311 | pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2); | |
312 | // set ordering for PostStepDoIt | |
313 | pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1); | |
314 | pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2); | |
315 | } | |
316 | } | |
317 | } | |
318 | ||
319 | ||
320 | // Hadron Processes | |
321 | ||
322 | #include <G4HadronElasticProcess.hh> | |
323 | ||
324 | #include <G4PionPlusInelasticProcess.hh> | |
325 | #include <G4PionMinusInelasticProcess.hh> | |
326 | #include <G4KaonPlusInelasticProcess.hh> | |
327 | #include <G4KaonZeroSInelasticProcess.hh> | |
328 | #include <G4KaonZeroLInelasticProcess.hh> | |
329 | #include <G4KaonMinusInelasticProcess.hh> | |
330 | #include <G4ProtonInelasticProcess.hh> | |
331 | #include <G4AntiProtonInelasticProcess.hh> | |
332 | #include <G4NeutronInelasticProcess.hh> | |
333 | #include <G4AntiNeutronInelasticProcess.hh> | |
334 | #include <G4LambdaInelasticProcess.hh> | |
335 | #include <G4AntiLambdaInelasticProcess.hh> | |
336 | #include <G4SigmaPlusInelasticProcess.hh> | |
337 | #include <G4SigmaMinusInelasticProcess.hh> | |
338 | #include <G4AntiSigmaPlusInelasticProcess.hh> | |
339 | #include <G4AntiSigmaMinusInelasticProcess.hh> | |
340 | #include <G4XiZeroInelasticProcess.hh> | |
341 | #include <G4XiMinusInelasticProcess.hh> | |
342 | #include <G4AntiXiZeroInelasticProcess.hh> | |
343 | #include <G4AntiXiMinusInelasticProcess.hh> | |
344 | #include <G4DeuteronInelasticProcess.hh> | |
345 | #include <G4TritonInelasticProcess.hh> | |
346 | #include <G4AlphaInelasticProcess.hh> | |
347 | #include <G4OmegaMinusInelasticProcess.hh> | |
348 | #include <G4AntiOmegaMinusInelasticProcess.hh> | |
349 | ||
350 | // Low-energy Models | |
351 | ||
352 | #include <G4LElastic.hh> | |
353 | ||
354 | #include <G4LEPionPlusInelastic.hh> | |
355 | #include <G4LEPionMinusInelastic.hh> | |
356 | #include <G4LEKaonPlusInelastic.hh> | |
357 | #include <G4LEKaonZeroSInelastic.hh> | |
358 | #include <G4LEKaonZeroLInelastic.hh> | |
359 | #include <G4LEKaonMinusInelastic.hh> | |
360 | #include <G4LEProtonInelastic.hh> | |
361 | #include <G4LEAntiProtonInelastic.hh> | |
362 | #include <G4LENeutronInelastic.hh> | |
363 | #include <G4LEAntiNeutronInelastic.hh> | |
364 | #include <G4LELambdaInelastic.hh> | |
365 | #include <G4LEAntiLambdaInelastic.hh> | |
366 | #include <G4LESigmaPlusInelastic.hh> | |
367 | #include <G4LESigmaMinusInelastic.hh> | |
368 | #include <G4LEAntiSigmaPlusInelastic.hh> | |
369 | #include <G4LEAntiSigmaMinusInelastic.hh> | |
370 | #include <G4LEXiZeroInelastic.hh> | |
371 | #include <G4LEXiMinusInelastic.hh> | |
372 | #include <G4LEAntiXiZeroInelastic.hh> | |
373 | #include <G4LEAntiXiMinusInelastic.hh> | |
374 | #include <G4LEDeuteronInelastic.hh> | |
375 | #include <G4LETritonInelastic.hh> | |
376 | #include <G4LEAlphaInelastic.hh> | |
377 | #include <G4LEOmegaMinusInelastic.hh> | |
378 | #include <G4LEAntiOmegaMinusInelastic.hh> | |
379 | ||
380 | // High-energy Models | |
381 | ||
382 | #include <G4HEPionPlusInelastic.hh> | |
383 | #include <G4HEPionMinusInelastic.hh> | |
384 | #include <G4HEKaonPlusInelastic.hh> | |
385 | #include <G4HEKaonZeroInelastic.hh> | |
386 | #include <G4HEKaonZeroInelastic.hh> | |
387 | #include <G4HEKaonMinusInelastic.hh> | |
388 | #include <G4HEProtonInelastic.hh> | |
389 | #include <G4HEAntiProtonInelastic.hh> | |
390 | #include <G4HENeutronInelastic.hh> | |
391 | #include <G4HEAntiNeutronInelastic.hh> | |
392 | #include <G4HELambdaInelastic.hh> | |
393 | #include <G4HEAntiLambdaInelastic.hh> | |
394 | #include <G4HESigmaPlusInelastic.hh> | |
395 | #include <G4HESigmaMinusInelastic.hh> | |
396 | #include <G4HEAntiSigmaPlusInelastic.hh> | |
397 | #include <G4HEAntiSigmaMinusInelastic.hh> | |
398 | #include <G4HEXiZeroInelastic.hh> | |
399 | #include <G4HEXiMinusInelastic.hh> | |
400 | #include <G4HEAntiXiZeroInelastic.hh> | |
401 | #include <G4HEAntiXiMinusInelastic.hh> | |
402 | #include <G4HEOmegaMinusInelastic.hh> | |
403 | #include <G4HEAntiOmegaMinusInelastic.hh> | |
404 | ||
405 | // Stopping processes | |
406 | ||
407 | #ifdef TRIUMF_STOP_PIMINUS | |
408 | #include <G4PionMinusAbsorptionAtRest.hh> | |
409 | #else | |
410 | #include <G4PiMinusAbsorptionAtRest.hh> | |
411 | #endif | |
412 | #ifdef TRIUMF_STOP_KMINUS | |
413 | #include <G4KaonMinusAbsorption.hh> | |
414 | #else | |
415 | #include <G4KaonMinusAbsorptionAtRest.hh> | |
416 | #endif | |
417 | ||
418 | void TG4PhysicsList::ConstructHad() | |
419 | { | |
420 | // | |
421 | // ConstructHad() | |
422 | // | |
423 | // Makes discrete physics processes for the hadrons, at present limited | |
424 | // to those particles with GHEISHA interactions (INTRC > 0). | |
425 | // The processes are: Elastic scattering and Inelastic scattering. | |
426 | // | |
427 | // F.W.Jones 09-JUL-1998 | |
428 | // --- | |
429 | ||
3c7cd15a | 430 | G4cout << "### TG4PhysicsList::ConstructHad()" << G4endl; |
2817d3e2 | 431 | |
432 | G4HadronElasticProcess* theElasticProcess = | |
433 | new G4HadronElasticProcess; | |
434 | G4LElastic* theElasticModel = new G4LElastic; | |
435 | theElasticProcess->RegisterMe(theElasticModel); | |
436 | ||
437 | theParticleIterator->reset(); | |
438 | while ((*theParticleIterator)()) { | |
439 | G4ParticleDefinition* particle = theParticleIterator->value(); | |
440 | G4ProcessManager* pmanager = particle->GetProcessManager(); | |
441 | G4String particleName = particle->GetParticleName(); | |
442 | ||
443 | if (particleName == "pi+") { | |
444 | pmanager->AddDiscreteProcess(theElasticProcess); | |
445 | G4PionPlusInelasticProcess* theInelasticProcess = | |
446 | new G4PionPlusInelasticProcess("inelastic"); | |
447 | G4LEPionPlusInelastic* theLEInelasticModel = | |
448 | new G4LEPionPlusInelastic; | |
449 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
450 | G4HEPionPlusInelastic* theHEInelasticModel = | |
451 | new G4HEPionPlusInelastic; | |
452 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
453 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
454 | } | |
455 | else if (particleName == "pi-") { | |
456 | pmanager->AddDiscreteProcess(theElasticProcess); | |
457 | G4PionMinusInelasticProcess* theInelasticProcess = | |
458 | new G4PionMinusInelasticProcess("inelastic"); | |
459 | G4LEPionMinusInelastic* theLEInelasticModel = | |
460 | new G4LEPionMinusInelastic; | |
461 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
462 | G4HEPionMinusInelastic* theHEInelasticModel = | |
463 | new G4HEPionMinusInelastic; | |
464 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
465 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
466 | #ifdef TRIUMF_STOP_PIMINUS | |
467 | pmanager->AddRestProcess(new G4PionMinusAbsorptionAtRest, ordDefault); | |
468 | #else | |
469 | G4String prcNam; | |
470 | pmanager->AddRestProcess( | |
471 | new G4PiMinusAbsorptionAtRest( | |
472 | prcNam="PiMinusAbsorptionAtRest"), ordDefault); | |
473 | #endif | |
474 | } | |
475 | else if (particleName == "kaon+") { | |
476 | pmanager->AddDiscreteProcess(theElasticProcess); | |
477 | G4KaonPlusInelasticProcess* theInelasticProcess = | |
478 | new G4KaonPlusInelasticProcess("inelastic"); | |
479 | G4LEKaonPlusInelastic* theLEInelasticModel = | |
480 | new G4LEKaonPlusInelastic; | |
481 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
482 | G4HEKaonPlusInelastic* theHEInelasticModel = | |
483 | new G4HEKaonPlusInelastic; | |
484 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
485 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
486 | } | |
487 | else if (particleName == "kaon0S") { | |
488 | pmanager->AddDiscreteProcess(theElasticProcess); | |
489 | G4KaonZeroSInelasticProcess* theInelasticProcess = | |
490 | new G4KaonZeroSInelasticProcess("inelastic"); | |
491 | G4LEKaonZeroSInelastic* theLEInelasticModel = | |
492 | new G4LEKaonZeroSInelastic; | |
493 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
494 | G4HEKaonZeroInelastic* theHEInelasticModel = | |
495 | new G4HEKaonZeroInelastic; | |
496 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
497 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
498 | } | |
499 | else if (particleName == "kaon0L") { | |
500 | pmanager->AddDiscreteProcess(theElasticProcess); | |
501 | G4KaonZeroLInelasticProcess* theInelasticProcess = | |
502 | new G4KaonZeroLInelasticProcess("inelastic"); | |
503 | G4LEKaonZeroLInelastic* theLEInelasticModel = | |
504 | new G4LEKaonZeroLInelastic; | |
505 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
506 | G4HEKaonZeroInelastic* theHEInelasticModel = | |
507 | new G4HEKaonZeroInelastic; | |
508 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
509 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
510 | } | |
511 | else if (particleName == "kaon-") { | |
512 | pmanager->AddDiscreteProcess(theElasticProcess); | |
513 | G4KaonMinusInelasticProcess* theInelasticProcess = | |
514 | new G4KaonMinusInelasticProcess("inelastic"); | |
515 | G4LEKaonMinusInelastic* theLEInelasticModel = | |
516 | new G4LEKaonMinusInelastic; | |
517 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
518 | G4HEKaonMinusInelastic* theHEInelasticModel = | |
519 | new G4HEKaonMinusInelastic; | |
520 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
521 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
522 | #ifdef TRIUMF_STOP_KMINUS | |
523 | pmanager->AddRestProcess(new G4KaonMinusAbsorption, ordDefault); | |
524 | #else | |
525 | pmanager->AddRestProcess(new G4KaonMinusAbsorptionAtRest, ordDefault); | |
526 | #endif | |
527 | } | |
528 | else if (particleName == "proton") { | |
529 | pmanager->AddDiscreteProcess(theElasticProcess); | |
530 | G4ProtonInelasticProcess* theInelasticProcess = | |
531 | new G4ProtonInelasticProcess("inelastic"); | |
532 | G4LEProtonInelastic* theLEInelasticModel = new G4LEProtonInelastic; | |
533 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
534 | G4HEProtonInelastic* theHEInelasticModel = new G4HEProtonInelastic; | |
535 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
536 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
537 | } | |
538 | else if (particleName == "anti_proton") { | |
539 | pmanager->AddDiscreteProcess(theElasticProcess); | |
540 | G4AntiProtonInelasticProcess* theInelasticProcess = | |
541 | new G4AntiProtonInelasticProcess("inelastic"); | |
542 | G4LEAntiProtonInelastic* theLEInelasticModel = | |
543 | new G4LEAntiProtonInelastic; | |
544 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
545 | G4HEAntiProtonInelastic* theHEInelasticModel = | |
546 | new G4HEAntiProtonInelastic; | |
547 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
548 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
549 | } | |
550 | else if (particleName == "neutron") { | |
551 | pmanager->AddDiscreteProcess(theElasticProcess); | |
552 | G4NeutronInelasticProcess* theInelasticProcess = | |
553 | new G4NeutronInelasticProcess("inelastic"); | |
554 | G4LENeutronInelastic* theLEInelasticModel = | |
555 | new G4LENeutronInelastic; | |
556 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
557 | G4HENeutronInelastic* theHEInelasticModel = | |
558 | new G4HENeutronInelastic; | |
559 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
560 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
561 | } | |
562 | else if (particleName == "anti_neutron") { | |
563 | pmanager->AddDiscreteProcess(theElasticProcess); | |
564 | G4AntiNeutronInelasticProcess* theInelasticProcess = | |
565 | new G4AntiNeutronInelasticProcess("inelastic"); | |
566 | G4LEAntiNeutronInelastic* theLEInelasticModel = | |
567 | new G4LEAntiNeutronInelastic; | |
568 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
569 | G4HEAntiNeutronInelastic* theHEInelasticModel = | |
570 | new G4HEAntiNeutronInelastic; | |
571 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
572 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
573 | } | |
574 | else if (particleName == "lambda") { | |
575 | pmanager->AddDiscreteProcess(theElasticProcess); | |
576 | G4LambdaInelasticProcess* theInelasticProcess = | |
577 | new G4LambdaInelasticProcess("inelastic"); | |
578 | G4LELambdaInelastic* theLEInelasticModel = new G4LELambdaInelastic; | |
579 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
580 | G4HELambdaInelastic* theHEInelasticModel = new G4HELambdaInelastic; | |
581 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
582 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
583 | } | |
584 | else if (particleName == "anti_lambda") { | |
585 | pmanager->AddDiscreteProcess(theElasticProcess); | |
586 | G4AntiLambdaInelasticProcess* theInelasticProcess = | |
587 | new G4AntiLambdaInelasticProcess("inelastic"); | |
588 | G4LEAntiLambdaInelastic* theLEInelasticModel = | |
589 | new G4LEAntiLambdaInelastic; | |
590 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
591 | G4HEAntiLambdaInelastic* theHEInelasticModel = | |
592 | new G4HEAntiLambdaInelastic; | |
593 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
594 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
595 | } | |
596 | else if (particleName == "sigma+") { | |
597 | pmanager->AddDiscreteProcess(theElasticProcess); | |
598 | G4SigmaPlusInelasticProcess* theInelasticProcess = | |
599 | new G4SigmaPlusInelasticProcess("inelastic"); | |
600 | G4LESigmaPlusInelastic* theLEInelasticModel = | |
601 | new G4LESigmaPlusInelastic; | |
602 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
603 | G4HESigmaPlusInelastic* theHEInelasticModel = | |
604 | new G4HESigmaPlusInelastic; | |
605 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
606 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
607 | } | |
608 | else if (particleName == "sigma-") { | |
609 | pmanager->AddDiscreteProcess(theElasticProcess); | |
610 | G4SigmaMinusInelasticProcess* theInelasticProcess = | |
611 | new G4SigmaMinusInelasticProcess("inelastic"); | |
612 | G4LESigmaMinusInelastic* theLEInelasticModel = | |
613 | new G4LESigmaMinusInelastic; | |
614 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
615 | G4HESigmaMinusInelastic* theHEInelasticModel = | |
616 | new G4HESigmaMinusInelastic; | |
617 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
618 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
619 | } | |
620 | else if (particleName == "anti_sigma+") { | |
621 | pmanager->AddDiscreteProcess(theElasticProcess); | |
622 | G4AntiSigmaPlusInelasticProcess* theInelasticProcess = | |
623 | new G4AntiSigmaPlusInelasticProcess("inelastic"); | |
624 | G4LEAntiSigmaPlusInelastic* theLEInelasticModel = | |
625 | new G4LEAntiSigmaPlusInelastic; | |
626 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
627 | G4HEAntiSigmaPlusInelastic* theHEInelasticModel = | |
628 | new G4HEAntiSigmaPlusInelastic; | |
629 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
630 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
631 | } | |
632 | else if (particleName == "anti_sigma-") { | |
633 | pmanager->AddDiscreteProcess(theElasticProcess); | |
634 | G4AntiSigmaMinusInelasticProcess* theInelasticProcess = | |
635 | new G4AntiSigmaMinusInelasticProcess("inelastic"); | |
636 | G4LEAntiSigmaMinusInelastic* theLEInelasticModel = | |
637 | new G4LEAntiSigmaMinusInelastic; | |
638 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
639 | G4HEAntiSigmaMinusInelastic* theHEInelasticModel = | |
640 | new G4HEAntiSigmaMinusInelastic; | |
641 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
642 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
643 | } | |
644 | else if (particleName == "xi0") { | |
645 | pmanager->AddDiscreteProcess(theElasticProcess); | |
646 | G4XiZeroInelasticProcess* theInelasticProcess = | |
647 | new G4XiZeroInelasticProcess("inelastic"); | |
648 | G4LEXiZeroInelastic* theLEInelasticModel = | |
649 | new G4LEXiZeroInelastic; | |
650 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
651 | G4HEXiZeroInelastic* theHEInelasticModel = | |
652 | new G4HEXiZeroInelastic; | |
653 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
654 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
655 | } | |
656 | else if (particleName == "xi-") { | |
657 | pmanager->AddDiscreteProcess(theElasticProcess); | |
658 | G4XiMinusInelasticProcess* theInelasticProcess = | |
659 | new G4XiMinusInelasticProcess("inelastic"); | |
660 | G4LEXiMinusInelastic* theLEInelasticModel = | |
661 | new G4LEXiMinusInelastic; | |
662 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
663 | G4HEXiMinusInelastic* theHEInelasticModel = | |
664 | new G4HEXiMinusInelastic; | |
665 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
666 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
667 | } | |
668 | else if (particleName == "anti_xi0") { | |
669 | pmanager->AddDiscreteProcess(theElasticProcess); | |
670 | G4AntiXiZeroInelasticProcess* theInelasticProcess = | |
671 | new G4AntiXiZeroInelasticProcess("inelastic"); | |
672 | G4LEAntiXiZeroInelastic* theLEInelasticModel = | |
673 | new G4LEAntiXiZeroInelastic; | |
674 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
675 | G4HEAntiXiZeroInelastic* theHEInelasticModel = | |
676 | new G4HEAntiXiZeroInelastic; | |
677 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
678 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
679 | } | |
680 | else if (particleName == "anti_xi-") { | |
681 | pmanager->AddDiscreteProcess(theElasticProcess); | |
682 | G4AntiXiMinusInelasticProcess* theInelasticProcess = | |
683 | new G4AntiXiMinusInelasticProcess("inelastic"); | |
684 | G4LEAntiXiMinusInelastic* theLEInelasticModel = | |
685 | new G4LEAntiXiMinusInelastic; | |
686 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
687 | G4HEAntiXiMinusInelastic* theHEInelasticModel = | |
688 | new G4HEAntiXiMinusInelastic; | |
689 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
690 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
691 | } | |
692 | else if (particleName == "deuteron") { | |
693 | pmanager->AddDiscreteProcess(theElasticProcess); | |
694 | G4DeuteronInelasticProcess* theInelasticProcess = | |
695 | new G4DeuteronInelasticProcess("inelastic"); | |
696 | G4LEDeuteronInelastic* theLEInelasticModel = | |
697 | new G4LEDeuteronInelastic; | |
698 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
699 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
700 | } | |
701 | else if (particleName == "triton") { | |
702 | pmanager->AddDiscreteProcess(theElasticProcess); | |
703 | G4TritonInelasticProcess* theInelasticProcess = | |
704 | new G4TritonInelasticProcess("inelastic"); | |
705 | G4LETritonInelastic* theLEInelasticModel = | |
706 | new G4LETritonInelastic; | |
707 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
708 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
709 | } | |
710 | else if (particleName == "alpha") { | |
711 | pmanager->AddDiscreteProcess(theElasticProcess); | |
712 | G4AlphaInelasticProcess* theInelasticProcess = | |
713 | new G4AlphaInelasticProcess("inelastic"); | |
714 | G4LEAlphaInelastic* theLEInelasticModel = | |
715 | new G4LEAlphaInelastic; | |
716 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
717 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
718 | } | |
719 | else if (particleName == "omega-") { | |
720 | pmanager->AddDiscreteProcess(theElasticProcess); | |
721 | G4OmegaMinusInelasticProcess* theInelasticProcess = | |
722 | new G4OmegaMinusInelasticProcess("inelastic"); | |
723 | G4LEOmegaMinusInelastic* theLEInelasticModel = | |
724 | new G4LEOmegaMinusInelastic; | |
725 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
726 | G4HEOmegaMinusInelastic* theHEInelasticModel = | |
727 | new G4HEOmegaMinusInelastic; | |
728 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
729 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
730 | } | |
731 | else if (particleName == "anti_omega-") { | |
732 | pmanager->AddDiscreteProcess(theElasticProcess); | |
733 | G4AntiOmegaMinusInelasticProcess* theInelasticProcess = | |
734 | new G4AntiOmegaMinusInelasticProcess("inelastic"); | |
735 | G4LEAntiOmegaMinusInelastic* theLEInelasticModel = | |
736 | new G4LEAntiOmegaMinusInelastic; | |
737 | theInelasticProcess->RegisterMe(theLEInelasticModel); | |
738 | G4HEAntiOmegaMinusInelastic* theHEInelasticModel = | |
739 | new G4HEAntiOmegaMinusInelastic; | |
740 | theInelasticProcess->RegisterMe(theHEInelasticModel); | |
741 | pmanager->AddDiscreteProcess(theInelasticProcess); | |
742 | } | |
743 | } | |
744 | ||
3c7cd15a | 745 | G4cout << "### TG4PhysicsList::ConstructHad() finished." << G4endl; |
2817d3e2 | 746 | |
747 | } | |
748 | ||
749 | ||
750 | #include <G4Cerenkov.hh> | |
751 | #include <G4OpAbsorption.hh> | |
752 | #include <G4OpRayleigh.hh> | |
753 | #include <G4OpBoundaryProcess.hh> | |
754 | ||
755 | void TG4PhysicsList::ConstructOp() | |
756 | { | |
757 | // Constructs optical processes. | |
758 | // According to ExN06PhysicsList.cc. | |
759 | // (geant4 1.1) | |
760 | // --- | |
761 | ||
762 | G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov"); | |
763 | G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption(); | |
764 | G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh(); | |
765 | G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess(); | |
766 | ||
767 | theCerenkovProcess->DumpPhysicsTable(); | |
768 | //theAbsorptionProcess->DumpPhysicsTable(); | |
769 | //theRayleighScatteringProcess->DumpPhysicsTable(); | |
770 | ||
771 | // add verbose | |
772 | //theCerenkovProcess->SetVerboseLevel(1); | |
773 | //theAbsorptionProcess->SetVerboseLevel(1); | |
774 | //theRayleighScatteringProcess->SetVerboseLevel(1); | |
775 | //theBoundaryProcess->SetVerboseLevel(1); | |
776 | ||
777 | G4int maxNumPhotons = 300; | |
778 | ||
779 | theCerenkovProcess->SetTrackSecondariesFirst(true); | |
780 | theCerenkovProcess->SetMaxNumPhotonsPerStep(maxNumPhotons); | |
781 | ||
782 | //G4OpticalSurfaceModel themodel = unified; | |
783 | // model from GEANT3 | |
784 | G4OpticalSurfaceModel themodel = glisur; | |
785 | theBoundaryProcess->SetModel(themodel); | |
786 | ||
787 | theParticleIterator->reset(); | |
788 | while( (*theParticleIterator)() ){ | |
789 | G4ParticleDefinition* particle = theParticleIterator->value(); | |
790 | G4ProcessManager* processManager = particle->GetProcessManager(); | |
791 | G4String particleName = particle->GetParticleName(); | |
792 | if (theCerenkovProcess->IsApplicable(*particle)) { | |
793 | processManager->AddContinuousProcess(theCerenkovProcess); | |
794 | } | |
795 | if (particleName == "opticalphoton") { | |
796 | G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl; | |
797 | processManager->AddDiscreteProcess(theAbsorptionProcess); | |
798 | processManager->AddDiscreteProcess(theRayleighScatteringProcess); | |
799 | processManager->AddDiscreteProcess(theBoundaryProcess); | |
800 | } | |
801 | } | |
802 | } | |
803 | ||
804 | #include <G4Decay.hh> | |
805 | ||
806 | void TG4PhysicsList::ConstructGeneral() | |
807 | { | |
808 | // Constructs general processes. | |
809 | // --- | |
810 | ||
811 | // Add Decay Process | |
812 | G4Decay* theDecayProcess = new G4Decay(); | |
813 | theParticleIterator->reset(); | |
814 | while( (*theParticleIterator)() ){ | |
815 | G4ParticleDefinition* particle = theParticleIterator->value(); | |
816 | G4ProcessManager* pmanager = particle->GetProcessManager(); | |
817 | if (theDecayProcess->IsApplicable(*particle)) { | |
818 | pmanager ->AddProcess(theDecayProcess); | |
819 | // set ordering for PostStepDoIt and AtRestDoIt | |
820 | pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep); | |
821 | pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest); | |
822 | } | |
823 | } | |
824 | } | |
825 | ||
826 | void TG4PhysicsList::ConstructSpecialCuts() | |
827 | { | |
828 | // Adds TG4SpecialCuts "process" that activates | |
829 | // the kinetic energy cuts defined in | |
830 | // the vector of cuts (PhysicsManager::fCutVector) or in TG4Limits. | |
831 | // --- | |
832 | ||
833 | TG4PhysicsManager* physicsManager | |
834 | = TG4PhysicsManager::Instance(); | |
835 | ||
836 | if (physicsManager->IsSpecialCuts()) | |
837 | { | |
838 | TG4CutVector* cutVector | |
839 | = physicsManager->GetCutVector(); | |
840 | TG4boolVector* isCutVector | |
841 | = physicsManager->GetIsCutVector(); | |
842 | ||
843 | theParticleIterator->reset(); | |
844 | while ((*theParticleIterator)()) | |
845 | { | |
846 | G4ParticleDefinition* particle = theParticleIterator->value(); | |
847 | TG3ParticleWSP particleWSP | |
848 | = physicsManager->GetG3ParticleWSP(particle); | |
849 | G4String name; | |
850 | physicsManager->GetG3ParticleWSPName(particleWSP, name); | |
851 | ||
852 | // uncomment this to see all particles "WSP" | |
853 | //G4cout << "Iterating particle: " | |
854 | // << particle->GetParticleName() << " " << particleWSP << " " | |
3c7cd15a | 855 | // << name << G4endl; |
2817d3e2 | 856 | |
857 | // special process is created in case | |
858 | // cutVector (vector of kinetic energy cuts) is set | |
859 | // or the special cut is set by TG4Limits | |
860 | if ((particleWSP !=kNofParticlesWSP) && | |
861 | ((*isCutVector)[particleWSP])) { | |
862 | // check if process already exists | |
863 | G4String processName = "specialCutFor" + name; | |
864 | G4VProcess* process = FindProcess(processName); | |
865 | if (!process) { | |
866 | process = new TG4SpecialCuts(particleWSP, cutVector, processName); | |
867 | } | |
868 | //particle->GetProcessManager()->AddProcess(process, 0, -1, 1); | |
869 | particle->GetProcessManager()->AddDiscreteProcess(process); | |
870 | } | |
871 | } | |
872 | ||
873 | if (verboseLevel>0) { | |
3c7cd15a | 874 | G4cout << "TG4PhysicsList::ConstructSpecialCuts: " << G4endl; |
2817d3e2 | 875 | if (cutVector) |
3c7cd15a | 876 | G4cout << " Global kinetic energy cuts are set." << G4endl; |
877 | G4cout << " Special cuts process is defined for: " << G4endl | |
2817d3e2 | 878 | << " "; |
879 | for (G4int i=0; i<kAny; i++) { | |
880 | G4String name; | |
881 | physicsManager->GetG3ParticleWSPName(i, name); | |
882 | if ((*isCutVector)[i]) G4cout << name << " "; | |
883 | } | |
3c7cd15a | 884 | G4cout << G4endl; |
2817d3e2 | 885 | } |
886 | } | |
887 | } | |
888 | ||
889 | void TG4PhysicsList::ConstructSpecialFlags() | |
890 | { | |
891 | // Adds TG4SpecialFlags "process" that activates | |
892 | // the control process flags defined in TG4Limits. | |
893 | // --- | |
894 | ||
895 | TG4PhysicsManager* physicsManager | |
896 | = TG4PhysicsManager::Instance(); | |
897 | ||
898 | if (physicsManager->IsSpecialFlags()) | |
899 | { | |
3c7cd15a | 900 | G4cout << "IsSpecialFlags started" << G4endl; |
2817d3e2 | 901 | TG4boolVector* isFlagVector |
902 | = physicsManager->GetIsFlagVector(); | |
903 | ||
904 | theParticleIterator->reset(); | |
905 | while ((*theParticleIterator)()) | |
906 | { | |
907 | G4ParticleDefinition* particle = theParticleIterator->value(); | |
908 | TG3ParticleWSP particleWSP | |
909 | = physicsManager->GetG3ParticleWSP(particle); | |
910 | //G4String name; | |
911 | //GetG3ParticleWSPName(particleWSP, name); | |
912 | ||
913 | // special process is set in case | |
914 | // the special flag is set by TG4Limits | |
915 | if ((particleWSP !=kNofParticlesWSP) && | |
916 | ((*isFlagVector)[particleWSP])) { | |
917 | // check if process already exists | |
918 | G4String processName = "specialFlag"; | |
919 | G4VProcess* process = FindProcess(processName); | |
920 | if (!process) { | |
921 | process = new TG4SpecialFlags(processName); | |
922 | } | |
923 | //particle->GetProcessManager()->AddProcess(process, 0, -1, 1); | |
924 | particle->GetProcessManager()->AddDiscreteProcess(process); | |
925 | } | |
926 | } | |
927 | ||
928 | if (verboseLevel>0) { | |
3c7cd15a | 929 | G4cout << "TG4PhysicsList::ConstructSpecialFlagss: " << G4endl; |
930 | G4cout << " Special flags process is defined for: " << G4endl | |
2817d3e2 | 931 | << " "; |
932 | for (G4int i=0; i<kNofParticlesWSP; i++) { | |
933 | G4String name; | |
934 | physicsManager->GetG3ParticleWSPName(i, name); | |
935 | if ((*isFlagVector)[i]) G4cout << name << " "; | |
936 | } | |
3c7cd15a | 937 | G4cout << G4endl; |
2817d3e2 | 938 | } |
939 | } | |
940 | } | |
941 | ||
942 | void TG4PhysicsList::SetCuts() | |
943 | { | |
6eb14eb0 | 944 | // Sets the default cut value for all particle types |
945 | // other then e-/e+. | |
946 | // The cut value for e-/e+ is high in oredr to supress | |
947 | // tracking of delta electrons. | |
2817d3e2 | 948 | // --- |
949 | ||
6eb14eb0 | 950 | // SetCutsWithDefault(); |
951 | // "G4VUserPhysicsList::SetCutsWithDefault" method sets | |
952 | // the default cut value for all particle types. | |
953 | ||
954 | // default cut value | |
955 | G4double cut = defaultCutValue; | |
956 | G4double ecut = 10.*m; | |
368e370d | 957 | //G4double ecut = cut; |
6eb14eb0 | 958 | |
959 | #ifdef G4VERBOSE | |
960 | if (verboseLevel >1){ | |
961 | G4cout << "G4VUserPhysicsList::SetCutsWithDefault:"; | |
962 | G4cout << "CutLength : " << cut/mm << " (mm)" << G4endl; | |
963 | } | |
964 | #endif | |
965 | ||
966 | // set cut values for gamma at first and for e- second and next for e+, | |
967 | // because some processes for e+/e- need cut values for gamma | |
968 | SetCutValue(cut, "gamma"); | |
969 | SetCutValue(ecut, "e-"); | |
970 | SetCutValue(ecut, "e+"); | |
971 | ||
972 | // set cut values for proton and anti_proton before all other hadrons | |
973 | // because some processes for hadrons need cut values for proton/anti_proton | |
974 | SetCutValue(cut, "proton"); | |
975 | SetCutValue(cut, "anti_proton"); | |
976 | ||
977 | SetCutValueForOthers(cut); | |
978 | ||
979 | if (verboseLevel>1) { | |
980 | DumpCutValuesTable(); | |
981 | } | |
2817d3e2 | 982 | } |
983 | ||
984 | void TG4PhysicsList::ConstructAllBosons() | |
985 | { | |
986 | // Construct all bosons | |
987 | // --- | |
988 | ||
989 | G4BosonConstructor pConstructor; | |
990 | pConstructor.ConstructParticle(); | |
991 | } | |
992 | ||
993 | void TG4PhysicsList::ConstructAllLeptons() | |
994 | { | |
995 | // Construct all leptons | |
996 | // --- | |
997 | ||
998 | G4LeptonConstructor pConstructor; | |
999 | pConstructor.ConstructParticle(); | |
1000 | } | |
1001 | ||
1002 | void TG4PhysicsList::ConstructAllMesons() | |
1003 | { | |
1004 | // Construct all mesons | |
1005 | // --- | |
1006 | ||
1007 | G4MesonConstructor pConstructor; | |
1008 | pConstructor.ConstructParticle(); | |
1009 | } | |
1010 | ||
1011 | void TG4PhysicsList::ConstructAllBaryons() | |
1012 | { | |
1013 | // Construct all barions | |
1014 | // --- | |
1015 | ||
1016 | G4BaryonConstructor pConstructor; | |
1017 | pConstructor.ConstructParticle(); | |
1018 | } | |
1019 | ||
1020 | void TG4PhysicsList::ConstructAllIons() | |
1021 | { | |
1022 | // Construct light ions | |
1023 | // --- | |
1024 | ||
1025 | G4IonConstructor pConstructor; | |
1026 | pConstructor.ConstructParticle(); | |
1027 | } | |
1028 | ||
1029 | void TG4PhysicsList::ConstructAllShortLiveds() | |
1030 | { | |
1031 | // Construct resonaces and quarks | |
1032 | // --- | |
1033 | ||
1034 | G4ShortLivedConstructor pConstructor; | |
1035 | pConstructor.ConstructParticle(); | |
1036 | } | |
1037 | ||
1038 | // private methods | |
1039 | ||
1040 | G4VProcess* TG4PhysicsList::FindProcess(G4String processName) const | |
1041 | { | |
1042 | // Finds G4VProcess with specified name. | |
1043 | // --- | |
1044 | ||
1045 | G4ProcessTable* processTable = G4ProcessTable::GetProcessTable(); | |
1046 | ||
1047 | G4ProcessVector* processVector | |
1048 | = processTable->FindProcesses(processName); | |
1049 | G4VProcess* firstFoundProcess = 0; | |
1050 | if (processVector->entries()>0) firstFoundProcess= (*processVector)[0]; | |
1051 | ||
1052 | processVector->clear(); | |
1053 | delete processVector; | |
1054 | ||
1055 | return firstFoundProcess; | |
1056 | } | |
1057 | ||
1058 | void TG4PhysicsList::InActivateProcess(G4String processName, | |
1059 | G4ParticleDefinition* particle) | |
1060 | { | |
1061 | // Activates the process specified by name for the specified | |
1062 | // particle. | |
1063 | // Only for tests - to be removed. | |
1064 | // --- | |
1065 | ||
1066 | G4ProcessManager* processManager = particle->GetProcessManager(); | |
1067 | G4ProcessVector* processVector = processManager->GetProcessList(); | |
1068 | for (G4int i=0; i<processVector->entries(); i++) { | |
1069 | if ((*processVector)[i]->GetProcessName() == processName) { | |
1070 | processManager->SetProcessActivation((*processVector)[i], false); | |
1071 | return; | |
1072 | } | |
1073 | } | |
1074 | ||
1075 | G4String text = "TG4PhysicsList::InActivateProcess: "; | |
1076 | text = text + processName + " is not set for "; | |
1077 | text = text + particle->GetParticleName(); | |
1078 | TG4Globals::Exception(text); | |
1079 | } | |
1080 | ||
1081 | void TG4PhysicsList::InActivateEM() | |
1082 | { | |
1083 | // Inactivates specified electromagnetic processes. | |
1084 | // Only for tests - to be removed. | |
1085 | // !! This method must be called after all Construct methods. | |
1086 | // Uncomment the selected line(s) to inactivate desired processes. | |
1087 | // --- | |
1088 | ||
1089 | theParticleIterator->reset(); | |
1090 | while ((*theParticleIterator)()) | |
1091 | { | |
1092 | G4ParticleDefinition* particle = theParticleIterator->value(); | |
1093 | G4String name = particle->GetParticleName(); | |
1094 | ||
1095 | if (name == "gamma") { | |
1096 | // gamma | |
1097 | //InActivateProcess("phot", particle); | |
1098 | //InActivateProcess("compt", particle); | |
1099 | //InActivateProcess("conv", particle); | |
1100 | } | |
1101 | else if (name == "e-") { | |
1102 | //electron | |
1103 | InActivateProcess("msc", particle); | |
3c7cd15a | 1104 | G4cout << "msc inactivated." << G4endl; |
2817d3e2 | 1105 | //InActivateProcess("eIoni", particle); |
3c7cd15a | 1106 | //G4cout << "eIoni inactivated." << G4endl; |
2817d3e2 | 1107 | InActivateProcess("eBrem", particle); |
3c7cd15a | 1108 | G4cout << "eBrem inactivated." << G4endl; |
2817d3e2 | 1109 | } |
1110 | else if (name == "e+") { | |
1111 | //positron | |
1112 | //InActivateProcess("msc", particle); | |
1113 | //InActivateProcess("eIoni", particle); | |
1114 | //InActivateProcess("eBrem", particle); | |
1115 | //InActivateProcess("annihil", particle); | |
1116 | } | |
1117 | else if (name == "mu+" || name == "mu-") { | |
1118 | //muon | |
1119 | //InActivateProcess("msc", particle); | |
1120 | //InActivateProcess("MuIoni", particle); | |
1121 | //InActivateProcess("MuBrem", particle); | |
1122 | //InActivateProcess("MuPairProd", particle); | |
1123 | } | |
1124 | else if ((!particle->IsShortLived()) && | |
1125 | (particle->GetPDGCharge() != 0.0) && | |
1126 | (particle->GetParticleName() != "chargedgeantino")) | |
1127 | { | |
1128 | // all others charged particles except geantino | |
1129 | //InActivateProcess("msc", particle); | |
1130 | //InActivateProcess("hIoni", particle); | |
1131 | } | |
1132 | } | |
1133 | } | |
1134 |