Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4InteractionContent.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id$
28//
29
30#ifndef G4InteractionContent_h
31#define G4InteractionContent_h 1
32
33// ------------------------------------------------------------
34// GEANT 4 class header file
35//
36// ---------------- G4InteractionContent----------------
37// by Gunter Folger, June 1998.
38// class for a storing colliding particles in PartonString Models
39// ------------------------------------------------------------
40
41#include "globals.hh"
42#include "G4VSplitableHadron.hh"
43#include "G4Nucleon.hh" // Uzhi 16.07.09
44
45//#define debug_QGSM
46#ifdef debug_QGSM
47 #include "../../qgsm/include/G4QGSMSplitableHadron.hh"
48 #include <deque>
49#endif
50
52{
53
54 public:
55
57 G4InteractionContent(G4VSplitableHadron *aPrimaryParticipant);
58
60
61 G4bool operator<(const G4InteractionContent &right) const;
62
65
66 void SetTargetNucleon(G4Nucleon * aNucleon);
68
69 void SetTarget(G4VSplitableHadron *aTarget);
70
77
78 void SplitHadrons();
79
80 void SetInteractionTime(G4double aValue); // Uzhi Feb23
81 G4double GetInteractionTime() const; // Uzhi Feb23
82 void SetStatus(G4int aValue); // Uzhi Feb26
83 G4int GetStatus() const; // Uzhi Feb26
84
85#ifdef G4DEBUG
86 void Dump();
87#endif
88
89
90private:
91 G4InteractionContent & operator=(const G4InteractionContent &right);
93 int operator==(const G4InteractionContent &right) const;
94 int operator!=(const G4InteractionContent &right) const;
95
96 protected:
97
98 private:
99
100 G4VSplitableHadron * theTarget;
101 G4VSplitableHadron * theProjectile;
102 G4Nucleon * theTargetNucleon;
103
104 G4int theNumberOfHard;
105 G4int theNumberOfSoft;
106 G4int theNumberOfDiffractive;
107
108 G4double theInteractionTime;
109 G4int curStatus;
110
111};
112
113// Class G4InteractionContent
114
116{
117 return theProjectile;
118}
119
121{
122 return theTarget;
123}
124
126{
127 theTarget = aTarget;
128}
129
131{
132 theTargetNucleon = aNucleon;
133}
134
136{
137 return theTargetNucleon;
138}
139
141{
142 return theNumberOfSoft;
143}
144
146{
147 return theNumberOfHard;
148}
149
151{
152 theNumberOfSoft = nCol;
153}
154
156{
157 theNumberOfHard = nCol;
158}
159
161{
162 return theNumberOfDiffractive;
163}
164
166{
167 theNumberOfDiffractive = nCol;
168}
169
171{
172 if ( theProjectile != NULL ) theProjectile->SplitUp();
173 if ( theTarget != NULL ) theTarget->SplitUp();
174 #ifdef G4DEBUG
175 // Dump();
176 #endif
177}
178
179#ifdef G4DEBUG
180inline void G4InteractionContent::Dump()
181{
182 G4LorentzVector mom(0.,0.,0.,0.);
183 G4cout << " G4InteractionContent " << this << G4endl
184 << "Hard/Soft/Diff "
185 << theNumberOfHard<<" / "
186 <<theNumberOfSoft<<" / "
187 <<theNumberOfDiffractive << G4endl
188 << "Projectile " ;
189 if ( theProjectile ) {
190 G4cout << theProjectile->GetDefinition()->GetPDGEncoding()
191 << " " << theProjectile->Get4Momentum()<< G4endl;
192 mom+=theProjectile->Get4Momentum();
193 #ifdef debug_QGSM
194 G4QGSMSplitableHadron * at =(G4QGSMSplitableHadron*)theProjectile;
195 std::deque<G4Parton *>color=at->GetColorPartons();
196 std::deque<G4Parton *>anticolor=at->GetAntiColorPartons();
197 G4cout << " proj. color/anti size " << color.size() << " / " << anticolor.size() << G4endl;
198 std::deque<G4Parton *>::iterator p_iter;
199 G4LorentzVector colmom(0.,0.,0.,0.);
200 for ( p_iter=color.begin(); p_iter!= color.end(); ++p_iter){
201 G4cout << "proj color : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
202 colmom+=(*p_iter)->Get4Momentum();
203 }
204
205 G4LorentzVector anticolmom(0.,0.,0.,0.);
206 for ( p_iter=anticolor.begin(); p_iter!= anticolor.end(); ++p_iter){
207 G4cout << "proj antic : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
208 anticolmom+=(*p_iter)->Get4Momentum();
209 }
210 G4cout << " proj. color/anti mom " << colmom << " / " << anticolmom << " Sum: " << colmom+anticolmom <<G4endl;
211 #endif
212 } else {
213 G4cout << " none " << G4endl;
214 }
215 if ( theTarget ) {
216 G4cout << "Target " << theTarget->GetDefinition()->GetPDGEncoding()
217 << " " << theTarget->Get4Momentum()<< G4endl;
218 mom+=theTarget->Get4Momentum();
219 #ifdef debug_QGSM
221 std::deque<G4Parton *>color=at->GetColorPartons();
222 std::deque<G4Parton *>anticolor=at->GetAntiColorPartons();
223 G4cout << " target color/anti size " << color.size() << " / " << anticolor.size() << G4endl;
224 std::deque<G4Parton *>::iterator p_iter;
225 G4LorentzVector colmom(0.,0.,0.,0.);
226 for ( p_iter=color.begin(); p_iter!= color.end(); ++p_iter){
227 G4cout << "target color : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
228 colmom+=(*p_iter)->Get4Momentum();
229 }
230
231 G4LorentzVector anticolmom(0.,0.,0.,0.);
232 for ( p_iter=anticolor.begin(); p_iter!= anticolor.end(); ++p_iter){
233 G4cout << "target antic : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
234 anticolmom+=(*p_iter)->Get4Momentum();
235 }
236 G4cout << " target color/anti mom " << colmom << " / " << anticolmom << " Sum: " << colmom+anticolmom <<G4endl;
237 #endif
238 } else {
239 G4cout << " none " << G4endl;
240 }
241 G4cout << "total 4-mom of interaction content " << mom << G4endl;
242}
243#endif
244
245#endif
246
247
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void SetNumberOfDiffractiveCollisions(int)
G4double GetInteractionTime() const
void SetTargetNucleon(G4Nucleon *aNucleon)
G4Nucleon * GetTargetNucleon() const
G4bool operator<(const G4InteractionContent &right) const
G4VSplitableHadron * GetProjectile() const
void SetTarget(G4VSplitableHadron *aTarget)
void SetStatus(G4int aValue)
void SetInteractionTime(G4double aValue)
G4VSplitableHadron * GetTarget() const
virtual void SplitUp()=0
G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & Get4Momentum() const