File indexing completed on 2025-02-23 09:22:30
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 #include "TSPhysicsList.hh"
0043
0044 #include "G4ParticleDefinition.hh"
0045 #include "G4ParticleTypes.hh"
0046 #include "G4ProcessManager.hh"
0047 #include "G4RunManager.hh"
0048
0049
0050 #include "G4BaryonConstructor.hh"
0051 #include "G4IonConstructor.hh"
0052 #include "G4MesonConstructor.hh"
0053
0054
0055 #include "G4BosonConstructor.hh"
0056
0057
0058 #include "G4LeptonConstructor.hh"
0059
0060
0061 #include "G4ShortLivedConstructor.hh"
0062
0063
0064 #include "G4LossTableManager.hh"
0065
0066
0067 #include "G4PhysicsListHelper.hh"
0068 #include "G4StepLimiter.hh"
0069
0070
0071 #include "G4DecayPhysics.hh"
0072 #include "G4EmStandardPhysics_option3.hh"
0073 #include "G4EmStandardPhysics_option4.hh"
0074 #include "G4HadronElasticPhysics.hh"
0075 #include "G4HadronElasticPhysicsHP.hh"
0076 #include "G4HadronPhysicsQGSP_BERT.hh"
0077 #include "G4HadronPhysicsQGSP_BERT_HP.hh"
0078 #include "G4IonBinaryCascadePhysics.hh"
0079 #include "G4IonElasticPhysics.hh"
0080 #include "G4RadioactiveDecayPhysics.hh"
0081
0082 #include <set>
0083
0084
0085
0086 TSPhysicsList::TSPhysicsList()
0087 {
0088 defaultCutValue = 1. * CLHEP::mm;
0089
0090 fConstructors.push_back(new G4EmStandardPhysics_option4);
0091 fConstructors.push_back(new G4DecayPhysics);
0092 fConstructors.push_back(new G4RadioactiveDecayPhysics);
0093 fConstructors.push_back(new G4HadronPhysicsQGSP_BERT_HP);
0094 fConstructors.push_back(new G4HadronElasticPhysicsHP);
0095 fConstructors.push_back(new G4IonElasticPhysics);
0096 fConstructors.push_back(new G4IonBinaryCascadePhysics);
0097 }
0098
0099
0100
0101 TSPhysicsList::~TSPhysicsList()
0102 {
0103 for (auto ite : fConstructors)
0104 delete ite;
0105 }
0106
0107
0108
0109 void TSPhysicsList::ConstructParticle()
0110 {
0111 for (auto c : fConstructors) {
0112 c->ConstructParticle();
0113 }
0114 }
0115
0116
0117
0118 void TSPhysicsList::ConstructProcess()
0119 {
0120
0121
0122 AddTransportation();
0123
0124 for (auto c : fConstructors) {
0125 c->ConstructProcess();
0126 }
0127
0128 std::set<G4String> step_limit_particles;
0129
0130 step_limit_particles.insert("e-");
0131 step_limit_particles.insert("e+");
0132 step_limit_particles.insert("alpha");
0133 step_limit_particles.insert("He3");
0134 step_limit_particles.insert("GenericIon");
0135 step_limit_particles.insert("proton");
0136 step_limit_particles.insert("neutron");
0137
0138 step_limit_particles.insert("pi+");
0139 step_limit_particles.insert("pi-");
0140 step_limit_particles.insert("mu+");
0141 step_limit_particles.insert("mu-");
0142
0143 auto particleIterator = GetParticleIterator();
0144 particleIterator->reset();
0145
0146 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0147
0148 while ((*particleIterator)()) {
0149 G4ParticleDefinition* particle = particleIterator->value();
0150 G4String pname = particle->GetParticleName();
0151
0152 if (step_limit_particles.find(pname) != step_limit_particles.end() || particle->GetPDGCharge())
0153 {
0154 ph->RegisterProcess(new G4StepLimiter, particle);
0155 }
0156 }
0157 }
0158
0159