5 // ExN04PhysicsList.cc,v 1.7 1999/12/15 14:49:26 gunter
6 // GEANT4 tag Name: geant4-01-01
8 #include "TG4PhysicsList.h"
9 #include "TG4PhysicsListMessenger.h"
10 #include "TG4PhysicsManager.h"
11 #include "TG4CutVector.h"
12 #include "TG4FlagVector.h"
13 #include "TG4SpecialCuts.h"
14 #include "TG4SpecialFlags.h"
16 #include <G4ParticleDefinition.hh>
17 #include <G4ParticleWithCuts.hh>
18 #include <G4ProcessManager.hh>
19 #include <G4ProcessVector.hh>
20 #include <G4ParticleTypes.hh>
21 #include <G4ParticleTable.hh>
22 #include <G4BosonConstructor.hh>
23 #include <G4LeptonConstructor.hh>
24 #include <G4MesonConstructor.hh>
25 #include <G4BaryonConstructor.hh>
26 #include <G4IonConstructor.hh>
27 #include <G4ShortLivedConstructor.hh>
28 #include <G4Material.hh>
29 #include <G4MaterialTable.hh>
30 #include <G4ProcessTable.hh>
33 #include <g4std/iomanip>
36 TG4PhysicsList::TG4PhysicsList()
37 : G4VUserPhysicsList(),
40 fSetSpecialCuts(false),
41 fSetSpecialFlags(false)
43 // default cut value (1.0mm)
44 defaultCutValue = 1.0*mm;
47 fMessenger = new TG4PhysicsListMessenger(this);
52 TG4PhysicsList::TG4PhysicsList(const TG4PhysicsList& right)
53 : G4VUserPhysicsList(right)
56 fMessenger = new TG4PhysicsListMessenger(this);
58 fSetOptical = right.fSetOptical;
59 fSetHadron = right.fSetHadron;
60 fSetSpecialCuts = right.fSetSpecialCuts;
61 fSetSpecialFlags = right.fSetSpecialFlags;
64 TG4PhysicsList::~TG4PhysicsList() {
70 TG4PhysicsList& TG4PhysicsList::operator=(const TG4PhysicsList& right)
72 // check assignement to self
73 if (this == &right) return *this;
75 // base class assignement
76 G4VUserPhysicsList::operator=(right);
78 fSetOptical = right.fSetOptical;
79 fSetHadron = right.fSetHadron;
80 fSetSpecialCuts = right.fSetSpecialCuts;
81 fSetSpecialFlags = right.fSetSpecialFlags;
88 void TG4PhysicsList::ConstructParticle()
90 // In this method, static member functions should be called
91 // for all particles which you want to use.
92 // This ensures that objects of these particle types will be
93 // created in the program.
96 // lock physics manager
97 TG4PhysicsManager* physicsManager = TG4PhysicsManager::Instance();
98 physicsManager->Lock();
99 physicsManager->SetPhysicsList(this);
101 // create all particles
102 ConstructAllBosons();
103 ConstructAllLeptons();
104 ConstructAllMesons();
105 ConstructAllBaryons();
107 ConstructAllShortLiveds();
110 void TG4PhysicsList::ConstructProcess()
112 // Constructs all processes.
118 if (fSetHadron) ConstructHad();
119 if (fSetOptical) ConstructOp();
120 if (fSetSpecialCuts) ConstructSpecialCuts();
121 if (fSetSpecialFlags) ConstructSpecialFlags();
123 if (verboseLevel>1) PrintAllProcesses();
127 void TG4PhysicsList::SetProcessActivation()
129 // (In)Activates built processes according
130 // to the setup in TG4PhysicsManager::fFlagVector.
133 G4cout << "TG4PhysicsList::SetProcessActivation() start" << endl;
135 TG4PhysicsManager* physicsManager = TG4PhysicsManager::Instance();
136 TG4FlagVector* flagVector = physicsManager->GetFlagVector();
138 // uncomment following lines to print
139 // the flagVector values
140 //for (G4int i=0; i<kNoG3Flags; i++)
141 //{ cout << i << " flag: " << (*flagVector)[i] << endl; }
144 theParticleIterator->reset();
145 while ((*theParticleIterator)())
147 G4ParticleDefinition* particle = theParticleIterator->value();
148 G4ProcessManager* processManager = particle->GetProcessManager();
149 G4ProcessVector* processVector = processManager->GetProcessList();
151 // set processes flags
152 for (G4int i=0; i<processManager->GetProcessListLength(); i++) {
153 G4int flag = flagVector->GetFlag((*processVector)[i]);
154 if ((flag == kInActivate) &&
155 (processManager->GetProcessActivation(i))) {
156 if (verboseLevel>1) {
157 G4cout << "Set process inactivation for "
158 << (*processVector)[i]->GetProcessName() << endl;
160 processManager->SetProcessActivation(i,false);
162 else if (((flag == kActivate) || (flag == kActivate2)) &&
163 (!processManager->GetProcessActivation(i))) {
164 if (verboseLevel>1) {
165 G4cout << "Set process activation for "
166 << (*processVector)[i]->GetProcessName() << endl;
168 processManager->SetProcessActivation(i,true);
174 G4String text = "TG4PhysicsList::SetProcessActivation: \n";
175 text = text + " Vector of processes flags is not set.";
176 TG4Globals::Warning(text);
178 G4cout << "TG4PhysicsList::SetProcessActivation() end" << endl;
181 void TG4PhysicsList::PrintAllProcesses() const
183 // Prints all processes.
186 G4cout << "TG4PhysicsList processes: " << endl;
187 G4cout << "========================= " << endl;
189 G4ProcessTable* processTable = G4ProcessTable::GetProcessTable();
190 TG4StringVector* processNameList = processTable->GetNameList();
192 for (G4int i=0; i <processNameList->entries(); i++){
193 G4cout << " " << (*processNameList)[i] << endl;
199 #include <G4ComptonScattering.hh>
200 #include <G4GammaConversion.hh>
201 #include <G4PhotoElectricEffect.hh>
203 #include <G4MultipleScattering.hh>
205 #include <G4eIonisation.hh>
206 #include <G4eBremsstrahlung.hh>
207 #include <G4eplusAnnihilation.hh>
209 #include <G4MuIonisation.hh>
210 #include <G4MuBremsstrahlung.hh>
211 #include <G4MuPairProduction.hh>
213 #include <G4hIonisation.hh>
214 #include <G4ionIonisation.hh>
216 void TG4PhysicsList::ConstructEM()
218 // Constructs electromagnetic processes.
221 theParticleIterator->reset();
222 while( (*theParticleIterator)() ){
223 G4ParticleDefinition* particle = theParticleIterator->value();
224 G4ProcessManager* pmanager = particle->GetProcessManager();
225 G4String particleName = particle->GetParticleName();
227 if (particleName == "gamma") {
229 // Construct processes for gamma
230 pmanager->AddDiscreteProcess(new G4GammaConversion());
231 pmanager->AddDiscreteProcess(new G4ComptonScattering());
232 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
234 } else if (particleName == "e-") {
236 // Construct processes for electron
237 G4VProcess* theeminusMultipleScattering = new G4MultipleScattering();
238 G4VProcess* theeminusIonisation = new G4eIonisation();
239 G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
241 pmanager->AddProcess(theeminusMultipleScattering);
242 pmanager->AddProcess(theeminusIonisation);
243 pmanager->AddProcess(theeminusBremsstrahlung);
244 // set ordering for AlongStepDoIt
245 pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep, 1);
246 pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep, 2);
247 // set ordering for PostStepDoIt
248 pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep, 1);
249 pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep, 2);
250 pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep, 3);
252 } else if (particleName == "e+") {
254 // Construct processes for positron
255 G4VProcess* theeplusMultipleScattering = new G4MultipleScattering();
256 G4VProcess* theeplusIonisation = new G4eIonisation();
257 G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
258 G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
260 pmanager->AddProcess(theeplusMultipleScattering);
261 pmanager->AddProcess(theeplusIonisation);
262 pmanager->AddProcess(theeplusBremsstrahlung);
263 pmanager->AddProcess(theeplusAnnihilation);
264 // set ordering for AtRestDoIt
265 pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
266 // set ordering for AlongStepDoIt
267 pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep, 1);
268 pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep, 2);
269 // set ordering for PostStepDoIt
270 pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep, 1);
271 pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep, 2);
272 pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep, 3);
273 pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep, 4);
275 } else if( particleName == "mu+" ||
276 particleName == "mu-" ) {
278 // Construct processes for muon+
279 G4VProcess* aMultipleScattering = new G4MultipleScattering();
280 G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
281 G4VProcess* aPairProduction = new G4MuPairProduction();
282 G4VProcess* anIonisation = new G4MuIonisation();
284 pmanager->AddProcess(anIonisation);
285 pmanager->AddProcess(aMultipleScattering);
286 pmanager->AddProcess(aBremsstrahlung);
287 pmanager->AddProcess(aPairProduction);
288 // set ordering for AlongStepDoIt
289 pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1);
290 pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2);
291 // set ordering for PostStepDoIt
292 pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
293 pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2);
294 pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep, 3);
295 pmanager->SetProcessOrdering(aPairProduction, idxPostStep, 4);
297 } else if( particleName == "GenericIon" ) {
298 G4VProcess* aionIonization = new G4ionIonisation;
299 G4VProcess* aMultipleScattering = new G4MultipleScattering();
300 pmanager->AddProcess(aionIonization);
301 pmanager->AddProcess(aMultipleScattering);
302 // set ordering for AlongStepDoIt
303 pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1);
304 pmanager->SetProcessOrdering(aionIonization, idxAlongStep, 2);
305 // set ordering for PostStepDoIt
306 pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
307 pmanager->SetProcessOrdering(aionIonization, idxPostStep, 2);
309 } else if ((!particle->IsShortLived()) &&
310 (particle->GetPDGCharge() != 0.0) &&
311 (particle->GetParticleName() != "chargedgeantino")) {
312 // all others charged particles except geantino
313 G4VProcess* aMultipleScattering = new G4MultipleScattering();
314 G4VProcess* anIonisation = new G4hIonisation();
316 pmanager->AddProcess(anIonisation);
317 pmanager->AddProcess(aMultipleScattering);
318 // set ordering for AlongStepDoIt
319 pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1);
320 pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2);
321 // set ordering for PostStepDoIt
322 pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
323 pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2);
331 #include <G4HadronElasticProcess.hh>
333 #include <G4PionPlusInelasticProcess.hh>
334 #include <G4PionMinusInelasticProcess.hh>
335 #include <G4KaonPlusInelasticProcess.hh>
336 #include <G4KaonZeroSInelasticProcess.hh>
337 #include <G4KaonZeroLInelasticProcess.hh>
338 #include <G4KaonMinusInelasticProcess.hh>
339 #include <G4ProtonInelasticProcess.hh>
340 #include <G4AntiProtonInelasticProcess.hh>
341 #include <G4NeutronInelasticProcess.hh>
342 #include <G4AntiNeutronInelasticProcess.hh>
343 #include <G4LambdaInelasticProcess.hh>
344 #include <G4AntiLambdaInelasticProcess.hh>
345 #include <G4SigmaPlusInelasticProcess.hh>
346 #include <G4SigmaMinusInelasticProcess.hh>
347 #include <G4AntiSigmaPlusInelasticProcess.hh>
348 #include <G4AntiSigmaMinusInelasticProcess.hh>
349 #include <G4XiZeroInelasticProcess.hh>
350 #include <G4XiMinusInelasticProcess.hh>
351 #include <G4AntiXiZeroInelasticProcess.hh>
352 #include <G4AntiXiMinusInelasticProcess.hh>
353 #include <G4DeuteronInelasticProcess.hh>
354 #include <G4TritonInelasticProcess.hh>
355 #include <G4AlphaInelasticProcess.hh>
356 #include <G4OmegaMinusInelasticProcess.hh>
357 #include <G4AntiOmegaMinusInelasticProcess.hh>
361 #include <G4LElastic.hh>
363 #include <G4LEPionPlusInelastic.hh>
364 #include <G4LEPionMinusInelastic.hh>
365 #include <G4LEKaonPlusInelastic.hh>
366 #include <G4LEKaonZeroSInelastic.hh>
367 #include <G4LEKaonZeroLInelastic.hh>
368 #include <G4LEKaonMinusInelastic.hh>
369 #include <G4LEProtonInelastic.hh>
370 #include <G4LEAntiProtonInelastic.hh>
371 #include <G4LENeutronInelastic.hh>
372 #include <G4LEAntiNeutronInelastic.hh>
373 #include <G4LELambdaInelastic.hh>
374 #include <G4LEAntiLambdaInelastic.hh>
375 #include <G4LESigmaPlusInelastic.hh>
376 #include <G4LESigmaMinusInelastic.hh>
377 #include <G4LEAntiSigmaPlusInelastic.hh>
378 #include <G4LEAntiSigmaMinusInelastic.hh>
379 #include <G4LEXiZeroInelastic.hh>
380 #include <G4LEXiMinusInelastic.hh>
381 #include <G4LEAntiXiZeroInelastic.hh>
382 #include <G4LEAntiXiMinusInelastic.hh>
383 #include <G4LEDeuteronInelastic.hh>
384 #include <G4LETritonInelastic.hh>
385 #include <G4LEAlphaInelastic.hh>
386 #include <G4LEOmegaMinusInelastic.hh>
387 #include <G4LEAntiOmegaMinusInelastic.hh>
389 // High-energy Models
391 #include <G4HEPionPlusInelastic.hh>
392 #include <G4HEPionMinusInelastic.hh>
393 #include <G4HEKaonPlusInelastic.hh>
394 #include <G4HEKaonZeroInelastic.hh>
395 #include <G4HEKaonZeroInelastic.hh>
396 #include <G4HEKaonMinusInelastic.hh>
397 #include <G4HEProtonInelastic.hh>
398 #include <G4HEAntiProtonInelastic.hh>
399 #include <G4HENeutronInelastic.hh>
400 #include <G4HEAntiNeutronInelastic.hh>
401 #include <G4HELambdaInelastic.hh>
402 #include <G4HEAntiLambdaInelastic.hh>
403 #include <G4HESigmaPlusInelastic.hh>
404 #include <G4HESigmaMinusInelastic.hh>
405 #include <G4HEAntiSigmaPlusInelastic.hh>
406 #include <G4HEAntiSigmaMinusInelastic.hh>
407 #include <G4HEXiZeroInelastic.hh>
408 #include <G4HEXiMinusInelastic.hh>
409 #include <G4HEAntiXiZeroInelastic.hh>
410 #include <G4HEAntiXiMinusInelastic.hh>
411 #include <G4HEOmegaMinusInelastic.hh>
412 #include <G4HEAntiOmegaMinusInelastic.hh>
414 // Stopping processes
416 #ifdef TRIUMF_STOP_PIMINUS
417 #include <G4PionMinusAbsorptionAtRest.hh>
419 #include <G4PiMinusAbsorptionAtRest.hh>
421 #ifdef TRIUMF_STOP_KMINUS
422 #include <G4KaonMinusAbsorption.hh>
424 #include <G4KaonMinusAbsorptionAtRest.hh>
427 void TG4PhysicsList::ConstructHad()
432 // Makes discrete physics processes for the hadrons, at present limited
433 // to those particles with GHEISHA interactions (INTRC > 0).
434 // The processes are: Elastic scattering and Inelastic scattering.
436 // F.W.Jones 09-JUL-1998
439 G4cout << "### TG4PhysicsList::ConstructHad()" << endl;
441 G4HadronElasticProcess* theElasticProcess =
442 new G4HadronElasticProcess;
443 G4LElastic* theElasticModel = new G4LElastic;
444 theElasticProcess->RegisterMe(theElasticModel);
446 theParticleIterator->reset();
447 while ((*theParticleIterator)()) {
448 G4ParticleDefinition* particle = theParticleIterator->value();
449 G4ProcessManager* pmanager = particle->GetProcessManager();
450 G4String particleName = particle->GetParticleName();
452 if (particleName == "pi+") {
453 pmanager->AddDiscreteProcess(theElasticProcess);
454 G4PionPlusInelasticProcess* theInelasticProcess =
455 new G4PionPlusInelasticProcess("inelastic");
456 G4LEPionPlusInelastic* theLEInelasticModel =
457 new G4LEPionPlusInelastic;
458 theInelasticProcess->RegisterMe(theLEInelasticModel);
459 G4HEPionPlusInelastic* theHEInelasticModel =
460 new G4HEPionPlusInelastic;
461 theInelasticProcess->RegisterMe(theHEInelasticModel);
462 pmanager->AddDiscreteProcess(theInelasticProcess);
464 else if (particleName == "pi-") {
465 pmanager->AddDiscreteProcess(theElasticProcess);
466 G4PionMinusInelasticProcess* theInelasticProcess =
467 new G4PionMinusInelasticProcess("inelastic");
468 G4LEPionMinusInelastic* theLEInelasticModel =
469 new G4LEPionMinusInelastic;
470 theInelasticProcess->RegisterMe(theLEInelasticModel);
471 G4HEPionMinusInelastic* theHEInelasticModel =
472 new G4HEPionMinusInelastic;
473 theInelasticProcess->RegisterMe(theHEInelasticModel);
474 pmanager->AddDiscreteProcess(theInelasticProcess);
475 #ifdef TRIUMF_STOP_PIMINUS
476 pmanager->AddRestProcess(new G4PionMinusAbsorptionAtRest, ordDefault);
479 pmanager->AddRestProcess(
480 new G4PiMinusAbsorptionAtRest(
481 prcNam="PiMinusAbsorptionAtRest"), ordDefault);
484 else if (particleName == "kaon+") {
485 pmanager->AddDiscreteProcess(theElasticProcess);
486 G4KaonPlusInelasticProcess* theInelasticProcess =
487 new G4KaonPlusInelasticProcess("inelastic");
488 G4LEKaonPlusInelastic* theLEInelasticModel =
489 new G4LEKaonPlusInelastic;
490 theInelasticProcess->RegisterMe(theLEInelasticModel);
491 G4HEKaonPlusInelastic* theHEInelasticModel =
492 new G4HEKaonPlusInelastic;
493 theInelasticProcess->RegisterMe(theHEInelasticModel);
494 pmanager->AddDiscreteProcess(theInelasticProcess);
496 else if (particleName == "kaon0S") {
497 pmanager->AddDiscreteProcess(theElasticProcess);
498 G4KaonZeroSInelasticProcess* theInelasticProcess =
499 new G4KaonZeroSInelasticProcess("inelastic");
500 G4LEKaonZeroSInelastic* theLEInelasticModel =
501 new G4LEKaonZeroSInelastic;
502 theInelasticProcess->RegisterMe(theLEInelasticModel);
503 G4HEKaonZeroInelastic* theHEInelasticModel =
504 new G4HEKaonZeroInelastic;
505 theInelasticProcess->RegisterMe(theHEInelasticModel);
506 pmanager->AddDiscreteProcess(theInelasticProcess);
508 else if (particleName == "kaon0L") {
509 pmanager->AddDiscreteProcess(theElasticProcess);
510 G4KaonZeroLInelasticProcess* theInelasticProcess =
511 new G4KaonZeroLInelasticProcess("inelastic");
512 G4LEKaonZeroLInelastic* theLEInelasticModel =
513 new G4LEKaonZeroLInelastic;
514 theInelasticProcess->RegisterMe(theLEInelasticModel);
515 G4HEKaonZeroInelastic* theHEInelasticModel =
516 new G4HEKaonZeroInelastic;
517 theInelasticProcess->RegisterMe(theHEInelasticModel);
518 pmanager->AddDiscreteProcess(theInelasticProcess);
520 else if (particleName == "kaon-") {
521 pmanager->AddDiscreteProcess(theElasticProcess);
522 G4KaonMinusInelasticProcess* theInelasticProcess =
523 new G4KaonMinusInelasticProcess("inelastic");
524 G4LEKaonMinusInelastic* theLEInelasticModel =
525 new G4LEKaonMinusInelastic;
526 theInelasticProcess->RegisterMe(theLEInelasticModel);
527 G4HEKaonMinusInelastic* theHEInelasticModel =
528 new G4HEKaonMinusInelastic;
529 theInelasticProcess->RegisterMe(theHEInelasticModel);
530 pmanager->AddDiscreteProcess(theInelasticProcess);
531 #ifdef TRIUMF_STOP_KMINUS
532 pmanager->AddRestProcess(new G4KaonMinusAbsorption, ordDefault);
534 pmanager->AddRestProcess(new G4KaonMinusAbsorptionAtRest, ordDefault);
537 else if (particleName == "proton") {
538 pmanager->AddDiscreteProcess(theElasticProcess);
539 G4ProtonInelasticProcess* theInelasticProcess =
540 new G4ProtonInelasticProcess("inelastic");
541 G4LEProtonInelastic* theLEInelasticModel = new G4LEProtonInelastic;
542 theInelasticProcess->RegisterMe(theLEInelasticModel);
543 G4HEProtonInelastic* theHEInelasticModel = new G4HEProtonInelastic;
544 theInelasticProcess->RegisterMe(theHEInelasticModel);
545 pmanager->AddDiscreteProcess(theInelasticProcess);
547 else if (particleName == "anti_proton") {
548 pmanager->AddDiscreteProcess(theElasticProcess);
549 G4AntiProtonInelasticProcess* theInelasticProcess =
550 new G4AntiProtonInelasticProcess("inelastic");
551 G4LEAntiProtonInelastic* theLEInelasticModel =
552 new G4LEAntiProtonInelastic;
553 theInelasticProcess->RegisterMe(theLEInelasticModel);
554 G4HEAntiProtonInelastic* theHEInelasticModel =
555 new G4HEAntiProtonInelastic;
556 theInelasticProcess->RegisterMe(theHEInelasticModel);
557 pmanager->AddDiscreteProcess(theInelasticProcess);
559 else if (particleName == "neutron") {
560 pmanager->AddDiscreteProcess(theElasticProcess);
561 G4NeutronInelasticProcess* theInelasticProcess =
562 new G4NeutronInelasticProcess("inelastic");
563 G4LENeutronInelastic* theLEInelasticModel =
564 new G4LENeutronInelastic;
565 theInelasticProcess->RegisterMe(theLEInelasticModel);
566 G4HENeutronInelastic* theHEInelasticModel =
567 new G4HENeutronInelastic;
568 theInelasticProcess->RegisterMe(theHEInelasticModel);
569 pmanager->AddDiscreteProcess(theInelasticProcess);
571 else if (particleName == "anti_neutron") {
572 pmanager->AddDiscreteProcess(theElasticProcess);
573 G4AntiNeutronInelasticProcess* theInelasticProcess =
574 new G4AntiNeutronInelasticProcess("inelastic");
575 G4LEAntiNeutronInelastic* theLEInelasticModel =
576 new G4LEAntiNeutronInelastic;
577 theInelasticProcess->RegisterMe(theLEInelasticModel);
578 G4HEAntiNeutronInelastic* theHEInelasticModel =
579 new G4HEAntiNeutronInelastic;
580 theInelasticProcess->RegisterMe(theHEInelasticModel);
581 pmanager->AddDiscreteProcess(theInelasticProcess);
583 else if (particleName == "lambda") {
584 pmanager->AddDiscreteProcess(theElasticProcess);
585 G4LambdaInelasticProcess* theInelasticProcess =
586 new G4LambdaInelasticProcess("inelastic");
587 G4LELambdaInelastic* theLEInelasticModel = new G4LELambdaInelastic;
588 theInelasticProcess->RegisterMe(theLEInelasticModel);
589 G4HELambdaInelastic* theHEInelasticModel = new G4HELambdaInelastic;
590 theInelasticProcess->RegisterMe(theHEInelasticModel);
591 pmanager->AddDiscreteProcess(theInelasticProcess);
593 else if (particleName == "anti_lambda") {
594 pmanager->AddDiscreteProcess(theElasticProcess);
595 G4AntiLambdaInelasticProcess* theInelasticProcess =
596 new G4AntiLambdaInelasticProcess("inelastic");
597 G4LEAntiLambdaInelastic* theLEInelasticModel =
598 new G4LEAntiLambdaInelastic;
599 theInelasticProcess->RegisterMe(theLEInelasticModel);
600 G4HEAntiLambdaInelastic* theHEInelasticModel =
601 new G4HEAntiLambdaInelastic;
602 theInelasticProcess->RegisterMe(theHEInelasticModel);
603 pmanager->AddDiscreteProcess(theInelasticProcess);
605 else if (particleName == "sigma+") {
606 pmanager->AddDiscreteProcess(theElasticProcess);
607 G4SigmaPlusInelasticProcess* theInelasticProcess =
608 new G4SigmaPlusInelasticProcess("inelastic");
609 G4LESigmaPlusInelastic* theLEInelasticModel =
610 new G4LESigmaPlusInelastic;
611 theInelasticProcess->RegisterMe(theLEInelasticModel);
612 G4HESigmaPlusInelastic* theHEInelasticModel =
613 new G4HESigmaPlusInelastic;
614 theInelasticProcess->RegisterMe(theHEInelasticModel);
615 pmanager->AddDiscreteProcess(theInelasticProcess);
617 else if (particleName == "sigma-") {
618 pmanager->AddDiscreteProcess(theElasticProcess);
619 G4SigmaMinusInelasticProcess* theInelasticProcess =
620 new G4SigmaMinusInelasticProcess("inelastic");
621 G4LESigmaMinusInelastic* theLEInelasticModel =
622 new G4LESigmaMinusInelastic;
623 theInelasticProcess->RegisterMe(theLEInelasticModel);
624 G4HESigmaMinusInelastic* theHEInelasticModel =
625 new G4HESigmaMinusInelastic;
626 theInelasticProcess->RegisterMe(theHEInelasticModel);
627 pmanager->AddDiscreteProcess(theInelasticProcess);
629 else if (particleName == "anti_sigma+") {
630 pmanager->AddDiscreteProcess(theElasticProcess);
631 G4AntiSigmaPlusInelasticProcess* theInelasticProcess =
632 new G4AntiSigmaPlusInelasticProcess("inelastic");
633 G4LEAntiSigmaPlusInelastic* theLEInelasticModel =
634 new G4LEAntiSigmaPlusInelastic;
635 theInelasticProcess->RegisterMe(theLEInelasticModel);
636 G4HEAntiSigmaPlusInelastic* theHEInelasticModel =
637 new G4HEAntiSigmaPlusInelastic;
638 theInelasticProcess->RegisterMe(theHEInelasticModel);
639 pmanager->AddDiscreteProcess(theInelasticProcess);
641 else if (particleName == "anti_sigma-") {
642 pmanager->AddDiscreteProcess(theElasticProcess);
643 G4AntiSigmaMinusInelasticProcess* theInelasticProcess =
644 new G4AntiSigmaMinusInelasticProcess("inelastic");
645 G4LEAntiSigmaMinusInelastic* theLEInelasticModel =
646 new G4LEAntiSigmaMinusInelastic;
647 theInelasticProcess->RegisterMe(theLEInelasticModel);
648 G4HEAntiSigmaMinusInelastic* theHEInelasticModel =
649 new G4HEAntiSigmaMinusInelastic;
650 theInelasticProcess->RegisterMe(theHEInelasticModel);
651 pmanager->AddDiscreteProcess(theInelasticProcess);
653 else if (particleName == "xi0") {
654 pmanager->AddDiscreteProcess(theElasticProcess);
655 G4XiZeroInelasticProcess* theInelasticProcess =
656 new G4XiZeroInelasticProcess("inelastic");
657 G4LEXiZeroInelastic* theLEInelasticModel =
658 new G4LEXiZeroInelastic;
659 theInelasticProcess->RegisterMe(theLEInelasticModel);
660 G4HEXiZeroInelastic* theHEInelasticModel =
661 new G4HEXiZeroInelastic;
662 theInelasticProcess->RegisterMe(theHEInelasticModel);
663 pmanager->AddDiscreteProcess(theInelasticProcess);
665 else if (particleName == "xi-") {
666 pmanager->AddDiscreteProcess(theElasticProcess);
667 G4XiMinusInelasticProcess* theInelasticProcess =
668 new G4XiMinusInelasticProcess("inelastic");
669 G4LEXiMinusInelastic* theLEInelasticModel =
670 new G4LEXiMinusInelastic;
671 theInelasticProcess->RegisterMe(theLEInelasticModel);
672 G4HEXiMinusInelastic* theHEInelasticModel =
673 new G4HEXiMinusInelastic;
674 theInelasticProcess->RegisterMe(theHEInelasticModel);
675 pmanager->AddDiscreteProcess(theInelasticProcess);
677 else if (particleName == "anti_xi0") {
678 pmanager->AddDiscreteProcess(theElasticProcess);
679 G4AntiXiZeroInelasticProcess* theInelasticProcess =
680 new G4AntiXiZeroInelasticProcess("inelastic");
681 G4LEAntiXiZeroInelastic* theLEInelasticModel =
682 new G4LEAntiXiZeroInelastic;
683 theInelasticProcess->RegisterMe(theLEInelasticModel);
684 G4HEAntiXiZeroInelastic* theHEInelasticModel =
685 new G4HEAntiXiZeroInelastic;
686 theInelasticProcess->RegisterMe(theHEInelasticModel);
687 pmanager->AddDiscreteProcess(theInelasticProcess);
689 else if (particleName == "anti_xi-") {
690 pmanager->AddDiscreteProcess(theElasticProcess);
691 G4AntiXiMinusInelasticProcess* theInelasticProcess =
692 new G4AntiXiMinusInelasticProcess("inelastic");
693 G4LEAntiXiMinusInelastic* theLEInelasticModel =
694 new G4LEAntiXiMinusInelastic;
695 theInelasticProcess->RegisterMe(theLEInelasticModel);
696 G4HEAntiXiMinusInelastic* theHEInelasticModel =
697 new G4HEAntiXiMinusInelastic;
698 theInelasticProcess->RegisterMe(theHEInelasticModel);
699 pmanager->AddDiscreteProcess(theInelasticProcess);
701 else if (particleName == "deuteron") {
702 pmanager->AddDiscreteProcess(theElasticProcess);
703 G4DeuteronInelasticProcess* theInelasticProcess =
704 new G4DeuteronInelasticProcess("inelastic");
705 G4LEDeuteronInelastic* theLEInelasticModel =
706 new G4LEDeuteronInelastic;
707 theInelasticProcess->RegisterMe(theLEInelasticModel);
708 pmanager->AddDiscreteProcess(theInelasticProcess);
710 else if (particleName == "triton") {
711 pmanager->AddDiscreteProcess(theElasticProcess);
712 G4TritonInelasticProcess* theInelasticProcess =
713 new G4TritonInelasticProcess("inelastic");
714 G4LETritonInelastic* theLEInelasticModel =
715 new G4LETritonInelastic;
716 theInelasticProcess->RegisterMe(theLEInelasticModel);
717 pmanager->AddDiscreteProcess(theInelasticProcess);
719 else if (particleName == "alpha") {
720 pmanager->AddDiscreteProcess(theElasticProcess);
721 G4AlphaInelasticProcess* theInelasticProcess =
722 new G4AlphaInelasticProcess("inelastic");
723 G4LEAlphaInelastic* theLEInelasticModel =
724 new G4LEAlphaInelastic;
725 theInelasticProcess->RegisterMe(theLEInelasticModel);
726 pmanager->AddDiscreteProcess(theInelasticProcess);
728 else if (particleName == "omega-") {
729 pmanager->AddDiscreteProcess(theElasticProcess);
730 G4OmegaMinusInelasticProcess* theInelasticProcess =
731 new G4OmegaMinusInelasticProcess("inelastic");
732 G4LEOmegaMinusInelastic* theLEInelasticModel =
733 new G4LEOmegaMinusInelastic;
734 theInelasticProcess->RegisterMe(theLEInelasticModel);
735 G4HEOmegaMinusInelastic* theHEInelasticModel =
736 new G4HEOmegaMinusInelastic;
737 theInelasticProcess->RegisterMe(theHEInelasticModel);
738 pmanager->AddDiscreteProcess(theInelasticProcess);
740 else if (particleName == "anti_omega-") {
741 pmanager->AddDiscreteProcess(theElasticProcess);
742 G4AntiOmegaMinusInelasticProcess* theInelasticProcess =
743 new G4AntiOmegaMinusInelasticProcess("inelastic");
744 G4LEAntiOmegaMinusInelastic* theLEInelasticModel =
745 new G4LEAntiOmegaMinusInelastic;
746 theInelasticProcess->RegisterMe(theLEInelasticModel);
747 G4HEAntiOmegaMinusInelastic* theHEInelasticModel =
748 new G4HEAntiOmegaMinusInelastic;
749 theInelasticProcess->RegisterMe(theHEInelasticModel);
750 pmanager->AddDiscreteProcess(theInelasticProcess);
754 G4cout << "### TG4PhysicsList::ConstructHad() finished." << endl;
759 #include <G4Cerenkov.hh>
760 #include <G4OpAbsorption.hh>
761 #include <G4OpRayleigh.hh>
762 #include <G4OpBoundaryProcess.hh>
764 void TG4PhysicsList::ConstructOp()
766 // Constructs optical processes.
767 // According to ExN06PhysicsList.cc.
771 G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
772 G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
773 G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh();
774 G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
776 theCerenkovProcess->DumpPhysicsTable();
777 //theAbsorptionProcess->DumpPhysicsTable();
778 //theRayleighScatteringProcess->DumpPhysicsTable();
781 //theCerenkovProcess->SetVerboseLevel(1);
782 //theAbsorptionProcess->SetVerboseLevel(1);
783 //theRayleighScatteringProcess->SetVerboseLevel(1);
784 //theBoundaryProcess->SetVerboseLevel(1);
786 G4int maxNumPhotons = 300;
788 theCerenkovProcess->SetTrackSecondariesFirst(true);
789 theCerenkovProcess->SetMaxNumPhotonsPerStep(maxNumPhotons);
791 //G4OpticalSurfaceModel themodel = unified;
793 G4OpticalSurfaceModel themodel = glisur;
794 theBoundaryProcess->SetModel(themodel);
796 theParticleIterator->reset();
797 while( (*theParticleIterator)() ){
798 G4ParticleDefinition* particle = theParticleIterator->value();
799 G4ProcessManager* processManager = particle->GetProcessManager();
800 G4String particleName = particle->GetParticleName();
801 if (theCerenkovProcess->IsApplicable(*particle)) {
802 processManager->AddContinuousProcess(theCerenkovProcess);
804 if (particleName == "opticalphoton") {
805 G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
806 processManager->AddDiscreteProcess(theAbsorptionProcess);
807 processManager->AddDiscreteProcess(theRayleighScatteringProcess);
808 processManager->AddDiscreteProcess(theBoundaryProcess);
813 #include <G4Decay.hh>
815 void TG4PhysicsList::ConstructGeneral()
817 // Constructs general processes.
821 G4Decay* theDecayProcess = new G4Decay();
822 theParticleIterator->reset();
823 while( (*theParticleIterator)() ){
824 G4ParticleDefinition* particle = theParticleIterator->value();
825 G4ProcessManager* pmanager = particle->GetProcessManager();
826 if (theDecayProcess->IsApplicable(*particle)) {
827 pmanager ->AddProcess(theDecayProcess);
828 // set ordering for PostStepDoIt and AtRestDoIt
829 pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
830 pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
835 void TG4PhysicsList::ConstructSpecialCuts()
837 // Adds TG4SpecialCuts "process" that activates
838 // the kinetic energy cuts defined in
839 // the vector of cuts (PhysicsManager::fCutVector) or in TG4Limits.
842 TG4PhysicsManager* physicsManager
843 = TG4PhysicsManager::Instance();
845 if (physicsManager->IsSpecialCuts())
847 TG4CutVector* cutVector
848 = physicsManager->GetCutVector();
849 TG4boolVector* isCutVector
850 = physicsManager->GetIsCutVector();
852 theParticleIterator->reset();
853 while ((*theParticleIterator)())
855 G4ParticleDefinition* particle = theParticleIterator->value();
856 TG3ParticleWSP particleWSP
857 = physicsManager->GetG3ParticleWSP(particle);
859 physicsManager->GetG3ParticleWSPName(particleWSP, name);
861 // uncomment this to see all particles "WSP"
862 //G4cout << "Iterating particle: "
863 // << particle->GetParticleName() << " " << particleWSP << " "
866 // special process is created in case
867 // cutVector (vector of kinetic energy cuts) is set
868 // or the special cut is set by TG4Limits
869 if ((particleWSP !=kNofParticlesWSP) &&
870 ((*isCutVector)[particleWSP])) {
871 // check if process already exists
872 G4String processName = "specialCutFor" + name;
873 G4VProcess* process = FindProcess(processName);
875 process = new TG4SpecialCuts(particleWSP, cutVector, processName);
877 //particle->GetProcessManager()->AddProcess(process, 0, -1, 1);
878 particle->GetProcessManager()->AddDiscreteProcess(process);
882 if (verboseLevel>0) {
883 G4cout << "TG4PhysicsList::ConstructSpecialCuts: " << endl;
885 G4cout << " Global kinetic energy cuts are set." << endl;
886 G4cout << " Special cuts process is defined for: " << endl
888 for (G4int i=0; i<kAny; i++) {
890 physicsManager->GetG3ParticleWSPName(i, name);
891 if ((*isCutVector)[i]) G4cout << name << " ";
898 void TG4PhysicsList::ConstructSpecialFlags()
900 // Adds TG4SpecialFlags "process" that activates
901 // the control process flags defined in TG4Limits.
904 TG4PhysicsManager* physicsManager
905 = TG4PhysicsManager::Instance();
907 if (physicsManager->IsSpecialFlags())
909 G4cout << "IsSpecialFlags started" << endl;
910 TG4boolVector* isFlagVector
911 = physicsManager->GetIsFlagVector();
913 theParticleIterator->reset();
914 while ((*theParticleIterator)())
916 G4ParticleDefinition* particle = theParticleIterator->value();
917 TG3ParticleWSP particleWSP
918 = physicsManager->GetG3ParticleWSP(particle);
920 //GetG3ParticleWSPName(particleWSP, name);
922 // special process is set in case
923 // the special flag is set by TG4Limits
924 if ((particleWSP !=kNofParticlesWSP) &&
925 ((*isFlagVector)[particleWSP])) {
926 // check if process already exists
927 G4String processName = "specialFlag";
928 G4VProcess* process = FindProcess(processName);
930 process = new TG4SpecialFlags(processName);
932 //particle->GetProcessManager()->AddProcess(process, 0, -1, 1);
933 particle->GetProcessManager()->AddDiscreteProcess(process);
937 if (verboseLevel>0) {
938 G4cout << "TG4PhysicsList::ConstructSpecialFlagss: " << endl;
939 G4cout << " Special flags process is defined for: " << endl
941 for (G4int i=0; i<kNofParticlesWSP; i++) {
943 physicsManager->GetG3ParticleWSPName(i, name);
944 if ((*isFlagVector)[i]) G4cout << name << " ";
951 void TG4PhysicsList::SetCuts()
953 // "G4VUserPhysicsList::SetCutsWithDefault" method sets
954 // the default cut value for all particle types
957 SetCutsWithDefault();
960 void TG4PhysicsList::ConstructAllBosons()
962 // Construct all bosons
965 G4BosonConstructor pConstructor;
966 pConstructor.ConstructParticle();
969 void TG4PhysicsList::ConstructAllLeptons()
971 // Construct all leptons
974 G4LeptonConstructor pConstructor;
975 pConstructor.ConstructParticle();
978 void TG4PhysicsList::ConstructAllMesons()
980 // Construct all mesons
983 G4MesonConstructor pConstructor;
984 pConstructor.ConstructParticle();
987 void TG4PhysicsList::ConstructAllBaryons()
989 // Construct all barions
992 G4BaryonConstructor pConstructor;
993 pConstructor.ConstructParticle();
996 void TG4PhysicsList::ConstructAllIons()
998 // Construct light ions
1001 G4IonConstructor pConstructor;
1002 pConstructor.ConstructParticle();
1005 void TG4PhysicsList::ConstructAllShortLiveds()
1007 // Construct resonaces and quarks
1010 G4ShortLivedConstructor pConstructor;
1011 pConstructor.ConstructParticle();
1016 G4VProcess* TG4PhysicsList::FindProcess(G4String processName) const
1018 // Finds G4VProcess with specified name.
1021 G4ProcessTable* processTable = G4ProcessTable::GetProcessTable();
1023 G4ProcessVector* processVector
1024 = processTable->FindProcesses(processName);
1025 G4VProcess* firstFoundProcess = 0;
1026 if (processVector->entries()>0) firstFoundProcess= (*processVector)[0];
1028 processVector->clear();
1029 delete processVector;
1031 return firstFoundProcess;
1034 void TG4PhysicsList::InActivateProcess(G4String processName,
1035 G4ParticleDefinition* particle)
1037 // Activates the process specified by name for the specified
1039 // Only for tests - to be removed.
1042 G4ProcessManager* processManager = particle->GetProcessManager();
1043 G4ProcessVector* processVector = processManager->GetProcessList();
1044 for (G4int i=0; i<processVector->entries(); i++) {
1045 if ((*processVector)[i]->GetProcessName() == processName) {
1046 processManager->SetProcessActivation((*processVector)[i], false);
1051 G4String text = "TG4PhysicsList::InActivateProcess: ";
1052 text = text + processName + " is not set for ";
1053 text = text + particle->GetParticleName();
1054 TG4Globals::Exception(text);
1057 void TG4PhysicsList::InActivateEM()
1059 // Inactivates specified electromagnetic processes.
1060 // Only for tests - to be removed.
1061 // !! This method must be called after all Construct methods.
1062 // Uncomment the selected line(s) to inactivate desired processes.
1065 theParticleIterator->reset();
1066 while ((*theParticleIterator)())
1068 G4ParticleDefinition* particle = theParticleIterator->value();
1069 G4String name = particle->GetParticleName();
1071 if (name == "gamma") {
1073 //InActivateProcess("phot", particle);
1074 //InActivateProcess("compt", particle);
1075 //InActivateProcess("conv", particle);
1077 else if (name == "e-") {
1079 InActivateProcess("msc", particle);
1080 G4cout << "msc inactivated." << endl;
1081 //InActivateProcess("eIoni", particle);
1082 //G4cout << "eIoni inactivated." << endl;
1083 InActivateProcess("eBrem", particle);
1084 G4cout << "eBrem inactivated." << endl;
1086 else if (name == "e+") {
1088 //InActivateProcess("msc", particle);
1089 //InActivateProcess("eIoni", particle);
1090 //InActivateProcess("eBrem", particle);
1091 //InActivateProcess("annihil", particle);
1093 else if (name == "mu+" || name == "mu-") {
1095 //InActivateProcess("msc", particle);
1096 //InActivateProcess("MuIoni", particle);
1097 //InActivateProcess("MuBrem", particle);
1098 //InActivateProcess("MuPairProd", particle);
1100 else if ((!particle->IsShortLived()) &&
1101 (particle->GetPDGCharge() != 0.0) &&
1102 (particle->GetParticleName() != "chargedgeantino"))
1104 // all others charged particles except geantino
1105 //InActivateProcess("msc", particle);
1106 //InActivateProcess("hIoni", particle);