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 G4ParticleHPNBodyPhaseSpace_h
0030 #define G4ParticleHPNBodyPhaseSpace_h 1
0031
0032 #include "G4Neutron.hh"
0033 #include "G4Pow.hh"
0034 #include "G4ReactionProduct.hh"
0035 #include "G4VParticleHPEnergyAngular.hh"
0036 #include "G4ios.hh"
0037 #include "globals.hh"
0038
0039 #include <CLHEP/Units/PhysicalConstants.h>
0040
0041 #include <fstream>
0042
0043 class G4ParticleHPNBodyPhaseSpace : public G4VParticleHPEnergyAngular
0044 {
0045 public:
0046 G4ParticleHPNBodyPhaseSpace()
0047 {
0048 theTotalMass = 0.0;
0049 theTotalCount = 0;
0050 }
0051 ~G4ParticleHPNBodyPhaseSpace() override = default;
0052
0053 public:
0054 void Init(G4double aMass, G4int aCount)
0055 {
0056 theTotalMass = aMass;
0057 theTotalCount = aCount;
0058 }
0059
0060 void Init(std::istream& aDataFile) override
0061 {
0062 aDataFile >> theTotalMass >> theTotalCount;
0063 theTotalMass *= G4Neutron::Neutron()->GetPDGMass();
0064 }
0065
0066 G4ReactionProduct* Sample(G4double anEnergy, G4double massCode, G4double mass) override;
0067
0068 private:
0069 inline G4double Prob(G4double anEnergy, G4double eMax, G4int n)
0070 {
0071 G4double result;
0072 result = std::sqrt(anEnergy) * G4Pow::GetInstance()->powA(eMax - anEnergy, 3. * n / 2. - 4.);
0073 return result;
0074 }
0075
0076 inline G4double C(G4double anEnergy, G4double mass)
0077 {
0078 G4double result(0);
0079 if (theTotalCount == 3)
0080 result = 4. / CLHEP::pi / G4Pow::GetInstance()->powN(GetEmax(anEnergy, mass), 2);
0081 if (theTotalCount == 4)
0082 result = 105. / 32. / G4Pow::GetInstance()->powA(GetEmax(anEnergy, mass), 3.5);
0083
0084
0085 if (theTotalCount == 5)
0086 result = 256. / 14. / CLHEP::pi / G4Pow::GetInstance()->powN(GetEmax(anEnergy, mass), 5);
0087 return result;
0088 }
0089
0090 inline G4double GetEmax(G4double anEnergy, G4double mass)
0091 {
0092 G4double result;
0093 G4double tMass = GetTarget()->GetMass();
0094 G4double pMass = GetProjectileRP()->GetMass();
0095 G4double availableEnergy = GetQValue() + anEnergy * tMass / (pMass + tMass);
0096 result = availableEnergy * (theTotalMass - mass) / theTotalMass;
0097 return result;
0098 }
0099
0100 G4double MeanEnergyOfThisInteraction() override { return -1; }
0101
0102 private:
0103 G4double theTotalMass;
0104 G4int theTotalCount;
0105 };
0106 #endif