Changeset 1228 for trunk/source/processes/hadronic/models/incl/src
- Timestamp:
- Jan 8, 2010, 11:56:51 AM (15 years ago)
- Location:
- trunk/source/processes/hadronic/models/incl/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/incl/src/G4Incl.cc
r1196 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4Incl.cc,v 1.2 2 2009/11/18 10:43:14kaitanie Exp $26 // $Id: G4Incl.cc,v 1.29 2009/12/09 10:36:40 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 49 49 densFunction = 5; 50 50 51 //randomGenerator = new G4InclGeant4Random();52 randomGenerator = new G4Ranecu();51 randomGenerator = new G4InclGeant4Random(); 52 //randomGenerator = new G4Ranecu(); 53 53 } 54 54 … … 94 94 varntp = aVarntp; 95 95 96 //randomGenerator = new G4InclGeant4Random();97 randomGenerator = new G4Ranecu();96 randomGenerator = new G4InclGeant4Random(); 97 // randomGenerator = new G4Ranecu(); 98 98 light_gaus_nuc = new G4LightGausNuc(); 99 99 light_nuc = new G4LightNuc(); … … 855 855 if(nopart > -1) { 856 856 for(G4int j = 0; j < nopart; j++) { 857 if(ep[j] < 0.0) continue; // Workaround to avoid negative energies (and taking std::sqrt of a negative number). 857 858 varntp->itypcasc[j] = 1; 858 859 // kind(): 1=proton, 2=neutron, 3=pi+, 4=pi0, 5=pi - … … 1086 1087 1087 1088 G4double xrand = 0.0; 1088 G4 double ialdep = 0.0;1089 G4long ialdep = 0; 1089 1090 G4int imat = 0; 1090 1091 G4int iamat = 0, izmat = 0; … … 1126 1127 } 1127 1128 1128 hazard->ial = i nt(ialdep);1129 hazard->ial = ialdep; 1129 1130 } 1130 1131 … … 1430 1431 { 1431 1432 for(G4int i=0; i < saxw->n-1; i++) { 1433 if((saxw->x[i+1][k] - saxw->x[i][k]) == 0.0) { // Safeguard to avoid division by zero 1434 saxw->s[i][k] = 0.0; 1435 continue; 1436 } 1432 1437 saxw->s[i][k] = (saxw->y[i+1][k] - saxw->y[i][k]) / (saxw->x[i+1][k] - saxw->x[i][k]); 1433 1438 } … … 6860 6865 x = std::sqrt(E*(E - v0)); 6861 6866 barr = 4.0*x/(E + E - v0 + x + x); 6862 if (iz > 0 ) {6867 if (iz > 0 && izn != 0) { // izn = 0 causes division by zero 6863 6868 G4double b = izn*1.44/r; 6864 6869 G4double px = std::sqrt((E - v0)/b); … … 7474 7479 prob = clmb2(rho,eta,&dumm); 7475 7480 } else { 7476 x = std::exp(std::log(eta)/6.0); 7481 if(eta <= 1.0e-6) { // Safeguard against a floating point exception 7482 x = 0.0; 7483 } else { 7484 x = std::exp(std::log(eta)/6.0); 7485 } 7477 7486 prob = std::sqrt(dp1 - y*x/(c0 + c1 * std::pow(x,3) + rho * x)); 7478 7487 } -
trunk/source/processes/hadronic/models/incl/src/G4InclAblaCascadeInterface.cc
r1196 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4InclAblaCascadeInterface.cc,v 1.1 2 2009/11/18 10:43:14kaitanie Exp $26 // $Id: G4InclAblaCascadeInterface.cc,v 1.13 2009/12/04 13:16:57 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 229 229 if(bulletType == proton) { 230 230 aParticleDefinition = G4Proton::ProtonDefinition(); 231 } 232 if(bulletType == neutron) { 231 } else if(bulletType == neutron) { 233 232 aParticleDefinition = G4Neutron::NeutronDefinition(); 234 } 235 if(bulletType == pionPlus) { 233 } else if(bulletType == pionPlus) { 236 234 aParticleDefinition = G4PionPlus::PionPlusDefinition(); 237 } 238 if(bulletType == pionZero) { 235 } else if(bulletType == pionZero) { 239 236 aParticleDefinition = G4PionZero::PionZeroDefinition(); 240 } 241 if(bulletType == pionMinus) { 237 } else if(bulletType == pionMinus) { 242 238 aParticleDefinition = G4PionMinus::PionMinusDefinition(); 243 } 244 245 cascadeParticle = new G4DynamicParticle(); 246 cascadeParticle->SetDefinition(aParticleDefinition); 247 cascadeParticle->Set4Momentum(aTrack.Get4Momentum()); 248 theResult.AddSecondary(cascadeParticle); 239 } else { // Projectile was not regognized 240 aParticleDefinition = 0; 241 } 242 243 if(aParticleDefinition != 0) { 244 cascadeParticle = new G4DynamicParticle(); 245 cascadeParticle->SetDefinition(aParticleDefinition); 246 cascadeParticle->Set4Momentum(aTrack.Get4Momentum()); 247 theResult.AddSecondary(cascadeParticle); 248 } 249 249 } 250 250 -
trunk/source/processes/hadronic/models/incl/src/G4InclAblaLightIonInterface.cc
r819 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4InclAblaLightIonInterface.cc,v 1.1 0 2007/12/10 16:31:57 gunterExp $26 // $Id: G4InclAblaLightIonInterface.cc,v 1.11 2009/12/04 13:16:57 kaitanie Exp $ 27 27 // Translation of INCL4.2/ABLA V3 28 28 // Pekka Kaitaniemi, HIP (translation) … … 207 207 if(bulletType == proton) { 208 208 aParticleDefinition = G4Proton::ProtonDefinition(); 209 } 210 if(bulletType == neutron) { 209 } else if(bulletType == neutron) { 211 210 aParticleDefinition = G4Neutron::NeutronDefinition(); 212 } 213 if(bulletType == pionPlus) { 211 } else if(bulletType == pionPlus) { 214 212 aParticleDefinition = G4PionPlus::PionPlusDefinition(); 215 } 216 if(bulletType == pionZero) { 213 } else if(bulletType == pionZero) { 217 214 aParticleDefinition = G4PionZero::PionZeroDefinition(); 218 } 219 if(bulletType == pionMinus) { 215 } else if(bulletType == pionMinus) { 220 216 aParticleDefinition = G4PionMinus::PionMinusDefinition(); 221 } 222 223 cascadeParticle = new G4DynamicParticle(); 224 cascadeParticle->SetDefinition(aParticleDefinition); 225 cascadeParticle->Set4Momentum(aTrack.Get4Momentum()); 226 theResult.AddSecondary(cascadeParticle); 217 } else if(bulletType == deuteron) { 218 aParticleDefinition = G4Deuteron::DeuteronDefinition(); 219 } else if(bulletType == triton) { 220 aParticleDefinition = G4Triton::TritonDefinition(); 221 } else if(bulletType == he3) { 222 aParticleDefinition = G4He3::He3Definition(); 223 } else if(bulletType == he4) { 224 aParticleDefinition = G4Alpha::AlphaDefinition(); 225 } else { // Particle was not recognized. Probably an unsupported particle was given as input 226 aParticleDefinition = 0; 227 } 228 229 if(aParticleDefinition != 0) { 230 cascadeParticle = new G4DynamicParticle(); 231 cascadeParticle->SetDefinition(aParticleDefinition); 232 cascadeParticle->Set4Momentum(aTrack.Get4Momentum()); 233 theResult.AddSecondary(cascadeParticle); 234 } 227 235 } 228 236
Note: See TracChangeset
for help on using the changeset viewer.