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 "TG4FlagVector.h"
12 #include "TG4SpecialCuts.h"
13 #include "TG4SpecialFlags.h"
15 #include <G4ParticleDefinition.hh>
16 #include <G4ProcessManager.hh>
17 #include <G4ProcessVector.hh>
18 #include <G4BosonConstructor.hh>
19 #include <G4LeptonConstructor.hh>
20 #include <G4MesonConstructor.hh>
21 #include <G4BaryonConstructor.hh>
22 #include <G4IonConstructor.hh>
23 #include <G4ShortLivedConstructor.hh>
24 #include <G4ProcessTable.hh>
27 TG4PhysicsList::TG4PhysicsList()
28 : G4VUserPhysicsList(),
31 fSetSpecialCuts(false),
32 fSetSpecialFlags(false)
34 // default cut value (1.0mm)
35 defaultCutValue = 1.0*mm;
38 fMessenger = new TG4PhysicsListMessenger(this);
43 TG4PhysicsList::TG4PhysicsList(const TG4PhysicsList& right)
44 : G4VUserPhysicsList(right)
47 fMessenger = new TG4PhysicsListMessenger(this);
49 fSetOptical = right.fSetOptical;
50 fSetHadron = right.fSetHadron;
51 fSetSpecialCuts = right.fSetSpecialCuts;
52 fSetSpecialFlags = right.fSetSpecialFlags;
55 TG4PhysicsList::~TG4PhysicsList() {
61 TG4PhysicsList& TG4PhysicsList::operator=(const TG4PhysicsList& right)
63 // check assignement to self
64 if (this == &right) return *this;
66 // base class assignement
67 G4VUserPhysicsList::operator=(right);
69 fSetOptical = right.fSetOptical;
70 fSetHadron = right.fSetHadron;
71 fSetSpecialCuts = right.fSetSpecialCuts;
72 fSetSpecialFlags = right.fSetSpecialFlags;
79 void TG4PhysicsList::ConstructParticle()
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.
87 // lock physics manager
88 TG4PhysicsManager* physicsManager = TG4PhysicsManager::Instance();
89 physicsManager->Lock();
90 physicsManager->SetPhysicsList(this);
92 // create all particles
94 ConstructAllLeptons();
96 ConstructAllBaryons();
98 ConstructAllShortLiveds();
101 void TG4PhysicsList::ConstructProcess()
103 // Constructs all processes.
109 if (fSetHadron) ConstructHad();
110 if (fSetOptical) ConstructOp();
111 if (fSetSpecialCuts) ConstructSpecialCuts();
112 if (fSetSpecialFlags) ConstructSpecialFlags();
114 if (verboseLevel>1) PrintAllProcesses();
118 void TG4PhysicsList::SetProcessActivation()
120 // (In)Activates built processes according
121 // to the setup in TG4PhysicsManager::fFlagVector.
124 G4cout << "TG4PhysicsList::SetProcessActivation() start" << G4endl;
126 TG4PhysicsManager* physicsManager = TG4PhysicsManager::Instance();
127 TG4FlagVector* flagVector = physicsManager->GetFlagVector();
129 // uncomment following lines to print
130 // the flagVector values
131 //for (G4int i=0; i<kNoG3Flags; i++)
132 //{ cout << i << " flag: " << (*flagVector)[i] << G4endl; }
135 theParticleIterator->reset();
136 while ((*theParticleIterator)())
138 G4ParticleDefinition* particle = theParticleIterator->value();
139 G4ProcessManager* processManager = particle->GetProcessManager();
140 G4ProcessVector* processVector = processManager->GetProcessList();
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 "
149 << (*processVector)[i]->GetProcessName() << G4endl;
151 processManager->SetProcessActivation(i,false);
153 else if (((flag == kActivate) || (flag == kActivate2)) &&
154 (!processManager->GetProcessActivation(i))) {
155 if (verboseLevel>1) {
156 G4cout << "Set process activation for "
157 << (*processVector)[i]->GetProcessName() << G4endl;
159 processManager->SetProcessActivation(i,true);
165 G4String text = "TG4PhysicsList::SetProcessActivation: \n";
166 text = text + " Vector of processes flags is not set.";
167 TG4Globals::Warning(text);
169 G4cout << "TG4PhysicsList::SetProcessActivation() end" << G4endl;
172 void TG4PhysicsList::PrintAllProcesses() const
174 // Prints all processes.
177 G4cout << "TG4PhysicsList processes: " << G4endl;
178 G4cout << "========================= " << G4endl;
180 G4ProcessTable* processTable = G4ProcessTable::GetProcessTable();
181 G4ProcessTable::G4ProcNameVector* processNameList
182 = processTable->GetNameList();
184 for (G4int i=0; i <processNameList->size(); i++){
185 G4cout << " " << (*processNameList)[i] << G4endl;
191 #include <G4ComptonScattering.hh>
192 #include <G4GammaConversion.hh>
193 #include <G4PhotoElectricEffect.hh>
195 #include <G4MultipleScattering.hh>
197 #include <G4eIonisation.hh>
198 #include <G4eBremsstrahlung.hh>
199 #include <G4eplusAnnihilation.hh>
201 #include <G4MuIonisation.hh>
202 #include <G4MuBremsstrahlung.hh>
203 #include <G4MuPairProduction.hh>
205 #include <G4hIonisation.hh>
207 void TG4PhysicsList::ConstructEM()
209 // Constructs electromagnetic processes.
212 theParticleIterator->reset();
213 while( (*theParticleIterator)() ){
214 G4ParticleDefinition* particle = theParticleIterator->value();
215 G4ProcessManager* pmanager = particle->GetProcessManager();
216 G4String particleName = particle->GetParticleName();
218 if (particleName == "gamma") {
220 // Construct processes for gamma
221 pmanager->AddDiscreteProcess(new G4GammaConversion());
222 pmanager->AddDiscreteProcess(new G4ComptonScattering());
223 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
225 } else if (particleName == "e-") {
227 // Construct processes for electron
228 G4VProcess* theeminusMultipleScattering = new G4MultipleScattering();
229 G4VProcess* theeminusIonisation = new G4eIonisation();
230 G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
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);
243 } else if (particleName == "e+") {
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();
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);
266 } else if( particleName == "mu+" ||
267 particleName == "mu-" ) {
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();
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);
288 } else if( particleName == "GenericIon" ) {
289 G4VProcess* aionIonization = new G4hIonisation;
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);
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();
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);
322 #include <G4HadronElasticProcess.hh>
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>
352 #include <G4LElastic.hh>
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>
380 // High-energy Models
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>
405 // Stopping processes
407 #ifdef TRIUMF_STOP_PIMINUS
408 #include <G4PionMinusAbsorptionAtRest.hh>
410 #include <G4PiMinusAbsorptionAtRest.hh>
412 #ifdef TRIUMF_STOP_KMINUS
413 #include <G4KaonMinusAbsorption.hh>
415 #include <G4KaonMinusAbsorptionAtRest.hh>
418 void TG4PhysicsList::ConstructHad()
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.
427 // F.W.Jones 09-JUL-1998
430 G4cout << "### TG4PhysicsList::ConstructHad()" << G4endl;
432 G4HadronElasticProcess* theElasticProcess =
433 new G4HadronElasticProcess;
434 G4LElastic* theElasticModel = new G4LElastic;
435 theElasticProcess->RegisterMe(theElasticModel);
437 theParticleIterator->reset();
438 while ((*theParticleIterator)()) {
439 G4ParticleDefinition* particle = theParticleIterator->value();
440 G4ProcessManager* pmanager = particle->GetProcessManager();
441 G4String particleName = particle->GetParticleName();
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);
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);
470 pmanager->AddRestProcess(
471 new G4PiMinusAbsorptionAtRest(
472 prcNam="PiMinusAbsorptionAtRest"), ordDefault);
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);
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);
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);
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);
525 pmanager->AddRestProcess(new G4KaonMinusAbsorptionAtRest, ordDefault);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
745 G4cout << "### TG4PhysicsList::ConstructHad() finished." << G4endl;
750 #include <G4Cerenkov.hh>
751 #include <G4OpAbsorption.hh>
752 #include <G4OpRayleigh.hh>
753 #include <G4OpBoundaryProcess.hh>
755 void TG4PhysicsList::ConstructOp()
757 // Constructs optical processes.
758 // According to ExN06PhysicsList.cc.
762 G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
763 G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
764 G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh();
765 G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
767 theCerenkovProcess->DumpPhysicsTable();
768 //theAbsorptionProcess->DumpPhysicsTable();
769 //theRayleighScatteringProcess->DumpPhysicsTable();
772 //theCerenkovProcess->SetVerboseLevel(1);
773 //theAbsorptionProcess->SetVerboseLevel(1);
774 //theRayleighScatteringProcess->SetVerboseLevel(1);
775 //theBoundaryProcess->SetVerboseLevel(1);
777 G4int maxNumPhotons = 300;
779 theCerenkovProcess->SetTrackSecondariesFirst(true);
780 theCerenkovProcess->SetMaxNumPhotonsPerStep(maxNumPhotons);
782 //G4OpticalSurfaceModel themodel = unified;
784 G4OpticalSurfaceModel themodel = glisur;
785 theBoundaryProcess->SetModel(themodel);
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);
795 if (particleName == "opticalphoton") {
796 G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
797 processManager->AddDiscreteProcess(theAbsorptionProcess);
798 processManager->AddDiscreteProcess(theRayleighScatteringProcess);
799 processManager->AddDiscreteProcess(theBoundaryProcess);
804 #include <G4Decay.hh>
806 void TG4PhysicsList::ConstructGeneral()
808 // Constructs general processes.
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);
826 void TG4PhysicsList::ConstructSpecialCuts()
828 // Adds TG4SpecialCuts "process" that activates
829 // the kinetic energy cuts defined in
830 // the vector of cuts (PhysicsManager::fCutVector) or in TG4Limits.
833 TG4PhysicsManager* physicsManager
834 = TG4PhysicsManager::Instance();
836 if (physicsManager->IsSpecialCuts())
838 TG4CutVector* cutVector
839 = physicsManager->GetCutVector();
840 TG4boolVector* isCutVector
841 = physicsManager->GetIsCutVector();
843 theParticleIterator->reset();
844 while ((*theParticleIterator)())
846 G4ParticleDefinition* particle = theParticleIterator->value();
847 TG3ParticleWSP particleWSP
848 = physicsManager->GetG3ParticleWSP(particle);
850 physicsManager->GetG3ParticleWSPName(particleWSP, name);
852 // uncomment this to see all particles "WSP"
853 //G4cout << "Iterating particle: "
854 // << particle->GetParticleName() << " " << particleWSP << " "
855 // << name << G4endl;
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);
866 process = new TG4SpecialCuts(particleWSP, cutVector, processName);
868 //particle->GetProcessManager()->AddProcess(process, 0, -1, 1);
869 particle->GetProcessManager()->AddDiscreteProcess(process);
873 if (verboseLevel>0) {
874 G4cout << "TG4PhysicsList::ConstructSpecialCuts: " << G4endl;
876 G4cout << " Global kinetic energy cuts are set." << G4endl;
877 G4cout << " Special cuts process is defined for: " << G4endl
879 for (G4int i=0; i<kAny; i++) {
881 physicsManager->GetG3ParticleWSPName(i, name);
882 if ((*isCutVector)[i]) G4cout << name << " ";
889 void TG4PhysicsList::ConstructSpecialFlags()
891 // Adds TG4SpecialFlags "process" that activates
892 // the control process flags defined in TG4Limits.
895 TG4PhysicsManager* physicsManager
896 = TG4PhysicsManager::Instance();
898 if (physicsManager->IsSpecialFlags())
900 G4cout << "IsSpecialFlags started" << G4endl;
901 TG4boolVector* isFlagVector
902 = physicsManager->GetIsFlagVector();
904 theParticleIterator->reset();
905 while ((*theParticleIterator)())
907 G4ParticleDefinition* particle = theParticleIterator->value();
908 TG3ParticleWSP particleWSP
909 = physicsManager->GetG3ParticleWSP(particle);
911 //GetG3ParticleWSPName(particleWSP, name);
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);
921 process = new TG4SpecialFlags(processName);
923 //particle->GetProcessManager()->AddProcess(process, 0, -1, 1);
924 particle->GetProcessManager()->AddDiscreteProcess(process);
928 if (verboseLevel>0) {
929 G4cout << "TG4PhysicsList::ConstructSpecialFlagss: " << G4endl;
930 G4cout << " Special flags process is defined for: " << G4endl
932 for (G4int i=0; i<kNofParticlesWSP; i++) {
934 physicsManager->GetG3ParticleWSPName(i, name);
935 if ((*isFlagVector)[i]) G4cout << name << " ";
942 void TG4PhysicsList::SetCuts()
944 // Sets the default cut value for all particle types
946 // The cut value for e-/e+ is high in oredr to supress
947 // tracking of delta electrons.
950 // SetCutsWithDefault();
951 // "G4VUserPhysicsList::SetCutsWithDefault" method sets
952 // the default cut value for all particle types.
955 G4double cut = defaultCutValue;
956 G4double ecut = 10.*m;
957 //G4double ecut = cut;
960 if (verboseLevel >1){
961 G4cout << "G4VUserPhysicsList::SetCutsWithDefault:";
962 G4cout << "CutLength : " << cut/mm << " (mm)" << G4endl;
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+");
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");
977 SetCutValueForOthers(cut);
979 if (verboseLevel>1) {
980 DumpCutValuesTable();
984 void TG4PhysicsList::ConstructAllBosons()
986 // Construct all bosons
989 G4BosonConstructor pConstructor;
990 pConstructor.ConstructParticle();
993 void TG4PhysicsList::ConstructAllLeptons()
995 // Construct all leptons
998 G4LeptonConstructor pConstructor;
999 pConstructor.ConstructParticle();
1002 void TG4PhysicsList::ConstructAllMesons()
1004 // Construct all mesons
1007 G4MesonConstructor pConstructor;
1008 pConstructor.ConstructParticle();
1011 void TG4PhysicsList::ConstructAllBaryons()
1013 // Construct all barions
1016 G4BaryonConstructor pConstructor;
1017 pConstructor.ConstructParticle();
1020 void TG4PhysicsList::ConstructAllIons()
1022 // Construct light ions
1025 G4IonConstructor pConstructor;
1026 pConstructor.ConstructParticle();
1029 void TG4PhysicsList::ConstructAllShortLiveds()
1031 // Construct resonaces and quarks
1034 G4ShortLivedConstructor pConstructor;
1035 pConstructor.ConstructParticle();
1040 G4VProcess* TG4PhysicsList::FindProcess(G4String processName) const
1042 // Finds G4VProcess with specified name.
1045 G4ProcessTable* processTable = G4ProcessTable::GetProcessTable();
1047 G4ProcessVector* processVector
1048 = processTable->FindProcesses(processName);
1049 G4VProcess* firstFoundProcess = 0;
1050 if (processVector->entries()>0) firstFoundProcess= (*processVector)[0];
1052 processVector->clear();
1053 delete processVector;
1055 return firstFoundProcess;
1058 void TG4PhysicsList::InActivateProcess(G4String processName,
1059 G4ParticleDefinition* particle)
1061 // Activates the process specified by name for the specified
1063 // Only for tests - to be removed.
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);
1075 G4String text = "TG4PhysicsList::InActivateProcess: ";
1076 text = text + processName + " is not set for ";
1077 text = text + particle->GetParticleName();
1078 TG4Globals::Exception(text);
1081 void TG4PhysicsList::InActivateEM()
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.
1089 theParticleIterator->reset();
1090 while ((*theParticleIterator)())
1092 G4ParticleDefinition* particle = theParticleIterator->value();
1093 G4String name = particle->GetParticleName();
1095 if (name == "gamma") {
1097 //InActivateProcess("phot", particle);
1098 //InActivateProcess("compt", particle);
1099 //InActivateProcess("conv", particle);
1101 else if (name == "e-") {
1103 InActivateProcess("msc", particle);
1104 G4cout << "msc inactivated." << G4endl;
1105 //InActivateProcess("eIoni", particle);
1106 //G4cout << "eIoni inactivated." << G4endl;
1107 InActivateProcess("eBrem", particle);
1108 G4cout << "eBrem inactivated." << G4endl;
1110 else if (name == "e+") {
1112 //InActivateProcess("msc", particle);
1113 //InActivateProcess("eIoni", particle);
1114 //InActivateProcess("eBrem", particle);
1115 //InActivateProcess("annihil", particle);
1117 else if (name == "mu+" || name == "mu-") {
1119 //InActivateProcess("msc", particle);
1120 //InActivateProcess("MuIoni", particle);
1121 //InActivateProcess("MuBrem", particle);
1122 //InActivateProcess("MuPairProd", particle);
1124 else if ((!particle->IsShortLived()) &&
1125 (particle->GetPDGCharge() != 0.0) &&
1126 (particle->GetParticleName() != "chargedgeantino"))
1128 // all others charged particles except geantino
1129 //InActivateProcess("msc", particle);
1130 //InActivateProcess("hIoni", particle);