00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // $Id$ 00027 // 00028 // 20100315 M. Kelsey -- Remove "using" directory and unnecessary #includes. 00029 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide() 00030 // 20100517 M. Kelsey -- Inherit from common base class, make other colliders 00031 // simple data members 00032 // 20100617 M. Kelsey -- Make G4NucleiModel a data member, instead of 00033 // creating and deleting on every cycle. 00034 // 20100623 M. Kelsey -- Undo change from 0617. G4NucleiModel not reusable. 00035 // 20100714 M. Kelsey -- Switch to new G4CascadeColliderBase class 00036 // 20100716 M. Kelsey -- Eliminate inter_case; use base-class functionality, 00037 // add function to compute recoil nuclear mass on the fly 00038 // 20100720 M. Kelsey -- Make EPCollider pointer member 00039 // 20100722 M. Kelsey -- Move cascade output buffers to .hh file 00040 // 20100728 M. Kelsey -- Move G4NucleiModel here, as pointer member 00041 // 20100907 M. Kelsey -- Add new "makeResidualFragment" to create 00042 // G4InuclNuclei at current stage of cascade 00043 // 20100909 M. Kelsey -- Drop makeResidualFragment(), getResidualMass() and 00044 // local G4InuclNuclei object, replace with new RecoilMaker. 00045 // Move goodCase() to RecoilMaker. 00046 // 20100916 M. Kelsey -- Add functions to handle trapped particles, and to 00047 // decay hyperons. 00048 // 20110224 M. Kelsey -- Add ::rescatter() function which takes a list of 00049 // pre-existing secondaries as input. Split ::collide() into 00050 // separate utility functions. Move cascade parameters to static 00051 // data members. Add setVerboseLevel(). 00052 // 20110303 M. Kelsey -- Add more cascade functions to support rescattering 00053 // 20110304 M. Kelsey -- Modify rescatter to use original Propagate() input 00054 // 20110316 M. Kelsey -- Add function to do G4KineticTrack conversion, decay 00055 // rescattering resonances in situ. 00056 // 20110324 M. Kelsey -- Add list of nucleon hit locations for rescatter(). 00057 // 20110721 M. Kelsey -- Drop decayTrappedParticle(G4KineticTrack*). 00058 // 20110722 M. Kelsey -- Deprecate "output_particles" list in favor of using 00059 // output directly (will help with pre-cascade issues). 00060 // 20110729 M. Kelsey -- Replace convertKineticToCascade() to reduce churn. 00061 // 20110801 M. Kelsey -- Add local target buffers for rescattering, to avoid 00062 // memory leak. 00063 // 20110919 M. Kelsey -- Add optional final-state clustering 00064 00065 #ifndef G4INTRA_NUCLEI_CASCADER_HH 00066 #define G4INTRA_NUCLEI_CASCADER_HH 00067 00068 #include "G4CascadeColliderBase.hh" 00069 #include "G4CollisionOutput.hh" 00070 #include "G4ThreeVector.hh" 00071 #include <vector> 00072 00073 class G4CascadParticle; 00074 class G4CascadeCoalescence; 00075 class G4CascadeRecoilMaker; 00076 class G4ElementaryParticleCollider; 00077 class G4InuclElementaryParticle; 00078 class G4InuclParticle; 00079 class G4KineticTrack; 00080 class G4KineticTrackVector; 00081 class G4NucleiModel; 00082 class G4V3DNucleus; 00083 00084 00085 class G4IntraNucleiCascader : public G4CascadeColliderBase { 00086 public: 00087 G4IntraNucleiCascader(); 00088 virtual ~G4IntraNucleiCascader(); 00089 00090 void collide(G4InuclParticle* bullet, G4InuclParticle* target, 00091 G4CollisionOutput& globalOutput); 00092 00093 // For use with Propagate to preload a set of secondaries 00094 void rescatter(G4InuclParticle* bullet, G4KineticTrackVector* theSecondaries, 00095 G4V3DNucleus* theNucleus, G4CollisionOutput& globalOutput); 00096 00097 void setVerboseLevel(G4int verbose=0); 00098 00099 private: 00100 static const G4int itry_max; // Maximum number of attempts 00101 static const G4int reflection_cut; // Maximum number of reflections 00102 static const G4double small_ekin; // Tolerance for round-off zero 00103 static const G4double quasielast_cut; // To recover elastic scatters 00104 00105 protected: 00106 G4bool initialize(G4InuclParticle* bullet, G4InuclParticle* target); 00107 00108 void newCascade(G4int itry); // Clear buffers for next attempt 00109 void setupCascade(); // Fill cascade using nuclear model 00110 void generateCascade(); // Track secondaries through nucleus 00111 G4bool finishCascade(); // Clean up output, check consistency 00112 00113 void finalize(G4int itry, // Transfer final state for return 00114 G4InuclParticle* bullet, G4InuclParticle* target, 00115 G4CollisionOutput& globalOutput); 00116 00117 G4InuclParticle* createTarget(G4V3DNucleus* theNucleus); 00118 00119 // Functions to transfer input high-energy cascade for propagation 00120 void preloadCascade(G4V3DNucleus* theNucleus, 00121 G4KineticTrackVector* theSecondaries); 00122 void copyWoundedNucleus(G4V3DNucleus* theNucleus); 00123 void copySecondaries(G4KineticTrackVector* theSecondaries); 00124 void processSecondary(const G4KineticTrack* aSecondary); 00125 void releaseSecondary(const G4KineticTrack* aSecondary); 00126 00127 // Functions to handle, e.g., low-energy hyperons stuck inside potential 00128 void processTrappedParticle(const G4CascadParticle& trapped); 00129 void decayTrappedParticle(const G4CascadParticle& trapped); 00130 00131 private: 00132 G4NucleiModel* model; 00133 G4ElementaryParticleCollider* theElementaryParticleCollider; 00134 G4CascadeRecoilMaker* theRecoilMaker; 00135 G4CascadeCoalescence* theClusterMaker; 00136 00137 // Buffers and parameters for cascade attempts 00138 G4InuclNuclei* tnuclei; // Target nucleus (must be non-zero) 00139 G4InuclNuclei* bnuclei; // Non-zero if ion-ion collision 00140 G4InuclElementaryParticle* bparticle; // Non-zero if hadron-ion collision 00141 00142 G4double minimum_recoil_A; // Require fragment with this mass 00143 G4double coulombBarrier; 00144 00145 // Buffers for creation (and reuse) of rescattering targets 00146 G4InuclNuclei* nucleusTarget; 00147 G4InuclElementaryParticle* protonTarget; 00148 00149 // Buffers for collecting result of cascade (reset on each iteration) 00150 G4CollisionOutput output; 00151 std::vector<G4CascadParticle> cascad_particles; 00152 std::vector<G4CascadParticle> new_cascad_particles; 00153 G4ExitonConfiguration theExitonConfiguration; 00154 00155 std::vector<G4ThreeVector> hitNucleons; // Nucleons hit before rescatter 00156 }; 00157 00158 #endif /* G4INTRA_NUCLEI_CASCADER_HH */