File indexing completed on 2025-01-18 09:58:52
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 G4ParticleHPEnAngCorrelation_h
0031 #define G4ParticleHPEnAngCorrelation_h 1
0032
0033 #include "G4Cache.hh"
0034 #include "G4ParticleHPManager.hh"
0035 #include "G4ParticleHPProduct.hh"
0036 #include "G4ParticleHPVector.hh"
0037 #include "G4ReactionProduct.hh"
0038 #include "G4ios.hh"
0039 #include "Randomize.hh"
0040 #include "globals.hh"
0041
0042 #include <fstream>
0043
0044 class G4ParticleDefinition;
0045
0046 class G4ParticleHPEnAngCorrelation
0047 {
0048 struct toBeCached
0049 {
0050 G4ReactionProduct* theProjectileRP{nullptr};
0051 G4ReactionProduct* theTarget{nullptr};
0052 G4double theTotalMeanEnergy{-1.0};
0053 toBeCached() = default;
0054 };
0055
0056 public:
0057 explicit G4ParticleHPEnAngCorrelation(const G4ParticleDefinition* proj = nullptr);
0058 ~G4ParticleHPEnAngCorrelation();
0059
0060 void Init(std::istream& aDataFile);
0061
0062 G4ReactionProduct* SampleOne(G4double anEnergy);
0063
0064 G4ReactionProductVector* Sample(G4double anEnergy);
0065
0066 void SetTarget(G4ReactionProduct& aTarget)
0067 {
0068 fCache.Get().theTarget = &aTarget;
0069 for (G4int i = 0; i < nProducts; ++i)
0070 theProducts[i].SetTarget(&aTarget);
0071 }
0072
0073 void SetProjectileRP(G4ReactionProduct& aIncidentPart)
0074 {
0075 fCache.Get().theProjectileRP = &aIncidentPart;
0076 for (G4int i = 0; i < nProducts; ++i)
0077 theProducts[i].SetProjectileRP(&aIncidentPart);
0078 }
0079
0080 G4bool InCharge() { return inCharge; }
0081
0082 G4double GetTargetMass() { return targetMass; }
0083
0084 G4double GetNumberOfProducts() { return nProducts; }
0085
0086 G4double GetTotalMeanEnergy()
0087 {
0088 return fCache.Get().theTotalMeanEnergy;
0089 }
0090
0091 G4ParticleHPEnAngCorrelation(G4ParticleHPEnAngCorrelation&) = delete;
0092 G4ParticleHPEnAngCorrelation& operator=
0093 (const G4ParticleHPEnAngCorrelation &right) = delete;
0094
0095 private:
0096 const G4ParticleDefinition* theProjectile;
0097 G4ParticleHPProduct* theProducts{nullptr};
0098
0099 G4double targetMass{0.0};
0100
0101 G4int frameFlag{1};
0102 G4int nProducts{0};
0103 G4bool inCharge{false};
0104
0105
0106
0107 G4Cache<toBeCached> fCache;
0108 };
0109
0110 #endif