ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4SmpNugDist.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4SmpNugDist.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 
58 #include <cmath>
59 #include "G4fissionEvent.hh"
60 #include "G4Exp.hh"
61 #include "G4Log.hh"
62 #include "G4Pow.hh"
63 
64 #define nfissg 40
65 #define alphanegbin 26
66 
68 
69 /*
70  Description
71  Sample Number of Photons from neutron induced fission in
72  all isotopes using Tim Valentine's model (negative binomial
73  distribution, using nubar as a model parameter)
74 */
75 
76 /*
77  Input
78  iso - isotope
79  Output
80  G4SmpNugDist - sampled multiplicity
81 */
82 
83  static G4double logcoeff[nfissg+1] = {
84  0.00000000000000e+00,
85  3.25809653802149e+00,
86  5.86078622346587e+00,
87  8.09437844497297e+00,
88  1.00753799138395e+01,
89  1.18671393830676e+01,
90  1.35093671183247e+01,
91  1.50291928720691e+01,
92  1.64462588918558e+01,
93  1.77753948391357e+01,
94  1.90281578076311e+01,
95  2.02137814732888e+01,
96  2.13397927361450e+01,
97  2.24124295384099e+01,
98  2.34369338549243e+01,
99  2.44177631079360e+01,
100  2.53587464524005e+01,
101  2.62632027266277e+01,
102  2.71340310844251e+01,
103  2.79737817391769e+01,
104  2.87847119553932e+01,
105  2.95688309141589e+01,
106  3.03279360625106e+01,
107  3.10636428574894e+01,
108  3.17774093252521e+01,
109  3.24705565058120e+01,
110  3.31442856005149e+01,
111  3.37996924530920e+01,
112  3.44377798564689e+01,
113  3.50594680730467e+01,
114  3.56656038766170e+01,
115  3.62569683628670e+01,
116  3.68342837279018e+01,
117  3.73982191769817e+01,
118  3.79493960962713e+01,
119  3.84883925970040e+01,
120  3.90157475227212e+01,
121  3.95319639951220e+01,
122  4.00375125617872e+01,
123  4.05328339990172e+01,
124  4.10183418147990e+01
125  };
126  G4int i, A, Z;
127  G4double cpi[nfissg+1];
128  G4double p, q, nubarg;
129  G4double r;
130 
131 /*
132  No data is available for induced fission gamma number
133  distributions. Sample the negative binomial cumulative
134  probability distribution.
135 */
136  A = (G4int) (isotope-1000*((G4int)(isotope/1000)));
137  Z = (G4int) ((isotope-A)/1000);
138  G4Pow* Pow = G4Pow::GetInstance();
139  nubarg = ((2.51-1.13e-5*Pow->powA(G4double(Z),2.)*std::sqrt(G4double(A)))*nubar+4.0)
140  /(-1.33+119.6*Pow->A13(G4double(Z))/G4double(A));
141  p = 1.*alphanegbin/(alphanegbin+nubarg);
142  q = 1.-p;
143  cpi[0] = G4Exp(logcoeff[0]+26.*G4Log(p));
144  for (i=1; i<=nfissg; i++) cpi[i] = cpi[i-1] + G4Exp(logcoeff[i]+26.*G4Log(p)+i*G4Log(q));
145  for (i=0; i<=nfissg; i++) cpi[i] = cpi[i]/cpi[nfissg-1];
146 
147  r=fisslibrng();
148 
149  for(i=0; i<=nfissg; i++) if (r <= cpi[i]) return i;
150 
151  //
152  // Fall through
153  //
154 
155  G4cout << " SmpNugDist: random number " << r << " out of range " << G4endl;
156  return -1;
157 
158 }