47     G4cout << 
"G4RPGKZeroInelastic::ApplyYourself called" << 
G4endl;
 
   49     G4cout << 
"target material = " << targetMaterial->
GetName() << 
", ";
 
   60     modifiedOriginal = *originalIncident;
 
   66     G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
 
   80     p = std::sqrt( std::abs((et-amas)*(et+amas)) );
 
   89     targetParticle = *originalTarget;
 
   92     G4bool incidentHasChanged = 
false;
 
   93     G4bool targetHasChanged = 
false;
 
   94     G4bool quasiElastic = 
false;
 
  101       Cascade( vec, vecLen,
 
  102                originalIncident, currentParticle, targetParticle,
 
  103                incidentHasChanged, targetHasChanged, quasiElastic );
 
  106                       originalIncident, originalTarget, modifiedOriginal,
 
  107                       targetNucleus, currentParticle, targetParticle,
 
  108                       incidentHasChanged, targetHasChanged, quasiElastic );
 
  111                  currentParticle, targetParticle,
 
  112                  incidentHasChanged );
 
  114     delete originalTarget;
 
  118 void G4RPGKZeroInelastic::Cascade(
 
  124    G4bool &incidentHasChanged,
 
  141   G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
 
  142                                       targetMass*targetMass +
 
  143                                       2.0*targetMass*etOriginal );
 
  144   G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
 
  150     static G4bool first = 
true;
 
  151     const G4int numMul = 1200;
 
  152     const G4int numSec = 60;
 
  153     static G4double protmul[numMul], protnorm[numSec]; 
 
  154     static G4double neutmul[numMul], neutnorm[numSec]; 
 
  156     G4int counter, 
nt=0, np=0, nneg=0, nz=0;
 
  163       for( i=0; i<numMul; ++i )protmul[i] = 0.0;
 
  164       for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
 
  166       for( np=0; np<(numSec/3); ++np )
 
  168         for( nneg=std::max(0,np-1); nneg<=(np+1); ++nneg )
 
  170           for( nz=0; nz<numSec/3; ++nz )
 
  172             if( ++counter < numMul )
 
  175               if( nt>0 && nt<=numSec )
 
  177                 protmul[counter] = 
Pmltpc(np,nneg,nz,nt,b[0],c);
 
  178                 protnorm[nt-1] += protmul[counter];
 
  184       for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
 
  185       for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
 
  187       for( np=0; np<numSec/3; ++np )
 
  189         for( nneg=std::max(0,np-2); nneg<=np; ++nneg )
 
  191           for( nz=0; nz<numSec/3; ++nz )
 
  193             if( ++counter < numMul )
 
  196               if( nt>0 && nt<=numSec )
 
  198                 neutmul[counter] = 
Pmltpc(np,nneg,nz,nt,b[1],c);
 
  199                 neutnorm[nt-1] += neutmul[counter];
 
  205       for( i=0; i<numSec; ++i )
 
  207         if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
 
  208         if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
 
  220     const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
 
  231         test = std::exp( std::min( expxu, std::max( expxl, -(1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
 
  233         test = std::exp( std::min( expxu, std::max( expxl, -(-1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
 
  242         test = std::exp( std::min( expxu, std::max( expxl, -(1.0+b[1])*(1.0+b[1])/(2.0*c*c) ) ) );
 
  245         test = std::exp( std::min( expxu, std::max( expxl, -(-1.0+b[1])*(-1.0+b[1])/(2.0*c*c) ) ) );
 
  252         else if( ran < wp/wt )
 
  267         for( np=0; np<numSec/3 && ran>=excs; ++np )
 
  269           for( nneg=std::max(0,np-1); nneg<=(np+1) && ran>=excs; ++nneg )
 
  271             for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
 
  273               if( ++counter < numMul )
 
  276                 if( nt>0 && nt<=numSec )
 
  278                   test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
 
  279                   dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
 
  280                   if( std::fabs(dum) < 1.0 )
 
  282                     if( test >= 1.0
e-10 )excs += dum*
test;
 
  301         for( np=0; np<numSec/3 && ran>=excs; ++np )
 
  303           for( nneg=std::max(0,np-2); nneg<=np && ran>=excs; ++nneg )
 
  305             for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
 
  307               if( ++counter < numMul )
 
  310                 if( nt>0 && nt<=numSec )
 
  312                   test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
 
  313                   dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
 
  314                   if( std::fabs(dum) < 1.0 )
 
  316                     if( test >= 1.0
e-10 )excs += dum*
test;
 
  342            incidentHasChanged = 
true;
 
  343            targetHasChanged = 
true;
 
  348          targetHasChanged = 
true;
 
  352          targetHasChanged = 
true;
 
  364            incidentHasChanged = 
true;
 
  369            targetHasChanged = 
true;
 
  374          incidentHasChanged = 
true;
 
  376          targetHasChanged = 
true;
 
  386       incidentHasChanged = 
true;
 
  393       targetHasChanged = 
true;