Ignore:
Timestamp:
May 28, 2009, 4:26:57 PM (15 years ago)
Author:
garnier
Message:

maj sur la beta de geant 4.9.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationSpectrum.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eIonisationSpectrum.cc,v 1.25 2006/06/29 19:42:04 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eIonisationSpectrum.cc,v 1.26 2009/03/23 09:13:44 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4646// 30.05.2002 VI            Update to 24-parameters data
    4747// 11.07.2002 VI            Fix in integration over spectrum
     48// 23.03.2009 LP            Added protection against division by zero (for
     49//                          faulty database files), Bug Report 1042
    4850//
    4951// -------------------------------------------------------------------
     
    125127  p.push_back((2.0*g - 1.0)/(g*g));
    126128 
    127   p[iMax-1] = Function(p[3], p);
     129  //Add protection against division by zero: actually in Function()
     130  //parameter p[3] appears in the denominator. Bug report 1042
     131  if (p[3] > 0)
     132    p[iMax-1] = Function(p[3], p);
     133  else
     134    {
     135      G4cout << "WARNING: G4eIonisationSpectrum::Probability "
     136             << "parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = "
     137             << Z << ". Please check and/or update it " << G4endl;     
     138    }
    128139
    129140  if(e >= 1. && e <= 0. && Z == 4) p.push_back(0.0);
     
    210221  p.push_back((2.0*g - 1.0)/(g*g));
    211222
    212   p[iMax-1] = Function(p[3], p);
     223 
     224  //Add protection against division by zero: actually in Function()
     225  //parameter p[3] appears in the denominator. Bug report 1042
     226  if (p[3] > 0)
     227    p[iMax-1] = Function(p[3], p);
     228  else
     229    {
     230      G4cout << "WARNING: G4eIonisationSpectrum::AverageEnergy "
     231             << "parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = "
     232             << Z << ". Please check and/or update it " << G4endl;     
     233    }
    213234   
    214235  G4double val = AverageValue(x1, x2, p);
     
    288309  p.push_back((2.0*g - 1.0)/(g*g));
    289310
    290   p[iMax-1] = Function(p[3], p);
     311 
     312  //Add protection against division by zero: actually in Function()
     313  //parameter p[3] appears in the denominator. Bug report 1042
     314  if (p[3] > 0)
     315    p[iMax-1] = Function(p[3], p);
     316  else
     317    {
     318      G4cout << "WARNING: G4eIonisationSpectrum::SampleSpectrum "
     319             << "parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = "
     320             << Z << ". Please check and/or update it " << G4endl;     
     321    }
    291322
    292323  G4double aria1 = 0.0;
Note: See TracChangeset for help on using the changeset viewer.