ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4BinaryCascade.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4BinaryCascade.hh
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 //
28 // -------------------------------------------------------------------
29 // GEANT4 Class file
30 //
31 //
32 // File name: G4BinaryCascade.hh
33 //
34 // Authors: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
35 // Hans-Peter Wellisch
36 // Gunter Folger
37 //
38 // Creation date: 8 June 2000
39 //
40 // -----------------------------------------------------------------------------
41 
42 #ifndef G4BinaryCascade_hh
43 #define G4BinaryCascade_hh
44 
47 #include "G4KineticTrackVector.hh"
48 #include "G4ListOfCollisions.hh"
49 #include "G4V3DNucleus.hh"
50 #include "G4Fancy3DNucleus.hh"
51 #include "G4Fragment.hh"
52 #include "G4VFieldPropagation.hh"
53 #include "G4VScatterer.hh"
54 #include "G4LorentzVector.hh"
55 #include "G4LorentzRotation.hh"
56 
57 #include "G4BCDecay.hh"
58 #include "G4BCLateParticle.hh"
59 #include "G4BCAction.hh"
60 
61 #include "G4DecayKineticTracks.hh"
62 
63 #include "G4Threading.hh"
64 
65 class G4CollisionManager;
66 
67 class G4Track;
68 class G4KineticTrack;
69 class G43DNucleus;
70 class G4Scatterer;
71 
73 {
74 public:
75 
77 
78  virtual ~G4BinaryCascade();
79 
81  G4Nucleus& theNucleus);
83  G4V3DNucleus *);
84 
85  virtual void ModelDescription(std::ostream&) const;
86  virtual void PropagateModelDescription(std::ostream&) const;
87 
88 private:
89 
92  G4bool operator==(G4BinaryCascade& right) {return (this == &right);}
93  G4bool operator!=(G4BinaryCascade& right) {return (this != &right);}
94 
95 // Implementation
96  void PrintWelcomeMessage();
97  void BuildTargetList();
102 
103 // void PropagateInit();
104 // void Cascade();
109 
111  G4bool Capture(G4bool verbose=false);
112  G4bool Absorb();
115  void CorrectFinalPandE();
116 
118  G4KineticTrack* primary,G4KineticTrackVector target_collection);
120  G4KineticTrackVector * products, G4double initial_Efermi);
121 
122  void UpdateTracksAndCollisions(G4KineticTrackVector * oldSecondaries,
123  G4KineticTrackVector * oldTarget,
124  G4KineticTrackVector * newSecondaries);
125  G4bool DoTimeStep(G4double timeStep);
127  G4KineticTrackVector *out);
129  void StepParticlesOut();
130 
133 
135  G4V3DNucleus *);
137 
138  G4int GetTotalCharge(std::vector<G4KineticTrack *> & aV)
139  {
140  G4int result = 0;
141  std::vector<G4KineticTrack *>::iterator i;
142  for(i = aV.begin(); i != aV.end(); ++i)
143  {
144  result += G4lrint((*i)->GetDefinition()->GetPDGCharge());
145  }
146  return result;
147  }
148  G4int GetTotalBaryonCharge(std::vector<G4KineticTrack *> & aV)
149  {
150  G4int result = 0;
151  std::vector<G4KineticTrack *>::iterator i;
152  for(i = aV.begin(); i != aV.end(); ++i)
153  {
154  if ( (*i)->GetDefinition()->GetBaryonNumber() != 0 ){
155  result += G4lrint((*i)->GetDefinition()->GetPDGCharge());
156  }
157  }
158  return result;
159  }
160 
162  G4KineticTrackVector * secondaries); // add secondaries of string model to G4RPV
163  G4ReactionProductVector * FillVoidNucleusProducts(G4ReactionProductVector * ); // nucleus destroyed, add secondaries to G4RPV
164 // utility methods
165 
166  G4ThreeVector GetSpherePoint(G4double r, const G4LorentzVector & momentumdirection);
167 
170 
171 // for debugging purpose
172 
174 
175  void PrintKTVector(G4KineticTrackVector * ktv, std::string comment=std::string(""));
176  void PrintKTVector(G4KineticTrack* kt, std::string comment=std::string(""));
178  G4KineticTrackVector * products);
180  G4KineticTrackVector *products);
182  G4bool DebugEpConservation(const G4String where);
184 
185 private:
186  G4KineticTrackVector theProjectileList; // replaced by theProjectile4Momentum
187  G4KineticTrackVector theTargetList; // list of nucleons in Nucleus
188  G4KineticTrackVector theSecondaryList; // particles being followed
189  G4KineticTrackVector theCapturedList; // captured particles
190  G4KineticTrackVector theFinalState; // particles for final state
191 
192 
195 
197 
198  std::vector<G4BCAction *> theImR;
203 
213  G4double currentInitialEnergy; // for debugging
219  static G4int theBIC_ID;
220 #ifdef G4MULTITHREADED
221  static G4Mutex BICMutex;
222 #endif
223 
224 
225 };
226 
227 #endif
228 
229 
230 
231