Ignore:
Timestamp:
Jan 8, 2010, 11:56:51 AM (15 years ago)
Author:
garnier
Message:

update geant4.9.3 tag

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  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Incl.cc,v 1.22 2009/11/18 10:43:14 kaitanie Exp $
     26// $Id: G4Incl.cc,v 1.29 2009/12/09 10:36:40 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    4949  densFunction = 5;
    5050
    51   //  randomGenerator = new G4InclGeant4Random();
    52   randomGenerator = new G4Ranecu();
     51  randomGenerator = new G4InclGeant4Random();
     52  //randomGenerator = new G4Ranecu();
    5353}
    5454
     
    9494  varntp = aVarntp;
    9595
    96   //  randomGenerator = new G4InclGeant4Random();
    97   randomGenerator = new G4Ranecu();
     96  randomGenerator = new G4InclGeant4Random();
     97  // randomGenerator = new G4Ranecu();
    9898  light_gaus_nuc = new G4LightGausNuc();
    9999  light_nuc = new G4LightNuc();
     
    855855  if(nopart > -1) {
    856856    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).
    857858      varntp->itypcasc[j] = 1;
    858859      // kind(): 1=proton, 2=neutron, 3=pi+, 4=pi0, 5=pi -     
     
    10861087
    10871088  G4double xrand = 0.0;
    1088   G4double ialdep = 0.0;
     1089  G4long ialdep = 0;
    10891090  G4int imat = 0;
    10901091  G4int iamat = 0, izmat = 0;
     
    11261127    }
    11271128
    1128     hazard->ial = int(ialdep);
     1129    hazard->ial = ialdep;
    11291130  }
    11301131
     
    14301431{
    14311432  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    }
    14321437    saxw->s[i][k] = (saxw->y[i+1][k] - saxw->y[i][k]) / (saxw->x[i+1][k] - saxw->x[i][k]);
    14331438  }
     
    68606865    x = std::sqrt(E*(E - v0));
    68616866    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
    68636868      G4double b = izn*1.44/r;
    68646869      G4double px = std::sqrt((E - v0)/b);
     
    74747479      prob = clmb2(rho,eta,&dumm);                                       
    74757480    } 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      }
    74777486      prob = std::sqrt(dp1 - y*x/(c0 + c1 * std::pow(x,3) + rho * x));
    74787487    }
  • trunk/source/processes/hadronic/models/incl/src/G4InclAblaCascadeInterface.cc

    r1196 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclAblaCascadeInterface.cc,v 1.12 2009/11/18 10:43:14 kaitanie Exp $
     26// $Id: G4InclAblaCascadeInterface.cc,v 1.13 2009/12/04 13:16:57 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    229229      if(bulletType == proton) {
    230230        aParticleDefinition = G4Proton::ProtonDefinition();
    231       }
    232       if(bulletType == neutron) {
     231      } else if(bulletType == neutron) {
    233232        aParticleDefinition = G4Neutron::NeutronDefinition();
    234       }
    235       if(bulletType == pionPlus) {
     233      } else if(bulletType == pionPlus) {
    236234        aParticleDefinition = G4PionPlus::PionPlusDefinition();
    237       }
    238       if(bulletType == pionZero) {
     235      } else if(bulletType == pionZero) {
    239236        aParticleDefinition = G4PionZero::PionZeroDefinition();
    240       }
    241       if(bulletType == pionMinus) {
     237      } else if(bulletType == pionMinus) {
    242238        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      }
    249249    }
    250250
  • trunk/source/processes/hadronic/models/incl/src/G4InclAblaLightIonInterface.cc

    r819 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclAblaLightIonInterface.cc,v 1.10 2007/12/10 16:31:57 gunter Exp $
     26// $Id: G4InclAblaLightIonInterface.cc,v 1.11 2009/12/04 13:16:57 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    207207      if(bulletType == proton) {
    208208        aParticleDefinition = G4Proton::ProtonDefinition();
    209       }
    210       if(bulletType == neutron) {
     209      } else if(bulletType == neutron) {
    211210        aParticleDefinition = G4Neutron::NeutronDefinition();
    212       }
    213       if(bulletType == pionPlus) {
     211      } else if(bulletType == pionPlus) {
    214212        aParticleDefinition = G4PionPlus::PionPlusDefinition();
    215       }
    216       if(bulletType == pionZero) {
     213      } else if(bulletType == pionZero) {
    217214        aParticleDefinition = G4PionZero::PionZeroDefinition();
    218       }
    219       if(bulletType == pionMinus) {
     215      } else if(bulletType == pionMinus) {
    220216        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      }
    227235    }
    228236
Note: See TracChangeset for help on using the changeset viewer.