Changeset 962 for trunk/source/processes/hadronic/util
- Timestamp:
- Apr 6, 2009, 12:30:29 PM (15 years ago)
- Location:
- trunk/source/processes/hadronic/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/util/History
r819 r962 14 14 * Please list in reverse chronological order (last date on top) 15 15 --------------------------------------------------------------- 16 17 23 Jul 2008 D.H. Wright for Vladimir Uzhinskiy (hadr-util-V09-01-01) 18 -------------------------------------------------------------------- 19 - G4ReactionDynamics::GenerateXandPt: fixed bug in momentum bin which 20 caused oscillatory behavior in spectrum: changed 21 x = std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1])/2 ) ) 22 to 23 x = std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1]) ) ) 24 25 9 Jul 2008 D.H. Wright (hadr-util-V09-01-00) 26 --------------------------------------------- 27 - G4ReactionDynamics::GenerateXandPt: replace exit with G4Exception. 16 28 17 29 11 Oct 2007 F.W. Jones (hadr-util-V09-00-00) -
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.