[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
[1196] | 27 | // $Id: G4FermiConfiguration.cc,v 1.10 2009/11/19 10:41:59 vnivanch Exp $ |
---|
| 28 | // GEANT4 tag $Name: geant4-09-03-cand-01 $ |
---|
[819] | 29 | // |
---|
| 30 | // Hadronic Process: Nuclear De-excitations |
---|
| 31 | // by V. Lara (Nov 1998) |
---|
| 32 | // |
---|
[1196] | 33 | // J.M.Quesada (12 October 2009) new implementation of Gamma function in configuration weight |
---|
[819] | 34 | |
---|
| 35 | |
---|
| 36 | #include "G4FermiConfiguration.hh" |
---|
| 37 | #include "G4FermiPhaseSpaceDecay.hh" |
---|
| 38 | #include <set> |
---|
| 39 | |
---|
| 40 | // Kappa = V/V_0 it is used in calculation of Coulomb energy |
---|
| 41 | // Kappa is adimensional |
---|
| 42 | const G4double G4FermiConfiguration::Kappa = 1.0; |
---|
| 43 | |
---|
| 44 | // r0 is the nuclear radius |
---|
| 45 | const G4double G4FermiConfiguration::r0 = 1.3*fermi; |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | G4double G4FermiConfiguration::CoulombBarrier(void) |
---|
| 49 | { |
---|
| 50 | // Calculates Coulomb Barrier (MeV) for given channel with K fragments. |
---|
| 51 | const G4double Coef = (3./5.)*(elm_coupling/r0)*std::pow(1./(1.+Kappa), 1./3.); |
---|
| 52 | |
---|
| 53 | G4double SumA = 0; |
---|
| 54 | G4double SumZ = 0; |
---|
| 55 | G4double CoulombEnergy = 0.; |
---|
| 56 | for (std::vector<const G4VFermiFragment*>::iterator i = Configuration.begin(); |
---|
| 57 | i != Configuration.end(); i++) |
---|
| 58 | { |
---|
| 59 | G4double z = static_cast<G4double>((*i)->GetZ()); |
---|
| 60 | G4double a = static_cast<G4double>((*i)->GetA()); |
---|
| 61 | CoulombEnergy += (z*z) / std::pow(a, 1./3.); |
---|
| 62 | SumA += a; |
---|
| 63 | SumZ += z; |
---|
| 64 | } |
---|
| 65 | CoulombEnergy -= SumZ*SumZ/std::pow(SumA, 1./3.); |
---|
| 66 | return -Coef * CoulombEnergy; |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | G4double G4FermiConfiguration::DecayProbability(const G4int A, const G4double TotalE) |
---|
| 73 | // Decay probability for a given channel with K fragments |
---|
| 74 | { |
---|
| 75 | // A: Atomic Weight |
---|
| 76 | // TotalE: Total energy of nucleus |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | G4double KineticEnergy = TotalE; // MeV |
---|
| 80 | G4double ProdMass = 1.0; |
---|
| 81 | G4double SumMass = 0.0; |
---|
| 82 | G4double S_n = 1.0; |
---|
| 83 | std::set<G4int> combSet; |
---|
| 84 | std::multiset<G4int> combmSet; |
---|
| 85 | |
---|
| 86 | for (std::vector<const G4VFermiFragment*>::iterator i = Configuration.begin(); |
---|
| 87 | i != Configuration.end(); i++) |
---|
| 88 | { |
---|
| 89 | G4int a = (*i)->GetA(); |
---|
| 90 | combSet.insert(a); |
---|
| 91 | combmSet.insert(a); |
---|
| 92 | G4double m = (*i)->GetFragmentMass(); |
---|
| 93 | ProdMass *= m; |
---|
| 94 | SumMass += m; |
---|
| 95 | // Spin factor S_n |
---|
| 96 | S_n *= (*i)->GetPolarization(); |
---|
| 97 | KineticEnergy -= m + (*i)->GetExcitationEnergy(); |
---|
| 98 | } |
---|
| 99 | |
---|
| 100 | // Check that there is enough energy to produce K fragments |
---|
| 101 | if (KineticEnergy <= 0.0) return 0.0; |
---|
| 102 | if ((KineticEnergy -= this->CoulombBarrier()) <= 0.0) return 0.0; |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | G4double MassFactor = ProdMass/SumMass; |
---|
| 106 | MassFactor *= std::sqrt(MassFactor); |
---|
| 107 | |
---|
| 108 | // Number of fragments |
---|
| 109 | G4int K = Configuration.size(); |
---|
| 110 | |
---|
| 111 | // This is the constant (doesn't depend on nucleus) part |
---|
| 112 | const G4double ConstCoeff = std::pow(r0/hbarc,3.0)*Kappa*std::sqrt(2.0/pi)/3.0; |
---|
| 113 | G4double Coeff = std::pow(ConstCoeff*A,K-1); |
---|
| 114 | |
---|
[1196] | 115 | //JMQ 111009 Bug fixed: gamma function for odd K was wrong by a factor 2 |
---|
| 116 | // new implementation explicitely according to standard properties of Gamma function |
---|
[819] | 117 | // Calculation of 1/Gamma(3(k-1)/2) |
---|
| 118 | G4double Gamma = 1.0; |
---|
[1196] | 119 | // G4double arg = 3.0*(K-1)/2.0 - 1.0; |
---|
| 120 | // while (arg > 1.1) |
---|
| 121 | // { |
---|
| 122 | // Gamma *= arg; |
---|
| 123 | // arg--; |
---|
| 124 | // } |
---|
| 125 | // if ((K-1)%2 == 1) Gamma *= std::sqrt(pi); |
---|
| 126 | |
---|
| 127 | if ((K-1)%2 != 1) |
---|
| 128 | |
---|
[819] | 129 | { |
---|
[1196] | 130 | G4double arg = 3.0*(K-1)/2.0 - 1.0; |
---|
| 131 | while (arg > 1.1) |
---|
| 132 | { |
---|
| 133 | Gamma *= arg; |
---|
| 134 | arg--; |
---|
| 135 | } |
---|
[819] | 136 | } |
---|
[1196] | 137 | else { |
---|
| 138 | G4double n= 3.0*K/2.0-2.0; |
---|
| 139 | G4double arg2=2*n-1; |
---|
| 140 | while (arg2>1.1) |
---|
| 141 | { |
---|
| 142 | Gamma*=arg2; |
---|
| 143 | arg2-=2; |
---|
| 144 | } |
---|
| 145 | Gamma=Gamma/std::pow(2,n)*sqrt(pi); |
---|
| 146 | } |
---|
| 147 | // end of new implementation of Gamma function |
---|
[819] | 148 | |
---|
| 149 | |
---|
| 150 | // Permutation Factor G_n |
---|
| 151 | G4double G_n = 1.0; |
---|
| 152 | for (std::set<G4int>::iterator s = combSet.begin(); s != combSet.end(); ++s) |
---|
| 153 | { |
---|
| 154 | for (G4int ni = combmSet.count(*s); ni > 1; ni--) G_n *= ni; |
---|
| 155 | } |
---|
| 156 | |
---|
| 157 | G4double Weight = Coeff * MassFactor * (S_n / G_n) / Gamma; |
---|
| 158 | Weight *= std::pow(KineticEnergy,3.0*(K-1)/2.0)/KineticEnergy; |
---|
| 159 | |
---|
| 160 | return Weight; |
---|
| 161 | } |
---|
| 162 | |
---|
| 163 | |
---|
| 164 | G4FragmentVector * G4FermiConfiguration::GetFragments(const G4Fragment & theNucleus) |
---|
| 165 | { |
---|
| 166 | |
---|
| 167 | G4FermiPhaseSpaceDecay thePhaseSpace; |
---|
| 168 | |
---|
| 169 | // Calculate Momenta of K fragments |
---|
| 170 | G4double M = theNucleus.GetMomentum().m(); |
---|
| 171 | std::vector<G4double> m; |
---|
| 172 | m.reserve(Configuration.size()); |
---|
| 173 | std::vector<const G4VFermiFragment*>::iterator i; |
---|
| 174 | for (i = Configuration.begin(); i != Configuration.end(); ++i) |
---|
| 175 | { |
---|
| 176 | m.push_back( (*i)->GetTotalEnergy() ); |
---|
| 177 | } |
---|
| 178 | std::vector<G4LorentzVector*>* MomentumComponents = |
---|
| 179 | thePhaseSpace.Decay(M,m); |
---|
| 180 | |
---|
| 181 | G4FragmentVector * theResult = new G4FragmentVector; |
---|
| 182 | |
---|
| 183 | G4ThreeVector boostVector = theNucleus.GetMomentum().boostVector(); |
---|
| 184 | |
---|
| 185 | // Go back to the Lab Frame |
---|
| 186 | for (i = Configuration.begin(); i != Configuration.end(); ++i) |
---|
| 187 | { |
---|
| 188 | #ifdef G4NO_ISO_VECDIST |
---|
| 189 | std::vector<const G4VFermiFragment*>::difference_type n = 0; |
---|
| 190 | std::distance(Configuration.begin(), i, n); |
---|
| 191 | G4LorentzVector FourMomentum(*(MomentumComponents->operator[](n))); |
---|
| 192 | #else |
---|
| 193 | G4LorentzVector FourMomentum(*(MomentumComponents-> |
---|
| 194 | operator[](std::distance(Configuration.begin(),i)))); |
---|
| 195 | #endif |
---|
| 196 | |
---|
| 197 | // Lorentz boost |
---|
| 198 | FourMomentum.boost(boostVector); |
---|
| 199 | |
---|
| 200 | G4FragmentVector * fragment = (*i)->GetFragment(FourMomentum); |
---|
| 201 | |
---|
| 202 | |
---|
| 203 | for (G4FragmentVector::reverse_iterator ri = fragment->rbegin(); |
---|
| 204 | ri != fragment->rend(); ++ri) |
---|
| 205 | { |
---|
| 206 | theResult->push_back(*ri); |
---|
| 207 | } |
---|
| 208 | delete fragment; |
---|
| 209 | } |
---|
| 210 | |
---|
| 211 | if (!MomentumComponents->empty()) |
---|
| 212 | { |
---|
| 213 | std::for_each(MomentumComponents->begin(),MomentumComponents->end(), |
---|
| 214 | DeleteFragment()); |
---|
| 215 | } |
---|
| 216 | |
---|
| 217 | delete MomentumComponents; |
---|
| 218 | |
---|
| 219 | return theResult; |
---|
| 220 | } |
---|
| 221 | |
---|
| 222 | |
---|
| 223 | G4ParticleMomentum G4FermiConfiguration::IsotropicVector(const G4double Magnitude) |
---|
| 224 | // Samples a isotropic random vectorwith a magnitud given by Magnitude. |
---|
| 225 | // By default Magnitude = 1.0 |
---|
| 226 | { |
---|
| 227 | G4double CosTheta = 1.0 - 2.0*G4UniformRand(); |
---|
| 228 | G4double SinTheta = std::sqrt(1.0 - CosTheta*CosTheta); |
---|
| 229 | G4double Phi = twopi*G4UniformRand(); |
---|
| 230 | G4ParticleMomentum Vector(Magnitude*std::cos(Phi)*SinTheta, |
---|
| 231 | Magnitude*std::sin(Phi)*SinTheta, |
---|
| 232 | Magnitude*CosTheta); |
---|
| 233 | return Vector; |
---|
| 234 | } |
---|