90 if(theInternalConversionFlag == 1)
95 else if(theInternalConversionFlag == 2)
102 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPPhotonDist: Unknown conversion flag");
111 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPPhotonDist: This data representation is not implemented.");
129 if (
repFlag == 2 )
G4cout <<
"G4NeutronHPPhotonDist: repFlag == 2 && isoFlag != 1 is unexpected! If you use G4ND3.x, then please report to Geant4 Hyper News. Thanks." <<
G4endl;
132 if (
theGammas != NULL &&
nDiscrete2 !=
nDiscrete )
G4cout <<
"080731c G4NeutronHPPhotonDist 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;
135 std::vector < G4double > vct_gammas_par;
136 std::vector < G4double > vct_shells_par;
137 std::vector < G4int > vct_primary_par;
138 std::vector < G4int > vct_distype_par;
139 std::vector < G4NeutronHPVector* > vct_pXS_par;
145 vct_gammas_par.push_back(
theGammas[ i ] );
146 vct_shells_par.push_back(
theShells[ i ] );
147 vct_primary_par.push_back(
isPrimary[ i ] );
148 vct_distype_par.push_back(
disType[ i ] );
151 vct_pXS_par.push_back( hpv );
158 for (i=0; i<
nIso; i++)
176 for (ii=0; ii<nNeu[i-
nIso]; ii++)
187 for (ii=0; ii<nNeu[i-
nIso]; ii++)
195 throw G4HadronicException(__FILE__, __LINE__,
"cannot deal with this tabulation type for angular distributions.");
199 if ( vct_gammas_par.size() > 0 )
207 if (
theGammas[ i ] == vct_gammas_par [ j ] &&
theShells [ i ] == vct_shells_par[ j ] )
210 disType [ i ] = vct_distype_par [ j ];
216 for ( std::vector < G4NeutronHPVector* >::iterator
217 it = vct_pXS_par.begin() ; it != vct_pXS_par.end() ; it++ )
229 G4int i, energyDistributionsNeeded = 0;
232 if(
disType[i]==1) energyDistributionsNeeded =1;
234 if(!energyDistributionsNeeded)
return;
287 G4int nSecondaries = 0;
296 if(nDiscrete==1&¤t<1.0001)
308 for(i=0;i<nSecondaries;i++)
312 thePhotons->push_back(theOne);
370 std::vector< G4double > photons_e_best(
actualMult[ 0 ] , 0.0 );
373 for (
G4int j = 0 ; j < maxTry ; j++ )
375 std::vector< G4double > photons_e(
actualMult[ 0 ] , 0.0 );
376 for ( std::vector< G4double >::iterator
377 it = photons_e.begin() ; it < photons_e.end() ; it++ )
381 if ( std::accumulate( photons_e.begin() , photons_e.end() , 0.0 ) > maximumE )
383 if ( std::accumulate( photons_e.begin() , photons_e.end() , 0.0 ) < best )
384 photons_e_best = photons_e;
389 for ( std::vector< G4double >::iterator
390 it = photons_e.begin() ; it < photons_e.end() ; it++ )
392 thePhotons->operator[](count)->SetKineticEnergy( *it );
400 G4cout <<
"NeutronHPPhotonDist could not find fitted energy set for multiplicity of " <<
actualMult[0] <<
"." <<
G4endl;
401 G4cout <<
"NeutronHPPhotonDist will use the best set." <<
G4endl;
402 for ( std::vector< G4double >::iterator
403 it = photons_e_best.begin() ; it < photons_e_best.end() ; it++ )
405 thePhotons->operator[](count)->SetKineticEnergy( *it );
416 thePhotons->operator[](count)->SetKineticEnergy(
energy[i]);
419 if(count > nSecondaries)
throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPPhotonDist::GetPhotons inconsistancy");
439 if(random<run/sum)
break;
441 if(theP==nPartials) theP=nPartials-1;
446 thePhotons->operator[](count)->SetKineticEnergy(eGamm);
451 thePhotons->operator[](count)->SetKineticEnergy(
energy[i]);
454 if(count > nSecondaries)
throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPPhotonDist::GetPhotons inconsistancy");
461 for (i=0; i< nSecondaries; i++)
464 G4double theta = std::acos(costheta);
467 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
468 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
469 thePhotons->operator[](i)->SetMomentum( temp ) ;
475 for(i=0; i<nSecondaries; i++)
477 G4double currentEnergy = thePhotons->operator[](i)->GetTotalEnergy();
480 if (std::abs(currentEnergy-
theGammas[ii])<0.1*
keV)
break;
482 if(ii==nDiscrete2) ii--;
489 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
490 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
491 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
497 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
519 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
520 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
521 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
527 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
537 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
538 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
539 thePhotons->operator[](i)->SetMomentum( tmpVector ) ;
558 if(random < running[i]/running[nGammaEnergies-1])
break;
576 G4double theta = std::acos(costheta);
583 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
591 if (std::abs(currentEnergy-
theGammas[ii])<0.1*
keV)
break;
593 if(ii==nDiscrete2) ii--;
607 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
614 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
640 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
647 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
661 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
665 thePhotons->push_back(theOne);
682 thePhotons->push_back( theOne );
688 std::vector < G4double > dif(
nDiscrete , 0.0 );
729 if ( iphoton <
nIso )
755 if (
theLegendre[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
774 if (
theAngular[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
785 G4double theta = std::acos( cosTheta );
786 G4double sinTheta = std::sin( theta );
789 G4ThreeVector direction ( sinTheta*std::cos( phi ) , sinTheta * std::sin( phi ) , cosTheta );
791 thePhotons->operator[]( 0 )->SetMomentum( photonP ) ;
G4ReactionProductVector * GetPhotons(G4double anEnergy)
G4double GetY(G4double x)
G4int GetVectorLength() const
G4long G4Poisson(G4double mean)
G4double SampleMax(G4double energy)
G4double GetTotalMomentum() const
CLHEP::Hep3Vector G4ThreeVector
void Init(G4int aScheme, G4int aRange)
G4NeutronHPPartial ** partials
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4int theInternalConversionFlag
G4double * theLevelEnergies
void Init(std::istream &aDataFile)
void SetCoeff(G4int i, G4int l, G4double coeff)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
G4double GetX(G4int i) const
G4double GetCosTh(G4int l)
G4double * theTransitionProbabilities
G4double * thePhotonTransitionFraction
G4NeutronHPAngularP ** theAngular
std::vector< G4ReactionProduct * > G4ReactionProductVector
void InitAngular(std::istream &aDataFile)
G4GLOB_DLL std::ostream G4cout
void Init(std::istream &aDataFile)
void SetTotalEnergy(const G4double en)
G4NeutronHPVector theTotalXsec
void InitEnergies(std::istream &aDataFile)
G4double GetY(G4int i, G4int j)
G4double GetTotalEnergy() const
G4bool InitMean(std::istream &aDataFile)
G4double GetPDGMass() const
G4double GetXsec(G4int i)
G4InterpolationManager theLegendreManager
void SetDefinition(G4ParticleDefinition *aParticleDefinition)
G4NeutronHPVector * probs
G4NeutronHPLegendreTable ** theLegendre
static G4Electron * Electron()
void InitInterpolation(G4int i, std::istream &aDataFile)
G4NeutronHPVector * thePartialXsec
void Init(std::istream &aDataFile)
G4NeutronHPVector * theYield
void InitPartials(std::istream &aDataFile)