File indexing completed on 2025-01-18 09:58:21
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 #ifndef G4HadFinalState_hh
0027 #define G4HadFinalState_hh
0028
0029
0030
0031
0032
0033
0034
0035 #include "globals.hh"
0036 #include "G4DynamicParticle.hh"
0037 #include "G4HadSecondary.hh"
0038 #include "G4LorentzRotation.hh"
0039 #include "G4ThreeVector.hh"
0040 #include <vector>
0041
0042 enum G4HadFinalStateStatus{isAlive, stopAndKill, suspend};
0043
0044
0045 class G4HadFinalState
0046 {
0047 public:
0048 G4HadFinalState();
0049
0050 inline
0051 std::size_t GetNumberOfSecondaries() const { return theSecs.size(); }
0052 void SetEnergyChange(G4double anEnergy);
0053 inline
0054 G4double GetEnergyChange() const { return theEnergy; }
0055 inline
0056 void SetMomentumChange(const G4ThreeVector& aV){ theDirection=aV; }
0057 void SetMomentumChange(G4double x, G4double y, G4double z);
0058 inline
0059 const G4ThreeVector& GetMomentumChange() const { return theDirection; }
0060 inline
0061 void AddSecondary(G4DynamicParticle* aP, G4int mod=-1) {
0062 theSecs.push_back(G4HadSecondary(aP, theW, mod));
0063 };
0064 inline
0065 void AddSecondary(const G4HadSecondary& aHS) { theSecs.push_back(aHS); }
0066 inline
0067 void SetStatusChange(G4HadFinalStateStatus aS) { theStat=aS; }
0068 inline
0069 G4HadFinalStateStatus GetStatusChange() const { return theStat; }
0070 void Clear();
0071 inline
0072 const G4LorentzRotation& GetTrafoToLab() const { return theT; }
0073 inline
0074 void SetTrafoToLab(const G4LorentzRotation & aT) { theT = aT; }
0075 inline
0076 void SetWeightChange(G4double aW) { theW=aW; }
0077 inline
0078 G4double GetWeightChange() const { return theW; }
0079 G4HadSecondary* GetSecondary(size_t i);
0080 const G4HadSecondary* GetSecondary(size_t i) const;
0081 inline
0082 void SetLocalEnergyDeposit(G4double aE) { theEDep=aE; }
0083 inline
0084 G4double GetLocalEnergyDeposit() const { return theEDep;}
0085
0086 inline
0087 void ClearSecondaries() { theSecs.clear(); }
0088
0089
0090 void AddSecondaries(const std::vector<G4HadSecondary>& addSecs);
0091 inline
0092 void AddSecondaries(const G4HadFinalState& addHFS) {
0093 AddSecondaries(addHFS.theSecs);
0094 }
0095 inline
0096 void AddSecondaries(const G4HadFinalState* addHFS) {
0097 if (addHFS) AddSecondaries(addHFS->theSecs);
0098 }
0099
0100 private:
0101 G4ThreeVector theDirection;
0102 G4double theEnergy;
0103 std::vector<G4HadSecondary> theSecs;
0104 G4HadFinalStateStatus theStat;
0105 G4LorentzRotation theT;
0106 G4double theW;
0107 G4double theEDep;
0108 };
0109
0110 #endif