File indexing completed on 2025-04-04 08:05:14
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 #include "NeutronHPphysics.hh"
0033
0034 #include "G4GenericMessenger.hh"
0035 #include "G4ParticleDefinition.hh"
0036 #include "G4ProcessManager.hh"
0037 #include "G4ProcessTable.hh"
0038
0039
0040
0041 #include "G4HadronElasticProcess.hh"
0042 #include "G4HadronInelasticProcess.hh"
0043 #include "G4NeutronCaptureProcess.hh"
0044 #include "G4NeutronFissionProcess.hh"
0045 #include "G4ParticleHPCapture.hh"
0046 #include "G4ParticleHPCaptureData.hh"
0047 #include "G4ParticleHPElastic.hh"
0048 #include "G4ParticleHPElasticData.hh"
0049 #include "G4ParticleHPFission.hh"
0050 #include "G4ParticleHPFissionData.hh"
0051 #include "G4ParticleHPInelastic.hh"
0052 #include "G4ParticleHPInelasticData.hh"
0053 #include "G4ParticleHPThermalScattering.hh"
0054 #include "G4ParticleHPThermalScatteringData.hh"
0055 #include "G4SystemOfUnits.hh"
0056
0057
0058
0059 NeutronHPphysics::NeutronHPphysics(const G4String& name) : G4VPhysicsConstructor(name)
0060 {
0061
0062 DefineCommands();
0063 }
0064
0065
0066
0067 NeutronHPphysics::~NeutronHPphysics()
0068 {
0069 delete fMessenger;
0070 }
0071
0072
0073
0074 void NeutronHPphysics::ConstructProcess()
0075 {
0076 G4ParticleDefinition* neutron = G4Neutron::Neutron();
0077 G4ProcessManager* pManager = neutron->GetProcessManager();
0078
0079
0080
0081 G4VProcess* process = 0;
0082 process = pManager->GetProcess("hadElastic");
0083 if (process) pManager->RemoveProcess(process);
0084
0085 process = pManager->GetProcess("neutronInelastic");
0086 if (process) pManager->RemoveProcess(process);
0087
0088 process = pManager->GetProcess("nCapture");
0089 if (process) pManager->RemoveProcess(process);
0090
0091 process = pManager->GetProcess("nFission");
0092 if (process) pManager->RemoveProcess(process);
0093
0094
0095
0096 G4HadronElasticProcess* process1 = new G4HadronElasticProcess();
0097 pManager->AddDiscreteProcess(process1);
0098
0099
0100 G4ParticleHPElastic* model1a = new G4ParticleHPElastic();
0101 process1->RegisterMe(model1a);
0102 process1->AddDataSet(new G4ParticleHPElasticData());
0103
0104
0105 if (fThermal) {
0106 model1a->SetMinEnergy(4 * eV);
0107 G4ParticleHPThermalScattering* model1b = new G4ParticleHPThermalScattering();
0108 process1->RegisterMe(model1b);
0109 process1->AddDataSet(new G4ParticleHPThermalScatteringData());
0110 }
0111
0112
0113
0114 G4HadronInelasticProcess* process2 =
0115 new G4HadronInelasticProcess("neutronInelastic", G4Neutron::Definition());
0116 pManager->AddDiscreteProcess(process2);
0117
0118
0119 G4ParticleHPInelasticData* dataSet2 = new G4ParticleHPInelasticData();
0120 process2->AddDataSet(dataSet2);
0121
0122
0123 G4ParticleHPInelastic* model2 = new G4ParticleHPInelastic();
0124 process2->RegisterMe(model2);
0125
0126
0127
0128 G4NeutronCaptureProcess* process3 = new G4NeutronCaptureProcess();
0129 pManager->AddDiscreteProcess(process3);
0130
0131
0132 G4ParticleHPCaptureData* dataSet3 = new G4ParticleHPCaptureData();
0133 process3->AddDataSet(dataSet3);
0134
0135
0136 G4ParticleHPCapture* model3 = new G4ParticleHPCapture();
0137 process3->RegisterMe(model3);
0138
0139
0140
0141 G4NeutronFissionProcess* process4 = new G4NeutronFissionProcess();
0142 pManager->AddDiscreteProcess(process4);
0143
0144
0145 G4ParticleHPFissionData* dataSet4 = new G4ParticleHPFissionData();
0146 process4->AddDataSet(dataSet4);
0147
0148
0149 G4ParticleHPFission* model4 = new G4ParticleHPFission();
0150 process4->RegisterMe(model4);
0151 }
0152
0153
0154
0155 void NeutronHPphysics::DefineCommands()
0156 {
0157
0158 fMessenger = new G4GenericMessenger(this, "/testhadr/phys/", "physics list commands");
0159
0160
0161 auto& thermalCmd = fMessenger->DeclareProperty("thermalScattering", fThermal);
0162
0163 thermalCmd.SetGuidance("set thermal scattering model");
0164 thermalCmd.SetParameterName("thermal", false);
0165 thermalCmd.SetStates(G4State_PreInit);
0166 }
0167
0168