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