Warning, file /include/Geant4/G4ParticleHPParticleYield.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef G4ParticleHPParticleYield_h
0030 #define G4ParticleHPParticleYield_h 1
0031
0032 #include "G4ParticleHPList.hh"
0033 #include "G4ParticleHPPolynomExpansion.hh"
0034 #include "G4ParticleHPVector.hh"
0035 #include "globals.hh"
0036
0037 #include <CLHEP/Units/SystemOfUnits.h>
0038
0039 class G4ParticleHPParticleYield
0040 {
0041 public:
0042
0043 G4ParticleHPParticleYield()
0044 {
0045 simpleMean = true;
0046 spontPrompt = true;
0047 hasPromptData = false;
0048 hasDelayedData = false;
0049
0050 targetMass = 0.0;
0051 theSpontPrompt = 0.0;
0052 spontDelayed = true;
0053 theSpontDelayed = 0.0;
0054 }
0055
0056 ~G4ParticleHPParticleYield() = default;
0057
0058 inline G4double GetTargetMass() const { return targetMass; }
0059
0060 inline void InitMean(std::istream& aDataFile)
0061 {
0062 G4int iflag;
0063 aDataFile >> targetMass >> iflag;
0064 if (iflag == 1) simpleMean = false;
0065 if (simpleMean) {
0066 theSimpleMean.Init(aDataFile, CLHEP::eV);
0067 }
0068 else {
0069 theMean.Init(aDataFile);
0070 }
0071 }
0072
0073 inline void InitPrompt(std::istream& aDataFile)
0074 {
0075 hasPromptData = true;
0076 G4int iflag;
0077 aDataFile >> targetMass >> iflag;
0078 if (iflag == 2) spontPrompt = false;
0079 if (spontPrompt) {
0080 aDataFile >> theSpontPrompt;
0081 }
0082 else {
0083 thePrompt.Init(aDataFile, CLHEP::eV);
0084 }
0085 }
0086
0087 inline void InitDelayed(std::istream& aDataFile)
0088 {
0089 hasDelayedData = true;
0090 G4int iflag;
0091 aDataFile >> targetMass >> iflag;
0092 thePrecursorDecayConstants.Init(aDataFile, 1. / CLHEP::s);
0093 if (iflag == 2) spontDelayed = false;
0094 if (spontDelayed) {
0095 aDataFile >> theSpontDelayed;
0096 }
0097 else {
0098 theDelayed.Init(aDataFile, CLHEP::eV);
0099 }
0100 }
0101
0102 inline G4double GetMean(G4double anEnergy) const
0103 {
0104 if (simpleMean) {
0105 return theSimpleMean.GetY(anEnergy);
0106 }
0107 return theMean.GetValue(anEnergy);
0108 }
0109
0110 inline G4double GetPrompt(G4double anEnergy) const
0111 {
0112 if (!hasPromptData) return 0;
0113 if (spontPrompt) {
0114 return theSpontPrompt;
0115 }
0116 return thePrompt.GetY(anEnergy);
0117 }
0118
0119 inline G4double GetDelayed(G4double anEnergy) const
0120 {
0121 if (!hasDelayedData) return 0;
0122 if (spontDelayed) {
0123 return theSpontDelayed;
0124 }
0125 return theDelayed.GetY(anEnergy);
0126 }
0127
0128 inline G4double GetDecayConstant(G4int i) const
0129 {
0130 return thePrecursorDecayConstants.GetValue(i);
0131 }
0132
0133 private:
0134
0135 G4double targetMass;
0136
0137 G4bool simpleMean;
0138 G4ParticleHPPolynomExpansion theMean;
0139 G4ParticleHPVector theSimpleMean;
0140
0141
0142 G4bool hasPromptData;
0143 G4bool spontPrompt;
0144 G4ParticleHPVector thePrompt;
0145 G4double theSpontPrompt;
0146
0147
0148 G4bool hasDelayedData;
0149 G4bool spontDelayed;
0150 G4ParticleHPList thePrecursorDecayConstants;
0151 G4ParticleHPVector theDelayed;
0152 G4double theSpontDelayed;
0153 };
0154
0155 #endif