File indexing completed on 2025-02-23 09:22:16
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 #include "PhysicsList.hh"
0034
0035 #include "PhysListEmStandard_GS.hh"
0036 #include "PhysListEmStandard_SS.hh"
0037 #include "PhysListEmStandard_WVI.hh"
0038 #include "PhysListEmStandard_option0.hh"
0039 #include "PhysListEmStandard_option3.hh"
0040 #include "PhysListEmStandard_option4.hh"
0041 #include "PhysicsListMessenger.hh"
0042 #include "StepMax.hh"
0043
0044 #include "G4LossTableManager.hh"
0045 #include "G4ParticleDefinition.hh"
0046 #include "G4ProcessManager.hh"
0047
0048
0049 #include "G4ChargedGeantino.hh"
0050 #include "G4Gamma.hh"
0051 #include "G4Geantino.hh"
0052
0053
0054 #include "G4Electron.hh"
0055 #include "G4Positron.hh"
0056
0057
0058 #include "G4Proton.hh"
0059 #include "G4SystemOfUnits.hh"
0060
0061
0062
0063 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0064 {
0065 G4LossTableManager::Instance();
0066 fMessenger = new PhysicsListMessenger(this);
0067
0068
0069 fEmName = G4String("standard_opt3");
0070 fEmPhysicsList = new PhysListEmStandard_option3(fEmName);
0071
0072 defaultCutValue = 10 * km;
0073
0074 SetVerboseLevel(1);
0075 }
0076
0077
0078
0079 PhysicsList::~PhysicsList()
0080 {
0081 delete fEmPhysicsList;
0082 delete fMessenger;
0083 }
0084
0085
0086
0087 void PhysicsList::ConstructParticle()
0088 {
0089
0090 G4Geantino::GeantinoDefinition();
0091 G4ChargedGeantino::ChargedGeantinoDefinition();
0092
0093
0094 G4Gamma::GammaDefinition();
0095
0096
0097 G4Electron::ElectronDefinition();
0098 G4Positron::PositronDefinition();
0099
0100
0101 G4Proton::ProtonDefinition();
0102 }
0103
0104
0105
0106 void PhysicsList::ConstructProcess()
0107 {
0108 AddTransportation();
0109 fEmPhysicsList->ConstructProcess();
0110
0111 AddStepMax();
0112 }
0113
0114
0115
0116 void PhysicsList::AddStepMax()
0117 {
0118
0119 StepMax* stepMaxProcess = new StepMax();
0120
0121 auto particleIterator = GetParticleIterator();
0122 particleIterator->reset();
0123 while ((*particleIterator)()) {
0124 G4ParticleDefinition* particle = particleIterator->value();
0125 G4ProcessManager* pmanager = particle->GetProcessManager();
0126
0127 if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
0128 pmanager->AddDiscreteProcess(stepMaxProcess);
0129 }
0130 }
0131 }
0132
0133
0134
0135 void PhysicsList::AddPhysicsList(const G4String& name)
0136 {
0137 if (verboseLevel > 0) {
0138 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0139 }
0140
0141 if (name == fEmName) return;
0142
0143 if (name == "standard_opt0") {
0144 fEmName = name;
0145 delete fEmPhysicsList;
0146 fEmPhysicsList = new PhysListEmStandard_option0(name);
0147 }
0148 else if (name == "standard_opt3") {
0149 fEmName = name;
0150 delete fEmPhysicsList;
0151 fEmPhysicsList = new PhysListEmStandard_option3(name);
0152 }
0153 else if (name == "standard_opt4") {
0154 fEmName = name;
0155 delete fEmPhysicsList;
0156 fEmPhysicsList = new PhysListEmStandard_option4(name);
0157 }
0158 else if (name == "standard_GS") {
0159 fEmName = name;
0160 delete fEmPhysicsList;
0161 fEmPhysicsList = new PhysListEmStandard_GS(name);
0162 }
0163 else if (name == "standard_WVI") {
0164 fEmName = name;
0165 delete fEmPhysicsList;
0166 fEmPhysicsList = new PhysListEmStandard_WVI(name);
0167 }
0168 else if (name == "standard_SS") {
0169 fEmName = name;
0170 delete fEmPhysicsList;
0171 fEmPhysicsList = new PhysListEmStandard_SS(name);
0172 }
0173 else {
0174 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0175 << " is not defined" << G4endl;
0176 }
0177 }
0178
0179