Warning, file /geant4/examples/advanced/gammaknife/src/GammaKnifePhysicsList.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 #include "G4RunManager.hh"
0028 #include "globals.hh"
0029 #include "G4ProcessManager.hh"
0030 #include "G4Region.hh"
0031 #include "G4RegionStore.hh"
0032
0033 #include "G4ParticleDefinition.hh"
0034 #include "G4ParticleTypes.hh"
0035 #include "G4ParticleTable.hh"
0036
0037 #include "G4PhysListFactory.hh"
0038 #include "GammaKnifePhysicsList.hh"
0039 #include "GammaKnifePhysicsListMessenger.hh"
0040 #include "GammaKnifeParticles.hh"
0041 #include "G4SystemOfUnits.hh"
0042
0043
0044
0045 #include "G4EmStandardPhysics_option3.hh"
0046 #include "G4EmLivermorePhysics.hh"
0047 #include "G4EmPenelopePhysics.hh"
0048 #include "G4EmExtraPhysics.hh"
0049
0050 #include "G4DecayPhysics.hh"
0051 #include "G4RadioactiveDecayPhysics.hh"
0052
0053 #include "G4LossTableManager.hh"
0054 #include "G4UnitsTable.hh"
0055
0056 GammaKnifePhysicsList::GammaKnifePhysicsList(): G4VModularPhysicsList()
0057 {
0058 G4LossTableManager::Instance();
0059 defaultCutValue = 1.*mm;
0060 cutForGamma = defaultCutValue;
0061 cutForElectron = defaultCutValue;
0062 cutForPositron = defaultCutValue;
0063
0064 radioactiveDecayIsRegistered = false;
0065
0066
0067 messenger = new GammaKnifePhysicsListMessenger(this);
0068 SetVerboseLevel(1);
0069
0070
0071 emPhysicsList = new G4EmStandardPhysics_option3(1);
0072 emName = G4String("emstandard_opt3");
0073
0074
0075 decPhysicsList = new G4DecayPhysics();
0076 }
0077
0078 GammaKnifePhysicsList::~GammaKnifePhysicsList()
0079 {
0080 delete messenger;
0081 delete emPhysicsList;
0082 delete decPhysicsList;
0083 for(size_t i=0; i<hadronPhys.size(); i++)
0084 delete hadronPhys[i];
0085 }
0086
0087 void GammaKnifePhysicsList::ConstructParticle()
0088 {
0089 decPhysicsList->ConstructParticle();
0090 emPhysicsList->ConstructParticle();
0091 }
0092
0093 void GammaKnifePhysicsList::ConstructProcess()
0094 {
0095
0096 AddTransportation();
0097
0098
0099 emPhysicsList->ConstructProcess();
0100
0101
0102 decPhysicsList->ConstructProcess();
0103
0104
0105 for(size_t i=0; i<hadronPhys.size(); i++) {
0106 hadronPhys[i] -> ConstructProcess();
0107 }
0108
0109 }
0110
0111
0112 void GammaKnifePhysicsList::AddPhysicsList(const G4String& name)
0113 {
0114
0115 if (verboseLevel>1) {
0116 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0117 }
0118 if (name == emName) return;
0119
0120
0121
0122
0123 if (name == "standard_opt3") {
0124 emName = name;
0125 delete emPhysicsList;
0126 emPhysicsList = new G4EmStandardPhysics_option3();
0127 G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
0128 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
0129
0130 } else if (name == "LowE_Livermore") {
0131 emName = name;
0132 delete emPhysicsList;
0133 emPhysicsList = new G4EmLivermorePhysics();
0134 G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
0135 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
0136
0137 } else if (name == "LowE_Penelope") {
0138 emName = name;
0139 delete emPhysicsList;
0140 emPhysicsList = new G4EmPenelopePhysics();
0141 G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
0142 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
0143
0144
0145
0146
0147
0148
0149 } else if (name == "decay")
0150 {
0151 hadronPhys.push_back(new G4DecayPhysics());
0152
0153 }
0154 else if (name == "radioactive_decay" && !radioactiveDecayIsRegistered )
0155 {
0156 hadronPhys.push_back(new G4RadioactiveDecayPhysics());
0157 radioactiveDecayIsRegistered = true;
0158 }
0159 else {
0160
0161 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0162 << " is not defined"
0163 << G4endl;
0164 }
0165
0166 }
0167
0168
0169
0170 void GammaKnifePhysicsList::SetCuts()
0171 {
0172
0173 if (verboseLevel >0){
0174 G4cout << "PhysicsList::SetCuts:";
0175 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
0176 }
0177
0178
0179
0180 SetCutValue(cutForGamma, "gamma");
0181 SetCutValue(cutForElectron, "e-");
0182 SetCutValue(cutForPositron, "e+");
0183
0184
0185 if (verboseLevel>0) DumpCutValuesTable();
0186 }
0187
0188
0189 void GammaKnifePhysicsList::SetCutForGamma(G4double cut)
0190 {
0191 cutForGamma = cut;
0192 SetParticleCuts(cutForGamma, G4Gamma::Gamma());
0193 }
0194
0195
0196 void GammaKnifePhysicsList::SetCutForElectron(G4double cut)
0197 {
0198 cutForElectron = cut;
0199 SetParticleCuts(cutForElectron, G4Electron::Electron());
0200 }
0201
0202
0203 void GammaKnifePhysicsList::SetCutForPositron(G4double cut)
0204 {
0205 cutForPositron = cut;
0206 SetParticleCuts(cutForPositron, G4Positron::Positron());
0207 }
0208