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 );
404 G4cout <<
"NeutronHPPhotonDist could not find fitted energy set for multiplicity of " <<
actualMult.
Get()->at(0) <<
"." <<
G4endl;
405 G4cout <<
"NeutronHPPhotonDist will use the best set." <<
G4endl;
406 for ( std::vector< G4double >::iterator
407 it = photons_e_best.begin() ; it < photons_e_best.end() ; it++ )
409 thePhotons->operator[](count)->SetKineticEnergy( *it );
420 thePhotons->operator[](count)->SetKineticEnergy(
energy[i]);
423 if(count > nSecondaries)
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPPhotonDist::GetPhotons inconsistancy");
443 if(random<run/sum)
break;
445 if(theP==nPartials) theP=nPartials-1;
450 thePhotons->operator[](count)->SetKineticEnergy(eGamm);
455 thePhotons->operator[](count)->SetKineticEnergy(
energy[i]);
458 if(count > nSecondaries)
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPPhotonDist::GetPhotons inconsistancy");
465 for (i=0; i< nSecondaries; i++)
468 G4double theta = std::acos(costheta);
471 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
472 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
473 thePhotons->operator[](i)->SetMomentum( temp ) ;
479 for(i=0; i<nSecondaries; i++)
481 G4double currentEnergy = thePhotons->operator[](i)->GetTotalEnergy();
484 if (std::abs(currentEnergy-
theGammas[ii])<0.1*
keV)
break;
486 if(ii==nDiscrete2) ii--;
494 G4double theta = std::acos(costheta);
497 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
498 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
499 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
505 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
527 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
528 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
529 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
535 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
545 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
546 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
547 thePhotons->operator[](i)->SetMomentum( tmpVector ) ;
566 if(random < running[i]/running[nGammaEnergies-1])
break;
584 G4double theta = std::acos(costheta);
591 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
599 if (std::abs(currentEnergy-
theGammas[ii])<0.1*
keV)
break;
601 if(ii==nDiscrete2) ii--;
615 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
622 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
648 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
655 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
669 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
673 thePhotons->push_back(theOne);
690 thePhotons->push_back( theOne );
696 std::vector < G4double > dif(
nDiscrete , 0.0 );
737 if ( iphoton <
nIso )
763 if (
theLegendre[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
782 if (
theAngular[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
793 G4double theta = std::acos( cosTheta );
794 G4double sinTheta = std::sin( theta );
797 G4ThreeVector direction ( sinTheta*std::cos( phi ) , sinTheta * std::sin( phi ) , cosTheta );
799 thePhotons->operator[]( 0 )->SetMomentum( photonP ) ;
G4int theInternalConversionFlag
G4long G4Poisson(G4double mean)
G4ParticleHPLegendreTable ** theLegendre
void Init(std::istream &aDataFile)
void InitInterpolation(G4int i, std::istream &aDataFile)
void Init(G4int aScheme, G4int aRange)
G4ParticleHPPartial ** partials
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double SampleMax(G4double energy)
G4InterpolationManager theLegendreManager
void Init(std::istream &aDataFile)
G4ParticleHPAngularP ** theAngular
G4ParticleHPVector * thePartialXsec
G4double GetCosTh(G4int l)
G4double * theTransitionProbabilities
G4Cache< std::vector< G4int > *> actualMult
G4double GetXsec(G4int i)
void InitPartials(std::istream &aDataFile)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
std::vector< G4ReactionProduct * > G4ReactionProductVector
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
G4ParticleHPVector * theYield
G4GLOB_DLL std::ostream G4cout
G4bool InitMean(std::istream &aDataFile)
G4double * theLevelEnergies
void SetTotalEnergy(const G4double en)
static const double twopi
G4ParticleHPVector theTotalXsec
G4double GetY(G4double x)
G4int GetVectorLength() const
G4double GetTotalMomentum() const
G4double GetX(G4int i) const
G4double GetPDGMass() const
void SetCoeff(G4int i, G4int l, G4double coeff)
G4double GetTotalEnergy() const
G4ReactionProductVector * GetPhotons(G4double anEnergy)
G4ParticleHPVector * probs
static G4Electron * Electron()
void InitEnergies(std::istream &aDataFile)
void Init(std::istream &aDataFile)
void InitAngular(std::istream &aDataFile)
G4double GetY(G4int i, G4int j)
G4double * thePhotonTransitionFraction