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

update processes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/util/src/G4ReactionDynamics.cc

    r819 r962  
    552552          while( ( ran >= dndl[l] ) && ( l < 20 ) )l++;
    553553          l = std::min( 19, l );
    554           x = std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1])/2.) );
     554          x = std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1]) ) );
    555555          if( vec[i]->GetSide() < 0 )x *= -1.;
    556556          vec[i]->SetMomentum( x*et*GeV );              // set the z-momentum
     
    736736    while( (ran>dndl[l]) && (l<20) )l++;
    737737    l = std::min( 19, l );
    738     x = std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1])/2.) );   
     738    x = std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1]) ) );
    739739    currentParticle.SetMomentum( x*et*GeV );                 // set the z-momentum
    740740    if( forwardEnergy < forwardKinetic )
     
    804804          while( ( ran >= dndl[l] ) && ( l < 20 ) )l++;
    805805          l = std::min( 19, l );
    806           x = std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1])/2.) );
     806          x = std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1]) ) );
    807807          if( targetParticle.GetSide() < 0 )x *= -1.;
    808808          targetParticle.SetMomentum( x*et*GeV );                // set the z-momentum
     
    917917        } // if (resetEnergies)
    918918      } // closes outer loop
    919 
    920 //      if( eliminateThisParticle )  // not enough energy, eliminate target
    921 //      {
    922 //        G4cerr << "Warning: eliminating target particle" << G4endl;
    923 //        exit( EXIT_FAILURE );
    924 //      }
    925     }
     919    }
     920
    926921    //
    927922    // Target particle finished.
     
    10161011        for( i=0; i<vecLen; ++i )
    10171012          G4cerr << "particle #" << i << " side = " << vec[i]->GetSide() << G4endl;
    1018         exit( EXIT_FAILURE );
     1013        G4Exception("G4ReactionDynamics::GenerateXandPt", "601",
     1014                    FatalException, "Mismatch in nucleon count");
    10191015      }
    10201016      constantCrossSection = true;
Note: See TracChangeset for help on using the changeset viewer.