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

update processes

Location:
trunk/source/processes/hadronic/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/util/History

    r819 r962  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     1723 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.
    1628
    172911 Oct 2007 F.W. Jones (hadr-util-V09-00-00)
  • 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.