G4SmpNugDist.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // This software was developed by Lawrence Livermore National Laboratory.
00028 //
00029 // Redistribution and use in source and binary forms, with or without
00030 // modification, are permitted provided that the following conditions are met:
00031 //
00032 // 1. Redistributions of source code must retain the above copyright notice,
00033 //   this list of conditions and the following disclaimer.
00034 // 2. Redistributions in binary form must reproduce the above copyright notice,
00035 //   this list of conditions and the following disclaimer in the documentation
00036 //   and/or other materials provided with the distribution.
00037 // 3. The name of the author may not be used to endorse or promote products
00038 //   derived from this software without specific prior written permission.
00039 //
00040 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
00041 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00042 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
00043 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00044 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00045 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00046 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00047 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00048 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00049 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00050 //
00051 // Copyright (c) 2006 The Regents of the University of California.
00052 // All rights reserved.
00053 // UCRL-CODE-224807
00054 //
00055 //
00056 // $Id: G4SmpNugDist.cc 69860 2013-05-16 14:39:02Z gcosmo $
00057 //
00058 
00059 #include <cmath>
00060 #include "G4fissionEvent.hh"
00061 
00062 #define nfissg 40
00063 #define alphanegbin 26
00064 
00065 G4int G4fissionEvent::G4SmpNugDist(G4int isotope, G4double nubar) {
00066 
00067 /*
00068   Description
00069     Sample Number of Photons from neutron induced fission in 
00070     all isotopes using Tim Valentine's model (negative binomial
00071     distribution, using nubar as a model parameter)
00072 */
00073 
00074 /*
00075   Input
00076     iso          - isotope
00077   Output
00078     G4SmpNugDist - sampled multiplicity
00079 */
00080  
00081   static G4double logcoeff[nfissg+1] = {
00082      0.00000000000000e+00,
00083      3.25809653802149e+00,
00084      5.86078622346587e+00,
00085      8.09437844497297e+00,
00086      1.00753799138395e+01,
00087      1.18671393830676e+01,
00088      1.35093671183247e+01,
00089      1.50291928720691e+01,
00090      1.64462588918558e+01,
00091      1.77753948391357e+01,
00092      1.90281578076311e+01,
00093      2.02137814732888e+01,
00094      2.13397927361450e+01,
00095      2.24124295384099e+01,
00096      2.34369338549243e+01,
00097      2.44177631079360e+01,
00098      2.53587464524005e+01,
00099      2.62632027266277e+01,
00100      2.71340310844251e+01,
00101      2.79737817391769e+01,
00102      2.87847119553932e+01,
00103      2.95688309141589e+01,
00104      3.03279360625106e+01,
00105      3.10636428574894e+01,
00106      3.17774093252521e+01,
00107      3.24705565058120e+01,
00108      3.31442856005149e+01,
00109      3.37996924530920e+01,
00110      3.44377798564689e+01,
00111      3.50594680730467e+01,
00112      3.56656038766170e+01,
00113      3.62569683628670e+01,
00114      3.68342837279018e+01,
00115      3.73982191769817e+01,
00116      3.79493960962713e+01,
00117      3.84883925970040e+01,
00118      3.90157475227212e+01,
00119      3.95319639951220e+01,
00120      4.00375125617872e+01,
00121      4.05328339990172e+01,
00122      4.10183418147990e+01
00123   };
00124   G4int i, A, Z;
00125   G4double cpi[nfissg+1];
00126   G4double p, q, nubarg;
00127   G4double r;
00128 
00129 /* 
00130   No data is available for induced fission gamma number
00131   distributions. Sample the negative binomial cumulative 
00132   probability distribution.
00133 */
00134   A = (G4int) (isotope-1000*((G4int)(isotope/1000)));
00135   Z = (G4int) ((isotope-A)/1000);
00136   nubarg = ((2.51-1.13e-5*std::pow(G4double(Z),2.)*std::sqrt(G4double(A)))*nubar+4.0)
00137            /(-1.33+119.6*std::pow(G4double(Z),1./3.)/G4double(A));
00138   p = 1.*alphanegbin/(alphanegbin+nubarg);
00139   q = 1.-p;
00140   cpi[0] = std::exp(logcoeff[0]+26.*std::log(p));
00141   for (i=1; i<=nfissg; i++) cpi[i] = cpi[i-1] + std::exp(logcoeff[i]+26.*std::log(p)+i*std::log(q));
00142   for (i=0; i<=nfissg; i++) cpi[i] = cpi[i]/cpi[nfissg-1];
00143 
00144   r=fisslibrng();
00145 
00146   for(i=0; i<=nfissg; i++) if (r <= cpi[i]) return i;
00147 
00148   //
00149   // Fall through
00150   //
00151 
00152   G4cout << " SmpNugDist: random number " << r << " out of range " << G4endl;
00153   return -1;
00154 
00155 }

Generated on Mon May 27 17:49:51 2013 for Geant4 by  doxygen 1.4.7