55 if (
fManager->GetUseWendtFissionModel()) {
58 fManager->SetProduceFissionFragments(
false);
66 delete theChannelData;
69 delete[] theIsotopeWiseData;
70 if (theFinalStates !=
nullptr) {
71 for (
G4int i = 0; i < niso; i++) {
72 delete theFinalStates[i];
74 delete[] theFinalStates;
81 return std::max(0., theChannelData->GetXsec(energy));
85 G4int isoNumber)
const
87 return theIsotopeWiseData[isoNumber].GetXsec(energy);
91 G4int isoNumber)
const
93 return theFinalStates[isoNumber]->GetXsec(energy);
100 Init(anElement, dirName);
106 theElement = anElement;
112 G4int Z = theElement->GetZasInt();
114 niso = (
G4int)theElement->GetNumberOfIsotopes();
115 const std::size_t nsize = niso > 0 ? niso : 1;
117 delete[] theIsotopeWiseData;
120 active =
new G4bool[nsize];
122 delete[] theFinalStates;
124 delete theChannelData;
126 for (
G4int i = 0; i < niso; ++i) {
127 theFinalStates[i] = theFS->
New();
130 if (niso != 0 && registerCount == 0) {
131 for (
G4int i1 = 0; i1 < niso; ++i1) {
132 G4int A = theElement->GetIsotope(i1)->GetN();
133 G4int M = theElement->GetIsotope(i1)->Getm();
136 G4double frac = theElement->GetRelativeAbundanceVector()[i1] / perCent;
137 theFinalStates[i1]->SetA_Z(
A, Z,
M);
144 if (result) theChannelData->Hash();
154 if (wendtFissionGenerator !=
nullptr) {
155 wendtFissionGenerator->InitializeANucleus(
A, Z,
M, theDir);
158 theFinalStates[index]->Init(
A, Z,
M, theDir, theFSType, projectile);
159 if (!theFinalStates[index]->
HasAnyData())
return;
164 if (theFinalStates[index]->HasXsec()) {
165 theBuffer = theFinalStates[index]->GetXsec();
166 theBuffer->Times(abundance / 100.);
167 theIsotopeWiseData[index].FillChannelData(theBuffer);
171 const G4String& tString =
"/CrossSection";
172 active[index] = theIsotopeWiseData[index].Init(
A, Z,
M, abundance,
174 if (active[index]) theBuffer = theIsotopeWiseData[index].MakeChannelData();
176 if (theBuffer !=
nullptr)
Harmonise(theChannelData, theBuffer);
182 G4int s_tmp = 0, n = 0, m_tmp = 0;
187 G4int a = s_tmp, p = n, t;
188 while (a < anActive->GetVectorLength() && p < aPassive->GetVectorLength())
193 theMerge->SetData(m_tmp, xa, anActive->
GetXsec(a) + std::max(0., aPassive->
GetXsec(xa)));
197 if (std::abs(std::abs(xp - xa) / xa) < 0.001) {
217 if (std::abs(theMerge->GetEnergy(std::max(0, m_tmp - 1)) -
227 if ( wendtFissionGenerator )
return wendtFissionGenerator;
237 if (anIsotope != -1 && anIsotope != -2) {
243 return theFinalStates[anIsotope]->ApplyYourself(theTrack);
249 for (
G4int i = 0; i < niso; i++) {
257 xsec[i] = theIsotopeWiseData[i].GetXsec(
259 theFinalStates[i]->GetZ(),
273 for (
G4int ix = 0; ix < niso; ix++) {
275 if (sum == 0 || random <= running / sum) {
280 if (it == niso) it--;
289 if ((wendtFissionGenerator !=
nullptr) && anIsotope == -2) {
290 theFinalState = wendtFissionGenerator->ApplyYourself(theTrack, Z,
A);
294 if (theFinalState ==
nullptr) {
296 G4int icounter_max = 1024;
297 while (theFinalState ==
nullptr)
300 if (icounter > icounter_max) {
301 G4cout <<
"Loop-counter exceeded the threshold value at "
302 << __LINE__ <<
"th line of " << __FILE__ <<
"." <<
G4endl;
311 theFinalState = theFinalStates[it]->ApplyYourself(theTrack);
318 fManager->GetReactionWhiteBoard()->SetTargA(
A);
319 fManager->GetReactionWhiteBoard()->SetTargZ(Z);
320 fManager->GetReactionWhiteBoard()->SetTargM(
M);
322 return theFinalState;
327 G4cout <<
" Element: " << theElement->GetName() <<
G4endl;
332 for (
int i = 0; i < niso; i++) {
333 G4cout << theFinalStates[i]->HasXsec() <<
" ";
336 if (theChannelData !=
nullptr) {
337 G4cout <<
" Cross Section (total for this channel):" <<
G4endl;
338 int np = theChannelData->GetVectorLength();
340 for (
int i = 0; i < np; i++) {
341 G4cout << theChannelData->GetEnergy(i) / eV <<
" " << theChannelData->GetXsec(i) <<
G4endl;
G4GLOB_DLL std::ostream G4cout
const G4Material * GetMaterial() const
G4double GetTemperature() const
static G4Neutron * Neutron()
G4double GetZ(G4int i) const
G4bool HasAnyData(G4int isoNumber) const
void UpdateData(G4int A, G4int Z, G4int index, G4double abundance, G4ParticleDefinition *projectile)
G4ParticleHPChannel(G4ParticleDefinition *projectile=nullptr)
G4double GetWeightedXsec(G4double energy, G4int isoNumber) const
G4double GetXsec(G4double energy) const
G4bool HasDataInAnyFinalState() const
G4double GetN(G4int i) const
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack, G4int isoNumber=-1, G4bool isElastic=false)
G4WendtFissionFragmentGenerator * GetWendtFissionGenerator() const
void Harmonise(G4ParticleHPVector *&theStore, G4ParticleHPVector *theNew)
G4double GetM(G4int i) const
G4bool Register(G4ParticleHPFinalState *theFS)
void Init(G4Element *theElement, const G4String &dirName)
G4ParticleHPManager * fManager
G4double GetFSCrossSection(G4double energy, G4int isoNumber) const
virtual G4ParticleHPFinalState * New()=0
void SetProjectile(G4ParticleDefinition *projectile)
static G4ParticleHPManager * GetInstance()
G4double GetThermalEnergy(const G4HadProjectile &aP, const G4Element *anE, G4double aT)
G4double GetXsec(G4int i)
G4double GetEnergy(G4int i) const
G4int GetVectorLength() const
static G4WendtFissionFragmentGenerator * GetInstance()