ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4FissionLibrary.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4FissionLibrary.cc
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 //
57 // neutron_hp -- source file
58 // J.M. Verbeke, Jan-2007
59 // A low energy neutron-induced fission model.
60 //
61 
62 #include "G4FissionLibrary.hh"
63 #include "G4ParticleHPManager.hh"
64 #include "G4SystemOfUnits.hh"
65 
67  : G4ParticleHPFinalState(), theIsotope(0), targetMass(0.0)
68 {
69  hasXsec = false;
70  fe=0;
71 }
72 
74 {}
75 
77 {
78  G4FissionLibrary * theNew = new G4FissionLibrary;
79  return theNew;
80 }
81 
82 //void G4FissionLibrary::Init (G4double A, G4double Z, G4String & dirName, G4String &)
84 {
85  G4String tString = "/FS/";
86  G4bool dbool;
87  theIsotope = static_cast<G4int>(1000*Z+A);
88  G4ParticleHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, dirName, tString, dbool);
89  G4String filename = aFile.GetName();
90 
91  if(!dbool)
92  {
93  hasAnyData = false;
94  hasFSData = false;
95  hasXsec = false;
96  return;
97  }
98  //std::ifstream theData(filename, std::ios::in);
99  std::istringstream theData(std::ios::in);
100  G4ParticleHPManager::GetInstance()->GetDataStream(filename,theData);
101 
102  // here it comes
103  G4int infoType, dataType;
104  hasFSData = false;
105  while (theData >> infoType) // Loop checking, 11.03.2015, T. Koi
106  {
107  hasFSData = true;
108  theData >> dataType;
109  switch(infoType)
110  {
111  case 1:
112  if(dataType==4) theNeutronAngularDis.Init(theData);
113  if(dataType==5) thePromptNeutronEnDis.Init(theData);
114  if(dataType==12) theFinalStatePhotons.InitMean(theData);
115  if(dataType==14) theFinalStatePhotons.InitAngular(theData);
116  if(dataType==15) theFinalStatePhotons.InitEnergies(theData);
117  break;
118  case 2:
119  if(dataType==1) theFinalStateNeutrons.InitMean(theData);
120  break;
121  case 3:
122  if(dataType==1) theFinalStateNeutrons.InitDelayed(theData);
123  if(dataType==5) theDelayedNeutronEnDis.Init(theData);
124  break;
125  case 4:
126  if(dataType==1) theFinalStateNeutrons.InitPrompt(theData);
127  break;
128  case 5:
129  if(dataType==1) theEnergyRelease.Init(theData);
130  break;
131  default:
132  G4cout << "G4FissionLibrary::Init: unknown data type"<<dataType<<G4endl;
133  throw G4HadronicException(__FILE__, __LINE__, "G4FissionLibrary::Init: unknown data type");
134  break;
135  }
136  }
138  //theData.close();
139 }
140 
142 {
143 
144  if ( theResult.Get() == NULL ) theResult.Put( new G4HadFinalState );
145  theResult.Get()->Clear();
146 
147  // prepare neutron
148  G4double eKinetic = theTrack.GetKineticEnergy();
149  const G4HadProjectile* incidentParticle = &theTrack;
150  G4ReactionProduct theNeutron(incidentParticle->GetDefinition() );
151  theNeutron.SetMomentum(incidentParticle->Get4Momentum().vect() );
152  theNeutron.SetKineticEnergy(eKinetic);
153 
154  // prepare target
155  G4Nucleus aNucleus;
157  G4ThreeVector neuVelo = (1./incidentParticle->GetDefinition()->GetPDGMass())*theNeutron.GetMomentum();
158  theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
159 
160  // set neutron and target in the FS classes
161  //theNeutronAngularDis.SetNeutron(theNeutron);
163  theNeutronAngularDis.SetTarget(theTarget);
164 
165  // boost to target rest system
166  theNeutron.Lorentz(theNeutron, -1*theTarget);
167 
168  eKinetic = theNeutron.GetKineticEnergy();
169 
170  // dice neutron and gamma multiplicities, energies and momenta in Lab. @@
171  // no energy conservation on an event-to-event basis. we rely on the data to be ok. @@
172  // also for mean, we rely on the consistency of the data. @@
173 
174  G4int nPrompt=0, gPrompt=0;
175  SampleMult(theTrack, &nPrompt, &gPrompt, eKinetic);
176 
177  // Build neutrons and add them to dynamic particle vector
179  for(G4int i=0; i<nPrompt; i++)
180  {
184  momentum = it->GetTotalMomentum();
185  G4ThreeVector temp(momentum*fe->getNeutronDircosu(i),
186  momentum*fe->getNeutronDircosv(i),
187  momentum*fe->getNeutronDircosw(i));
188  it->SetMomentum( temp );
189 // it->SetGlobalTime(fe->getNeutronAge(i)*second);
190  theResult.Get()->AddSecondary(it);
191 // G4cout <<"G4FissionLibrary::ApplyYourself: energy of prompt neutron " << i << " = " << it->GetKineticEnergy()<<G4endl;
192  }
193 
194  // Build gammas, lorentz transform them, and add them to dynamic particle vector
195  for(G4int i=0; i<gPrompt; i++)
196  {
197  G4ReactionProduct * thePhoton = new G4ReactionProduct;
198  thePhoton->SetDefinition(G4Gamma::Gamma());
199  thePhoton->SetKineticEnergy(fe->getPhotonEnergy(i)*MeV);
200  momentum = thePhoton->GetTotalMomentum();
201  G4ThreeVector temp(momentum*fe->getPhotonDircosu(i),
202  momentum*fe->getPhotonDircosv(i),
203  momentum*fe->getPhotonDircosw(i));
204  thePhoton->SetMomentum( temp );
205  thePhoton->Lorentz(*thePhoton, -1.*theTarget);
206 
208  it->SetDefinition(thePhoton->GetDefinition());
209  it->SetMomentum(thePhoton->GetMomentum());
210 // it->SetGlobalTime(fe->getPhotonAge(i)*second);
211 // G4cout <<"G4FissionLibrary::ApplyYourself: energy of prompt photon " << i << " = " << it->GetKineticEnergy()<<G4endl;
212  theResult.Get()->AddSecondary(it);
213  delete thePhoton;
214  }
215 // G4cout <<"G4FissionLibrary::ApplyYourself: Number of secondaries = "<<theResult.GetNumberOfSecondaries()<< G4endl;
216 // G4cout <<"G4FissionLibrary::ApplyYourself: Number of induced prompt neutron = "<<nPrompt<<G4endl;
217 // G4cout <<"G4FissionLibrary::ApplyYourself: Number of induced prompt photons = "<<gPrompt<<G4endl;
218 
219  // finally deal with local energy depositions.
220  G4double eDepByFragments = theEnergyRelease.GetFragmentKinetic();
221  theResult.Get()->SetLocalEnergyDeposit(eDepByFragments);
222 // G4cout << "G4FissionLibrary::local energy deposit" << eDepByFragments<<G4endl;
223  // clean up the primary neutron
225  return theResult.Get();
226 }
227 
228 void G4FissionLibrary::SampleMult(const G4HadProjectile & theTrack, G4int* nPrompt,
229  G4int* gPrompt, G4double eKinetic)
230 {
231  G4double promptNeutronMulti = 0;
232  promptNeutronMulti = theFinalStateNeutrons.GetPrompt(eKinetic); // prompt nubar from Geant
233  G4double delayedNeutronMulti = 0;
234  delayedNeutronMulti = theFinalStateNeutrons.GetDelayed(eKinetic); // delayed nubar from Geant
235 
236  G4double time = theTrack.GetGlobalTime()/second;
237  G4double totalNeutronMulti = theFinalStateNeutrons.GetMean(eKinetic);
238  if(delayedNeutronMulti==0&&promptNeutronMulti==0) {
239  // no data for prompt and delayed neutrons in Geant
240  // but there is perhaps data for the total neutron multiplicity, in which case
241  // we use it for prompt neutron emission
242  if (fe != 0) delete fe;
243  fe = new G4fissionEvent(theIsotope, time, totalNeutronMulti, eKinetic);
244  } else {
245  // prompt nubar != 0 || delayed nubar != 0
246  if (fe != 0) delete fe;
247  fe = new G4fissionEvent(theIsotope, time, promptNeutronMulti, eKinetic);
248  }
249  *nPrompt = fe->getNeutronNu();
250  if (*nPrompt == -1) *nPrompt = 0; // the fission library libFission.a has no data for neutrons
251  *gPrompt = fe->getPhotonNu();
252  if (*gPrompt == -1) *gPrompt = 0; // the fission library libFission.a has no data for gammas
253 }
254