69 if ( std::getenv(
"G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) )
adjustResult =
false;
84 if ( std::getenv(
"G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) )
adjustResult =
false;
108 if( std::getenv(
"G4PHPTEST") )
G4cout <<
" G4ParticleHPContAngularPar::Sample " << anEnergy <<
" " << massCode <<
" " << angularRep <<
G4endl;
139 if(Z!=2)
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPContAngularPar: Unknown ion case 1");
150 if( angularRep == 1 )
183 if (
theAngular[j].GetValue(0) != 0.0 )
break;
197 running[j+1] = running[j] +
delta;
215 if ( j == nDiscreteEnergies ) {
226 if ( j != nEnergies-1 ) {
231 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPContAngularPar: Unexpected non zero value of theAngular[nEnergies-1].GetValue(0)");
236 running[j+1] = running[j] + ( ( e_high - e_low ) * delta );
252 random *= (tot_prob_DIS + tot_prob_CON);
254 if ( random <= ( tot_prob_DIS / ( tot_prob_DIS + tot_prob_CON ) ) || nDiscreteEnergies ==
nEnergies )
260 if ( random < running[ j+1 ] )
284 if ( random < running[ j ] )
295 if ( it != nDiscreteEnergies )
309 if ( it == nDiscreteEnergies ) itt = it+1;
363 running[i]=running[i-1];
376 if ( nEnergies == 1 || running[nEnergies-1] == 0 )
380 fCache.
Get()->currentMeanEnergy = weighted/running[nEnergies-1];
384 if ( nEnergies == 1 ) it = 0;
387 if ( running[nEnergies-1] != 0 )
392 if ( random < running [ i ] / running [ nEnergies-1 ] )
break;
397 if ( running [ nEnergies-1 ] == 0 ) it = 0;
421 running[it-1]/running[nEnergies-1],
422 running[
it]/running[nEnergies-1],
440 G4double x1 = running[it-1]/running[nEnergies-1];
465 else if(angularRep==2)
472 if( std::getenv(
"G4PHPTEST") )
G4cout <<
" G4ParticleHPContAngularPar::Sample nEnergies " <<
nEnergies <<
G4endl;
475 if(j!=0) running[j]=running[j-1];
482 if( std::getenv(
"G4PHPTEST") )
G4cout <<
" G4ParticleHPContAngularPar::Sample " << j <<
" running " << running[j]
488 if ( nEnergies == 1 )
491 fCache.
Get()->currentMeanEnergy = weighted/running[nEnergies-1];
500 if(randkal<running[j]/running[nEnergies-1])
break;
506 x = randkal*running[nEnergies-1];
515 if( std::getenv(
"G4PHPTEST") )
G4cout << itt <<
" G4particleHPContAngularPar fsEnergy " << fsEnergy <<
" " <<
theManager.
GetInverseScheme(itt-1) <<
" x " << x <<
" " << x1 <<
" " << x2 <<
" y " << y1 <<
" " << y2 <<
G4endl;
520 fsEnergy,
y1,
y2, cLow,cHigh);
522 if ( compoundFraction > 1.0 ) compoundFraction = 1.0;
524 if( std::getenv(
"G4PHPTEST") )
G4cout << itt <<
" G4particleHPContAngularPar compoundFraction " << compoundFraction <<
" E " << fsEnergy <<
" " <<
theManager.
GetScheme(itt) <<
" ener " << fsEnergy <<
" y " << y1 <<
" " << y2 <<
" cLH " << cLow <<
" " << cHigh <<
G4endl;
540 G4int residualA = targetA+incidentA-
A;
541 G4int residualZ = targetZ+incidentZ-
Z;
544 incidentEnergy, incidentMass,
545 productEnergy, productMass,
546 residualMass, residualA, residualZ,
547 targetMass, targetA, targetZ,
548 incidentA,incidentZ,A,Z);
549 cosTh = theKallbach.
Sample(anEnergy);
550 if( std::getenv(
"G4PHPTEST") )
G4cout <<
" G4ParticleHPKallbachMannSyst::Sample resulttest " << cosTh <<
G4endl;
552 else if(angularRep>10&&angularRep<16)
560 if(i!=0) running[i]=running[i-1];
570 if ( nEnergies == 1 )
573 fCache.
Get()->currentMeanEnergy = weighted/running[nEnergies-1];
576 if ( nEnergies == 1 ) it = 0;
581 if(random<running[i]/running[nEnergies-1])
break;
597 aMan.
Init(angularRep-10, nAngularParameters-1);
599 cosTh = theStore.
Sample();
615 running[it-1]/running[nEnergies-1],
616 running[it]/running[nEnergies-1],
621 cosTh = theStore.
Sample();
626 G4double x1 = running[it-1]/running[nEnergies-1];
665 x = theBuff1.
GetX(i);
666 y1 = theBuff1.
GetY(i);
667 y2 = theBuff2.
GetY(i);
674 cosTh = theStore.
Sample();
680 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPContAngularPar::Sample: Unknown angular representation");
687 G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) );
704 if( !angParPrev )
return;
711 for(ie=0; ie<nDiscreteEnergiesPrev; ie++) {
716 for(ie=nDiscreteEnergies; ie<
nEnergies; ie++) {
725 for(ie=nDiscreteEnergiesPrev; ie<nEnergiesPrev; ie++) {
727 G4double enerT = (ener-minEnerPrev)/(maxEnerPrev-minEnerPrev);
740 G4int ie,ie1,ie2, ie1Prev, ie2Prev;
746 std::set<G4double>::const_iterator itede;
749 std::map<G4double,G4int>::const_iterator itedeo;
753 itedeo = discEnerOwn1.find(discEner);
754 if( itedeo == discEnerOwn1.end() ) {
759 itedeo = discEnerOwn2.find(discEner);
760 if( itedeo == discEnerOwn2.end() ) {
784 if( std::getenv(
"G4PHPTEST2") )
G4cout << ie <<
" " << ip <<
" G4ParticleHPContAngularPar::Merge DiscreteEnergies val1 " << val1 <<
" val2 " << val2 <<
" value " << value <<
G4endl;
802 std::set<G4double>::const_iterator iteet = energiesTransformed.begin();
815 G4double e1 = (maxEner1-minEner1) * eT + minEner1;
817 for(ie1=nDiscreteEnergies1; ie1<nEnergies1; ie1++) {
821 if( ie1 == 0 ) ie1Prev++;
822 if( ie1 == nEnergies1 ) {
827 G4double e2 = (maxEner2-minEner2) * eT + minEner2;
829 for(ie2=nDiscreteEnergies2; ie2<nEnergies2; ie2++) {
834 if( ie2 == 0 ) ie2Prev++;
835 if( ie2 == nEnergies2 ) {
842 if( std::getenv(
"G4PHPTEST2") )
G4cout << ie <<
" " << ie1 <<
" " << ie2 <<
" G4ParticleHPContAngularPar::loop eT " << eT <<
" -> eN " << eN <<
" e1 " << e1 <<
" e2 " << e2 <<
G4endl;
867 }
else if ( value != 0 ) {
868 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPContAngularPar::PrepareTableInterpolation theMaxEner == theMinEner and value != 0.");
870 if( std::getenv(
"G4PHPTEST2") )
G4cout << ie <<
" " << ip <<
" G4ParticleHPContAngularPar::Merge val1 " << val1 <<
" val2 " << val2 <<
" value " << value <<
G4endl;
879 if( std::getenv(
"G4PHPTEST2") ) {
880 G4cout <<
" G4ParticleHPContAngularPar::Merge ANGPAR1 " <<
G4endl;
882 G4cout <<
" G4ParticleHPContAngularPar::Merge ANGPAR2 " <<
G4endl;
884 G4cout <<
" G4ParticleHPContAngularPar::Merge ANGPARNEW " <<
G4endl;