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
0030
0031
0032
0033
0034
0035
0036
0037 #ifndef G4ParticleHPPhotonDist_h
0038 #define G4ParticleHPPhotonDist_h 1
0039
0040 #include "G4Cache.hh"
0041 #include "G4Gamma.hh"
0042 #include "G4InterpolationManager.hh"
0043 #include "G4ParticleHPAngularP.hh"
0044 #include "G4ParticleHPFastLegendre.hh"
0045 #include "G4ParticleHPInterpolator.hh"
0046 #include "G4ParticleHPLegendreTable.hh"
0047 #include "G4ParticleHPPartial.hh"
0048 #include "G4ParticleHPVector.hh"
0049 #include "G4ReactionProduct.hh"
0050 #include "G4ReactionProductVector.hh"
0051 #include "G4ios.hh"
0052 #include "globals.hh"
0053
0054 #include <fstream>
0055
0056 class G4ParticleHPPhotonDist
0057 {
0058 public:
0059 G4ParticleHPPhotonDist()
0060 {
0061 disType = nullptr;
0062 energy = nullptr;
0063 theYield = nullptr;
0064 thePartialXsec = nullptr;
0065 theReactionXsec = nullptr;
0066 isPrimary = nullptr;
0067 theShells = nullptr;
0068 theGammas = nullptr;
0069 nNeu = nullptr;
0070 theLegendre = nullptr;
0071 theAngular = nullptr;
0072 distribution = nullptr;
0073 probs = nullptr;
0074 partials = nullptr;
0075 actualMult.Put(nullptr);
0076
0077 theLevelEnergies = nullptr;
0078 theTransitionProbabilities = nullptr;
0079 thePhotonTransitionFraction = nullptr;
0080 }
0081
0082 ~G4ParticleHPPhotonDist()
0083 {
0084 delete[] disType;
0085 delete[] energy;
0086 delete[] theYield;
0087 delete[] thePartialXsec;
0088
0089
0090 delete[] isPrimary;
0091 delete[] theShells;
0092 delete[] theGammas;
0093 delete[] nNeu;
0094 delete[] theAngular;
0095 delete[] distribution;
0096 delete[] probs;
0097
0098 if (theLegendre != nullptr) {
0099 for (G4int i = 0; i < (nDiscrete2 - nIso); i++)
0100 if (theLegendre[i] != nullptr) delete[] theLegendre[i];
0101
0102 delete[] theLegendre;
0103 }
0104
0105 if (partials != nullptr) {
0106 for (G4int i = 0; i < nPartials; i++) {
0107 delete partials[i];
0108 }
0109
0110 delete[] partials;
0111 }
0112
0113 delete[] theLevelEnergies;
0114 delete[] theTransitionProbabilities;
0115 delete[] thePhotonTransitionFraction;
0116 if (actualMult.Get() != nullptr) delete actualMult.Get();
0117 }
0118
0119 G4bool InitMean(std::istream& aDataFile);
0120
0121 void InitAngular(std::istream& aDataFile);
0122
0123 void InitEnergies(std::istream& aDataFile);
0124
0125 void InitPartials(std::istream& aDataFile, G4ParticleHPVector* theXsec = nullptr);
0126
0127 G4ReactionProductVector* GetPhotons(G4double anEnergy);
0128
0129 inline G4double GetTargetMass() { return targetMass; }
0130
0131 inline G4bool NeedsCascade() { return repFlag == 2; }
0132
0133 inline G4double GetLevelEnergy() { return theBaseEnergy; }
0134
0135 private:
0136 G4int repFlag{0};
0137 G4double targetMass{0.0};
0138
0139 G4int nDiscrete{0};
0140 G4int* disType;
0141 G4double* energy;
0142 G4ParticleHPVector* theYield;
0143 G4ParticleHPVector theTotalXsec;
0144 G4ParticleHPVector* thePartialXsec;
0145 G4ParticleHPVector* theReactionXsec;
0146 G4int* isPrimary;
0147
0148 G4int isoFlag{0};
0149 G4int tabulationType{0};
0150 G4int nDiscrete2{0};
0151 G4int nIso{0};
0152 G4double* theShells;
0153 G4double* theGammas;
0154 G4int* nNeu;
0155 G4InterpolationManager theLegendreManager;
0156 G4ParticleHPLegendreTable** theLegendre;
0157 G4ParticleHPAngularP** theAngular;
0158
0159 G4int* distribution;
0160 G4int nPartials{0};
0161 G4ParticleHPVector* probs;
0162 G4ParticleHPPartial** partials;
0163
0164 G4Cache<std::vector<G4int>*> actualMult;
0165
0166
0167 G4int theInternalConversionFlag{0};
0168 G4int nGammaEnergies{0};
0169 G4double theBaseEnergy{0.0};
0170 G4double* theLevelEnergies;
0171 G4double* theTransitionProbabilities;
0172 G4double* thePhotonTransitionFraction;
0173
0174
0175 G4ParticleHPFastLegendre theLegend;
0176 };
0177
0178 #endif