File indexing completed on 2026-04-03 07:53:04
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 #include "TSPhysicsList.hh"
0040
0041 #include "G4ParticleDefinition.hh"
0042 #include "G4ParticleTypes.hh"
0043 #include "G4ProcessManager.hh"
0044 #include "G4RunManager.hh"
0045
0046
0047 #include "G4BaryonConstructor.hh"
0048 #include "G4IonConstructor.hh"
0049 #include "G4MesonConstructor.hh"
0050
0051
0052 #include "G4BosonConstructor.hh"
0053
0054
0055 #include "G4LeptonConstructor.hh"
0056
0057
0058 #include "G4ShortLivedConstructor.hh"
0059
0060
0061 #include "G4LossTableManager.hh"
0062
0063
0064 #include "G4PhysicsListHelper.hh"
0065 #include "G4StepLimiter.hh"
0066
0067
0068 #include "G4DecayPhysics.hh"
0069 #include "G4EmStandardPhysics_option3.hh"
0070 #include "G4EmStandardPhysics_option4.hh"
0071 #include "G4HadronElasticPhysics.hh"
0072 #include "G4HadronElasticPhysicsHP.hh"
0073 #include "G4HadronPhysicsQGSP_BERT.hh"
0074 #include "G4HadronPhysicsQGSP_BERT_HP.hh"
0075 #include "G4IonBinaryCascadePhysics.hh"
0076 #include "G4IonElasticPhysics.hh"
0077 #include "G4RadioactiveDecayPhysics.hh"
0078
0079 #include <set>
0080
0081
0082
0083 TSPhysicsList::TSPhysicsList()
0084 {
0085 defaultCutValue = 1. * CLHEP::mm;
0086
0087 fConstructors.push_back(new G4EmStandardPhysics_option4);
0088 fConstructors.push_back(new G4DecayPhysics);
0089 fConstructors.push_back(new G4RadioactiveDecayPhysics);
0090 fConstructors.push_back(new G4HadronPhysicsQGSP_BERT_HP);
0091 fConstructors.push_back(new G4HadronElasticPhysicsHP);
0092 fConstructors.push_back(new G4IonElasticPhysics);
0093 fConstructors.push_back(new G4IonBinaryCascadePhysics);
0094 }
0095
0096
0097
0098 TSPhysicsList::~TSPhysicsList()
0099 {
0100 for (auto ite : fConstructors)
0101 delete ite;
0102 }
0103
0104
0105
0106 void TSPhysicsList::ConstructParticle()
0107 {
0108 for (auto c : fConstructors) {
0109 c->ConstructParticle();
0110 }
0111 }
0112
0113
0114
0115 void TSPhysicsList::ConstructProcess()
0116 {
0117
0118
0119 AddTransportation();
0120
0121 for (auto c : fConstructors) {
0122 c->ConstructProcess();
0123 }
0124
0125 std::set<G4String> step_limit_particles;
0126
0127 step_limit_particles.insert("e-");
0128 step_limit_particles.insert("e+");
0129 step_limit_particles.insert("alpha");
0130 step_limit_particles.insert("He3");
0131 step_limit_particles.insert("GenericIon");
0132 step_limit_particles.insert("proton");
0133 step_limit_particles.insert("neutron");
0134
0135 step_limit_particles.insert("pi+");
0136 step_limit_particles.insert("pi-");
0137 step_limit_particles.insert("mu+");
0138 step_limit_particles.insert("mu-");
0139
0140 auto particleIterator = GetParticleIterator();
0141 particleIterator->reset();
0142
0143 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0144
0145 while ((*particleIterator)()) {
0146 G4ParticleDefinition* particle = particleIterator->value();
0147 G4String pname = particle->GetParticleName();
0148
0149 if (step_limit_particles.find(pname) != step_limit_particles.end() || particle->GetPDGCharge())
0150 {
0151 ph->RegisterProcess(new G4StepLimiter, particle);
0152 }
0153 }
0154 }
0155
0156