File indexing completed on 2025-02-23 09:22: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 #include "PhysicsList.hh"
0036
0037 #include "G4DecayPhysics.hh"
0038 #include "G4EmExtraPhysics.hh"
0039 #include "G4EmStandardPhysics.hh"
0040 #include "G4EmStandardPhysics_option4.hh"
0041 #include "G4HadronElasticPhysics.hh"
0042 #include "G4HadronElasticPhysicsHP.hh"
0043 #include "G4HadronPhysicsQGSP_BIC.hh"
0044 #include "G4HadronPhysicsQGSP_BIC_AllHP.hh"
0045 #include "G4HadronPhysicsQGSP_BIC_HP.hh"
0046 #include "G4IonBinaryCascadePhysics.hh"
0047 #include "G4LossTableManager.hh"
0048 #include "G4NeutronTrackingCut.hh"
0049 #include "G4RadioactiveDecayPhysics.hh"
0050 #include "G4RunManager.hh"
0051 #include "G4StoppingPhysics.hh"
0052 #include "G4SystemOfUnits.hh"
0053 #include "G4VPhysicsConstructor.hh"
0054
0055 #include "PhysicsListMessenger.hh"
0056
0057 namespace RadioBio
0058 {
0059
0060
0061
0062 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0063 {
0064
0065 G4LossTableManager::Instance();
0066 defaultCutValue = 1. * mm;
0067 fCutForGamma = defaultCutValue;
0068 fCutForElectron = defaultCutValue;
0069 fCutForPositron = defaultCutValue;
0070
0071 fPhysMessenger = new PhysicsListMessenger(this);
0072 SetVerboseLevel(1);
0073
0074
0075 fDecayPhysicsList = new G4DecayPhysics();
0076
0077
0078 fEmPhysicsList = new G4EmStandardPhysics_option4();
0079 }
0080
0081
0082
0083 PhysicsList::~PhysicsList()
0084 {
0085 delete fPhysMessenger;
0086 delete fEmPhysicsList;
0087 delete fDecayPhysicsList;
0088
0089
0090 for (size_t i = 0; i < fHadronPhys.size(); i++) {
0091 delete fHadronPhys[i];
0092 }
0093
0094
0095 fHadronPhys.clear();
0096 }
0097
0098
0099
0100 void PhysicsList::ConstructParticle()
0101 {
0102 fDecayPhysicsList->ConstructParticle();
0103 }
0104
0105
0106
0107 void PhysicsList::ConstructProcess()
0108 {
0109
0110 AddTransportation();
0111
0112
0113 fDecayPhysicsList->ConstructProcess();
0114 fEmPhysicsList->ConstructProcess();
0115
0116
0117 for (size_t i = 0; i < fHadronPhys.size(); i++) {
0118 fHadronPhys[i]->ConstructProcess();
0119 }
0120 }
0121
0122
0123
0124 void PhysicsList::AddPhysicsList(const G4String& name)
0125 {
0126 if (verboseLevel > 1) {
0127 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0128 }
0129 if (name == fEmName) return;
0130
0131
0132
0133
0134 if (name == "standard_opt4") {
0135 fEmName = name;
0136 delete fEmPhysicsList;
0137 fHadronPhys.clear();
0138 fEmPhysicsList = new G4EmStandardPhysics_option4();
0139 G4RunManager::GetRunManager()->PhysicsHasBeenModified();
0140 if (verboseLevel > 1) {
0141 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: "
0142 << "G4EmStandardPhysics_option4" << G4endl;
0143 }
0144
0145
0146
0147
0148 }
0149 else if (name == "HADRONTHERAPY_1") {
0150 AddPhysicsList("standard_opt4");
0151 fHadronPhys.push_back(new G4RadioactiveDecayPhysics());
0152 fHadronPhys.push_back(new G4IonBinaryCascadePhysics());
0153 fHadronPhys.push_back(new G4EmExtraPhysics());
0154 fHadronPhys.push_back(new G4HadronElasticPhysicsHP());
0155 fHadronPhys.push_back(new G4StoppingPhysics());
0156 fHadronPhys.push_back(new G4HadronPhysicsQGSP_BIC_HP());
0157 fHadronPhys.push_back(new G4NeutronTrackingCut());
0158
0159 G4cout << "HADRONTHERAPY_1 PHYSICS LIST has been activated" << G4endl;
0160 }
0161
0162 else if (name == "HADRONTHERAPY_2") {
0163
0164 AddPhysicsList("standard_opt4");
0165 fHadronPhys.push_back(new G4RadioactiveDecayPhysics());
0166 fHadronPhys.push_back(new G4IonBinaryCascadePhysics());
0167 fHadronPhys.push_back(new G4EmExtraPhysics());
0168 fHadronPhys.push_back(new G4HadronElasticPhysics());
0169 fHadronPhys.push_back(new G4StoppingPhysics());
0170 fHadronPhys.push_back(new G4HadronPhysicsQGSP_BIC());
0171 fHadronPhys.push_back(new G4NeutronTrackingCut());
0172
0173 G4cout << "HADRONTHERAPY_2 PHYSICS LIST has been activated" << G4endl;
0174 }
0175 else {
0176 G4Exception("PhysicsList::AddPhysicsList", "NoPhysicsList", JustWarning,
0177 (name + " is not a defined physics list").c_str());
0178 }
0179 }
0180
0181
0182
0183 }