Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

Location:
trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4GNASHTransitions.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4GNASHTransitions.cc,v 1.6 2010/08/20 07:42:19 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
     29// 20.08.2010 V.Ivanchenko move constructor and destructor to the source
     30
    2631#include "G4GNASHTransitions.hh"
    2732#include "G4PreCompoundParameters.hh"
    2833#include "G4HadronicException.hh"
    2934
    30 const G4GNASHTransitions & G4GNASHTransitions::
    31 operator=(const G4GNASHTransitions & )
    32 {
    33   throw G4HadronicException(__FILE__, __LINE__, "G4GNASHTransitions::operator= meant to not be accesable");
    34   return *this;
    35 }
     35G4GNASHTransitions::G4GNASHTransitions()
     36{}
    3637
    37 G4bool G4GNASHTransitions::operator==(const G4GNASHTransitions & ) const
    38 {
    39   return false;
    40 }
    41 
    42 G4bool G4GNASHTransitions::operator!=(const G4GNASHTransitions & ) const
    43 {
    44   return true;
    45 }
    46 
     38G4GNASHTransitions::~G4GNASHTransitions()
     39{}
    4740
    4841G4double G4GNASHTransitions::
     
    7265  Probability *= theMatrixElement;
    7366
    74 
    7567  return Probability;
    7668}
    7769
    78 G4Fragment G4GNASHTransitions::
    79 PerformTransition(const G4Fragment & aFragment)
     70void G4GNASHTransitions::PerformTransition(G4Fragment & result)
    8071{
    81   G4Fragment result(aFragment);
    8272  result.SetNumberOfParticles(result.GetNumberOfParticles()+1);
    8373  result.SetNumberOfHoles(result.GetNumberOfHoles()+1);
     
    9181      result.SetNumberOfCharged(result.GetNumberOfParticles());
    9282    }
    93 
    94   return result;
    9583}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4HETCAlpha.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4HETCAlpha.cc,v 1.4 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
     29// by V. Lara
     30//
     31// Modified:
     32// 23.08.2010 V.Ivanchenko general cleanup, move constructor and destructor
     33//            the source, use G4Pow
     34
    2635#include "G4HETCAlpha.hh"
     36#include "G4Alpha.hh"
     37
     38G4HETCAlpha::G4HETCAlpha()
     39  : G4HETCChargedFragment(G4Alpha::Alpha(), &theAlphaCoulombBarrier)
     40{}
     41
     42G4HETCAlpha::~G4HETCAlpha()
     43{}
     44
     45G4double G4HETCAlpha::GetAlpha()
     46{
     47  G4double C = 0.0;
     48  G4int aZ = GetZ() + GetRestZ();
     49  if (aZ <= 30)
     50    {
     51      C = 0.10;
     52    }
     53  else if (aZ <= 50)
     54    {
     55      C = 0.1 + -((aZ-50.)/20.)*0.02;
     56    }
     57  else if (aZ < 70)
     58    {
     59      C = 0.08 + -((aZ-70.)/20.)*0.02;
     60    }
     61  else
     62    {
     63      C = 0.06;
     64    }
     65  return 1.0+C;
     66}
     67 
     68G4double G4HETCAlpha::GetBeta()
     69{
     70  return -GetCoulombBarrier();
     71}
     72 
     73G4double G4HETCAlpha::GetSpinFactor()
     74{
     75  return 1.0;
     76}
    2777
    2878G4double G4HETCAlpha::K(const G4Fragment & aFragment)
    2979{
    30   if (GetStage() != 1) return 1.0;
    31   // Number of protons in projectile
    32   G4double Pa = static_cast<G4int>(aFragment.GetParticleDefinition()->GetPDGCharge());
    33   // Number of neutrons in projectile
    34   G4double Na = aFragment.GetParticleDefinition()->GetBaryonNumber();
    35   G4double TargetA = aFragment.GetA() - Na;
    36   G4double TargetZ = aFragment.GetZ() - Pa;
    37   Na -= Pa;
    38   G4double r = TargetZ/TargetA;
     80  // Number of protons in emitted fragment
     81  G4int Pa = GetZ();
     82  // Number of neutrons in emitted fragment
     83  G4int Na = GetA() - Pa;
    3984
    40  
    41   G4double P = aFragment.GetNumberOfParticles();
    42   G4double H = aFragment.GetNumberOfHoles();
     85  G4int TargetZ = GetRestZ();
     86  G4int TargetA = GetRestA();
     87  G4double r = G4double(TargetZ)/G4double(TargetA);
     88
     89  G4int P = aFragment.GetNumberOfParticles();
     90  G4int H = aFragment.GetNumberOfHoles();
    4391
    4492  G4double result = 0.0;
     
    52100         Pa*(Pa-1.0)*Na*(Na-1.0));
    53101
    54       result /= 6.0*std::pow((TargetZ/TargetA)*((TargetA-TargetZ)/TargetA),2.0);
     102      result /= 6.0*r*r*(1. - r) *(1. - r);
    55103    }
    56 
    57104  return std::max(0.0,result);
    58 
    59105}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4HETCChargedFragment.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4HETCChargedFragment.cc,v 1.3 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
    2629// by V. Lara
     30//
     31// Modified:
     32// 23.08.2010 V.Ivanchenko general cleanup, move constructor and destructor
     33//            the source, use G4Pow
     34//
    2735
    2836#include "G4HETCChargedFragment.hh"
     37#include "G4VCoulombBarrier.hh"
    2938#include "G4PreCompoundParameters.hh"
    3039
     40G4HETCChargedFragment::G4HETCChargedFragment(
     41  const G4ParticleDefinition* pd, G4VCoulombBarrier * aCoulombBarrier)
     42  : G4HETCFragment(pd, aCoulombBarrier)
     43{}
     44
     45G4HETCChargedFragment::~G4HETCChargedFragment()
     46{}
    3147
    3248G4double G4HETCChargedFragment::
    3349GetKineticEnergy(const G4Fragment & aFragment)
    3450{
    35   // Number of protons in projectile
    36   G4double Pa = aFragment.GetParticleDefinition()->GetPDGCharge();
    37   // Number of neutrons in projectile
    38   G4double Na = aFragment.GetParticleDefinition()->GetBaryonNumber();
    39   Na -= Pa;
    40  
    41   G4double Pb = aFragment.GetNumberOfParticles();
    42   G4double H = aFragment.GetNumberOfHoles();
     51  G4int Pb = aFragment.GetNumberOfParticles();
     52  G4int H = aFragment.GetNumberOfHoles();
    4353
    44   G4double Ab = std::max(0.0,(Pb*Pb+H*H+Pb-3*H)/4.0);
     54  G4double g0 = (6.0/pi2)*aFragment.GetA_asInt()*theParameters->GetLevelDensity();
     55
     56  G4double Ab = std::max(0.0,G4double(Pb*Pb+H*H+Pb-3*H)/(4.0*g0));
    4557  G4double Emax = GetMaximalKineticEnergy() - Ab;
    4658
    47   G4double x = BetaRand(static_cast<G4int>(Pb+H),2);
     59  G4double x = BetaRand(Pb + H, 2);
    4860 
    4961  return Emax - (Emax-GetCoulombBarrier())*x;
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4HETCDeuteron.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4HETCDeuteron.cc,v 1.3 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
     29// by V. Lara
     30//
     31// Modified:
     32// 23.08.2010 V.Ivanchenko general cleanup, move constructor and destructor
     33//            the source, use G4Pow
     34
    2635#include "G4HETCDeuteron.hh"
     36#include "G4Deuteron.hh"
     37
     38G4HETCDeuteron::G4HETCDeuteron()
     39  : G4HETCChargedFragment(G4Deuteron::Deuteron(), &theDeuteronCoulombBarrier)
     40{}
     41
     42G4HETCDeuteron::~G4HETCDeuteron()
     43{}
     44
     45G4double G4HETCDeuteron::GetAlpha()
     46{
     47  G4double C = 0.0;
     48  G4int aZ = GetZ() + GetRestZ();
     49  if (aZ >= 70)
     50    {
     51      C = 0.10;
     52    }
     53  else
     54    {
     55      C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
     56    }
     57  return 1.0 + C/2.0;
     58}
     59 
     60G4double G4HETCDeuteron::GetBeta()
     61{
     62  return -GetCoulombBarrier();
     63}
     64
     65G4double G4HETCDeuteron::GetSpinFactor()
     66{
     67  // 2s+1
     68  return 3.0;
     69}
    2770
    2871G4double G4HETCDeuteron::K(const G4Fragment & aFragment)
    2972{
    30   if (GetStage() != 1) return 1.0;
    31   // Number of protons in projectile
    32   G4double Pa = static_cast<G4int>(aFragment.GetParticleDefinition()->GetPDGCharge());
    33   // Number of neutrons in projectile
    34   G4double Na = aFragment.GetParticleDefinition()->GetBaryonNumber();
    35   G4double TargetA = aFragment.GetA() - Na;
    36   G4double TargetZ = aFragment.GetZ() - Pa;
    37   Na -= Pa;
    38   G4double r = TargetZ/TargetA;
     73  // Number of protons in emitted fragment
     74  G4int Pa = GetZ();
     75  // Number of neutrons in emitted fragment
     76  G4int Na = GetA() - Pa;
    3977
     78  G4int TargetZ = GetRestZ();
     79  G4int TargetA = GetRestA();
     80  G4double r = G4double(TargetZ)/G4double(TargetA);
    4081 
    41   G4double P = aFragment.GetNumberOfParticles();
    42   G4double H = aFragment.GetNumberOfHoles();
     82  G4int P = aFragment.GetNumberOfParticles();
     83  G4int H = aFragment.GetNumberOfHoles();
    4384
    4485  G4double result = 0.0;
     
    4788      result = 2.0* (H*(H-1.0)*r*(r-1.0)+H*(Na*r+Pa*(1.0-r)) + Pa*Na)/(P*(P-1.0));
    4889
    49       result /= (TargetZ/TargetA)*((TargetA-TargetZ)/TargetA);
     90      result /= r*(1.0 - r);
    5091    }
    51 
    5292  return std::max(0.0,result);
    53 
    5493}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4HETCEmissionFactory.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4HETCEmissionFactory.cc,v 1.5 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
     29// by V. Lara
     30//
     31// Modified:
     32// 23.08.2010 V.Ivanchenko general cleanup, move constructor and destructor
     33//            the source
     34//
     35
    2636#include "G4HETCEmissionFactory.hh"
    2737
     
    3343#include "G4HETCAlpha.hh"
    3444
     45G4HETCEmissionFactory::G4HETCEmissionFactory()
     46{}
    3547
    36 const G4HETCEmissionFactory & G4HETCEmissionFactory::
    37 operator=(const G4HETCEmissionFactory & )
    38 {
    39   throw G4HadronicException(__FILE__, __LINE__, "G4HETCEmissionFactory::operator= meant to not be accessable.");
    40   return *this;
    41 }
    42 
    43 G4bool G4HETCEmissionFactory::
    44 operator==(const G4HETCEmissionFactory & ) const
    45 {
    46   throw G4HadronicException(__FILE__, __LINE__, "G4HETCEmissionFactory::operator== meant to not be accessable.");
    47   return false;
    48 }
    49 
    50 G4bool G4HETCEmissionFactory::
    51 operator!=(const G4HETCEmissionFactory & ) const
    52 {
    53   throw G4HadronicException(__FILE__, __LINE__, "G4HETCEmissionFactory::operator!= meant to not be accessable.");
    54   return true;
    55 }
    56 
     48G4HETCEmissionFactory::~G4HETCEmissionFactory()
     49{}
    5750
    5851std::vector<G4VPreCompoundFragment*> *  G4HETCEmissionFactory::
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4HETCFragment.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4HETCFragment.cc,v 1.4 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
    2629// by V. Lara
     30//
     31// Modified:
     32// 23.08.2010 V.Ivanchenko general cleanup, move constructor and destructor
     33//            the source, use G4Pow
    2734 
    2835#include "G4HETCFragment.hh"
     
    3037
    3138G4HETCFragment::
    32 G4HETCFragment(const G4HETCFragment & right) :
    33   G4VPreCompoundFragment(right)
     39G4HETCFragment(const G4ParticleDefinition* part,
     40               G4VCoulombBarrier* aCoulombBarrier)
     41  : G4VPreCompoundFragment(part, aCoulombBarrier)
    3442{
     43  G4double r0 = theParameters->Getr0();
     44  r2norm = r0*r0/(CLHEP::pi*CLHEP::hbarc*CLHEP::hbarc*CLHEP::hbarc);
    3545}
    3646
    37 G4HETCFragment::
    38 G4HETCFragment(const G4double anA,
    39                const G4double aZ,
    40                G4VCoulombBarrier* aCoulombBarrier,
    41                const G4String & aName) :
    42   G4VPreCompoundFragment(anA,aZ,aCoulombBarrier,aName)
     47G4HETCFragment::~G4HETCFragment()
    4348{}
    44 
    45 G4HETCFragment::~G4HETCFragment()
    46 {
    47 }
    48 
    49 const G4HETCFragment & G4HETCFragment::
    50 operator= (const G4HETCFragment & right)
    51 {
    52   if (&right != this) this->G4VPreCompoundFragment::operator=(right);
    53   return *this;
    54 }
    55 
    56 G4int G4HETCFragment::operator==(const G4HETCFragment & right) const
    57 {
    58   return G4VPreCompoundFragment::operator==(right);
    59 }
    60 
    61 G4int G4HETCFragment::operator!=(const G4HETCFragment & right) const
    62 {
    63   return G4VPreCompoundFragment::operator!=(right);
    64 }
    65 
    66 
    6749
    6850G4double G4HETCFragment::
     
    7052{
    7153  if (GetEnergyThreshold() <= 0.0)
    72   {
     54    {
    7355      theEmissionProbability = 0.0;
    7456      return 0.0;
    75   }   
     57    }   
    7658  // Coulomb barrier is the lower limit
    7759  // of integration over kinetic energy
     
    8062  // Excitation energy of nucleus after fragment emission is the upper limit
    8163  // of integration over kinetic energy
    82   G4double UpperLimit = this->GetMaximalKineticEnergy();
     64  G4double UpperLimit = GetMaximalKineticEnergy();
    8365 
    84   theEmissionProbability = IntegrateEmissionProbability(LowerLimit,UpperLimit,aFragment);
     66  theEmissionProbability =
     67    IntegrateEmissionProbability(LowerLimit,UpperLimit,aFragment);
    8568   
    8669  return theEmissionProbability;
     
    9275{
    9376 
    94   if ( !IsItPossible(aFragment) ) return 0.0;
    95 
    96   const G4double r0 = G4PreCompoundParameters::GetAddress()->Getr0();
     77  if ( !IsItPossible(aFragment) ) { return 0.0; }
    9778   
    9879  G4double U = aFragment.GetExcitationEnergy();
    99   G4double P = aFragment.GetNumberOfParticles();
    100   G4double H = aFragment.GetNumberOfHoles();
    101   G4double N = P + H;
    102   G4double Pb = P - GetA();
    103   G4double Nb = Pb + H;
    104   if (Nb <= 0.0) return 0.0;
    105  
    106   G4double A = (P*P+H*H+P-3*H)/4.0;
    107   G4double Ab = (Pb*Pb+H*H+Pb-3*H)/4.0;
     80
     81  G4int P  = aFragment.GetNumberOfParticles();
     82  G4int H  = aFragment.GetNumberOfHoles();
     83  G4int N  = P + H;
     84  G4int Pb = P - GetA();
     85  G4int Nb = Pb + H;
     86  if (Nb <= 0.0) { return 0.0; }
     87  G4double g = (6.0/pi2)*aFragment.GetA()*theParameters->GetLevelDensity();
     88  G4double gb = (6.0/pi2)*GetRestA()*theParameters->GetLevelDensity();
     89
     90  G4double A  = G4double(P*P+H*H+P-3*H)/(4.0*g);
     91  G4double Ab = G4double(Pb*Pb+H*H+Pb-3*H)/(4.0*gb);
    10892  U = std::max(U-A,0.0);
    109   if (U <= 0.0) return 0.0;
     93  if (U <= 0.0) { return 0.0; }
    11094
    111   G4double g = (6.0/pi2)*aFragment.GetA()*G4PreCompoundParameters::GetAddress()->GetLevelDensity();
    112   G4double gb = (6.0/pi2)*GetRestA()*G4PreCompoundParameters::GetAddress()->GetLevelDensity();
    113 
    114   G4double Pf = P;
    115   G4double Hf = H;
    116   G4double Nf = N-1.0;
    117   for (G4int i = 1; i < GetA(); i++)
     95  G4int Pf = P;
     96  G4int Hf = H;
     97  G4int Nf = N-1;
     98  for (G4int i = 1; i < GetA(); ++i)
    11899    {
    119100      Pf *= (P-i);
     
    125106  G4double Y = std::max(Up - Ab - Low, 0.0);
    126107
    127   G4double Probability = GetSpinFactor()/(pi*hbarc*hbarc*hbarc) * GetReducedMass() * GetAlpha() *
    128     r0 * r0 * std::pow(GetRestA(),2.0/3.0)/std::pow(U,N-1) * (std::pow(gb,Nb)/std::pow(g,N)) * Pf * Hf * Nf * K(aFragment) *
    129     std::pow(Y,Nb) * (X/Nb - Y/(Nb+1));
     108  G4double Probability = r2norm*GetSpinFactor()*GetReducedMass()*GetAlpha()
     109    *g4pow->Z23(GetRestA())*Pf*Hf*Nf*K(aFragment)*(X/Nb - Y/(Nb+1))
     110    *U*g4pow->powN(g*gb,Nb)/g4pow->powN(g*U,N);
     111
     112  //  G4double Probability = GetSpinFactor()/(pi*hbarc*hbarc*hbarc)
     113  //  * GetReducedMass() * GetAlpha() *
     114  //  r0 * r0 * std::pow->Z23(GetRestA())/std::pow->pow(U,G4double(N-1)) *
     115  //  (std::pow->(gb,Nb)/std::pow(g,N)) * Pf * Hf * Nf * K(aFragment) *
     116  //  std::pow(Y,Nb) * (X/Nb - Y/(Nb+1));
    130117
    131118  return Probability;
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4HETCHe3.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4HETCHe3.cc,v 1.4 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
     29// by V. Lara
     30//
     31// Modified:
     32// 23.08.2010 V.Ivanchenko general cleanup, move constructor and destructor
     33//            the source, use G4Pow
     34
    2635#include "G4HETCHe3.hh"
     36#include "G4He3.hh"
     37
     38G4HETCHe3::G4HETCHe3()
     39  : G4HETCChargedFragment(G4He3::He3(), &theHe3CoulombBarrier)
     40{}
     41
     42G4HETCHe3::~G4HETCHe3()
     43{}
     44
     45G4double G4HETCHe3::GetAlpha()
     46{
     47  G4double C = 0.0;
     48  G4int aZ = GetZ() + GetRestZ();
     49  if (aZ <= 30)
     50    {
     51      C = 0.10;
     52    }
     53  else if (aZ <= 50)
     54    {
     55      C = 0.1 + -((aZ-50.)/20.)*0.02;
     56    }
     57  else if (aZ < 70)
     58    {
     59      C = 0.08 + -((aZ-70.)/20.)*0.02;
     60    }
     61  else
     62    {
     63      C = 0.06;
     64    }
     65  return 1.0 + C*(4.0/3.0);
     66}
     67 
     68G4double G4HETCHe3::GetBeta()
     69{
     70  return -GetCoulombBarrier();
     71}
     72
     73G4double G4HETCHe3::GetSpinFactor()
     74{
     75  // 2s+1
     76  return 2.0;
     77}   
    2778
    2879G4double G4HETCHe3::K(const G4Fragment & aFragment)
    2980{
    30   if (GetStage() != 1) return 1.0;
    31   // Number of protons in projectile
    32   G4double Pa = static_cast<G4int>(aFragment.GetParticleDefinition()->GetPDGCharge());
    33   // Number of neutrons in projectile
    34   G4double Na = aFragment.GetParticleDefinition()->GetBaryonNumber();
    35   G4double TargetA = aFragment.GetA() - Na;
    36   G4double TargetZ = aFragment.GetZ() - Pa;
    37   Na -= Pa;
    38   G4double r = TargetZ/TargetA;
     81  // Number of protons in emitted fragment
     82  G4int Pa = GetZ();
     83  // Number of neutrons in emitted fragment
     84  G4int Na = GetA() - Pa;
    3985
     86  G4int TargetZ = GetRestZ();
     87  G4int TargetA = GetRestA();
     88  G4double r = G4double(TargetZ)/G4double(TargetA);
    4089
    41  
    42   G4double P = aFragment.GetNumberOfParticles();
    43   G4double H = aFragment.GetNumberOfHoles();
     90  G4int P = aFragment.GetNumberOfParticles();
     91  G4int H = aFragment.GetNumberOfHoles();
    4492
    4593  G4double result = 0.0;
     
    52100         Pa*Na*(Pa-1.0));
    53101
    54       result /= 3.0*std::pow(TargetZ/TargetA, 2.0) * ((TargetA-TargetZ)/TargetA);
     102      result /= 3.0*r*r*(1.0 - r);
    55103    }
    56 
    57104  return std::max(0.0,result);
    58 
    59105}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4HETCNeutron.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4HETCNeutron.cc,v 1.3 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
     29// by V. Lara
     30//
     31// Modified:
     32// 23.08.2010 V.Ivanchenko general cleanup, move constructor and destructor
     33//            the source, use G4Pow
     34
    2635#include "G4HETCNeutron.hh"
     36#include "G4Neutron.hh"
    2737
     38G4HETCNeutron::G4HETCNeutron()
     39  : G4HETCFragment(G4Neutron::Neutron(), &theNeutronCoulombBarrier)
     40{}
     41
     42G4HETCNeutron::~G4HETCNeutron()
     43{}
     44
     45G4double G4HETCNeutron::GetAlpha()
     46{
     47  return 0.76+2.2/g4pow->Z13(GetRestA());
     48}
     49 
     50G4double G4HETCNeutron::GetBeta()
     51{
     52  return (2.12/g4pow->Z23(GetRestA())-0.05)*MeV/GetAlpha();
     53}
     54
     55G4double G4HETCNeutron::GetSpinFactor()
     56{
     57  // (2s+1)
     58  return 2.0;
     59}
     60 
    2861G4double G4HETCNeutron::K(const G4Fragment & aFragment)
    2962{
    30   if (GetStage() != 1) return 1.0;
    31   // Number of protons in projectile
    32   G4double Pa = static_cast<G4int>(aFragment.GetParticleDefinition()->GetPDGCharge());
    33   // Number of neutrons in projectile
    34   G4double Na = aFragment.GetParticleDefinition()->GetBaryonNumber();
    35   G4double TargetA = aFragment.GetA() - Na;
    36   G4double TargetZ = aFragment.GetZ() - Pa;
    37   Na -= Pa;
    38   G4double r = TargetZ/TargetA;
     63  // Number of protons in emitted fragment
     64  G4int Pa = GetZ();
     65  // Number of neutrons in emitted fragment
     66  G4int Na = GetA() - Pa;
     67
     68  G4int TargetZ = GetRestZ();
     69  G4int TargetA = GetRestA();
     70  G4double r = G4double(TargetZ)/G4double(TargetA);
    3971 
    40   G4double P = aFragment.GetNumberOfParticles();
    41   G4double H = aFragment.GetNumberOfHoles();
     72  G4int P = aFragment.GetNumberOfParticles();
     73  G4int H = aFragment.GetNumberOfHoles();
    4274 
    4375  G4double result = 0.0;
    4476  if (P > 0)
    4577    {
    46       result = (H*(1.0-r)+Na)/P;
    47 
    48       result /= (TargetA-TargetZ)/TargetA;
     78      result = (H + Na/(1.0-r))/P;
    4979    }
    5080 
     
    5282}
    5383
    54 
    5584G4double G4HETCNeutron::GetKineticEnergy(const G4Fragment & aFragment)
    5685{
    57   G4double H = aFragment.GetNumberOfHoles();
    58   G4double Pb = aFragment.GetNumberOfParticles() - GetA();
    59   G4double Nb = Pb + H;
     86  G4int H = aFragment.GetNumberOfHoles();
     87  G4int Pb = aFragment.GetNumberOfParticles();
     88  G4int Nb = Pb + H;
     89  G4double g0 = (6.0/pi2)*aFragment.GetA_asInt()*theParameters->GetLevelDensity();
    6090 
    61   G4double Ab = std::max(0.0,(Pb*Pb+H*H+Pb-3*H)/4.0);
     91  G4double Ab = std::max(0.0,G4double(Pb*Pb+H*H+Pb-3*H)/(4.0*g0));
    6292  G4double Emax = GetMaximalKineticEnergy() - Ab;
    6393 
    64   G4double cut = GetBeta() / (GetBeta()+Emax/(Nb+1));
     94  G4double cut = GetBeta() / (GetBeta()+Emax/G4double(Nb+1));
    6595  G4double x(0.0);
    6696  if (G4UniformRand() <= cut)
    6797    {
    68       x = BetaRand(static_cast<G4int>(Nb),1);
     98      x = BetaRand(Nb,1);
    6999    }
    70100  else
    71101    {
    72       x = BetaRand(static_cast<G4int>(Nb),2);
     102      x = BetaRand(Nb,2);
    73103    }
    74104
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4HETCProton.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4HETCProton.cc,v 1.3 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
     29// by V. Lara
     30//
     31// Modified:
     32// 23.08.2010 V.Ivanchenko general cleanup, move constructor and destructor
     33//            the source, use G4Pow
     34
    2635#include "G4HETCProton.hh"
     36#include "G4Proton.hh"
     37
     38G4HETCProton::G4HETCProton()
     39  : G4HETCChargedFragment(G4Proton::Proton(), &theProtonCoulombBarrier)
     40{}
     41
     42G4HETCProton::~G4HETCProton()
     43{}
     44
     45G4double G4HETCProton::GetAlpha()
     46{
     47  G4int aZ = GetRestZ();
     48  G4double C = 0.0;
     49  if (aZ >= 70)
     50    {
     51      C = 0.10;
     52    }
     53  else
     54    {
     55      C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
     56    }
     57  return 1.0 + C;
     58}
     59 
     60G4double G4HETCProton::GetBeta()
     61{
     62  return -GetCoulombBarrier();
     63}
     64 
     65G4double G4HETCProton::GetSpinFactor()
     66{
     67  // 2s+1
     68  return 2.0;
     69}
    2770
    2871G4double G4HETCProton::K(const G4Fragment & aFragment)
    2972{
    30   if (GetStage() != 1) return 1.0;
    31   // Number of protons in projectile
    32   G4double Pa = static_cast<G4int>(aFragment.GetParticleDefinition()->GetPDGCharge());
    33   // Number of neutrons in projectile
    34   G4double Na = aFragment.GetParticleDefinition()->GetBaryonNumber();
    35   G4double TargetA = aFragment.GetA() - Na;
    36   G4double TargetZ = aFragment.GetZ() - Pa;
    37   Na -= Pa;
    38   G4double r = TargetZ/TargetA;
     73  // Number of protons in emitted fragment
     74  G4int Pa = GetZ();
    3975
     76  G4int TargetZ = GetRestZ();
     77  G4int TargetA = GetRestA();
     78  G4double r = G4double(TargetZ)/G4double(TargetA);
    4079
    41   G4double P = aFragment.GetNumberOfParticles();
    42   G4double H = aFragment.GetNumberOfHoles();
     80  G4int P = aFragment.GetNumberOfParticles();
     81  G4int H = aFragment.GetNumberOfHoles();
    4382
    4483  G4double result = 0.0;
    4584  if (P > 0)
    4685    {
    47       result = (H*r + Pa)/P;
    48      
    49       result /= TargetZ/TargetA;
     86      result = (H*r + Pa)/P/r;
    5087    }
    5188
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4HETCTriton.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4HETCTriton.cc,v 1.4 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
     29// by V. Lara
     30//
     31// Modified:
     32// 23.08.2010 V.Ivanchenko general cleanup, move constructor and destructor
     33//            the source, use G4Pow
     34
    2635#include "G4HETCTriton.hh"
     36#include "G4Triton.hh"
     37
     38G4HETCTriton::G4HETCTriton()
     39  : G4HETCChargedFragment(G4Triton::Triton(), &theTritonCoulombBarrier)
     40{}
     41
     42G4HETCTriton::~G4HETCTriton()
     43{}
     44
     45G4double G4HETCTriton::GetAlpha()
     46{
     47  G4double C = 0.0;
     48  G4int aZ = GetZ() + GetRestZ();
     49  if (aZ >= 70)
     50    {
     51      C = 0.10;
     52    }
     53  else
     54    {
     55      C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
     56    }
     57 
     58  return 1.0 + C/3.0;
     59}
     60 
     61G4double G4HETCTriton::GetBeta()
     62{
     63  return -GetCoulombBarrier();
     64}
     65
     66G4double G4HETCTriton::GetSpinFactor()
     67{
     68  // 2s+1
     69  return 2.0;
     70}
    2771
    2872G4double G4HETCTriton::K(const G4Fragment & aFragment)
    2973{
    30   if (GetStage() != 1) return 1.0;
    31   // Number of protons in projectile
    32   G4double Pa = static_cast<G4int>(aFragment.GetParticleDefinition()->GetPDGCharge());
    33   // Number of neutrons in projectile
    34   G4double Na = aFragment.GetParticleDefinition()->GetBaryonNumber();
    35   G4double TargetA = aFragment.GetA() - Na;
    36   G4double TargetZ = aFragment.GetZ() - Pa;
    37   Na -= Pa;
    38   G4double r = TargetZ/TargetA;
     74  // Number of protons in emitted fragment
     75  G4int Pa = GetZ();
     76  // Number of neutrons in emitted fragment
     77  G4int Na = GetA() - Pa;
    3978
    40  
    41   G4double P = aFragment.GetNumberOfParticles();
    42   G4double H = aFragment.GetNumberOfHoles();
     79  G4int TargetZ = GetRestZ();
     80  G4int TargetA = GetRestA();
     81  G4double r = G4double(TargetZ)/G4double(TargetA);
     82
     83  G4int P = aFragment.GetNumberOfParticles();
     84  G4int H = aFragment.GetNumberOfHoles();
    4385
    4486  G4double result = 0.0;
     
    5193         Pa*Na*(Na-1.0));
    5294
    53       result /= 3.0*(TargetZ/TargetA)*std::pow((TargetA-TargetZ)/TargetA,2.0);
     95      result /= 3.0*r*(1.0 - r)*(1.0 - r);
    5496    }
    55 
    5697  return std::max(0.0,result);
    57 
    5898}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4LowEIonFragmentation.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4LowEIonFragmentation.cc,v 1.5 2010/06/01 16:51:11 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4LowEIonFragmentation.cc,v 1.7 2010/09/08 16:38:09 gunter Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2928//
    3029//---------------------------------------------------------------------------
     
    7271
    7372  // Get Target A, Z
    74   G4double aTargetA = theNucleus.GetN();
    75   G4double aTargetZ = theNucleus.GetZ();
     73  G4int aTargetA = theNucleus.GetA_asInt();
     74  G4int aTargetZ = theNucleus.GetZ_asInt();
    7675
    7776  // Get Projectile A, Z
    78   G4double aProjectileA = thePrimary.GetDefinition()->GetBaryonNumber();
    79   G4double aProjectileZ = thePrimary.GetDefinition()->GetPDGCharge();
     77  G4int aProjectileA = thePrimary.GetDefinition()->GetBaryonNumber();
     78  G4int aProjectileZ = G4lrint(thePrimary.GetDefinition()->GetPDGCharge());
    8079
    8180  // Get Maximum radius of both
     
    131130    }
    132131  }
    133   hits ++;
     132  hits++;
    134133
    135134  // From target:
     
    157156  G4double compoundEnergy = thePrimary.GetTotalEnergy()*particlesFromProjectile/aProjectileA; 
    158157  G4double targetMass = G4ParticleTable::GetParticleTable()
    159                         ->GetIonTable()->GetIonMass(static_cast<G4int>(aTargetZ) ,static_cast<G4int>(aTargetA));
     158                        ->GetIonTable()->GetIonMass(aTargetZ, aTargetA);
    160159  compoundEnergy += targetMass;
    161160  G4LorentzVector fragment4Momentum(exciton3Momentum, compoundEnergy);
     
    163162  // take the nucleons and fill the Fragments
    164163  G4Fragment anInitialState;
    165   anInitialState.SetA(aTargetA+particlesFromProjectile);
    166   anInitialState.SetZ(aTargetZ+chargedFromProjectile);
     164  anInitialState.SetZandA_asInt(aTargetZ+chargedFromProjectile,
     165                                aTargetA+particlesFromProjectile);
    167166  // M.A. Cortes fix
    168167  //anInitialState.SetNumberOfParticles(particlesFromProjectile);
     
    187186 
    188187    G4Fragment initialState2;
    189     initialState2.SetA(aProjectileA-particlesFromProjectile);
    190     initialState2.SetZ(aProjectileZ-chargedFromProjectile);
     188    initialState2.SetZandA_asInt(aProjectileZ-chargedFromProjectile,
     189                                 aProjectileA-particlesFromProjectile);
    191190    initialState2.SetNumberOfHoles(static_cast<G4int>((aProjectileA-particlesFromProjectile)/2.0));
    192191    initialState2.SetNumberOfParticles(static_cast<G4int>((aProjectileZ-chargedFromProjectile)/2.0));
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundAlpha.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PreCompoundAlpha.cc,v 1.6 2010/04/09 14:06:17 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundAlpha.cc,v 1.7 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2928//
    3029// -------------------------------------------------------------------
     
    3938// Modified: 
    4039// 21.08.2008 J. M. Quesada add choice of options 
     40// 20.08.2010 V.Ivanchenko added G4Pow and G4PreCompoundParameters pointers
     41//                         use int Z and A and cleanup
    4142//
    4243
    4344#include "G4PreCompoundAlpha.hh"
    44 
    45 G4ReactionProduct * G4PreCompoundAlpha::GetReactionProduct() const
    46 {
    47   G4ReactionProduct * theReactionProduct =
    48     new G4ReactionProduct(G4Alpha::AlphaDefinition());
    49   theReactionProduct->SetMomentum(GetMomentum().vect());
    50   theReactionProduct->SetTotalEnergy(GetMomentum().e());
    51 #ifdef PRECOMPOUND_TEST
    52   theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    53 #endif
    54   return theReactionProduct;
    55 }   
    56 
    57 G4double G4PreCompoundAlpha::FactorialFactor(const G4double N, const G4double P)
    58 {
    59   return
    60       (N-4.0)*(P-3.0)*(
    61                        (((N-3.0)*(P-2.0))/2.0) *(
    62                                                  (((N-2.0)*(P-1.0))/3.0) *(
    63                                                                            (((N-1.0)*P)/2.0)
    64                                                                            )
    65                                                  )
    66                        );
    67 }
    68  
    69 G4double G4PreCompoundAlpha::CoalescenceFactor(const G4double A)
    70 {
    71   return 4096.0/(A*A*A); 
     45#include "G4Alpha.hh"
     46
     47G4PreCompoundAlpha::G4PreCompoundAlpha()
     48  : G4PreCompoundIon(G4Alpha::Alpha(), &theAlphaCoulombBarrier)
     49{}
     50
     51G4PreCompoundAlpha::~G4PreCompoundAlpha()
     52{}
     53
     54G4double G4PreCompoundAlpha::FactorialFactor(G4int N, G4int P)
     55{
     56  return G4double((N-4)*(P-3)*(N-3)*(P-2)*(N-2)*(P-1)*(N-1)*P)/12.0;
     57}
     58 
     59G4double G4PreCompoundAlpha::CoalescenceFactor(G4int A)
     60{
     61  return 4096.0/G4double(A*A*A); 
    7262}   
    7363
    74 G4double G4PreCompoundAlpha::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     64G4double G4PreCompoundAlpha::GetRj(G4int nParticles, G4int nCharged)
    7565{
    7666  G4double rj = 0.0;
    77   G4double denominator = NumberParticles*(NumberParticles-1)*(NumberParticles-2)*(NumberParticles-3);
    78   if(NumberCharged >=2 && (NumberParticles-NumberCharged) >=2 ) {
    79     rj = 6.0*static_cast<G4double>(NumberCharged*(NumberCharged-1)*(NumberParticles-NumberCharged)*
    80                                    (NumberParticles-NumberCharged-1))/static_cast<G4double>(denominator); 
     67  if(nCharged >=2 && (nParticles-nCharged) >=2 ) {
     68    G4double denominator =
     69      G4double(nParticles*(nParticles-1)*(nParticles-2)*(nParticles-3));
     70    rj = 6.0*nCharged*(nCharged-1)*(nParticles-nCharged)*(nParticles-nCharged-1)
     71      /denominator; 
    8172  }
    8273  return rj;
    8374}
    8475
    85 ////////////////////////////////////////////////////////////////////////////////////
     76/////////////////////////////////////////////////////////////////////////////////
    8677//J. M. Quesada (Dec 2007-June 2008): New inverse reaction cross sections
    8778//OPT=0 Dostrovski's parameterization
     
    8980//OPT=3,4 Kalbach's parameterization
    9081//
    91 G4double G4PreCompoundAlpha::CrossSection(const  G4double K)
    92 {
    93 
    94   ResidualA=GetRestA();
    95   ResidualZ=GetRestZ();
    96   theA=GetA();
    97   theZ=GetZ();
    98   ResidualAthrd=std::pow(ResidualA,0.33333);
    99   FragmentA=GetA()+GetRestA();
    100   FragmentAthrd=std::pow(FragmentA,0.33333);
    101 
    102 
    103   if (OPTxs==0) return GetOpt0( K);
    104   else if( OPTxs==1 || OPTxs==2) return GetOpt12( K);
    105   else if (OPTxs==3 || OPTxs==4)  return GetOpt34( K);
     82G4double G4PreCompoundAlpha::CrossSection(G4double K)
     83{
     84  ResidualA = GetRestA();
     85  ResidualZ = GetRestZ();
     86  theA = GetA();
     87  theZ = GetZ();
     88  ResidualAthrd = ResidualA13();
     89  FragmentA = theA + ResidualA;
     90  FragmentAthrd = g4pow->Z13(FragmentA);
     91
     92  if (OPTxs==0) { return GetOpt0( K); }
     93  else if( OPTxs==1 || OPTxs==2) { return GetOpt12( K); }
     94  else if (OPTxs==3 || OPTxs==4) { return GetOpt34( K); }
    10695  else{
    10796    std::ostringstream errOs;
     
    112101}
    113102
    114 // *********************** OPT=0 : Dostrovski's cross section  *****************************
    115 
    116 G4double G4PreCompoundAlpha::GetOpt0(const  G4double K)
    117 {
    118   const G4double r0 = G4PreCompoundParameters::GetAddress()->Getr0();
    119   // cross section is now given in mb (r0 is in mm) for the sake of consistency
    120   //with the rest of the options
    121   return 1.e+25*pi*(r0*ResidualAthrd)*(r0*ResidualAthrd)*GetAlpha()*(1.+GetBeta()/K);
    122 }
    123 //
    124 //----------------
    125 //
    126103G4double G4PreCompoundAlpha::GetAlpha()
    127104{
    128105  G4double C = 0.0;
    129   G4double aZ = GetZ() + GetRestZ();
     106  G4int aZ = theZ + ResidualZ;
    130107  if (aZ <= 30)
    131108    {
     
    134111  else if (aZ <= 50)
    135112    {
    136       C = 0.1 + -((aZ-50.)/20.)*0.02;
     113      C = 0.1 - (aZ-30)*0.001;
    137114    }
    138115  else if (aZ < 70)
    139116    {
    140       C = 0.08 + -((aZ-70.)/20.)*0.02;
     117      C = 0.08 - (aZ-50)*0.001;
    141118    }
    142119  else
     
    146123  return 1.0+C;
    147124}
    148 //
    149 //--------------------
    150 //
    151 G4double G4PreCompoundAlpha::GetBeta()
    152 {
    153   return -GetCoulombBarrier();
    154 }
    155 //
    156 //********************* OPT=1,2 : Chatterjee's cross section ************************
     125
     126//
     127//********************* OPT=1,2 : Chatterjee's cross section ********************
    157128//(fitting to cross section from Bechetti & Greenles OM potential)
    158129
    159 G4double G4PreCompoundAlpha::GetOpt12(const  G4double K)
    160 {
    161 
     130G4double G4PreCompoundAlpha::GetOpt12(G4double K)
     131{
    162132  G4double Kc=K;
    163133
    164134  // JMQ xsec is set constant above limit of validity
    165   if (K>50) Kc=50;
     135  if (K > 50*MeV) { Kc = 50*MeV; }
    166136
    167137  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
     
    182152  p = p0 + p1/Ec + p2/(Ec*Ec);
    183153  landa = landa0*ResidualA + landa1;
    184   mu = mu0*std::pow(ResidualA,mu1);
    185   nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     154  G4double resmu1 = g4pow->powZ(ResidualA,mu1);
     155  mu = mu0*resmu1;
     156  nu = resmu1*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    186157  q = landa - nu/(Ec*Ec) - 2*p*Ec;
    187158  r = mu + 2*nu/Ec + p*(Ec*Ec);
     
    194165             
    195166  return xs;
    196 
    197167}
    198168
    199169// *********** OPT=3,4 : Kalbach's cross sections (from PRECO code)*************
    200 G4double G4PreCompoundAlpha::GetOpt34(const  G4double K)
     170G4double G4PreCompoundAlpha::GetOpt34(G4double K)
    201171// c     ** alpha from huizenga and igo
    202172{
    203 
    204173  G4double landa, mu, nu, p , signor(1.),sig;
    205174  G4double ec,ecsq,xnulam,etest(0.),a;
     
    209178  G4double     spill= 1.e+18;
    210179
    211   G4double       p0 = 10.95;
     180  G4double     p0 = 10.95;
    212181  G4double     p1 = -85.2;
    213182  G4double     p2 = 1146.;
     
    228197  p = p0 + p1/ec + p2/ecsq;
    229198  landa = landa0*ResidualA + landa1;
    230   a = std::pow(ResidualA,mu1);
     199  a = g4pow->powZ(ResidualA,mu1);
    231200  mu = mu0 * a;
    232201  nu = a* (nu0+nu1*ec+nu2*ecsq); 
    233202  xnulam = nu / landa;
    234   if (xnulam > spill) xnulam=0.;
    235   if (xnulam >= flow) etest = 1.2 *std::sqrt(xnulam);
     203  if (xnulam > spill) { xnulam=0.; }
     204  if (xnulam >= flow) { etest = 1.2 *std::sqrt(xnulam); }
    236205
    237206  a = -2.*p*ec + landa - nu/ecsq;
     
    239208  ecut = 0.;
    240209  cut = a*a - 4.*p*b;
    241   if (cut > 0.) ecut = std::sqrt(cut);
     210  if (cut > 0.) { ecut = std::sqrt(cut); }
    242211  ecut = (ecut-a) / (p+p);
    243212  ecut2 = ecut;
    244 //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
    245 //ecut<0 means that there is no cut with energy axis, i.e. xs is set to 0 bellow minimum
    246 //  if (cut < 0.) ecut2 = ecut - 2.;
    247   if (cut < 0.) ecut2 = ecut;
    248   elab = K * FragmentA / ResidualA;
     213  //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
     214  // ecut<0 means that there is no cut with energy axis, i.e. xs is set
     215  // to 0 bellow minimum
     216  //  if (cut < 0.) ecut2 = ecut - 2.;
     217  if (cut < 0.) { ecut2 = ecut; }
     218  elab = K * FragmentA / G4double(ResidualA);
    249219  sig = 0.;
    250220 
    251221  if (elab <= ec) { //start for E<Ec
    252     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     222    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
    253223  }           //end for E<Ec
    254224  else {           //start for E>Ec
    255225    sig = (landa*elab+mu+nu/elab) * signor;
    256226    geom = 0.;
    257     if (xnulam < flow || elab < etest) return sig;
     227    if (xnulam < flow || elab < etest) { return sig; }
    258228    geom = std::sqrt(theA*K);
    259229    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
     
    262232  }           //end for E>Ec
    263233  return sig;
    264  
    265 }
    266 
    267 //   ************************** end of cross sections *******************************
     234}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundDeuteron.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PreCompoundDeuteron.cc,v 1.6 2010/04/09 14:06:17 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundDeuteron.cc,v 1.7 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2828//
    2929// -------------------------------------------------------------------
     
    3838// Modified: 
    3939// 21.08.2008 J. M. Quesada add choice of options 
     40// 20.08.2010 V.Ivanchenko added G4Pow and G4PreCompoundParameters pointers
     41//                         use int Z and A and cleanup
    4042//
    4143
    4244#include "G4PreCompoundDeuteron.hh"
    43 
    44 G4ReactionProduct * G4PreCompoundDeuteron::GetReactionProduct() const
    45 {
    46   G4ReactionProduct * theReactionProduct =
    47     new G4ReactionProduct(G4Deuteron::DeuteronDefinition());
    48   theReactionProduct->SetMomentum(GetMomentum().vect());
    49   theReactionProduct->SetTotalEnergy(GetMomentum().e());
    50 #ifdef PRECOMPOUND_TEST
    51   theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    52 #endif
    53   return theReactionProduct;
    54 }   
    55 
     45#include "G4Deuteron.hh"
     46
     47G4PreCompoundDeuteron::G4PreCompoundDeuteron()
     48  : G4PreCompoundIon(G4Deuteron::Deuteron(), &theDeuteronCoulombBarrier)
     49{}
     50
     51G4PreCompoundDeuteron::~G4PreCompoundDeuteron()
     52{}
    5653 
    57 G4double G4PreCompoundDeuteron::FactorialFactor(const G4double N, const G4double P)
    58 {
    59   return (N-1.0)*(N-2.0)*(P-1.0)*P/2.0;
     54G4double G4PreCompoundDeuteron::FactorialFactor(G4int N, G4int P)
     55{
     56  return G4double((N-1)*(N-2)*(P-1)*P)/2.0;
    6057}
    6158 
    62 G4double G4PreCompoundDeuteron::CoalescenceFactor(const G4double A)
    63 {
    64   return 16.0/A;
     59G4double G4PreCompoundDeuteron::CoalescenceFactor(G4int A)
     60{
     61  return 16.0/G4double(A);
    6562}   
    6663
    67 G4double G4PreCompoundDeuteron::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     64G4double G4PreCompoundDeuteron::GetRj(G4int nParticles, const G4int nCharged)
    6865{
    6966  G4double rj = 0.0;
    70   G4double denominator = NumberParticles*(NumberParticles-1);
    71   if(NumberCharged >=1 && (NumberParticles-NumberCharged) >=1) {
    72     rj = 2.0*static_cast<G4double>(NumberCharged*(NumberParticles-NumberCharged))
    73       / static_cast<G4double>(denominator);
     67  if(nCharged >=1 && (nParticles-nCharged) >=1) {
     68    G4double denominator = G4double(nParticles*(nParticles-1));
     69    rj = 2*nCharged*(nParticles-nCharged)/denominator;
    7470  }
    7571  return rj;
    7672}
    7773
    78 ////////////////////////////////////////////////////////////////////////////////////
     74////////////////////////////////////////////////////////////////////////////////
    7975//J. M. Quesada (Dec 2007-June 2008): New inverse reaction cross sections
    8076//OPT=0 Dostrovski's parameterization
     
    8278//OPT=3,4 Kalbach's parameterization
    8379//
    84 G4double G4PreCompoundDeuteron::CrossSection(const  G4double K)
    85 {
    86 
    87   ResidualA=GetRestA();
    88   ResidualZ=GetRestZ();
    89   theA=GetA();
    90   theZ=GetZ();
    91   ResidualAthrd=std::pow(ResidualA,0.33333);
    92   FragmentA=GetA()+GetRestA();
    93   FragmentAthrd=std::pow(FragmentA,0.33333);
    94 
    95 
    96   if (OPTxs==0) return GetOpt0( K);
    97   else if( OPTxs==1 || OPTxs==2) return GetOpt12( K);
    98   else if (OPTxs==3 || OPTxs==4)  return GetOpt34( K);
     80G4double G4PreCompoundDeuteron::CrossSection(G4double K)
     81{
     82  ResidualA = GetRestA();
     83  ResidualZ = GetRestZ();
     84  theA = GetA();
     85  theZ = GetZ();
     86  ResidualAthrd = ResidualA13();
     87  FragmentA = theA + ResidualA;
     88  FragmentAthrd = g4pow->Z13(FragmentA);
     89
     90  if (OPTxs==0) { return GetOpt0( K); }
     91  else if( OPTxs==1 || OPTxs==2) { return GetOpt12( K); }
     92  else if (OPTxs==3 || OPTxs==4) { return GetOpt34( K); }
    9993  else{
    10094    std::ostringstream errOs;
     
    10599}
    106100
    107 // *********************** OPT=0 : Dostrovski's cross section  *****************************
    108 
    109 G4double G4PreCompoundDeuteron::GetOpt0(const  G4double K)
    110 {
    111   const G4double r0 = G4PreCompoundParameters::GetAddress()->Getr0();
    112   // cross section is now given in mb (r0 is in mm) for the sake of consistency
    113   //with the rest of the options
    114   return 1.e+25*pi*(r0*ResidualAthrd)*(r0*ResidualAthrd)*GetAlpha()*(1.+GetBeta()/K);
    115 }
    116 //
    117 //---------
    118 //
    119101G4double G4PreCompoundDeuteron::GetAlpha()
    120102{
    121103  G4double C = 0.0;
    122   G4double aZ = GetZ() + GetRestZ();
     104  G4int aZ = theZ + ResidualZ;
    123105  if (aZ >= 70)
    124106    {
     
    132114}
    133115//
    134 //---------
    135 //
    136 G4double G4PreCompoundDeuteron::GetBeta()
    137 {
    138   return -GetCoulombBarrier();
    139 }
    140 //
    141 //********************* OPT=1,2 : Chatterjee's cross section ************************
     116//********************* OPT=1,2 : Chatterjee's cross section ********************
    142117//(fitting to cross section from Bechetti & Greenles OM potential)
    143118
    144 G4double G4PreCompoundDeuteron::GetOpt12(const  G4double K)
    145 {
    146 
    147   G4double Kc=K;
    148 
    149 // JMQ xsec is set constat above limit of validity
    150   if (K>50) Kc=50;
     119G4double G4PreCompoundDeuteron::GetOpt12(G4double K)
     120{
     121  G4double Kc = K;
     122
     123  // JMQ xsec is set constat above limit of validity
     124  if (K > 50*MeV) { Kc = 50*MeV; }
    151125
    152126  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
    153   //G4double Eo(0),epsilon1(0),epsilon2(0),discri(0);
    154 
    155127 
    156128  G4double    p0 = -38.21;
     
    165137  G4double    nu2 = -5.924; 
    166138  G4double    delta=1.2;           
    167  
    168139
    169140  Ec = 1.44*theZ*ResidualZ/(1.5*ResidualAthrd+delta);
    170141  p = p0 + p1/Ec + p2/(Ec*Ec);
    171142  landa = landa0*ResidualA + landa1;
    172   mu = mu0*std::pow(ResidualA,mu1);
    173   nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     143  G4double resmu1 = g4pow->powZ(ResidualA,mu1);
     144  mu = mu0*resmu1;
     145  nu = resmu1*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    174146  q = landa - nu/(Ec*Ec) - 2*p*Ec;
    175147  r = mu + 2*nu/Ec + p*(Ec*Ec);
     
    182154             
    183155  return xs;
    184 
    185156}
    186157
    187158// *********** OPT=3,4 : Kalbach's cross sections (from PRECO code)*************
    188 G4double G4PreCompoundDeuteron::GetOpt34(const  G4double K)
     159G4double G4PreCompoundDeuteron::GetOpt34(G4double K)
    189160//     ** d from o.m. of perey and perey
    190161{
     
    196167  G4double     flow = 1.e-18;
    197168  G4double     spill= 1.e+18;
    198 
    199  
    200169
    201170  G4double     p0 = 0.798;
     
    210179  G4double     nu2 = -3.592;     
    211180 
    212 
    213181  G4double     ra=0.80;
    214182       
     
    219187  p = p0 + p1/ec + p2/ecsq;
    220188  landa = landa0*ResidualA + landa1;
    221   a = std::pow(ResidualA,mu1);
     189  a = g4pow->powZ(ResidualA,mu1);
    222190  mu = mu0 * a;
    223191  nu = a* (nu0+nu1*ec+nu2*ecsq); 
    224192  xnulam = nu / landa;
    225   if (xnulam > spill) xnulam=0.;
    226   if (xnulam >= flow) etest = 1.2 *std::sqrt(xnulam);
     193  if (xnulam > spill) { xnulam=0.; }
     194  if (xnulam >= flow) { etest = 1.2 *std::sqrt(xnulam); }
    227195
    228196  a = -2.*p*ec + landa - nu/ecsq;
     
    230198  ecut = 0.;
    231199  cut = a*a - 4.*p*b;
    232   if (cut > 0.) ecut = std::sqrt(cut);
     200  if (cut > 0.) { ecut = std::sqrt(cut); }
    233201  ecut = (ecut-a) / (p+p);
    234202  ecut2 = ecut;
    235 //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
    236 //ecut<0 means that there is no cut with energy axis, i.e. xs is set to 0 bellow minimum
    237 //  if (cut < 0.) ecut2 = ecut - 2.;
    238   if (cut < 0.) ecut2 = ecut;
    239   elab = K * FragmentA / ResidualA;
     203  //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
     204  //ecut<0 means that there is no cut with energy axis, i.e. xs is set
     205  //to 0 bellow minimum
     206  //  if (cut < 0.) ecut2 = ecut - 2.;
     207  if (cut < 0.) { ecut2 = ecut; }
     208  elab = K * FragmentA / G4double(ResidualA);
    240209  sig = 0.;
    241210
    242211  if (elab <= ec) { //start for E<Ec
    243     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     212    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
    244213  }           //end for E<Ec
    245214  else {           //start for E>Ec
    246215    sig = (landa*elab+mu+nu/elab) * signor;
    247216    geom = 0.;
    248     if (xnulam < flow || elab < etest) return sig;
     217    if (xnulam < flow || elab < etest) { return sig; }
    249218    geom = std::sqrt(theA*K);
    250219    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
     
    253222  }           //end for E>Ec
    254223  return sig;
    255 
    256 }
    257 
    258 //   ************************** end of cross sections *******************************
    259 
    260 
    261 
    262 
     224}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundEmission.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PreCompoundEmission.cc,v 1.28 2010/02/25 10:27:36 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundEmission.cc,v 1.32 2010/09/01 15:11:10 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2928//
    3029// -------------------------------------------------------------------
     
    4140// 19.01.2010 V.Ivanchenko simplified computation of parameter an, sample cosTheta
    4241//                         instead of theta; protect all calls to sqrt
     42// 20.08.2010 V.Ivanchenko added G4Pow and G4PreCompoundParameters pointers
     43//                         use int Z and A and cleanup
    4344//
    4445
    4546#include "G4PreCompoundEmission.hh"
    4647#include "G4PreCompoundParameters.hh"
    47 
    4848#include "G4PreCompoundEmissionFactory.hh"
    4949#include "G4HETCEmissionFactory.hh"
    50 
    51 const G4PreCompoundEmission &
    52 G4PreCompoundEmission::operator=(const G4PreCompoundEmission &)
    53 {
    54   throw G4HadronicException(__FILE__, __LINE__,
    55                             "G4PreCompoundEmission::operator= meant to not be accessable");
    56   return *this;
    57 }
    58 
    59 
    60 G4bool G4PreCompoundEmission::operator==(const G4PreCompoundEmission &) const
    61 {
    62   return false;
    63 }
    64 
    65 G4bool G4PreCompoundEmission::operator!=(const G4PreCompoundEmission &) const
    66 {
    67   return true;
    68 }
     50#include "G4HadronicException.hh"
     51#include "G4Pow.hh"
     52#include "Randomize.hh"
    6953
    7054G4PreCompoundEmission::G4PreCompoundEmission()
    7155{
    7256  theFragmentsFactory = new G4PreCompoundEmissionFactory();
    73   theFragmentsVector = new G4PreCompoundFragmentVector(theFragmentsFactory->GetFragmentVector());
     57  theFragmentsVector =
     58    new G4PreCompoundFragmentVector(theFragmentsFactory->GetFragmentVector());
     59  g4pow = G4Pow::GetInstance();
     60  theParameters = G4PreCompoundParameters::GetAddress();
    7461}
    7562
    7663G4PreCompoundEmission::~G4PreCompoundEmission()
    7764{
    78   if (theFragmentsFactory) delete theFragmentsFactory;
    79   if (theFragmentsVector) delete theFragmentsVector;
     65  if (theFragmentsFactory) { delete theFragmentsFactory; }
     66  if (theFragmentsVector)  { delete theFragmentsVector; }
    8067}
    8168
    8269void G4PreCompoundEmission::SetDefaultModel()
    8370{
    84   if (theFragmentsFactory) delete theFragmentsFactory;
     71  if (theFragmentsFactory) { delete theFragmentsFactory; }
    8572  theFragmentsFactory = new G4PreCompoundEmissionFactory();
    8673  if (theFragmentsVector)
     
    9077  else
    9178    {
    92       theFragmentsVector = new G4PreCompoundFragmentVector(theFragmentsFactory->GetFragmentVector());
    93     }
    94   theFragmentsVector->ResetStage();
     79      theFragmentsVector =
     80        new G4PreCompoundFragmentVector(theFragmentsFactory->GetFragmentVector());
     81    }
    9582  return;
    9683}
     
    10693  else
    10794    {
    108       theFragmentsVector = new G4PreCompoundFragmentVector(theFragmentsFactory->GetFragmentVector());
    109     }
    110   theFragmentsVector->ResetStage();
     95      theFragmentsVector =
     96        new G4PreCompoundFragmentVector(theFragmentsFactory->GetFragmentVector());
     97    }
    11198  return;
    11299}
     
    114101G4ReactionProduct * G4PreCompoundEmission::PerformEmission(G4Fragment & aFragment)
    115102{
    116 #ifdef debug
    117   G4Fragment InitialState(aFragment);
    118 #endif
    119103  // Choose a Fragment for emission
    120   G4VPreCompoundFragment * theFragment = theFragmentsVector->ChooseFragment();
    121   if (theFragment == 0)
    122     {
    123       G4cerr <<  "G4PreCompoundEmission::PerformEmission : I couldn't choose a fragment\n"
     104  G4VPreCompoundFragment * thePreFragment = theFragmentsVector->ChooseFragment();
     105  if (thePreFragment == 0)
     106    {
     107      G4cout <<  "G4PreCompoundEmission::PerformEmission : I couldn't choose a fragment\n"
    124108             << "while trying to de-excite\n"
    125              << aFragment << '\n';
     109             << aFragment << G4endl;
    126110      throw G4HadronicException(__FILE__, __LINE__, "");
    127111    }
    128112  // Kinetic Energy of emitted fragment
    129   G4double KineticEnergyOfEmittedFragment = theFragment->GetKineticEnergy(aFragment);
     113  G4double kinEnergyOfEmittedFragment = thePreFragment->GetKineticEnergy(aFragment);
     114  if(kinEnergyOfEmittedFragment < 0.0) { kinEnergyOfEmittedFragment = 0.0; }
    130115 
    131116  // Calculate the fragment momentum (three vector)
    132   G4ThreeVector momentum = AngularDistribution(theFragment,aFragment,KineticEnergyOfEmittedFragment);
     117  AngularDistribution(thePreFragment,aFragment,kinEnergyOfEmittedFragment);
    133118 
    134119  // Mass of emittef fragment
    135   G4double EmittedMass = theFragment->GetNuclearMass();
     120  G4double EmittedMass = thePreFragment->GetNuclearMass();
    136121 
    137122  // Now we can calculate the four momentum
    138123  // both options are valid and give the same result but 2nd one is faster
    139   // G4LorentzVector EmittedMomentum(momentum,std::sqrt(momentum.mag2()+EmittedMass*EmittedMass));
    140   G4LorentzVector EmittedMomentum(momentum,EmittedMass+KineticEnergyOfEmittedFragment);
     124  G4LorentzVector Emitted4Momentum(theFinalMomentum,
     125                                   EmittedMass + kinEnergyOfEmittedFragment);
    141126   
    142127  // Perform Lorentz boost
    143   EmittedMomentum.boost(aFragment.GetMomentum().boostVector()); 
     128  G4LorentzVector Rest4Momentum = aFragment.GetMomentum();
     129  Emitted4Momentum.boost(Rest4Momentum.boostVector()); 
    144130
    145131  // Set emitted fragment momentum
    146   theFragment->SetMomentum(EmittedMomentum);   
    147 
     132  thePreFragment->SetMomentum(Emitted4Momentum);       
    148133
    149134  // NOW THE RESIDUAL NUCLEUS
    150135  // ------------------------
    151    
    152   // Now the residual nucleus.
    153   // The energy conservation says that
    154   G4double ResidualEcm =
    155     //    aFragment.GetGroundStateMass() + aFragment.GetExcitationEnergy() // initial energy in cm
    156     aFragment.GetMomentum().m()
    157     - (EmittedMass+KineticEnergyOfEmittedFragment);
    158 
    159   // Then the four momentum for residual is
    160   G4LorentzVector RestMomentum(-momentum,ResidualEcm);
    161   // This could save a Lorentz boost
    162   // G4LorentzVector RestMomentum2(aFragment.GetMomentum()-EmittedMomentum);
    163 
    164   // Just for test
    165   // Excitation energy
    166   //  G4double anU = ResidualEcm - theFragment->GetRestNuclearMass();
    167   // This is equivalent
    168   //  G4double anU = theFragment->GetMaximalKineticEnergy() - KineticEnergyOfEmittedFragment +
    169   //    theFragment->GetCoulombBarrier();
    170    
    171   // check that Excitation energy is >= 0
    172   G4double anU = RestMomentum.m()-theFragment->GetRestNuclearMass();
    173   if (anU < 0.0) {
    174     throw G4HadronicException(__FILE__, __LINE__,
    175                               "G4PreCompoundModel::DeExcite: Excitation energy less than 0!");
    176   }
    177      
     136
     137  Rest4Momentum -= Emitted4Momentum;
     138   
    178139  // Update nucleus parameters:
    179140  // --------------------------
     
    181142  // Number of excitons
    182143  aFragment.SetNumberOfParticles(aFragment.GetNumberOfParticles()-
    183                                  static_cast<G4int>(theFragment->GetA()));
     144                                 thePreFragment->GetA());
    184145  // Number of charges
    185146  aFragment.SetNumberOfCharged(aFragment.GetNumberOfCharged()-
    186                                static_cast<G4int>(theFragment->GetZ()));
    187    
    188   // Atomic number
    189   aFragment.SetA(theFragment->GetRestA());
    190    
    191   // Charge
    192   aFragment.SetZ(theFragment->GetRestZ());
    193 
    194    
    195   // Perform Lorentz boosts
    196   RestMomentum.boost(aFragment.GetMomentum().boostVector());
    197 
    198   // Update nucleus momentum
    199   aFragment.SetMomentum(RestMomentum);
     147                               thePreFragment->GetZ());
     148   
     149  // Z and A
     150  aFragment.SetZandA_asInt(thePreFragment->GetRestZ(),
     151                           thePreFragment->GetRestA());
     152   
     153  // Update nucleus momentum
     154  // A check on consistence of Z, A, and mass will be performed
     155  aFragment.SetMomentum(Rest4Momentum);
    200156       
    201157  // Create a G4ReactionProduct
    202   G4ReactionProduct * MyRP = theFragment->GetReactionProduct();
    203 #ifdef PRECOMPOUND_TEST
    204   MyRP->SetCreatorModel("G4PreCompoundModel");
    205 #endif
    206 #ifdef debug
    207   CheckConservation(InitialState,aFragment,MyRP);
    208 #endif
     158  G4ReactionProduct * MyRP = thePreFragment->GetReactionProduct();
     159
     160  //G4cout << "G4PreCompoundEmission::Fragment emitted" << G4endl;
     161  //G4cout << thePreFragment << G4endl;
     162
    209163  return MyRP;
    210164}
    211165
    212 G4ThreeVector
    213 G4PreCompoundEmission::AngularDistribution(G4VPreCompoundFragment * theFragment,
     166void
     167G4PreCompoundEmission::AngularDistribution(G4VPreCompoundFragment* thePreFragment,
    214168                                           const G4Fragment& aFragment,
    215                                            const G4double kinEnergyOfEmittedFrag) const
    216 {
    217   G4double p = aFragment.GetNumberOfParticles();
    218   G4double h = aFragment.GetNumberOfHoles();
     169                                           G4double ekin)
     170{
     171  G4int p = aFragment.GetNumberOfParticles();
     172  G4int h = aFragment.GetNumberOfHoles();
    219173  G4double U = aFragment.GetExcitationEnergy();
    220174
    221   G4double ekin = std::max(0.0, kinEnergyOfEmittedFrag);
    222        
    223175  // Emission particle separation energy
    224   G4double Bemission = theFragment->GetBindingEnergy();
     176  G4double Bemission = thePreFragment->GetBindingEnergy();
    225177
    226178  // Fermi energy
    227   G4double Ef = G4PreCompoundParameters::GetAddress()->GetFermiEnergy();
     179  G4double Ef = theParameters->GetFermiEnergy();
    228180       
    229181  //
     
    231183  //  G4double g = (6.0/pi2)*aFragment.GetA()*
    232184
    233   G4double g = (6.0/pi2)*aFragment.GetA()
    234     *G4PreCompoundParameters::GetAddress()->GetLevelDensity();
     185  G4double g = (6.0/pi2)*aFragment.GetA_asInt()*theParameters->GetLevelDensity();
    235186       
    236187  // Average exciton energy relative to bottom of nuclear well
    237   G4double Eav = 2.0*p*(p+1.0)/((p+h)*g);
     188  G4double Eav = 2*p*(p+1)/((p+h)*g);
    238189       
    239190  // Excitation energy relative to the Fermi Level
     
    241192  //  G4double Uf = U - KineticEnergyOfEmittedFragment - Bemission;
    242193
    243   G4double w_num = rho(p+1,h,g,Uf,Ef);
    244   G4double w_den = rho(p,h,g,Uf,Ef);
     194  G4double w_num = rho(p+1, h, g, Uf, Ef);
     195  G4double w_den = rho(p,   h, g, Uf, Ef);
    245196  if (w_num > 0.0 && w_den > 0.0)
    246197    {
     
    253204    }
    254205 
    255 
    256206  // VI + JMQ 19/01/2010 update computation of the parameter an
    257207  //
     
    262212    G4double zeta = std::max(1.0,9.3/std::sqrt(ekin/MeV));
    263213 
    264     an = 3.0*std::sqrt((ProjEnergy+Ef)*Eeff)/(zeta*Eav);
     214    // This should be the projectile energy. If I would know which is
     215    // the projectile (proton, neutron) I could remove the binding energy.
     216    // But, what happens if INC precedes precompound? This approximation
     217    // seems to work well enough
     218    G4double ProjEnergy = aFragment.GetExcitationEnergy();
     219
     220    an = 3*std::sqrt((ProjEnergy+Ef)*Eeff)/(zeta*Eav);
    265221
    266222    G4int ne = aFragment.GetNumberOfExcitons() - 1;
     
    283239  } 
    284240
    285   G4double phi = twopi*G4UniformRand();
     241  G4double phi = CLHEP::twopi*G4UniformRand();
    286242 
    287243  // Calculate the momentum magnitude of emitted fragment       
    288   G4double pmag = std::sqrt(ekin*(ekin + 2.0*theFragment->GetNuclearMass()));
     244  G4double pmag = std::sqrt(ekin*(ekin + 2.0*thePreFragment->GetNuclearMass()));
    289245 
    290246  G4double sint = std::sqrt((1.0-cost)*(1.0+cost));
    291247
    292   G4ThreeVector momentum(pmag*std::cos(phi)*sint,pmag*std::sin(phi)*sint,pmag*cost);
     248  theFinalMomentum.set(pmag*std::cos(phi)*sint,pmag*std::sin(phi)*sint,pmag*cost);
     249
    293250  // theta is the angle wrt the incident direction
    294   momentum.rotateUz(theIncidentDirection);
    295 
    296   return momentum;
    297 }
    298 
    299 G4double G4PreCompoundEmission::rho(const G4double p, const G4double h, const G4double g,
    300                                     const G4double E, const G4double Ef) const
     251  G4ThreeVector theIncidentDirection = aFragment.GetMomentum().vect().unit();
     252  theFinalMomentum.rotateUz(theIncidentDirection);
     253}
     254
     255G4double G4PreCompoundEmission::rho(G4int p, G4int h, G4double g,
     256                                    G4double E, G4double Ef) const
    301257{       
    302258  // 25.02.2010 V.Ivanchenko added more protections
     
    306262  if ( E - Aph < 0.0) { return 0.0; }
    307263 
    308   G4double logConst =  (p+h)*std::log(g) - logfactorial(p+h-1) - logfactorial(p) - logfactorial(h);
     264  G4double logConst =  (p+h)*std::log(g)
     265    - g4pow->logfactorial(p+h-1) - g4pow->logfactorial(p) - g4pow->logfactorial(h);
    309266
    310267  // initialise values using j=0
     
    312269  G4double t1=1;
    313270  G4double t2=1;
    314   G4double logt3=(p+h-1) * std::log(E-Aph) + logConst;
     271  G4double logt3 = (p+h-1) * std::log(E-Aph) + logConst;
    315272  const G4double logmax = 200.;
    316273  if(logt3 > logmax) { logt3 = logmax; }
     
    333290  return tot;
    334291}
    335 
    336 G4double G4PreCompoundEmission::factorial(G4double a) const
    337 {
    338   // Values of factorial function from 0 to 60
    339   const G4int factablesize = 61;
    340   static const G4double fact[factablesize] =
    341     {
    342       1.0, // 0!
    343       1.0, // 1!
    344       2.0, // 2!
    345       6.0, // 3!
    346       24.0, // 4!
    347       120.0, // 5!
    348       720.0, // 6!
    349       5040.0, // 7!
    350       40320.0, // 8!
    351       362880.0, // 9!
    352       3628800.0, // 10!
    353       39916800.0, // 11!
    354       479001600.0, // 12!
    355       6227020800.0, // 13!
    356       87178291200.0, // 14!
    357       1307674368000.0, // 15!
    358       20922789888000.0, // 16!
    359       355687428096000.0, // 17!
    360       6402373705728000.0, // 18!
    361       121645100408832000.0, // 19!
    362       2432902008176640000.0, // 20!
    363       51090942171709440000.0, // 21!
    364       1124000727777607680000.0, // 22!
    365       25852016738884976640000.0, // 23!
    366       620448401733239439360000.0, // 24!
    367       15511210043330985984000000.0, // 25!
    368       403291461126605635584000000.0, // 26!
    369       10888869450418352160768000000.0, // 27!
    370       304888344611713860501504000000.0, // 28!
    371       8841761993739701954543616000000.0, // 29!
    372       265252859812191058636308480000000.0, // 30!
    373       8222838654177922817725562880000000.0, // 31!
    374       263130836933693530167218012160000000.0, // 32!
    375       8683317618811886495518194401280000000.0, // 33!
    376       295232799039604140847618609643520000000.0, // 34!
    377       10333147966386144929666651337523200000000.0, // 35!
    378       371993326789901217467999448150835200000000.0, // 36!
    379       13763753091226345046315979581580902400000000.0, // 37!
    380       523022617466601111760007224100074291200000000.0, // 38!
    381       20397882081197443358640281739902897356800000000.0, // 39!
    382       815915283247897734345611269596115894272000000000.0, // 40!
    383       33452526613163807108170062053440751665152000000000.0, // 41!
    384       1405006117752879898543142606244511569936384000000000.0, // 42!
    385       60415263063373835637355132068513997507264512000000000.0, // 43!
    386       2658271574788448768043625811014615890319638528000000000.0, // 44!
    387       119622220865480194561963161495657715064383733760000000000.0, // 45!
    388       5502622159812088949850305428800254892961651752960000000000.0, // 46!
    389       258623241511168180642964355153611979969197632389120000000000.0, // 47!
    390       12413915592536072670862289047373375038521486354677760000000000.0, // 48!
    391       608281864034267560872252163321295376887552831379210240000000000.0, // 49!
    392       30414093201713378043612608166064768844377641568960512000000000000.0, // 50!
    393       1551118753287382280224243016469303211063259720016986112000000000000.0, // 51!
    394       80658175170943878571660636856403766975289505440883277824000000000000.0, // 52!
    395       4274883284060025564298013753389399649690343788366813724672000000000000.0, // 53!
    396       230843697339241380472092742683027581083278564571807941132288000000000000.0, // 54!
    397       12696403353658275925965100847566516959580321051449436762275840000000000000.0, // 55!
    398       710998587804863451854045647463724949736497978881168458687447040000000000000.0, // 56!
    399       40526919504877216755680601905432322134980384796226602145184481280000000000000.0, // 57!
    400       2350561331282878571829474910515074683828862318181142924420699914240000000000000.0, // 58!
    401       138683118545689835737939019720389406345902876772687432540821294940160000000000000.0, // 59!
    402       8320987112741390144276341183223364380754172606361245952449277696409600000000000000.0  // 60!
    403     };
    404   //    fact[0] = 1;
    405   //    for (G4int n = 1; n < 21; n++) {
    406   //      fact[n] = fact[n-1]*static_cast<G4double>(n);
    407   //    }
    408   G4double result(0.0);
    409   G4int ia = static_cast<G4int>(a);
    410   if (ia < factablesize)
    411     {
    412       result = fact[ia];
    413     }
    414   else
    415     {
    416       result = fact[factablesize-1];
    417       for (G4int n = factablesize; n < ia+1; ++n)
    418         {
    419           result *= static_cast<G4double>(n);
    420         }
    421     }
    422    
    423     return result;
    424 }
    425 G4double G4PreCompoundEmission::logfactorial(G4double a) const
    426 {
    427   // Values of logs of factorial function from 0 to 60
    428 
    429   G4double result(0.0);
    430   const G4int factablesize = 61;
    431   const G4double halfLn2pi = 0.918938533;      // 0.5 log(2* pi)
    432   static G4double logfact[factablesize];
    433   static bool needinit=true;
    434  
    435   if (needinit)
    436   {
    437       needinit=false;
    438       for ( G4int n=0; n < factablesize; ++n)
    439       {
    440          logfact[n]=std::log(factorial(n));
    441       }
    442   }
    443 
    444   G4int ia = static_cast<G4int>(a);
    445   if (ia < factablesize)
    446   {
    447       result = logfact[ia];
    448   } else {
    449       result = (ia+0.5)*std::log(G4double(ia)) - ia + halfLn2pi;
    450   }
    451    
    452   return result;
    453 }
    454 
    455 #ifdef debug
    456 void G4PreCompoundEmission::CheckConservation(const G4Fragment & theInitialState,
    457                                               const G4Fragment & theResidual,
    458                                               G4ReactionProduct * theEmitted) const
    459 {
    460   G4double ProductsEnergy = theEmitted->GetTotalEnergy() + theResidual.GetMomentum().e();
    461   G4ThreeVector ProductsMomentum(theEmitted->GetMomentum()+theResidual.GetMomentum().vect());
    462   G4int ProductsA = theEmitted->GetDefinition()->GetBaryonNumber() + theResidual.GetA();
    463   G4int ProductsZ = theEmitted->GetDefinition()->GetPDGCharge() + theResidual.GetZ();
    464 
    465   if (ProductsA != theInitialState.GetA()) {
    466     G4cout << "!!!!!!!!!! Baryonic Number Conservation Violation !!!!!!!!!!" << G4endl;
    467     G4cout << "G4PreCompoundEmission.cc: Barionic Number Conservation"
    468            << G4endl;
    469     G4cout << "Initial A = " << theInitialState.GetA()
    470            << "   Fragments A = " << ProductsA << "   Diference --> "
    471            << theInitialState.GetA() - ProductsA << G4endl;
    472   }
    473   if (ProductsZ != theInitialState.GetZ()) {
    474     G4cout << "!!!!!!!!!! Charge Conservation Violation !!!!!!!!!!" << G4endl;
    475     G4cout << "G4PreCompoundEmission.cc: Charge Conservation test"
    476            << G4endl;
    477     G4cout << "Initial Z = " << theInitialState.GetZ()
    478            << "   Fragments Z = " << ProductsZ << "   Diference --> "
    479            << theInitialState.GetZ() - ProductsZ << G4endl;
    480   }
    481   if (std::abs(ProductsEnergy-theInitialState.GetMomentum().e()) > 10.0*eV) {
    482     G4cout << "!!!!!!!!!! Energy Conservation Violation !!!!!!!!!!" << G4endl;
    483     G4cout << "G4PreCompoundEmission.cc: Energy Conservation test"
    484            << G4endl;
    485     G4cout << "Initial E = " << theInitialState.GetMomentum().e()/MeV << " MeV"
    486            << "   Fragments E = " << ProductsEnergy/MeV  << " MeV   Diference --> "
    487            << (theInitialState.GetMomentum().e() - ProductsEnergy)/MeV << " MeV" << G4endl;
    488   }
    489   if (std::abs(ProductsMomentum.x()-theInitialState.GetMomentum().x()) > 10.0*eV ||
    490       std::abs(ProductsMomentum.y()-theInitialState.GetMomentum().y()) > 10.0*eV ||
    491       std::abs(ProductsMomentum.z()-theInitialState.GetMomentum().z()) > 10.0*eV) {
    492     G4cout << "!!!!!!!!!! Momentum Conservation Violation !!!!!!!!!!" << G4endl;
    493     G4cout << "G4PreCompoundEmission.cc: Momentum Conservation test"
    494            << G4endl;
    495     G4cout << "Initial P = " << theInitialState.GetMomentum().vect() << " MeV"
    496            << "   Fragments P = " << ProductsMomentum  << " MeV   Diference --> "
    497            << theInitialState.GetMomentum().vect() - ProductsMomentum << " MeV" << G4endl;
    498   }
    499   return;
    500 }
    501 
    502 #endif
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundEmissionFactory.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
     26// $Id: G4PreCompoundEmissionFactory.cc,v 1.5 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
     29
    2630#include "G4PreCompoundEmissionFactory.hh"
    2731
     
    3337#include "G4PreCompoundAlpha.hh"
    3438
     39G4PreCompoundEmissionFactory::G4PreCompoundEmissionFactory()
     40{}
    3541
    36 const G4PreCompoundEmissionFactory & G4PreCompoundEmissionFactory::
    37 operator=(const G4PreCompoundEmissionFactory & )
    38 {
    39   throw G4HadronicException(__FILE__, __LINE__, "G4PreCompoundEmissionFactory::operator= meant to not be accessable.");
    40   return *this;
    41 }
    42 
    43 G4bool G4PreCompoundEmissionFactory::
    44 operator==(const G4PreCompoundEmissionFactory & ) const
    45 {
    46   throw G4HadronicException(__FILE__, __LINE__, "G4PreCompoundEmissionFactory::operator== meant to not be accessable.");
    47   return false;
    48 }
    49 
    50 G4bool G4PreCompoundEmissionFactory::
    51 operator!=(const G4PreCompoundEmissionFactory & ) const
    52 {
    53   throw G4HadronicException(__FILE__, __LINE__, "G4PreCompoundEmissionFactory::operator!= meant to not be accessable.");
    54   return true;
    55 }
    56 
     42G4PreCompoundEmissionFactory::~G4PreCompoundEmissionFactory()
     43{}
    5744
    5845std::vector<G4VPreCompoundFragment*> *  G4PreCompoundEmissionFactory::
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundFragment.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PreCompoundFragment.cc,v 1.8 2009/02/10 16:01:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundFragment.cc,v 1.9 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2828//
    2929// J. M. Quesada (August 2008). 
    3030// Based  on previous work by V. Lara
    31 // JMQ (06 September 2008) Also external choice has been added for:
    32 //                      - superimposed Coulomb barrier (if useSICB=true)
    3331//
     32// Modified:
     33// 06.09.2008 JMQ Also external choice has been added for:
     34//               - superimposed Coulomb barrier (if useSICB=true)
     35// 20.08.2010 V.Ivanchenko cleanup
     36//
     37
    3438#include "G4PreCompoundFragment.hh"
    3539
    3640G4PreCompoundFragment::
    37 G4PreCompoundFragment(const G4PreCompoundFragment &right) :
    38   G4VPreCompoundFragment(right)
     41G4PreCompoundFragment(const G4ParticleDefinition* part,
     42                      G4VCoulombBarrier* aCoulombBarrier)
     43  : G4VPreCompoundFragment(part,aCoulombBarrier)
    3944{}
    4045
    41 
    42 G4PreCompoundFragment::
    43 G4PreCompoundFragment(const G4double anA,
    44                       const G4double aZ,
    45                       G4VCoulombBarrier* aCoulombBarrier,
    46                       const G4String & aName):
    47   G4VPreCompoundFragment(anA,aZ,aCoulombBarrier,aName)
    48 {
    49 }
    50 
    51 
    52 
    5346G4PreCompoundFragment::~G4PreCompoundFragment()
    54 {
    55 }
    56 
    57 
    58 const G4PreCompoundFragment & G4PreCompoundFragment::
    59 operator= (const G4PreCompoundFragment & right)
    60 {
    61   if (&right != this) this->G4VPreCompoundFragment::operator=(right);
    62   return *this;
    63 }
    64 
    65 G4int G4PreCompoundFragment::operator==(const G4PreCompoundFragment & right) const
    66 {
    67   return G4VPreCompoundFragment::operator==(right);
    68 }
    69 
    70 G4int G4PreCompoundFragment::operator!=(const G4PreCompoundFragment & right) const
    71 {
    72   return G4VPreCompoundFragment::operator!=(right);
    73 }
    74 
     47{}
    7548
    7649G4double G4PreCompoundFragment::
    7750CalcEmissionProbability(const G4Fragment & aFragment)
    7851{
    79 // If  theCoulombBarrier effect is included in the emission probabilities
    80 //if (GetMaximalKineticEnergy() <= 0.0)
    81   G4double limit;
    82   if(OPTxs==0 ||  useSICB) limit= theCoulombBarrier;
    83   else limit=0.;
     52  //G4cout << theCoulombBarrier << "  " << GetMaximalKineticEnergy() << G4endl;
     53  // If  theCoulombBarrier effect is included in the emission probabilities
     54  //if (GetMaximalKineticEnergy() <= 0.0)
     55  G4double limit = 0.0;
     56  if(OPTxs==0 ||  useSICB) { limit = theCoulombBarrier; }
    8457  if (GetMaximalKineticEnergy() <= limit)
    8558    {
    8659      theEmissionProbability = 0.0;
    8760      return 0.0;
    88   }   
    89 // If  theCoulombBarrier effect is included in the emission probabilities
    90 //  G4double LowerLimit = 0.;
    91 // Coulomb barrier is the lower limit
    92 // of integration over kinetic energy
     61    }   
     62  // If  theCoulombBarrier effect is included in the emission probabilities
     63  //  G4double LowerLimit = 0.;
     64  // Coulomb barrier is the lower limit
     65  // of integration over kinetic energy
    9366  G4double LowerLimit = limit;
    9467
    95 // Excitation energy of nucleus after fragment emission is the upper limit of integration over kinetic energy
     68  // Excitation energy of nucleus after fragment emission is the upper
     69  //limit of integration over kinetic energy
    9670  G4double UpperLimit = GetMaximalKineticEnergy();
    9771 
    9872  theEmissionProbability =
    9973    IntegrateEmissionProbability(LowerLimit,UpperLimit,aFragment);
     74  /*
     75  G4cout << "## G4PreCompoundFragment::CalcEmisProb "
     76         << "Z= " << aFragment.GetZ_asInt()
     77         << " A= " << aFragment.GetA_asInt()
     78         << " Elow= " << LowerLimit/MeV
     79         << " Eup= " << UpperLimit/MeV
     80         << " prob= " << theEmissionProbability
     81         << G4endl;
     82  */
    10083  return theEmissionProbability;
    10184}
    10285
    10386G4double G4PreCompoundFragment::
    104 IntegrateEmissionProbability(const G4double & Low, const G4double & Up,
     87IntegrateEmissionProbability(G4double Low, G4double Up,
    10588                             const G4Fragment & aFragment)
    10689{
     
    134117  G4double Total = 0.0;
    135118
    136 
    137   for (G4int i = 0; i < N; i++)
     119  for (G4int i = 0; i < N; ++i)
    138120    {
    139       G4double KineticE = ((Up-Low)*x[i]+(Up+Low))/2.0;
     121      G4double KineticE = 0.5*((Up-Low)*x[i]+(Up+Low));
    140122      Total += w[i]*ProbabilityDistributionFunction(KineticE, aFragment);
    141123    }
    142   Total  *= (Up-Low)/2.0;
     124  Total  *= 0.5*(Up-Low);
    143125  return Total;
    144126}
    145 
    146 
    147 
    148127
    149128G4double G4PreCompoundFragment::
    150129GetKineticEnergy(const G4Fragment & aFragment)
    151130{
     131  //let's keep this way for consistency with CalcEmissionProbability method
     132  G4double V = 0.0;
     133  if(OPTxs==0 || useSICB) { V = theCoulombBarrier; }
    152134
    153 //      G4double V = this->GetCoulombBarrier();// alternative way for accessing the Coulomb barrier
    154 //                                             //should be equivalent (in fact it is)
    155   G4double V;
    156   if(OPTxs==0 || useSICB) V= theCoulombBarrier;//let's keep this way for consistency with CalcEmissionProbability method
    157   else V=0.;
    158 
    159   G4double Tmax =  GetMaximalKineticEnergy() ; 
     135  G4double Tmax = GetMaximalKineticEnergy(); 
     136  if(Tmax < V) { return 0.0; }
    160137  G4double T(0.0);
    161   G4double NormalizedProbability(1.0);
     138  G4double Probability(1.0);
     139  G4double maxProbability = GetEmissionProbability();
    162140  do
    163141    {
    164       T =V+ G4UniformRand()*(Tmax-V);
    165       NormalizedProbability = ProbabilityDistributionFunction(T,aFragment)/GetEmissionProbability();     
    166     }   while (G4UniformRand() > NormalizedProbability); 
     142      T = V + G4UniformRand()*(Tmax-V);
     143      Probability = ProbabilityDistributionFunction(T,aFragment);     
     144    }   while (maxProbability*G4UniformRand() > Probability); 
    167145  return T;
    168146}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundFragmentVector.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PreCompoundFragmentVector.cc,v 1.11 2009/02/10 16:01:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundFragmentVector.cc,v 1.12 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2828//
    2929// Hadronic Process: Nuclear Preequilibrium
    3030// by V. Lara
     31//
     32// Modified:
     33// 27.08.2010 V.Ivanchenko moved constructor and destructor to source,
     34//            simplify run time computations making inlined
     35//
    3136
    3237#include "G4PreCompoundFragmentVector.hh"
    33 #include "G4HadronicException.hh"
    3438
    35 const G4PreCompoundFragmentVector &
    36 G4PreCompoundFragmentVector::
    37 operator=(const G4PreCompoundFragmentVector &)
     39G4PreCompoundFragmentVector::G4PreCompoundFragmentVector(pcfvector * avector)
     40  : theChannels(0), nChannels(0)
    3841{
    39     throw G4HadronicException(__FILE__, __LINE__, "G4PreCompoundFragmentVector::operator= meant to not be accessable");
    40     return *this;
     42  SetVector(avector);
    4143}
    4244
     45G4PreCompoundFragmentVector::~G4PreCompoundFragmentVector()
     46{}
    4347
    44 G4bool G4PreCompoundFragmentVector::
    45 operator==(const G4PreCompoundFragmentVector &) const
     48void G4PreCompoundFragmentVector::SetVector(pcfvector * avector)
    4649{
    47     return false;
     50  theChannels = avector;
     51  if(theChannels) {
     52    nChannels = theChannels->size();
     53    probabilities.resize(nChannels);
     54  }
    4855}
    4956
    50 G4bool G4PreCompoundFragmentVector::
    51 operator!=(const G4PreCompoundFragmentVector &) const
    52 {
    53     return true;
     57//for inverse cross section choice
     58void G4PreCompoundFragmentVector::SetOPTxs(G4int opt)
     59{   
     60  for (G4int i=0; i< nChannels; ++i) {
     61    (*theChannels)[i]->SetOPTxs(opt);
     62  }
    5463}
    5564
    56 
    57 
    58 G4double G4PreCompoundFragmentVector::
    59 CalculateProbabilities(const G4Fragment & aFragment)
    60 {
    61   TotalEmissionProbability = 0.0;
    62   pcfvector::iterator aChannel;
    63   for (aChannel=theChannels->begin(); aChannel != theChannels->end();
    64        aChannel++)
    65     {
    66       // Calculate emission probailities
    67       // Compute total (integrated over kinetic energy) emission
    68       // probability of a fragment and
    69       // Summing channel emission probabilities
    70       TotalEmissionProbability += (*aChannel)->CalcEmissionProbability(aFragment);
    71     }
    72   return TotalEmissionProbability;
     65//for superimposed Coulomb Barrier for inverse  cross sections
     66void G4PreCompoundFragmentVector::UseSICB(G4bool use)
     67{   
     68  for (G4int i=0; i< nChannels; ++i) {
     69    (*theChannels)[i]->UseSICB(use);
     70  }
    7371}
    7472
    75 
    76 G4VPreCompoundFragment * G4PreCompoundFragmentVector::
    77 ChooseFragment(void)
    78 {
    79   const G4int NumOfFrags = theChannels->size();
    80   std::vector<G4double> running;
    81   running.reserve(NumOfFrags);
    82  
    83   pcfvector::iterator i;
    84   G4double accumulation = 0.0;
    85   for (i = theChannels->begin(); i != theChannels->end(); ++i) {
    86     accumulation += (*i)->GetEmissionProbability();
    87 
    88     running.push_back(accumulation);
    89   }
    90        
    91   // Choose an emission channel
    92   G4double aChannel = G4UniformRand()*TotalEmissionProbability;
    93   G4int ChosenChannel = -1;
    94   std::vector<G4double>::iterator ich;
    95   for (ich = running.begin(); ich != running.end(); ++ich)
    96     {
    97       if (aChannel <= *ich)
    98         {
    99 #ifdef G4NO_ISO_VECDIST
    100           std::vector<G4double>::difference_type n = 0;
    101           std::distance(running.begin(),ich,n);
    102           ChosenChannel = n;
    103 #else
    104           ChosenChannel = std::distance(running.begin(),ich);
    105 #endif
    106           break;
    107         }
    108     }
    109   running.clear();
    110   if (ChosenChannel < 0)
    111     {
    112       G4cerr
    113         << "G4PreCompoundFragmentVector::ChooseFragment: I can't determine a channel\n"
    114         << "Probabilities: ";
    115       for (i = theChannels->begin(); i != theChannels->end(); ++i)
    116         {
    117           G4cout << (*i)->GetEmissionProbability() << "  ";
    118         }
    119       G4cout << '\n';
    120       return 0;
    121     }
    122   else
    123     {
    124       for (i = theChannels->begin(); i != theChannels->end(); ++i)
    125         {
    126           (*i)->IncrementStage();
    127         }
    128     }
    129 
    130   return theChannels->operator[](ChosenChannel);
    131 }
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundHe3.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PreCompoundHe3.cc,v 1.6 2010/04/09 14:06:17 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundHe3.cc,v 1.7 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2928//
    3029// -------------------------------------------------------------------
     
    3938// Modified: 
    4039// 21.08.2008 J. M. Quesada add choice of options 
     40// 20.08.2010 V.Ivanchenko added G4Pow and G4PreCompoundParameters pointers
     41//                         use int Z and A and cleanup
    4142//
    4243 
    4344#include "G4PreCompoundHe3.hh"
    44 
    45 G4ReactionProduct * G4PreCompoundHe3::GetReactionProduct() const
    46 {
    47   G4ReactionProduct * theReactionProduct =
    48     new G4ReactionProduct(G4He3::He3Definition());
    49   theReactionProduct->SetMomentum(GetMomentum().vect());
    50   theReactionProduct->SetTotalEnergy(GetMomentum().e());
    51 #ifdef PRECOMPOUND_TEST
    52   theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    53 #endif
    54   return theReactionProduct;
    55 }   
    56 
    57 G4double G4PreCompoundHe3::FactorialFactor(const G4double N, const G4double P)
    58 {
    59   return
    60       (N-3.0)*(P-2.0)*(
    61                        (((N-2.0)*(P-1.0))/2.0) *(
    62                                                  (((N-1.0)*P)/3.0)
    63                                                  )
    64                        );
    65 }
    66  
    67 G4double G4PreCompoundHe3::CoalescenceFactor(const G4double A)
    68 {
    69   return 243.0/(A*A);
     45#include "G4He3.hh"
     46
     47G4PreCompoundHe3::G4PreCompoundHe3()
     48  : G4PreCompoundIon(G4He3::He3(), &theHe3CoulombBarrier)
     49{}
     50
     51G4PreCompoundHe3::~G4PreCompoundHe3()
     52{}
     53
     54G4double G4PreCompoundHe3::FactorialFactor(G4int N, G4int P)
     55{
     56  return G4double((N-3)*(P-2)*(N-2)*(P-1)*(N-1)*P)/6.0;
     57}
     58 
     59G4double G4PreCompoundHe3::CoalescenceFactor(G4int A)
     60{
     61  return 243.0/G4double(A*A);
    7062}   
    7163
    72 G4double G4PreCompoundHe3::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     64G4double G4PreCompoundHe3::GetRj(G4int nParticles, G4int nCharged)
    7365{
    7466  G4double rj = 0.0;
    75   G4double denominator = NumberParticles*(NumberParticles-1)*(NumberParticles-2);
    76   if(NumberCharged >=2 && (NumberParticles-NumberCharged) >= 1) {
    77     rj = 3.0*static_cast<G4double>(NumberCharged*(NumberCharged-1)*(NumberParticles-NumberCharged))
    78       / static_cast<G4double>(denominator); 
     67  if(nCharged >=2 && (nParticles-nCharged) >= 1) {
     68    G4double denominator = G4double(nParticles*(nParticles-1)*(nParticles-2));
     69    rj = G4double(3*nCharged*(nCharged-1)*(nParticles-nCharged))/denominator; 
    7970  }
    8071  return rj;
    8172}
    8273
    83 ////////////////////////////////////////////////////////////////////////////////////
     74////////////////////////////////////////////////////////////////////////////////
    8475//J. M. Quesada (Dec 2007-June 2008): New inverse reaction cross sections
    8576//OPT=0 Dostrovski's parameterization
     
    8778//OPT=3,4 Kalbach's parameterization
    8879//
    89 G4double G4PreCompoundHe3::CrossSection(const  G4double K)
    90 {
    91   ResidualA=GetRestA();
    92   ResidualZ=GetRestZ();
    93   theA=GetA();
    94   theZ=GetZ();
    95   ResidualAthrd=std::pow(ResidualA,0.33333);
    96   FragmentA=GetA()+GetRestA();
    97   FragmentAthrd=std::pow(FragmentA,0.33333);
    98 
     80G4double G4PreCompoundHe3::CrossSection(G4double K)
     81{
     82  ResidualA = GetRestA();
     83  ResidualZ = GetRestZ();
     84  theA = GetA();
     85  theZ = GetZ();
     86  ResidualAthrd = ResidualA13();
     87  FragmentA = theA + ResidualA;
     88  FragmentAthrd = g4pow->Z13(FragmentA);
    9989
    10090  if (OPTxs==0) return GetOpt0( K);
     
    10999}
    110100
    111 // *********************** OPT=0 : Dostrovski's cross section  *****************************
    112 
    113 G4double G4PreCompoundHe3::GetOpt0(const  G4double K)
    114 {
    115   const G4double r0 = G4PreCompoundParameters::GetAddress()->Getr0();
    116   // cross section is now given in mb (r0 is in mm) for the sake of consistency
    117   //with the rest of the options
    118   return 1.e+25*pi*(r0*ResidualAthrd)*(r0*ResidualAthrd)*GetAlpha()*(1.+GetBeta()/K);
    119 }
    120 //
    121 //----------------
    122 //
    123101G4double G4PreCompoundHe3::GetAlpha()
    124102{
    125103  G4double C = 0.0;
    126   G4double aZ = GetZ() + GetRestZ();
     104  G4int aZ = theZ + ResidualZ;
    127105  if (aZ <= 30)
    128106    {
     
    131109  else if (aZ <= 50)
    132110    {
    133       C = 0.1 + -((aZ-50.)/20.)*0.02;
     111      C = 0.1 - (aZ - 30)*0.001;
    134112    }
    135113  else if (aZ < 70)
    136114    {
    137       C = 0.08 + -((aZ-70.)/20.)*0.02;
     115      C = 0.08 - (aZ - 50)*0.001;
    138116    }
    139117  else
     
    143121  return 1.0 + C*(4.0/3.0);
    144122}
    145 //
    146 //--------------------
    147 //
    148 G4double G4PreCompoundHe3::GetBeta()
    149 {
    150   return -GetCoulombBarrier();
    151 }
    152 //
    153 //********************* OPT=1,2 : Chatterjee's cross section ************************
     123
     124//********************* OPT=1,2 : Chatterjee's cross section *****************
    154125//(fitting to cross section from Bechetti & Greenles OM potential)
    155126
    156127G4double G4PreCompoundHe3::GetOpt12(const  G4double K)
    157128{
    158 
    159   G4double Kc=K;
     129  G4double Kc = K;
    160130
    161131  // JMQ xsec is set constat above limit of validity
    162   if (K>50) Kc=50;
     132  if (K > 50*MeV) { Kc = 50*MeV; }
    163133
    164134  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
    165135
    166   G4double      p0 = -3.06;
     136  G4double     p0 = -3.06;
    167137  G4double     p1 = 278.5;
    168138  G4double     p2 = -1389.;
     
    179149  p = p0 + p1/Ec + p2/(Ec*Ec);
    180150  landa = landa0*ResidualA + landa1;
    181   mu = mu0*std::pow(ResidualA,mu1);
    182   nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     151
     152  G4double resmu1 = g4pow->powZ(ResidualA,mu1);
     153  mu = mu0*resmu1;
     154  nu = resmu1*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    183155  q = landa - nu/(Ec*Ec) - 2*p*Ec;
    184156  r = mu + 2*nu/Ec + p*(Ec*Ec);
     
    198170//c     ** 3he from o.m. of gibson et al
    199171{
    200 
    201172  G4double landa, mu, nu, p , signor(1.),sig;
    202173  G4double ec,ecsq,xnulam,etest(0.),a;
    203174  G4double b,ecut,cut,ecut2,geom,elab;
    204175
    205 
    206176  G4double     flow = 1.e-18;
    207177  G4double     spill= 1.e+18;
    208 
    209178
    210179  G4double     p0 = -2.88;
     
    227196  p = p0 + p1/ec + p2/ecsq;
    228197  landa = landa0*ResidualA + landa1;
    229   a = std::pow(ResidualA,mu1);
     198  a = g4pow->powZ(ResidualA,mu1);
    230199  mu = mu0 * a;
    231200  nu = a* (nu0+nu1*ec+nu2*ecsq); 
    232201  xnulam = nu / landa;
    233   if (xnulam > spill) xnulam=0.;
    234   if (xnulam >= flow) etest = 1.2 *std::sqrt(xnulam);
     202  if (xnulam > spill) { xnulam=0.; }
     203  if (xnulam >= flow) { etest = 1.2 *std::sqrt(xnulam); }
    235204 
    236205  a = -2.*p*ec + landa - nu/ecsq;
     
    241210  ecut = (ecut-a) / (p+p);
    242211  ecut2 = ecut;
    243 //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
    244 //ecut<0 means that there is no cut with energy axis, i.e. xs is set to 0 bellow minimum
    245 //  if (cut < 0.) ecut2 = ecut - 2.;
    246   if (cut < 0.) ecut2 = ecut;
     212  //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
     213  // ecut<0 means that there is no cut with energy axis, i.e. xs is set
     214  // to 0 bellow minimum
     215  //  if (cut < 0.) ecut2 = ecut - 2.;
     216  if (cut < 0.) { ecut2 = ecut; }
    247217  elab = K * FragmentA / ResidualA;
    248218  sig = 0.;
    249219 
    250220  if (elab <= ec) { //start for E<Ec
    251     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     221    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
    252222  }           //end for E<Ec
    253223  else {           //start for E>Ec
    254224    sig = (landa*elab+mu+nu/elab) * signor;
    255225    geom = 0.;
    256     if (xnulam < flow || elab < etest) return sig;
     226    if (xnulam < flow || elab < etest) { return sig; }
    257227    geom = std::sqrt(theA*K);
    258228    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
     
    263233 
    264234}
    265 
    266 //   ************************** end of cross sections *******************************
    267 
    268 
    269 
    270 
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundIon.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PreCompoundIon.cc,v 1.16 2009/02/10 16:01:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundIon.cc,v 1.17 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2828//
    2929// -------------------------------------------------------------------
     
    3838// Modified: 
    3939// 10.02.2009 J. M. Quesada fixed bug in density level of light fragments 
     40// 20.08.2010 V.Ivanchenko added G4Pow and G4PreCompoundParameters pointers
     41//                         use int Z and A and cleanup
    4042//
    4143
    4244#include "G4PreCompoundIon.hh"
    43 #include "G4PreCompoundParameters.hh"
    4445
    45 G4bool G4PreCompoundIon::IsItPossible(const G4Fragment& aFragment)
     46G4PreCompoundIon::
     47G4PreCompoundIon(const G4ParticleDefinition* part,
     48                 G4VCoulombBarrier* aCoulombBarrier)
     49  : G4PreCompoundFragment(part,aCoulombBarrier)
    4650{
    47   G4int pplus = aFragment.GetNumberOfCharged();   
    48   G4int pneut = aFragment.GetNumberOfParticles()-pplus;
    49   return (pneut >= (GetA()-GetZ()) && pplus >= GetZ());
     51  G4double r0 = theParameters->Getr0();
     52  fact = 0.75*CLHEP::millibarn/(CLHEP::pi*r0*r0*r0);
    5053}
    5154
     55G4PreCompoundIon::~G4PreCompoundIon()
     56{}
     57
    5258G4double G4PreCompoundIon::
    53 ProbabilityDistributionFunction(const G4double eKin,
     59ProbabilityDistributionFunction(G4double eKin,
    5460                                const G4Fragment& aFragment)
    5561{
    56   if ( !IsItPossible(aFragment) ) return 0.0;
    57  
    58   const G4double r0 = G4PreCompoundParameters::GetAddress()->Getr0();
     62  if ( !IsItPossible(aFragment) ) { return 0.0; }
     63  G4double efinal = eKin + GetBindingEnergy();
     64  //G4cout << "Efinal= " << efinal << " Ekin= " << eKin << G4endl;
     65  if(efinal <= 0.0 ) { return 0.0; }
    5966
    6067  G4double U = aFragment.GetExcitationEnergy();
    61   G4double P = aFragment.GetNumberOfParticles();
    62   G4double H = aFragment.GetNumberOfHoles();
    63   G4double N = P + H;
     68  G4int P = aFragment.GetNumberOfParticles();
     69  G4int H = aFragment.GetNumberOfHoles();
     70  G4int A = GetA();
     71  G4int N = P + H;
    6472
    65   G4double g0 = (6.0/pi2)*aFragment.GetA() *
    66     G4PreCompoundParameters::GetAddress()->GetLevelDensity();
    67  
    68   G4double g1 = (6.0/pi2)*GetRestA() *
    69     G4PreCompoundParameters::GetAddress()->GetLevelDensity();
     73  G4double g0 = (6.0/pi2)*aFragment.GetA_asInt()*theParameters->GetLevelDensity();
     74  G4double g1 = (6.0/pi2)*GetRestA()*theParameters->GetLevelDensity();
    7075
    7176  //JMQ 06/02/209  This is  THE BUG that was killing cluster emission
     
    7580  G4double gj = g1;
    7681
    77   G4double A0 = ((P*P+H*H+P-H)/4.0 - H/2.0)/g0;
     82  G4double A0 = G4double(P*P+H*H+P-3*H)/(4.0*g0);
     83  G4double A1 = std::max(0.0,(A0*g0 + A*(A-2*P-1)*0.25)/g1);
    7884
    79   G4double A1 = std::max(0.0,(A0*g0 + GetA()*(GetA()-2.0*P-1.0)/4.0)/g1);
    80 
    81   G4double Aj = GetA()*(GetA()+1.0)/4.0/gj;
    82 
    83 
    84   G4double E0 = std::max(0.0,U - A0);
    85   if (E0 == 0.0) return 0.0;
     85  G4double E0 = U - A0;
     86  //G4cout << "E0= " << E0 << G4endl;
     87  if (E0 <= 0.0) { return 0.0; }
    8688
    8789  G4double E1 = (std::max(0.0,GetMaximalKineticEnergy() - eKin - A1));
    8890
    89   G4double Ej = std::max(0.0,eKin + GetBindingEnergy() -Aj);
     91  G4double Aj = A*(A+1)/(4.0*gj);
     92  G4double Ej = std::max(0.0,efinal - Aj);
     93
     94  G4double rj = GetRj(P, aFragment.GetNumberOfCharged());
     95  G4double xs = CrossSection(eKin);
     96
     97  //G4cout << "rj= " << rj << " xs= " << xs << G4endl;
    9098
    9199  // JMQ 10/02/09 reshaping of the formula (unnecessary std::pow elimitated)
     100  /*
     101  G4double r0 = theParameters->Getr0();
    92102  G4double pA = (3.0/4.0) * std::sqrt(std::max(0.0, 2.0/(GetReducedMass()*
    93                 (eKin+GetBindingEnergy()))))/(pi * r0 * r0 *r0* GetRestA())*
     103                (eKin+GetBindingEnergy()))))/(pi * r0 * r0 *r0* GetRestA())*
    94104                eKin*CrossSection(eKin)*millibarn*
    95                 CoalescenceFactor(aFragment.GetA()) * FactorialFactor(N,P)*
    96                 GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged());
     105                CoalescenceFactor(aFragment.GetA_asInt()) * FactorialFactor(N,P)*
     106       GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged());
    97107
    98108  G4double pB = std::pow((g1*E1)/(g0*E0),N-GetA()-1.0)*(g1/g0);
    99  
    100109  G4double pC = std::pow((gj*Ej)/(g0*E0),GetA()-1.0)*(gj/g0)/E0;
    101 
    102   G4double Probability = pA * pB * pC;
    103 
    104   return Probability;
     110  pA *= pB * pC;
     111  */
     112 
     113  G4double pA = fact*eKin*xs*rj
     114    * CoalescenceFactor(aFragment.GetA_asInt()) * FactorialFactor(N,P)
     115    * std::sqrt(2.0/(GetReducedMass()*efinal))
     116    * g4pow->powN(g1*E1/(g0*E0), N-A-1)
     117    * g4pow->powN(gj*Ej/(g0*E0), A-1)*gj*g1/(g0*g0*E0*GetRestA());
     118   
     119  return pA;
    105120}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PreCompoundModel.cc,v 1.20 2010/06/11 17:26:43 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundModel.cc,v 1.25 2010/10/11 13:54:59 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2928//
    3029// by V. Lara
    3130//
    32 //J. M. Quesada (Apr.08). Several changes. Soft cut-off switched off.
    33 //(May. 08). Protection against non-physical preeq. transitional regime has
    34 // been set
    35 //
    36 // Modif (03 September 2008) by J. M. Quesada for external choice of inverse
    37 // cross section option
    38 // JMQ (06 September 2008) Also external choices have been added for:
     31// Modified:
     32// 01.04.2008 J.M.Quesada Several changes. Soft cut-off switched off.
     33// 01.05.2008 J.M.Quesada Protection against non-physical preeq.
     34//                        transitional regime has been set
     35// 03.09.2008 J.M.Quesada for external choice of inverse cross section option
     36// 06.09.2008 J.M.Quesada Also external choices have been added for:
    3937//                      - superimposed Coulomb barrier (useSICB=true)
    4038//                      - "never go back"  hipothesis (useNGB=true)
    4139//                      - soft cutoff from preeq. to equlibrium (useSCO=true)
    4240//                      - CEM transition probabilities (useCEMtr=true) 
    43 
     41// 20.08.2010 V.Ivanchenko Cleanup of the code:
     42//                      - integer Z and A;
     43//                      - emission and transition classes created at initialisation
     44//                      - options are set at initialisation
     45//                      - do not use copy-constructors for G4Fragment 
    4446
    4547#include "G4PreCompoundModel.hh"
     
    4850#include "G4GNASHTransitions.hh"
    4951#include "G4ParticleDefinition.hh"
    50 
     52#include "G4Proton.hh"
     53#include "G4Neutron.hh"
     54
     55#include "G4NucleiProperties.hh"
     56#include "G4PreCompoundParameters.hh"
     57#include "Randomize.hh"
     58#include "G4DynamicParticle.hh"
     59#include "G4ParticleTypes.hh"
     60#include "G4ParticleTable.hh"
     61#include "G4LorentzVector.hh"
    5162
    5263#ifdef PRECOMPOUND_TEST
     
    5869  : G4VPreCompoundModel(value), useHETCEmission(false), useGNASHTransition(false),
    5970    OPTxs(3), useSICB(false), useNGB(false), useSCO(false), useCEMtr(true)
    60 {}
     71{
     72  theParameters = G4PreCompoundParameters::GetAddress();
     73
     74  theEmission = new G4PreCompoundEmission();
     75  if(useHETCEmission) { theEmission->SetHETCModel(); }
     76  else { theEmission->SetDefaultModel(); }
     77  theEmission->SetOPTxs(OPTxs);
     78  theEmission->UseSICB(useSICB);
     79
     80  if(useGNASHTransition) { theTransition = new G4GNASHTransitions; }
     81  else { theTransition = new G4PreCompoundTransitions(); }
     82  theTransition->UseNGB(useNGB);
     83  theTransition->UseCEMtr(useCEMtr);
     84
     85  proton = G4Proton::Proton();
     86  neutron = G4Neutron::Neutron();
     87}
    6188
    6289G4PreCompoundModel::~G4PreCompoundModel()
    63 {}
    64 
    65 G4PreCompoundModel::G4PreCompoundModel()
    66   : G4VPreCompoundModel(0), useHETCEmission(false), useGNASHTransition(false),
    67     OPTxs(3), useSICB(false), useNGB(false), useSCO(false), useCEMtr(true)
    68 {}
    69 
    70 G4PreCompoundModel::G4PreCompoundModel(const G4PreCompoundModel &)
    71 : G4VPreCompoundModel()
    72 {}
    73 
    74 const G4PreCompoundModel & G4PreCompoundModel::operator=(const G4PreCompoundModel &)
    7590{
    76   throw G4HadronicException(__FILE__, __LINE__, "G4PreCompoundModel::operator= meant to not be accessable");
    77   return *this;
    78 }
    79 
    80 
    81 G4bool G4PreCompoundModel::operator==(const G4PreCompoundModel &) const
    82 {
    83   return false;
    84 }
    85 
    86 G4bool G4PreCompoundModel::operator!=(const G4PreCompoundModel &) const
    87 {
    88   return true;
    89 }
    90 
    91 
    92 
    93 // Additional Declarations
    94 
    95 G4HadFinalState * G4PreCompoundModel::ApplyYourself(const G4HadProjectile & thePrimary,
    96                                                     G4Nucleus & theNucleus)
     91  delete theEmission;
     92  delete theTransition;
     93}
     94
     95/////////////////////////////////////////////////////////////////////////////////////////
     96
     97G4HadFinalState* G4PreCompoundModel::ApplyYourself(const G4HadProjectile & thePrimary,
     98                                                   G4Nucleus & theNucleus)
    9799
     100  const G4ParticleDefinition* primary = thePrimary.GetDefinition();
     101  if(primary != neutron && primary != proton) {
     102    std::ostringstream errOs;
     103    errOs << "BAD primary type in G4PreCompoundModel: "
     104          << primary->GetParticleName() <<G4endl;
     105    throw G4HadronicException(__FILE__, __LINE__, errOs.str());
     106  }
     107  G4int Zp = 0;
     108  G4int Ap = 1;
     109  if(primary == proton) { Zp = 1; }
     110
     111  G4int A = theNucleus.GetA_asInt();
     112  G4int Z = theNucleus.GetZ_asInt();
     113
     114  // 4-Momentum
     115  G4LorentzVector p = thePrimary.Get4Momentum();
     116  G4double mass = G4NucleiProperties::GetNuclearMass(A, Z);
     117  p += G4LorentzVector(0.0,0.0,0.0,mass);
     118
    98119  // prepare fragment
    99   G4Fragment anInitialState;
    100   // This si for GNASH transitions
    101   anInitialState.SetParticleDefinition(const_cast<G4ParticleDefinition *>(thePrimary.GetDefinition()));
    102 
    103   G4int anA=static_cast<G4int>(theNucleus.GetN());
    104   anA += thePrimary.GetDefinition()->GetBaryonNumber();
    105 
    106   anInitialState.SetA(anA);
    107  
    108   G4int aZ=static_cast<G4int>(theNucleus.GetZ());
    109   aZ += static_cast<G4int>(thePrimary.GetDefinition()->GetPDGCharge());
    110 
    111   anInitialState.SetZ(aZ);
    112  
    113   // Assume the projectile is a nucleon
    114  
     120  G4Fragment anInitialState(A + Ap, Z + Zp, p);
     121  anInitialState.SetNumberOfParticles(2);
     122  anInitialState.SetNumberOfHoles(1);
     123  anInitialState.SetNumberOfCharged(1);
     124  anInitialState.SetCreationTime(thePrimary.GetGlobalTime());
     125  /*
    115126  // Number of Excited Particles
    116127  anInitialState.SetNumberOfParticles(1+thePrimary.GetDefinition()->GetBaryonNumber());
     
    129140  // Number of Holes
    130141  anInitialState.SetNumberOfHoles(1);
    131  
    132   // pre-compound nucleus energy.
    133   G4double anEnergy = 0;
    134   G4double nucleusMass =  G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(static_cast<G4int>(theNucleus.GetZ()),
    135                                                                                          static_cast<G4int>(theNucleus.GetN()));
    136   anEnergy =  nucleusMass + thePrimary.GetTotalEnergy();
    137  
    138   // Momentum
    139   G4ThreeVector p = thePrimary.Get4Momentum().vect();
    140 
    141   // 4-momentum
    142   G4LorentzVector momentum(p, anEnergy);
    143   anInitialState.SetMomentum(momentum);
    144  
    145 #ifdef PRECOMPOUND_TEST
    146   G4PreCompoundModel::theInitialFragmentForTest = anInitialState;
    147 #endif
     142  */
    148143 
    149144  // call excitation handler
    150   const G4Fragment aFragment(anInitialState);
    151   G4ReactionProductVector * result = DeExcite(aFragment);
     145  //  const G4Fragment aFragment(anInitialState);
     146  G4ReactionProductVector * result = DeExcite(anInitialState);
    152147
    153148#ifdef PRECOMPOUND_TEST
     
    180175}
    181176
    182 
    183177/////////////////////////////////////////////////////////////////////////////////////////
    184 /////////////////////////////////////////////////////////////////////////////////////////
    185 
    186 G4ReactionProductVector* G4PreCompoundModel::DeExcite(const G4Fragment & theInitialState) const
     178
     179G4ReactionProductVector* G4PreCompoundModel::DeExcite(G4Fragment& aFragment)
    187180{
    188  
    189181  G4ReactionProductVector * Result = new G4ReactionProductVector;
    190  
    191   // Copy of the initial state
    192   G4Fragment aFragment(theInitialState);
    193 
    194   if (aFragment.GetExcitationEnergy() < 10*eV)
    195     {
    196       // Perform Equilibrium Emission
    197       PerformEquilibriumEmission(aFragment,Result);
    198       return Result;
    199     }
    200  
    201   if (aFragment.GetA() < 5) {
    202     G4ReactionProduct * theRP = new G4ReactionProduct(G4ParticleTable::GetParticleTable()->
    203                                                       GetIon(static_cast<G4int>(aFragment.GetZ()),
    204                                                              static_cast<G4int>(aFragment.GetA()),
    205                                                              aFragment.GetExcitationEnergy()));
    206     theRP->SetMomentum(aFragment.GetMomentum().vect());
    207     theRP->SetTotalEnergy(aFragment.GetMomentum().e());   
    208     Result->push_back(theRP);
     182  G4double Eex = aFragment.GetExcitationEnergy();
     183  G4int A = aFragment.GetA_asInt();
     184
     185  //G4cout << "### G4PreCompoundModel::DeExcite" << G4endl;
     186  //G4cout << aFragment << G4endl;
     187 
     188  // Perform Equilibrium Emission
     189  if (A < 5 || Eex < keV /*|| Eex > 3.*MeV*A*/) {
     190    PerformEquilibriumEmission(aFragment, Result);
    209191    return Result;
    210192  }
    211193 
    212   G4PreCompoundEmission aEmission;
    213   if (useHETCEmission) aEmission.SetHETCModel();
    214   aEmission.SetUp(theInitialState);
    215  
    216   //for cross section options
    217  
    218   if (OPTxs!= 0 && OPTxs!=1 && OPTxs !=2 && OPTxs !=3 && OPTxs !=4  ) {
    219     std::ostringstream errOs;
    220     errOs << "BAD CROSS SECTION OPTION in G4PreCompoundModel.cc !!"  <<G4endl;
    221     throw G4HadronicException(__FILE__, __LINE__, errOs.str());}
    222   else aEmission.SetOPTxs(OPTxs);
    223  
    224   //for the choice of superimposed Coulomb Barrier for inverse cross sections
    225  
    226    aEmission.UseSICB(useSICB);
    227  
    228  
    229   //----------
    230  
    231   G4VPreCompoundTransitions * aTransition = 0;
    232   if (useGNASHTransition)
    233     {
    234       aTransition = new G4GNASHTransitions;
    235     }
    236   else
    237     {
    238       aTransition = new G4PreCompoundTransitions;
    239       // for the choice of "never go back" hypothesis and CEM transition probabilities 
    240       if (useNGB) aTransition->UseNGB(useNGB);
    241       if (useCEMtr) aTransition->UseCEMtr(useCEMtr);
    242     }
    243  
    244   // Main loop. It is performed until equilibrium deexcitation.
    245   //G4int fragment=0;
    246  
     194  // main loop 
    247195  for (;;) {
    248196   
     
    252200   
    253201    // Initialize fragment according with the nucleus parameters
    254     aEmission.Initialize(aFragment);
    255    
    256    
    257    
    258     G4double g = (6.0/pi2)*aFragment.GetA()*
    259       G4PreCompoundParameters::GetAddress()->GetLevelDensity();
    260    
    261    
    262    
    263    
    264     G4int EquilibriumExcitonNumber = static_cast<G4int>(std::sqrt(2.0*g*aFragment.GetExcitationEnergy())+ 0.5);
    265 //   
    266 //    G4cout<<"Neq="<<EquilibriumExcitonNumber<<G4endl;
    267 //
    268 // J. M. Quesada (Jan. 08)  equilibrium hole number could be used as preeq.- evap. delimiter (IAEA report)
    269 //    G4int EquilibriumHoleNumber = static_cast<G4int>(0.2*std::sqrt(g*aFragment.GetExcitationEnergy())+ 0.5);
    270    
    271 // Loop for transitions, it is performed while there are preequilibrium transitions.
     202    theEmission->Initialize(aFragment);
     203   
     204    G4double g = (6.0/pi2)*aFragment.GetA_asInt()*theParameters->GetLevelDensity();
     205   
     206    G4int EquilibriumExcitonNumber =
     207      static_cast<G4int>(std::sqrt(2.0*g*aFragment.GetExcitationEnergy())+ 0.5);
     208    //   
     209    //    G4cout<<"Neq="<<EquilibriumExcitonNumber<<G4endl;
     210    //
     211    // J. M. Quesada (Jan. 08)  equilibrium hole number could be used as preeq.
     212    // evap. delimiter (IAEA report)
     213   
     214    // Loop for transitions, it is performed while there are preequilibrium transitions.
    272215    G4bool ThereIsTransition = false;
    273216   
     
    278221    //        G4cout<<" Ex. Energy="<<aFragment.GetExcitationEnergy()<<G4endl;
    279222    //        G4cout<<"N. excitons="<<NE<<"  N. Part="<<NP<<"N. Holes ="<<NH<<G4endl;
    280        
    281    
    282223    //G4int transition=0;
    283     do
    284       {
    285         //transition++;
    286         //G4cout<<"transition number .."<<transition<<G4endl;
    287         //G4cout<<" n ="<<aFragment.GetNumberOfExcitons()<<G4endl;
    288         G4bool go_ahead = false;
    289         // soft cutoff criterium as an "ad-hoc" solution to force increase in  evaporation 
    290         //       G4double test = static_cast<G4double>(aFragment.GetNumberOfHoles());
    291         G4double test = static_cast<G4double>(aFragment.GetNumberOfExcitons());
    292        
    293        
    294         if (test < EquilibriumExcitonNumber) go_ahead=true;
    295         //J. M. Quesada (Apr. 08): soft-cutoff switched off by default
    296         if (useSCO) {
    297           if (test < EquilibriumExcitonNumber)
    298             //  if (test < EquilibriumHoleNumber)
    299             {
    300               test /= static_cast<G4double>(EquilibriumExcitonNumber);
    301               //     test /= static_cast<G4double>(EquilibriumHoleNumber);
    302               test -= 1.0;
     224    do {
     225      //transition++;
     226      //G4cout<<"transition number .."<<transition<<G4endl;
     227      //G4cout<<" n ="<<aFragment.GetNumberOfExcitons()<<G4endl;
     228      G4bool go_ahead = false;
     229      // soft cutoff criterium as an "ad-hoc" solution to force increase in  evaporation 
     230      //       G4double test = static_cast<G4double>(aFragment.GetNumberOfHoles());
     231      G4int test = aFragment.GetNumberOfExcitons();
     232      if (test < EquilibriumExcitonNumber) { go_ahead=true; }
     233
     234      //J. M. Quesada (Apr. 08): soft-cutoff switched off by default
     235      if (useSCO) {
     236        if (test < EquilibriumExcitonNumber)
     237          {
     238            G4double x = G4double(test)/G4double(EquilibriumExcitonNumber) - 1;
     239            if( G4UniformRand() < 1.0 -  std::exp(-x*x/0.32) ) { go_ahead = true; }
     240            /*
    303241              test = test*test;
    304242              test /= 0.32;
    305243              test = 1.0 - std::exp(-test);
    306244              go_ahead = (G4UniformRand() < test);
    307              
    308             }
    309         }
     245            */
     246          }
     247      }
    310248       
    311         //JMQ: WARNING:  CalculateProbability MUST be called prior to Get methods !! (O values would be returned otherwise)
    312         G4double TotalTransitionProbability = aTransition->CalculateProbability(aFragment);
    313         G4double P1=aTransition->GetTransitionProb1();
    314         G4double P2=aTransition->GetTransitionProb2();
    315         G4double P3=aTransition->GetTransitionProb3();
    316         //       G4cout<<"P1="<<P1<<" P2="<<P2<<"  P3="<<P3<<G4endl;
     249      // JMQ: WARNING:  CalculateProbability MUST be called prior to Get methods !!
     250      // (O values would be returned otherwise)
     251      G4double TotalTransitionProbability =
     252        theTransition->CalculateProbability(aFragment);
     253      G4double P1 = theTransition->GetTransitionProb1();
     254      G4double P2 = theTransition->GetTransitionProb2();
     255      G4double P3 = theTransition->GetTransitionProb3();
     256      //G4cout<<"P1="<<P1<<" P2="<<P2<<"  P3="<<P3<<G4endl;
     257     
     258      //J.M. Quesada (May. 08). Physical criterium (lamdas)  PREVAILS over
     259      //                        approximation (critical exciton number)
     260      if(P1 <= P2+P3) { go_ahead = false; }
    317261       
    318        
    319         //J.M. Quesada (May. 08). Physical criterium (lamdas)  PREVAILS over approximation (critical exciton number)
    320         if(P1<=(P2+P3)) go_ahead=false;
    321        
    322         if (go_ahead &&  aFragment.GetA() > 4)
    323           {                             
    324             G4double TotalEmissionProbability = aEmission.GetTotalProbability(aFragment);
    325             //
    326             //  G4cout<<"TotalEmissionProbability="<<TotalEmissionProbability<<G4endl;
    327             //
    328             // Check if number of excitons is greater than 0
    329             // else perform equilibrium emission
    330             if (aFragment.GetNumberOfExcitons() <= 0)
    331               {
    332                 // Perform Equilibrium Emission
    333 #ifdef debug // ------------- debug -----------------------------------------
    334                 CheckConservation(theInitialState,aFragment,Result);
    335 #endif // ------------------- debug -----------------------------------------
    336                 PerformEquilibriumEmission(aFragment,Result);
    337                 delete aTransition;
    338                 return Result;
    339               }
     262      if (go_ahead &&  aFragment.GetA_asInt() > 4)
     263        {
     264                               
     265          G4double TotalEmissionProbability =
     266            theEmission->GetTotalProbability(aFragment);
     267          //
     268          //  G4cout<<"TotalEmissionProbability="<<TotalEmissionProbability<<G4endl;
     269          //
     270          // Check if number of excitons is greater than 0
     271          // else perform equilibrium emission
     272          if (aFragment.GetNumberOfExcitons() <= 0)
     273            {
     274              PerformEquilibriumEmission(aFragment,Result);
     275              return Result;
     276            }
    340277           
    341             //      G4PreCompoundTransitions aTransition(aFragment);
     278          //J.M.Quesada (May 08) this has already been done in order to decide 
     279          //                     what to do (preeq-eq)
     280          // Sum of all probabilities
     281          G4double TotalProbability = TotalEmissionProbability
     282            + TotalTransitionProbability;
    342283           
    343             //J.M.Quesada (May 08) this has already been done in order to decide what to do (preeq-eq)
    344             // Sum of transition probabilities
    345             //      G4double TotalTransitionProbability = aTransition->CalculateProbability(aFragment);
    346            
    347             // Sum of all probabilities
    348             G4double TotalProbability = TotalEmissionProbability + TotalTransitionProbability;
    349            
    350             // Select subprocess
    351             if (G4UniformRand() > TotalEmissionProbability/TotalProbability)
    352               {
    353                 // It will be transition to state with a new number of excitons
    354                 ThereIsTransition = true;               
    355                 // Perform the transition
    356                 aFragment = aTransition->PerformTransition(aFragment);
    357               }
    358             else
    359               {
    360                 // It will be fragment emission
    361                 ThereIsTransition = false;
    362                 Result->push_back(aEmission.PerformEmission(aFragment));
    363               }
    364           }
    365         else
    366           {
    367             // Perform Equilibrium Emission
    368 #ifdef debug
    369             CheckConservation(theInitialState,aFragment,Result);
    370 #endif
    371             PerformEquilibriumEmission(aFragment,Result);
    372             delete aTransition;
    373             return Result;
    374           }
    375       } while (ThereIsTransition);   // end of do loop
     284          // Select subprocess
     285          if (TotalProbability*G4UniformRand() > TotalEmissionProbability)
     286            {
     287              // It will be transition to state with a new number of excitons
     288              ThereIsTransition = true;         
     289              // Perform the transition
     290              theTransition->PerformTransition(aFragment);
     291            }
     292          else
     293            {
     294              // It will be fragment emission
     295              ThereIsTransition = false;
     296              Result->push_back(theEmission->PerformEmission(aFragment));
     297            }
     298        }
     299      else
     300        {
     301          PerformEquilibriumEmission(aFragment,Result);
     302          return Result;
     303        }
     304    } while (ThereIsTransition);   // end of do loop
    376305  } // end of for (;;) loop
    377 }
    378 
    379 
    380 
    381 
    382 void G4PreCompoundModel::PerformEquilibriumEmission(const G4Fragment & aFragment,
    383                                                     G4ReactionProductVector * Result) const
    384 {
    385   G4ReactionProductVector * theEquilibriumResult;
    386 
    387   theEquilibriumResult = GetExcitationHandler()->BreakItUp(aFragment);
    388  
    389   Result->insert(Result->end(),theEquilibriumResult->begin(), theEquilibriumResult->end());
    390 
    391   delete theEquilibriumResult;
    392   return;
    393 }
    394 
     306  return Result;
     307}
     308
     309/////////////////////////////////////////////////////////////////////////////////////////
     310//       Initialisation
     311/////////////////////////////////////////////////////////////////////////////////////////
     312
     313void G4PreCompoundModel::UseHETCEmission()
     314{
     315  useHETCEmission = true;
     316  theEmission->SetHETCModel();
     317}
     318
     319void G4PreCompoundModel::UseDefaultEmission()
     320{
     321  useHETCEmission = false;
     322  theEmission->SetDefaultModel();
     323}
     324
     325void G4PreCompoundModel::UseGNASHTransition() {
     326  useGNASHTransition = true;
     327  delete theTransition;
     328  theTransition = new G4GNASHTransitions;
     329  theTransition->UseNGB(useNGB);
     330  theTransition->UseCEMtr(useCEMtr);
     331}
     332
     333void G4PreCompoundModel::UseDefaultTransition() {
     334  useGNASHTransition = false;
     335  delete theTransition;
     336  theTransition = new G4PreCompoundTransitions();
     337  theTransition->UseNGB(useNGB);
     338  theTransition->UseCEMtr(useCEMtr);
     339}
     340
     341void G4PreCompoundModel::SetOPTxs(G4int opt)
     342{
     343  OPTxs = opt;
     344  theEmission->SetOPTxs(OPTxs);
     345}
     346
     347void G4PreCompoundModel::UseSICB()
     348{
     349  useSICB = true;
     350  theEmission->UseSICB(useSICB);
     351}
     352
     353void G4PreCompoundModel::UseNGB() 
     354{
     355  useNGB = true;
     356}
     357
     358void G4PreCompoundModel::UseSCO() 
     359{
     360  useSCO = true;
     361}
     362
     363void G4PreCompoundModel::UseCEMtr()
     364{
     365  useCEMtr = true;
     366}
     367
     368/////////////////////////////////////////////////////////////////////////////////////////
    395369
    396370#ifdef debug
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundNeutron.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PreCompoundNeutron.cc,v 1.4 2009/02/11 18:06:00 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundNeutron.cc,v 1.5 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2928//
    3029// -------------------------------------------------------------------
     
    4039// 21.08.2008 J. M. Quesada add choice of options 
    4140// 10.02.2009 J. M. Quesada set default opt3
     41// 20.08.2010 V.Ivanchenko added G4Pow and G4PreCompoundParameters pointers
     42//                         use int Z and A and cleanup
    4243//
    4344
    4445#include "G4PreCompoundNeutron.hh"
    45 
    46 G4ReactionProduct * G4PreCompoundNeutron::GetReactionProduct() const
    47 {
    48   G4ReactionProduct * theReactionProduct =
    49     new G4ReactionProduct(G4Neutron::NeutronDefinition());
    50   theReactionProduct->SetMomentum(GetMomentum().vect());
    51   theReactionProduct->SetTotalEnergy(GetMomentum().e());
    52 #ifdef PRECOMPOUND_TEST
    53   theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    54 #endif
    55   return theReactionProduct;
    56 }
    57 
    58 G4double G4PreCompoundNeutron::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     46#include "G4Neutron.hh"
     47
     48G4PreCompoundNeutron::G4PreCompoundNeutron()
     49  : G4PreCompoundNucleon(G4Neutron::Neutron(), &theNeutronCoulombBarrier)
     50{}
     51
     52G4PreCompoundNeutron::~G4PreCompoundNeutron()
     53{}
     54
     55G4double G4PreCompoundNeutron::GetRj(G4int nParticles, G4int nCharged)
    5956{
    6057  G4double rj = 0.0;
    61   if(NumberParticles > 0) rj = static_cast<G4double>(NumberParticles - NumberCharged)/
    62                             static_cast<G4double>(NumberParticles);
     58  if(nParticles > 0) {
     59    rj = static_cast<G4double>(nParticles - nCharged)/
     60      static_cast<G4double>(nParticles);
     61  }
    6362  return rj;
    6463}
     
    7271G4double G4PreCompoundNeutron::CrossSection(const  G4double K)
    7372{
    74   ResidualA=GetRestA();
    75   ResidualZ=GetRestZ();
    76   theA=GetA();
    77   theZ=GetZ();
    78   ResidualAthrd=std::pow(ResidualA,0.33333);
    79   FragmentA=GetA()+GetRestA();
    80   FragmentAthrd=std::pow(FragmentA,0.33333);
    81 
    82   if (OPTxs==0) return GetOpt0( K);
    83   else if( OPTxs==1 || OPTxs==2) return GetOpt12( K);
    84   else if (OPTxs==3 || OPTxs==4)  return GetOpt34( K);
     73  ResidualA = GetRestA();
     74  ResidualZ = GetRestZ();
     75  theA = GetA();
     76  theZ = GetZ();
     77  ResidualAthrd = ResidualA13();
     78  FragmentA = theA + ResidualA;
     79  FragmentAthrd = g4pow->Z13(FragmentA);
     80
     81  if (OPTxs==0) { return GetOpt0( K); }
     82  else if( OPTxs==1 || OPTxs==2) { return GetOpt12( K); }
     83  else if (OPTxs==3 || OPTxs==4) { return GetOpt34( K); }
    8584  else{
    8685    std::ostringstream errOs;
     
    9190}
    9291
    93 // *********************** OPT=0 : Dostrovski's cross section  *****************************
    94 
    95 G4double G4PreCompoundNeutron::GetOpt0(const  G4double K)
    96 {
    97  
    98   const G4double r0 = G4PreCompoundParameters::GetAddress()->Getr0();
    99   // cross section is now given in mb (r0 is in mm) for the sake of consistency
    100   //with the rest of the options
    101   return 1.e+25*pi*(r0*ResidualAthrd)*(r0*ResidualAthrd)*GetAlpha()*(1.+GetBeta()/K);
    102 }
    103 //
    104 //-------
    105 //
    10692G4double G4PreCompoundNeutron::GetAlpha()
    10793{
    108   //   return 0.76+2.2/std::pow(GetRestA(),1.0/3.0);
    10994  return 0.76+2.2/ResidualAthrd;
    11095}
    111 //
    112 //------------
    113 //
     96
    11497G4double G4PreCompoundNeutron::GetBeta()
    11598{
     
    117100  return (2.12/(ResidualAthrd*ResidualAthrd)-0.05)*MeV/GetAlpha();
    118101}
    119 //
    120 
    121 //********************* OPT=1,2 : Chatterjee's cross section ************************
     102
     103//********************* OPT=1,2 : Chatterjee's cross section *******************
    122104//(fitting to cross section from Bechetti & Greenles OM potential)
    123105
    124 G4double G4PreCompoundNeutron::GetOpt12(const  G4double K)
    125 {
    126 
     106G4double G4PreCompoundNeutron::GetOpt12(G4double K)
     107{
    127108  G4double Kc=K;
    128109
    129 // Pramana (Bechetti & Greenles) for neutrons is chosen
    130 
    131 // JMQ  xsec is set constat above limit of validity
    132  if (K>50) Kc=50;
     110  // Pramana (Bechetti & Greenles) for neutrons is chosen
     111
     112  // JMQ  xsec is set constat above limit of validity
     113  if (K > 50*MeV) { Kc = 50*MeV; }
    133114
    134115 G4double landa, landa0, landa1, mu, mu0, mu1,nu, nu0, nu1, nu2,xs;
     
    155136}
    156137
    157 
    158138// *********** OPT=3,4 : Kalbach's cross sections (from PRECO code)*************
    159 G4double G4PreCompoundNeutron::GetOpt34(const  G4double K)
    160 {
    161  
     139G4double G4PreCompoundNeutron::GetOpt34(G4double K)
     140{
    162141  G4double landa, landa0, landa1, mu, mu0, mu1,nu, nu0, nu1, nu2;
    163142  G4double p, p0, p1, p2;
     
    177156  p2=0.;
    178157
    179 
    180158  flow = 1.e-18;
    181159  spill= 1.0e+18;
    182160
    183161  // PRECO xs for neutrons is choosen
    184 
    185162  p0 = -312.;
    186163  p1= 0.;
     
    194171  nu2 = 1280.8;
    195172
    196   if (ResidualA < 40.) signor=0.7+ResidualA*0.0075;
    197   if (ResidualA > 210.) signor = 1. + (ResidualA-210.)/250.;
     173  if (ResidualA < 40)  { signor =0.7 + ResidualA*0.0075; }
     174  if (ResidualA > 210) { signor = 1. + (ResidualA-210)/250.; }
    198175  landa = landa0/ResidualAthrd + landa1;
    199176  mu = mu0*ResidualAthrd + mu1*ResidualAthrd*ResidualAthrd;
     
    201178
    202179  // JMQ very low energy behaviour corrected (problem  for A (apprx.)>60)
    203   if (nu < 0.)nu=-nu;
     180  if (nu < 0.) { nu=-nu; }
    204181
    205182  ec = 0.5;
     
    216193  ecut = 0.;
    217194  cut = a*a - 4.*p*b;
    218   if (cut > 0.) ecut = std::sqrt(cut);
     195  if (cut > 0.) { ecut = std::sqrt(cut); }
    219196  ecut = (ecut-a) / (p+p);
    220197  ecut2 = ecut;
    221   if (cut < 0.) ecut2 = ecut - 2.;
    222   elab = K * FragmentA / ResidualA;
     198  if (cut < 0.) { ecut2 = ecut - 2.; }
     199  elab = K * FragmentA / G4double(ResidualA);
    223200  sig = 0.;
    224201  if (elab <= ec) { //start for E<Ec
    225     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;               
     202    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }               
    226203  }              //end for E<Ec
    227204  else {           //start for  E>Ec
    228205    sig = (landa*elab+mu+nu/elab) * signor;
    229206    geom = 0.;
    230     if (xnulam < flow || elab < etest) return sig;
     207    if (xnulam < flow || elab < etest) { return sig; }
    231208    geom = std::sqrt(theA*K);
    232209    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
     
    235212
    236213  }
    237   return sig;}
    238 
    239 //   ************************** end of cross sections *******************************
    240 
    241 
     214  return sig;
     215}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundNucleon.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PreCompoundNucleon.cc,v 1.13 2009/02/11 18:06:00 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundNucleon.cc,v 1.14 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2928//
    3029// -------------------------------------------------------------------
     
    3938// Modified: 
    4039// 10.02.2009 J. M. Quesada cleanup
     40// 20.08.2010 V.Ivanchenko added G4Pow and G4PreCompoundParameters pointers
     41//                         use int Z and A and cleanup
    4142//
    4243
    4344#include "G4PreCompoundNucleon.hh"
    44 #include "G4PreCompoundParameters.hh"
    4545
    46 G4bool G4PreCompoundNucleon::IsItPossible(const G4Fragment& aFragment)
     46G4PreCompoundNucleon::
     47G4PreCompoundNucleon(const G4ParticleDefinition* part,
     48                      G4VCoulombBarrier* aCoulombBarrier)
     49  : G4PreCompoundFragment(part,aCoulombBarrier)
    4750{
    48   G4int pplus = aFragment.GetNumberOfCharged();   
    49   G4int pneut = aFragment.GetNumberOfParticles()-pplus;
    50   return (pneut >= (GetA()-GetZ()) && pplus >= GetZ());
     51  fact = 2*CLHEP::millibarn/(CLHEP::pi2*CLHEP::hbarc*CLHEP::hbarc*CLHEP::hbarc);
    5152}
    5253
     54G4PreCompoundNucleon::~G4PreCompoundNucleon()
     55{}
     56
    5357G4double G4PreCompoundNucleon::
    54 ProbabilityDistributionFunction(const G4double eKin,
     58ProbabilityDistributionFunction(G4double eKin,
    5559                                const G4Fragment& aFragment)
    5660{
    57   if ( !IsItPossible(aFragment) ) return 0.0;
     61  if ( !IsItPossible(aFragment) ) { return 0.0; }
    5862
    5963  G4double U = aFragment.GetExcitationEnergy();
    60   G4double P = aFragment.GetNumberOfParticles();
    61   G4double H = aFragment.GetNumberOfHoles();
    62   G4double N = P + H;
     64  G4int P = aFragment.GetNumberOfParticles();
     65  G4int H = aFragment.GetNumberOfHoles();
     66  G4int N = P + H;
     67
     68  G4double g0 = (6.0/pi2)*aFragment.GetA_asInt()*theParameters->GetLevelDensity();
     69  G4double g1 = (6.0/pi2)*GetRestA()*theParameters->GetLevelDensity();
    6370 
    64   G4double g0 = (6.0/pi2)*aFragment.GetA() *
    65     G4PreCompoundParameters::GetAddress()->GetLevelDensity();
    66  
    67   G4double g1 = (6.0/pi2)*GetRestA() *
    68     G4PreCompoundParameters::GetAddress()->GetLevelDensity();
     71  G4double A0 = G4double(P*P+H*H+P-3*H)/(4.0*g0);
     72  G4double A1 = (A0 - 0.5*P)/g1; 
    6973
    70   G4double A0 = ((P*P+H*H+P-H)/4.0 - H/2.0)/g0;
     74  G4double E0 = U - A0;
     75  if (E0 <= 0.0) { return 0.0; }
    7176
    72   G4double A1 = (A0 - P/2.0)/g1;
     77  G4double E1 = U - eKin - GetBindingEnergy() - A1;
     78  if (E1 <= 0.0) { return 0.0; }
     79
     80  G4double rj = GetRj(P, aFragment.GetNumberOfCharged());
     81  G4double xs = CrossSection(eKin);
     82
     83  if (rj <0.0 || xs < 0.0) { 
     84    std::ostringstream errOs;
     85    G4cout<<"WARNING:  NEGATIVE VALUES "<<G4endl;     
     86    errOs << "Rj=" << rj <<"  xsec("
     87          <<eKin/MeV<<" MeV)= "<< xs <<"  A= "<<GetA()<<"  Z= "<<GetZ()
     88          <<G4endl;
     89    throw G4HadronicException(__FILE__, __LINE__, errOs.str());
     90  }
     91
     92  G4double Probability = fact * GetReducedMass() * rj * xs * eKin * P * (N-1)
     93    * g4pow->powN(g1*E1/(g0*E0),N-2) * g1 / (E0*g0*g0);
    7394 
    74   G4double E0 = std::max(0.0,U - A0);
    75   if (E0 == 0.0) return 0.0;
    76   G4double E1 = std::max(0.0,U - eKin - GetBindingEnergy() - A1);
    77   if (E1 == 0.0) return 0.0;
    78 
    79 
     95  /*
    8096  G4double Probability = 1.0/pi2*2.0/(hbarc*hbarc*hbarc) * GetReducedMass()
    8197    * GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged()) 
    82     * eKin*CrossSection(eKin)*millibarn * P*(N-1.0) * std::pow(g1*E1/(g0*E0),N-2.0)/E0 * g1/(g0*g0);
    83 
    84   if (GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged())<0.0
    85       || CrossSection(eKin) <0) { 
    86     std::ostringstream errOs;
    87     G4cout<<"WARNING:  NEGATIVE VALUES "<<G4endl;     
    88     errOs << "Rj=" << GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged())
    89           <<G4endl;
    90     errOs <<"  xsec("<<eKin<<" MeV) ="<<CrossSection(eKin)<<G4endl;
    91     errOs <<"  A="<<GetA()<<"  Z="<<GetZ()<<G4endl;
    92     throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    93   }
     98    * eKin*CrossSection(eKin)*millibarn * P*(N-1.0) *
     99   std::pow(g1*E1/(g0*E0),N-2.0)/E0 * g1/(g0*g0);
     100  */
    94101
    95102  return Probability;
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundParameters.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PreCompoundParameters.cc,v 1.3 2006/06/29 20:59:29 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundParameters.cc,v 1.4 2010/08/18 14:07:24 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2928//
    3029// by V. Lara
     30//
     31// 18.08.2010 V.Ivanchenko make this class as a standard singleton
     32//
    3133
    3234#include "G4PreCompoundParameters.hh"
    3335
    34 
    35 G4PreCompoundParameters G4PreCompoundParameters::thePreCompoundParameters;
     36G4PreCompoundParameters* G4PreCompoundParameters::theParameters = 0;
    3637
    3738G4PreCompoundParameters * G4PreCompoundParameters::GetAddress()
    38 { return &thePreCompoundParameters; }
     39{
     40  if(0 == theParameters) {
     41    static G4PreCompoundParameters par;
     42    theParameters = &par;
     43  }
     44  return theParameters;
     45}
    3946
     47G4PreCompoundParameters::G4PreCompoundParameters()
     48  : fLevelDensity(0.10/MeV),
     49    fR0(1.5*fermi),
     50    fTransitions_r0(0.6*fermi),
     51    fFermiEnergy(35.0*MeV)
     52{}
     53
     54G4PreCompoundParameters::~G4PreCompoundParameters()
     55{}
     56
     57
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundProton.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PreCompoundProton.cc,v 1.5 2010/04/09 14:06:17 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundProton.cc,v 1.6 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2928//
    3029// -------------------------------------------------------------------
     
    3938// Modified: 
    4039// 21.08.2008 J. M. Quesada added external choice of inverse cross section option
    41 // 21.08.2008 J. M. Quesada added external choice for superimposed Coulomb barrier
    42 //                          (if useSICB=true)
     40// 21.08.2008 J. M. Quesada added external choice for superimposed Coulomb
     41//                          barrier (if useSICB=true)
     42// 20.08.2010 V.Ivanchenko added G4Pow and G4PreCompoundParameters pointers
     43//                         use int Z and A and cleanup
    4344//
    4445
    4546#include "G4PreCompoundProton.hh"
    46 
    47 G4ReactionProduct * G4PreCompoundProton::GetReactionProduct() const
    48 {
    49   G4ReactionProduct * theReactionProduct =
    50     new G4ReactionProduct(G4Proton::ProtonDefinition());
    51   theReactionProduct->SetMomentum(GetMomentum().vect());
    52   theReactionProduct->SetTotalEnergy(GetMomentum().e());
    53 #ifdef PRECOMPOUND_TEST
    54   theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    55 #endif
    56   return theReactionProduct;
    57 }
    58 
    59 G4double G4PreCompoundProton::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     47#include "G4Proton.hh"
     48
     49G4PreCompoundProton::G4PreCompoundProton()
     50  : G4PreCompoundNucleon(G4Proton::Proton(), &theProtonCoulombBarrier)
     51{}
     52
     53G4PreCompoundProton::~G4PreCompoundProton()
     54{}
     55
     56G4double G4PreCompoundProton::GetRj(G4int nParticles, G4int nCharged)
    6057{
    6158  G4double rj = 0.0;
    62   if(NumberParticles > 0) rj = static_cast<G4double>(NumberCharged)/static_cast<G4double>(NumberParticles);
     59  if(nParticles > 0) {
     60    rj = static_cast<G4double>(nCharged)/static_cast<G4double>(nParticles);
     61  }
    6362  return rj;
    6463}
     
    7170//OPT=3 Kalbach's parameterization
    7271//
    73 G4double G4PreCompoundProton::CrossSection(const  G4double K)
    74 {
    75   //G4cout<<" In G4PreCompoundProton OPTxs="<<OPTxs<<G4endl;
    76   //G4cout<<" In G4PreCompoundProton useSICB="<<useSICB<<G4endl;
    77 
    78   ResidualA=GetRestA();
    79   ResidualZ=GetRestZ();
    80   theA=GetA();
    81   theZ=GetZ();
    82   ResidualAthrd=std::pow(ResidualA,0.33333);
    83   FragmentA=GetA()+GetRestA();
    84   FragmentAthrd=std::pow(FragmentA,0.33333);
    85 
    86   if (OPTxs==0) return GetOpt0(K);
    87   else if( OPTxs==1) return GetOpt1(K);
    88   else if( OPTxs==2|| OPTxs==4) return GetOpt2(K);
    89   else if (OPTxs==3)  return GetOpt3(K);
     72G4double G4PreCompoundProton::CrossSection(G4double K)
     73{
     74  ResidualA = GetRestA();
     75  ResidualZ = GetRestZ();
     76  theA = GetA();
     77  theZ = GetZ();
     78  ResidualAthrd = ResidualA13();
     79  FragmentA = theA + ResidualA;
     80  FragmentAthrd = g4pow->Z13(FragmentA);
     81
     82  if (OPTxs==0) { return GetOpt0(K); }
     83  else if( OPTxs==1) { return GetOpt1(K); }
     84  else if( OPTxs==2|| OPTxs==4) { return GetOpt2(K); }
     85  else if (OPTxs==3)  { return GetOpt3(K); }
    9086  else{
    9187    std::ostringstream errOs;
     
    9692}
    9793
    98 // *********************** OPT=0 : Dostrovski's cross section  *****************************
    99 
    100 G4double G4PreCompoundProton::GetOpt0(const  G4double K)
    101 {
    102   const G4double r0 = G4PreCompoundParameters::GetAddress()->Getr0();
    103   // cross section is now given in mb (r0 is in mm) for the sake of consistency
    104   //with the rest of the options
    105   return 1.e+25*pi*(r0*ResidualAthrd)*(r0*ResidualAthrd)*GetAlpha()*(1.+GetBeta()/K);
    106 }
    107 //
    108 //------------
    109 //
    11094G4double G4PreCompoundProton::GetAlpha()
    11195{
    112   G4double aZ = static_cast<G4double>(GetRestZ());
     96  G4int aZ = ResidualZ;
    11397  G4double C = 0.0;
    11498  if (aZ >= 70)
     
    122106  return 1.0 + C;
    123107}
    124 //
    125 //-------------------
    126 // 
     108
    127109G4double G4PreCompoundProton::GetBeta()
    128110{
    129111  return -GetCoulombBarrier();
    130112}
    131 //
    132  
    133 //********************* OPT=1 : Chatterjee's cross section ************************
     113 
     114//********************* OPT=1 : Chatterjee's cross section *********************
    134115//(fitting to cross section from Bechetti & Greenles OM potential)
    135116
    136 G4double G4PreCompoundProton::GetOpt1(const  G4double K)
     117G4double G4PreCompoundProton::GetOpt1(G4double K)
    137118{
    138119  G4double Kc=K;
    139120
    140121  // JMQ  xsec is set constat above limit of validity
    141   if (K>50)  Kc=50;
     122  if (K > 50*MeV) { Kc = 50*MeV; }
    142123
    143124  G4double landa, landa0, landa1, mu, mu0, mu1,nu, nu0, nu1, nu2,xs;
     
    159140  p = p0 + p1/Ec + p2/(Ec*Ec);
    160141  landa = landa0*ResidualA + landa1;
    161   mu = mu0*std::pow(ResidualA,mu1);
    162   nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     142
     143  G4double resmu1 = g4pow->powZ(ResidualA,mu1);
     144  mu = mu0*resmu1;
     145  nu = resmu1*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    163146  q = landa - nu/(Ec*Ec) - 2*p*Ec;
    164147  r = mu + 2*nu/Ec + p*(Ec*Ec);
     
    170153
    171154  return xs;
    172 
    173 }
    174 
    175 //************* OPT=2 : Welisch's proton reaction cross section ************************
    176 
    177 G4double G4PreCompoundProton::GetOpt2(const  G4double K)
    178 {
    179 
    180   G4double rnpro,rnneu,eekin,ekin,ff1,ff2,ff3,r0,fac,fac1,fac2,b0,xine_th(0);
     155}
     156
     157//************* OPT=2 : Welisch's proton reaction cross section ***************
     158
     159G4double G4PreCompoundProton::GetOpt2(G4double K)
     160{
     161
     162  G4double eekin,ekin,ff1,ff2,ff3,r0,fac,fac1,fac2,b0,xine_th(0);
    181163 
    182   //This is redundant when the Coulomb  barrier is overimposed to all cross sections
    183   //It should be kept when Coulomb barrier only imposed at OPTxs=2
    184 
    185   if(!useSICB && K<=theCoulombBarrier) return xine_th=0.0;
     164  // This is redundant when the Coulomb  barrier is overimposed to all
     165  // cross sections
     166  // It should be kept when Coulomb barrier only imposed at OPTxs=2
     167
     168  if(!useSICB && K<=theCoulombBarrier) { return 0.0; }
    186169
    187170  eekin=K;
    188   rnpro=ResidualZ;
    189   rnneu=ResidualA-ResidualZ;
     171  G4int rnneu=ResidualA-ResidualZ;
    190172  ekin=eekin/1000;
    191173  r0=1.36*1.e-15;
     
    194176  fac1=b0*(1.-1./ResidualAthrd);
    195177  fac2=1.;
    196   if(rnneu > 1.5) fac2=std::log(rnneu);
     178  if(rnneu > 1.5) { fac2 = g4pow->logZ(rnneu); }
    197179  xine_th= 1.e+31*fac*fac2*(1.+ResidualAthrd-fac1);
    198180  xine_th=(1.-0.15*std::exp(-ekin))*xine_th/(1.00-0.0007*ResidualA);   
    199   ff1=0.70-0.0020*ResidualA ;
     181  ff1=0.70-0.0020*ResidualA;
    200182  ff2=1.00+1/ResidualA;
    201183  ff3=0.8+18/ResidualA-0.002*ResidualA;
     
    215197  }
    216198  return xine_th;
    217            
    218 }
    219 
     199}
    220200
    221201// *********** OPT=3 : Kalbach's cross sections (from PRECO code)*************
     
    247227  G4double ec,ecsq,xnulam,etest(0.),ra(0.),a,w,c,signor(1.),signor2,sig;
    248228  G4double b,ecut,cut,ecut2,geom,elab;
    249  
    250  
     229   
    251230  G4double      flow = 1.e-18;
    252231  G4double       spill= 1.e+18;
    253  
    254  
    255  
    256   if (ResidualA <= 60.)  signor = 0.92;
    257   else if (ResidualA < 100.) signor = 0.8 + ResidualA*0.002;
    258  
     232   
     233  if (ResidualA <= 60.)  { signor = 0.92; }
     234  else if (ResidualA < 100.) { signor = 0.8 + ResidualA*0.002; }
    259235 
    260236  ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     
    262238  p = p0 + p1/ec + p2/ecsq;
    263239  landa = landa0*ResidualA + landa1;
    264   a = std::pow(ResidualA,mu1);
     240  a = g4pow->powZ(ResidualA,mu1);
    265241  mu = mu0 * a;
    266242  nu = a* (nu0+nu1*ec+nu2*ecsq);
     
    270246 
    271247  xnulam = nu / landa;
    272   if (xnulam > spill) xnulam=0.;
    273   if (xnulam >= flow) etest =std::sqrt(xnulam) + 7.;
     248  if (xnulam > spill) { xnulam=0.; }
     249  if (xnulam >= flow) { etest =std::sqrt(xnulam) + 7.; }
    274250 
    275251  a = -2.*p*ec + landa - nu/ecsq;
     
    277253  ecut = 0.;
    278254  cut = a*a - 4.*p*b;
    279   if (cut > 0.) ecut = std::sqrt(cut);
     255  if (cut > 0.) { ecut = std::sqrt(cut); }
    280256  ecut = (ecut-a) / (p+p);
    281257  ecut2 = ecut;
    282 //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
    283 //ecut<0 means that there is no cut with energy axis, i.e. xs is set to 0 bellow minimum
    284 //  if (cut < 0.) ecut2 = ecut - 2.;
    285   if (cut < 0.) ecut2 = ecut;
     258  //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
     259  // ecut<0 means that there is no cut with energy axis, i.e. xs is set
     260  // to 0 bellow minimum
     261  //  if (cut < 0.) ecut2 = ecut - 2.;
     262  if (cut < 0.) { ecut2 = ecut; }
    286263  elab = K * FragmentA / ResidualA;
    287264  sig = 0.;
    288265  if (elab <= ec) { //start for E<Ec
    289     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     266    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
    290267   
    291268    signor2 = (ec-elab-c) / w;
     
    308285   
    309286  }   //end for E>Ec
    310 
    311287  return sig;
    312288}
    313 
    314 //   ************************** end of cross sections *******************************
    315 
    316 
    317 
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundTransitions.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PreCompoundTransitions.cc,v 1.22 2009/11/21 18:03:13 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundTransitions.cc,v 1.27 2010/10/20 00:47:46 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2828//
    2929// -------------------------------------------------------------------
     
    3737//
    3838// Modified: 
    39 // 16.02.2008 J. M. Quesada fixed bugs
    40 // 06.09.2008 J. M. Quesada added external choices for:
     39// 16.02.2008 J.M.Quesada fixed bugs
     40// 06.09.2008 J.M.Quesada added external choices for:
    4141//                      - "never go back"  hipothesis (useNGB=true)
    4242//                      -  CEM transition probabilities (useCEMtr=true)
    43 
    44 // 30.10.09 J.M.Quesada: CEM transition probabilities have been renormalized
     43// 30.10.2009 J.M.Quesada: CEM transition probabilities have been renormalized
    4544//                       (IAEA benchmark)
    46 //
     45// 20.08.2010 V.Ivanchenko move constructor and destructor to the source and
     46//                         optimise the code
     47//
     48
    4749#include "G4PreCompoundTransitions.hh"
    4850#include "G4HadronicException.hh"
    49 
    50 const G4PreCompoundTransitions & G4PreCompoundTransitions::
    51 operator=(const G4PreCompoundTransitions &)
     51#include "G4PreCompoundParameters.hh"
     52#include "G4Proton.hh"
     53#include "Randomize.hh"
     54#include "G4Pow.hh"
     55
     56G4PreCompoundTransitions::G4PreCompoundTransitions()
    5257{
    53   throw G4HadronicException(__FILE__, __LINE__, "G4PreCompoundTransitions::operator= meant to not be accessable");
    54   return *this;
     58  proton = G4Proton::Proton();
     59  FermiEnergy = G4PreCompoundParameters::GetAddress()->GetFermiEnergy();
     60  r0 = G4PreCompoundParameters::GetAddress()->GetTransitionsr0();
     61  aLDP = G4PreCompoundParameters::GetAddress()->GetLevelDensity();
     62  g4pow = G4Pow::GetInstance();
    5563}
    5664
    57 
    58 G4bool G4PreCompoundTransitions::operator==(const G4PreCompoundTransitions &) const
    59 {
    60   return false;
    61 }
    62 
    63 G4bool G4PreCompoundTransitions::operator!=(const G4PreCompoundTransitions &) const
    64 {
    65   return true;
    66 }
    67 
    68 
     65G4PreCompoundTransitions::~G4PreCompoundTransitions()
     66{}
     67
     68// Calculates transition probabilities with
     69// DeltaN = +2 (Trans1) -2 (Trans2) and 0 (Trans3)
    6970G4double G4PreCompoundTransitions::
    7071CalculateProbability(const G4Fragment & aFragment)
    7172{
    72   //G4cout<<"In G4PreCompoundTransitions.cc  useNGB="<<useNGB<<G4endl;
    73   //G4cout<<"In G4PreCompoundTransitions.cc  useCEMtr="<<useCEMtr<<G4endl;
    74 
    75   // Fermi energy
    76   const G4double FermiEnergy = G4PreCompoundParameters::GetAddress()->GetFermiEnergy();
     73  // Number of holes
     74  G4int H = aFragment.GetNumberOfHoles();
     75  // Number of Particles
     76  G4int P = aFragment.GetNumberOfParticles();
     77  // Number of Excitons
     78  G4int N = P+H;
     79  // Nucleus
     80  G4int A = aFragment.GetA_asInt();
     81  G4int Z = aFragment.GetZ_asInt();
     82  G4double U = aFragment.GetExcitationEnergy();
     83
     84  //G4cout << aFragment << G4endl;
    7785 
    78   // Nuclear radius
    79   const G4double r0 = G4PreCompoundParameters::GetAddress()->GetTransitionsr0();
    80    
    81   // In order to calculate the level density parameter
    82   // G4EvaporationLevelDensityParameter theLDP;
    83 
    84   // Number of holes
    85   G4double H = aFragment.GetNumberOfHoles();
    86   // Number of Particles
    87   G4double P = aFragment.GetNumberOfParticles();
    88   // Number of Excitons
    89   G4double N = P+H;
    90   // Nucleus
    91   G4double A = aFragment.GetA();
    92   G4double Z = static_cast<G4double>(aFragment.GetZ());
    93   G4double U = aFragment.GetExcitationEnergy();
    94  
    95   if(U<10*eV) return 0.0;
     86  if(U < 10*eV) { return 0.0; }
    9687 
    9788  //J. M. Quesada (Feb. 08) new physics
    98   // OPT=1 Transitions are calculated according to Gudima's paper (original in G4PreCompound from VL)
     89  // OPT=1 Transitions are calculated according to Gudima's paper
     90  //       (original in G4PreCompound from VL)
    9991  // OPT=2 Transitions are calculated according to Gupta's formulae
    10092  //
    101  
    102  
    103  
    10493  if (useCEMtr){
    10594
    106    
    10795    // Relative Energy (T_{rel})
    108     G4double RelativeEnergy = (8.0/5.0)*FermiEnergy + U/N;
     96    G4double RelativeEnergy = 1.6*FermiEnergy + U/G4double(N);
    10997   
    11098    // Sample kind of nucleon-projectile
    11199    G4bool ChargedNucleon(false);
    112100    G4double chtest = 0.5;
    113     if (P > 0) chtest = aFragment.GetNumberOfCharged()/P;
    114     if (G4UniformRand() < chtest) ChargedNucleon = true;
     101    if (P > 0) {
     102      chtest = G4double(aFragment.GetNumberOfCharged())/G4double(P);
     103    }
     104    if (G4UniformRand() < chtest) { ChargedNucleon = true; }
    115105   
    116106    // Relative Velocity:
    117107    // <V_{rel}>^2
    118108    G4double RelativeVelocitySqr(0.0);
    119     if (ChargedNucleon) RelativeVelocitySqr = 2.0*RelativeEnergy/proton_mass_c2;
    120     else RelativeVelocitySqr = 2.0*RelativeEnergy/neutron_mass_c2;
     109    if (ChargedNucleon) {
     110      RelativeVelocitySqr = 2.0*RelativeEnergy/CLHEP::proton_mass_c2;
     111    } else {
     112      RelativeVelocitySqr = 2.0*RelativeEnergy/CLHEP::neutron_mass_c2;
     113    }
    121114   
    122115    // <V_{rel}>
     
    124117   
    125118    // Proton-Proton Cross Section
    126     G4double ppXSection = (10.63/RelativeVelocitySqr - 29.92/RelativeVelocity + 42.9)*millibarn;
     119    G4double ppXSection =
     120      (10.63/RelativeVelocitySqr - 29.92/RelativeVelocity + 42.9)
     121      * CLHEP::millibarn;
    127122    // Proton-Neutron Cross Section
    128     G4double npXSection = (34.10/RelativeVelocitySqr - 82.20/RelativeVelocity + 82.2)*millibarn;
     123    G4double npXSection =
     124      (34.10/RelativeVelocitySqr - 82.20/RelativeVelocity + 82.2)
     125      * CLHEP::millibarn;
    129126   
    130127    // Averaged Cross Section: \sigma(V_{rel})
     
    134131      {
    135132        //JMQ: small bug fixed
    136         //      AveragedXSection = ((Z-1.0) * ppXSection + (A-Z-1.0) * npXSection) / (A-1.0);
    137         AveragedXSection = ((Z-1.0) * ppXSection + (A-Z) * npXSection) / (A-1.0);
     133        //AveragedXSection=((Z-1.0) * ppXSection + (A-Z-1.0) * npXSection)/(A-1.0);
     134        AveragedXSection = ((Z-1)*ppXSection + (A-Z)*npXSection)/G4double(A-1);
    138135      }
    139136    else
    140137      {
    141         AveragedXSection = ((A-Z-1.0) * ppXSection + Z * npXSection) / (A-1.0);
     138        AveragedXSection = ((A-Z-1)*ppXSection + Z*npXSection)/G4double(A-1);
     139        //AveragedXSection = ((A-Z-1)*npXSection + Z*ppXSection)/G4double(A-1);
    142140      }
    143141   
     
    146144   
    147145    // This factor is introduced to take into account the Pauli principle
    148     G4double PauliFactor = 1.0 - (7.0/5.0)*FermiRelRatio;
    149     if (FermiRelRatio > 0.5) PauliFactor += (2.0/5.0)*FermiRelRatio*std::pow(2.0 - (1.0/FermiRelRatio), 5.0/2.0);
    150    
     146    G4double PauliFactor = 1.0 - 1.4*FermiRelRatio;
     147    if (FermiRelRatio > 0.5) {
     148      G4double x = 2.0 - 1.0/FermiRelRatio;
     149      PauliFactor += 0.4*FermiRelRatio*x*x*std::sqrt(x);
     150      //PauliFactor +=
     151      //(2.0/5.0)*FermiRelRatio*std::pow(2.0 - (1.0/FermiRelRatio), 5.0/2.0);
     152    }
    151153    // Interaction volume
    152     //  G4double Vint = (4.0/3.0)*pi*std::pow(2.0*r0 + hbarc/(proton_mass_c2*RelativeVelocity) , 3.0);
    153     G4double xx=2.0*r0 + hbarc/(proton_mass_c2*RelativeVelocity);
    154     G4double Vint = (4.0/3.0)*pi*xx*xx*xx;
     154    //  G4double Vint = (4.0/3.0)
     155    //*pi*std::pow(2.0*r0 + hbarc/(proton_mass_c2*RelativeVelocity) , 3.0);
     156    G4double xx = 2.0*r0 + hbarc/(CLHEP::proton_mass_c2*RelativeVelocity);
     157    //    G4double Vint = (4.0/3.0)*CLHEP::pi*xx*xx*xx;
     158    G4double Vint = CLHEP::pi*xx*xx*xx/0.75;
    155159   
    156160    // Transition probability for \Delta n = +2
    157161   
    158     TransitionProb1 = AveragedXSection*PauliFactor*std::sqrt(2.0*RelativeEnergy/proton_mass_c2)/Vint;
    159 
    160 //JMQ 281009  phenomenological factor in order to increase equilibrium contribution
    161 //   G4double factor=5.0;
    162 //   TransitionProb1 *= factor;
    163 //
    164     if (TransitionProb1 < 0.0) TransitionProb1 = 0.0;
    165    
    166     G4double a = G4PreCompoundParameters::GetAddress()->GetLevelDensity();
     162    TransitionProb1 = AveragedXSection*PauliFactor
     163      *std::sqrt(2.0*RelativeEnergy/CLHEP::proton_mass_c2)/Vint;
     164
     165    //JMQ 281009  phenomenological factor in order to increase
     166    //   equilibrium contribution
     167    //   G4double factor=5.0;
     168    //   TransitionProb1 *= factor;
     169    //
     170    if (TransitionProb1 < 0.0) { TransitionProb1 = 0.0; }
     171   
    167172    // GE = g*E where E is Excitation Energy
    168     G4double GE = (6.0/pi2)*a*A*U;
    169    
    170     G4double Fph = ((P*P+H*H+P-H)/4.0 - H/2.0);
    171    
    172     //G4bool NeverGoBack(false);
    173     G4bool NeverGoBack;
    174     if(useNGB)  NeverGoBack=true;
    175     else NeverGoBack=false;
    176    
     173    G4double GE = (6.0/pi2)*aLDP*A*U;
     174   
     175    //G4double Fph = ((P*P+H*H+P-H)/4.0 - H/2.0);
     176    G4double Fph = G4double(P*P+H*H+P-3*H)/4.0;
     177   
     178    G4bool NeverGoBack(false);
     179    if(useNGB) { NeverGoBack=true; }
    177180   
    178181    //JMQ/AH  bug fixed: if (U-Fph < 0.0) NeverGoBack = true;
    179     if (GE-Fph < 0.0) NeverGoBack = true;
     182    if (GE-Fph < 0.0) { NeverGoBack = true; }
    180183   
    181184    // F(p+1,h+1)
    182185    G4double Fph1 = Fph + N/2.0;
    183186   
    184     G4double ProbFactor = std::pow((GE-Fph)/(GE-Fph1),N+1.0);
    185    
     187    G4double ProbFactor = g4pow->powN((GE-Fph)/(GE-Fph1),N+1);
    186188   
    187189    if (NeverGoBack)
    188190      {
    189       TransitionProb2 = 0.0;
    190       TransitionProb3 = 0.0;
     191        TransitionProb2 = 0.0;
     192        TransitionProb3 = 0.0;
    191193      }
    192194    else
    193195      {
    194196        // Transition probability for \Delta n = -2 (at F(p,h) = 0)
    195         TransitionProb2 = TransitionProb1 * ProbFactor * (P*H*(N+1.0)*(N-2.0))/((GE-Fph)*(GE-Fph));
    196         if (TransitionProb2 < 0.0) TransitionProb2 = 0.0;
     197        TransitionProb2 =
     198          TransitionProb1 * ProbFactor * (P*H*(N+1)*(N-2))/((GE-Fph)*(GE-Fph));
     199        if (TransitionProb2 < 0.0) { TransitionProb2 = 0.0; }
    197200       
    198201        // Transition probability for \Delta n = 0 (at F(p,h) = 0)
    199         TransitionProb3 = TransitionProb1* ((N+1.0)/N) * ProbFactor  * (P*(P-1.0) + 4.0*P*H + H*(H-1.0))/(GE-Fph);
    200         if (TransitionProb3 < 0.0) TransitionProb3 = 0.0;
    201       }
    202    
    203     //  G4cout<<"U = "<<U<<G4endl;
    204     //  G4cout<<"N="<<N<<"  P="<<P<<"  H="<<H<<G4endl;
    205     //  G4cout<<"l+ ="<<TransitionProb1<<"  l- ="<< TransitionProb2<<"  l0 ="<< TransitionProb3<<G4endl;
    206     return TransitionProb1 + TransitionProb2 + TransitionProb3;
    207   }
    208  
    209   else  {
    210     //JMQ: Transition probabilities from Gupta's work
    211    
    212     G4double a = G4PreCompoundParameters::GetAddress()->GetLevelDensity();
     202        TransitionProb3 = TransitionProb1*(N+1)* ProbFactor 
     203          * (P*(P-1) + 4.0*P*H + H*(H-1))/(N*(GE-Fph));
     204        if (TransitionProb3 < 0.0) { TransitionProb3 = 0.0; }
     205      }
     206  } else {
     207    //JMQ: Transition probabilities from Gupta's work   
    213208    // GE = g*E where E is Excitation Energy
    214     G4double GE = (6.0/pi2)*a*A*U;
     209    G4double GE = (6.0/pi2)*aLDP*A*U;
    215210 
    216211    G4double Kmfp=2.;
    217212       
    218     TransitionProb1=1./Kmfp*3./8.*1./c_light*1.0e-9*(1.4e+21*U-2./(N+1)*6.0e+18*U*U);
    219     if (TransitionProb1 < 0.0) TransitionProb1 = 0.0;
    220    
    221     if (useNGB){
    222       TransitionProb2=0.;
    223       TransitionProb3=0.;
    224     }
    225     else{       
    226       if (N<=1) TransitionProb2=0. ;   
    227       else  TransitionProb2=1./Kmfp*3./8.*1./c_light*1.0e-9*(N-1.)*(N-2.)*P*H/(GE*GE)*(1.4e+21*U - 2./(N-1)*6.0e+18*U*U);     
     213    //TransitionProb1=1./Kmfp*3./8.*1./c_light*1.0e-9*(1.4e+21*U-2./(N+1)*6.0e+18*U*U);
     214    TransitionProb1 = 3.0e-9*(1.4e+21*U - 1.2e+19*U*U/G4double(N+1))
     215      /(8*Kmfp*CLHEP::c_light);
     216    if (TransitionProb1 < 0.0) { TransitionProb1 = 0.0; }
     217
     218    TransitionProb2=0.;
     219    TransitionProb3=0.;
     220   
     221    if (!useNGB && N > 1) {
     222      // TransitionProb2=1./Kmfp*3./8.*1./c_light*1.0e-9*(N-1.)*(N-2.)*P*H/(GE*GE)*(1.4e+21*U - 2./(N-1)*6.0e+18*U*U);     
     223      TransitionProb2 =
     224        3.0e-9*(N-2)*P*H*(1.4e+21*U*(N-1) - 1.2e+19*U*U)/(8*Kmfp*c_light*GE*GE);     
    228225      if (TransitionProb2 < 0.0) TransitionProb2 = 0.0;
    229       TransitionProb3=0.;
    230     }
    231    
    232       //  G4cout<<"U = "<<U<<G4endl;
    233     //  G4cout<<"N="<<N<<"  P="<<P<<"  H="<<H<<G4endl;
    234     //  G4cout<<"l+ ="<<TransitionProb1<<"  l- ="<< TransitionProb2<<"  l0 ="<< TransitionProb3<<G4endl;
    235     return TransitionProb1 + TransitionProb2 + TransitionProb3;
     226    }
    236227  }
     228  //  G4cout<<"U = "<<U<<G4endl;
     229  //  G4cout<<"N="<<N<<"  P="<<P<<"  H="<<H<<G4endl;
     230  //  G4cout<<"l+ ="<<TransitionProb1<<"  l- ="<< TransitionProb2
     231  //   <<"  l0 ="<< TransitionProb3<<G4endl;
     232  return TransitionProb1 + TransitionProb2 + TransitionProb3;
    237233}
    238234
    239 
    240 G4Fragment G4PreCompoundTransitions::PerformTransition(const G4Fragment & aFragment)
     235void G4PreCompoundTransitions::PerformTransition(G4Fragment & result)
    241236{
    242   G4Fragment result(aFragment);
    243   G4double ChosenTransition = G4UniformRand()*(TransitionProb1 + TransitionProb2 + TransitionProb3);
     237  G4double ChosenTransition =
     238    G4UniformRand()*(TransitionProb1 + TransitionProb2 + TransitionProb3);
    244239  G4int deltaN = 0;
    245   G4int Nexcitons = result.GetNumberOfExcitons();
     240  //  G4int Nexcitons = result.GetNumberOfExcitons();
     241  G4int Npart     = result.GetNumberOfParticles();
     242  G4int Ncharged  = result.GetNumberOfCharged();
     243  G4int Nholes    = result.GetNumberOfHoles();
    246244  if (ChosenTransition <= TransitionProb1)
    247245    {
     
    255253    }
    256254
    257   // AH/JMQ: Randomly decrease the number of charges if deltaN is -2 and in proportion
    258   // to the number charges w.r.t. number of particles,  PROVIDED that there are charged particles
    259   if(deltaN < 0 && G4UniformRand() <=
    260      static_cast<G4double>(result.GetNumberOfCharged())/static_cast<G4double>(result.GetNumberOfParticles())
    261      && (result.GetNumberOfCharged() >= 1)) {
    262     result.SetNumberOfCharged(result.GetNumberOfCharged()+deltaN/2); // deltaN is negative!
    263   }
     255  // AH/JMQ: Randomly decrease the number of charges if deltaN is -2 and 
     256  // in proportion to the number charges w.r.t. number of particles, 
     257  // PROVIDED that there are charged particles
     258  deltaN /= 2;
     259
     260  //G4cout << "deltaN= " << deltaN << G4endl;
    264261
    265262  // JMQ the following lines have to be before SetNumberOfCharged, otherwise the check on
    266263  // number of charged vs. number of particles fails
    267   result.SetNumberOfParticles(result.GetNumberOfParticles()+deltaN/2);
    268   result.SetNumberOfHoles(result.GetNumberOfHoles()+deltaN/2);
    269 
    270   // With weight Z/A, number of charged particles is increased with +1
    271   if ( ( deltaN > 0 ) &&
    272       (G4UniformRand() <= static_cast<G4double>(result.GetZ()-result.GetNumberOfCharged())/
    273        std::max(static_cast<G4double>(result.GetA()-Nexcitons),1.)))
    274     {
    275       result.SetNumberOfCharged(result.GetNumberOfCharged()+deltaN/2);
    276     }
     264  result.SetNumberOfParticles(Npart+deltaN);
     265  result.SetNumberOfHoles(Nholes+deltaN);
     266
     267  if(deltaN < 0) {
     268    if( Ncharged >= 1 && G4int(Npart*G4UniformRand()) <= Ncharged)
     269      {
     270        result.SetNumberOfCharged(Ncharged+deltaN); // deltaN is negative!
     271      }
     272
     273  } else if ( deltaN > 0 ) {
     274    // With weight Z/A, number of charged particles is increased with +1
     275    G4int A = result.GetA_asInt();
     276    G4int Z = result.GetZ_asInt();
     277    if( G4int(std::max(1, A - Npart)*G4UniformRand()) <= Z)
     278      {
     279        result.SetNumberOfCharged(Ncharged+deltaN);
     280      }
     281  }
    277282 
    278283  // Number of charged can not be greater that number of particles
    279   if ( result.GetNumberOfParticles() < result.GetNumberOfCharged() )
     284  if ( Npart < Ncharged )
    280285    {
    281       result.SetNumberOfCharged(result.GetNumberOfParticles());
    282     }
    283  
    284   return result;
     286      result.SetNumberOfCharged(Npart);
     287    }
     288  //G4cout << "### After transition" << G4endl;
     289  //G4cout << result << G4endl;
    285290}
    286291
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundTriton.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PreCompoundTriton.cc,v 1.6 2010/04/09 14:06:17 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PreCompoundTriton.cc,v 1.7 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2928//
    3029// -------------------------------------------------------------------
     
    3938// Modified: 
    4039// 21.08.2008 J. M. Quesada add choice of options 
     40// 20.08.2010 V.Ivanchenko added G4Pow and G4PreCompoundParameters pointers
     41//                         use int Z and A and cleanup
    4142//
    4243 
    4344#include "G4PreCompoundTriton.hh"
    44 
    45 
    46 G4ReactionProduct * G4PreCompoundTriton::GetReactionProduct() const
    47 {
    48   G4ReactionProduct * theReactionProduct =
    49     new G4ReactionProduct(G4Triton::TritonDefinition());
    50   theReactionProduct->SetMomentum(GetMomentum().vect());
    51   theReactionProduct->SetTotalEnergy(GetMomentum().e());
    52 #ifdef PRECOMPOUND_TEST
    53   theReactionProduct->SetCreatorModel("G4PrecompoundModel");
    54 #endif
    55   return theReactionProduct;
    56 }   
    57 
    58 G4double G4PreCompoundTriton::FactorialFactor(const G4double N, const G4double P)
    59 {
    60   return
    61       (N-3.0)*(P-2.0)*(
    62                        (((N-2.0)*(P-1.0))/2.0) *(
    63                                                  (((N-1.0)*P)/3.0)
    64                                                  )
    65                        );
     45#include "G4Triton.hh"
     46
     47G4PreCompoundTriton::G4PreCompoundTriton()
     48  : G4PreCompoundIon(G4Triton::Triton(), &theTritonCoulombBarrier)
     49{}
     50
     51G4PreCompoundTriton::~G4PreCompoundTriton()
     52{}
     53
     54G4double G4PreCompoundTriton::FactorialFactor(G4int N, const G4int P)
     55{
     56  return G4double((N-3)*(P-2)*(N-2)*(P-1)*(N-1)*P)/6.0;
    6657}
    6758 
    68 G4double G4PreCompoundTriton::CoalescenceFactor(const G4double A)
    69 {
    70   return 243.0/(A*A);
     59G4double G4PreCompoundTriton::CoalescenceFactor(G4int A)
     60{
     61  return 243.0/G4double(A*A);
    7162}   
    7263
    73 G4double G4PreCompoundTriton::GetRj(const G4int NumberParticles, const G4int NumberCharged)
     64G4double G4PreCompoundTriton::GetRj(G4int nParticles, G4int nCharged)
    7465{
    7566  G4double rj = 0.0;
    76   G4double denominator = NumberParticles*(NumberParticles-1)*(NumberParticles-2);
    77   if(NumberCharged >= 1 && (NumberParticles-NumberCharged) >= 2) {
    78     rj = 3.0*static_cast<G4double>(NumberCharged*(NumberParticles-NumberCharged)*(NumberParticles-NumberCharged-1))
    79       /static_cast<G4double>(denominator);
     67  if(nCharged >= 1 && (nParticles-nCharged) >= 2) {
     68    G4double denominator =
     69      G4double(nParticles*(nParticles-1)*(nParticles-2));
     70    rj = G4double(3*nCharged*(nParticles-nCharged)*(nParticles-nCharged-1))
     71      /denominator;
    8072  }
    8173  return rj;
    8274}
    8375
    84 ////////////////////////////////////////////////////////////////////////////////////
     76//////////////////////////////////////////////////////////////////////////////////
    8577//J. M. Quesada (Dec 2007-June 2008): New inverse reaction cross sections
    8678//OPT=0 Dostrovski's parameterization
     
    8880//OPT=3,4 Kalbach's parameterization
    8981//
    90 G4double G4PreCompoundTriton::CrossSection(const  G4double K)
    91 {
    92   ResidualA=GetRestA();
    93   ResidualZ=GetRestZ();
    94   theA=GetA();
    95   theZ=GetZ();
    96   ResidualAthrd=std::pow(ResidualA,0.33333);
    97   FragmentA=GetA()+GetRestA();
    98   FragmentAthrd=std::pow(FragmentA,0.33333);
    99 
    100   if (OPTxs==0) return GetOpt0( K);
    101   else if( OPTxs==1 || OPTxs==2) return GetOpt12( K);
    102   else if (OPTxs==3 || OPTxs==4)  return GetOpt34( K);
     82G4double G4PreCompoundTriton::CrossSection(G4double K)
     83{
     84  ResidualA = GetRestA();
     85  ResidualZ = GetRestZ();
     86  theA = GetA();
     87  theZ = GetZ();
     88  ResidualAthrd = ResidualA13();
     89  FragmentA = theA + ResidualA;
     90  FragmentAthrd = g4pow->Z13(FragmentA);
     91
     92  if (OPTxs==0) { return GetOpt0( K); }
     93  else if( OPTxs==1 || OPTxs==2) { return GetOpt12( K); }
     94  else if (OPTxs==3 || OPTxs==4) { return GetOpt34( K); }
    10395  else{
    10496    std::ostringstream errOs;
     
    109101}
    110102
    111 // *********************** OPT=0 : Dostrovski's cross section  *****************************
    112 
    113 G4double G4PreCompoundTriton::GetOpt0(const  G4double K)
    114 {
    115   const G4double r0 = G4PreCompoundParameters::GetAddress()->Getr0();
    116   // cross section is now given in mb (r0 is in mm) for the sake of consistency
    117   //with the rest of the options
    118   return 1.e+25*pi*(r0*ResidualAthrd)*(r0*ResidualAthrd)*GetAlpha()*(1.+GetBeta()/K);
    119 }
    120 //
    121 //---------
    122 //
    123103G4double G4PreCompoundTriton::GetAlpha()
    124104{
    125105  G4double C = 0.0;
    126   G4double aZ = GetZ() + GetRestZ();
     106  G4int aZ = theZ + ResidualZ;
    127107  if (aZ >= 70)
    128108    {
     
    136116  return 1.0 + C/3.0;
    137117}
    138 //
    139 //-------------
    140 //
    141 G4double G4PreCompoundTriton::GetBeta()
    142 {
    143   return -GetCoulombBarrier();
    144 }
    145 //
    146 //********************* OPT=1,2 : Chatterjee's cross section ************************
     118
     119//
     120//********************* OPT=1,2 : Chatterjee's cross section *****************
    147121//(fitting to cross section from Bechetti & Greenles OM potential)
    148122
    149 G4double G4PreCompoundTriton::GetOpt12(const  G4double K)
    150 {
    151 
     123G4double G4PreCompoundTriton::GetOpt12(G4double K)
     124{
    152125  G4double Kc=K;
    153126
    154127  // JMQ xsec is set constat above limit of validity
    155   if (K>50) Kc=50;
     128  if (K > 50*MeV) { Kc=50*MeV; }
    156129
    157130  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
     
    172145  p = p0 + p1/Ec + p2/(Ec*Ec);
    173146  landa = landa0*ResidualA + landa1;
    174   mu = mu0*std::pow(ResidualA,mu1);
    175   nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     147
     148  G4double resmu1 = g4pow->powZ(ResidualA,mu1);
     149  mu = mu0*resmu1;
     150  nu = resmu1*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    176151  q = landa - nu/(Ec*Ec) - 2*p*Ec;
    177152  r = mu + 2*nu/Ec + p*(Ec*Ec);
     
    184159             
    185160  return xs;
    186 
    187161}
    188162
    189163// *********** OPT=3,4 : Kalbach's cross sections (from PRECO code)*************
    190 G4double G4PreCompoundTriton::GetOpt34(const  G4double K)
     164G4double G4PreCompoundTriton::GetOpt34(G4double K)
    191165//     ** t from o.m. of hafele, flynn et al
    192166{
    193 
    194167  G4double landa, mu, nu, p , signor(1.),sig;
    195168  G4double ec,ecsq,xnulam,etest(0.),a;
    196169  G4double b,ecut,cut,ecut2,geom,elab;
    197170
    198 
    199171  G4double     flow = 1.e-18;
    200172  G4double     spill= 1.e+18;
    201 
    202173
    203174  G4double     p0 = -21.45;
     
    220191  p = p0 + p1/ec + p2/ecsq;
    221192  landa = landa0*ResidualA + landa1;
    222   a = std::pow(ResidualA,mu1);
     193  a = g4pow->powZ(ResidualA,mu1);
    223194  mu = mu0 * a;
    224195  nu = a* (nu0+nu1*ec+nu2*ecsq); 
    225196  xnulam = nu / landa;
    226   if (xnulam > spill) xnulam=0.;
    227   if (xnulam >= flow) etest = 1.2 *std::sqrt(xnulam);
     197  if (xnulam > spill) { xnulam=0.; }
     198  if (xnulam >= flow) { etest = 1.2 *std::sqrt(xnulam); }
    228199 
    229200  a = -2.*p*ec + landa - nu/ecsq;
     
    231202  ecut = 0.;
    232203  cut = a*a - 4.*p*b;
    233   if (cut > 0.) ecut = std::sqrt(cut);
     204  if (cut > 0.) { ecut = std::sqrt(cut); }
    234205  ecut = (ecut-a) / (p+p);
    235206  ecut2 = ecut;
    236 //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
    237 //ecut<0 means that there is no cut with energy axis, i.e. xs is set to 0 bellow minimum
    238 //  if (cut < 0.) ecut2 = ecut - 2.;
    239   if (cut < 0.) ecut2 = ecut;
    240   elab = K * FragmentA / ResidualA;
     207  //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
     208  // ecut<0 means that there is no cut with energy axis, i.e. xs is set
     209  // to 0 bellow minimum
     210  //  if (cut < 0.) ecut2 = ecut - 2.;
     211  if (cut < 0.) { ecut2 = ecut; }
     212  elab = K * FragmentA / G4double(ResidualA);
    241213  sig = 0.;
    242214 
    243215  if (elab <= ec) { //start for E<Ec
    244     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     216    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
    245217  }           //end for E<Ec
    246218  else {           //start for E>Ec
    247219    sig = (landa*elab+mu+nu/elab) * signor;
    248220    geom = 0.;
    249     if (xnulam < flow || elab < etest) return sig;
     221    if (xnulam < flow || elab < etest) { return sig; }
    250222    geom = std::sqrt(theA*K);
    251223    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
     
    254226  }           //end for E>Ec
    255227  return sig;
    256 
    257 }
    258 
    259 //   ************************** end of cross sections *******************************
     228}
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4VPreCompoundEmissionFactory.cc

    r819 r1340  
    2424// ********************************************************************
    2525//
    26 
     26// $Id: G4VPreCompoundEmissionFactory.cc,v 1.5 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
     28//
    2729// by V. Lara
    2830
    2931#include "G4VPreCompoundEmissionFactory.hh"
    30 #include "G4HadronicException.hh"
    3132
    32 const G4VPreCompoundEmissionFactory &
    33 G4VPreCompoundEmissionFactory::operator=(const G4VPreCompoundEmissionFactory & )
     33G4VPreCompoundEmissionFactory::G4VPreCompoundEmissionFactory()
     34  : fragvector(0)
     35{}
     36
     37G4VPreCompoundEmissionFactory::~G4VPreCompoundEmissionFactory()
    3438{
    35   throw G4HadronicException(__FILE__, __LINE__, "G4VPreCompoundEmissionFactory::operator= meant to not be accessable.");
    36   return *this;
    37 }
    38 
    39 G4bool
    40 G4VPreCompoundEmissionFactory::operator==(const G4VPreCompoundEmissionFactory & ) const
    41 {
    42   throw G4HadronicException(__FILE__, __LINE__, "G4VPreCompoundEmissionFactory::operator== meant to not be accessable.");
    43   return false;
    44 }
    45 
    46 G4bool
    47 G4VPreCompoundEmissionFactory::operator!=(const G4VPreCompoundEmissionFactory & ) const
    48 {
    49   throw G4HadronicException(__FILE__, __LINE__, "G4VPreCompoundEmissionFactory::operator!= meant to not be accessable.");
    50   return true;
     39  if (fragvector != 0)
     40    std::for_each(fragvector->begin(), fragvector->end(),
     41                  DeleteFragment());
     42  delete fragvector;
    5143}
    5244
    5345
    54 
    55 
    56 G4VPreCompoundEmissionFactory::~G4VPreCompoundEmissionFactory()
    57 {
    58   if (_fragvector != 0)
    59     std::for_each(_fragvector->begin(), _fragvector->end(),
    60                     DeleteFragment());
    61   delete _fragvector;
    62 }
    63 
    64 
    65 std::vector<G4VPreCompoundFragment*> *
    66 G4VPreCompoundEmissionFactory::GetFragmentVector()
    67 {
    68   // Lazy initialization
    69   if (_fragvector == 0)
    70     _fragvector = CreateFragmentVector();
    71   return _fragvector;
    72 }
    73 
  • trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4VPreCompoundFragment.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VPreCompoundFragment.cc,v 1.12 2009/02/10 16:01:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4VPreCompoundFragment.cc,v 1.13 2010/08/28 15:16:55 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-ref-09 $
    2828//
    29 // J. M. Quesada (August 2008). 
    30 // Based  on previous work by V. Lara
     29// J. M. Quesada (August 2008).  Based  on previous work by V. Lara
    3130//
    32  
     31// Modified:
     32// 20.08.2010 V.Ivanchenko added G4Pow and G4PreCompoundParameters pointers
     33//                         use int Z and A and cleanup
     34
    3335#include "G4VPreCompoundFragment.hh"
    3436#include "G4PreCompoundParameters.hh"
     37#include "G4NucleiProperties.hh"
    3538
    36 G4VPreCompoundFragment::
    37 G4VPreCompoundFragment(const G4VPreCompoundFragment & right)
     39G4VPreCompoundFragment::G4VPreCompoundFragment(
     40  const G4ParticleDefinition* part, G4VCoulombBarrier* aCoulombBarrier)
     41  : particle(part), theCoulombBarrierPtr(aCoulombBarrier),
     42    theRestNucleusA(0),theRestNucleusZ(0),theBindingEnergy(0.0),
     43    theMaximalKineticEnergy(-MeV),theRestNucleusMass(0.0),
     44    theReducedMass(0.0),theMomentum(0.,0.,0.,0.),
     45    theEmissionProbability(0.0),theCoulombBarrier(0.0)
    3846{
    39   theA = right.theA;
    40   theZ = right.theZ;
    41   theRestNucleusA = right.theRestNucleusA;
    42   theRestNucleusZ = right.theRestNucleusZ;
    43   theCoulombBarrier = right.theCoulombBarrier;
    44   theCoulombBarrierPtr = right.theCoulombBarrierPtr;
    45   theMaximalKineticEnergy = right.theMaximalKineticEnergy;
    46   theEmissionProbability = right.theEmissionProbability;
    47   theMomentum = right.theMomentum;
    48   theFragmentName = right.theFragmentName;
    49   theStage = right.theStage;
     47  theA = particle->GetBaryonNumber();
     48  theZ = G4int(particle->GetPDGCharge()/eplus + 0.1);
     49  theMass = particle->GetPDGMass();
     50  theParameters = G4PreCompoundParameters::GetAddress();
     51  g4pow = G4Pow::GetInstance();
    5052}
    5153
    52 G4VPreCompoundFragment::
    53 G4VPreCompoundFragment(const G4double anA,
    54                        const G4double aZ,
    55                        G4VCoulombBarrier* aCoulombBarrier,
    56                        const G4String & aName):
    57   theA(anA),theZ(aZ),
    58   theRestNucleusA(0.0),theRestNucleusZ(0.0),theCoulombBarrier(0.0),
    59   theCoulombBarrierPtr(aCoulombBarrier),
    60   theBindingEnergy(0.0), theMaximalKineticEnergy(-1.0),
    61   theEmissionProbability(0.0), theMomentum(0.0,0.0,0.0,0.0),
    62   theFragmentName(aName),theStage(0)
     54G4VPreCompoundFragment::~G4VPreCompoundFragment()
    6355{}
    64 
    65 
    66 
    67 G4VPreCompoundFragment::~G4VPreCompoundFragment()
    68 {
    69 }
    70 
    71 
    72 const G4VPreCompoundFragment & G4VPreCompoundFragment::
    73 operator= (const G4VPreCompoundFragment & right)
    74 {
    75   if (this != &right) {
    76     theA = right.theA;
    77     theZ = right.theZ;
    78     theRestNucleusA = right.theRestNucleusA;
    79     theRestNucleusZ = right.theRestNucleusZ;
    80     theCoulombBarrier = right.theCoulombBarrier;
    81     theCoulombBarrierPtr = right.theCoulombBarrierPtr;
    82     theMaximalKineticEnergy = right.theMaximalKineticEnergy;
    83     theEmissionProbability = right.theEmissionProbability;
    84     theMomentum = right.theMomentum;
    85     theFragmentName = right.theFragmentName;
    86     theStage = right.theStage;
    87   }
    88   return *this;
    89 }
    90 
    91 G4int G4VPreCompoundFragment::operator==(const G4VPreCompoundFragment & right) const
    92 {
    93   return (this == (G4VPreCompoundFragment *) &right);
    94 }
    95 
    96 G4int G4VPreCompoundFragment::operator!=(const G4VPreCompoundFragment & right) const
    97 {
    98   return (this != (G4VPreCompoundFragment *) &right);
    99 }
    100 
    10156
    10257std::ostream&
     
    10762}
    10863
    109 
    11064std::ostream&
    11165operator << (std::ostream &out, const G4VPreCompoundFragment *theFragment)
     
    11569   
    11670  out
    117     << "PreCompound Model Emitted Fragment: A = "
     71    << "PreCompoundModel Emitted Fragment: A = "
    11872    << std::setprecision(3) << theFragment->theA
    11973    << ", Z = " << std::setprecision(3) << theFragment->theZ;
     
    13084   
    13185    out.setf(old_floatfield,std::ios::floatfield);
    132    
    13386    return out;
    13487}
    135 
    13688
    13789void G4VPreCompoundFragment::
    13890Initialize(const G4Fragment & aFragment)
    13991{
    140   theRestNucleusA = aFragment.GetA() - theA;
    141   theRestNucleusZ = aFragment.GetZ() - theZ;
     92  theRestNucleusA = aFragment.GetA_asInt() - theA;
     93  theRestNucleusZ = aFragment.GetZ_asInt() - theZ;
     94  theRestNucleusA13 = g4pow->Z13(theRestNucleusA);
    14295
    14396  if ((theRestNucleusA < theRestNucleusZ) ||
     
    149102      return;
    150103    }
    151  
    152  
     104   
    153105  // Calculate Coulomb barrier
    154106  theCoulombBarrier = theCoulombBarrierPtr->
    155     GetCoulombBarrier(static_cast<G4int>(theRestNucleusA),static_cast<G4int>(theRestNucleusZ),
     107    GetCoulombBarrier(theRestNucleusA,theRestNucleusZ,
    156108                      aFragment.GetExcitationEnergy());
    157109
     110  // Calculate masses
     111  theRestNucleusMass =
     112    G4NucleiProperties::GetNuclearMass(theRestNucleusA, theRestNucleusZ);
     113  theReducedMass = theRestNucleusMass*theMass/(theRestNucleusMass + theMass);
    158114
    159115  // Compute Binding Energies for fragments
    160116  // (needed to separate a fragment from the nucleus)
     117  theBindingEnergy = theRestNucleusMass + theMass - aFragment.GetGroundStateMass();
    161118 
    162   theBindingEnergy = G4NucleiProperties::GetMassExcess(static_cast<G4int>(theA),static_cast<G4int>(theZ)) +
    163     G4NucleiProperties::GetMassExcess(static_cast<G4int>(theRestNucleusA),static_cast<G4int>(theRestNucleusZ)) -
    164     G4NucleiProperties::GetMassExcess(static_cast<G4int>(aFragment.GetA()),static_cast<G4int>(aFragment.GetZ()));
     119  //theBindingEnergy = G4NucleiProperties::GetMassExcess(static_cast<G4int>(theA),static_cast<G4int>(theZ)) +
     120  //G4NucleiProperties::GetMassExcess(static_cast<G4int>(theRestNucleusA),static_cast<G4int>(theRestNucleusZ)) -
     121  //G4NucleiProperties::GetMassExcess(static_cast<G4int>(aFragment.GetA()),static_cast<G4int>(aFragment.GetZ()));
    165122 
    166123  // Compute Maximal Kinetic Energy which can be carried by fragments after separation
    167124  // This is the true (assimptotic) maximal kinetic energy
    168   G4double m = aFragment.GetMomentum().m();
    169   G4double rm = GetRestNuclearMass();
    170   G4double em = GetNuclearMass();
     125  G4double m  = aFragment.GetMomentum().m();
     126  G4double rm = theRestNucleusMass;
     127  G4double em = theMass;
    171128  theMaximalKineticEnergy = ((m - rm)*(m + rm) + em*em)/(2.0*m) - em;
    172129 
    173  
    174130  return;
    175131}
    176 
    177 
    178 
    179 
Note: See TracChangeset for help on using the changeset viewer.