Ignore:
Timestamp:
Apr 6, 2009, 12:21:12 PM (15 years ago)
Author:
garnier
Message:

update processes

File:
1 edited

Legend:

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

    r819 r961  
    2525//
    2626//
    27 // $Id: G4hLowEnergyLoss.cc,v 1.23 2006/06/29 19:42:23 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4hLowEnergyLoss.cc,v 1.28 2009/02/20 10:49:54 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// -----------------------------------------------------------
     
    145145G4double G4hLowEnergyLoss::HighestKineticEnergy= 100.*GeV;
    146146G4int    G4hLowEnergyLoss::TotBin = 360;
    147 G4double G4hLowEnergyLoss::RTable,G4hLowEnergyLoss::LOGRTable;
     147G4double G4hLowEnergyLoss::RTable =1.1;
     148G4double G4hLowEnergyLoss::LOGRTable = 1.1;
    148149
    149150//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    772773    theRangeTable = theRangepbarTable ;
    773774  }
    774  
    775775  G4double R2 = RTable*RTable ;
    776776  G4double R1 = RTable+1.;
     
    796796      else
    797797      {
    798         Tim = Ti/RTable ;
     798        // ---- MGP ---- Modified to avoid a floating point exception
     799        // The correction is just a temporary patch, the whole class should be redesigned
     800        // Original: Tim = Ti/RTable  results in 0./0.
     801        if (RTable != 0.)
     802          {
     803            Tim = Ti/RTable ;
     804          }
     805        else
     806          {
     807            Tim = 0.;
     808          }
    799809        Rim = rangeVector->GetValue(Tim,isOut);
    800810      }
     
    806816        Rip = rangeVector->GetValue(Tip,isOut);
    807817      }
    808       Value = (w1*Rip + w2*Ri + w3*Rim)/(Ti*Ti) ;
     818      if (Ti!=0) Value = (w1*Rip + w2*Ri + w3*Rim)/(Ti*Ti); else Value=0;
    809819
    810820      aVector->PutValue(i,Value);
     
    868878      else
    869879      {
    870         Tim = Ti/RTable ;
     880        if (RTable!=0) Tim = Ti/RTable ; else Tim =0;
    871881        Rim = rangeVector->GetValue(Tim,isOut);
    872882      }
     
    878888        Rip = rangeVector->GetValue(Tip,isOut);
    879889      }
    880       Value = (w1*Rip + w2*Ri + w3*Rim)/Ti;
     890      if (Ti!=0) Value = (w1*Rip + w2*Ri + w3*Rim)/Ti; else Value=0;
    881891
    882892      aVector->PutValue(i,Value);
     
    939949      else
    940950      {
    941         Tim = Ti/RTable ;
     951        if (RTable!=0) Tim = Ti/RTable ; else Tim=0;
    942952        Rim = rangeVector->GetValue(Tim,isOut);
    943953      }
     
    10521062{
    10531063  G4double LowEdgeRange,A,B,C,discr,KineticEnergy ;
    1054   G4double Tbin = LowestKineticEnergy/RTable ;
     1064  G4double Tbin = 0;
     1065  if (RTable !=0.) Tbin = LowestKineticEnergy/RTable ;
    10551066  G4double rangebin = 0.0 ;
    10561067  G4int binnumber = -1 ;
Note: See TracChangeset for help on using the changeset viewer.