Geant4  10.02.p02
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 89732 2015-04-29 09:00:48Z 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" // Uzhi 8.09.2014
44 //#include "G4SystemOfUnits.hh" // Uzhi 8.09.2014
45 
46 #include "G4VSplitableHadron.hh"
47 #include "G4Nucleon.hh"
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);
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);
89  void SetStatus(G4int aValue);
90  G4int GetStatus() const;
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 
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 //G4cout<<"InterContent Proj "<<theProjectile<<G4endl;
192  if ( theProjectile != NULL ) {theProjectile->SplitUp();}
193 //G4cout<<"InterContent Targ "<<theTarget<<G4endl;
194  if ( theTarget != NULL ) {theTarget->SplitUp();}
195  #ifdef G4DEBUG
196  // Dump();
197  #endif
198 }
199 
200 #ifdef G4DEBUG
201 inline void G4InteractionContent::Dump()
202 {
203  G4LorentzVector mom(0.,0.,0.,0.);
204  G4cout << " G4InteractionContent " << this << G4endl
205  << "Hard/Soft/Diff "
206  << theNumberOfHard<<" / "
207  <<theNumberOfSoft<<" / "
209  << "Projectile " ;
210  if ( theProjectile ) {
212  << " " << theProjectile->Get4Momentum()<< G4endl;
213  mom+=theProjectile->Get4Momentum();
214  #ifdef debug_QGSM
216  std::deque<G4Parton *>color=at->GetColorPartons();
217  std::deque<G4Parton *>anticolor=at->GetAntiColorPartons();
218  G4cout << " proj. color/anti size " << color.size() << " / " << anticolor.size() << G4endl;
219  std::deque<G4Parton *>::iterator p_iter;
220  G4LorentzVector colmom(0.,0.,0.,0.);
221  for ( p_iter=color.begin(); p_iter!= color.end(); ++p_iter){
222  G4cout << "proj color : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
223  colmom+=(*p_iter)->Get4Momentum();
224  }
225 
226  G4LorentzVector anticolmom(0.,0.,0.,0.);
227  for ( p_iter=anticolor.begin(); p_iter!= anticolor.end(); ++p_iter){
228  G4cout << "proj antic : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
229  anticolmom+=(*p_iter)->Get4Momentum();
230  }
231  G4cout << " proj. color/anti mom " << colmom << " / " << anticolmom << " Sum: " << colmom+anticolmom <<G4endl;
232  #endif
233  } else {
234  G4cout << " none " << G4endl;
235  }
236  if ( theTarget ) {
237  G4cout << "Target " << theTarget->GetDefinition()->GetPDGEncoding()
238  << " " << theTarget->Get4Momentum()<< G4endl;
239  mom+=theTarget->Get4Momentum();
240  #ifdef debug_QGSM
242  std::deque<G4Parton *>color=at->GetColorPartons();
243  std::deque<G4Parton *>anticolor=at->GetAntiColorPartons();
244  G4cout << " target color/anti size " << color.size() << " / " << anticolor.size() << G4endl;
245  std::deque<G4Parton *>::iterator p_iter;
246  G4LorentzVector colmom(0.,0.,0.,0.);
247  for ( p_iter=color.begin(); p_iter!= color.end(); ++p_iter){
248  G4cout << "target color : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
249  colmom+=(*p_iter)->Get4Momentum();
250  }
251 
252  G4LorentzVector anticolmom(0.,0.,0.,0.);
253  for ( p_iter=anticolor.begin(); p_iter!= anticolor.end(); ++p_iter){
254  G4cout << "target antic : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
255  anticolmom+=(*p_iter)->Get4Momentum();
256  }
257  G4cout << " target color/anti mom " << colmom << " / " << anticolmom << " Sum: " << colmom+anticolmom <<G4endl;
258  #endif
259  } else {
260  G4cout << " none " << G4endl;
261  }
262  G4cout << "total 4-mom of interaction content " << mom << G4endl;
263 }
264 #endif
265 
266 #endif
267 
268 
G4Nucleon * GetTargetNucleon() const
int operator!=(const G4InteractionContent &right) const
G4Nucleon * GetProjectileNucleon() const
void SetInteractionTime(G4double aValue)
int G4int
Definition: G4Types.hh:78
virtual void SplitUp()=0
G4InteractionContent & operator=(const G4InteractionContent &right)
const G4ParticleDefinition * GetDefinition() const
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