File indexing completed on 2026-09-12 08:29:20
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
0040
0041
0042
0043 #include "PhysicsList.hh"
0044
0045 #include "DetectorConstruction.hh"
0046 #include "PhysicsListMessenger.hh"
0047 #include "StepMax.hh"
0048 #include "TransitionRadiationPhysics.hh"
0049
0050 #include "G4DecayPhysics.hh"
0051 #include "G4EmLivermorePhysics.hh"
0052 #include "G4EmLowEPPhysics.hh"
0053 #include "G4EmParameters.hh"
0054 #include "G4EmPenelopePhysics.hh"
0055 #include "G4EmStandardPhysics.hh"
0056 #include "G4EmStandardPhysicsGS.hh"
0057 #include "G4EmStandardPhysicsSS.hh"
0058 #include "G4EmStandardPhysicsWVI.hh"
0059 #include "G4EmStandardPhysics_option1.hh"
0060 #include "G4EmStandardPhysics_option2.hh"
0061 #include "G4EmStandardPhysics_option3.hh"
0062 #include "G4EmStandardPhysics_option4.hh"
0063 #include "G4ProcessManager.hh"
0064
0065
0066 #include "G4SystemOfUnits.hh"
0067
0068 G4ThreadLocal StepMax* PhysicsList::fStepMaxProcess = nullptr;
0069
0070
0071
0072 PhysicsList::PhysicsList(DetectorConstruction* ptr) : G4VModularPhysicsList(), fVerbose(1)
0073 {
0074 SetDefaultCutValue(1 * CLHEP::mm);
0075 SetVerboseLevel(fVerbose);
0076
0077 fMessenger = new PhysicsListMessenger(this);
0078
0079
0080 fDecayPhysicsList = new G4DecayPhysics(fVerbose);
0081
0082
0083 fEmName = G4String("emstandard_opt0");
0084 fEmPhysicsList = new G4EmStandardPhysics(fVerbose);
0085
0086
0087 fXTRPhysicsList = new TransitionRadiationPhysics(fVerbose, ptr);
0088 }
0089
0090
0091
0092 PhysicsList::~PhysicsList()
0093 {
0094 delete fMessenger;
0095 delete fDecayPhysicsList;
0096 delete fXTRPhysicsList;
0097 delete fEmPhysicsList;
0098 }
0099
0100
0101
0102 void PhysicsList::ConstructParticle()
0103 {
0104 fDecayPhysicsList->ConstructParticle();
0105 }
0106
0107
0108
0109 void PhysicsList::ConstructProcess()
0110 {
0111 AddTransportation();
0112 fEmPhysicsList->ConstructProcess();
0113 fDecayPhysicsList->ConstructProcess();
0114 fXTRPhysicsList->ConstructProcess();
0115 AddStepMax();
0116 }
0117
0118
0119
0120 void PhysicsList::AddPhysicsList(const G4String& name)
0121 {
0122 if (fVerbose > 1) {
0123 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0124 }
0125
0126 if (name == fEmName) {
0127 return;
0128 }
0129 else if (name == "emstandard_opt0") {
0130 fEmName = name;
0131 delete fEmPhysicsList;
0132 fEmPhysicsList = new G4EmStandardPhysics(fVerbose);
0133 }
0134 else if (name == "emstandard_opt1") {
0135 fEmName = name;
0136 delete fEmPhysicsList;
0137 fEmPhysicsList = new G4EmStandardPhysics_option1(fVerbose);
0138 }
0139 else if (name == "emstandard_opt2") {
0140 fEmName = name;
0141 delete fEmPhysicsList;
0142 fEmPhysicsList = new G4EmStandardPhysics_option2(fVerbose);
0143 }
0144 else if (name == "emstandard_opt3") {
0145 fEmName = name;
0146 delete fEmPhysicsList;
0147 fEmPhysicsList = new G4EmStandardPhysics_option3(fVerbose);
0148 }
0149 else if (name == "emstandard_opt4") {
0150 fEmName = name;
0151 delete fEmPhysicsList;
0152 fEmPhysicsList = new G4EmStandardPhysics_option4(fVerbose);
0153 }
0154 else if (name == "emstandardWVI") {
0155 fEmName = name;
0156 delete fEmPhysicsList;
0157 fEmPhysicsList = new G4EmStandardPhysicsWVI(fVerbose);
0158 }
0159 else if (name == "emstandardSS") {
0160 fEmName = name;
0161 delete fEmPhysicsList;
0162 fEmPhysicsList = new G4EmStandardPhysicsSS(fVerbose);
0163 }
0164 else if (name == "emstandardGS") {
0165 fEmName = name;
0166 delete fEmPhysicsList;
0167 fEmPhysicsList = new G4EmStandardPhysicsGS(fVerbose);
0168 }
0169 else if (name == "emlivermore") {
0170 fEmName = name;
0171 delete fEmPhysicsList;
0172 fEmPhysicsList = new G4EmLivermorePhysics(fVerbose);
0173 }
0174 else if (name == "empenelope") {
0175 fEmName = name;
0176 delete fEmPhysicsList;
0177 fEmPhysicsList = new G4EmPenelopePhysics(fVerbose);
0178 }
0179 else if (name == "emlowenergy") {
0180 fEmName = name;
0181 delete fEmPhysicsList;
0182 fEmPhysicsList = new G4EmLowEPPhysics(fVerbose);
0183 }
0184 else {
0185 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0186 << " is not defined" << G4endl;
0187 }
0188 }
0189
0190
0191
0192 void PhysicsList::SetXTRModel(const G4String& name)
0193 {
0194 fXTRPhysicsList->SetXTRModel(name);
0195 }
0196
0197
0198
0199 void PhysicsList::AddStepMax()
0200 {
0201
0202 fStepMaxProcess = new StepMax();
0203
0204 auto particleIterator = GetParticleIterator();
0205 particleIterator->reset();
0206 while ((*particleIterator)()) {
0207 G4ParticleDefinition* particle = particleIterator->value();
0208 G4ProcessManager* pmanager = particle->GetProcessManager();
0209
0210 if (fStepMaxProcess->IsApplicable(*particle)) {
0211 pmanager->AddDiscreteProcess(fStepMaxProcess);
0212 }
0213 }
0214 }
0215
0216