File indexing completed on 2025-01-18 09:58:45
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 #ifndef G4Nucleon_h
0029 #define G4Nucleon_h 1
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 #include "G4ThreeVector.hh"
0040 #include "G4LorentzVector.hh"
0041 #include "globals.hh"
0042 #include "G4ParticleDefinition.hh"
0043 #include "G4Proton.hh"
0044 #include "G4Neutron.hh"
0045 #include "G4Lambda.hh"
0046 #include "G4AntiProton.hh"
0047 #include "G4AntiNeutron.hh"
0048 #include "G4AntiLambda.hh"
0049 #include "G4VKineticNucleon.hh"
0050
0051
0052 class G4VSplitableHadron;
0053
0054 class G4Nucleon : public G4VKineticNucleon
0055 {
0056
0057 public:
0058 G4Nucleon();
0059 ~G4Nucleon();
0060
0061 inline G4bool operator==(const G4Nucleon &right) const;
0062 inline G4bool operator!=(const G4Nucleon &right) const;
0063 G4Nucleon& operator=(const G4Nucleon& right);
0064
0065 public:
0066
0067 void SetPosition(const G4ThreeVector aPosition);
0068 const G4ThreeVector& GetPosition() const;
0069
0070 inline void SetMomentum(G4LorentzVector & aMomentum) {theMomentum = aMomentum;}
0071 inline const G4LorentzVector& GetMomentum() const {return theMomentum;}
0072 virtual inline const G4LorentzVector & Get4Momentum() const {return theMomentum;}
0073
0074 inline void SetBindingEnergy(G4double anEnergy) {theBindingE = anEnergy;}
0075 inline G4double GetBindingEnergy() const {return theBindingE;}
0076
0077 inline void SetParticleType(G4Proton* aProton) {theParticleType = aProton;}
0078 inline void SetParticleType(G4Neutron* aNeutron){theParticleType = aNeutron;}
0079 inline void SetParticleType(G4Lambda* aLambda) {theParticleType = aLambda;}
0080
0081 inline void SetParticleType(G4AntiProton* aAntiProton) {theParticleType = aAntiProton;}
0082 inline void SetParticleType(G4AntiNeutron* aAntiNeutron){theParticleType = aAntiNeutron;}
0083 inline void SetParticleType(G4AntiLambda* aAntiLambda) {theParticleType = aAntiLambda;}
0084
0085 inline const G4ParticleDefinition* GetParticleType() const {return theParticleType;}
0086 virtual const G4ParticleDefinition* GetDefinition() const {return theParticleType;}
0087
0088 inline void Boost(const G4ThreeVector & beta){ theMomentum.boost(beta); }
0089 void Boost(const G4LorentzVector & aMomentum);
0090
0091 inline void Hit(G4VSplitableHadron *aHit) { theSplitableHadron=aHit;}
0092
0093 inline void Hit(G4int )
0094 {
0095 theSplitableHadron=reinterpret_cast<G4VSplitableHadron *>(1111);
0096 }
0097 inline G4VSplitableHadron * GetSplitableHadron() const { return theSplitableHadron;}
0098 inline G4bool AreYouHit() const { return theSplitableHadron!=0;}
0099
0100 private:
0101
0102 G4ThreeVector thePosition;
0103 G4LorentzVector theMomentum;
0104 G4double theBindingE;
0105 const G4ParticleDefinition * theParticleType;
0106 G4VSplitableHadron * theSplitableHadron;
0107
0108
0109 };
0110
0111 std::ostream & operator << (std::ostream &, const G4Nucleon&);
0112
0113 inline G4bool G4Nucleon::operator==(const G4Nucleon &right) const
0114 {
0115 return this==&right;
0116 }
0117 inline G4bool G4Nucleon::operator!=(const G4Nucleon &right) const
0118 {
0119 return this!=&right;
0120 }
0121
0122 inline G4Nucleon& G4Nucleon::operator=(const G4Nucleon& right)
0123 {
0124 if (this != &right)
0125 {
0126 thePosition=right.GetPosition();
0127 theMomentum=right.Get4Momentum();
0128 theBindingE=right.GetBindingEnergy();
0129 theParticleType=right.GetDefinition();
0130 theSplitableHadron=right.GetSplitableHadron();
0131 }
0132 return *this;
0133 }
0134
0135 inline void G4Nucleon::SetPosition(const G4ThreeVector aPosition)
0136 {
0137 thePosition = aPosition;
0138 }
0139
0140 inline const G4ThreeVector& G4Nucleon::GetPosition() const
0141 {
0142 return thePosition;
0143 }
0144
0145 #endif
0146