G4SmpWatt.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: G4SmpWatt.cc 69860 2013-05-16 14:39:02Z gcosmo $
00057 //
00058 
00059 #define nZAfis 39    /* 38 fissionable isotopes in ENDL + U-232 from ENDF7 */
00060 #define WATTEMIN 1.0e-6
00061 #define WATTEMAX 20.0
00062 
00063 #include <cmath>
00064 #include "G4fissionEvent.hh"
00065 
00066 G4double G4fissionEvent::G4SmpWatt(G4double ePart, G4int iso) {
00067 
00068 /*
00069   Description
00070     Sample Watt Spectrum as in TART (Kalos algorithm)
00071 */
00072 
00073 /*
00074   Input
00075     ePart     - energy of incoming particle
00076     iso       - isotope
00077   Output
00078               - energy of incoming particle
00079 */
00080 
00081    static G4int nZA [nZAfis]= {
00082                       90231, 90232, 90233,
00083                       91233,
00084                       92232, 92233, 92234, 92235, 92236, 92237, 92238, 92239, 92240,
00085                       93235, 93236, 93237, 93238,
00086                       94237, 94238, 94239, 94240, 94241, 94242, 94243,
00087                       95241, 95242, 95243,
00088                       96242, 96243, 96244, 96245, 96246, 96247, 96248,
00089                       97249,
00090                       98249, 98250, 98251, 98252
00091                       };
00092 
00093    static G4double Watta [nZAfis][3] = {
00094                       {6.00949285e-05, -8.36695381e-03,  9.50939496e-01},
00095                       {6.54348443e-05, -8.86574327e-03,  9.55404490e-01},
00096                       {7.08173682e-05, -9.22676286e-03,  9.50088329e-01},
00097                       {6.35839062e-05, -8.63645973e-03,  9.24583535e-01},
00098                       {8.21929628e-05,  4.01922936e-03,  1.152121164e00},
00099                       {6.21335718e-05, -8.45651858e-03,  9.14717276e-01},
00100                       {6.81386135e-05, -8.99142394e-03,  9.21954824e-01},
00101                       {7.32627297e-05, -9.36908697e-03,  9.20107976e-01},
00102                       {8.06505279e-05, -9.95416671e-03,  9.27890410e-01},
00103                       {8.33208285e-05, -1.01073057e-02,  9.17691654e-01},
00104                       {8.96944680e-05, -1.06491070e-02,  9.25496030e-01},
00105                       {9.44608097e-05, -1.08940419e-02,  9.17795511e-01},
00106                       {1.01395704e-04, -1.15098159e-02,  9.29395462e-01},
00107                       {6.81110009e-05, -8.91619352e-03,  9.00047566e-01},
00108                       {7.21126359e-05, -9.20179363e-03,  8.95722889e-01},
00109                       {7.82371142e-05, -9.67050621e-03,  8.99574933e-01},
00110                       {8.27256297e-05, -9.99353009e-03,  8.97461897e-01},
00111                       {7.29458059e-05, -9.22415170e-03,  8.80996165e-01},
00112                       {8.02383914e-05, -9.78291439e-03,  8.88964070e-01},
00113                       {8.50641730e-05, -1.01099145e-02,  8.87304833e-01},
00114                       {9.10537157e-05, -1.05303084e-02,  8.89438514e-01},
00115                       {9.43014320e-05, -1.07133543e-02,  8.82632055e-01},
00116                       {1.02655616e-04, -1.13154691e-02,  8.91617174e-01},
00117                       {1.06118094e-04, -1.14971777e-02,  8.85181637e-01},
00118                       {9.08474473e-05, -1.04296303e-02,  8.71942958e-01},
00119                       {9.35633054e-05, -1.05612167e-02,  8.63930371e-01},
00120                       {1.01940441e-04, -1.11573929e-02,  8.73153437e-01},
00121                       {9.19501202e-05, -1.04229157e-02,  8.58681822e-01},
00122                       {9.42991674e-05, -1.05098872e-02,  8.49103546e-01},
00123                       {1.02747171e-04, -1.11371417e-02,  8.60434431e-01},
00124                       {1.05024967e-04, -1.12138980e-02,  8.51101942e-01},
00125                       {1.14130011e-04, -1.18692049e-02,  8.62838259e-01},
00126                       {1.15163673e-04, -1.18553822e-02,  8.51306646e-01},
00127                       {1.27169055e-04, -1.27033210e-02,  8.68623539e-01},
00128                       {1.24195213e-04, -1.24047085e-02,  8.48974077e-01},
00129                       {1.12616150e-04, -1.15135023e-02,  8.19708800e-01},
00130                       {1.23637465e-04, -1.22869889e-02,  8.35392018e-01},
00131                       {1.22724317e-04, -1.21677963e-02,  8.22569523e-01},
00132                       {1.33891595e-04, -1.29267762e-02,  8.37122909e-01} };
00133 
00134    G4double a;  /* Watt Parameters */
00135    G4double b=1.0;
00136 
00137    G4double rand1,rand2;
00138    G4double x,y,z;
00139    G4double eSmp;
00140    G4int i;
00141 
00142 
00143 /*
00144    Find Watt parameters for isotope
00145 */
00146    G4int isoindex=-1;
00147    for (i=0; isoindex == -1 && i<nZAfis; i++) {
00148       if (iso == nZA[i]) isoindex = i;
00149    }
00150    if (isoindex == -1) {
00151       std::ostringstream o;
00152       o << iso;
00153       std::string errMsg = "No Watt spectrum available for iso " + o.str();
00154       G4fissionerr(6, "SmpWatt", errMsg);
00155    }
00156    
00157    a= Watta[isoindex][2] + ePart*(Watta[isoindex][1] + ePart*Watta[isoindex][0]);
00158 
00159    x= 1. + (b/(8.*a));
00160    y= (x + std::sqrt(x*x-1.))/a;
00161    z= a*y - 1.;
00162 
00163    do {
00164 
00165       rand1= -std::log(fisslibrng());
00166       rand2= -std::log(fisslibrng());
00167       eSmp= y*rand1;
00168 
00169    } while ((rand2-z*(rand1+1.))*(rand2-z*(rand1+1.)) > b*y*rand1 ||
00170              eSmp < WATTEMIN || eSmp > WATTEMAX);
00171  
00172    
00173    return eSmp;
00174 }

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