Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // This software was developed by Lawrence Liv 28 // 29 // Redistribution and use in source and binary 30 // modification, are permitted provided that t 31 // 32 // 1. Redistributions of source code must reta 33 // this list of conditions and the following 34 // 2. Redistributions in binary form must repr 35 // this list of conditions and the following 36 // and/or other materials provided with the 37 // 3. The name of the author may not be used t 38 // derived from this software without specif 39 // 40 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``A 41 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 42 // MERCHANTABILITY AND FITNESS FOR A PARTICULA 43 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DI 44 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGE 45 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES 46 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AN 47 // WHETHER IN CONTRACT, STRICT LIABILITY, OR T 48 // OTHERWISE) ARISING IN ANY WAY OUT OF THE US 49 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 50 // 51 // Copyright (c) 2006 The Regents of the Unive 52 // All rights reserved. 53 // UCRL-CODE-224807 54 // 55 // 56 // 57 58 #define nZAfis 39 /* 38 fissionable isotope 59 #define WATTEMIN 1.0e-6 60 #define WATTEMAX 20.0 61 62 #include <cmath> 63 #include "G4Log.hh" 64 #include "G4fissionEvent.hh" 65 66 G4double G4fissionEvent::G4SmpWatt(G4double eP 67 68 /* 69 Description 70 Sample Watt Spectrum as in TART (Kalos alg 71 */ 72 73 /* 74 Input 75 ePart - energy of incoming particle 76 iso - isotope 77 Output 78 - energy of incoming particle 79 */ 80 81 static G4int nZA [nZAfis]= { 82 90231, 90232, 90233, 83 91233, 84 92232, 92233, 92234, 92235, 9 85 93235, 93236, 93237, 93238, 86 94237, 94238, 94239, 94240, 9 87 95241, 95242, 95243, 88 96242, 96243, 96244, 96245, 9 89 97249, 90 98249, 98250, 98251, 98252}; 91 92 static G4double Watta [nZAfis][3] = { 93 {6.00949285e-05, -8.3669 94 {6.54348443e-05, -8.8657 95 {7.08173682e-05, -9.2267 96 {6.35839062e-05, -8.6364 97 {8.21929628e-05, 4.0192 98 {6.21335718e-05, -8.4565 99 {6.81386135e-05, -8.9914 100 {7.32627297e-05, -9.3690 101 {8.06505279e-05, -9.9541 102 {8.33208285e-05, -1.0107 103 {8.96944680e-05, -1.0649 104 {9.44608097e-05, -1.0894 105 {1.01395704e-04, -1.1509 106 {6.81110009e-05, -8.9161 107 {7.21126359e-05, -9.2017 108 {7.82371142e-05, -9.6705 109 {8.27256297e-05, -9.9935 110 {7.29458059e-05, -9.2241 111 {8.02383914e-05, -9.7829 112 {8.50641730e-05, -1.0109 113 {9.10537157e-05, -1.0530 114 {9.43014320e-05, -1.0713 115 {1.02655616e-04, -1.1315 116 {1.06118094e-04, -1.1497 117 {9.08474473e-05, -1.0429 118 {9.35633054e-05, -1.0561 119 {1.01940441e-04, -1.1157 120 {9.19501202e-05, -1.0422 121 {9.42991674e-05, -1.0509 122 {1.02747171e-04, -1.1137 123 {1.05024967e-04, -1.1213 124 {1.14130011e-04, -1.1869 125 {1.15163673e-04, -1.1855 126 {1.27169055e-04, -1.2703 127 {1.24195213e-04, -1.2404 128 {1.12616150e-04, -1.1513 129 {1.23637465e-04, -1.2286 130 {1.22724317e-04, -1.2167 131 {1.33891595e-04, -1.2926 132 133 G4double a; /* Watt Parameters */ 134 G4double b=1.0; 135 136 G4double rand1,rand2; 137 G4double x,y,z; 138 G4double eSmp; 139 G4int i; 140 141 142 /* 143 Find Watt parameters for isotope 144 */ 145 G4int isoindex=-1; 146 for (i=0; isoindex == -1 && i<nZAfis; i++) 147 if (iso == nZA[i]) isoindex = i; 148 } 149 if (isoindex == -1) { 150 std::ostringstream o; 151 o << iso; 152 const std::string& errMsg = "No Watt spe 153 G4fissionerr(6, "SmpWatt", errMsg); 154 } 155 156 a= Watta[isoindex][2] + ePart*(Watta[isoind 157 158 x= 1. + (b/(8.*a)); 159 y= (x + std::sqrt(x*x-1.))/a; 160 z= a*y - 1.; 161 162 G4int icounter = 0; 163 G4int icounter_max = 1024; 164 do { 165 166 rand1= -G4Log(fisslibrng()); 167 rand2= -G4Log(fisslibrng()); 168 eSmp= y*rand1; 169 170 icounter++; 171 if ( icounter > icounter_max ) { 172 G4cout << "Loop-counter exceeded the thresh 173 break; 174 } 175 176 } while ((rand2-z*(rand1+1.))*(rand2-z*(ran 177 eSmp < WATTEMIN || eSmp > WATTEMA 178 // Loop checking, 11.03.2015, T. Koi 179 180 return eSmp; 181 } 182