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

geant4 tag 9.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPInelasticCompFS.cc

    r1340 r1347  
    4141//        add two_body_reaction
    4242// 100909 add safty
     43// 101111 add safty for _nat_ data case in Binary reaction, but break conservation 
    4344//
    4445#include "G4NeutronHPInelasticCompFS.hh"
     
    681682   G4double AA = hadron->GetDefinition()->GetPDGMass() / proj->GetDefinition()->GetPDGMass();
    682683   G4double E1 = proj->GetKineticEnergy();
    683    G4double beta = std::sqrt ( A*(A+1-AA)/AA*(1+(1+A)/A*Q/E1) );
     684
     685// 101111
     686// In _nat_ data (Q+E1) could become negative value, following line is safty for this case.
     687   //if ( (Q+E1) < 0 )
     688   if ( ( 1 + (1+A)/A*Q/E1 ) < 0 )
     689   {
     690// 1.0e-6 eV is additional safty for numeric precision
     691      Q = -( A/(1+A)*E1 ) + 1.0e-6*eV;
     692   }
     693
     694   G4double beta = std::sqrt ( A*(A+1-AA)/AA*( 1 + (1+A)/A*Q/E1 ) );
    684695   G4double gamma = AA/(A+1-AA)*beta;
    685696   G4double E3 = AA/std::pow((1+A),2)*(beta*beta+1+2*beta*mu)*E1;
Note: See TracChangeset for help on using the changeset viewer.