File indexing completed on 2025-09-15 08:59:11
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 #ifndef G4ParticleHPFinalState_h
0035 #define G4ParticleHPFinalState_h
0036
0037 #include "G4Cache.hh"
0038 #include "G4HadFinalState.hh"
0039 #include "G4HadProjectile.hh"
0040 #include "G4Material.hh"
0041 #include "G4Neutron.hh"
0042 #include "G4IonTable.hh"
0043 #include "G4ParticleHPManager.hh"
0044 #include "G4ParticleHPNames.hh"
0045 #include "G4ParticleHPVector.hh"
0046
0047 class G4ParticleDefinition;
0048
0049 class G4ParticleHPFinalState
0050 {
0051 public:
0052
0053 G4ParticleHPFinalState();
0054 virtual ~G4ParticleHPFinalState();
0055
0056 inline void Init(G4double A, G4double Z, const G4String& dirName,
0057 const G4String& aFSType, G4ParticleDefinition* p)
0058 {
0059 theProjectile = p;
0060 Init(A, Z, 0, dirName, aFSType, p);
0061 }
0062 virtual void Init(G4double A, G4double Z, G4int M, const G4String& dirName,
0063 const G4String& aFSType, G4ParticleDefinition*) = 0;
0064
0065 virtual G4HadFinalState* ApplyYourself(const G4HadProjectile&)
0066 {
0067 throw G4HadronicException(
0068 __FILE__, __LINE__,
0069 "G4ParticleHPFinalState::ApplyYourself(..) needs implementation");
0070 return nullptr;
0071 }
0072
0073
0074
0075 virtual G4ParticleHPFinalState* New() = 0;
0076
0077 inline G4bool HasXsec() const { return hasXsec; }
0078 inline G4bool HasFSData() const { return hasFSData; }
0079 inline G4bool HasAnyData() const { return hasAnyData; }
0080
0081 virtual G4double GetXsec(G4double) const { return 0.; }
0082 virtual G4ParticleHPVector* GetXsec() const { return nullptr; }
0083
0084 void SetA_Z(G4double anA, G4double aZ, G4int aM = 0)
0085 {
0086 theBaseA = G4lrint(anA);
0087 theBaseZ = G4lrint(aZ);
0088 theBaseM = aM;
0089 }
0090 G4double GetZ() const { return theBaseZ; }
0091 G4double GetN() const { return theBaseA; }
0092 G4double GetA() const { return theBaseA; }
0093 G4int GetM() const { return theBaseM; }
0094
0095 inline void SetAZMs(const G4ParticleHPDataUsed& used)
0096 {
0097 theNDLDataA = G4lrint(used.GetA());
0098 theNDLDataZ = G4lrint(used.GetZ());
0099 theNDLDataM = used.GetM();
0100 }
0101
0102 inline void SetAZMs(G4double anA, G4double aZ, G4int aM, const G4ParticleHPDataUsed& used)
0103 {
0104 theBaseA = G4lrint(anA);
0105 theBaseZ = G4lrint(aZ);
0106 theBaseM = aM;
0107 theNDLDataA = G4lrint(used.GetA());
0108 theNDLDataZ = G4lrint(used.GetZ());
0109 theNDLDataM = used.GetM();
0110 }
0111
0112 inline void SetProjectile(G4ParticleDefinition* projectile)
0113 {
0114 theProjectile = projectile;
0115 }
0116
0117 G4ParticleHPFinalState& operator=(const G4ParticleHPFinalState& right) = delete;
0118 G4ParticleHPFinalState(const G4ParticleHPFinalState&) = delete;
0119
0120 protected:
0121
0122 void adjust_final_state(G4LorentzVector);
0123
0124 G4ParticleDefinition* theProjectile{nullptr};
0125 G4ParticleHPManager* fManager;
0126 G4IonTable* ionTable;
0127
0128 G4int theBaseA{0};
0129 G4int theBaseZ{0};
0130 G4int theBaseM{0};
0131 G4int theNDLDataZ{0};
0132 G4int theNDLDataA{0};
0133 G4int theNDLDataM{0};
0134
0135 G4int secID{-1};
0136
0137
0138 G4bool hasXsec{true};
0139 G4bool hasFSData{true};
0140 G4bool hasAnyData{true};
0141 G4ParticleHPNames theNames;
0142
0143 G4Cache<G4HadFinalState*> theResult;
0144
0145 };
0146
0147 #endif