Geant4  10.00.p03
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: G4InteractionContent.hh 67999 2013-03-13 11:14:32Z gcosmo $
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 
43 #include "G4PhysicalConstants.hh"
44 #include "G4SystemOfUnits.hh"
45 
46 #include "G4VSplitableHadron.hh"
47 #include "G4Nucleon.hh" // Uzhi 16.07.09
48 
49 //#define debug_QGSM
50 #ifdef debug_QGSM
51  #include "../../qgsm/include/G4QGSMSplitableHadron.hh"
52  #include <deque>
53 #endif
54 
56 {
57 
58  public:
59 
61  G4InteractionContent(G4VSplitableHadron *aPrimaryParticipant);
62 
64 
66 
68  G4VSplitableHadron * GetTarget() const;
69 
70  void SetProjectileNucleon(G4Nucleon * aNucleon); // Uzhi Nov. 2012
72 
73  void SetTargetNucleon(G4Nucleon * aNucleon);
74  G4Nucleon * GetTargetNucleon() const;
75 
76  void SetTarget(G4VSplitableHadron *aTarget);
77 
80  void SetNumberOfSoftCollisions(int);
81  void SetNumberOfHardCollisions(int);
84 
85  void SplitHadrons();
86 
87  void SetInteractionTime(G4double aValue); // Uzhi Feb23
88  G4double GetInteractionTime() const; // Uzhi Feb23
89  void SetStatus(G4int aValue); // Uzhi Feb26
90  G4int GetStatus() const; // Uzhi Feb26
91 
92 #ifdef G4DEBUG
93  void Dump();
94 #endif
95 
96 
97 private:
100  int operator==(const G4InteractionContent &right) const;
101  int operator!=(const G4InteractionContent &right) const;
102 
103  protected:
104 
105  private:
106 
109 
112 
116 
119 
120 };
121 
122 // Class G4InteractionContent
123 
125 {
126  return theProjectile;
127 }
128 
130 {
131  return theTarget;
132 }
133 
135 {
136  theTarget = aTarget;
137 }
138 
139 inline void G4InteractionContent::SetProjectileNucleon(G4Nucleon * aNucleon)// Uzhi Nov. 2012
140 {
141  theProjectileNucleon = aNucleon;
142 }
143 
145 {
146  return theProjectileNucleon;
147 }
148 
150 {
151  theTargetNucleon = aNucleon;
152 }
153 
155 {
156  return theTargetNucleon;
157 }
158 
160 {
161  return theNumberOfSoft;
162 }
163 
165 {
166  return theNumberOfHard;
167 }
168 
170 {
171  theNumberOfSoft = nCol;
172 }
173 
175 {
176  theNumberOfHard = nCol;
177 }
178 
180 {
181  return theNumberOfDiffractive;
182 }
183 
185 {
186  theNumberOfDiffractive = nCol;
187 }
188 
190 {
191  if ( theProjectile != NULL ) theProjectile->SplitUp();
192  if ( theTarget != NULL ) theTarget->SplitUp();
193  #ifdef G4DEBUG
194  // Dump();
195  #endif
196 }
197 
198 #ifdef G4DEBUG
199 inline void G4InteractionContent::Dump()
200 {
201  G4LorentzVector mom(0.,0.,0.,0.);
202  G4cout << " G4InteractionContent " << this << G4endl
203  << "Hard/Soft/Diff "
204  << theNumberOfHard<<" / "
205  <<theNumberOfSoft<<" / "
207  << "Projectile " ;
208  if ( theProjectile ) {
210  << " " << theProjectile->Get4Momentum()<< G4endl;
211  mom+=theProjectile->Get4Momentum();
212  #ifdef debug_QGSM
214  std::deque<G4Parton *>color=at->GetColorPartons();
215  std::deque<G4Parton *>anticolor=at->GetAntiColorPartons();
216  G4cout << " proj. color/anti size " << color.size() << " / " << anticolor.size() << G4endl;
217  std::deque<G4Parton *>::iterator p_iter;
218  G4LorentzVector colmom(0.,0.,0.,0.);
219  for ( p_iter=color.begin(); p_iter!= color.end(); ++p_iter){
220  G4cout << "proj color : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
221  colmom+=(*p_iter)->Get4Momentum();
222  }
223 
224  G4LorentzVector anticolmom(0.,0.,0.,0.);
225  for ( p_iter=anticolor.begin(); p_iter!= anticolor.end(); ++p_iter){
226  G4cout << "proj antic : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
227  anticolmom+=(*p_iter)->Get4Momentum();
228  }
229  G4cout << " proj. color/anti mom " << colmom << " / " << anticolmom << " Sum: " << colmom+anticolmom <<G4endl;
230  #endif
231  } else {
232  G4cout << " none " << G4endl;
233  }
234  if ( theTarget ) {
235  G4cout << "Target " << theTarget->GetDefinition()->GetPDGEncoding()
236  << " " << theTarget->Get4Momentum()<< G4endl;
237  mom+=theTarget->Get4Momentum();
238  #ifdef debug_QGSM
240  std::deque<G4Parton *>color=at->GetColorPartons();
241  std::deque<G4Parton *>anticolor=at->GetAntiColorPartons();
242  G4cout << " target color/anti size " << color.size() << " / " << anticolor.size() << G4endl;
243  std::deque<G4Parton *>::iterator p_iter;
244  G4LorentzVector colmom(0.,0.,0.,0.);
245  for ( p_iter=color.begin(); p_iter!= color.end(); ++p_iter){
246  G4cout << "target color : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
247  colmom+=(*p_iter)->Get4Momentum();
248  }
249 
250  G4LorentzVector anticolmom(0.,0.,0.,0.);
251  for ( p_iter=anticolor.begin(); p_iter!= anticolor.end(); ++p_iter){
252  G4cout << "target antic : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
253  anticolmom+=(*p_iter)->Get4Momentum();
254  }
255  G4cout << " target color/anti mom " << colmom << " / " << anticolmom << " Sum: " << colmom+anticolmom <<G4endl;
256  #endif
257  } else {
258  G4cout << " none " << G4endl;
259  }
260  G4cout << "total 4-mom of interaction content " << mom << G4endl;
261 }
262 #endif
263 
264 #endif
265 
266 
G4Nucleon * GetTargetNucleon() const
int operator!=(const G4InteractionContent &right) const
G4Nucleon * GetProjectileNucleon() const
void SetInteractionTime(G4double aValue)
int G4int
Definition: G4Types.hh:78
G4ParticleDefinition * GetDefinition() const
virtual void SplitUp()=0
G4InteractionContent & operator=(const G4InteractionContent &right)
G4bool operator<(const G4InteractionContent &right) const
void SetProjectileNucleon(G4Nucleon *aNucleon)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4LorentzVector & Get4Momentum() const
int operator==(const G4InteractionContent &right) const
void SetNumberOfDiffractiveCollisions(int)
void SetStatus(G4int aValue)
G4VSplitableHadron * theProjectile
G4VSplitableHadron * GetTarget() const
G4VSplitableHadron * GetProjectile() const
#define G4endl
Definition: G4ios.hh:61
G4VSplitableHadron * theTarget
double G4double
Definition: G4Types.hh:76
G4double GetInteractionTime() const
void SetTargetNucleon(G4Nucleon *aNucleon)
void SetTarget(G4VSplitableHadron *aTarget)
CLHEP::HepLorentzVector G4LorentzVector