NeutronHPphysics.cc
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////
2 /// \file NeutronHPphysics.cc
3 /// \brief High precision neutron physics constructor for Geant4
4 /// \details Adapted from the Geant4 example Hadr04
5 //////////////////////////////////////////////////////////////////////////////
6 
7 #include "NeutronHPphysics.hh"
8 
9 #include "Geant4/G4ParticleDefinition.hh"
10 #include "Geant4/G4ProcessManager.hh"
11 #include "Geant4/G4ProcessTable.hh"
12 
13 // Processes
14 #include "Geant4/G4HadronElasticProcess.hh"
15 #include "Geant4/G4ParticleHPElastic.hh"
16 #include "Geant4/G4ParticleHPElasticData.hh"
17 #include "Geant4/G4ParticleHPThermalScattering.hh"
18 #include "Geant4/G4ParticleHPThermalScatteringData.hh"
19 
20 #include "Geant4/G4NeutronInelasticProcess.hh"
21 #include "Geant4/G4ParticleHPInelastic.hh"
22 #include "Geant4/G4ParticleHPInelasticData.hh"
23 
24 #include "Geant4/G4HadronCaptureProcess.hh"
25 #include "Geant4/G4ParticleHPCapture.hh"
26 #include "Geant4/G4ParticleHPCaptureData.hh"
27 
28 #include "Geant4/G4HadronFissionProcess.hh"
29 #include "Geant4/G4ParticleHPFission.hh"
30 #include "Geant4/G4ParticleHPFissionData.hh"
31 
32 #include "Geant4/G4SystemOfUnits.hh"
33 
34 // Thermal neutron physics is enabled by default
35 // (important for low-energy neutron interactions!)
37  : G4VPhysicsConstructor(name), fThermal(true)
38 {}
39 
40 void
42 {
43  G4ParticleDefinition* neutron = G4Neutron::Neutron();
44  G4ProcessManager* pManager = neutron->GetProcessManager();
45 
46  // delete all neutron processes if already registered
47  G4ProcessTable* processTable = G4ProcessTable::GetProcessTable();
48  G4VProcess* process = 0;
49  process = processTable->FindProcess("hadElastic", neutron);
50  if (process) pManager->RemoveProcess(process);
51  //
52  process = processTable->FindProcess("neutronInelastic", neutron);
53  if (process) pManager->RemoveProcess(process);
54  //
55  process = processTable->FindProcess("nCapture", neutron);
56  if (process) pManager->RemoveProcess(process);
57  //
58  process = processTable->FindProcess("nFission", neutron);
59  if (process) pManager->RemoveProcess(process);
60 
61  // (re) create process: elastic
62  //
63  G4HadronElasticProcess* process1 = new G4HadronElasticProcess();
64  pManager->AddDiscreteProcess(process1);
65  //
66  // model1a
67  G4ParticleHPElastic* model1a = new G4ParticleHPElastic();
68  process1->RegisterMe(model1a);
69  process1->AddDataSet(new G4ParticleHPElasticData());
70  //
71  // model1b
72  if (fThermal) {
73  model1a->SetMinEnergy(4 * eV);
74  G4ParticleHPThermalScattering* model1b = new G4ParticleHPThermalScattering();
75  process1->RegisterMe(model1b);
76  process1->AddDataSet(new G4ParticleHPThermalScatteringData());
77  }
78 
79  // (re) create process: inelastic
80  //
81  G4NeutronInelasticProcess* process2 = new G4NeutronInelasticProcess();
82  pManager->AddDiscreteProcess(process2);
83  //
84  // cross section data set
85  G4ParticleHPInelasticData* dataSet2 = new G4ParticleHPInelasticData();
86  process2->AddDataSet(dataSet2);
87  //
88  // models
89  G4ParticleHPInelastic* model2 = new G4ParticleHPInelastic();
90  process2->RegisterMe(model2);
91 
92  // (re) create process: nCapture
93  //
94  G4HadronCaptureProcess* process3 = new G4HadronCaptureProcess();
95  pManager->AddDiscreteProcess(process3);
96  //
97  // cross section data set
98  G4ParticleHPCaptureData* dataSet3 = new G4ParticleHPCaptureData();
99  process3->AddDataSet(dataSet3);
100  //
101  // models
102  G4ParticleHPCapture* model3 = new G4ParticleHPCapture();
103  process3->RegisterMe(model3);
104 
105  // (re) create process: nFission
106  //
107  G4HadronFissionProcess* process4 = new G4HadronFissionProcess();
108  pManager->AddDiscreteProcess(process4);
109  //
110  // cross section data set
111  G4ParticleHPFissionData* dataSet4 = new G4ParticleHPFissionData();
112  process4->AddDataSet(dataSet4);
113  //
114  // models
115  G4ParticleHPFission* model4 = new G4ParticleHPFission();
116  process4->RegisterMe(model4);
117 }
static QCString name
Definition: declinfo.cpp:673
std::unordered_map< int, std::unordered_map< int, std::string > > & processTable()
Definition: ProcessTable.hh:21
def process(f, kind)
Definition: search.py:254
static constexpr double eV
Definition: Units.h:127
void ConstructProcess() override
High precision neutron physics constructor for Geant4.
NeutronHPphysics(const G4String &name="neutron")