File indexing completed on 2025-01-31 09:22:18
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 #include "G4SystemOfUnits.hh"
0040 #include "G4RunManager.hh"
0041 #include "G4Region.hh"
0042 #include "G4RegionStore.hh"
0043 #include "HadrontherapyPhysicsList.hh"
0044 #include "HadrontherapyPhysicsListMessenger.hh"
0045 #include "HadrontherapyStepMax.hh"
0046 #include "G4PhysListFactory.hh"
0047 #include "G4VPhysicsConstructor.hh"
0048 #include "G4HadronPhysicsQGSP_BIC_HP.hh"
0049 #include "G4HadronPhysicsQGSP_BIC.hh"
0050 #include "G4EmStandardPhysics_option4.hh"
0051 #include "G4EmStandardPhysics.hh"
0052 #include "G4EmExtraPhysics.hh"
0053 #include "G4StoppingPhysics.hh"
0054 #include "G4DecayPhysics.hh"
0055 #include "G4HadronElasticPhysics.hh"
0056 #include "G4HadronElasticPhysicsHP.hh"
0057 #include "G4RadioactiveDecayPhysics.hh"
0058 #include "G4IonBinaryCascadePhysics.hh"
0059 #include "G4DecayPhysics.hh"
0060 #include "G4NeutronTrackingCut.hh"
0061 #include "G4LossTableManager.hh"
0062 #include "G4UnitsTable.hh"
0063 #include "G4ProcessManager.hh"
0064 #include "G4IonFluctuations.hh"
0065 #include "G4IonParametrisedLossModel.hh"
0066 #include "G4EmParameters.hh"
0067 #include "G4ParallelWorldPhysics.hh"
0068 #include "G4EmLivermorePhysics.hh"
0069 #include "G4AutoDelete.hh"
0070 #include "G4HadronPhysicsQGSP_BIC_AllHP.hh"
0071 #include "QGSP_BIC_HP.hh"
0072 #include "G4HadronPhysicsQGSP_BERT.hh"
0073 #include "G4HadronPhysicsQGSP_BERT_HP.hh"
0074
0075
0076 HadrontherapyPhysicsList::HadrontherapyPhysicsList() : G4VModularPhysicsList()
0077 {
0078 G4LossTableManager::Instance();
0079 defaultCutValue = 1.*mm;
0080 cutForGamma = defaultCutValue;
0081 cutForElectron = defaultCutValue;
0082 cutForPositron = defaultCutValue;
0083
0084 pMessenger = new HadrontherapyPhysicsListMessenger(this);
0085 SetVerboseLevel(1);
0086 decay_List = new G4DecayPhysics();
0087
0088
0089 emPhysicsList = new G4EmStandardPhysics_option4();
0090
0091 }
0092
0093
0094 HadrontherapyPhysicsList::~HadrontherapyPhysicsList()
0095 {
0096 delete pMessenger;
0097 delete emPhysicsList;
0098 delete decay_List;
0099
0100 hadronPhys.clear();
0101 for(size_t i=0; i<hadronPhys.size(); i++)
0102 {
0103 delete hadronPhys[i];
0104 }
0105 }
0106
0107
0108 void HadrontherapyPhysicsList::ConstructParticle()
0109 {
0110 decay_List -> ConstructParticle();
0111
0112 }
0113
0114
0115 void HadrontherapyPhysicsList::ConstructProcess()
0116 {
0117
0118
0119 AddTransportation();
0120
0121 decay_List -> ConstructProcess();
0122 emPhysicsList -> ConstructProcess();
0123
0124
0125
0126
0127
0128
0129 for(size_t i=0; i < hadronPhys.size(); i++)
0130 {
0131 hadronPhys[i] -> ConstructProcess();
0132 }
0133
0134
0135
0136 AddStepMax();
0137
0138
0139
0140 G4ParallelWorldPhysics* pWorld = new G4ParallelWorldPhysics("DetectorROGeometry");
0141 pWorld->ConstructProcess();
0142
0143 return;
0144 }
0145
0146
0147 void HadrontherapyPhysicsList::AddPhysicsList(const G4String& name)
0148 {
0149 if (verboseLevel>1) {
0150 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0151 }
0152 if (name == emName) return;
0153
0154
0155
0156
0157 if (name == "standard_opt4") {
0158 emName = name;
0159 delete emPhysicsList;
0160 hadronPhys.clear();
0161 emPhysicsList = new G4EmStandardPhysics_option4();
0162 G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
0163 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option4" << G4endl;
0164
0165
0166
0167
0168
0169 } else if (name == "HADRONTHERAPY_1") {
0170
0171 AddPhysicsList("standard_opt4");
0172 hadronPhys.push_back( new G4DecayPhysics());
0173 hadronPhys.push_back( new G4RadioactiveDecayPhysics());
0174 hadronPhys.push_back( new G4IonBinaryCascadePhysics());
0175 hadronPhys.push_back( new G4EmExtraPhysics());
0176 hadronPhys.push_back( new G4HadronElasticPhysicsHP());
0177 hadronPhys.push_back( new G4StoppingPhysics());
0178 hadronPhys.push_back( new G4HadronPhysicsQGSP_BIC_HP());
0179 hadronPhys.push_back( new G4NeutronTrackingCut());
0180
0181 G4cout << "HADRONTHERAPY_1 PHYSICS LIST has been activated" << G4endl;
0182 }
0183
0184 else if (name == "HADRONTHERAPY_2") {
0185
0186 AddPhysicsList("standard_opt4");
0187 hadronPhys.push_back( new G4DecayPhysics());
0188 hadronPhys.push_back( new G4RadioactiveDecayPhysics());
0189 hadronPhys.push_back( new G4IonBinaryCascadePhysics());
0190 hadronPhys.push_back( new G4EmExtraPhysics());
0191 hadronPhys.push_back( new G4HadronElasticPhysics());
0192 hadronPhys.push_back( new G4StoppingPhysics());
0193 hadronPhys.push_back( new G4HadronPhysicsQGSP_BIC_AllHP());
0194 hadronPhys.push_back( new G4NeutronTrackingCut());
0195
0196 G4cout << "HADRONTHERAPY_2 PHYSICS LIST has been activated" << G4endl;
0197 }
0198
0199 else if (name == "HADRONTHERAPY_3"){
0200 AddPhysicsList("standard_opt4");
0201 hadronPhys.push_back( new G4DecayPhysics());
0202 hadronPhys.push_back( new G4RadioactiveDecayPhysics());
0203 hadronPhys.push_back( new G4IonBinaryCascadePhysics());
0204 hadronPhys.push_back( new G4EmExtraPhysics());
0205 hadronPhys.push_back( new G4HadronElasticPhysics());
0206 hadronPhys.push_back( new G4StoppingPhysics());
0207 hadronPhys.push_back( new G4HadronPhysicsQGSP_BERT_HP());
0208 hadronPhys.push_back( new G4NeutronTrackingCut());
0209
0210 G4cout << "HADRONTHERAPY_3 PHYSICS LIST has been activated" << G4endl;
0211 }
0212
0213 else {
0214 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0215 << " is not defined"
0216 << G4endl;
0217 }
0218
0219 }
0220
0221
0222 void HadrontherapyPhysicsList::AddStepMax()
0223 {
0224
0225
0226
0227 HadrontherapyStepMax* stepMaxProcess = new HadrontherapyStepMax();
0228
0229
0230 auto particleIterator = GetParticleIterator();
0231 particleIterator->reset();
0232 while ((*particleIterator)()){
0233 G4ParticleDefinition* particle = particleIterator->value();
0234 G4ProcessManager* pmanager = particle->GetProcessManager();
0235
0236 if (stepMaxProcess->IsApplicable(*particle) && pmanager)
0237 {
0238 pmanager ->AddDiscreteProcess(stepMaxProcess);
0239 }
0240 }
0241 }