66 if ( getenv(
"G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) )
adjustResult =
false;
77 if ( getenv(
"G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) )
adjustResult =
false;
83 if( getenv(
"G4PHPTEST") )
103 if( getenv(
"G4PHPTEST") )
G4cout <<
" G4ParticleHPContAngularPar::Sample " << anEnergy <<
" " << massCode <<
" " << angularRep <<
G4endl;
133 if(Z!=2)
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPContAngularPar: Unknown ion case 1");
144 if( angularRep == 1 )
177 if (
theAngular[j].GetValue(0) != 0.0 )
break;
191 running[j+1] = running[j] + delta;
209 if ( j == nDiscreteEnergies ) {
220 if ( j != nEnergies-1 ) {
225 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPContAngularPar: Unexpected non zero value of theAngular[nEnergies-1].GetValue(0)");
230 running[j+1] = running[j] + ( ( e_high - e_low ) * delta );
246 random *= (tot_prob_DIS + tot_prob_CON);
248 if ( random <= ( tot_prob_DIS / ( tot_prob_DIS + tot_prob_CON ) ) || nDiscreteEnergies ==
nEnergies )
254 if ( random < running[ j+1 ] )
278 if ( random < running[ j ] )
289 if ( it != nDiscreteEnergies )
303 if ( it == nDiscreteEnergies ) itt = it+1;
357 running[i]=running[i-1];
370 if ( nEnergies == 1 || running[nEnergies-1] == 0 )
378 if ( nEnergies == 1 ) it = 0;
381 if ( running[nEnergies-1] != 0 )
386 if ( random < running [ i ] / running [ nEnergies-1 ] )
break;
391 if ( running [ nEnergies-1 ] == 0 ) it = 0;
415 running[it-1]/running[nEnergies-1],
416 running[it]/running[nEnergies-1],
434 G4double x1 = running[it-1]/running[nEnergies-1];
435 G4double x2 = running[it]/running[nEnergies-1];
459 else if(angularRep==2)
466 if( getenv(
"G4PHPTEST") )
G4cout <<
" G4ParticleHPContAngularPar::Sample nEnergies " <<
nEnergies <<
G4endl;
469 if(j!=0) running[j]=running[j-1];
476 if( getenv(
"G4PHPTEST") )
G4cout <<
" G4ParticleHPContAngularPar::Sample " << j <<
" running " << running[j]
482 if ( nEnergies == 1 )
494 if(randkal<running[j]/running[nEnergies-1])
break;
500 x = randkal*running[nEnergies-1];
509 if( getenv(
"G4PHPTEST") )
G4cout << itt <<
" G4particleHPContAngularPar fsEnergy " << fsEnergy <<
" " <<
theManager.
GetInverseScheme(itt-1) <<
" x " << x <<
" " << x1 <<
" " << x2 <<
" y " << y1 <<
" " << y2 <<
G4endl;
514 fsEnergy, y1, y2, cLow,cHigh);
515 if( getenv(
"G4PHPTEST") )
G4cout << itt <<
" G4particleHPContAngularPar compoundFraction " << compoundFraction <<
" E " << fsEnergy <<
" " <<
theManager.
GetScheme(itt) <<
" ener " << fsEnergy <<
" y " << y1 <<
" " << y2 <<
" cLH " << cLow <<
" " << cHigh <<
G4endl;
529 G4int residualA = targetA+1-
A;
530 G4int residualZ = targetZ-Z;
535 incidentEnergy, incidentMass,
536 productEnergy, productMass,
537 residualMass, residualA, residualZ,
538 targetMass, targetA, targetZ);
539 cosTh = theKallbach.
Sample(anEnergy);
540 if( getenv(
"G4PHPTEST") )
G4cout <<
" G4ParticleHPKallbachMannSyst::Sample resulttest " << cosTh <<
G4endl;
542 else if(angularRep>10&&angularRep<16)
550 if(i!=0) running[i]=running[i-1];
560 if ( nEnergies == 1 )
566 if ( nEnergies == 1 ) it = 0;
571 if(random<running[i]/running[nEnergies-1])
break;
587 aMan.
Init(angularRep-10, nAngularParameters-1);
589 cosTh = theStore.
Sample();
605 running[it-1]/running[nEnergies-1],
606 running[it]/running[nEnergies-1],
611 cosTh = theStore.
Sample();
616 G4double x1 = running[it-1]/running[nEnergies-1];
617 G4double x2 = running[it]/running[nEnergies-1];
655 x = theBuff1.
GetX(i);
656 y1 = theBuff1.
GetY(i);
657 y2 = theBuff2.
GetY(i);
664 cosTh = theStore.
Sample();
670 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPContAngularPar::Sample: Unknown angular representation");
677 G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) );
694 if( !angParPrev )
return;
701 for(ie=0; ie<nDiscreteEnergiesPrev; ie++) {
706 for(ie=nDiscreteEnergies; ie<
nEnergies; ie++) {
715 for(ie=nDiscreteEnergiesPrev; ie<nEnergiesPrev; ie++) {
717 G4double enerT = (ener-minEnerPrev)/(maxEnerPrev-minEnerPrev);
730 G4int ie,ie1,ie2, ie1Prev, ie2Prev;
736 std::set<G4double>::const_iterator itede;
739 std::map<G4double,G4int>::const_iterator itedeo;
743 itedeo = discEnerOwn1.find(discEner);
744 if( itedeo == discEnerOwn1.end() ) {
749 itedeo = discEnerOwn2.find(discEner);
750 if( itedeo == discEnerOwn2.end() ) {
774 if( getenv(
"G4PHPTEST2") )
G4cout << ie <<
" " << ip <<
" G4ParticleHPContAngularPar::Merge DiscreteEnergies val1 " << val1 <<
" val2 " << val2 <<
" value " << value <<
G4endl;
792 std::set<G4double>::const_iterator iteet = energiesTransformed.begin();
805 G4double e1 = (maxEner1-minEner1) * eT + minEner1;
807 for(ie1=nDiscreteEnergies1; ie1<nEnergies1; ie1++) {
811 if( ie1 == 0 ) ie1Prev++;
812 if( ie1 == nEnergies1 ) {
817 G4double e2 = (maxEner2-minEner2) * eT + minEner2;
819 for(ie2=nDiscreteEnergies2; ie2<nEnergies2; ie2++) {
824 if( ie2 == 0 ) ie2Prev++;
825 if( ie2 == nEnergies2 ) {
832 if( getenv(
"G4PHPTEST2") )
G4cout << ie <<
" " << ie1 <<
" " << ie2 <<
" G4ParticleHPContAngularPar::loop eT " << eT <<
" -> eN " << eN <<
" e1 " << e1 <<
" e2 " << e2 <<
G4endl;
855 if( getenv(
"G4PHPTEST2") )
G4cout << ie <<
" " << ip <<
" G4ParticleHPContAngularPar::Merge val1 " << val1 <<
" val2 " << val2 <<
" value " << value <<
G4endl;
864 if( getenv(
"G4PHPTEST2") ) {
865 G4cout <<
" G4ParticleHPContAngularPar::Merge ANGPAR1 " <<
G4endl;
867 G4cout <<
" G4ParticleHPContAngularPar::Merge ANGPAR2 " <<
G4endl;
869 G4cout <<
" G4ParticleHPContAngularPar::Merge ANGPARNEW " <<
G4endl;
std::map< G4double, G4int > GetDiscreteEnergiesOwn() const
void Init(G4int i, G4double e, G4int n)
G4int GetVectorLength() const
G4double GetTotalMomentum() const
CLHEP::Hep3Vector G4ThreeVector
void Init(std::istream &aDataFile, G4int nPar, G4double unit=1.)
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass, G4int angularRep, G4int interpol)
void BuildByInterpolation(G4double anEnergy, G4InterpolationScheme aScheme, G4ParticleHPContAngularPar &store1, G4ParticleHPContAngularPar &store2)
G4double Interpolate2(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
void Init(G4int aScheme, G4int aRange)
void SetKineticEnergy(const G4double en)
G4double GetMinEner() const
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double SampleMax(G4double energy)
G4double remaining_energy
G4ParticleDefinition * theProjectile
G4InterpolationManager theManager
G4double currentMeanEnergy
void SetInterpolationManager(const G4InterpolationManager &aManager)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ParticleHPContAngularPar()
std::map< G4double, G4int > theDiscreteEnergiesOwn
std::set< G4double > GetEnergiesTransformed() const
void SetY(G4int i, G4double x)
G4GLOB_DLL std::ostream G4cout
void Init(std::istream &aDataFile, G4ParticleDefinition *projectile)
G4int GetNEnergiesTransformed() const
void SetValue(G4int i, G4double y)
G4InterpolationScheme GetScheme(G4int index) const
static G4Triton * Triton()
static G4Proton * Proton()
G4double GetX(G4int i) const
static G4Neutron * Neutron()
G4double GetY(G4double x)
G4double GetMaxEner() const
static const G4double A[nN]
G4double GetWeightedBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)
static G4Deuteron * Deuteron()
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
void SetLabel(G4double aLabel)
static G4IonTable * GetIonTable()
void SetManager(G4InterpolationManager &aManager)
static G4Positron * Positron()
G4int GetNDiscreteEnergies() const
G4ParticleHPInterpolator theInt
G4ReactionProduct * theTarget
G4double GetPDGMass() const
static G4double GetBindingEnergy(const G4int A, const G4int Z)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4ParticleHPList * theAngular
void SetCoeff(G4int i, G4int l, G4double coeff)
std::set< G4double > theDiscreteEnergies
std::set< G4double > theEnergiesTransformed
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4InterpolationScheme GetInverseScheme(G4int index)
static G4Electron * Electron()
G4double GetValue(G4int i)
G4double GetBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)
void PrepareTableInterpolation(const G4ParticleHPContAngularPar *angularPrev)
void SetX(G4int i, G4double e)
G4double Sample(G4double anEnergy)
G4int GetNEnergies() const