File indexing completed on 2025-01-18 09:58:53
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 G4ParticleHPParticleYield()
0043 {
0044 simpleMean = true;
0045 spontPrompt = true;
0046 hasPromptData = false;
0047 hasDelayedData = false;
0048
0049 targetMass = 0.0;
0050 theSpontPrompt = 0.0;
0051 spontDelayed = true;
0052 theSpontDelayed = 0.0;
0053 }
0054 ~G4ParticleHPParticleYield() = default;
0055
0056 G4double GetTargetMass() { return targetMass; }
0057
0058 void InitMean(std::istream& aDataFile)
0059 {
0060 G4int iflag;
0061 aDataFile >> targetMass >> iflag;
0062 if (iflag == 1) simpleMean = false;
0063 if (simpleMean) {
0064 theSimpleMean.Init(aDataFile, CLHEP::eV);
0065 }
0066 else {
0067 theMean.Init(aDataFile);
0068 }
0069 }
0070
0071 void InitPrompt(std::istream& aDataFile)
0072 {
0073 hasPromptData = true;
0074 G4int iflag;
0075 aDataFile >> targetMass >> iflag;
0076 if (iflag == 2) spontPrompt = false;
0077 if (spontPrompt) {
0078 aDataFile >> theSpontPrompt;
0079 }
0080 else {
0081 thePrompt.Init(aDataFile, CLHEP::eV);
0082 }
0083 }
0084
0085 void InitDelayed(std::istream& aDataFile)
0086 {
0087 hasDelayedData = true;
0088 G4int iflag;
0089 aDataFile >> targetMass >> iflag;
0090 thePrecursorDecayConstants.Init(aDataFile, 1. / CLHEP::s);
0091 if (iflag == 2) spontDelayed = false;
0092 if (spontDelayed) {
0093 aDataFile >> theSpontDelayed;
0094 }
0095 else {
0096 theDelayed.Init(aDataFile, CLHEP::eV);
0097 }
0098 }
0099
0100 G4double GetMean(G4double anEnergy)
0101 {
0102 if (simpleMean) {
0103 return theSimpleMean.GetY(anEnergy);
0104 }
0105 return theMean.GetValue(anEnergy);
0106 }
0107
0108 G4double GetPrompt(G4double anEnergy)
0109 {
0110 if (!hasPromptData) return 0;
0111 if (spontPrompt) {
0112 return theSpontPrompt;
0113 }
0114 return thePrompt.GetY(anEnergy);
0115 }
0116
0117 G4double GetDelayed(G4double anEnergy)
0118 {
0119 if (!hasDelayedData) return 0;
0120 if (spontDelayed) {
0121 return theSpontDelayed;
0122 }
0123 return theDelayed.GetY(anEnergy);
0124 }
0125
0126 inline G4double GetDecayConstant(G4int i) { return thePrecursorDecayConstants.GetValue(i); }
0127
0128 private:
0129 G4double targetMass;
0130
0131 G4bool simpleMean;
0132 G4ParticleHPPolynomExpansion theMean;
0133 G4ParticleHPVector theSimpleMean;
0134
0135
0136 G4bool hasPromptData;
0137 G4bool spontPrompt;
0138 G4ParticleHPVector thePrompt;
0139 G4double theSpontPrompt;
0140
0141
0142 G4bool hasDelayedData;
0143 G4bool spontDelayed;
0144 G4ParticleHPList thePrecursorDecayConstants;
0145 G4ParticleHPVector theDelayed;
0146 G4double theSpontDelayed;
0147 };
0148 #endif