- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/de_excitation/fermi_breakup/include/G4FermiPhaseSpaceDecay.hh
r819 r1315 33 33 #include "G4LorentzVector.hh" 34 34 #include "G4ParticleMomentum.hh" 35 #include "Randomize.hh" 36 #include "G4Pow.hh" 35 37 #include <CLHEP/Random/RandGamma.h> 36 38 … … 41 43 { 42 44 public: 43 inline G4FermiPhaseSpaceDecay(); 44 inline ~G4FermiPhaseSpaceDecay(); 45 46 G4FermiPhaseSpaceDecay(); 47 ~G4FermiPhaseSpaceDecay(); 45 48 46 49 inline std::vector<G4LorentzVector*> * … … 48 51 49 52 private: 50 inline G4FermiPhaseSpaceDecay(const G4FermiPhaseSpaceDecay&); 51 inline const G4FermiPhaseSpaceDecay & operator=(const G4FermiPhaseSpaceDecay &); 52 inline G4bool operator==(const G4FermiPhaseSpaceDecay&); 53 inline G4bool operator!=(const G4FermiPhaseSpaceDecay&); 53 54 G4FermiPhaseSpaceDecay(const G4FermiPhaseSpaceDecay&); 55 const G4FermiPhaseSpaceDecay & operator=(const G4FermiPhaseSpaceDecay &); 56 G4bool operator==(const G4FermiPhaseSpaceDecay&); 57 G4bool operator!=(const G4FermiPhaseSpaceDecay&); 54 58 55 59 inline G4double PtwoBody(G4double E, G4double P1, G4double P2) const; … … 69 73 }; 70 74 71 #include "G4FermiPhaseSpaceDecay.icc" 75 inline G4double 76 G4FermiPhaseSpaceDecay::PtwoBody(G4double E, G4double P1, G4double P2) const 77 { 78 G4double res = -1.0; 79 G4double P = (E+P1+P2)*(E+P1-P2)*(E-P1+P2)*(E-P1-P2)/(4.0*E*E); 80 if (P>0.0) { res = std::sqrt(P); } 81 return res; 82 } 83 84 inline std::vector<G4LorentzVector*> * G4FermiPhaseSpaceDecay:: 85 Decay(const G4double parent_mass, const std::vector<G4double>& fragment_masses) const 86 { 87 return KopylovNBodyDecay(parent_mass,fragment_masses); 88 } 89 90 inline G4double 91 G4FermiPhaseSpaceDecay::BetaKopylov(const G4int K) const 92 { 93 //JMQ 250410 old algorithm has been commented 94 // Notice that alpha > beta always 95 // const G4double beta = 1.5; 96 // G4double alpha = 1.5*(K-1); 97 // G4double Y1 = CLHEP::RandGamma::shoot(alpha,1); 98 // G4double Y2 = CLHEP::RandGamma::shoot(beta,1); 99 100 // return Y1/(Y1+Y2); 101 102 G4Pow* g4pow = G4Pow::GetInstance(); 103 G4int N = 3*K - 5; 104 G4double xN = G4double(N); 105 G4double F; 106 //G4double Fmax = std::pow((3.*K-5.)/(3.*K-4.),(3.*K-5.)/2.)*std::sqrt(1-((3.*K-5.)/(3.*K-4.))); 107 // VI variant 108 G4double Fmax = std::sqrt(g4pow->powZ(N, xN/(xN + 1))/(xN + 1)); 109 G4double chi; 110 do 111 { 112 chi = G4UniformRand(); 113 F = std::sqrt(g4pow->powZ(N, chi)*(1-chi)); 114 } while ( Fmax*G4UniformRand() > F); 115 return chi; 116 117 } 72 118 73 119 #endif
Note: See TracChangeset
for help on using the changeset viewer.