Geant4.10
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
G4FissionProductYieldDist Class Referenceabstract

#include <G4FissionProductYieldDist.hh>

Inheritance diagram for G4FissionProductYieldDist:
G4FPYBiasedLightFragmentDist G4FPYNormalFragmentDist

Public Member Functions

 G4FissionProductYieldDist (G4int WhichIsotope, G4FFGEnumerations::MetaState WhichMetaState, G4FFGEnumerations::FissionCause WhichCause, G4FFGEnumerations::YieldType WhichYieldType, std::istringstream &dataStream)
 
 G4FissionProductYieldDist (G4int WhichIsotope, G4FFGEnumerations::MetaState WhichMetaState, G4FFGEnumerations::FissionCause WhichCause, G4FFGEnumerations::YieldType WhichYieldType, G4int Verbosity, std::istringstream &dataStream)
 
G4DynamicParticleVectorG4GetFission (void)
 
G4IonsG4GetFissionProduct (void)
 
void G4SetAlphaProduction (G4double WhatAlphaProduction)
 
void G4SetEnergy (G4double WhatIncidentEnergy)
 
void G4SetTernaryProbability (G4double TernaryProbability)
 
void G4SetVerbosity (G4int WhatVerbosity)
 
virtual ~G4FissionProductYieldDist (void)
 

Protected Member Functions

void CheckAlphaSanity (void)
 
G4IonsFindParticle (G4double RandomParticle)
 
G4IonsFindParticleExtrapolation (G4double RandomParticle, G4bool LowerEnergyGroupExists)
 
G4IonsFindParticleInterpolation (G4double RandomParticle, G4int LowerEnergyGroup)
 
G4IonsFindParticleBranchSearch (ProbabilityBranch *Branch, G4double RandomParticle, G4int EnergyGroup1, G4int EnergyGroup2)
 
virtual void GenerateAlphas (std::vector< G4ReactionProduct * > *Alphas)
 
virtual void GenerateNeutrons (std::vector< G4ReactionProduct * > *Neutrons)
 
virtual G4IonsGetFissionProduct (void)=0
 
G4IonsGetParticleDefinition (G4int Product, G4FFGEnumerations::MetaState MetaState)
 
G4String MakeDirectoryName (void)
 
G4String MakeFileName (G4int Isotope, G4FFGEnumerations::MetaState MetaState)
 
G4DynamicParticleMakeG4DynamicParticle (G4ReactionProduct *)
 
G4String MakeIsotopeName (G4int Isotope, G4FFGEnumerations::MetaState MetaState)
 
virtual void MakeTrees (void)
 
virtual void ReadProbabilities (void)
 
void Renormalize (ProbabilityBranch *Branch)
 
void SampleAlphaEnergies (std::vector< G4ReactionProduct * > *Alphas)
 
void SampleGammaEnergies (std::vector< G4ReactionProduct * > *Gammas)
 
void SampleNeutronEnergies (std::vector< G4ReactionProduct * > *Neutrons)
 
void SetNubar (void)
 
virtual void SortProbability (G4ENDFYieldDataContainer *YieldData)
 
void BurnTree (ProbabilityBranch *Branch)
 

Protected Attributes

const G4int Isotope_
 
const G4FFGEnumerations::MetaState MetaState_
 
const
G4FFGEnumerations::FissionCause 
Cause_
 
const G4FFGEnumerations::YieldType YieldType_
 
G4ENDFTapeReadENDFData_
 
G4IonsAlphaDefinition_
 
G4double AlphaProduction_
 
G4double TernaryProbability_
 
G4IonsGammaDefinition_
 
G4double IncidentEnergy_
 
G4double MeanGammaEnergy_
 
G4IonsNeutronDefinition_
 
G4double Nubar_
 
G4double NubarWidth_
 
G4int RemainingZ_
 
G4int RemainingA_
 
G4double RemainingEnergy_
 
G4int Verbosity_
 
ProbabilityTreeTrees_
 
G4IonsSmallestZ_
 
G4IonsSmallestA_
 
G4IonsLargestZ_
 
G4IonsLargestA_
 
G4int YieldEnergyGroups_
 
G4doubleYieldEnergies_
 
G4doubleMaintainNormalizedData_
 
G4doubleDataTotal_
 
G4int TreeCount_
 
G4int BranchCount_
 
G4IonTableIonTable_
 
G4NeutronHPNamesElementNames_
 
G4FPYSamplingOpsRandomEngine_
 

Detailed Description

G4FissionProductYieldDist is the base class for storing all the fission data and generating fission events.

Definition at line 53 of file G4FissionProductYieldDist.hh.

Constructor & Destructor Documentation

G4FissionProductYieldDist::G4FissionProductYieldDist ( G4int  WhichIsotope,
G4FFGEnumerations::MetaState  WhichMetaState,
G4FFGEnumerations::FissionCause  WhichCause,
G4FFGEnumerations::YieldType  WhichYieldType,
std::istringstream &  dataStream 
)

Default constructor

  • Usage:
    • WhichIsotope: Isotope number of the element in ZZZAAA form
    • WhichMetaState: GROUND_STATE, META_1, or META_2
    • WhichCause: SPONTANEOUS or N_INDUCED
    • WhichYieldType: INDEPENDENT or CUMULATIVE
  • Notes:

Definition at line 81 of file G4FissionProductYieldDist.cc.

References G4FFG_FUNCTIONENTER__, and G4FFG_FUNCTIONLEAVE__.

86 : Isotope_(WhichIsotope),
87  MetaState_(WhichMetaState),
88  Cause_(WhichCause),
89  YieldType_(WhichYieldType),
90  Verbosity_(G4FFGDefaultValues::Verbosity)
91 {
93 
94  try
95  {
96  // Initialize the class
97  Initialize(dataStream);
98  } catch (std::exception e)
99  {
101  throw e;
102  }
103 
105 }
const G4FFGEnumerations::YieldType YieldType_
const G4FFGEnumerations::FissionCause Cause_
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
const G4FFGEnumerations::MetaState MetaState_
G4FissionProductYieldDist::G4FissionProductYieldDist ( G4int  WhichIsotope,
G4FFGEnumerations::MetaState  WhichMetaState,
G4FFGEnumerations::FissionCause  WhichCause,
G4FFGEnumerations::YieldType  WhichYieldType,
G4int  Verbosity,
std::istringstream &  dataStream 
)

Overloaded constructor

  • Usage:
    • WhichIsotope: Isotope number of the element in ZZZAAA form
    • WhichMetaState: GROUND_STATE, META_1, or META_2
    • WhichCause: SPONTANEOUS or N_INDUCED
    • WhichYieldType: INDEPENDENT or CUMULATIVE
    • Verbosity: Verbosity level
  • Notes:

Definition at line 108 of file G4FissionProductYieldDist.cc.

References G4FFG_FUNCTIONENTER__, and G4FFG_FUNCTIONLEAVE__.

114 : Isotope_(WhichIsotope),
115  MetaState_(WhichMetaState),
116  Cause_(WhichCause),
117  YieldType_(WhichYieldType),
119 {
121 
122  try
123  {
124  // Initialize the class
125  Initialize(dataStream);
126  } catch (std::exception e)
127  {
129  throw e;
130  }
131 
133 }
const G4FFGEnumerations::YieldType YieldType_
const G4FFGEnumerations::FissionCause Cause_
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
const G4FFGEnumerations::MetaState MetaState_
G4FissionProductYieldDist::~G4FissionProductYieldDist ( void  )
virtual

Default deconstructor. It is a virtual function since G4FissionProductYieldDist is a parent class

Definition at line 1475 of file G4FissionProductYieldDist.cc.

References BurnTree(), DataTotal_, ElementNames_, ENDFData_, G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, MaintainNormalizedData_, ProbabilityTree::ProbabilityRangeEnd, RandomEngine_, Trees_, TRUE, and ProbabilityTree::Trunk.

1476 {
1478 
1479  // Burn each tree, one by one
1480  G4int WhichTree = 0;
1481  while(Trees_[WhichTree].IsEnd != TRUE)
1482  {
1483  BurnTree(Trees_[WhichTree].Trunk);
1484  delete Trees_[WhichTree].Trunk;
1485  delete[] Trees_[WhichTree].ProbabilityRangeEnd;
1486  WhichTree++;
1487  }
1488 
1489  // Delete each dynamically allocated variable
1490  delete ENDFData_;
1491  delete[] Trees_;
1492  delete[] DataTotal_;
1493  delete[] MaintainNormalizedData_;
1494  delete ElementNames_;
1495  delete RandomEngine_;
1496 
1498 }
G4double * ProbabilityRangeEnd
int G4int
Definition: G4Types.hh:78
#define TRUE
Definition: globals.hh:55
ProbabilityBranch * Trunk
#define G4FFG_FUNCTIONLEAVE__
void BurnTree(ProbabilityBranch *Branch)
#define G4FFG_FUNCTIONENTER__

Member Function Documentation

void G4FissionProductYieldDist::BurnTree ( ProbabilityBranch Branch)
protected

Recursively burns each branch in a probability tree.

Definition at line 1501 of file G4FissionProductYieldDist.cc.

References G4FFG_RECURSIVE_FUNCTIONENTER__, G4FFG_RECURSIVE_FUNCTIONLEAVE__, ProbabilityBranch::IncidentEnergies, ProbabilityBranch::Left, ProbabilityBranch::ProbabilityRangeBottom, ProbabilityBranch::ProbabilityRangeTop, and ProbabilityBranch::Right.

Referenced by ~G4FissionProductYieldDist().

1502 {
1504 
1505  // Check to see it Branch exists. Branch will be a null pointer if it
1506  // doesn't exist
1507  if(Branch)
1508  {
1509  // Burn down before you burn up
1510  BurnTree(Branch->Left);
1511  delete Branch->Left;
1512  BurnTree(Branch->Right);
1513  delete Branch->Right;
1514 
1515  delete[] Branch->IncidentEnergies;
1516  delete[] Branch->ProbabilityRangeTop;
1517  delete[] Branch->ProbabilityRangeBottom;
1518  }
1519 
1521 }
#define G4FFG_RECURSIVE_FUNCTIONLEAVE__
ProbabilityBranch * Right
G4double * ProbabilityRangeBottom
G4double * ProbabilityRangeTop
#define G4FFG_RECURSIVE_FUNCTIONENTER__
ProbabilityBranch * Left
void BurnTree(ProbabilityBranch *Branch)
void G4FissionProductYieldDist::CheckAlphaSanity ( void  )
protected

Checks to make sure that alpha overpopulation will not occur, which could result in an unsolvable zero momentum in the LAB system.

Definition at line 660 of file G4FissionProductYieldDist.cc.

References AlphaProduction_, G4FFG_FUNCTIONENTER__, and G4FFG_FUNCTIONLEAVE__.

Referenced by G4GetFission().

661 {
663 
664  // This provides comfortable breathing room at 16 MeV per alpha
665  if(AlphaProduction_ > 10)
666  {
667  AlphaProduction_ = 10;
668  } else if(AlphaProduction_ < -7)
669  {
670  AlphaProduction_ = -7;
671  }
672 
674 }
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
G4Ions * G4FissionProductYieldDist::FindParticle ( G4double  RandomParticle)
protected

Returns the G4Ions definitions pointer for the particle whose probability segment contains the (0, 1] random number RandomParticle

Definition at line 677 of file G4FissionProductYieldDist.cc.

References FindParticleExtrapolation(), FindParticleInterpolation(), G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, ProbabilityBranch::Left, ProbabilityBranch::Particle, ProbabilityBranch::ProbabilityRangeTop, ProbabilityBranch::Right, gammaraytel::tree, TreeCount_, Trees_, ProbabilityTree::Trunk, YieldEnergies_, and YieldEnergyGroups_.

Referenced by G4GetFissionProduct(), G4FPYNormalFragmentDist::GetFissionProduct(), and G4FPYBiasedLightFragmentDist::GetFissionProduct().

678 {
680 
681  // Determine which energy group is currently in use
682  G4bool isExact = false;
683  G4bool lowerExists = false;
684  G4bool higherExists = false;
685  G4int energyGroup;
686  for(energyGroup = 0; energyGroup < YieldEnergyGroups_; energyGroup++)
687  {
688  if(IncidentEnergy_ == YieldEnergies_[energyGroup])
689  {
690  isExact = true;
691  break;
692  }
693 
694  if(energyGroup == 0 && IncidentEnergy_ < YieldEnergies_[energyGroup])
695  {
696  // Break if the energy is less than the lowest energy
697  higherExists = true;
698  break;
699  } else if(energyGroup == YieldEnergyGroups_ - 1)
700  {
701  // The energy is greater than any values in the yield data.
702  lowerExists = true;
703  break;
704  } else
705  {
706  // Break if the energy is less than the lowest energy
707  if(IncidentEnergy_ > YieldEnergies_[energyGroup])
708  {
709  energyGroup--;
710  lowerExists = true;
711  higherExists = true;
712  break;
713  }
714  }
715  }
716 
717  // Determine which particle it is
718  G4Ions* FoundParticle = NULL;
719  if(isExact || YieldEnergyGroups_ == 1)
720  {
721  // Determine which tree contains the random value
722  G4int tree;
723  for(tree = 0; tree < TreeCount_; tree++)
724  {
725  // Break if a tree is identified as containing the random particle
726  if(RandomParticle <= Trees_[tree].ProbabilityRangeEnd[energyGroup])
727  {
728  break;
729  }
730  }
731  ProbabilityBranch* Branch = Trees_[tree].Trunk;
732 
733  // Iteratively traverse the tree until the particle addressed by the random
734  // variable is found
735  G4bool RangeIsSmaller;
736  G4bool RangeIsGreater;
737  while((RangeIsSmaller = (RandomParticle < Branch->ProbabilityRangeBottom[energyGroup]))
738  || (RangeIsGreater = (RandomParticle > Branch->ProbabilityRangeTop[energyGroup])))
739  {
740  if(RangeIsSmaller)
741  {
742  Branch = Branch->Left;
743  } else {
744  Branch = Branch->Right;
745  }
746  }
747 
748  FoundParticle = Branch->Particle;
749  } else if(lowerExists && higherExists)
750  {
751  // We need to do some interpolation
752  FoundParticle = FindParticleInterpolation(RandomParticle, energyGroup);
753  } else
754  {
755  // We need to do some extrapolation
756  FoundParticle = FindParticleExtrapolation(RandomParticle, lowerExists);
757  }
758 
759  // Return the particle
761  return FoundParticle;
762 }
ProbabilityBranch * Right
int G4int
Definition: G4Types.hh:78
G4double * ProbabilityRangeTop
tuple tree
Definition: gammaraytel.py:4
Definition: G4Ions.hh:51
bool G4bool
Definition: G4Types.hh:79
ProbabilityBranch * Trunk
G4Ions * FindParticleExtrapolation(G4double RandomParticle, G4bool LowerEnergyGroupExists)
G4Ions * FindParticleInterpolation(G4double RandomParticle, G4int LowerEnergyGroup)
#define G4FFG_FUNCTIONLEAVE__
ProbabilityBranch * Left
#define G4FFG_FUNCTIONENTER__
G4Ions * G4FissionProductYieldDist::FindParticleBranchSearch ( ProbabilityBranch Branch,
G4double  RandomParticle,
G4int  EnergyGroup1,
G4int  EnergyGroup2 
)
protected

Returns the G4Ions definitions pointer for the particle whose probability segment contains the (0, 1] random number RandomParticle by searching through a branch. Both the extrapolation and interpolation schemes currently use this function to identify the particle.

Definition at line 819 of file G4FissionProductYieldDist.cc.

References G4FFG_RECURSIVE_FUNCTIONENTER__, G4FFG_RECURSIVE_FUNCTIONLEAVE__, ProbabilityBranch::IncidentEnergies, ProbabilityBranch::IncidentEnergiesCount, ProbabilityBranch::Left, ProbabilityBranch::Particle, ProbabilityBranch::ProbabilityRangeBottom, ProbabilityBranch::ProbabilityRangeTop, and ProbabilityBranch::Right.

Referenced by FindParticleExtrapolation(), and FindParticleInterpolation().

823 {
825 
826  G4Ions* Particle;
827 
828  // Verify that the branch exists
829  if(Branch == NULL)
830  {
831  Particle = NULL;
832  } else if(EnergyGroup1 >= Branch->IncidentEnergiesCount
833  || EnergyGroup2 >= Branch->IncidentEnergiesCount
834  || EnergyGroup1 == EnergyGroup2
835  || Branch->IncidentEnergies[EnergyGroup1] == Branch->IncidentEnergies[EnergyGroup2])
836  {
837  // Set NULL if any invalid conditions exist
838  Particle = NULL;
839  } else
840  {
841  // Everything check out - proceed
842  G4Ions* FoundParticle = NULL;
843  G4double Intercept;
844  G4double Slope;
845  G4double RangeAtIncidentEnergy;
846  G4double Denominator = Branch->IncidentEnergies[EnergyGroup1] - Branch->IncidentEnergies[EnergyGroup2];
847 
848  // Calculate the lower probability bounds
849  Slope = (Branch->ProbabilityRangeBottom[EnergyGroup1] - Branch->ProbabilityRangeBottom[EnergyGroup2]) / Denominator;
850  Intercept = Branch->ProbabilityRangeBottom[EnergyGroup1] - Slope * Branch->IncidentEnergies[EnergyGroup1];
851  RangeAtIncidentEnergy = Slope * IncidentEnergy_ + Intercept;
852 
853  // Go right if the particle is below the probability bounds
854  if(RandomParticle < RangeAtIncidentEnergy)
855  {
856  FoundParticle = FindParticleBranchSearch(Branch->Left,
857  RandomParticle,
858  EnergyGroup1,
859  EnergyGroup2);
860  } else
861  {
862  // Calculate the upper probability bounds
863  Slope = (Branch->ProbabilityRangeTop[EnergyGroup1] - Branch->ProbabilityRangeTop[EnergyGroup2]) / Denominator;
864  Intercept = Branch->ProbabilityRangeTop[EnergyGroup1] - Slope * Branch->IncidentEnergies[EnergyGroup1];
865  RangeAtIncidentEnergy = Slope * IncidentEnergy_ + Intercept;
866 
867  // Go left if the particle is above the probability bounds
868  if(RandomParticle > RangeAtIncidentEnergy)
869  {
870  FoundParticle = FindParticleBranchSearch(Branch->Right,
871  RandomParticle,
872  EnergyGroup1,
873  EnergyGroup2);
874  } else
875  {
876  // If the particle is bounded then we found it!
877  FoundParticle = Branch->Particle;
878  }
879  }
880 
881  Particle = FoundParticle;
882  }
883 
885  return Particle;
886 }
#define G4FFG_RECURSIVE_FUNCTIONLEAVE__
ProbabilityBranch * Right
G4double * ProbabilityRangeBottom
G4double * ProbabilityRangeTop
Definition: G4Ions.hh:51
G4Ions * FindParticleBranchSearch(ProbabilityBranch *Branch, G4double RandomParticle, G4int EnergyGroup1, G4int EnergyGroup2)
#define G4FFG_RECURSIVE_FUNCTIONENTER__
ProbabilityBranch * Left
double G4double
Definition: G4Types.hh:76
G4Ions * G4FissionProductYieldDist::FindParticleExtrapolation ( G4double  RandomParticle,
G4bool  LowerEnergyGroupExists 
)
protected

Returns the G4Ions definitions pointer for the particle whose probability segment contains the (0, 1] random number RandomParticle by extrapolating values using the current data set. This function exists so that that different models of extrapolation may be more easily implemented in the future.

Definition at line 765 of file G4FissionProductYieldDist.cc.

References FindParticleBranchSearch(), G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, TreeCount_, Trees_, and YieldEnergyGroups_.

Referenced by FindParticle().

767 {
769 
770  G4Ions* FoundParticle = NULL;
771  G4int NearestEnergy;
772  G4int NextNearestEnergy;
773 
774  // Check to see if we are extrapolating above or below the data set
775  if(LowerEnergyGroupExists == true)
776  {
777  NearestEnergy = YieldEnergyGroups_ - 1;
778  NextNearestEnergy = NearestEnergy - 1;
779  } else
780  {
781  NearestEnergy = 0;
782  NextNearestEnergy = 1;
783  }
784 
785  for(G4int Tree = 0; Tree < TreeCount_ && FoundParticle == NULL; Tree++)
786  {
787  FoundParticle = FindParticleBranchSearch(Trees_[Tree].Trunk,
788  RandomParticle,
789  NearestEnergy,
790  NextNearestEnergy);
791  }
792 
794  return FoundParticle;
795 }
int G4int
Definition: G4Types.hh:78
Definition: G4Ions.hh:51
G4Ions * FindParticleBranchSearch(ProbabilityBranch *Branch, G4double RandomParticle, G4int EnergyGroup1, G4int EnergyGroup2)
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
G4Ions * G4FissionProductYieldDist::FindParticleInterpolation ( G4double  RandomParticle,
G4int  LowerEnergyGroup 
)
protected

Returns the G4Ions definitions pointer for the particle whose probability segment contains the (0, 1] random number RandomParticle by interpolating values in the current data set. This function exists so that that different models of interpolation may be more easily implemented in the future.

Definition at line 798 of file G4FissionProductYieldDist.cc.

References FindParticleBranchSearch(), G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, TreeCount_, and Trees_.

Referenced by FindParticle().

800 {
802 
803  G4Ions* FoundParticle = NULL;
804  G4int HigherEnergyGroup = LowerEnergyGroup + 1;
805 
806  for(G4int Tree = 0; Tree < TreeCount_ && FoundParticle == NULL; Tree++)
807  {
808  FoundParticle = FindParticleBranchSearch(Trees_[Tree].Trunk,
809  RandomParticle,
810  LowerEnergyGroup,
811  HigherEnergyGroup);
812  }
813 
815  return FoundParticle;
816 }
int G4int
Definition: G4Types.hh:78
Definition: G4Ions.hh:51
G4Ions * FindParticleBranchSearch(ProbabilityBranch *Branch, G4double RandomParticle, G4int EnergyGroup1, G4int EnergyGroup2)
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
G4DynamicParticleVector * G4FissionProductYieldDist::G4GetFission ( void  )

Generates a fission event using default sampling and returns the pointer to that fission event.

  • Usage: No arguments required
  • Notes:
    • The fission products are loaded into FissionContainer in the following order:
      • First daughter product
      • Second daughter product
      • Alpha particles
      • Neutrons
      • Gamma rays
    • The last particle will have a NULL NextFragment pointer

Definition at line 190 of file G4FissionProductYieldDist.cc.

References Cause_, CheckAlphaSanity(), G4FFGEnumerations::DAUGHTER_INFO, G4ArrayOps::DeleteVectorOfPointers(), G4cout, G4endl, G4Exception(), G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, G4FFG_LOCATION__, G4FFG_SPACING__, G4FPYSamplingOps::G4SampleGaussian(), G4FPYSamplingOps::G4SampleUniform(), G4FFGEnumerations::GAMMA_INDUCED, GenerateAlphas(), GenerateNeutrons(), G4ParticleDefinition::GetAtomicMass(), G4ParticleDefinition::GetAtomicNumber(), G4ReactionProduct::GetDefinition(), GetFissionProduct(), GetParticleDefinition(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGEncoding(), G4ParticleDefinition::GetPDGMass(), CLHEP::Hep3Vector::getX(), CLHEP::Hep3Vector::getY(), CLHEP::Hep3Vector::getZ(), G4FFGEnumerations::GROUND_STATE, IncidentEnergy_, Isotope_, JustWarning, python.hepunit::keV, CLHEP::Hep3Vector::mag(), MakeG4DynamicParticle(), python.hepunit::MeV, G4FFGEnumerations::MOMENTUM_INFO, G4FFGEnumerations::NEUTRON_INDUCED, python.hepunit::pi, G4FFGEnumerations::PROTON_INDUCED, RandomEngine_, RemainingA_, RemainingEnergy_, RemainingZ_, CLHEP::Hep3Vector::rotateUz(), SampleAlphaEnergies(), SampleGammaEnergies(), SampleNeutronEnergies(), CLHEP::Hep3Vector::set(), G4ReactionProduct::SetMomentum(), CLHEP::Hep3Vector::setR(), CLHEP::Hep3Vector::setRThetaPhi(), CLHEP::Hep3Vector::setX(), CLHEP::Hep3Vector::setY(), CLHEP::Hep3Vector::setZ(), G4FFGEnumerations::SPONTANEOUS, and Verbosity_.

Referenced by G4FissionFragmentGenerator::G4GenerateFission().

191 {
193 
194  // Check to see if the user has set the alpha production to a somewhat
195  // reasonable level
197 
198  // Generate the new G4DynamicParticle pointers to identify key locations in
199  // the G4DynamicParticle chain that will be passed to the G4FissionEvent
200  G4ReactionProduct* FirstDaughter = NULL;
201  G4ReactionProduct* SecondDaughter = NULL;
202  std::vector< G4ReactionProduct* >* Alphas = new std::vector< G4ReactionProduct* >;
203  std::vector< G4ReactionProduct* >* Neutrons = new std::vector< G4ReactionProduct* >;
204  std::vector< G4ReactionProduct* >* Gammas = new std::vector< G4ReactionProduct* >;
205 
206  // Generate all the nucleonic fission products
207  // How many nucleons do we have to work with?
208  //TK modified 131108
209  //const G4int ParentA = Isotope_ % 1000;
210  //const G4int ParentZ = (Isotope_ - ParentA) / 1000;
211  const G4int ParentA = (Isotope_/10) % 1000;
212  const G4int ParentZ = ((Isotope_/10) - ParentA) / 1000;
213  RemainingA_ = ParentA;
214  RemainingZ_ = ParentZ;
215 
216  // Don't forget the extra nucleons depending on the fission cause
217  switch(Cause_)
218  {
220  ++RemainingA_;
221  break;
222 
224  ++RemainingZ_;
225  break;
226 
229  default:
230  // Nothing to do here
231  break;
232  }
233 
234  // Ternary fission can be set by the user. Thus, it is necessary to
235  // sample the alpha particle first and the first daughter product
236  // second. See the discussion in
237  // G4FissionProductYieldDist::G4GetFissionProduct() for more information
238  // as to why the fission events are sampled this way.
239  GenerateAlphas(Alphas);
240 
241  // Generate the first daughter product
242  FirstDaughter = new G4ReactionProduct(GetFissionProduct());
243  RemainingA_ -= FirstDaughter->GetDefinition()->GetAtomicMass();
244  RemainingZ_ -= FirstDaughter->GetDefinition()->GetAtomicNumber();
246  {
249 
250  G4cout << " -- First daughter product sampled" << G4endl;
252  G4cout << " Name: " << FirstDaughter->GetDefinition()->GetParticleName() << G4endl;
254  G4cout << " Z: " << FirstDaughter->GetDefinition()->GetAtomicNumber() << G4endl;
256  G4cout << " A: " << FirstDaughter->GetDefinition()->GetAtomicMass() << G4endl;
258  G4cout << " Meta State: " << (FirstDaughter->GetDefinition()->GetPDGEncoding() % 10) << G4endl;
259  }
260 
261  GenerateNeutrons(Neutrons);
262 
263  // Now that all the nucleonic particles have been generated, we can
264  // calculate the composition of the second daughter product.
265  G4int NewIsotope = RemainingZ_ * 1000 + RemainingA_;
267  if(Verbosity_ & G4FFGEnumerations::DAUGHTER_INFO)
268  {
271 
272  G4cout << " -- Second daughter product sampled" << G4endl;
274  G4cout << " Name: " << SecondDaughter->GetDefinition()->GetParticleName() << G4endl;
276  G4cout << " Z: " << SecondDaughter->GetDefinition()->GetAtomicNumber() << G4endl;
278  G4cout << " A: " << SecondDaughter->GetDefinition()->GetAtomicMass() << G4endl;
280  G4cout << " Meta State: " << (SecondDaughter->GetDefinition()->GetPDGEncoding() % 10) << G4endl;
281  }
282 
283  // Calculate how much kinetic energy will be available
284  // 195 to 205 MeV are available in a fission reaction, but about 20 MeV
285  // are from delayed sources. We are concerned only with prompt sources,
286  // so sample a Gaussian distribution about 20 MeV and subtract the
287  // result from the total available energy. Also, the energy of fission
288  // neutrinos is neglected. Fission neutrinos would add ~11 MeV
289  // additional energy to the fission. (Ref 2)
290  // Finally, add in the kinetic energy contribution of the fission
291  // inducing particle, if any.
292  const G4double TotalKE = RandomEngine_->G4SampleUniform(195.0, 205.0) * MeV
293  - RandomEngine_->G4SampleGaussian(20.0, 3.0) * MeV
294  + IncidentEnergy_;
295  RemainingEnergy_ = TotalKE;
296 
297  // Calculate the energies of the alpha particles and neutrons
298  // Once again, since the alpha particles are user defined, we must
299  // sample their kinetic energy first. SampleAlphaEnergies() returns the
300  // amount of energy consumed by the alpha particles, so remove the total
301  // energy alloted to the alpha particles from the available energy
302  SampleAlphaEnergies(Alphas);
303 
304  // Second, the neutrons are sampled from the Watt fission spectrum.
305  SampleNeutronEnergies(Neutrons);
306 
307  // Calculate the total energy available to the daughter products
308  // A Gaussian distribution about the average calculated energy with
309  // a standard deviation of 1.5 MeV (Ref. 2) is used. Since the energy
310  // distribution is dependant on the alpha particle generation and the
311  // Watt fission sampling for neutrons, we only have the left-over energy
312  // to work with for the fission daughter products.
313  G4double FragmentsKE;
314  do
315  {
316  FragmentsKE = RandomEngine_->G4SampleGaussian(RemainingEnergy_, 1.5 *MeV);
317  } while(FragmentsKE > RemainingEnergy_);
318 
319  // Make sure that we don't produce any sub-gamma photons
320  if((RemainingEnergy_ - FragmentsKE) / (100 * keV) < 1.0)
321  {
322  FragmentsKE = RemainingEnergy_;
323  }
324 
325  // This energy has now been allotted to the fission fragments.
326  // Subtract FragmentsKE from the total available fission energy.
327  RemainingEnergy_ -= FragmentsKE;
328 
329  // Sample the energies of the gamma rays
330  // Assign the remainder, if any, of the energy to the gamma rays
331  SampleGammaEnergies(Gammas);
332 
333  // Prepare to balance the momenta of the system
334  // We will need these for sampling the angles and balancing the momenta
335  // of all the fission products
336  G4double NumeratorSqrt, NumeratorOther, Denominator;
337  G4double Theta, Phi, Magnitude;
338  G4ThreeVector Direction;
339  G4ParticleMomentum ResultantVector(0, 0, 0);
340 
341  if(Alphas->size() > 0)
342  {
343  // Sample the angles of the alpha particles and neutrons, then calculate
344  // the total moment contribution to the system
345  // The average angle of the alpha particles with respect to the
346  // light fragment is dependent on the ratio of the kinetic energies.
347  // This equation was determined by performing a fit on data from
348  // Ref. 3 using the website:
349  // http://soft.arquimedex.com/linear_regression.php
350  //
351  // RatioOfKE Angle (rad) Angle (degrees)
352  // 1.05 1.257 72
353  // 1.155 1.361 78
354  // 1.28 1.414 81
355  // 1.5 1.518 87
356  // 1.75 1.606 92
357  // 1.9 1.623 93
358  // 2.2 1.728 99
359  // This equation generates the angle in radians. If the RatioOfKE is
360  // greater than 2.25 the angle defaults to 1.3963 rad (100 degrees)
361  G4double MassRatio = FirstDaughter->GetDefinition()->GetPDGMass() / SecondDaughter->GetDefinition()->GetPDGMass();
362 
363  // Invert the mass ratio if the first daughter product is the lighter fragment
364  if(MassRatio < 1)
365  {
366  MassRatio = 1 / MassRatio;
367  }
368 
369  // The empirical equation is valid for mass ratios up to 2.75
370  if(MassRatio > 2.75)
371  {
372  MassRatio = 2.75;
373  }
374  const G4double MeanAlphaAngle = 0.3644 * MassRatio * MassRatio * MassRatio
375  - 1.9766 * MassRatio * MassRatio
376  + 3.8207 * MassRatio
377  - 0.9917;
378 
379  // Sample the directions of the alpha particles with respect to the
380  // light fragment. For the moment we will assume that the light
381  // fragment is traveling along the z-axis in the positive direction.
382  const G4double MeanAlphaAngleStdDev = 0.0523598776;
383  G4double PlusMinus;
384 
385  for(unsigned int i = 0; i < Alphas->size(); ++i)
386  {
387  PlusMinus = std::acos(RandomEngine_->G4SampleGaussian(0, MeanAlphaAngleStdDev)) - (pi / 2);
388  Theta = MeanAlphaAngle + PlusMinus;
389  if(Theta < 0)
390  {
391  Theta = 0.0 - Theta;
392  } else if(Theta > pi)
393  {
394  Theta = (2 * pi - Theta);
395  }
397 
398  Direction.setRThetaPhi(1.0, Theta, Phi);
399  Magnitude = std::sqrt(2 * Alphas->at(i)->GetKineticEnergy() * Alphas->at(i)->GetDefinition()->GetPDGMass());
400  Alphas->at(i)->SetMomentum(Direction * Magnitude);
401  ResultantVector += Alphas->at(i)->GetMomentum();
402  }
403  }
404 
405  // Sample the directions of the neutrons.
406  if(Neutrons->size() != 0)
407  {
408  for(unsigned int i = 0; i < Neutrons->size(); ++i)
409  {
410  Theta = std::acos(RandomEngine_->G4SampleUniform(-1, 1));
412 
413  Direction.setRThetaPhi(1.0, Theta, Phi);
414  Magnitude = std::sqrt(2 * Neutrons->at(i)->GetKineticEnergy() * Neutrons->at(i)->GetDefinition()->GetPDGMass());
415  Neutrons->at(i)->SetMomentum(Direction * Magnitude);
416  ResultantVector += Neutrons->at(i)->GetMomentum();
417  }
418  }
419 
420  // Sample the directions of the gamma rays
421  if(Gammas->size() != 0)
422  {
423  for(unsigned int i = 0; i < Gammas->size(); ++i)
424  {
425  Theta = std::acos(RandomEngine_->G4SampleUniform(-1, 1));
427 
428  Direction.setRThetaPhi(1.0, Theta, Phi);
429  Magnitude = Gammas->at(i)->GetKineticEnergy() / CLHEP::c_light;
430  Gammas->at(i)->SetMomentum(Direction * Magnitude);
431  ResultantVector += Gammas->at(i)->GetMomentum();
432  }
433  }
434 
435  // Calculate the momenta of the two daughter products
436  G4ReactionProduct* LightFragment;
437  G4ReactionProduct* HeavyFragment;
438  G4ThreeVector LightFragmentDirection;
439  G4ThreeVector HeavyFragmentDirection;
440  G4double ResultantX, ResultantY, ResultantZ;
441  ResultantX = ResultantVector.getX();
442  ResultantY = ResultantVector.getY();
443  ResultantZ = ResultantVector.getZ();
444 
445  if(FirstDaughter->GetDefinition()->GetPDGMass() < SecondDaughter->GetDefinition()->GetPDGMass())
446  {
447  LightFragment = FirstDaughter;
448  HeavyFragment = SecondDaughter;
449  } else
450  {
451  LightFragment = SecondDaughter;
452  HeavyFragment = FirstDaughter;
453  }
454  const G4double LightFragmentMass = LightFragment->GetDefinition()->GetPDGMass();
455  const G4double HeavyFragmentMass = HeavyFragment->GetDefinition()->GetPDGMass();
456 
457  LightFragmentDirection.setRThetaPhi(1.0, 0, 0);
458 
459  // Fit the momenta of the daughter products to the resultant vector of
460  // the remaining fission products. This will be done in the Cartesian
461  // coordinate system, not spherical. This is done using the following
462  // table listing the system momenta and the corresponding equations:
463  // X Y Z
464  //
465  // A 0 0 P
466  //
467  // B -R_x -R_y -P - R_z
468  //
469  // R R_x R_y R_z
470  //
471  // v = sqrt(2*m*k) -> k = v^2/(2*m)
472  // tk = k_A + k_B
473  // k_L = P^2/(2*m_L)
474  // k_H = ((-R_x)^2 + (-R_y)^2 + (-P - R_z)^2)/(2*m_H)
475  // where:
476  // P: momentum of the light daughter product
477  // R: the remaining fission products' resultant vector
478  // v: momentum
479  // m: mass
480  // k: kinetic energy
481  // tk: total kinetic energy available to the daughter products
482  //
483  // Below is the solved form for P, with the solution generated using
484  // the WolframAlpha website:
485  // http://www.wolframalpha.com/input/?i=
486  // solve+((-x)^2+%2B+(-y)^2+%2B+(-P-z)^2)%2F(2*B)+%2B+L^2%2F(2*A)+%3D+k+
487  // for+P
488  //
489  //
490  // nsqrt = sqrt(m_L*(m_L*(2*m_H*tk - R_x^2 - R_y^2) +
491  // m_H*(2*m_H*tk - R_x^2 - R_y^2 - R_z^2))
492  NumeratorSqrt = std::sqrt(LightFragmentMass *
493  (LightFragmentMass * (2 * HeavyFragmentMass * FragmentsKE
494  - ResultantX * ResultantX
495  - ResultantY * ResultantY)
496  + HeavyFragmentMass * (2 * HeavyFragmentMass * FragmentsKE
497  - ResultantX * ResultantX
498  - ResultantY * ResultantY
499  - ResultantZ - ResultantZ)));
500 
501  // nother = m_L*R_z
502  NumeratorOther = LightFragmentMass * ResultantZ;
503 
504  // denom = m_L + m_H
505  Denominator = LightFragmentMass + HeavyFragmentMass;
506 
507  // P = (nsqrt + nother) / denom
508  const G4double LightFragmentMomentum = (NumeratorSqrt + NumeratorOther) / Denominator;
509  const G4double HeavyFragmentMomentum = std::sqrt(ResultantX * ResultantX
510  + ResultantY * ResultantY
511  + std::pow(LightFragmentMomentum + ResultantZ, 2));
512 
513  // Finally! We now have everything we need for the daughter products
514  LightFragment->SetMomentum(LightFragmentDirection * LightFragmentMomentum);
515  HeavyFragmentDirection.setX(-ResultantX);
516  HeavyFragmentDirection.setY(-ResultantY);
517  HeavyFragmentDirection.setZ((-LightFragmentMomentum - ResultantZ));
518  // Don't forget to normalize the vector to the unit sphere
519  HeavyFragmentDirection.setR(1.0);
520  HeavyFragment->SetMomentum(HeavyFragmentDirection * HeavyFragmentMomentum);
521 
522  if(Verbosity_ & (G4FFGEnumerations::DAUGHTER_INFO | G4FFGEnumerations::MOMENTUM_INFO))
523  {
526 
527  G4cout << " -- Daugher product momenta finalized" << G4endl;
529  }
530 
531  // Load all the particles into a contiguous set
532  //TK modifed 131108
533  //G4DynamicParticleVector* FissionProducts = new G4DynamicParticleVector(2 + Alphas->size() + Neutrons->size() + Gammas->size());
534  G4DynamicParticleVector* FissionProducts = new G4DynamicParticleVector();
535  // Load the fission fragments
536  FissionProducts->push_back(MakeG4DynamicParticle(LightFragment));
537  FissionProducts->push_back(MakeG4DynamicParticle(HeavyFragment));
538  // Load the neutrons
539  for(unsigned int i = 0; i < Neutrons->size(); i++)
540  {
541  FissionProducts->push_back(MakeG4DynamicParticle(Neutrons->at(i)));
542  }
543  // Load the gammas
544  for(unsigned int i = 0; i < Gammas->size(); i++)
545  {
546  FissionProducts->push_back(MakeG4DynamicParticle(Gammas->at(i)));
547  }
548  // Load the alphas
549  for(unsigned int i = 0; i < Alphas->size(); i++)
550  {
551  FissionProducts->push_back(MakeG4DynamicParticle(Alphas->at(i)));
552  }
553 
554  // Rotate the system to a random location so that the light fission fragment
555  // is not always traveling along the positive z-axis
556  // Sample Theta and Phi.
557  G4ThreeVector RotationAxis;
558 
559  Theta = std::acos(RandomEngine_->G4SampleUniform(-1, 1));
561  RotationAxis.setRThetaPhi(1.0, Theta, Phi);
562 
563  // We will also check the net momenta
564  ResultantVector.set(0.0, 0.0, 0.0);
565  for(unsigned int i = 0; i < FissionProducts->size(); i++)
566  {
567  Direction = FissionProducts->at(i)->GetMomentumDirection();
568  Direction.rotateUz(RotationAxis);
569  FissionProducts->at(i)->SetMomentumDirection(Direction);
570  ResultantVector += FissionProducts->at(i)->GetMomentum();
571  }
572 
573  // Warn if the sum momenta of the system is not within a reasonable
574  // tolerance
575  G4double PossibleImbalance = ResultantVector.mag();
576  if(PossibleImbalance > 0.01)
577  {
578  std::ostringstream Temp;
579  Temp << "Momenta imbalance of ";
580  Temp << PossibleImbalance / (MeV / CLHEP::c_light);
581  Temp << " MeV/c in the system";
582  G4Exception("G4FissionProductYieldDist::G4GetFission()",
583  Temp.str().c_str(),
584  JustWarning,
585  "Results may not be valid");
586  }
587 
588  // Clean up
589  delete FirstDaughter;
590  delete SecondDaughter;
594 
596  return FissionProducts;
597 }
G4double G4SampleGaussian(G4double Mean, G4double StdDev)
G4double G4SampleUniform(void)
void SetMomentum(const G4double x, const G4double y, const G4double z)
#define G4FFG_LOCATION__
void setR(double s)
int G4int
Definition: G4Types.hh:78
void setY(double)
const G4String & GetParticleName() const
void setZ(double)
void setX(double)
G4int GetAtomicNumber() const
G4ParticleDefinition * GetDefinition() const
double getX() const
virtual void GenerateNeutrons(std::vector< G4ReactionProduct * > *Neutrons)
virtual void GenerateAlphas(std::vector< G4ReactionProduct * > *Alphas)
G4DynamicParticle * MakeG4DynamicParticle(G4ReactionProduct *)
void SampleAlphaEnergies(std::vector< G4ReactionProduct * > *Alphas)
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
Definition: ThreeVector.cc:72
std::vector< G4DynamicParticle * > G4DynamicParticleVector
G4Ions * GetParticleDefinition(G4int Product, G4FFGEnumerations::MetaState MetaState)
void DeleteVectorOfPointers(std::vector< T > &Vector)
Definition: G4ArrayOps.hh:216
void setRThetaPhi(double r, double theta, double phi)
G4int GetAtomicMass() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4double GetPDGMass() const
void SampleGammaEnergies(std::vector< G4ReactionProduct * > *Gammas)
const G4FFGEnumerations::FissionCause Cause_
#define G4FFG_FUNCTIONLEAVE__
#define G4endl
Definition: G4ios.hh:61
#define G4FFG_SPACING__
void SampleNeutronEnergies(std::vector< G4ReactionProduct * > *Neutrons)
double G4double
Definition: G4Types.hh:76
virtual G4Ions * GetFissionProduct(void)=0
double mag() const
#define G4FFG_FUNCTIONENTER__
G4Ions * G4FissionProductYieldDist::G4GetFissionProduct ( void  )

Selects a fission fragment at random from the probability tree and returns the G4Ions pointer.

  • Usage: No arguments required
  • Notes:

Definition at line 600 of file G4FissionProductYieldDist.cc.

References FindParticle(), G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, G4FPYSamplingOps::G4SampleUniform(), and RandomEngine_.

Referenced by G4FissionFragmentGenerator::G4GenerateFissionProduct().

601 {
603 
605 
607  return Product;
608 }
G4double G4SampleUniform(void)
G4Ions * FindParticle(G4double RandomParticle)
Definition: G4Ions.hh:51
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
void G4FissionProductYieldDist::G4SetAlphaProduction ( G4double  WhatAlphaProduction)

Set the alpha production behavior for fission event generation.

  • Usage:
    • if AlphaProduction is negative then alpha particles are sampled randomly.
  • Notes:
    • The maximum number of alpha particles that may be created is physically limited by the nucleons present in the parent nucleus. Setting the AlphaProduction too high will have unpredictable results on the sampling of the fission products.

Definition at line 611 of file G4FissionProductYieldDist.cc.

References AlphaProduction_, G4FFG_FUNCTIONENTER__, and G4FFG_FUNCTIONLEAVE__.

Referenced by G4FissionFragmentGenerator::G4SetAlphaProduction(), and G4FissionFragmentGenerator::InitializeFissionProductYieldClass().

612 {
614 
615  AlphaProduction_ = WhatAlphaProduction;
616 
618 }
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
void G4FissionProductYieldDist::G4SetEnergy ( G4double  WhatIncidentEnergy)

Sets the energy of the incident particle

  • Usage:
    • WhatIncidentEnergy: Kinetic energy, if any, of the incident neutron in GeV
  • Notes:

Definition at line 621 of file G4FissionProductYieldDist.cc.

References Cause_, G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, python.hepunit::GeV, and G4FFGEnumerations::SPONTANEOUS.

Referenced by G4FissionFragmentGenerator::G4SetIncidentEnergy().

622 {
624 
626  {
627  IncidentEnergy_ = WhatIncidentEnergy;
628  } else
629  {
630  IncidentEnergy_ = 0 * GeV;
631  }
632 
634 }
const G4FFGEnumerations::FissionCause Cause_
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
void G4FissionProductYieldDist::G4SetTernaryProbability ( G4double  TernaryProbability)

Sets the probability of ternary fission

  • Usage:
    • WhatTernaryProbability: Probability of generating a ternary fission event.
  • Notes:

Definition at line 637 of file G4FissionProductYieldDist.cc.

References G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, and TernaryProbability_.

Referenced by G4FissionFragmentGenerator::G4SetTernaryProbability(), and G4FissionFragmentGenerator::InitializeFissionProductYieldClass().

638 {
640 
641  TernaryProbability_ = WhatTernaryProbability;
642 
644 }
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
void G4FissionProductYieldDist::G4SetVerbosity ( G4int  WhatVerbosity)

Sets the verbosity levels

  • Usage:
    • WhichVerbosity: Combination of levels
  • Notes:
    • SILENT: All verbose output is repressed
    • UPDATES: Only high-level internal changes are reported
    • DAUGHTER_INFO: Displays information about daughter product sampling
    • NEUTRON_INFO: Displays information about neutron sampling
    • GAMMA_INFO: Displays information about gamma sampling
    • ALPHA_INFO: Displays information about alpha sampling
    • MOMENTUM_INFO: Displays information about momentum balancing
    • EXTRAPOLATION_INTERPOLATION_INFO: Displays information about any data extrapolation or interpolation that occurs
    • DEBUG: Reports program flow as it steps through functions
    • PRINT_ALL: Displays any and all output

Definition at line 647 of file G4FissionProductYieldDist.cc.

References ENDFData_, G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, G4ENDFTapeRead::G4SetVerbosity(), G4FPYSamplingOps::G4SetVerbosity(), RandomEngine_, and Verbosity_.

Referenced by G4FissionFragmentGenerator::G4SetVerbosity().

648 {
650 
652 
653  ENDFData_->G4SetVerbosity(Verbosity_);
654  RandomEngine_->G4SetVerbosity(Verbosity_);
655 
657 }
void G4SetVerbosity(G4int WhatVerbosity)
#define G4FFG_FUNCTIONLEAVE__
void G4SetVerbosity(G4int WhatVerbosity)
#define G4FFG_FUNCTIONENTER__
void G4FissionProductYieldDist::GenerateAlphas ( std::vector< G4ReactionProduct * > *  Alphas)
protectedvirtual

Generates a G4DynamicParticleVector with the fission alphas

Definition at line 889 of file G4FissionProductYieldDist.cc.

References AlphaDefinition_, AlphaProduction_, G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, G4FPYSamplingOps::G4SampleIntegerGaussian(), G4FPYSamplingOps::G4SampleUniform(), G4FFGEnumerations::POSITIVE, RandomEngine_, RemainingA_, RemainingZ_, and TernaryProbability_.

Referenced by G4GetFission().

890 {
892 
893  // Throw the dice to determine if ternary fission occurs
895  if(MakeAlphas)
896  {
897  G4int NumberOfAlphasToProduce;
898 
899  // Determine how many alpha particles to produce for the ternary fission
900  if(AlphaProduction_ < 0)
901  {
902  NumberOfAlphasToProduce = RandomEngine_->G4SampleIntegerGaussian(AlphaProduction_ * -1,
903  1,
905  } else
906  {
907  NumberOfAlphasToProduce = (G4int)AlphaProduction_;
908  }
909 
910  //TK modifed 131108
911  //Alphas->resize(NumberOfAlphasToProduce);
912  for(int i = 0; i < NumberOfAlphasToProduce; i++)
913  {
914  // Set the G4Ions as an alpha particle
915  Alphas->push_back(new G4ReactionProduct(AlphaDefinition_));
916 
917  // Remove 4 nucleons (2 protons and 2 neutrons) for each alpha added
918  RemainingZ_ -= 2;
919  RemainingA_ -= 4;
920  }
921  }
922 
924 }
G4double G4SampleUniform(void)
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
G4int G4SampleIntegerGaussian(G4double Mean, G4double StdDev)
void G4FissionProductYieldDist::GenerateNeutrons ( std::vector< G4ReactionProduct * > *  Neutrons)
protectedvirtual

Generate a linked chain of neutrons and return the pointer to the last neutron in the chain.

Definition at line 927 of file G4FissionProductYieldDist.cc.

References G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, G4FPYSamplingOps::G4SampleIntegerGaussian(), NeutronDefinition_, Nubar_, NubarWidth_, G4FFGEnumerations::POSITIVE, RandomEngine_, and RemainingA_.

Referenced by G4GetFission().

928 {
930 
931  G4int NeutronProduction;
933 
934  //TK modifed 131108
935  //Neutrons->resize(NeutronProduction);
936  for(int i = 0; i < NeutronProduction; i++)
937  {
938  // Define the fragment as a neutron
939  Neutrons->push_back(new G4ReactionProduct(NeutronDefinition_));
940 
941  // Remove 1 nucleon for each neutron added
942  RemainingA_--;
943  }
944 
946 }
int G4int
Definition: G4Types.hh:78
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
G4int G4SampleIntegerGaussian(G4double Mean, G4double StdDev)
virtual G4Ions* G4FissionProductYieldDist::GetFissionProduct ( void  )
protectedpure virtual

Selects a fission product from the probability tree, limited by the number of nucleons available to the system

Implemented in G4FPYBiasedLightFragmentDist, and G4FPYNormalFragmentDist.

Referenced by G4GetFission().

G4Ions * G4FissionProductYieldDist::GetParticleDefinition ( G4int  Product,
G4FFGEnumerations::MetaState  MetaState 
)
protected

Returns the G4Ions definition pointer to the isotope defined by Product and MetaState. Searches the ParticleTable for the particle defined by Product (ZZZAAA) and MetaState and returns the G4Ions pointer to that particle. If the particle does not exist then it is created in G4ParticleTable and the pointer to the new particle is returned.

Definition at line 949 of file G4FissionProductYieldDist.cc.

References G4FFG_DATA_FUNCTIONENTER__, G4FFG_DATA_FUNCTIONLEAVE__, G4IonTable::GetIon(), and IonTable_.

Referenced by G4GetFission(), and SortProbability().

953 {
955 
956  G4Ions* Temp;
957 
958  // Break Product down into its A and Z components
959  G4int A = Product % 1000; // Extract A
960  G4int Z = (Product - A) / 1000; // Extract Z
961 
962  // Check to see if the particle is registered using the PDG code
963  // TODO Add metastable state when supported by G4IonTable::GetIon()
964  Temp = reinterpret_cast<G4Ions*>(IonTable_->GetIon(Z, A));
965 
966  // Removed in favor of the G4IonTable::GetIon() method
967 // // Register the particle if it does not exist
968 // if(Temp == NULL)
969 // {
970 // // Define the particle properties
971 // G4String Name = MakeIsotopeName(Product, MetaState);
972 // // Calculate the rest mass using a function already in Geant4
973 // G4double Mass = G4NucleiProperties::
974 // GetNuclearMass((double)A, (double)Z );
975 // G4double Charge = Z*eplus;
976 // G4int BaryonNum = A;
977 // G4bool Stable = TRUE;
978 //
979 // // I am unsure about the following properties:
980 // // 2*Spin, Parity, C-conjugation, 2*Isospin, 2*Isospin3, G-parity.
981 // // Perhaps is would be a good idea to have a physicist familiar with
982 // // Geant4 nomenclature to review and correct these properties.
983 // Temp = new G4Ions (
984 // // Name Mass Width Charge
985 // Name, Mass, 0.0, Charge,
986 //
987 // // 2*Spin Parity C-conjugation 2*Isospin
988 // 0, 1, 0, 0,
989 //
990 // // 2*Isospin3 G-parity Type Lepton number
991 // 0, 0, "nucleus", 0,
992 //
993 // // Baryon number PDG encoding Stable Lifetime
994 // BaryonNum, PDGCode, Stable, -1,
995 //
996 // // Decay table Shortlived SubType Anti_encoding
997 // NULL, FALSE, "generic", 0,
998 //
999 // // Excitation
1000 // 0.0);
1001 // Temp->SetPDGMagneticMoment(0.0);
1002 //
1003 // // Declare that there is no anti-particle
1004 // Temp->SetAntiPDGEncoding(0);
1005 //
1006 // // Define the processes to use in transporting the particles
1007 // std::ostringstream osAdd;
1008 // osAdd << "/run/particle/addProcManager " << Name;
1009 // G4String cmdAdd = osAdd.str();
1010 //
1011 // // set /control/verbose 0
1012 // G4int tempVerboseLevel = G4UImanager::GetUIpointer()->GetVerboseLevel();
1013 // G4UImanager::GetUIpointer()->SetVerboseLevel(0);
1014 //
1015 // // issue /run/particle/addProcManage
1016 // G4UImanager::GetUIpointer()->ApplyCommand(cmdAdd);
1017 //
1018 // // retreive /control/verbose
1019 // G4UImanager::GetUIpointer()->SetVerboseLevel(tempVerboseLevel);
1020 // }
1021 
1023  return Temp;
1024 }
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:449
#define G4FFG_DATA_FUNCTIONENTER__
int G4int
Definition: G4Types.hh:78
Definition: G4Ions.hh:51
#define G4FFG_DATA_FUNCTIONLEAVE__
G4String G4FissionProductYieldDist::MakeDirectoryName ( void  )
protected

Generates the directory location for the data file referenced by G4FissionProductYieldDist

Definition at line 1027 of file G4FissionProductYieldDist.cc.

References G4FFG_FUNCTIONENTER__, and G4FFG_FUNCTIONLEAVE__.

1028 {
1030 
1031  // Generate the file location starting in the Geant4 data directory
1032  std::ostringstream DirectoryName;
1033  DirectoryName << getenv("G4NEUTRONHPDATA") << G4FFGDefaultValues::ENDFFissionDataLocation;
1034 
1035  // Return the directory structure
1037  return DirectoryName.str();
1038 }
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
G4String G4FissionProductYieldDist::MakeFileName ( G4int  Isotope,
G4FFGEnumerations::MetaState  MetaState 
)
protected

Generates the appropriate file name for the isotope requested

Definition at line 1041 of file G4FissionProductYieldDist.cc.

References G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, and MakeIsotopeName().

1043 {
1045 
1046 
1047  // Create the unique identifying name for the particle
1048  std::ostringstream FileName;
1049 
1050  // Determine if a leading 0 is needed (ZZZAAA or 0ZZAAA)
1051  if(Isotope < 100000)
1052  {
1053  FileName << "0";
1054  }
1055 
1056  // Add the name of the element and the extension
1057  FileName << MakeIsotopeName(Isotope, MetaState) << ".fpy";
1058 
1060  return FileName.str();
1061 }
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
G4String MakeIsotopeName(G4int Isotope, G4FFGEnumerations::MetaState MetaState)
G4DynamicParticle * G4FissionProductYieldDist::MakeG4DynamicParticle ( G4ReactionProduct ReactionProduct)
protected

Creates a G4DynamicParticle from an existing G4ReactionProduct

Definition at line 1064 of file G4FissionProductYieldDist.cc.

References G4FFG_DATA_FUNCTIONENTER__, G4FFG_DATA_FUNCTIONLEAVE__, G4ReactionProduct::GetDefinition(), and G4ReactionProduct::GetMomentum().

Referenced by G4GetFission().

1065 {
1067 
1068  G4DynamicParticle* DynamicParticle = new G4DynamicParticle(ReactionProduct->GetDefinition(), ReactionProduct->GetMomentum());
1069 
1071  return DynamicParticle;
1072 }
#define G4FFG_DATA_FUNCTIONENTER__
G4ParticleDefinition * GetDefinition() const
#define G4FFG_DATA_FUNCTIONLEAVE__
G4ThreeVector GetMomentum() const
G4String G4FissionProductYieldDist::MakeIsotopeName ( G4int  Isotope,
G4FFGEnumerations::MetaState  MetaState 
)
protected

Generates the unique name for an isotope/isomer defined by Isotope\ and MetaState in the following format: ZZZ_AAAmX_NAME

Definition at line 1075 of file G4FissionProductYieldDist.cc.

References ElementNames_, G4FFG_DATA_FUNCTIONENTER__, G4FFG_DATA_FUNCTIONLEAVE__, G4FFGEnumerations::GROUND_STATE, G4FFGEnumerations::META_2, and G4NeutronHPNames::theString.

Referenced by MakeFileName().

1077 {
1079 
1080  // Break Product down into its A and Z components
1081  G4int A = Isotope % 1000;
1082  G4int Z = (Isotope - A) / 1000;
1083 
1084  // Create the unique identifying name for the particle
1085  std::ostringstream IsotopeName;
1086 
1087  IsotopeName << Z << "_" << A;
1088 
1089  // If it is metastable then append "m" to the name
1091  {
1092  IsotopeName << "m";
1093 
1094  // If it is a second isomeric state then append "2" to the name
1096  {
1097  IsotopeName << "2";
1098  }
1099  }
1100  // Add the name of the element and the extension
1101  IsotopeName << "_" << ElementNames_->theString[Z - 1];
1102 
1104  return IsotopeName.str();
1105 }
#define G4FFG_DATA_FUNCTIONENTER__
int G4int
Definition: G4Types.hh:78
#define G4FFG_DATA_FUNCTIONLEAVE__
static const G4String theString[100]
void G4FissionProductYieldDist::MakeTrees ( void  )
protectedvirtual

Dynamically allocates and initializes the 'field' of 'trees' with the 'trunks'

Definition at line 1108 of file G4FissionProductYieldDist.cc.

References ProbabilityTree::BranchCount, ENDFData_, FALSE, G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, G4ENDFTapeRead::G4GetNumberOfFissionProducts(), ProbabilityTree::IsEnd, ProbabilityTree::ProbabilityRangeEnd, TreeCount_, Trees_, TRUE, ProbabilityTree::Trunk, and YieldEnergyGroups_.

1109 {
1111 
1112  // Allocate the space
1113  // We will make each tree a binary search
1114  // The maximum number of iterations required to find a single fission product
1115  // based on it's probability is defined by the following:
1116  // x = number of fission products
1117  // Trees = T(x) = ceil( ln(x) )
1118  // Rows/Tree = R(x) = ceil(( sqrt( (8 * x / T(x)) + 1) - 1) / 2)
1119  // Maximum = M(x) = T(x) + R(x)
1120  // Results: x => M(x)
1121  // 10 5
1122  // 100 10
1123  // 1000 25
1124  // 10000 54
1125  // 100000 140
1128 
1129  // Initialize the range of each node
1130  for(G4int i = 0; i < TreeCount_; i++)
1131  {
1133  Trees_[i].Trunk = NULL;
1134  Trees_[i].BranchCount = 0;
1135  Trees_[i].IsEnd = FALSE;
1136  }
1137  // Mark the last tree as the ending tree
1138  Trees_[TreeCount_ - 1].IsEnd = TRUE;
1139 
1141 }
G4double * ProbabilityRangeEnd
int G4int
Definition: G4Types.hh:78
#define FALSE
Definition: globals.hh:52
#define TRUE
Definition: globals.hh:55
ProbabilityBranch * Trunk
#define G4FFG_FUNCTIONLEAVE__
G4int G4GetNumberOfFissionProducts(void)
double G4double
Definition: G4Types.hh:76
#define G4FFG_FUNCTIONENTER__
void G4FissionProductYieldDist::ReadProbabilities ( void  )
protectedvirtual

Reads in the probability data from the data file

Definition at line 1144 of file G4FissionProductYieldDist.cc.

References BranchCount_, G4ArrayOps::Copy(), DataTotal_, G4ArrayOps::Divide(), ENDFData_, G4FFG_DATA_FUNCTIONENTER__, G4FFG_DATA_FUNCTIONLEAVE__, G4ENDFTapeRead::G4GetNumberOfFissionProducts(), G4ENDFTapeRead::G4GetYield(), MaintainNormalizedData_, Renormalize(), G4ArrayOps::Set(), SortProbability(), TreeCount_, Trees_, and YieldEnergyGroups_.

1145 {
1147 
1148  G4int ProductCount = ENDFData_->G4GetNumberOfFissionProducts();
1149  BranchCount_ = 0;
1151 
1152  // Loop through all the products
1153  for(G4int i = 0; i < ProductCount; i++)
1154  {
1155  // Acquire the data and sort it
1157  }
1158 
1159  // Generate the true normalization factor, since round-off errors may result
1160  // in non-singular normalization of the data files. Also, reset DataTotal_
1161  // since it is used by Renormalize() to set the probability segments.
1164 
1165  // Go through all the trees one at a time
1166  for(G4int i = 0; i < TreeCount_; i++)
1167  {
1168  Renormalize(Trees_[i].Trunk);
1169  // Set the max range of the tree to DataTotal
1170  G4ArrayOps::Copy(YieldEnergyGroups_, Trees_[i].ProbabilityRangeEnd, DataTotal_);
1171  }
1172 
1174 }
G4ENDFYieldDataContainer * G4GetYield(G4int WhichYield)
void Copy(G4int Elements, T *To, T *From)
Definition: G4ArrayOps.hh:63
void Divide(G4int Elements, T *To, T *Numerator, T *Denominator=NULL)
Definition: G4ArrayOps.hh:178
#define G4FFG_DATA_FUNCTIONENTER__
virtual void SortProbability(G4ENDFYieldDataContainer *YieldData)
int G4int
Definition: G4Types.hh:78
#define G4FFG_DATA_FUNCTIONLEAVE__
void Renormalize(ProbabilityBranch *Branch)
void Set(G4int Elements, T *To, T Value)
Definition: G4ArrayOps.hh:51
G4int G4GetNumberOfFissionProducts(void)
void G4FissionProductYieldDist::Renormalize ( ProbabilityBranch Branch)
protected

Renormalizes the data in a ProbabilityTree. Traverses the tree structure and renormalizes all the probability data into probability segments, ensuring that no segment overlaps the other.

Definition at line 1177 of file G4FissionProductYieldDist.cc.

References G4ArrayOps::Add(), G4ArrayOps::Copy(), DataTotal_, G4FFG_RECURSIVE_FUNCTIONENTER__, G4FFG_RECURSIVE_FUNCTIONLEAVE__, ProbabilityBranch::Left, MaintainNormalizedData_, G4ArrayOps::Multiply(), ProbabilityBranch::ProbabilityRangeBottom, ProbabilityBranch::ProbabilityRangeTop, ProbabilityBranch::Right, and YieldEnergyGroups_.

Referenced by ReadProbabilities().

1178 {
1180 
1181  // Check to see if Branch exists. Branch will be a null pointer if it
1182  // doesn't exist
1183  if(Branch != NULL)
1184  {
1185  // Call the lower branch to set the probability segment first, since it
1186  // supposed to have a lower probability segment that this node
1187  Renormalize(Branch->Left);
1188 
1189  // Set this node as the next sequential probability segment
1194 
1195  // Now call the upper branch to set those probability segments
1196  Renormalize(Branch->Right);
1197  }
1198 
1200 }
#define G4FFG_RECURSIVE_FUNCTIONLEAVE__
void Copy(G4int Elements, T *To, T *From)
Definition: G4ArrayOps.hh:63
ProbabilityBranch * Right
G4double * ProbabilityRangeBottom
G4double * ProbabilityRangeTop
void Multiply(G4int Elements, T *To, T *M1, T *M2=NULL)
Definition: G4ArrayOps.hh:138
void Renormalize(ProbabilityBranch *Branch)
#define G4FFG_RECURSIVE_FUNCTIONENTER__
ProbabilityBranch * Left
void Add(G4int Elements, T *To, T *A1, T *A2=NULL)
Definition: G4ArrayOps.hh:77
void G4FissionProductYieldDist::SampleAlphaEnergies ( std::vector< G4ReactionProduct * > *  Alphas)
protected

Sample the energy of the alpha particles. The energy used by the alpha particles is subtracted from the available energy

Definition at line 1203 of file G4FissionProductYieldDist.cc.

References G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, G4FPYSamplingOps::G4SampleGaussian(), python.hepunit::MeV, G4FFGEnumerations::POSITIVE, RandomEngine_, and RemainingEnergy_.

Referenced by G4GetFission().

1204 {
1206 
1207  // The condition of sampling more energy from the fission products than is
1208  // alloted is statistically unfavorable, but it could still happen. The
1209  // do-while loop prevents such an occurrence from happening
1210  G4double MeanAlphaEnergy = 16.0;
1211  G4double TotalAlphaEnergy;
1212 
1213  do
1214  {
1215  G4double AlphaEnergy;
1216  TotalAlphaEnergy = 0;
1217 
1218  // Walk through the alpha particles one at a time and sample each's
1219  // energy
1220  for(unsigned int i = 0; i < Alphas->size(); i++)
1221  {
1222  AlphaEnergy = RandomEngine_->G4SampleGaussian(MeanAlphaEnergy,
1223  2.35,
1225  // Assign the energy to the alpha particle
1226  Alphas->at(i)->SetKineticEnergy(AlphaEnergy);
1227 
1228  // Add up the total amount of kinetic energy consumed.
1229  TotalAlphaEnergy += AlphaEnergy;
1230  }
1231 
1232  // If true, decrement the mean alpha energy by 0.1 and try again.
1233  MeanAlphaEnergy -= 0.1;
1234  } while(TotalAlphaEnergy >= RemainingEnergy_);
1235 
1236  // Subtract the total amount of energy that was assigned.
1237  RemainingEnergy_ -= TotalAlphaEnergy;
1238 
1240 }
G4double G4SampleGaussian(G4double Mean, G4double StdDev)
#define G4FFG_FUNCTIONLEAVE__
double G4double
Definition: G4Types.hh:76
#define G4FFG_FUNCTIONENTER__
void G4FissionProductYieldDist::SampleGammaEnergies ( std::vector< G4ReactionProduct * > *  Gammas)
protected

Samples the energy of the gamma rays

Definition at line 1243 of file G4FissionProductYieldDist.cc.

References G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, GammaDefinition_, python.hepunit::keV, python.hepunit::MeV, G4FFGEnumerations::POSITIVE, RandomEngine_, and RemainingEnergy_.

Referenced by G4GetFission().

1244 {
1246 
1247  // Make sure that there is energy to assign to the gamma rays
1248  if(RemainingEnergy_ != 0)
1249  {
1250  G4double SampleEnergy;
1251 
1252  // Sample from RemainingEnergy until it is all gone. Also,
1253  // RemainingEnergy should not be smaller than
1254  // G4FFGDefaultValues::MeanGammaEnergy. This will prevent the
1255  // sampling of a fractional portion of the Gaussian distribution
1256  // in an attempt to find a new gamma ray energy.
1257  while(RemainingEnergy_ >= G4FFGDefaultValues::MeanGammaEnergy )
1258  {
1259  SampleEnergy = RandomEngine_->
1260  G4SampleGaussian(G4FFGDefaultValues::MeanGammaEnergy, 1.0 * MeV, G4FFGEnumerations::POSITIVE);
1261  // Make sure that we didn't sample more energy than was available
1262  if(SampleEnergy <= RemainingEnergy_)
1263  {
1264  // If this energy assignment would leave less energy than the
1265  // 'intrinsic' minimal energy of a gamma ray then just assign
1266  // all of the remaining energy
1267  if(RemainingEnergy_ - SampleEnergy < 100 * keV)
1268  {
1269  SampleEnergy = RemainingEnergy_;
1270  }
1271 
1272  // Create the new particle
1273  Gammas->push_back(new G4ReactionProduct());
1274 
1275  // Set the properties
1276  Gammas->back()->SetDefinition(GammaDefinition_);
1277  Gammas->back()->SetTotalEnergy(SampleEnergy);
1278 
1279  // Calculate how much is left
1280  RemainingEnergy_ -= SampleEnergy;
1281  }
1282  }
1283 
1284  // If there is anything left over, the energy must be above 100 keV but
1285  // less than G4FFGDefaultValues::MeanGammaEnergy. Arbitrarily assign
1286  // RemainingEnergy to a new particle
1287  if(RemainingEnergy_ > 0)
1288  {
1289  SampleEnergy = RemainingEnergy_;
1290  Gammas->push_back(new G4ReactionProduct());
1291 
1292  // Set the properties
1293  Gammas->back()->SetDefinition(GammaDefinition_);
1294  Gammas->back()->SetTotalEnergy(SampleEnergy);
1295 
1296  // Calculate how much is left
1297  RemainingEnergy_ -= SampleEnergy;
1298  }
1299  }
1300 
1302 }
#define G4FFG_FUNCTIONLEAVE__
double G4double
Definition: G4Types.hh:76
#define G4FFG_FUNCTIONENTER__
void G4FissionProductYieldDist::SampleNeutronEnergies ( std::vector< G4ReactionProduct * > *  Neutrons)
protected

Sample the energy of the neutrons using the Watt fission spectrum. The kinetic energy consumed is returned.

Definition at line 1305 of file G4FissionProductYieldDist.cc.

References Cause_, G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, G4FPYSamplingOps::G4SampleWatt(), Isotope_, RandomEngine_, and RemainingEnergy_.

Referenced by G4GetFission().

1306 {
1308 
1309  // The condition of sampling more energy from the fission products than is
1310  // alloted is statistically unfavorable, but it could still happen. The
1311  // do-while loop prevents such an occurrence from happening
1312  G4double TotalNeutronEnergy;
1313  G4double NeutronEnergy;
1314 
1315  // Make sure that we don't sample more energy than is available
1316  do
1317  {
1318  TotalNeutronEnergy = 0;
1319 
1320  // Walk through the neutrons one at a time and sample the energies.
1321  // The gamma rays have not yet been sampled, so the last neutron will
1322  // have a NULL value for NextFragment
1323  for(unsigned int i = 0; i < Neutrons->size(); i++)
1324  {
1325  // Assign the energy to the neutron
1327  Neutrons->at(i)->SetKineticEnergy(NeutronEnergy);
1328 
1329  // Add up the total amount of kinetic energy consumed.
1330  TotalNeutronEnergy +=NeutronEnergy;
1331  }
1332  } while (TotalNeutronEnergy > RemainingEnergy_);
1333 
1334  // Subtract the total amount of energy that was assigned.
1335  RemainingEnergy_ -= TotalNeutronEnergy;
1336 
1338 }
G4double G4SampleWatt(G4int WhatIsotope, G4FFGEnumerations::FissionCause WhatCause, G4double WhatEnergy)
const G4FFGEnumerations::FissionCause Cause_
#define G4FFG_FUNCTIONLEAVE__
double G4double
Definition: G4Types.hh:76
#define G4FFG_FUNCTIONENTER__
void G4FissionProductYieldDist::SetNubar ( void  )
protected

Sets the nubar values for the isotope referenced by G4FissionProductYieldDistdefined from the data sets defined in SpecialOps.hh

Definition at line 1341 of file G4FissionProductYieldDist.cc.

References Cause_, G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, Isotope_, Nubar_, NubarWidth_, and G4FFGEnumerations::SPONTANEOUS.

1342 {
1344 
1345  G4int* WhichNubar;
1346  G4int* NubarWidth;
1347  G4double XFactor, BFactor;
1348 
1350  {
1351  WhichNubar = const_cast<G4int*>(&SpontaneousNubar_[0][0]);
1352  NubarWidth = const_cast<G4int*>(&SpontaneousNubarWidth_[0][0]);
1353  } else
1354  {
1355  WhichNubar = const_cast<G4int*>(&NeutronInducedNubar_[0][0]);
1356  NubarWidth = const_cast<G4int*>(&NeutronInducedNubarWidth_[0][0]);
1357  }
1358 
1359  XFactor = std::pow(10.0, -13.0);
1360  BFactor = std::pow(10.0, -4.0);
1361  Nubar_ = *(WhichNubar + 1) * IncidentEnergy_ * XFactor
1362  + *(WhichNubar + 2) * BFactor;
1363  while(*WhichNubar != -1)
1364  {
1365  if(*WhichNubar == Isotope_)
1366  {
1367  Nubar_ = *(WhichNubar + 1) * IncidentEnergy_ * XFactor
1368  + *(WhichNubar + 2) * BFactor;
1369 
1370  break;
1371  }
1372  WhichNubar += 3;
1373  }
1374 
1375  XFactor = std::pow((G4double)10, -6);
1376  NubarWidth_ = *(NubarWidth + 1) * XFactor;
1377  while(*WhichNubar != -1)
1378  {
1379  if(*WhichNubar == Isotope_)
1380  {
1381  NubarWidth_ = *(NubarWidth + 1) * XFactor;
1382 
1383  break;
1384  }
1385  WhichNubar += 2;
1386  }
1387 
1389 }
int G4int
Definition: G4Types.hh:78
const G4FFGEnumerations::FissionCause Cause_
#define G4FFG_FUNCTIONLEAVE__
double G4double
Definition: G4Types.hh:76
#define G4FFG_FUNCTIONENTER__
void G4FissionProductYieldDist::SortProbability ( G4ENDFYieldDataContainer YieldData)
protectedvirtual

Sorts information for a potential new particle into the correct tree

Definition at line 1392 of file G4FissionProductYieldDist.cc.

References G4ArrayOps::Add(), ProbabilityTree::BranchCount, BranchCount_, G4ArrayOps::Copy(), DataTotal_, G4FFG_DATA_FUNCTIONENTER__, G4FFG_DATA_FUNCTIONLEAVE__, G4ParticleDefinition::GetAtomicMass(), G4ParticleDefinition::GetAtomicNumber(), G4ENDFYieldDataContainer::GetMetaState(), GetParticleDefinition(), G4ENDFYieldDataContainer::GetProduct(), G4ENDFYieldDataContainer::GetYieldProbability(), ProbabilityBranch::IncidentEnergiesCount, LargestA_, LargestZ_, SmallestA_, SmallestZ_, TreeCount_, Trees_, ProbabilityTree::Trunk, YieldEnergies_, and YieldEnergyGroups_.

Referenced by ReadProbabilities().

1393 {
1395 
1396  // Initialize the new branch
1397  ProbabilityBranch* NewBranch = new ProbabilityBranch;
1399  NewBranch->Left = NULL;
1400  NewBranch->Right = NULL;
1401  NewBranch->Particle = GetParticleDefinition(YieldData->GetProduct(), YieldData->GetMetaState());
1402  NewBranch->IncidentEnergies = new G4double[YieldEnergyGroups_];
1403  NewBranch->ProbabilityRangeTop = new G4double[YieldEnergyGroups_];
1404  NewBranch->ProbabilityRangeBottom = new G4double[YieldEnergyGroups_];
1405  G4ArrayOps::Copy(YieldEnergyGroups_, NewBranch->ProbabilityRangeTop, YieldData->GetYieldProbability());
1406  G4ArrayOps::Copy(YieldEnergyGroups_, NewBranch->IncidentEnergies, YieldEnergies_);
1408 
1409  // Check to see if the this is the smallest/largest particle. First, check
1410  // to see if this is the first particle in the system
1411  if(SmallestZ_ == NULL)
1412  {
1413  SmallestZ_ = SmallestA_ = LargestZ_ = LargestA_ = NewBranch->Particle;
1414  } else
1415  {
1416  G4bool IsSmallerZ = NewBranch->Particle->GetAtomicNumber() < SmallestZ_->GetAtomicNumber();
1417  G4bool IsSmallerA = NewBranch->Particle->GetAtomicMass() < SmallestA_->GetAtomicMass();
1418  G4bool IsLargerZ = NewBranch->Particle->GetAtomicNumber() > LargestZ_->GetAtomicNumber();
1419  G4bool IsLargerA = NewBranch->Particle->GetAtomicMass() > LargestA_->GetAtomicMass();
1420 
1421  if(IsSmallerZ)
1422  {
1423  SmallestZ_ = NewBranch->Particle;
1424  }
1425 
1426  if(IsLargerZ)
1427  {
1428  LargestA_ = NewBranch->Particle;
1429  }
1430 
1431  if(IsSmallerA)
1432  {
1433  SmallestA_ = NewBranch->Particle;
1434  }
1435 
1436  if(IsLargerA)
1437  {
1438  LargestA_ = NewBranch->Particle;
1439  }
1440  }
1441 
1442  // Place the new branch
1443  // Determine which tree the new branch goes into
1444  G4int WhichTree = (G4int)floor((G4double)(BranchCount_ % TreeCount_));
1445  ProbabilityBranch** WhichBranch = &(Trees_[WhichTree].Trunk);
1446  Trees_[WhichTree].BranchCount++;
1447 
1448  // Search for the position
1449  // Determine where the branch goes
1450  G4int BranchPosition = (G4int)floor((G4double)(BranchCount_ / TreeCount_)) + 1;
1451 
1452  // Run through the tree until the end branch is reached
1453  while(BranchPosition > 1)
1454  {
1455  if(BranchPosition & 1)
1456  {
1457  // If the 1's bit is on then move to the next 'right' branch
1458  WhichBranch = &((*WhichBranch)->Right);
1459  } else
1460  {
1461  // If the 1's bit is off then move to the next 'down' branch
1462  WhichBranch = &((*WhichBranch)->Left);
1463  }
1464 
1465  BranchPosition >>= 1;
1466  }
1467 
1468  *WhichBranch = NewBranch;
1469  BranchCount_++;
1470 
1472 }
G4FFGEnumerations::MetaState GetMetaState(void)
void Copy(G4int Elements, T *To, T *From)
Definition: G4ArrayOps.hh:63
#define G4FFG_DATA_FUNCTIONENTER__
int G4int
Definition: G4Types.hh:78
G4int GetAtomicNumber() const
#define G4FFG_DATA_FUNCTIONLEAVE__
bool G4bool
Definition: G4Types.hh:79
G4Ions * GetParticleDefinition(G4int Product, G4FFGEnumerations::MetaState MetaState)
G4int GetAtomicMass() const
ProbabilityBranch * Trunk
double G4double
Definition: G4Types.hh:76
void Add(G4int Elements, T *To, T *A1, T *A2=NULL)
Definition: G4ArrayOps.hh:77

Field Documentation

G4Ions* G4FissionProductYieldDist::AlphaDefinition_
protected

Contains the G4Ions pointer to an alpha particle

Definition at line 186 of file G4FissionProductYieldDist.hh.

Referenced by GenerateAlphas().

G4double G4FissionProductYieldDist::AlphaProduction_
protected

Controls whether alpha particles are emitted, and how many

Definition at line 188 of file G4FissionProductYieldDist.hh.

Referenced by CheckAlphaSanity(), G4SetAlphaProduction(), and GenerateAlphas().

G4int G4FissionProductYieldDist::BranchCount_
protected

A run-time counter for the total number of branches stored

Definition at line 242 of file G4FissionProductYieldDist.hh.

Referenced by ReadProbabilities(), and SortProbability().

const G4FFGEnumerations::FissionCause G4FissionProductYieldDist::Cause_
protected

The cause of fission: SPONTANEOUS or N_INDUCED.

Definition at line 174 of file G4FissionProductYieldDist.hh.

Referenced by G4GetFission(), G4SetEnergy(), SampleNeutronEnergies(), and SetNubar().

G4double* G4FissionProductYieldDist::DataTotal_
protected

A running total of all the probabilities

Definition at line 238 of file G4FissionProductYieldDist.hh.

Referenced by ReadProbabilities(), Renormalize(), SortProbability(), and ~G4FissionProductYieldDist().

G4NeutronHPNames* G4FissionProductYieldDist::ElementNames_
protected

Pointer to G4NeutronHPNames
Provides access to the list of element names included in Geant4

Definition at line 254 of file G4FissionProductYieldDist.hh.

Referenced by MakeIsotopeName(), and ~G4FissionProductYieldDist().

G4ENDFTapeRead* G4FissionProductYieldDist::ENDFData_
protected

Name of the fission yield product data file that G4FissionProductYieldDist references

Definition at line 182 of file G4FissionProductYieldDist.hh.

Referenced by G4SetVerbosity(), MakeTrees(), ReadProbabilities(), and ~G4FissionProductYieldDist().

G4Ions* G4FissionProductYieldDist::GammaDefinition_
protected

Contains the g4ParticleDefinition pointer to a gamma particle

Definition at line 192 of file G4FissionProductYieldDist.hh.

Referenced by SampleGammaEnergies().

G4double G4FissionProductYieldDist::IncidentEnergy_
protected

Kinetic energy, if any, of the incident particle in GeV.

Definition at line 194 of file G4FissionProductYieldDist.hh.

Referenced by G4GetFission().

G4IonTable* G4FissionProductYieldDist::IonTable_
protected

Pointer to G4IonTable
All G4Ions are created using G4IonTable

Definition at line 250 of file G4FissionProductYieldDist.hh.

Referenced by GetParticleDefinition().

const G4int G4FissionProductYieldDist::Isotope_
protected

Number in ZZZAAA format of the isotope that G4FissionProductYieldDist references

Definition at line 167 of file G4FissionProductYieldDist.hh.

Referenced by G4GetFission(), G4FPYBiasedLightFragmentDist::Initialize(), SampleNeutronEnergies(), and SetNubar().

G4Ions* G4FissionProductYieldDist::LargestA_
protected

Defines the largest Z particle in the field of trees

Definition at line 230 of file G4FissionProductYieldDist.hh.

Referenced by SortProbability().

G4Ions* G4FissionProductYieldDist::LargestZ_
protected

Defines the largest Z particle in the field of trees.

Definition at line 228 of file G4FissionProductYieldDist.hh.

Referenced by SortProbability().

G4double* G4FissionProductYieldDist::MaintainNormalizedData_
protected

Variable for ensuring that the input data is normalized

Definition at line 236 of file G4FissionProductYieldDist.hh.

Referenced by ReadProbabilities(), Renormalize(), and ~G4FissionProductYieldDist().

G4double G4FissionProductYieldDist::MeanGammaEnergy_
protected

Sets the mean gamma energy, in MeV, produced by the fission of the isotope described by Isotope_

Definition at line 198 of file G4FissionProductYieldDist.hh.

const G4FFGEnumerations::MetaState G4FissionProductYieldDist::MetaState_
protected

MetaState information of the isotope that G4FissionProductYieldDist references
Possible values are GROUND_STATE, META_1, or META_2

Definition at line 172 of file G4FissionProductYieldDist.hh.

G4Ions* G4FissionProductYieldDist::NeutronDefinition_
protected

Contains the G4ParticleDefinition pointer to a neutron, cast as a G4Ion for compatibility

Definition at line 201 of file G4FissionProductYieldDist.hh.

Referenced by GenerateNeutrons().

G4double G4FissionProductYieldDist::Nubar_
protected

Nubar for the isotope and incident neutron energy that G4FissionProductYieldDist references.

Definition at line 205 of file G4FissionProductYieldDist.hh.

Referenced by GenerateNeutrons(), and SetNubar().

G4double G4FissionProductYieldDist::NubarWidth_
protected

Width of the gaussian distribution that samples nubar for the isotope and incident neutron energy that G4FissionProductYieldDist references.

Definition at line 210 of file G4FissionProductYieldDist.hh.

Referenced by GenerateNeutrons(), and SetNubar().

G4FPYSamplingOps* G4FissionProductYieldDist::RandomEngine_
protected
G4int G4FissionProductYieldDist::RemainingA_
protected

Counter for the number of nucleons available to the fission event

Definition at line 214 of file G4FissionProductYieldDist.hh.

Referenced by G4GetFission(), GenerateAlphas(), GenerateNeutrons(), G4FPYNormalFragmentDist::GetFissionProduct(), and G4FPYBiasedLightFragmentDist::GetFissionProduct().

G4double G4FissionProductYieldDist::RemainingEnergy_
protected

Container for the energy remaining to be assigned in the fission generation

Definition at line 216 of file G4FissionProductYieldDist.hh.

Referenced by G4GetFission(), SampleAlphaEnergies(), SampleGammaEnergies(), and SampleNeutronEnergies().

G4int G4FissionProductYieldDist::RemainingZ_
protected

Counter for the number of protons available to the fission event

Definition at line 212 of file G4FissionProductYieldDist.hh.

Referenced by G4GetFission(), GenerateAlphas(), G4FPYNormalFragmentDist::GetFissionProduct(), and G4FPYBiasedLightFragmentDist::GetFissionProduct().

G4Ions* G4FissionProductYieldDist::SmallestA_
protected

Defines the smallest A particle in the field of trees

Definition at line 226 of file G4FissionProductYieldDist.hh.

Referenced by SortProbability().

G4Ions* G4FissionProductYieldDist::SmallestZ_
protected

Defines the smallest Z particle in the field of trees

Definition at line 224 of file G4FissionProductYieldDist.hh.

Referenced by SortProbability().

G4double G4FissionProductYieldDist::TernaryProbability_
protected

Sets the ternary fission probability. Valid ranges are [0, 1]

Definition at line 190 of file G4FissionProductYieldDist.hh.

Referenced by G4SetTernaryProbability(), and GenerateAlphas().

G4int G4FissionProductYieldDist::TreeCount_
protected
ProbabilityTree* G4FissionProductYieldDist::Trees_
protected
G4int G4FissionProductYieldDist::Verbosity_
protected

Verbosity level

Definition at line 218 of file G4FissionProductYieldDist.hh.

Referenced by G4GetFission(), and G4SetVerbosity().

G4double* G4FissionProductYieldDist::YieldEnergies_
protected

Energy values of each energy

Definition at line 234 of file G4FissionProductYieldDist.hh.

Referenced by FindParticle(), and SortProbability().

G4int G4FissionProductYieldDist::YieldEnergyGroups_
protected

Number of specific energy groups

Definition at line 232 of file G4FissionProductYieldDist.hh.

Referenced by FindParticle(), FindParticleExtrapolation(), MakeTrees(), ReadProbabilities(), Renormalize(), and SortProbability().

const G4FFGEnumerations::YieldType G4FissionProductYieldDist::YieldType_
protected

The type of yield to be used: INDEPENDET or CUMULATIVE

Definition at line 176 of file G4FissionProductYieldDist.hh.


The documentation for this class was generated from the following files: