- Timestamp:
- Apr 6, 2009, 12:30:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/util/src/G4ReactionDynamics.cc
r819 r962 552 552 while( ( ran >= dndl[l] ) && ( l < 20 ) )l++; 553 553 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]) ) ); 555 555 if( vec[i]->GetSide() < 0 )x *= -1.; 556 556 vec[i]->SetMomentum( x*et*GeV ); // set the z-momentum … … 736 736 while( (ran>dndl[l]) && (l<20) )l++; 737 737 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]) ) ); 739 739 currentParticle.SetMomentum( x*et*GeV ); // set the z-momentum 740 740 if( forwardEnergy < forwardKinetic ) … … 804 804 while( ( ran >= dndl[l] ) && ( l < 20 ) )l++; 805 805 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]) ) ); 807 807 if( targetParticle.GetSide() < 0 )x *= -1.; 808 808 targetParticle.SetMomentum( x*et*GeV ); // set the z-momentum … … 917 917 } // if (resetEnergies) 918 918 } // 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 926 921 // 927 922 // Target particle finished. … … 1016 1011 for( i=0; i<vecLen; ++i ) 1017 1012 G4cerr << "particle #" << i << " side = " << vec[i]->GetSide() << G4endl; 1018 exit( EXIT_FAILURE ); 1013 G4Exception("G4ReactionDynamics::GenerateXandPt", "601", 1014 FatalException, "Mismatch in nucleon count"); 1019 1015 } 1020 1016 constantCrossSection = true;
Note: See TracChangeset
for help on using the changeset viewer.