00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef G4CASCADE_COALESCENCE_HH
00036 #define G4CASCADE_COALESCENCE_HH
00037
00038 #include "globals.hh"
00039 #include "G4InuclNuclei.hh"
00040 #include "G4LorentzVector.hh"
00041 #include <vector>
00042 #include <set>
00043
00044 class G4CollisionOutput;
00045 class G4InuclElementaryParticle;
00046
00047
00048 class G4CascadeCoalescence {
00049 public:
00050 G4CascadeCoalescence(G4int verbose=0);
00051 virtual ~G4CascadeCoalescence();
00052
00053
00054 void FindClusters(G4CollisionOutput& finalState);
00055
00056 void setVerboseLevel(G4int verbose) { verboseLevel = verbose; }
00057
00058 private:
00059 typedef std::vector<size_t> ClusterCandidate;
00060
00061 G4int verboseLevel;
00062
00063 static const G4double dpMaxDoublet;
00064 static const G4double dpMaxTriplet;
00065 static const G4double dpMaxAlpha;
00066
00067 std::vector<ClusterCandidate> allClusters;
00068 std::set<size_t> triedClusters;
00069 std::set<size_t> usedNucleons;
00070
00071 G4CollisionOutput* thisFinalState;
00072 const std::vector<G4InuclElementaryParticle>* thisHadrons;
00073
00074 ClusterCandidate thisCluster;
00075 G4InuclNuclei thisLightIon;
00076
00077
00078 void selectCandidates();
00079 void createNuclei();
00080 void removeNucleons();
00081
00082
00083 void tryClusters(size_t idx1, size_t idx2);
00084 void tryClusters(size_t idx1, size_t idx2, size_t idx3);
00085 void tryClusters(size_t idx1, size_t idx2, size_t idx3, size_t idx4);
00086
00087
00088 void fillCluster(size_t idx1, size_t idx2);
00089 void fillCluster(size_t idx1, size_t idx2, size_t idx3);
00090 void fillCluster(size_t idx1, size_t idx2, size_t idx3, size_t idx4);
00091
00092
00093 size_t clusterHash(const ClusterCandidate& clus) const;
00094
00095
00096 bool clusterTried(const ClusterCandidate& clus) const {
00097 return triedClusters.find(clusterHash(clus)) != triedClusters.end();
00098 }
00099
00100
00101 bool nucleonUsed(size_t idx) const {
00102 return usedNucleons.find(idx) != usedNucleons.end();
00103 }
00104
00105
00106 bool allNucleons(const ClusterCandidate& clus) const;
00107 bool goodCluster(const ClusterCandidate& clus) const;
00108 G4int clusterType(const ClusterCandidate& aCluster) const;
00109
00110
00111 const G4InuclElementaryParticle& getHadron(size_t idx) const {
00112 return (*thisHadrons)[idx];
00113 }
00114
00115
00116 bool makeLightIon(const ClusterCandidate& aCluster);
00117
00118
00119 G4LorentzVector getClusterMomentum(const ClusterCandidate& aCluster) const;
00120
00121 G4double maxDeltaP(const ClusterCandidate& aCluster) const;
00122
00123
00124 void reportArgs(const G4String& name, const ClusterCandidate& clus) const;
00125 void reportResult(const G4String& name, const G4InuclNuclei& nucl) const;
00126 };
00127
00128 #endif