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

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/de_excitation/ablation/include/G4WilsonAblationModel.hh

    r819 r1228  
    4040// MODULE:              G4WilsonAblationModel.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
     
    5858// Beta release
    5959//
     60// 08 December 2009, P R Truscott, QinetiQ Ltd, UK
     61// Ver 1.0
     62// Introduced vector of evaporation channels and evaporation factory.  Also
     63// copied directly over the SumProbabilities class in G4Evaporation.hh at
     64// version 9.2.r9, just in cases there's any subtle differences.  See .cc
     65// file comments to see impact of the rest of the changes.
     66//
    6067// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    6168////////////////////////////////////////////////////////////////////////////////
     
    6774#include "G4ParticleDefinition.hh"
    6875#include "globals.hh"
     76#include "G4VEvaporationFactory.hh"
     77#include "G4EvaporationFactory.hh"
     78
    6979
    7080#include <vector>
     
    99109    VectorOfFragmentTypes  evapType;
    100110
    101     class SumProbabilities :
    102       public std::binary_function<G4double,G4double,G4double>
    103     {
    104       public:
    105         SumProbabilities() : total(0.0) {}
    106         G4double operator() (G4double& /* probSoFar */, G4VEvaporationChannel*& frag)
    107         {
    108           total += frag->GetEmissionProbability();
    109           return total;
    110         }
     111    std::vector<G4VEvaporationChannel*> * theChannels;
     112    G4VEvaporationFactory * theChannelFactory;
    111113
    112         G4double GetTotal() { return total; }
    113       public:
    114       G4double total;
     114  class SumProbabilities : public std::binary_function<G4double,G4double,G4double>
     115  {
     116  public:
     117    SumProbabilities() : total(0.0) {}
     118    G4double operator() (G4double& /* probSoFar */, G4VEvaporationChannel*& frag)
     119    {
     120      G4double temp_prob = frag->GetEmissionProbability();
     121      if(temp_prob >= 0.0) total += temp_prob;
     122      //      total += frag->GetEmissionProbability();
     123      return total;
     124    }
     125   
     126    G4double GetTotal() { return total; }
     127  public:
     128    G4double total;
     129   
    115130  };
    116                                                                                
    117 
    118131
    119132};
  • trunk/source/processes/hadronic/models/de_excitation/ablation/src/G4WilsonAblationModel.cc

    r819 r1228  
    3838// MODULE:              G4WilsonAblationModel.cc
    3939//
    40 // Version:             B.1
    41 // Date:                15/04/04
     40// Version:             1.0
     41// Date:                08/12/2009
    4242// Author:              P R Truscott
    4343// Organisation:        QinetiQ Ltd, UK
     
    5656// Beta release
    5757//
     58// 08 December 2009, P R Truscott, QinetiQ Ltd, UK
     59// Ver 1.0
     60// Updated as a result of changes in the G4Evaporation classes.  These changes
     61// affect mostly SelectSecondariesByEvaporation, and now you have variables
     62// associated with the evaporation model which can be changed:
     63//    OPTxs to select the inverse cross-section
     64//    OPTxs = 0      => Dostrovski's parameterization
     65//    OPTxs = 1 or 2 => Chatterjee's paramaterization
     66//    OPTxs = 3 or 4 => Kalbach's parameterization
     67//    useSICB        => use superimposed Coulomb Barrier for inverse cross
     68//                      sections
     69// Other problem found with G4Fragment definition using Lorentz vector and
     70// **G4ParticleDefinition**.  This does not allow A and Z to be defined for the
     71// fragment for some reason.  Now the fragment is defined more explicitly:
     72//    G4Fragment *fragment = new G4Fragment(A, Z, lorentzVector);
     73// to avoid this quirk.  Bug found in SelectSecondariesByDefault: *type is now
     74// equated to evapType[i] whereas previously it was equated to fragType[i].
     75//
    5876// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    5977////////////////////////////////////////////////////////////////////////////////
     
    123141//
    124142  verboseLevel = 0;
     143  theChannelFactory = new G4EvaporationFactory();
     144  theChannels = theChannelFactory->GetChannel();
     145//
     146//
     147// Set defaults for evaporation classes.  These can be overridden by user
     148// "set" methods.
     149//
     150  OPTxs   = 3;
     151  useSICB = false;
    125152}
    126153////////////////////////////////////////////////////////////////////////////////
    127154//
    128155G4WilsonAblationModel::~G4WilsonAblationModel()
    129 {;}
     156{
     157  if (theChannels != 0) theChannels = 0;
     158  if (theChannelFactory != 0) delete theChannelFactory;
     159}
    130160////////////////////////////////////////////////////////////////////////////////
    131161//
     
    207237  G4int DAabl = (G4int) (ex / B);
    208238  if (DAabl > A) DAabl = A;
    209   if (verboseLevel >= 2)
    210     G4cout <<"Number of nucleons ejected = " <<DAabl <<G4endl;
     239// The following lines are no longer accurate given we now treat the final fragment
     240//  if (verboseLevel >= 2)
     241//    G4cout <<"Number of nucleons ejected = " <<DAabl <<G4endl;
    211242
    212243//
     
    219250  if (AF > 0)
    220251  {
    221     G4double AFd = static_cast<G4double>(AF);
     252    G4double AFd = (G4double) AF;
    222253    G4double R = 11.8 / std::pow(AFd, 0.45);
    223254    G4int minZ = Z - DAabl;
     
    253284  }
    254285  G4int DZabl = Z - ZF;
    255   if (verboseLevel >= 2)
    256     G4cout <<"Final fragment      A=" <<AF
    257            <<", Z=" <<ZF
    258            <<G4endl;
    259286//
    260287//
     
    285312      DAabl -= (G4int) (n * type->GetBaryonNumber() + 1.0E-10);
    286313      DZabl -= (G4int) (n * type->GetPDGCharge() + 1.0E-10);
    287       if (verboseLevel >= 2)
    288         G4cout <<"Particle type: " <<std::setw(10) <<type->GetParticleName()
    289                <<", number of particles emitted = " <<n
    290                <<G4endl;
    291     }
    292   }
    293 //
    294 //
    295 // Determine the properties of the final nuclear fragment.
     314    }
     315  }
     316//
     317//
     318// Determine the properties of the final nuclear fragment.  Note that if
     319// the final fragment is predicted to have a nucleon number of zero, then
     320// really it's the particle last in the vector evapType which becomes the
     321// final fragment.  Therefore delete this from the vector if this is the
     322// case.
    296323//
    297324  G4double massFinalFrag = 0.0;
    298   if (AF > 0.0)
     325  if (AF > 0)
    299326    massFinalFrag = G4ParticleTable::GetParticleTable()->GetIonTable()->
    300327      GetIonMass(ZF,AF);
     328  else
     329  {
     330    G4ParticleDefinition *type = evapType[evapType.size()-1];
     331    AF                         = type->GetBaryonNumber();
     332    ZF                         = (G4int) (type->GetPDGCharge() + 1.0E-10);
     333    evapType.erase(evapType.end()-1);
     334  }
    301335  totalEpost   += massFinalFrag;
    302336//
     337//
     338// Provide verbose output on the nuclear fragment if requested.
     339//
     340  if (verboseLevel >= 2)
     341  {
     342    G4cout <<"Final fragment      A=" <<AF
     343           <<", Z=" <<ZF
     344           <<G4endl;
     345    for (G4int ift=0; ift<nFragTypes; ift++)
     346    {
     347      G4ParticleDefinition *type = fragType[ift];
     348      G4int n                    = std::count(evapType.begin(),evapType.end(),type);
     349      if (n > 0)
     350        G4cout <<"Particle type: " <<std::setw(10) <<type->GetParticleName()
     351               <<", number of particles emitted = " <<n <<G4endl;
     352    }
     353  }
    303354//
    304355// Add the total energy from the fragment.  Note that the fragment is assumed
     
    326377      SelectSecondariesByDefault(G4ThreeVector(0.0,0.0,0.0));
    327378  }
     379
    328380  if (AF > 0)
    329381  {
     
    352404    G4int ie = 0;
    353405    G4FragmentVector::iterator iter;
    354     for (iter = fragmentVector->begin(); iter != fragmentVector->end(); ++iter)
     406    for (iter = fragmentVector->begin(); iter != fragmentVector->end(); iter++)
    355407    {
    356408      if (ie == nEvap)
    357409      {
    358         G4cout <<*iter  <<G4endl;
     410//        G4cout <<*iter  <<G4endl;
    359411        G4cout <<"---------------------------------" <<G4endl;
    360412        G4cout <<"Particles from default emission :" <<G4endl;
     
    375427  (G4Fragment *intermediateNucleus)
    376428{
     429  G4Fragment theResidualNucleus = *intermediateNucleus;
    377430  G4bool evaporate = true;
    378431  while (evaporate && evapType.size() != 0)
     
    386439    std::vector <G4VEvaporationChannel*>  theChannels;
    387440    theChannels.clear();
     441    std::vector <G4VEvaporationChannel*>::iterator i;
    388442    VectorOfFragmentTypes::iterator iter;
    389443    std::vector <VectorOfFragmentTypes::iterator> iters;
     
    393447    {
    394448      theChannels.push_back(new G4AlphaEvaporationChannel);
     449      i = theChannels.end() - 1;
     450      (*i)->SetOPTxs(OPTxs);
     451      (*i)->UseSICB(useSICB);
     452//      (*i)->Initialize(theResidualNucleus);
    395453      iters.push_back(iter);
    396454    }
     
    399457    {
    400458      theChannels.push_back(new G4He3EvaporationChannel);
     459      i = theChannels.end() - 1;
     460      (*i)->SetOPTxs(OPTxs);
     461      (*i)->UseSICB(useSICB);
     462//      (*i)->Initialize(theResidualNucleus);
    401463      iters.push_back(iter);
    402464    }
     
    405467    {
    406468      theChannels.push_back(new G4TritonEvaporationChannel);
     469      i = theChannels.end() - 1;
     470      (*i)->SetOPTxs(OPTxs);
     471      (*i)->UseSICB(useSICB);
     472//      (*i)->Initialize(theResidualNucleus);
    407473      iters.push_back(iter);
    408474    }
     
    411477    {
    412478      theChannels.push_back(new G4DeuteronEvaporationChannel);
     479      i = theChannels.end() - 1;
     480      (*i)->SetOPTxs(OPTxs);
     481      (*i)->UseSICB(useSICB);
     482//      (*i)->Initialize(theResidualNucleus);
    413483      iters.push_back(iter);
    414484    }
     
    417487    {
    418488      theChannels.push_back(new G4ProtonEvaporationChannel);
     489      i = theChannels.end() - 1;
     490      (*i)->SetOPTxs(OPTxs);
     491      (*i)->UseSICB(useSICB);
     492//      (*i)->Initialize(theResidualNucleus);
    419493      iters.push_back(iter);
    420494    }
     
    423497    {
    424498      theChannels.push_back(new G4NeutronEvaporationChannel);
     499      i = theChannels.end() - 1;
     500      (*i)->SetOPTxs(OPTxs);
     501      (*i)->UseSICB(useSICB);
     502//      (*i)->Initialize(theResidualNucleus);
    425503      iters.push_back(iter);
    426504    }
     
    479557  for (unsigned i=0; i<evapType.size(); i++)
    480558  {
    481     G4ParticleDefinition *type = fragType[i];
     559    G4ParticleDefinition *type = evapType[i];
    482560    G4double mass              = type->GetPDGMass();
    483561    G4double e                 = mass + 10.0*eV;
     
    489567    G4LorentzVector lorentzVector = G4LorentzVector(direction*p, e);
    490568    lorentzVector.boost(-boost);
     569// Possibility that the following line is not correctly carrying over A and Z
     570// from particle definition.  Force values.  PRT 03/12/2009.
     571//    G4Fragment *fragment          =
     572//      new G4Fragment(lorentzVector, type);
     573    G4int A = type->GetBaryonNumber();
     574    G4int Z = (G4int) (type->GetPDGCharge() + 1.0E-10);
    491575    G4Fragment *fragment          =
    492       new G4Fragment(lorentzVector, type);
     576      new G4Fragment(A, Z, lorentzVector);
     577
    493578    fragmentVector->push_back(fragment);
    494579  }
Note: See TracChangeset for help on using the changeset viewer.