91 if(theInternalConversionFlag == 1)
96 else if(theInternalConversionFlag == 2)
103 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPPhotonDist: Unknown conversion flag");
112 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPPhotonDist: This data representation is not implemented.");
130 if (
repFlag == 2 )
G4cout <<
"G4ParticleHPPhotonDist: repFlag == 2 && isoFlag != 1 is unexpected! If you use G4ND3.x, then please report to Geant4 Hyper News. Thanks." <<
G4endl;
133 if (
theGammas != NULL &&
nDiscrete2 !=
nDiscrete )
G4cout <<
"080731c G4ParticleHPPhotonDist nDiscrete2 != nDiscrete, It looks like something wrong in your NDL files. Please update the latest. If you still have this messages after the update, then please report to Geant4 Hyper News." <<
G4endl;
136 std::vector < G4double > vct_gammas_par;
137 std::vector < G4double > vct_shells_par;
138 std::vector < G4int > vct_primary_par;
139 std::vector < G4int > vct_distype_par;
140 std::vector < G4ParticleHPVector* > vct_pXS_par;
146 vct_gammas_par.push_back(
theGammas[ i ] );
147 vct_shells_par.push_back(
theShells[ i ] );
148 vct_primary_par.push_back(
isPrimary[ i ] );
149 vct_distype_par.push_back(
disType[ i ] );
152 vct_pXS_par.push_back( hpv );
159 for (i=0; i<
nIso; i++)
177 for (ii=0; ii<nNeu[i-
nIso]; ii++)
188 for (ii=0; ii<nNeu[i-
nIso]; ii++)
196 throw G4HadronicException(__FILE__, __LINE__,
"cannot deal with this tabulation type for angular distributions.");
200 if ( vct_gammas_par.size() > 0 )
208 if (
theGammas[ i ] == vct_gammas_par [ j ] &&
theShells [ i ] == vct_shells_par[ j ] )
211 disType [ i ] = vct_distype_par [ j ];
217 for ( std::vector < G4ParticleHPVector* >::iterator
218 it = vct_pXS_par.begin() ; it != vct_pXS_par.end() ; it++ )
230 G4int i, energyDistributionsNeeded = 0;
233 if(
disType[i]==1) energyDistributionsNeeded =1;
235 if(!energyDistributionsNeeded)
return;
291 G4int nSecondaries = 0;
300 if(nDiscrete==1&¤t<1.0001)
312 for(i=0;i<nSecondaries;i++)
316 thePhotons->push_back(theOne);
374 std::vector< G4double > photons_e_best(
actualMult.
Get()->at(0) , 0.0 );
377 for (
G4int j = 0 ; j < maxTry ; j++ )
379 std::vector< G4double > photons_e(
actualMult.
Get()->at(0) , 0.0 );
380 for ( std::vector< G4double >::iterator
381 it = photons_e.begin() ; it < photons_e.end() ; it++ )
385 if ( std::accumulate( photons_e.begin() , photons_e.end() , 0.0 ) > maximumE )
387 if ( std::accumulate( photons_e.begin() , photons_e.end() , 0.0 ) < best )
388 photons_e_best = photons_e;
393 for ( std::vector< G4double >::iterator
394 it = photons_e.begin() ; it < photons_e.end() ; it++ )
396 thePhotons->operator[](count)->SetKineticEnergy( *it );
423 thePhotons->operator[](count)->SetKineticEnergy(
energy[i]);
426 if(count > nSecondaries)
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPPhotonDist::GetPhotons inconsistancy");
446 if(random<run/sum)
break;
448 if(theP==nPartials) theP=nPartials-1;
453 thePhotons->operator[](count)->SetKineticEnergy(eGamm);
458 thePhotons->operator[](count)->SetKineticEnergy(
energy[i]);
461 if(count > nSecondaries)
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPPhotonDist::GetPhotons inconsistancy");
468 for (i=0; i< nSecondaries; i++)
471 G4double theta = std::acos(costheta);
474 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
475 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
476 thePhotons->operator[](i)->SetMomentum( temp ) ;
482 for(i=0; i<nSecondaries; i++)
484 G4double currentEnergy = thePhotons->operator[](i)->GetTotalEnergy();
487 if (std::abs(currentEnergy-
theGammas[ii])<0.1*
keV)
break;
489 if(ii==nDiscrete2) ii--;
497 G4double theta = std::acos(costheta);
500 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
501 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
502 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
508 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
530 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
531 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
532 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
538 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
548 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
549 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
550 thePhotons->operator[](i)->SetMomentum( tmpVector ) ;
569 if(random < running[i]/running[nGammaEnergies-1])
break;
587 G4double theta = std::acos(costheta);
594 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
602 if (std::abs(currentEnergy-
theGammas[ii])<0.1*
keV)
break;
604 if(ii==nDiscrete2) ii--;
618 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
625 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
651 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
658 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
672 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
676 thePhotons->push_back(theOne);
693 thePhotons->push_back( theOne );
699 std::vector < G4double > dif(
nDiscrete , 0.0 );
740 if ( iphoton <
nIso )
766 if (
theLegendre[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
785 if (
theAngular[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
796 G4double theta = std::acos( cosTheta );
797 G4double sinTheta = std::sin( theta );
800 G4ThreeVector direction ( sinTheta*std::cos( phi ) , sinTheta * std::sin( phi ) , cosTheta );
802 thePhotons->operator[]( 0 )->SetMomentum( photonP ) ;
G4ParticleHPVector * probs
G4ParticleHPPartial ** partials
static constexpr double keV
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4double GetX(G4int i) const
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4ParticleHPVector theTotalXsec
G4double * theTransitionProbabilities
void SetCoeff(G4int i, G4int l, G4double coeff)
G4int theInternalConversionFlag
G4double GetPDGMass() const
G4double GetXsec(G4int i)
G4ParticleHPAngularP ** theAngular
void SetTotalEnergy(const G4double en)
void Init(std::istream &aDataFile)
G4double GetTotalEnergy() const
void Init(std::istream &aDataFile)
G4ParticleHPLegendreTable ** theLegendre
G4double GetY(G4double x)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
G4ParticleHPVector * theYield
G4bool InitMean(std::istream &aDataFile)
static constexpr double twopi
G4double GetTotalMomentum() const
void Init(G4int aScheme, G4int aRange)
G4double * theLevelEnergies
static constexpr double eV
static G4Electron * Electron()
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4double * thePhotonTransitionFraction
G4ReactionProductVector * GetPhotons(G4double anEnergy)
G4double G4ParticleHPJENDLHEData::G4double result
void Init(std::istream &aDataFile)
void InitPartials(std::istream &aDataFile)
void InitAngular(std::istream &aDataFile)
G4double SampleMax(G4double energy)
G4double GetCosTh(G4int l)
G4ParticleHPVector * thePartialXsec
G4GLOB_DLL std::ostream G4cout
G4InterpolationManager theLegendreManager
G4Cache< std::vector< G4int > * > actualMult
G4int GetVectorLength() const
G4long G4Poisson(G4double mean)
void InitInterpolation(G4int i, std::istream &aDataFile)
G4double GetY(G4int i, G4int j)
void InitEnergies(std::istream &aDataFile)