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