Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (13 years ago)
Author:
garnier
Message:

geant4 tag 9.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4E1Probability.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4E1Probability.cc,v 1.9 2010/05/25 10:47:24 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4E1Probability.cc,v 1.11 2010/11/23 18:05:07 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029//---------------------------------------------------------------------
     
    3736// 18.05.2010 V.Ivanchenko trying to speedup the most slow method
    3837//            by usage of G4Pow, integer A and introduction of const members
    39 //
     38// 17.11.2010 V.Ivanchenko perform general cleanup and simplification
     39//            of integration method; low-limit of integration is defined
     40//            by gamma energy or is zero (was always zero before)
    4041//
    4142
    4243#include "G4E1Probability.hh"
    43 //#include "G4ConstantLevelDensityParameter.hh"
    4444#include "Randomize.hh"
    4545#include "G4Pow.hh"
     
    6363
    6464G4double G4E1Probability::EmissionProbDensity(const G4Fragment& frag,
    65                                               const G4double gammaE)
     65                                              G4double gammaE)
    6666{
    6767
     
    7777  G4int Afrag = frag.GetA_asInt();
    7878  G4double Uexcite = frag.GetExcitationEnergy();
     79  G4double U = std::max(0.0,Uexcite-gammaE);
    7980
    80   if( (Uexcite-gammaE) < 0.0 || gammaE < 0) { return theProb; }
     81  if(gammaE < 0.0) { return theProb; }
    8182
    8283  // Need a level density parameter.
     
    8990  //  G4double levelDensAft = std::exp(2*std::sqrt(aLevelDensityParam*(Uexcite-gammaE)));
    9091  // VI reduce number of calls to exp
    91   G4double levelDens = 1.0;
    92   if( aLevelDensityParam > 0.0 ) {
    93     levelDens = std::exp(2*(std::sqrt(aLevelDensityParam*(Uexcite-gammaE))
    94       - std::sqrt(aLevelDensityParam*Uexcite)));
    95   }
     92  G4double levelDens =
     93    std::exp(2*(std::sqrt(aLevelDensityParam*U)-std::sqrt(aLevelDensityParam*Uexcite)));
    9694  // Now form the probability density
    9795
     
    140138
    141139G4double G4E1Probability::EmissionProbability(const G4Fragment& frag,
    142                                                  const G4double gammaE)
     140                                              G4double gammaE)
    143141{
    144 
    145142  // From nuclear fragment properties and the excitation energy, calculate
    146143  // the probability for photon evaporation down to last ground level.
    147144  // fragment = nuclear fragment BEFORE de-excitation
    148145
    149   G4double theProb = 0.0;
     146  G4double upperLim = gammaE;
     147  G4double lowerLim = 0.0;
    150148
    151   G4double Uafter = 0.0;
    152   const G4double Uexcite = frag.GetExcitationEnergy();
    153 
    154   G4double normC = 3.0;
    155 
    156   const G4double upperLim = Uexcite;
    157   const G4double lowerLim = Uafter;
    158   const G4int numIters = 100;
    159 
    160   // Fall-back is a uniform random number
    161 
    162   //G4double uniformNum = G4UniformRand();
    163   //theProb = uniformNum;
     149  //G4cout << "G4E1Probability::EmissionProbability:  Emin= " << lowerLim
     150  //     << " Emax= " << upperLim << G4endl;
     151  if( upperLim - lowerLim <= CLHEP::keV ) { return 0.0; }
    164152
    165153  // Need to integrate EmissionProbDensity from lowerLim to upperLim
    166   // and multiply by normC
     154  // and multiply by factor 3 (?!)
    167155
    168   G4double integ = normC *
    169            EmissionIntegration(frag,gammaE,lowerLim,upperLim,numIters);
    170   if(integ > 0.0) theProb = integ/(upperLim-lowerLim);
     156  G4double integ = 3.0 * EmissionIntegration(frag,lowerLim,upperLim);
    171157
    172   return theProb;
     158  return integ;
    173159
    174160}
    175161
    176162G4double G4E1Probability::EmissionIntegration(const G4Fragment& frag,
    177                              const G4double ,
    178                              const G4double lowLim, const G4double upLim,
    179                              const G4int numIters)
     163                                              G4double lowLim, G4double upLim)
    180164
    181165{
     166  // Simple integration
     167  // VI replace by direct integration over 100 point
    182168
    183   // Simple Gaussian quadrature integration
     169  const G4int numIters = 100;
     170  G4double Step = (upLim-lowLim)/G4double(numIters);
    184171
    185   G4double x;
    186   G4double root3 = 1.0/std::sqrt(3.0);
     172  G4double res = 0.0;
     173  G4double x = lowLim - 0.5*Step;
    187174
    188   G4double Step = (upLim-lowLim)/(2.0*numIters);
    189   G4double Delta = Step*root3;
    190 
    191   G4double mean = 0.0;
    192 
    193   G4double theInt = 0.0;
    194 
    195   for(G4int i = 0; i < numIters; i++) {
    196 
    197     x = (2*i + 1)*Step;
    198     G4double E1ProbDensityA = EmissionProbDensity(frag,x+Delta);
    199     G4double E1ProbDensityB = EmissionProbDensity(frag,x-Delta);
    200 
    201     mean += E1ProbDensityA + E1ProbDensityB;
    202 
     175  for(G4int i = 0; i < numIters; ++i) {
     176    x += Step;
     177    res += EmissionProbDensity(frag, x);
    203178  }
    204179
    205   if(mean*Step > 0.0) theInt = mean*Step;
     180  if(res > 0.0) { res /= G4double(numIters); }
     181  else { res = 0.0; }
    206182
    207   return theInt;
     183  return res;
    208184
    209185}
Note: See TracChangeset for help on using the changeset viewer.