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

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.