File indexing completed on 2025-02-23 09:21:57
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 #include "PhysicsList.hh"
0039
0040 #include "PhysicsListMessenger.hh"
0041
0042 #include "G4BaryonConstructor.hh"
0043 #include "G4BosonConstructor.hh"
0044 #include "G4DNAGenericIonsManager.hh"
0045 #include "G4EmDNAPhysics.hh"
0046 #include "G4EmDNAPhysics_option1.hh"
0047 #include "G4EmDNAPhysics_option2.hh"
0048 #include "G4EmDNAPhysics_option3.hh"
0049 #include "G4EmDNAPhysics_option4.hh"
0050 #include "G4EmDNAPhysics_option5.hh"
0051 #include "G4EmDNAPhysics_option6.hh"
0052 #include "G4EmDNAPhysics_option7.hh"
0053 #include "G4EmDNAPhysics_option8.hh"
0054 #include "G4EmLivermorePhysics.hh"
0055 #include "G4EmPenelopePhysics.hh"
0056 #include "G4EmStandardPhysics_option4.hh"
0057 #include "G4IonConstructor.hh"
0058 #include "G4LeptonConstructor.hh"
0059 #include "G4MesonConstructor.hh"
0060 #include "G4ShortLivedConstructor.hh"
0061 #include "G4StepLimiter.hh"
0062 #include "G4UserSpecialCuts.hh"
0063
0064 #include <memory>
0065
0066
0067
0068 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0069 {
0070 fMessenger = std::make_unique<PhysicsListMessenger>(this);
0071 SetVerboseLevel(1);
0072 fEmPhysicsList = std::make_unique<G4EmDNAPhysics_option2>();
0073 }
0074
0075
0076
0077 PhysicsList::~PhysicsList() = default;
0078
0079
0080
0081 void PhysicsList::ConstructParticle()
0082 {
0083 G4BosonConstructor pBosonConstructor;
0084 pBosonConstructor.ConstructParticle();
0085
0086 G4LeptonConstructor pLeptonConstructor;
0087 pLeptonConstructor.ConstructParticle();
0088
0089 G4MesonConstructor pMesonConstructor;
0090 pMesonConstructor.ConstructParticle();
0091
0092 G4BaryonConstructor pBaryonConstructor;
0093 pBaryonConstructor.ConstructParticle();
0094
0095 G4IonConstructor pIonConstructor;
0096 pIonConstructor.ConstructParticle();
0097
0098 G4ShortLivedConstructor pShortLivedConstructor;
0099 pShortLivedConstructor.ConstructParticle();
0100
0101 G4DNAGenericIonsManager* genericIonsManager;
0102 genericIonsManager = G4DNAGenericIonsManager::Instance();
0103 genericIonsManager->GetIon("alpha++");
0104 genericIonsManager->GetIon("alpha+");
0105 genericIonsManager->GetIon("helium");
0106 genericIonsManager->GetIon("hydrogen");
0107 }
0108
0109
0110
0111 void PhysicsList::ConstructProcess()
0112 {
0113
0114 AddTransportation();
0115
0116
0117 fEmPhysicsList->ConstructProcess();
0118
0119
0120 AddTrackingCut();
0121
0122
0123 AddMaxStepSize();
0124 }
0125
0126
0127
0128 void PhysicsList::AddPhysicsList(const G4String& name)
0129 {
0130 if (verboseLevel > -1) {
0131 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0132 }
0133
0134 if (name == fEmName) return;
0135
0136 if (name == "dna") {
0137 fEmName = name;
0138 fEmPhysicsList = std::make_unique<G4EmDNAPhysics>();
0139 }
0140 else if (name == "dna_opt1") {
0141 fEmName = name;
0142 fEmPhysicsList = std::make_unique<G4EmDNAPhysics_option1>();
0143 }
0144 else if (name == "dna_opt2") {
0145 fEmName = name;
0146 fEmPhysicsList = std::make_unique<G4EmDNAPhysics_option2>();
0147 }
0148 else if (name == "dna_opt3") {
0149 fEmName = name;
0150 fEmPhysicsList = std::make_unique<G4EmDNAPhysics_option3>();
0151 }
0152 else if (name == "dna_opt4") {
0153 fEmName = name;
0154 fEmPhysicsList = std::make_unique<G4EmDNAPhysics_option4>();
0155 }
0156 else if (name == "dna_opt5") {
0157 fEmName = name;
0158 fEmPhysicsList = std::make_unique<G4EmDNAPhysics_option5>();
0159 }
0160 else if (name == "dna_opt6") {
0161 fEmName = name;
0162 fEmPhysicsList = std::make_unique<G4EmDNAPhysics_option6>();
0163 }
0164 else if (name == "dna_opt7") {
0165 fEmName = name;
0166 fEmPhysicsList = std::make_unique<G4EmDNAPhysics_option7>();
0167 }
0168 else if (name == "dna_opt8") {
0169 fEmName = name;
0170 fEmPhysicsList = std::make_unique<G4EmDNAPhysics_option8>();
0171 }
0172 else if (name == "liv") {
0173 fEmName = name;
0174 fEmPhysicsList = std::make_unique<G4EmLivermorePhysics>();
0175 }
0176 else if (name == "pene") {
0177 fEmName = name;
0178 fEmPhysicsList = std::make_unique<G4EmPenelopePhysics>();
0179 }
0180 else if (name == "emstandard_opt4") {
0181 fEmName = name;
0182 fEmPhysicsList = std::make_unique<G4EmStandardPhysics_option4>();
0183 }
0184 else {
0185 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0186 << " is not defined" << G4endl;
0187 }
0188 }
0189
0190
0191
0192 void PhysicsList::AddTrackingCut()
0193 {
0194 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0195
0196 auto particleIterator = GetParticleIterator();
0197 particleIterator->reset();
0198 while ((*particleIterator)()) {
0199 G4ParticleDefinition* particle = particleIterator->value();
0200 G4String particleName = particle->GetParticleName();
0201
0202 if (particleName == "e-") {
0203 ph->RegisterProcess(new G4UserSpecialCuts(), particle);
0204 }
0205 }
0206 }
0207
0208
0209
0210 void PhysicsList::AddMaxStepSize()
0211 {
0212 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0213
0214 auto particleIterator = GetParticleIterator();
0215 particleIterator->reset();
0216 while ((*particleIterator)()) {
0217 G4ParticleDefinition* particle = particleIterator->value();
0218 G4String particleName = particle->GetParticleName();
0219
0220 if (particleName == "e-") {
0221 ph->RegisterProcess(new G4StepLimiter(), particle);
0222 }
0223 }
0224 }
0225
0226