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3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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 //
 26 //
 27 //---------------------------------------------------------------------------
 28 //
 29 // ClassName:    G4URRNeutrons
 30 //
 31 // Author:       Alberto Ribon - October 2024  
 32 //
 33 // Description:  Physics list constructor that can be applied on top of any
 34 //               _HP or _HPT based physics list.
 35 //               This class enables the special Unresolved Resonance Region
 36 //               (URR) treatment of low-energy neutrons based on Particle
 37 //               Table (PT).
 38 //               If this constructor is applied on top of a non-HP based
 39 //               physics list, then nothing is done (i.e. the physics list
 40 //               remains as it was originally, and a warning is printed out).
 41 //
 42 // Modified:
 43 //
 44 //----------------------------------------------------------------------------
 45 //
 46 
 47 #include "G4URRNeutrons.hh"
 48 #include "G4ParticleDefinition.hh"
 49 #include "G4ProcessManager.hh"
 50 #include "G4HadronicProcess.hh"
 51 #include "G4HadronicParameters.hh"
 52 #include "G4ParticleHPElasticDataPT.hh"
 53 #include "G4ParticleHPElasticURR.hh"
 54 #include "G4ParticleHPCaptureDataPT.hh"
 55 #include "G4ParticleHPCaptureURR.hh"
 56 #include "G4ParticleHPFissionURR.hh"
 57 #include "G4ParticleHPFissionDataPT.hh"
 58 #include "G4ParticleHPInelasticDataPT.hh"
 59 #include "G4ParticleHPInelasticURR.hh"
 60 #include "G4BuilderType.hh"
 61 #include "G4PhysListUtil.hh"
 62 #include "G4SystemOfUnits.hh"
 63 
 64 #include "G4PhysicsConstructorFactory.hh"
 65 G4_DECLARE_PHYSCONSTR_FACTORY( G4URRNeutrons );
 66 
 67 
 68 G4URRNeutrons::G4URRNeutrons( G4int ver ) : G4VHadronPhysics( "URRNeutrons", ver ) {}
 69 
 70 
 71 G4URRNeutrons::~G4URRNeutrons() {}
 72 
 73 
 74 void G4URRNeutrons::ConstructProcess() {
 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   
 82   if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 1 ) {
 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 }
223