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/abrasion
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/abrasion/include/G4WilsonAbrasionModel.hh

    r819 r1228  
    4040// MODULE:              G4WilsonAbrasionModel.hh
    4141//
    42 // Version:             B.1
    43 // Date:                15/04/04
     42// Version:             1.0
     43// Date:                08/12/2009
    4444// Author:              P R Truscott
    4545// Organisation:        QinetiQ Ltd, UK
     
    5757// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
    5858// Beta release
     59//
     60// 08 December 2009, P R Truscott, QinetiQ Ltd, Ltd
     61// ver 1.0
     62// Variable fradius defined. See .cc file for more details.
    5963//
    6064// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    119123    G4double               B;
    120124    G4double               third;
     125    G4double               fradius;
    121126};
    122127////////////////////////////////////////////////////////////////////////////////
  • trunk/source/processes/hadronic/models/abrasion/src/G4WilsonAbrasionModel.cc

    r819 r1228  
    3838// MODULE:              G4WilsonAbrasionModel.cc
    3939//
    40 // Version:             B.2
    41 // Date:                18/01/05
     40// Version:             1.0
     41// Date:                08/12/2009
    4242// Author:              P R Truscott
    4343// Organisation:        QinetiQ Ltd, UK
     
    6060// handler deleted to prevent memory leaks.  Also particle change of projectile
    6161// fragment previously not properly defined.
     62//
     63// 08 December 2009, P R Truscott, QinetiQ Ltd, Ltd
     64// ver 1.0
     65// There was originally a possibility of the minimum impact parameter AFTER
     66// considering Couloumb repulsion, rm, being too large.  Now if:
     67//     rm >= fradius * (rP + rT)
     68// where fradius is currently 0.99, then it is assumed the primary track is
     69// unchanged.  Additional conditions to escape from while-loop over impact
     70// parameter: if the loop counter evtcnt reaches 1000, the primary track is
     71// continued.
     72// Additional clauses have been included in
     73//    G4WilsonAbrasionModel::GetNucleonInducedExcitation
     74// Previously it was possible to get sqrt of negative number as Wilson algorithm
     75// not properly defined if either:
     76//    rT > rP && rsq < rTsq - rPsq) or (rP > rT && rsq < rPsq - rTsq)
    6277//
    6378// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    151166  B                = 10.0 * MeV;
    152167  third            = 1.0 / 3.0;
     168  fradius          = 0.99;
    153169  conserveEnergy   = false;
    154170  conserveMomentum = true;
     
    197213  B                = 10.0 * MeV;
    198214  third            = 1.0 / 3.0;
     215  fradius          = 0.99;
    199216  conserveEnergy   = false;
    200217  conserveMomentum = true;
     
    208225// The destructor doesn't have to do a great deal!
    209226//
    210   delete theExcitationHandler;
    211   delete theExcitationHandlerx;
     227  if (theExcitationHandler)  delete theExcitationHandler;
     228  if (theExcitationHandlerx) delete theExcitationHandlerx;
     229  if (useAblation)           delete theAblation;
     230//  delete theExcitationHandler;
     231//  delete theExcitationHandlerx;
    212232}
    213233////////////////////////////////////////////////////////////////////////////////
     
    304324    G4double rPT   = rP + rT;
    305325    G4double rPTsq = rPT * rPT;
     326//
     327//
     328// This is a "catch" to make sure we don't go into an infinite loop because the
     329// energy is too low to overcome nuclear repulsion.  PRT 20091023.  If the
     330// value of rm < fradius * rPT then we're unlikely to sample a small enough
     331// impact parameter (energy of incident particle is too low).  Return primary
     332// and don't complete nuclear interaction analysis.
     333//
     334    if (rm >= fradius * rPT) {
     335      theParticleChange.SetStatusChange(isAlive);
     336      theParticleChange.SetEnergyChange(theTrack.GetKineticEnergy());
     337      theParticleChange.SetMomentumChange(theTrack.Get4Momentum().vect().unit());
     338      if (verboseLevel >= 2) {
     339        G4cout <<"Particle energy too low to overcome repulsion." <<G4endl;
     340        G4cout <<"Event rejected and original track maintained" <<G4endl;
     341        G4cout <<"########################################"
     342               <<"########################################"
     343               <<G4endl;
     344      }
     345      return &theParticleChange;
     346    }
     347//
     348//
     349// Now sample impact parameter until the criterion is met that projectile
     350// and target overlap, but repulsion is taken into consideration.
     351//
     352    G4int evtcnt   = 0;
    306353    r              = 1.1 * rPT;
    307     while (r > rPT)
     354    while (r > rPT && ++evtcnt < 1000)
    308355    {
    309356      G4double bsq = rPTsq * G4UniformRand();
    310357      r            = (rm + std::sqrt(rm*rm + 4.0*bsq)) / 2.0;
    311358    }
     359//
     360//
     361// We've tried to sample this 1000 times, but failed.  Assume nuclei do not
     362// collide.
     363//
     364    if (evtcnt >= 1000) {
     365      theParticleChange.SetStatusChange(isAlive);
     366      theParticleChange.SetEnergyChange(theTrack.GetKineticEnergy());
     367      theParticleChange.SetMomentumChange(theTrack.Get4Momentum().vect().unit());
     368      if (verboseLevel >= 2) {
     369        G4cout <<"Particle energy too low to overcome repulsion." <<G4endl;
     370        G4cout <<"Event rejected and original track maintained" <<G4endl;
     371        G4cout <<"########################################"
     372               <<"########################################"
     373               <<G4endl;
     374      }
     375      return &theParticleChange;
     376    }
     377
     378
    312379    rsq = r * r;
    313380//
     
    764831  if (r > rT) Cl = 2.0*std::sqrt(rPsq + 2.0*r*rT - rsq - rTsq);
    765832  else        Cl = 2.0*rP;
    766  
    767   G4double bP = (rPsq+rsq-rTsq)/2.0/r;
    768   G4double Ct = 2.0*std::sqrt(rPsq - bP*bP);
     833//
     834//
     835// The next lines have been changed to include a "catch" to make sure if the
     836// projectile and target are too close, Ct is set to twice rP or twice rT.
     837// Otherwise the standard Wilson algorithm should work fine.
     838// PRT 20091023.
     839//
     840  G4double Ct = 0.0;
     841  if      (rT > rP && rsq < rTsq - rPsq) Ct = 2.0 * rP;
     842  else if (rP > rT && rsq < rPsq - rTsq) Ct = 2.0 * rT;
     843  else {
     844    G4double bP = (rPsq+rsq-rTsq)/2.0/r;
     845    G4double x  = rPsq - bP*bP;
     846    if (x < 0.0) {
     847      G4cerr <<"########################################"
     848             <<"########################################"
     849             <<G4endl;
     850      G4cerr <<"ERROR IN G4WilsonAbrasionModel::GetNucleonInducedExcitation"
     851             <<G4endl;
     852      G4cerr <<"rPsq - bP*bP < 0.0 and cannot be square-rooted" <<G4endl;
     853      G4cerr <<"Set to zero instead" <<G4endl;
     854      G4cerr <<"########################################"
     855             <<"########################################"
     856             <<G4endl;
     857    }
     858    Ct = 2.0*std::sqrt(x);
     859  }
    769860 
    770861  G4double Ex = 13.0 * Cl / fermi;
Note: See TracChangeset for help on using the changeset viewer.