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;
288 G4int nSecondaries = 0;
297 if(nDiscrete==1&¤t<1.0001)
309 for(i=0;i<nSecondaries;i++)
313 thePhotons->push_back(theOne);
371 std::vector< G4double > photons_e_best(
actualMult[ 0 ] , 0.0 );
374 for (
G4int j = 0 ; j < maxTry ; j++ )
376 std::vector< G4double > photons_e(
actualMult[ 0 ] , 0.0 );
377 for ( std::vector< G4double >::iterator
378 it = photons_e.begin() ; it < photons_e.end() ; it++ )
382 if ( std::accumulate( photons_e.begin() , photons_e.end() , 0.0 ) > maximumE )
384 if ( std::accumulate( photons_e.begin() , photons_e.end() , 0.0 ) < best )
385 photons_e_best = photons_e;
390 for ( std::vector< G4double >::iterator
391 it = photons_e.begin() ; it < photons_e.end() ; it++ )
393 thePhotons->operator[](count)->SetKineticEnergy( *it );
401 G4cout <<
"NeutronHPPhotonDist could not find fitted energy set for multiplicity of " <<
actualMult[0] <<
"." <<
G4endl;
402 G4cout <<
"NeutronHPPhotonDist will use the best set." <<
G4endl;
403 for ( std::vector< G4double >::iterator
404 it = photons_e_best.begin() ; it < photons_e_best.end() ; it++ )
406 thePhotons->operator[](count)->SetKineticEnergy( *it );
417 thePhotons->operator[](count)->SetKineticEnergy(
energy[i]);
420 if(count > nSecondaries)
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPPhotonDist::GetPhotons inconsistancy");
440 if(random<run/sum)
break;
442 if(theP==nPartials) theP=nPartials-1;
447 thePhotons->operator[](count)->SetKineticEnergy(eGamm);
452 thePhotons->operator[](count)->SetKineticEnergy(
energy[i]);
455 if(count > nSecondaries)
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPPhotonDist::GetPhotons inconsistancy");
462 for (i=0; i< nSecondaries; i++)
465 G4double theta = std::acos(costheta);
468 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
469 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
470 thePhotons->operator[](i)->SetMomentum( temp ) ;
476 for(i=0; i<nSecondaries; i++)
478 G4double currentEnergy = thePhotons->operator[](i)->GetTotalEnergy();
481 if (std::abs(currentEnergy-
theGammas[ii])<0.1*
keV)
break;
483 if(ii==nDiscrete2) ii--;
490 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
491 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
492 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
498 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
520 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
521 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
522 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
528 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
538 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
539 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
540 thePhotons->operator[](i)->SetMomentum( tmpVector ) ;
559 if(random < running[i]/running[nGammaEnergies-1])
break;
577 G4double theta = std::acos(costheta);
584 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
592 if (std::abs(currentEnergy-
theGammas[ii])<0.1*
keV)
break;
594 if(ii==nDiscrete2) ii--;
608 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
615 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
641 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
648 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
662 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
666 thePhotons->push_back(theOne);
683 thePhotons->push_back( theOne );
689 std::vector < G4double > dif(
nDiscrete , 0.0 );
730 if ( iphoton <
nIso )
756 if (
theLegendre[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
775 if (
theAngular[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
786 G4double theta = std::acos( cosTheta );
787 G4double sinTheta = std::sin( theta );
790 G4ThreeVector direction ( sinTheta*std::cos( phi ) , sinTheta * std::sin( phi ) , cosTheta );
792 thePhotons->operator[]( 0 )->SetMomentum( photonP ) ;
G4int theInternalConversionFlag
G4long G4Poisson(G4double mean)
G4int GetVectorLength() const
G4double GetTotalMomentum() const
CLHEP::Hep3Vector G4ThreeVector
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
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)
G4ParticleHPVector theTotalXsec
G4double GetX(G4int i) const
G4double GetY(G4double x)
G4double GetTotalEnergy() const
G4double GetPDGMass() const
void SetCoeff(G4int i, G4int l, G4double coeff)
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