Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 100828 2016-11-02 15:25:59Z 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  public:
59  G4InteractionContent(G4VSplitableHadron *aPrimaryParticipant);
60 
62 
63  G4bool operator<(const G4InteractionContent &right) const;
64 
66  G4VSplitableHadron * GetTarget() const;
67 
68  void SetProjectileNucleon(G4Nucleon * aNucleon);
70 
71  void SetTargetNucleon(G4Nucleon * aNucleon);
72  G4Nucleon * GetTargetNucleon() const;
73 
74  void SetTarget(G4VSplitableHadron *aTarget);
75 
78  void SetNumberOfSoftCollisions(int);
79  void SetNumberOfHardCollisions(int);
82 
83  void SplitHadrons();
84 
85  void SetInteractionTime(G4double aValue);
87  void SetStatus(G4int aValue);
88  G4int GetStatus() const;
89 
90  #ifdef G4DEBUG
91  void Dump();
92  #endif
93 
94  private:
95  G4InteractionContent & operator=(const G4InteractionContent &right);
97  int operator==(const G4InteractionContent &right) const;
98  int operator!=(const G4InteractionContent &right) const;
99 
100  protected:
101 
102  private:
103  G4VSplitableHadron * theTarget;
104  G4VSplitableHadron * theProjectile;
105 
106  G4Nucleon * theProjectileNucleon;
107  G4Nucleon * theTargetNucleon;
108 
109  G4int theNumberOfHard;
110  G4int theNumberOfSoft;
111  G4int theNumberOfDiffractive;
112 
113  G4double theInteractionTime;
114  G4int curStatus;
115 };
116 
117 // Class G4InteractionContent
118 
120 {
121  return theProjectile;
122 }
123 
125 {
126  return theTarget;
127 }
128 
130 {
131  theTarget = aTarget;
132 }
133 
135 {
136  theProjectileNucleon = aNucleon;
137 }
138 
140 {
141  return theProjectileNucleon;
142 }
143 
145 {
146  theTargetNucleon = aNucleon;
147 }
148 
150 {
151  return theTargetNucleon;
152 }
153 
155 {
156  return theNumberOfSoft;
157 }
158 
160 {
161  return theNumberOfHard;
162 }
163 
165 {
166  theNumberOfSoft = nCol;
167 }
168 
170 {
171  theNumberOfHard = nCol;
172 }
173 
175 {
176  return theNumberOfDiffractive;
177 }
178 
180 {
181  theNumberOfDiffractive = nCol;
182 }
183 
185 {
186  //G4cout<<"InterContent Proj "<<theProjectile<<G4endl;
187  if ( theProjectile != NULL ) {theProjectile->SplitUp();}
188  //G4cout<<"InterContent Targ "<<theTarget<<G4endl;
189  if ( theTarget != NULL ) {theTarget->SplitUp();}
190  #ifdef G4DEBUG
191  //Dump();
192  #endif
193 }
194 
195 #ifdef G4DEBUG
196 inline void G4InteractionContent::Dump()
197 {
198  G4LorentzVector mom(0.,0.,0.,0.);
199  G4cout << " G4InteractionContent " << this << G4endl
200  << "Hard/Soft/Diff "
201  << theNumberOfHard<<" / "
202  <<theNumberOfSoft<<" / "
203  <<theNumberOfDiffractive << G4endl
204  << "Projectile " ;
205 
206  if ( theProjectile ) {
207  G4cout << theProjectile->GetDefinition()->GetPDGEncoding()
208  << " " << theProjectile->Get4Momentum()<< G4endl;
209  mom+=theProjectile->Get4Momentum();
210  #ifdef debug_QGSM
211  G4QGSMSplitableHadron * at =(G4QGSMSplitableHadron*)theProjectile;
212  std::deque<G4Parton *>color=at->GetColorPartons();
213  std::deque<G4Parton *>anticolor=at->GetAntiColorPartons();
214  G4cout << " proj. color/anti size " << color.size() << " / " << anticolor.size() << G4endl;
215  std::deque<G4Parton *>::iterator p_iter;
216  G4LorentzVector colmom(0.,0.,0.,0.);
217  for ( p_iter=color.begin(); p_iter!= color.end(); ++p_iter){
218  G4cout << "proj color : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
219  colmom+=(*p_iter)->Get4Momentum();
220  }
221  G4LorentzVector anticolmom(0.,0.,0.,0.);
222  for ( p_iter=anticolor.begin(); p_iter!= anticolor.end(); ++p_iter){
223  G4cout << "proj antic : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
224  anticolmom+=(*p_iter)->Get4Momentum();
225  }
226  G4cout << " proj. color/anti mom " << colmom << " / " << anticolmom << " Sum: " << colmom+anticolmom <<G4endl;
227  #endif
228  } else {
229  G4cout << " none " << G4endl;
230  }
231 
232  if ( theTarget ) {
233  G4cout << "Target " << theTarget->GetDefinition()->GetPDGEncoding()
234  << " " << theTarget->Get4Momentum()<< G4endl;
235  mom+=theTarget->Get4Momentum();
236  #ifdef debug_QGSM
238  std::deque<G4Parton *>color=at->GetColorPartons();
239  std::deque<G4Parton *>anticolor=at->GetAntiColorPartons();
240  G4cout << " target color/anti size " << color.size() << " / " << anticolor.size() << G4endl;
241  std::deque<G4Parton *>::iterator p_iter;
242  G4LorentzVector colmom(0.,0.,0.,0.);
243  for ( p_iter=color.begin(); p_iter!= color.end(); ++p_iter){
244  G4cout << "target color : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
245  colmom+=(*p_iter)->Get4Momentum();
246  }
247  G4LorentzVector anticolmom(0.,0.,0.,0.);
248  for ( p_iter=anticolor.begin(); p_iter!= anticolor.end(); ++p_iter){
249  G4cout << "target antic : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
250  anticolmom+=(*p_iter)->Get4Momentum();
251  }
252  G4cout << " target color/anti mom " << colmom << " / " << anticolmom << " Sum: " << colmom+anticolmom <<G4endl;
253  #endif
254  } else {
255  G4cout << " none " << G4endl;
256  }
257  G4cout << "total 4-mom of interaction content " << mom << G4endl;
258 }
259 #endif
260 
261 #endif
262 
G4Nucleon * GetTargetNucleon() const
G4Nucleon * GetProjectileNucleon() const
void SetInteractionTime(G4double aValue)
int G4int
Definition: G4Types.hh:78
virtual void SplitUp()=0
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
void SetNumberOfDiffractiveCollisions(int)
void SetStatus(G4int aValue)
G4VSplitableHadron * GetTarget() const
G4VSplitableHadron * GetProjectile() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double GetInteractionTime() const
void SetTargetNucleon(G4Nucleon *aNucleon)
void SetTarget(G4VSplitableHadron *aTarget)