Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4FissionLibrary.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 //
27 // This software was developed by Lawrence Livermore National Laboratory.
28 //
29 // Redistribution and use in source and binary forms, with or without
30 // modification, are permitted provided that the following conditions are met:
31 //
32 // 1. Redistributions of source code must retain the above copyright notice,
33 // this list of conditions and the following disclaimer.
34 // 2. Redistributions in binary form must reproduce the above copyright notice,
35 // this list of conditions and the following disclaimer in the documentation
36 // and/or other materials provided with the distribution.
37 // 3. The name of the author may not be used to endorse or promote products
38 // derived from this software without specific prior written permission.
39 //
40 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
41 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
42 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
43 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
45 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
46 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
47 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
48 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
49 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50 //
51 // Copyright (c) 2006 The Regents of the University of California.
52 // All rights reserved.
53 // UCRL-CODE-224807
54 //
55 //
56 // $Id: G4FissionLibrary.cc 67966 2013-03-13 09:38:38Z gcosmo $
57 //
58 // neutron_hp -- source file
59 // J.M. Verbeke, Jan-2007
60 // A low energy neutron-induced fission model.
61 //
62 
63 #include "G4FissionLibrary.hh"
64 #include "G4SystemOfUnits.hh"
65 
67  : G4NeutronHPFinalState(), theIsotope(0), targetMass(0.0)
68 {
69  hasXsec = false;
70 }
71 
73 {}
74 
76 {
77  G4FissionLibrary * theNew = new G4FissionLibrary;
78  return theNew;
79 }
80 
81 //void G4FissionLibrary::Init (G4double A, G4double Z, G4String & dirName, G4String &)
83 {
84  G4String tString = "/FS/";
85  G4bool dbool;
86  theIsotope = static_cast<G4int>(1000*Z+A);
87  G4NeutronHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, dirName, tString, dbool);
88  G4String filename = aFile.GetName();
89 
90  if(!dbool)
91  {
92  hasAnyData = false;
93  hasFSData = false;
94  hasXsec = false;
95  return;
96  }
97  std::ifstream theData(filename, std::ios::in);
98 
99  // here it comes
100  G4int infoType, dataType;
101  hasFSData = false;
102  while (theData >> infoType)
103  {
104  hasFSData = true;
105  theData >> dataType;
106  switch(infoType)
107  {
108  case 1:
109  if(dataType==4) theNeutronAngularDis.Init(theData);
110  if(dataType==5) thePromptNeutronEnDis.Init(theData);
111  if(dataType==12) theFinalStatePhotons.InitMean(theData);
112  if(dataType==14) theFinalStatePhotons.InitAngular(theData);
113  if(dataType==15) theFinalStatePhotons.InitEnergies(theData);
114  break;
115  case 2:
116  if(dataType==1) theFinalStateNeutrons.InitMean(theData);
117  break;
118  case 3:
119  if(dataType==1) theFinalStateNeutrons.InitDelayed(theData);
120  if(dataType==5) theDelayedNeutronEnDis.Init(theData);
121  break;
122  case 4:
123  if(dataType==1) theFinalStateNeutrons.InitPrompt(theData);
124  break;
125  case 5:
126  if(dataType==1) theEnergyRelease.Init(theData);
127  break;
128  default:
129  G4cout << "G4FissionLibrary::Init: unknown data type"<<dataType<<G4endl;
130  throw G4HadronicException(__FILE__, __LINE__, "G4FissionLibrary::Init: unknown data type");
131  break;
132  }
133  }
134  targetMass = theFinalStateNeutrons.GetTargetMass();
135  theData.close();
136 }
137 
139 {
140  theResult.Clear();
141 
142 // prepare neutron
143  G4double eKinetic = theTrack.GetKineticEnergy();
144  const G4HadProjectile *incidentParticle = &theTrack;
145  G4ReactionProduct theNeutron( const_cast<G4ParticleDefinition *>(incidentParticle->GetDefinition()) );
146  theNeutron.SetMomentum( incidentParticle->Get4Momentum().vect() );
147  theNeutron.SetKineticEnergy( eKinetic );
148 
149 // prepare target
150  G4Nucleus aNucleus;
152  G4ThreeVector neuVelo = (1./incidentParticle->GetDefinition()->GetPDGMass())*theNeutron.GetMomentum();
153  theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
154 
155 // set neutron and target in the FS classes
156  theNeutronAngularDis.SetNeutron(theNeutron);
157  theNeutronAngularDis.SetTarget(theTarget);
158 
159 // boost to target rest system
160  theNeutron.Lorentz(theNeutron, -1*theTarget);
161 
162  eKinetic = theNeutron.GetKineticEnergy();
163 
164 // dice neutron and gamma multiplicities, energies and momenta in Lab. @@
165 // no energy conservation on an event-to-event basis. we rely on the data to be ok. @@
166 // also for mean, we rely on the consistency of the data. @@
167 
168  G4int nPrompt=0, gPrompt=0;
169  SampleMult(theTrack, &nPrompt, &gPrompt, eKinetic);
170 
171 // Build neutrons and add them to dynamic particle vector
172  G4double momentum;
173  for(G4int i=0; i<nPrompt; i++)
174  {
177  it->SetKineticEnergy(getneng_(&i)*MeV);
178  momentum = it->GetTotalMomentum();
179  G4ThreeVector temp(momentum*getndircosu_(&i),
180  momentum*getndircosv_(&i),
181  momentum*getndircosw_(&i));
182  it->SetMomentum( temp );
183 // it->SetGlobalTime(getnage_(&i)*second);
185 // G4cout <<"G4FissionLibrary::ApplyYourself: energy of prompt neutron " << i << " = " << it->GetKineticEnergy()<<G4endl;
186  }
187 
188 // Build gammas, lorentz transform them, and add them to dynamic particle vector
189  for(G4int i=0; i<gPrompt; i++)
190  {
191  G4ReactionProduct * thePhoton = new G4ReactionProduct;
192  thePhoton->SetDefinition(G4Gamma::Gamma());
193  thePhoton->SetKineticEnergy(getpeng_(&i)*MeV);
194  momentum = thePhoton->GetTotalMomentum();
195  G4ThreeVector temp(momentum*getpdircosu_(&i),
196  momentum*getpdircosv_(&i),
197  momentum*getpdircosw_(&i));
198  thePhoton->SetMomentum( temp );
199  thePhoton->Lorentz(*thePhoton, -1.*theTarget);
200 
202  it->SetDefinition(thePhoton->GetDefinition());
203  it->SetMomentum(thePhoton->GetMomentum());
204 // it->SetGlobalTime(getpage_(&i)*second);
205 // G4cout <<"G4FissionLibrary::ApplyYourself: energy of prompt photon " << i << " = " << it->GetKineticEnergy()<<G4endl;
207  delete thePhoton;
208  }
209 // G4cout <<"G4FissionLibrary::ApplyYourself: Number of secondaries = "<<theResult.GetNumberOfSecondaries()<< G4endl;
210 // G4cout <<"G4FissionLibrary::ApplyYourself: Number of induced prompt neutron = "<<nPrompt<<G4endl;
211 // G4cout <<"G4FissionLibrary::ApplyYourself: Number of induced prompt photons = "<<gPrompt<<G4endl;
212 
213 // finally deal with local energy depositions.
214  G4double eDepByFragments = theEnergyRelease.GetFragmentKinetic();
215  theResult.SetLocalEnergyDeposit(eDepByFragments);
216 // G4cout << "G4FissionLibrary::local energy deposit" << eDepByFragments<<G4endl;
217 // clean up the primary neutron
219  return &theResult;
220 }
221 
222 void G4FissionLibrary::SampleMult(const G4HadProjectile & theTrack, G4int* nPrompt,
223  G4int* gPrompt, G4double eKinetic)
224 {
225  G4double promptNeutronMulti = 0;
226  promptNeutronMulti = theFinalStateNeutrons.GetPrompt(eKinetic); // prompt nubar from Geant
227  G4double delayedNeutronMulti = 0;
228  delayedNeutronMulti = theFinalStateNeutrons.GetDelayed(eKinetic); // delayed nubar from Geant
229 
230  G4double time = theTrack.GetGlobalTime()/second;
231  if(delayedNeutronMulti==0&&promptNeutronMulti==0) {
232  // no data for prompt and delayed neutrons in Geant
233  // but there is perhaps data for the total neutron multiplicity, in which case
234  // we use it for prompt neutron emission
235  G4double totalNeutronMulti = theFinalStateNeutrons.GetMean(eKinetic);
236  genfissevt_(&theIsotope, &time, &totalNeutronMulti, &eKinetic);
237  } else {
238  // prompt nubar != 0 || delayed nubar != 0
239  genfissevt_(&theIsotope, &time, &promptNeutronMulti, &eKinetic);
240  }
241  *nPrompt = getnnu_();
242  if (*nPrompt == -1) *nPrompt = 0; // the fission library libFission.a has no data for neutrons
243  *gPrompt = getpnu_();
244  if (*gPrompt == -1) *gPrompt = 0; // the fission library libFission.a has no data for gammas
245 }
246 
void SetNeutron(const G4ReactionProduct &aNeutron)
G4NeutronHPFinalState * New()
G4double getndircosu_(G4int *index)
void SetMomentum(const G4ThreeVector &momentum)
G4double GetTotalMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &)
G4double getneng_(G4int *index)
void Init(std::istream &aDataFile)
void SetKineticEnergy(const G4double en)
void InitDelayed(std::istream &aDataFile)
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTarget(const G4ReactionProduct &aTarget)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
int G4int
Definition: G4Types.hh:78
G4ParticleDefinition * GetDefinition() const
G4double GetTotalMomentum() const
G4double GetMean(G4double anEnergy)
void SetStatusChange(G4HadFinalStateStatus aS)
void InitAngular(std::istream &aDataFile)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
Definition: G4Nucleus.cc:108
G4int getnnu_()
Hep3Vector vect() const
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * GetDefinition() const
bool G4bool
Definition: G4Types.hh:79
G4double GetKineticEnergy() const
G4double GetGlobalTime() const
G4ErrorTarget * theTarget
Definition: errprop.cc:59
void InitEnergies(std::istream &aDataFile)
void Init(std::istream &aDataFile)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
const G4LorentzVector & Get4Momentum() const
void SetKineticEnergy(G4double aEnergy)
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack)
G4double getpdircosw_(G4int *index)
G4double GetKineticEnergy() const
G4double GetDelayed(G4double anEnergy)
G4double getpeng_(G4int *index)
G4bool InitMean(std::istream &aDataFile)
G4double getpdircosu_(G4int *index)
void genfissevt_(G4int *isotope, G4double *time, G4double *nubar, G4double *eng)
G4double GetPDGMass() const
G4double getpdircosv_(G4int *index)
void SetDefinition(G4ParticleDefinition *aParticleDefinition)
G4double getndircosv_(G4int *index)
G4ThreeVector GetMomentum() const
G4double GetTemperature() const
Definition: G4Material.hh:180
void SetLocalEnergyDeposit(G4double aE)
void InitPrompt(std::istream &aDataFile)
#define G4endl
Definition: G4ios.hh:61
G4int getpnu_()
const G4Material * GetMaterial() const
double G4double
Definition: G4Types.hh:76
G4double getndircosw_(G4int *index)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4double GetPrompt(G4double anEnergy)
void InitMean(std::istream &aDataFile)
void AddSecondary(G4DynamicParticle *aP)