Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/de_excitation/fermi_breakup/include/G4FermiPhaseSpaceDecay.hh

    r819 r1315  
    3333#include "G4LorentzVector.hh"
    3434#include "G4ParticleMomentum.hh"
     35#include "Randomize.hh"
     36#include "G4Pow.hh"
    3537#include <CLHEP/Random/RandGamma.h>
    3638
     
    4143{
    4244public:
    43   inline G4FermiPhaseSpaceDecay();
    44   inline ~G4FermiPhaseSpaceDecay();
     45
     46  G4FermiPhaseSpaceDecay();
     47  ~G4FermiPhaseSpaceDecay();
    4548 
    4649  inline std::vector<G4LorentzVector*> *
     
    4851
    4952private:
    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&);
    5458
    5559  inline G4double PtwoBody(G4double E, G4double P1, G4double P2) const;
     
    6973};
    7074
    71 #include "G4FermiPhaseSpaceDecay.icc"
     75inline G4double
     76G4FermiPhaseSpaceDecay::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
     84inline std::vector<G4LorentzVector*> * G4FermiPhaseSpaceDecay::
     85Decay(const G4double parent_mass, const std::vector<G4double>& fragment_masses) const
     86{
     87  return KopylovNBodyDecay(parent_mass,fragment_masses);
     88}
     89
     90inline G4double
     91G4FermiPhaseSpaceDecay::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}
    72118
    73119#endif
Note: See TracChangeset for help on using the changeset viewer.