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;
290 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__,
"G4NeutronHPPhotonDist::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__,
"G4NeutronHPPhotonDist::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--;
493 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
494 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
495 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
501 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
523 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
524 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
525 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
531 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
541 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
542 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
543 thePhotons->operator[](i)->SetMomentum( tmpVector ) ;
562 if(random < running[i]/running[nGammaEnergies-1])
break;
580 G4double theta = std::acos(costheta);
587 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
595 if (std::abs(currentEnergy-
theGammas[ii])<0.1*
keV)
break;
597 if(ii==nDiscrete2) ii--;
611 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
618 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
644 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
651 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
665 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
669 thePhotons->push_back(theOne);
686 thePhotons->push_back( theOne );
692 std::vector < G4double > dif(
nDiscrete , 0.0 );
733 if ( iphoton <
nIso )
759 if (
theLegendre[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
778 if (
theAngular[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
789 G4double theta = std::acos( cosTheta );
790 G4double sinTheta = std::sin( theta );
793 G4ThreeVector direction ( sinTheta*std::cos( phi ) , sinTheta * std::sin( phi ) , cosTheta );
795 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
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
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
G4NeutronHPVector * probs
G4NeutronHPLegendreTable ** theLegendre
static G4Electron * Electron()
G4Cache< std::vector< G4int > * > actualMult
void InitInterpolation(G4int i, std::istream &aDataFile)
G4NeutronHPVector * thePartialXsec
void Init(std::istream &aDataFile)
G4NeutronHPVector * theYield
void InitPartials(std::istream &aDataFile)