Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4DiscreteGammaTransition.cc

    r819 r1315  
    3737//
    3838//      Modifications:
     39//        15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
     40//              Added creation time evaluation for products of evaporation
     41//
     42//        21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
     43//              i) added G4int _nucleusZ initialise it through the constructor
     44//              ii) modified SelectGamma() to allow the generation of conversion electrons   
     45//              iii) added #include G4AtomicShells.hh
     46//     
    3947//        09 Sep. 2002, Fan Lei  (flei@space.qinetiq.com)
    4048//              Added renormalization to determine whether transition leads to
    4149//              electron or gamma in SelectGamma()
    4250//
    43 //        21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
    44 //              i) added G4int _nucleusZ initialise it through the constructor
    45 //              ii) modified SelectGamma() to allow the generation of conversion electrons     
    46 //              iii) added #include G4AtomicShells.hh
    47 //     
    48 //        15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
    49 //              Added creation time evaluation for products of evaporation
     51//        19 April 2010, J. M. Quesada.
     52//              Corrections added for taking into account mismatch between tabulated
     53//              gamma energies and level energy differences (fake photons eliminated)
     54//
     55//        9 May 2010, V.Ivanchenko
     56//              Removed unphysical corretions of gamma energy; fixed default particle
     57//              as gamma; do not subtract bounding energy in case of electron emmision
    5058//     
    5159// -------------------------------------------------------------------
     
    5563#include "G4RandGeneralTmp.hh"
    5664#include "G4AtomicShells.hh"
     65//JMQ:
     66#include "G4NuclearLevelStore.hh"
     67#include "G4Pow.hh"
    5768
    5869G4DiscreteGammaTransition::G4DiscreteGammaTransition(const G4NuclearLevel& level):
     
    6071{ }
    6172
    62 G4DiscreteGammaTransition::G4DiscreteGammaTransition(const G4NuclearLevel& level, G4int Z):
     73//JMQ: now A is also needed in the constructor
     74//G4DiscreteGammaTransition::G4DiscreteGammaTransition(const G4NuclearLevel& level, G4int Z):
     75G4DiscreteGammaTransition::G4DiscreteGammaTransition(const G4NuclearLevel& level, G4int Z, G4int A):
    6376  _nucleusZ(Z), _orbitE(-1), _bondE(0.), _aGamma(true), _icm(false), _gammaEnergy(0.),
    64   _level(level), _excitation(0.),  _gammaCreationTime(0.)
     77  _level(level), _excitation(0.),  _gammaCreationTime(0.),_A(A),_Z(Z)
    6578{
    6679  _verbose = 0;
     80  //JMQ: added tolerence in the mismatch
     81  _tolerance = CLHEP::keV;
    6782}
    6883
     
    7489void G4DiscreteGammaTransition::SelectGamma()
    7590{
    76 
     91  // default gamma
     92  _aGamma = true;   
    7793  _gammaEnergy = 0.;
    78 
     94 
    7995  G4int nGammas = _level.NumberOfGammas();
    8096  if (nGammas > 0)
    8197    {
    8298      G4double random = G4UniformRand();
    83 
    84       G4int iGamma = 0;
    85       for(iGamma=0;iGamma < nGammas;iGamma++)
     99     
     100      G4int iGamma;
     101      for(iGamma=0; iGamma<nGammas; ++iGamma)
    86102        {
    87103          if(random <= (_level.GammaCumulativeProbabilities())[iGamma])
    88             break;
     104            { break; }
    89105        }
    90 
    91 
     106     
    92107      // Small correction due to the fact that there are mismatches between
    93108      // nominal level energies and emitted gamma energies
    94 
    95       G4double eCorrection = _level.Energy() - _excitation;
    96 
     109     
     110      // 09.05.2010 VI : it is an error ?
     111      G4double eCorrection = _level.Energy() - _excitation;     
    97112      _gammaEnergy = (_level.GammaEnergies())[iGamma] - eCorrection;
    98 
     113           
     114      //JMQ:
     115      //1)If chosen gamma energy is close enough to excitation energy, the later
     116      //  is used instead for gamma dacey to gs (it guarantees energy conservation)
     117      //2)For energy conservation, level energy differences instead of  tabulated
     118      //  gamma energies must be used (origin of final fake photons)
     119     
     120      if(_excitation - _gammaEnergy < _tolerance)     
     121        {
     122          _gammaEnergy =_excitation;
     123        }
     124      else
     125        {               
     126          _levelManager = G4NuclearLevelStore::GetInstance()->GetManager(_Z,_A);
     127          _gammaEnergy = _excitation -
     128            _levelManager->NearestLevel(_excitation - _gammaEnergy)->Energy();
     129        }
     130     
    99131      //  Warning: the following check is needed to avoid loops:
    100132      //  Due essentially to missing nuclear levels in data files, it is
     
    106138      //          but this change needs a more complex revision of actual design.
    107139      //          I leave this for a later revision.
    108 
    109       if (_gammaEnergy < _level.Energy()*10e-5) _gammaEnergy = _excitation;
     140     
     141      if (_gammaEnergy < _level.Energy()*10.e-5) _gammaEnergy = _excitation;
     142
     143      //G4cout << "G4DiscreteGammaTransition::SelectGamma: " << _gammaEnergy
     144      //             << " _icm: " << _icm << G4endl;
     145
    110146      // now decide whether Internal Coversion electron should be emitted instead
    111147      if (_icm) {
     
    144180              }
    145181            }
    146             if (_verbose > 0)
     182            _bondE = G4AtomicShells::GetBindingEnergy(_nucleusZ, iShell);
     183            if (_verbose > 0) {
    147184              G4cout << "G4DiscreteGammaTransition: _nucleusZ = " <<_nucleusZ
    148185                     << " , iShell = " << iShell 
    149                      << " , Shell binding energy = " << G4AtomicShells::GetBindingEnergy(_nucleusZ, iShell) / keV
     186                     << " , Shell binding energy = " << _bondE/keV
    150187                     << " keV " << G4endl;
    151             _bondE = G4AtomicShells::GetBindingEnergy(_nucleusZ, iShell);
    152             _gammaEnergy = _gammaEnergy - _bondE;
     188            }
     189
     190            // 09.05.2010 VI : it is an error - cannot subtract bond energy from
     191            //                 transition energy here
     192            //_gammaEnergy = _gammaEnergy - _bondE;
     193            //G4cout << "_gammaEnergy = " << _gammaEnergy << G4endl;
     194
    153195            _orbitE = iShell;     
    154196            _aGamma = false ;   // emitted is not a gamma now
    155197          }
    156198      }
    157    
    158       G4double tau = _level.HalfLife() / std::log(2.0);
    159 
    160       G4double tMin = 0;
    161       G4double tMax = 10.0 * tau;
     199     
     200      G4double tau = _level.HalfLife() / G4Pow::GetInstance()->logZ(2);
     201
     202      //09.05.2010 VI rewrite samling of decay time
     203      //              assuming ordinary exponential low
     204      _gammaCreationTime = 0.;     
     205      if(tau > 0.0) {  _gammaCreationTime = -tau*log(G4UniformRand()); }
     206
     207      //G4double tMin = 0;
     208      //G4double tMax = 10.0 * tau;
    162209      //  Original code, not very efficent
    163210      //  G4int nBins = 200;
     
    172219      //  G4RandGeneralTmp randGeneral(sampleArray, nBins);
    173220      //G4double random = randGeneral.shoot();
    174  
     221     
    175222      //_gammaCreationTime = tMin + (tMax - tMin) * random;
    176223
    177224      // new code by Fan Lei
    178225      //
     226      /*
    179227      if (tau != 0 )
    180228      {
     
    186234          //       << _gammaCreationTime/second << G4endl;
    187235       } else { _gammaCreationTime=0.; }
     236      */
    188237    }
    189238  return;
    190239}
    191240
    192 
    193 //G4bool G4DiscreteGammaTransition::IsAGamma()
    194 //{
    195 //  return _aGamma;
    196 //}
    197 
    198 
    199241G4double G4DiscreteGammaTransition::GetGammaEnergy()
    200242{
     
    210252{
    211253  _excitation = energy;
    212   return;
    213 }
    214 
    215 
    216 
    217 
    218 
    219 
     254}
     255
     256
     257
     258
     259
     260
Note: See TracChangeset for help on using the changeset viewer.