Geant4  10.01.p01
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 "G4ParticleHPFissionFS.hh"
36 #include "G4PhysicalConstants.hh"
37 #include "G4Nucleus.hh"
40 #include "G4IonTable.hh"
41 
42  void G4ParticleHPFissionFS::Init (G4double A, G4double Z, G4int M, G4String & dirName, G4String & aFSType, G4ParticleDefinition* projectile )
43  {
44  //G4cout << "G4ParticleHPFissionFS::Init " << A << " " << Z << " " << M << G4endl;
45  theFS.Init(A, Z, M, dirName, aFSType, projectile);
46  theFC.Init(A, Z, M, dirName, aFSType, projectile);
47  theSC.Init(A, Z, M, dirName, aFSType, projectile);
48  theTC.Init(A, Z, M, dirName, aFSType, projectile);
49  theLC.Init(A, Z, M, dirName, aFSType, projectile);
50 
51  theFF.Init(A, Z, M, dirName, aFSType, projectile);
52  if ( getenv("G4NEUTRONHP_PRODUCE_FISSION_FRAGMENTS") && theFF.HasFSData() )
53  {
54  G4cout << "Activate Fission Fragments Production for the target isotope of "
55  << "Z = " << (G4int)Z
56  << ", A = " << (G4int)A
57  //<< "M = " << M
58  << G4endl;
59  G4cout << "As the result, delayed neutrons are omitted and they should be taken care by RadioaActiveDecay."
60  << G4endl;
62  }
63  }
65  {
66  //G4cout << "G4ParticleHPFissionFS::ApplyYourself " << G4endl;
67 // prepare neutron
68  theResult.Clear();
69  G4double eKinetic = theTrack.GetKineticEnergy();
70  const G4HadProjectile *incidentParticle = &theTrack;
71  G4ReactionProduct theNeutron( const_cast<G4ParticleDefinition *>(incidentParticle->GetDefinition()) );
72  theNeutron.SetMomentum( incidentParticle->Get4Momentum().vect() );
73  theNeutron.SetKineticEnergy( eKinetic );
74 
75 // prepare target
76  G4Nucleus aNucleus;
78  G4double targetMass = theFS.GetMass();
79  G4ThreeVector neuVelo = (1./incidentParticle->GetDefinition()->GetPDGMass())*theNeutron.GetMomentum();
80  theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
81  theTarget.SetDefinition( G4IonTable::GetIonTable()->GetIon( G4int(theBaseZ), G4int(theBaseA) , 0.0 ) ); //TESTPHP
82 // set neutron and target in the FS classes
83  theFS.SetNeutronRP(theNeutron);
84  theFS.SetTarget(theTarget);
85  theFC.SetNeutronRP(theNeutron);
86  theFC.SetTarget(theTarget);
87  theSC.SetNeutronRP(theNeutron);
88  theSC.SetTarget(theTarget);
89  theTC.SetNeutronRP(theNeutron);
90  theTC.SetTarget(theTarget);
91  theLC.SetNeutronRP(theNeutron);
92  theLC.SetTarget(theTarget);
93 
94 
95  theFF.SetNeutronRP(theNeutron);
96  theFF.SetTarget(theTarget);
97 
98 //TKWORK 120531
99 //G4cout << theTarget.GetDefinition() << G4endl; this should be NULL
100 //G4cout << "Z = " << theBaseZ << ", A = " << theBaseA << ", M = " << theBaseM << G4endl;
101 // theNDLDataZ,A,M should be filled in each FS (theFS, theFC, theSC, theTC, theLC and theFF)
103 
104 // boost to target rest system and decide on channel.
105  theNeutron.Lorentz(theNeutron, -1*theTarget);
106 
107 // dice the photons
108 
109  G4DynamicParticleVector * thePhotons;
110  thePhotons = theFS.GetPhotons();
111 
112 // select the FS in charge
113 
114  eKinetic = theNeutron.GetKineticEnergy();
115  G4double xSec[4];
116  xSec[0] = theFC.GetXsec(eKinetic);
117  xSec[1] = xSec[0]+theSC.GetXsec(eKinetic);
118  xSec[2] = xSec[1]+theTC.GetXsec(eKinetic);
119  xSec[3] = xSec[2]+theLC.GetXsec(eKinetic);
120  G4int it;
121  unsigned int i=0;
122  G4double random = G4UniformRand();
123  if(xSec[3]==0)
124  {
125  it=-1;
126  }
127  else
128  {
129  for(i=0; i<4; i++)
130  {
131  it =i;
132  if(random<xSec[i]/xSec[3]) break;
133  }
134  }
135 
136 // dice neutron multiplicities, energies and momenta in Lab. @@
137 // no energy conservation on an event-to-event basis. we rely on the data to be ok. @@
138 // also for mean, we rely on the consistancy of the data. @@
139 
140  G4int Prompt=0, delayed=0, all=0;
141  G4DynamicParticleVector * theNeutrons = 0;
142  switch(it) // check logic, and ask, if partials can be assumed to correspond to individual particles @@@
143  {
144  case 0:
145  theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 0);
146  if(Prompt==0&&delayed==0) Prompt=all;
147  theNeutrons = theFC.ApplyYourself(Prompt); // delayed always in FS
148  // take 'U' into account explicitely (see 5.4) in the sampling of energy @@@@
149  break;
150  case 1:
151  theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 1);
152  if(Prompt==0&&delayed==0) Prompt=all;
153  theNeutrons = theSC.ApplyYourself(Prompt); // delayed always in FS, off done in FSFissionFS
154  break;
155  case 2:
156  theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 2);
157  if(Prompt==0&&delayed==0) Prompt=all;
158  theNeutrons = theTC.ApplyYourself(Prompt); // delayed always in FS
159  break;
160  case 3:
161  theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 3);
162  if(Prompt==0&&delayed==0) Prompt=all;
163  theNeutrons = theLC.ApplyYourself(Prompt); // delayed always in FS
164  break;
165  default:
166  break;
167  }
168 
169 // dice delayed neutrons and photons, and fallback
170 // for Prompt in case channel had no FS data; add all paricles to FS.
171 
172  //TKWORK120531
173  if ( produceFissionFragments ) delayed=0;
174 
175  G4double * theDecayConstants;
176 
177  if( theNeutrons != 0)
178  {
179  theDecayConstants = new G4double[delayed];
180  //
181  //110527TKDB Unused codes, Detected by gcc4.6 compiler
182  //G4int nPhotons = 0;
183  //if(thePhotons!=0) nPhotons = thePhotons->size();
184  for(i=0; i<theNeutrons->size(); i++)
185  {
186  theResult.AddSecondary(theNeutrons->operator[](i));
187  }
188  delete theNeutrons;
189 
190  G4DynamicParticleVector * theDelayed = 0;
191 // G4cout << "delayed" << G4endl;
192  theDelayed = theFS.ApplyYourself(0, delayed, theDecayConstants);
193  for(i=0; i<theDelayed->size(); i++)
194  {
195  G4double time = -std::log(G4UniformRand())/theDecayConstants[i];
196  time += theTrack.GetGlobalTime();
197  theResult.AddSecondary(theDelayed->operator[](i));
199  }
200  delete theDelayed;
201  }
202  else
203  {
204 // cout << " all = "<<all<<G4endl;
205  theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 0);
206  theDecayConstants = new G4double[delayed];
207  if(Prompt==0&&delayed==0) Prompt=all;
208  theNeutrons = theFS.ApplyYourself(Prompt, delayed, theDecayConstants);
209  //110527TKDB Unused codes, Detected by gcc4.6 compiler
210  //G4int nPhotons = 0;
211  //if(thePhotons!=0) nPhotons = thePhotons->size();
212  G4int i0;
213  for(i0=0; i0<Prompt; i0++)
214  {
215  theResult.AddSecondary(theNeutrons->operator[](i0));
216  }
217 
218 //G4cout << "delayed" << G4endl;
219  for(i0=Prompt; i0<Prompt+delayed; i0++)
220  {
221  G4double time = -std::log(G4UniformRand())/theDecayConstants[i0-Prompt];
222  time += theTrack.GetGlobalTime();
223  theResult.AddSecondary(theNeutrons->operator[](i0));
225  }
226  delete theNeutrons;
227  }
228  delete [] theDecayConstants;
229 // cout << "all delayed "<<delayed<<G4endl;
230  unsigned int nPhotons = 0;
231  if(thePhotons!=0)
232  {
233  nPhotons = thePhotons->size();
234  for(i=0; i<nPhotons; i++)
235  {
236  theResult.AddSecondary(thePhotons->operator[](i));
237  }
238  delete thePhotons;
239  }
240 
241 // finally deal with local energy depositions.
242 // G4cout <<"Number of secondaries = "<<theResult.GetNumberOfSecondaries()<< G4endl;
243 // G4cout <<"Number of photons = "<<nPhotons<<G4endl;
244 // G4cout <<"Number of Prompt = "<<Prompt<<G4endl;
245 // G4cout <<"Number of delayed = "<<delayed<<G4endl;
246 
248  G4double eDepByFragments = theERelease->GetFragmentKinetic();
249  //theResult.SetLocalEnergyDeposit(eDepByFragments);
251 // cout << "local energy deposit" << eDepByFragments<<G4endl;
252 // clean up the primary neutron
254  //G4cout << "Prompt = " << Prompt << ", Delayed = " << delayed << ", All= " << all << G4endl;
255  //G4cout << "local energy deposit " << eDepByFragments/MeV << "MeV " << G4endl;
256 
257  //TKWORK120531
259  {
260  G4int fragA_Z=0;
261  G4int fragA_A=0;
262  G4int fragA_M=0;
263  // System is traget rest!
264  theFF.GetAFissionFragment(eKinetic,fragA_Z,fragA_A,fragA_M);
265  G4int fragB_Z=(G4int)theBaseZ-fragA_Z;
266  G4int fragB_A=(G4int)theBaseA-fragA_A-Prompt;
267  //fragA_M ignored
268  //G4int fragB_M=theBaseM-fragA_M;
269  //G4cout << fragA_Z << " " << fragA_A << " " << fragA_M << G4endl;
270  //G4cout << fragB_Z << " " << fragB_A << G4endl;
271 
273  //Excitation energy is not taken into account
274  G4ParticleDefinition* pdA = pt->GetIon( fragA_Z , fragA_A , 0.0 );
275  G4ParticleDefinition* pdB = pt->GetIon( fragB_Z , fragB_A , 0.0 );
276 
277  //Isotropic Distribution
278  G4double phi = twopi*G4UniformRand();
279  G4double theta = pi*G4UniformRand();
280  G4double sinth = std::sin(theta);
281  G4ThreeVector direction (sinth*std::cos(phi) , sinth*std::sin(phi), std::cos(theta) );
282 
283  // Just use ENDF value for this
284  G4double ER = eDepByFragments;
285  G4double ma = pdA->GetPDGMass();
286  G4double mb = pdB->GetPDGMass();
287  G4double EA = ER / ( 1 + ma/mb);
288  G4double EB = ER - EA;
289  G4DynamicParticle* dpA = new G4DynamicParticle( pdA , direction , EA);
290  G4DynamicParticle* dpB = new G4DynamicParticle( pdB , -direction , EB);
291  theResult.AddSecondary(dpA);
292  theResult.AddSecondary(dpB);
293  }
294  //TKWORK 120531 END
295 
296  return &theResult;
297  }
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
G4HadSecondary * GetSecondary(size_t i)
CLHEP::Hep3Vector G4ThreeVector
G4DynamicParticleVector * ApplyYourself(G4int NNeutrons)
void SetKineticEnergy(const G4double en)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:463
const G4double pi
void SetNeutronRP(const G4ReactionProduct &aNeutron)
void SampleNeutronMult(G4int &all, G4int &Prompt, G4int &delayed, G4double energy, G4int off)
void SetNeutronRP(const G4ReactionProduct &aNeutron)
void SetTarget(const G4ReactionProduct &aTarget)
int G4int
Definition: G4Types.hh:78
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ParticleHPSCFissionFS theSC
void SetStatusChange(G4HadFinalStateStatus aS)
void GetAFissionFragment(G4double, G4int &, G4int &, G4int &)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
Definition: G4Nucleus.cc:108
#define G4UniformRand()
Definition: Randomize.hh:95
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * GetDefinition() const
virtual G4double GetXsec(G4double anEnergy)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
G4double GetKineticEnergy() const
G4ParticleHPFissionERelease * GetEnergyRelease()
G4double GetGlobalTime() const
G4ErrorTarget * theTarget
Definition: errprop.cc:59
G4DynamicParticleVector * ApplyYourself(G4int Prompt, G4int delayed, G4double *decayconst)
G4ParticleHPTCFissionFS theTC
std::vector< G4DynamicParticle * > G4DynamicParticleVector
G4DynamicParticleVector * ApplyYourself(G4int NNeutrons)
G4DynamicParticleVector * GetPhotons()
static const G4double A[nN]
const G4LorentzVector & Get4Momentum() const
static G4IonTable * GetIonTable()
Definition: G4IonTable.hh:78
G4double GetKineticEnergy() const
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
void SetTarget(const G4ReactionProduct &aTarget)
G4ParticleHPLCFissionFS theLC
G4double GetPDGMass() const
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
G4ParticleHPFSFissionFS theFS
G4ThreeVector GetMomentum() const
G4double GetTemperature() const
Definition: G4Material.hh:182
void SetLocalEnergyDeposit(G4double aE)
#define G4endl
Definition: G4ios.hh:61
G4DynamicParticleVector * ApplyYourself(G4int NNeutrons)
G4ParticleHPFFFissionFS theFF
const G4Material * GetMaterial() const
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
G4DynamicParticleVector * ApplyYourself(G4int nNeutrons)
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
double G4double
Definition: G4Types.hh:76
G4ParticleHPFCFissionFS theFC
G4int GetNumberOfSecondaries() const
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)