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10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/hadronic/models/fission/src/G4SmpWatt.cc (Version 11.3.0) and /processes/hadronic/models/fission/src/G4SmpWatt.cc (Version 10.4)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27 // This software was developed by Lawrence Liv     27 // This software was developed by Lawrence Livermore National Laboratory.
 28 //                                                 28 //
 29 // Redistribution and use in source and binary     29 // Redistribution and use in source and binary forms, with or without
 30 // modification, are permitted provided that t     30 // modification, are permitted provided that the following conditions are met:
 31 //                                                 31 //
 32 // 1. Redistributions of source code must reta     32 // 1. Redistributions of source code must retain the above copyright notice,
 33 //   this list of conditions and the following     33 //   this list of conditions and the following disclaimer.
 34 // 2. Redistributions in binary form must repr     34 // 2. Redistributions in binary form must reproduce the above copyright notice,
 35 //   this list of conditions and the following     35 //   this list of conditions and the following disclaimer in the documentation
 36 //   and/or other materials provided with the      36 //   and/or other materials provided with the distribution.
 37 // 3. The name of the author may not be used t     37 // 3. The name of the author may not be used to endorse or promote products
 38 //   derived from this software without specif     38 //   derived from this software without specific prior written permission.
 39 //                                                 39 //
 40 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``A     40 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 41 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO,      41 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 42 // MERCHANTABILITY AND FITNESS FOR A PARTICULA     42 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 43 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DI     43 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 44 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGE     44 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 45 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES     45 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 46 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AN     46 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 47 // WHETHER IN CONTRACT, STRICT LIABILITY, OR T     47 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 48 // OTHERWISE) ARISING IN ANY WAY OUT OF THE US     48 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 49 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.      49 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 50 //                                                 50 //
 51 // Copyright (c) 2006 The Regents of the Unive     51 // Copyright (c) 2006 The Regents of the University of California.
 52 // All rights reserved.                            52 // All rights reserved.
 53 // UCRL-CODE-224807                                53 // UCRL-CODE-224807
 54 //                                                 54 //
 55 //                                                 55 //
                                                   >>  56 // $Id: G4SmpWatt.cc 68799 2013-04-05 13:29:46Z gcosmo $
 56 //                                                 57 //
 57                                                    58 
 58 #define nZAfis 39    /* 38 fissionable isotope     59 #define nZAfis 39    /* 38 fissionable isotopes in ENDL + U-232 from ENDF7 */
 59 #define WATTEMIN 1.0e-6                            60 #define WATTEMIN 1.0e-6
 60 #define WATTEMAX 20.0                              61 #define WATTEMAX 20.0
 61                                                    62 
 62 #include <cmath>                                   63 #include <cmath>
 63 #include "G4Log.hh"                                64 #include "G4Log.hh"
 64 #include "G4fissionEvent.hh"                       65 #include "G4fissionEvent.hh"
 65                                                    66 
 66 G4double G4fissionEvent::G4SmpWatt(G4double eP     67 G4double G4fissionEvent::G4SmpWatt(G4double ePart, G4int iso) {
 67                                                    68 
 68 /*                                                 69 /*
 69   Description                                      70   Description
 70     Sample Watt Spectrum as in TART (Kalos alg     71     Sample Watt Spectrum as in TART (Kalos algorithm)
 71 */                                                 72 */
 72                                                    73 
 73 /*                                                 74 /*
 74   Input                                            75   Input
 75     ePart     - energy of incoming particle        76     ePart     - energy of incoming particle
 76     iso       - isotope                            77     iso       - isotope
 77   Output                                           78   Output
 78               - energy of incoming particle        79               - energy of incoming particle
 79 */                                                 80 */
 80                                                    81 
 81   static G4int nZA [nZAfis]= {                     82   static G4int nZA [nZAfis]= {
 82                  90231, 90232, 90233,              83                  90231, 90232, 90233,
 83                  91233,                            84                  91233,
 84                  92232, 92233, 92234, 92235, 9     85                  92232, 92233, 92234, 92235, 92236, 92237, 92238, 92239, 92240,
 85                  93235, 93236, 93237, 93238,       86                  93235, 93236, 93237, 93238,
 86                  94237, 94238, 94239, 94240, 9     87                  94237, 94238, 94239, 94240, 94241, 94242, 94243,
 87                  95241, 95242, 95243,              88                  95241, 95242, 95243,
 88                  96242, 96243, 96244, 96245, 9     89                  96242, 96243, 96244, 96245, 96246, 96247, 96248,
 89                  97249,                            90                  97249,
 90                  98249, 98250, 98251, 98252};      91                  98249, 98250, 98251, 98252};
 91                                                    92 
 92   static G4double Watta [nZAfis][3] = {            93   static G4double Watta [nZAfis][3] = {
 93                       {6.00949285e-05, -8.3669     94                       {6.00949285e-05, -8.36695381e-03,  9.50939496e-01},
 94                       {6.54348443e-05, -8.8657     95                       {6.54348443e-05, -8.86574327e-03,  9.55404490e-01},
 95                       {7.08173682e-05, -9.2267     96                       {7.08173682e-05, -9.22676286e-03,  9.50088329e-01},
 96                       {6.35839062e-05, -8.6364     97                       {6.35839062e-05, -8.63645973e-03,  9.24583535e-01},
 97                       {8.21929628e-05,  4.0192     98                       {8.21929628e-05,  4.01922936e-03,  1.152121164e00},
 98                       {6.21335718e-05, -8.4565     99                       {6.21335718e-05, -8.45651858e-03,  9.14717276e-01},
 99                       {6.81386135e-05, -8.9914    100                       {6.81386135e-05, -8.99142394e-03,  9.21954824e-01},
100                       {7.32627297e-05, -9.3690    101                       {7.32627297e-05, -9.36908697e-03,  9.20107976e-01},
101                       {8.06505279e-05, -9.9541    102                       {8.06505279e-05, -9.95416671e-03,  9.27890410e-01},
102                       {8.33208285e-05, -1.0107    103                       {8.33208285e-05, -1.01073057e-02,  9.17691654e-01},
103                       {8.96944680e-05, -1.0649    104                       {8.96944680e-05, -1.06491070e-02,  9.25496030e-01},
104                       {9.44608097e-05, -1.0894    105                       {9.44608097e-05, -1.08940419e-02,  9.17795511e-01},
105                       {1.01395704e-04, -1.1509    106                       {1.01395704e-04, -1.15098159e-02,  9.29395462e-01},
106                       {6.81110009e-05, -8.9161    107                       {6.81110009e-05, -8.91619352e-03,  9.00047566e-01},
107                       {7.21126359e-05, -9.2017    108                       {7.21126359e-05, -9.20179363e-03,  8.95722889e-01},
108                       {7.82371142e-05, -9.6705    109                       {7.82371142e-05, -9.67050621e-03,  8.99574933e-01},
109                       {8.27256297e-05, -9.9935    110                       {8.27256297e-05, -9.99353009e-03,  8.97461897e-01},
110                       {7.29458059e-05, -9.2241    111                       {7.29458059e-05, -9.22415170e-03,  8.80996165e-01},
111                       {8.02383914e-05, -9.7829    112                       {8.02383914e-05, -9.78291439e-03,  8.88964070e-01},
112                       {8.50641730e-05, -1.0109    113                       {8.50641730e-05, -1.01099145e-02,  8.87304833e-01},
113                       {9.10537157e-05, -1.0530    114                       {9.10537157e-05, -1.05303084e-02,  8.89438514e-01},
114                       {9.43014320e-05, -1.0713    115                       {9.43014320e-05, -1.07133543e-02,  8.82632055e-01},
115                       {1.02655616e-04, -1.1315    116                       {1.02655616e-04, -1.13154691e-02,  8.91617174e-01},
116                       {1.06118094e-04, -1.1497    117                       {1.06118094e-04, -1.14971777e-02,  8.85181637e-01},
117                       {9.08474473e-05, -1.0429    118                       {9.08474473e-05, -1.04296303e-02,  8.71942958e-01},
118                       {9.35633054e-05, -1.0561    119                       {9.35633054e-05, -1.05612167e-02,  8.63930371e-01},
119                       {1.01940441e-04, -1.1157    120                       {1.01940441e-04, -1.11573929e-02,  8.73153437e-01},
120                       {9.19501202e-05, -1.0422    121                       {9.19501202e-05, -1.04229157e-02,  8.58681822e-01},
121                       {9.42991674e-05, -1.0509    122                       {9.42991674e-05, -1.05098872e-02,  8.49103546e-01},
122                       {1.02747171e-04, -1.1137    123                       {1.02747171e-04, -1.11371417e-02,  8.60434431e-01},
123                       {1.05024967e-04, -1.1213    124                       {1.05024967e-04, -1.12138980e-02,  8.51101942e-01},
124                       {1.14130011e-04, -1.1869    125                       {1.14130011e-04, -1.18692049e-02,  8.62838259e-01},
125                       {1.15163673e-04, -1.1855    126                       {1.15163673e-04, -1.18553822e-02,  8.51306646e-01},
126                       {1.27169055e-04, -1.2703    127                       {1.27169055e-04, -1.27033210e-02,  8.68623539e-01},
127                       {1.24195213e-04, -1.2404    128                       {1.24195213e-04, -1.24047085e-02,  8.48974077e-01},
128                       {1.12616150e-04, -1.1513    129                       {1.12616150e-04, -1.15135023e-02,  8.19708800e-01},
129                       {1.23637465e-04, -1.2286    130                       {1.23637465e-04, -1.22869889e-02,  8.35392018e-01},
130                       {1.22724317e-04, -1.2167    131                       {1.22724317e-04, -1.21677963e-02,  8.22569523e-01},
131                       {1.33891595e-04, -1.2926    132                       {1.33891595e-04, -1.29267762e-02,  8.37122909e-01} };
132                                                   133 
133    G4double a;  /* Watt Parameters */             134    G4double a;  /* Watt Parameters */
134    G4double b=1.0;                                135    G4double b=1.0;
135                                                   136 
136    G4double rand1,rand2;                          137    G4double rand1,rand2;
137    G4double x,y,z;                                138    G4double x,y,z;
138    G4double eSmp;                                 139    G4double eSmp;
139    G4int i;                                       140    G4int i;
140                                                   141 
141                                                   142 
142 /*                                                143 /*
143    Find Watt parameters for isotope               144    Find Watt parameters for isotope
144 */                                                145 */
145    G4int isoindex=-1;                             146    G4int isoindex=-1;
146    for (i=0; isoindex == -1 && i<nZAfis; i++)     147    for (i=0; isoindex == -1 && i<nZAfis; i++) {
147       if (iso == nZA[i]) isoindex = i;            148       if (iso == nZA[i]) isoindex = i;
148    }                                              149    }
149    if (isoindex == -1) {                          150    if (isoindex == -1) {
150       std::ostringstream o;                       151       std::ostringstream o;
151       o << iso;                                   152       o << iso;
152       const std::string& errMsg = "No Watt spe << 153       std::string errMsg = "No Watt spectrum available for iso " + o.str();
153       G4fissionerr(6, "SmpWatt", errMsg);         154       G4fissionerr(6, "SmpWatt", errMsg);
154    }                                              155    }
155                                                   156    
156    a= Watta[isoindex][2] + ePart*(Watta[isoind    157    a= Watta[isoindex][2] + ePart*(Watta[isoindex][1] + ePart*Watta[isoindex][0]);
157                                                   158 
158    x= 1. + (b/(8.*a));                            159    x= 1. + (b/(8.*a));
159    y= (x + std::sqrt(x*x-1.))/a;                  160    y= (x + std::sqrt(x*x-1.))/a;
160    z= a*y - 1.;                                   161    z= a*y - 1.;
161                                                   162 
162    G4int icounter = 0;                            163    G4int icounter = 0;
163    G4int icounter_max = 1024;                     164    G4int icounter_max = 1024;
164    do {                                           165    do {
165                                                   166 
166       rand1= -G4Log(fisslibrng());                167       rand1= -G4Log(fisslibrng());
167       rand2= -G4Log(fisslibrng());                168       rand2= -G4Log(fisslibrng());
168       eSmp= y*rand1;                              169       eSmp= y*rand1;
169                                                   170 
170       icounter++;                                 171       icounter++;
171       if ( icounter > icounter_max ) {            172       if ( icounter > icounter_max ) { 
172    G4cout << "Loop-counter exceeded the thresh    173    G4cout << "Loop-counter exceeded the threshold value at " << __LINE__ << "th line of " << __FILE__ << "." << G4endl;
173          break;                                   174          break;
174       }                                           175       }
175                                                   176 
176    } while ((rand2-z*(rand1+1.))*(rand2-z*(ran    177    } while ((rand2-z*(rand1+1.))*(rand2-z*(rand1+1.)) > b*y*rand1 ||
177              eSmp < WATTEMIN || eSmp > WATTEMA    178              eSmp < WATTEMIN || eSmp > WATTEMAX);
178    // Loop checking, 11.03.2015, T. Koi           179    // Loop checking, 11.03.2015, T. Koi
179                                                   180    
180    return eSmp;                                   181    return eSmp;
181 }                                                 182 }
182                                                   183