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 #ifndef G4ParticleHPProduct_h
0031 #define G4ParticleHPProduct_h 1
0032
0033 #include "G4Cache.hh"
0034 #include "G4ReactionProductVector.hh"
0035 #include "G4VParticleHPEnergyAngular.hh"
0036 #include "G4ParticleHPVector.hh"
0037 #include "G4ios.hh"
0038 #include "globals.hh"
0039
0040 #include <fstream>
0041
0042 class G4ParticleDefinition;
0043
0044 enum G4HPMultiMethod
0045 {
0046 G4HPMultiPoisson,
0047 G4HPMultiBetweenInts
0048 };
0049
0050 class G4ParticleHPProduct
0051 {
0052 struct toBeCached
0053 {
0054 G4ReactionProduct* theProjectileRP{nullptr};
0055 G4ReactionProduct* theTarget{nullptr};
0056 G4int theCurrentMultiplicity{-1};
0057 toBeCached() = default;
0058 };
0059
0060 public:
0061 G4ParticleHPProduct();
0062 ~G4ParticleHPProduct();
0063
0064 void Init(std::istream& aDataFile, const G4ParticleDefinition* projectile);
0065
0066 G4int GetMultiplicity(G4double anEnergy);
0067 G4ReactionProductVector* Sample(G4double anEnergy, G4int nParticles);
0068
0069 G4double GetMeanYield(G4double anEnergy) { return theYield.GetY(anEnergy); }
0070
0071 void SetProjectileRP(G4ReactionProduct* aIncidentPart)
0072 {
0073 fCache.Get().theProjectileRP = aIncidentPart;
0074 }
0075
0076 void SetTarget(G4ReactionProduct* aTarget) { fCache.Get().theTarget = aTarget; }
0077
0078 inline G4ReactionProduct* GetTarget() { return fCache.Get().theTarget; }
0079
0080 inline G4ReactionProduct* GetProjectileRP() { return fCache.Get().theProjectileRP; }
0081
0082 inline G4double MeanEnergyOfThisInteraction()
0083 {
0084 G4double result = 0.0;
0085 if (theDist != nullptr) {
0086 result = theDist->MeanEnergyOfThisInteraction();
0087 result *= fCache.Get().theCurrentMultiplicity;
0088 }
0089 return result;
0090 }
0091
0092 inline G4double GetQValue() { return theActualStateQValue; }
0093
0094
0095
0096 G4double GetMassCode() { return theMassCode; }
0097 G4double GetMass() { return theMass; }
0098
0099 private:
0100 G4double theMassCode{0.0};
0101 G4double theMass{0.0};
0102 G4double theGroundStateQValue{0.0};
0103 G4double theActualStateQValue{0.0};
0104 G4int theIsomerFlag{0};
0105 G4int theDistLaw{-1};
0106 G4VParticleHPEnergyAngular* theDist{nullptr};
0107
0108
0109
0110 G4Cache<toBeCached> fCache;
0111
0112 G4HPMultiMethod theMultiplicityMethod;
0113 G4ParticleHPVector theYield;
0114 };
0115
0116 #endif