Changeset 1315 for trunk/source/processes/hadronic/cross_sections
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (15 years ago)
- Location:
- trunk/source/processes/hadronic/cross_sections
- Files:
-
- 11 edited
-
History (modified) (1 diff)
-
include/G4CrossSectionDataStore.hh (modified) (2 diffs)
-
include/G4HadronCrossSections.hh (modified) (3 diffs)
-
include/G4UPiNuclearCrossSection.hh (modified) (1 diff)
-
src/G4CrossSectionDataSetRegistry.cc (modified) (2 diffs)
-
src/G4CrossSectionDataStore.cc (modified) (10 diffs)
-
src/G4HadronCrossSections.cc (modified) (2 diffs)
-
src/G4NeutronCaptureXS.cc (modified) (3 diffs)
-
src/G4NeutronElasticXS.cc (modified) (4 diffs)
-
src/G4NeutronInelasticXS.cc (modified) (4 diffs)
-
src/G4UPiNuclearCrossSection.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/cross_sections/History
r1228 r1315 14 14 * Please list in reverse chronological order (last date on top) 15 15 --------------------------------------------------------------- 16 17 03 Lun 2010 Vladimir Ivanchenko (hadr-cross-V09-03-05) 18 - G4NeutronElasticXS, G4NeutronInelasticXS, G4NeutronCaptureXS - substitute 19 environment variable G4NEUTRONXS by G4NEUTRONXSDATA 20 21 02 Jun 2010 Gunter Folger (hadr-cross-V09-03-04) 22 - fix compilation error on Windows: use G4lrint not lrint 23 24 29 Apr 2010 Gunter Folger (hadr-cross-V09-03-03) 25 ------------------------------------------------------------ 26 - G4CrossSectionDataStore integer Z and A transition 27 ( note that cross sections data sets still have G4double in interface) 28 29 25 Mar 2010 Vladimir Ivanchenko (hadr-cross-V09-03-02) 30 ------------------------------------------------------------ 31 - G4CrossSectionDataSetRegistry - do not pop_back vector of pointers 32 when DeRegister cross section data set - big fixed for Windows 33 34 17 Mar 2010 Gabriele Cosmo (hadr-cross-V09-03-01) 35 ------------------------------------------------------------ 36 - Cache computation of std::pow() in GetCaptureCrossSection() method of 37 G4HadronCrossSections, to avoid repeated calls with same argument. 38 39 26 Feb 2010 Vladimir Ivanchenko (hadr-cross-V09-03-00) 40 ------------------------------------------------------------ 41 - G4UPiNuclearCrossSection - fixed bug for high Z (>83) atoms 16 42 17 43 9 Dec 2009 Gunter Folger (hadr-cross-V09-02-18) -
trunk/source/processes/hadronic/cross_sections/include/G4CrossSectionDataStore.hh
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionDataStore.hh,v 1.1 4 2009/01/24 11:54:47 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 3$26 // $Id: G4CrossSectionDataStore.hh,v 1.15 2010/04/29 14:46:08 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 77 77 G4double Z, G4double A, G4double aTemperature); 78 78 79 G4double GetCrossSection(const G4DynamicParticle*, 80 G4int Z, G4int A, G4double aTemperature); 81 79 82 // to replace GetMicroscopicCrossSection 80 83 G4double GetCrossSection(const G4DynamicParticle*, const G4Material*); -
trunk/source/processes/hadronic/cross_sections/include/G4HadronCrossSections.hh
r1228 r1315 25 25 // 26 26 // 27 // GEANT4 tag $Name: geant4-09-0 3$27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // … … 93 93 public: 94 94 95 G4HadronCrossSections() : prevParticleDefinition(0), verboseLevel(0) 95 G4HadronCrossSections() 96 : prevParticleDefinition(0), lastEkx(0.), lastEkxPower(0.), verboseLevel(0) 96 97 { 97 98 } … … 184 185 G4Element* prevElement; 185 186 G4double prevKineticEnergy; 187 G4double lastEkx, lastEkxPower; 186 188 187 189 static G4bool correctInelasticNearZero; -
trunk/source/processes/hadronic/cross_sections/include/G4UPiNuclearCrossSection.hh
r962 r1315 105 105 G4double elow; 106 106 G4double elowest; 107 G4double APower[9 2];107 G4double APower[93]; 108 108 109 109 const G4ParticleDefinition* piPlus; -
trunk/source/processes/hadronic/cross_sections/src/G4CrossSectionDataSetRegistry.cc
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4CrossSectionDataSetRegistry.cc,v 1. 6 2009/12/02 15:59:59vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4CrossSectionDataSetRegistry.cc,v 1.7 2010/03/25 15:28:22 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // ------------------------------------------------------------------- … … 97 97 if(xSections[i] == p) { 98 98 xSections[i] = 0; 99 if(i == n-1) { xSections.pop_back(); }100 99 return; 101 100 } -
trunk/source/processes/hadronic/cross_sections/src/G4CrossSectionDataStore.cc
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CrossSectionDataStore.cc,v 1.1 6 2009/01/24 11:54:47 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 3$26 // $Id: G4CrossSectionDataStore.cc,v 1.18 2010/06/02 09:33:16 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 37 37 // Modifications: 38 38 // 23.01.2009 V.Ivanchenko add destruction of data sets 39 // 29.04.2010 G.Folger modifictaions for integer A & Z 39 40 // 40 41 // … … 123 124 G4CrossSectionDataStore::GetCrossSection(const G4DynamicParticle* aParticle, 124 125 G4double Z, G4double A, 126 G4double aTemperature) 127 { 128 G4int iZ=G4lrint(Z); 129 G4int iA=G4lrint(A); 130 return GetCrossSection(aParticle, iZ, iA,aTemperature); 131 } 132 133 134 G4double 135 G4CrossSectionDataStore::GetCrossSection(const G4DynamicParticle* aParticle, 136 G4int Z, G4int A, 125 137 G4double aTemperature) 126 138 { … … 197 209 // element have been selected 198 210 inCharge = whichDataSetInCharge(particle, anElement); 199 G4 double ZZ = anElement->GetZ();200 G4 doubleAA;211 G4int ZZ = G4lrint(anElement->GetZ()); 212 G4int AA; 201 213 202 214 // Collect abundance weighted cross sections and A values for each isotope … … 208 220 if (0 < nIsoPerElement) { 209 221 G4IsotopeVector* isoVector = anElement->GetIsotopeVector(); 210 AA = G4double((*isoVector)[0]->GetN());222 AA =(*isoVector)[0]->GetN(); 211 223 if(1 < nIsoPerElement) { 212 224 … … 218 230 G4bool elementXS = false; 219 231 for (i = 0; i<nIsoPerElement; i++) { 220 if (inCharge->IsZAApplicable(particle, ZZ, G4double((*isoVector)[i]->GetN()))) {232 if (inCharge->IsZAApplicable(particle, ZZ,(*isoVector)[i]->GetN())) { 221 233 iso_xs = inCharge->GetIsoCrossSection(particle, (*isoVector)[i], aTemp); 222 234 } else if (elementXS == false) { … … 231 243 for (i = 0; i<nIsoPerElement; i++) { 232 244 if(cross <= xsec[i]) { 233 AA = G4double((*isoVector)[i]->GetN());245 AA = (*isoVector)[i]->GetN(); 234 246 break; 235 247 } … … 241 253 242 254 G4StableIsotopes theDefaultIsotopes; 243 G4int Z = G4int(ZZ + 0.5);244 const G4int nIso = theDefaultIsotopes.GetNumberOfIsotopes(Z );245 G4int index = theDefaultIsotopes.GetFirstIsotope(Z );246 AA = G4double(theDefaultIsotopes.GetIsotopeNucleonCount(index));255 //-- Int ZZ G4int Z = G4int(ZZ + 0.5); 256 const G4int nIso = theDefaultIsotopes.GetNumberOfIsotopes(ZZ); 257 G4int index = theDefaultIsotopes.GetFirstIsotope(ZZ); 258 AA = theDefaultIsotopes.GetIsotopeNucleonCount(index); 247 259 248 260 if(1 < nIso) { … … 254 266 255 267 for (i = 0; i<nIso; i++) { 256 AA = G4double(theDefaultIsotopes.GetIsotopeNucleonCount(index+i));268 AA = theDefaultIsotopes.GetIsotopeNucleonCount(index+i); 257 269 if (inCharge->IsZAApplicable(particle, ZZ, AA )) { 258 270 iso_xs = inCharge->GetIsoZACrossSection(particle, ZZ, AA, aTemp); … … 267 279 for (i = 0; i<nIso; i++) { 268 280 if(cross <= xsec[i]) { 269 AA = G4double(theDefaultIsotopes.GetIsotopeNucleonCount(index+i));281 AA = theDefaultIsotopes.GetIsotopeNucleonCount(index+i); 270 282 break; 271 283 } -
trunk/source/processes/hadronic/cross_sections/src/G4HadronCrossSections.cc
r1228 r1315 25 25 // 26 26 // 27 // GEANT4 tag $Name: geant4-09-0 3$27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // … … 1585 1585 G4double ZZ, G4double /*AA*/) 1586 1586 { 1587 if (GetParticleCode(aParticle) != 16) return 0.;1587 if (GetParticleCode(aParticle) != 16) { return 0.; } 1588 1588 G4double ek = aParticle->GetKineticEnergy()/GeV; 1589 if (ek > 0.0327) return 0.;1589 if (ek > 0.0327) { return 0.; } 1590 1590 1591 1591 G4double ekx = std::max(ek, 1.e-9); 1592 if( ekx != lastEkx ) 1593 { 1594 lastEkx = ekx; 1595 lastEkxPower = std::pow(ekx*1.e6, 0.577); 1596 } 1597 1592 1598 G4int izno = static_cast<G4int> (ZZ + 0.01); 1593 1599 if (izno > 100) izno = 100; // Not in GHESIG 1594 1600 izno = izno - 1; // For array indexing 1595 G4double sigcap = 11.12*cscap[izno]/ std::pow(ekx*1.e6, 0.577);1601 G4double sigcap = 11.12*cscap[izno]/lastEkxPower; 1596 1602 // Convert cross section from mb to default units 1597 1603 sigcap = sigcap*millibarn; -
trunk/source/processes/hadronic/cross_sections/src/G4NeutronCaptureXS.cc
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4NeutronCaptureXS.cc,v 1. 2 2009/11/19 12:36:53vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3$26 // $Id: G4NeutronCaptureXS.cc,v 1.3 2010/06/03 11:50:21 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 129 129 // check environment variable 130 130 // Build the complete string identifying the file with the data set 131 char* path = getenv("G4NEUTRONXS ");131 char* path = getenv("G4NEUTRONXSDATA"); 132 132 if (!path){ 133 G4cout << "G4NEUTRONXS environment variable not set" << G4endl;133 G4cout << "G4NEUTRONXSDATA environment variable not set" << G4endl; 134 134 } 135 135 … … 162 162 // check environment variable 163 163 // Build the complete string identifying the file with the data set 164 path = getenv("G4NEUTRONXS ");164 path = getenv("G4NEUTRONXSDATA"); 165 165 if (!path) { 166 166 if(verboseLevel > 1) { 167 G4cout << "G4NEUTRONXS environment variable not set" << G4endl;167 G4cout << "G4NEUTRONXSDATA environment variable not set" << G4endl; 168 168 } 169 169 return; -
trunk/source/processes/hadronic/cross_sections/src/G4NeutronElasticXS.cc
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4NeutronElasticXS.cc,v 1. 3 2009/11/19 12:01:54vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3$26 // $Id: G4NeutronElasticXS.cc,v 1.4 2010/06/03 11:50:21 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 140 140 // check environment variable 141 141 // Build the complete string identifying the file with the data set 142 char* path = getenv("G4NEUTRONXS ");142 char* path = getenv("G4NEUTRONXSDATA"); 143 143 if (!path){ 144 G4cout << "G4NEUTRONXS environment variable not set" << G4endl;144 G4cout << "G4NEUTRONXSDATA environment variable not set" << G4endl; 145 145 } 146 146 … … 178 178 // check environment variable 179 179 // Build the complete string identifying the file with the data set 180 path = getenv("G4NEUTRONXS ");180 path = getenv("G4NEUTRONXSDATA"); 181 181 if (!path) { 182 182 if(verboseLevel > 1) { 183 G4cout << "G4NEUTRONXS environment variable not set" << G4endl;183 G4cout << "G4NEUTRONXSDATA environment variable not set" << G4endl; 184 184 } 185 185 return; … … 217 217 ggXsection->GetCrossSection(dynParticle, Elem); 218 218 G4double sig2 = ggXsection->GetElasticGlauberGribovXsc(); 219 if(sig2 > 0.) coeff[Z] = sig1/sig2;219 if(sig2 > 0.) { coeff[Z] = sig1/sig2; } 220 220 } 221 if(!dp) delete dynParticle;222 } 221 if(!dp) { delete dynParticle; } 222 } -
trunk/source/processes/hadronic/cross_sections/src/G4NeutronInelasticXS.cc
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4NeutronInelasticXS.cc,v 1. 3 2009/11/19 12:00:40vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3$26 // $Id: G4NeutronInelasticXS.cc,v 1.4 2010/06/03 11:50:21 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 140 140 // check environment variable 141 141 // Build the complete string identifying the file with the data set 142 char* path = getenv("G4NEUTRONXS ");142 char* path = getenv("G4NEUTRONXSDATA"); 143 143 if (!path){ 144 G4cout << "G4NEUTRONXS environment variable not set" << G4endl;144 G4cout << "G4NEUTRONXSDATA environment variable not set" << G4endl; 145 145 } 146 146 … … 178 178 // check environment variable 179 179 // Build the complete string identifying the file with the data set 180 path = getenv("G4NEUTRONXS ");180 path = getenv("G4NEUTRONXSDATA"); 181 181 if (!path) { 182 182 if(verboseLevel > 1) { 183 G4cout << "G4NEUTRONXS environment variable not set" << G4endl;183 G4cout << "G4NEUTRONXSDATA environment variable not set" << G4endl; 184 184 } 185 185 return; … … 217 217 ggXsection->GetCrossSection(dynParticle, Elem); 218 218 G4double sig2 = ggXsection->GetInelasticGlauberGribovXsc(); 219 if(sig2 > 0.) coeff[Z] = sig1/sig2;219 if(sig2 > 0.) { coeff[Z] = sig1/sig2; } 220 220 } 221 if(!dp) delete dynParticle;222 } 221 if(!dp) { delete dynParticle; } 222 } -
trunk/source/processes/hadronic/cross_sections/src/G4UPiNuclearCrossSection.cc
r1196 r1315 106 106 if(idx >= NZ) idx = NZ - 1; 107 107 G4int iz2 = theZ[idx]; 108 108 // G4cout << "U: iz= " << iz << " iz2= " << iz2 << " " 109 // << APower[iz] << " " << APower[iz2]<<G4endl; 109 110 G4double x2 = (((*table)[idx])->Value(ekin))*APower[iz]/APower[iz2]; 110 111 … … 184 185 theA.push_back(nist->GetAtomicMassAmu(iz[i])); 185 186 } 186 for(i=1; i<9 2; i++) {187 for(i=1; i<93; i++) { 187 188 APower[i] = std::pow(nist->GetAtomicMassAmu(i),aPower); 188 189 }
Note:
See TracChangeset
for help on using the changeset viewer.
