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));
87 return theIsotopeWiseData[isoNumber].
GetXsec(energy);
93 return theFinalStates[isoNumber]->
GetXsec(energy);
100 Init(anElement, dirName);
106 theElement = anElement;
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) {
137 theFinalStates[i1]->
SetA_Z(
A, Z,
M);
144 if (result) theChannelData->
Hash();
154 if (wendtFissionGenerator !=
nullptr) {
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.);
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)) -
232 if (anIsotope != -1 && anIsotope != -2) {
244 for (
G4int i = 0; i < niso; i++) {
252 xsec[i] = theIsotopeWiseData[i].
GetXsec(
254 theFinalStates[i]->
GetZ(),
268 for (
G4int ix = 0; ix < niso; ix++) {
270 if (sum == 0 || random <= running / sum) {
275 if (it == niso) it--;
284 if ((wendtFissionGenerator !=
nullptr) && anIsotope == -2) {
285 theFinalState = wendtFissionGenerator->
ApplyYourself(theTrack, Z,
A);
289 if (theFinalState ==
nullptr) {
291 G4int icounter_max = 1024;
292 while (theFinalState ==
nullptr)
295 if (icounter > icounter_max) {
296 G4cout <<
"Loop-counter exceeded the threshold value at "
297 << __LINE__ <<
"th line of " << __FILE__ <<
"." <<
G4endl;
317 return theFinalState;
327 for (
int i = 0; i < niso; i++) {
331 if (theChannelData !=
nullptr) {
332 G4cout <<
" Cross Section (total for this channel):" <<
G4endl;
335 for (
int i = 0; i < np; i++) {
G4GLOB_DLL std::ostream G4cout
G4double * GetRelativeAbundanceVector() const
const G4Isotope * GetIsotope(G4int iso) const
size_t GetNumberOfIsotopes() const
const G4String & GetName() const
const G4Material * GetMaterial() const
G4double GetTemperature() const
static G4Neutron * Neutron()
G4double GetZ(G4int i) const
G4bool HasAnyData(G4int isoNumber)
void UpdateData(G4int A, G4int Z, G4int index, G4double abundance, G4ParticleDefinition *projectile)
G4ParticleHPChannel(G4ParticleDefinition *projectile=nullptr)
G4double GetN(G4int i) const
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack, G4int isoNumber=-1, G4bool isElastic=false)
void Harmonise(G4ParticleHPVector *&theStore, G4ParticleHPVector *theNew)
G4bool HasDataInAnyFinalState()
G4double GetWeightedXsec(G4double energy, G4int isoNumber)
G4double GetM(G4int i) const
G4bool Register(G4ParticleHPFinalState *theFS)
G4double GetXsec(G4double energy)
void Init(G4Element *theElement, const G4String &dirName)
G4ParticleHPManager * fManager
G4double GetFSCrossSection(G4double energy, G4int isoNumber)
virtual G4double GetXsec(G4double)
virtual G4HadFinalState * ApplyYourself(const G4HadProjectile &)
void SetA_Z(G4double anA, G4double aZ, G4int aM=0)
virtual G4ParticleHPFinalState * New()=0
void SetProjectile(G4ParticleDefinition *projectile)
void Init(G4double A, G4double Z, G4String &dirName, G4String &aFSType, G4ParticleDefinition *p)
G4ParticleHPVector * MakeChannelData()
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)
void FillChannelData(G4ParticleHPVector *aBuffer)
G4double GetXsec(G4double energy)
void SetProduceFissionFragments(G4bool val)
G4bool GetUseWendtFissionModel() const
static G4ParticleHPManager * GetInstance()
G4ParticleHPReactionWhiteBoard * GetReactionWhiteBoard()
G4double GetThermalEnergy(const G4HadProjectile &aP, const G4Element *anE, G4double aT)
void Times(G4double factor)
G4double GetXsec(G4int i)
G4double GetEnergy(G4int i) const
G4int GetVectorLength() const
void InitializeANucleus(const G4int A, const G4int Z, const G4int M, const G4String &dataDirectory)
G4HadFinalState * ApplyYourself(const G4HadProjectile &projectile, G4int Z, G4int A)
static G4WendtFissionFragmentGenerator * GetInstance()