Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutronHPInelasticVI.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//
26// Geant4 class : G4NeutronHPInelasticVI
27// Created: 15 October 2023
28//
29// Author V.Ivanchenko
30//
31
33
36
74
75#include "G4Neutron.hh"
76#include "G4Nucleus.hh"
77#include "G4Element.hh"
78#include "G4SystemOfUnits.hh"
79#include "G4AutoLock.hh"
80
81G4bool G4NeutronHPInelasticVI::fLock = false;
82G4ParticleHPChannelList* G4NeutronHPInelasticVI::theChannels[] = {nullptr};
83
84namespace
85{
86 G4Mutex theHPInelastic = G4MUTEX_INITIALIZER;
87}
88
90 : G4HadronicInteraction("NeutronHPInelastic")
91{
92 SetMaxEnergy(20*CLHEP::MeV);
94 if ( !fLock ) {
95 fLock = true;
96 fInitializer = true;
97 for ( G4int i=0; i<ZMAXHPI; ++i ) {
98 theChannels[i] = nullptr;
99 }
100 }
101}
102
104{
105 if ( fInitializer ) {
106 for ( G4int i=0; i<ZMAXHPI; ++i ) {
107 delete theChannels[i];
108 }
109 }
110}
111
113 G4Nucleus& aNucleus)
114{
115 G4HadFinalState* finalState = nullptr;
116 G4int Z = aNucleus.GetZ_asInt();
117 if ( Z >= ZMAXHPI || Z < 1 ) { return finalState; }
118
119 G4int A = aNucleus.GetA_asInt();
120 fManagerHP->OpenReactionWhiteBoard();
121 fManagerHP->GetReactionWhiteBoard()->SetTargZ(Z);
122 fManagerHP->GetReactionWhiteBoard()->SetTargA(A);
123
124 G4ParticleHPChannelList* clist = theChannels[Z];
125 if ( nullptr == clist ) {
126 InitialiseOnFly();
127 if ( nullptr == clist ) { return finalState; }
128 }
129
130 for (auto const & elm : *(G4Element::GetElementTable())) {
131 if ( Z == elm->GetZasInt() ) {
132 finalState = clist->ApplyYourself(elm, aTrack);
133 break;
134 }
135 }
136
138 return finalState;
139}
140
141const std::pair<G4double, G4double> G4NeutronHPInelasticVI::GetFatalEnergyCheckLevels() const
142{
143 // max energy non-conservation is mass of heavy nucleus
144 return std::pair<G4double, G4double>(10.0 * perCent, 350.0 * CLHEP::GeV);
145}
146
148{
149 if ( fInitializer ) {
150 Initialise();
151 fManagerHP->DumpSetting();
152 }
153}
154
155void G4NeutronHPInelasticVI::InitialiseOnFly()
156{
157 G4AutoLock l(&theHPInelastic);
158 Initialise();
159 l.unlock();
160}
161
162void G4NeutronHPInelasticVI::Initialise()
163{
164 G4String dirName;
165 G4ParticleDefinition* part = nullptr;
166
167 for (auto const & elm : *(G4Element::GetElementTable())) {
168 G4int Z = elm->GetZasInt();
169 if ( 0 < Z && Z < ZMAXHPI && nullptr == theChannels[Z] ) {
170 if ( nullptr == part ) {
171 part = G4Neutron::Neutron();
172 dirName = fManagerHP->GetNeutronHPPath() + "/Inelastic";
173 }
174 auto clist = new G4ParticleHPChannelList(36, part);
175 theChannels[Z] = clist;
176 clist->Init(elm, dirName, part);
177 clist->Register(new G4ParticleHPNInelasticFS, "F01/"); // has
178 clist->Register(new G4ParticleHPNXInelasticFS, "F02/");
179 clist->Register(new G4ParticleHP2NDInelasticFS, "F03/");
180 clist->Register(new G4ParticleHP2NInelasticFS, "F04/"); // has, E Done
181 clist->Register(new G4ParticleHP3NInelasticFS, "F05/"); // has, E Done
182 clist->Register(new G4ParticleHPNAInelasticFS, "F06/");
183 clist->Register(new G4ParticleHPN3AInelasticFS, "F07/");
184 clist->Register(new G4ParticleHP2NAInelasticFS, "F08/");
185 clist->Register(new G4ParticleHP3NAInelasticFS, "F09/");
186 clist->Register(new G4ParticleHPNPInelasticFS, "F10/");
187 clist->Register(new G4ParticleHPN2AInelasticFS, "F11/");
188 clist->Register(new G4ParticleHP2N2AInelasticFS, "F12/");
189 clist->Register(new G4ParticleHPNDInelasticFS, "F13/");
190 clist->Register(new G4ParticleHPNTInelasticFS, "F14/");
191 clist->Register(new G4ParticleHPNHe3InelasticFS, "F15/");
192 clist->Register(new G4ParticleHPND2AInelasticFS, "F16/");
193 clist->Register(new G4ParticleHPNT2AInelasticFS, "F17/");
194 clist->Register(new G4ParticleHP4NInelasticFS, "F18/"); // has, E Done
195 clist->Register(new G4ParticleHP2NPInelasticFS, "F19/");
196 clist->Register(new G4ParticleHP3NPInelasticFS, "F20/");
197 clist->Register(new G4ParticleHPN2PInelasticFS, "F21/");
198 clist->Register(new G4ParticleHPNPAInelasticFS, "F22/");
199 clist->Register(new G4ParticleHPPInelasticFS, "F23/");
200 clist->Register(new G4ParticleHPDInelasticFS, "F24/");
201 clist->Register(new G4ParticleHPTInelasticFS, "F25/");
202 clist->Register(new G4ParticleHPHe3InelasticFS, "F26/");
203 clist->Register(new G4ParticleHPAInelasticFS, "F27/");
204 clist->Register(new G4ParticleHP2AInelasticFS, "F28/");
205 clist->Register(new G4ParticleHP3AInelasticFS, "F29/");
206 clist->Register(new G4ParticleHP2PInelasticFS, "F30/");
207 clist->Register(new G4ParticleHPPAInelasticFS, "F31/");
208 clist->Register(new G4ParticleHPD2AInelasticFS, "F32/");
209 clist->Register(new G4ParticleHPT2AInelasticFS, "F33/");
210 clist->Register(new G4ParticleHPPDInelasticFS, "F34/");
211 clist->Register(new G4ParticleHPPTInelasticFS, "F35/");
212 clist->Register(new G4ParticleHPDAInelasticFS, "F36/");
213#ifdef G4VERBOSE
214 if (fManagerHP->GetVerboseLevel() > 1) {
215 G4cout << "G4NeutronHP::InelasticVI for "
216 << part->GetParticleName() << " off "
217 << elm->GetName() << G4endl;
218 }
219#endif
220 }
221 }
222}
223
224void G4NeutronHPInelasticVI::ModelDescription(std::ostream& outFile) const
225{
226 outFile << "High Precision (HP) model for inelastic reaction of "
227 << " neutrons below 20MeV\n";
228}
#define G4MUTEX_INITIALIZER
std::mutex G4Mutex
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
const G4double A[17]
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4ElementTable * GetElementTable()
Definition G4Element.cc:389
void SetMaxEnergy(const G4double anEnergy)
const std::pair< G4double, G4double > GetFatalEnergyCheckLevels() const override
void BuildPhysicsTable(const G4ParticleDefinition &) override
void ModelDescription(std::ostream &outFile) const override
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus) override
static G4Neutron * Neutron()
Definition G4Neutron.cc:101
G4int GetA_asInt() const
Definition G4Nucleus.hh:99
G4int GetZ_asInt() const
Definition G4Nucleus.hh:105
const G4String & GetParticleName() const
G4HadFinalState * ApplyYourself(const G4Element *theElement, const G4HadProjectile &aTrack)
const G4String & GetNeutronHPPath() const
static G4ParticleHPManager * GetInstance()
G4ParticleHPReactionWhiteBoard * GetReactionWhiteBoard()