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