Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NeutronHPphysics.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 // $Id: NeutronHPphysics.cc 66587 2012-12-21 11:06:44Z ihrivnac $
30 //
31 
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "NeutronHPphysics.hh"
35 
36 #include "NeutronHPMessenger.hh"
37 
38 #include "G4ParticleDefinition.hh"
39 #include "G4ProcessManager.hh"
40 #include "G4ProcessTable.hh"
41 
42 // Processes
43 
47 #include "G4ParticleHPElastic.hh"
49 
52 #include "G4ParticleHPInelastic.hh"
53 
56 #include "G4ParticleHPCapture.hh"
57 
60 #include "G4ParticleHPFission.hh"
61 
62 #include "G4SystemOfUnits.hh"
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
67 : G4VPhysicsConstructor(name), fThermal(true), fNeutronMessenger(0)
68 {
69  fNeutronMessenger = new NeutronHPMessenger(this);
70 }
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
75 {
76  delete fNeutronMessenger;
77 }
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
82 {
84  G4ProcessManager* pManager = neutron->GetProcessManager();
85 
86  // delete all neutron processes if already registered
87  //
89  G4VProcess* process = 0;
90  process = processTable->FindProcess("hadElastic", neutron);
91  if (process) pManager->RemoveProcess(process);
92  //
93  process = processTable->FindProcess("neutronInelastic", neutron);
94  if (process) pManager->RemoveProcess(process);
95  //
96  process = processTable->FindProcess("nCapture", neutron);
97  if (process) pManager->RemoveProcess(process);
98  //
99  process = processTable->FindProcess("nFission", neutron);
100  if (process) pManager->RemoveProcess(process);
101 
102  // (re) create process: elastic
103  //
105  pManager->AddDiscreteProcess(process1);
106  //
107  // model1a
108  G4ParticleHPElastic* model1a = new G4ParticleHPElastic();
109  process1->RegisterMe(model1a);
110  process1->AddDataSet(new G4ParticleHPElasticData());
111  //
112  // model1b
113  if (fThermal) {
114  model1a->SetMinEnergy(4*eV);
116  process1->RegisterMe(model1b);
118  }
119 
120  // (re) create process: inelastic
121  //
123  pManager->AddDiscreteProcess(process2);
124  //
125  // cross section data set
127  process2->AddDataSet(dataSet2);
128  //
129  // models
131  process2->RegisterMe(model2);
132 
133  // (re) create process: nCapture
134  //
136  pManager->AddDiscreteProcess(process3);
137  //
138  // cross section data set
140  process3->AddDataSet(dataSet3);
141  //
142  // models
144  process3->RegisterMe(model3);
145 
146  // (re) create process: nFission
147  //
149  pManager->AddDiscreteProcess(process4);
150  //
151  // cross section data set
153  process4->AddDataSet(dataSet4);
154  //
155  // models
157  process4->RegisterMe(model4);
158 }
159 
160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const XML_Char * name
Definition: expat.h:151
NeutronHPphysics(const G4String &name="neutron")
virtual void ConstructProcess()
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
void RegisterMe(G4HadronicInteraction *a)
void SetMinEnergy(G4double anEnergy)
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
static constexpr double eV
Definition: G4SIunits.hh:215
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4ProcessManager * GetProcessManager() const
Definition of the NeutronHPphysics class.
G4VProcess * RemoveProcess(G4VProcess *aProcess)
static G4ProcessTable * GetProcessTable()
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const