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.");
129 if (
repFlag == 2)
G4cout <<
"G4ParticleHPPhotonDist: repFlag == 2 && isoFlag != 1 is unexpected! If you use G4ND3.x, then please report to Geant4 HyperNews. " <<
G4endl;
133 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;
138 std::vector < G4double > vct_gammas_par;
139 std::vector < G4double > vct_shells_par;
140 std::vector < G4int > vct_primary_par;
141 std::vector < G4int > vct_distype_par;
142 std::vector < G4ParticleHPVector* > vct_pXS_par;
148 vct_gammas_par.push_back(
theGammas[ i ] );
149 vct_shells_par.push_back(
theShells[ i ] );
150 vct_primary_par.push_back(
isPrimary[ i ] );
151 vct_distype_par.push_back(
disType[ i ] );
154 vct_pXS_par.push_back( hpv );
161 for (i=0; i<
nIso; i++)
179 for (ii=0; ii<nNeu[i-
nIso]; ii++)
190 for (ii=0; ii<nNeu[i-
nIso]; ii++)
198 throw G4HadronicException(__FILE__, __LINE__,
"cannot deal with this tabulation type for angular distributions.");
202 if ( vct_gammas_par.size() > 0 )
210 if (
theGammas[ i ] == vct_gammas_par [ j ] &&
theShells [ i ] == vct_shells_par[ j ] )
213 disType [ i ] = vct_distype_par [ j ];
219 for ( std::vector < G4ParticleHPVector* >::iterator
220 it = vct_pXS_par.begin() ;
it != vct_pXS_par.end() ;
it++ )
232 G4int i, energyDistributionsNeeded = 0;
235 if(
disType[i]==1) energyDistributionsNeeded =1;
237 if(!energyDistributionsNeeded)
return;
294 G4int nSecondaries = 0;
302 if (nDiscrete == 1 && current < 1.0001) {
313 for (i = 0; i < nSecondaries; i++) {
316 thePhotons->push_back(theOne);
331 std::vector< G4double > photons_e_best(
actualMult.
Get()->at(0) , 0.0 );
334 for (
G4int j = 0; j < maxTry; j++) {
335 std::vector<G4double> photons_e(
actualMult.
Get()->at(0), 0.0);
336 for (std::vector<G4double>::iterator
it = photons_e.begin();
it < photons_e.end();
it++) {
340 if (std::accumulate(photons_e.begin(), photons_e.end(), 0.0) > maximumE) {
341 if (std::accumulate(photons_e.begin(), photons_e.end(), 0.0) < best)
342 photons_e_best = photons_e;
347 for (std::vector<G4double>::iterator
it = photons_e.begin();
it < photons_e.end();
it++) {
348 thePhotons->operator[](iphot)->SetKineticEnergy(*
it);
369 thePhotons->operator[](count)->SetKineticEnergy(
energy[i]);
372 if (count > nSecondaries)
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPPhotonDist::GetPhotons inconsistancy");
381 for (iii = 0; iii <
nPartials; iii++) sum+=
probs[iii].GetY(anEnergy);
387 if(random<run/sum)
break;
390 if (theP == nPartials) theP=nPartials-1;
395 thePhotons->operator[](count)->SetKineticEnergy(eGamm);
400 thePhotons->operator[](count)->SetKineticEnergy(
energy[i]);
403 if (count > nSecondaries)
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPPhotonDist::GetPhotons inconsistancy");
410 for (i=0; i< nSecondaries; i++)
416 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
417 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
418 thePhotons->operator[](i)->SetMomentum( temp ) ;
424 for(i=0; i<nSecondaries; i++)
426 G4double currentEnergy = thePhotons->operator[](i)->GetTotalEnergy();
431 if(ii==nDiscrete2) ii--;
442 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
444 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costheta );
445 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
451 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
473 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
474 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
475 thePhotons->operator[](i)->SetMomentum( tempVector ) ;
481 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
491 G4double en = thePhotons->operator[](i)->GetTotalEnergy();
492 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
493 thePhotons->operator[](i)->SetMomentum( tmpVector ) ;
511 if(random < running[i]/running[nGammaEnergies-1])
break;
536 G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
546 if(ii==nDiscrete2) ii--;
560 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
567 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
593 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
600 for (iii=0; iii<
nNeu[ii-
nIso]; iii++)
614 G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
618 thePhotons->push_back(theOne);
635 thePhotons->push_back( theOne );
641 std::vector < G4double > dif(
nDiscrete , 0.0 );
692 if ( iphoton <
nIso )
718 if (
theLegendre[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
737 if (
theAngular[ iphoton -
nIso ][ j ].GetEnergy() > anEnergy )
break;
749 G4double sinTheta = std::sin( theta );
752 G4ThreeVector direction ( sinTheta*std::cos( phi ) , sinTheta * std::sin( phi ) , cosTheta );
754 thePhotons->operator[]( 0 )->SetMomentum( photonP ) ;