Geant4  10.02.p02
G4IntraNucleiCascader.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 // $Id: G4IntraNucleiCascader.hh 71719 2013-06-21 00:01:54Z mkelsey $
27 //
28 // 20100315 M. Kelsey -- Remove "using" directory and unnecessary #includes.
29 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide()
30 // 20100517 M. Kelsey -- Inherit from common base class, make other colliders
31 // simple data members
32 // 20100617 M. Kelsey -- Make G4NucleiModel a data member, instead of
33 // creating and deleting on every cycle.
34 // 20100623 M. Kelsey -- Undo change from 0617. G4NucleiModel not reusable.
35 // 20100714 M. Kelsey -- Switch to new G4CascadeColliderBase class
36 // 20100716 M. Kelsey -- Eliminate inter_case; use base-class functionality,
37 // add function to compute recoil nuclear mass on the fly
38 // 20100720 M. Kelsey -- Make EPCollider pointer member
39 // 20100722 M. Kelsey -- Move cascade output buffers to .hh file
40 // 20100728 M. Kelsey -- Move G4NucleiModel here, as pointer member
41 // 20100907 M. Kelsey -- Add new "makeResidualFragment" to create
42 // G4InuclNuclei at current stage of cascade
43 // 20100909 M. Kelsey -- Drop makeResidualFragment(), getResidualMass() and
44 // local G4InuclNuclei object, replace with new RecoilMaker.
45 // Move goodCase() to RecoilMaker.
46 // 20100916 M. Kelsey -- Add functions to handle trapped particles, and to
47 // decay hyperons.
48 // 20110224 M. Kelsey -- Add ::rescatter() function which takes a list of
49 // pre-existing secondaries as input. Split ::collide() into
50 // separate utility functions. Move cascade parameters to static
51 // data members. Add setVerboseLevel().
52 // 20110303 M. Kelsey -- Add more cascade functions to support rescattering
53 // 20110304 M. Kelsey -- Modify rescatter to use original Propagate() input
54 // 20110316 M. Kelsey -- Add function to do G4KineticTrack conversion, decay
55 // rescattering resonances in situ.
56 // 20110324 M. Kelsey -- Add list of nucleon hit locations for rescatter().
57 // 20110721 M. Kelsey -- Drop decayTrappedParticle(G4KineticTrack*).
58 // 20110722 M. Kelsey -- Deprecate "output_particles" list in favor of using
59 // output directly (will help with pre-cascade issues).
60 // 20110729 M. Kelsey -- Replace convertKineticToCascade() to reduce churn.
61 // 20110801 M. Kelsey -- Add local target buffers for rescattering, to avoid
62 // memory leak.
63 // 20110919 M. Kelsey -- Add optional final-state clustering
64 // 20130304 M. Kelsey -- Add new G4CascadeHistory for cacasde structure reporting
65 // 20130620 Address Coverity complaint about missing copy actions
66 // 20141204 M. Kelsey -- Add function to test for non-interacting particles
67 
68 #ifndef G4INTRA_NUCLEI_CASCADER_HH
69 #define G4INTRA_NUCLEI_CASCADER_HH
70 
71 #include "G4CascadeColliderBase.hh"
72 #include "G4CollisionOutput.hh"
73 #include "G4ThreeVector.hh"
74 #include <vector>
75 
76 class G4CascadParticle;
78 class G4CascadeHistory;
82 class G4InuclParticle;
83 class G4KineticTrack;
85 class G4NucleiModel;
86 class G4V3DNucleus;
87 
88 
90 public:
92  virtual ~G4IntraNucleiCascader();
93 
94  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
95  G4CollisionOutput& globalOutput);
96 
97  // For use with Propagate to preload a set of secondaries
98  void rescatter(G4InuclParticle* bullet, G4KineticTrackVector* theSecondaries,
99  G4V3DNucleus* theNucleus, G4CollisionOutput& globalOutput);
100 
101  void setVerboseLevel(G4int verbose=0);
102 
103 private:
104  static const G4int itry_max; // Maximum number of attempts
105  static const G4int reflection_cut; // Maximum number of reflections
106  static const G4double small_ekin; // Tolerance for round-off zero
107  static const G4double quasielast_cut; // To recover elastic scatters
108 
109 protected:
111 
112  void newCascade(G4int itry); // Clear buffers for next attempt
113  void setupCascade(); // Fill cascade using nuclear model
114  void generateCascade(); // Track secondaries through nucleus
115  G4bool finishCascade(); // Clean up output, check consistency
116 
117  void finalize(G4int itry, // Transfer final state for return
118  G4InuclParticle* bullet, G4InuclParticle* target,
119  G4CollisionOutput& globalOutput);
120 
122 
123  // Functions to transfer input high-energy cascade for propagation
124  void preloadCascade(G4V3DNucleus* theNucleus,
125  G4KineticTrackVector* theSecondaries);
126  void copyWoundedNucleus(G4V3DNucleus* theNucleus);
127  void copySecondaries(G4KineticTrackVector* theSecondaries);
128  void processSecondary(const G4KineticTrack* aSecondary);
129  void releaseSecondary(const G4KineticTrack* aSecondary);
130 
131  // Functions to handle, e.g., low-energy hyperons stuck inside potential
132  void processTrappedParticle(const G4CascadParticle& trapped);
133  void decayTrappedParticle(const G4CascadParticle& trapped);
134 
135  // Test if particle is able to interact in nucleus
136  G4bool particleCanInteract(const G4CascadParticle& cpart) const;
137 
138 private:
144 
145  // Buffers and parameters for cascade attempts
146  G4InuclNuclei* tnuclei; // Target nucleus (must be non-zero)
147  G4InuclNuclei* bnuclei; // Non-zero if ion-ion collision
148  G4InuclElementaryParticle* bparticle; // Non-zero if hadron-ion collision
149 
150  G4double minimum_recoil_A; // Require fragment with this mass
152 
153  // Buffers for creation (and reuse) of rescattering targets
156 
157  // Buffers for collecting result of cascade (reset on each iteration)
159  std::vector<G4CascadParticle> cascad_particles;
160  std::vector<G4CascadParticle> new_cascad_particles;
162 
163  std::vector<G4ThreeVector> hitNucleons; // Nucleons hit before rescatter
164 
165 private:
166  // Copying of modules is forbidden
169 };
170 
171 #endif /* G4INTRA_NUCLEI_CASCADER_HH */
G4InuclElementaryParticle * protonTarget
void processTrappedParticle(const G4CascadParticle &trapped)
std::vector< G4CascadParticle > cascad_particles
static const G4int reflection_cut
G4CascadeHistory * theCascadeHistory
G4ExitonConfiguration theExitonConfiguration
static const G4double quasielast_cut
G4IntraNucleiCascader & operator=(const G4IntraNucleiCascader &)
std::vector< G4ThreeVector > hitNucleons
G4bool particleCanInteract(const G4CascadParticle &cpart) const
int G4int
Definition: G4Types.hh:78
G4InuclParticle * createTarget(G4V3DNucleus *theNucleus)
G4CascadeCoalescence * theClusterMaker
G4bool initialize(G4InuclParticle *bullet, G4InuclParticle *target)
void decayTrappedParticle(const G4CascadParticle &trapped)
G4CascadeRecoilMaker * theRecoilMaker
bool G4bool
Definition: G4Types.hh:79
void rescatter(G4InuclParticle *bullet, G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus, G4CollisionOutput &globalOutput)
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
void processSecondary(const G4KineticTrack *aSecondary)
static const G4double small_ekin
void copyWoundedNucleus(G4V3DNucleus *theNucleus)
void copySecondaries(G4KineticTrackVector *theSecondaries)
void setVerboseLevel(G4int verbose=0)
std::vector< G4CascadParticle > new_cascad_particles
double G4double
Definition: G4Types.hh:76
void finalize(G4int itry, G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
G4ElementaryParticleCollider * theElementaryParticleCollider
void releaseSecondary(const G4KineticTrack *aSecondary)
void preloadCascade(G4V3DNucleus *theNucleus, G4KineticTrackVector *theSecondaries)
G4InuclElementaryParticle * bparticle