Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/hadronic/models/particle_hp/src/G4FissionFragmentGenerator.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 //
 26 /*
 27  * File:   G4FissionFragmentGenerator.cc
 28  * Author: B. Wendt (wendbryc@isu.edu)
 29  *
 30  * Created on May 11, 2011, 12:04 PM
 31  */
 32 
 33 #include "G4FFGDebuggingMacros.hh"
 34 #include "G4FFGDefaultValues.hh"
 35 #include "G4HadFinalState.hh"
 36 #include "G4Ions.hh"
 37 #include "G4Neutron.hh"
 38 #include "globals.hh"
 39 
 40 #include <iostream>
 41 #include <vector>
 42 // Use a few select constant of CLHEP namespace
 43 using CLHEP::eV;
 44 using CLHEP::GeV;
 45 using CLHEP::keV;
 46 using CLHEP::MeV;
 47 #include "G4FFGEnumerations.hh"
 48 #include "G4FPYBiasedLightFragmentDist.hh"
 49 #include "G4FPYNormalFragmentDist.hh"
 50 #include "G4FissionFragmentGenerator.hh"
 51 #include "G4TableTemplate.hh"
 52 
 53 G4FissionFragmentGenerator::G4FissionFragmentGenerator()
 54 {
 55   // Set the default verbosity
 56   Verbosity_ = G4FFGDefaultValues::Verbosity;
 57 
 58   // Initialize the class
 59   Initialize();
 60 }
 61 
 62 G4FissionFragmentGenerator::G4FissionFragmentGenerator(G4int Verbosity)
 63 {
 64   // Set the verbosity
 65   Verbosity_ = Verbosity;
 66 
 67   // Initialize the class
 68   Initialize();
 69 }
 70 
 71 void G4FissionFragmentGenerator::Initialize()
 72 {
 73   G4FFG_FUNCTIONENTER__
 74 
 75   // Initialize the class descriptor variables to the default values. These
 76   // will be used unless the user redefines them.
 77   Isotope_ = G4FFGDefaultValues::Isotope;
 78   MetaState_ = G4FFGDefaultValues::MetaState;
 79   Cause_ = G4FFGDefaultValues::FissionCause;
 80   IncidentEnergy_ = G4FFGDefaultValues::ThermalNeutronEnergy;
 81   YieldType_ = G4FFGDefaultValues::YieldType;
 82   TernaryProbability_ = G4FFGDefaultValues::TernaryProbability;
 83   AlphaProduction_ = G4FFGDefaultValues::AlphaProduction;
 84   SamplingScheme_ = G4FFGDefaultValues::SamplingScheme;
 85 
 86   // No data class has been created yet
 87   YieldData_ = nullptr;
 88   IsReconstructionNeeded_ = TRUE;
 89 
 90   G4FFG_FUNCTIONLEAVE__
 91 }
 92 
 93 G4DynamicParticleVector* G4FissionFragmentGenerator::G4GenerateFission()
 94 {
 95   G4FFG_FUNCTIONENTER__
 96 
 97   const G4HadProjectile Projectile(G4DynamicParticle(G4Neutron::Neutron(), G4ThreeVector(0, 0, 0),
 98                                                      G4FFGDefaultValues::ThermalNeutronEnergy));
 99 
100   // Call the overloaded function and generate 1 fission
101   std::vector<G4DynamicParticleVector*> FissionEvent = G4GenerateFission(1, Projectile);
102   G4DynamicParticleVector* Container = FissionEvent[0];
103 
104   G4FFG_FUNCTIONLEAVE__
105   return Container;
106 }
107 
108 G4DynamicParticleVector*
109 G4FissionFragmentGenerator::G4GenerateFission(const G4HadProjectile& Projectile)
110 {
111   G4FFG_FUNCTIONENTER__
112 
113   // Call the overloaded function and generate 1 fission
114   std::vector<G4DynamicParticleVector*> FissionEvent = G4GenerateFission(1, Projectile);
115   G4DynamicParticleVector* const Container = FissionEvent[0];
116 
117   G4FFG_FUNCTIONLEAVE__
118   return Container;
119 }
120 
121 const std::vector<G4DynamicParticleVector*>
122 G4FissionFragmentGenerator::G4GenerateFission(G4long NumberOfFissions,
123                                               const G4HadProjectile& Projectile)
124 {
125   G4FFG_FUNCTIONENTER__
126 
127   // TK Modified 131107
128   // std::vector< G4DynamicParticleVector* > FissionEvents(NumberOfFissions);
129   std::vector<G4DynamicParticleVector*> FissionEvents(0);
130 
131   if (Projectile.GetDefinition() == G4Neutron::Neutron()) {
132     if (static_cast<int>(IsReconstructionNeeded_) == TRUE) {
133       // TODO Eliminate potential need for restructuring during run phase
134       // InitializeFissionProductYieldClass();
135     }
136 
137     for (G4long i = 0; i < NumberOfFissions; i++) {
138       FissionEvents.push_back(YieldData_->G4GetFission());
139       // FIXME Use particle momentum in balance equation
140       // FissionEvents.push_back(YieldData_->G4GetFission(Projectile.Get4Momentum()));
141     }
142   }
143   else {
144     FissionEvents.push_back(nullptr);
145   }
146 
147   G4FFG_FUNCTIONLEAVE__
148   return FissionEvents;
149 }
150 
151 G4Ions* G4FissionFragmentGenerator::G4GenerateFissionProduct()
152 {
153   G4FFG_FUNCTIONENTER__
154 
155   if (static_cast<int>(IsReconstructionNeeded_) == TRUE) {
156     // TODO Eliminate potential need for restructuring during run phase
157     // InitializeFissionProductYieldClass();
158   }
159 
160   G4Ions* Product = YieldData_->G4GetFissionProduct();
161 
162   G4FFG_FUNCTIONLEAVE__
163   return Product;
164 }
165 
166 G4double G4FissionFragmentGenerator::G4GetAlphaProduction()
167 {
168   G4FFG_FUNCTIONENTER__
169 
170   G4FFG_FUNCTIONLEAVE__
171   return AlphaProduction_;
172 }
173 
174 G4double G4FissionFragmentGenerator::G4GetTernaryProbability()
175 {
176   G4FFG_FUNCTIONENTER__
177 
178   G4FFG_FUNCTIONLEAVE__
179   return TernaryProbability_;
180 }
181 
182 G4FFGEnumerations::FissionCause G4FissionFragmentGenerator::G4GetCause()
183 {
184   G4FFG_FUNCTIONENTER__
185 
186   G4FFG_FUNCTIONLEAVE__
187   return Cause_;
188 }
189 
190 G4double G4FissionFragmentGenerator::G4GetIncidentEnergy()
191 {
192   G4FFG_FUNCTIONENTER__
193 
194   G4FFG_FUNCTIONLEAVE__
195   return IncidentEnergy_;
196 }
197 
198 G4int G4FissionFragmentGenerator::G4GetIsotope()
199 {
200   G4FFG_FUNCTIONENTER__
201 
202   G4FFG_FUNCTIONLEAVE__
203   return Isotope_;
204 }
205 
206 G4FFGEnumerations::MetaState G4FissionFragmentGenerator::G4GetMetaState()
207 {
208   G4FFG_FUNCTIONENTER__
209 
210   G4FFG_FUNCTIONLEAVE__
211   return MetaState_;
212 }
213 
214 G4FFGEnumerations::FissionSamplingScheme G4FissionFragmentGenerator::G4GetSamplingScheme()
215 {
216   G4FFG_FUNCTIONENTER__
217 
218   G4FFG_FUNCTIONLEAVE__
219   return SamplingScheme_;
220 }
221 
222 G4FFGEnumerations::YieldType G4FissionFragmentGenerator::G4GetYieldType()
223 {
224   G4FFG_FUNCTIONENTER__
225 
226   G4FFG_FUNCTIONLEAVE__
227   return YieldType_;
228 }
229 
230 G4int G4FissionFragmentGenerator::G4MakeIsotopeCode(G4int Z, G4int A, G4int M)
231 {
232   // Sanity check;
233   A %= 1000;
234   Z %= 1000;
235   M %= 10;
236 
237   return (A + Z * 1000) * 10 + M;
238 }
239 
240 void G4FissionFragmentGenerator::G4SetAlphaProduction(G4double WhatAlphaProduction)
241 {
242   G4FFG_FUNCTIONENTER__
243 
244   AlphaProduction_ = WhatAlphaProduction;
245   if (YieldData_ != nullptr) {
246     YieldData_->G4SetAlphaProduction(AlphaProduction_);
247   }
248 
249   if ((Verbosity_ & G4FFGEnumerations::UPDATES) != 0) {
250     G4FFG_SPACING__
251     G4FFG_LOCATION__
252 
253     G4cout << " -- Alpha production set to " << AlphaProduction_ << G4endl;
254   }
255 
256   G4FFG_FUNCTIONLEAVE__
257 }
258 
259 void G4FissionFragmentGenerator::G4SetTernaryProbability(G4double WhatTernaryProbability)
260 {
261   G4FFG_FUNCTIONENTER__
262 
263   TernaryProbability_ = WhatTernaryProbability;
264   if (YieldData_ != nullptr) {
265     YieldData_->G4SetTernaryProbability(TernaryProbability_);
266   }
267 
268   if ((Verbosity_ & G4FFGEnumerations::UPDATES) != 0) {
269     G4FFG_SPACING__
270     G4FFG_LOCATION__
271 
272     G4cout << " -- Ternary fission probability set to " << TernaryProbability_ << G4endl;
273   }
274 
275   G4FFG_FUNCTIONLEAVE__
276 }
277 
278 void G4FissionFragmentGenerator::G4SetCause(G4FFGEnumerations::FissionCause WhichCause)
279 {
280   G4FFG_FUNCTIONENTER__
281 
282   G4bool IsValidCause = (WhichCause == G4FFGEnumerations::SPONTANEOUS
283                          || WhichCause == G4FFGEnumerations::NEUTRON_INDUCED);
284   G4bool IsSameCause = (Cause_ == WhichCause);
285 
286   if (!IsSameCause && IsValidCause) {
287     Cause_ = WhichCause;
288     if (Cause_ == G4FFGEnumerations::SPONTANEOUS) {
289       IncidentEnergy_ = 0;
290     }
291     IsReconstructionNeeded_ = TRUE;
292   }
293 
294   if (Verbosity_ != G4FFGEnumerations::SILENT) {
295     G4String CauseString;
296     switch (WhichCause) {
297       case G4FFGEnumerations::SPONTANEOUS:
298         CauseString = "SPONTANEOUS";
299         break;
300       case G4FFGEnumerations::NEUTRON_INDUCED:
301         CauseString = "NEUTRON_INDUCED";
302         break;
303       case G4FFGEnumerations::PROTON_INDUCED:
304         CauseString = "PROTON_INDUCED";
305         break;
306       case G4FFGEnumerations::GAMMA_INDUCED:
307         CauseString = "GAMMA_INDUCED";
308         break;
309     }
310 
311     if ((Verbosity_ & G4FFGEnumerations::WARNING) != 0) {
312       G4FFG_SPACING__
313       G4FFG_LOCATION__
314 
315       if (IsValidCause) {
316         if (IsSameCause && YieldData_ != nullptr) {
317           G4cout << " -- Already set to use " << CauseString
318                  << " as the fission cause. Yield data class will not be reconstructed." << G4endl;
319         }
320         else if (YieldData_ == nullptr) {
321           G4cout << " -- Yield data class not yet constructed. " << CauseString
322                  << " will be applied when it is constructed." << G4endl;
323         }
324       }
325       else {
326         G4cout << " -- Invalid cause of fission" << G4endl;
327       }
328     }
329 
330     if (((Verbosity_ & G4FFGEnumerations::UPDATES) != 0) && IsValidCause) {
331       G4FFG_SPACING__
332       G4FFG_LOCATION__
333 
334       G4cout << " -- Fission cause set to " << CauseString << "." << G4endl;
335     }
336   }
337 
338   G4FFG_FUNCTIONLEAVE__
339 }
340 
341 void G4FissionFragmentGenerator::G4SetIncidentEnergy(G4double WhatIncidentEnergy)
342 {
343   G4FFG_FUNCTIONENTER__
344 
345   if (Cause_ != G4FFGEnumerations::SPONTANEOUS) {
346     IncidentEnergy_ = WhatIncidentEnergy;
347     if (YieldData_ != nullptr) {
348       YieldData_->G4SetEnergy(IncidentEnergy_);
349     }
350   }
351 
352   if (Verbosity_ != G4FFGEnumerations::SILENT) {
353     std::ostringstream EnergyString;
354     if (IncidentEnergy_ / GeV > 1) {
355       EnergyString << IncidentEnergy_ / GeV << " GeV";
356     }
357     else if (IncidentEnergy_ / MeV > 1) {
358       EnergyString << IncidentEnergy_ / MeV << " MeV";
359     }
360     else if (IncidentEnergy_ / keV > 1) {
361       EnergyString << IncidentEnergy_ / keV << " keV";
362     }
363     else {
364       EnergyString << IncidentEnergy_ / eV << " eV";
365     }
366 
367     if (((Verbosity_ & G4FFGEnumerations::ENERGY_INFO) != 0)
368         || ((Verbosity_ & G4FFGEnumerations::WARNING) != 0))
369     {
370       if (Cause_ == G4FFGEnumerations::SPONTANEOUS && IncidentEnergy_ != 0) {
371         G4FFG_SPACING__
372         G4FFG_LOCATION__
373 
374         G4cout << " -- Cannot set a non-zero energy for spontaneous fission" << G4endl;
375       }
376       else if (YieldData_ == nullptr) {
377         G4FFG_SPACING__
378         G4FFG_LOCATION__
379 
380         G4cout << " -- Yield data class not yet constructed. " << EnergyString.str()
381                << " will be applied when it is constructed." << G4endl;
382       }
383     }
384 
385     if (((Verbosity_ & G4FFGEnumerations::ENERGY_INFO) != 0)
386         || ((Verbosity_ & G4FFGEnumerations::UPDATES) != 0))
387     {
388       G4FFG_SPACING__
389       G4FFG_LOCATION__
390 
391       G4cout << " -- Incident neutron energy set to " << EnergyString.str() << "." << G4endl;
392     }
393   }
394 
395   G4FFG_FUNCTIONLEAVE__
396 }
397 
398 void G4FissionFragmentGenerator::G4SetIsotope(G4int WhichIsotope)
399 {
400   G4FFG_FUNCTIONENTER__
401 
402   G4bool IsSameIsotope = (Isotope_ == WhichIsotope);
403 
404   if (!IsSameIsotope) {
405     Isotope_ = WhichIsotope;
406     IsReconstructionNeeded_ = TRUE;
407   }
408 
409   if (Verbosity_ != G4FFGEnumerations::SILENT) {
410     if ((Verbosity_ & G4FFGEnumerations::WARNING) != 0) {
411       if (IsSameIsotope && YieldData_ != nullptr) {
412         G4FFG_SPACING__
413         G4FFG_LOCATION__
414 
415         G4cout << " -- Isotope " << Isotope_
416                << " already in use. Yield data class will not be reconstructed." << G4endl;
417       }
418       else if (YieldData_ == nullptr) {
419         G4FFG_SPACING__
420         G4FFG_LOCATION__
421 
422         G4cout << " -- Yield data class not yet constructed. The isotope will be set to "
423                << Isotope_ << " when it is constructed." << G4endl;
424       }
425     }
426 
427     if ((Verbosity_ & G4FFGEnumerations::UPDATES) != 0) {
428       G4FFG_SPACING__
429       G4FFG_LOCATION__
430 
431       G4cout << " -- Isotope set to " << Isotope_ << "." << G4endl;
432     }
433   }
434 
435   G4FFG_FUNCTIONLEAVE__
436 }
437 
438 void G4FissionFragmentGenerator::G4SetMetaState(G4FFGEnumerations::MetaState WhichMetaState)
439 {
440   G4FFG_FUNCTIONENTER__
441 
442   G4bool IsValidMetaState = (WhichMetaState >= G4FFGEnumerations::MetaStateFirst
443                              && WhichMetaState <= G4FFGEnumerations::MetaStateLast);
444   G4bool IsSameMetaState = (MetaState_ == WhichMetaState);
445 
446   if (!IsSameMetaState && IsValidMetaState) {
447     MetaState_ = WhichMetaState;
448     IsReconstructionNeeded_ = TRUE;
449   }
450 
451   if (Verbosity_ != G4FFGEnumerations::SILENT) {
452     G4String MetaName;
453     switch (MetaState_) {
454       case G4FFGEnumerations::GROUND_STATE:
455         MetaName = "GROUND_STATE";
456         break;
457 
458       case G4FFGEnumerations::META_1:
459         MetaName = "META_1";
460         break;
461 
462       case G4FFGEnumerations::META_2:
463         MetaName = "META_2";
464         break;
465     }
466 
467     if ((Verbosity_ & G4FFGEnumerations::WARNING) != 0) {
468       G4FFG_SPACING__
469       G4FFG_LOCATION__
470 
471       std::ostringstream Temp;
472       if (IsValidMetaState) {
473         if (IsSameMetaState && YieldData_ != nullptr) {
474           G4cout << " -- Already set to use " << MetaName
475                  << " as the metastable state. Yield data class will not be reconstructed"
476                  << G4endl;
477         }
478         else if (YieldData_ == nullptr) {
479           G4cout << " -- Yield data class not yet constructed. " << MetaName
480                  << " will be applied when it is constructed." << G4endl;
481         }
482       }
483       else {
484         G4cout << " -- Invalid metastable state." << G4endl;
485       }
486     }
487 
488     if (((Verbosity_ & G4FFGEnumerations::UPDATES) != 0) && IsValidMetaState) {
489       G4FFG_SPACING__
490       G4FFG_LOCATION__
491 
492       G4cout << " -- Metastable state set to " << MetaName << "." << G4endl;
493     }
494   }
495 
496   G4FFG_FUNCTIONLEAVE__
497 }
498 
499 void G4FissionFragmentGenerator ::G4SetSamplingScheme(
500   G4FFGEnumerations::FissionSamplingScheme NewScheme)
501 {
502   G4FFG_FUNCTIONENTER__
503 
504   G4bool IsValidScheme = (NewScheme >= G4FFGEnumerations::FissionSamplingSchemeFirst
505                           && NewScheme <= G4FFGEnumerations::FissionSamplingSchemeLast);
506   G4bool IsSameScheme = (NewScheme == SamplingScheme_);
507 
508   if (!IsSameScheme && IsValidScheme) {
509     SamplingScheme_ = NewScheme;
510     IsReconstructionNeeded_ = TRUE;
511   }
512 
513   if (Verbosity_ != G4FFGEnumerations::SILENT) {
514     G4String SchemeString;
515     switch (SamplingScheme_) {
516       case G4FFGEnumerations::NORMAL:
517         SchemeString = "NORMAL";
518         break;
519 
520       case G4FFGEnumerations::LIGHT_FRAGMENT:
521         SchemeString = "LIGHT_FRAGMENT";
522         break;
523 
524       default:
525         SchemeString = "UNSUPPORTED";
526         break;
527     }
528 
529     if ((Verbosity_ & G4FFGEnumerations::WARNING) != 0) {
530       G4FFG_SPACING__
531       G4FFG_LOCATION__
532 
533       if (IsValidScheme) {
534         if (IsSameScheme && YieldData_ != nullptr) {
535           G4cout << " -- Already set to use " << SchemeString
536                  << " as the sampling scheme. Yield data class will not be reconstructed."
537                  << G4endl;
538         }
539         else if (YieldData_ == nullptr) {
540           G4cout << " -- Yield data class not yet constructed. " << SchemeString
541                  << " will be applied when it is constructed." << G4endl;
542         }
543       }
544       else {
545         G4cout << " -- Invalid sampling scheme." << G4endl;
546       }
547     }
548 
549     if (((Verbosity_ & G4FFGEnumerations::UPDATES) != 0) && IsValidScheme) {
550       G4FFG_SPACING__
551       G4FFG_LOCATION__
552 
553       G4cout << " -- Sampling scheme set to " << SchemeString << "." << G4endl;
554     }
555   }
556 
557   G4FFG_FUNCTIONLEAVE__
558 }
559 
560 void G4FissionFragmentGenerator::G4SetYieldType(G4FFGEnumerations::YieldType WhichYieldType)
561 {
562   G4FFG_FUNCTIONENTER__
563 
564   G4bool IsValidYieldType = (WhichYieldType == G4FFGEnumerations::INDEPENDENT
565                              || WhichYieldType == G4FFGEnumerations::CUMULATIVE);
566   G4bool IsSameYieldType = (YieldType_ == WhichYieldType);
567 
568   if (!IsSameYieldType && IsValidYieldType) {
569     YieldType_ = WhichYieldType;
570     IsReconstructionNeeded_ = TRUE;
571   }
572 
573   if (Verbosity_ != G4FFGEnumerations::SILENT) {
574     G4String YieldString;
575     switch ((int)YieldType_) {
576       case G4FFGEnumerations::INDEPENDENT:
577         YieldString = "INDEPENDENT";
578         break;
579 
580       case G4FFGEnumerations::SPONTANEOUS:
581         YieldString = "SPONTANEOUS";
582         break;
583 
584       default:
585         YieldString = "UNSUPPORTED";
586         break;
587     }
588 
589     if ((Verbosity_ & G4FFGEnumerations::WARNING) != 0) {
590       G4FFG_SPACING__
591       G4FFG_LOCATION__
592 
593       if (IsValidYieldType) {
594         if (IsSameYieldType && YieldData_ != nullptr) {
595         }
596         else if (YieldData_ == nullptr) {
597           G4cout << " -- Yield data class not yet constructed. Yield type " << YieldString
598                  << " will be applied when it is constructed." << G4endl;
599         }
600       }
601       else {
602         G4cout << " -- Invalid yield type." << G4endl;
603       }
604     }
605 
606     if (((Verbosity_ & G4FFGEnumerations::UPDATES) != 0) && IsValidYieldType) {
607       G4FFG_SPACING__
608       G4FFG_LOCATION__
609 
610       G4cout << " -- Yield type set to " << YieldString << G4endl;
611     }
612   }
613 
614   G4FFG_FUNCTIONLEAVE__
615 }
616 
617 void G4FissionFragmentGenerator::G4SetVerbosity(G4int Verbosity)
618 {
619   G4FFG_FUNCTIONENTER__
620 
621   Verbosity_ = Verbosity;
622 
623   if (YieldData_ != nullptr) {
624     YieldData_->G4SetVerbosity(Verbosity_);
625   }
626 
627   G4FFG_FUNCTIONLEAVE__
628 }
629 
630 bool G4FissionFragmentGenerator::InitializeFissionProductYieldClass(std::istringstream& dataStream)
631 {
632   G4FFG_FUNCTIONENTER__
633 
634   if (YieldData_ != nullptr) {
635     delete YieldData_;
636 
637     if ((Verbosity_ & G4FFGEnumerations::UPDATES) != 0) {
638       G4FFG_SPACING__
639       G4FFG_LOCATION__
640 
641       G4cout << " -- Old yield data class deleted." << G4endl;
642     }
643   }
644 
645   try {
646     if (SamplingScheme_ == G4FFGEnumerations::NORMAL) {
647       YieldData_ = new G4FPYNormalFragmentDist(Isotope_, MetaState_, Cause_, YieldType_, Verbosity_,
648                                                dataStream);
649     }
650     else {
651       YieldData_ = new G4FPYBiasedLightFragmentDist(Isotope_, MetaState_, Cause_, YieldType_,
652                                                     Verbosity_, dataStream);
653     }
654 
655     if (AlphaProduction_ != 0 && TernaryProbability_ != 0) {
656       YieldData_->G4SetTernaryProbability(TernaryProbability_);
657       YieldData_->G4SetAlphaProduction(AlphaProduction_);
658     }
659 
660     if ((Verbosity_ & G4FFGEnumerations::UPDATES) != 0) {
661       G4FFG_SPACING__
662       G4FFG_LOCATION__
663 
664       G4cout << " -- Yield data class constructed with defined values." << G4endl;
665     }
666   }
667   catch (std::exception& e) {
668     YieldData_ = nullptr;
669   }
670 
671   IsReconstructionNeeded_ = FALSE;
672 
673   G4FFG_FUNCTIONLEAVE__
674   return YieldData_ != nullptr;
675 }
676 
677 G4FissionFragmentGenerator::~G4FissionFragmentGenerator()
678 {
679   G4FFG_FUNCTIONENTER__
680 
681   delete YieldData_;
682 
683   G4FFG_FUNCTIONLEAVE__
684 }
685