File indexing completed on 2025-02-26 09:19:29
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 #include "PhysicsList.hh"
0032 #include "PhysicsListMessenger.hh"
0033 #include "G4PhysListFactory.hh"
0034 #include "G4VPhysicsConstructor.hh"
0035
0036
0037 #include "G4EmStandardPhysics_option3.hh"
0038 #include "G4EmLivermorePhysics.hh"
0039 #include "G4EmPenelopePhysics.hh"
0040 #include "G4DecayPhysics.hh"
0041 #include "G4HadronElasticPhysics.hh"
0042 #include "G4HadronDElasticPhysics.hh"
0043 #include "G4HadronElasticPhysicsHP.hh"
0044 #include "G4IonBinaryCascadePhysics.hh"
0045 #include "G4Decay.hh"
0046 #include "G4StepLimiter.hh"
0047 #include "G4LossTableManager.hh"
0048 #include "G4UnitsTable.hh"
0049 #include "G4SystemOfUnits.hh"
0050 #include "G4ProcessManager.hh"
0051
0052 #include "G4IonFluctuations.hh"
0053 #include "G4IonParametrisedLossModel.hh"
0054 #include "G4HadronPhysicsQGSP_BIC_HP.hh"
0055 #include "G4RadioactiveDecayPhysics.hh"
0056
0057
0058 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0059 {
0060 G4LossTableManager::Instance();
0061 defaultCutValue = 0.01*micrometer;
0062 cutForGamma = defaultCutValue;
0063 cutForElectron = defaultCutValue;
0064 cutForPositron = defaultCutValue;
0065
0066 G4double lowLimit = 250. * eV;
0067 G4double highLimit = 100. * GeV;
0068 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowLimit, highLimit);
0069
0070
0071
0072 SetCutValue(cutForGamma, "gamma");
0073 SetCutValue(cutForElectron, "e-");
0074 SetCutValue(cutForPositron, "e+");
0075
0076 DumpCutValuesTable();
0077
0078 helIsRegisted = false;
0079 bicIsRegisted = false;
0080 biciIsRegisted = false;
0081 locIonIonInelasticIsRegistered = false;
0082 radioactiveDecayIsRegisted = false;
0083
0084 pMessenger = new PhysicsListMessenger(this);
0085
0086 SetVerboseLevel(1);
0087
0088
0089 emPhysicsList = new G4EmStandardPhysics_option3(1);
0090 emName = G4String("emstandard_opt3");
0091
0092
0093 decPhysicsList = new G4DecayPhysics();
0094 }
0095
0096
0097 PhysicsList::~PhysicsList()
0098 {
0099 delete pMessenger;
0100 delete emPhysicsList;
0101 delete decPhysicsList;
0102 for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
0103 }
0104
0105
0106 void PhysicsList::AddPackage(const G4String& name)
0107 {
0108 G4PhysListFactory factory;
0109 G4VModularPhysicsList* phys =factory.GetReferencePhysList(name);
0110 G4int i=0;
0111 const G4VPhysicsConstructor* elem= phys->GetPhysics(i);
0112 G4VPhysicsConstructor* tmp = const_cast<G4VPhysicsConstructor*> (elem);
0113 while (elem !=0)
0114 {
0115 RegisterPhysics(tmp);
0116 elem= phys->GetPhysics(++i) ;
0117 tmp = const_cast<G4VPhysicsConstructor*> (elem);
0118 }
0119 }
0120
0121
0122 void PhysicsList::ConstructParticle()
0123 {
0124 decPhysicsList->ConstructParticle();
0125 }
0126
0127
0128 void PhysicsList::ConstructProcess()
0129 {
0130
0131
0132 AddTransportation();
0133
0134
0135
0136 emPhysicsList->ConstructProcess();
0137 em_config.AddModels();
0138
0139
0140
0141 decPhysicsList->ConstructProcess();
0142
0143
0144 for(size_t i=0; i<hadronPhys.size(); i++) {
0145 hadronPhys[i]->ConstructProcess();
0146 }
0147
0148
0149
0150
0151
0152 }
0153
0154
0155 void PhysicsList::AddPhysicsList(const G4String& name)
0156 {
0157
0158 if (verboseLevel>1) {
0159 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0160 }
0161 if (name == emName) return;
0162
0163
0164
0165
0166
0167 if (name == "standard_opt3") {
0168 emName = name;
0169 delete emPhysicsList;
0170 emPhysicsList = new G4EmStandardPhysics_option3();
0171 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
0172
0173 } else if (name == "LowE_Livermore") {
0174 emName = name;
0175 delete emPhysicsList;
0176 emPhysicsList = new G4EmLivermorePhysics();
0177 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
0178
0179 } else if (name == "LowE_Penelope") {
0180 emName = name;
0181 delete emPhysicsList;
0182 emPhysicsList = new G4EmPenelopePhysics();
0183 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
0184
0185
0186
0187
0188 } else if (name == "elastic" && !helIsRegisted) {
0189 G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()" << G4endl;
0190 hadronPhys.push_back( new G4HadronElasticPhysics());
0191 helIsRegisted = true;
0192
0193 } else if (name == "DElastic" && !helIsRegisted) {
0194 hadronPhys.push_back( new G4HadronDElasticPhysics());
0195 helIsRegisted = true;
0196
0197 } else if (name == "HPElastic" && !helIsRegisted) {
0198 hadronPhys.push_back( new G4HadronElasticPhysicsHP());
0199 helIsRegisted = true;
0200
0201 } else if (name == "binary" && !bicIsRegisted) {
0202 hadronPhys.push_back(new G4HadronPhysicsQGSP_BIC_HP());
0203 bicIsRegisted = true;
0204 G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: HadronPhysicsQGSP_BIC_HP()" << G4endl;
0205
0206 } else if (name == "binary_ion" && !biciIsRegisted) {
0207 hadronPhys.push_back(new G4IonBinaryCascadePhysics());
0208 biciIsRegisted = true;
0209 G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4IonBinaryCascadePhysics()" << G4endl;
0210 } else if (name == "radioactive_decay" && !radioactiveDecayIsRegisted ) {
0211 hadronPhys.push_back(new G4RadioactiveDecayPhysics());
0212 radioactiveDecayIsRegisted = true;
0213 G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4RadioactiveDecayPhysics()" << G4endl;
0214 } else {
0215
0216 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0217 << " is not defined"
0218 << G4endl;
0219 }
0220 }
0221
0222
0223 void PhysicsList::AddStepMax()
0224 {
0225
0226
0227 auto particleIterator=GetParticleIterator();
0228 particleIterator->reset();
0229
0230 while ((*particleIterator)())
0231 {
0232 G4ParticleDefinition* particle = particleIterator->value();
0233 G4ProcessManager* pmanager = particle->GetProcessManager();
0234 pmanager -> AddProcess(new G4StepLimiter(), -1,-1,3);
0235 }
0236
0237 }
0238
0239 void PhysicsList::SetCutForGamma(G4double cut)
0240 {
0241 cutForGamma = cut;
0242 SetParticleCuts(cutForGamma, G4Gamma::Gamma());
0243 }
0244
0245 void PhysicsList::SetCutForElectron(G4double cut)
0246 {
0247 cutForElectron = cut;
0248 SetParticleCuts(cutForElectron, G4Electron::Electron());
0249 }
0250
0251 void PhysicsList::SetCutForPositron(G4double cut)
0252 {
0253 cutForPositron = cut;
0254 SetParticleCuts(cutForPositron, G4Positron::Positron());
0255 }
0256