- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/cross_sections/src/G4NeutronInelasticXS.cc
r1337 r1340 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4NeutronInelasticXS.cc,v 1. 4 2010/06/03 11:50:21 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-04-beta-01$26 // $Id: G4NeutronInelasticXS.cc,v 1.6 2010/10/15 22:35:32 dennis Exp $ 27 // GEANT4 tag $Name: hadr-cross-V09-03-12 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 47 47 #include "G4PhysicsVector.hh" 48 48 #include "G4GlauberGribovCrossSection.hh" 49 #include "G4HadronNucleonXsc.hh" 49 50 #include "G4NistManager.hh" 51 #include "G4Proton.hh" 50 52 51 53 #include <iostream> 52 54 #include <fstream> 53 55 #include <sstream> 56 54 57 using namespace std; 55 58 56 59 G4NeutronInelasticXS::G4NeutronInelasticXS() 57 { 58 verboseLevel = 0; 59 G4cout << "G4NeutronInelasticXS::G4NeutronInelasticXS: Initialise " << G4endl; 60 for(G4int i=0; i<93; ++i) { 61 data[i] = 0; 62 coeff[i]= 1.0; 63 } 60 : proton(G4Proton::Proton()), maxZ(92) 61 { 62 // verboseLevel = 0; 63 if(verboseLevel > 0){ 64 G4cout << "G4NeutronInelasticXS::G4NeutronInelasticXS Initialise for Z < " 65 << maxZ + 1 << G4endl; 66 } 67 data.resize(maxZ+1, 0); 68 coeff.resize(maxZ+1, 1.0); 64 69 ggXsection = new G4GlauberGribovCrossSection(); 70 fNucleon = new G4HadronNucleonXsc(); 65 71 isInitialized = false; 66 72 } … … 68 74 G4NeutronInelasticXS::~G4NeutronInelasticXS() 69 75 { 70 for(G4int i=0; i< 92; ++i) {76 for(G4int i=0; i<=maxZ; ++i) { 71 77 delete data[i]; 72 78 } … … 81 87 82 88 G4bool 83 G4NeutronInelasticXS::Is ZAApplicable(const G4DynamicParticle*,84 G4double /*ZZ*/, G4double/*AA*/)89 G4NeutronInelasticXS::IsIsoApplicable(const G4DynamicParticle*, 90 G4int /*ZZ*/, G4int /*AA*/) 85 91 { 86 92 return false; … … 97 103 98 104 G4int Z = G4int(elm->GetZ()); 105 if(Z < 1 || Z > maxZ) { return xs; } 99 106 G4PhysicsVector* pv = data[Z]; 100 107 // G4cout << "G4NeutronInelasticXS::GetCrossSection e= " << ekin << " Z= " << Z << G4endl; … … 104 111 Initialise(Z); 105 112 pv = data[Z]; 106 if(!pv) return xs;113 if(!pv) { return xs; } 107 114 } 108 115 109 116 G4double e1 = pv->Energy(0); 110 if(ekin <= e1) return xs;117 if(ekin <= e1) { return xs; } 111 118 112 119 G4int n = pv->GetVectorLength() - 1; … … 114 121 if(ekin <= e2) { 115 122 xs = pv->Value(ekin); 123 } else if(1 == Z) { 124 fNucleon->GetHadronNucleonXscPDG(aParticle, proton); 125 xs = coeff[1]*fNucleon->GetInelasticHadronNucleonXsc(); 116 126 } else { 117 127 ggXsection->GetCrossSection(aParticle, elm); … … 119 129 } 120 130 121 if(verboseLevel > 0) {131 if(verboseLevel > 0) { 122 132 G4cout << "ekin= " << ekin << ", XSinel= " << xs << G4endl; 123 133 } … … 129 139 G4NeutronInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p) 130 140 { 131 G4cout << "G4NeutronInelasticXS::BuildPhysicsTable: " << G4endl; 132 G4cout << p.GetParticleName() << G4endl; 133 if(p.GetParticleName() != "neutron") { 134 return; 135 } 136 if(isInitialized) return; 141 if(verboseLevel > 0){ 142 G4cout << "G4NeutronInelasticXS::BuildPhysicsTable for " 143 << p.GetParticleName() << G4endl; 144 } 145 if(isInitialized || p.GetParticleName() != "neutron") { return; } 137 146 isInitialized = true; 138 139 147 140 148 // check environment variable … … 154 162 for(size_t i=0; i<numOfElm; ++i) { 155 163 G4int Z = G4int(((*theElmTable)[i])->GetZ()); 156 if(Z < 1) Z = 1;157 else if(Z > 92) Z = 92;164 if(Z < 1) { Z = 1; } 165 else if(Z > maxZ) { Z = maxZ; } 158 166 //G4cout << "Z= " << Z << G4endl; 159 167 // Initialisation … … 173 181 const char* p) 174 182 { 175 if(data[Z]) return;183 if(data[Z]) { return; } 176 184 const char* path = p; 177 185 if(!p) { … … 215 223 G4double sig1 = (*data[Z])[n]; 216 224 dynParticle->SetKineticEnergy(emax); 217 ggXsection->GetCrossSection(dynParticle, Elem); 218 G4double sig2 = ggXsection->GetInelasticGlauberGribovXsc(); 225 G4double sig2 = 0.0; 226 if(1 == Z) { 227 fNucleon->GetHadronNucleonXscPDG(dynParticle, proton); 228 sig2 = fNucleon->GetInelasticHadronNucleonXsc(); 229 } else { 230 ggXsection->GetCrossSection(dynParticle, Elem); 231 sig2 = ggXsection->GetInelasticGlauberGribovXsc(); 232 } 219 233 if(sig2 > 0.) { coeff[Z] = sig1/sig2; } 220 234 }
Note: See TracChangeset
for help on using the changeset viewer.