File indexing completed on 2025-02-23 09:20:54
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 #include "PhysicsList.hh"
0035
0036 #include "PhysListEmStandard.hh"
0037 #include "PhysicsListMessenger.hh"
0038
0039 #include "G4EmStandardPhysicsGS.hh"
0040 #include "G4EmStandardPhysicsSS.hh"
0041 #include "G4EmStandardPhysicsWVI.hh"
0042 #include "G4EmStandardPhysics_option3.hh"
0043 #include "G4EmStandardPhysics_option4.hh"
0044 #include "G4LossTableManager.hh"
0045 #include "G4SystemOfUnits.hh"
0046 #include "G4UnitsTable.hh"
0047
0048
0049 #include "G4ChargedGeantino.hh"
0050 #include "G4Gamma.hh"
0051 #include "G4Geantino.hh"
0052 #include "G4OpticalPhoton.hh"
0053
0054
0055 #include "G4AntiNeutrinoE.hh"
0056 #include "G4AntiNeutrinoMu.hh"
0057 #include "G4Electron.hh"
0058 #include "G4MuonMinus.hh"
0059 #include "G4MuonPlus.hh"
0060 #include "G4NeutrinoE.hh"
0061 #include "G4NeutrinoMu.hh"
0062 #include "G4Positron.hh"
0063
0064
0065 #include "G4AntiKaonZero.hh"
0066 #include "G4Eta.hh"
0067 #include "G4EtaPrime.hh"
0068 #include "G4KaonMinus.hh"
0069 #include "G4KaonPlus.hh"
0070 #include "G4KaonZero.hh"
0071 #include "G4KaonZeroLong.hh"
0072 #include "G4KaonZeroShort.hh"
0073 #include "G4PionMinus.hh"
0074 #include "G4PionPlus.hh"
0075 #include "G4PionZero.hh"
0076
0077
0078 #include "G4AntiNeutron.hh"
0079 #include "G4AntiProton.hh"
0080 #include "G4Neutron.hh"
0081 #include "G4Proton.hh"
0082
0083
0084 #include "StepMax.hh"
0085
0086 #include "G4Alpha.hh"
0087 #include "G4Deuteron.hh"
0088 #include "G4GenericIon.hh"
0089 #include "G4ProcessManager.hh"
0090 #include "G4Triton.hh"
0091
0092
0093
0094 PhysicsList::PhysicsList() : G4VModularPhysicsList(), fEmPhysicsList(0), fMessenger(0)
0095 {
0096 G4LossTableManager::Instance();
0097 SetDefaultCutValue(1 * mm);
0098
0099 fMessenger = new PhysicsListMessenger(this);
0100
0101 SetVerboseLevel(1);
0102
0103
0104 fEmName = G4String("local");
0105 fEmPhysicsList = new PhysListEmStandard(fEmName);
0106 }
0107
0108
0109
0110 PhysicsList::~PhysicsList()
0111 {
0112 delete fMessenger;
0113 }
0114
0115
0116
0117 void PhysicsList::ConstructParticle()
0118 {
0119
0120 G4Geantino::GeantinoDefinition();
0121 G4ChargedGeantino::ChargedGeantinoDefinition();
0122
0123
0124 G4Gamma::GammaDefinition();
0125
0126
0127 G4OpticalPhoton::OpticalPhotonDefinition();
0128
0129
0130 G4Electron::ElectronDefinition();
0131 G4Positron::PositronDefinition();
0132 G4MuonPlus::MuonPlusDefinition();
0133 G4MuonMinus::MuonMinusDefinition();
0134
0135 G4NeutrinoE::NeutrinoEDefinition();
0136 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
0137 G4NeutrinoMu::NeutrinoMuDefinition();
0138 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
0139
0140
0141 G4PionPlus::PionPlusDefinition();
0142 G4PionMinus::PionMinusDefinition();
0143 G4PionZero::PionZeroDefinition();
0144 G4Eta::EtaDefinition();
0145 G4EtaPrime::EtaPrimeDefinition();
0146 G4KaonPlus::KaonPlusDefinition();
0147 G4KaonMinus::KaonMinusDefinition();
0148 G4KaonZero::KaonZeroDefinition();
0149 G4AntiKaonZero::AntiKaonZeroDefinition();
0150 G4KaonZeroLong::KaonZeroLongDefinition();
0151 G4KaonZeroShort::KaonZeroShortDefinition();
0152
0153
0154 G4Proton::ProtonDefinition();
0155 G4AntiProton::AntiProtonDefinition();
0156 G4Neutron::NeutronDefinition();
0157 G4AntiNeutron::AntiNeutronDefinition();
0158
0159
0160 G4Deuteron::DeuteronDefinition();
0161 G4Triton::TritonDefinition();
0162 G4Alpha::AlphaDefinition();
0163 G4GenericIon::GenericIonDefinition();
0164 }
0165
0166
0167
0168 void PhysicsList::ConstructProcess()
0169 {
0170
0171
0172 AddTransportation();
0173
0174
0175
0176 fEmPhysicsList->ConstructProcess();
0177
0178
0179
0180 G4EmParameters* param = G4EmParameters::Instance();
0181 param->SetIntegral(false);
0182 param->SetStepFunction(1., 1 * mm);
0183 param->SetLossFluctuations(false);
0184
0185
0186
0187 AddStepMax();
0188 }
0189
0190
0191
0192 void PhysicsList::AddPhysicsList(const G4String& name)
0193 {
0194 if (verboseLevel > 0) {
0195 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0196 }
0197
0198 if (name == fEmName) return;
0199
0200 if (name == "local") {
0201 fEmName = name;
0202 delete fEmPhysicsList;
0203 fEmPhysicsList = new PhysListEmStandard(name);
0204 }
0205 else if (name == "emstandard_opt3") {
0206 fEmName = name;
0207 delete fEmPhysicsList;
0208 fEmPhysicsList = new G4EmStandardPhysics_option3();
0209 }
0210 else if (name == "emstandard_opt4") {
0211 fEmName = name;
0212 delete fEmPhysicsList;
0213 fEmPhysicsList = new G4EmStandardPhysics_option4();
0214 }
0215 else if (name == "emstandardSS") {
0216 fEmName = name;
0217 delete fEmPhysicsList;
0218 fEmPhysicsList = new G4EmStandardPhysicsSS();
0219 }
0220 else if (name == "emstandardWVI") {
0221 fEmName = name;
0222 delete fEmPhysicsList;
0223 fEmPhysicsList = new G4EmStandardPhysicsWVI();
0224 }
0225 else if (name == "emstandardGS") {
0226 fEmName = name;
0227 delete fEmPhysicsList;
0228 fEmPhysicsList = new G4EmStandardPhysicsGS();
0229 }
0230 else {
0231 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0232 << " is not defined" << G4endl;
0233 }
0234 }
0235
0236
0237
0238 void PhysicsList::AddStepMax()
0239 {
0240
0241 StepMax* stepMaxProcess = new StepMax();
0242
0243 auto particleIterator = GetParticleIterator();
0244 particleIterator->reset();
0245 while ((*particleIterator)()) {
0246 G4ParticleDefinition* particle = particleIterator->value();
0247 G4ProcessManager* pmanager = particle->GetProcessManager();
0248
0249 if (stepMaxProcess->IsApplicable(*particle) && pmanager) {
0250 pmanager->AddDiscreteProcess(stepMaxProcess);
0251 }
0252 }
0253 }
0254
0255