Changeset 1340 for trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclSpecialFunctions.cc
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclSpecialFunctions.cc
r1337 r1340 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4InuclSpecialFunctions.cc,v 1.2 0 2010/06/25 09:44:46 gunterExp $27 // Geant4 tag: $Name: geant4-09-04-beta-01$26 // $Id: G4InuclSpecialFunctions.cc,v 1.21 2010/09/14 17:51:36 mkelsey Exp $ 27 // Geant4 tag: $Name: hadr-casc-V09-03-85 $ 28 28 // 29 29 // 20100114 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly 30 // 20100914 M. Kelsey -- Migrate to integer A and Z. Discard pointless 31 // verbosity. 30 32 31 33 #include "G4InuclSpecialFunctions.hh" … … 35 37 #include <cmath> 36 38 37 G4double G4InuclSpecialFunctions::getAL(G4double A) {38 G4int verboseLevel = 2;39 39 40 if (verboseLevel > 3) { 41 G4cout << " >>> G4InuclSpecialFunctions::getAL" << G4endl; 42 } 43 40 G4double G4InuclSpecialFunctions::getAL(G4int A) { 44 41 return 0.76 + 2.2 / G4cbrt(A); 45 42 } 46 43 47 44 G4double G4InuclSpecialFunctions::csNN(G4double e) { 48 G4int verboseLevel = 2;49 50 if (verboseLevel > 3) {51 G4cout << " >>> G4InuclSpecialFunctions::csNN" << G4endl;52 }53 54 45 G4double snn; 55 46 56 47 if (e < 40.0) { 57 48 snn = -1174.8 / (e * e) + 3088.5 / e + 5.3107; 58 59 49 } else { 60 50 snn = 93074.0 / (e * e) - 11.148 / e + 22.429; 61 } ;51 } 62 52 63 53 return snn; … … 65 55 66 56 G4double G4InuclSpecialFunctions::csPN(G4double e) { 67 G4int verboseLevel = 2;68 69 if (verboseLevel > 3) {70 G4cout << " >>> G4InuclSpecialFunctions::csPN" << G4endl;71 }72 73 57 G4double spn; 74 58 75 59 if (e < 40.0) { 76 60 spn = -5057.4 / (e * e) + 9069.2 / e + 6.9466; 77 78 61 } else { 79 62 spn = 239380.0 / (e * e) + 1802.0 / e + 27.147; 80 } ;63 } 81 64 82 65 return spn; 83 66 } 84 67 85 G4double G4InuclSpecialFunctions::FermiEnergy(G4double A, G4double Z, G4int ntype) { 86 // calculates the nuclei Fermi energy for 0 - neutron and 1 - proton 87 G4int verboseLevel = 2; 68 // calculates the nuclei Fermi energy for 0 - neutron and 1 - proton 88 69 89 if (verboseLevel > 3) { 90 G4cout << " >>> G4InuclSpecialFunctions::FermiEnergy" << G4endl; 91 } 92 70 G4double G4InuclSpecialFunctions::FermiEnergy(G4int A, G4int Z, G4int ntype) { 93 71 const G4double C = 55.4; 94 G4double arg = (ntype==0) ? (A-Z)/A : Z/A;72 G4double arg = (ntype==0) ? G4double(A-Z)/A : G4double(Z)/A; 95 73 96 74 return C * G4cbrt(arg*arg); // 2/3 power … … 102 80 103 81 G4double G4InuclSpecialFunctions::inuclRndm() { 104 G4int verboseLevel = 2;105 106 if (verboseLevel > 3) {107 G4cout << " >>> G4InuclSpecialFunctions::inuclRndm" << G4endl;108 }109 110 82 G4double rnd = G4UniformRand(); 111 112 83 return rnd; 113 84 } 114 85 115 86 G4double G4InuclSpecialFunctions::randomGauss(G4double sigma) { 116 G4int verboseLevel = 2;117 118 if (verboseLevel > 3) {119 G4cout << " >>> G4InuclSpecialFunctions::randomGauss" << G4endl;120 }121 122 87 const G4double eps = 1.0e-6; 123 88 const G4double twopi = 6.2831854; … … 132 97 133 98 G4double G4InuclSpecialFunctions::randomPHI() { 134 G4int verboseLevel = 2;135 136 if (verboseLevel > 3) {137 G4cout << " >>> G4InuclSpecialFunctions::randomPHI" << G4endl;138 }139 140 99 const G4double twopi = 6.2831853; 141 142 100 return twopi * inuclRndm(); 143 101 } 144 102 145 103 std::pair<G4double, G4double> G4InuclSpecialFunctions::randomCOS_SIN() { 146 G4int verboseLevel = 2;147 148 if (verboseLevel > 3) {149 G4cout << " >>> G4InuclSpecialFunctions::randomCOS_SIN" << G4endl;150 }151 152 104 G4double CT = 1.0 - 2.0 * inuclRndm(); 153 105 154 return std::pair<G4double, G4double>(CT, std::sqrt(1.0 - CT *CT));106 return std::pair<G4double, G4double>(CT, std::sqrt(1.0 - CT*CT)); 155 107 } 156 108 … … 158 110 G4InuclSpecialFunctions::generateWithFixedTheta(G4double ct, G4double p, 159 111 G4double m) { 160 const G4int verboseLevel = 0;161 if (verboseLevel > 3) {162 G4cout << " >>> G4InuclSpecialFunctions::generateWithFixedTheta" << G4endl;163 }164 165 112 G4double phi = randomPHI(); 166 113 G4double pt = p * std::sqrt(std::fabs(1.0 - ct * ct));
Note: See TracChangeset
for help on using the changeset viewer.