Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4URRNeutrons Class Reference

#include <G4URRNeutrons.hh>

Inheritance diagram for G4URRNeutrons:

Public Member Functions

 G4URRNeutrons (G4int ver=1)
virtual ~G4URRNeutrons ()
void ConstructProcess () override
Public Member Functions inherited from G4VHadronPhysics
 G4VHadronPhysics (const G4String &name="hInelastic", G4int verbose=0)
virtual ~G4VHadronPhysics ()
void ConstructParticle () override
G4HadronicInteractionBuildModel (G4VHadronModelBuilder *, G4double emin, G4double emax)
G4HadronicInteractionNewModel (G4HadronicInteraction *, G4double emin, G4double emax)
 G4VHadronPhysics (G4VHadronPhysics &)=delete
G4VHadronPhysicsoperator= (const G4VHadronPhysics &right)=delete
Public Member Functions inherited from G4VPhysicsConstructor
 G4VPhysicsConstructor (const G4String &="")
 G4VPhysicsConstructor (const G4String &name, G4int physics_type)
virtual ~G4VPhysicsConstructor ()
void SetPhysicsName (const G4String &="")
const G4StringGetPhysicsName () const
void SetPhysicsType (G4int)
G4int GetPhysicsType () const
G4int GetInstanceID () const
virtual void TerminateWorker ()
void SetVerboseLevel (G4int value)
G4int GetVerboseLevel () const

Additional Inherited Members

Static Public Member Functions inherited from G4VPhysicsConstructor
static const G4VPCManagerGetSubInstanceManager ()
Protected Types inherited from G4VPhysicsConstructor
using PhysicsBuilder_V = G4VPCData::PhysicsBuilders_V
Protected Member Functions inherited from G4VPhysicsConstructor
G4bool RegisterProcess (G4VProcess *process, G4ParticleDefinition *particle)
G4ParticleTable::G4PTblDicIteratorGetParticleIterator () const
PhysicsBuilder_V GetBuilders () const
void AddBuilder (G4PhysicsBuilderInterface *bld)
Protected Attributes inherited from G4VPhysicsConstructor
G4int verboseLevel = 0
G4String namePhysics = ""
G4int typePhysics = 0
G4ParticleTabletheParticleTable = nullptr
G4int g4vpcInstanceID = 0
Static Protected Attributes inherited from G4VPhysicsConstructor
static G4RUN_DLL G4VPCManager subInstanceManager

Detailed Description

Definition at line 55 of file G4URRNeutrons.hh.

Constructor & Destructor Documentation

◆ G4URRNeutrons()

G4URRNeutrons::G4URRNeutrons ( G4int ver = 1)
explicit

Definition at line 68 of file G4URRNeutrons.cc.

68: G4VHadronPhysics( "URRNeutrons", ver ) {}
G4VHadronPhysics(const G4String &name="hInelastic", G4int verbose=0)

◆ ~G4URRNeutrons()

G4URRNeutrons::~G4URRNeutrons ( )
virtual

Definition at line 71 of file G4URRNeutrons.cc.

71{}

Member Function Documentation

◆ ConstructProcess()

void G4URRNeutrons::ConstructProcess ( )
overridevirtual

Implements G4VPhysicsConstructor.

Definition at line 74 of file G4URRNeutrons.cc.

74 {
75 // Find elastic, capture, fission and inelastic processes of neutron
76 // (from the physics list on which this constructor is applied on top);
77 // then look at their hadronic final-state models in order to disable those that
78 // would otherwise fully overlap with the URR hadronic final-state models.
79 // Note that for disabling a hadronic model - not being defined the "DeRegister"
80 // method - it is enough to set to 0.0 the max energy of the model.
81
83 G4cout << "### " << GetPhysicsName() << " Construct Processes " << G4endl;
84 }
85 G4Neutron* part = G4Neutron::Neutron();
86
87 // Elastic (including, eventually, thermal scattering)
88 G4HadronicProcess* elasticProcess = G4PhysListUtil::FindElasticProcess( part );
89 if ( elasticProcess == nullptr ) {
90 G4cout << "### " << GetPhysicsName() << " WARNING: Fail to add URR neutron elastic treatment: "
91 << "NOT found elastic process => G4URRNeutrons returns without doing anything !" << G4endl;
92 return;
93 }
94 G4int niElastic = static_cast< G4int >( (elasticProcess->GetHadronicInteractionList()).size() );
95 if ( niElastic < 1 ) {
96 G4cout << "### " << GetPhysicsName() << " WARNING: Fail to add URR neutron elastic treatment: "
97 << "NOT found any elastic model => G4URRNeutrons returns without doing anything !" << G4endl;
98 return;
99 }
100 G4int indexHPelastic = -1;
101 G4int indexHPthermalScattering = -1;
102 for ( G4int index = 0; index < niElastic; ++index ) {
103 if ( (elasticProcess->GetHadronicInteractionList())[index]->GetModelName() == "NeutronHPElastic" ) {
104 indexHPelastic = index;
105 } else if ( (elasticProcess->GetHadronicInteractionList())[index]->GetModelName() == "NeutronHPThermalScattering" ) {
106 indexHPthermalScattering = index;
107 }
108 }
109 if ( indexHPelastic >= 0 ) {
110 (elasticProcess->GetHadronicInteractionList())[indexHPelastic]->SetMaxEnergy( 0.0 ); // Disabled
111 G4cout << G4endl << " G4URRNeutrons::ConstructProcess() : found NeutronHPElastic => Disabled !" << G4endl;
112 } else {
113 G4cout << "### " << GetPhysicsName()
114 << " WARNING: NOT found NeutronHPElastic => G4URRNeutrons returns without doing anything !" << G4endl;
115 return;
116 }
117 G4bool isThermalScatteringOn = false;
118 if ( indexHPthermalScattering > 0 ) isThermalScatteringOn = true;
119 elasticProcess->AddDataSet( new G4ParticleHPElasticDataPT );
120 elasticProcess->RegisterMe( new G4ParticleHPElasticURR( isThermalScatteringOn ) );
121
122 // Capture
123 G4HadronicProcess* captureProcess = G4PhysListUtil::FindCaptureProcess( part );
124 if ( captureProcess == nullptr ) {
125 G4cout << "### " << GetPhysicsName() << " WARNING: Fail to add URR neutron capture treatment: "
126 << "NOT found capture process => G4URRNeutrons returns without doing anything !" << G4endl;
127 return;
128 }
129 G4int niCapture = static_cast< G4int >( (captureProcess->GetHadronicInteractionList()).size() );
130 if ( niCapture < 1 ) {
131 G4cout << "### " << GetPhysicsName() << " WARNING: Fail to add URR neutron capture treatment: "
132 << "NOT found any capture model => G4URRNeutrons returns without doing anything !" << G4endl;
133 return;
134 }
135 G4int indexHPcapture = -1;
136 for ( G4int index = 0; index < niCapture; ++index ) {
137 // For QGSP_BERT_HP, since G4 11.2, the neutron capture model is called either "nRadCaptureHP"
138 // or "nuDEX_neutronCapture" (the latter when NuDEX is used).
139 G4String nameNeutronCaptureModel = (captureProcess->GetHadronicInteractionList())[index]->GetModelName();
140 if ( nameNeutronCaptureModel == "NeutronHPCapture" ||
141 nameNeutronCaptureModel == "nRadCaptureHP" ||
142 nameNeutronCaptureModel == "nuDEX_neutronCapture" ) {
143 indexHPcapture = index;
144 }
145 }
146 if ( indexHPcapture >= 0 ) {
147 (captureProcess->GetHadronicInteractionList())[indexHPcapture]->SetMaxEnergy( 0.0 ); // Disabled
148 G4cout << G4endl << " G4URRNeutrons::ConstructProcess() : found "
149 << (captureProcess->GetHadronicInteractionList())[indexHPcapture]->GetModelName()
150 << " => Disabled !" << G4endl;
151 } else {
152 G4cout << "### " << GetPhysicsName()
153 << " WARNING: NOT found any expected neutron capture model => G4URRNeutrons returns without doing anything !" << G4endl;
154 return;
155 }
156 captureProcess->AddDataSet( new G4ParticleHPCaptureDataPT );
157 captureProcess->RegisterMe( new G4ParticleHPCaptureURR );
158
159 // Fission
160 G4HadronicProcess* fissionProcess = G4PhysListUtil::FindFissionProcess( part );
161 if ( fissionProcess == nullptr ) {
162 G4cout << "### " << GetPhysicsName() << " WARNING: Fail to add URR neutron fission treatment: "
163 << "NOT found fission process => G4URRNeutrons returns without doing anything !" << G4endl;
164 return;
165 }
166 G4int niFission = static_cast< G4int >( (fissionProcess->GetHadronicInteractionList()).size() );
167 if ( niFission < 1 ) {
168 G4cout << "### " << GetPhysicsName() << " WARNING: Fail to add URR neutron fission treatment: "
169 << "NOT found any fission model => G4URRNeutrons returns without doing anything !" << G4endl;
170 return;
171 }
172 G4int indexHPfission = -1;
173 for ( G4int index = 0; index < niFission; ++index ) {
174 // For QGSP_BERT_HP, since G4 11.2, the neutron fission model is called "nFissionVI"
175 G4String nameNeutronFissionModel = (fissionProcess->GetHadronicInteractionList())[index]->GetModelName();
176 if ( nameNeutronFissionModel == "NeutronHPFission" || nameNeutronFissionModel == "nFissionVI" ) {
177 indexHPfission = index;
178 }
179 }
180 if ( indexHPfission >= 0 ) {
181 (fissionProcess->GetHadronicInteractionList())[indexHPfission]->SetMaxEnergy( 0.0 ); // Disabled
182 G4cout << G4endl << " G4URRNeutrons::ConstructProcess() : found "
183 << (fissionProcess->GetHadronicInteractionList())[indexHPfission]->GetModelName() // Disabled
184 << " => Disabled !" << G4endl;
185 } else {
186 G4cout << "### " << GetPhysicsName()
187 << " WARNING: NOT found any expected neutron fission model => G4URRNeutrons returns without doing anything !" << G4endl;
188 return;
189 }
190 fissionProcess->RegisterMe( new G4ParticleHPFissionURR );
191 fissionProcess->AddDataSet( new G4ParticleHPFissionDataPT );
192
193 // Inelastic
194 G4HadronicProcess* inelasticProcess = G4PhysListUtil::FindInelasticProcess( part );
195 if ( inelasticProcess == nullptr ) {
196 G4cout << "### " << GetPhysicsName() << " WARNING: Fail to add URR neutron inelastic treatment: "
197 << "NOT found inelastic process => G4URRNeutrons returns without doing anything !" << G4endl;
198 return;
199 }
200 G4int niInelastic = static_cast< G4int >( (inelasticProcess->GetHadronicInteractionList()).size() );
201 if ( niInelastic < 1 ) {
202 G4cout << "### " << GetPhysicsName() << " WARNING: Fail to add URR neutron inelastic treatment: "
203 << "NOT found any inelastic model => G4URRNeutrons returns without doing anything !" << G4endl;
204 return;
205 }
206 G4int indexHPinelastic = -1;
207 for ( G4int index = 0; index < niInelastic; ++index ) {
208 if ( (inelasticProcess->GetHadronicInteractionList())[index]->GetModelName() == "NeutronHPInelastic" ) {
209 indexHPinelastic = index;
210 }
211 }
212 if ( indexHPinelastic >= 0 ) {
213 (inelasticProcess->GetHadronicInteractionList())[indexHPinelastic]->SetMaxEnergy( 0.0 ); // Disabled
214 G4cout << G4endl << " G4URRNeutrons::ConstructProcess() : found NeutronHPInelastic => Disabled !" << G4endl;
215 } else {
216 G4cout << "### " << GetPhysicsName()
217 << " WARNING: NOT found NeutronHPInelastic => G4URRNeutrons returns without doing anything !" << G4endl;
218 return;
219 }
220 inelasticProcess->AddDataSet( new G4ParticleHPInelasticDataPT );
221 inelasticProcess->RegisterMe( new G4ParticleHPInelasticURR );
222}
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4HadronicParameters * Instance()
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
std::vector< G4HadronicInteraction * > & GetHadronicInteractionList()
void RegisterMe(G4HadronicInteraction *a)
static G4Neutron * Neutron()
Definition G4Neutron.cc:101
static G4HadronicProcess * FindElasticProcess(const G4ParticleDefinition *)
static G4HadronicProcess * FindInelasticProcess(const G4ParticleDefinition *)
static G4HadronicProcess * FindCaptureProcess(const G4ParticleDefinition *)
static G4HadronicProcess * FindFissionProcess(const G4ParticleDefinition *)
const G4String & GetPhysicsName() const

The documentation for this class was generated from the following files: