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