Geant4-11
G4ParticleHPFissionFS.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// neutron_hp -- source file
27// J.P. Wellisch, Nov-1996
28// A prototype of the low energy neutron transport model.
29//
30// 12-Apr-06 fix in delayed neutron and photon emission without FS data by T. Koi
31// 07-Sep-11 M. Kelsey -- Follow change to G4HadFinalState interface
32// P. Arce, June-2014 Conversion neutron_hp to particle_hp
33//
34
35#include "G4Exp.hh"
38#include "G4Nucleus.hh"
41#include "G4IonTable.hh"
43
44
46 {
47 secID = G4PhysicsModelCatalog::GetModelID( "model_NeutronHPFission" );
48 hasXsec = false;
50 }
51
52
54 {
55 //G4cout << "G4ParticleHPFissionFS::Init " << A << " " << Z << " " << M << G4endl;
56 theFS.Init(A, Z, M, dirName, aFSType, projectile);
57 theFC.Init(A, Z, M, dirName, aFSType, projectile);
58 theSC.Init(A, Z, M, dirName, aFSType, projectile);
59 theTC.Init(A, Z, M, dirName, aFSType, projectile);
60 theLC.Init(A, Z, M, dirName, aFSType, projectile);
61
62 theFF.Init(A, Z, M, dirName, aFSType, projectile);
63 if ( G4ParticleHPManager::GetInstance()->GetProduceFissionFragments() && theFF.HasFSData() )
64 {
65 G4cout << "Fission fragment production is now activated in HP package for "
66 << "Z = " << (G4int)Z
67 << ", A = " << (G4int)A
68 //<< "M = " << M
69 << G4endl;
70 G4cout << "As currently modeled this option precludes production of delayed neutrons from fission fragments." << G4endl;
72 }
73 }
75 {
76
77 //Because it may change by UI command
79
80 //G4cout << "G4ParticleHPFissionFS::ApplyYourself " << G4endl;
81// prepare neutron
82
83 if ( theResult.Get() == NULL ) theResult.Put( new G4HadFinalState );
84 theResult.Get()->Clear();
85 G4double eKinetic = theTrack.GetKineticEnergy();
86 const G4HadProjectile *incidentParticle = &theTrack;
87 G4ReactionProduct theNeutron( const_cast<G4ParticleDefinition *>(incidentParticle->GetDefinition()) );
88 theNeutron.SetMomentum( incidentParticle->Get4Momentum().vect() );
89 theNeutron.SetKineticEnergy( eKinetic );
90
91// prepare target
92 G4Nucleus aNucleus;
93 G4ReactionProduct theTarget;
94 G4double targetMass = theFS.GetMass();
95 G4ThreeVector neuVelo = (1./incidentParticle->GetDefinition()->GetPDGMass())*theNeutron.GetMomentum();
96 theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
97 theTarget.SetDefinition( G4IonTable::GetIonTable()->GetIon( G4int(theBaseZ), G4int(theBaseA) , 0.0 ) ); //TESTPHP
98// set neutron and target in the FS classes
99 theFS.SetNeutronRP(theNeutron);
100 theFS.SetTarget(theTarget);
101 theFC.SetNeutronRP(theNeutron);
102 theFC.SetTarget(theTarget);
103 theSC.SetNeutronRP(theNeutron);
104 theSC.SetTarget(theTarget);
105 theTC.SetNeutronRP(theNeutron);
106 theTC.SetTarget(theTarget);
107 theLC.SetNeutronRP(theNeutron);
108 theLC.SetTarget(theTarget);
109
110
111 theFF.SetNeutronRP(theNeutron);
112 theFF.SetTarget(theTarget);
113
114//TKWORK 120531
115//G4cout << theTarget.GetDefinition() << G4endl; this should be NULL
116//G4cout << "Z = " << theBaseZ << ", A = " << theBaseA << ", M = " << theBaseM << G4endl;
117// theNDLDataZ,A,M should be filled in each FS (theFS, theFC, theSC, theTC, theLC and theFF)
119
120// boost to target rest system and decide on channel.
121 theNeutron.Lorentz(theNeutron, -1*theTarget);
122
123// dice the photons
124
125 G4DynamicParticleVector * thePhotons;
126 thePhotons = theFS.GetPhotons();
127
128// select the FS in charge
129
130 eKinetic = theNeutron.GetKineticEnergy();
131 G4double xSec[4];
132 xSec[0] = theFC.GetXsec(eKinetic);
133 xSec[1] = xSec[0]+theSC.GetXsec(eKinetic);
134 xSec[2] = xSec[1]+theTC.GetXsec(eKinetic);
135 xSec[3] = xSec[2]+theLC.GetXsec(eKinetic);
136 G4int it;
137 unsigned int i=0;
138 G4double random = G4UniformRand();
139 if(xSec[3]==0)
140 {
141 it=-1;
142 }
143 else
144 {
145 for(i=0; i<4; i++)
146 {
147 it =i;
148 if(random<xSec[i]/xSec[3]) break;
149 }
150 }
151
152// dice neutron multiplicities, energies and momenta in Lab. @@
153// no energy conservation on an event-to-event basis. we rely on the data to be ok. @@
154// also for mean, we rely on the consistancy of the data. @@
155
156 G4int Prompt=0, delayed=0, all=0;
157 G4DynamicParticleVector * theNeutrons = 0;
158 switch(it) // check logic, and ask, if partials can be assumed to correspond to individual particles @@@
159 {
160 case 0:
161 theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 0);
162 if(Prompt==0&&delayed==0) Prompt=all;
163 theNeutrons = theFC.ApplyYourself(Prompt); // delayed always in FS
164 // take 'U' into account explicitly (see 5.4) in the sampling of energy @@@@
165 break;
166 case 1:
167 theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 1);
168 if(Prompt==0&&delayed==0) Prompt=all;
169 theNeutrons = theSC.ApplyYourself(Prompt); // delayed always in FS, off done in FSFissionFS
170 break;
171 case 2:
172 theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 2);
173 if(Prompt==0&&delayed==0) Prompt=all;
174 theNeutrons = theTC.ApplyYourself(Prompt); // delayed always in FS
175 break;
176 case 3:
177 theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 3);
178 if(Prompt==0&&delayed==0) Prompt=all;
179 theNeutrons = theLC.ApplyYourself(Prompt); // delayed always in FS
180 break;
181 default:
182 break;
183 }
184
185// dice delayed neutrons and photons, and fallback
186// for Prompt in case channel had no FS data; add all paricles to FS.
187
188 //TKWORK120531
189 if ( produceFissionFragments ) delayed=0;
190
191 G4double * theDecayConstants;
192
193 if( theNeutrons != 0)
194 {
195 theDecayConstants = new G4double[delayed];
196 //
197 //110527TKDB Unused codes, Detected by gcc4.6 compiler
198 //G4int nPhotons = 0;
199 //if(thePhotons!=0) nPhotons = thePhotons->size();
200 for(i=0; i<theNeutrons->size(); i++)
201 {
202 theResult.Get()->AddSecondary(theNeutrons->operator[](i), secID);
203 }
204 delete theNeutrons;
205
206 G4DynamicParticleVector * theDelayed = 0;
207// G4cout << "delayed" << G4endl;
208 theDelayed = theFS.ApplyYourself(0, delayed, theDecayConstants);
209 for(i=0; i<theDelayed->size(); i++)
210 {
211 G4double time = -G4Log(G4UniformRand())/theDecayConstants[i];
212 time += theTrack.GetGlobalTime();
213 theResult.Get()->AddSecondary(theDelayed->operator[](i), secID);
215 }
216 delete theDelayed;
217 }
218 else
219 {
220// cout << " all = "<<all<<G4endl;
221 theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 0);
222 theDecayConstants = new G4double[delayed];
223 if(Prompt==0&&delayed==0) Prompt=all;
224 theNeutrons = theFS.ApplyYourself(Prompt, delayed, theDecayConstants);
225 //110527TKDB Unused codes, Detected by gcc4.6 compiler
226 //G4int nPhotons = 0;
227 //if(thePhotons!=0) nPhotons = thePhotons->size();
228 G4int i0;
229 for(i0=0; i0<Prompt; i0++)
230 {
231 theResult.Get()->AddSecondary(theNeutrons->operator[](i0), secID);
232 }
233
234//G4cout << "delayed" << G4endl;
235 for(i0=Prompt; i0<Prompt+delayed; i0++)
236 {
237 // Protect against the very rare case of division by zero
238 G4double time = 0.0;
239 if ( theDecayConstants[i0-Prompt] > 1.0e-30 ) {
240 time = -G4Log(G4UniformRand())/theDecayConstants[i0-Prompt];
241 } else {
243 ed << " theDecayConstants[i0-Prompt]=" << theDecayConstants[i0-Prompt]
244 << " -> cannot sample the time : set it to 0.0 !" << G4endl;
245 G4Exception( "G4ParticleHPFissionFS::ApplyYourself ", "HAD_FISSIONHP_001", JustWarning, ed );
246 }
247
248 time += theTrack.GetGlobalTime();
249 theResult.Get()->AddSecondary(theNeutrons->operator[](i0), secID);
251 }
252 delete theNeutrons;
253 }
254 delete [] theDecayConstants;
255// cout << "all delayed "<<delayed<<G4endl;
256 unsigned int nPhotons = 0;
257 if(thePhotons!=0)
258 {
259 nPhotons = thePhotons->size();
260 for(i=0; i<nPhotons; i++)
261 {
262 theResult.Get()->AddSecondary(thePhotons->operator[](i), secID);
263 }
264 delete thePhotons;
265 }
266
267// finally deal with local energy depositions.
268// G4cout <<"Number of secondaries = "<<theResult.GetNumberOfSecondaries()<< G4endl;
269// G4cout <<"Number of photons = "<<nPhotons<<G4endl;
270// G4cout <<"Number of Prompt = "<<Prompt<<G4endl;
271// G4cout <<"Number of delayed = "<<delayed<<G4endl;
272
274 G4double eDepByFragments = theERelease->GetFragmentKinetic();
275 //theResult.SetLocalEnergyDeposit(eDepByFragments);
277// cout << "local energy deposit" << eDepByFragments<<G4endl;
278// clean up the primary neutron
280 //G4cout << "Prompt = " << Prompt << ", Delayed = " << delayed << ", All= " << all << G4endl;
281 //G4cout << "local energy deposit " << eDepByFragments/MeV << "MeV " << G4endl;
282
283 //TKWORK120531
285 {
286 G4int fragA_Z=0;
287 G4int fragA_A=0;
288 G4int fragA_M=0;
289 // System is traget rest!
290 theFF.GetAFissionFragment(eKinetic,fragA_Z,fragA_A,fragA_M);
291 G4int fragB_Z=(G4int)theBaseZ-fragA_Z;
292 G4int fragB_A=(G4int)theBaseA-fragA_A-Prompt;
293 //fragA_M ignored
294 //G4int fragB_M=theBaseM-fragA_M;
295 //G4cout << fragA_Z << " " << fragA_A << " " << fragA_M << G4endl;
296 //G4cout << fragB_Z << " " << fragB_A << G4endl;
297
299 //Excitation energy is not taken into account
300 G4ParticleDefinition* pdA = pt->GetIon( fragA_Z , fragA_A , 0.0 );
301 G4ParticleDefinition* pdB = pt->GetIon( fragB_Z , fragB_A , 0.0 );
302
303 //Isotropic Distribution
305 // Bug #1745 DHW G4double theta = pi*G4UniformRand();
306 G4double costheta = 2.*G4UniformRand()-1.;
307 G4double theta = std::acos(costheta);
308 G4double sinth = std::sin(theta);
309 G4ThreeVector direction(sinth*std::cos(phi), sinth*std::sin(phi), costheta);
310
311 // Just use ENDF value for this
312 G4double ER = eDepByFragments;
313 G4double ma = pdA->GetPDGMass();
314 G4double mb = pdB->GetPDGMass();
315 G4double EA = ER / ( 1 + ma/mb);
316 G4double EB = ER - EA;
317 G4DynamicParticle* dpA = new G4DynamicParticle( pdA , direction , EA);
318 G4DynamicParticle* dpB = new G4DynamicParticle( pdB , -direction , EB);
321 }
322 //TKWORK 120531 END
323
324 return theResult.Get();
325 }
std::vector< G4DynamicParticle * > G4DynamicParticleVector
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
@ stopAndKill
G4double G4Log(G4double x)
Definition: G4Log.hh:226
#define M(row, col)
static constexpr double twopi
Definition: G4SIunits.hh:56
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
const G4double A[17]
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:52
Hep3Vector vect() const
value_type & Get() const
Definition: G4Cache.hh:315
void Put(const value_type &val) const
Definition: G4Cache.hh:321
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
std::size_t GetNumberOfSecondaries() const
G4HadSecondary * GetSecondary(size_t i)
void SetLocalEnergyDeposit(G4double aE)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetGlobalTime() const
void SetTime(G4double aT)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:522
static G4IonTable * GetIonTable()
Definition: G4IonTable.cc:170
G4double GetTemperature() const
Definition: G4Material.hh:178
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
Definition: G4Nucleus.cc:118
G4DynamicParticleVector * ApplyYourself(G4int nNeutrons)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
void GetAFissionFragment(G4double, G4int &, G4int &, G4int &)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
G4DynamicParticleVector * ApplyYourself(G4int Prompt, G4int delayed, G4double *decayconst)
void SampleNeutronMult(G4int &all, G4int &Prompt, G4int &delayed, G4double energy, G4int off)
G4ParticleHPFissionERelease * GetEnergyRelease()
void SetNeutronRP(const G4ReactionProduct &aNeutron)
void SetTarget(const G4ReactionProduct &aTarget)
G4DynamicParticleVector * GetPhotons()
G4Cache< G4HadFinalState * > theResult
virtual G4double GetXsec(G4double anEnergy)
void SetTarget(const G4ReactionProduct &aTarget)
void SetNeutronRP(const G4ReactionProduct &aNeutron)
G4ParticleHPFCFissionFS theFC
G4ParticleHPLCFissionFS theLC
G4ParticleHPFFFissionFS theFF
G4ParticleHPSCFissionFS theSC
G4ParticleHPTCFissionFS theTC
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
G4ParticleHPFSFissionFS theFS
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
G4DynamicParticleVector * ApplyYourself(G4int NNeutrons)
static G4ParticleHPManager * GetInstance()
G4DynamicParticleVector * ApplyYourself(G4int NNeutrons)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
G4DynamicParticleVector * ApplyYourself(G4int NNeutrons)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
static G4int GetModelID(const G4int modelIndex)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)