Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4fissionEvent.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 // $Id: G4fissionEvent.cc 68799 2013-04-05 13:29:46Z gcosmo $
56 //
57 
58 #include "G4fissionEvent.hh"
59 
60 G4int G4fissionEvent::delayoption=0;
61 G4int G4fissionEvent::correlationoption=0;
62 G4int G4fissionEvent::nudistoption=3;
63 G4int G4fissionEvent::Cf252ndistoption=0;
64 G4int G4fissionEvent::Cf252nengoption=0;
65 
67  G4double nubar, G4double eng)
68  :neutronNu(0), neutronEnergies(0), neutronVelocities(0), neutronDircosu(0),
69  neutronDircosv(), neutronDircosw(), neutronAges(0),
70  photonNu(0), photonEnergies(0), photonVelocities(0), photonDircosu(0),
71  photonDircosv(0), photonDircosw(0), photonAges(0)
72 {
73  /*
74  * Constructs a fission event with neutronNu neutrons and photonNu
75  * photons.
76  */
77  G4int i;
78 
79  if (nubar == -1.) {
80  /* spontaneous fission */
81  neutronNu = G4SmpSpNuDistData(isotope, Cf252ndistoption);
82  photonNu = G4SmpSpNugDistData(isotope);
83  } else {
84  /* induced fission */
85  if (nudistoption == 0 || nudistoption == 1) {
86  switch (isotope) {
87  case 92235:
88  neutronNu = G4SmpNuDistDataU235(eng,nudistoption);
89  break;
90  case 92238:
91  neutronNu = G4SmpNuDistDataU238(eng);
92  break;
93  case 94239:
94  neutronNu = G4SmpNuDistDataPu239(eng);
95  break;
96  default:
97  neutronNu = (G4int) G4SmpTerrell(nubar);
98  break;
99  }
100  } else if (nudistoption == 2) {
101  switch (isotope) {
102  case 92232:
103  case 92234:
104  case 92236:
105  case 92238:
106  neutronNu = G4SmpNuDistDataU232_234_236_238(nubar);
107  break;
108  case 92233:
109  case 92235:
110  neutronNu = (G4int) G4SmpNuDistDataU233_235(nubar);
111  break;
112  case 94239:
113  case 94241:
114  neutronNu = G4SmpNuDistDataPu239_241(nubar);
115  break;
116  default:
117  neutronNu = (G4int) G4SmpTerrell(nubar);
118  break;
119  }
120  } else if (nudistoption == 3) {
121  switch (isotope) {
122  case 92232:
123  case 92234:
124  case 92236:
125  case 92238:
126  neutronNu = G4SmpNuDistDataU232_234_236_238_MC(nubar);
127  break;
128  case 92233:
129  case 92235:
130  neutronNu = (G4int) G4SmpNuDistDataU233_235_MC(nubar);
131  break;
132  case 94239:
133  case 94241:
134  neutronNu = G4SmpNuDistDataPu239_241_MC(nubar);
135  break;
136  default:
137  neutronNu = (G4int) G4SmpTerrell(nubar);
138  break;
139  }
140  }
141  photonNu = G4SmpNugDist(isotope, nubar);
142  }
143  if (neutronNu > 0) {
144  neutronEnergies = new G4double[ neutronNu ];
145  neutronVelocities = new G4double[ neutronNu ];
146  neutronDircosu = new G4double[ neutronNu ];
147  neutronDircosv = new G4double[ neutronNu ];
148  neutronDircosw = new G4double[ neutronNu ];
149  neutronAges = new G4double[neutronNu];
150  for (i=0; i<neutronNu; i++) {
151  if (isotope == 98252) neutronEnergies[i] = G4SmpNEngCf252(Cf252nengoption);
152  else neutronEnergies[i] = G4SmpWatt(eng, isotope);
153  neutronVelocities[i] = G4SmpNVel(
154  neutronEnergies[i],
155  &(neutronDircosu[i]),
156  &(neutronDircosv[i]),
157  &(neutronDircosw[i])
158  );
159  neutronAges[i] = time;
160  }
161  }
162  if (photonNu > 0) {
163  photonEnergies = new G4double[photonNu];
164  photonVelocities = new G4double[photonNu];
165  photonDircosu = new G4double[photonNu];
166  photonDircosv = new G4double[photonNu];
167  photonDircosw = new G4double[photonNu];
168  photonAges = new G4double[photonNu];
169  for (i=0; i<photonNu; i++) {
170  photonEnergies[i] = G4SmpGEng();
171  photonVelocities[i] = G4SmpPVel(
172  photonEnergies[i],
173  &(photonDircosu[i]),
174  &(photonDircosv[i]),
175  &(photonDircosw[i])
176  );
177  photonAges[i] = time;
178  }
179  }
180 }
181 
183  if (neutronNu > 0) {
184  delete [] neutronEnergies;
185  delete [] neutronVelocities;
186  delete [] neutronDircosu;
187  delete [] neutronDircosv;
188  delete [] neutronDircosw;
189  delete [] neutronAges;
190  }
191 
192  if (photonNu > 0) {
193  delete [] photonEnergies;
194  delete [] photonVelocities;
195  delete [] photonDircosu;
196  delete [] photonDircosv;
197  delete [] photonDircosw;
198  delete [] photonAges;
199  }
200 }
int G4int
Definition: G4Types.hh:78
G4fissionEvent(G4int isotope, G4double time, G4double nubar, G4double eng)
double G4double
Definition: G4Types.hh:76