- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- Location:
- trunk/source/processes/hadronic/models/cascade/cascade/include
- Files:
-
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/cascade/cascade/include/G4BigBanger.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4BigBanger.hh,v 1.13 2010/05/21 17:56:34 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100315 M. Kelsey -- Remove "using" directive and unnecessary #includes. 29 // 20100407 M. Kelsey -- Replace std::vector<> returns with data members. 30 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide() 31 // 20100517 M. Kelsey -- Inherit from common base class 32 // 20100519 M. Kelsey -- Get rid of proton and neutron masses as arguments! 33 26 34 #ifndef G4BIG_BANGER_HH 27 35 #define G4BIG_BANGER_HH 28 36 29 #include "G4 Collider.hh"37 #include "G4VCascadeCollider.hh" 30 38 #include "G4InuclElementaryParticle.hh" 31 #include "G4InuclSpecialFunctions.hh" 39 #include <vector> 40 41 class G4CollisionOutput; 32 42 33 43 34 using namespace G4InuclSpecialFunctions; 44 class G4BigBanger : public G4VCascadeCollider { 45 public: 46 G4BigBanger(); 47 virtual ~G4BigBanger() {}; 35 48 36 class G4BigBanger { 37 38 public: 39 40 G4BigBanger(); 41 42 G4CollisionOutput collide(G4InuclParticle* bullet, 43 G4InuclParticle* target); 49 void collide(G4InuclParticle* bullet, G4InuclParticle* target, 50 G4CollisionOutput& output); 44 51 45 52 private: 53 void generateBangInSCM(G4double etot, G4double a, G4double z); 46 54 47 G4int verboseLevel; 48 std::vector<G4InuclElementaryParticle> generateBangInSCM(G4double etot, 49 G4double a, 50 G4double z, 51 G4double mp, 52 G4double mn) const; 53 54 std::vector<G4double> generateMomentumModules(G4double etot, 55 G4double a, 56 G4double z, 57 G4double mp, 58 G4double mn) const; 55 void generateMomentumModules(G4double etot, G4double a, G4double z); 59 56 60 57 G4double xProbability(G4double x, … … 67 64 G4double promax) const; 68 65 66 // Buffers for big-bang results 67 std::vector<G4InuclElementaryParticle> particles; 68 std::vector<G4double> momModules; 69 69 }; 70 70 71 #endif / / G4BIG_BANGER_HH71 #endif /* G4BIG_BANGER_HH */ 72 72 73 73 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadParticle.hh
r1196 r1315 1 #ifndef G4CASCAD_PARTICLE_HH 2 #define G4CASCAD_PARTICLE_HH 1 3 // 2 4 // ******************************************************************** … … 23 25 // * acceptance of all terms of the Geant4 Software license. * 24 26 // ******************************************************************** 27 // $Id: G4CascadParticle.hh,v 1.14 2010/03/16 22:10:26 mkelsey Exp $ 28 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 29 // 26 #ifndef G4CASCAD_PARTICLE_HH 27 #define G4CASCAD_PARTICLE_HH 30 // 20100112 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly 31 // 20100126 M. Kelsey -- Replace vector<G4Double> position with G4ThreeVector, 32 // move ::print() to .cc file, fix uninitialized data members 28 33 29 34 #include "G4InuclElementaryParticle.hh" 35 #include "G4LorentzVector.hh" 36 #include "G4ThreeVector.hh" 37 30 38 31 39 class G4CascadParticle { 32 40 33 41 public: 34 42 // NOTE: Default constructor does not make a functional object! 35 43 G4CascadParticle(); 36 44 37 45 G4CascadParticle(const G4InuclElementaryParticle& particle, 38 const std::vector<G4double>& pos,46 const G4ThreeVector& pos, 39 47 G4int izone, 40 48 G4double cpath, 41 49 G4int gen) 50 : verboseLevel(0), theParticle(particle), position(pos), 51 current_zone(izone), current_path(cpath), movingIn(true), 52 reflectionCounter(0), reflected(false), generation(gen) {} 42 53 43 : theParticle(particle), 44 position(pos), 45 current_zone(izone), 46 current_path(cpath) { 47 current_path = cpath; 48 movingIn = true; 49 reflectionCounter = 0; 50 generation = gen; 51 }; 54 void updateParticleMomentum(const G4LorentzVector& mom) { 55 theParticle.setMomentum(mom); 56 } 52 57 53 void updateParticleMomentum(const G4CascadeMomentum& mom) { 54 theParticle.setMomentum(mom); 55 }; 56 57 void updatePosition(const std::vector<G4double>& pos) { 58 void updatePosition(const G4ThreeVector& pos) { 58 59 position = pos; 59 } ;60 } 60 61 61 62 void incrementReflectionCounter() { 62 63 reflectionCounter++; 63 64 reflected = true; 64 } ;65 } 65 66 66 67 void resetReflection() { 67 68 reflected = false; 68 } ;69 } 69 70 70 71 void incrementCurrentPath(G4double npath) { 71 72 current_path += npath; 72 } ;73 } 73 74 74 75 void updateZone(G4int izone) { 75 76 current_zone = izone; 76 } ;77 } 77 78 78 79 G4bool movingInsideNuclei() const { 79 80 return movingIn; 80 } ;81 } 81 82 82 83 G4double getPathToTheNextZone(G4double rz_in, 83 84 G4double rz_out); 84 85 85 const G4CascadeMomentum& getMomentum() const {86 G4LorentzVector getMomentum() const { // Can't return ref; temporary 86 87 return theParticle.getMomentum(); 87 } ;88 } 88 89 89 G4InuclElementaryParticlegetParticle() const {90 const G4InuclElementaryParticle& getParticle() const { 90 91 return theParticle; 91 } ;92 } 92 93 93 const std::vector<G4double>& getPosition() const { 94 G4InuclElementaryParticle& getParticle() { 95 return theParticle; 96 } 97 98 const G4ThreeVector& getPosition() const { 94 99 return position; 95 } ;100 } 96 101 97 102 G4int getCurrentZone() const { 98 103 return current_zone; 99 } ;104 } 100 105 101 106 G4int getNumberOfReflections() const { 102 107 return reflectionCounter; 103 } ;108 } 104 109 105 110 G4bool young(G4double young_path_cut, 106 111 G4double cpath) const { 107 108 if(current_path < 1000.0) { 109 return cpath < young_path_cut; 110 } 111 else { 112 return false; 113 }; 114 // return current_path + cpath < young_path_cut; 115 }; 112 return ((current_path < 1000.) && (cpath < young_path_cut)); 113 } 116 114 117 115 G4bool reflectedNow() const { 118 116 return reflected; 119 } ;117 } 120 118 121 119 void propagateAlongThePath(G4double path); 122 120 123 void print() const { 124 theParticle.printParticle(); 125 G4cout << " zone " << current_zone << " current_path " << current_path 126 << " reflectionCounter " << reflectionCounter << G4endl 127 << " x " << position[0] << " y " << position[1] 128 << " z " << position[2] << G4endl; 129 }; 121 void print() const; 130 122 131 123 G4int getGeneration() { … … 134 126 135 127 private: 136 137 128 G4int verboseLevel; 138 129 G4InuclElementaryParticle theParticle; 139 std::vector<G4double>position;130 G4ThreeVector position; 140 131 G4int current_zone; 141 132 G4double current_path; -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeChannel.hh,v 1.6 2010/05/15 04:25:17 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100514 M. Kelsey -- All functionality removed except quantum-number 29 // validation functions. 30 26 31 #ifndef G4_CASCADE_CHANNEL_HH 27 32 #define G4_CASCADE_CHANNEL_HH 28 33 29 34 #include "globals.hh" 35 #include "G4FastVector.hh" 36 #include "G4ReactionProduct.hh" 30 37 #include <vector> 31 38 32 class G4CascadeChannel { 39 namespace G4CascadeChannel { 40 std::vector<G4int> getQnums(G4int type); 33 41 34 public: 35 36 static std::pair<G4int, G4double> interpolateEnergy(G4double ke); 37 static G4int sampleFlat(std::vector<G4double> const& sigma); 38 static std::vector<G4int> getQnums(G4int type); 39 40 private: 41 G4CascadeChannel(); // not implemented 42 43 static const double energyScale[31]; 44 }; 42 void CheckQnums(const G4FastVector<G4ReactionProduct,256> &vec, 43 G4int &vecLen, 44 G4ReactionProduct ¤tParticle, 45 G4ReactionProduct &targetParticle, 46 G4double Q, G4double B, G4double S); 47 } 45 48 46 49 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeData.hh
r967 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeData.hh,v 1.5 2010/05/16 05:18:36 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Use template arguments to dimension const-refs 29 // to arrays,for use in passing to functions as dimensioned. 30 // Add two additional optional(!) template args for piN/NN. 31 // Add new data member "sum" to separate summed xsec values 32 // from measured inclusive (tot) cross-sections. Add two 33 // ctors to pass inclusive xsec array as input (for piN/NN). 34 26 35 #ifndef G4_CASCADE_DATA_HH 27 36 #define G4_CASCADE_DATA_HH 28 37 29 38 #include "globals.hh" 39 #include "G4CascadeSampler.hh" /* To get number of energy bins */ 30 40 31 template <int n2, int n3, int n4, int n5, int n6, int n7, int nxs>41 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8=0,int N9=0> 32 42 struct G4CascadeData 33 43 { 34 G4double * tot; 44 // NOTE: Need access to N2 by value to initialize index array 45 enum { N02=N2, N23=N2+N3, N24=N23+N4, N25=N24+N5, N26=N25+N6, N27=N26+N7, 46 N28=N27+N8, N29=N28+N9 }; 35 47 36 typedef G4double multiplicities_t[31]; 37 multiplicities_t * multiplicities; 48 enum { N8D=N8?N8:1, N9D=N9?N9:1 }; // SPECIAL: Can't dimension arrays [0] 38 49 39 typedef G4int index_t[2]; 40 index_t const * index; 50 enum { NM=N9?8:N8?7:6, NXS=N29 }; // Multiplicity and cross-section bins 41 51 42 typedef G4int x2bfs_t[2];43 x2bfs_t const * x2bfs;52 G4int index[NM+1]; // Start and stop indices to xsec's 53 G4double multiplicities[NM][NE]; // Multiplicity distributions 44 54 45 typedef G4int x3bfs_t[3]; 46 x3bfs_t const * x3bfs; 55 const G4int (&x2bfs)[N2][2]; // Initialized from file-scope inputs 56 const G4int (&x3bfs)[N3][3]; 57 const G4int (&x4bfs)[N4][4]; 58 const G4int (&x5bfs)[N5][5]; 59 const G4int (&x6bfs)[N6][6]; 60 const G4int (&x7bfs)[N7][7]; 61 const G4int (&x8bfs)[N8D][8]; // These may not be used if mult==7 62 const G4int (&x9bfs)[N9D][9]; 63 const G4double (&crossSections)[NXS][NE]; 47 64 48 typedef G4int x4bfs_t[4];49 x4bfs_t const * x4bfs;65 G4double sum[NE]; // Summed cross-sections, computed 66 const G4double (&tot)[NE]; // Inclusive cross-sections (from input) 50 67 51 typedef G4int x5bfs_t[5];52 x5bfs_t const * x5bfs;68 static const G4int empty8bfs[1][8]; // For multiplicity==7 case 69 static const G4int empty9bfs[1][9]; 53 70 54 typedef G4int x6bfs_t[6]; 55 x6bfs_t const * x6bfs; 71 G4int maxMultiplicity() const { return NM+1; } // Used by G4CascadeFunctions 56 72 57 typedef G4int x7bfs_t[7]; 58 x7bfs_t const * x7bfs; 73 // Constructor for kaon/hyperon channels, with multiplicity <= 7 74 G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3], 75 const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5], 76 const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7], 77 const G4double (&xsec)[NXS][NE]) 78 : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs), 79 x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(empty8bfs), x9bfs(empty9bfs), 80 crossSections(xsec), tot(sum) { initialize(); } 59 81 60 typedef G4float crossSections_t[31]; 61 crossSections_t const * crossSections; 82 // Constructor for kaon/hyperon channels, with multiplicity <= 7 and inclusive 83 G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3], 84 const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5], 85 const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7], 86 const G4double (&xsec)[NXS][NE], const G4double (&theTot)[NE]) 87 : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs), 88 x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(empty8bfs), x9bfs(empty9bfs), 89 crossSections(xsec), tot(theTot) { initialize(); } 62 90 63 void initialize(); 91 // Constructor for pion/nuleon channels, with multiplicity > 7 92 G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3], 93 const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5], 94 const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7], 95 const G4int (&the8bfs)[N8D][8], const G4int (&the9bfs)[N9D][9], 96 const G4double (&xsec)[NXS][NE]) 97 : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs), 98 x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(the8bfs), x9bfs(the9bfs), 99 crossSections(xsec), tot(sum) { initialize(); } 64 100 65 // G4double tot[31]; 66 // G4double multiplicities[6][31]; 67 68 // G4int index[6][2]; 69 // G4int x2bfs[n2][2]; 70 // G4int x3bfs[n3][3]; 71 // G4int x4bfs[n4][4]; 72 // G4int x5bfs[n5][5]; 73 // G4int x6bfs[n6][6]; 74 // G4int x7bfs[n7][7]; 75 76 // G4float crossSections[nxs][31]; 101 // Constructor for pion/nuleon channels, with multiplicity > 7 and inclusive 102 G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3], 103 const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5], 104 const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7], 105 const G4int (&the8bfs)[N8D][8], const G4int (&the9bfs)[N9D][9], 106 const G4double (&xsec)[NXS][NE], const G4double (&theTot)[NE]) 107 : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs), 108 x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(the8bfs), x9bfs(the9bfs), 109 crossSections(xsec), tot(theTot) { initialize(); } 110 void initialize(); // Fill summed arrays from input 77 111 }; 78 112 79 template <int n2, int n3, int n4, int n5, int n6, int n7, int nxs> 80 inline 81 void 82 G4CascadeData<n2, n3, n4, n5, n6, n7, nxs>::initialize() 83 { 113 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9> inline 114 void G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::initialize() { 115 // Initialize index offsets for cross-section array (can't do globally) 116 index[0] = 0; index[1] = N02; index[2] = N23; index[3] = N24; 117 index[4] = N25; index[5] = N26; index[6] = N27; 118 if (NM>6) index[7]=N28; 119 if (NM>7) index[8]=N29; 120 84 121 // Initialize multiplicity array 85 86 for (G4int m = 0; m < 6; m++) { 87 G4int start = index[m][0]; 88 G4int stop = index[m][1]; 89 for (G4int k = 0; k < 31; k++) { 122 for (G4int m = 0; m < NM; m++) { 123 G4int start = index[m]; 124 G4int stop = index[m+1]; 125 for (G4int k = 0; k < NE; k++) { 90 126 multiplicities[m][k] = 0.0; 91 127 for (G4int i = start; i < stop; i++) { … … 96 132 97 133 // Initialize total cross section array 98 99 for (G4int k = 0; k < 31; k++) { 100 tot[k] = 0.0; 101 for (G4int m = 0; m < 6; m++) { 102 tot[k] += multiplicities[m][k]; 134 for (G4int k = 0; k < NE; k++) { 135 sum[k] = 0.0; 136 for (G4int m = 0; m < NM; m++) { 137 sum[k] += multiplicities[m][k]; 103 138 } 104 139 } 105 140 } 106 141 142 // Dummy arrays for use when optional template arguments are skipped 143 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9> 144 const G4int G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::empty8bfs[1][8] = {{0}}; 145 146 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9> 147 const G4int G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::empty9bfs[1][9] = {{0}}; 148 107 149 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeFunctions.hh
r967 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeFunctions.hh,v 1.5 2010/05/14 21:05:03 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100407 M. Kelsey -- Return particle types std::vector<> by const ref, 29 // using a static variable in the function as a buffer. 30 // 20100505 M. Kelsey -- Use new interpolator class, drop std::pair<>, move 31 // sampleFlat(...) from G4CascadeChannel, move functionality 32 // to new base class, to allow data-member buffers. Move 33 // function definitions to .icc file (needed with templating). 34 // 20100510 M. Kelsey -- Use both summed and inclusive cross-sections for 35 // multiplicity, as done in G4{Pion,Nucleon}Sampler. Support 36 // up to 9-body final states. Add second argument specifying 37 // which Sampler is used. Move implementations to .icc file. 38 // 20100511 M. Kelsey -- Pass "kinds" buffer as input to getOutputPartTypes 39 26 40 #ifndef G4_CASCADE_FUNCTIONS_HH 27 41 #define G4_CASCADE_FUNCTIONS_HH 28 42 43 #include "globals.hh" 44 #include "Randomize.hh" 29 45 #include <vector> 30 #include "globals.hh"31 #include "G4CascadeChannel.hh"32 46 33 template <class T> 34 class G4CascadeFunctions 35 {47 48 template <class DATA, class SAMP> 49 class G4CascadeFunctions : public SAMP { 36 50 public: 37 static G4double getCrossSection(double ke); 51 static G4double getCrossSection(double ke) { 52 return instance.findCrossSection(ke, DATA::data.tot); 53 } 54 55 static G4double getCrossSectionSum(double ke) { 56 return instance.findCrossSection(ke, DATA::data.sum); 57 } 58 38 59 static G4int getMultiplicity(G4double ke); 39 static std::vector<G4int> getOutgoingParticleTypes(G4int mult, G4double ke); 60 61 static void 62 getOutgoingParticleTypes(std::vector<G4int>& kinds, G4int mult, G4double ke); 63 64 private: 65 G4CascadeFunctions() : SAMP() {} 66 static const G4CascadeFunctions<DATA,SAMP> instance; 40 67 }; 41 68 42 template <class T> 43 inline 44 G4double 45 G4CascadeFunctions<T>::getCrossSection(double ke) 46 { 47 std::pair<G4int, G4double> epair = G4CascadeChannel::interpolateEnergy(ke); 48 G4int k = epair.first; 49 G4double fraction = epair.second; 50 return T::data.tot[k] + fraction*(T::data.tot[k+1] - T::data.tot[k]); 51 } 69 #include "G4CascadeFunctions.icc" 52 70 53 template <class T> 54 inline 55 G4int 56 G4CascadeFunctions<T>::getMultiplicity(G4double ke) 57 { 58 G4double multint(0.0); 59 std::vector<G4double> sigma; 60 61 std::pair<G4int, G4double> epair = G4CascadeChannel::interpolateEnergy(ke); 62 G4int k = epair.first; 63 G4double fraction = epair.second; 64 65 for (G4int m = 0; m < 6; ++m) 66 { 67 multint = T::data.multiplicities[m][k] 68 + fraction * (T::data.multiplicities[m][k+1] - T::data.multiplicities[m][k]); 69 sigma.push_back(multint); 70 } 71 72 return G4CascadeChannel::sampleFlat(sigma); 73 } 74 75 template <class T> 76 inline 77 std::vector<G4int> 78 G4CascadeFunctions<T>::getOutgoingParticleTypes(G4int mult, G4double ke) 79 { 80 G4int i; 81 G4double sigint(0.); 82 std::vector<G4double> sigma; 83 84 std::pair<G4int, G4double> epair = G4CascadeChannel::interpolateEnergy(ke); 85 G4int k = epair.first; 86 G4double fraction = epair.second; 87 88 G4int start = T::data.index[mult-2][0]; 89 G4int stop = T::data.index[mult-2][1]; 90 91 for (i = start; i < stop; i++) { 92 sigint = T::data.crossSections[i][k] 93 + fraction*(T::data.crossSections[i][k+1] - T::data.crossSections[i][k]); 94 sigma.push_back(sigint); 95 } 96 97 G4int channel = G4CascadeChannel::sampleFlat(sigma); 98 99 std::vector<G4int> kinds; 100 101 if (mult == 2) { 102 for(i = 0; i < mult; i++) kinds.push_back(T::data.x2bfs[channel][i]); 103 } else if (mult == 3) { 104 for(i = 0; i < mult; i++) kinds.push_back(T::data.x3bfs[channel][i]); 105 } else if (mult == 4) { 106 for(i = 0; i < mult; i++) kinds.push_back(T::data.x4bfs[channel][i]); 107 } else if (mult == 5) { 108 for(i = 0; i < mult; i++) kinds.push_back(T::data.x5bfs[channel][i]); 109 } else if (mult == 6) { 110 for(i = 0; i < mult; i++) kinds.push_back(T::data.x6bfs[channel][i]); 111 } else if (mult == 7) { 112 for(i = 0; i < mult; i++) kinds.push_back(T::data.x7bfs[channel][i]); 113 } else { 114 G4cout << " Illegal multiplicity " << G4endl; 115 } 116 117 return kinds; 118 } 119 120 121 #endif 71 #endif /* G4_CASCADE_FUNCTIONS_HH */ -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeInterface.hh
r1196 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CascadeInterface.hh,v 1.1 4 2009/09/24 20:48:02 dennisExp $26 // $Id: G4CascadeInterface.hh,v 1.16 2010/05/21 18:07:30 mkelsey Exp $ 27 27 // Defines an interface to Bertini (BERT) cascade 28 28 // based on INUCL intra-nuclear transport.models 29 29 // with bullet hadron energy ~< 10 GeV 30 // 31 // 20100405 M. Kelsey -- Fix constness of op== and op!= 32 // 20100519 M. Kelsey -- Remove Collider data members 30 33 31 34 #ifndef G4CASCADEINTERFACE_H 32 35 #define G4CASCADEINTERFACE_H 1 33 36 37 #include "G4VIntraNuclearTransportModel.hh" 38 #include "G4FragmentVector.hh" 39 #include "G4KineticTrackVector.hh" 34 40 #include "G4Nucleon.hh" 35 41 #include "G4Nucleus.hh" 36 #include "G4VIntraNuclearTransportModel.hh"37 #include "G4KineticTrackVector.hh"38 #include "G4FragmentVector.hh"39 42 #include "G4ParticleChange.hh" 43 #include "G4ReactionProduct.hh" 40 44 #include "G4ReactionProductVector.hh" 41 #include "G4ReactionProduct.hh"42 43 #include "G4ElementaryParticleCollider.hh"44 #include "G4NonEquilibriumEvaporator.hh"45 #include "G4EquilibriumEvaporator.hh"46 #include "G4Fissioner.hh"47 #include "G4BigBanger.hh"48 #include "G4IntraNucleiCascader.hh"49 45 50 46 … … 56 52 virtual ~G4CascadeInterface(); 57 53 58 G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus); 59 60 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& theNucleus); 54 G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, 55 G4V3DNucleus* theNucleus); 56 57 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 58 G4Nucleus& theNucleus); 61 59 62 60 private: 63 G4int operator==( G4CascadeInterface& right){61 G4int operator==(const G4CascadeInterface& right) const { 64 62 return (this == &right); 65 63 } 66 64 67 G4int operator!=( G4CascadeInterface& right){65 G4int operator!=(const G4CascadeInterface& right) const { 68 66 return (this != &right); 69 67 } … … 72 70 73 71 private: 74 75 G4ElementaryParticleCollider colep;76 G4NonEquilibriumEvaporator noneq;77 G4EquilibriumEvaporator eqil;78 G4Fissioner fiss;79 G4BigBanger bigb;80 G4IntraNucleiCascader inc;81 82 72 G4HadFinalState theResult; 83 84 73 }; 85 74 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKminusNChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeKminusNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_KMINUSN_CHANNEL_HH 27 34 #define G4_CASCADE_KMINUSN_CHANNEL_HH 28 35 29 30 36 #include "G4CascadeData.hh" 31 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 32 39 33 40 struct G4CascadeKminusNChannelData { 34 typedef G4CascadeData< 5,15,28,42,20,11,121> data_t;41 typedef G4CascadeData<31,5,15,28,42,20,11> data_t; 35 42 static data_t data; 36 43 }; 37 44 38 typedef G4CascadeFunctions<G4CascadeKminusNChannelData> G4CascadeKminusNChannel; 39 45 typedef G4CascadeFunctions<G4CascadeKminusNChannelData,G4KaonHypSampler> G4CascadeKminusNChannel; 40 46 41 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKminusPChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeKminusPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_KMINUSP_CHANNEL_HH 27 34 #define G4_CASCADE_KMINUSP_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 31 39 32 40 struct G4CascadeKminusPChannelData { 33 typedef G4CascadeData< 8,20,34,48,22,16,148> data_t;41 typedef G4CascadeData<31,8,20,34,48,22,16> data_t; 34 42 static data_t data; 35 43 }; 36 44 37 typedef G4CascadeFunctions<G4CascadeKminusPChannelData > G4CascadeKminusPChannel;45 typedef G4CascadeFunctions<G4CascadeKminusPChannelData,G4KaonHypSampler> G4CascadeKminusPChannel; 38 46 39 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKplusNChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeKplusNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_KPLUSN_CHANNEL_HH 27 34 #define G4_CASCADE_KPLUSN_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 31 39 32 40 struct G4CascadeKplusNChannelData { 33 typedef G4CascadeData< 2,5,13,22,32,41,115> data_t;41 typedef G4CascadeData<31,2,5,13,22,32,41> data_t; 34 42 static data_t data; 35 43 }; 36 44 37 typedef G4CascadeFunctions<G4CascadeKplusNChannelData > G4CascadeKplusNChannel;45 typedef G4CascadeFunctions<G4CascadeKplusNChannelData,G4KaonHypSampler> G4CascadeKplusNChannel; 38 46 39 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKplusPChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeKplusPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_KPLUSP_CHANNEL_HH 27 34 #define G4_CASCADE_KPLUSP_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 31 38 #include "G4KaonHypSampler.hh" 32 39 33 40 struct G4CascadeKplusPChannelData { 34 typedef G4CascadeData< 1,4,10,19,28,38,100> data_t;41 typedef G4CascadeData<31,1,4,10,19,28,38> data_t; 35 42 static data_t data; 36 43 }; 37 44 38 typedef G4CascadeFunctions<G4CascadeKplusPChannelData > G4CascadeKplusPChannel;45 typedef G4CascadeFunctions<G4CascadeKplusPChannelData,G4KaonHypSampler> G4CascadeKplusPChannel; 39 46 40 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKzeroBarNChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeKzeroBarNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_KZEROBARN_CHANNEL_HH 27 34 #define G4_CASCADE_KZEROBARN_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 31 39 32 40 struct G4CascadeKzeroBarNChannelData { 33 typedef G4CascadeData< 8,20,34,48,22,16,148> data_t;41 typedef G4CascadeData<31,8,20,34,48,22,16> data_t; 34 42 static data_t data; 35 43 }; 36 44 37 typedef G4CascadeFunctions<G4CascadeKzeroBarNChannelData > G4CascadeKzeroBarNChannel;45 typedef G4CascadeFunctions<G4CascadeKzeroBarNChannelData,G4KaonHypSampler> G4CascadeKzeroBarNChannel; 38 46 39 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKzeroBarPChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeKzeroBarPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_KZEROBARP_CHANNEL_HH 27 34 #define G4_CASCADE_KZEROBARP_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 31 32 38 #include "G4KaonHypSampler.hh" 33 39 34 40 struct G4CascadeKzeroBarPChannelData { 35 typedef G4CascadeData< 5,15,28,42,20,11,121> data_t;41 typedef G4CascadeData<31,5,15,28,42,20,11> data_t; 36 42 static data_t data; 37 43 }; 38 44 39 typedef G4CascadeFunctions<G4CascadeKzeroBarPChannelData > G4CascadeKzeroBarPChannel;45 typedef G4CascadeFunctions<G4CascadeKzeroBarPChannelData,G4KaonHypSampler> G4CascadeKzeroBarPChannel; 40 46 41 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKzeroNChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeKzeroNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_KZERON_CHANNEL_HH 27 34 #define G4_CASCADE_KZERON_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 31 38 #include "G4KaonHypSampler.hh" 32 39 33 40 struct G4CascadeKzeroNChannelData { 34 typedef G4CascadeData< 1,4,10,19,28,38,100> data_t;41 typedef G4CascadeData<31,1,4,10,19,28,38> data_t; 35 42 static data_t data; 36 43 }; 37 44 38 typedef G4CascadeFunctions<G4CascadeKzeroNChannelData > G4CascadeKzeroNChannel;45 typedef G4CascadeFunctions<G4CascadeKzeroNChannelData,G4KaonHypSampler> G4CascadeKzeroNChannel; 39 46 40 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeKzeroPChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeKzeroPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_KZEROP_CHANNEL_HH 27 34 #define G4_CASCADE_KZEROP_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 31 39 32 40 struct G4CascadeKzeroPChannelData { 33 typedef G4CascadeData< 2,5,13,22,32,41,115> data_t;41 typedef G4CascadeData<31,2,5,13,22,32,41> data_t; 34 42 static data_t data; 35 43 }; 36 44 37 typedef G4CascadeFunctions<G4CascadeKzeroPChannelData > G4CascadeKzeroPChannel;45 typedef G4CascadeFunctions<G4CascadeKzeroPChannelData,G4KaonHypSampler> G4CascadeKzeroPChannel; 38 46 39 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeLambdaNChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeLambdaNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_LAMBDAN_CHANNEL_HH 27 34 #define G4_CASCADE_LAMBDAN_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 31 38 #include "G4KaonHypSampler.hh" 32 39 33 40 struct G4CascadeLambdaNChannelData { 34 typedef G4CascadeData<3 ,12,33,59,30,20,157> data_t;41 typedef G4CascadeData<31,3,12,33,59,30,20> data_t; 35 42 static data_t data; 36 43 }; 37 44 38 typedef G4CascadeFunctions<G4CascadeLambdaNChannelData > G4CascadeLambdaNChannel;45 typedef G4CascadeFunctions<G4CascadeLambdaNChannelData,G4KaonHypSampler> G4CascadeLambdaNChannel; 39 46 40 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeLambdaPChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeLambdaPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_LAMBDAP_CHANNEL_HH 27 34 #define G4_CASCADE_LAMBDAP_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 31 39 32 40 struct G4CascadeLambdaPChannelData { 33 typedef G4CascadeData<3 ,12,33,59,30,20,157> data_t;41 typedef G4CascadeData<31,3,12,33,59,30,20> data_t; 34 42 static data_t data; 35 43 }; 36 44 37 typedef G4CascadeFunctions<G4CascadeLambdaPChannelData > G4CascadeLambdaPChannel;45 typedef G4CascadeFunctions<G4CascadeLambdaPChannelData,G4KaonHypSampler> G4CascadeLambdaPChannel; 38 46 39 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeMomentum.hh
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CascadeMomentum.hh,v 1.1 2008/09/22 10:06:32 gcosmo Exp $ 27 // GEANT4 tag $Name: geant4-09-03 $ 28 // 26 // $Id: G4CascadeMomentum.hh,v 1.5 2010/03/16 22:10:26 mkelsey Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 28 // 30 29 // Class G4CascadeMomentum … … 35 34 // std::vector<double> in the cascade mode code, which causes 36 35 // problems for performance due to excess memory allocations. 37 36 // 37 // NOTE: The Bertini code does not pass legitimate four-vectors when 38 // creating new particles; the new getLV() function takes an 39 // optional mass argument (in Bertini units [GeV]) so that a 40 // valid G4LorentzVector can be returned. 41 // 38 42 // Author: Peter Elmer, Princeton University 7-Aug-2008 43 // Update: Michael Kelsey, SLAC (support G4LorentzVector) 8-Jan-2010 39 44 // -------------------------------------------------------------------- 40 45 #ifndef G4CASCADE_MOMENTUM_HH … … 44 49 45 50 #include "G4Types.hh" 51 #include "G4LorentzVector.hh" 52 #include "G4ThreeVector.hh" 46 53 47 54 class G4CascadeMomentum 48 55 { 49 56 public: 50 51 57 G4CascadeMomentum() {for (int i=0; i<4; ++i) data_[i]=0.0;} 52 58 53 G4double& operator[](int i) 54 { 59 // WARNING! This metric is (t,x,y,z), DIFFERENT FROM HepLV! 60 G4CascadeMomentum(const G4LorentzVector& lv) { 61 setLV(lv); 62 } 63 64 G4double& operator[](int i) { 55 65 assert(i>=0 && i<4); 56 66 return data_[i]; 57 67 } 58 const G4double& operator[](int i) const 59 { 68 const G4double& operator[](int i) const { 60 69 assert(i>=0 && i<4); 61 70 return data_[i]; 62 71 } 63 72 73 operator const G4LorentzVector&() const { 74 return getLV(); // Casting can't do mass repairs 75 } 76 77 const G4LorentzVector& getLV(G4double mass=-1.) const { 78 if (mass>=0.) lv.setVectM(get3V(),mass); // Force input mass! 79 else lv.set(data_[1],data_[2],data_[3],data_[0]); 80 81 return lv; 82 } 83 84 G4ThreeVector get3V() const { 85 return getLV().vect(); 86 } 87 88 void setLV(const G4LorentzVector& lv) { 89 data_[0] = lv.t(); // NOTE DIFFERENT METRIC CONVENTION! 90 data_[1] = lv.x(); 91 data_[2] = lv.y(); 92 data_[3] = lv.z(); 93 } 94 95 G4CascadeMomentum& operator=(const G4LorentzVector& lv) { 96 setLV(lv); 97 return *this; 98 } 99 64 100 private: 101 G4double data_[4]; 102 mutable G4LorentzVector lv; // Buffer for conversion operations 103 }; 65 104 66 G4double data_[4];67 };68 105 #endif 69 106 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaMinusNChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeSigmaMinusNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_SIGMAMINUSN_CHANNEL_HH 27 34 #define G4_CASCADE_SIGMAMINUSN_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 31 38 #include "G4KaonHypSampler.hh" 32 39 33 40 struct G4CascadeSigmaMinusNChannelData { 34 typedef G4CascadeData< 1,6,20,42,25,17,111> data_t;41 typedef G4CascadeData<31,1,6,20,42,25,17> data_t; 35 42 static data_t data; 36 43 }; 37 44 38 typedef G4CascadeFunctions<G4CascadeSigmaMinusNChannelData > G4CascadeSigmaMinusNChannel;45 typedef G4CascadeFunctions<G4CascadeSigmaMinusNChannelData,G4KaonHypSampler> G4CascadeSigmaMinusNChannel; 39 46 40 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaMinusPChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeSigmaMinusPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_SIGMAMINUSP_CHANNEL_HH 27 34 #define G4_CASCADE_SIGMAMINUSP_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 31 38 #include "G4KaonHypSampler.hh" 32 39 33 40 struct G4CascadeSigmaMinusPChannelData { 34 typedef G4CascadeData<3 ,12,33,59,30,20,157> data_t;41 typedef G4CascadeData<31,3,12,33,59,30,20> data_t; 35 42 static data_t data; 36 43 }; 37 44 38 typedef G4CascadeFunctions<G4CascadeSigmaMinusPChannelData > G4CascadeSigmaMinusPChannel;45 typedef G4CascadeFunctions<G4CascadeSigmaMinusPChannelData,G4KaonHypSampler> G4CascadeSigmaMinusPChannel; 39 46 40 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaPlusNChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeSigmaPlusNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_SIGMAPLUSN_CHANNEL_HH 27 34 #define G4_CASCADE_SIGMAPLUSN_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 31 38 #include "G4KaonHypSampler.hh" 32 39 33 40 struct G4CascadeSigmaPlusNChannelData { 34 typedef G4CascadeData<3 ,12,33,59,30,20,157> data_t;41 typedef G4CascadeData<31,3,12,33,59,30,20> data_t; 35 42 static data_t data; 36 43 }; 37 44 38 typedef G4CascadeFunctions<G4CascadeSigmaPlusNChannelData > G4CascadeSigmaPlusNChannel;45 typedef G4CascadeFunctions<G4CascadeSigmaPlusNChannelData,G4KaonHypSampler> G4CascadeSigmaPlusNChannel; 39 46 40 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaPlusPChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeSigmaPlusPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_SIGMAPLUSP_CHANNEL_HH 27 34 #define G4_CASCADE_SIGMAPLUSP_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 31 38 #include "G4KaonHypSampler.hh" 32 39 33 40 struct G4CascadeSigmaPlusPChannelData { 34 typedef G4CascadeData< 1,6,20,42,25,17,111> data_t;41 typedef G4CascadeData<31,1,6,20,42,25,17> data_t; 35 42 static data_t data; 36 43 }; 37 44 38 typedef G4CascadeFunctions<G4CascadeSigmaPlusPChannelData > G4CascadeSigmaPlusPChannel;45 typedef G4CascadeFunctions<G4CascadeSigmaPlusPChannelData,G4KaonHypSampler> G4CascadeSigmaPlusPChannel; 39 46 40 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaZeroNChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeSigmaZeroNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_SIGMAZERON_CHANNEL_HH 27 34 #define G4_CASCADE_SIGMAZERON_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 31 38 #include "G4KaonHypSampler.hh" 32 39 33 40 struct G4CascadeSigmaZeroNChannelData { 34 typedef G4CascadeData<3 ,12,33,59,30,20,157> data_t;41 typedef G4CascadeData<31,3,12,33,59,30,20> data_t; 35 42 static data_t data; 36 43 }; 37 44 38 typedef G4CascadeFunctions<G4CascadeSigmaZeroNChannelData > G4CascadeSigmaZeroNChannel;45 typedef G4CascadeFunctions<G4CascadeSigmaZeroNChannelData,G4KaonHypSampler> G4CascadeSigmaZeroNChannel; 39 46 40 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSigmaZeroPChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeSigmaZeroPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_SIGMAZEROP_CHANNEL_HH 27 34 #define G4_CASCADE_SIGMAZEROP_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 31 39 32 40 struct G4CascadeSigmaZeroPChannelData { 33 typedef G4CascadeData<3 ,12,33,59,30,20,157> data_t;41 typedef G4CascadeData<31,3,12,33,59,30,20> data_t; 34 42 static data_t data; 35 43 }; 36 44 37 typedef G4CascadeFunctions<G4CascadeSigmaZeroPChannelData > G4CascadeSigmaZeroPChannel;45 typedef G4CascadeFunctions<G4CascadeSigmaZeroPChannelData,G4KaonHypSampler> G4CascadeSigmaZeroPChannel; 38 46 39 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeXiMinusNChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeXiMinusNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_XIMINUSN_CHANNEL_HH 27 34 #define G4_CASCADE_XIMINUSN_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 31 39 32 40 struct G4CascadeXiMinusNChannelData { 33 typedef G4CascadeData<3 ,18,53,2,2,2,80> data_t;41 typedef G4CascadeData<31,3,18,53,2,2,2> data_t; 34 42 static data_t data; 35 43 }; 36 44 37 typedef G4CascadeFunctions<G4CascadeXiMinusNChannelData > G4CascadeXiMinusNChannel;45 typedef G4CascadeFunctions<G4CascadeXiMinusNChannelData,G4KaonHypSampler> G4CascadeXiMinusNChannel; 38 46 39 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeXiMinusPChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeXiMinusPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_XIMINUSP_CHANNEL_HH 27 34 #define G4_CASCADE_XIMINUSP_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 31 39 32 40 struct G4CascadeXiMinusPChannelData { 33 typedef G4CascadeData< 6,24,4,4,4,4,46> data_t;41 typedef G4CascadeData<31,6,24,4,4,4,4> data_t; 34 42 static data_t data; 35 43 }; 36 44 37 typedef G4CascadeFunctions<G4CascadeXiMinusPChannelData > G4CascadeXiMinusPChannel;45 typedef G4CascadeFunctions<G4CascadeXiMinusPChannelData,G4KaonHypSampler> G4CascadeXiMinusPChannel; 38 46 39 47 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeXiZeroNChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeXiZeroNChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_XIZERON_CHANNEL_HH 27 34 #define G4_CASCADE_XIZERON_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 31 39 32 40 33 41 struct G4CascadeXiZeroNChannelData { 34 typedef G4CascadeData< 6,24,4,4,4,4,46> data_t;42 typedef G4CascadeData<31,6,24,4,4,4,4> data_t; 35 43 static data_t data; 36 44 }; 37 45 38 typedef G4CascadeFunctions<G4CascadeXiZeroNChannelData > G4CascadeXiZeroNChannel;46 typedef G4CascadeFunctions<G4CascadeXiZeroNChannelData,G4KaonHypSampler> G4CascadeXiZeroNChannel; 39 47 40 48 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeXiZeroPChannel.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CascadeXiZeroPChannel.hh,v 1.6 2010/05/15 00:55:01 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100507 M. Kelsey -- Remove redundant total-bins template argument 29 // 20100510 M. Kelsey -- Add initial "31" template arg. Add G4CascSampler 30 // to template for channel typedef 31 // 20100514 M. Kelsey -- Replace G4CascadeSampler with G4KaonHypSampler. 32 26 33 #ifndef G4_CASCADE_XIZEROP_CHANNEL_HH 27 34 #define G4_CASCADE_XIZEROP_CHANNEL_HH … … 29 36 #include "G4CascadeData.hh" 30 37 #include "G4CascadeFunctions.hh" 38 #include "G4KaonHypSampler.hh" 39 31 40 32 41 struct G4CascadeXiZeroPChannelData { 33 typedef G4CascadeData<3 ,18,53,2,2,2,80> data_t;42 typedef G4CascadeData<31,3,18,53,2,2,2> data_t; 34 43 static data_t data; 35 44 }; 36 45 37 typedef G4CascadeFunctions<G4CascadeXiZeroPChannelData > G4CascadeXiZeroPChannel;46 typedef G4CascadeFunctions<G4CascadeXiZeroPChannelData,G4KaonHypSampler> G4CascadeXiZeroPChannel; 38 47 39 48 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4CollisionOutput.hh
r1196 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4CollisionOutput.hh,v 1.20 2010/05/21 18:07:30 mkelsey Exp $ 26 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100114 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly 29 // 20100407 M. Kelsey -- Replace ::resize(0) with ::clear() 30 // 20100409 M. Kelsey -- Move function code to .cc files, not inlinable 31 // 20100418 M. Kelsey -- Add function to boost output lists to lab frame 32 // 20100520 M. Kelsey -- Add function to rotate Z axis, from G4Casc.Interface 33 26 34 #ifndef G4COLLISION_OUTPUT_HH 27 35 #define G4COLLISION_OUTPUT_HH 28 36 29 #include <iostream>30 31 37 #include "G4InuclElementaryParticle.hh" 32 38 #include "G4InuclNuclei.hh" 33 39 #include "G4LorentzRotation.hh" 34 40 #include <algorithm> 35 41 #include <vector> 42 43 class G4LorentzConvertor; 36 44 37 45 class G4CollisionOutput { … … 43 51 G4CollisionOutput& operator=(const G4CollisionOutput& right); 44 52 45 void reset() { 46 nucleiFragments.resize(0); 47 outgoingParticles.resize(0); 48 49 }; 53 void reset(); 50 54 51 55 void addOutgoingParticle(const G4InuclElementaryParticle& particle) { 52 56 outgoingParticles.push_back(particle); 53 } ;57 } 54 58 55 void addOutgoingParticles(const std::vector<G4InuclElementaryParticle>& particles) { 56 for(G4int i = 0; i < G4int(particles.size()); i++) 57 outgoingParticles.push_back(particles[i]); 58 }; 59 void addOutgoingParticles(const std::vector<G4InuclElementaryParticle>& particles); 59 60 60 61 void addTargetFragment(const G4InuclNuclei& nuclei) { … … 62 63 }; 63 64 64 void addTargetFragments(const std::vector<G4InuclNuclei>& nuclea) { 65 for(G4int i = 0; i < G4int(nuclea.size()); i++) 66 nucleiFragments.push_back(nuclea[i]); 67 }; 65 void addTargetFragments(const std::vector<G4InuclNuclei>& nuclea); 68 66 69 67 const std::vector<G4InuclElementaryParticle>& getOutgoingParticles() const { … … 79 77 }; 80 78 81 G4CascadeMomentum getTotalOutputMomentum() const { 82 G4CascadeMomentum tot_mom; 83 double eex_r = 0.0; 84 G4int i(0); 85 for(i = 0; i < G4int(outgoingParticles.size()); i++) { 86 const G4CascadeMomentum& mom = outgoingParticles[i].getMomentum(); 87 for(G4int j = 0; j < 4; j++) tot_mom[j] += mom[j]; 88 }; 89 for(i = 0; i < G4int(nucleiFragments.size()); i++) { 90 const G4CascadeMomentum& mom = nucleiFragments[i].getMomentum(); 91 for(G4int j = 0; j < 4; j++) tot_mom[j] += mom[j]; 92 eex_r += 0.001 * nucleiFragments[i].getExitationEnergy(); 93 }; 94 tot_mom[0] += eex_r; 95 return tot_mom; 96 }; 79 G4LorentzVector getTotalOutputMomentum() const; 97 80 98 void printCollisionOutput() const { 99 G4cout << " Output: " << G4endl 100 << " Outgoing Particles: " << outgoingParticles.size() << G4endl; 101 G4int i(0); 102 for(i = 0; i < G4int(outgoingParticles.size()); i++) { 103 outgoingParticles[i].printParticle(); 104 }; 105 G4cout << " Nuclei fragments: " << nucleiFragments.size() << G4endl; 106 for(i = 0; i < G4int(nucleiFragments.size()); i++) { 107 nucleiFragments[i].printParticle(); 108 }; 109 }; 81 void printCollisionOutput() const; 82 83 void boostToLabFrame(const G4LorentzConvertor& convertor); 84 85 void rotateEvent(const G4LorentzRotation& rotate); 110 86 111 87 void trivialise(G4InuclParticle* bullet, 112 G4InuclParticle* target) { 113 if(G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) { 114 nucleiFragments.push_back(*nuclei_target); 115 } 116 else { 117 G4InuclElementaryParticle* particle = 118 dynamic_cast<G4InuclElementaryParticle*>(target); 119 outgoingParticles.push_back(*particle); 120 }; 121 if(G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) { 122 nucleiFragments.push_back(*nuclei_bullet); 123 } 124 else { 125 G4InuclElementaryParticle* particle = 126 dynamic_cast<G4InuclElementaryParticle*>(bullet); 127 outgoingParticles.push_back(*particle); 128 }; 129 }; 88 G4InuclParticle* target); 130 89 131 90 void setOnShell(G4InuclParticle* bullet, 132 91 G4InuclParticle* target); 133 92 134 void setRemainingExitationEnergy() { 135 eex_rest = 0.0; 136 for(G4int i = 0; i < G4int(nucleiFragments.size()); i++) 137 eex_rest += 0.001 * nucleiFragments[i].getExitationEnergy(); 138 }; 93 void setRemainingExitationEnergy(); 139 94 140 95 double getRemainingExitationEnergy() const { … … 147 102 148 103 private: 149 150 G4int verboseLevel; 104 G4int verboseLevel; 151 105 std::vector<G4InuclElementaryParticle> outgoingParticles; 152 153 106 std::vector<G4InuclNuclei> nucleiFragments; 154 155 107 G4double eex_rest; 156 108 157 std::pair<std::pair<G4int, 109 std::pair<std::pair<G4int,G4int>, G4int> selectPairToTune(G4double de) const; 158 110 159 111 G4bool on_shell; -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4ElementaryParticleCollider.hh
r1196 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4ElementaryParticleCollider.hh,v 1.31 2010/05/21 17:56:34 mkelsey Exp $ 26 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100114 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly 29 // 20100315 M. Kelsey -- Remove "using" directive and unnecessary #includes. 30 // 20100407 M. Kelsey -- Eliminate return-by-value std::vector<> by creating 31 // three data buffers for particles, momenta, and particle types. 32 // The following functions now return void and are non-const: 33 // ::generateSCMfinalState() 34 // ::generateMomModules() (also remove input vector) 35 // ::generateStrangeChannelPartTypes() 36 // ::generateSCMpionAbsorption() 37 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide(); merge 38 // public vs. private ::collide() functions. 39 // 20100511 M. Kelsey -- Remove G4PionSampler and G4NucleonSampler. Expand 40 // particle-types selector to all modes, not just strangeness. 41 // 20100517 M. Kelsey -- Inherit from common base class, make arrays static 42 26 43 #ifndef G4ELEMENTARY_PARTICLE_COLLIDER_HH 27 44 #define G4ELEMENTARY_PARTICLE_COLLIDER_HH 28 45 29 #include "G4 Collider.hh"46 #include "G4VCascadeCollider.hh" 30 47 #include "G4InuclElementaryParticle.hh" 31 #include "G4InuclSpecialFunctions.hh" 32 #include "G4CascadSpecialFunctions.hh" 33 #include "G4LorentzConvertor.hh" 34 #include "G4NucleonSampler.hh" 35 #include "G4PionSampler.hh" 48 #include "G4LorentzVector.hh" 49 #include <vector> 36 50 37 38 using namespace G4InuclSpecialFunctions; 39 using namespace G4CascadSpecialFunctions; 51 class G4LorentzConvertor; 52 class G4CollisionOutput; 40 53 41 54 42 class G4ElementaryParticleCollider { 43 55 class G4ElementaryParticleCollider : public G4VCascadeCollider { 44 56 public: 45 46 57 G4ElementaryParticleCollider(); 47 48 G4CollisionOutput collide(G4InuclParticle* bullet, 49 G4InuclParticle* target); 58 virtual ~G4ElementaryParticleCollider() {}; 59 60 void collide(G4InuclParticle* bullet, G4InuclParticle* target, 61 G4CollisionOutput& output); 50 62 51 63 private: 52 53 G4int verboseLevel;54 55 64 void initializeArrays(); 56 65 57 66 G4int generateMultiplicity(G4int is, G4double ekin) const; 58 67 59 void collide(G4InuclElementaryParticle* bullet, 60 G4InuclElementaryParticle* target, 61 G4CollisionOutput& output); 68 void generateOutgoingPartTypes(G4int is, G4int mult, G4double ekin); 62 69 63 64 std::vector<G4InuclElementaryParticle> 65 generateSCMfinalState(G4double ekin, G4double etot_scm, G4double pscm, 66 G4InuclElementaryParticle* particle1, 67 G4InuclElementaryParticle* particle2, 68 G4LorentzConvertor* toSCM) const; 70 void generateSCMfinalState(G4double ekin, G4double etot_scm, G4double pscm, 71 G4InuclElementaryParticle* particle1, 72 G4InuclElementaryParticle* particle2, 73 G4LorentzConvertor* toSCM); 74 75 void generateSCMpionAbsorption(G4double etot_scm, 76 G4InuclElementaryParticle* particle1, 77 G4InuclElementaryParticle* particle2); 78 79 void generateMomModules(G4int mult, G4int is, G4double ekin, 80 G4double etot_cm); 81 82 // Samples the CM momentum for elastic and charge exchange scattering 83 // 84 G4LorentzVector 85 sampleCMmomentumFor2to2(G4int is, G4int kw, G4double ekin, 86 G4double pscm) const; 69 87 70 88 71 std::vector<G4double> 72 generateMomModules(const std::vector<G4int>& kinds, G4int mult, 73 G4int is, G4double ekin, G4double etot_cm) const; 89 // Samples cos(theta) in the CM for elastic and charge exchange scattering 90 // 91 G4double sampleCMcosFor2to2(G4double pscm, G4double pFrac, 92 G4double pA, G4double pC, G4double pCos) const; 74 93 75 94 76 G4CascadeMomentum 77 particleSCMmomentumFor2to2(G4int is, G4int kw, G4double ekin, 78 G4double pscm) const; 79 80 81 G4int getElasticCase(G4int is, G4int kw, G4double ekin) const; 82 83 84 std::vector<G4int> 85 generateStrangeChannelPartTypes(G4int is, G4int mult, 86 G4double ekin) const; 87 88 89 G4double 90 getMomModuleFor2toMany(G4int is, G4int mult, G4int knd, 91 G4double ekin) const; 95 G4double getMomModuleFor2toMany(G4int is, G4int mult, G4int knd, 96 G4double ekin) const; 92 97 93 98 94 99 G4bool satisfyTriangle(const std::vector<G4double>& modules) const; 95 100 96 G4 CascadeMomentum101 G4LorentzVector 97 102 particleSCMmomentumFor2to3(G4int is, G4int knd, G4double ekin, 98 103 G4double pmod) const; 99 104 100 101 std::pair<G4double, G4double> 102 adjustIntervalForElastic(G4double ekin, G4double ak, G4double ae, 103 G4int k, G4int l, const std::vector<G4double>& ssv, 104 G4double st) const; 105 106 std::vector<G4InuclElementaryParticle> 107 generateSCMpionAbsorption(G4double etot_scm, 108 G4InuclElementaryParticle* particle1, 109 G4InuclElementaryParticle* particle2) const; 110 111 G4NucleonSampler nucSampler; 112 G4PionSampler piSampler; 105 // Internal buffers for lists of secondaries 106 std::vector<G4InuclElementaryParticle> particles; 107 std::vector<G4double> modules; 108 std::vector<G4int> particle_kinds; 113 109 114 110 // Parameter arrays 115 116 G4double rmn[14][10][2]; 117 G4double ang[4][4][13]; 118 G4double abn[4][4][4]; 119 111 static const G4double rmn[14][10][2]; 112 static const G4double abn[4][4][4]; 120 113 }; 121 114 122 #endif // G4ELEMENTARY_PARTICLE_COLLIDER_HH115 #endif /* G4ELEMENTARY_PARTICLE_COLLIDER_HH */ 123 116 124 117 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4EquilibriumEvaporator.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4EquilibriumEvaporator.hh,v 1.11 2010/05/21 17:56:34 mkelsey Exp $ 26 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide() 29 // 20100517 M. Kelsey -- Inherit from common base class, make other colliders 30 // simple data members. Rename timeToBigBang() to override 31 // base explosion(). 32 26 33 #ifndef G4EQUILIBRIUM_EVAPORATOR_HH 27 34 #define G4EQUILIBRIUM_EVAPORATOR_HH 28 35 29 #include "G4Collider.hh" 30 #include "G4Fissioner.hh" 31 #include "G4BigBanger.hh" 32 #include "G4InuclSpecialFunctions.hh" 36 #include "G4VCascadeCollider.hh" 33 37 34 using namespace G4InuclSpecialFunctions; 38 class G4CollisionOutput; 39 class G4Fissioner; 40 class G4BigBanger; 41 class G4InuclParticle; 35 42 36 class G4EquilibriumEvaporator { 43 class G4EquilibriumEvaporator : public G4VCascadeCollider { 44 public: 45 G4EquilibriumEvaporator(); 46 virtual ~G4EquilibriumEvaporator(); 37 47 38 public: 39 40 G4EquilibriumEvaporator(); 41 42 void setFissioner(G4Fissioner* fissioner) { 43 theFissioner = fissioner; 44 }; 45 46 void setBigBanger(G4BigBanger* banger) { 47 theBigBanger = banger; 48 }; 49 50 G4CollisionOutput collide(G4InuclParticle* bullet, 51 G4InuclParticle* target); 48 void collide(G4InuclParticle* bullet, G4InuclParticle* target, 49 G4CollisionOutput& output); 52 50 53 51 private: 54 G4int verboseLevel; 52 // Replace base class verision 53 virtual G4bool explosion(G4InuclNuclei*) const { return false; } 54 virtual G4bool explosion(G4double a, 55 G4double z, 56 G4double e) const; 57 58 G4bool goodRemnant(G4double a, 59 G4double z) const; 60 55 61 G4double getE0(G4double A) const; 56 62 57 63 G4double getPARLEVDEN(G4double A, 58 64 G4double Z) const; 59 60 G4bool timeToBigBang(G4double a,61 G4double z,62 G4double e) const;63 64 G4bool goodRemnant(G4double a,65 G4double z) const;66 65 67 66 G4double getQF(G4double x, … … 78 77 G4Fissioner* theFissioner; 79 78 G4BigBanger* theBigBanger; 80 81 79 }; 82 80 83 #endif / / G4EQUILIBRIUM_EVAPORATOR_HH81 #endif /* G4EQUILIBRIUM_EVAPORATOR_HH */ 84 82 85 83 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4EvaporationInuclCollider.hh
r962 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EvaporationInuclCollider.hh,v 1.2 2008/06/29 23:56:03 dennis Exp $ 26 // $Id: G4EvaporationInuclCollider.hh,v 1.5 2010/05/21 17:56:34 mkelsey Exp $ 27 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 28 // 29 // 20100315 M. Kelsey -- Remove "using" directive and unnecessary #includes. 30 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide() 31 // 20100517 M. Kelsey -- Inherit from common base class, make other colliders 32 // simple data members 33 27 34 #ifndef G4EVAPORATIONINUCL_COLLIDER_HH 28 35 #define G4EVAPORATIONINUCL_COLLIDER_HH 29 36 30 #include "G4 Collider.hh"37 #include "G4VCascadeCollider.hh" 31 38 32 #include "G4EquilibriumEvaporator.hh" 33 #include "G4Fissioner.hh" 34 #include "G4BigBanger.hh" 39 class G4InuclParticle; 40 class G4CollisionOutput; 41 class G4EquilibriumEvaporator; 42 class G4BigBanger; 35 43 36 #include "G4ElementaryParticleCollider.hh" 37 #include "G4InteractionCase.hh" 38 #include "G4InuclNuclei.hh" 39 #include "G4InuclSpecialFunctions.hh" 40 #include "G4Analyser.hh" 41 42 using namespace G4InuclSpecialFunctions; 43 44 class G4EvaporationInuclCollider { 45 44 class G4EvaporationInuclCollider : public G4VCascadeCollider { 46 45 public: 47 48 46 G4EvaporationInuclCollider(); 49 47 50 G4EvaporationInuclCollider(G4EquilibriumEvaporator* eqevaporator, G4Fissioner* fissioner, G4BigBanger* bigbanger) { 51 52 setEquilibriumEvaporator(eqevaporator, fissioner, bigbanger); 53 }; 54 55 void setEquilibriumEvaporator(G4EquilibriumEvaporator* eqevaporator, G4Fissioner* fissioner, G4BigBanger* bigbanger) { 56 theEquilibriumEvaporator = eqevaporator; 57 theEquilibriumEvaporator->setFissioner(fissioner); 58 theEquilibriumEvaporator->setBigBanger(bigbanger); 59 }; 60 61 void setBigBanger(G4BigBanger* bigbanger) { 62 63 theBigBanger = bigbanger; 64 }; 65 66 G4CollisionOutput collide(G4InuclParticle* bullet, G4InuclParticle* target); 48 void collide(G4InuclParticle* bullet, G4InuclParticle* target, 49 G4CollisionOutput& output); 67 50 68 51 private: 69 70 G4int verboseLevel;71 72 G4bool inelasticInteractionPossible(G4InuclParticle* bullet,73 G4InuclParticle* target,74 G4double ekin) const;75 76 G4InteractionCase bulletTargetSetter(G4InuclParticle* bullet,77 G4InuclParticle* target) const;78 79 G4bool explosion(G4InuclNuclei* target) const;80 81 52 G4EquilibriumEvaporator* theEquilibriumEvaporator; 82 G4BigBanger* theBigBanger;83 84 53 }; 85 54 86 #endif / / G4EVAPORATIONINUCL_COLLIDER_HH55 #endif /* G4EVAPORATIONINUCL_COLLIDER_HH */ 87 56 88 57 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4Fissioner.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4Fissioner.hh,v 1.12 2010/05/21 17:56:34 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100315 M. Kelsey -- Remove "using" directive and unnecessary #includes. 29 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide() 30 // 20100517 M. Kelsey -- Inherit from common base class 31 26 32 #ifndef G4FISSIONER_HH 27 33 #define G4FISSIONER_HH 28 34 29 #include "G4 Collider.hh"30 #include "G4InuclSpecialFunctions.hh"35 #include "G4VCascadeCollider.hh" 36 #include <vector> 31 37 32 using namespace G4InuclSpecialFunctions; 38 class G4CollisionOutput; 39 class G4InuclParticle; 33 40 34 class G4Fissioner {35 41 42 class G4Fissioner : public G4VCascadeCollider { 36 43 public: 44 G4Fissioner(); 45 virtual ~G4Fissioner() {} 37 46 38 G4Fissioner(); 39 40 G4CollisionOutput collide(G4InuclParticle* bullet, 41 G4InuclParticle* target); 47 void collide(G4InuclParticle* bullet, G4InuclParticle* target, 48 G4CollisionOutput& output); 42 49 43 50 private: 44 G4int verboseLevel;45 51 G4double getC2(G4double A1, 46 52 G4double A2, … … 66 72 std::vector<G4double>& BET1, 67 73 G4double& R12) const; 68 69 74 }; 70 75 71 #endif / / G4FISSIONER_HH76 #endif /* G4FISSIONER_HH */ -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4InteractionCase.hh
r819 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4InteractionCase.hh,v 1.11 2010/05/21 17:56:34 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100518 M. Kelsey -- Why use std::pair<> at all? Never exported; just 29 // store pointers. Add clear() function. Move code from 30 // Colliders' "bulletTargetSetter()" to set(). 31 26 32 #ifndef G4INTERACTION_CASE_HH 27 33 #define G4INTERACTION_CASE_HH 28 34 29 //#ifndef G4INUCL_PARTICLE_HH 30 #include "G4InuclParticle.hh" 31 //#endif 35 #include "globals.hh" 32 36 33 #include <algorithm> 37 class G4InuclParticle; 38 34 39 35 40 class G4InteractionCase { 41 public: 42 G4InteractionCase() : bullet(0), target(0), inter_case(0) {} 36 43 37 public: 44 G4InteractionCase(G4InuclParticle* part1, G4InuclParticle* part2) { 45 set(part1, part2); 46 } 38 47 39 G4InteractionCase() { 40 bultag = std::pair<G4InuclParticle*, G4InuclParticle*>(0, 0); 48 void set(G4InuclParticle* part1, G4InuclParticle* part2); 49 50 void clear() { 51 bullet = target = 0; 41 52 inter_case = 0; 42 } ;53 } 43 54 44 G4InteractionCase(G4InuclParticle* part1, 45 G4InuclParticle* part2, 46 G4int ic) { 47 setBulletTarget(part1, part2); 48 setInterCase(ic); 49 }; 55 G4InuclParticle* getBullet() const { return bullet; } 56 G4InuclParticle* getTarget() const { return target; } 50 57 51 void setBulletTarget(G4InuclParticle* part1, 52 G4InuclParticle* part2) { 53 bultag = std::pair<G4InuclParticle*, G4InuclParticle*>(part1, part2); 54 }; 58 G4bool valid() const { return inter_case != 0; } 55 59 56 void setInterCase(G4int ic) {57 inter_case = ic;58 };60 G4bool twoNuclei() const { return inter_case == -2; } 61 G4bool hadNucleus() const { return inter_case == -1; } 62 G4int hadrons() const { return inter_case; } // "rtype" or "is" code 59 63 60 G4InuclParticle* getBullet() const { 61 return bultag.first; 62 }; 63 64 G4InuclParticle* getTarget() const { 65 return bultag.second; 66 }; 67 68 G4int getInterCase() const { 69 return inter_case; 70 }; 64 // For compatibility with G4IntraNucleiCascader code 65 G4int code() const { return ((inter_case<0) ? -inter_case : 0); } 71 66 72 67 private: 73 74 std::pair<G4InuclParticle*, G4InuclParticle*> bultag;68 G4InuclParticle* bullet; 69 G4InuclParticle* target; 75 70 76 71 G4int inter_case; 77 78 72 }; 79 73 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4IntraNucleiCascader.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4IntraNucleiCascader.hh,v 1.10 2010/05/21 17:56:34 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 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 26 33 #ifndef G4INTRA_NUCLEI_CASCADER_HH 27 34 #define G4INTRA_NUCLEI_CASCADER_HH 28 35 29 #include "G4Collider.hh" 30 #include "G4ElementaryParticleCollider.hh" 31 #include "G4InuclSpecialFunctions.hh" 32 #include "G4CascadSpecialFunctions.hh" 33 #include "G4InuclElementaryParticle.hh" 36 #include "G4VCascadeCollider.hh" 34 37 35 using namespace G4InuclSpecialFunctions; 36 using namespace G4CascadSpecialFunctions; 38 class G4CollisionOutput; 39 class G4ElementaryParticleCollider; 40 class G4InuclParticle; 37 41 38 class G4IntraNucleiCascader {39 42 43 class G4IntraNucleiCascader : public G4VCascadeCollider { 40 44 public: 45 G4IntraNucleiCascader(); 46 virtual ~G4IntraNucleiCascader(); 41 47 42 G4IntraNucleiCascader(); 48 void collide(G4InuclParticle* bullet, G4InuclParticle* target, 49 G4CollisionOutput& output); 43 50 44 void setElementaryParticleCollider(G4ElementaryParticleCollider* ecollider) { 45 theElementaryParticleCollider = ecollider; 46 }; 47 48 G4CollisionOutput collide(G4InuclParticle* bullet, 49 G4InuclParticle* target); 50 51 // FIXME: This should come from (or be determined by) G4InteractionCase 51 52 void setInteractionCase(G4int intcase) { 52 53 inter_case = intcase; … … 54 55 55 56 private: 56 G4int verboseLevel;57 57 G4ElementaryParticleCollider* theElementaryParticleCollider; 58 58 59 // FIXME: This should come from (or be determined by) G4InteractionCase 59 60 G4int inter_case; 60 61 61 62 G4bool goodCase(G4double a, G4double z, G4double eexs, G4double ein) const; 62 63 63 }; 64 64 65 #endif / / G4INTRA_NUCLEI_CASCADER_HH65 #endif /* G4INTRA_NUCLEI_CASCADER_HH */ -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclCollider.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4InuclCollider.hh,v 1.13 2010/05/21 17:56:34 mkelsey Exp $ 26 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide() 29 // 20100517 M. Kelsey -- Inherit from common base class, make other colliders 30 // simple data members 31 26 32 #ifndef G4INUCL_COLLIDER_HH 27 33 #define G4INUCL_COLLIDER_HH 28 29 #include "G4Collider.hh"30 #include "G4IntraNucleiCascader.hh"31 #include "G4NonEquilibriumEvaporator.hh"32 #include "G4EquilibriumEvaporator.hh"33 #include "G4Fissioner.hh"34 #include "G4BigBanger.hh"35 #include "G4ElementaryParticleCollider.hh"36 #include "G4InteractionCase.hh"37 #include "G4InuclNuclei.hh"38 #include "G4InuclSpecialFunctions.hh"39 #include "G4Analyser.hh"40 34 41 using namespace G4InuclSpecialFunctions; 35 #include "G4VCascadeCollider.hh" 42 36 43 class G4InuclCollider { 37 class G4BigBanger; 38 class G4CollisionOutput; 39 class G4ElementaryParticleCollider; 40 class G4EquilibriumEvaporator; 41 class G4IntraNucleiCascader; 42 class G4InuclParticle; 43 class G4NonEquilibriumEvaporator; 44 45 46 class G4InuclCollider : public G4VCascadeCollider { 44 47 45 48 public: 46 49 47 50 G4InuclCollider(); 51 virtual ~G4InuclCollider(); 48 52 49 G4InuclCollider(G4ElementaryParticleCollider* ecollider, 50 G4IntraNucleiCascader* incascader, 51 G4NonEquilibriumEvaporator* noeqevaporator, 52 G4EquilibriumEvaporator* eqevaporator, 53 G4Fissioner* fissioner, 54 G4BigBanger* bigbanger) { 55 56 setElementaryParticleCollider(ecollider); 57 setIntraNucleiCascader(incascader,ecollider); 58 setNonEquilibriumEvaporator(noeqevaporator); 59 setEquilibriumEvaporator(eqevaporator, fissioner, bigbanger); 60 setBigBanger(bigbanger); 61 62 }; 63 64 void setElementaryParticleCollider(G4ElementaryParticleCollider* ecollider) { 65 66 theElementaryParticleCollider = ecollider; 67 }; 68 69 void setIntraNucleiCascader(G4IntraNucleiCascader* incascader, 70 G4ElementaryParticleCollider* ecollider) { 71 72 theIntraNucleiCascader = incascader; 73 theIntraNucleiCascader->setElementaryParticleCollider(ecollider); 74 }; 75 76 void setNonEquilibriumEvaporator(G4NonEquilibriumEvaporator* noeqevaporator) { 77 78 theNonEquilibriumEvaporator = noeqevaporator; 79 }; 80 81 void setEquilibriumEvaporator(G4EquilibriumEvaporator* eqevaporator, 82 G4Fissioner* fissioner, 83 G4BigBanger* bigbanger) { 84 85 theEquilibriumEvaporator = eqevaporator; 86 theEquilibriumEvaporator->setFissioner(fissioner); 87 theEquilibriumEvaporator->setBigBanger(bigbanger); 88 }; 89 90 void setBigBanger(G4BigBanger* bigbanger) { 91 92 theBigBanger = bigbanger; 93 }; 94 95 G4CollisionOutput collide(G4InuclParticle* bullet, 96 G4InuclParticle* target); 53 void collide(G4InuclParticle* bullet, G4InuclParticle* target, 54 G4CollisionOutput& output); 97 55 98 56 private: 99 100 G4int verboseLevel;101 102 G4bool inelasticInteractionPossible(G4InuclParticle* bullet,103 G4InuclParticle* target,104 G4double ekin) const;105 106 G4InteractionCase bulletTargetSetter(G4InuclParticle* bullet,107 G4InuclParticle* target) const;108 109 G4bool explosion(G4InuclNuclei* target) const;110 111 57 G4ElementaryParticleCollider* theElementaryParticleCollider; 112 58 G4IntraNucleiCascader* theIntraNucleiCascader; … … 114 60 G4EquilibriumEvaporator* theEquilibriumEvaporator; 115 61 G4BigBanger* theBigBanger; 116 117 62 }; 118 63 119 #endif / / G4INUCL_COLLIDER_HH64 #endif /* G4INUCL_COLLIDER_HH */ 120 65 121 66 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclElementaryParticle.hh
r1196 r1315 1 #ifndef G4INUCL_ELEMENTARY_PARTICLE_HH 2 #define G4INUCL_ELEMENTARY_PARTICLE_HH 1 3 // 2 4 // ******************************************************************** … … 23 25 // * acceptance of all terms of the Geant4 Software license. * 24 26 // ******************************************************************** 27 // $Id: G4InuclElementaryParticle.hh,v 1.22 2010/04/29 19:39:55 mkelsey Exp $ 28 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 29 // 26 #ifndef G4INUCL_ELEMENTARY_PARTICLE_HH 27 #define G4INUCL_ELEMENTARY_PARTICLE_HH 30 // 20100114 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly 31 // 20100409 M. Kelsey -- Drop unused string argument from ctors. 32 // 20100429 M. Kelsey -- Change "photon()" to "isPhoton()", use enum names 28 33 29 34 #include "G4InuclParticle.hh" 35 #include "G4InuclParticleNames.hh" 30 36 #include "globals.hh" 31 37 32 #ifndef G4INUCL_PARTICLE_HH 33 #include "G4InuclParticle.hh" 34 #endif 38 class G4ParticleDefinition; 35 39 36 40 class G4InuclElementaryParticle : public G4InuclParticle { 41 public: 42 G4InuclElementaryParticle() 43 : G4InuclParticle(), generation(0) {} 37 44 38 // known particle types: 39 // 1 - proton 11 - k+ 111 - quasideuteron PP 40 // 2 - neutron 13 - k- 112 - quasideuteron PN 41 // 3 - pi+ 15 - k0 122 - quasideuteron NN 42 // 5 - pi- 17 - k0bar 43 // 7 - pi 0 21 - lambda 44 // 10 - photon 23 - sigma+ 45 // 25 - sigma0 46 // 27 - sigma- 47 // 29 - xi0 48 // 31 - xi- 49 50 public: 45 explicit G4InuclElementaryParticle(G4int type) 46 : G4InuclParticle(makeDefinition(type)), generation(0) {} 51 47 52 G4InuclElementaryParticle() { 53 particleType = 0; // DHW: added to keep 4.3 compiler happy 54 particleMass = 0.; // " " 55 valid_particle = false; 56 generation = 0; 57 }; 48 G4InuclElementaryParticle(const G4LorentzVector& mom, 49 G4int type, G4int model=0) 50 : G4InuclParticle(makeDefinition(type), mom), generation(0) { 51 setModel(model); 52 } 58 53 59 G4InuclElementaryParticle(G4 int type)60 : particleType(type) {54 G4InuclElementaryParticle(G4double ekin, G4int type) 55 : G4InuclParticle(makeDefinition(type), ekin), generation(0) {} 61 56 62 particleMass = getParticleMass(type);63 valid_particle = false;64 };57 // Copy and assignment constructors for use with std::vector<> 58 G4InuclElementaryParticle(const G4InuclElementaryParticle& right) 59 : G4InuclParticle(right), generation(right.generation) {} 65 60 66 G4InuclElementaryParticle(const G4CascadeMomentum& mom, 67 G4int type) 68 : G4InuclParticle(mom), 69 particleType(type) { 61 G4InuclElementaryParticle& operator=(const G4InuclElementaryParticle& right); 70 62 71 particleMass = getParticleMass(type); 72 momentum[0] = std::sqrt(momentum[1] * momentum[1] + momentum[2] * momentum[2] + 73 momentum[3] * momentum[3] + particleMass * particleMass); 74 valid_particle = true; 75 }; 63 void setType(G4int ityp); 64 G4int type() const { return type(getDefinition()); } 76 65 77 78 G4InuclElementaryParticle(const G4CascadeMomentum& mom, 79 G4int type, G4int model) 80 : G4InuclParticle(mom), 81 particleType(type) { 66 static G4int type(const G4ParticleDefinition* pd); 82 67 83 G4InuclParticle::setModel(model);68 G4bool isPhoton() const { return (type() == G4InuclParticleNames::photon); } 84 69 85 particleMass = getParticleMass(type); 86 momentum[0] = std::sqrt(momentum[1] * momentum[1] + momentum[2] * momentum[2] + 87 momentum[3] * momentum[3] + particleMass * particleMass); 88 valid_particle = true; 89 }; 70 G4bool pion() const { return (type()==G4InuclParticleNames::pionPlus || 71 type()==G4InuclParticleNames::pionMinus || 72 type()==G4InuclParticleNames::pionZero); } 90 73 91 G4InuclElementaryParticle(G4double ekin, 92 G4int type) 93 : particleType(type) { 74 G4bool nucleon() const { return (type()==G4InuclParticleNames::proton || 75 type()==G4InuclParticleNames::neutron); } 94 76 95 particleMass = getParticleMass(type); 96 momentum[0] = ekin + particleMass; 97 momentum[3] = std::sqrt(momentum[0] * momentum[0] - particleMass * particleMass); 98 momentum[1] = momentum[2] = 0.0; 99 valid_particle = true; 100 }; 77 G4int baryon() const { // Can use as a bool (!=0 ==> true) 78 return getDefinition()->GetBaryonNumber(); 79 } 101 80 102 void setType(G4int ityp) {81 G4bool quasi_deutron() const { return (type() > 100); } 103 82 104 particleType = ityp; 105 particleMass = getParticleMass(ityp); 106 }; 107 108 void setMomentum(const G4CascadeMomentum& mom) { 109 110 momentum = mom; 111 momentum[0] = std::sqrt(momentum[1] * momentum[1] + momentum[2] * momentum[2] + 112 momentum[3] * momentum[3] + particleMass * particleMass); 113 valid_particle = true; 114 }; 115 116 G4int type() const { 117 118 return particleType; 119 }; 120 121 G4bool photon() const { 122 123 return particleType == 10; 124 }; 125 126 G4bool nucleon() const { 127 return particleType <= 2; 128 }; 129 130 G4bool baryon() const { 131 return (particleType == 1 || 132 particleType == 2 || 133 particleType == 21 || 134 particleType == 23 || 135 particleType == 25 || 136 particleType == 27 || 137 particleType == 29 || 138 particleType == 31 ); 139 }; 140 141 G4bool pion() const { 142 143 return particleType == 3 || particleType == 5 || particleType == 7; 144 }; 145 146 G4bool quasi_deutron() const { 147 148 return particleType > 100; 149 }; 150 151 G4double getMass() const { 152 153 return particleMass; 154 }; 155 156 G4double getParticleMass() const { 157 158 G4double mass; 159 160 switch(particleType) { 161 case 1: // proton 162 mass = 0.93827; 163 break; 164 case 2: // neutron 165 mass = 0.93957; 166 break; 167 case 3: // pi+ 168 mass = 0.13957; 169 break; 170 case 5: // pi- 171 mass = 0.13957; 172 break; 173 case 7: // pi0 174 mass = 0.13498; 175 break; 176 case 10: // photon 177 mass = 0.0; 178 break; 179 case 11: // k+ 180 mass = 0.49368; 181 break; 182 case 13: // k- 183 mass = 0.49368; 184 break; 185 case 15: // k0 186 mass = 0.49767; 187 break; 188 case 17: // k0bar 189 mass = 0.49767; 190 break; 191 case 21: // lambda 192 mass = 1.1157; 193 break; 194 case 23: // sigma+ 195 mass = 1.1894; 196 break; 197 case 25: // sigma0 198 mass = 1.1926; 199 break; 200 case 27: // sigma- 201 mass = 1.1974; 202 break; 203 case 29: // xi0 204 mass = 1.3148; 205 break; 206 case 31: // xi- 207 mass = 1.3213; 208 break; 209 case 111: // PP 210 mass = 0.93827 + 0.93827; 211 break; 212 case 112: // PN 213 mass = 0.93827 + 0.93957; 214 break; 215 case 122: // NN 216 mass = 0.93957 + 0.93957; 217 break; 218 default: 219 G4cout << " uups, unknown particle type " << particleType << G4endl; 220 mass = 0.; 221 }; 222 223 return mass; 224 }; 225 226 G4double getCharge() const { 227 228 G4double charge; 229 230 switch(particleType) { 231 case 1: // proton 232 charge = 1.0; 233 break; 234 case 2: // neutron 235 charge = 0.0; 236 break; 237 case 3: // pi+ 238 charge = 1.0; 239 break; 240 case 5: // pi- 241 charge = -1.0; 242 break; 243 case 7: // pi0 244 charge = 0.0; 245 break; 246 case 10: // photon 247 charge = 0.0; 248 break; 249 case 11: // k+ 250 charge = 1.0; 251 break; 252 case 13: // k- 253 charge = -1.0; 254 break; 255 case 15: // k0 256 charge = 0.0; 257 break; 258 case 17: // k0bar 259 charge = 0.0; 260 break; 261 case 21: // lambda 262 charge = 0.0; 263 break; 264 case 23: // sigma+ 265 charge = 1.0; 266 break; 267 case 25: // sigma0 268 charge = 0.0; 269 break; 270 case 27: // sigma- 271 charge = -1.0; 272 break; 273 case 29: // xi0 274 charge = 0.0; 275 break; 276 case 31: // xi- 277 charge = -1.0; 278 break; 279 case 111: // PP 280 charge = 2.0; 281 break; 282 case 112: // PN 283 charge = 1.0; 284 break; 285 case 122: // NN 286 charge = 0.0; 287 break; 288 default: 289 G4cout << " uups, unknown particle type " << particleType << G4endl; 290 charge = 0.0; 291 }; 292 293 return charge; 294 }; 295 296 297 G4double getStrangeness(G4int type) const { 298 299 G4double strangeness; 300 301 switch(type) { 302 case 1: // proton 303 strangeness = 0.0; 304 break; 305 case 2: // neutron 306 strangeness = 0.0; 307 break; 308 case 3: // pi+ 309 strangeness = 0.0; 310 break; 311 case 5: // pi- 312 strangeness = 0.0; 313 break; 314 case 7: // pi0 315 strangeness = 0.0; 316 break; 317 case 10: // photon 318 strangeness = 0.0; 319 break; 320 case 11: // k+ 321 strangeness = 1.0; 322 break; 323 case 13: // k- 324 strangeness = -1.0; 325 break; 326 case 15: // k0 327 strangeness = 1.0; 328 break; 329 case 17: // k0bar 330 strangeness = -1.0; 331 break; 332 case 21: // lambda 333 strangeness = -1.0; 334 break; 335 case 23: // sigma+ 336 strangeness = -1.0; 337 break; 338 case 25: // sigma0 339 strangeness = -1.0; 340 break; 341 case 27: // sigma- 342 strangeness = -1.0; 343 break; 344 case 29: // xi0 345 strangeness = -2.0; 346 break; 347 case 31: // xi- 348 strangeness = -2.0; 349 break; 350 case 111: // PP 351 strangeness = 0.0; 352 break; 353 case 112: // PN 354 strangeness = 0.0; 355 break; 356 case 122: // NN 357 strangeness = 0.0; 358 break; 359 default: 360 G4cout << " unknown particle type " << type << G4endl; 361 strangeness = 0.0; 362 }; 363 364 return strangeness; 365 }; 366 367 368 G4double getParticleMass(G4int type) const { 369 370 G4double mass; 371 372 switch(type) { 373 case 1: // proton 374 mass = 0.93827; 375 break; 376 case 2: // neutron 377 mass = 0.93957; 378 break; 379 case 3: // pi+ 380 mass = 0.13957; 381 break; 382 case 5: // pi- 383 mass = 0.13957; 384 break; 385 case 7: // pi0 386 mass = 0.13498; 387 break; 388 case 10: // photon 389 mass = 0.0; 390 break; 391 case 11: // k+ 392 mass = 0.49368; 393 break; 394 case 13: // k- 395 mass = 0.49368; 396 break; 397 case 15: // k0 398 mass = 0.49767; 399 break; 400 case 17: // k0bar 401 mass = 0.49767; 402 break; 403 case 21: // lambda 404 mass = 1.1157; 405 break; 406 case 23: // sigma+ 407 mass = 1.1894; 408 break; 409 case 25: // sigma0 410 mass = 1.1926; 411 break; 412 case 27: // sigma- 413 mass = 1.1974; 414 break; 415 case 29: // xi0 416 mass = 1.3148; 417 break; 418 case 31: // xi- 419 mass = 1.3213; 420 break; 421 case 111: // PP 422 mass = 0.93827 + 0.93827; 423 break; 424 case 112: // PN 425 mass = 0.93827 + 0.93957; 426 break; 427 case 122: // NN 428 mass = 0.93957 + 0.93957; 429 break; 430 default: 431 G4cout << " uups, unknown particle type " << type << G4endl; 432 mass = 0.0; 433 }; 434 435 return mass; 436 }; 437 438 G4double getKineticEnergy() const { 439 440 return momentum[0] - particleMass; 441 }; 442 443 G4double getEnergy() const { 444 445 return momentum[0]; 446 }; 447 448 G4bool valid() const { 449 450 return valid_particle; 451 }; 83 G4bool valid() const { return type()>0; } 452 84 453 85 virtual void printParticle() const { 454 455 86 G4InuclParticle::printParticle(); 456 457 G4cout << " Particle: type " << particleType << " mass " << particleMass << 458 " ekin " << getKineticEnergy() << G4endl; 459 }; 460 461 void setGeneration(G4int gen) { 462 generation = gen; 87 G4cout << " Particle: type " << type() << " mass " << getMass() 88 << " ekin " << getKineticEnergy() << G4endl; 463 89 } 464 90 465 G4int getGeneration() { 466 return generation; 467 } 91 void setGeneration(G4int gen) { generation = gen; } 92 G4int getGeneration() const { return generation; } 93 94 static G4double getStrangeness(G4int type); 95 static G4double getParticleMass(G4int type); 96 97 protected: 98 // Convert internal type code to standard GEANT4 pointer 99 static G4ParticleDefinition* makeDefinition(G4int ityp); 468 100 469 101 private: 470 471 G4int particleType;472 473 G4double particleMass;474 475 G4bool valid_particle;476 477 102 G4int generation; 478 479 103 }; 480 104 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclEvaporation.hh
r819 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4InuclEvaporation.hh,v 1. 5 2007/05/24 23:27:01 miheikkiExp $26 // $Id: G4InuclEvaporation.hh,v 1.8 2010/05/21 18:07:30 mkelsey Exp $ 27 27 // Defines an interface to evaporation models of Bertini cascase (BERT) 28 28 // based on INUCL code. 29 29 // 30 // 20100405 M. Kelsey -- Pass const-ref std::vector<> 31 // 20100517 M. Kelsey -- MakeG4EvaporationInuclCollider a data member. 32 // 20100520 M. Kelsey -- Clean up interface 33 30 34 #ifndef G4INUCLEVAPORATION_h 31 35 #define G4INUCLEVAPORATION_h 1 … … 35 39 #include "G4Fragment.hh" 36 40 37 //#define DEBUG 41 class G4EvaporationInuclCollider; 42 38 43 39 44 class G4InuclEvaporation : public G4VEvaporation { … … 49 54 G4bool operator!=(const G4InuclEvaporation &right) const; 50 55 51 void fillResult( std::vector< G4DynamicParticle * > secondaryParticleVector,52 G4FragmentVector * aResult );53 56 public: 54 55 57 G4FragmentVector * BreakItUp(const G4Fragment &theNucleus); 56 58 57 59 void setVerboseLevel( const G4int verbose ); 58 60 59 61 private: 60 62 G4int verboseLevel; 61 62 #ifdef DEBUG 63 64 #endif 65 63 G4EvaporationInuclCollider* evaporator; 66 64 }; 67 65 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclNuclei.hh
r962 r1315 1 #ifndef G4INUCL_NUCLEI_HH 2 #define G4INUCL_NUCLEI_HH 1 3 // 2 4 // ******************************************************************** … … 23 25 // * acceptance of all terms of the Geant4 Software license. * 24 26 // ******************************************************************** 27 // $Id: G4InuclNuclei.hh,v 1.16 2010/04/09 19:33:11 mkelsey Exp $ 28 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 29 // 26 #ifndef G4INUCL_NUCLEI_HH 27 #define G4INUCL_NUCLEI_HH 30 // 20100112 Michael Kelsey -- Replace G4CascadeMomentum with G4LorentzVector 31 // 20100301 M. Kelsey -- Add function to create unphysical nuclei for use 32 // as temporary final-state fragments. 33 // 20100319 M. Kelsey -- Remove "using" directory and unnecessary #includes. 34 // 20100409 M. Kelsey -- Drop unused string argument from ctors. 28 35 29 #ifndef G4INUCL_PARTICLE_HH30 36 #include "G4InuclParticle.hh" 31 #endif32 37 #include "G4ExitonConfiguration.hh" 33 #include "G4InuclSpecialFunctions.hh"34 38 35 using namespace G4InuclSpecialFunctions;39 class G4ParticleDefinition; 36 40 37 41 class G4InuclNuclei : public G4InuclParticle { 42 public: 43 G4InuclNuclei() : G4InuclParticle() {} 38 44 39 public: 45 G4InuclNuclei(G4double a, G4double z) 46 : G4InuclParticle(makeDefinition(a,z)), 47 exitationEnergy(0.0) {} 40 48 41 G4InuclNuclei() {}; 49 G4InuclNuclei(const G4LorentzVector& mom, G4double a, G4double z) 50 : G4InuclParticle(makeDefinition(a,z), mom), 51 exitationEnergy(0.0) {} 42 52 43 G4InuclNuclei(G4double a, 44 G4double z) 45 : A(a), 46 Z(z) { 53 G4InuclNuclei(G4double ekin, G4double a, G4double z) 54 : G4InuclParticle(makeDefinition(a,z), ekin), 55 exitationEnergy(0.0) {} 47 56 48 setNucleiMass(); 49 exitationEnergy = 0.0; 50 }; 57 virtual ~G4InuclNuclei() {} 51 58 52 G4InuclNuclei(const G4CascadeMomentum& mom, 53 G4double a, 54 G4double z) 55 : G4InuclParticle(mom), 56 A(a), 57 Z(z) { 59 // Copy and assignment constructors for use with std::vector<> 60 G4InuclNuclei(const G4InuclNuclei& right) 61 : G4InuclParticle(right), exitationEnergy(right.exitationEnergy), 62 theExitonConfiguration(right.theExitonConfiguration) {} 58 63 59 setNucleiMass(); 60 exitationEnergy = 0.0; 61 }; 64 G4InuclNuclei& operator=(const G4InuclNuclei& right); 62 65 63 G4InuclNuclei(G4double ekin, 64 G4double a, 65 G4double z) 66 : A(a), 67 Z(z) { 68 69 setNucleiMass(); 70 G4CascadeMomentum mom; 71 mom[0] = ekin + nucleiMass; 72 mom[3] = std::sqrt(mom[0] * mom[0] - nucleiMass * nucleiMass); 73 G4InuclParticle::setMomentum(mom); 74 exitationEnergy = 0.0; 75 }; 76 77 void setA(G4double a) { 78 79 A = a; 80 }; 81 82 void setZ(G4double z) { 83 84 Z = z; 85 }; 86 87 void setExitationEnergy(G4double e) { 88 89 exitationEnergy = e; 90 }; 91 92 void setEnergy() { 93 94 momentum[0] = std::sqrt(momentum[1] * momentum[1] + momentum[2] * momentum[2] + 95 momentum[3] * momentum[3] + nucleiMass * nucleiMass); 96 }; 97 98 void setNucleiMass() { 99 100 nucleiMass = 0.93827 * Z + 0.93957 * (A - Z) - 0.001 * bindingEnergy(A, Z); 101 }; 66 void setExitationEnergy(G4double e) { exitationEnergy = e; } 102 67 103 68 void setExitonConfiguration(const G4ExitonConfiguration& config) { 69 theExitonConfiguration = config; 70 } 104 71 105 theExitonConfiguration = config; 106 }; 72 G4double getA() const { return getDefinition()->GetAtomicMass(); } 107 73 108 G4double get A() const {74 G4double getZ() const { return getDefinition()->GetAtomicNumber(); } 109 75 110 return A; 111 }; 112 113 G4double getZ() const { 114 115 return Z; 116 }; 117 118 G4double getExitationEnergy() const { 119 120 return exitationEnergy; 121 }; 76 G4double getExitationEnergy() const { return exitationEnergy; } 122 77 123 78 G4double getExitationEnergyInGeV() const { 79 return 0.001 * exitationEnergy; 80 } 124 81 125 return 0.001 * exitationEnergy; 126 }; 82 const G4ExitonConfiguration& getExitonConfiguration() const { 83 return theExitonConfiguration; 84 } 127 85 128 G4ExitonConfiguration getExitonConfiguration() const { 129 130 return theExitonConfiguration; 131 }; 132 133 G4double getMass() const { 134 135 return nucleiMass; 136 }; 137 138 G4double getKineticEnergy() const { 139 140 return momentum[0] - nucleiMass; 141 }; 142 143 G4double getNucleiMass(G4double a, 144 G4double z) const { 145 146 return 0.93827 * z + 0.93957 * (a - z) - 0.001 * bindingEnergy(a, z); 147 }; 86 static G4double getNucleiMass(G4double a, G4double z); 148 87 149 88 virtual void printParticle() const { 89 G4cout << " A " << getA() << " Z " << getZ() << " mass " 90 << getMass() << " Eex (MeV) " << exitationEnergy << G4endl; 91 G4InuclParticle::printParticle(); 92 } 150 93 151 G4cout << " A " << A << " Z " << Z << " mass " << nucleiMass << 152 " Eex (MeV) " << exitationEnergy << G4endl; 94 protected: 95 // Convert nuclear configuration to standard GEANT4 pointer 96 static G4ParticleDefinition* 97 makeDefinition(G4double a, G4double z, G4double exc=0.); 153 98 154 G4cout << " Px " << momentum[1] << " Py " << momentum[2] << " Pz " << 155 momentum[3] << " E " << momentum[0] << G4endl; 156 }; 99 static G4ParticleDefinition* 100 makeNuclearFragment(G4double a, G4double z, G4double exc=0.); 157 101 158 102 private: 159 160 G4double A;161 G4double Z;162 103 G4double exitationEnergy; 163 G4double nucleiMass;164 104 G4ExitonConfiguration theExitonConfiguration; 165 166 105 }; 167 106 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclParticle.hh
r962 r1315 1 #ifndef G4INUCL_PARTICLE_HH 2 #define G4INUCL_PARTICLE_HH 1 3 // 2 4 // ******************************************************************** … … 23 25 // * acceptance of all terms of the Geant4 Software license. * 24 26 // ******************************************************************** 27 // $Id: G4InuclParticle.hh,v 1.19 2010/05/21 18:07:30 mkelsey Exp $ 28 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 29 // 26 #ifndef G4INUCL_PARTICLE_HH 27 #define G4INUCL_PARTICLE_HH 30 // 20100112 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly 31 // 20100409 M. Kelsey -- Drop unused string argument from ctors. 32 // 20100519 M. Kelsey -- Add public access to G4DynamicParticle content 28 33 29 #ifndef GLOB 34 #include "G4DynamicParticle.hh" 35 #include "G4LorentzVector.hh" 30 36 #include "globals.hh" 31 #endif32 37 33 #include <iostream>34 #include <vector>35 #include "G4CascadeMomentum.hh"36 37 // Notice: no cc-file for G4InuclParticle38 38 39 39 class G4InuclParticle { 40 public: 41 G4InuclParticle() : modelId(0) {} 40 42 41 public: 42 G4InuclParticle() { 43 setModel(0); // default model 44 }; 43 explicit G4InuclParticle(const G4LorentzVector& mom) : modelId(0) { 44 pDP.Set4Momentum(mom*GeV/MeV); // From Bertini to G4 units 45 } 45 46 46 virtual ~G4InuclParticle() { }; 47 48 G4InuclParticle(const G4CascadeMomentum& mom) { 49 setMomentum(mom); 50 setModel(0); 51 }; 47 virtual ~G4InuclParticle() {} 52 48 53 void setMomentum(const G4CascadeMomentum& mom) {54 momentum = mom;55 };49 // Copy and assignment constructors for use with std::vector<> 50 G4InuclParticle(const G4InuclParticle& right) 51 : pDP(right.pDP), modelId(right.modelId) {} 56 52 53 G4InuclParticle& operator=(const G4InuclParticle& right); 57 54 58 const G4CascadeMomentum& getMomentum() const { 59 return momentum; 60 }; 55 // This is no longer required, as setMomentum() handles mass adjustment 56 void setEnergy() { ; } 61 57 62 G4double getMomModule() const { 63 return std::sqrt(momentum[1] * momentum[1] + 64 momentum[2] * momentum[2] + 65 momentum[3] * momentum[3]); 66 }; 67 68 virtual void printParticle() const { 69 G4cout << " px " << momentum[1] << " py " << momentum[2] << 70 " pz " << momentum[3] << 71 " pmod " << std::sqrt(momentum[1] * momentum[1] + 72 momentum[2] * momentum[2] + 73 momentum[3] * momentum[3]) 74 << " E " << momentum[0] 75 << " creator model " << modelId << G4endl; 76 }; 58 // These are call-throughs to G4DynamicParticle 59 void setMomentum(const G4LorentzVector& mom); 77 60 78 void setModel(G4int model) { 79 modelId = model; 80 }; 61 void setMass(G4double mass) { pDP.SetMass(mass*GeV/MeV); } 81 62 82 G4int getModel() { 83 return modelId; 84 }; 63 G4double getMass() const { 64 return pDP.GetMass()*MeV/GeV; // From G4 to Bertini units 65 } 66 67 G4double getCharge() const { 68 return pDP.GetCharge(); 69 } 70 71 G4double getKineticEnergy() const { 72 return pDP.GetKineticEnergy()*MeV/GeV; // From G4 to Bertini units 73 } 74 75 G4double getEnergy() const { 76 return pDP.GetTotalEnergy()*MeV/GeV; // From G4 to Bertini units 77 } 78 79 G4double getMomModule() const { 80 return pDP.GetTotalMomentum()*MeV/GeV; // From G4 to Bertini units 81 } 82 83 G4LorentzVector getMomentum() const { 84 return pDP.Get4Momentum()*MeV/GeV; // From G4 to Bertini units 85 } 86 87 virtual void printParticle() const; 88 89 void setModel(G4int model) { modelId = model; } 90 91 G4int getModel() const { return modelId; } 92 93 G4ParticleDefinition* getDefinition() const { 94 return pDP.GetDefinition(); 95 } 96 97 const G4DynamicParticle& getDynamicParticle() const { 98 return pDP; 99 } 85 100 86 101 protected: 87 G4CascadeMomentum momentum; 102 // Special constructors for subclasses to set particle type correctly 103 explicit G4InuclParticle(G4ParticleDefinition* pd) : modelId(0) { 104 setDefinition(pd); 105 } 106 107 // FIXME: Bertini code doesn't pass valid 4-vectors, so force mass value 108 // from supplied PartDefn, with required unit conversions 109 G4InuclParticle(G4ParticleDefinition* pd, const G4LorentzVector& mom); 110 111 // NOTE: Momentum forced along Z direction 112 G4InuclParticle(G4ParticleDefinition* pd, G4double ekin) 113 : pDP(pd,G4ThreeVector(0.,0.,1.),ekin*GeV/MeV), modelId(0) {} 114 115 void setDefinition(G4ParticleDefinition* pd) { pDP.SetDefinition(pd); } 88 116 89 117 private: 90 G4 int modelId; // used to indicate model that created instance of G4InuclParticle118 G4DynamicParticle pDP; // Carries all the kinematics and info 91 119 120 G4int modelId; 121 // used to indicate model that created instance of G4InuclParticle 92 122 // 0 default 93 123 // 1 bullet -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclSpecialFunctions.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4InuclSpecialFunctions.hh,v 1.16 2010/04/13 05:30:10 mkelsey Exp $ 26 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100114 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly 29 // 20100319 M. Kelsey -- Add optional mass argument to generateWithFixedTheta; 30 // define new generateWithRandomAngles, encapsulating code; define 31 // cbrt() cube-root function (in math.h, but not in <math>!) 32 // 20100412 M. Kelsey -- Modify paraMaker[Truncated] to take buffer as argument 33 26 34 #ifndef G4INUCL_SPECIAL_FUNC_HH 27 35 #define G4INUCL_SPECIAL_FUNC_HH 28 36 29 37 #include "globals.hh" 30 #include <cmath>31 38 #include <algorithm> 32 39 #include <vector> 33 #include "G4 CascadeMomentum.hh"40 #include "G4LorentzVector.hh" 34 41 35 42 namespace G4InuclSpecialFunctions { … … 51 58 G4int ntype); 52 59 53 std::pair<std::vector<G4double>, std::vector<G4double> > paraMaker(G4double Z);60 void paraMaker(G4double Z, std::pair<std::vector<G4double>, std::vector<G4double> >& parms); 54 61 55 std::pair<G4double, G4double> paraMakerTruncated(G4double Z);62 void paraMakerTruncated(G4double Z, std::pair<G4double, G4double>& parms); 56 63 57 64 G4double getAL(G4double A); … … 60 67 61 68 G4double csPN(G4double e); 69 70 G4double G4cbrt(G4double x); // Can't use "cbrt" name, clashes with <math.h> 62 71 63 72 G4double inuclRndm(); … … 71 80 G4double nucleiLevelDensity(G4double a); 72 81 73 G4CascadeMomentum generateWithFixedTheta(G4double ct, 74 G4double p); 82 // Optional mass argument will be used to fill G4LorentzVector correctly 83 G4LorentzVector generateWithFixedTheta(G4double ct, G4double p, 84 G4double m=0.); 85 86 G4LorentzVector generateWithRandomAngles(G4double p, G4double m=0.); 75 87 } 88 89 76 90 #endif -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4LorentzConvertor.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4LorentzConvertor.hh,v 1.15 2010/05/21 17:56:34 mkelsey Exp $ 26 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100108 Michael Kelsey -- Use G4LorentzVector internally 29 // 20100120 M. Kelsey -- BUG FIX: scm_momentum should be G4ThreeVector 30 // 20100126 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly 31 // 20100519 M. Kelsey -- Add interfaces to pass G4InuclParticles directly 32 26 33 #ifndef G4LORENTZ_CONVERTOR_HH 27 34 #define G4LORENTZ_CONVERTOR_HH 28 35 29 #ifndef GLOB30 36 #include "globals.hh" 31 #endif 37 #include "G4LorentzVector.hh" 38 #include "G4ThreeVector.hh" 32 39 33 #include <vector> 34 #include "G4CascadeMomentum.hh" 40 class G4InuclParticle; 35 41 36 42 class G4LorentzConvertor { … … 40 46 G4LorentzConvertor(); 41 47 42 G4LorentzConvertor(const G4CascadeMomentum& bmom, 43 G4double bmass, 44 const G4CascadeMomentum& tmom, 45 G4double tmass) { 46 48 G4LorentzConvertor(const G4LorentzVector& bmom, G4double bmass, 49 const G4LorentzVector& tmom, G4double tmass) { 47 50 setBullet(bmom, bmass); 48 51 setTarget(tmom, tmass); 49 degenerated = false; 50 }; 52 } 51 53 52 void setBullet(const G4CascadeMomentum& bmom, 53 G4double bmass) { 54 G4LorentzConvertor(const G4InuclParticle* bullet, 55 const G4InuclParticle* target) { 56 setBullet(bullet); 57 setTarget(target); 58 } 54 59 55 bullet_mom = bmom; 56 bullet_mass = bmass; 57 // G4cout << " bullet: e " << bmom[0] << " mass " << bmass << G4endl; 60 void setVerbose(G4int vb=0) { verboseLevel = vb; } 61 62 void setBullet(const G4InuclParticle* bullet); 63 void setTarget(const G4InuclParticle* target); 64 65 void setBullet(const G4InuclParticle& bullet) { setBullet(&bullet); } 66 void setTarget(const G4InuclParticle& target) { setTarget(&target); } 67 68 // Use correct four-vectors as input 69 void setBullet(const G4LorentzVector& bmom) { bullet_mom = bmom; } 70 void setTarget(const G4LorentzVector& bmom) { target_mom = bmom; } 71 72 // NOTE: These functions "repair" input 4-vectors using specified mass 73 void setBullet(const G4LorentzVector& bmom, G4double bmass) { 74 bullet_mom.setVectM(bmom.vect(), bmass); 75 76 // G4cout << " bullet: e " << bullet_mom.e() << " mass " 77 // << bullet_mom.m() << G4endl; 58 78 }; 59 79 60 void setTarget(const G4 CascadeMomentum& tmom,61 G4double tmass) { 80 void setTarget(const G4LorentzVector& tmom, G4double tmass) { 81 target_mom.setVectM(tmom.vect(), tmass); 62 82 63 target_mom = tmom; 64 target_mass = tmass; 65 // G4cout << " target: e " << tmom[0] << " mass " << tmass << G4endl; 83 // G4cout << " target: e " << target_mom.e() << " mass " 84 // << target_mom.m() << G4endl; 66 85 }; 67 86 68 87 void toTheCenterOfMass(); 69 70 88 void toTheTargetRestFrame(); 71 89 72 G4 CascadeMomentum backToTheLab(const G4CascadeMomentum& mom) const;90 G4LorentzVector backToTheLab(const G4LorentzVector& mom) const; 73 91 74 G4double getKinEnergyInTheTRS() const { 92 // Four-vectors of bullet and target in last chosen reference frame 93 const G4LorentzVector& getBullet() const { return bullet_mom; } 94 const G4LorentzVector& getTarget() const { return target_mom; } 95 96 G4double getKinEnergyInTheTRS() const; 97 G4double getTotalSCMEnergy() const { return ecm_tot; } 98 G4double getSCMMomentum() const { return scm_momentum.rho(); } 99 G4double getTRSMomentum() const; 75 100 76 G4double pv = bullet_mom[1] * target_mom[1] + 77 bullet_mom[2] * target_mom[2] + 78 bullet_mom[3] * target_mom[3]; 79 G4double ekin_trf = (target_mom[0] * 80 bullet_mom[0] - pv) / target_mass - bullet_mass; 81 return ekin_trf; 82 }; 101 G4LorentzVector rotate(const G4LorentzVector& mom) const; 83 102 84 G4double getTotalSCMEnergy() const { 85 86 return ecm_tot; 87 }; 88 89 G4double getSCMMomentum() const { 90 91 return pscm; 92 }; 93 94 G4double getTRSMomentum() const { 95 96 return plab; 97 }; 98 99 G4CascadeMomentum rotate(const G4CascadeMomentum& mom) const; 100 101 G4CascadeMomentum rotate(const G4CascadeMomentum& mom1, 102 const G4CascadeMomentum& mom) const; 103 G4LorentzVector rotate(const G4LorentzVector& mom1, 104 const G4LorentzVector& mom) const; 103 105 104 106 G4bool reflectionNeeded() const; 105 107 106 G4bool trivial() const { 107 return degenerated; 108 }; 108 G4bool trivial() const { return degenerated; } 109 109 110 110 private: 111 G4int verboseLevel; 112 G4CascadeMomentum bullet_mom; 113 G4double bullet_mass; 111 static const G4double small; 114 112 115 G4CascadeMomentum target_mom; 116 G4double target_mass; 113 G4int verboseLevel; 114 G4LorentzVector bullet_mom; 115 G4LorentzVector target_mom; 117 116 118 std::vector<G4double> velocity;117 G4LorentzVector scm_momentum; // CM momentum relative to target/bullet 119 118 120 G4CascadeMomentum scm_momentum; 121 119 // Buffer variables for doing ::rotate() calculations 120 G4ThreeVector velocity; 121 G4double gamma; 122 G4double v2; 122 123 G4double ecm_tot; 123 124 G4double pscm;125 126 G4double plab;127 128 G4double gamma;129 130 G4double v2;131 132 124 G4double ga; 133 134 125 G4double gb; 135 136 126 G4double gbpp; 137 138 127 G4double gapp; 139 140 128 G4bool degenerated; 141 129 }; -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4NonEquilibriumEvaporator.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4NonEquilibriumEvaporator.hh,v 1.10 2010/05/21 17:56:34 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100315 M. Kelsey -- Remove "using" directive and unnecessary #includes. 29 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide() 30 // 20100517 M. Kelsey -- Inherit from common base class 31 26 32 #ifndef G4NON_EQUILIBRIUM_EVAPORATOR_HH 27 33 #define G4NON_EQUILIBRIUM_EVAPORATOR_HH 28 34 29 #include "G4Collider.hh" 30 #include "G4InuclSpecialFunctions.hh" 35 #include "G4VCascadeCollider.hh" 31 36 32 using namespace G4InuclSpecialFunctions; 37 class G4CollisionOutput; 38 class G4InuclParticle; 33 39 34 class G4NonEquilibriumEvaporator { 40 class G4NonEquilibriumEvaporator : public G4VCascadeCollider { 41 public: 42 G4NonEquilibriumEvaporator(); 43 virtual ~G4NonEquilibriumEvaporator() {} 35 44 36 public: 37 38 G4NonEquilibriumEvaporator(); 39 40 G4CollisionOutput collide(G4InuclParticle* bullet, 41 G4InuclParticle* target); 45 void collide(G4InuclParticle* bullet, G4InuclParticle* target, 46 G4CollisionOutput& output); 42 47 43 48 private: 44 G4int verboseLevel;45 49 G4double getMatrixElement(G4double A) const; 46 47 50 G4double getE0(G4double A) const; 48 49 51 G4double getParLev(G4double A, G4double Z) const; 50 51 52 }; 52 53 53 #endif / / G4NON_EQUILIBRIUM_EVAPORATOR_HH54 #endif /* G4NON_EQUILIBRIUM_EVAPORATOR_HH */ -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4NuclWatcher.hh
r819 r1315 1 #ifndef G4NUCL_WATCHER_HH 2 #define G4NUCL_WATCHER_HH 1 3 // 2 4 // ******************************************************************** … … 23 25 // * acceptance of all terms of the Geant4 Software license. * 24 26 // ******************************************************************** 27 // $Id: G4NuclWatcher.hh,v 1.13 2010/04/07 18:23:15 mkelsey Exp $ 28 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 29 // 26 #ifndef G4NUCL_WATCHER_HH 27 #define G4NUCL_WATCHER_HH 30 // 20100202 M. Kelsey -- Move most code into .cc file 31 // 20100405 M. Kelsey -- Pass const-ref std::vector<> 28 32 29 #ifndef GLOB 30 #include "globals.hh" 31 #endif 33 #include "G4Types.hh" 32 34 33 35 #include <algorithm> … … 36 38 37 39 class G4NuclWatcher { 40 public: 41 G4NuclWatcher(G4double z, 42 const std::vector<G4double>& expa, 43 const std::vector<G4double>& expcs, 44 const std::vector<G4double>& experr, 45 G4bool check, 46 G4bool nucl); 38 47 39 public: 48 ~G4NuclWatcher() {} 40 49 41 G4NuclWatcher(G4double z, 42 std::vector<G4double> expa, 43 std::vector<G4double> expcs, 44 std::vector<G4double> experr, 45 G4bool check, 46 G4bool nucl) 47 : nuclz(z), 48 checkable(check), 49 nucleable(nucl) { 50 void watch(G4double a, G4double z); 51 void setInuclCs(G4double csec, G4int nev); 50 52 51 exper_as = expa; 52 exper_cs = expcs; 53 exper_err = experr; 54 }; 53 G4double getChsq() const { return izotop_chsq; } 54 G4bool to_check() const { return checkable; } 55 G4bool look_forNuclei() const { return nucleable; } 56 G4double getLhood() const { return aver_lhood; } 57 G4double getNmatched() const { return aver_matched; } 55 58 56 void watch(G4double a, 57 G4double z) { 58 59 const G4double small = 0.001; 60 61 if(std::fabs(z - nuclz) < small) { 62 G4bool here = false; 63 G4int simulatedAsSize = simulated_as.size(); 64 for(G4int i = 0; i < simulatedAsSize; i++) { 65 66 if(std::fabs(simulated_as[i] - a) < small) { 67 simulated_cs[i] += 1.0; 68 here = true; 69 break; 70 }; 71 }; 72 if(!here) { 73 simulated_as.push_back(a); 74 simulated_cs.push_back(1.0); 75 }; 76 }; 77 }; 78 79 void setInuclCs(G4double csec, 80 G4int nev) { 81 G4int simulatedAsSize = simulated_as.size(); 82 for(G4int i = 0; i < simulatedAsSize ; i++) { 83 double err = std::sqrt(simulated_cs[i]) / simulated_cs[i]; 84 85 simulated_prob.push_back(simulated_cs[i] / nev); 86 simulated_cs[i] *= csec / nev; 87 simulated_errors.push_back(simulated_cs[i] * err); 88 }; 89 }; 90 91 G4double getChsq() const { 92 93 return izotop_chsq; 94 }; 59 std::pair<G4double, G4double> getExpCs() const; 60 std::pair<G4double, G4double> getInuclCs() const; 95 61 96 62 std::pair<G4double, G4double> getAverageRatio() const { 63 return std::pair<G4double, G4double>(average_ratio, aver_rat_err); 64 } 97 65 98 return std::pair<G4double, G4double>(average_ratio, aver_rat_err); 99 }; 100 101 std::pair<G4double, G4double> getExpCs() const { 102 103 G4double cs = 0.0; 104 G4double err = 0.0; 105 106 G4int experAsSize = exper_as.size(); 107 for(G4int iz = 0; iz < experAsSize; iz++) { 108 cs += exper_cs[iz]; 109 err += exper_err[iz]; 110 }; 111 112 return std::pair<G4double, G4double>(cs, err); 113 }; 114 115 G4bool to_check() const { 116 117 return checkable; 118 }; 119 120 G4bool look_forNuclei() const { 121 122 return nucleable; 123 }; 124 125 std::pair<G4double, G4double> getInuclCs() const { 126 127 G4double cs = 0.0; 128 G4double err = 0.0; 129 G4int simulatedAsSize = simulated_as.size(); 130 for(G4int iz = 0; iz < simulatedAsSize; iz++) { 131 cs += simulated_cs[iz]; 132 err += simulated_errors[iz]; 133 }; 134 135 return std::pair<G4double, G4double>(cs, err); 136 }; 137 138 void print() { 139 140 const G4double small = 0.001; 141 142 G4cout << G4endl << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ " 143 << G4endl; 144 G4cout << " **** izotop Z **** " << nuclz << G4endl; 145 146 izotop_chsq = 0.0; 147 average_ratio = 0.0; 148 aver_rat_err = 0.0; 149 G4double exp_cs = 0.0; 150 G4double exp_cs_err = 0.0; 151 G4double inucl_cs = 0.0; 152 G4double inucl_cs_err = 0.0; 153 std::vector<G4bool> not_used(simulated_cs.size(), true); 154 G4int nmatched = exper_as.size(); 155 G4int nused = simulated_cs.size(); 156 G4double lhood = 0.0; 157 G4int experAsSize = exper_as.size(); 158 for(G4int iz = 0; iz < experAsSize; iz++) { 159 G4double a = exper_as[iz]; 160 161 exp_cs += exper_cs[iz]; 162 exp_cs_err += exper_err[iz]; 163 164 G4bool found = false; 165 G4int simulatedAsSize = simulated_as.size(); 166 for(G4int i = 0; i < simulatedAsSize; i++) { 167 168 if(std::fabs(simulated_as[i] - a) < small) { 169 G4double rat = simulated_cs[i] / exper_cs[iz]; 170 171 lhood += std::log10(rat) * std::log10(rat); 172 173 G4double rat_err = std::sqrt(simulated_errors[i] * simulated_errors[i] + 174 exper_err[iz] * exper_err[iz] * rat * rat) / exper_cs[iz]; 175 average_ratio += rat; 176 aver_rat_err += rat_err; 177 178 G4cout << " A " << a << " exp.cs " << exper_cs[iz] << " err " << 179 exper_err[iz] << G4endl << 180 " sim. cs " << simulated_cs[i] << " err " << simulated_errors[i] << G4endl 181 << " ratio " << rat << " err " << rat_err << G4endl; 182 G4cout << " simulated production rate " << simulated_prob[i] << G4endl; 183 184 not_used[i] = false; 185 izotop_chsq += (rat - 1.0) * (rat - 1.0) / rat_err / rat_err; 186 found = true; 187 nused--; 188 break; 189 }; 190 }; 191 if(!found) { 192 G4cout << " not found exper.: A " << a << " exp.cs " << exper_cs[iz] 193 << " err " << exper_err[iz] << G4endl; 194 } 195 else { 196 nmatched--; 197 }; 198 }; 199 200 G4cout << " not found in simulations " << nmatched << G4endl; 201 G4cout << " not found in exper: " << nused << G4endl; 202 G4int simulatedAsSize = simulated_as.size(); 203 for(G4int i = 0; i < simulatedAsSize; i++) { 204 inucl_cs += simulated_cs[i]; 205 inucl_cs_err += simulated_errors[i]; 206 207 if(not_used[i]) 208 G4cout << " extra simul.: A " << simulated_as[i] << 209 " sim. cs " << simulated_cs[i] << " err " << simulated_errors[i] << G4endl; 210 G4cout << " simulated production rate " << simulated_prob[i] << G4endl; 211 }; 212 G4int matched = exper_as.size() - nmatched; 213 214 if(matched > 0) { 215 aver_lhood = lhood; 216 aver_matched = matched; 217 lhood = std::pow(10.0, std::sqrt(lhood / matched)); 218 219 G4cout << " matched " << matched << " CHSQ " << std::sqrt(izotop_chsq) / matched 220 << G4endl 221 << " raw chsq " << izotop_chsq << G4endl 222 << " average ratio " << average_ratio / matched 223 << " err " << aver_rat_err / matched << G4endl 224 << " lhood " << lhood << G4endl; 225 } 226 else { 227 izotop_chsq = 0.0; 228 aver_lhood = 0.0; 229 }; 230 231 G4cout << " exper. cs " << exp_cs << " err " << exp_cs_err << G4endl 232 << " inucl. cs " << inucl_cs << " err " << inucl_cs_err << G4endl; 233 G4cout << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ " << G4endl; 234 }; 235 236 G4double getLhood() const { 237 238 return aver_lhood; 239 }; 240 241 G4double getNmatched() const { 242 243 return aver_matched; 244 }; 66 void print(); 245 67 246 68 private: 247 248 69 G4double nuclz; 249 250 70 G4double izotop_chsq; 251 252 71 G4double average_ratio; 253 254 72 G4double aver_rat_err; 255 256 73 G4double aver_lhood; 257 258 74 G4double aver_matched; 259 260 75 std::vector<G4double> exper_as; 261 262 76 std::vector<G4double> exper_cs; 263 264 77 std::vector<G4double> exper_err; 265 266 78 std::vector<G4double> simulated_as; 267 268 79 std::vector<G4double> simulated_cs; 269 270 80 std::vector<G4double> simulated_errors; 271 272 81 std::vector<G4double> simulated_prob; 273 274 82 G4bool checkable; 275 276 83 G4bool nucleable; 277 278 }; 84 }; 279 85 280 86 #endif // G4NUCL_WATCHER_HH -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4NucleiModel.hh
r1196 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4NucleiModel.hh,v 1.25 2010/05/21 17:44:38 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100319 M. Kelsey -- Remove "using" directory and unnecessary #includes, 29 // move ctor to .cc file 30 // 20100407 M. Kelsey -- Create "partners thePartners" data member to act 31 // as buffer between ::generateInteractionPartners() and 32 // ::generateParticleFate(), and make "outgoing_cparticles" a 33 // data member returned from the latter by const-ref. Replace 34 // return-by-value of initializeCascad() with an input buffer. 35 // 20100409 M. Kelsey -- Add function to sort list of partnerts by pathlen, 36 // move non-inlinable code to .cc. 37 // 20100421 M. Kelsey -- Move getFermiKinetic() to .cc, no hardwired masses. 38 // 20100517 M. Kelsey -- Change cross-section tables to static arrays. Move 39 // absorptionCrossSection() from SpecialFunc. 40 // 20100520 M. Kelsey -- Add function to separate momentum from nucleon 41 26 42 #ifndef G4NUCLEI_MODEL_HH 27 43 #define G4NUCLEI_MODEL_HH 28 44 29 30 #ifndef G4INUCL_ELEMENTARY_PARTICLE_HH31 45 #include "G4InuclElementaryParticle.hh" 32 #endif33 46 #include "G4CascadParticle.hh" 34 #include "G4InuclSpecialFunctions.hh" 35 #include "G4ElementaryParticleCollider.hh" 36 37 47 #include <algorithm> 38 48 #include <vector> 39 49 40 50 class G4InuclNuclei; 41 42 using namespace G4InuclSpecialFunctions; 43 44 typedef std::pair<G4InuclElementaryParticle, G4double> partner; 45 typedef std::vector<partner> partners; 51 class G4ElementaryParticleCollider; 46 52 47 53 class G4NucleiModel { … … 50 56 51 57 G4NucleiModel(); 52 53 G4NucleiModel(G4InuclNuclei* nuclei) { 54 generateModel(nuclei->getA(), nuclei->getZ()); 55 } 58 G4NucleiModel(G4InuclNuclei* nuclei); 56 59 57 60 void generateModel(G4double a, G4double z); 58 59 61 60 62 void reset() { … … 76 78 } 77 79 78 79 G4double getFermiKinetic(G4int ip, G4int izone) const { 80 G4double ekin = 0.0; 81 82 if(ip < 3 && izone < number_of_zones) { 83 G4double pf = fermi_momenta[ip - 1][izone]; 84 G4double mass = ip == 1 ? 0.93827 : 0.93957; 85 86 ekin = std::sqrt(pf * pf + mass * mass) - mass; 87 } 88 return ekin; 89 } 90 80 G4double getFermiKinetic(G4int ip, G4int izone) const; 91 81 92 82 G4double getPotential(G4int ip, G4int izone) const { … … 98 88 99 89 100 std::vector<G4CascadParticle>90 const std::vector<G4CascadParticle>& 101 91 generateParticleFate(G4CascadParticle& cparticle, 102 92 G4ElementaryParticleCollider* theElementaryParticleCollider); … … 126 116 127 117 128 std::pair<std::vector<G4CascadParticle>, std::vector<G4InuclElementaryParticle> > 129 initializeCascad(G4InuclNuclei* bullet, G4InuclNuclei* target); 118 typedef std::pair<std::vector<G4CascadParticle>, std::vector<G4InuclElementaryParticle> > modelLists; 119 120 void initializeCascad(G4InuclNuclei* bullet, G4InuclNuclei* target, 121 modelLists& output); 130 122 131 123 … … 139 131 G4InuclElementaryParticle generateNucleon(G4int type, G4int zone) const; 140 132 133 G4LorentzVector generateNucleonMomentum(G4int type, G4int zone) const; 134 135 G4double absorptionCrossSection(G4double e, G4int type) const; 136 G4double totalCrossSection(G4double ke, G4int rtype) const; 137 141 138 private: 142 143 139 G4int verboseLevel; 144 145 void initTotalCrossSections();146 G4double totalCrossSection(G4double e, G4int rtype) const;147 140 148 141 G4bool passFermi(const std::vector<G4InuclElementaryParticle>& particles, … … 155 148 G4int zone) const; 156 149 157 partners generateInteractionPartners(G4CascadParticle& cparticle) const; 150 typedef std::pair<G4InuclElementaryParticle, G4double> partner; 151 152 std::vector<partner> thePartners; // Buffer for output below 153 void generateInteractionPartners(G4CascadParticle& cparticle); 154 155 // Function for std::sort() to use in organizing partners by path length 156 static G4bool sortPartners(const partner& p1, const partner& p2) { 157 return (p2.second > p1.second); 158 } 158 159 159 160 G4double volNumInt(G4double r1, G4double r2, G4double cu, … … 164 165 G4double getRatio(G4int ip) const; 165 166 167 std::vector<G4CascadParticle> outgoing_cparticles; // Return buffer 168 166 169 std::vector<std::vector<G4double> > nucleon_densities; 167 170 … … 191 194 192 195 // Total cross sections 193 194 G4double PPtot[30]; 195 G4double NPtot[30]; 196 G4double pipPtot[30]; 197 G4double pimPtot[30]; 198 G4double pizPtot[30]; 199 G4double kpPtot[30]; 200 G4double kpNtot[30]; 201 G4double kmPtot[30]; 202 G4double kmNtot[30]; 203 G4double lPtot[30]; 204 G4double spPtot[30]; 205 G4double smPtot[30]; 206 G4double xi0Ptot[30]; 207 G4double ximPtot[30]; 208 196 static const G4double PPtot[30]; 197 static const G4double NPtot[30]; 198 static const G4double pipPtot[30]; 199 static const G4double pimPtot[30]; 200 static const G4double pizPtot[30]; 201 static const G4double kpPtot[30]; 202 static const G4double kpNtot[30]; 203 static const G4double kmPtot[30]; 204 static const G4double kmNtot[30]; 205 static const G4double lPtot[30]; 206 static const G4double spPtot[30]; 207 static const G4double smPtot[30]; 208 static const G4double xi0Ptot[30]; 209 static const G4double ximPtot[30]; 209 210 }; 210 211 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4ParticleLargerBeta.hh
r1197 r1315 1 #ifndef G4ParticleLargerBeta_h 2 #define G4ParticleLargerBeta_h 1 3 // 2 4 // ******************************************************************** … … 23 25 // * acceptance of all terms of the Geant4 Software license. * 24 26 // ******************************************************************** 27 // $Id: G4ParticleLargerBeta.hh,v 1.6 2010/05/15 04:25:17 mkelsey Exp $ 28 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 29 // 26 #ifndef G4ParticleLargerBeta_h 27 #define G4ParticleLargerBeta_h 30 // 20100112 M. Kelsey -- Add additional operator() which uses pointers, 31 // also fix bug which returns wrong result 28 32 29 #ifndef G4INUCL_ELEMENTARY_PARTICLE_HH30 33 #include "G4InuclElementaryParticle.hh" 31 #endif32 34 33 35 class G4ParticleLargerBeta { 34 35 36 public: 36 37 37 G4bool operator() (const G4InuclElementaryParticle& part1, 38 38 const G4InuclElementaryParticle& part2) { 39 40 return part1.getMomModule()/part1.getEnergy() <= 41 part2.getMomModule()/part2.getEnergy();39 return (part1.getMomModule()/part1.getEnergy() >= 40 part2.getMomModule()/part2.getEnergy() 41 ); 42 42 } 43 43 44 G4bool operator() (const G4InuclElementaryParticle* part1, 45 const G4InuclElementaryParticle* part2) { 46 return (part1 && part2 && operator()(*part1, *part2)); 47 } 44 48 }; 45 49 46 #endif 50 #endif /* G4ParticleLargerBeta_h */ -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4ParticleLargerEkin.hh
r819 r1315 1 #ifndef G4PARTICLE_LARGER_EKIN_HH 2 #define G4PARTICLE_LARGER_EKIN_HH 1 3 // 2 4 // ******************************************************************** … … 23 25 // * acceptance of all terms of the Geant4 Software license. * 24 26 // ******************************************************************** 27 // $Id: G4ParticleLargerEkin.hh,v 1.11 2010/05/15 04:25:17 mkelsey Exp $ 28 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 29 // 26 #ifndef G4PARTICLE_LARGER_EKIN_HH 27 #define G4PARTICLE_LARGER_EKIN_HH 30 // Implements a *reverse* sorting: std::sort expects a less-than operator 31 // which returns true if arg1<arg2. This function returns true if arg1>=arg2. 32 // 33 // 20091125 M. Kelsey -- Add additional operator() which uses pointers 28 34 29 #ifndef G4INUCL_ELEMENTARY_PARTICLE_HH30 35 #include "G4InuclElementaryParticle.hh" 36 37 #ifdef G4CASCADE_DEBUG_SORT 38 #include "G4ios.hh" 31 39 #endif 32 40 33 41 class G4ParticleLargerEkin { 34 35 42 public: 36 37 43 G4bool operator() (const G4InuclElementaryParticle& part1, 38 44 const G4InuclElementaryParticle& part2) { 39 40 return part1.getKineticEnergy() >= part2.getKineticEnergy(); 41 // return part1.getEnergy() >= part2.getEnergy(); 42 // return part1.getMomModule() >= part2.getMomModule(); 43 }; 45 #ifdef G4CASCADE_DEBUG_SORT 46 G4cout << "part1 @ " << &part1 << ": "; 47 part1.printParticle(); 48 G4cout << "part2 @ " << &part2 << ": "; 49 part2.printParticle(); 50 G4cout << G4endl; 51 #endif 52 return (part1.getKineticEnergy() >= part2.getKineticEnergy()); 53 } 44 54 55 G4bool operator() (const G4InuclElementaryParticle* part1, 56 const G4InuclElementaryParticle* part2) { 57 return (part1 && part2 && operator()(*part1, *part2)); 58 } 45 59 }; 46 60 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4PreCompoundCascadeInterface.hh
r819 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PreCompoundCascadeInterface.hh,v 1. 1 2007/05/23 14:37:28 miheikkiExp $26 // $Id: G4PreCompoundCascadeInterface.hh,v 1.3 2010/05/21 18:07:30 mkelsey Exp $ 27 27 // Defines an interface to Bertini (BERT) INC with exitons. Evaporation is NOT included 28 // 29 // 20100520 M. Kelsey -- Add missing name string to ctor, follow code changes from 30 // G4CascadeInterface. 28 31 29 32 #ifndef G4PRECOMPOUNDCASCADEINTERFACE_H … … 42 45 43 46 public: 44 G4PreCompoundCascadeInterface( );47 G4PreCompoundCascadeInterface(const G4String& nam="PreCompound Bertini Cascade"); 45 48 46 49 ~G4PreCompoundCascadeInterface(){ … … 52 55 53 56 private: 54 G4int operator==( G4PreCompoundCascadeInterface& right){57 G4int operator==(const G4PreCompoundCascadeInterface& right) const { 55 58 return (this == &right); 56 59 } 57 60 58 G4int operator!=( G4PreCompoundCascadeInterface& right){61 G4int operator!=(const G4PreCompoundCascadeInterface& right) const { 59 62 return (this != &right); 60 63 } -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4PreCompoundInuclCollider.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4PreCompoundInuclCollider.hh,v 1.6 2010/05/21 17:56:34 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100315 M. Kelsey -- Remove "using" directive and unneeded #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 26 33 #ifndef G4PRECOMPOUNDINUCL_COLLIDER_HH 27 34 #define G4PRECOMPOUNDINUCL_COLLIDER_HH 28 35 29 #include "G4Collider.hh" 30 #include "G4IntraNucleiCascader.hh" 31 #include "G4NonEquilibriumEvaporator.hh" 32 #include "G4BigBanger.hh" 33 #include "G4ElementaryParticleCollider.hh" 34 #include "G4InteractionCase.hh" 35 #include "G4InuclNuclei.hh" 36 #include "G4InuclSpecialFunctions.hh" 37 #include "G4Analyser.hh" 36 #include "G4VCascadeCollider.hh" 38 37 39 using namespace G4InuclSpecialFunctions; 38 class G4BigBanger; 39 class G4CollisionOutput; 40 class G4ElementaryParticleCollider; 41 class G4IntraNucleiCascader; 42 class G4InuclParticle; 43 class G4NonEquilibriumEvaporator; 40 44 41 class G4PreCompoundInuclCollider { 42 45 class G4PreCompoundInuclCollider : public G4VCascadeCollider { 43 46 public: 44 45 47 G4PreCompoundInuclCollider(); 46 47 G4PreCompoundInuclCollider(G4ElementaryParticleCollider* ecollider, 48 G4IntraNucleiCascader* incascader, 49 G4NonEquilibriumEvaporator* noeqevaporator, 50 G4BigBanger* bigbanger) { 51 52 setElementaryParticleCollider(ecollider); 53 setIntraNucleiCascader(incascader,ecollider); 54 setNonEquilibriumEvaporator(noeqevaporator); 55 setBigBanger(bigbanger); 56 57 }; 58 59 void setElementaryParticleCollider(G4ElementaryParticleCollider* ecollider) { 60 61 theElementaryParticleCollider = ecollider; 62 }; 63 64 void setIntraNucleiCascader(G4IntraNucleiCascader* incascader, 65 G4ElementaryParticleCollider* ecollider) { 66 67 theIntraNucleiCascader = incascader; 68 theIntraNucleiCascader->setElementaryParticleCollider(ecollider); 69 }; 70 71 void setNonEquilibriumEvaporator(G4NonEquilibriumEvaporator* noeqevaporator) { 72 73 theNonEquilibriumEvaporator = noeqevaporator; 74 }; 75 76 void setBigBanger(G4BigBanger* bigbanger) { 77 78 theBigBanger = bigbanger; 79 }; 48 virtual ~G4PreCompoundInuclCollider(); 80 49 81 G4CollisionOutput collide(G4InuclParticle* bullet,82 G4InuclParticle* target);50 void collide(G4InuclParticle* bullet, G4InuclParticle* target, 51 G4CollisionOutput& globalOutput); 83 52 84 53 private: 85 G4int verboseLevel;86 87 G4bool inelasticInteractionPossible(G4InuclParticle* bullet,88 G4InuclParticle* target,89 G4double ekin) const;90 91 G4InteractionCase bulletTargetSetter(G4InuclParticle* bullet,92 G4InuclParticle* target) const;93 94 G4bool explosion(G4InuclNuclei* target) const;95 96 54 G4ElementaryParticleCollider* theElementaryParticleCollider; 97 55 G4IntraNucleiCascader* theIntraNucleiCascader; 98 56 G4NonEquilibriumEvaporator* theNonEquilibriumEvaporator; 99 57 G4BigBanger* theBigBanger; 100 101 58 }; 102 59 103 #endif / / G4PRECOMPOUNDINUCL_COLLIDER_HH60 #endif /* G4PRECOMPOUNDINUCL_COLLIDER_HH */ 104 61 105 62 -
trunk/source/processes/hadronic/models/cascade/cascade/include/G4WatcherGun.hh
r819 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4WatcherGun.hh,v 1.9 2010/04/08 15:48:00 mkelsey Exp $ 26 // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100407 M. Kelsey -- Return const-ref to avoid copy overhead. 29 26 30 #ifndef G4WATCHER_GUN_HH 27 31 #define G4WATCHER_GUN_HH … … 37 41 void setWatchers(); 38 42 39 std::vector<G4NuclWatcher>getWatchers() const {43 const std::vector<G4NuclWatcher>& getWatchers() const { 40 44 return watchers; 41 45 };
Note: See TracChangeset
for help on using the changeset viewer.