File indexing completed on 2025-01-18 09:58:30
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 #ifndef G4InteractionContent_h
0030 #define G4InteractionContent_h 1
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #include "globals.hh"
0041 #include "G4VSplitableHadron.hh"
0042 #include "G4Nucleon.hh"
0043
0044
0045 class G4InteractionContent
0046 {
0047 public:
0048 G4InteractionContent() {}
0049 G4InteractionContent(G4VSplitableHadron *aPrimaryParticipant);
0050
0051 ~G4InteractionContent();
0052
0053 G4bool operator<(const G4InteractionContent &right) const;
0054
0055 G4VSplitableHadron * GetProjectile() const ;
0056 G4VSplitableHadron * GetTarget() const;
0057
0058 void SetProjectileNucleon(G4Nucleon * aNucleon);
0059 G4Nucleon * GetProjectileNucleon() const;
0060
0061 void SetTargetNucleon(G4Nucleon * aNucleon);
0062 G4Nucleon * GetTargetNucleon() const;
0063
0064 void SetTarget(G4VSplitableHadron *aTarget);
0065
0066 G4int GetNumberOfSoftCollisions();
0067 G4int GetNumberOfHardCollisions();
0068 void SetNumberOfSoftCollisions(int);
0069 void SetNumberOfHardCollisions(int);
0070 G4int GetNumberOfDiffractiveCollisions();
0071 void SetNumberOfDiffractiveCollisions(int);
0072
0073 void SplitHadrons();
0074
0075 void SetInteractionTime(G4double aValue);
0076 G4double GetInteractionTime() const;
0077 void SetStatus(G4int aValue);
0078 G4int GetStatus() const;
0079
0080 #ifdef G4DEBUG
0081 void Dump();
0082 #endif
0083
0084 private:
0085 G4InteractionContent & operator=(const G4InteractionContent &right);
0086 G4InteractionContent(const G4InteractionContent &right);
0087 G4bool operator==(const G4InteractionContent &right) const;
0088 G4bool operator!=(const G4InteractionContent &right) const;
0089
0090 protected:
0091
0092 private:
0093 G4VSplitableHadron * theTarget;
0094 G4VSplitableHadron * theProjectile;
0095
0096 G4Nucleon * theProjectileNucleon;
0097 G4Nucleon * theTargetNucleon;
0098
0099 G4int theNumberOfHard;
0100 G4int theNumberOfSoft;
0101 G4int theNumberOfDiffractive;
0102
0103 G4double theInteractionTime;
0104 G4int curStatus;
0105 };
0106
0107
0108
0109 inline G4VSplitableHadron * G4InteractionContent::GetProjectile() const
0110 {
0111 return theProjectile;
0112 }
0113
0114 inline G4VSplitableHadron * G4InteractionContent::GetTarget() const
0115 {
0116 return theTarget;
0117 }
0118
0119 inline void G4InteractionContent::SetTarget(G4VSplitableHadron *aTarget)
0120 {
0121 theTarget = aTarget;
0122 }
0123
0124 inline void G4InteractionContent::SetProjectileNucleon(G4Nucleon * aNucleon)
0125 {
0126 theProjectileNucleon = aNucleon;
0127 }
0128
0129 inline G4Nucleon * G4InteractionContent::GetProjectileNucleon() const
0130 {
0131 return theProjectileNucleon;
0132 }
0133
0134 inline void G4InteractionContent::SetTargetNucleon(G4Nucleon * aNucleon)
0135 {
0136 theTargetNucleon = aNucleon;
0137 }
0138
0139 inline G4Nucleon * G4InteractionContent::GetTargetNucleon() const
0140 {
0141 return theTargetNucleon;
0142 }
0143
0144 inline G4int G4InteractionContent::GetNumberOfSoftCollisions()
0145 {
0146 return theNumberOfSoft;
0147 }
0148
0149 inline G4int G4InteractionContent::GetNumberOfHardCollisions()
0150 {
0151 return theNumberOfHard;
0152 }
0153
0154 inline void G4InteractionContent::SetNumberOfSoftCollisions(int nCol)
0155 {
0156 theNumberOfSoft = nCol;
0157 }
0158
0159 inline void G4InteractionContent::SetNumberOfHardCollisions(int nCol)
0160 {
0161 theNumberOfHard = nCol;
0162 }
0163
0164 inline G4int G4InteractionContent::GetNumberOfDiffractiveCollisions()
0165 {
0166 return theNumberOfDiffractive;
0167 }
0168
0169 inline void G4InteractionContent::SetNumberOfDiffractiveCollisions(int nCol)
0170 {
0171 theNumberOfDiffractive = nCol;
0172 }
0173
0174 inline void G4InteractionContent::SplitHadrons()
0175 {
0176
0177 if ( theProjectile != NULL ) {theProjectile->SplitUp();}
0178
0179 if ( theTarget != NULL ) {theTarget->SplitUp();}
0180 #ifdef G4DEBUG
0181
0182 #endif
0183 }
0184
0185 #ifdef G4DEBUG
0186 inline void G4InteractionContent::Dump()
0187 {
0188 G4LorentzVector mom(0.,0.,0.,0.);
0189 G4cout << " G4InteractionContent " << this << G4endl
0190 << "Hard/Soft/Diff "
0191 << theNumberOfHard<<" / "
0192 <<theNumberOfSoft<<" / "
0193 <<theNumberOfDiffractive << G4endl
0194 << "Projectile " ;
0195
0196 if ( theProjectile ) {
0197 G4cout << theProjectile->GetDefinition()->GetPDGEncoding()
0198 << " " << theProjectile->Get4Momentum()<< G4endl;
0199 mom+=theProjectile->Get4Momentum();
0200 } else {
0201 G4cout << " none " << G4endl;
0202 }
0203
0204 if ( theTarget ) {
0205 G4cout << "Target " << theTarget->GetDefinition()->GetPDGEncoding()
0206 << " " << theTarget->Get4Momentum()<< G4endl;
0207 mom+=theTarget->Get4Momentum();
0208 } else {
0209 G4cout << " none " << G4endl;
0210 }
0211 G4cout << "total 4-mom of interaction content " << mom << G4endl;
0212 }
0213 #endif
0214
0215 #endif
0216